Return a list of unstaged files in the project repository.

    Returns:
        list[str]: The list of files not tracked by project git repo.
186585
def unstaged():
    # type: () -> List[str]
    
    with conf.within_proj_dir():
        status = shell.run(
            'git status --porcelain',
            capture=True,
            never_pretend=True
        ).stdout
        results = []

        for file_status in status.split(os.linesep):
            if file_status.strip() and file_status[0] == ' ':
                results.append(file_status[3:].strip())

        return results
540299
def get_recent_files(self):
        """"""
        try:
            recent_files = self.CONF[WORKSPACE].get('main', 'recent_files',
                                                    default=[])
        except EnvironmentError:
            return []

        for recent_file in recent_files[:]:
            if not os.path.isfile(recent_file):
                recent_files.remove(recent_file)
        return list(OrderedDict.fromkeys(recent_files))
846684
def exp_files(self):
        
        ret = OrderedDict()
        # restore the order of the experiments
        exp_file = self.exp_file
        if osp.exists(exp_file):
            for key, val in safe_load(exp_file).items():
                ret[key] = val
        for project, d in self.projects.items():
            project_path = d['root']
            config_path = osp.join(project_path, '.project')
            if not osp.exists(config_path):
                continue
            for fname in glob.glob(osp.join(config_path, '*.yml')):
                if fname == '.project.yml':
                    continue
                exp = osp.splitext(osp.basename(fname))[0]
                if not isinstance(ret.get(exp), Archive):
                    ret[exp] = osp.join(config_path, exp + '.yml')
                if exp not in self._project_map[project]:
                    self._project_map[project].append(exp)
        return ret
1036529
def output_files(self):
        
        outs = [os.path.join(self.address.repo, self.address.path, x)
                for x in self.params['outs']]
        return outs
676949
def untrack(context, file_names):
    
    context.obj.find_repo_type()
    for fn in file_names:
        if context.obj.vc_name == 'git':
            context.obj.call(['git', 'rm', '--cached', fn])
        elif context.obj.vc_name == 'hg':
            context.obj.call(['hg', 'forget', fn])
495592
def get_used_files():
    """"""
    import psutil
    loop_over_scanpy_processes = (proc for proc in psutil.process_iter()
                                  if proc.name() == 'scanpy')
    filenames = []
    for proc in loop_over_scanpy_processes:
        try:
            flist = proc.open_files()
            for nt in flist:
                filenames.append(nt.path)
        # This catches a race condition where a process ends
        # before we can examine its files
        except psutil.NoSuchProcess as err:
            pass
    return set(filenames)
403697
def is_dirty(self, index=True, working_tree=True, untracked_files=False,
                 submodules=True, path=None):
        
        if self._bare:
            # Bare repositories with no associated working directory are
            # always consired to be clean.
            return False

        # start from the one which is fastest to evaluate
        default_args = ['--abbrev=40', '--full-index', '--raw']
        if not submodules:
            default_args.append('--ignore-submodules')
        if path:
            default_args.append(path)
        if index:
            # diff index against HEAD
            if osp.isfile(self.index.path) and \
                    len(self.git.diff('--cached', *default_args)):
                return True
        # END index handling
        if working_tree:
            # diff index against working tree
            if len(self.git.diff(*default_args)):
                return True
        # END working tree handling
        if untracked_files:
            if len(self._get_untracked_files(path, ignore_submodules=not submodules)):
                return True
        # END untracked files
        return False
1231295
def list(self, path=None, with_metadata=False, include_partitions=False):
        ''''''
        import json

        sub_path = self.prefix + '/' + path.strip('/') if path else self.prefix

        l = {}

        for e in self.bucket.list(sub_path):

            path = e.name.replace(self.prefix, '', 1).strip('/')
            if path.startswith('_') or path.startswith('meta'):
                continue

            # TODO 'include_partitions' doesn't make any sense outside of ambry
            if not include_partitions and path.count('/') > 1:
                continue  # partition files

            if with_metadata:
                d = self.metadata(path)
                if d and 'identity' in d:
                    d['identity'] = json.loads(d['identity'])
            else:
                d = {}

            d['caches'] = [self.repo_id]

            if path:
                l[path] = d

        return l
714341
def get_filesnames(self):
        """"""
        self._update()
        projects = set(list(self._tasks.keys()) + self._task_projects + ['all_projects', 'unaffiliated'])
        return [join(self._data_location, p.split()[0]) for p in projects]
516709
def get_repos(self, since=github.GithubObject.NotSet):
        
        assert since is github.GithubObject.NotSet or isinstance(since, (int, long)), since
        url_parameters = dict()
        if since is not github.GithubObject.NotSet:
            url_parameters["since"] = since
        return github.PaginatedList.PaginatedList(
            github.Repository.Repository,
            self.__requester,
            "/repositories",
            url_parameters
        )
179089
def get_unspents(self):
        
        self.unspents[:] = list(map(
            lambda u: u.set_type('p2pkh' if self.is_compressed() else
                                 'p2pkh-uncompressed'),
            NetworkAPI.get_unspent(self.address)
        ))
        if self.segwit_address:
            self.unspents += list(map(
                lambda u: u.set_type('np2wkh'),
                NetworkAPI.get_unspent(self.segwit_address)
            ))
        self.balance = sum(unspent.amount for unspent in self.unspents)
        return self.unspents
874918
def files(self):
        ''''''
        try:
            cur = self.conn.cursor()
            cur.execute(
                'SELECT id, item FROM workflows WHERE entry_type = "tracked_files"'
            )
            return [(x[0], eval(x[1])) for x in cur.fetchall()]
        except sqlite3.DatabaseError as e:
            env.logger.warning(
                f'Failed to get files from signature database: {e}')
            return []
1143280
public List<GitlabProject> getOwnedProjects() throws IOException {
        Query query = new Query().append("owned", "true");
        query.mergeWith(new Pagination().withPerPage(Pagination.MAX_ITEMS_PER_PAGE).asQuery());
        String tailUrl = GitlabProject.URL + query.toString();
        return retrieve().getAll(tailUrl, GitlabProject[].class);
    }
743284
def get_projects(self, state=github.GithubObject.NotSet):
        
        
        url_parameters = dict()
        if state is not github.GithubObject.NotSet:
            url_parameters["state"] = state
            
        return github.PaginatedList.PaginatedList(
            github.Project.Project,
            self._requester,
            self.url + "/projects",
            url_parameters,
            {"Accept": Consts.mediaTypeProjectsPreview}
        )
281108
def snapshot_list(self):
        '''
        
        '''
        NO_SNAPSHOTS_TAKEN = 'No snapshots have been taken yet!'
        output = self._run_vagrant_command(['snapshot', 'list'])
        if NO_SNAPSHOTS_TAKEN in output:
            return []
        else:
            return output.splitlines()
128254
def file_list(self, tgt_env):
        '''
        
        '''
        def _traverse(tree, blobs, prefix):
            '''
            Traverse through a pygit2 Tree object recursively, accumulating all
            the file paths and symlink info in the "blobs" dict
            '''
            for entry in iter(tree):
                if entry.oid not in self.repo:
                    # Entry is a submodule, skip it
                    continue
                obj = self.repo[entry.oid]
                if isinstance(obj, pygit2.Blob):
                    repo_path = salt.utils.path.join(
                        prefix, entry.name, use_posixpath=True)
                    blobs.setdefault('files', []).append(repo_path)
                    if stat.S_ISLNK(tree[entry.name].filemode):
                        link_tgt = self.repo[tree[entry.name].oid].data
                        blobs.setdefault('symlinks', {})[repo_path] = link_tgt
                elif isinstance(obj, pygit2.Tree):
                    _traverse(
                        obj, blobs, salt.utils.path.join(
                            prefix, entry.name, use_posixpath=True)
                    )

        files = set()
        symlinks = {}
        tree = self.get_tree(tgt_env)
        if not tree:
            # Not found, return empty objects
            return files, symlinks
        if self.root(tgt_env):
            try:
                # This might need to be changed to account for a root that
                # spans more than one directory
                oid = tree[self.root(tgt_env)].oid
                tree = self.repo[oid]
            except KeyError:
                return files, symlinks
            if not isinstance(tree, pygit2.Tree):
                return files, symlinks
            relpath = lambda path: os.path.relpath(path, self.root(tgt_env))
        else:
            relpath = lambda path: path
        blobs = {}
        if tree:
            _traverse(tree, blobs, self.root(tgt_env))
        add_mountpoint = lambda path: salt.utils.path.join(
            self.mountpoint(tgt_env), path, use_posixpath=True)
        for repo_path in blobs.get('files', []):
            files.add(add_mountpoint(relpath(repo_path)))
        for repo_path, link_tgt in six.iteritems(blobs.get('symlinks', {})):
            symlinks[add_mountpoint(relpath(repo_path))] = link_tgt
        return files, symlinks
865781
def find_repositories_by_walking_without_following_symlinks(path):
    """"""
    repos = []
    for dirpath, dirnames, filenames in os.walk(path, followlinks=False):
        for dotdir in set(dirnames) & DOTDIRS:
            repos.append((dirpath, dotdir))
    return repos