code: def step(self, compute=True):
          
          if self.batched:  # we're already in a context manager
              raise wandb.Error("Nested History step contexts aren't supported")
          self.batched = True
          self.compute = compute
          yield self
          if compute:
              self._write()
          compute = True
docs: Context manager to gradually build a history row, then commit it at the end.
  
          To reduce the number of conditionals needed, code can check run.history.compute:
  
          with run.history.step(batch_idx % log_interval == 0):
              run.history.add({"nice": "ok"})
              if run.history.compute:
                  # Something expensive here