Calls functions for dropping constraints and indexes.

    :param stdout: output stream
    :return: None
332091
def remove_all_labels(stdout=None):
    

    if not stdout:
        stdout = sys.stdout

    stdout.write("Droping constraints...\n")
    drop_constraints(quiet=False, stdout=stdout)

    stdout.write('Droping indexes...\n')
    drop_indexes(quiet=False, stdout=stdout)
693277
def out(*output, **kwargs):
    
    output = ' '.join([str(o) for o in output])
    if kwargs.get('wrap') is not False:
        output = '\n'.join(wrap(output, kwargs.get('indent', '')))
    elif kwargs.get('indent'):
        indent = kwargs['indent']
        output = indent + ('\n' + indent).join(output.splitlines())
    sys.stdout.write(output + '\n')
215668
def eout(s):
    

    if allow_print: 
       if con_encoding=='':
          x=sys.stdin.encoding
          if x==None: 
             b=s.encode()
          else:
             b=s.encode(x, 'ignore')
       else:
          b=s.encode(con_encoding, 'ignore')

       if sys.version_info[0]>2:
          try: # We encountered issues on ipython with Anaconda
               # and hence made this work around
             sys.stderr.buffer.write(b)
             sys.stderr.buffer.write(b'\n')
          except Exception as e: 
             sys.stderr.write(s)
             pass
       else:
          sys.stderr.write(b)

    sys.stderr.flush()

    return None
959000
def popen(self, stdout, stderr):
        
        self.logger.info('Executing command: %s', self.command_str)
        return subprocess.Popen([self._executor_script], stdout=stdout, stderr=stderr)
721801
def run(command, get_output=False, cwd=None):
    
    if cwd is None:
        cwd = GITPATH

    cprint('===')
    cprint('===  Command: ', command)
    cprint('===  CWD:     ', cwd)
    cprint('===')

    if get_output:
        proc = capture_stdout(command, cwd=cwd)
        out = proc.stdout.read().decode()
        print(out, end='')
        check_exit_code(proc.returncode)
        return out
    else:
        proc = sarge_run(command, cwd=cwd)
        check_exit_code(proc.returncode)
768112
def main() -> None:
    
    logging.basicConfig(level=logging.DEBUG)
    parser = argparse.ArgumentParser()
    parser.add_argument("inputfile", nargs="?", help="Input file name")
    parser.add_argument(
        "--availability", nargs='*',
        help="File extensions to check availability for (use a '.' prefix, "
             "and use the special extension 'None' to check the fallback "
             "processor")
    parser.add_argument(
        "--plain", action="store_true",
        help="Keep it plain: minimize layout (e.g. of tables) and maximize "
             "the likelihood of source sentence flowing properly in the "
             "output (e.g. for natural language processing).")
    parser.add_argument(
        "--width", type=int, default=DEFAULT_WIDTH,
        help="Word wrapping width (default {})".format(DEFAULT_WIDTH))
    parser.add_argument(
        "--min-col-width", type=int, default=DEFAULT_MIN_COL_WIDTH,
        help="Minimum column width for tables (default {})".format(
            DEFAULT_MIN_COL_WIDTH))
    args = parser.parse_args()
    if args.availability:
        for ext in args.availability:
            if ext.lower() == 'none':
                ext = None
            available = is_text_extractor_available(ext)
            print("Extractor for extension {} present: {}".format(ext,
                                                                  available))
        return
    if not args.inputfile:
        parser.print_help(sys.stderr)
        return
    config = TextProcessingConfig(
        width=args.width,
        min_col_width=args.min_col_width,
        plain=args.plain,
    )
    result = document_to_text(filename=args.inputfile, config=config)
    if result is None:
        return
    else:
        print(result)
246909
def __dump_stack(self):
        
        maxdepth = len(self._mode_stack)
        maxdepth_strlen = len(str(maxdepth))
        index_width = 4 - (-maxdepth_strlen) % 4 + 4
        index_str = lambda i: '{:<{}d}'.format(i, index_width)

        self.stdout.write(index_str(0) + self.root_prompt)
        self.stdout.write('\n')

        tree_prefix = '└── '
        for i in range(maxdepth):
            index_prefix = index_str(i + 1)
            whitespace_prefix = ' ' * len(tree_prefix) * i
            mode = self._mode_stack[i]
            line = index_prefix + whitespace_prefix + \
                    tree_prefix + mode.prompt + \
                    ': {}@{}'.format(mode.cmd, mode.args)
            self.stdout.write(line)
            self.stdout.write('\n')
1218253
def drop_indexes(quiet=True, stdout=None):
    

    results, meta = db.cypher_query("CALL db.indexes()")
    pattern = re.compile(':(.*)\((.*)\)')
    for index in results:
        db.cypher_query('DROP ' + index[0])
        match = pattern.search(index[0])
        stdout.write(' - Dropping index on label {0} with property {1}.\n'.format(
            match.group(1), match.group(2)))
    stdout.write("\n")
693869
def clear(self):
        
        if hasattr(self.stdout, 'isatty') and self.stdout.isatty() or self.term_type == 'mintty':
            cmd, shell = {
                'posix': ('clear', False),
                'nt': ('cls', True),
                'cygwin': (['echo', '-en', r'\ec'], False),
                'mintty': (r'echo -en "\ec', False),
            }[self.term_type]
            subprocess.call(cmd, shell=shell, stdin=self.stdin, stdout=self.stdout, stderr=self.stderr)
226728
function outputStdout(s, outputHandler) {
  if (outputHandler) {
    outputHandler(s);
  } else {
    process.stdout.write(s);
  }
}
182197
def tail(self, stream='stdout', num_lines=10):
        
        target = self._map_string_to_file(stream)
        if not target:  # no current temp file
            last_run = self.backend.get_latest_run_log(self.parent_job.job_id,
                                                       self.name)
            if not last_run:
                return None
            return self._tail_string(last_run['tasks'][self.name][stream],
                                     num_lines)
        else:
            return self._tail_temp_file(target, num_lines)
390380
def stdout(self):
        
        streams = self._payload.get('streams', None)
        return streams[0] if streams is not None and len(streams) >= 1 else ''
1068356
def _pop(self, command, *args, **kwargs):
        
        result = self._traverse_command(command, *args, **kwargs)
        if self.indexable:
            self.deindex([result])
        return result
5521
def out(*args):
    
    for value in args:
        sys.stdout.write(value)

    sys.stdout.write(os.linesep)
271462
def parse_stdout(self, filelike):
        
        from aiida.orm import Dict

        numbers = {}
        content = filelike.read().strip()

        if not content:
            return self.exit_codes.ERROR_EMPTY_OUTPUT_FILE

        try:
            for line in content.split('\n'):
                formula, identifier, count, _ = re.split(r'\s+', line.strip())
                numbers[identifier] = {'count': int(count), 'formula': formula}
        except Exception:  # pylint: disable=broad-except
            self.logger.exception('Failed to parse the numbers from the stdout file\n%s', traceback.format_exc())
            return self.exit_codes.ERROR_PARSING_OUTPUT_DATA
        else:
            self.out('numbers', Dict(dict=numbers))

        return
503967
def print_update(self, stream=sys.stdout, job_stats=None):
        
        if job_stats is None:
            job_stats = JobStatusVector()
            job_det_list = []
            job_det_list += self._scatter_link.jobs.values()

            for job_dets in job_det_list:
                if job_dets.status == JobStatus.no_job:
                    continue
                job_stats[job_dets.status] += 1

        stream.write("Status :\n  Total  : %i\n  Unknown: %i\n" %
                     (job_stats.n_total, job_stats[JobStatus.unknown]))
        stream.write("  Not Ready: %i\n  Ready: %i\n" %
                     (job_stats[JobStatus.not_ready], job_stats[JobStatus.ready]))
        stream.write("  Pending: %i\n  Running: %i\n" %
                     (job_stats[JobStatus.pending], job_stats[JobStatus.running]))
        stream.write("  Done: %i\n  Failed: %i\n" %
                     (job_stats[JobStatus.done], job_stats[JobStatus.failed]))
355180
def stdout_to_results(s):
    """"""
    results = s.strip().split('\n')
    return [BenchmarkResult(*r.split()) for r in results]