code: def log(x, base=None):
      """
      Calculate the log
  
      Parameters
      ----------
      x : float | array_like
          Input values
      base : int | float, default=None
          Base of the log. If `None`, the natural logarithm
          is computed (`base=np.e`).
  
      Returns
      -------
      out : float | ndarray
          Calculated result
      """
      if base == 10:
          return np.log10(x)
      elif base == 2:
          return np.log2(x)
      elif base is None or base == np.e:
          return np.log(x)
      else:
          return np.log(x) / np.log(base)
  
imports: from __future__ import annotations
  import inspect
  import itertools
  import warnings
  from collections import defaultdict
  from collections.abc import Iterable, Sequence
  from contextlib import suppress
  from typing import TYPE_CHECKING, cast, overload
  from warnings import warn
  import numpy
  import pandas
  from pandas.core.groupby import DataFrameGroupBy
  from ..exceptions import PlotnineError, PlotnineWarning
  from ..mapping import aes
label_desc: Use image node_id 35 for calling a global function with example usage: log(x, base) and returns: np, np, np, unknown