def failureFromJSON(failureDict):
 newFailure = getattr(Failure, '__new__', None)
 if (newFailure is None):
  f = types.InstanceType(Failure)
 else:
  f = newFailure(Failure)
 if (not _PY3):
  failureDict = asBytes(failureDict)
 typeInfo = failureDict['type']
 failureDict['type'] = type(typeInfo['__name__'], (), typeInfo)
 f.__dict__ = failureDict
 return f

def failureFromJSON ( failureDict ) : newFailure = getattr ( Failure , '__new__' , None ) if ( newFailure is None ) : f = types . InstanceType ( Failure ) else : f = newFailure ( Failure ) if ( not _PY3 ) : failureDict = asBytes ( failureDict ) typeInfo = failureDict [ 'type' ] failureDict [ 'type' ] = type ( typeInfo [ '__name__' ] , ( ) , typeInfo ) f . __dict__ = failureDict return f
load a l{failure} from a dictionary deserialized from json .