Print a header for the results of either a file or an object.
559221
def print_results_header(identifier, is_valid):
    
    print_horizontal_rule()
    print_level(logger.info, "[-] Results for: %s", 0, identifier)

    if is_valid:
        marker = _GREEN + "[+]"
        verdict = "Valid"
        log_func = logger.info
    else:
        marker = _RED + "[X]"
        verdict = "Invalid"
        log_func = logger.error
    print_level(log_func, "%s STIX JSON: %s", 0, marker, verdict)
602167
def _print_results(filename, data):
    
    if filename:
        with open(filename, 'wb') as f:
            f.write(data)
    else:
        print data
1291757
def _get_clstr_outfile(self):
        """"""
        if self.Parameters['-o'].isOn():
            return ''.join([self.Parameters['-o'].Value, '.clstr'])
        else:
            raise ValueError, "No output file specified"
440201
def header(cls, name, type_=Type.String, description=None, default=None, required=None, **options):
        
        return cls(name, In.Header, type_, None, description,
                   required=required, default=default,
                   **options)
943211
private void printHeader(MetricType metricType, String name, String description) {
		print("# HELP ");
		print(METRIC_PREFIX);
		print(name);
		print(' ');
		println(description);

		print("# TYPE ");
		print(METRIC_PREFIX);
		print(name);
		print(' ');
		println(metricType.getCode());
	}
289835
def explore_show_head(self, uri, check_headers=None):
        
        print("HEAD %s" % (uri))
        if (re.match(r'^\w+:', uri)):
            # Looks like a URI
            response = requests.head(uri)
        else:
            # Mock up response if we have a local file
            response = self.head_on_file(uri)
        print("  status: %s" % (response.status_code))
        if (response.status_code == '200'):
            # print some of the headers
            for header in ['content-length', 'last-modified',
                           'lastmod', 'content-type', 'etag']:
                if header in response.headers:
                    check_str = ''
                    if (check_headers is not None and
                            header in check_headers):
                        if (response.headers[header] == check_headers[header]):
                            check_str = ' MATCHES EXPECTED VALUE'
                        else:
                            check_str = ' EXPECTED %s' % (
                                check_headers[header])
                    print(
                        "  %s: %s%s" %
                        (header, response.headers[header], check_str))
868703
synchronized void print(TestResult result, long runTime) {
        printHeader(runTime);
        printErrors(result);
        printFailures(result);
        printFooter(result);
    }
502123
def get_header(results):
    ''''''
    ret = ['name', ]
    values = next(iter(results.values()))
    for k, v in values.items():
        if isinstance(v, dict):
            for metric in v.keys():
                ret.append('%s:%s' % (k, metric))
        else:
            ret.append(k)
    return ret
756998
def show(cls, result):
        
        if result.ok:
            if result.stdout:
                out = '\n'.join(result.stdout)
                if result.value and result.value != '()':
                    return '\n'.join([out, result.value])
                return out
            if result.value and not cls._is_function_value(result.value):
                return result.value
            return cls.show_type(result)
        return result.value
1023268
def dump(self, f, name):
        """"""
        # print the header line
        value = self.get()
        kind = self.get_kind(value)
        print("% 40s  kind=%s  value=%s" % (name, kind, value), file=f)
1182103
def print_and_exit(results):
    """"""
    for success, value in results:
        if success:
            print value.encode(locale.getpreferredencoding())
        else:
            value.printTraceback()
1274743
def process(self, object, h, n=0, nl=False):
        
        if object is None:
            return 'None'
        if isinstance(object, Object):
            if len(object) == 0:
                return '<empty>'
            else:
                return self.print_object(object, h, n+2, nl)
        if isinstance(object, dict):
            if len(object) == 0:
                return '<empty>'
            else:
                return self.print_dictionary(object, h, n+2, nl)
        if isinstance(object, (list, tuple)):
            if len(object) == 0:
                return '<empty>'
            else:
                return self.print_collection(object, h, n+2)
        if isinstance(object, basestring):
            return '"%s"' % tostr(object)
        return '%s' % tostr(object)
681725
def printable(object)
      case object
      when Array  then :array
      when Hash   then :hash
      when File   then :file
      when Dir    then :dir
      when Struct then :struct
      else object.class.to_s.gsub(/:+/, "_").downcase.to_sym
      end
    end
350434
def _print_results(file, status):
        

        file_color = c.Fore.GREEN
        status_color = c.Fore.RED
        if status == 'Success':
            status_color = c.Fore.GREEN
        elif status == 'Skipped':
            status_color = c.Fore.YELLOW
        print(
            '{}{!s:<13}{}{!s:<35}{}{!s:<8}{}{}'.format(
                c.Fore.CYAN,
                'Downloading:',
                file_color,
                file,
                c.Fore.CYAN,
                'Status:',
                status_color,
                status,
            )
        )
1238831
def pprint(obj, file_=None):
    

    if file_ is None:
        file_ = sys.stdout

    # functions, methods
    if callable(obj) and hasattr(obj, "_code"):
        obj._code.pprint(file_)
        return

    # classes
    if isinstance(obj, type) and hasattr(obj, "_constructors"):
        constructors = obj._constructors
        for names, func in sorted(constructors.items()):
            func._code.pprint(file_)
        return

    raise TypeError("unkown type")
716426
def fprint(self, obj, stream=None, **kwargs):
        """"""
        if stream is None:
            stream = sys.stdout

        options = self.options
        options.update(kwargs)

        if isinstance(obj, dimod.SampleSet):
            self._print_sampleset(obj, stream, **options)
            return

        raise TypeError("cannot format type {}".format(type(obj)))
388832
def report_header(output)
      output.title('Request summary')

      output.with_style(cell_separator: false) do
        output.table({ width: 20 }, { font: :bold }) do |rows|
          source.processed_files.each do |f|
            rows << ['Processed File:', f]
          end
          rows << ['Parsed lines:',     source.parsed_lines]
          rows << ['Skipped lines:',    source.skipped_lines]
          rows << ['Parsed requests:',  source.parsed_requests]
          rows << ['Skipped requests:', source.skipped_requests]
          rows << ['Warnings:', @warnings_encountered.map { |(key, value)| "#{key}: #{value}" }.join(', ')] if has_warnings?
        end
      end
      output << "\n"
    end