def METHOD_NAME(cls, document_id, collection=None):
    try:
        document_id = int(Namespace.strip(document_id))
    except Exception:
        return
    q = cls.all()
    q = q.filter(cls.id == document_id)
    if collection is not None:
        q = q.filter(cls.collection_id == collection.id)
    return q.first()