<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def build_and_submit_jobs(root_dir, jobs, sgeargs=None):
 """Submits the passed iterable of Job objects to SGE, placing SGE's output in the passed root directory - root_dir Root directory for SGE and job output - jobs List of Job objects, describing each job to be submitted - sgeargs Additional arguments to qsub """

    # If the passed set of jobs is not a list, turn it into one. This makes the
    # use of a single JobGroup a little more intutitive
    if not isinstance(jobs, list):
        jobs = [jobs]

    # Build and submit the passed jobs
    build_directories(root_dir)        # build all necessary directories
    build_job_scripts(root_dir, jobs)  # build job scripts
    submit_jobs(root_dir, jobs, sgeargs)