code: def get_num_branches(self):
          
          num = {}
          for trt, branches in itertools.groupby(
                  self.branches, operator.attrgetter('trt')):
              num[trt] = sum(1 for br in branches if br.effective)
          return num
docs: Return the number of effective branches for tectonic region type,
          as a dictionary.