code: def load_entities():
      
      path = os.path.join(TOPDIR, 'entities.json')
      entities = json.load(open(path))
      names = [i['name'] for i in entities]
  
      try:
          assert len(set(names)) == len(entities)
      except AssertionError:
          raise Exception('Entities with same name: %s' % [i for i in names if
                                                           names.count(i) > 1])
  
      entities = dict((k['name'], c.Entity(name=k['name'],
                                           dimensions=k['dimensions'],
                                           uri=k['URI'])) for k in entities)
  
      dimensions_ent = defaultdict(list)
      for ent in entities:
          if not entities[ent].dimensions:
              continue
          perms = get_dimension_permutations(entities, entities[ent].dimensions)
          for perm in perms:
              key = get_key_from_dimensions(perm)
              dimensions_ent[key].append(entities[ent])
  
      return entities, dimensions_ent
docs: Load entities from JSON file.