def METHOD_NAME(saved_model_dir, tags):
  """Gets `MetaGraphDef` from a directory containing a `SavedModel`.
  Returns the `MetaGraphDef` for the given tag-set and SavedModel directory.
  Args:
    saved_model_dir: Directory containing the SavedModel.
    tags: Comma separated list of tags used to identify the correct
      `MetaGraphDef`.
  Raises:
    ValueError: An error when the given tags cannot be found.
  Returns:
    A `MetaGraphDef` corresponding to the given tags.
  """
  saved_model = reader.read_saved_model(saved_model_dir)
  set_of_tags = set([tag.strip() for tag in tags.split(',')])
  for meta_graph_def in saved_model.meta_graphs:
    if set(meta_graph_def.meta_info_def.tags) == set_of_tags:
      return meta_graph_def
  raise ValueError('Could not find MetaGraphDef with tags {}'.format(tags))