Gets a required component reference that matches specified locator.

         :param locator: the locator to find a reference by.

         :return: a matching component reference.

         :raises: a [[ReferenceException]] when no references found.
174101
def get_one_required(self, locator):
        
        components = self.find(locator, True)
        return components[0] if len(components) > 0 else None
517646
def lookup(self, opaque_ref):
        
        opaque_ref_value = self._get_reference_value(opaque_ref)
        # check local refs
        if opaque_ref_value in self.local_refs:
            return self.local_refs[opaque_ref_value]
        # check global refs
        if opaque_ref_value in self.global_refs:
            return self.global_refs[opaque_ref_value]
        raise KeyError("Unknown JNI reference %d. Local references: %s Global references: %s"
                       % (opaque_ref_value, self.local_refs, self.global_refs))
725303
def from_tuple(cls, components: tuple) -> 'ComponentRef':
        

        component_ref = ComponentRef(name=components[0], child=[])
        c = component_ref
        for component in components[1:]:
            c.child.append(ComponentRef(name=component, child=[]))
            c = c.child[0]
        return component_ref
528009
def getReferenceByName(self, name):
        
        if name not in self._referenceNameMap:
            raise exceptions.ReferenceNameNotFoundException(name)
        return self._referenceNameMap[name]
1124046
public Object getComponent(String role, String roleHint) throws ComponentLookupException {
        return container.lookup(role, roleHint);
    }
227883
def getComponent(self, innerFlag=False):
        
        if self._currentIdx is None:
            raise error.PyAsn1Error('Component not chosen')
        else:
            c = self._componentValues[self._currentIdx]
            if innerFlag and isinstance(c, Choice):
                return c.getComponent(innerFlag)
            else:
                return c
1119882
def _findCRefPattern(self, xml):
        
        if not self.citation.is_set():
            citation = xml.xpath("//tei:refsDecl[@n='CTS']", namespaces=XPATH_NAMESPACES)
            if len(citation):
                self.citation = Citation.ingest(resource=citation[0], xpath=".//tei:cRefPattern")
            else:
                raise MissingRefsDecl("No reference declaration (refsDecl) found.")
195348
def put(self, locator = None, component = None):
        
        if component == None:
            raise Exception("Component cannot be null")

        self._lock.acquire()
        try:
            self._references.append(Reference(locator, component))
        finally:
            self._lock.release()
358124
def get_referenced_object(self):
        

        if self._UserPerson is not None:
            return self._UserPerson

        if self._UserCompany is not None:
            return self._UserCompany

        raise exception.BunqException(self._ERROR_NULL_FIELDS)
1346622
def get_element_size(self, locator):
        
        element = self._element_find(locator, True, True)
        element_size = element.size
        self._info("Element '%s' size: %s " % (locator, element_size))
        return element_size
957035
def need_geocoding(self):
        
        need_geocoding = False
        for attribute, component in self.required_address_components.items():
            if not getattr(self, attribute):
                need_geocoding = True
                break  # skip extra loops
        return need_geocoding
385032
def get_one_required(self, name):
        
        locator = self._locate(name)
        if locator == None:
            raise ReferenceException(None, name)
        
        return self._references.get_one_required(locator)
506757
def get_attribute(self, reference):
        
        prefix, _, name = reference.rpartition('.')

        match = None
        for attribute in self._contents:
            if name == attribute.name and \
                    (not prefix or prefix == attribute.prefix):
                if match:
                    raise AttributeReferenceError(
                        'Ambiguous attribute reference: {}.'.format(
                            attribute.name))
                else:
                    match = attribute

        if match:
            return match
        raise AttributeReferenceError(
            'Attribute does not exist: {}'.format(reference))
218440
def lookup_object(spec):
    
    parts, target = spec.split(':') if ':' in spec else (spec, None)
    module = __import__(parts)

    for part in parts.split('.')[1:] + ([target] if target else []):
        module = getattr(module, part)

    return module
895104
public List<Object> getOptional(Object locator) {
		try {
			return find(Object.class, locator, false);
		} catch (Exception ex) {
			return new ArrayList<Object>();
		}
	}
47722
def get_referenced_object(self):
        

        if self._Payment is not None:
            return self._Payment

        if self._PaymentBatch is not None:
            return self._PaymentBatch

        raise exception.BunqException(self._ERROR_NULL_FIELDS)
209006
def get_api_references(self, api_url=None):
        
        # Get subject listing Url for SCO-API
        if not api_url is None:
            url = api_url
        else:
            url = self.api_url
        # Check if API references are in local cache. If not send GET request
        # and add the result to the local cache
        if not url in self.apis:
            self.apis[url] = sco.references_to_dict(
                sco.JsonResource(url).json[sco.REF_LINKS]
            )
        return self.apis[url]