def METHOD_NAME(variables):
  """Returns an `OrderedDict` of `vars`, keyed by names.
  Checks that all variables have unique names. The order of the variables
  is preserved, since this may be important if the values are used as a list
  later, as in keras_model.set_weights().
  Args:
    variables: An iterable of variables.
  Returns:
    A `collections.OrderedDict` keyed by variable name with the ":0" removed.
  """
  tuples = []
  seen_names = set()
  for v in variables:
    py_typecheck.check_type(v, tf.Variable, 'v')
    name = v.name
    if name[-2:] != ':0':
      raise ValueError('Variable has unexpected name {}'.format(v.name))
    name = v.name[:-2]
    if name in seen_names:
      raise ValueError('Found multiple variables with the name', name)
    tuples.append((name, v))
    seen_names.add(name)
  return collections.OrderedDict(tuples)