<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 First we build a pipeline object to analyze the dSphs, and point it at the config file for the dSphs analysis.
Step1:  We have to 'preconfigure' the pipeline, because we need to build up the list of targets so that we correctly set up the later stages of the pipeline.
Step2:  We then tell the pipeline to update the arguments for all of the steps that comprise it.
Step3:  Now we look around a bit, we can drill down into the links that make up the pipeline.
In this case we have a pipeline that consists of a couple of preparation jobs,
then 5 sub-pipelines ('data', 'sim_xxx', 'random').
The sub-pipeline analyze the real data, and some different simulation cases.
The 'random' sub-pipeline analyzes random sky directions.
At this point the pipeline is fully configured, let's look around.
Step4:  We can print the status for the various links.
Using recurse=True will also drill down to the status of the links in the sub pipelines.
Step5:  We can access a particular Link in the pipeline.
We can ask
Step6:  We can ask what jobs get run by this link.   In this paritcular case the link
runs 1 job that in turn dispatches several other jobs to the batch farm.
Step7:  Here we are talking to the link that represents any one of the disptached jobs.
The command_template() function tells us how we would run this job from the UNIX command line.
Step8:  Here are ask what jobs will be dispatched.  Note that there are two jobs with slightly different names.
Step9:  Here are are asking for information about the first of those two jobs.  In particular, the specific options used for this instance of the job.  You can merge the job_config with the command_template to get the exact syntax for the instance of this command.
Step10:  Here we run a single link.
We use 'run_with_log()' so that the log file will be in the correct place and the pipeline will know the job
has completed.
Step11:  Here we run the 'data' sub-pipeline.
<ASSISTANT_TASK:>
Python Code:
pipe = Pipeline(linkname = 'dSphs')
configfile = 'config/master_dSphs.yaml'
Explanation: First we build a pipeline object to analyze the dSphs, and point it at the config file for the dSphs analysis.
End of explanation
pipe.preconfigure(configfile)
Explanation: We have to 'preconfigure' the pipeline, because we need to build up the list of targets so that we correctly set up the later stages of the pipeline.
End of explanation
pipe.update_args(dict(config=configfile))
Explanation: We then tell the pipeline to update the arguments for all of the steps that comprise it.
End of explanation
pipe.linknames
pipe['data']
pipe['data'].linknames
Explanation: Now we look around a bit, we can drill down into the links that make up the pipeline.
In this case we have a pipeline that consists of a couple of preparation jobs,
then 5 sub-pipelines ('data', 'sim_xxx', 'random').
The sub-pipeline analyze the real data, and some different simulation cases.
The 'random' sub-pipeline analyzes random sky directions.
At this point the pipeline is fully configured, let's look around.
End of explanation
pipe.print_status()
pipe.print_status(recurse=True)
Explanation: We can print the status for the various links.
Using recurse=True will also drill down to the status of the links in the sub pipelines.
End of explanation
pipe['data']['analyze-roi']
pipe['data']['analyze-roi']._options
pipe['data']['analyze-roi'].args
Explanation: We can access a particular Link in the pipeline.
We can ask:
  what the default options for the link are ('_options')
  what the current set of options are ('args')
End of explanation
pipe['data']['analyze-roi'].jobs
Explanation: We can ask what jobs get run by this link.   In this paritcular case the link
runs 1 job that in turn dispatches several other jobs to the batch farm.
End of explanation
pipe['data']['analyze-roi'].scatter_link
pipe['data']['analyze-roi'].scatter_link.command_template()
Explanation: Here we are talking to the link that represents any one of the disptached jobs.
The command_template() function tells us how we would run this job from the UNIX command line.
End of explanation
pipe['data']['analyze-roi'].scatter_link.jobs
Explanation: Here are ask what jobs will be dispatched.  Note that there are two jobs with slightly different names.
End of explanation
pipe['data']['analyze-roi'].scatter_link.jobs['draco@dSphs.data.analyze-roi']
pipe['data']['analyze-roi'].scatter_link.jobs['draco@dSphs.data.analyze-roi'].job_config
Explanation: Here are are asking for information about the first of those two jobs.  In particular, the specific options used for this instance of the job.  You can merge the job_config with the command_template to get the exact syntax for the instance of this command.
End of explanation
pipe['spec-table'].run_with_log()
pipe.print_status()
Explanation: Here we run a single link.
We use 'run_with_log()' so that the log file will be in the correct place and the pipeline will know the job
has completed.
End of explanation
pipe['data'].run(resubmit_failed=True)
pipe.print_status(recurse=True)
pipe['data']['convert-castro'].scatter_link.jobs['draco:ack2016_point:lgauss@dSphs.data.convert-castro'].job_config
pipe.run(resubmit_failed=True)
Explanation: Here we run the 'data' sub-pipeline.
End of explanation
<END_TASK>