def METHOD_NAME(namespace):
    "Takes a namespace dict from an executed ufl file and converts it to a FileData object."
    # Object to hold all returned data
    ufd = FileData()
    # Extract object names for Form, Coefficient and FiniteElementBase objects
    # The use of id(obj) as key in object_names is necessary
    # because we need to distinguish between instances,
    # and not just between objects with different values.
    for name, value in sorted_by_key(namespace):
        # Store objects by reserved name OR instance id
        reserved_names = ("unknown",)  # Currently only one reserved name
        if name in reserved_names:
            # Store objects with reserved names
            ufd.reserved_objects[name] = value
            # FIXME: Remove after FFC is updated to use reserved_objects:
            ufd.object_names[name] = value
            ufd.object_by_name[name] = value
        elif isinstance(value, (FiniteElementBase, Coefficient, Constant, Argument, Form, Expr)):
            # Store instance <-> name mappings for important objects
            # without a reserved name
            ufd.object_names[id(value)] = name
            ufd.object_by_name[name] = value
    # Get list of exported forms
    forms = namespace.get("forms")
    if forms is None:
        # Get forms from object_by_name, which has already mapped
        # tuple->Form where needed
        def get_form(name):
            form = ufd.object_by_name.get(name)
            return form if isinstance(form, Form) else None
        a_form = get_form("a")
        L_form = get_form("L")
        M_form = get_form("M")
        forms = [a_form, L_form, M_form]
        # Add forms F and J if not "a" and "L" are used
        if a_form is None or L_form is None:
            F_form = get_form("F")
            J_form = get_form("J")
            forms += [F_form, J_form]
        # Remove Nones
        forms = [f for f in forms if isinstance(f, Form)]
    ufd.forms = forms
    # Validate types
    if not isinstance(ufd.forms, (list, tuple)):
        raise ValueError(f"Expecting 'forms' to be a list or tuple, not '{type(ufd.forms)}'.")
    if not all(isinstance(a, Form) for a in ufd.forms):
        raise ValueError("Expecting 'forms' to be a list of Form instances.")
    # Get list of exported elements
    elements = namespace.get("elements")
    if elements is None:
        elements = [ufd.object_by_name.get(name) for name in ("element",)]
        elements = [e for e in elements if e is not None]
    ufd.elements = elements
    # Validate types
    if not isinstance(ufd.elements, (list, tuple)):
        raise ValueError(f"Expecting 'elements' to be a list or tuple, not '{type(ufd.elements)}''.")
    if not all(isinstance(e, FiniteElementBase) for e in ufd.elements):
        raise ValueError("Expecting 'elements' to be a list of FiniteElementBase instances.")
    # Get list of exported coefficients
    functions = []
    ufd.coefficients = namespace.get("coefficients", functions)
    # Validate types
    if not isinstance(ufd.coefficients, (list, tuple)):
        raise ValueError(f"Expecting 'coefficients' to be a list or tuple, not '{type(ufd.coefficients)}'.")
    if not all(isinstance(e, Coefficient) for e in ufd.coefficients):
        raise ValueError("Expecting 'coefficients' to be a list of Coefficient instances.")
    # Get list of exported expressions
    ufd.expressions = namespace.get("expressions", [])
    # Validate types
    if not isinstance(ufd.expressions, (list, tuple)):
        raise ValueError(f"Expecting 'expressions' to be a list or tuple, not '{type(ufd.expressions)}'.")
    if not all(isinstance(e[0], Expr) for e in ufd.expressions):
        raise ValueError("Expecting 'expressions' to be a list of Expr instances.")
    # Return file data
    return ufd