code: def _validate_field_names(field_names):
      """Validate field names."""
      # Same logic as used for namedtuples.
      seen = set()
      for name in field_names:
          if not isinstance(name, str):
              raise TypeError(
                  "Field names must be strings: {} has type {}".format(
                      name, type(name)
                  )
              )
          if not name.isidentifier():
              raise ValueError(
                  "Field names must be valid identifiers: {}".format(
                      name
                  )
              )
          if keyword.iskeyword(name):
              raise ValueError(
                  "Field names cannot be a keyword: {}".format(name)
              )
          if name.startswith("_"):
              raise ValueError(
                  "Field names cannot start with an underscore: {}".format(
                      name
                  )
              )
          if name in seen:
              raise ValueError(
                  "Encountered duplicate field name: {}".format(name)
              )
          seen.add(name)
  
imports: import builtins
  import collections
  import keyword
  import weakref
label_desc: Use image node_id 2 for calling a global function with example usage: _validate_field_names(field_names) without return types