Generates the Terminal Output for Standard cases

        Returns the dataset needed for the verbose output, as well as the failure flags.
433213
def standard_output(self, ds, limit, check_name, groups):
        

        score_list, points, out_of = self.get_points(groups, limit)
        issue_count = out_of - points

        # Let's add the version number to the check name if it's missing
        check_name = self._get_check_versioned_name(check_name)
        check_url = self._get_check_url(check_name)
        width = 2 * self.col_width
        print('\n')
        print("-" * width)
        print('{:^{width}}'.format("IOOS Compliance Checker Report", width=width))
        print('{:^{width}}'.format(check_name, width=width))
        print('{:^{width}}'.format(check_url, width=width))
        print("-" * width)
        if issue_count > 0:
            print('{:^{width}}'.format("Corrective Actions", width=width))
            plural = '' if issue_count == 1 else 's'
            print("{} has {} potential issue{}".format(os.path.basename(ds), issue_count, plural))

        return [groups, points, out_of]
1227498
def main(argv=None):
    

    parser = create_parser()
    args = parser.parse_args() if argv is None else parser.parse_args(argv)

    if not os.path.exists(args.path):
        sys.exit(0)

    all_valid = True
    single = os.path.isfile(args.path)
    files = [args.path] if single else iter_files(
        args.path, exts=('epub', ), recursive=args.recursive
    )

    pool = ThreadPool()
    results = pool.imap_unordered(EpubCheck, files)

    metas = tablib.Dataset(headers=Checker._fields + Meta._fields)
    messages = tablib.Dataset(headers=Message._fields)

    for result in results:
        metas.append(result.checker + result.meta.flatten())
        if not result.valid:
            all_valid = False
        for message in result.messages:
            messages.append(message)
            if message.level == 'ERROR':
                print(message.short, file=sys.stderr)
            else:
                print(message.short)

    if args.csv:
        args.csv.write(messages.export('csv', delimiter=b';'))

    if args.xls:
        databook = tablib.Databook((metas, messages))
        args.xls.write(databook.xls)

    if all_valid:
        return 0
    else:
        return 1
727944
def getOutput(self):
        
        output = self.stdout
        if self.stdout:
            output += '\r\n'
        output += self.stderr
        return output
388804
def _make_output(value, output_script, version=None):
    '''
    
    '''
    if 'decred' in riemann.get_current_network_name():
        return tx.DecredTxOut(
            value=value,
            version=version,
            output_script=output_script)
    return tx.TxOut(value=value, output_script=output_script)
636748
def generate_datafile(number_items=20000):
    
    from utils import generate_dataset_shelve
    filename = "samples.shelve"
    dataset = generate_dataset_shelve(filename, number_items)
    print "%s generated with %d samples" % (filename, number_items)
739969
def output_lines(self):
        
        if self.exception:
            return [self.EXCEPTION_HEADERS[0], '  ...'] + self.exception_detail
        else:
            return self.output
935224
def output(data, **kwargs):  # pylint: disable=unused-argument
    '''
    
    '''
    out = ''
    for id_ in data['data']:
        out += '{0}\n'.format(id_)
        for vm_ in data['data'][id_]['vm_info']:
            out += '  {0}\n'.format(vm_)
            vm_data = data[id_]['vm_info'][vm_]
            if 'cpu' in vm_data:
                out += '    CPU: {0}\n'.format(vm_data['cpu'])
            if 'mem' in vm_data:
                out += '    Memory: {0}\n'.format(vm_data['mem'])
            if 'state' in vm_data:
                out += '    State: {0}\n'.format(vm_data['state'])
            if 'graphics' in vm_data:
                if vm_data['graphics'].get('type', '') == 'vnc':
                    out += '    Graphics: vnc - {0}:{1}\n'.format(
                            id_,
                            vm_data['graphics']['port'])
            if 'disks' in vm_data:
                for disk, d_data in six.iteritems(vm_data['disks']):
                    out += '    Disk - {0}:\n'.format(disk)
                    out += '      Size: {0}\n'.format(d_data['disk size'])
                    out += '      File: {0}\n'.format(d_data['file'])
                    out += '      File Format: {0}\n'.format(d_data['file format'])
            if 'nics' in vm_data:
                for mac in vm_data['nics']:
                    out += '    Nic - {0}:\n'.format(mac)
                    out += '      Source: {0}\n'.format(
                                vm_data['nics'][mac]['source'][next(six.iterkeys(vm_data['nics'][mac]['source']))])
                    out += '      Type: {0}\n'.format(vm_data['nics'][mac]['type'])
    return out
796653
def _parse_output_for_errors(data, command, **kwargs):
    '''
    
    '''
    if re.search('% Invalid', data):
        raise CommandExecutionError({
            'rejected_input': command,
            'message': 'CLI excution error',
            'code': '400',
            'cli_error': data.lstrip(),
        })
    if kwargs.get('error_pattern') is not None:
        for re_line in kwargs.get('error_pattern'):
            if re.search(re_line, data):
                raise CommandExecutionError({
                    'rejected_input': command,
                    'message': 'CLI excution error',
                    'code': '400',
                    'cli_error': data.lstrip(),
                })
15694
def generate(self, output_dir, catalogue, results, label):
        """"""
        data = results.get_raw_data()
        labels = catalogue.ordered_labels
        ngrams = self._generate_results(output_dir, labels, data)
        ngram_table = self._generate_ngram_table(output_dir, labels, data)
        corpus_table = self._generate_corpus_table(labels, ngrams)
        context = {'corpus_table': corpus_table, 'focus_label': label,
                   'labels': labels, 'ngram_table': ngram_table, 'sep': os.sep}
        report_name = 'lifetime-{}.html'.format(label)
        self._write(context, output_dir, report_name)
758955
def produce_csv(input, output):
    
    '''
    output.write('"model","mean","std"\n')
    for model_data in input:
        output.write('"%s",%f,%f\n' % (model_data['name'], model_data['mean'], model_data['stddev']))
    output.flush()
    output.close()
    print("Wrote as %s" % output.name)
929884
def output_to_terminal(sources):
    """"""
    results = OrderedDict()
    for source in sources:
        if source.get_is_available():
            source.update()
            results.update(source.get_summary())
    for key, value in results.items():
        sys.stdout.write(str(key) + ": " + str(value) + ", ")
    sys.stdout.write("\n")
    sys.exit()
615233
def generate_data_files():
    
    assets_folder = path.join('source', 'rafcon', 'gui', 'assets')
    share_folder = path.join(assets_folder, 'share')
    themes_folder = path.join(share_folder, 'themes', 'RAFCON')
    examples_folder = path.join('share', 'examples')
    libraries_folder = path.join('share', 'libraries')

    gui_data_files = [
        get_data_files_tuple(assets_folder, 'splashscreens'),
        get_data_files_tuple(assets_folder, 'fonts', 'FontAwesome'),
        get_data_files_tuple(assets_folder, 'fonts', 'Source Sans Pro'),
        get_data_files_tuple(themes_folder, 'gtk-3.0', 'gtk.css', path_to_file=True),
        get_data_files_tuple(themes_folder, 'gtk-3.0', 'gtk-dark.css', path_to_file=True),
        get_data_files_tuple(themes_folder, 'assets'),
        get_data_files_tuple(themes_folder, 'sass'),
        get_data_files_tuple(themes_folder, 'gtk-sourceview'),
        get_data_files_tuple(themes_folder, 'colors.json', path_to_file=True),
        get_data_files_tuple(themes_folder, 'colors-dark.json', path_to_file=True)
    ]
    # print("gui_data_files", gui_data_files)

    icon_data_files = get_data_files_recursively(path.join(share_folder, 'icons'), share_target_root="icons")
    # print("icon_data_files", icon_data_files)

    locale_data_files = create_mo_files()
    # example tuple
    # locale_data_files = [('share/rafcon/locale/de/LC_MESSAGES', ['source/rafcon/locale/de/LC_MESSAGES/rafcon.mo'])]
    # print("locale_data_files", locale_data_files)

    version_data_file = [("./", ["VERSION"])]
    desktop_data_file = [("share/applications", [path.join('share', 'applications', 'de.dlr.rm.RAFCON.desktop')])]

    examples_data_files = get_data_files_recursively(examples_folder, share_target_root=path.join("rafcon", "examples"))
    libraries_data_files = get_data_files_recursively(libraries_folder, share_target_root=path.join("rafcon",
                                                                                                    "libraries"))
    generated_data_files = gui_data_files + icon_data_files + locale_data_files + version_data_file + \
                           desktop_data_file + examples_data_files + libraries_data_files
    # for elem in generated_data_files:
    #     print(elem)
    return generated_data_files
626439
def run_output(self):
        """"""
        for f in logdissect.output.__formats__:
            ouroutput = self.output_modules[f]
            ouroutput.write_output(self.data_set['finalized_data'],
                    args=self.args)
            del(ouroutput)

        # Output to terminal if silent mode is not set:
        if not self.args.silentmode:
            if self.args.verbosemode:
                print('\n==== ++++ ==== Output: ==== ++++ ====\n')
            for line in self.data_set['finalized_data']['entries']:
                print(line['raw_text'])
1148862
def outputs(ctx, client, revision, paths):
    
    """
    graph = Graph(client)
    filter = graph.build(paths=paths, revision=revision)
    output_paths = graph.output_paths

    click.echo('\n'.join(graph._format_path(path) for path in output_paths))

    if paths:
        if not output_paths:
            ctx.exit(1)

        from renku.models._datastructures import DirectoryTree
        tree = DirectoryTree.from_list(item.path for item in filter)

        for output in output_paths:
            if tree.get(output) is None:
                ctx.exit(1)
                return
798351
def datasets(self, libref: str = '') -> str:
        
        code = "proc datasets"
        if libref:
           code += " dd=" + libref
        code += "; quit;"

        if self.nosub:
           print(code)
        else:
           if self.results.lower() == 'html':
              ll = self._io.submit(code, "html")
              if not self.batch:
                 self.DISPLAY(self.HTML(ll['LST']))
              else:
                 return ll
           else:
              ll = self._io.submit(code, "text")
              if self.batch:
                 return ll['LOG'].rsplit(";*\';*\";*/;\n")[0]
              else:
                 print(ll['LOG'].rsplit(";*\';*\";*/;\n")[0])
1240465
def print_row_failures(failing_items, verbose=False, outfile_name=None):
    
    if outfile_name:
        outfile = open(outfile_name, "w")
        outfile.write("\t".join(["name", "row_number", "problem_type",
                                 "problem_col", "error_message"]))
        outfile.write("\n")
    else:
        outfile = None
    for ind, row in failing_items.iterrows():
        issues = row['issues']
        string = "{:10}  |  row number: {}".format(ind, str(row["num"]))
        first_string = "\t".join([str(ind), str(row["num"])])
        if verbose:
            print(first_string)
        #if outfile:
        #    ofile.write("{}\n".format(string))
        for key, issue in list(issues.items()):
            issue_type, issue_col = extract_col_name(key)
            string = "{:10}  |  {:10}  |  {}".format(issue_type, issue_col, issue)
            string = "\t".join([issue_type, issue_col, issue])
            if verbose:
                print(string)
            if outfile:
                outfile.write(first_string + "\t" + string + "\n")
    if outfile:
        outfile.close()
506325
def gen_outputs(self, riskinput, monitor, epspath=None, hazard=None):
        
        self.monitor = monitor
        hazard_getter = riskinput.hazard_getter
        if hazard is None:
            with monitor('getting hazard'):
                hazard_getter.init()
                hazard = hazard_getter.get_hazard()
        sids = hazard_getter.sids
        assert len(sids) == 1
        with monitor('computing risk', measuremem=False):
            # this approach is slow for event_based_risk since a lot of
            # small arrays are passed (one per realization) instead of
            # a long array with all realizations; ebrisk does the right
            # thing since it calls get_output directly
            assets_by_taxo = get_assets_by_taxo(riskinput.assets, epspath)
            for rlzi, haz in sorted(hazard[sids[0]].items()):
                out = self.get_output(assets_by_taxo, haz, rlzi)
                yield out