<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _create_flag_value_map(self, flags):
 """Returns a map of flag -> list of values, based on the given flag strings. None signals no value given (e.g., -x, --foo). The value is a list because the user may specify the same flag multiple times, and that's sometimes OK (e.g., when appending to list-valued options). """

    flag_value_map = defaultdict(list)
    for flag in flags:
      key, has_equals_sign, flag_val = flag.partition('=')
      if not has_equals_sign:
        if not flag.startswith('--'):  # '-xfoo' style.
          key = flag[0:2]
          flag_val = flag[2:]
        if not flag_val:
          # Either a short option with no value or a long option with no equals sign.
          # Important so we can distinguish between no value ('--foo') and setting to an empty
          # string ('--foo='), for options with an implicit_value.
          flag_val = None
      flag_value_map[key].append(flag_val)
    return flag_value_map