docs: def validate_load_areas(session, nw):
      '''Validate if total load of a grid in a pkl file is what expected from load areas
      
      Parameters
      ----------
      session : sqlalchemy.orm.session.Session
          Database session
      nw
          The network
          
      Returns
      -------
      DataFrame
          compare_by_la
      Bool
          True if data base IDs of LAs are the same as the IDs in the grid 
      '''
      #config network intern variables
      nw._config = nw.import_config()
      nw._pf_config = nw.import_pf_config()
      nw._static_data = nw.import_static_data()
      nw._orm = nw.import_orm()
  
      #rescue peak load from input table
      load_input = nw.list_load_areas(session, nw.mv_grid_districts())
      la_input = sorted(load_input.index)
      load_input = load_input.sum(axis=0).apply(lambda x: np.round(x,3))
      load_input.sort_index(inplace=True)
  
      #search for LA in the grid
      la_idx = 0
      la_dict = {}
      for mv_district in nw.mv_grid_districts():
          for LA in mv_district.lv_load_areas():
              la_idx +=1
              la_dict[la_idx] = {
                  'id_db':LA.id_db,
                  'peak_load_residential':LA.peak_load_residential,
                  'peak_load_retail':LA.peak_load_retail,
                  'peak_load_industrial':LA.peak_load_industrial,
                  'peak_load_agricultural':LA.peak_load_agricultural,
              }
  
      #compare by LA
      load_effective = pd.DataFrame.from_dict(la_dict,orient='index').set_index('id_db')
      la_effective = sorted(load_effective.index)
      load_effective = load_effective.sum(axis=0).apply(lambda x: np.round(x,3))
      load_effective.sort_index(inplace=True)
  
      compare_by_la = pd.concat([load_input,load_effective,load_input==load_effective],axis=1)
      compare_by_la.columns = ['table','ding0','equal?']
      compare_by_la.index.names = ['sector']
  
      return compare_by_la, la_input==la_effective