def METHOD_NAME(filename, event_names=None, layer_event_names=None, model=0):
  """Load specified events from filename.
  model specifies the model to load events from; -1 means any model.
  event_names is a sequence of event names not associated with any layer to
  load.
  layer_event_names is a sequence of layer event names to load.
  This assumes events are named in a relatively standard way:
  - event names are of the form modelN/event-name
  - layer event names are of the form modelN/layer-name/event-name
  Note event-name may have additional slashes in it.
  Returns a dictionary of the results.
  """
  if event_names is None:
    event_names = []
  if layer_event_names is None:
    layer_event_names = []
  results = None
  if model < 0:
    results = defaultdict(dict)
  else:
    results = {}
  for e in yield_events(filename):
    if len(e.summary.value) == 0:
      continue  # Skip non-value entries.
    tag = e.summary.value[0].tag
    val = e.summary.value[0].simple_value
    split_tag1 = tag.split('/', 1)  # For general events.
    if len(split_tag1) <= 1:
      continue
    split_tag2 = tag.split('/', 2)  # For layer events.
    # Determine whether this is the appropriate model.
    # len('model') = 5
    model_num = int(split_tag1[0][5:])
    if model >= 0 and model != model_num:
      continue
    tag = tag[tag.find('/')+1:]
    # Determine where in the results dictionary to add.
    base = results
    if model < 0:
      base = results[model_num]
    event_name = split_tag1[1]
    # Check if this matches an event.
    if event_name in event_names:
      if split_tag1[1] in base:
        base[event_name].append(val)
      else:
        base[event_name] = [val]
    # Check if this matches a layer event.
    if len(split_tag2) != 3:
      continue
    layer = split_tag2[1]
    layer_event_name = split_tag2[2]
    if layer_event_name in layer_event_names:
      if layer_event_name in base:
        if layer in base[layer_event_name]:
          base[layer_event_name][layer].append(val)
        else:
          base[layer_event_name][layer] = [val]
      else:
        base[layer_event_name] = {layer: [val]}
  return results