A one-shot access to hidden properties (the field is then destroyed)

        :return: A copy of the hidden properties dictionary on the first call
        :raise AttributeError: On any call after the first one
495609
def grab_hidden_properties(self):
        # type: () -> dict
        
        # Copy properties
        result = self.__hidden_properties.copy()

        # Destroy the field
        self.__hidden_properties.clear()
        del self.__hidden_properties
        return result
552336
def _reset(self, name=None):
        
        if name is None:
            for key in self._props:
                if isinstance(self._props[key], basic.Property):
                    self._reset(key)
            return
        if name not in self._props:
            raise AttributeError("Input name '{}' is not a known "
                                 "property or attribute".format(name))
        if not isinstance(self._props[name], basic.Property):
            raise AttributeError("Cannot reset GettableProperty "
                                 "'{}'".format(name))
        if name in self._defaults:
            val = self._defaults[name]
        else:
            val = self._props[name].default
        if callable(val):
            val = val()
        setattr(self, name, val)
606322
def natural_key(self):
        
        # Recursively extract properties from related objects if needed
        vals = [reduce(getattr, name.split('__'), self)
                for name in self.get_natural_key_fields()]
        return vals
1021539
def init_running_properties(self):
        
        for prop, entry in list(self.__class__.running_properties.items()):
            val = entry.default
            # Make a copy of the value for complex iterable types
            # As such, each instance has its own copy and not a simple reference
            setattr(self, prop, copy(val) if isinstance(val, (set, list, dict)) else val)
751767
def _cached(f):
    

    attr_name = '_cached_' + f.__name__

    def wrapper(obj, *args, **kwargs):
        if not hasattr(obj, attr_name):
            setattr(obj, attr_name, f(obj, *args, **kwargs))
        return getattr(obj, attr_name)
    return wrapper
963714
def derive_readonly(self):
        
        readonly = list(self.readonly)
        for key, value in self.field_config.items():
            if 'readonly' in value and value['readonly']:
                readonly.append(key)

        return readonly
675953
def _parse_properties(self):
        
        props_dict = self.data.get('properties', {})
        for prop_name in self.KNOWN_PROPERTIES:
            if prop_name in props_dict:
                setattr(self, prop_name, props_dict.get(prop_name))
            else:
                setattr(self, prop_name, None)
1344395
def persistent_object_context_changed(self):
        
        super().persistent_object_context_changed()

        def source_registered(source):
            self.__source = source

        def source_unregistered(source=None):
            pass

        def reference_registered(property_name, reference):
            self.__referenced_objects[property_name] = reference

        def reference_unregistered(property_name, reference=None):
            pass

        if self.persistent_object_context:
            self.persistent_object_context.subscribe(self.source_uuid, source_registered, source_unregistered)

            for property_name, value in self.__properties.items():
                if isinstance(value, dict) and value.get("type") in {"data_item", "display_item", "data_source", "graphic", "structure"} and "uuid" in value:
                    self.persistent_object_context.subscribe(uuid.UUID(value["uuid"]), functools.partial(reference_registered, property_name), functools.partial(reference_unregistered, property_name))
        else:
            source_unregistered()

            for property_name, value in self.__properties.items():
                if isinstance(value, dict) and value.get("type") in {"data_item", "display_item", "data_source", "graphic", "structure"} and "uuid" in value:
                    reference_unregistered(property_name)
948035
def getattr(self, key):
		
		if key in _MethodFactoryMeta[self.classId]:
			""" property exists """
			return self.__dict__[key]
		else:
			""" property does not exist """
			return None
455461
def private_props(obj):
    
    # Get private properties but NOT magic methods
    props = [item for item in dir(obj)]
    priv_props = [_PRIVATE_PROP_REGEXP.match(item) for item in props]
    call_props = [callable(getattr(obj, item)) for item in props]
    iobj = zip(props, priv_props, call_props)
    for obj_name in [prop for prop, priv, call in iobj if priv and (not call)]:
        yield obj_name
381983
def dict(self):
        
        SKIP_KEYS = ('_source_table', '_dest_table', 'd_vid', 't_vid', 'st_id',
                     'dataset', 'hash', 'process_records')
        return OrderedDict([(k, getattr(self, k)) for k in self.properties if k not in SKIP_KEYS])
564987
def get(self):
        
        if not hasattr(self, '_instance'):
            raise ImplementationError("Impossible to get the PK of an unbound field")
        if not hasattr(self._instance, '_pk'):
            raise DoesNotExist("The current object doesn't exists anymore")

        if not self._instance._pk:
            self.set(value=None)

        return self.normalize(self._instance._pk)
1336957
def export_deleted_fields(self):
        
        result = self.__deleted_fields__.copy()

        for key, value in self.__original_data__.items():
            if key in result:
                continue
            try:
                partial = value.export_deleted_fields()
                result.extend(['.'.join([key, key2]) for key2 in partial])
            except AttributeError:
                pass

        return result
237767
def copy(self):
        
        c = copy.copy(self)
        c._fieldDict = c._fieldDict.copy()
        return c
963315
def get_readonly_fields(self, request, obj=None):
        

        # Get read only fields from super
        fields = list(super(CreateUpdateAdmin, self).get_readonly_fields(
            request=request, obj=obj))

        # Loop over ownership info field
        for k, v in self.ownership_info['fields'].items():

            # Check if model has k attribute
            # and field k is readonly
            # and k is not already in fields
            # and k is not in excluded field
            # (if not checked, form.Meta.exclude has same field twice)
            if (hasattr(self.model, k)
                    and ('readonly' in v and v['readonly'])
                    and k not in fields
                    and (not self.exclude
                         or (self.exclude and k not in self.exclude))):
                fields.append(k)
        return tuple(fields)
990473
def accessible(f):
    
    @wraps(f)
    def wrapper(*args, **kwargs):
        print 'KWARGS= ', kwargs
        setattr(args[0], kwargs['name'], args[1])
        print "property: ", str(getattr(args[0], kwargs['name']))
        return f(*args, **kwargs)
    return wrapper
710397
def dirty_ops(self, instance):
        ''' '''
        obj_value = instance._values[self._name]
        if not obj_value.set:
            return {}

        if not obj_value.dirty and self.__type.config_extra_fields != 'ignore':
            return {}

        ops = obj_value.value.get_dirty_ops()

        ret = {}
        for op, values in ops.items():
            ret[op] = {}
            for key, value in values.items():
                name = '%s.%s' % (self._name, key)
                ret[op][name] = value
        return ret