import logging


def argument_name(argument):
  """Gets argument name from string in the form "--arg_name=value".

  Args:
    argument: String argument in the form --arg_name=value.

  Returns:
    String argument name.
  """
  if len(argument) < 4 or argument[:2] != '--' or '=' not in argument:
    logging.error('Invalid argument: %s. Argument must be in the form '
                  '--name=value', argument)
    return ''
  return argument[2:argument.index('=')]