<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def cast(type_name, value, **opts):
 """Convert a given string to the type indicated by ``type_name``. If ``None`` is passed in, it will always be returned. Optional arguments can include ``true_values`` and ``false_values`` to describe boolean types, and ``format`` for dates. """

    type_name, opts = _field_options(type_name, opts)
    return converter(type_name).cast(value, **opts)