code: def _get_lat_or_lon_col_name(
      data: pd.DataFrame,
      human_readable_name: str,
      col_name_from_user: Optional[str],
      default_col_names: Set[str],
  ) -> str:
      """Returns the column name to be used for latitude or longitude."""
  
      if (
          isinstance(col_name_from_user, str)
          and col_name_from_user in data.columns
      ):
          col_name = col_name_from_user
  
      else:
          # Try one of the default col_names:
          candidate_col_name = None
  
          for c in default_col_names:
              if c in data.columns:
                  candidate_col_name = c
                  break
  
          if candidate_col_name is None:
              formatted_allowed_col_name = ", ".join(
                  map(repr, sorted(default_col_names))
              )
              formmated_col_names = ", ".join(
                  map(repr, list(data.columns))
              )
  
              raise StreamlitAPIException(
                  f"Map data must contain a {human_readable_name} column named: "
                  f"{formatted_allowed_col_name}. Existing columns: {formmated_col_names}"
              )
          else:
              col_name = candidate_col_name
  
      # Check that the column is well-formed.
      # IMPLEMENTATION NOTE: We can't use isnull().values.any() because .values can return
      # ExtensionArrays, which don't have a .any() method.
      # (Read about ExtensionArrays here: # https://pandas.pydata.org/community/blog/extension-arrays.html)
      # However, after a performance test I found the solution below runs basically as
      # fast as .values.any().
      if any(data[col_name].isnull().array):
          raise StreamlitAPIException(
              f"Column {col_name} is not allowed to contain null values, such "
              "as NaN, NaT, or None."
          )
  
      return col_name
  
imports: import copy
  import hashlib
  import json
  from typing import TYPE_CHECKING, Any, Collection, Dict, Iterable, Optional, Set, Tuple, Union, cast
  import pandas
  from typing_extensions import Final, TypeAlias
  import streamlit.elements.deck_gl_json_chart
  from streamlit import config, type_util
  from streamlit.color_util import Color, IntColorTuple, is_color_like, to_int_color_tuple
  from streamlit.errors import StreamlitAPIException
  from streamlit.proto.DeckGlJsonChart_pb2 import DeckGlJsonChart
  from streamlit.runtime.metrics_util import gather_metrics
  from streamlit.util import HASHLIB_KWARGS
label_desc: Use image node_id 2 for calling a global function with example usage: _get_lat_or_lon_col_name(data, human_readable_name, col_name_from_user, default_col_names) and returns: col_name