import yaml


def parse_str(source: str, model_content: str) -> dict[str, dict]:
    """Parse a string containing one or more yaml model definitions.

    Args:
        source:  The file the content came from (to help with better logging)
        model_content:  The yaml to parse

    Returns:
        A dictionary of the parsed model(s).  The key is the type name from the model and the
        value is the parsed model root.
    """
    parsed_models = {}

    roots = yaml.load_all(model_content, Loader=yaml.FullLoader)
    for root in roots:
        if "import" in root:
            del root["import"]
        root_name = list(root.keys())[0]
        parsed_models[root[root_name]["name"]] = root
    return parsed_models