def METHOD_NAME(folder, map, keymap = None, filter = None):
  """ Write values (possibly only for the keys in the keymap and filtered) from folder to map """
  for value in folder.GetListOfKeys():
    full_name = value.ReadObj().GetName()
    if not value.IsFolder() and re.match("^<.+>f=-{,1}[0-9\.]+</.+>$", full_name):
      value_name = re.sub("<(?P<n>[^>]+)>.+", "\g<n>", full_name)
      value_numb = float(re.sub("<.+>f=(?P<n>-{,1}[0-9\.]+)</.+>", "\g<n>", full_name))
      if keymap == None or value_name in keymap:
        if not keymap == None:
          if not keymap[value_name] == None:
            value_name = keymap[value_name]
        if filter == None or re.match(filter, value_name):
          if value_name not in map:
            map[value_name] = value_numb