def METHOD_NAME(asset_doc, project_name):
    """Extract data from asset document that are used in templates.
    Output dictionary contains keys:
    - 'asset'       - asset name
    - 'hierarchy'   - parent asset names joined with '/'
    - 'parent'      - direct parent name, project name used if is under project
    Required document fields:
        Asset: 'name', 'data.parents'
    Args:
        asset_doc (Dict[str, Any]): Queried asset document.
        project_name (str): Is used for 'parent' key if asset doc does not have
            any.
    Returns:
        Dict[str, str]: Data that are based on asset document and can be used
            in templates.
    """
    asset_parents = asset_doc["data"]["parents"]
    hierarchy = "/".join(asset_parents)
    if asset_parents:
        parent_name = asset_parents[-1]
    else:
        parent_name = project_name
    return {
        "asset": asset_doc["name"],
        "folder": {
            "name": asset_doc["name"]
        },
        "hierarchy": hierarchy,
        "parent": parent_name
    }