Returns references
516867
def get_references(chebi_ids):
    ''''''
    references = []
    chebi_ids = [str(chebi_id) for chebi_id in chebi_ids]

    filename = get_file('reference.tsv.gz')

    with io.open(filename, 'r', encoding='cp1252') as textfile:
        next(textfile)

        for line in textfile:
            tokens = line.strip().split('\t')

            if tokens[0] in chebi_ids:
                # Append Reference:
                if len(tokens) > 3:
                    ref = Reference(tokens[1], tokens[2], tokens[3],
                                    tokens[4])
                else:
                    ref = Reference(tokens[1], tokens[2])

                references.append(ref)
    return references
1120060
def references_json(references):
    ''' 

    '''

    references_json = []
    for r in references:
        ref = r.ref
        ref['attributes'] = r._to_json_like(include_defaults=False)
        references_json.append(ref)

    return references_json
452526
def getServices(self):
        
        tool = getToolByName(self, REFERENCE_CATALOG)
        services = []
        for spec in self.getReferenceResults():
            service = tool.lookupObject(spec['uid'])
            services.append(service)
        return services
234422
def get(self, instance, aslist=False, **kwargs):
        
        refs = self.get_versioned_references_for(instance)

        if not self.multiValued:
            if len(refs) > 1:
                logger.warning("Found {} references for non-multivalued "
                               "reference field '{}' of {}".format(
                                   len(refs), self.getName(), repr(instance)))
            if not aslist:
                if refs:
                    refs = refs[0]
                else:
                    refs = None

        if not self.referencesSortable or not hasattr(
                aq_base(instance), "at_ordered_refs"):
            return refs

        refs = instance.at_ordered_refs
        order = refs[self.relationship]
        if order is None:
            return refs

        by_uid = dict(map(lambda ob: (api.get_uid(ob), ob), refs))
        return [by_uid[uid] for uid in order if uid in by_uid]
442895
def references(self):
        
        return self.connection.query("""
        SELECT concat('`', table_schema, '`.`', table_name, '`') as referencing_table, column_name
        FROM information_schema.key_column_usage
        WHERE referenced_table_name="{tab}" and referenced_table_schema="{db}"
        """.format(tab=self.table_name, db=self.database), as_dict=True)
841163
def _get_reference(self):
        
        super()._get_reference()
        self.cubeA_body_id = self.sim.model.body_name2id("cubeA")
        self.cubeB_body_id = self.sim.model.body_name2id("cubeB")
        self.l_finger_geom_ids = [
            self.sim.model.geom_name2id(x) for x in self.gripper.left_finger_geoms
        ]
        self.r_finger_geom_ids = [
            self.sim.model.geom_name2id(x) for x in self.gripper.right_finger_geoms
        ]
        self.cubeA_geom_id = self.sim.model.geom_name2id("cubeA")
        self.cubeB_geom_id = self.sim.model.geom_name2id("cubeB")
646201
def reverse_reference(self):
        ''''''
        self.ref_start = self.ref_length - self.ref_start - 1
        self.ref_end = self.ref_length - self.ref_end - 1
695684
def ref(self):
        
        # Clean
        self._refs = [r for r in self._refs if (r() is not None)]
        # Get ref
        ref = self._refs[0]() if self._refs else None
        if ref is not None:
            return ref
        else:
            raise RuntimeError('No reference for available for GLShared')
1197798
def get_backreferences_for(self, instance):
        
        rc = api.get_tool("reference_catalog")
        backreferences = rc.getReferences(instance, self.relationship)
        return map(lambda ref: ref.targetUID, backreferences)
207208
def get_versioned_references_for(self, instance):
        
        vrefs = []

        # Retrieve the referenced objects
        refs = instance.getRefs(relationship=self.relationship)

        ref_versions = getattr(instance, REFERENCE_VERSIONS, None)
        # No versions stored, return the original references
        if ref_versions is None:
            return refs

        for ref in refs:
            uid = api.get_uid(ref)
            # get the linked version to the reference
            version = ref_versions.get(uid)
            # append the versioned reference
            vrefs.append(self.retrieve_version(ref, version))

        return vrefs
853362
def master_ref(self):
        
        return ReferencesDataFrame(self._engine_dataframe.getReferences().getHEAD(),
                                   self._session, self._implicits)
865761
def getReadAlignments(self, reference, start=None, end=None):
        
        return self._getReadAlignments(reference, start, end, self, None)
791990
def _get_absolute_reference(self, ref_key):
        """"""

        key_str = u", ".join(map(str, ref_key))
        return u"S[" + key_str + u"]"
818291
def getReferenceSet(self, id_):
        
        if id_ not in self._referenceSetIdMap:
            raise exceptions.ReferenceSetNotFoundException(id_)
        return self._referenceSetIdMap[id_]
123138
def _references(self, i, sequence=False):
        """"""

        c = next(i)
        if c == '\\':
            # \\
            if sequence and self.bslash_abort:
                raise PathNameException
        elif c == '/':
            # \/
            if sequence and self.pathname:
                raise PathNameException
            elif self.pathname:
                i.rewind(1)
        else:
            # \a, \b, \c, etc.
            pass
395305
def _parse_references(xml):
    """"""
    references = []
    ref_finder = HTMLReferenceFinder(xml)
    for elm, uri_attr in ref_finder:
        type_ = _discover_uri_type(elm.get(uri_attr))
        references.append(Reference(elm, type_, uri_attr))
    return references
734040
def reference(self):
        """"""

        # Import from_didl_string if it isn't present already. The import
        # happens here because it would cause cyclic import errors if the
        # import happened at load time.
        global _FROM_DIDL_STRING_FUNCTION  # pylint: disable=global-statement
        if not _FROM_DIDL_STRING_FUNCTION:
            from . import data_structures_entry
            _FROM_DIDL_STRING_FUNCTION = data_structures_entry.from_didl_string

        ref = _FROM_DIDL_STRING_FUNCTION(
            getattr(self, 'resource_meta_data'))[0]
        # The resMD metadata lacks a <res> tag, so we use the resources from
        # the favorite to make 'reference' playable.
        ref.resources = self.resources
        return ref