Get associations for all stored species taxid2asscs[taxid][ID2GOs|GO2IDs].
766346
def get_id2gos_all(taxid2asscs_a2b):
        """"""
        id2gos_all = {}
        for a2b in taxid2asscs_a2b.values():
            for geneid, gos in a2b['ID2GOs'].items():
                id2gos_all[geneid] = gos
        return id2gos_all
492729
def _get_taxon(taxon):
        """"""
        if not taxon:
            return None
        ## assert taxon[:6] == 'taxon:', 'UNRECOGNIZED Taxon({Taxon})'.format(Taxon=taxon)
        ## taxid = taxon[6:]
        ## assert taxon[:10] == 'NCBITaxon:', 'UNRECOGNIZED Taxon({Taxon})'.format(Taxon=taxon)
        ## taxid = taxon[10:]
        # Get tzxon number: taxon:9606 NCBITaxon:9606
        sep = taxon.find(':')
        taxid = taxon[sep + 1:]
        assert taxid.isdigit(), "UNEXPECTED TAXON({T})".format(T=taxid)
        return int(taxid)
909249
def get_taxids(list_of_names):
    
    from jcvi.apps.fetch import batch_taxids
    return [int(x) for x in batch_taxids(list_of_names)]
484124
def _get_all_relationships(self):
        """"""
        relationships_all = set()
        for goterm in self.go2obj.values():
            if goterm.relationship:
                relationships_all.update(goterm.relationship)
            if goterm.relationship_rev:
                relationships_all.update(goterm.relationship_rev)
        return relationships_all
708160
public function getAssociations($pk, $assocTbl, $callback=null, $ordered=true)
  {
    $associations = [];
    
    if ( $this->realPkSelection($pk) ){
      if ( $this->load($pk) ){
        $fkParts = explode('_', $this->tbl_name);
        $fk = array_pop($fkParts);
        
        $query = $this->db->getQuery(true)
          ->select('*')
          ->from($this->tbl.'_'.$assocTbl)
          ->where('id_'.$fk.' = '.$pk);
        
        if ( $ordered ){
          if ( is_bool($ordered) ){
            $query->order('ordering ASC');
          }
          else {
            $query->order($ordered);
          }
        }
        
        $this->db->setQuery($query);
        
        $associations = $this->db->loadObjectList();
        
        if ( is_callable($callback) ){
          foreach($associations as $row){
            $callback($row, $this);
          }
        }
      }
    }
    
    $this->errors = [];
    return $associations;
  }
211684
def read_associations(assoc_fn, anno_type='id2gos', **kws):
    """"""
    # kws get_objanno: taxids hdr_only prt allow_missing_symbol
    obj = get_objanno(assoc_fn, anno_type, **kws)
    # kws get_id2gos: ev_include ev_exclude keep_ND keep_NOT b_geneid2gos go2geneids
    return obj.get_id2gos(**kws)
510470
def _init_associations(fin_anno, taxid=None, taxids=None):
        """"""
        return InitAssc(taxid, taxids).init_associations(fin_anno, taxids)
957661
def _get_goid2dbids(associations):
        """"""
        go2ids = cx.defaultdict(set)
        for ntd in associations:
            go2ids[ntd.GO_ID].add(ntd.DB_ID)
        return dict(go2ids)
852375
def chk_associations(self, fout_err="gaf.err"):
        """"""
        obj = GafData("2.1")
        return obj.chk(self.associations, fout_err)
649270
def get_go2nt_all(self, rcntobj):
        """"""
        if 'go2nt' in self.kws:
            go2nt = self.kws['go2nt']
            return {go:go2nt[go] for go in self.go2obj}
        else:
            return self._get_go2nt_all(rcntobj)
1120739
def convert_association(self, association: Association) -> Entity:
        
        if "header" not in association or association["header"] == False:
            # print(json.dumps(association, indent=4))
            gpi_obj = {
                'id': association["subject"]["id"],
                'label': association["subject"]["label"],  # db_object_symbol,
                'full_name': association["subject"]["fullname"],  # db_object_name,
                'synonyms': association["subject"]["synonyms"],
                'type': association["subject"]["type"], #db_object_type,
                'parents': "", # GAF does not have this field, but it's optional in GPI
                'xrefs': "", # GAF does not have this field, but it's optional in GPI
                'taxon': {
                    'id': association["subject"]["taxon"]["id"]
                }
            }
            return Entity(gpi_obj)

        return None
336867
function extractAssociationIds(devices) {
  var associationIds = [];

  for(var deviceId in devices) {
    var device = devices[deviceId];
    var hasAssociationIds = device.hasOwnProperty("associationIds");
    if(!hasAssociationIds) {
      device.associationIds = reelib.tiraid.getAssociationIds(device);
    }
    for(var cId = 0; cId < device.associationIds.length; cId++) {
      if(associationIds.indexOf(device.associationIds[cId]) < 0) {
        associationIds.push(device.associationIds[cId]);
      }
    }
  }

  return associationIds;
}
11522
private function getInheritanceAssociations(ClassMetadata $class, $associations = array())
    {
        if ($parent = $this->classStore->getParent($class)) {
            foreach ($parent->getAssociationNames() as $association) {
                if (!in_array($association, $associations)) {
                    $associations[] = $association;
                }
            }
            $associations = $this->getInheritanceAssociations($parent, $associations);
        }

        return $associations;
    }
299315
protected List<OneToManyAssociation> getOneToManyAssociations(List<Association> exclusions) {
        List<OneToManyAssociation> one2Manies = new ArrayList<>();
        for (Association association : associations) {
            if(association.getClass().equals(OneToManyAssociation.class) && !exclusions.contains(association)){
                one2Manies.add((OneToManyAssociation)association);
            }
        }
        return one2Manies;
    }
928808
def associations(self, subject, object=None):
        
        if object is None:
            if self.associations_by_subj is not None:
                return self.associations_by_subj[subject]
            else:
                return []
        else:
            if self.associations_by_subj_obj is not None:
                return self.associations_by_subj_obj[(subject,object)]
            else:
                return []
243700
public java.util.List<String> getAssociationIds() {
        if (associationIds == null) {
            associationIds = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return associationIds;
    }
1374885
public function findAssociationCategories()
    {
        $xmlQuery = $this->metaApiService->getAssociationCategories();

        $categories = new Categories();

        $mapper = new \RGU\Dvoconnector\Mapper\AssociationCategories($xmlQuery);
        $mapper->mapToAbstractEntity($categories);

        return $categories;
    }