code: def compute_related(self, object_id, score=pearson_score):
          
          dataset = self.dataset
          object_vector = dataset.get(object_id)
          if not object_vector:
              return []
  
          object_related = {}
          for o_id, o_vector in dataset.items():
              if o_id != object_id:
                  try:
                      object_related[o_id] = score(object_vector, o_vector)
                  except ZeroDivisionError:
                      pass
          related = sorted(object_related.items(),
                           key=lambda k_v: (k_v[1], k_v[0]), reverse=True)
          return related
docs: Compute the most related pks to an object's pk.