code: def _coerce_to_scalar(obj):
      """Coerce obj to scalar, from polymorphic input scalar or pandas."""
      if isinstance(obj, pd.DataFrame):
          assert len(obj) == 1
          assert len(obj.columns) == 1
          return obj.iloc[0, 0]
      if isinstance(obj, pd.Series):
          assert len(obj) == 1
          return obj.iloc[0]
      return obj
  
imports: import pandas
label_desc: Use image node_id 1 for calling a global function with example usage: _coerce_to_scalar(obj) and returns: obj, obj, obj