Runs the ur_pair_diff.
17463
def real_main(new_url=None,
              baseline_url=None,
              upload_build_id=None,
              upload_release_name=None):
    """"""
    coordinator = workers.get_coordinator()
    fetch_worker.register(coordinator)
    coordinator.start()

    item = UrlPairDiff(
        new_url,
        baseline_url,
        upload_build_id,
        upload_release_name=upload_release_name,
        heartbeat=workers.PrintWorkflow)
    item.root = True

    coordinator.input_queue.put(item)
    coordinator.wait_one()
    coordinator.stop()
    coordinator.join()
241974
def tune_pair(self, pair):
        """"""
        self._save_bm_state()
        self.pair = pair
        self.update_disparity_map()
125053
def compare(node1, node2):
    """"""
    if not os.path.isdir("a"):
        print("error: comparison feature not initialized", file=sys.stderr)
        sys.exit(4)

    print("=" * 80)
    print("WERKZEUG INTERNAL BENCHMARK -- COMPARE MODE".center(80))
    print("-" * 80)

    def _hg_update(repo, node):
        def hg(*x):
            return subprocess.call(
                ["hg"] + list(x), cwd=repo, stdout=null_out, stderr=null_out
            )

        hg("revert", "-a", "--no-backup")
        client = subprocess.Popen(
            ["hg", "status", "--unknown", "-n", "-0"], stdout=subprocess.PIPE, cwd=repo
        )
        unknown = client.communicate()[0]
        if unknown:
            client = subprocess.Popen(
                ["xargs", "-0", "rm", "-f"],
                cwd=repo,
                stdout=null_out,
                stdin=subprocess.PIPE,
            )
            client.communicate(unknown)
        hg("pull", "../..")
        hg("update", node)
        if node == "tip":
            diff = subprocess.Popen(
                ["hg", "diff"], cwd="..", stdout=subprocess.PIPE
            ).communicate()[0]
            if diff:
                client = subprocess.Popen(
                    ["hg", "import", "--no-commit", "-"],
                    cwd=repo,
                    stdout=null_out,
                    stdin=subprocess.PIPE,
                )
                client.communicate(diff)

    _hg_update("a", node1)
    _hg_update("b", node2)
    d1 = run("a", no_header=True)
    d2 = run("b", no_header=True)

    print("DIRECT COMPARISON".center(80))
    print("-" * 80)
    for key in sorted(d1):
        delta = d1[key] - d2[key]
        if abs(1 - d1[key] / d2[key]) < TOLERANCE or abs(delta) < MIN_RESOLUTION:
            delta = "=="
        else:
            delta = "%+.4f (%+d%%)" % (delta, round(d2[key] / d1[key] * 100 - 100))
        print("%36s   %.4f    %.4f    %s" % (format_func(key), d1[key], d2[key], delta))
    print("-" * 80)
696324
def _load(self):
        """"""
        self.is_running = True
        self.pair_generator = self._iterator(self.plugins,
                                             self.context)
        self.current_pair = next(self.pair_generator, (None, None))
        self.current_error = None
        self.is_running = False
659232
def run_evaluate(self, *args, **kwargs) -> None:
        
        if self._needs_evaluation:
            for _, item in self._nested_items.items():
                item.run_evaluate()
1202313
def diff(actual, expected):
    
    return '\n'.join(list(
        difflib.unified_diff(actual.splitlines(), expected.splitlines())
    ))
618822
def equals_log_diff(expected, actual, level=logging.ERROR):
  """"""
  if expected == actual:
    return True

  # Output the diff first.
  logging.log(level, '***** Data mismatch: *****')
  for line in difflib.unified_diff(
      expected.splitlines(), actual.splitlines(),
      fromfile='expected', tofile='actual', lineterm=''):
    logging.log(level, line)
  logging.log(level, '^^^^^  Data diff  ^^^^^')
796721
def diff(self):
        """"""
        done = set(self.done)
        return [name for name in self.todo if name not in done]
104469
def diff(*args):
    """"""
    parser = argparse.ArgumentParser(prog="%s %s" % (__package__, diff.__name__), description=diff.__doc__)
    parser.add_argument('FILENAME', help="file(s) to show changes in", nargs="*", default=['.'])
    parser.add_argument('-U', '--unified', type=int, dest="NUM", default=3, action="store", help="number of lines of context to show")
    args = parser.parse_args(args)

    config = FragmentsConfig()

    for s, curr_path in _iterate_over_files(args.FILENAME, config, statuses='MAD'):
        key = os.path.relpath(curr_path, config.root)
        if key not in config['files']:
            yield "Could not diff '%s', it is not being followed" % os.path.relpath(curr_path)
            continue

        if s in 'MAD':
            repo_lines = []
            curr_lines = []
            if s in 'MA':
                with _smart_open(curr_path, 'r') as curr_file:
                    curr_lines = curr_file.readlines()
            if s in 'MD':
                repo_path = os.path.join(config.directory, config['files'][key])
                with _smart_open(repo_path, 'r') as repo_file:
                    repo_lines = repo_file.readlines()
            weave = Weave()
            weave.add_revision(1, repo_lines, [])
            weave.add_revision(2, curr_lines, [])
            for l in _full_diff(weave.merge(1, 2), key, context_lines=args.NUM):
                yield l
129449
def run_step(self):
        """"""
        rewriter = StreamRewriter(self.context.iter_formatted_strings)
        super().run_step(rewriter)
441814
def _make_diff(self, correct, given):
        """"""
        dmp = DMP()
        dmp.Diff_Timeout = 4
        text1, text2, array = dmp.diff_linesToChars(correct, given)
        diffs = dmp.diff_main(text1, text2)
        dmp.diff_cleanupSemantic(diffs)
        dmp.diff_charsToLines(diffs, array)
        return list(dmp_to_mdiff(diffs))
881256
def run(self, change):
        

        if self._formats is None:
            self.setup()

        entry = self.entry

        for fmt in self._formats:
            fmt.run(change, entry)

        self.clear()
1528
def run(self):
        """"""
        if self.mloginfo.logfile.repl_set:
            print("    rs name: %s" % self.mloginfo.logfile.repl_set)
            print(" rs members: %s"
                  % (self.mloginfo.logfile.repl_set_members
                     if self.mloginfo.logfile.repl_set_members
                     else "unknown"))
            print(" rs version: %s"
                  % (self.mloginfo.logfile.repl_set_version
                     if self.mloginfo.logfile.repl_set_version
                     else "unknown"))
            print("rs protocol: %s"
                  % (self.mloginfo.logfile.repl_set_protocol
                     if self.mloginfo.logfile.repl_set_protocol
                     else "unknown"))
        else:
            print("  no rs info changes found")
788009
def modified_lines_from_diff(self, diff):
        
        from pep8radius.diff import modified_lines_from_udiff
        for start, end in modified_lines_from_udiff(diff):
            yield start, end
1290270
def run():
    """"""
    args = parse()
    build_results = [build(p) for p in glob.iglob(glob_path)]

    if not args['publish']:
        return

    for entry in build_results:
        publish(entry)
1263590
def run(self):
        
        # Set a stream to replace stdout, and get results in it
        stdoutBak = sys.stdout
        streamResult = StringIO()
        sys.stdout = streamResult
        try:
            pycodestyle.Checker.check_all(self)
        finally:
            sys.stdout = stdoutBak
519966
def run(self):
        
        for i in xrange(self.nreq):
            req = '%s_%s' % (self.ident, i)
            pre_request(None, req)
            sleep(random() / 2)
            post_request(None, req)