Select either function or terminal in grow method
326567
def grow_use_function(self, depth=0):
        ""
        if depth == 0:
            return False
        if depth == self._depth:
            return True
        return np.random.random() < 0.5
995334
def _bashcomplete(cmd, prog_name, complete_var=None):
    """"""
    if complete_var is None:
        complete_var = '_%s_COMPLETE' % (prog_name.replace('-', '_')).upper()
    complete_instr = os.environ.get(complete_var)
    if not complete_instr:
        return

    from ._bashcomplete import bashcomplete
    if bashcomplete(cmd, prog_name, complete_var, complete_instr):
        fast_exit(1)
878092
function handleFunction (node, options) {
  const args = handleExprList(node.args, options)
  return `${node.name}${args}`
}
1190181
def program_select(self, chan, sfid, bank, preset):
        """"""
        return fluid_synth_program_select(self.synth, chan, sfid, bank, preset)
606527
function bash(pattern, options, cb) {
  if (!isGlob(pattern)) {
    return nonGlob(pattern, options, cb);
  }

  if (typeof options === 'function') {
    cb = options;
    options = undefined;
  }

  var opts = extend({cwd: process.cwd()}, options);

  fs.stat(opts.cwd, function(err, stat) {
    if (err) {
      cb(handleError(err, pattern, opts));
      return;
    }

    if (!stat.isDirectory()) {
      cb(new Error('cwd is not a directory: ' + opts.cwd));
      return;
    }

    var cp = spawn(bashPath, cmd(pattern, options), options);
    var buf = new Buffer(0);

    cp.stdout.on('data', function(data) {
      emitMatches(data.toString(), pattern, options);
      buf = Buffer.concat([buf, data]);
    });

    cp.stderr.on('data', function(data) {
      cb(handleError(data.toString(), pattern, options));
    });

    cp.on('close', function(code) {
      cb(code, getFiles(buf.toString(), pattern, options));
    });
  });
}
152562
function(command, options) {
	options = options || [];
	options.unshift(command);
	return childProcess.spawn(apt.command, options, apt.spawnOptions);
}
1151868
def build_command(self):
        ''''''
        # if defined in settings, run the function or return the string
        if self.options['command']:
            return self.options['command'](self) if callable(self.options['command']) else self.options['command']
        # build the default
        return self.build_default_command()
1082505
def exec_func(code, glob_vars, loc_vars=None):
    """"""
    if loc_vars is None:
        exec(code, glob_vars)
    else:
        exec(code, glob_vars, loc_vars)
163853
def execute_by_options(args):
    
    if args['subcommand'] == 'sphinx':
        s = Sphinx(proj_info)
        if args['quickstart']:
            s.quickstart()
        elif args['gen_code_api']:
            s.gen_code_api()
        elif args['rst2html']:
            s.rst2html()
        pass
    elif args['subcommand'] == 'offline_dist':
        pod = PyOfflineDist()
        if args['freeze_deps']:
            pod.freeze_deps()
        elif args['download_deps']:
            pod.download_deps()
        elif args['install_deps']:
            pod.install_deps()
        elif args['clean_deps']:
            pod.clean_deps()
        elif args['mkbinary']:
            pod.pyinstaller_mkbinary(args['mkbinary'])
        elif args['clean_binary']:
            pod.clean_binary()

    pass
847207
def cmd_func_name(self, command: str) -> str:
        
        target = COMMAND_FUNC_PREFIX + command
        return target if callable(getattr(self, target, None)) else ''
1342320
function exp(cmd, confdir) {
  return function (files, opt) {
    var defaultOpt = {
      cwd: process.cwd()
    };
    opt = append(defaultOpt, opt);

    if (typeof files == 'string')
      files = [ files ];

    require(path.resolve(confdir, cmd + '.js'))(files, opt);
  };
}
1239338
def get_or_create(self, key, creation_function, **kw):
        """"""

        return self._ctx_get_or_create(key, creation_function, None, **kw)
960848
function (version, args, pipe) {
        let spawnOpts = { cwd: ForestInternal.elmRoot(version) };
        let buffers = [];
        return new Promise((resolve, reject) => {
            let child = child_process_1.spawn('npm', args, spawnOpts);
            if (pipe) {
                child.stdout.pipe(process.stdout);
                child.stderr.pipe(process.stderr);
                process.stdin.pipe(child.stdin);
                process.stdin.resume();
            }
            child.stdout.on('data', (data) => {
                buffers.push(data);
            });
            child.on('close', (code) => {
                if (pipe) {
                    process.stdin.pause();
                    process.stdin.unpipe();
                }
                if (code === 0) {
                    let str = Buffer.concat(buffers).toString('utf-8');
                    return resolve(str);
                }
                // Use reject instead of throw here because we are in a callback
                reject(new ForestError(Errors.NpmCommandFailed, `npm command failed with exit code ${code}`, code));
            });
        }).catch((err) => {
            if (err instanceof ForestError) {
                throw err;
            }
            else {
                throw new ForestError(Errors.NpmRunFailed, err);
            }
        });
    }
406672
def select(*args)
      case args[0]
      when nil
        raise ArgumentError, "Not enough arguments"
      when :first
        args.shift
        @connection.select_hash_first(*args)
      when :all
        args.shift
        @connection.select_hash_all(*args)
      else
        @connection.select_hash_all(*args)
      end
    end
891558
function _from_file (fname_tmpl, opts, cfg_so_far, cb) {
  var vals = {
    env: process.env.NODE_ENV || 'development'
  };

  _.merge (vals, cfg_so_far);
  
  var fname = interpolator.parse (fname_tmpl, vals);

  // check existence
  fs.access (fname, function (err) {
    if (err) {
      if (opts.ignore_missing) {
        return cb (null, {});
      }
      else {
        return cb (err);
      }
    }

    var obj = {};
  
    try {
      obj = importFresh (fname);
    } 
    catch (e) {
      return cb (e);
    }

    // expand variables in loaded object
    _expand (obj, vals, cb);
  });
}
912597
def do_alternate(self, args):
        """"""
        func = getattr(args, 'func', None)
        if func is not None:
            # Call whatever sub-command function was selected
            func(self, args)
        else:
            # No sub-command was provided, so call help
            self.do_help('alternate')
1153455
def method_missing(cmd, options={}, *args, &block)
      native(cmd, options, *args, &block)
    end