code: def valid_symbol_name(name):
      
      if name in RESERVED_WORDS:
          return False
  
      gen = generate_tokens(io.BytesIO(name.encode('utf-8')).readline)
      typ, _, start, end, _ = next(gen)
      if typ == tk_ENCODING:
          typ, _, start, end, _ = next(gen)
      return typ == tk_NAME and start == (1, 0) and end == (1, len(name))
docs: Determine whether the input symbol name is a valid name.
  
      Arguments
      ---------
        name  : str
           name to check for validity.
  
      Returns
      --------
        valid :  bool
          whether name is a a valid symbol name
  
      This checks for Python reserved words and that the name matches
      the regular expression ``[a-zA-Z_][a-zA-Z0-9_]``