provide a copy of this player's attributes as a dictionary
979602
def attrs(self):
        """"""
        ret = dict(self.__dict__) # obtain copy of internal __dict__
        del ret["_matches"] # match history is specifically distinguished from player information (and stored separately)
        if self.type != c.COMPUTER: # difficulty only matters for computer playres
            del ret["difficulty"]
        return ret
922447
def save(self):
        
        return dict(code=self.code, name=self.name, abilities=self.abilities,
                    attributes=self.attributes, info=self.info)
231155
def to_dict(self, copy=False):
        
        new_dict = {}
        for attr, value in self:
            if copy:
                value = deepcopy(value)
            new_dict[attr] = value

        return new_dict
1230539
def as_dict(self):
        ''''''
        pk = self.pk
        id_type = 3
        if pk.type == 'auto':
            id_type = 1
        return {'id_name': pk.name,
                'id_type': id_type,
                'sorted': bool(self.ordering),
                'autoincr': self.ordering and self.ordering.auto,
                'multi_fields': [field.name for field in self.multifields],
                'indices': dict(((idx.attname, idx.unique)
                                 for idx in self.indices))}
1149812
def obj_to_dict(cls, obj):
        
        data = {}
        for field_name in cls.get_fields():
            try:
                value = getattr(obj, field_name)
            except AttributeError:
                # If the field doesn't exist on the object, fail gracefully
                # and don't include the field in the data dict at all. Fail
                # loudly if the field exists but produces a different error
                # (edge case: accessing an *existing* field could technically
                # produce an unrelated AttributeError).
                continue

            if callable(value):
                value = value()
            data[field_name] = value

        return data
885148
def copy(self):
        """"""
        new_dict = IDict(std=self._std)
        new_dict.update(self.store)
        return new_dict
205679
def attributes_dict(self):
        
        h = {}
        for k in self.attributes.keys():
            h[k] = getattr(self, k)
        for k in self.lists.keys():
            h[k] = getattr(self, k)
        for k in self.references.keys():
            h[k] = getattr(self, k)
        return h
417532
def as_dict(self):
        """"""
        dicts = [x.as_dict for x in self.children]
        return {'{0} {1}'.format(self.name, self.value): dicts}
16554
def as_dictionary(self):
        """"""
        values = {
            'id': self._id,
            'type': self._type
        }

        if self._owner:
            values['owner'] = self._owner
        return values
367679
def get_obj_attrs(obj):
    
    pr = {}
    if obj is not None:
        if isinstance(obj, numpy.core.records.record):
            for name in obj.dtype.names:
                pr[name] = getattr(obj, name)
        elif hasattr(obj, '__dict__') and obj.__dict__:
            pr = obj.__dict__
        elif hasattr(obj, '__slots__'):
            for slot in obj.__slots__:
                if hasattr(obj, slot):
                    pr[slot] = getattr(obj, slot)
        elif isinstance(obj, dict):
            pr = obj.copy()
        else:
            for name in dir(obj):
                try:
                    value = getattr(obj, name)
                    if not name.startswith('__') and not inspect.ismethod(value):
                        pr[name] = value
                except:
                    continue

    return pr
1105119
def _to_dict(self):
        """"""
        _dict = {}
        if hasattr(self, 'name') and self.name is not None:
            _dict['name'] = self.name
        if hasattr(self, 'action_type') and self.action_type is not None:
            _dict['type'] = self.action_type
        if hasattr(self, 'parameters') and self.parameters is not None:
            _dict['parameters'] = self.parameters
        if hasattr(self,
                   'result_variable') and self.result_variable is not None:
            _dict['result_variable'] = self.result_variable
        if hasattr(self, 'credentials') and self.credentials is not None:
            _dict['credentials'] = self.credentials
        return _dict
476355
def attributes(self):
        
        return dict([(name, getattr(self, name)) for (name, _) in self.format.values() if name is not None and not name.startswith('_')])
1366304
def as_dict(self):
        
        d = {}
        _add_value(d, 'obstory_ids', self.obstory_ids)
        _add_string(d, 'field_name', self.field_name)
        _add_value(d, 'lat_min', self.lat_min)
        _add_value(d, 'lat_max', self.lat_max)
        _add_value(d, 'long_min', self.long_min)
        _add_value(d, 'long_max', self.long_max)
        _add_value(d, 'time_min', self.time_min)
        _add_value(d, 'time_max', self.time_max)
        _add_string(d, 'item_id', self.item_id)
        _add_value(d, 'skip', self.skip)
        _add_value(d, 'limit', self.limit)
        _add_boolean(d, 'exclude_imported', self.exclude_imported)
        _add_string(d, 'exclude_export_to', self.exclude_export_to)
        return d
770298
def getKnownPlayers(reset=False):
    """"""
    global playerCache
    if not playerCache or reset:
        jsonFiles = os.path.join(c.PLAYERS_FOLDER, "*.json")
        for playerFilepath in glob.glob(jsonFiles):
            filename = os.path.basename(playerFilepath)
            name = re.sub("^player_", "", filename)
            name = re.sub("\.json$",  "", name)
            player = PlayerRecord(name)
            playerCache[player.name] = player
    return playerCache
740225
def _model_to_dict(obj):
        
        result = _properties_model_to_dict(obj.properties)
        for attribute in ('metadata', 'snapshot'):
            try:
                value = getattr(obj, attribute)
            except AttributeError:
                continue
            if value:
                result[attribute] = value
        return result
1085857
def as_dict(self):
        
        return dict((f, self[i]) for f, i in self.__field_positions.items())
795363
def to_dict(self, properties=None):
        
        if not properties:
            properties = [p for p in dir(Assay) if isinstance(getattr(Assay, p), property)]
        return {p: getattr(self, p) for p in properties}