<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def resolve_type_name(ctx, param, value):
 # pylint: disable=unused-argument """Resolve CLI option type name"""


    def _resolve(value):
        """Resolve single type name"""
        value = [
            type_id
            for type_id, type_name in W1ThermSensor.TYPE_NAMES.items()
            if type_name == value
        ][0]
        return value

    if not value:
        return value

    if isinstance(value, tuple):
        return [_resolve(v) for v in value]
    else:
        return _resolve(value)