parameters: (sign, body, spec)
return_statement: return result
docstring: Given an unpadded, non-aligned numeric string 'body' and sign
      string 'sign', add padding and alignment conforming to the given
      format specifier dictionary 'spec' (as produced by
      parse_format_specifier).
  
      Also converts result to unicode if necessary.
docstring_summary: Given an unpadded, non-aligned numeric string 'body' and sign
      string 'sign', add padding and alignment conforming to the given
      format specifier dictionary 'spec' (as produced by
      parse_format_specifier).
docstring_tokens: Given an unpadded non - aligned numeric string body and sign string sign add padding and alignment conforming to the given format specifier dictionary spec ( as produced by parse_format_specifier ) .
function: def _format_align(sign, body, spec):
      """Given an unpadded, non-aligned numeric string 'body' and sign
      string 'sign', add padding and alignment conforming to the given
      format specifier dictionary 'spec' (as produced by
      parse_format_specifier).
  
      Also converts result to unicode if necessary.
  
      """
      # how much extra space do we have to play with?
      minimumwidth = spec['minimumwidth']
      fill = spec['fill']
      padding = fill*(minimumwidth - len(sign) - len(body))
  
      align = spec['align']
      if align == '<':
          result = sign + body + padding
      elif align == '>':
          result = padding + sign + body
      elif align == '=':
          result = sign + padding + body
      elif align == '^':
          half = len(padding)//2
          result = padding[:half] + sign + body + padding[half:]
      else:
          raise ValueError('Unrecognised alignment field')
  
      # make sure that result is unicode if necessary
      if spec['unicode']:
          result = unicode(result)
  
      return result
function_tokens: def _format_align ( sign , body , spec ) : # how much extra space do we have to play with? minimumwidth = spec [ 'minimumwidth' ] fill = spec [ 'fill' ] padding = fill * ( minimumwidth - len ( sign ) - len ( body ) ) align = spec [ 'align' ] if align == '<' : result = sign + body + padding elif align == '>' : result = padding + sign + body elif align == '=' : result = sign + padding + body elif align == '^' : half = len ( padding ) // 2 result = padding [ : half ] + sign + body + padding [ half : ] else : raise ValueError ( 'Unrecognised alignment field' ) # make sure that result is unicode if necessary if spec [ 'unicode' ] : result = unicode ( result ) return result