from typing import Optional
import yaml


def find_inventory(inventory: Optional[str] = None):
    """
    Finds the inventory file, and return it as a yaml object.
    """
    if inventory is None:
        inventory = "inventory.yaml"

    # pylint: disable=C0103
    with open(inventory, "r") as f:
        return yaml.safe_load(f)