Get a list of file paths based of a set of ids

        Parameters
        ----------

        id_list : list
            List of integer file keys

        Returns list of file paths
510960
def get_file_paths(self, id_list):
        
        if id_list is None:
            return []
        try:
            path_array = self._table[id_list - 1]['path']
        except IndexError:
            print("IndexError ", len(self._table), id_list)
            path_array = []
        return [path for path in path_array]
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')
292442
def _list_ids(path_to_data):
    """"""
    loaded = pickle.load(open(path_to_data, "rb"))
    raw_datasets = loaded['handwriting_datasets']
    raw_ids = {}
    for raw_dataset in raw_datasets:
        raw_data_id = raw_dataset['handwriting'].raw_data_id
        if raw_dataset['formula_id'] not in raw_ids:
            raw_ids[raw_dataset['formula_id']] = [raw_data_id]
        else:
            raw_ids[raw_dataset['formula_id']].append(raw_data_id)
    for symbol_id in sorted(raw_ids):
        print("%i: %s" % (symbol_id, sorted(raw_ids[symbol_id])))
411800
def get_subset_ids(path):
        
        all = []

        for path in glob.glob(os.path.join(path, '*.tsv')):
            file_name = os.path.split(path)[1]
            basename = os.path.splitext(file_name)[0]
            all.append(basename)

        return all
985627
def lookup(self, id_list, **kw):
        
        result_id_pack = ','.join([str(_id) for _id in id_list])
        if not result_id_pack:
            return []
        return self.twitter.statuses.lookup(_id=result_id_pack)
1012973
def read_id_list(filepath):
    
    if not filepath:
        return None
    id_list = []
    with open(filepath) as f:
        for line in f:
            line = line.rstrip()
            if not re.match('^[0-9]{8}$', line):
                raise('Each line in whitelist or blacklist is expected '
                      'to contain an eight digit ID, and nothing else.')
            else:
                id_list.append(line)
    return id_list
117204
def get_asset_ids(self):
        
        if not self.is_asset_based_activity():
            raise IllegalState()
        else:
            ids = []
            for i in self._my_map['assetIds']:
                ids.append(Id(i))
            return IdList(ids)
256246
def list_files(dir_path, recursive=True):
    

    for root, dirs, files in os.walk(dir_path):
        file_list = [os.path.join(root, f) for f in files]
        if recursive:
            for dir in dirs:
                dir = os.path.join(root, dir)
                file_list.extend(list_files(dir, recursive=True))
        return file_list
946394
def get_folders(path):
        
        folder_paths = []

        for item in os.listdir(path):
            folder_path = os.path.join(path, item)

            if os.path.isdir(folder_path):
                folder_paths.append(folder_path)

        return folder_paths
271127
def get_paths(self, user_ids=None, startup_ids=None, direction=None):
    
    if user_ids is None and startup_ids is None and direction is None:
      raise Exception('At least one input argument should be different than None')
    if isinstance(user_ids, list):
      user_ids = ','.join(list(map(lambda k: str(k), user_ids)))
    if isinstance(startup_ids, list):
      startup_ids = ','.join(list(map(lambda k: str(k), startup_ids)))

    paths_url = _PATHS.format(c_api=_C_API_BEGINNING,
                                      api=_API_VERSION,
                                      at=self.access_token)
    if not user_ids is None:
      paths_url += '&' + _USER_IDS_SUFFIX.format(user_ids=user_ids)
    if not startup_ids is None:
      paths_url += '&' + _STARTUP_IDS_SUFFIX.format(
                                                    startup_ids=startup_ids)
    if not direction is None:
      paths_url += '&' + _DIRECTION_SUFFIX.format(direction=direction)
    return _get_request(paths_url)
922052
def get_paths(self, key):
        ""
        result_list = []
        if key in self.keys():
            result_list.append(((key,), self[key]))
        for sub_key, v in self.items():
            if isinstance(v, self.__class__):
                sub_res_list = v.get_paths(key)
                for key_path, res in sub_res_list:
                    result_list.append(((sub_key,) + key_path, res))
            elif isinstance(v, dict):
                if key in v.keys():
                    result_list.append(((sub_key, key), v[key]))
        return result_list
793998
def listdir(self, relpath):
    

    path = self._realpath(relpath)
    if not path.endswith('/'):
      raise self.NotADirException(self.rev, relpath)

    if path[0] == '/' or path.startswith('../'):
      return os.listdir(path)

    tree = self._read_tree(path[:-1])
    return list(tree.keys())
1074763
def list(self, id):
        
        id = self.__unpack_id(id)        
        return self.__api_request('GET', '/api/v1/lists/{0}'.format(id))
53937
def get_hierarchies_by_ids(self, *args, **kwargs):
        """"""
        # Implemented from kitosid template for -
        # osid.resource.BinLookupSession.get_bins_by_ids
        catalogs = self._get_provider_session('hierarchy_lookup_session').get_hierarchies_by_ids(*args, **kwargs)
        cat_list = []
        for cat in catalogs:
            cat_list.append(Hierarchy(self._provider_manager, cat, self._runtime, self._proxy))
        return HierarchyList(cat_list)
146136
def identify_with_list(identifier):
    
    @wraps(identifier)
    def decorated_func(origin, filepath, fileobj, *args, **kwargs):
        # pylint: disable=missing-docstring
        try:
            filepath = file_list(filepath)[0]
        except ValueError:
            if filepath is None:
                try:
                    files = file_list(args[0])
                except (IndexError, ValueError):
                    pass
                else:
                    if files:
                        filepath = files[0]
        except IndexError:
            pass
        return identifier(origin, filepath, fileobj, *args, **kwargs)
    return decorated_func
1292064
def list(self, id=None):
        
        args = {'pid': id}
        self._process_chk.check(args)
        return self._client.json('process.list', args)
233468
def backupIds(self) -> Sequence[int]:
        
        return [id for id in self.started.keys() if id != 0]