Define a string parameter coming from a shell command to be used within
    this YAML file. Trailing newlines will be stripped.
483021
def cmd_string(name, cmd):
    # type: (AName, ACmd) -> ADefine
    """"""
    value = subprocess.check_output(cmd, shell=True).rstrip("\n")
    return Define(name, value)
1048922
def parse(args)
      if args.size == 1 && args[0].is_a?(String)
        args = Shellwords.shellwords(args[0]) if !Boson.in_shell
        global_opt, parsed_options, args = parse_options args
      # last string argument interpreted as args + options
      elsif args.size > 1 && args[-1].is_a?(String)
        temp_args = Boson.in_shell ? args : Shellwords.shellwords(args.pop)
        global_opt, parsed_options, new_args = parse_options temp_args
        Boson.in_shell ? args = new_args : args += new_args
      # add default options
      elsif @command.options.nil? || @command.options.empty? ||
        (@command.numerical_arg_size? && args.size <= (@command.arg_size - 1).abs) ||
        (@command.has_splat_args? && !args[-1].is_a?(Hash))
          global_opt, parsed_options = parse_options([])[0,2]
      # merge default options with given hash of options
      elsif (@command.has_splat_args? || (args.size == @command.arg_size)) &&
        args[-1].is_a?(Hash)
          global_opt, parsed_options = parse_options([])[0,2]
          parsed_options.merge!(args.pop)
      end
      [global_opt || {}, parsed_options, args]
    end
934764
def prose_wc(args):
    
    if args.file is None:
        return 1
    if args.split_hyphens:
        INTERSTITIAL_PUNCTUATION.append(re.compile(r'-'))
    content = args.file.read().decode('utf-8')
    filename = args.file.name
    body = strip_frontmatter(content)
    parsed = markdown_to_text(body)
    result = wc(filename, body, parsed=parsed,
                is_jekyll=(body != content))
    if (args.update and
            filename != '_stdin_' and
            result['counts']['type'] == 'jekyll'):
        update_file(filename, result, content, args.indent)
    else:
        _mockable_print({
            'yaml': yaml.safe_dump(result, default_flow_style=False,
                              indent=args.indent),
            'json': json.dumps(result, indent=args.indent),
            'default': default_dump(result),
        }[args.format])
    return 0
895330
def create_args(line, namespace):
    
    args = []
    # Using shlex.split handles quotes args and escape characters.
    for arg in shlex.split(line):
      if not arg:
         continue
      if arg[0] == '$':
        var_name = arg[1:]
        if var_name in namespace:
          args.append((namespace[var_name]))
        else:
          raise Exception('Undefined variable referenced in command line: %s' % arg)
      else:
        args.append(arg)
    return args
337046
def StrConcat(*args):
    
    new_value = ''.join([arg.value for arg in args])
    return StringV(new_value)
406998
def argument(value, options = {})
      return unless @shell.applicable?(options)
      value = value.to_s
      if @shell.requires_escaping?(value)
        value = @shell.escape_value(value)
      end
      @command << ' ' << value
      @last_arg = :argument
    end
346456
def to_s
      string =  "Workflow:    #{@name}\n"
      string << "ID:          #{@id}\n"
      string << "Description: #{@description}\n"
      string << "Version:     #{@version}\n"

      string << "\nInput Parameters:\n"
      if @input_parameters.size > 0
        @input_parameters.each_value { |wf_param| string << " #{wf_param}" }
      end

      string << "\nOutput Parameters:" << "\n"
      if @output_parameters.size > 0
        @output_parameters.each_value { |wf_param| string << " #{wf_param}" }
      end

      # Assert
      string
    end
572428
def lines
      @value.inject(0) do |s, e|
        next s + e.count("\n") if e.is_a?(String)
        next s
      end
    end
675849
function(value)
	{
		value = value + '';
		var len = YamlEscaper.escapees.length;
		var maxlen = YamlEscaper.escaped.length;
		var esc = YamlEscaper.escaped;
		for (var i = 0; i < len; ++i)
			if ( i >= maxlen ) esc.push('');

		var ret = '';		
		ret = value.replace(new RegExp(YamlEscaper.escapees.join('|'),'g'), function(str){
			for(var i = 0; i < len; ++i){
				if( str == YamlEscaper.escapees[i] )
					return esc[i];
			}
		});
		return '"' + ret + '"'; 
	}
428492
def yaml_squote(text):
    '''
    
    '''
    with io.StringIO() as ostream:
        yemitter = yaml.emitter.Emitter(ostream, width=six.MAXSIZE)
        yemitter.write_single_quoted(six.text_type(text))
        return ostream.getvalue()
1337640
def DEFINE_string(  # pylint: disable=invalid-name,redefined-builtin
    name, default, help, flag_values=_flagvalues.FLAGS, **args):
  """"""
  parser = _argument_parser.ArgumentParser()
  serializer = _argument_parser.ArgumentSerializer()
  DEFINE(parser, name, default, help, flag_values, serializer, **args)
649874
def quote_string_if_needed(arg: str) -> str:
    
    if is_quoted(arg) or ' ' not in arg:
        return arg

    if '"' in arg:
        quote = "'"
    else:
        quote = '"'

    return quote + arg + quote
1318999
def _input_as_multiline_string(self, data):
        
        if data:
            self.Parameters['-infile']\
                .on(super(Clustalw,self)._input_as_multiline_string(data))
        return ''
977984
def param(name, transform: nil)
      if @command.explicitly_no_params?
        raise AlreadySpecifiedAsNoParams.new(name, @command)
      end

      @command.parameter_definitions << Cri::ParamDefinition.new(
        name: name,
        transform: transform,
      )
    end
863805
def set_with_string(config)
      if File.exists?(config)
        set_with_yaml(File.read(config))
      else
        set_with_yaml(config)
      end
    end
663946
def write_config(path, config):
    
    config_as_string = to_nice_yaml(config)

    config_as_string = "---\n" + config_as_string

    string_to_file(path, config_as_string)
16169
def send_command_return_multilines(self, command, *arguments):
        
        return self.api.send_command_return_multilines(self, command, *arguments)