<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def to_resolvers(sweepable: Sweepable) -> List[ParamResolver]: """Convert a Sweepable to a list of ParamResolvers."""

    if isinstance(sweepable, ParamResolver):
        return [sweepable]
    elif isinstance(sweepable, Sweep):
        return list(sweepable)
    elif isinstance(sweepable, collections.Iterable):
        iterable = cast(collections.Iterable, sweepable)
        return list(iterable) if isinstance(next(iter(iterable)),
                                            ParamResolver) else sum(
            [list(s) for s in iterable], [])
    raise TypeError('Unexpected Sweepable type.')