FEFF job parameters.

        Returns:
            Tags
498399
def tags(self):
        
        if "RECIPROCAL" in self.config_dict:
            if self.small_system:
                self.config_dict["CIF"] = "{}.cif".format(
                    self.structure.formula.replace(" ", ""))
                self.config_dict["TARGET"] = self.atoms.center_index + 1
                self.config_dict["COREHOLE"] = "RPA"
                logger.warning("Setting COREHOLE = RPA for K-space calculation")
                if not self.config_dict.get("KMESH", None):
                    abc = self.structure.lattice.abc
                    mult = (self.nkpts * abc[0] * abc[1] * abc[2]) ** (1 / 3)
                    self.config_dict["KMESH"] = [int(round(mult / l)) for l in abc]
            else:
                logger.warning("Large system(>=14 atoms) or EXAFS calculation, \
                                removing K-space settings")
                del self.config_dict["RECIPROCAL"]
                self.config_dict.pop("CIF", None)
                self.config_dict.pop("TARGET", None)
                self.config_dict.pop("KMESH", None)
                self.config_dict.pop("STRFAC", None)

        return Tags(self.config_dict)
1283534
def build_job_configs(self, args):
        
        job_configs = {}

        components = Component.build_from_yamlfile(args['comp'])
        NAME_FACTORY.update_base_dict(args['data'])

        mktime = args['mktimefilter']

        base_config = dict(nxpix=args['nxpix'],
                           nypix=args['nypix'],
                           binsz=args['binsz'])

        for comp in components:
            zcut = "zmax%i" % comp.zmax
            key = comp.make_key('{ebin_name}_{evtype_name}')
            name_keys = dict(zcut=zcut,
                             ebin=comp.ebin_name,
                             psftype=comp.evtype_name,
                             irf_ver=NAME_FACTORY.irf_ver(),
                             coordsys=comp.coordsys,
                             mktime=mktime,
                             fullpath=True)
            outfile = NAME_FACTORY.bexpcube(**name_keys)
            ltcube = NAME_FACTORY.ltcube(**name_keys)
            full_config = base_config.copy()
            full_config.update(dict(infile=ltcube,
                                    outfile=outfile,
                                    irfs=NAME_FACTORY.irfs(**name_keys),
                                    evtype=comp.evtype,
                                    emin=comp.emin,
                                    emax=comp.emax,
                                    enumbins=comp.enumbins,
                                    logfile=make_nfs_path(outfile.replace('.fits', '.log'))))
            job_configs[key] = full_config

        return job_configs
1315533
def tags(self):
        ""
        for bucket in self:
            for k,v in self[bucket].items():
                yield k,v
444501
def get_running_jobs(opts):
    '''
    
    '''

    ret = []
    proc_dir = os.path.join(opts['cachedir'], 'proc')
    if not os.path.isdir(proc_dir):
        return ret
    for fn_ in os.listdir(proc_dir):
        path = os.path.join(proc_dir, fn_)
        data = read_proc_file(path, opts)
        if not data:
            continue
        if not is_pid_healthy(data['pid']):
            continue
        ret.append(data)
    return ret
1283464
function getAllTags(version, cwd, repo, cb) {
  var str = 'git for-each-ref --format="%(tag)" --sort=\'*authordate\' refs/tags | sed \'1!G;h;$!d\'';
  exec(str, {cwd: cwd}, function (err, stdout, stderr) {

    var output = '';

    if (err) { return cb(err); }

    var stdoutAsString = stdout.toString('utf8');

    // Get the latest tag
    var lastTag = stdoutAsString.split('\n')[0];

    getTagDate(lastTag, function (err, tagDateAsString) {
      if (err) { return cb(err); }

      output += format('## [%s] -%s\n\n', version, tagDateAsString);
      output += '### Fixed\n\n';

      var str = 'git --no-pager log --pretty="format:- [] %%s (\\`%%an\\`)%%n  https://github.com/%s/commit/%H" "%s..HEAD"';
      str = format(str, repo, lastTag);

      exec(str, {cwd: cwd}, function (err, stdout, stderr) {
        if (err) { return cb(err); }
        output += stdout;

        return cb(null, output);
      });
    });
  });
}
923549
def term_all_jobs():
    '''
    
    '''
    ret = []
    for data in running():
        ret.append(signal_job(data['jid'], signal.SIGTERM))
    return ret
720434
def extract_mfd_params(src):
    
    tags = get_taglist(src)
    if "incrementalMFD" in tags:
        mfd_node = src.nodes[tags.index("incrementalMFD")]
    elif "truncGutenbergRichterMFD" in tags:
        mfd_node = src.nodes[tags.index("truncGutenbergRichterMFD")]
    elif "arbitraryMFD" in tags:
        mfd_node = src.nodes[tags.index("arbitraryMFD")]
    elif "YoungsCoppersmithMFD" in tags:
        mfd_node = src.nodes[tags.index("YoungsCoppersmithMFD")]
    else:
        raise ValueError("Source %s contains no supported MFD type!" % src.tag)
    data = []
    rates = []
    for key, param, vtype in MFD_PARAMS:
        if key in mfd_node.attrib and mfd_node.attrib[key] is not None:
            data.append((param, mfd_node.attrib[key]))
        else:
            data.append((param, None))
    if ("incrementalMFD" or "arbitraryMFD") in mfd_node.tag:
        # Extract Rates
        rates = ~mfd_node.occurRates
        n_r = len(rates)
        if n_r > MAX_RATES:
            raise ValueError("Number of rates in source %s too large "
                             "to be placed into shapefile" % src.tag)
        rate_dict = dict([(key, rates[i] if i < n_r else None)
                          for i, (key, _) in enumerate(RATE_PARAMS)])
    elif "YoungsCoppersmithMFD" in mfd_node.tag:
        rate_dict = dict([(key, mfd_node.attrib['characteristicRate'])
                          for i, (key, _) in enumerate(RATE_PARAMS)])
    else:
        rate_dict = dict([(key, None)
                          for i, (key, _) in enumerate(RATE_PARAMS)])
    return dict(data), rate_dict
1155236
def tags(self):
        """"""
        return [(r['name'], self.vpathto(r['name'])) for r in self.remotes if r['kind'] == 'tags']
443710
def listTagged(self, *args, **kwargs):
        
        data = yield self.call('listTagged', *args, **kwargs)
        builds = []
        for bdata in data:
            build = Build.fromDict(bdata)
            build.connection = self
            builds.append(build)
        defer.returnValue(builds)
165836
def nodes(self, tag):
        
        if tag == '*':
            return sorted(list(set(self.campaign.network.nodes)))
        definitions = self.campaign.network.tags.get(tag)
        if definitions is None:
            return []
        nodes = set()
        for definition in definitions:
            if len(definition.items()) == 0:
                continue
            mode, value = list(definition.items())[0]
            if mode == 'match':
                nodes = nodes.union(
                    set(
                        [
                            node
                            for node in self.campaign.network.nodes
                            if value.match(node)
                        ]
                    )
                )
            elif mode == 'constraint':
                slurm_nodes = os.environ.get('SLURM_JOB_NODELIST')
                if slurm_nodes:
                    nodes = NodeSet(slurm_nodes)
                else:
                    return ConstraintTag(tag, value)
            else:
                assert mode == 'nodes'
                nodes = nodes.union(set(value))
        return sorted(list(nodes))
619601
def project_tags(self):
        
        request_url = "{}git/tags".format(self.create_basic_url())

        return_value = self._call_api(request_url)

        return return_value['tags']
315800
def atq(tag=None):
    '''
    
    '''
    jobs = []

    res = __salt__['cmd.run_all']('atq')

    if res['retcode'] > 0:
        return {'error': res['stderr']}

    # No jobs so return
    if res['stdout'] == 'no files in queue.':
        return {'jobs': jobs}

    # Jobs created with at.at() will use the following
    # comment to denote a tagged job.
    job_kw_regex = re.compile(r'^### SALT: (\w+)')

    # Split each job into a dictionary and handle
    # pulling out tags or only listing jobs with a certain
    # tag
    for line in res['stdout'].splitlines():
        job_tag = ''

        # skip header
        if line.startswith(' Rank'):
            continue

        # parse job output
        tmp = line.split()
        timestr = ' '.join(tmp[1:5])
        job = tmp[6]
        specs = datetime.datetime(
            *(time.strptime(timestr, '%b %d, %Y %H:%M')[0:5])
        ).isoformat().split('T')
        specs.append(tmp[7])
        specs.append(tmp[5])

        # make sure job is str
        job = six.text_type(job)

        # search for any tags
        atjob_file = '/var/spool/cron/atjobs/{job}'.format(
            job=job
        )
        if __salt__['file.file_exists'](atjob_file):
            with salt.utils.files.fopen(atjob_file, 'r') as atjob:
                for line in atjob:
                    line = salt.utils.stringutils.to_unicode(line)
                    tmp = job_kw_regex.match(line)
                    if tmp:
                        job_tag = tmp.groups()[0]

        # filter on tags
        if not tag:
            jobs.append({'job': job, 'date': specs[0], 'time': specs[1],
                'queue': specs[2], 'user': specs[3], 'tag': job_tag})
        elif tag and tag in [job_tag, job]:
            jobs.append({'job': job, 'date': specs[0], 'time': specs[1],
                'queue': specs[2], 'user': specs[3], 'tag': job_tag})

    return {'jobs': jobs}
887025
def ff(items, targets):
    
    bins = [(target, []) for target in targets]
    skip = []

    for item in items:
        for target, content in bins:
            if item <= (target - sum(content)):
                content.append(item)
                break
        else:
            skip.append(item)
    return bins, skip
1088848
def handle_tags(repo, **kwargs):
    """"""
    log.info('tags: %s %s' %(repo, kwargs))
    return [str(t) for t in repo.tags(**kwargs)]
31714
def jobs(opts={})

      opts = { opts => true } if opts.is_a?(Symbol)

      jobs = @jobs.to_a

      if opts[:running]
        jobs = jobs.select { |j| j.running? }
      elsif ! opts[:all]
        jobs = jobs.reject { |j| j.next_time.nil? || j.unscheduled_at }
      end

      tags = Array(opts[:tag] || opts[:tags]).collect(&:to_s)
      jobs = jobs.reject { |j| tags.find { |t| ! j.tags.include?(t) } }

      jobs
    end
1338599
def get_tags_from_full_ob(ob, reqtags=None):
    
    # each instrument should have one
    # perhaps each mode...
    files = ob.frames
    cfiles = ob.children
    alltags = {}

    if reqtags is None:
        reqtags = []

    # Init alltags...
    # Open first image
    if files:
        for fname in files[:1]:
            with fname.open() as fd:
                header = fd[0].header
                for t in reqtags:
                    alltags[t] = header[t]
    else:

        for prod in cfiles[:1]:
            prodtags = prod.tags
            for t in reqtags:
                alltags[t] = prodtags[t]

    for fname in files:
        with fname.open() as fd:
            header = fd[0].header

            for t in reqtags:
                if alltags[t] != header[t]:
                    msg = 'wrong tag %s in file %s' % (t, fname)
                    raise ValueError(msg)

    for prod in cfiles:
        prodtags = prod.tags
        for t in reqtags:
            if alltags[t] != prodtags[t]:
                msg = 'wrong tag %s in product %s' % (t, prod)
                raise ValueError(msg)

    return alltags
568569
def build_job_configs(self, args):
        
        job_configs = {}

        comp_file = args.get('comp', None)
        if comp_file is not None:
            comp_dict = yaml.safe_load(open(comp_file))
            coordsys = comp_dict.pop('coordsys')
            for v in comp_dict.values():
                v['coordsys'] = coordsys
        else:
            return job_configs

        datafile = args['data']
        if datafile is None or datafile == 'None':
            return job_configs
        NAME_FACTORY.update_base_dict(args['data'])

        inputfiles = create_inputlist(args['ft1file'])
        outdir_base = os.path.join(NAME_FACTORY.base_dict['basedir'], 'counts_cubes')
        data_ver = NAME_FACTORY.base_dict['data_ver']

        for idx, infile in enumerate(inputfiles):
            key = "%06i" % idx
            key_scfile = "%03i" % (idx + 1)
            output_dir = os.path.join(outdir_base, key)
            try:
                os.mkdir(output_dir)
            except OSError:
                pass
            scfile = args['ft2file'].replace('.lst', '_%s.fits' % key_scfile)
            logfile = make_nfs_path(os.path.join(output_dir,
                                                 'scatter_mk_%s_%s.log' % (data_ver, key)))

            job_configs[key] = comp_dict.copy()
            job_configs[key].update(dict(ft1file=infile,
                                         scfile=scfile,
                                         comp=args['comp'],
                                         hpx_order_max=args['hpx_order_max'],
                                         outdir=outdir_base,
                                         outkey=key,
                                         logfile=logfile,
                                         pfiles=output_dir))

        return job_configs