parameters: (options)
return_statement: return options_map
docstring: Parse options and returns a dict.
  
      Since there are options which can be specifed with a short('-') or long
      ('--') form, we preserve that in key map as {option_name: (value, form)}.
docstring_summary: Parse options and returns a dict.
docstring_tokens: Parse options and returns a dict .
function: def parse_options(options):
      """Parse options and returns a dict.
  
      Since there are options which can be specifed with a short('-') or long
      ('--') form, we preserve that in key map as {option_name: (value, form)}.
      """
      options_map = collections.defaultdict(list)
      opts = shlex.split(options)
      opt_name = None
      opt_form = None
      for opt in opts:
          # Handle options which could start with "-" or "--".
          if opt.startswith("-"):
              opt_idx = 2 if opt[1] == "-" else 1
              opt_form = opt[:opt_idx]
              eq_idx = opt.find("=")
              if eq_idx == -1:
                  opt_name = opt[opt_idx:]
                  options_map[opt_name] = (None, opt_form)
              else:
                  opt_name = opt[opt_idx:eq_idx]
                  options_map[opt_name] = (opt[eq_idx + 1:], opt_form)
                  opt_name = None
          elif opt_name:
              options_map[opt_name] = (opt, opt_form)
      return options_map
function_tokens: def parse_options ( options ) : options_map = collections . defaultdict ( list ) opts = shlex . split ( options ) opt_name = None opt_form = None for opt in opts : # Handle options which could start with "-" or "--". if opt . startswith ( "-" ) : opt_idx = 2 if opt [ 1 ] == "-" else 1 opt_form = opt [ : opt_idx ] eq_idx = opt . find ( "=" ) if eq_idx == - 1 : opt_name = opt [ opt_idx : ] options_map [ opt_name ] = ( None , opt_form ) else : opt_name = opt [ opt_idx : eq_idx ] options_map [ opt_name ] = ( opt [ eq_idx + 1 : ] , opt_form ) opt_name = None elif opt_name : options_map [ opt_name ] = ( opt , opt_form ) return options_map