def define_argument_name(method, string):
  """
  Define a valid Python argument name for the given <method name, param name>
  pair. This method ensures that the generated argument name is a valid Python
  argument name and is not already assigned to an argument in the same method.

  Args:
    method Name of the class to which the argument belongs
    string  Name of the parameter for which an argument is being generated

  Returns:
    Name of the argument
  """
  temp_name = ''.join([i for i in string if i.isalnum() or i == '_'])
  if not temp_name:
    temp_name = 'param'
  elif temp_name[0].isdigit():
    temp_name = 'param_' + temp_name
  param_name = temp_name[0].lower() + temp_name[1:]
  counter = 0
  while True:
    if method.has_argument(param_name):
      if counter > 0:
        param_name = param_name[:-1*len(str(counter))]
      counter += 1
      param_name += str(counter)
      continue
    else:
      return param_name