code: def write(self, output='jsonstat'):
          
  
          if output == 'jsonstat':
              return json.dumps(self)
          elif output == 'dataframe_list':
              df_list = []
              unnest_collection(self, df_list)
              return df_list
          else:
              raise ValueError(
                  "Allowed arguments are 'jsonstat' or 'dataframe_list'")
docs: Writes data from a Collection object to JSONstat or list of \
             Pandas Dataframes.
          Args:
              output(string): can accept 'jsonstat' or 'dataframe_list'
  
          Returns:
              Serialized JSONstat or a list of Pandas Dataframes,depending on \
              the 'output' parameter.