code: def gen_data(dim, use_pandas):
      if dim == 1:
          out = np.empty(
              10,
          )
          if use_pandas:
              out = pd.Series(out)
      elif dim == 2:
          out = np.empty((20, 10))
          if use_pandas:
              out = pd.DataFrame(out)
      else:
          out = np.empty(np.arange(5, 5 + dim))
  
      return out
  
imports: from collections import OrderedDict
  import numpy
  import pandas
  import pytest
  from statsmodels.tools.validation import array_like, PandasWrapper, bool_like, dict_like, float_like, int_like, string_like
  from statsmodels.tools.validation.validation import _right_squeeze
label_desc: Use image node_id 2 for calling a global function with example usage: gen_data(dim, use_pandas) and returns: out