def from_instance(instance):
    """Returns the locality id, pool and thread id the str `instance`.
    If `instance` is not valid, then None is returned."""
    if isinstance(instance, tuple) or isinstance(instance, list):
        if not len(instance) == 3:
            return None

        if isinstance(instance, list):
            instance = tuple(instance)

        return instance
    elif isinstance(instance, str):
        return instance, None, "total"
    else:
        return None