code: def get_ancestors(self, limit: int, header: BlockHeader) -> Tuple[BaseBlock, ...]:
          
          ancestor_count = min(header.block_number, limit)
  
          # We construct a temporary block object
          vm_class = self.get_vm_class_for_block_number(header.block_number)
          block_class = vm_class.get_block_class()
          block = block_class(header=header, uncles=[])
  
          ancestor_generator = iterate(compose(
              self.get_block_by_hash,
              operator.attrgetter('parent_hash'),
              operator.attrgetter('header'),
          ), block)
          # we peel off the first element from the iterator which will be the
          # temporary block object we constructed.
          next(ancestor_generator)
  
          return tuple(take(ancestor_count, ancestor_generator))
docs: Return `limit` number of ancestor blocks from the current canonical head.