code: def variable_name(value,
                    allow_empty = False,
                    **kwargs):
      
      if not value and not allow_empty:
          raise errors.EmptyValueError('value (%s) was empty' % value)
      elif not value:
          return None
  
      try:
          parse('%s = None' % value)
      except (SyntaxError, ValueError, TypeError):
          raise errors.InvalidVariableNameError(
              'value (%s) is not a valid variable name' % value
          )
  
      return value
docs: Validate that the value is a valid Python variable name.
  
      .. caution::
  
        This function does **NOT** check whether the variable exists. It only
        checks that the ``value`` would work as a Python variable (or class, or
        function, etc.) name.
  
      :param value: The value to validate.
  
      :param allow_empty: If ``True``, returns :obj:`None <python:None>` if
        ``value`` is empty. If ``False``, raises a
        :class:`EmptyValueError <validator_collection.errors.EmptyValueError>`
        if ``value`` is empty. Defaults to ``False``.
      :type allow_empty: :class:`bool <python:bool>`
  
      :returns: ``value`` / :obj:`None <python:None>`
      :rtype: :class:`str <python:str>` or :obj:`None <python:None>`
  
      :raises EmptyValueError: if ``allow_empty`` is ``False`` and ``value``
        is empty