Returns a dict of projects present in the database.
    :return: dict -> {<int_keys>: <project_name>}
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()
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)
1366002
def _update_projects(self):
        ''''''
        now = time.time()
        if (
                not self._force_update_project
                and self._last_update_project + self.UPDATE_PROJECT_INTERVAL > now
        ):
            return
        for project in self.projectdb.check_update(self._last_update_project):
            self._update_project(project)
            logger.debug("project: %s updated.", project['name'])
        self._force_update_project = False
        self._last_update_project = now
1238884
def get_project_export(self, project_id):
        
        try:
            result = self._request('/getprojectexport/',
                                   {'projectid': project_id})
            return TildaProject(**result)
        except NetworkError:
            return []
1229305
def to_dict(self):
        
        session = self._get_session()
        snapshot = self._get_snapshot()
        return {
            "session_id": session._session_id,
            "transaction_id": snapshot._transaction_id,
        }
921244
def get_my_choices_projects():
    

    proj_list = Project.objects.all()
    proj_tuple = []
    counter = 1
    for proj in proj_list:
        proj_tuple.append((counter, proj))
        counter = counter + 1
    return proj_tuple
194691
def get_project_details(self, project):
        
        result = self.get_project(project.pid)
        if result is None:
            result = {}
        return result
134180
def database_exist(self):
        
        binds = {}
        for key, engine in self.keys_engines():
            key = key if key else 'default'
            binds[key] = self._database_exist(engine)
        return binds
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]
826663
def get_projects_list(self):
        
        try:
            result = self._request('/getprojectslist/')
            return [TildaProject(**p) for p in result]
        except NetworkError:
            return []
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')
1372747
def _get_project_types(self):
        """"""
        project_types = get_available_project_types()
        projects = []

        for project in project_types:
            projects.append(project.PROJECT_TYPE_NAME)

        return projects
684988
def getProcessDatabase(self):
        
        info_dict = {}
        cur = self._conn.cursor()
        cur.execute("""SHOW FULL PROCESSLIST;""")
        rows = cur.fetchall()
        if rows:
            for row in rows:
                db = row[3]
                info_dict[db] = info_dict.get(db, 0) + 1
        return info_dict
823399
def project(self, key):
        
        url = 'rest/api/1.0/projects/{0}'.format(key)
        return (self.get(url) or {}).get('values')
123600
def to_dict(self):
        
        return {
            'task_name': self.task_name,
            'dag_name': self.dag_name,
            'workflow_name': self.workflow_name,
            'workflow_id': self.workflow_id,
            'worker_hostname': self.worker_hostname
        }
5371
def get_listed_projects():
    
    index_path = Path().resolve() / "docs" / "index.md"
    with open(index_path, "r") as index_file:
        lines = index_file.readlines()

    listed_projects = set()
    project_section = False
    for _, l in enumerate(lines):
        idx = l.find(PROJECT_KEY)
        if idx >= 0:
            project_section = True
        if project_section:
            # Find first parenthesis after the key
            start = l.find("](")
            if start > 0:
                closing_parenthesis = sorted(
                    [m.start() for m in re.finditer(r"\)", l) if m.start() > start]
                )[0]
                project = l[start + 2 : closing_parenthesis]
                listed_projects.add(project)
        # If the Projects section is over, stop iteration.
        # It will stop before seeing ## but wainting for it
        # Allows the user to use single # in the projects' descriptions
        if len(listed_projects) > 0 and l.startswith("#"):
            return listed_projects
    return listed_projects
576736
def get_projects(self, **kwargs):
        

        _login = kwargs.get('login', self._login)
        search_url = SEARCH_URL.format(login=_login)
        return self._request_api(url=search_url).json()