code: def ensure_ndarray_2d(X):
      assert X is not None
      tmp = ensure_ndarray(X)
      if len(tmp.shape) not in [1, 2]:
          raise ValueError("Requires 1d or 2d array")
      if len(tmp.shape) == 2:
          return tmp
      result = np.expand_dims(tmp, 1)
      assert len(result.shape) == 2
      return result
  
file_path: fairlearn/test/unit/input_convertors.py
imports: import numpy
  import pandas
  from fairlearn.utils._input_validation import _merge_columns
label_desc: Use image node_id 4 for calling a global function with example usage: ensure_ndarray_2d(X) and returns: result, tmp