Print solver version and exit.
976926
def _print_version(ctx, _, value):
    """"""
    if not value or ctx.resilient_parsing:
        return
    click.echo(analyzer_version)
    ctx.exit()
218109
function printTimingAndExit(startTime) {
  const execTime = time() - startTime;

  printColumns(chalk.green(`Finished in: ${execTime.toFixed()}ms`));
  process.exit(0);
}
1310419
def adapt_files(solver):
    

    print("adapting {0}'s files".format(solver))
    root = os.path.join('solvers', solver)

    for arch in to_extract[solver]:
        arch = os.path.join(root, arch)
        extract_archive(arch, solver, put_inside=True)

    for fnames in to_move[solver]:
        old = os.path.join(root, fnames[0])
        new = os.path.join(root, fnames[1])
        os.rename(old, new)

    for f in to_remove[solver]:
        f = os.path.join(root, f)
        if os.path.isdir(f):
            shutil.rmtree(f)
        else:
            os.remove(f)
69229
def print(formatted = nil)
      result = name
      unless version.nil?
        result += ", version #{version}"
      end
      if formatted
        result = "#{FORMATTING_STAR.colorize(:yellow)} #{result}"
      end
      result
    end
1138895
def main(ctx, opts, version):
    """"""
    # pylint: disable=unused-argument
    if version:
        print_version()
    elif ctx.invoked_subcommand is None:
        click.echo(ctx.get_help())
851328
def exit(self, status=0, message=None):
        '''
        
        '''
        self.exited = True
        self.status = status

        if message is not None:
            self.outp.printf(message)
        raise s_exc.ParserExit(mesg=message, status=status)
330241
def _check_pypi_version(self):
        
        try:
            check_version()
        except VersionException as err:
            print(str(err), file=sys.stderr)
            time.sleep(TWO_SECONDS)
433135
def exit(self) -> None:
        """"""
        total = sum(len(logs) for logs in self.logs.values())
        if self.json:
            self.logs['total'] = total
            print(json.dumps(self.logs, indent=self.indent))

        else:
            for name, log in self.logs.items():
                if not log or self.parser[name].as_bool("quiet"):
                    continue

                print("[[{0}]]".format(name))
                getattr(snekchek.format, name + "_format")(log)
                print("\n")

            print("-" * 30)
            print("Total:", total)

        sys.exit(self.status_code)
1068850
def exit(exit_code=0):
  
  """
  core.processExitHooks()

  if state.isExitHooked and not hasattr(sys, 'exitfunc'): # The function is called from the exit hook
    sys.stderr.flush()
    sys.stdout.flush()
    os._exit(exit_code) #pylint: disable=W0212

  sys.exit(exit_code)
601244
def _get_conda_version(stdout, stderr):
        """"""
        # argparse outputs version to stderr in Python < 3.4.
        # http://bugs.python.org/issue18920
        pat = re.compile(r'conda:?\s+(\d+\.\d\S+|unknown)')
        m = pat.match(stderr.decode().strip())
        if m is None:
            m = pat.match(stdout.decode().strip())

        if m is None:
            raise Exception('output did not match: {0}'.format(stderr))

        return m.group(1)
477327
public void initForSolve(PrintStream out)
    {
        final int width = matrix.getWidth();
        final int height = matrix.getHeight();

        mTop = fillInTopVariables(width - 1);
        mSide = fillInConstants(height);
        //System.out.println("INIT-SOLVE matrix.h=" + matrix.getHeight() +
        //        " matrix.w=" + matrix.getWidth() + " m.array.length=" +
        //        matrix.getArray().length + " m.array[0].length=" + matrix.getArray()[0].length);
        mArrayhide = fillInArray(matrix.getArray(), constantsInThisColumnIndex);

        nullPrintln(out, "INIT-SOLVE, TOP.length = " + mTop.length + " matrix.height=" + height + " matrix.w=" + width);
        printTopArraySide(out);

    }
1215842
def solve(self, printmat=0, sendback=0, silent=False):
        ''''''
        # Initialize elements
        self.initialize()
        # Compute number of equations
        self.neq = np.sum([e.nunknowns for e in self.elementlist])
        if self.neq == 0: return
        if silent is False:
            print('Number of elements, Number of equations:', len(
                self.elementlist), ',', self.neq)
        if self.neq == 0:
            if silent is False: print('No unknowns. Solution complete')
            return
        mat = np.empty((self.neq, self.neq))
        rhs = np.empty(self.neq)
        ieq = 0
        for e in self.elementlist:
            if e.nunknowns > 0:
                mat[ieq:ieq + e.nunknowns, :], rhs[ieq:ieq + e.nunknowns] = \
                e.equation()
                ieq += e.nunknowns
            if silent is False:
                print('.', end='', flush=True)
        if printmat:
            return mat, rhs
        sol = np.linalg.solve(mat, rhs)
        icount = 0
        for e in self.elementlist:
            if e.nunknowns > 0:
                e.setparams(sol[icount:icount + e.nunknowns])
                icount += e.nunknowns
        if silent is False:
            print()  # needed cause the dots are printed
            print('solution complete')
        elif (silent == 'dot') or (silent == '.'):
            print('.', end='', flush=True)
        if sendback:
            return sol
        return
1199579
def main(args=None):
    """"""
    retcode = 0
    try:
        ci = CliInterface()
        args = ci.parser.parse_args()
        result = args.func(args)
        if result is not None:
            print(result)
        retcode = 0
    except Exception:
        retcode = 1
        traceback.print_exc()
    sys.exit(retcode)
1261369
def _possibly_exit_with_help(parser, known_args):
        
        if known_args.core_help or known_args.core_help_all:
            parser.print_help()
            sys.exit()
78140
def _chk_docopt_exit(self, args, exp_letters):
        """"""
        if args is None:
            args = sys.argv[1:]
        keys_all = self.exp_keys.union(self.exp_elems)
        if exp_letters:
            keys_all |= exp_letters
        unknown_args = self._chk_docunknown(args, keys_all)
        if unknown_args:
            raise RuntimeError("{USAGE}\n    **FATAL: UNKNOWN ARGS: {UNK}".format(
                USAGE=self.doc, UNK=" ".join(unknown_args)))
926666
def print_parameters(self):
        
        self.print_info(u"Available parameters:")
        self.print_generic(u"\n" + u"\n".join(self.PARAMETERS) + u"\n")
        return self.HELP_EXIT_CODE
1219604
def _get_version_output(self):
        
        if not self.executable:
            return ''
        command = [self.executable, '--version']
        out, _, _ = self._check(self.conn, command)
        try:
            return out.decode('utf-8').split()[2]
        except IndexError:
            return ''