If verbose=True and terse=False, this will print to terminal. Otherwise, it won't.
545714
def input(self, string='', level=0, prompt='(please respond) '):
        ''''''
        self.report(string, level)
        return input("{0}".format(self._prefix + prompt))
1123738
def verbose(enabled):
    """"""
    def _vprint(msg, **kwargs):
        print(msg, **kwargs)
    def _nprint(msg, **kwargs):
        pass
    return _vprint if enabled else _nprint
946717
def check_command(self, command):
        

        # Use `command` to see if command is callable, store exit code
        code = os.system("command -v {0} >/dev/null 2>&1 || {{ exit 1; }}".format(command))

        # If exit code is not 0, report which command failed and return False, else return True
        if code != 0:
            print("Command is not callable: {0}".format(command))
            return False
        else:
            return True
787422
def is_print(value, space = True, tab = False, crlf = False):
    
    if not isinstance(value, basestring):
        return False

    regex = r'\x00-\x08\x0B\x0C\x0E-\x1F\x7F'

    if not space:
        regex += r'\x20'

    if tab:
        regex += r'\x09'

    if crlf:
        regex += r'\x0A\x0D'

    return re.match(r'[' + regex + ']', value, re.U) is None
751703
def _print_message(self, prefix, message, verbose=True):
        ''

        # Load up the standard output.
        output = ['\n', prefix, message['message']]

        # We have some extra stuff for verbose mode.
        if verbose:
            verbose_output = []

            # Detailed problem description.
            if message['description']:
                verbose_output.append(
                    self._flatten_list(message['description']))

            if message.get('signing_severity'):
                verbose_output.append(
                    ('\tAutomated signing severity: %s' %
                     message['signing_severity']))

            if message.get('signing_help'):
                verbose_output.append(
                    '\tSuggestions for passing automated signing:')
                verbose_output.append(
                    self._flatten_list(message['signing_help']))

            # Show the user what tier we're on
            verbose_output.append('\tTier:\t%d' % message['tier'])

            # If file information is available, output that as well.
            files = message['file']
            if files is not None and files != '':
                fmsg = '\tFile:\t%s'

                # Nested files (subpackes) are stored in a list.
                if type(files) is list:
                    if files[-1] == '':
                        files[-1] = '(none)'
                    verbose_output.append(fmsg % ' > '.join(files))
                else:
                    verbose_output.append(fmsg % files)

            # If there is a line number, that gets put on the end.
            if message['line']:
                verbose_output.append('\tLine:\t%s' % message['line'])
            if message['column'] and message['column'] != 0:
                verbose_output.append('\tColumn:\t%d' % message['column'])

            if message.get('context'):
                verbose_output.append('\tContext:')
                verbose_output.extend([('\t> %s' % x
                                        if x is not None
                                        else '\t>' + ('-' * 20))
                                       for x
                                       in message['context']])

            # Stick it in with the standard items.
            output.append('\n')
            output.append('\n'.join(verbose_output))

        # Send the final output to the handler to be rendered.
        self.handler.write(u''.join(map(unicodehelper.decode, output)))
1256121
def print_callback(val):
    
    success = False
    try:
        # for reasons I cannot fathom, regular printing, even directly
        # to io.stdout does not work.
        # I have to intrude rather deep into IPython to make it behave
        if have_ipython:
            if InteractiveShell.initialized():
                IPython.display.publish_display_data({'text/plain':val,'text/html':'<pre>' + val + '</pre>'})
                success = True
    except:
        pass

    if not success:
        print(val)
        sys.stdout.flush()
35633
def _maybe_print(something_to_print, end=None, min_=1, max_=99, verbose=0):
    """"""
    if min_ <= verbose <= max_:
        import sys
        print(something_to_print, end=end)
        sys.stdout.flush()
188765
def run(command, verbose=False):
    
    def do_nothing(*args, **kwargs):
        return None

    v_print = print if verbose else do_nothing

    p = subprocess.Popen(
        command,
        shell=True,
        stdout=subprocess.PIPE,
        stderr=subprocess.STDOUT,
        universal_newlines=True,
    )

    v_print("run:", command)

    def log_and_yield(line):
        if six.PY2:
            # If not unicode, try to decode it first
            if isinstance(line, str):
                line = line.decode('utf8', 'replace')
        v_print(line)
        return line

    output = ''.join(map(log_and_yield, p.stdout))
    status_code = p.wait()

    return CommandResult(command, output, status_code)
539770
def s(command, verbose=False, fail_fast=True, interactive=False):
    

    completed_process = None
    output = None
    if interactive:
        completed_process = subprocess.run(
            command,
            shell=True,
            stdin=sys.stdin,
            stdout=sys.stdout,
            stderr=sys.stderr,
        )
        output = {
            "exit_code": completed_process.returncode,
        }
    else:
        completed_process = subprocess.run(
            command,
            shell=True,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
        )
        output = {
            "exit_code": completed_process.returncode,
            "out": completed_process.stdout.decode('utf-8'),
            "err": completed_process.stderr.decode('utf-8'),
        }

    result = None
    if completed_process.returncode == 0:
        result = cmn.OkResult(output)
    else:
        result = cmn.ErrorResult(output)

    fail = fail_fast and not result.ok

    if verbose or fail:
        cmn.logger.log(
            "Executed shell command '{command}'\n"
            "exit code was: {exit_code}\n".format(
                command=command,
                **result.value
            )
        )

    if (verbose or fail) and not interactive:
        cmn.logger.log(
            "stdout was:\n{out}\n"
            "stderr was:\n{err}".format(
                **result.value
            )
        )

    if fail:
        cmn.fail("Failed executing shell command '{command}'".format(command=command))

    return result
167824
def log(self, text, key="?????", force=False):
        """"""
        if force or self.verbose:
            print ">>>> {} {}".format(key, text)
            sys.stdout.flush()
1049016
def __do_log(self, text):
        
        if isinstance(text, compat.unicode):
            text = text.encode('cp1252')
        if self.verbose:
            print(text)
        if self.logfile:
            try:
                self.fd.writelines('%s\n' % text)
            except IOError:
                e = sys.exc_info()[1]
                self.__logfile_error(e)
341878
def prog(self, s=None):
        
        s = s or self.prog_msg
        self.printer(s, end='')
1210633
def anchore_print(msg, do_formatting=False):
    
    if do_formatting:
        click.echo(formatter(msg))
    else:
        click.echo(msg)
1144420
private void checkArg(char command, String arg) throws DatatypeException,
            IOException {
        int mant = 0;
        int mantDig = 0;
        boolean mantPos = true;
        boolean mantRead = false;

        int exp = 0;
        int expDig = 0;
        int expAdj = 0;
        boolean expPos = true;

        switch (current) {
            case '-':
                mantPos = false;
            case '+':
                current = reader.read();
                appendToContext(current);
        }

        m1: switch (current) {
            default:
                reportUnexpected(arg + " for \u201c" + command
                        + "\u201d command", current);
                skipSubPath();
                return;

            case '.':
                break;

            case '0':
                mantRead = true;
                l: for (;;) {
                    current = reader.read();
                    appendToContext(current);
                    switch (current) {
                        case '1':
                        case '2':
                        case '3':
                        case '4':
                        case '5':
                        case '6':
                        case '7':
                        case '8':
                        case '9':
                            break l;
                        case '.':
                        case 'e':
                        case 'E':
                            break m1;
                        default:
                            return;
                        case '0':
                    }
                }

            case '1':
            case '2':
            case '3':
            case '4':
            case '5':
            case '6':
            case '7':
            case '8':
            case '9':
                mantRead = true;
                l: for (;;) {
                    if (mantDig < 9) {
                        mantDig++;
                        mant = mant * 10 + (current - '0');
                    } else {
                        expAdj++;
                    }
                    current = reader.read();
                    appendToContext(current);
                    switch (current) {
                        default:
                            break l;
                        case '0':
                        case '1':
                        case '2':
                        case '3':
                        case '4':
                        case '5':
                        case '6':
                        case '7':
                        case '8':
                        case '9':
                    }
                }
        }

        if (current == '.') {
            current = reader.read();
            appendToContext(current);
            m2: switch (current) {
                default:
                case 'e':
                case 'E':
                    if (!mantRead) {
                        reportNonNumber(command, current);
                        return;
                    }
                    break;

                case '0':
                    if (mantDig == 0) {
                        l: for (;;) {
                            current = reader.read();
                            appendToContext(current);
                            expAdj--;
                            switch (current) {
                                case '1':
                                case '2':
                                case '3':
                                case '4':
                                case '5':
                                case '6':
                                case '7':
                                case '8':
                                case '9':
                                    break l;
                                default:
                                    if (!mantRead) {
                                        return;
                                    }
                                    break m2;
                                case '0':
                            }
                        }
                    }
                case '1':
                case '2':
                case '3':
                case '4':
                case '5':
                case '6':
                case '7':
                case '8':
                case '9':
                    l: for (;;) {
                        if (mantDig < 9) {
                            mantDig++;
                            mant = mant * 10 + (current - '0');
                            expAdj--;
                        }
                        current = reader.read();
                        appendToContext(current);
                        switch (current) {
                            default:
                                break l;
                            case '0':
                            case '1':
                            case '2':
                            case '3':
                            case '4':
                            case '5':
                            case '6':
                            case '7':
                            case '8':
                            case '9':
                        }
                    }
            }
        }

        switch (current) {
            case 'e':
            case 'E':
                current = reader.read();
                appendToContext(current);
                switch (current) {
                    default:
                        reportNonNumber(command, current);
                        return;
                    case '-':
                        expPos = false;
                    case '+':
                        current = reader.read();
                        appendToContext(current);
                        switch (current) {
                            default:
                                reportNonNumber(command, current);
                                return;
                            case '0':
                            case '1':
                            case '2':
                            case '3':
                            case '4':
                            case '5':
                            case '6':
                            case '7':
                            case '8':
                            case '9':
                        }
                    case '0':
                    case '1':
                    case '2':
                    case '3':
                    case '4':
                    case '5':
                    case '6':
                    case '7':
                    case '8':
                    case '9':
                }

                en: switch (current) {
                    case '0':
                        l: for (;;) {
                            current = reader.read();
                            appendToContext(current);
                            switch (current) {
                                case '1':
                                case '2':
                                case '3':
                                case '4':
                                case '5':
                                case '6':
                                case '7':
                                case '8':
                                case '9':
                                    break l;
                                default:
                                    break en;
                                case '0':
                            }
                        }

                    case '1':
                    case '2':
                    case '3':
                    case '4':
                    case '5':
                    case '6':
                    case '7':
                    case '8':
                    case '9':
                        l: for (;;) {
                            if (expDig < 3) {
                                expDig++;
                                exp = exp * 10 + (current - '0');
                            }
                            current = reader.read();
                            appendToContext(current);
                            switch (current) {
                                default:
                                    break l;
                                case '0':
                                case '1':
                                case '2':
                                case '3':
                                case '4':
                                case '5':
                                case '6':
                                case '7':
                                case '8':
                                case '9':
                            }
                        }
                }
            default:
        }

        if (!expPos) {
            exp = -exp;
        }
        exp += expAdj;
        if (!mantPos) {
            mant = -mant;
        }

        return;
    }
540011
def cprint(text="", color=None, on_color=None, attrs=None, **kwargs):
    """"""
    # Assume 80 in case not running in a terminal
    columns, lines = shutil.get_terminal_size()
    if columns == 0:
        columns = 80  # Because get_terminal_size's default fallback doesn't work in pipes

    # Print text
    termcolor.cprint(textwrap.fill(text, columns, drop_whitespace=False),
                     color=color, on_color=on_color, attrs=attrs, **kwargs)
305465
def check_vprint(s, vprinter):
    ''''''
    if vprinter is True:
        print(s);
    elif callable(vprinter):
        vprinter(s);
1203892
def do_print (self, url_data):
        """"""
        if self.verbose:
            return True
        if self.warnings and url_data.warnings:
            return True
        return not url_data.valid