Display a standalone shell.
510824
def display_console(self, request):
        """"""
        if 0 not in self.frames:
            if self.console_init_func is None:
                ns = {}
            else:
                ns = dict(self.console_init_func())
            ns.setdefault("app", self.app)
            self.frames[0] = _ConsoleFrame(ns)
        is_trusted = bool(self.check_pin_trust(request.environ))
        return Response(
            render_console_html(secret=self.secret, evalex_trusted=is_trusted),
            mimetype="text/html",
        )
678503
def display(name):
    '''
    
    '''
    cmd = [_get_cmd(), '--display', name]
    out = __salt__['cmd.run_all'](cmd, python_shell=False)
    if out['retcode'] > 0 and out['stderr'] != '':
        return out['stderr']
    return out['stdout']
1296051
def prepare_shell_data(self, shells, key, entry):
        """"""
        if self.can_process_shell(entry):
            if key in ['python']:
                entry['type'] = key

            if 'with' in entry and isinstance(entry['with'], str):
                rendered_with = ast.literal_eval(render(entry['with'],
                                                        variables=self.pipeline.variables,
                                                        model=self.pipeline.model,
                                                        env=self.get_merged_env(include_os=True)))
            elif 'with' in entry:
                rendered_with = entry['with']
            else:
                rendered_with = ['']

            for item in rendered_with:
                shells.append({
                    'id': self.next_task_id,
                    'creator': key,
                    'entry': entry,
                    'model': self.pipeline.model,
                    'env': self.get_merged_env(),
                    'item': item,
                    'dry_run': self.pipeline.options.dry_run,
                    'debug': self.pipeline.options.debug,
                    'strict': self.pipeline.options.strict,
                    'variables': self.pipeline.variables,
                    'temporary_scripts_path': self.pipeline.options.temporary_scripts_path})
                self.next_task_id += 1
1001741
def main():
    

    print("Ontospy " + VERSION)

    Shell()._clear_screen()
    print(Style.BRIGHT + "** Ontospy Interactive Ontology Browser " + VERSION + " **" + Style.RESET_ALL)
    # manager.get_or_create_home_repo()
    Shell().cmdloop()
    raise SystemExit(1)
450473
def cli(ctx, path, renku_home, use_external_storage):
    """"""
    ctx.obj = LocalClient(
        path=path,
        renku_home=renku_home,
        use_external_storage=use_external_storage,
    )
1260043
def shell():
    
    ctx = _get_shell_ctx()
    try:
        import IPython
        IPython.embed(header=_get_shell_banner(), user_ns=ctx)
    except ImportError:
        import code
        code.interact(banner=_get_shell_banner(verbose=True), local=ctx)
112652
def shell(self, *args, **kwargs):
        
        args = ['shell'] + list(args)
        return self.run_cmd(*args, **kwargs)
940375
def run_external_subprocess_in_background(command_list, env=None):
    """"""
    if system_os == "Windows":
        DETACHED_PROCESS = 0x00000008
        p = subprocess.Popen(command_list, shell=False, stdin=None, stdout=None,
                stderr=None, close_fds=True, creationflags=DETACHED_PROCESS, env=env)
    else:
        p = subprocess.Popen(command_list, shell=False, stdin=None, stdout=None,
                stderr=None, close_fds=True, env=env)
    return p
182738
def shell(args, wait=True, msg=None):
    

    # Fix Windows error if passed a string
    if isinstance(args, str):
        args = shlex.split(args, posix=(os.name != "nt"))
        if os.name == "nt":
            args = [arg.replace('/', '\\') for arg in args]

    if wait:
        proc = Popen(args, stdin=PIPE, stdout=PIPE, stderr=PIPE)
        out, err = proc.communicate(input=msg)
        exitcode = proc.returncode
        if exitcode != 0:
            raise IOError(err)
        return out
    else:
        DETACHED_PROCESS = 0x00000008
        proc = Popen(args, creationflags=DETACHED_PROCESS)
1204652
def _do_shell(self, line):
        """"""
        if not line:
            return
        sp = Popen(line,
                   shell=True,
                   stdin=PIPE,
                   stdout=PIPE,
                   stderr=PIPE,
                   close_fds=not WINDOWS)
        (fo, fe) = (sp.stdout, sp.stderr)
        if PY2:
            out = fo.read().strip(EOL)
            err = fe.read().strip(EOL)
        else:
            out = fo.read().decode("utf-8")
            err = fe.read().decode("utf-8")
        if out:
            print(out)
            return
        if err:
            print(err.replace('isbn_', ''))
1248259
def standalone(body):
    
    with open(_ROOT + '/html.dat', 'r') as html_template:
        head = html_title()
        html = "".join(html_template.readlines()) \
                 .replace("{{HEAD}}", head) \
                 .replace("{{BODY}}", body)
        return html
238170
def shell(self):
        
        click.echo(click.style("NOTICE!", fg="yellow", bold=True) + " This is a " + click.style("local", fg="green", bold=True) + " shell, inside a " + click.style("Zappa", bold=True) + " object!")
        self.zappa.shell()
        return
577596
def cli():
    """"""
    objcli = WrHierCli(sys.argv[1:])
    fouts_txt = objcli.get_fouts()
    if fouts_txt:
        for fout_txt in fouts_txt:
            objcli.wrtxt_hier(fout_txt)
    else:
        objcli.prt_hier(sys.stdout)
295722
def shell
      @shell ||= if options[:no_color] || !STDOUT.tty?
        Thor::Shell::Basic
      else
        Thor::Base.shell
      end.new
    end
496857
def Shell(device, *command):
    
    if command:
        return device.StreamingShell(' '.join(command))
    else:
        # Retrieve the initial terminal prompt to use as a delimiter for future reads
        terminal_prompt = device.InteractiveShell()
        print(terminal_prompt.decode('utf-8'))

        # Accept user input in a loop and write that into the interactive shells stdin, then print output
        while True:
            cmd = input('> ')
            if not cmd:
                continue
            elif cmd == 'exit':
                break
            else:
                stdout = device.InteractiveShell(cmd, strip_cmd=True, delim=terminal_prompt, strip_delim=True)
                if stdout:
                    if isinstance(stdout, bytes):
                        stdout = stdout.decode('utf-8')
                        print(stdout)

        device.Close()
5537
def show_image(self, name):
        """"""
        command = "%s.show()" % name
        sw = self.shellwidget
        if sw._reading:
            sw.kernel_client.input(command)
        else:
            sw.execute(command)
763636
def shell(source=None, vars=None, server=None, port=None):
    """"""
    Wdb.get(server=server, port=port).shell(source=source, vars=vars)