def get_doctype_from_node(node):

    if node.is_registration:
        return 'registration'
    elif node.category in COMPONENT_CATEGORIES:
        return 'component'
    else:
        return node.category
dataset/ETHPy150Open CenterForOpenScience/osf.io/website/search/elastic_search.py/get_doctype_from_node/original