code: def parse(tokens):
      '''Parse the provided string to produce *args and **kwargs'''
      args = []
      kwargs = {}
      last = None
      for token in tokens:
          if token.startswith('--'):
              # If this is a keyword flag, but we've already got one that we've
              # parsed, then we're going to interpret it as a bool
              if last:
                  kwargs[last] = True
              # See if it is the --foo=5 style
              last, _, value = token.strip('-').partition('=')
              if value:
                  kwargs[last] = value
                  last = None
          elif last != None:
              kwargs[last] = token
              last = None
          else:
              args.append(token)
  
      # If there's a dangling last, set that bool
      if last:
          kwargs[last] = True
  
      return args, kwargf parse(tokens):
      '''Parse the provided string to produce *args and **kwargs'''
      args = []
      kwargs = {}
      last = None
      for token in tokens:
          if token.startswith('--'):
              # If this is a keyword flag, but we've already got one that we've
              # parsed, then we're going to interpret it as a bool
              if last:
                  kwargs[last] = True
              # See if it is the --foo=5 style
              last, _, value = token.strip('-').partition('=')
              if value:
                  kwargs[last] = value
                  last = None
          elif last != None:
              kwargs[last] = token
              last = None
          else:
              args.append(token)
  
      # If there's a dangling last, set that bool
      if last:
          kwargs[last] = True
  
      return args, kwargs
docs: Parse the provided string to produce *args and **kwargs