Base helper to output a key value using left justify.
546358
def output_sub_line(gandi, key, val, justify):
    
    msg = ('\t%%-%ds:%%s' % justify) % (key, (' %s' % val) if val else '')
    gandi.echo(msg)
573113
def dot_vals(value):
    '''
    
    '''
    ret = {}
    for key, val in six.iteritems(__pillar__.get('master', {})):
        if key.startswith('{0}.'.format(value)):
            ret[key] = val
    for key, val in six.iteritems(__opts__):
        if key.startswith('{0}.'.format(value)):
            ret[key] = val
    return ret
369275
def print_number_str(self, value, justify_right=True):
        
        # Calculate length of value without decimals.
        length = len(value.translate(None, '.'))
        # Error if value without decimals is longer than 4 characters.
        if length > 4:
            self.print_str('----')
            return
        # Calculcate starting position of digits based on justification.
        pos = (4-length) if justify_right else 0
        # Go through each character and print it on the display.
        for i, ch in enumerate(value):
            if ch == '.':
                # Print decimal points on the previous digit.
                self.set_decimal(pos-1, True)
            else:
                self.set_digit(pos, ch)
                pos += 1
176865
def text args, key_args
      anchor, font, justify, text =
      key_args.values_at(*%w{anchor font justify text})
       # width handled by handle_generic_config
      
      proc do |tkaroid, cos_r, sin_r|
        x = tkaroid.x
        y = tkaroid.y
        params = tkaroid.params

        xv, yv = args.map {|arg| arg[params] rescue arg}
        coords = [
          x + xv * cos_r - yv * sin_r,
          y + xv * sin_r + yv * cos_r
        ]
        
        config = {}
        handle_generic_config(config, params, key_args)

        if anchor
          config[:anchor] = anchor[params] rescue anchor
        end
        if font
          config[:font] = font[params] rescue font
        end
        if justify
          config[:justify] = justify[params] rescue justify
        end
        if text
          config[:text] = text[params] rescue text
        end

        [TkcText, coords, config]
      end
    end
1082046
private short getAlignment(String value)
    {
        short ret = ALIGN_LEFT;

        if(value.equals("centre"))
            ret = ALIGN_CENTRE;
        else if(value.equals("left"))
            ret = ALIGN_LEFT;
        else if(value.equals("right"))
            ret = ALIGN_RIGHT;
        else if(value.equals("justify"))
            ret = ALIGN_JUSTIFY;
        else if(value.equals("fill"))
            ret = ALIGN_FILL;

        return ret;
    }
871173
def _extract_key_val(kv, delimiter='='):
    '''
    '''
    pieces = kv.split(delimiter)
    key = pieces[0]
    val = delimiter.join(pieces[1:])
    return key, val
396530
def kwarg(string, separator='='):
    """"""
    if separator not in string:
        raise ValueError("Separator '%s' not in value '%s'"
                         % (separator, string))
    if string.strip().startswith(separator):
        raise ValueError("Value '%s' starts with separator '%s'"
                         % (string, separator))
    if string.strip().endswith(separator):
        raise ValueError("Value '%s' ends with separator '%s'"
                         % (string, separator))
    if string.count(separator) != 1:
        raise ValueError("Value '%s' should only have one '%s' separator"
                         % (string, separator))
    key, value = string.split(separator)
    return {key: value}
955375
function printVueFor(value, textToDoc) {
  const { left, operator, right } = parseVueFor(value);
  return concat([
    group(
      textToDoc(`function _(${left}) {}`, {
        parser: "babel",
        __isVueForBindingLeft: true
      })
    ),
    " ",
    operator,
    " ",
    textToDoc(right, { parser: "__js_expression" })
  ]);
}
595435
def parenthesize(self, expr, level, *args, strict=False, **kwargs):
        """"""
        needs_parenths = (
            (precedence(expr) < level) or
            (strict and precedence(expr) == level))
        if needs_parenths:
            return (
                self._parenth_left + self.doprint(expr, *args, **kwargs) +
                self._parenth_right)
        else:
            return self.doprint(expr, *args, **kwargs)
678875
function equalOwnProperties(left, right, equalityComparer) {
        if (left === right)
            return true;
        if (!left || !right)
            return false;
        for (var key in left)
            if (hasOwnProperty.call(left, key)) {
                if (!hasOwnProperty.call(right, key) === undefined)
                    return false;
                if (equalityComparer ? !equalityComparer(left[key], right[key]) : left[key] !== right[key])
                    return false;
            }
        for (var key in right)
            if (hasOwnProperty.call(right, key)) {
                if (!hasOwnProperty.call(left, key))
                    return false;
            }
        return true;
    }
949321
def output(ret, **kwargs):
    '''
    
    '''
    # Prefer kwargs before opts
    retcode = kwargs.get('_retcode', 0)
    base_indent = kwargs.get('nested_indent', 0) \
        or __opts__.get('nested_indent', 0)
    nest = NestDisplay(retcode=retcode)
    lines = nest.display(ret, base_indent, '', [])
    try:
        return '\n'.join(lines)
    except UnicodeDecodeError:
        # output contains binary data that can't be decoded
        return str('\n').join(  # future lint: disable=blacklisted-function
            [salt.utils.stringutils.to_str(x) for x in lines]
        )
778957
def partial_format(target, **kwargs):
  
  output = target[:]

  for tag, var in re.findall(r'(\{(.*?)\})', output):
    root = var.split('.')[0]  # dot notation
    root = root.split('[')[0]  # dict notation
    if root in kwargs:
      output = output.replace(tag, tag.format(**{root: kwargs[root]}))

  return output
438720
def align_buf(buf, sample_width):
    """"""
    remainder = len(buf) % sample_width
    if remainder != 0:
        buf += b'\0' * (sample_width - remainder)
    return buf
917153
def rpush(self, key, value, *values):
        
        return self.execute(b'RPUSH', key, value, *values)
787178
def get_output_str(item, detect_numerics, precision, sign_value):
    """"""
    if detect_numerics:
        item = _convert_to_numeric(item)
    if isinstance(item, float):
        item = round(item, precision)
    try:
        item = '{:{sign}}'.format(item, sign=sign_value)
    except (ValueError, TypeError):
        pass
    return to_unicode(item)
1246791
function C(iid, left) {
        var aret;
        if (sandbox.analysis && sandbox.analysis.conditional) {
            aret = sandbox.analysis.conditional(iid, left);
            if (aret) {
                left = aret.result;
            }
        }

        lastVal = left;
        return (lastComputedValue = left);
    }
1165840
def _nested_output(obj):
    '''
    
    '''
    nested.__opts__ = __opts__
    ret = nested.output(obj).rstrip()
    return ret