Replace aliases to the corresponding type to compute the ids.
174283
def _canonical_type(name):  # pylint: disable=too-many-return-statements
    

    if name == 'int':
        return 'int256'

    if name == 'uint':
        return 'uint256'

    if name == 'fixed':
        return 'fixed128x128'

    if name == 'ufixed':
        return 'ufixed128x128'

    if name.startswith('int['):
        return 'int256' + name[3:]

    if name.startswith('uint['):
        return 'uint256' + name[4:]

    if name.startswith('fixed['):
        return 'fixed128x128' + name[5:]

    if name.startswith('ufixed['):
        return 'ufixed128x128' + name[6:]

    return name
688382
def assign(pid_type, pid_value, status, object_type, object_uuid, overwrite):
    """"""
    from .models import PersistentIdentifier
    obj = PersistentIdentifier.get(pid_type, pid_value)
    if status is not None:
        obj.status = status
    obj.assign(object_type, object_uuid, overwrite=overwrite)
    db.session.commit()
    click.echo(obj.status)
489006
def ids2strids(ids: Iterable[int]) -> str:
    
    return C.TOKEN_SEPARATOR.join(map(str, ids))
181463
def update_mappings(self):
        """"""
        self.pos2id = dict((v, k) for k, v in self.id2pos.iteritems())
        assert len(self.pos2id) == len(self.id2pos), "duplicate ids or positions detected"
252782
def transform(self, attrs):
        """"""
        self.collect(attrs)
        self.add_missing_implementations()
        self.fill_attrs(attrs)
1125048
def loadCats(self, ids=[]):
        
        if type(ids) == list:
            return [self.cats[id] for id in ids]
        elif type(ids) == int:
            return [self.cats[ids]]
535537
def update_ids(self, docids):
        """"""
        logger.info("updating %i id mappings" % len(docids))
        for docid in docids:
            if docid is not None:
                pos = self.id2pos.get(docid, None)
                if pos is not None:
                    logger.info("replacing existing document %r in %s" % (docid, self))
                    del self.pos2id[pos]
                self.id2pos[docid] = self.length
                try:
                    del self.id2sims[docid]
                except:
                    pass
            self.length += 1
        self.id2sims.sync()
        self.update_mappings()
1322820
def real_ids(type)

      Dir[File.join(dir_for(type), '**', '*.json')].inject([]) { |a, p|
        doc = do_get(p)
        a << doc['_id'] if doc
        a
      }.sort
    end
258218
def convert_ids_to_object_ids(obj_map):
    """"""
    converted_map = {}
    for key, value in obj_map.items():
        if key == '_id':
            # hacky, but using alias sends back the whole ID string, like
            #   assessment.Item%3A5758326b4a40452d6eee1fa1%40ODL.MIT.EDU
            # so we have to preserve it
            try:
                converted_map[key] = ObjectId(value)
            except InvalidId:
                converted_map[key] = value
        elif isinstance(value, dict):
            converted_map[key] = convert_ids_to_object_ids(value)
        elif isinstance(value, list):
            new_list = []
            for internal_item in value:
                if isinstance(internal_item, dict):
                    new_list.append(convert_ids_to_object_ids(internal_item))
                else:
                    new_list.append(internal_item)
            converted_map[key] = new_list
        else:
            converted_map[key] = value
    return converted_map
531231
def alias(*aliases):
    

    def decorate(f):
        if not hasattr(f, "aliases"):
            f.aliases = []
        f.aliases += aliases
        return f

    return decorate
1061893
public static Integer[] transformToInt(final String[] ids) {
    if (ids == null) return new Integer[0];
    Integer[] idsOfInteger = new Integer[ids.length];
    for (int i = 0; i < ids.length; i++) {
      idsOfInteger[i] = new Integer(ids[i]);
    }
    return idsOfInteger;
  }
298304
def expand_idx_mimetype(type_):
    """"""
    if isinstance(type_, unicode_type):
        match = __IDX_PATTERN.match(type_)
        return __IDX_MAPPING.get(match.group(1), type_) if match else type_
    else:
        return type_
160750
def _generate_alias_type(self, alias_type):
        
        namespace = alias_type.namespace
        self.emit('export type %s = %s;' % (fmt_type_name(alias_type, namespace),
                                     fmt_type_name(alias_type.data_type, namespace)))
        self.emit()
270603
private void resetIdentifierType()
  {
    Expression expression = getExpression();
    if( expression == null )
    {
      return;
    }

    Identifier identifier = getIdentifier();
    if( identifier == null )
    {
      return;
    }

    ISymbol symbol = identifier.getSymbol();
    if( symbol.getType() == GosuParserTypes.NULL_TYPE() )
    {
      symbol.setType( expression.getType() );
    }
  }
132148
def filter_by_ids(original_list, ids_to_filter):
    """"""
    if not ids_to_filter:
        return original_list

    return [i for i in original_list if i['id'] in ids_to_filter]
788158
def fix_identities(self, uniq=None):
        """"""
        if not hasattr(self, 'children'):
            return self
        uniq = list(set(self.flat())) if uniq is None else uniq
        for i, child in enumerate(self.children):
            if not hasattr(child, 'children'):
                assert child in uniq
                self.children[i] = uniq[uniq.index(child)]
            else:
                child.fix_identities(uniq)
1264930
private void applyAliases(Map<FieldType, String> aliases)
   {
      CustomFieldContainer fields = m_project.getCustomFields();
      for (Map.Entry<FieldType, String> entry : aliases.entrySet())
      {
         fields.getCustomField(entry.getKey()).setAlias(entry.getValue());
      }
   }