Generates one or more VSGSuite instances from command line arguments.

        :param kwargs:  List of additional keyworded arguments to be passed into the VSGSuite defined in the :meth:`~VSGSuite.make_parser` method.
507431
def from_args(cls, **kwargs):
        
        # Create a VSGSuite for each filename on the command line.
        if kwargs.get('suite_commands', None) == 'generate':
            filenames = kwargs.pop('configuration_filenames', [])
            return [cls.from_file(f) for f in filenames]

        # Create a VSGSuit from the target directory and override commands
        if kwargs.get('suite_commands', None) == 'auto':
            type = kwargs.get('suite_type', None)
            return [cls.from_directory('', type, **kwargs)]

        # Create nothing.
        return []
1165525
def create_parser(self, prog_name, subcommand):
        
        parser = optparse.OptionParser(
            prog=prog_name,
            usage=self.usage(subcommand),
            version=self.get_version(),
            option_list=self.get_option_list())
        for name, description, option_list in self.get_option_groups():
            group = optparse.OptionGroup(parser, name, description);
            list(map(group.add_option, option_list))
            parser.add_option_group(group)
        return parser
1186358
def parse_func_kwarg_keys(func, with_vals=False):
    
    sourcecode = get_func_sourcecode(func, strip_docstr=True,
                                     strip_comments=True)
    kwkeys = parse_kwarg_keys(sourcecode, with_vals=with_vals)
    #ut.get_func_kwargs  TODO
    return kwkeys
605625
def mk_kwargs(cls, kwargs):
        
        ret = {}
        kws = ['row_factory', 'body', 'parent']
        for k in kws:
            if k in kwargs:
                ret[k] = kwargs.pop(k)

        return ret
529997
def filter_kwargs(keys, kwargs):
    
    for k in keys:
        if k in kwargs:
            yield (k, kwargs[k])
279306
def kwargs_to_list(kwargs):
    
    kwargs_list = []
    # Kwargs are sorted in alphabetic order by their keys.
    # Taken from http://www.saltycrane.com/blog/2007/09/how-to-sort-python-dictionary-by-keys/
    for k, v in items_sorted_by_key(kwargs):
        kwargs_list.append(str(k) + '-' + str(force_string(v)))
    return kwargs_list
566603
def genargs() -> ArgumentParser:
    
    parser = ArgumentParser()
    parser.add_argument("infile", help="Input JSG specification")
    parser.add_argument("-o", "--outfile", help="Output python file (Default: {infile}.py)")
    parser.add_argument("-e", "--evaluate", help="Evaluate resulting python file as a test", action="store_true")
    parser.add_argument("-v", "--verbose", help="Verbose output", action="store_true")
    return parser
716376
def add_defaults_to_kwargs(defaults, **kwargs):
    
    defaults = dict(defaults)
    defaults.update(kwargs)
    return defaults
56411
def get_kwargs(**kwargs):
        
        d = dict()
        for k, v in kwargs.iteritems():
            if v is not NOTSET:
                d[k] = v
        return d
753575
def extract_kwargs(names:Collection[str], kwargs:KWArgs):
    ""
    new_kwargs = {}
    for arg_name in names:
        if arg_name in kwargs:
            arg_val = kwargs.pop(arg_name)
            new_kwargs[arg_name] = arg_val
    return new_kwargs, kwargs
810819
def _add_inputs_to_kwargs(args, kwargs, parser):
    
    inputs = [x for x in [args.global_config, args.fc_dir] + args.run_config
              if x is not None]
    global_config = "bcbio_system.yaml"  # default configuration if not specified
    if kwargs.get("workflow", "") == "template":
        if args.only_metadata:
            inputs.append("--only-metadata")
        if args.force_single:
            inputs.append("--force-single")
        if args.separators:
            inputs.extend(["--separators", args.separators])
        kwargs["inputs"] = inputs
        return kwargs
    elif len(inputs) == 1:
        if os.path.isfile(inputs[0]):
            fc_dir = None
            run_info_yaml = inputs[0]
        else:
            fc_dir = inputs[0]
            run_info_yaml = None
    elif len(inputs) == 2:
        if os.path.isfile(inputs[0]):
            global_config = inputs[0]
            if os.path.isfile(inputs[1]):
                fc_dir = None
                run_info_yaml = inputs[1]
            else:
                fc_dir = inputs[1]
                run_info_yaml = None
        else:
            fc_dir, run_info_yaml = inputs
    elif len(inputs) == 3:
        global_config, fc_dir, run_info_yaml = inputs
    elif args.version:
        print(version.__version__)
        sys.exit()
    else:
        print("Incorrect input arguments", inputs)
        parser.print_help()
        sys.exit()
    if fc_dir:
        fc_dir = os.path.abspath(fc_dir)
    if run_info_yaml:
        run_info_yaml = os.path.abspath(run_info_yaml)
    if kwargs.get("workflow"):
        kwargs["inputs"] = inputs
    kwargs["config_file"] = global_config
    kwargs["fc_dir"] = fc_dir
    kwargs["run_info_yaml"] = run_info_yaml
    return kwargs
1303991
def get_translation_kwargs(self, kwargs):
        
        lks = []
        for k, v in six.iteritems(kwargs):
            if self.is_linguist_lookup(k):
                lks.append(
                    utils.get_translation_lookup(self.model._linguist.identifier, k, v)
                )

        translation_kwargs = {}
        for lk in lks:
            for k, v in six.iteritems(lk):
                if k not in translation_kwargs:
                    translation_kwargs[k] = v

        return translation_kwargs
787096
def arg(*args, **kwargs):
    
    def _arg(f):
        if not hasattr(f, '_subcommand_args'):
            f._subcommand_args = []
        f._subcommand_args.append((args, kwargs))
        return f
    return _arg
518611
def generate(self, x, **kwargs):
    
    assert self.sess is not None, \
        'Cannot use `generate` when no `sess` was provided'
    self.parse_params(**kwargs)

    if self.y_target is None:
      self.y_target, nb_classes = self.get_or_guess_labels(x, kwargs)
      self.targeted_attack = False
    else:
      _, nb_classes = self.get_or_guess_labels(x, kwargs)
      self.targeted_attack = True

    attack = LBFGS_impl(
        self.sess, x, self.model.get_logits(x),
        self.y_target, self.targeted_attack,
        self.binary_search_steps, self.max_iterations, self.initial_const,
        self.clip_min, self.clip_max, nb_classes, self.batch_size)

    def lbfgs_wrap(x_val, y_val):
      """
      Wrapper creating TensorFlow interface for use with py_func
      """
      return np.array(attack.attack(x_val, y_val), dtype=self.np_dtype)

    wrap = tf.py_func(lbfgs_wrap, [x, self.y_target], self.tf_dtype)
    wrap.set_shape(x.get_shape())

    return wrap
335501
def transform_kwargs(self, **kwargs):
		""""""
		args = list()
		for k, v in kwargs.items():
			if len(k) == 1:
				if v is True:
					args.append("-%s" % k)
				elif type(v) is not bool:
					args.append("-%s%s" % (k, v))
			else:
				if v is True:
					args.append("--%s" % dashify(k))
				elif type(v) is not bool:
					args.append("--%s=%s" % (dashify(k), v))
		return args
340196
def format_args(self):
        
        result = []
        if self.args:
            result.append(
                _format_args(
                    self.args, self.defaults, getattr(self, "annotations", None)
                )
            )
        if self.vararg:
            result.append("*%s" % self.vararg)
        if self.kwonlyargs:
            if not self.vararg:
                result.append("*")
            result.append(
                _format_args(
                    self.kwonlyargs, self.kw_defaults, self.kwonlyargs_annotations
                )
            )
        if self.kwarg:
            result.append("**%s" % self.kwarg)
        return ", ".join(result)
1033113
def _get_callargs(self, *args, **kwargs):
        
        callargs = getcallargs(self.func, *args, **kwargs)
        return callargs