code: def gen_obj(klass, index):
      if klass is Series:
          obj = Series(np.arange(len(index)), index=index)
      else:
          obj = DataFrame(
              np.random.default_rng(2).standard_normal(
                  (len(index), len(index))
              ),
              index=index,
              columns=index,
          )
      return obj
  
imports: import numpy
  import pytest
  from pandas import DataFrame, Index, RangeIndex, Series, date_range, period_range, timedelta_range
  import pandas._testing
label_desc: Use image node_id 1 for calling a global function with example usage: gen_obj(klass, index) and returns: obj