code: def c(*args):
      r"""Imitates the ``c`` function from R.
  
      Since this whole library is aimed at re-creating in
      Python what R has already done so well, the ``c`` function was created to
      wrap ``numpy.concatenate`` and mimic the R functionality. Similar to R,
      this works with scalars, iterables, and any mix therein.
  
      Note that using the ``c`` function on multi-nested lists or iterables
      will fail!
  
      Examples
      --------
      Using ``c`` with varargs will yield a single array:
  
      >>> c(1, 2, 3, 4)
      array([1, 2, 3, 4])
  
      Using ``c`` with nested lists and scalars will also yield a single array:
  
      >>> c([1, 2], 4, c(5, 4))
      array([1, 2, 4, 5, 4])
  
      However, using ``c`` with multi-level lists will fail!
  
      >>> c([1, 2, 3], [[1, 2]])  # doctest: +SKIP
      ValueError: all the input arrays must have same number of dimensions
  
      References
      ----------
      .. [1] https://stat.ethz.ch/R-manual/R-devel/library/base/html/c.html
      """
      # R returns NULL for this
      if not args:
          return None
  
      # just an array of len 1
      if len(args) == 1:
          element = args[0]
  
          # if it's iterable, make it an array
          if is_iterable(element):
              return np.asarray(element)
  
          # otherwise it's not iterable, put it in an array
          return np.asarray([element])
  
      # np.concat all. This can be slow, as noted by numerous threads on
      # numpy concat efficiency, however an alternative using recursive
      # yields was tested and performed far worse:
      #
      # >>> def timeit(func, ntimes, *args):
      # ...     times = []
      # ...     for i in range(ntimes):
      # ...         start = time.time()
      # ...         func(*args)
      # ...         times.append(time.time() - start)
      # ...     arr = np.asarray(times)
      # ...     print("%s (%i times) - Mean: %.5f sec, "
      # ...           "Min: %.5f sec, Max: %.5f" % (func.__name__, ntimes,
      # ...                                         arr.mean(), arr.min(),
      # ...                                         arr.max()))
      # >>> y = [np.arange(10000), range(500), (1000,), 100, np.arange(50000)]
      # >>> timeit(c1, 100, *y)
      # c1 (100 times) - Mean: 0.00009 sec, Min: 0.00006 sec, Max: 0.00065
      # >>> timeit(c2, 100, *y)
      # c2 (100 times) - Mean: 0.08708 sec, Min: 0.08273 sec, Max: 0.10115
      #
      # So we stick with c1, which is this variant.
      return np.concatenate(
          [a if is_iterable(a) else [a] for a in args]
      )
  
file_path: pmdarima/pmdarima/utils/array.py
imports: from sklearn.utils import validation
  import numpy
  import pandas
  from ..compat import DTYPE
  from ._array import C_intgrt_vec
label_desc: Use image node_id 2 for calling a global function with example usage: c() and returns: np, None, np, np