Returns a sorted list of all the ids for a given type of documents.

 Warning : trusts the ids to be identical to the filenames
421552
def ids(type)

      Dir[File.join(dir_for(type), '**', '*.json')].collect { |path|
        File.basename(path, '.json')
      }.sort
    end
1286824
def listIDs(basedir):
    
    prefix = ''
    # check for pairtree_prefix file
    prefixfile = os.path.join(basedir, 'pairtree_prefix')
    if os.path.isfile(prefixfile):
        rff = open(prefixfile, 'r')
        prefix = rff.readline().strip()
        rff.close()
    # check for pairtree_root dir
    root = os.path.join(basedir, 'pairtree_root')
    if os.path.isdir(root):
        objects = pairtree.findObjects(root)
        for obj in objects:
            doi = os.path.split(obj)[1]
            # print with prefix and original chars in place
            print(prefix + pairtree.deSanitizeString(doi))
    else:
        print('pairtree_root directory not found')
271275
def fileids(self):
        
        return [os.path.join(self.path,i) for i in os.listdir(self.path)]
790335
def get_grade_ids(self):
        
        id_list = []
        for grade_map in self._my_map['grades']:
            id_list.append(Id(grade_map.id))
        if id_list == []:
            raise IllegalState()
        else:
            return IdList(id_list)
522249
def get_documents_in_database(self, with_id=True):
        
        documents = []
        for coll in self.get_collection_names():
            documents += self.get_documents_in_collection(
                coll,
                with_id=with_id
            )

        return documents
782765
def get_documents(self, subtypes=None, refresh=False):
        
        search = ScopusSearch('au-id({})'.format(self.identifier), refresh)
        if subtypes:
            return [p for p in search.results if p.subtype in subtypes]
        else:
            return search.results
700980
function() {
      var documents = [];
      // search localstorage for saved documents
      for ( var i = 0, max = localStorage.length; i < max; i++) {
        var key = localStorage.key(i);
        // value is a document if key confirms to prefix
        if (key.indexOf(prefix) == 0) {
          var doc = getDocumentByKey(key);
          if (doc) {
            documents.push(doc);
          }
        }
      }
      return documents;
    }
540300
def get_last_documents(self):
        
        return (
            self.session.query(Document)
            .filter(Document.name.in_(self.last_docs))
            .order_by(Document.name)
            .all()
        )
553092
def iter_doc_filepaths(self, **kwargs):  # pylint: disable=W0613
        
        with self._index_lock:
            for doc_id, info in self._doc_index.items():
                if not self._is_alias(doc_id):
                    yield doc_id, info[-1]
322059
def get_calc_ids(datadir=None):
    
    datadir = datadir or get_datadir()
    if not os.path.exists(datadir):
        return []
    calc_ids = set()
    for f in os.listdir(datadir):
        mo = re.match(CALC_REGEX, f)
        if mo:
            calc_ids.add(int(mo.group(2)))
    return sorted(calc_ids)
159992
def getallobjlists(idf, refname):
    
    dtls = idf.model.dtls
    objlists = []
    for i, fieldidds in enumerate(idf.idd_info):
        indexlist = []
        for j, fieldidd in enumerate(fieldidds):
            if 'object-list' in fieldidd:
                if fieldidd['object-list'][0].upper() == refname.upper():
                    indexlist.append(j)
        if indexlist != []:
            objkey = dtls[i]
            objlists.append((objkey, refname, indexlist))
    return objlists
144247
def set_doc_ids(self, doc_ids):
        
        if isinstance(doc_ids, list):
            self.set_documents(dict.fromkeys(doc_ids))
        else:
            self.set_documents({doc_ids: None})
850363
def get_es_ids(self):
        
        search = self.search.source(['uri']).sort(['uri'])
        es_ids = [item.meta.id for item in search.scan()]
        return es_ids
894820
def getidfobjectlist(idf):
    """"""
    idfobjects = idf.idfobjects  
    # idfobjlst = [idfobjects[key] for key in idfobjects if idfobjects[key]]
    idfobjlst = [idfobjects[key] for key in idf.model.dtls if idfobjects[key]]
        # `for key in idf.model.dtls` maintains the order
        # `for key in idfobjects` does not have order
    idfobjlst = itertools.chain.from_iterable(idfobjlst)
    idfobjlst = list(idfobjlst)
    return idfobjlst
1053737
def get_doctypes(self, index, edges=True):
        
        if index not in self.indices:
            self.get_all_indices()
        return self.indices.get(index, {})
460971
def query_ids(self, ids):
        

        results = self._get_repo_filter(Layer.objects).filter(uuid__in=ids).all()

        if len(results) == 0:  # try services
            results = self._get_repo_filter(Service.objects).filter(uuid__in=ids).all()

        return results
1255351
def doc_id(self):
        
        if self.id:
            return '%s_%s' % (self.doc_type, self.id.lower())
        return self._hashed_key