Return element of abi (return None if fails to find)
352469
def abi_get_element_by_name(abi, name):
    
    if (abi and "abi" in abi):
        for a in abi["abi"]:
            if ("name" in a and a["name"] == name):
                return a
    return None
1202803
def element(self, inp=None):
        
        if inp is None:
            return self.elements[0]
        elif inp in self.elements:
            return inp
        else:
            raise ValueError('cannot convert inp {} to element in {}'
                             ''.format(inp, self))
1283605
def get_element_by_id(self, ident):
        """"""
        for group in list(self.toc.keys()):
            for name in list(self.toc[group].keys()):
                if self.toc[group][name].ident == ident:
                    return self.toc[group][name]
        return None
919654
def get_parent_element(self):
        """"""
        return {AUDIT_REF_STATE: self.context.audit_record,
                SIGNATURE_REF_STATE: self.context.signature}[self.ref_state]
843941
def Element(self, elem, **params):
        """"""
        res = self.__call__(deepcopy(elem), **params)
        if len(res) > 0: 
            return res[0]
        else:
            return None
35115
def get_one(self, qry, tpl):
        '''  '''
        self.cur.execute(qry + ' LIMIT 1', tpl)
        result = self.cur.fetchone()
        # unpack tuple if it has only
        # one element
        # TODO unpack results
        if type(result) is tuple and len(result) == 1:
            result = result[0]
        return result
662827
function find(doc, element, id) {
  if (!element) {
    element = doc.getElementById(id);
    if (!element) {
      throw new Error('Missing element, id=' + id);
    }
  }
  return element;
}
800328
def get_named_by_definition(cls, element_list, string_def):
        """"""
        try:
            return next(
                (
                    st.value
                    for st in element_list
                    if st.definition == string_def
                )
            )
        except Exception:
            return None
685823
def get_abi_size(self, target_data, context=None):
        
        llty = self._get_ll_pointer_type(target_data, context)
        return target_data.get_pointee_abi_size(llty)
219258
def get_flag(env, var, fallback, expected=True, warn=True):
    """"""
    val = env.config_var(var)
    if val is None:
        if warn:
            warnings.warn(
                "Config variable '{0}' is unset, Python ABI tag may "
                "be incorrect".format(var),
                RuntimeWarning,
                2,
            )
        return fallback()
    return val == expected
523793
def _find(self, root, tagname, id=None):
        """"""
        if id is None:
            result = root.find('.//%s' % tagname)
            if result is None:
                raise LookupError('Cannot find any %s elements' % tagname)
            else:
                return result
        else:
            result = [
                elem for elem in root.findall('.//%s' % tagname)
                if elem.attrib.get('id', '') == id
            ]
            if len(result) == 0:
                raise LookupError('Cannot find a %s element with id %s' % (tagname, id))
            elif len(result) > 1:
                raise LookupError('Found multiple %s elements with id %s' % (tagname, id))
            else:
                return result[0]
119095
def get(self,oid):
		""""""
		try:
			self.lock.acquire()
			if oid not in self.data:
				return "NONE"
			else:
				return self.base_oid + oid + '\n' + self.data[oid]['type'] + '\n' +	str(self.data[oid]['value'])
		finally:
			self.lock.release()
690632
def index element
      rv = 0
      found = @element.find do |child|
        child.kind_of? Element and
        (rv += 1) and
        child == element
      end
      return rv if found == element
      return -1
    end
1276809
def one(self):
        
        return self.element(np.ones(self.shape, dtype=self.dtype,
                                    order=self.default_order))
81004
def _get_list_key(self, obj, key, vc, obj_nex_id=None):
        
        k = obj.get(key)
        if k is None:
            return None
        if isinstance(k, dict):
            k = [k]
        if not isinstance(k, list):
            self._error_event(vc.curr_element_type,
                              obj=obj,
                              err_type=gen_MissingExpectedListWarning,
                              anc=vc.anc_list,
                              obj_nex_id=obj_nex_id,
                              key_list=[key, ])
            return None
        return k
1030371
def _get_element_by_id(self, resource_name, eclass, id):
        """"""
        elements = self._get_elements(resource_name, eclass, id=id)
        if not elements:
            raise ValueError("No resource matching: {0}".format(id))
        if len(elements) == 1:
            return elements[0]
        raise ValueError("Multiple resources matching: {0}".format(id))
991353
def get(self, idx, default=None):
        
        for placeholder in self:
            if placeholder.element.ph_idx == idx:
                return placeholder
        return default