<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get(cls, resource_type):
 """Returns the ResourceType object for `resource_type`. If no existing object was found, a new type will be created in the database and returned Args: resource_type (str):
 Resource type name Returns: :obj:`ResourceType` """

        if isinstance(resource_type, str):
            obj = getattr(db, cls.__name__).find_one(cls.resource_type == resource_type)

        elif isinstance(resource_type, int):
            obj = getattr(db, cls.__name__).find_one(cls.resource_type_id == resource_type)

        elif isinstance(resource_type, cls):
            return resource_type

        else:
            obj = None

        if not obj:
            obj = cls()
            obj.resource_type = resource_type
            db.session.add(obj)
            db.session.commit()
            db.session.refresh(obj)

        return obj