Execute pandoc with the given arguments
10930
def pandoc(args, filein=None, fileout=None):
    """"""
    cmd = [u'pandoc']

    if filein:
        cmd.append(filein)

    if fileout:
        cmd.append('-o')
        cmd.append(fileout)

    cmd.extend(args.split())

    proc = subprocess.Popen(cmd, stdout=subprocess.PIPE)
    out, err = proc.communicate()
    if proc.returncode:
        raise PandocError('pandoc exited with return code {}\n{}'.format(proc.returncode, str(err)))
    return out.decode('utf-8')
339995
def executemany(self, *args, **kwargs):
        

        with self:
            self._cursor.executemany(*args, **kwargs)
324329
def _execute(self, *args: str, **kwargs: Any) -> tuple:
        ''''''
        return self.execute(args=args, options=merge_dict(self.options, kwargs)).communicate()
604000
def execute_callback(callback, *args)
      (callback.arity == 2 ? callback.call(*args[0, 2]) : callback.call(*args)) if callback
    end
1146654
@Override
    public String execute(Map<String, String> parameters, String body,
                          ConversionContext context) throws MacroExecutionException {
        try
        {
            String xhtmlRendered = gpUtil.getWikiStyleRenderer().convertWikiToXHtml(context.getPageContext(), body);
            LOGGER.trace("rendering : \n - source \n {} \n - output \n {}", body, xhtmlRendered);
            return xhtmlRendered;
        }
        catch (Exception e)
        {
            return getErrorView("greenpepper.info.macroid", e.getMessage());
        }
    }
1339143
def run_from_cli():
    

    arg_parser = argparse.ArgumentParser(
        description='Read and write properties in a wp-config.php file. '
                    'Include a --value argument to set the value, omit it to '
                    'read the value of the specified key.',
        prog='python -m wpconfigr')

    arg_parser.add_argument('--filename',
                            help='wp-config.php filename',
                            required=True)

    arg_parser.add_argument('--key',
                            help='Property key',
                            required=True)

    arg_parser.add_argument('--value',
                            help='New property value',
                            required=False)

    arg_parser.add_argument('--log-level',
                            default='CRITICAL',
                            help='Log level',
                            required=False)

    arg_parser.add_argument('--set-true',
                            action='store_true',
                            help='Set the value as boolean true')

    arg_parser.add_argument('--set-false',
                            action='store_true',
                            help='Set the value as boolean false')

    args = arg_parser.parse_args()

    if args.set_true and args.set_false:
        arg_parser.error('Cannot set --set-true and --set-false.')

    if args.value and args.set_true:
        arg_parser.error('Cannot set --value and --set-true.')

    if args.value and args.set_false:
        arg_parser.error('Cannot set --value and --set-false.')

    basicConfig(level=str(args.log_level).upper())

    updater = WpConfigFile(filename=args.filename)

    if args.set_true:
        value = True
    elif args.set_false:
        value = False
    else:
        value = args.value

    if value is not None:
        updater.set(key=args.key, value=value)
    else:
        got = updater.get(key=args.key)

        if got:
            print(got)
1052856
def execute(cmd, verbosityThreshold = 1, **kwargs):
    ''''''
    global exectue_defaults
    opts = merge(exectue_defaults, kwargs)              # the options computed from the default options together with the passed in options.
    subopts = filterKWArgsForFunc(opts, subprocess.Popen)
    formattedCmd = cmd.format(**getFormatBindings(cmd,1))

    shouldPrint = opts['verbosity'] >= verbosityThreshold
    isDryrun = opts['dryrun']

    if shouldPrint:
        msg = "would execute:" if isDryrun else "executing:"
        pre = "("+subopts['cwd']+")" if (subopts['cwd'] != exectue_defaults['cwd']) else ""
        print "{pre}{msg} {formattedCmd}".format(pre=pre, formattedCmd=formattedCmd, msg=msg)
    if isDryrun:
        return (0, None, None)

    printStdOut = shouldPrint and opts['permitShowingStdOut']
    printStdErr = shouldPrint and opts['permitShowingStdErr']
    returnCode = 0
    if opts['captureStdOutStdErr']:
        (returnCode, stdOut, stdErr) = _AsynchronouslyGetProcessOutput(formattedCmd, printStdOut, printStdErr, **subopts)    
    else:
        subopts['stdout'] = None if printStdOut else subprocess.PIPE
        subopts['stderr'] = None if printStdErr else subprocess.PIPE
        process = subprocess.Popen(formattedCmd, **subopts)
        res = process.communicate()
        returnCode = process.returncode
        stdOut = res[0]
        stdErr = res[1]

    if returnCode and not opts['ignoreErrors']:
        print colored('Command {} failed with return code {}!'.format(cmd, returnCode),'red')
        sys.exit(returnCode)
    
    # always print any errors
    return (returnCode, stdOut, stdErr)
1278164
def exec(self, args):
        

        logger.debug("update %s", args.update)
        self.update(args.update)
550001
def run_apidoc(_):
    """"""
    import better_apidoc
    better_apidoc.main([
        'better-apidoc',
        '-t',
        os.path.join('.', '_templates'),
        '--force',
        '--no-toc',
        '--separate',
        '-o',
        os.path.join('.', 'API'),
        os.path.join('..', 'src', 'qnet'),
    ])
1215969
function __pandocAvailable(cb) {
      var test = spawn('pandoc', ['--help']);
      test.on('error', function() {
        console.error('Pandoc not found');
        cb('Pandoc not found');
      });
      test.on('exit', function() { cb(null); });
      test.stdin.end();
    }
418129
def _execute_callback(self, *args):
        ""
        self._validate_key(args)      # Validate input key

        # Additional validation needed to ensure kwargs don't clash
        kdims = [kdim.name for kdim in self.kdims]
        kwarg_items = [s.contents.items() for s in self.streams]
        hash_items = tuple(tuple(sorted(s.hashkey.items())) for s in self.streams)+args
        flattened = [(k,v) for kws in kwarg_items for (k,v) in kws
                     if k not in kdims]

        if self._posarg_keys:
            kwargs = dict(flattened, **dict(zip(self._posarg_keys, args)))
            args = ()
        else:
            kwargs = dict(flattened)
        if not isinstance(self.callback, Generator):
            kwargs['_memoization_hash_'] = hash_items

        with dynamicmap_memoization(self.callback, self.streams):
            retval = self.callback(*args, **kwargs)
        return self._style(retval)
919273
def main():
    """"""

    # pylint: disable=global-statement
    global PANDOCVERSION
    global Image

    # Get the output format and document
    fmt = args.fmt
    doc = json.loads(STDIN.read())

    # Initialize pandocxnos
    # pylint: disable=too-many-function-args
    PANDOCVERSION = pandocxnos.init(args.pandocversion, doc)

    # Element primitives
    if PANDOCVERSION < '1.16':
        Image = elt('Image', 2)

    # Chop up the doc
    meta = doc['meta'] if PANDOCVERSION >= '1.18' else doc[0]['unMeta']
    blocks = doc['blocks'] if PANDOCVERSION >= '1.18' else doc[1:]

    # Process the metadata variables
    process(meta)

    # First pass
    attach_attrs_image = attach_attrs_factory(Image,
                                              extract_attrs=_extract_attrs)
    detach_attrs_image = detach_attrs_factory(Image)
    insert_secnos = insert_secnos_factory(Image)
    delete_secnos = delete_secnos_factory(Image)
    filters = [insert_secnos, process_figures, delete_secnos] \
      if PANDOCVERSION >= '1.16' else \
      [attach_attrs_image, insert_secnos, process_figures,
       delete_secnos, detach_attrs_image]
    altered = functools.reduce(lambda x, action: walk(x, action, fmt, meta),
                               filters, blocks)

    # Second pass
    process_refs = process_refs_factory(references.keys())
    replace_refs = replace_refs_factory(references,
                                        use_cleveref_default, False,
                                        plusname if not capitalize else
                                        [name.title() for name in plusname],
                                        starname, 'figure')
    altered = functools.reduce(lambda x, action: walk(x, action, fmt, meta),
                               [repair_refs, process_refs, replace_refs],
                               altered)

    # Insert supporting TeX
    if fmt == 'latex':

        rawblocks = []

        if has_unnumbered_figures:
            rawblocks += [RawBlock('tex', TEX0),
                          RawBlock('tex', TEX1),
                          RawBlock('tex', TEX2)]

        if captionname != 'Figure':
            rawblocks += [RawBlock('tex', TEX3 % captionname)]

        insert_rawblocks = insert_rawblocks_factory(rawblocks)

        altered = functools.reduce(lambda x, action: walk(x, action, fmt, meta),
                                   [insert_rawblocks], altered)

    # Update the doc
    if PANDOCVERSION >= '1.18':
        doc['blocks'] = altered
    else:
        doc = doc[:1] + altered

    # Dump the results
    json.dump(doc, STDOUT)

    # Flush stdout
    STDOUT.flush()
1191975
function execute(args){
    var options = optionator.parse(args);

    if(options.help){
        console.log(optionator.generateHelp());
    }
    else if(options.version){
        console.log("v" + require("../package.json").version);
    }
    else{
        printResults(loadPerf(options));
    }
}
943333
def execute_command(self, cmd, params=None, callback=None, raw=False):
        '''
        
        '''
        def execute_with_callbacks(cmd, params=None, callback=None, raw=False):
            code, params = self.send_command(cmd, params, raw)
            if callback:
                callback(code, params)
            return code, params

        if self.daemon:
            t = Thread(target=execute_with_callbacks,
                    args=(cmd, ), kwargs={'params':params, 'callback':callback, 'raw':raw})
            t.daemon = True
            t.start()
        else:
            return execute_with_callbacks(cmd, params, callback, raw)
1154179
def execute(args):
    
    # just print the file location?
    if args.location:
        print(Config.instance().config_file)
        return

    # every option below requires the name to be set
    if not args.name:
        abort("please give the name of the config in the format <section>[.<option>]")

    # removal
    if args.remove:
        abort("config removal not yet implemented")

    # setting
    if args.value:
        abort("config setting not yet implemented")

    # getting
    print(get_config(args.name, expand=args.expand))
174181
def _execute(self, *args: str, **kwargs) -> tuple:
        ''''''
        process = self.execute(
            args=args, options=merge_dict(self.options, kwargs))
        command = ' '.join(process.args)
        if self._dev:
            output, error = process.communicate()
            print(
                "Debug Information",
                "Command: {!r}".format(command),
                "Output: {!r}".format(output.encode('utf-8')),
                "Error: {!r}".format(error.encode('utf-8')),
                sep='\n', end='\n{}\n'.format('=' * 80)
            )
        return process.communicate()
852799
def run_apidoc(_):
    """"""
    current_directory = os.path.abspath(os.path.dirname(__file__))
    output_path = os.path.join(current_directory, 'source')
    cmd_path = 'sphinx-apidoc'
    if hasattr(sys, 'real_prefix'):  # Check to see if we are in a virtualenv
        # If we are, assemble the path manually
        cmd_path = os.path.abspath(os.path.join(sys.prefix, 'bin', 'sphinx-apidoc'))
    main([cmd_path, '-e', '-o', output_path, '../cinder_data', '--force'])