original_docstring: Take a plant-column data frame and decompose it into plant-column data frames
      for each resources-areas combinations.
  
      :param pandas.DataFrame df: data frame, columns are plant id in grid.
      :param dict areas: areas to use for decomposition. Keys are area types
          ('*loadzone*', '*state*' or '*interconnect*'), values are
          str/list/tuple/set of areas.
      :param str/list/tuple/set resources: resource(s) to use for decomposition.
      :param powersimdata.input.grid.Grid grid: Grid instance.
      :return: (*dict*) -- keys are areas, values are dictionaries whose keys are
          resources and values are data frames indexed by (datetime, plant) where plant
          include only plants of matching type and located in area.
      
docstring: Take a plant-column data frame and decompose it into plant-column data frames
  for each resources-areas combinations.
docstring_tokens: Take a plant - column data frame and decompose it into plant - column data frames for each resources - areas combinations .
code: def decompose_plant_data_frame_into_areas_and_resources(df, areas, resources, grid):
      """Take a plant-column data frame and decompose it into plant-column data frames
      for each resources-areas combinations.
  
      :param pandas.DataFrame df: data frame, columns are plant id in grid.
      :param dict areas: areas to use for decomposition. Keys are area types
          ('*loadzone*', '*state*' or '*interconnect*'), values are
          str/list/tuple/set of areas.
      :param str/list/tuple/set resources: resource(s) to use for decomposition.
      :param powersimdata.input.grid.Grid grid: Grid instance.
      :return: (*dict*) -- keys are areas, values are dictionaries whose keys are
          resources and values are data frames indexed by (datetime, plant) where plant
          include only plants of matching type and located in area.
      """
      resources = _check_resources_are_in_grid_and_format(resources, grid)
      df_areas_resources = {
          a: decompose_plant_data_frame_into_resources(df_a, resources, grid)
          for a, df_a in decompose_plant_data_frame_into_areas(df, areas, grid).items()
      }
  
      return df_areas_resources
code_tokens: def decompose_plant_data_frame_into_areas_and_resources ( df , areas , resources , grid ) : resources = _check_resources_are_in_grid_and_format ( resources , grid ) df_areas_resources = { a : decompose_plant_data_frame_into_resources ( df_a , resources , grid ) for a , df_a in decompose_plant_data_frame_into_areas ( df , areas , grid ) . items ( ) } return df_areas_resources
short_docstring: Take a plant-column data frame and decompose it into plant-column data frames
  for each resources-areas combinations.
short_docstring_tokens: Take a plant - column data frame and decompose it into plant - column data frames for each resources - areas combinations .
comment: """Take a plant-column data frame and decompose it into plant-column data frames
      for each resources-areas combinations.
  
      :param pandas.DataFrame df: data frame, columns are plant id in grid.
      :param dict areas: areas to use for decomposition. Keys are area types
          ('*loadzone*', '*state*' or '*interconnect*'), values are
          str/list/tuple/set of areas.
      :param str/list/tuple/set resources: resource(s) to use for decomposition.
      :param powersimdata.input.grid.Grid grid: Grid instance.
      :return: (*dict*) -- keys are areas, values are dictionaries whose keys are
          resources and values are data frames indexed by (datetime, plant) where plant
          include only plants of matching type and located in area.
      """