Get an attribute's accessor with the getter and the setter.

        :return: `Accessor` instance.
334247
def accessor(self):
        
        if isinstance(self.attr, Accessor):
            return self.attr

        if callable(self.attr):
            return Accessor(getter=self.attr)

        attr = self.attr or self.name
        return Accessor(getter=attr, setter=attr)
66579
def access(self, name: str, rename: Optional[str] = None) -> 'ProxyAttr':
        
        self.getter(name, rename)
        self.setter(name, rename)
        return self
852518
def getter(name, key=None):
  

  if not key:
    key = lambda x: x

  def wrapper(self):
    return key(getattr(self, name))
  wrapper.__name__ = wrapper.__qualname__ = name
  return property(wrapper)
149180
def attr_accessor_with_default(name, val)
      ivar_sym = "@#{name}"
      define_method name do
        unless instance_variable_defined?(ivar_sym)
          instance_variable_set(ivar_sym, val)
        end
        instance_variable_get ivar_sym
      end
      attr_writer name
    end
463100
def _load_get_attr(self, name):
        ''
        if self._mode in _allowed_read and self._N is None:
            self._read_header()
        return getattr(self, name)
167425
def _original_attr(self, attr_name):
        
        try:
            return getattr(
                getattr(self.obj.__class__, attr_name), '_doubles_target_method', None
            )
        except AttributeError:
            return None
547803
def get_setter(cls, prop_name,  # @NoSelf
                   user_setter=None, setter_takes_name=False,
                   user_getter=None, getter_takes_name=False):
        """"""

        _inner_setter = ObservablePropertyMeta.get_setter(cls, prop_name,
                                            user_setter, setter_takes_name,
                                            user_getter, getter_takes_name)

        def _setter(self, val):
            self._prop_lock.acquire()
            _inner_setter(self, val)
            self._prop_lock.release()
        return _setter
639104
def _getAttr(self, attr):
        
        meth = "_get_%s" % attr
        if not hasattr(self, meth):
            raise AttributeError("No getter for attribute '%s'." % attr)
        meth = getattr(self, meth)
        value = meth()
        return value
1362310
def _setable_get_(name, self):
        ""

        raise AttributeError(
            "'{typename}' object has no attribute '{name}'".format(
                typename=type(self).__name__,
                name=name
            )
        )
1063924
function Accessor()
    {
        if (!$this->accessor)
        {
            $this->accessor = $this->CreateAccessor();
            $this->accessor->LoadCurrent();
        }
        return $this->accessor;
    }
1068112
def _get_fields(self, attr):
        
        ret = set()
        if "OR" in self.pieces:
            return ret
        for i in range(0, len(self.pieces), 2):
            const = self.pieces[i]
            field = getattr(const, attr)
            if field is not None:
                ret.add(field)
        return ret
5394
def source_getattr():
    

    def source_getattr(_value, context, **_params):
        value = getattr(context["model"].source, context["key"])
        return _attr(value)

    return source_getattr
314237
def get(self, **kwargs):
        
        for chain in self.chains:
            for key in kwargs:
                getter_name = "get_"+key
                # scan all possible getters
                if (hasattr(chain, getter_name)):
                    getter = getattr(chain, getter_name) # e.g. "get_address"
                    if (getter() == kwargs[key]):
                        return chain
        return None
464826
def get_attribute(instance, attrs):
    
    for attr in attrs:
        if instance is None:
            # Break out early if we get `None` at any point in a nested lookup.
            return None
        try:
            if isinstance(instance, collections.Mapping):
                instance = instance[attr]
            else:
                instance = getattr(instance, attr)
        except ObjectDoesNotExist:
            return None
        if is_simple_callable(instance):
            try:
                instance = instance()
            except (AttributeError, KeyError) as exc:
                # If we raised an Attribute or KeyError here it'd get treated
                # as an omitted field in `Field.get_attribute()`. Instead we
                # raise a ValueError to ensure the exception is not masked.
                raise ValueError('Exception raised in callable attribute "{0}"; original exception was: {1}'.format(attr, exc))

    return instance
387963
def get_attr(item, name, default=None):
    '''  '''
    try:
        val = item[name]
    except (KeyError, TypeError):
        try:
            val = getattr(item, name)
        except AttributeError:
            val = default
    return val
1077930
def _Getattr(self, t):
        
        if isinstance(t.expr, (Div, Mul, Sub, Add)):
            self._write('(')
            self._dispatch(t.expr)
            self._write(')')
        else:
            self._dispatch(t.expr)
            
        self._write('.'+t.attrname)
730967
def get_instance(self):
        
        try:
            return self._instance
        except AttributeError:
            self._instance = self._decorated()
            return self._instance