@classmethod
def find_registry(cls, id: str=None, name: str=None) ->'Registry':
    """Finds a registry based on either id or name.

        If neither is provided and there is only 1 registry, return the
        only registry.
        """
    if id:
        return cls.get(id)
    elif name:
        return cls.find_by_name(name)
    else:
        registries = cls.list()
        if len(registries) == 1:
            return registries[0]
