from typing import Any
from typing import Sequence


def _get_value_str(value: Any, arguments: Sequence[str], index: int = 0) -> str:
  """Returns the `value_str` given parsed `arguments` and the desired `index`.

  Args:
    value: The input value to generate a string representation for.
    arguments: The input sequence of arguments as returned by
      `_retrieve_argnames()`.
    index: The index of the argument in `arguments` correspoding to value.

  Returns:
    The corresponding `value_str` representation.
  """
  if arguments and len(arguments) > index:
    return f'{arguments[index]}={value}'
  return f'{value}'