Retreive an attribute from the C{proto} parameter.
977284
def fromBox(self, name, strings, objects, proto):
        
        objects[name] = getattr(proto, self.attr)
881249
def to_proto(self):
    """"""
    # Return the proto.SplitInfo, sorted by name
    return sorted((s.get_proto() for s in self.values()), key=lambda s: s.name)
386264
def unpack_attribute(att):
    """"""
    if att.unsigned:
        log.warning('Unsupported unsigned attribute!')

    # TDS 5.0 now has a dataType attribute that takes precedence
    if att.len == 0:  # Empty
        val = None
    elif att.dataType == stream.STRING:  # Then look for new datatype string
        val = att.sdata
    elif att.dataType:  # Then a non-zero new data type
        val = np.frombuffer(att.data,
                            dtype='>' + _dtypeLookup[att.dataType], count=att.len)
    elif att.type:  # Then non-zero old-data type0
        val = np.frombuffer(att.data,
                            dtype=_attrConverters[att.type], count=att.len)
    elif att.sdata:  # This leaves both 0, try old string
        val = att.sdata
    else:  # Assume new datatype is Char (0)
        val = np.array(att.data, dtype=_dtypeLookup[att.dataType])

    if att.len == 1:
        val = val[0]

    return att.name, val
618751
function attr(proto, attrName) {
    var metadataManager = Vessel$$1.$container.get('@metadata_manager'), className = proto.getClassName();
    metadataManager.setAttribute(className, attrName);
}
1195012
def attribute(func):
    """"""
    attr = abc.abstractmethod(func)
    attr.__iattribute__ = True
    attr = _property(attr)
    return attr
1250438
def on_attribute(self, node):    # ('value', 'attr', 'ctx')
        """"""
        ctx = node.ctx.__class__
        if ctx == ast.Store:
            msg = "attribute for storage: shouldn't be here!"
            self.raise_exception(node, exc=RuntimeError, msg=msg)

        sym = self.run(node.value)
        if ctx == ast.Del:
            return delattr(sym, node.attr)

        # ctx is ast.Load
        fmt = "cannnot access attribute '%s' for %s"
        if node.attr not in UNSAFE_ATTRS:
            fmt = "no attribute '%s' for %s"
            try:
                return getattr(sym, node.attr)
            except AttributeError:
                pass

        # AttributeError or accessed unsafe attribute
        obj = self.run(node.value)
        msg = fmt % (node.attr, obj)
        self.raise_exception(node, exc=AttributeError, msg=msg)
338518
def getattrdeep(obj, attr, *default):
    ''
    attrs = attr.split('.')
    if default:
        getattr_default = lambda o,a,d=default[0]: getattr(o, a, d)
    else:
        getattr_default = lambda o,a: getattr(o, a)

    for a in attrs[:-1]:
        obj = getattr_default(obj, a)

    return getattr_default(obj, attrs[-1])
679822
def _parse_attr(self, line):
        """"""
        colon_pos = line.index(b':')
        attr_type = line[0:colon_pos].decode('ascii')

        if line[colon_pos:].startswith(b'::'):
            attr_value = base64.decodestring(line[colon_pos + 2:])
        elif line[colon_pos:].startswith(b':<'):
            url = line[colon_pos + 2:].strip()
            attr_value = b''
            if self._process_url_schemes:
                u = urlparse(url)
                if u[0] in self._process_url_schemes:
                    attr_value = urlopen(url.decode('ascii')).read()
        else:
            attr_value = line[colon_pos + 1:].strip()

        return self._decode_value(attr_type, attr_value)
564734
def getAttributeNode(self, attr: str) -> Optional[Attr]:
        
        return self.attributes.getNamedItem(attr)
1275760
def p_Attribute(p):
  
  p[0] = model.Attribute(inherit=p[1], readonly=p[2], type=p[4], name=p[5])
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
1057336
def get_attr(obj, string_rep, default=_get_attr_raise_on_attribute_error, separator="."):
    
    attribute_chain = string_rep.split(separator)

    current_obj = obj

    for attr in attribute_chain:
        try:
            current_obj = getattr(current_obj, attr)
        except AttributeError:
            if default is _get_attr_raise_on_attribute_error:
                raise AttributeError(
                    "Bad attribute \"{}\" in chain: \"{}\"".format(attr, string_rep)
                )
            return default

    return current_obj
1267970
def igetattr(self, attrname, context=None):
        
        if attrname == "start":
            yield self._wrap_attribute(self.lower)
        elif attrname == "stop":
            yield self._wrap_attribute(self.upper)
        elif attrname == "step":
            yield self._wrap_attribute(self.step)
        else:
            yield from self.getattr(attrname, context=context)
1323741
def do_attr_any(self, element, decl, pseudo):
        """"""
        step = self.state[self.state['current_step']]
        actions = step['actions']
        strval = self.eval_string_value(element, decl.value)
        actions.append(('attrib', (decl.name[5:], strval)))
470874
def _get_attribute_tensors(onnx_model_proto):  # type: (ModelProto) -> Iterable[TensorProto]
    """"""
    for node in onnx_model_proto.graph.node:
        for attribute in node.attribute:
            if attribute.HasField("t"):
                yield attribute.t
            for tensor in attribute.tensors:
                yield tensor
969338
def get(self, name, strict=True):
        """"""
        if not isinstance(name, str) or name.startswith('_'):
            raise AttributeError(self.__class__.__name__, name)
        elif strict and name not in self._possible_attributes:
            raise AttributeError('%s is not a valid attribute of %r.' %
                                 (name, self))
        elif name in self._attributes:
            return self._attributes[name]
        else:
            raise exceptions.AttributeNotProvided(name)
923414
def getrec(self, name, include_self=True, *default):
        """"""
        for node in self.iter_up(include_self):
            try:
                return getattr(node, name)
            except AttributeError: pass
            
        if default:
            return default[0]
        else:
            raise AttributeError(name)