code: def _find_common_type_decimal(dtypes):
      # Find the largest scale and the largest difference between
      # precision and scale of the columns to be concatenated
      s = max(dtype.scale for dtype in dtypes)
      lhs = max(dtype.precision - dtype.scale for dtype in dtypes)
      # Combine to get the necessary precision and clip at the maximum
      # precision
      p = s + lhs
  
      if p > cudf.Decimal64Dtype.MAX_PRECISION:
          return cudf.Decimal128Dtype(
              min(cudf.Decimal128Dtype.MAX_PRECISION, p), s
          )
      elif p > cudf.Decimal32Dtype.MAX_PRECISION:
          return cudf.Decimal64Dtype(
              min(cudf.Decimal64Dtype.MAX_PRECISION, p), s
          )
      else:
          return cudf.Decimal32Dtype(
              min(cudf.Decimal32Dtype.MAX_PRECISION, p), s
          )
  
imports: import datetime
  from collections import namedtuple
  from decimal import Decimal
  import cupy
  import numpy
  import pandas
  import pyarrow
  from pandas.core.dtypes.common import infer_dtype_from_object
  import cudf
  from cudf._typing import DtypeObj
  from cudf.api.types import is_bool, is_float, is_integer
label_desc: Use image node_id 4 for calling a global function with example usage: _find_common_type_decimal(dtypes) and returns: cudf, cudf, cudf