def METHOD_NAME(arg):
  if type(arg) == dict:
    return frozendict((k, METHOD_NAME(v)) for (k, v) in arg.iteritems())
  elif '__iter__' in dir(arg):
    return tuple( METHOD_NAME(v) for v in arg )
  else:
    return arg