code: def ensure_workdir_exists(context):
      
      ensure_context_attribute_exists(context, "workdir", None)
      if not context.workdir:
          context.workdir = os.path.abspath(WORKDIR)
      pathutil.ensure_directory_exists(context.workdir)
docs: Ensures that the work directory exists.
      In addition, the location of the workdir is stored as attribute in
      the context object.