code: def ensure_obj(f):
      
      @click.pass_context
      def new_func(ctx, *args, **kwargs):
          if ctx.obj is None:
              ctx.obj = {}
          return ctx.invoke(f, *args, **kwargs)
      return update_wrapper(new_func, f)
docs: A decorator that ensures context.obj exists. If it doesn't,
      a new dict() is created and stored as obj.