code: def make_signature(
      name: str,
      params: dict[str, Any],
      common_params: list[str],
      common_param_values: dict[str, Any],
  ) -> str:
      """
      Create a signature for a geom or stat
  
      Gets the DEFAULT_PARAMS (params) and creates are comma
      separated list of the `name=value` pairs. The common_params
      come first in the list, and they get take their values from
      either the params-dict or the common_geom_param_values-dict.
      """
      params_lst = []
      _common_params_lookup = set(common_params)
      it = itertools.chain(
          common_params,
          (p for p in params if p not in _common_params_lookup),
      )
  
      # preferred params come first
      for i, key in enumerate(it):
          value = params.get(key, common_param_values.get(key))
          if isinstance(value, str):
              value = f'"{value}"'
          params_lst.append(f"{key}={value}")
          if i == 1:
              params_lst.append("*")
  
      params_lst.append("**kwargs")
  
      # Format to a maximum width of 78 chars
      # It fails when a parameter declarations is longer than 78
      opening = f"{name}("
      params_string = ", ".join(params_lst)
      closing = ")"
      pad = " " * 4
      if len(opening) + len(params_string) > 78:
          line_pad = f"\n{pad}"
          # One parameter per line
          if len(params_string) > 74:
              params_string = f",{line_pad}".join(params_lst)
          params_string = f"{line_pad}{params_string}"
          closing = f"\n{closing}"
      sig = f"{opening}{params_string}{closing}"
      return indent(sig, pad)
  
file_path: plotnine/plotnine/doctools.py
imports: from __future__ import annotations
  import itertools
  import os
  import re
  import typing
  from functools import lru_cache
  from textwrap import dedent, indent
label_desc: Use image node_id 2 for calling a global function with example usage: make_signature(name, params, common_params, common_param_values) and returns: indent