Return a list of project IDs assigned to flavor ID
323338
def flavor_access_list(self, **kwargs):
        '''
        
        '''
        flavor_id = kwargs.get('flavor_id')
        nt_ks = self.compute_conn
        ret = {flavor_id: []}
        flavor_accesses = nt_ks.flavor_access.list(flavor=flavor_id, **kwargs)
        for project in flavor_accesses:
            ret[flavor_id].append(project.tenant_id)
        return ret
359625
def flavor_list(self, **kwargs):
        '''
        
        '''
        nt_ks = self.compute_conn
        ret = {}
        for flavor in nt_ks.flavors.list(**kwargs):
            links = {}
            for link in flavor.links:
                links[link['rel']] = link['href']
            ret[flavor.name] = {
                'disk': flavor.disk,
                'id': flavor.id,
                'name': flavor.name,
                'ram': flavor.ram,
                'swap': flavor.swap,
                'vcpus': flavor.vcpus,
                'links': links,
            }
            if hasattr(flavor, 'rxtx_factor'):
                ret[flavor.name]['rxtx_factor'] = flavor.rxtx_factor
        return ret
422468
def get_projects(self):
        

        repos_list = []

        gerrit_projects_db = self.projects_db

        db = Database(user="root", passwd="", host="localhost", port=3306,
                      scrdb=None, shdb=gerrit_projects_db, prjdb=None)

        sql = """
            SELECT DISTINCT(repository_name)
            FROM project_repositories
            WHERE data_source='scr'
        """

        repos_list_raw = db.execute(sql)

        # Convert from review.openstack.org_openstack/rpm-packaging-tools to
        # openstack_rpm-packaging-tools
        for repo in repos_list_raw:
            # repo_name = repo[0].replace("review.openstack.org_","")
            repo_name = repo[0].replace(self.repository + "_", "")
            repos_list.append(repo_name)

        return repos_list
86280
def get_project_id():
    
    if os.name == 'nt':
        command = _CLOUD_SDK_WINDOWS_COMMAND
    else:
        command = _CLOUD_SDK_POSIX_COMMAND

    try:
        output = subprocess.check_output(
            (command,) + _CLOUD_SDK_CONFIG_COMMAND,
            stderr=subprocess.STDOUT)
    except (subprocess.CalledProcessError, OSError, IOError):
        return None

    try:
        configuration = json.loads(output.decode('utf-8'))
    except ValueError:
        return None

    try:
        return configuration['configuration']['properties']['core']['project']
    except KeyError:
        return None
381415
def get_runs(project_name):
    
    conn, c = open_data_base_connection()
    try:
        c.execute("""SELECT run_name FROM {}""".format(project_name + "_run_table"))
        run_names = np.array(c.fetchall()).squeeze(axis=1)
        run_names = convert_list_to_dict(run_names)
        return run_names
    except sqlite3.OperationalError:
        logging.info("{} not found".format(run_name))
    finally:
        conn.close()
619903
def _get_flavor():
    
    target = op.join("seqcluster", "flavor")
    url = "https://github.com/lpantano/seqcluster.git"
    if not os.path.exists(target):
    #   shutil.rmtree("seqcluster")
        subprocess.check_call(["git", "clone","-b", "flavor", "--single-branch", url])
    return op.abspath(target)
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]
299299
def find_by_id(self, project_membership, params={}, **options): 
        
        path = "/project_memberships/%s" % (project_membership)
        return self.client.get(path, params, **options)
508325
def list_flavors(self, retrieve_all=True, **_params):
        """"""
        return self.list('flavors', self.flavors_path, retrieve_all,
                         **_params)
949864
def _get_func_nodes():
    """"""
    return [definition for definition in project_definitions.values()
            if isinstance(definition.node, ast.FunctionDef)]
1045446
def per_from_id(flavors=chat_flavors+inline_flavors):
    
    return _wrap_none(lambda msg:
                          msg['from']['id']
                          if flavors == 'all' or flavor(msg) in flavors
                          else None)
900686
def proj_list(args):
    ''''''
    projects = fapi.list_billing_projects()
    fapi._check_response_code(projects, 200)
    projects = sorted(projects.json(), key=lambda d: d['projectName'])
    l = map(lambda p: '{0}\t{1}'.format(p['projectName'], p['role']), projects)
    # FIXME: add username col to output, for when iterating over multiple users
    return ["Project\tRole"] + l
979345
def get_build_flavor(settings_module, args):
    """"""
    known_flavors = listify(call_user_func(settings_module, 'known_flavors'))
    if args.flavor:
        if args.flavor not in known_flavors:
            raise ValueError('Unknown build flavor: {}'.format(args.flavor))
    else:
        args.flavor = call_user_func(settings_module, 'default_flavor')
        if args.flavor and args.flavor not in known_flavors:
            raise ValueError(
                'Unknown default build flavor: {}'.format(args.flavor))
292752
def flavor_access_remove(self, flavor_id, project_id):
        '''
        
        '''
        nt_ks = self.compute_conn
        ret = {flavor_id: []}
        flavor_accesses = nt_ks.flavor_access.remove_tenant_access(flavor_id, project_id)
        for project in flavor_accesses:
            ret[flavor_id].append(project.tenant_id)
        return ret
1244933
def create_flavor(self, nova, name, ram, vcpus, disk, flavorid="auto",
                      ephemeral=0, swap=0, rxtx_factor=1.0, is_public=True):
        """"""
        try:
            nova.flavors.find(name=name)
        except (exceptions.NotFound, exceptions.NoUniqueMatch):
            self.log.debug('Creating flavor ({})'.format(name))
            nova.flavors.create(name, ram, vcpus, disk, flavorid,
                                ephemeral, swap, rxtx_factor, is_public)
1238884
def get_project_export(self, project_id):
        
        try:
            result = self._request('/getprojectexport/',
                                   {'projectid': project_id})
            return TildaProject(**result)
        except NetworkError:
            return []
1276850
def get_ids_by_program(self, program):
		
		return set(row.process_id for row in self if row.program == program)