code: def key_source(self):
          
          def parent_gen(self):
              if self.target.full_table_name not in self.connection.dependencies:
                  self.connection.dependencies.load()
              for parent_name, fk_props in self.target.parents(primary=True).items():
                  if not parent_name.isdigit():  # simple foreign key
                      yield FreeTable(self.connection, parent_name).proj()
                  else:
                      grandparent = list(self.connection.dependencies.in_edges(parent_name))[0][0]
                      yield FreeTable(self.connection, grandparent).proj(**{
                          attr: ref for attr, ref in fk_props['attr_map'].items() if ref != attr})
  
          if self._key_source is None:
              parents = parent_gen(self)
              try:
                  self._key_source = next(parents)
              except StopIteration:
                  raise DataJointError('A relation must have primary dependencies for auto-populate to work') from None
              for q in parents:
                  self._key_source *= q
          return self._key_source
docs: :return: the relation whose primary key values are passed, sequentially, to the
                  ``make`` method when populate() is called.
                  The default value is the join of the parent relations.
                  Users may override to change the granularity or the scope of populate() calls.