todo: Docstring for exec
        
        :param args: arg description
        :type args: type description
        :return:
        :rtype:
324262
def exec(self, args):
        
        logger.debug("create %s", args.create[0])

        self.create_repo(args.create[0])
977869
def sh(args, **kwargs):
    
    if isinstance(args, str):
        args = args.split()
    if not args:
        return
    click.echo('$ {0}'.format(' '.join(args)))
    try:
        return subprocess.check_call(args, **kwargs)
    except subprocess.CalledProcessError as exc:
        click.secho('run error {}'.format(exc))
    except OSError as exc:
        click.secho('not found error {}'.format(exc))
1325952
def exec_python_rc(*args, **kwargs):
    
    cmdargs, kwargs = __wrap_python(args, kwargs)
    return exec_command_rc(*cmdargs, **kwargs)
715838
def do_python(self, arg):
        
        if self.cmdprefix:
            raise CmdError("prefix not allowed")

        # When given a Python statement, execute it directly.
        if arg:
            try:
                compat.exec_(arg, globals(), locals())
            except Exception:
                traceback.print_exc()

        # When no statement is given, spawn a Python interpreter.
        else:
            try:
                self._spawn_python_shell(arg)
            except Exception:
                e = sys.exc_info()[1]
                raise CmdError(
                    "unhandled exception when running Python console: %s" % e)
1022107
def db_exec(self, query, args=None):
        
        if args is None:
            self.db_query(query)
        else:
            self.db_query(query, args)

        self.db.commit()
397995
def _execCmd(self, cmd, args):
        
        output = self._eslconn.api(cmd, args)
        if output:
            body = output.getBody()
            if body:
                return body.splitlines()
        return None
414364
def __exec_python_cmd(cmd):
    
    # Prepend PYTHONPATH with pathex
    pp = os.pathsep.join(PyInstaller.__pathex__)
    old_pp = compat.getenv('PYTHONPATH')
    if old_pp:
        pp = os.pathsep.join([pp, old_pp])
    compat.setenv("PYTHONPATH", pp)
    try:
        try:
            txt = compat.exec_python(*cmd)
        except OSError, e:
            raise SystemExit("Execution failed: %s" % e)
    finally:
        if old_pp is not None:
            compat.setenv("PYTHONPATH", old_pp)
        else:
            compat.unsetenv("PYTHONPATH")
    return txt.strip()
699640
def execute(self):
        
        func_params = []
        exec_str = self.func.__name__ + '(' 
        for p in self.params:
            if p[0][0:2] != '__':   # ignore custom param names
                exec_str += p[0] + '="' + self._force_str(p[1]) + '", '
                func_params.append(p[1])
        exec_str = exec_str[:-2]
        exec_str += ')  # task' + str(self.task_id) + ': ' + self.name
        
        
        self.result = self.func(*func_params)
        print(exec_str + ' loaded ', self.result)
1041232
def execute(self, arg_list):
        
        arg_map = self.parser.parse_args(arg_list).__dict__
        command = arg_map.pop(self._COMMAND_FLAG)
        return command(**arg_map)
664267
def _exec_command(self, cmd):
        
        _, out, err = self._client.exec_command(cmd, timeout=self._timeout)
        return out.read().strip() if not err.read().strip() else None
1268518
def exec(self, args):
        

        logger.debug("query %s", args.query)

        pl = Repo.installed_list()
        if not pl:
            print("No packages installed, use 'upkg install'")

        idx = 1
        for p in pl:
            print("[%s] %s" % (idx, p))
            idx += 1
761837
def handle_exec(args):
    
    session_file = get_db_name(args.get('<session-file>'))
    cosmic_ray.commands.execute(session_file)

    return ExitCode.OK
1010097
def main():
    
    arguments = docopt(main.__doc__)

    if arguments.get('--version'):
        print('with {}'.format(withtool.__version__))
        sys.exit()

    while True:
        sub = yield from get_prompt(arguments['<command>'])
        call = '{cmd} {sub}'.format(cmd=arguments['<command>'], sub=sub)
        run(call)
561904
def command(*args, **kwargs):
    
    def decorator(f):
        if 'description' not in kwargs:
            kwargs['description'] = f.__doc__
        if 'parents' in kwargs:
            if not hasattr(f, '_argnames'):  # pragma: no cover
                f._argnames = []
            for p in kwargs['parents']:
                f._argnames += p._argnames if hasattr(p, '_argnames') else []
            kwargs['parents'] = [p.parser for p in kwargs['parents']]
        f.parser = argparse.ArgumentParser(*args, **kwargs)
        f.climax = True
        for arg in getattr(f, '_arguments', []):
            f.parser.add_argument(*arg[0], **arg[1])

        @wraps(f)
        def wrapper(args=None):
            kwargs = f.parser.parse_args(args)
            return f(**vars(kwargs))

        wrapper.func = f
        return wrapper
    return decorator
768437
def _exec_template(callable_, context, args=None, kwargs=None):
    
    template = context._with_template
    if template is not None and \
            (template.format_exceptions or template.error_handler):
        try:
            callable_(context, *args, **kwargs)
        except Exception:
            _render_error(template, context, compat.exception_as())
        except:
            e = sys.exc_info()[0]
            _render_error(template, context, e)
    else:
        callable_(context, *args, **kwargs)
324329
def _execute(self, *args: str, **kwargs: Any) -> tuple:
        ''''''
        return self.execute(args=args, options=merge_dict(self.options, kwargs)).communicate()
393395
def cmdline(self, args=()):
    
    cmds = [self._interpreter.binary]
    cmds.append(self._pex)
    cmds.extend(args)
    return cmds