Quick and nice way to output mixed variable(s)
320007
public function dump()
	{
		if ((bool) defined('STDIN'))
		{
			// no fancy flying on the commandline, just dump 'm
			foreach (func_get_args() as $arg)
			{
				var_dump($arg);
			}
		}
		else
		{
			// @codeCoverageIgnoreStart
			call_user_func_array(array($this, 'dumpAsHtml'), func_get_args());
			// @codeCoverageIgnoreEnd
		}
	}
577015
def _parse_output_keys(val):
    
    out = {}
    for k in val.split(","):
        # record output
        if ":" in k:
            name, attrs = k.split(":")
            out[name] = attrs.split(";")
        else:
            out[k] = None
    return out
1288992
def _write_values(kwargs, variables):
    """"""
    writeto = []
    for var_name, value in kwargs.items():
        var = variables[var_name]
        var.notify_will_write()
        var.write(value)
        writeto.append(var)
    return _notify_reader_writes(writeto)
675337
def __separate_data_vars(line):
        
        combine = []
        if '#' in line:
            line = line.replace("#", "")
            line = line.lstrip()
        if line not in NOAA_EMPTY and line not in EMPTY:
            m = re.match(re_var_split, line)
            if m:
                combine.append(m.group(1))
                attr = m.group(2).split(',')
                combine += attr
                for index, string in enumerate(combine):
                    combine[index] = string.strip()
                # for i, s in enumerate(combine):
                #     if not s or s in NOAA_EMPTY:
                #         del combine[i]
        return combine
1336252
def variables(template):
    ''''''
    vars = set()
    for varlist in TEMPLATE.findall(template):
        if varlist[0] in OPERATOR:
            varlist = varlist[1:]
        varspecs = varlist.split(',')
        for var in varspecs:
            # handle prefix values
            var = var.split(':')[0]
            # handle composite values
            if var.endswith('*'):
                var = var[:-1]
            vars.add(var)
    return vars
1200576
def _ctypes_variables(parameter):
    
    if parameter.dimension is not None and ":" in parameter.dimension:
        #For arrays that provide input (including 'inout'), we pass the output separately
        #through a c-pointer. They will always be input arrays. For pure (out) parameters
        #we use *only* a c-ptr, but it needs intent (inout) since it is created by ctypes.
        if "in" in parameter.direction or parameter.direction == "":
            #We have to get the ctypes-compatible data type for the parameters.
            #stype = _ctypes_dtype(parameter)
            splice = _ctypes_splice(parameter)
            name = parameter.ctypes_parameter()[0]
            if parameter.direction == "(inout)" and not ("allocatable" in parameter.modifiers or
                                                         "pointer" in parameter.modifiers):
                return (parameter.definition(optionals=False, customdim=splice), False)
            else:
                return ("{}, intent(in) :: {}({})".format(parameter.strtype, name, splice), False)
    else:
        if parameter.dtype == "logical":
            stype = _ctypes_dtype(parameter)
            suffix = "_c"
            modifiers = None
        elif hasattr(parameter, "parameters"):
            stype = None
            suffix = "_f"
            modifiers = ["intent(out)"]
        else:
            stype = None
            suffix = ""
            modifiers = None
            
        return (parameter.definition(ctype=stype, optionals=False, suffix=suffix,
                                     modifiers=modifiers), False)
673856
def output_generic(gandi, data, output_keys, justify=10):
    
    for key in output_keys:
        if key in data:
            output_line(gandi, key, data[key], justify)
346311
function(_exps,_out){
        // foo|a:x|b:y1,y2|c:z1,z2 -> c(b(a(foo,x),y1,y2),z1,z2)
        if (!_exps||!_exps.length) return;
        if (_exps.length==1){
            var _var = _exps.pop();
            _doParseVars(_var);
            // fix error for ${}
            _out.push(_var==''?'""':_var);
            return;
        }
        var _exp = _exps.pop().split(':');
        _out.push('__MDF[\''+_exp.shift()+'\'](');
        _doParseExpression(_exps,_out);
        if (_exp.length>0){
            var _args = _exp.join(':');
            _doParseVars(_args);
            _out.push(','+_args);
        }
        _out.push(')');
    }
1207394
def variablename(var):
    
    s=[tpl[0] for tpl in itertools.ifilter(lambda x: var is x[1], globals().items())]
    s=s[0].upper()
    return s
1240304
def var_dump(*obs):
	
	i = 0
	for x in obs:
		
		str = var_dump_output(x, 0, '  ', '\n', True)
		print (str.strip())
		
		#dump(x, 0, i, '', object)
		i += 1
1331619
def _split_variables(variables):
    
    file_vs = []
    std_vs = []
    for v in variables:
        cur_type = v["type"]
        while isinstance(cur_type, dict):
            if "items" in cur_type:
                cur_type = cur_type["items"]
            else:
                cur_type = cur_type["type"]
        if (cur_type in ["File", "null", "record"] or
              (isinstance(cur_type, (list, tuple)) and
               ("File" in cur_type or {'items': 'File', 'type': 'array'} in cur_type))):
            file_vs.append(v)
        elif v["id"] in ALWAYS_AVAILABLE:
            std_vs.append(v)
        else:
            file_vs.append(v)
    return file_vs, std_vs
1029326
def parse_output(variables, function, output)
      plottable_function = " #{function.clone} "
      coefficients = {}
      deltas = {}
      variables.each do |var|
        value, error = output.scan(%r{#{var} *= ([^ ]+) *\+/\- ([^ ]+)})[0]
        plottable_function.gsub!(/#{var}([^0-9a-zA-Z])/) { value + Regexp.last_match(1) }
        coefficients[var] = value.to_f
        deltas[var] = error.to_f
      end
      [coefficients, deltas, plottable_function]
    end
459683
def _variable(lexer):
    """"""
    names = _names(lexer)

    tok = next(lexer)
    # NAMES '[' ... ']'
    if isinstance(tok, LBRACK):
        indices = _indices(lexer)
        _expect_token(lexer, {RBRACK})
    # NAMES
    else:
        lexer.unpop_token(tok)
        indices = tuple()

    return ('var', names, indices)
609802
def _format_variables(self, raw_vars):
        
        f_vars = []
        for var, value in raw_vars.items():
            if not (var.startswith('__') and var.endswith('__')):
                repr_value = self._get_repr(value)
                f_vars.append('{0} = {1}'.format(var, repr_value))
        return '\n'.join(sorted(f_vars))
934675
def parse_mixed_delim_str(line):
    """"""
    arrs = [[], [], []]
    for group in line.split(' '):
        for col, coord in enumerate(group.split('/')):
            if coord:
                arrs[col].append(int(coord))

    return [tuple(arr) for arr in arrs]
1037907
function replaceValuesWithVariableNames (variables, prefix) {
  const map = {}

  Object.keys(variables || {}).forEach((variableName) => {
    map[variableName] = `var(${formatVariableName(variableName, prefix)})`
  })

  return map
}
1138656
private String decodeAndUpdateWithVariables(String[] splitList,
      Map<String, Map<String, String>> variables) throws MtasParserException {
    StringBuilder builder = new StringBuilder();
    for (String split : splitList) {
      if (split.contains(":")) {
        String[] subSplit = split.split(":");
        if (subSplit.length == 2) {
          String decodedVariableName = new String(dec.decode(subSplit[0]),
              StandardCharsets.UTF_8);
          String decodedVariableValue = new String(dec.decode(subSplit[1]),
              StandardCharsets.UTF_8);
          if (variables.containsKey(decodedVariableName)) {
            if (variables.get(decodedVariableName)
                .containsKey(decodedVariableValue)) {
              String valueFromVariable = variables.get(decodedVariableName)
                  .get(decodedVariableValue);
              builder.append(valueFromVariable);
            } else {
              throw new MtasParserException("id " + decodedVariableValue
                  + " not found in " + decodedVariableName);
            }
          } else {
            throw new MtasParserException(
                "variable " + decodedVariableName + " unknown");
          }
        }
      } else {
        try {
          builder.append(new String(dec.decode(split), StandardCharsets.UTF_8));
        } catch (IllegalArgumentException e) {
          log.info(e);
        }
      }
    }
    return builder.toString();
  }