code: def is_series(data):
      
      dd = None
      if 'dask' in sys.modules:
          import dask.dataframe as dd
      return((pd is not None and isinstance(data, pd.Series)) or
            (dd is not None and isinstance(data, dd.Series)))
docs: Checks whether the supplied data is of Series type.