This function checks if we are already running the :class:`Flow` with a :class:`PyFlowScheduler`.
        Raises: Flow.Error if the pid file of the scheduler exists.

def check_pid_file(self):
        """
        This function checks if we are already running the :class:`Flow` with a :class:`PyFlowScheduler`.
        Raises: Flow.Error if the pid file of the scheduler exists.
        """
        if not os.path.exists(self.pid_file):
            return 0

        self.show_status()
        raise self.Error("""\n\
            pid_file
            %s
            already exists. There are two possibilities:

               1) There's an another instance of PyFlowScheduler running
               2) The previous scheduler didn't exit in a clean way

            To solve case 1:
               Kill the previous scheduler (use 'kill pid' where pid is the number reported in the file)
               Then you can restart the new scheduler.

            To solve case 2:
               Remove the pid_file and restart the scheduler.

            Exiting""" % self.pid_file)