docs: def from_dict(cls, context_options_dict):
          """Return a context job from a dict output by Context.to_dict."""
          import copy
  
          context_options = copy.deepcopy(context_options_dict)
  
          tasks_inserted = context_options.pop('_tasks_inserted', False)
  
          insert_tasks = context_options.pop('insert_tasks', None)
          if insert_tasks:
              context_options['insert_tasks'] = path_to_reference(insert_tasks)
  
          # The constructor expects a reference to the persistence engine.
          persistence_engine = context_options.pop('persistence_engine', None)
          if persistence_engine:
              context_options['persistence_engine'] = path_to_reference(
                  persistence_engine)
  
          # If there are callbacks, reconstitute them.
          callbacks = context_options.pop('callbacks', None)
          if callbacks:
              context_options['callbacks'] = decode_callbacks(callbacks)
  
          context = cls(**context_options)
  
          context._tasks_inserted = tasks_inserted
  
          return context