Dataset Viewer
Auto-converted to Parquet Duplicate
nodes
stringlengths
501
22.4k
edges
stringlengths
138
5.07k
code
stringlengths
108
19.3k
0, module; 1, function_definition; 2, function_name:gather_categories; 3, parameters; 4, block; 5, identifier:imap; 6, identifier:header; 7, default_parameter; 8, expression_statement; 9, comment:# If no categories provided, return all SampleIDs; 10, if_statement; 11, expression_statement; 12, expression_statement; 13,...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 3, 7; 4, 8; 4, 9; 4, 10; 4, 11; 4, 12; 4, 13; 4, 14; 4, 15; 4, 16; 4, 17; 4, 18; 4, 19; 4, 20; 4, 21; 4, 22; 4, 23; 4, 24; 4, 25; 4, 26; 7, 27; 7, 28; 8, 29; 10, 30; 10, 31; 11, 32; 12, 33; 13, 34; 14, 35; 14, 36; 14, 37; 16, 38; 16, 39; 18, 40; 18, 41; 20, 42; 21, 43; 21, 44; 21, 45...
def gather_categories(imap, header, categories=None): """ Find the user specified categories in the map and create a dictionary to contain the relevant data for each type within the categories. Multiple categories will have their types combined such that each possible combination will have its own entry...
0, module; 1, function_definition; 2, function_name:sort_sam; 3, parameters; 4, block; 5, identifier:sam; 6, identifier:sort; 7, expression_statement; 8, expression_statement; 9, if_statement; 10, return_statement; 11, comment:""" sort sam file """; 12, assignment; 13, comparison_operator:sort is True; 14, bloc...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 4, 7; 4, 8; 4, 9; 4, 10; 7, 11; 8, 12; 9, 13; 9, 14; 9, 15; 10, 16; 12, 17; 12, 18; 13, 19; 13, 20; 14, 21; 14, 22; 14, 23; 15, 24; 18, 25; 18, 26; 21, 27; 22, 28; 22, 29; 22, 30; 23, 31; 24, 32; 25, 33; 26, 34; 27, 35; 27, 36; 28, 37; 28, 38; 29, 39; 30, 40; 31, 41; 31, 42; 32, 43; ...
def sort_sam(sam, sort): """ sort sam file """ tempdir = '%s/' % (os.path.abspath(sam).rsplit('/', 1)[0]) if sort is True: mapping = '%s.sorted.sam' % (sam.rsplit('.', 1)[0]) if sam != '-': if os.path.exists(mapping) is False: os.system("\ ...
0, module; 1, function_definition; 2, function_name:top_hits; 3, parameters; 4, block; 5, identifier:hits; 6, identifier:num; 7, identifier:column; 8, identifier:reverse; 9, expression_statement; 10, expression_statement; 11, for_statement; 12, comment:""" get top hits after sorting by column number """; 13, ca...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 3, 7; 3, 8; 4, 9; 4, 10; 4, 11; 9, 12; 10, 13; 11, 14; 11, 15; 11, 16; 13, 17; 13, 18; 15, 19; 15, 20; 16, 21; 17, 22; 17, 23; 18, 24; 18, 25; 20, 26; 20, 27; 21, 28; 24, 29; 24, 30; 25, 31; 25, 32; 28, 33; 30, 34; 30, 35; 35, 36
def top_hits(hits, num, column, reverse): """ get top hits after sorting by column number """ hits.sort(key = itemgetter(column), reverse = reverse) for hit in hits[0:num]: yield hit
0, module; 1, function_definition; 2, function_name:numBlast_sort; 3, parameters; 4, block; 5, identifier:blast; 6, identifier:numHits; 7, identifier:evalueT; 8, identifier:bitT; 9, expression_statement; 10, expression_statement; 11, expression_statement; 12, expression_statement; 13, for_statement; 14, expression_stat...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 3, 7; 3, 8; 4, 9; 4, 10; 4, 11; 4, 12; 4, 13; 4, 14; 4, 15; 9, 16; 10, 17; 11, 18; 12, 19; 13, 20; 13, 21; 13, 22; 14, 23; 15, 24; 15, 25; 15, 26; 17, 27; 17, 28; 18, 29; 19, 30; 19, 31; 22, 32; 22, 33; 22, 34; 22, 35; 22, 36; 22, 37; 22, 38; 22, 39; 23, 40; 23, 41; 24, 42; 24, 43; 2...
def numBlast_sort(blast, numHits, evalueT, bitT): """ parse b6 output with sorting """ header = ['#query', 'target', 'pident', 'alen', 'mismatch', 'gapopen', 'qstart', 'qend', 'tstart', 'tend', 'evalue', 'bitscore'] yield header hmm = {h:[] for h in header} for line in blast: ...
0, module; 1, function_definition; 2, function_name:numDomtblout; 3, parameters; 4, block; 5, identifier:domtblout; 6, identifier:numHits; 7, identifier:evalueT; 8, identifier:bitT; 9, identifier:sort; 10, expression_statement; 11, if_statement; 12, expression_statement; 13, expression_statement; 14, expression_stateme...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 3, 7; 3, 8; 3, 9; 4, 10; 4, 11; 4, 12; 4, 13; 4, 14; 4, 15; 4, 16; 10, 17; 11, 18; 11, 19; 12, 20; 13, 21; 14, 22; 15, 23; 15, 24; 15, 25; 16, 26; 16, 27; 16, 28; 18, 29; 18, 30; 19, 31; 19, 32; 20, 33; 20, 34; 21, 35; 22, 36; 22, 37; 25, 38; 25, 39; 25, 40; 25, 41; 25, 42; 25, 43; 2...
def numDomtblout(domtblout, numHits, evalueT, bitT, sort): """ parse hmm domain table output this version is faster but does not work unless the table is sorted """ if sort is True: for hit in numDomtblout_sort(domtblout, numHits, evalueT, bitT): yield hit return head...
0, module; 1, function_definition; 2, function_name:S; 3, parameters; 4, block; 5, identifier:Document; 6, list_splat_pattern; 7, expression_statement; 8, expression_statement; 9, for_statement; 10, return_statement; 11, identifier:fields; 12, comment:"""Generate a MongoDB sort order list using the Django ORM style."""...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 4, 7; 4, 8; 4, 9; 4, 10; 6, 11; 7, 12; 8, 13; 9, 14; 9, 15; 9, 16; 10, 17; 13, 18; 13, 19; 16, 20; 16, 21; 16, 22; 16, 23; 16, 24; 16, 25; 16, 26; 20, 27; 20, 28; 20, 29; 21, 30; 22, 31; 22, 32; 23, 33; 23, 34; 24, 35; 24, 36; 25, 37; 26, 38; 27, 39; 27, 40; 29, 41; 29, 42; 29, 43; 3...
def S(Document, *fields): """Generate a MongoDB sort order list using the Django ORM style.""" result = [] for field in fields: if isinstance(field, tuple): # Unpack existing tuple. field, direction = field result.append((field, direction)) continue direction = ASCENDING if not field.starts...
0, module; 1, function_definition; 2, function_name:arrayuniqify; 3, parameters; 4, block; 5, identifier:X; 6, default_parameter; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, expression_statement; 11, if_statement; 12, identifier:retainorder; 13, False; 14, comment:""" Very fast un...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 4, 7; 4, 8; 4, 9; 4, 10; 4, 11; 6, 12; 6, 13; 7, 14; 8, 15; 9, 16; 10, 17; 11, 18; 11, 19; 11, 20; 15, 21; 15, 22; 16, 23; 16, 24; 17, 25; 17, 26; 19, 27; 19, 28; 19, 29; 19, 30; 20, 31; 22, 32; 22, 33; 24, 34; 24, 35; 26, 36; 26, 37; 27, 38; 28, 39; 29, 40; 30, 41; 31, 42; 32, 43; 3...
def arrayuniqify(X, retainorder=False): """ Very fast uniqify routine for numpy arrays. **Parameters** **X** : numpy array Determine the unique elements of this numpy array. **retainorder** : Boolean, optional Whether or not to return in...
0, module; 1, function_definition; 2, function_name:equalspairs; 3, parameters; 4, block; 5, identifier:X; 6, identifier:Y; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, expression_statement; 11, expression_statement; 12, expression_statement; 13, expression_statement; 14, expression_st...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 4, 7; 4, 8; 4, 9; 4, 10; 4, 11; 4, 12; 4, 13; 4, 14; 4, 15; 4, 16; 4, 17; 7, 18; 8, 19; 9, 20; 10, 21; 11, 22; 12, 23; 13, 24; 14, 25; 15, 26; 16, 27; 17, 28; 19, 29; 19, 30; 20, 31; 20, 32; 21, 33; 21, 34; 22, 35; 22, 36; 23, 37; 23, 38; 24, 39; 24, 40; 25, 41; 25, 42; 26, 43; 26, 4...
def equalspairs(X, Y): """ Indices of elements in a sorted numpy array equal to those in another. Given numpy array `X` and sorted numpy array `Y`, determine the indices in Y equal to indices in X. Returns `[A,B]` where `A` and `B` are numpy arrays of indices in `X` such that:: ...
0, module; 1, function_definition; 2, function_name:_inplace_sort_by_id; 3, parameters; 4, block; 5, identifier:unsorted_list; 6, expression_statement; 7, if_statement; 8, expression_statement; 9, expression_statement; 10, delete_statement; 11, expression_statement; 12, comment:"""Takes a list of dicts each of which ha...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 4, 6; 4, 7; 4, 8; 4, 9; 4, 10; 4, 11; 6, 12; 7, 13; 7, 14; 8, 15; 9, 16; 10, 17; 11, 18; 13, 19; 14, 20; 15, 21; 15, 22; 16, 23; 16, 24; 17, 25; 17, 26; 18, 27; 18, 28; 19, 29; 19, 30; 22, 31; 22, 32; 23, 33; 23, 34; 27, 35; 27, 36; 28, 37; 30, 38; 30, 39; 31, 40; 31, 41; 32, 42; 32, 43; 3...
def _inplace_sort_by_id(unsorted_list): """Takes a list of dicts each of which has an '@id' key, sorts the elements in the list by the value of the @id key. Assumes that @id is unique or the dicts have a meaningul < operator """ if not isinstance(unsorted_list, list): return sorted_list ...
0, module; 1, function_definition; 2, function_name:get_schemaloc_string; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, default_parameter; 8, default_parameter; 9, expression_statement; 10, if_statement; 11, if_statement; 12, expression_statement; 13, for_statement; 14, if_statement; 15, return_...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 3, 7; 3, 8; 4, 9; 4, 10; 4, 11; 4, 12; 4, 13; 4, 14; 4, 15; 6, 16; 6, 17; 7, 18; 7, 19; 8, 20; 8, 21; 9, 22; 10, 23; 10, 24; 11, 25; 11, 26; 12, 27; 13, 28; 13, 29; 13, 30; 14, 31; 14, 32; 15, 33; 23, 34; 24, 35; 26, 36; 27, 37; 27, 38; 30, 39; 30, 40; 31, 41; 32, 42; 33, 43; 33, 44;...
def get_schemaloc_string(self, ns_uris=None, sort=False, delim="\n"): """Constructs and returns a schemalocation attribute. If no namespaces in this set have any schema locations defined, returns an empty string. Args: ns_uris (iterable): The namespaces to include in the co...
0, module; 1, function_definition; 2, function_name:aggregate; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, default_parameter; 12, default_parameter; 13, expression_statement; 14, if_statement; 15, express...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 3, 7; 3, 8; 3, 9; 3, 10; 3, 11; 3, 12; 4, 13; 4, 14; 4, 15; 4, 16; 4, 17; 6, 18; 6, 19; 7, 20; 7, 21; 8, 22; 8, 23; 9, 24; 9, 25; 10, 26; 10, 27; 11, 28; 11, 29; 12, 30; 12, 31; 13, 32; 14, 33; 14, 34; 14, 35; 15, 36; 16, 37; 17, 38; 17, 39; 17, 40; 34, 41; 35, 42; 36, 43; 36, 44; 37...
def aggregate(self, On=None, AggFuncDict=None, AggFunc=None, AggList = None, returnsort=False,KeepOthers=True, keyfuncdict=None): """ Aggregate a tabarray on columns for given functions. Method wraps:: tabular.spreadsheet.aggregate(self, On, AggFuncDict, AggFu...
0, module; 1, function_definition; 2, function_name:argsort; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, default_parameter; 8, default_parameter; 9, expression_statement; 10, expression_statement; 11, expression_statement; 12, return_statement; 13, identifier:axis; 14, unary_operator; 15, iden...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 3, 7; 3, 8; 4, 9; 4, 10; 4, 11; 4, 12; 6, 13; 6, 14; 7, 15; 7, 16; 8, 17; 8, 18; 9, 19; 10, 20; 11, 21; 12, 22; 14, 23; 16, 24; 20, 25; 20, 26; 21, 27; 21, 28; 26, 29; 26, 30; 28, 31; 28, 32; 29, 33; 29, 34; 30, 35; 30, 36; 30, 37; 30, 38; 30, 39; 31, 40; 31, 41; 32, 42; 33, 43; 33, ...
def argsort(self, axis=-1, kind='quicksort', order=None): """ Returns the indices that would sort an array. .. note:: This method wraps `numpy.argsort`. This documentation is modified from that of `numpy.argsort`. Perform an indirect sort along the gi...
0, module; 1, function_definition; 2, function_name:blt; 3, parameters; 4, type; 5, block; 6, typed_parameter; 7, typed_parameter; 8, generic_type; 9, expression_statement; 10, expression_statement; 11, expression_statement; 12, return_statement; 13, identifier:f; 14, type; 15, identifier:x; 16, type; 17, identifier:Di...
0, 1; 1, 2; 1, 3; 1, 4; 1, 5; 3, 6; 3, 7; 4, 8; 5, 9; 5, 10; 5, 11; 5, 12; 6, 13; 6, 14; 7, 15; 7, 16; 8, 17; 8, 18; 9, 19; 10, 20; 11, 21; 12, 22; 14, 23; 16, 24; 18, 25; 18, 26; 20, 27; 20, 28; 21, 29; 21, 30; 22, 31; 22, 32; 22, 33; 22, 34; 22, 35; 22, 36; 22, 37; 22, 38; 23, 39; 23, 40; 24, 41; 24, 42; 25, 43; 26, ...
def blt(f: List[SYM], x: List[SYM]) -> Dict[str, Any]: """ Sort equations by dependence """ J = ca.jacobian(f, x) nblock, rowperm, colperm, rowblock, colblock, coarserow, coarsecol = J.sparsity().btf() return { 'J': J, 'nblock': nblock, 'rowperm': rowperm, 'colper...
0, module; 1, function_definition; 2, function_name:sort_generators; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, expression_statement; 8, comment:""" Reorders the list of generators according to bus index. """; 9, call; 10, attribute; 11, argument_list; 12, attribute; 13, identifier...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 4, 6; 4, 7; 6, 8; 7, 9; 9, 10; 9, 11; 10, 12; 10, 13; 11, 14; 12, 15; 12, 16; 14, 17; 14, 18; 18, 19; 18, 20; 19, 21; 20, 22; 20, 23; 22, 24; 22, 25
def sort_generators(self): """ Reorders the list of generators according to bus index. """ self.generators.sort(key=lambda gn: gn.bus._i)
0, module; 1, function_definition; 2, function_name:list; 3, parameters; 4, comment:# pylint: disable=redefined-builtin; 5, block; 6, identifier:self; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, default_parameter; 12, expression_statement; 13, expression_statement; 14, e...
0, 1; 1, 2; 1, 3; 1, 4; 1, 5; 3, 6; 3, 7; 3, 8; 3, 9; 3, 10; 3, 11; 5, 12; 5, 13; 5, 14; 5, 15; 5, 16; 7, 17; 7, 18; 8, 19; 8, 20; 9, 21; 9, 22; 10, 23; 10, 24; 11, 25; 11, 26; 12, 27; 13, 28; 14, 29; 15, 30; 16, 31; 28, 32; 28, 33; 29, 34; 29, 35; 30, 36; 30, 37; 31, 38; 31, 39; 33, 40; 33, 41; 35, 42; 35, 43; 36, 44;...
def list(self, filter=None, type=None, sort=None, limit=None, page=None): # pylint: disable=redefined-builtin """Get a list of configs. :param filter: (optional) Filters to apply as a string list. :param type: (optional) `union` or `inter` as string. :param sort: (optional) Sort fields ...
0, module; 1, function_definition; 2, function_name:list_csv; 3, parameters; 4, comment:# pylint: disable=redefined-builtin; 5, block; 6, identifier:self; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, default_parameter; 12, expression_statement; 13, return_statement; 14, i...
0, 1; 1, 2; 1, 3; 1, 4; 1, 5; 3, 6; 3, 7; 3, 8; 3, 9; 3, 10; 3, 11; 5, 12; 5, 13; 7, 14; 7, 15; 8, 16; 8, 17; 9, 18; 9, 19; 10, 20; 10, 21; 11, 22; 11, 23; 12, 24; 13, 25; 25, 26; 25, 27; 26, 28; 26, 29; 28, 30; 28, 31; 29, 32; 29, 33; 29, 34; 29, 35; 29, 36; 29, 37; 29, 38; 30, 39; 30, 40; 32, 41; 32, 42; 38, 43; 38, ...
def list_csv(self, filter=None, type=None, sort=None, limit=None, page=None): # pylint: disable=redefined-builtin """Get a list of results as CSV. :param filter: (optional) Filters to apply as a string list. :param type: (optional) `union` or `inter` as string. :param sort: (optional) S...
0, module; 1, function_definition; 2, function_name:list_logdir; 3, parameters; 4, comment:# pylint: disable=invalid-name,redefined-builtin; 5, block; 6, identifier:self; 7, identifier:id; 8, default_parameter; 9, default_parameter; 10, expression_statement; 11, expression_statement; 12, expression_statement; 13, retur...
0, 1; 1, 2; 1, 3; 1, 4; 1, 5; 3, 6; 3, 7; 3, 8; 3, 9; 5, 10; 5, 11; 5, 12; 5, 13; 8, 14; 8, 15; 9, 16; 9, 17; 10, 18; 11, 19; 12, 20; 13, 21; 19, 22; 19, 23; 20, 24; 20, 25; 21, 26; 21, 27; 23, 28; 23, 29; 25, 30; 25, 31; 26, 32; 26, 33; 27, 34; 27, 35; 27, 36; 30, 37; 30, 38; 31, 39; 31, 40; 31, 41; 32, 42; 32, 43; 36...
def list_logdir(self, id, filter=None, sort=None): # pylint: disable=invalid-name,redefined-builtin """Get a list of logdir files. :param id: Result ID as an int. :param filter: Filter to apply as string. :param sort: Sort field to apply as string. :return: :class:`results.LogDi...
0, module; 1, function_definition; 2, function_name:list; 3, parameters; 4, comment:# pylint: disable=redefined-builtin; 5, block; 6, identifier:self; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, default_parameter; 12, expression_statement; 13, expression_statement; 14, e...
0, 1; 1, 2; 1, 3; 1, 4; 1, 5; 3, 6; 3, 7; 3, 8; 3, 9; 3, 10; 3, 11; 5, 12; 5, 13; 5, 14; 5, 15; 5, 16; 7, 17; 7, 18; 8, 19; 8, 20; 9, 21; 9, 22; 10, 23; 10, 24; 11, 25; 11, 26; 12, 27; 13, 28; 14, 29; 15, 30; 16, 31; 28, 32; 28, 33; 29, 34; 29, 35; 30, 36; 30, 37; 31, 38; 31, 39; 33, 40; 33, 41; 35, 42; 35, 43; 36, 44;...
def list(self, filter=None, type=None, sort=None, limit=None, page=None): # pylint: disable=redefined-builtin """Get a list of packages. :param filter: (optional) Filters to apply as a string list. :param type: (optional) `union` or `inter` as string. :param sort: (optional) Sort fields...
0, module; 1, function_definition; 2, function_name:list; 3, parameters; 4, comment:# pylint: disable=invalid-name,redefined-builtin; 5, block; 6, identifier:self; 7, identifier:id; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, default_parameter; 12, default_parameter; 13, expression_statement;...
0, 1; 1, 2; 1, 3; 1, 4; 1, 5; 3, 6; 3, 7; 3, 8; 3, 9; 3, 10; 3, 11; 3, 12; 5, 13; 5, 14; 5, 15; 5, 16; 5, 17; 8, 18; 8, 19; 9, 20; 9, 21; 10, 22; 10, 23; 11, 24; 11, 25; 12, 26; 12, 27; 13, 28; 14, 29; 15, 30; 16, 31; 17, 32; 29, 33; 29, 34; 30, 35; 30, 36; 31, 37; 31, 38; 32, 39; 32, 40; 34, 41; 34, 42; 36, 43; 36, 44...
def list(self, id, filter=None, type=None, sort=None, limit=None, page=None): # pylint: disable=invalid-name,redefined-builtin """Get a list of a device's attachments. :param id: Device ID as an int. :param filter: (optional) Filters to apply as a string list. :param type: (optional) `u...
0, module; 1, function_definition; 2, function_name:_process_value; 3, parameters; 4, block; 5, identifier:self; 6, identifier:value; 7, identifier:type; 8, expression_statement; 9, if_statement; 10, return_statement; 11, comment:""" Process a value that will be sent to backend :param value: the value ...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 3, 7; 4, 8; 4, 9; 4, 10; 8, 11; 9, 12; 9, 13; 10, 14; 12, 15; 13, 16; 15, 17; 15, 18; 16, 19; 18, 20; 18, 21; 19, 22; 19, 23; 21, 24; 21, 25; 23, 26; 23, 27; 24, 28; 24, 29; 25, 30; 26, 31; 26, 32; 27, 33
def _process_value(self, value, type): """ Process a value that will be sent to backend :param value: the value to return :param type: hint for what sort of value this is :type type: str """ if not isinstance(value, six.string_types + (list,)): val...
0, module; 1, function_definition; 2, function_name:representatives; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, default_parameter; 8, expression_statement; 9, expression_statement; 10, if_statement; 11, if_statement; 12, expression_statement; 13, expression_statement; 14, for_statement; 15, r...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 3, 7; 4, 8; 4, 9; 4, 10; 4, 11; 4, 12; 4, 13; 4, 14; 4, 15; 6, 16; 6, 17; 7, 18; 7, 19; 8, 20; 9, 21; 10, 22; 10, 23; 11, 24; 11, 25; 12, 26; 13, 27; 14, 28; 14, 29; 14, 30; 15, 31; 21, 32; 21, 33; 22, 34; 22, 35; 23, 36; 25, 37; 26, 38; 26, 39; 27, 40; 27, 41; 28, 42; 28, 43; 29, 44...
def representatives(self, count=None, sorting=False): """ Returns a list of pairs of representative and its voting weight :param count: Max amount of representatives to return :type count: int :param sorting: If true, sorts by weight :type sorting: bool :raises...
0, module; 1, function_definition; 2, function_name:iterative_overlap_assembly; 3, parameters; 4, block; 5, identifier:variant_sequences; 6, default_parameter; 7, expression_statement; 8, if_statement; 9, comment:# reduce the number of inputs to the merge algorithm by first collapsing; 10, comment:# shorter sequences o...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 4, 7; 4, 8; 4, 9; 4, 10; 4, 11; 4, 12; 4, 13; 4, 14; 4, 15; 4, 16; 6, 17; 6, 18; 7, 19; 8, 20; 8, 21; 8, 22; 8, 23; 11, 24; 12, 25; 13, 26; 14, 27; 15, 28; 16, 29; 20, 30; 20, 31; 23, 32; 24, 33; 24, 34; 25, 35; 25, 36; 26, 37; 26, 38; 27, 39; 27, 40; 28, 41; 28, 42; 29, 43; 29, 44; ...
def iterative_overlap_assembly( variant_sequences, min_overlap_size=MIN_VARIANT_SEQUENCE_ASSEMBLY_OVERLAP_SIZE): """ Assembles longer sequences from reads centered on a variant by between merging all pairs of overlapping sequences and collapsing shorter sequences onto every longer sequen...
0, module; 1, function_definition; 2, function_name:rot_consts; 3, parameters; 4, block; 5, identifier:geom; 6, identifier:masses; 7, default_parameter; 8, default_parameter; 9, expression_statement; 10, comment:# Imports; 11, import_statement; 12, import_from_statement; 13, comment:# Ensure units are valid; 14, if_sta...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 3, 7; 3, 8; 4, 9; 4, 10; 4, 11; 4, 12; 4, 13; 4, 14; 4, 15; 4, 16; 4, 17; 4, 18; 4, 19; 4, 20; 4, 21; 4, 22; 4, 23; 4, 24; 4, 25; 4, 26; 7, 27; 7, 28; 8, 29; 8, 30; 9, 31; 11, 32; 12, 33; 12, 34; 12, 35; 12, 36; 12, 37; 14, 38; 14, 39; 18, 40; 20, 41; 20, 42; 20, 43; 20, 44; 23, 45; ...
def rot_consts(geom, masses, units=_EURC.INV_INERTIA, on_tol=_DEF.ORTHONORM_TOL): """Rotational constants for a given molecular system. Calculates the rotational constants for the provided system with numerical value given in the units provided in `units`. The orthnormality tolerance `on_tol` is requi...
0, module; 1, function_definition; 2, function_name:reference_contexts_for_variants; 3, parameters; 4, block; 5, identifier:variants; 6, identifier:context_size; 7, default_parameter; 8, expression_statement; 9, expression_statement; 10, for_statement; 11, return_statement; 12, identifier:transcript_id_whitelist; 13, N...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 3, 7; 4, 8; 4, 9; 4, 10; 4, 11; 7, 12; 7, 13; 8, 14; 9, 15; 10, 16; 10, 17; 10, 18; 11, 19; 15, 20; 15, 21; 18, 22; 21, 23; 21, 24; 22, 25; 25, 26; 25, 27; 26, 28; 26, 29; 27, 30; 27, 31; 31, 32; 31, 33; 31, 34; 32, 35; 32, 36; 33, 37; 33, 38; 34, 39; 34, 40
def reference_contexts_for_variants( variants, context_size, transcript_id_whitelist=None): """ Extract a set of reference contexts for each variant in the collection. Parameters ---------- variants : varcode.VariantCollection context_size : int Max of nucleotid...
0, module; 1, function_definition; 2, function_name:ffd; 3, parameters; 4, block; 5, identifier:items; 6, identifier:targets; 7, dictionary_splat_pattern; 8, expression_statement; 9, expression_statement; 10, expression_statement; 11, expression_statement; 12, return_statement; 13, identifier:kwargs; 14, comment:"""Fir...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 3, 7; 4, 8; 4, 9; 4, 10; 4, 11; 4, 12; 7, 13; 8, 14; 9, 15; 10, 16; 11, 17; 12, 18; 15, 19; 15, 20; 16, 21; 16, 22; 17, 23; 17, 24; 18, 25; 18, 26; 20, 27; 20, 28; 22, 29; 22, 30; 24, 31; 24, 32; 26, 33; 26, 34; 28, 35; 28, 36; 30, 37; 30, 38; 30, 39; 32, 40; 32, 41; 36, 42; 36, 43; ...
def ffd(items, targets, **kwargs): """First-Fit Decreasing This is perhaps the simplest packing heuristic; it simply packs items in the next available bin. This algorithm differs only from Next-Fit Decreasing in having a 'sort'; that is, the items are pre-sorted (largest to smallest). Com...
0, module; 1, function_definition; 2, function_name:sort_protein_sequences; 3, parameters; 4, block; 5, identifier:protein_sequences; 6, expression_statement; 7, return_statement; 8, comment:""" Sort protein sequences in decreasing order of priority """; 9, call; 10, identifier:list; 11, argument_list; 12, call...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 4, 6; 4, 7; 6, 8; 7, 9; 9, 10; 9, 11; 11, 12; 12, 13; 12, 14; 14, 15; 14, 16; 14, 17; 16, 18; 16, 19; 17, 20; 17, 21; 19, 22; 19, 23
def sort_protein_sequences(protein_sequences): """ Sort protein sequences in decreasing order of priority """ return list( sorted( protein_sequences, key=ProteinSequence.ascending_sort_key, reverse=True))
0, module; 1, function_definition; 2, function_name:dump; 3, parameters; 4, block; 5, identifier:obj; 6, default_parameter; 7, default_parameter; 8, default_parameter; 9, dictionary_splat_pattern; 10, expression_statement; 11, if_statement; 12, identifier:fp; 13, None; 14, identifier:indent; 15, None; 16, identifier:so...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 3, 7; 3, 8; 3, 9; 4, 10; 4, 11; 6, 12; 6, 13; 7, 14; 7, 15; 8, 16; 8, 17; 9, 18; 10, 19; 11, 20; 11, 21; 11, 22; 21, 23; 21, 24; 22, 25; 23, 26; 24, 27; 24, 28; 24, 29; 25, 30; 26, 31; 26, 32; 29, 33; 30, 34; 32, 35; 32, 36; 33, 37; 34, 38; 34, 39; 35, 40; 35, 41; 36, 42; 37, 43; 37,...
def dump(obj, fp=None, indent=None, sort_keys=False, **kw): """ Dump object to a file like object or string. :param obj: :param fp: Open file like object :param int indent: Indent size, default 2 :param bool sort_keys: Optionally sort dictionary keys. :return: Yaml serialized data. """ ...
0, module; 1, function_definition; 2, function_name:sorted_options; 3, parameters; 4, block; 5, identifier:sort_options; 6, expression_statement; 7, return_statement; 8, comment:"""Sort sort options for display. :param sort_options: A dictionary containing the field name as key and asc/desc as value. :...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 4, 6; 4, 7; 6, 8; 7, 9; 9, 10; 9, 11; 10, 12; 10, 13; 11, 14; 11, 15; 12, 16; 12, 17; 13, 18; 13, 19; 14, 20; 14, 21; 15, 22; 15, 23; 16, 24; 17, 25; 17, 26; 18, 27; 19, 28; 23, 29; 23, 30; 26, 31; 28, 32; 28, 33; 28, 34; 29, 35; 29, 36; 30, 37; 30, 38; 32, 39; 32, 40; 33, 41; 33, 42; 35, ...
def sorted_options(sort_options): """Sort sort options for display. :param sort_options: A dictionary containing the field name as key and asc/desc as value. :returns: A dictionary with sorting options for Invenio-Search-JS. """ return [ { 'title': v['title'], ...
0, module; 1, function_definition; 2, function_name:info; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, return_statement; 8, string; 9, call; 10, string_content:Returns information on all the registered checkers. Sorted by namespace and then name :returns a list of CheckerInf...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 4, 6; 4, 7; 6, 8; 7, 9; 8, 10; 9, 11; 9, 12; 12, 13; 12, 14; 13, 15; 13, 16; 14, 17; 14, 18; 15, 19; 15, 20; 18, 21; 18, 22; 19, 23; 19, 24; 21, 25; 22, 26; 22, 27; 26, 28; 26, 29; 27, 30; 27, 31
def info(self): ''' Returns information on all the registered checkers. Sorted by namespace and then name :returns a list of CheckerInfo ''' return sorted(self._checkers.values(), key=lambda x: (x.ns, x.name))
0, module; 1, function_definition; 2, function_name:extract_from_text; 3, parameters; 4, block; 5, identifier:text; 6, expression_statement; 7, return_statement; 8, comment:""" Extract HAL ids from a text. :param text: The text to extract HAL ids from. :returns: A list of matching HAL ids. >>> sorted(...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 4, 6; 4, 7; 6, 8; 7, 9; 9, 10; 9, 11; 10, 12; 10, 13; 11, 14; 14, 15; 14, 16; 14, 17; 15, 18; 15, 19; 16, 20; 16, 21; 17, 22; 21, 23; 21, 24; 22, 25; 22, 26; 23, 27; 23, 28; 24, 29
def extract_from_text(text): """ Extract HAL ids from a text. :param text: The text to extract HAL ids from. :returns: A list of matching HAL ids. >>> sorted(extract_from_text("hal-01258754 hal-01258754v2 foobar")) ['hal-01258754', 'hal-01258754v2'] """ return tools.remove_duplicates([...
0, module; 1, function_definition; 2, function_name:_show_documentation; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, expression_statement; 8, for_statement; 9, expression_statement; 10, expression_statement; 11, if_statement; 12, expression_statement; 13, expression_statement; 14, while_sta...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 4, 6; 4, 7; 4, 8; 4, 9; 4, 10; 4, 11; 4, 12; 4, 13; 4, 14; 6, 15; 7, 16; 8, 17; 8, 18; 8, 19; 9, 20; 10, 21; 11, 22; 11, 23; 12, 24; 13, 25; 14, 26; 14, 27; 16, 28; 16, 29; 17, 30; 17, 31; 18, 32; 18, 33; 19, 34; 20, 35; 20, 36; 21, 37; 21, 38; 22, 39; 22, 40; 23, 41; 24, 42; 24, 43; 25, 4...
def _show_documentation(self): """ Shows all documents of the current groundwork app in the console. Documents are sorted bei its names, except "main", which gets set to the beginning. """ documents = [] for key, document in self.app.documents.get().items(): ...
0, module; 1, function_definition; 2, function_name:dispersion_ranking_NN; 3, parameters; 4, block; 5, identifier:self; 6, identifier:nnm; 7, default_parameter; 8, expression_statement; 9, expression_statement; 10, expression_statement; 11, expression_statement; 12, expression_statement; 13, expression_statement; 14, e...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 3, 7; 4, 8; 4, 9; 4, 10; 4, 11; 4, 12; 4, 13; 4, 14; 4, 15; 4, 16; 4, 17; 4, 18; 4, 19; 7, 20; 7, 21; 8, 22; 9, 23; 10, 24; 11, 25; 12, 26; 13, 27; 14, 28; 15, 29; 16, 30; 17, 31; 18, 32; 19, 33; 23, 34; 23, 35; 24, 36; 24, 37; 25, 38; 25, 39; 26, 40; 26, 41; 27, 42; 27, 43; 28, 44; ...
def dispersion_ranking_NN(self, nnm, num_norm_avg=50): """Computes the spatial dispersion factors for each gene. Parameters ---------- nnm - scipy.sparse, float Square cell-to-cell nearest-neighbor matrix. num_norm_avg - int, optional, default 50 The top...
0, module; 1, function_definition; 2, function_name:canonical_ops; 3, parameters; 4, block; 5, identifier:ops; 6, expression_statement; 7, expression_statement; 8, return_statement; 9, string; 10, assignment; 11, identifier:new_ops; 12, string_content:Returns the given operations array sorted with duplicates removed. ...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 4, 6; 4, 7; 4, 8; 6, 9; 7, 10; 8, 11; 9, 12; 10, 13; 10, 14; 14, 15; 14, 16; 16, 17; 16, 18; 17, 19; 17, 20; 18, 21; 18, 22; 20, 23; 22, 24; 22, 25; 24, 26; 25, 27; 25, 28; 27, 29; 27, 30; 28, 31; 28, 32
def canonical_ops(ops): ''' Returns the given operations array sorted with duplicates removed. @param ops checker.Ops @return: checker.Ops ''' new_ops = sorted(set(ops), key=lambda x: (x.entity, x.action)) return new_ops
0, module; 1, function_definition; 2, function_name:extract_from_text; 3, parameters; 4, block; 5, identifier:text; 6, expression_statement; 7, comment:# Remove the leading "arxiv:".; 8, return_statement; 9, comment:""" Extract arXiv IDs from a text. :param text: The text to extract arXiv IDs from. :return...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 4, 6; 4, 7; 4, 8; 6, 9; 8, 10; 10, 11; 10, 12; 11, 13; 11, 14; 12, 15; 15, 16; 15, 17; 15, 18; 16, 19; 16, 20; 17, 21; 17, 22; 18, 23; 19, 24; 19, 25; 20, 26; 20, 27; 20, 28; 20, 29; 22, 30; 22, 31; 23, 32; 23, 33; 28, 34; 28, 35; 29, 36; 29, 37; 30, 38; 30, 39; 31, 40; 32, 41; 32, 42; 37,...
def extract_from_text(text): """ Extract arXiv IDs from a text. :param text: The text to extract arXiv IDs from. :returns: A list of matching arXiv IDs, in canonical form. >>> sorted(extract_from_text('1506.06690 1506.06690v1 arXiv:1506.06690 arXiv:1506.06690v1 arxiv:1506.06690 arxiv:1506.06690v1 ...
0, module; 1, function_definition; 2, function_name:serialize_text; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, if_statement; 8, expression_statement; 9, expression_statement; 10, for_statement; 11, return_statement; 12, string; 13, boolean_operator; 14, block; 15, assignment; 16, assignmen...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 4, 6; 4, 7; 4, 8; 4, 9; 4, 10; 4, 11; 6, 12; 7, 13; 7, 14; 8, 15; 9, 16; 10, 17; 10, 18; 10, 19; 11, 20; 12, 21; 13, 22; 13, 23; 14, 24; 15, 25; 15, 26; 16, 27; 16, 28; 19, 29; 20, 30; 20, 31; 22, 32; 22, 33; 23, 34; 23, 35; 24, 36; 26, 37; 26, 38; 29, 39; 30, 40; 30, 41; 31, 42; 32, 43; 3...
def serialize_text(self): '''Returns a serialized form of the Namepace. All the elements in the namespace are sorted by URI, joined to the associated prefix with a colon and separated with spaces. :return: bytes ''' if self._uri_to_prefix is None or len(self._uri...
0, module; 1, function_definition; 2, function_name:process; 3, parameters; 4, block; 5, identifier:self; 6, identifier:versions; 7, expression_statement; 8, for_statement; 9, comment:"""Logging version sorted ascending by tool name."""; 10, identifier:tool_name; 11, call; 12, block; 13, identifier:sorted; 14, argument...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 4, 7; 4, 8; 7, 9; 8, 10; 8, 11; 8, 12; 11, 13; 11, 14; 12, 15; 12, 16; 14, 17; 15, 18; 16, 19; 17, 20; 17, 21; 18, 22; 18, 23; 19, 24; 19, 25; 20, 26; 20, 27; 23, 28; 23, 29; 24, 30; 24, 31; 25, 32; 32, 33; 32, 34; 34, 35; 34, 36
def process(self, versions): """Logging version sorted ascending by tool name.""" for tool_name in sorted(versions.keys()): version = versions[tool_name] self._log("Using tool '%s', %s" % (tool_name, version))
0, module; 1, function_definition; 2, function_name:most_similar_catchments; 3, parameters; 4, block; 5, identifier:self; 6, identifier:subject_catchment; 7, identifier:similarity_dist_function; 8, default_parameter; 9, default_parameter; 10, expression_statement; 11, if_statement; 12, expression_statement; 13, comment...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 3, 7; 3, 8; 3, 9; 4, 10; 4, 11; 4, 12; 4, 13; 4, 14; 4, 15; 4, 16; 4, 17; 4, 18; 4, 19; 4, 20; 4, 21; 4, 22; 4, 23; 4, 24; 4, 25; 8, 26; 8, 27; 9, 28; 9, 29; 10, 30; 11, 31; 11, 32; 12, 33; 14, 34; 16, 35; 16, 36; 16, 37; 18, 38; 18, 39; 18, 40; 20, 41; 22, 42; 23, 43; 24, 44; 24, 45...
def most_similar_catchments(self, subject_catchment, similarity_dist_function, records_limit=500, include_subject_catchment='auto'): """ Return a list of catchments sorted by hydrological similarity defined by `similarity_distance_function` :param subject_catchme...
0, module; 1, function_definition; 2, function_name:sort_and_index_star; 3, parameters; 4, block; 5, identifier:job; 6, identifier:star_bams; 7, identifier:univ_options; 8, identifier:star_options; 9, expression_statement; 10, expression_statement; 11, expression_statement; 12, expression_statement; 13, expression_stat...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 3, 7; 3, 8; 4, 9; 4, 10; 4, 11; 4, 12; 4, 13; 4, 14; 4, 15; 9, 16; 10, 17; 11, 18; 12, 19; 13, 20; 14, 21; 15, 22; 17, 23; 17, 24; 18, 25; 18, 26; 19, 27; 19, 28; 20, 29; 20, 30; 21, 31; 21, 32; 22, 33; 22, 34; 22, 35; 23, 36; 23, 37; 24, 38; 24, 39; 26, 40; 26, 41; 28, 42; 28, 43; 2...
def sort_and_index_star(job, star_bams, univ_options, star_options): """ A wrapper for sorting and indexing the genomic star bam generated by run_star. It is required since run_star returns a dict of 2 bams :param dict star_bams: The bams from run_star :param dict univ_options: Dict of universal op...
End of preview. Expand in Data Studio

No dataset card yet

Downloads last month
21