Generate the "project process" section of the report.
771568
def get_sec_project_process(self):
        

        logger.debug("Calculating Project Process metrics.")

        data_path = os.path.join(self.data_dir, "process")
        if not os.path.exists(data_path):
            os.makedirs(data_path)

        project_process_config = {
            "bmi_metrics": [],
            "time_to_close_metrics": [],
            "time_to_close_review_metrics": [],
            "patchsets_metrics": []
        }

        for ds in self.data_sources:
            metric_file = self.ds2class[ds]
            metric_index = self.get_metric_index(ds)
            project_process = metric_file.project_process(metric_index, self.start_date,
                                                          self.end_date)
            for section in project_process_config:
                project_process_config[section].extend(project_process[section])

        project_process_config["time_to_close_title"] = "Days to close (median and average)"
        project_process_config["time_to_close_review_title"] = "Days to close review (median and average)"

        """
        BMI Pull Requests, BMI Issues
        description: closed PRs/issues out of open PRs/issues in a period of time
        """
        for bmi_metric in project_process_config['bmi_metrics']:
            headers = bmi_metric.id
            dataframe = bmi_metric.timeseries(dataframe=True)
            file_label = bmi_metric.DS_NAME + "_" + bmi_metric.id
            file_path = os.path.join(data_path, file_label)
            title_name = bmi_metric.name
            self.create_csv_fig_from_df([dataframe], file_path, [headers],
                                        fig_type="bar", title=title_name)
        """
        Time to close Issues and gerrit and ITS tickets
        description: median and mean time to close issues
        """
        i = 0
        if len(project_process_config['time_to_close_metrics']) > 0:
            metrics = project_process_config['time_to_close_metrics']
            while i < len(metrics):
                file_label = ""
                headers = [metrics[i].id, metrics[i + 1].id]
                file_label += metrics[i].DS_NAME + "_" + metrics[i].id + "_"
                file_label += metrics[i + 1].DS_NAME + "_" + metrics[i + 1].id
                dataframes = [metrics[i].timeseries(dataframe=True),
                              metrics[i + 1].timeseries(dataframe=True)]
                title_name = project_process_config['time_to_close_title']
                file_path = os.path.join(data_path, file_label)
                self.create_csv_fig_from_df(dataframes, file_path, headers,
                                            fig_type="bar", title=title_name)
                i += 2
        """
        Time to close PRs and gerrit reviews
        description: median and mean time to close prs and gerrit reviews
        """
        i = 0
        if len(project_process_config['time_to_close_review_metrics']) > 0:
            metrics = project_process_config['time_to_close_review_metrics']
            while i < len(metrics):
                file_label = ""
                headers = [metrics[i].id, metrics[i + 1].id]
                file_label += metrics[i].DS_NAME + "_" + metrics[i].id + "_"
                file_label += metrics[i + 1].DS_NAME + "_" + metrics[i + 1].id
                dataframes = [metrics[i].timeseries(dataframe=True),
                              metrics[i + 1].timeseries(dataframe=True)]
                title_name = project_process_config['time_to_close_review_title']
                file_path = os.path.join(data_path, file_label)
                self.create_csv_fig_from_df(dataframes, file_path, headers,
                                            fig_type="bar", title=title_name)
                i += 2
        """
        Patchsets per review
        description: median and average of the number of patchsets per review
        """
        if project_process_config['patchsets_metrics']:
            file_label = ""
            metrics = project_process_config['patchsets_metrics']
            headers = [metrics[0].id, metrics[1].id]
            dataframes = [metrics[0].timeseries(dataframe=True),
                          metrics[1].timeseries(dataframe=True)]
            file_label = metrics[0].DS_NAME + "_" + metrics[0].id + "_"
            file_label += metrics[1].DS_NAME + "_" + metrics[1].id
            file_path = os.path.join(data_path, file_label)
            title_name = project_process_config['patchsets_title']
            self.create_csv_fig_from_df(dataframes, file_path, headers,
                                        fig_type="bar", title=title_name)
1014023
private void processProjectProperties() throws SQLException
   {
      List<ResultSetRow> rows = getRows("SELECT * FROM MSP_PROJECTS WHERE PROJ_ID=?", m_projectID);
      if (rows.isEmpty() == false)
      {
         processProjectProperties(rows.get(0));
      }
   }
557146
def _GenerateSection(self, problem_type):
    
    if problem_type == transitfeed.TYPE_WARNING:
      dataset_problems = self._dataset_warnings
      heading = 'Warnings'
    else:
      dataset_problems = self._dataset_errors
      heading = 'Errors'

    if not dataset_problems:
      return ''

    prefix = '<h2 class="issueHeader">%s:</h2>' % heading
    dataset_sections = []
    for dataset_merger, problems in dataset_problems.items():
      dataset_sections.append('<h3>%s</h3><ol>%s</ol>' % (
          dataset_merger.FILE_NAME, '\n'.join(problems)))
    body = '\n'.join(dataset_sections)
    return prefix + body
437758
def mutate(self):
        """"""
        section = self.section
        project_name = self.project_name

        section.project_name = project_name

        self.contribute_runtime_dir()

        main = section.main_process
        main.set_naming_params(prefix='[%s] ' % project_name)

        main.set_pid_file(
            self.get_pid_filepath(),
            before_priv_drop=False,  # For vacuum to cleanup properly.
            safe=True,
        )

        section.master_process.set_basic_params(
            fifo_file=self.get_fifo_filepath(),
        )

        # todo maybe autoreload in debug

        apps = section.applications
        apps.set_basic_params(
            manage_script_name=True,
        )

        self.contribute_error_pages()
        self.contribute_static()
710827
def create_yaml(directory, project_name, board,output_dir):
    # lay out what the common section a project yaml file will look like
    # The value mapped to by each key are the file extensions that will help us get valid files for each section
    logger.debug("Project name: %s, Target: %s"%(project_name,board))
    common_section = {
        'linker_file': FILES_EXTENSIONS['linker_file'],
        'sources': FILES_EXTENSIONS['source_files_c'] + FILES_EXTENSIONS['source_files_cpp'] +
                   FILES_EXTENSIONS['source_files_s'] + FILES_EXTENSIONS['source_files_obj'],
        'includes': FILES_EXTENSIONS['include_files']
    }

    # will be written to projects.yaml
    root = os.path.relpath(directory)
    projects_yaml = {
        'projects': {
            project_name:
                ['project.yaml']
        },
        'settings': {'export_dir': os.path.relpath(output_dir)}
    }

    # will be written to project.yaml
    project_yaml = {
        'common': {},
        'tool_specific': {}
    }
    # iterate over the common section defined above
    for section, extensions in common_section.items():
        # look for files in this directory that have the defined extensions, and add them to our project file
        project_yaml['common'][section] = _scan(section, directory,extensions)

    project_yaml['common']['target'] = [board] # user passes target in command line

    """"""
    tools = _determine_tool(project_yaml['common']['linker_file'])

    linkers = {}   # dictionary containing all linker files in the project directory

    # exhaust the iterator and add its yielded values to linkers
    for (file,tool) in tools:
        if tool in linkers:
            linkers[tool].append(file)
        else:
            linkers[tool] = [file]

    for tool, linker in linkers.items():
        if len(linker) > 1:
            # The project directory defined more than one linker for a tool
            print("\nMultipe linkers found for " + tool + "\n")
            for i, file in enumerate(linker):
                print(str(i) + ": " + file)
            answer = raw_input('\nWhich file do you want? ')
            while int(answer) not in range(0,len(linker)):
                answer = raw_input('Answer not in list. Which file do you want? ')
            project_yaml['tool_specific'][tool] = {'linker_file': [linkers[tool][int(answer)]]}
        else:
            project_yaml['tool_specific'][tool] = {'linker_file': linker}

    # linker file is now in tool_specific section
    del project_yaml['common']['linker_file']

    ret = _generate_file("projects.yaml", projects_yaml)
    if ret < 0: # make sure the first file generated correctly
        return -1
    ret = _generate_file("project.yaml", project_yaml)
    return ret
312774
def _generate_report(ret, show_tasks):
    '''
    
    '''

    returns = ret.get('return')

    sorted_data = sorted(
        returns.items(),
        key=lambda s: s[1].get('__run_num__', 0)
    )

    total = 0
    failed = 0
    changed = 0
    duration = 0.0

    changed_tasks = []
    failed_tasks = []

    # gather stats
    for state, data in sorted_data:
        # state: module, stateid, name, function
        _, stateid, _, _ = state.split('_|-')
        task = '{filename}.sls | {taskname}'.format(
            filename=str(data.get('__sls__')), taskname=stateid)

        if not data.get('result', True):
            failed += 1
            failed_tasks.append(task)

        if data.get('changes', {}):
            changed += 1
            changed_tasks.append(task)

        total += 1
        try:
            duration += float(data.get('duration', 0.0))
        except ValueError:
            pass

    unchanged = total - failed - changed

    log.debug('%s total: %s', __virtualname__, total)
    log.debug('%s failed: %s', __virtualname__, failed)
    log.debug('%s unchanged: %s', __virtualname__, unchanged)
    log.debug('%s changed: %s', __virtualname__, changed)

    report = {
        'id': ret.get('id'),
        'success': True if failed == 0 else False,
        'total': total,
        'function': ret.get('fun'),
        'arguments': ret.get('fun_args', []),
        'jid': ret.get('jid'),
        'duration': duration / 1000,
        'unchanged': {
            'counter': unchanged
        },
        'changed': {
            'counter': changed,
            'tasks': changed_tasks if show_tasks else []
        },
        'failed': {
            'counter': failed,
            'tasks': failed_tasks if show_tasks else []
        }
    }

    return report
413950
private void processProjectProperties()
   {
      //
      // Process common attributes
      //
      List<Row> rows = getRows("project", "proj_id", m_projectID);
      m_reader.processProjectProperties(rows, m_projectID);

      //
      // Process XER-specific attributes
      //
      if (m_defaultCurrencyData != null)
      {
         m_reader.processDefaultCurrency(m_defaultCurrencyData);
      }

      processScheduleOptions();
   }
181417
def generate_vars(project_name, project_dir):
    

    out = vary_name(project_name)
    out['random_key'] = make_random_key()
    out['settings_file'] = make_file_path(
        project_dir,
        project_name,
        path.join('src', project_name),
        'settings.py',
    )

    return out
259819
public function generate ()
	{
		$startTime = microtime (true);

		if (!is_dir($this->reportDir)) 
		{
			echo "Creating new directory {$this->reportDir}... ";
			mkdir ($this->reportDir);
			echo "OK\n";
		}

		echo "Generating HTML report to {$this->reportDir} ... ";
		$this->iterate ($this->report);

		$totalTime = number_format (microtime(true) - $startTime, 2);
		echo "OK ({$totalTime}s).\n";
	}
989748
def create_data_figs(self):
        

        logger.info("Generating the report data and figs from %s to %s",
                    self.start_date, self.end_date)

        self.get_sec_overview()
        self.get_sec_project_activity()
        self.get_sec_project_community()
        self.get_sec_project_process()

        logger.info("Data and figs done")
605029
def display(self) -> typing.Union[None, report.Report]:
        """"""
        return (
            self._project.current_step.report
            if self._project and self._project.current_step else
            None
        )
929638
def get_project_root():
    """"""
    cfg = get_project_configuration()
    # At this point it can be sure that the configuration file exists
    # Now make sure the project structure exists
    for dirname in ["raw-datasets",
                    "preprocessed",
                    "feature-files",
                    "models",
                    "reports"]:
        directory = os.path.join(cfg['root'], dirname)
        if not os.path.exists(directory):
            os.makedirs(directory)

    raw_yml_path = pkg_resources.resource_filename('hwrt', 'misc/')

    # TODO: How to check for updates if it already exists?
    raw_data_dst = os.path.join(cfg['root'], "raw-datasets/info.yml")
    if not os.path.isfile(raw_data_dst):
        raw_yml_pkg_src = os.path.join(raw_yml_path, "info.yml")
        shutil.copy(raw_yml_pkg_src, raw_data_dst)

    # Make sure small-baseline folders exists
    for dirname in ["models/small-baseline", "feature-files/small-baseline",
                    "preprocessed/small-baseline"]:
        directory = os.path.join(cfg['root'], dirname)
        if not os.path.exists(directory):
            os.makedirs(directory)

    # Make sure small-baseline yml files exist
    paths = [("preprocessed/small-baseline/", "preprocessing-small-info.yml"),
             ("feature-files/small-baseline/", "feature-small-info.yml"),
             ("models/small-baseline/", "model-small-info.yml")]
    for dest, src in paths:
        raw_data_dst = os.path.join(cfg['root'], "%s/info.yml" % dest)
        if not os.path.isfile(raw_data_dst):
            raw_yml_pkg_src = os.path.join(raw_yml_path, src)
            shutil.copy(raw_yml_pkg_src, raw_data_dst)

    return cfg['root']
882047
def main():
    """"""
    args = parse_arguments()
    pid = args.pid
    title = get_programme_title(pid)
    broadcast_date = get_broadcast_date(pid)
    listing = extract_listing(pid)
    filename = get_output_filename(args)
    tracklisting = generate_output(listing, title, broadcast_date)
    output_to_file(filename, tracklisting, args.action)
    print("Done!")
391748
def _generate_report_all(self):
        ''''''
        assert self.workbook is not None
        count = 0

        # Do all subfolders
        for sid in self.folders.subfolders(self.folder_id, self.user):
            count += 1
            self._generate_for_subfolder(sid)

        if count == 0:
            print("I: empty workbook created: no subfolders found")
742342
function generate (projectPatch, source, done) {
  shell.mkdir('-p', projectPatch)
  shell.cp('-Rf', source, projectPatch)
  done()
}
1164039
def generate_quickstart(project_path):
    """"""
    ensure_path_exists(project_path)
    ensure_file_exists(os.path.join(project_path, "config.yml"), DEFAULT_CONFIG_CONTENT)
    ensure_path_exists(os.path.join(project_path, 'models'))
    ensure_path_exists(os.path.join(project_path, 'data'))
    ensure_path_exists(os.path.join(project_path, 'themes'))
    ensure_path_exists(os.path.join(project_path, 'templates'))
    ensure_path_exists(os.path.join(project_path, 'templatetags'))
    ensure_path_exists(os.path.join(project_path, 'views'))
    ensure_path_exists(os.path.join(project_path, 'assets'))
133789
def generate_completions(event):
    
    """
    b = event.current_buffer

    # When already navigating through completions, select the next one.
    if b.complete_state:
        b.complete_next()
    else:
        event.cli.start_completion(insert_common_part=True, select_first=False)