def modify_parse_args(args):
 mods = {}
 dels = []
 query = []
 for arg in args:
  if (arg.endswith('!') and ('=' not in arg) and (':' not in arg)):
   dels.append(arg[:(-1)])
  elif (('=' in arg) and (':' not in arg.split('=', 1)[0])):
   (key, val) = arg.split('=', 1)
   mods[key] = val
  else:
   query.append(arg)
 return (query, mods, dels)

def modify_parse_args ( args ) : mods = { } dels = [ ] query = [ ] for arg in args : if ( arg . endswith ( '!' ) and ( '=' not in arg ) and ( ':' not in arg ) ) : dels . append ( arg [ : ( - 1 ) ] ) elif ( ( '=' in arg ) and ( ':' not in arg . split ( '=' , 1 ) [ 0 ] ) ) : ( key , val ) = arg . split ( '=' , 1 ) mods [ key ] = val else : query . append ( arg ) return ( query , mods , dels )
split the arguments for the modify subcommand into query parts .