Get a tiered list of all er/pmag_age codes
        i.e. pmag_codes = {'anisotropy_codes': ['code1', 'code2'],
        'sample_preparation': [code1, code2], ...}
17355
def get_tiered_meth_category(self, mtype, all_codes, code_types):
        
        categories = Series(code_types[code_types[mtype] == True].index)
        codes = {cat: list(self.get_one_meth_type(cat, all_codes).index) for cat in categories}
        return codes
607610
def get_all(self, sort_order=None, sort_target='key'):
        
        return self.get(
            key=_encode(b'\0'),
            metadata=True,
            sort_order=sort_order,
            sort_target=sort_target,
            range_end=_encode(b'\0'),
        )
291807
def get_grp2codes(self):
        """"""
        grp2codes = cx.defaultdict(set)
        for code, ntd in self.code2nt.items():
            grp2codes[ntd.group].add(code)
        return dict(grp2codes)
273034
def get_ar_data(self):
        
        for obj in self.get_objects():
            info = self.get_base_info(obj)
            info.update({
                "analyses": self.get_analysis_data_for(obj),
                "sampletype": self.get_base_info(obj.getSampleType()),
                "number_of_partitions": self.get_number_of_partitions_for(obj),
                "template": self.get_template_data_for(obj),
            })
            yield info
1254398
def get_all_tgt(self):
		
		tgts = []
		for cred in self.credentials:
			if cred.server.to_string().lower().find('krbtgt') != -1:
				tgts.append(cred.to_tgt())

		return tgts
942695
def _parse_metafiles(self, metafile_input):
        
        all_metafiles = AwsConstants.S2_L1C_METAFILES if self.data_source is DataSource.SENTINEL2_L1C else \
            AwsConstants.S2_L2A_METAFILES

        if metafile_input is None:
            if self.__class__.__name__ == 'SafeProduct':
                return all_metafiles
            if self.__class__.__name__ == 'SafeTile':
                return [metafile for metafile in all_metafiles if metafile in AwsConstants.TILE_FILES]
            return []
        if isinstance(metafile_input, str):
            metafile_list = metafile_input.split(',')
        elif isinstance(metafile_input, list):
            metafile_list = metafile_input.copy()
        else:
            raise ValueError('metafiles parameter must be a list or a string')
        metafile_list = [metafile.strip().split('.')[0] for metafile in metafile_list]
        metafile_list = [metafile for metafile in metafile_list if metafile != '']
        if not set(metafile_list) <= set(all_metafiles):
            raise ValueError('metadata files {} must be a subset of {}'.format(metafile_list, all_metafiles))
        return metafile_list
1022800
def list_from_metadata(cls, url, metadata):
        ''''''
        key = cls._get_key(url)
        metadata = Metadata(**metadata)
        ct = cls._get_create_time(key)
        time_buckets = cls.get_time_buckets_from_metadata(metadata)
        return [cls(url, metadata, t, ct, key.size) for t in time_buckets]
780065
function ParseMetaData(countryCode, md) {
    var array = eval(md.replace(BACKSLASH, "\\\\"));
    md = ParseArray(array,
                    META_DATA_ENCODING,
                    { countryCode: countryCode });
    regionCache[md.region] = md;
    return md;
  }
1330421
def list_cmaps(provider=None, records=False, name=None, category=None, source=None,
               bg=None, reverse=None):
    
    # Only uses names actually imported and currently available
    available = _list_cmaps(provider=provider, records=True)

    matches = set()

    for avail in available:
        aname=avail.name
        matched=False
        basename=aname[:-2] if aname.endswith('_r') else aname

        if (reverse is None or
            (reverse==True and aname.endswith('_r')) or
            (reverse==False and not aname.endswith('_r'))):
            for r in cmap_info:
               if (r.name==basename):
                   matched=True

                   # cmap_info stores only non-reversed info, so construct
                   # suitable values for reversed version if appropriate
                   r=r._replace(name=aname)
                   if aname.endswith('_r') and (r.category != 'Diverging'):
                       if r.bg=='light':
                           r=r._replace(bg='dark')
                       elif r.bg=='dark':
                           r=r._replace(bg='light')

                   if ((    name is None or     name in r.name) and
                       (provider is None or provider in r.provider) and
                       (category is None or category in r.category) and
                       (  source is None or   source in r.source) and
                       (      bg is None or       bg in r.bg)):
                       matches.add(r)
            if not matched and (category is None or category=='Miscellaneous'):
                # Return colormaps that exist but are not found in cmap_info
                # under the 'Miscellaneous' category, with no source or bg
                r = CMapInfo(aname,provider=avail.provider,category='Miscellaneous',source=None,bg=None)
                matches.add(r)

    # Return results sorted by category if category information is provided
    if records:
        return list(unique_iterator(python2sort(matches,
                    key=lambda r: (r.category.split(" ")[-1],r.bg,r.name.lower(),r.provider,r.source))))
    else:
        return list(unique_iterator(sorted([rec.name for rec in matches], key=lambda n:n.lower())))
314339
def get_kwargs(self):
        """"""

        kwargs = {}

        for attr in self.attrs:
            val = self.attrs[attr]
            if val is not None:
                kwargs[attr] = repr(val)

        code = ", ".join(repr(key) + ": " + kwargs[key] for key in kwargs)

        code = "{" + code + "}"

        return code
1125599
def get_colors(catalog):
    
    print("Get Colors")
    a = pyfits.open(catalog)
    data = a[1].data
    a.close()
    all_ids = data['LAMOST_ID_1']
    all_ids = np.array([val.strip() for val in all_ids])
    # G magnitude
    gmag = data['gpmag']
    gmag_err = data['e_gpmag']
    # R magnitude
    rmag = data['rpmag']
    rmag_err = data['e_rpmag']
    # I magnitude
    imag = data['ipmag']
    imag_err = data['e_ipmag']
    # W1
    W1 = data['W1mag']
    W1_err = data['e_W1mag']
    # W1
    W2 = data['W2mag']
    W2_err = data['e_W2mag']
    # J magnitude
    Jmag = data['Jmag']
    Jmag_err = data['e_Jmag']
    # H magnitude
    Hmag = data['Hmag']
    Hmag_err = data['e_Hmag']
    # K magnitude
    Kmag = data['Kmag']
    Kmag_err = data['e_Kmag']
    # Stack
    mag = np.vstack((
        gmag, rmag, imag, Jmag, Hmag, Kmag, W2, W1)) # 8, nobj
    mag_err = np.vstack((
        gmag_err, rmag_err, imag_err, Jmag_err, 
        Hmag_err, Kmag_err, W2_err, W1_err))
    # Make g-r, r-i, i-J, etc
    col = mag[:-1] - mag[1:]
    col_ivar = 1/(mag_err[:-1]**2 + mag_err[1:]**2)

    # There's something wrong with the i-band, I think..so the second color r-i
    #bad = col[:,1] < 0.0
    #col_ivar[bad] = 0.0

    return all_ids, col, col_ivar
64836
def get_all(self):
    """"""
    ret = []
    for cache_name, stat in self.stats_per_cache.items():
      ret.append({
        'cache_name': cache_name,
        'num_hits': len(stat.hit_targets),
        'num_misses': len(stat.miss_targets),
        'hits': stat.hit_targets,
        'misses': stat.miss_targets
      })
    return ret
211124
def getmeths(method_type):
    
    meths = []
    if method_type == 'GM':
        meths.append('GM-PMAG-APWP')
        meths.append('GM-ARAR')
        meths.append('GM-ARAR-AP')
        meths.append('GM-ARAR-II')
        meths.append('GM-ARAR-NI')
        meths.append('GM-ARAR-TF')
        meths.append('GM-CC-ARCH')
        meths.append('GM-CC-ARCHMAG')
        meths.append('GM-C14')
        meths.append('GM-FOSSIL')
        meths.append('GM-FT')
        meths.append('GM-INT-L')
        meths.append('GM-INT-S')
        meths.append('GM-ISO')
        meths.append('GM-KAR')
        meths.append('GM-PMAG-ANOM')
        meths.append('GM-PMAG-POL')
        meths.append('GM-PBPB')
        meths.append('GM-RATH')
        meths.append('GM-RBSR')
        meths.append('GM-RBSR-I')
        meths.append('GM-RBSR-MA')
        meths.append('GM-SMND')
        meths.append('GM-SMND-I')
        meths.append('GM-SMND-MA')
        meths.append('GM-CC-STRAT')
        meths.append('GM-LUM-TH')
        meths.append('GM-UPA')
        meths.append('GM-UPB')
        meths.append('GM-UTH')
        meths.append('GM-UTHHE')
    else:
        pass
    return meths
169077
def context(self):
        """"""
        stats = status_codes_by_date_stats()

        attacks_data = [{
            'type': 'line',
            'zIndex': 9,
            'name': _('Attacks'),
            'data': [(v[0], v[1]['attacks'])
                     for v in stats]
        }]

        codes_data = [{
            'zIndex': 4,
            'name': '2xx',
            'data': [(v[0], v[1][200]) for v in stats]
        }, {
            'zIndex': 5,
            'name': '3xx',
            'data': [(v[0], v[1][300]) for v in stats]
        }, {
            'zIndex': 6,
            'name': '4xx',
            'data': [(v[0], v[1][400]) for v in stats]
        }, {
            'zIndex': 8,
            'name': '5xx',
            'data': [(v[0], v[1][500]) for v in stats]
        }]

        return {'generic_chart': json.dumps(status_codes_by_date_chart()),
                'attacks_data': json.dumps(attacks_data),
                'codes_data': json.dumps(codes_data)}
138631
def _raw_aspera_metadata(self, bucket):
        '''  '''
        response = self._client.get_bucket_aspera(Bucket=bucket)

        # Parse metadata from response
        aspera_access_key = response['AccessKey']['Id']
        aspera_secret_key = response['AccessKey']['Secret']
        ats_endpoint = response['ATSEndpoint']

        return aspera_access_key, aspera_secret_key, ats_endpoint
478263
def getCodeBlocks():
    """"""
    raw=open("examples.py").read()
    d={}
    for block in raw.split("if __name__")[0].split("\ndef "):
        title=block.split("\n")[0].split("(")[0]
        if not title.startswith("demo_"):
            continue
        code=[x[4:] for x in block.split("\n")[1:] if x.startswith("    ")]
        d[title]="\n".join(code).strip()
    return d
352763
def metas(self, prefix=None, limit=None, delimiter=None):
        
        limit = coalesce(limit, TOO_MANY_KEYS)
        keys = self.bucket.list(prefix=prefix, delimiter=delimiter)
        prefix_len = len(prefix)
        output = []
        for i, k in enumerate(k for k in keys if len(k.key) == prefix_len or k.key[prefix_len] in [".", ":"]):
            output.append({
                "key": strip_extension(k.key),
                "etag": convert.quote2string(k.etag),
                "expiry_date": Date(k.expiry_date),
                "last_modified": Date(k.last_modified)
            })
            if i >= limit:
                break
        return wrap(output)