<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def parse_dest(*args, **kwargs):
 """Select the dest name for an option registration. If an explicit `dest` is specified, returns that and otherwise derives a default from the option flags where '--foo-bar' -> 'foo_bar' and '-x' -> 'x'. """

    explicit_dest = kwargs.get('dest')
    if explicit_dest:
      return explicit_dest

    arg = next((a for a in args if a.startswith('--')), args[0])
    return arg.lstrip('-').replace('-', '_')