def METHOD_NAME(
    working_directory,
    job_id=None,
    file_path=None,
    submit_on_remote=False,
    debug=False,
    collect=False,
):
    """
    Job Wrapper function - creates a JobWrapper object and calls run() on that object
    Args:
        working_directory (str): directory where the HDF5 file of the job is located
        job_id (int/ None): job id
        file_path (str): path to the HDF5 file
        debug (bool): enable debug mode
        submit_on_remote (bool): submit to queuing system on remote host
        collect (bool): collect output of calculation
    """
    # always close the database connection in calculations on the cluster to avoid high number of concurrent
    # connections.
    state.database.close_connection()
    state.database.connection_timeout = 0
    state.database.open_connection()
    if job_id is not None:
        job = JobWrapper(
            working_directory=working_directory,
            job_id=job_id,
            submit_on_remote=submit_on_remote,
            debug=debug,
            collect=collect,
        )
    elif file_path is not None:
        hdf5_file = (
            ".".join(file_path.split(".")[:-1])
            + "."
            + file_path.split(".")[-1].split("/")[0]
        )
        h5_path = "/".join(file_path.split(".")[-1].split("/")[1:])
        job = JobWrapper(
            working_directory,
            job_id=None,
            hdf5_file=hdf5_file,
            h5_path="/" + h5_path,
            submit_on_remote=submit_on_remote,
            debug=debug,
            collect=collect,
        )
    else:
        raise ValueError("Either job_id or file_path have to be not None.")
    job.run()