def main(argv=None):
    args = parse_args(__doc__, argv=argv)
    script_file = args["<tool>"]
    script_args = args["<args>"]
    try:
        script = jip.find(script_file)
    except LookupError, e:
        print >>sys.stderr, str(e)
        sys.exit(1)

    # disable required checks
    jip.options._check_required = False
    profile = jip.profiles.get(name='default')
    jobs = jip.jobs.create_jobs(script, args=script_args,
                                profile=profile)
    specs = {}
    default_env = os.environ
    env_exckludes = [
        "JIP_MODULES",
        "JIP_LOGLEVEL",
        "JIP_PATH",
        "JIP_DB_LOGLEVEL"
    ]
    for j in jobs:
        job_env = {}
        for k, v in j.env.iteritems():
            if not k in env_exckludes and v and v != default_env.get(k, None):
                job_env[k] = v
        spec = sorted_dict({
            "threads": j.threads,
            "mem": j.max_memory,
            "queue": j.queue,
            "priority": j.priority,
            "time": j.max_time,
            "account": j.account,
            "extra": j.extra,
            "env": job_env
        })
        specs[j.name] = spec

    print json.dumps({"jobs": specs}, indent=4, sort_keys=False)
dataset/ETHPy150Open thasso/pyjip/jip/cli/jip_specs.py/main/original