# Path: pyani/pyani_config.py
# SGE_WAIT = 0.01  # Base unit of time (s) to wait between polling SGE


import os
import time
from typing import Any, Dict, List, Optional
from .pyani_config import SGE_WAIT
            count = len(self.arguments[key])
            self.script += """let "%s_INDEX=$TASK_ID %% %d"\n""" % (key, count)
            self.script += """%s=${%s_ARRAY[$%s_INDEX]}\n""" % (key, key, key)
            self.script += """let "TASK_ID=$TASK_ID / %d"\n""" % (count)

        # now, add the command to run the job
        self.script += "\n"
        self.script += self.command
        self.script += "\n"

        # set the number of tasks in this group
        self.tasks = total

    def add_dependency(self, job) -> None:
        """Add the passed job to the dependency list for this JobGroup.

        :param job:  Job, job to be added to the JobGroup's dependency list

        This JobGroup should not execute until all dependent jobs are
        completed
        """
        self.dependencies.append(job)

    def remove_dependency(self, job) -> None:
        """Remove passed job from this JobGroup's dependency list.

        :param job:  Job, job to be removed from the JobGroup's dependency list
        """
        self.dependencies.remove(job)


# Path: pyani/pyani_config.py
# SGE_WAIT = 0.01  # Base unit of time (s) to wait between polling SGE


# Path: pyani/pyani_jobs.py
import os
import time
from typing import Any, Dict, List, Optional
from .pyani_config import SGE_WAIT

            count = len(self.arguments[key])
            self.script += """let "%s_INDEX=$TASK_ID %% %d"\n""" % (key, count)
            self.script += """%s=${%s_ARRAY[$%s_INDEX]}\n""" % (key, key, key)
            self.script += """let "TASK_ID=$TASK_ID / %d"\n""" % (count)

        # now, add the command to run the job
        self.script += "\n"
        self.script += self.command
        self.script += "\n"

        # set the number of tasks in this group
        self.tasks = total

    def add_dependency(self, job) -> None:
        """Add the passed job to the dependency list for this JobGroup.

        :param job:  Job, job to be added to the JobGroup's dependency list

        This JobGroup should not execute until all dependent jobs are
        completed
        """
        self.dependencies.append(job)

    def remove_dependency(self, job) -> None:
        """Remove passed job from this JobGroup's dependency list.

        :param job:  Job, job to be removed from the JobGroup's dependency list
        """
        self.dependencies.remove(job)


    def wait(self, interval: float = SGE_WAIT) -> None: