def parse_kwarg(string_):
 try:
  return KWARG_REGEX.match(string_).groups()
 except AttributeError:
  return (None, None)

def parse_kwarg ( string_ ) : try : return KWARG_REGEX . match ( string_ ) . groups ( ) except AttributeError : return ( None , None )
parses the string and looks for the following kwarg format: "{argument name}={argument value}" for example: "my_message=hello world" returns the kwarg name and value .