Find wheels from which we can import PROJECTS.

    Scan through SEARCH_DIRS for a wheel for each PROJECT in turn. Return
    a list of the first wheel found for each PROJECT
964339
def find_wheels(projects, search_dirs):
    

    wheels = []

    # Look through SEARCH_DIRS for the first suitable wheel. Don't bother
    # about version checking here, as this is simply to get something we can
    # then use to install the correct version.
    for project in projects:
        for dirname in search_dirs:
            # This relies on only having "universal" wheels available.
            # The pattern could be tightened to require -py2.py3-none-any.whl.
            files = glob.glob(os.path.join(dirname, project + '-*.whl'))
            if files:
                wheels.append(os.path.abspath(files[0]))
                break
        else:
            # We're out of luck, so quit with a suitable error
            logger.fatal('Cannot find a wheel for %s' % (project,))

    return wheels
179285
def get_projects():
    
    conn, c = open_data_base_connection()
    try:
        c.execute("""SELECT project_name FROM main_table""")
        project_names = np.array(c.fetchall()).squeeze(axis=1)
        project_names = convert_list_to_dict(project_names)
        return project_names
    except sqlite3.OperationalError:
        logging.info("{} not found".format(run_name))
    finally:
        conn.close()
705038
def _get_matching_wheel(self, pex_path, interpreter, requirements, module_name):
    """"""
    with self.context.new_workunit('extract-native-wheels'):
      with safe_concurrent_creation(pex_path) as chroot:
        pex_builder = PexBuilderWrapper.Factory.create(
          builder=PEXBuilder(path=chroot, interpreter=interpreter),
          log=self.context.log)
        return pex_builder.extract_single_dist_for_current_platform(requirements, module_name)
399372
def get_project_details(project):
    
    result = []
    for datastore in _get_datastores():
        value = datastore.get_project_details(project)
        value['datastore'] = datastore.config['DESCRIPTION']
        result.append(value)
    return result
1022257
def list_projects(root, backend=os.listdir):
    
    projects = list()
    for project in sorted(backend(root)):
        abspath = os.path.join(root, project)
        if not isproject(abspath):
            continue
        projects.append(project)
    return projects
192538
def all(self):
        
        project_list = self.fetch('projects.json').get("projects")
        obj_list = []
        for proj in project_list:
            proj['_connection'] = self._connection
            proj = Project(proj)
            obj_list.append(proj)
        return obj_list
296913
def project_list(self, limit=None):
        
        params = {}
        if limit:
            params['limit'] = limit
        return (self.get('rest/api/1.0/projects', params=params) or {}).get('values')
772609
def system_find_project_members(input_params={}, always_retry=True, **kwargs):
    
    return DXHTTPRequest('/system/findProjectMembers', input_params, always_retry=always_retry, **kwargs)
700824
def list(self, **kwargs):
        
        projects = Project.select().order_by(Project.name)
        if len(projects) == 0:
            self._print('No projects available', 'yellow')
            return

        for project in projects:
            project_repr = self._PROJECT_ITEM.format(project.name, project.path)
            row = '- {}'.format(self._PROJECT_ITEM.format(project.name, project.path))
            six.print_(row)
1086973
def find_objects(modules):
    
    return {
        subclass.__name__: subclass
        for subclass in chain(
            get_all_subclasses(Object),
            get_all_subclasses(ObjectSet),
        )
        if subclass.__module__ in modules
    }
382978
def projects(self):
        
        result = set()
        for todo in self._todos:
            projects = todo.projects()
            result = result.union(projects)

        return result
138918
function getRecentProjects() {
        var recentProjects = PreferencesManager.getViewState("recentProjects") || [],
            i;

        for (i = 0; i < recentProjects.length; i++) {
            // We have to canonicalize & then de-canonicalize the path here, since our pref format uses no trailing "/"
            recentProjects[i] = FileUtils.stripTrailingSlash(ProjectManager.updateWelcomeProjectPath(recentProjects[i] + "/"));
        }
        return recentProjects;
    }
1358778
def get_project_ids(self):
        
        user = self.request.user
        projects = Project.objects.accessible_to(user).values('id')
        return [p['id'] for p in projects]
36012
def get_tasks(self, task_id=None, state='completed', json_file=None):
        """"""
        if self.project is None:
            raise ProjectError

        loader = create_tasks_loader(self.project.id, task_id,
                                     state, json_file, self.all)
        self.tasks = loader.load()

        self._check_project_has_tasks()
        self.tasks_df = dataframer.create_data_frame(self.tasks)
825085
@Override
    public List<Project> findProjects() {
        List<Project> projectList;
        try {
            projectList = createProjects(ldapDao.getDirectChildren(DnFactory.projects()));
        } catch (NoSuchNodeException | MissingParentException e) {
            LOGGER.error("LDAP exception", e);
            throw new LdapRuntimeException(e);
        }
        return projectList;
    }
353874
def get_project_files():
    
    if is_git_project():
        return get_git_project_files()

    project_files = []
    for top, subdirs, files in os.walk('.'):
        for subdir in subdirs:
            if subdir.startswith('.'):
                subdirs.remove(subdir)

        for f in files:
            if f.startswith('.'):
                continue
            project_files.append(os.path.join(top, f))

    return project_files
411677
def find_imports_and_track_names(filename, warn_about_duplicates=False,
                                 verbose=False):
    
    with open(filename) as f:
        root = ast.parse(f.read(), filename)
    visitor = ImportFinderAndNameTracker(filename)
    visitor.warn_about_duplicates = warn_about_duplicates
    visitor.verbose = verbose
    visitor.visit(root)
    visitor.leaveAllScopes()
    return visitor.imports, visitor.unused_names