Return a namedtuple of the dS, dH, dG, and Tm of any hairpin struct
    present.
964767
def calcHairpin(seq, mv_conc=50, dv_conc=0, dntp_conc=0.8, dna_conc=50,
                 temp_c=37, max_loop=30, temp_only=False):
    ''' 
    '''
    return calcThermo(seq, seq, 'HAIRPIN', mv_conc, dv_conc, dntp_conc,
                      dna_conc, temp_c, max_loop, temp_only)
671744
def T(u, dfs_data):
    """"""
    return list(set([w for v in S_star(u, dfs_data) for w in A(v, dfs_data)]))
973196
def astuple(self):
        
        return tuple(getattr(self, f.name) for f in fields(self))
100938
def unpack(self, s):
        """"""
        return self._create(super(NamedStruct, self).unpack(s))
320549
def get_dependencies(primary_type, types):
    
    deps = set()
    struct_names_yet_to_be_expanded = [primary_type]

    while len(struct_names_yet_to_be_expanded) > 0:
        struct_name = struct_names_yet_to_be_expanded.pop()

        deps.add(struct_name)
        fields = types[struct_name]
        for field in fields:
            if field["type"] not in types:
                # We don't need to expand types that are not user defined (customized)
                continue
            elif field["type"] in deps:
                # skip types that we have already encountered
                continue
            else:
                # Custom Struct Type
                struct_names_yet_to_be_expanded.append(field["type"])

    # Don't need to make a struct as dependency of itself
    deps.remove(primary_type)

    return tuple(deps)
1323022
def _identifiers(self):
        """"""
        for handle in self._storage_broker.iter_item_handles():
            yield dtoolcore.utils.generate_identifier(handle)
829842
def is_named_tuple(cls):
    """"""
    b = cls.__bases__
    if len(b) != 1 or b[0] != tuple:
        return False
    f = getattr(cls, "_fields", None)
    if not isinstance(f, tuple):
        return False
    return all(type(n) == str for n in f)
1016521
def _get_attrs(self):
        """"""
        attrs = []
        attrs.append(("N Blocks", self.n_blocks, "{}"))
        bds = self.bounds
        attrs.append(("X Bounds", (bds[0], bds[1]), "{:.3f}, {:.3f}"))
        attrs.append(("Y Bounds", (bds[2], bds[3]), "{:.3f}, {:.3f}"))
        attrs.append(("Z Bounds", (bds[4], bds[5]), "{:.3f}, {:.3f}"))
        return attrs
159905
def get_decl_pair(self):
        
        def get_tp():
            """ Iterator generating lines for struct definition. """
            decl = "struct "
            if self.tpname is not None:
                decl += self.tpname
                if self.inherit is not None:
                    decl += " : " + self.inherit
            yield decl
            yield "{"
            for f in self.fields:
                for f_line in f.generate():
                    yield "  " + f_line
            yield "} "
        return get_tp(), ""
380310
def consume(fmt, data, names):
    """"""
    size = struct.calcsize(fmt)
    return named(struct.unpack(fmt, data[:size]), names), data[size:]
264758
def as_tuple(self):
        
        ptr = self._pointer
        return (ptr.xx, ptr.yx, ptr.xy, ptr.yy, ptr.x0, ptr.y0)
378643
def ptake(n: int, xs: Iterable[T]) -> Iterable[T]:
    
    return tqdm(take(n, xs), total=n)
1083718
def _get_geneid2nt(nts):
        """"""
        geneid2nt = {}
        for ntd in nts:
            geneid = ntd.GeneID
            if geneid not in geneid2nt:
                geneid2nt[geneid] = ntd
            else:
                print("DUPLICATE GeneID FOUND {N:9} {SYM}".format(N=geneid, SYM=ntd.Symbol))
        return geneid2nt
830091
def get_go2nt(self, usr_go2nt):
        """"""
        gos_all = self.get_gos_all()
        # Minimum set of namedtuple fields available for use with Sorter on grouped GO IDs
        prt_flds_all = get_hdridx_flds() + self.gosubdag.prt_attr['flds']
        if not usr_go2nt:
            return self.__init_go2nt_dflt(gos_all, prt_flds_all)
        usr_nt_flds = next(iter(usr_go2nt.values()))._fields
        # If user namedtuple already contains all fields available, then return usr_go2nt
        if len(set(prt_flds_all).difference(usr_nt_flds)) == 0:
            return self._init_go2nt_aug(usr_go2nt)
        # Otherwise, combine user fields and default Sorter fields
        return self.__init_go2nt_w_usr(gos_all, usr_go2nt, prt_flds_all)
124771
def _get_wrhiercfg(self):
        """"""
        prtfmt = self.gosubdag.prt_attr['fmt']
        prtfmt = prtfmt.replace('{GO} # ', '')
        prtfmt = prtfmt.replace('{D1:5} ', '')
        return {'name2prtfmt':{'ITEM':prtfmt, 'ID':'{GO}{alt:1}'},
                'max_indent': self.usrdct.get('max_indent'),
                'include_only': self.usrdct.get('include_only'),
                'item_marks': self.usrdct.get('item_marks', {}),
                'concise_prt': 'concise' in self.usrset,
                'indent': 'no_indent' not in self.usrset,
                'dash_len': self.usrdct.get('dash_len', 6),
                'sortby': self.usrdct.get('sortby')
               }
11304
def getTuple(self):
        
        return (self.x, self.y, self.w, self.h)
1173762
def get_extra_ds(dataset):
    """"""
    ds_collection = {}
    for ds in dataset.attrs.get('ancillary_variables', []):
        ds_collection.update(get_extra_ds(ds))
    ds_collection[dataset.attrs['name']] = dataset

    return ds_collection