def enum_hook(obj):
    """Hook function passed to json-deserializer as "object_hook".
        EnumEncoder in runhistory/runhistory.
        """
    if '__enum__' in obj:
        name, member = obj['__enum__'].split('.')
        if name == 'StatusType':
            return getattr(globals()[name], member)
    return obj
