          if self.output == "file":
              self.output_file(output_message, len(items_output))
  
      def output_file(self, output_message, items_discovered):
          """ Save the output to a text file in the frames directory """
          now = datetime.now().strftime("%Y%m%d_%H%M%S")
          dst_dir = self.get_output_folder()
          filename = "{}{}_{}.txt".format(self.get_filename_prefix(),
                                          self.output_message.replace(" ", "_").lower(),
 
</s> remove         filename = "{}_{}.txt".format(self.output_message.replace(" ", "_").lower(), now)
        output_file = os.path.join(self.source_dir, filename)
 </s> add         dst_dir = self.get_output_folder()
        filename = "{}{}_{}.txt".format(self.get_filename_prefix(),
                                        self.output_message.replace(" ", "_").lower(),
                                        now)
        output_file = os.path.join(dst_dir, filename) </s> remove         folder_name = "{}_{}".format(self.output_message.replace(" ", "_").lower(), now)
        output_folder = os.path.join(self.source_dir, folder_name)
 </s> add         folder_name = "{}{}_{}".format(self.get_filename_prefix,
                                       self.output_message.replace(" ", "_").lower(), now)
        dst_dir = self.get_output_folder()
        output_folder = os.path.join(dst_dir, folder_name) </s> remove         if self.frames.vid_cap:
            dest_folder = os.path.split(self.frames.folder)[0]
 </s> add         if self.frames.is_video:
            dest_folder = os.path.dirname(self.frames.folder) </s> remove         if self.job in ("multi-faces", "leftover-faces"):
 </s> add         if self.job in ("multi-faces", "leftover-faces") and self.type == "faces":
    def get_output_folder(self):
        """ Return output folder. Needs to be in the root if input is a video """
        dst_dir = os.path.dirname(self.source_dir) if self.is_video else self.source_dir
        return dst_dir

    def get_filename_prefix(self):
        """ Video name needs to be prefixed to filename if input is a video """
        if not self.is_video:
            return ""
        return "{}_".format(os.path.basename(self.source_dir))

          if self.output == "file":
              self.output_file(output_message, len(items_output))
  
    def get_output_folder(self):
        """ Return output folder. Needs to be in the root if input is a video """
        dst_dir = os.path.dirname(self.source_dir) if self.is_video else self.source_dir
        return dst_dir

    def get_filename_prefix(self):
        """ Video name needs to be prefixed to filename if input is a video """
        if not self.is_video:
            return ""
        return "{}_".format(os.path.basename(self.source_dir))

      def output_file(self, output_message, items_discovered):
          """ Save the output to a text file in the frames directory """
          now = datetime.now().strftime("%Y%m%d_%H%M%S")
          dst_dir = self.get_output_folder()
          filename = "{}{}_{}.txt".format(self.get_filename_prefix(),
                                          self.output_message.replace(" ", "_").lower(),
keep keep add keep keep keep keep keep keep
 Fix output for alignments tool tasks when input is a video 
tools/lib_alignments/jobs.py