nodes
stringlengths
501
22.4k
edges
stringlengths
138
5.07k
code
stringlengths
108
19.3k
0, module; 1, function_definition; 2, function_name:get_dummy_dynamic_run; 3, parameters; 4, block; 5, identifier:nsamples; 6, dictionary_splat_pattern; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, expression_statement; 11, expression_statement; 12, expression_statement; 13, if_stateme...
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; 4, 18; 4, 19; 4, 20; 4, 21; 4, 22; 4, 23; 4, 24; 4, 25; 6, 26; 7, 27; 8, 28; 9, 29; 10, 30; 11, 31; 12, 32; 13, 33; 13, 34; 14, 35; 15, 36; 16, 37; 18, 38; 20, 39; 20, 40; 20, 41; 21, 42; 24, 43; 25, 44; 28, 45...
def get_dummy_dynamic_run(nsamples, **kwargs): """Generate dummy data for a dynamic nested sampling run. Loglikelihood values of points are generated from a uniform distribution in (0, 1), sorted, scaled by logl_range and shifted by logl_start (if it is not -np.inf). Theta values of each point are each...
0, module; 1, function_definition; 2, function_name:get_dates_for_project; 3, parameters; 4, block; 5, identifier:self; 6, identifier:project; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, for_statement; 11, return_statement; 12, comment:""" Return a list of the dates we have in...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 4, 7; 4, 8; 4, 9; 4, 10; 4, 11; 7, 12; 8, 13; 9, 14; 10, 15; 10, 16; 10, 17; 11, 18; 13, 19; 13, 20; 14, 21; 14, 22; 16, 23; 16, 24; 17, 25; 17, 26; 17, 27; 17, 28; 18, 29; 18, 30; 20, 31; 20, 32; 23, 33; 23, 34; 24, 35; 25, 36; 25, 37; 26, 38; 27, 39; 27, 40; 28, 41; 30, 42; 31, 43;...
def get_dates_for_project(self, project): """ Return a list of the dates we have in cache for the specified project, sorted in ascending date order. :param project: project name :type project: str :return: list of datetime.datetime objects :rtype: datetime.dateti...
0, module; 1, function_definition; 2, function_name:insort_event_right; 3, parameters; 4, block; 5, identifier:self; 6, identifier:event; 7, default_parameter; 8, default_parameter; 9, expression_statement; 10, if_statement; 11, if_statement; 12, while_statement; 13, expression_statement; 14, identifier:lo; 15, integer...
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; 7, 14; 7, 15; 8, 16; 8, 17; 9, 18; 10, 19; 10, 20; 11, 21; 11, 22; 12, 23; 12, 24; 13, 25; 19, 26; 19, 27; 20, 28; 21, 29; 21, 30; 22, 31; 23, 32; 23, 33; 24, 34; 24, 35; 25, 36; 25, 37; 28, 38; 31, 39; 34, 40; 35, 41; 35, 42; 35, 43; 36,...
def insort_event_right(self, event, lo=0, hi=None): """Insert event in queue, and keep it sorted assuming queue is sorted. If event is already in queue, insert it to the right of the rightmost event (to keep FIFO order). Optional args lo (default 0) and hi (default len(a)) bound the slice of a to ...
0, module; 1, function_definition; 2, function_name:getMd5Checksum; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, return_statement; 11, comment:""" Returns the MD5 checksum for this reference set. This checksu...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 4, 6; 4, 7; 4, 8; 4, 9; 4, 10; 6, 11; 7, 12; 8, 13; 9, 14; 10, 15; 12, 16; 12, 17; 13, 18; 13, 19; 14, 20; 14, 21; 17, 22; 17, 23; 19, 24; 19, 25; 21, 26; 21, 27; 23, 28; 23, 29; 24, 30; 24, 31; 25, 32; 26, 33; 26, 34; 28, 35; 28, 36; 29, 37; 29, 38; 32, 39; 32, 40; 33, 41; 33, 42; 35, 43;...
def getMd5Checksum(self): """ Returns the MD5 checksum for this reference set. This checksum is calculated by making a list of `Reference.md5checksum` for all `Reference`s in this set. We then sort this list, and take the MD5 hash of all the strings concatenated together. ...
0, module; 1, function_definition; 2, function_name:knn_impute_few_observed; 3, parameters; 4, block; 5, identifier:X; 6, identifier:missing_mask; 7, identifier:k; 8, default_parameter; 9, default_parameter; 10, expression_statement; 11, expression_statement; 12, expression_statement; 13, comment:# put the missing mask...
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; 4, 26; 4, 27; 4, 28; 4, 29; 8, 30; 8, 31; 9, 32; 9, 33; 10, 34; 11, 35; 12, 36; 15, 37; 16, 38; 17, 39; 18, 40; 20, 41; 21, 42; 22, 43; 23, 44; 26, 45; 27...
def knn_impute_few_observed( X, missing_mask, k, verbose=False, print_interval=100): """ Seems to be the fastest kNN implementation. Pre-sorts each rows neighbors and then filters these sorted indices using each columns mask of observed values. Important detail: If k observed values are not...
0, module; 1, function_definition; 2, function_name:_sort_converters; 3, parameters; 4, block; 5, identifier:cls; 6, default_parameter; 7, expression_statement; 8, comment:# app_ready is True when called from DMP's AppConfig.ready(); 9, comment:# we can't sort before then because models aren't ready; 10, expression_sta...
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; 10, 15; 11, 16; 11, 17; 14, 18; 15, 19; 15, 20; 16, 21; 16, 22; 17, 23; 17, 24; 19, 25; 19, 26; 20, 27; 20, 28; 23, 29; 23, 30; 23, 31; 24, 32; 27, 33; 27, 34; 30, 35; 30, 36; 31, 37; 32, 38; 32, 39; 37, 40; 38, 41; 38, 42; 39, 43;...
def _sort_converters(cls, app_ready=False): '''Sorts the converter functions''' # app_ready is True when called from DMP's AppConfig.ready() # we can't sort before then because models aren't ready cls._sorting_enabled = cls._sorting_enabled or app_ready if cls._sorting_enabled: ...
0, module; 1, function_definition; 2, function_name:prepare_sort_key; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, if_statement; 8, comment:# we reverse sort by ( len(mro), source code order ) so subclasses match first; 9, comment:# on same types, last declared method sorts first; 10, expres...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 4, 6; 4, 7; 4, 8; 4, 9; 4, 10; 6, 11; 7, 12; 7, 13; 10, 14; 11, 15; 12, 16; 12, 17; 13, 18; 13, 19; 14, 20; 14, 21; 17, 22; 17, 23; 18, 24; 18, 25; 19, 26; 19, 27; 20, 28; 20, 29; 21, 30; 21, 31; 22, 32; 22, 33; 24, 34; 25, 35; 25, 36; 26, 37; 27, 38; 27, 39; 30, 40; 30, 41; 31, 42; 31, 43...
def prepare_sort_key(self): ''' Triggered by view_function._sort_converters when our sort key should be created. This can't be called in the constructor because Django models might not be ready yet. ''' if isinstance(self.convert_type, str): try: app_n...
0, module; 1, function_definition; 2, function_name:sort_key_for_numeric_suffixes; 3, parameters; 4, block; 5, identifier:path; 6, default_parameter; 7, default_parameter; 8, expression_statement; 9, expression_statement; 10, comment:# Remove suffix from path and convert to int; 11, if_statement; 12, return_statement; ...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 3, 7; 4, 8; 4, 9; 4, 10; 4, 11; 4, 12; 6, 13; 6, 14; 7, 15; 7, 16; 8, 17; 9, 18; 11, 19; 11, 20; 12, 21; 14, 22; 16, 23; 18, 24; 18, 25; 19, 26; 19, 27; 20, 28; 21, 29; 21, 30; 25, 31; 25, 32; 26, 33; 26, 34; 28, 35; 31, 36; 31, 37; 32, 38; 33, 39; 33, 40; 35, 41; 35, 42; 41, 43; 41,...
def sort_key_for_numeric_suffixes(path, sep='.', suffix_index=-2): """ Sort files taking into account potentially absent suffixes like somefile.dcd somefile.1000.dcd somefile.2000.dcd To be used with sorted(..., key=callable). """ chunks = path.split(sep) # Remove suffix...
0, module; 1, function_definition; 2, function_name:_get_query; 3, parameters; 4, block; 5, identifier:self; 6, identifier:cursor; 7, expression_statement; 8, expression_statement; 9, if_statement; 10, if_statement; 11, return_statement; 12, string; 13, assignment; 14, attribute; 15, block; 16, attribute; 17, block; 18...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 4, 7; 4, 8; 4, 9; 4, 10; 4, 11; 7, 12; 8, 13; 9, 14; 9, 15; 10, 16; 10, 17; 11, 18; 12, 19; 13, 20; 13, 21; 14, 22; 14, 23; 15, 24; 16, 25; 16, 26; 17, 27; 21, 28; 21, 29; 21, 30; 21, 31; 24, 32; 27, 33; 28, 34; 28, 35; 29, 36; 29, 37; 30, 38; 30, 39; 31, 40; 31, 41; 32, 42; 32, 43; ...
def _get_query(self, cursor): ''' Query tempalte for source Solr, sorts by id by default. ''' query = {'q':'*:*', 'sort':'id desc', 'rows':self._rows, 'cursorMark':cursor} if self._date_field: query['sort'] = "{...
0, module; 1, function_definition; 2, function_name:url_params; 3, parameters; 4, block; 5, identifier:request; 6, default_parameter; 7, default_parameter; 8, expression_statement; 9, if_statement; 10, expression_statement; 11, for_statement; 12, if_statement; 13, return_statement; 14, identifier:except_params; 15, Non...
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; 6, 14; 6, 15; 7, 16; 7, 17; 8, 18; 9, 19; 9, 20; 10, 21; 11, 22; 11, 23; 11, 24; 12, 25; 12, 26; 12, 27; 13, 28; 19, 29; 20, 30; 21, 31; 21, 32; 22, 33; 22, 34; 23, 35; 23, 36; 24, 37; 26, 38; 27, 39; 28, 40; 28, 41; 29, 42; 29, 43; 30, 4...
def url_params(request, except_params=None, as_is=False): """ create string with GET-params of request usage example: c['sort_url'] = url_params(request, except_params=('sort',)) ... <a href="{{ sort_url }}&sort=lab_number">Лабораторный номер</a> """ if not request.GET: ...
0, module; 1, function_definition; 2, function_name:compose; 3, parameters; 4, block; 5, list_splat_pattern; 6, expression_statement; 7, comment:# slightly optimized for most common cases and hence verbose; 8, if_statement; 9, identifier:funcs; 10, comment:"""Compose `funcs` to a single function. >>> compose(opera...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 4, 6; 4, 7; 4, 8; 5, 9; 6, 10; 8, 11; 8, 12; 8, 13; 8, 14; 8, 15; 8, 16; 11, 17; 11, 18; 12, 19; 12, 20; 13, 21; 13, 22; 14, 23; 14, 24; 15, 25; 15, 26; 16, 27; 17, 28; 17, 29; 19, 30; 20, 31; 21, 32; 21, 33; 22, 34; 22, 35; 23, 36; 23, 37; 24, 38; 24, 39; 25, 40; 25, 41; 26, 42; 27, 43; 2...
def compose(*funcs): """Compose `funcs` to a single function. >>> compose(operator.abs, operator.add)(-2,-3) 5 >>> compose()('nada') 'nada' >>> compose(sorted, set, partial(filter, None))(range(3)[::-1]*2) [1, 2] """ # slightly optimized for most common cases and hence verbose i...
0, module; 1, function_definition; 2, function_name:_sort_lines; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, expression_statement; 8, comment:"""Haproxy writes its logs after having gathered all information related to each specific connection. A simple request can be really ...
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; 15, 16; 15, 17; 16, 18; 16, 19; 17, 20; 17, 21; 21, 22; 21, 23; 22, 24; 23, 25; 23, 26
def _sort_lines(self): """Haproxy writes its logs after having gathered all information related to each specific connection. A simple request can be really quick but others can be really slow, thus even if one connection is logged later, it could have been accepted before others that are...
0, module; 1, function_definition; 2, function_name:_sort_and_trim; 3, parameters; 4, block; 5, identifier:data; 6, default_parameter; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, expression_statement; 11, return_statement; 12, identifier:reverse; 13, False; 14, comment:"""Sorts a dict...
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; 15, 19; 15, 20; 16, 21; 16, 22; 17, 23; 17, 24; 18, 25; 18, 26; 22, 27; 22, 28; 24, 29; 24, 30; 26, 31; 27, 32; 27, 33; 30, 34; 30, 35; 30, 36; 35, 37; 35, 38; 36, 39; 36, 40; 38, 41; 38, 42; 41, 43; 4...
def _sort_and_trim(data, reverse=False): """Sorts a dictionary with at least two fields on each of them sorting by the second element. .. warning:: Right now is hardcoded to 10 elements, improve the command line interface to allow to send parameters to each command or global...
0, module; 1, function_definition; 2, function_name:get_queryset; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, expression_statement; 8, comment:# Perform global search; 9, expression_statement; 10, comment:# Perform column search; 11, expression_statement; 12, comment:# Return the ordered qu...
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; 6, 14; 7, 15; 9, 16; 11, 17; 13, 18; 14, 19; 15, 20; 15, 21; 16, 22; 16, 23; 17, 24; 17, 25; 18, 26; 18, 27; 21, 28; 21, 29; 23, 30; 23, 31; 25, 32; 25, 33; 26, 34; 26, 35; 27, 36; 28, 37; 28, 38; 30, 39; 30, 40; 31, 41; 32, 42; 32, 43; 3...
def get_queryset(self): '''Apply Datatables sort and search criterion to QuerySet''' qs = super(DatatablesView, self).get_queryset() # Perform global search qs = self.global_search(qs) # Perform column search qs = self.column_search(qs) # Return the ordered querys...
0, module; 1, function_definition; 2, function_name:rangify; 3, parameters; 4, block; 5, identifier:number_list; 6, expression_statement; 7, if_statement; 8, expression_statement; 9, expression_statement; 10, for_statement; 11, expression_statement; 12, return_statement; 13, comment:"""Assumes the list is sorted."""; 1...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 4, 6; 4, 7; 4, 8; 4, 9; 4, 10; 4, 11; 4, 12; 6, 13; 7, 14; 7, 15; 8, 16; 9, 17; 10, 18; 10, 19; 10, 20; 11, 21; 12, 22; 14, 23; 15, 24; 16, 25; 16, 26; 17, 27; 17, 28; 19, 29; 19, 30; 20, 31; 20, 32; 21, 33; 21, 34; 24, 35; 28, 36; 28, 37; 30, 38; 31, 39; 31, 40; 32, 41; 33, 42; 33, 43; 34...
def rangify(number_list): """Assumes the list is sorted.""" if not number_list: return number_list ranges = [] range_start = prev_num = number_list[0] for num in number_list[1:]: if num != (prev_num + 1): ranges.append((range_start, prev_num)) range_start = ...
0, module; 1, function_definition; 2, function_name:get_solver; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, default_parameter; 8, dictionary_splat_pattern; 9, expression_statement; 10, expression_statement; 11, comment:# backward compatibility: name as the first feature; 12, if_statement; 13, ...
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; 6, 17; 6, 18; 7, 19; 7, 20; 8, 21; 9, 22; 10, 23; 12, 24; 12, 25; 14, 26; 14, 27; 16, 28; 16, 29; 23, 30; 23, 31; 24, 32; 24, 33; 25, 34; 26, 35; 26, 36; 27, 37; 28, 38; 28, 39; 29, 40; 29, 41; 30, 42; 30, 43; 31, 44;...
def get_solver(self, name=None, refresh=False, **filters): """Load the configuration for a single solver. Makes a blocking web call to `{endpoint}/solvers/remote/{solver_name}/`, where `{endpoint}` is a URL configured for the client, and returns a :class:`.Solver` instance that can be u...
0, module; 1, function_definition; 2, function_name:find_germanet_xml_files; 3, parameters; 4, block; 5, identifier:xml_path; 6, expression_statement; 7, expression_statement; 8, comment:# sort out the lexical files; 9, expression_statement; 10, expression_statement; 11, if_statement; 12, comment:# sort out the GermaNe...
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; 4, 15; 4, 16; 4, 17; 4, 18; 4, 19; 4, 20; 4, 21; 4, 22; 4, 23; 4, 24; 4, 25; 6, 26; 7, 27; 9, 28; 10, 29; 11, 30; 11, 31; 13, 32; 14, 33; 15, 34; 15, 35; 15, 36; 17, 37; 18, 38; 19, 39; 19, 40; 21, 41; 22, 42; 23, 43; 23, 44; 24, 4...
def find_germanet_xml_files(xml_path): ''' Globs the XML files contained in the given directory and sorts them into sections for import into the MongoDB database. Arguments: - `xml_path`: the path to the directory containing the GermaNet XML files ''' xml_files = sorted(glob.glob(os.p...
0, module; 1, function_definition; 2, function_name:iter_org_issues; 3, parameters; 4, block; 5, identifier:self; 6, identifier:name; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, default_parameter; 12, default_parameter; 13, default_parameter; 14, default_parameter; 15, e...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 3, 7; 3, 8; 3, 9; 3, 10; 3, 11; 3, 12; 3, 13; 3, 14; 4, 15; 4, 16; 4, 17; 4, 18; 4, 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; 13, 33; 14, 34; 14, 35; 15, 36; 16, 37; 18, 38; 19, 39; 33, 40; 37, 41; 37, 42; 38, 43; 38, 44; 39...
def iter_org_issues(self, name, filter='', state='', labels='', sort='', direction='', since=None, number=-1, etag=None): """Iterate over the organnization's issues if the authenticated user belongs to it. :param str name: (required), name of the organization :pa...
0, module; 1, function_definition; 2, function_name:iter_repos; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, expression_statement; 12, expression_statement; 13, expression_statement; 14, if_statement; 15, ...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 3, 7; 3, 8; 3, 9; 3, 10; 4, 11; 4, 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; 12, 29; 13, 30; 14, 31; 14, 32; 15, 33; 15, 34; 16, 35; 16, 36; 17, 37; 25, 38; 29, 39; 29, 40; 30, 41; 30, 42; 31, 43; 31, 44; 32...
def iter_repos(self, type=None, sort=None, direction=None, number=-1, etag=None): """List public repositories for the authenticated user. .. versionchanged:: 0.6 Removed the login parameter for correctness. Use iter_user_repos instead :param str type: (...
0, module; 1, function_definition; 2, function_name:iter_starred; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, expression_statement; 12, if_statement; 13, expression_statement; 14, expression_statement; 15...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 3, 7; 3, 8; 3, 9; 3, 10; 4, 11; 4, 12; 4, 13; 4, 14; 4, 15; 4, 16; 6, 17; 6, 18; 7, 19; 7, 20; 8, 21; 8, 22; 9, 23; 9, 24; 10, 25; 10, 26; 11, 27; 12, 28; 12, 29; 13, 30; 14, 31; 15, 32; 16, 33; 24, 34; 29, 35; 30, 36; 30, 37; 31, 38; 31, 39; 32, 40; 32, 41; 33, 42; 33, 43; 35, 44; 3...
def iter_starred(self, login=None, sort=None, direction=None, number=-1, etag=None): """Iterate over repositories starred by ``login`` or the authenticated user. .. versionchanged:: 0.5 Added sort and direction parameters (optional) as per the change in ...
0, module; 1, function_definition; 2, function_name:search_code; 3, parameters; 4, block; 5, identifier:self; 6, identifier:query; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, default_parameter; 12, default_parameter; 13, expression_statement; 14, expression_statement; 15...
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; 4, 18; 4, 19; 4, 20; 7, 21; 7, 22; 8, 23; 8, 24; 9, 25; 9, 26; 10, 27; 10, 28; 11, 29; 11, 30; 12, 31; 12, 32; 13, 33; 14, 34; 15, 35; 16, 36; 16, 37; 17, 38; 17, 39; 18, 40; 18, 41; 19, 42; 20, 43; 30, 44; 34,...
def search_code(self, query, sort=None, order=None, per_page=None, text_match=False, number=-1, etag=None): """Find code via the code search API. The query can contain any combination of the following supported qualifiers: - ``in`` Qualifies which fields are searche...
0, module; 1, function_definition; 2, function_name:search_issues; 3, parameters; 4, block; 5, identifier:self; 6, identifier:query; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, default_parameter; 12, default_parameter; 13, expression_statement; 14, expression_statement; ...
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; 4, 18; 4, 19; 4, 20; 7, 21; 7, 22; 8, 23; 8, 24; 9, 25; 9, 26; 10, 27; 10, 28; 11, 29; 11, 30; 12, 31; 12, 32; 13, 33; 14, 34; 15, 35; 16, 36; 16, 37; 17, 38; 17, 39; 18, 40; 18, 41; 19, 42; 20, 43; 30, 44; 34,...
def search_issues(self, query, sort=None, order=None, per_page=None, text_match=False, number=-1, etag=None): """Find issues by state and keyword The query can contain any combination of the following supported qualifers: - ``type`` With this qualifier you can res...
0, module; 1, function_definition; 2, function_name:search_users; 3, parameters; 4, block; 5, identifier:self; 6, identifier:query; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, default_parameter; 12, default_parameter; 13, expression_statement; 14, expression_statement; 1...
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; 4, 18; 4, 19; 4, 20; 7, 21; 7, 22; 8, 23; 8, 24; 9, 25; 9, 26; 10, 27; 10, 28; 11, 29; 11, 30; 12, 31; 12, 32; 13, 33; 14, 34; 15, 35; 16, 36; 16, 37; 17, 38; 17, 39; 18, 40; 18, 41; 19, 42; 20, 43; 30, 44; 34,...
def search_users(self, query, sort=None, order=None, per_page=None, text_match=False, number=-1, etag=None): """Find users via the Search API. The query can contain any combination of the following supported qualifers: - ``type`` With this qualifier you can restri...
0, module; 1, function_definition; 2, function_name:iter_starred; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, expression_statement; 11, import_from_statement; 12, expression_statement; 13, expression_statement; 14, expression_s...
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; 6, 16; 6, 17; 7, 18; 7, 19; 8, 20; 8, 21; 9, 22; 9, 23; 10, 24; 11, 25; 11, 26; 12, 27; 13, 28; 14, 29; 15, 30; 21, 31; 25, 32; 25, 33; 26, 34; 27, 35; 27, 36; 28, 37; 28, 38; 29, 39; 29, 40; 30, 41; 30, 42; 33, 43; 36, 44; ...
def iter_starred(self, sort=None, direction=None, number=-1, etag=None): """Iterate over repositories starred by this user. .. versionchanged:: 0.5 Added sort and direction parameters (optional) as per the change in GitHub's API. :param int number: (optional), number of s...
0, module; 1, function_definition; 2, function_name:iter_forks; 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, if_statement; 13, return_statement; 14, identifier:sort; 15, str...
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; 6, 14; 6, 15; 7, 16; 7, 17; 8, 18; 8, 19; 9, 20; 10, 21; 11, 22; 12, 23; 12, 24; 13, 25; 17, 26; 21, 27; 21, 28; 22, 29; 22, 30; 23, 31; 23, 32; 24, 33; 25, 34; 25, 35; 28, 36; 28, 37; 32, 38; 32, 39; 32, 40; 33, 41; 34, 42; 34, 43; 35, 4...
def iter_forks(self, sort='', number=-1, etag=None): """Iterate over forks of this repository. :param str sort: (optional), accepted values: ('newest', 'oldest', 'watchers'), API default: 'newest' :param int number: (optional), number of forks to return. Default: -1 retu...
0, module; 1, function_definition; 2, function_name:iter_issues; 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, default_parameter; 14, default_parameter; 15, def...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 3, 7; 3, 8; 3, 9; 3, 10; 3, 11; 3, 12; 3, 13; 3, 14; 3, 15; 4, 16; 4, 17; 4, 18; 4, 19; 4, 20; 4, 21; 4, 22; 6, 23; 6, 24; 7, 25; 7, 26; 8, 27; 8, 28; 9, 29; 9, 30; 10, 31; 10, 32; 11, 33; 11, 34; 12, 35; 12, 36; 13, 37; 13, 38; 14, 39; 14, 40; 15, 41; 15, 42; 16, 43; 17, 44; 18, 45;...
def iter_issues(self, milestone=None, state=None, assignee=None, mentioned=None, labels=None, sort=None, direction=None, since=None, number=...
0, module; 1, function_definition; 2, function_name:iter_milestones; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, expression_statement; 12, expression_statement; 13, expression_statement; 14, expression_st...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 3, 7; 3, 8; 3, 9; 3, 10; 4, 11; 4, 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; 12, 29; 13, 30; 14, 31; 15, 32; 15, 33; 15, 34; 16, 35; 16, 36; 17, 37; 25, 38; 29, 39; 29, 40; 30, 41; 30, 42; 31, 43; 31, 44; 32...
def iter_milestones(self, state=None, sort=None, direction=None, number=-1, etag=None): """Iterates over the milestones on this repository. :param str state: (optional), state of the milestones, accepted values: ('open', 'closed') :param str sort: (optional),...
0, module; 1, function_definition; 2, function_name:iter_pulls; 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, expression_statement; 15...
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; 4, 18; 4, 19; 6, 20; 6, 21; 7, 22; 7, 23; 8, 24; 8, 25; 9, 26; 9, 27; 10, 28; 10, 29; 11, 30; 11, 31; 12, 32; 12, 33; 13, 34; 14, 35; 15, 36; 16, 37; 16, 38; 17, 39; 18, 40; 19, 41; 27, 42; 29, 43; 31, 44; 35, ...
def iter_pulls(self, state=None, head=None, base=None, sort='created', direction='desc', number=-1, etag=None): """List pull requests on repository. .. versionchanged:: 0.9.0 - The ``state`` parameter now accepts 'all' in addition to 'open' and 'closed'. ...
0, module; 1, function_definition; 2, function_name:iter_user_repos; 3, parameters; 4, block; 5, identifier:login; 6, default_parameter; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, expression_statement; 12, if_statement; 13, return_statement; 14, identifier:type; 15, Non...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 3, 7; 3, 8; 3, 9; 3, 10; 4, 11; 4, 12; 4, 13; 6, 14; 6, 15; 7, 16; 7, 17; 8, 18; 8, 19; 9, 20; 9, 21; 10, 22; 10, 23; 11, 24; 12, 25; 12, 26; 13, 27; 21, 28; 26, 29; 27, 30; 27, 31; 29, 32; 31, 33; 32, 34; 32, 35; 34, 36; 34, 37; 35, 38; 35, 39; 35, 40; 35, 41; 35, 42; 35, 43
def iter_user_repos(login, type=None, sort=None, direction=None, number=-1, etag=None): """List public repositories for the specified ``login``. .. versionadded:: 0.6 .. note:: This replaces github3.iter_repos :param str login: (required) :param str type: (optional), accepted ...
0, module; 1, function_definition; 2, function_name:sort_descendants; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, expression_statement; 8, expression_statement; 9, for_statement; 10, identifier:attr; 11, string:"name"; 12, comment:""" This function sort the branches of a given tree by ...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 4, 7; 4, 8; 4, 9; 6, 10; 6, 11; 7, 12; 8, 13; 9, 14; 9, 15; 9, 16; 13, 17; 13, 18; 15, 19; 15, 20; 16, 21; 18, 22; 18, 23; 19, 24; 19, 25; 21, 26; 21, 27; 22, 28; 22, 29; 23, 30; 23, 31; 26, 32; 27, 33; 30, 34; 30, 35; 31, 36; 31, 37; 32, 38; 32, 39; 33, 40; 38, 41; 38, 42; 40, 43; 4...
def sort_descendants(self, attr="name"): """ This function sort the branches of a given tree by considerening node names. After the tree is sorted, nodes are labeled using ascendent numbers. This can be used to ensure that nodes in a tree with the same node names are always ...
0, module; 1, function_definition; 2, function_name:collect_backups; 3, parameters; 4, block; 5, identifier:self; 6, identifier:location; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, expression_statement; 11, expression_statement; 12, for_statement; 13, if_statement; 14, return_stateme...
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; 7, 15; 8, 16; 9, 17; 10, 18; 11, 19; 12, 20; 12, 21; 12, 22; 13, 23; 13, 24; 14, 25; 16, 26; 16, 27; 17, 28; 17, 29; 18, 30; 18, 31; 19, 32; 19, 33; 21, 34; 21, 35; 22, 36; 22, 37; 24, 38; 25, 39; 25, 40; 29, 41; 29, 42; 30, 43; 30...
def collect_backups(self, location): """ Collect the backups at the given location. :param location: Any value accepted by :func:`coerce_location()`. :returns: A sorted :class:`list` of :class:`Backup` objects (the backups are sorted by their date). :raises: :e...
0, module; 1, function_definition; 2, function_name:prepare_bam; 3, parameters; 4, block; 5, identifier:job; 6, identifier:uuid; 7, identifier:url; 8, identifier:config; 9, default_parameter; 10, default_parameter; 11, expression_statement; 12, comment:# 0: Align FASTQ or realign BAM; 13, if_statement; 14, comment:# 1:...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 3, 7; 3, 8; 3, 9; 3, 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; 9, 25; 9, 26; 10, 27; 10, 28; 11, 29; 13, 30; 13, 31; 13, 32; 13, 33; 13, 34; 16, 35; 16, 36; 16, 37; 19, 38; 20, 39; 21, 40; 22, 41; 23, 42; 23, 43; 23, 44; 24,...
def prepare_bam(job, uuid, url, config, paired_url=None, rg_line=None): """ Prepares BAM file for Toil germline pipeline. Steps in pipeline 0: Download and align BAM or FASTQ sample 1: Sort BAM 2: Index BAM 3: Run GATK preprocessing pipeline (Optional) - Uploads preprocessed BAM to ...
0, module; 1, function_definition; 2, function_name:alignment; 3, parameters; 4, block; 5, identifier:job; 6, identifier:ids; 7, identifier:input_args; 8, identifier:sample; 9, expression_statement; 10, expression_statement; 11, comment:# ids['bam'] = job.fileStore.getEmptyFileStoreID(); 12, expression_statement; 13, e...
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; 4, 27; 4, 28; 4, 29; 4, 30; 4, 31; 4, 32; 4, 33; 9, 34; 10, 35; 12, 36; 13, 37; 14, 38; 15, 39; 17, 40; 19, 41; 19, 42; 19, 43; 21, 44; 22, 45; 23,...
def alignment(job, ids, input_args, sample): """ Runs BWA and then Bamsort on the supplied fastqs for this sample Input1: Toil Job instance Input2: jobstore id dictionary Input3: Input arguments dictionary Input4: Sample tuple -- contains uuid and urls for the sample """ uuid, urls = sa...
0, module; 1, function_definition; 2, function_name:bamsort_and_index; 3, parameters; 4, block; 5, identifier:job; 6, identifier:job_vars; 7, expression_statement; 8, comment:# Unpack variables; 9, expression_statement; 10, expression_statement; 11, expression_statement; 12, comment:# I/O; 13, expression_statement; 14,...
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; 4, 18; 4, 19; 4, 20; 4, 21; 4, 22; 4, 23; 4, 24; 4, 25; 4, 26; 7, 27; 9, 28; 10, 29; 11, 30; 13, 31; 14, 32; 16, 33; 17, 34; 18, 35; 19, 36; 21, 37; 22, 38; 24, 39; 25, 40; 26, 41; 28, 42; 28, 43; 29, 44; 29, 4...
def bamsort_and_index(job, job_vars): """ Sorts bam file and produces index file job_vars: tuple Tuple of dictionaries: input_args and ids """ # Unpack variables input_args, ids = job_vars work_dir = job.fileStore.getLocalTempDir() sudo = input_args['sudo'] # I/O rg_alignmen...
0, module; 1, function_definition; 2, function_name:sort_bam_by_reference; 3, parameters; 4, block; 5, identifier:job; 6, identifier:job_vars; 7, expression_statement; 8, comment:# Unpack variables; 9, expression_statement; 10, expression_statement; 11, comment:# I/O; 12, expression_statement; 13, expression_statement;...
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; 4, 18; 4, 19; 4, 20; 4, 21; 4, 22; 4, 23; 4, 24; 4, 25; 4, 26; 4, 27; 4, 28; 7, 29; 9, 30; 10, 31; 12, 32; 13, 33; 15, 34; 16, 35; 17, 36; 17, 37; 17, 38; 18, 39; 20, 40; 20, 41; 20, 42; 20, 43; 21, 44; 22, 45;...
def sort_bam_by_reference(job, job_vars): """ Sorts the bam by reference job_vars: tuple Tuple of dictionaries: input_args and ids """ # Unpack variables input_args, ids = job_vars work_dir = job.fileStore.getLocalTempDir() # I/O sorted_bam, sorted_bai = return_input_paths(job, ...
0, module; 1, function_definition; 2, function_name:main; 3, parameters; 4, block; 5, expression_statement; 6, comment:# Define Parser object and add to toil; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, comment:# Store inputs from argparse; 11, expression_statement; 12, comment:# Laun...
0, 1; 1, 2; 1, 3; 1, 4; 4, 5; 4, 6; 4, 7; 4, 8; 4, 9; 4, 10; 4, 11; 4, 12; 4, 13; 5, 14; 7, 15; 8, 16; 9, 17; 11, 18; 13, 19; 15, 20; 15, 21; 16, 22; 16, 23; 17, 24; 17, 25; 18, 26; 18, 27; 19, 28; 19, 29; 21, 30; 21, 31; 22, 32; 22, 33; 23, 34; 25, 35; 25, 36; 27, 37; 27, 38; 27, 39; 27, 40; 27, 41; 27, 42; 27, 43; 27...
def main(): """ This is a Toil pipeline for the UNC best practice RNA-Seq analysis. RNA-seq fastqs are combined, aligned, sorted, filtered, and quantified. Please read the README.md located in the same directory. """ # Define Parser object and add to toil parser = build_parser() Job.Run...
0, module; 1, function_definition; 2, function_name:fourier_series; 3, parameters; 4, block; 5, identifier:self; 6, identifier:pars; 7, identifier:x; 8, identifier:order; 9, expression_statement; 10, expression_statement; 11, for_statement; 12, return_statement; 13, comment:""" Function to fit Fourier Series. ...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 3, 7; 3, 8; 4, 9; 4, 10; 4, 11; 4, 12; 9, 13; 10, 14; 11, 15; 11, 16; 11, 17; 12, 18; 14, 19; 14, 20; 16, 21; 16, 22; 17, 23; 20, 24; 20, 25; 22, 26; 23, 27; 27, 28; 27, 29; 29, 30; 29, 31; 29, 32; 30, 33; 30, 34; 32, 35; 32, 36; 33, 37; 33, 38; 34, 39; 34, 40; 35, 41; 35, 42; 36, 43...
def fourier_series(self, pars, x, order): """ Function to fit Fourier Series. Parameters ---------- x : array_like An array of date divided by period. It doesn't need to be sorted. pars : array_like Fourier series parameters. order : int ...
0, module; 1, function_definition; 2, function_name:slope_percentile; 3, parameters; 4, block; 5, identifier:self; 6, identifier:date; 7, identifier:mag; 8, expression_statement; 9, expression_statement; 10, expression_statement; 11, comment:# Remove zero mag_diff.; 12, expression_statement; 13, expression_statement; 1...
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; 8, 20; 9, 21; 10, 22; 12, 23; 13, 24; 14, 25; 16, 26; 17, 27; 18, 28; 19, 29; 21, 30; 21, 31; 22, 32; 22, 33; 23, 34; 23, 35; 24, 36; 24, 37; 25, 38; 25, 39; 26, 40; 26, 41; 27, 42; 27, 43; 28, 44...
def slope_percentile(self, date, mag): """ Return 10% and 90% percentile of slope. Parameters ---------- date : array_like An array of phase-folded date. Sorted. mag : array_like An array of phase-folded magnitudes. Sorted by date. Return...
0, module; 1, function_definition; 2, function_name:number_aware_alphabetical_cmp; 3, parameters; 4, block; 5, identifier:str1; 6, identifier:str2; 7, expression_statement; 8, function_definition; 9, expression_statement; 10, expression_statement; 11, expression_statement; 12, expression_statement; 13, while_statement;...
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; 7, 16; 8, 17; 8, 18; 8, 19; 9, 20; 10, 21; 11, 22; 12, 23; 13, 24; 13, 25; 14, 26; 14, 27; 14, 28; 15, 29; 18, 30; 19, 31; 19, 32; 19, 33; 20, 34; 20, 35; 21, 36; 21, 37; 22, 38; 22, 39; 23, 40; 23, 41; 24, 42; 24, 43; 25, 4...
def number_aware_alphabetical_cmp(str1, str2): """ cmp function for sorting a list of strings by alphabetical order, but with numbers sorted numerically. i.e., foo1, foo2, foo10, foo11 instead of foo1, foo10 """ def flatten_tokens(tokens): l = [] for token in tokens...
0, module; 1, function_definition; 2, function_name:sort_members; 3, parameters; 4, block; 5, identifier:tup; 6, identifier:names; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, return_statement; 11, comment:"""Return two pairs of members, scalar and tuple members. The scalars will be...
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; 10, 14; 12, 15; 12, 16; 13, 17; 13, 18; 14, 19; 14, 20; 15, 21; 15, 22; 16, 23; 16, 24; 17, 25; 17, 26; 18, 27; 18, 28; 19, 29; 19, 30; 20, 31; 20, 32; 24, 33; 24, 34; 28, 35; 28, 36; 29, 37; 29, 38; 30, 39; 30, 40; 32, 41; 33, 42; 33, 43...
def sort_members(tup, names): """Return two pairs of members, scalar and tuple members. The scalars will be sorted s.t. the unbound members are at the top. """ scalars, tuples = partition(lambda x: not is_tuple_node(tup.member[x].value), names) unbound, bound = partition(lambda x: tup.member[x].value.is_unbo...
0, module; 1, function_definition; 2, function_name:sort_schemas; 3, parameters; 4, block; 5, identifier:schemas; 6, expression_statement; 7, function_definition; 8, return_statement; 9, comment:"""Sort a list of SQL schemas in order"""; 10, function_name:keyfun; 11, parameters; 12, block; 13, call; 14, identifier:v; 1...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 4, 6; 4, 7; 4, 8; 6, 9; 7, 10; 7, 11; 7, 12; 8, 13; 11, 14; 12, 15; 12, 16; 12, 17; 13, 18; 13, 19; 15, 20; 17, 21; 19, 22; 19, 23; 20, 24; 20, 25; 21, 26; 21, 27; 21, 28; 21, 29; 21, 30; 23, 31; 23, 32; 25, 33; 25, 34; 26, 35; 26, 36; 27, 37; 27, 38; 28, 39; 28, 40; 28, 41; 29, 42; 29, 43...
def sort_schemas(schemas): """Sort a list of SQL schemas in order""" def keyfun(v): x = SQL_SCHEMA_REGEXP.match(v).groups() # x3: 'DEV' should come before '' return (int(x[0]), x[1], int(x[2]) if x[2] else None, x[3] if x[3] else 'zzz', int(x[4])) return sorted(schem...
0, module; 1, function_definition; 2, function_name:sort_nodes; 3, parameters; 4, block; 5, identifier:dom; 6, identifier:cmp_func; 7, expression_statement; 8, expression_statement; 9, for_statement; 10, comment:""" Sort the nodes of the dom in-place, based on a comparison function. """; 11, call; 12, identifie...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 4, 7; 4, 8; 4, 9; 7, 10; 8, 11; 9, 12; 9, 13; 9, 14; 11, 15; 11, 16; 13, 17; 13, 18; 14, 19; 14, 20; 15, 21; 15, 22; 18, 23; 19, 24; 20, 25; 20, 26; 23, 27; 23, 28; 24, 29; 24, 30; 25, 31; 25, 32; 26, 33; 26, 34; 28, 35; 28, 36; 30, 37; 30, 38; 32, 39; 32, 40; 33, 41; 34, 42; 36, 43;...
def sort_nodes(dom, cmp_func): """ Sort the nodes of the dom in-place, based on a comparison function. """ dom.normalize() for node in list(walk_dom(dom, elements_only=True)): prev_sib = node.previousSibling while prev_sib and cmp_func(prev_sib, node) == 1: node.parentNod...
0, module; 1, function_definition; 2, function_name:currentdir; 3, parameters; 4, type; 5, block; 6, identifier:self; 7, identifier:str; 8, expression_statement; 9, if_statement; 10, return_statement; 11, comment:"""Name of the current working directory containing the relevant files. To show most of the functi...
0, 1; 1, 2; 1, 3; 1, 4; 1, 5; 3, 6; 4, 7; 5, 8; 5, 9; 5, 10; 8, 11; 9, 12; 9, 13; 10, 14; 12, 15; 12, 16; 13, 17; 13, 18; 14, 19; 14, 20; 15, 21; 15, 22; 17, 23; 18, 24; 18, 25; 18, 26; 18, 27; 23, 28; 23, 29; 24, 30; 24, 31; 25, 32; 26, 33; 26, 34; 27, 35; 29, 36; 29, 37; 30, 38; 30, 39; 32, 40; 33, 41; 33, 42; 34, 43...
def currentdir(self) -> str: """Name of the current working directory containing the relevant files. To show most of the functionality of |property| |FileManager.currentdir| (unpacking zip files on the fly is explained in the documentation on function (|FileManager.zip_currentdi...
0, module; 1, function_definition; 2, function_name:zip_currentdir; 3, parameters; 4, type; 5, block; 6, identifier:self; 7, None; 8, expression_statement; 9, with_statement; 10, delete_statement; 11, comment:"""Pack the current working directory in a `zip` file. |FileManager| subclasses allow for manual packi...
0, 1; 1, 2; 1, 3; 1, 4; 1, 5; 3, 6; 4, 7; 5, 8; 5, 9; 5, 10; 8, 11; 9, 12; 9, 13; 10, 14; 12, 15; 13, 16; 14, 17; 14, 18; 15, 19; 16, 20; 16, 21; 16, 22; 19, 23; 19, 24; 20, 25; 20, 26; 21, 27; 21, 28; 22, 29; 23, 30; 23, 31; 24, 32; 28, 33; 28, 34; 29, 35; 30, 36; 30, 37; 31, 38; 31, 39; 33, 40; 33, 41; 34, 42; 34, 43...
def zip_currentdir(self) -> None: """Pack the current working directory in a `zip` file. |FileManager| subclasses allow for manual packing and automatic unpacking of working directories. The only supported format is `zip`. To avoid possible inconsistencies, origin directories and zip ...
0, module; 1, function_definition; 2, function_name:keywords; 3, parameters; 4, type; 5, block; 6, identifier:self; 7, generic_type; 8, expression_statement; 9, return_statement; 10, identifier:Set; 11, type_parameter; 12, comment:"""A set of all keywords of all handled devices. In addition to attribute access...
0, 1; 1, 2; 1, 3; 1, 4; 1, 5; 3, 6; 4, 7; 5, 8; 5, 9; 7, 10; 7, 11; 8, 12; 9, 13; 11, 14; 13, 15; 13, 16; 14, 17; 16, 18; 16, 19; 16, 20; 16, 21; 19, 22; 19, 23; 20, 24; 20, 25; 21, 26; 25, 27; 25, 28; 26, 29; 26, 30; 30, 31; 30, 32
def keywords(self) -> Set[str]: """A set of all keywords of all handled devices. In addition to attribute access via device names, |Nodes| and |Elements| objects allow for attribute access via keywords, allowing for an efficient search of certain groups of devices. Let us use th...
0, module; 1, function_definition; 2, function_name:variables; 3, parameters; 4, type; 5, block; 6, identifier:self; 7, generic_type; 8, expression_statement; 9, expression_statement; 10, for_statement; 11, return_statement; 12, identifier:Set; 13, type_parameter; 14, comment:"""A set of all different |Node.variable| v...
0, 1; 1, 2; 1, 3; 1, 4; 1, 5; 3, 6; 4, 7; 5, 8; 5, 9; 5, 10; 5, 11; 7, 12; 7, 13; 8, 14; 9, 15; 10, 16; 10, 17; 10, 18; 11, 19; 13, 20; 15, 21; 15, 22; 15, 23; 17, 24; 17, 25; 18, 26; 20, 27; 22, 28; 23, 29; 23, 30; 26, 31; 28, 32; 28, 33; 31, 34; 31, 35; 33, 36; 34, 37; 34, 38; 35, 39; 36, 40; 39, 41; 39, 42
def variables(self) -> Set[str]: """A set of all different |Node.variable| values of the |Node| objects directly connected to the actual |Element| object. Suppose there is an element connected to five nodes, which (partly) represent different variables: >>> from hydpy import El...
0, module; 1, function_definition; 2, function_name:model2subs2seqs; 3, parameters; 4, type; 5, block; 6, identifier:self; 7, generic_type; 8, expression_statement; 9, expression_statement; 10, for_statement; 11, return_statement; 12, identifier:Dict; 13, type_parameter; 14, comment:"""A nested |collections.defaultdict...
0, 1; 1, 2; 1, 3; 1, 4; 1, 5; 3, 6; 4, 7; 5, 8; 5, 9; 5, 10; 5, 11; 7, 12; 7, 13; 8, 14; 9, 15; 10, 16; 10, 17; 10, 18; 11, 19; 13, 20; 13, 21; 15, 22; 15, 23; 17, 24; 17, 25; 18, 26; 18, 27; 18, 28; 20, 29; 21, 30; 23, 31; 23, 32; 24, 33; 24, 34; 25, 35; 26, 36; 27, 37; 27, 38; 28, 39; 28, 40; 28, 41; 30, 42; 30, 43; ...
def model2subs2seqs(self) -> Dict[str, Dict[str, List[str]]]: """A nested |collections.defaultdict| containing the model specific information provided by the XML `sequences` element. >>> from hydpy.auxs.xmltools import XMLInterface >>> from hydpy import data >>> interface = XMLI...
0, module; 1, function_definition; 2, function_name:subs2seqs; 3, parameters; 4, type; 5, block; 6, identifier:self; 7, generic_type; 8, expression_statement; 9, expression_statement; 10, expression_statement; 11, if_statement; 12, return_statement; 13, identifier:Dict; 14, type_parameter; 15, comment:"""A |collections...
0, 1; 1, 2; 1, 3; 1, 4; 1, 5; 3, 6; 4, 7; 5, 8; 5, 9; 5, 10; 5, 11; 5, 12; 7, 13; 7, 14; 8, 15; 9, 16; 10, 17; 11, 18; 11, 19; 12, 20; 14, 21; 14, 22; 16, 23; 16, 24; 17, 25; 17, 26; 18, 27; 18, 28; 19, 29; 21, 30; 22, 31; 24, 32; 24, 33; 26, 34; 26, 35; 29, 36; 29, 37; 29, 38; 31, 39; 31, 40; 32, 41; 32, 42; 33, 43; 3...
def subs2seqs(self) -> Dict[str, List[str]]: """A |collections.defaultdict| containing the node-specific information provided by XML `sequences` element. >>> from hydpy.auxs.xmltools import XMLInterface >>> from hydpy import data >>> interface = XMLInterface('single_run.xml', da...
0, module; 1, function_definition; 2, function_name:get_modelnames; 3, parameters; 4, type; 5, block; 6, generic_type; 7, expression_statement; 8, return_statement; 9, identifier:List; 10, type_parameter; 11, comment:"""Return a sorted |list| containing all application model names. >>> from hydpy.auxs.xmltools...
0, 1; 1, 2; 1, 3; 1, 4; 1, 5; 4, 6; 5, 7; 5, 8; 6, 9; 6, 10; 7, 11; 8, 12; 10, 13; 12, 14; 12, 15; 13, 16; 15, 17; 15, 18; 15, 19; 17, 20; 17, 21; 18, 22; 18, 23; 19, 24; 21, 25; 23, 26; 23, 27; 24, 28; 25, 29; 25, 30; 26, 31; 26, 32; 27, 33; 28, 34; 28, 35; 29, 36; 29, 37; 33, 38; 33, 39; 34, 40; 34, 41; 35, 42; 36, 4...
def get_modelnames() -> List[str]: """Return a sorted |list| containing all application model names. >>> from hydpy.auxs.xmltools import XSDWriter >>> print(XSDWriter.get_modelnames()) # doctest: +ELLIPSIS [...'dam_v001', 'dam_v002', 'dam_v003', 'dam_v004', 'dam_v005',...] ""...
0, module; 1, function_definition; 2, function_name:toys; 3, parameters; 4, type; 5, block; 6, identifier:self; 7, generic_type; 8, expression_statement; 9, return_statement; 10, identifier:Tuple; 11, type_parameter; 12, comment:"""A sorted |tuple| of all contained |TOY| objects."""; 13, call; 14, type; 15, type; 16, i...
0, 1; 1, 2; 1, 3; 1, 4; 1, 5; 3, 6; 4, 7; 5, 8; 5, 9; 7, 10; 7, 11; 8, 12; 9, 13; 11, 14; 11, 15; 13, 16; 13, 17; 14, 18; 15, 19; 17, 20; 17, 21; 18, 22; 18, 23; 21, 24; 21, 25; 24, 26; 24, 27
def toys(self) -> Tuple[timetools.TOY, ...]: """A sorted |tuple| of all contained |TOY| objects.""" return tuple(toy for (toy, _) in self)
0, module; 1, function_definition; 2, function_name:collect_variables; 3, parameters; 4, type; 5, block; 6, identifier:self; 7, identifier:selections; 8, None; 9, expression_statement; 10, expression_statement; 11, comment:"""Apply method |ExchangeItem.insert_variables| to collect the relevant target variables ...
0, 1; 1, 2; 1, 3; 1, 4; 1, 5; 3, 6; 3, 7; 4, 8; 5, 9; 5, 10; 9, 11; 10, 12; 12, 13; 12, 14; 13, 15; 13, 16; 14, 17; 14, 18; 14, 19; 17, 20; 17, 21; 18, 22; 18, 23
def collect_variables(self, selections) -> None: """Apply method |ExchangeItem.insert_variables| to collect the relevant target variables handled by the devices of the given |Selections| object. We prepare the `LahnH` example project to be able to use its |Selections| object: ...
0, module; 1, function_definition; 2, function_name:collect_variables; 3, parameters; 4, type; 5, block; 6, identifier:self; 7, identifier:selections; 8, None; 9, expression_statement; 10, expression_statement; 11, expression_statement; 12, comment:"""Apply method |ChangeItem.collect_variables| of the base class ...
0, 1; 1, 2; 1, 3; 1, 4; 1, 5; 3, 6; 3, 7; 4, 8; 5, 9; 5, 10; 5, 11; 9, 12; 10, 13; 11, 14; 13, 15; 13, 16; 14, 17; 14, 18; 15, 19; 15, 20; 16, 21; 17, 22; 17, 23; 18, 24; 18, 25; 18, 26; 19, 27; 19, 28; 24, 29; 24, 30; 25, 31; 25, 32
def collect_variables(self, selections) -> None: """Apply method |ChangeItem.collect_variables| of the base class |ChangeItem| and also apply method |ExchangeItem.insert_variables| of class |ExchangeItem| to collect the relevant base variables handled by the devices of the given |Selecti...
0, module; 1, function_definition; 2, function_name:save_controls; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, default_parameter; 8, default_parameter; 9, expression_statement; 10, expression_statement; 11, identifier:parameterstep; 12, None; 13, identifier:simulationstep; 14, None; 15, identi...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 3, 7; 3, 8; 4, 9; 4, 10; 6, 11; 6, 12; 7, 13; 7, 14; 8, 15; 8, 16; 9, 17; 10, 18; 18, 19; 18, 20; 19, 21; 19, 22; 20, 23; 20, 24; 20, 25; 21, 26; 21, 27; 23, 28; 23, 29; 24, 30; 24, 31; 25, 32; 25, 33
def save_controls(self, parameterstep=None, simulationstep=None, auxfiler=None): """Call method |Elements.save_controls| of the |Elements| object currently handled by the |HydPy| object. We use the `LahnH` example project to demonstrate how to write a complete set ...
0, module; 1, function_definition; 2, function_name:variables; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, expression_statement; 8, for_statement; 9, return_statement; 10, comment:"""Sorted list of strings summarizing all variables handled by the |Node| objects"""; 11, assignment; 1...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 4, 6; 4, 7; 4, 8; 4, 9; 6, 10; 7, 11; 8, 12; 8, 13; 8, 14; 9, 15; 11, 16; 11, 17; 13, 18; 13, 19; 14, 20; 15, 21; 15, 22; 17, 23; 17, 24; 20, 25; 22, 26; 24, 27; 25, 28; 25, 29; 28, 30; 28, 31; 29, 32; 32, 33; 32, 34
def variables(self): """Sorted list of strings summarizing all variables handled by the |Node| objects""" variables = set([]) for node in self.nodes: variables.add(node.variable) return sorted(variables)
0, module; 1, function_definition; 2, function_name:sort_timeplaceentries; 3, parameters; 4, type; 5, block; 6, identifier:self; 7, identifier:timeentry; 8, identifier:placeentry; 9, generic_type; 10, expression_statement; 11, if_statement; 12, return_statement; 13, identifier:Tuple; 14, type_parameter; 15, comment:"""...
0, 1; 1, 2; 1, 3; 1, 4; 1, 5; 3, 6; 3, 7; 3, 8; 4, 9; 5, 10; 5, 11; 5, 12; 9, 13; 9, 14; 10, 15; 11, 16; 11, 17; 12, 18; 14, 19; 14, 20; 16, 21; 16, 22; 17, 23; 18, 24; 18, 25; 19, 26; 20, 27; 23, 28; 28, 29; 28, 30
def sort_timeplaceentries(self, timeentry, placeentry) -> Tuple[Any, Any]: """Return a |tuple| containing the given `timeentry` and `placeentry` sorted in agreement with the currently selected `timeaxis`. >>> from hydpy.core.netcdftools import NetCDFVariableBase >>> from hydpy import ma...
0, module; 1, function_definition; 2, function_name:prepare_io_example_1; 3, parameters; 4, type; 5, comment:# noinspection PyUnresolvedReferences; 6, block; 7, generic_type; 8, expression_statement; 9, import_from_statement; 10, expression_statement; 11, import_from_statement; 12, expression_statement; 13, with_statem...
0, 1; 1, 2; 1, 3; 1, 4; 1, 5; 1, 6; 4, 7; 6, 8; 6, 9; 6, 10; 6, 11; 6, 12; 6, 13; 6, 14; 6, 15; 6, 16; 6, 17; 6, 18; 6, 19; 6, 20; 6, 21; 6, 22; 6, 23; 6, 24; 6, 25; 6, 26; 6, 27; 6, 28; 6, 29; 6, 30; 6, 31; 6, 32; 6, 33; 6, 34; 6, 35; 7, 36; 7, 37; 8, 38; 9, 39; 9, 40; 10, 41; 11, 42; 11, 43; 12, 44; 13, 45; 13, 46; 1...
def prepare_io_example_1() -> Tuple[devicetools.Nodes, devicetools.Elements]: # noinspection PyUnresolvedReferences """Prepare an IO example configuration. >>> from hydpy.core.examples import prepare_io_example_1 >>> nodes, elements = prepare_io_example_1() (1) Prepares a short initialisation peri...
0, module; 1, function_definition; 2, function_name:comparison_table; 3, parameters; 4, comment:# pragma: no cover; 5, block; 6, identifier:self; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, default_parameter; 12, default_parameter; 13, default_parameter; 14, default_para...
0, 1; 1, 2; 1, 3; 1, 4; 1, 5; 3, 6; 3, 7; 3, 8; 3, 9; 3, 10; 3, 11; 3, 12; 3, 13; 3, 14; 5, 15; 5, 16; 5, 17; 5, 18; 5, 19; 5, 20; 5, 21; 5, 22; 5, 23; 5, 24; 5, 25; 5, 26; 5, 27; 5, 28; 5, 29; 5, 30; 5, 31; 5, 32; 5, 33; 5, 34; 5, 35; 5, 36; 5, 37; 5, 38; 5, 39; 5, 40; 5, 41; 5, 42; 5, 43; 7, 44; 7, 45; 8, 46; 8, 47; ...
def comparison_table(self, caption=None, label="tab:model_comp", hlines=True, aic=True, bic=True, dic=True, sort="bic", descending=True): # pragma: no cover """ Return a LaTeX ready table of model comparisons. Parameters ---------- caption : str, option...
0, module; 1, function_definition; 2, function_name:_initDevClasses; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, expression_statement; 11, expression_statement; 12, if_statement; 13, for_statement; 14, expression_st...
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; 4, 15; 4, 16; 4, 17; 6, 18; 7, 19; 8, 20; 9, 21; 10, 22; 11, 23; 12, 24; 12, 25; 13, 26; 13, 27; 13, 28; 14, 29; 15, 30; 16, 31; 17, 32; 17, 33; 17, 34; 19, 35; 19, 36; 20, 37; 20, 38; 21, 39; 21, 40; 22, 41; 22, 42; 23, 43; 23, 44...
def _initDevClasses(self): """Sort block devices into lists depending on device class and initialize device type map and partition map.""" self._devClassTree = {} self._partitionTree = {} self._mapDevType = {} basedevs = [] otherdevs = [] if self._mapMajo...
0, module; 1, function_definition; 2, function_name:zdiffstore; 3, parameters; 4, block; 5, identifier:self; 6, identifier:dest; 7, identifier:keys; 8, default_parameter; 9, expression_statement; 10, expression_statement; 11, expression_statement; 12, return_statement; 13, identifier:withscores; 14, False; 15, string; ...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 3, 7; 3, 8; 4, 9; 4, 10; 4, 11; 4, 12; 8, 13; 8, 14; 9, 15; 10, 16; 11, 17; 12, 18; 15, 19; 16, 20; 16, 21; 17, 22; 17, 23; 18, 24; 18, 25; 21, 26; 21, 27; 23, 28; 23, 29; 23, 30; 24, 31; 24, 32; 25, 33; 25, 34; 25, 35; 25, 36; 26, 37; 27, 38; 27, 39; 28, 40; 33, 41; 36, 42; 36, 43; ...
def zdiffstore(self, dest, keys, withscores=False): '''Compute the difference of multiple sorted. The difference of sets specified by ``keys`` into a new sorted set in ``dest``. ''' keys = (dest,) + tuple(keys) wscores = 'withscores' if withscores else '' ...
0, module; 1, function_definition; 2, function_name:places_within_radius; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, dictionary_splat_pattern; 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; 3, 8; 3, 9; 3, 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; 6, 23; 6, 24; 7, 25; 7, 26; 8, 27; 8, 28; 9, 29; 9, 30; 10, 31; 11, 32; 12, 33; 13, 34; 14, 35; 15, 36; 16, 37; 18, 38; 18, 39; 18, 40; 18, 41; 20, 42; 21, 43; 21, 44; 21, 45;...
def places_within_radius( self, place=None, latitude=None, longitude=None, radius=0, **kwargs ): """ Return descriptions of the places stored in the collection that are within the circle specified by the given location and radius. A list of dicts will be returned. Th...
0, module; 1, function_definition; 2, function_name:naturalize_person; 3, parameters; 4, block; 5, identifier:self; 6, identifier:string; 7, expression_statement; 8, expression_statement; 9, comment:# Add lowercase versions:; 10, expression_statement; 11, comment:# If a name has a capitalised particle in we use that to...
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; 4, 18; 4, 19; 4, 20; 4, 21; 4, 22; 4, 23; 4, 24; 4, 25; 4, 26; 4, 27; 7, 28; 8, 29; 10, 30; 13, 31; 14, 32; 16, 33; 18, 34; 20, 35; 21, 36; 22, 37; 22, 38; 22, 39; 23, 40; 23, 41; 24, 42; 24, 43; 24, 44; 26, 45...
def naturalize_person(self, string): """ Attempt to make a version of the string that has the surname, if any, at the start. 'John, Brown' to 'Brown, John' 'Sir John Brown Jr' to 'Brown, Sir John Jr' 'Prince' to 'Prince' string -- The string to change. "...
0, module; 1, function_definition; 2, function_name:get_countries; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, expression_statement; 8, expression_statement; 9, for_statement; 10, return_statement; 11, comment:""" Returns a list of dicts, one per country that has at least one Venue ...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 4, 6; 4, 7; 4, 8; 4, 9; 4, 10; 6, 11; 7, 12; 8, 13; 9, 14; 9, 15; 9, 16; 10, 17; 12, 18; 12, 19; 13, 20; 13, 21; 16, 22; 17, 23; 17, 24; 19, 25; 19, 26; 22, 27; 24, 28; 24, 29; 25, 30; 25, 31; 25, 32; 26, 33; 27, 34; 27, 35; 29, 36; 29, 37; 30, 38; 30, 39; 33, 40; 34, 41; 34, 42; 35, 43; 3...
def get_countries(self): """ Returns a list of dicts, one per country that has at least one Venue in it. Each dict has 'code' and 'name' elements. The list is sorted by the country 'name's. """ qs = Venue.objects.values('country') \ ...
0, module; 1, function_definition; 2, function_name:fit; 3, parameters; 4, block; 5, identifier:self; 6, identifier:t; 7, identifier:y; 8, default_parameter; 9, default_parameter; 10, expression_statement; 11, expression_statement; 12, expression_statement; 13, return_statement; 14, identifier:dy; 15, integer:1; 16, id...
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; 8, 14; 8, 15; 9, 16; 9, 17; 10, 18; 11, 19; 12, 20; 13, 21; 19, 22; 19, 23; 20, 24; 20, 25; 22, 26; 22, 27; 22, 28; 23, 29; 23, 30; 24, 31; 24, 32; 25, 33; 25, 34; 25, 35; 26, 36; 26, 37; 27, 38; 27, 39; 28, 40; 28, 41; 29, 42; 29, 43; 30...
def fit(self, t, y, dy=1, presorted=False): """Fit the smoother Parameters ---------- t : array_like time locations of the points to smooth y : array_like y locations of the points to smooth dy : array_like or float (default = 1) Error...
0, module; 1, function_definition; 2, function_name:validate_inputs; 3, parameters; 4, block; 5, list_splat_pattern; 6, dictionary_splat_pattern; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, if_statement; 11, if_statement; 12, if_statement; 13, return_statement; 14, identifier:arrays; ...
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; 5, 14; 6, 15; 7, 16; 8, 17; 9, 18; 10, 19; 10, 20; 11, 21; 11, 22; 12, 23; 12, 24; 13, 25; 17, 26; 17, 27; 18, 28; 18, 29; 20, 30; 21, 31; 21, 32; 22, 33; 23, 34; 23, 35; 24, 36; 24, 37; 24, 38; 27, 39; 27, 40; 29, 41; 29, 42; 30, 43; 31,...
def validate_inputs(*arrays, **kwargs): """Validate input arrays This checks that - Arrays are mutually broadcastable - Broadcasted arrays are one-dimensional Optionally, arrays are sorted according to the ``sort_by`` argument. Parameters ---------- *args : ndarrays All non-ke...
0, module; 1, function_definition; 2, function_name:multinterp; 3, parameters; 4, block; 5, identifier:x; 6, identifier:y; 7, identifier:xquery; 8, default_parameter; 9, expression_statement; 10, expression_statement; 11, assert_statement; 12, assert_statement; 13, assert_statement; 14, comment:# make sure xmin < xquer...
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; 8, 17; 8, 18; 9, 19; 10, 20; 11, 21; 12, 22; 13, 23; 15, 24; 16, 25; 16, 26; 16, 27; 16, 28; 20, 29; 20, 30; 21, 31; 21, 32; 22, 33; 22, 34; 23, 35; 23, 36; 24, 37; 24, 38; 26, 39; 26, 40; 27, 41; 27, 42; 27, 43; 28, ...
def multinterp(x, y, xquery, slow=False): """Multiple linear interpolations Parameters ---------- x : array_like, shape=(N,) sorted array of x values y : array_like, shape=(N, M) array of y values corresponding to each x value xquery : array_like, shape=(M,) array of que...
0, module; 1, function_definition; 2, function_name:check_valid_time_and_sort; 3, parameters; 4, block; 5, identifier:df; 6, identifier:timescol; 7, default_parameter; 8, default_parameter; 9, expression_statement; 10, expression_statement; 11, if_statement; 12, identifier:days; 13, integer:5; 14, identifier:warning; 1...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 3, 7; 3, 8; 4, 9; 4, 10; 4, 11; 7, 12; 7, 13; 8, 14; 8, 15; 9, 16; 10, 17; 11, 18; 11, 19; 11, 20; 17, 21; 17, 22; 18, 23; 18, 24; 19, 25; 20, 26; 22, 27; 22, 28; 25, 29; 26, 30; 26, 31; 27, 32; 29, 33; 29, 34; 30, 35; 30, 36; 31, 37; 32, 38; 32, 39; 33, 40; 33, 41; 36, 42; 36, 43; 3...
def check_valid_time_and_sort(df, timescol, days=5, warning=True): """Check if the data contains reads created within the same `days` timeframe. if not, print warning and only return part of the data which is within `days` days Resetting the index twice to get also an "index" column for plotting the cum_yi...
0, module; 1, function_definition; 2, function_name:list_anime_series; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, default_parameter; 8, default_parameter; 9, expression_statement; 10, expression_statement; 11, return_statement; 12, identifier:sort; 13, attribute; 14, identifier:limit; 15, att...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 3, 7; 3, 8; 4, 9; 4, 10; 4, 11; 6, 12; 6, 13; 7, 14; 7, 15; 8, 16; 8, 17; 9, 18; 10, 19; 11, 20; 13, 21; 13, 22; 15, 23; 15, 24; 19, 25; 19, 26; 26, 27; 26, 28; 27, 29; 27, 30; 28, 31; 28, 32; 28, 33; 28, 34; 29, 35; 29, 36; 31, 37; 31, 38; 32, 39; 32, 40; 33, 41; 33, 42; 34, 43; 34,...
def list_anime_series(self, sort=META.SORT_ALPHA, limit=META.MAX_SERIES, offset=0): """Get a list of anime series @param str sort pick how results should be sorted, should be one of META.SORT_* @param int limit limit number of series to return, there doesn...
0, module; 1, function_definition; 2, function_name:list_drama_series; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, default_parameter; 8, default_parameter; 9, expression_statement; 10, expression_statement; 11, return_statement; 12, identifier:sort; 13, attribute; 14, identifier:limit; 15, att...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 3, 7; 3, 8; 4, 9; 4, 10; 4, 11; 6, 12; 6, 13; 7, 14; 7, 15; 8, 16; 8, 17; 9, 18; 10, 19; 11, 20; 13, 21; 13, 22; 15, 23; 15, 24; 19, 25; 19, 26; 26, 27; 26, 28; 27, 29; 27, 30; 28, 31; 28, 32; 28, 33; 28, 34; 29, 35; 29, 36; 31, 37; 31, 38; 32, 39; 32, 40; 33, 41; 33, 42; 34, 43; 34,...
def list_drama_series(self, sort=META.SORT_ALPHA, limit=META.MAX_SERIES, offset=0): """Get a list of drama series @param str sort pick how results should be sorted, should be one of META.SORT_* @param int limit limit number of series to return, there doesn...
0, module; 1, function_definition; 2, function_name:list_media; 3, parameters; 4, block; 5, identifier:self; 6, identifier:series; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, expression_statement; 11, expression_statement; 12, expression_statement; 13, expression_statement; 14, return_statemen...
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; 7, 15; 7, 16; 8, 17; 8, 18; 9, 19; 9, 20; 10, 21; 11, 22; 12, 23; 13, 24; 14, 25; 16, 26; 16, 27; 18, 28; 18, 29; 22, 30; 22, 31; 23, 32; 23, 33; 24, 34; 24, 35; 31, 36; 31, 37; 31, 38; 32, 39; 32, 40; 33, 41; 35, 42; 35, 43; 36, 4...
def list_media(self, series, sort=META.SORT_DESC, limit=META.MAX_MEDIA, offset=0): """List media for a given series or collection @param crunchyroll.models.Series series the series to search for @param str sort choose the ordering of the ...
0, module; 1, function_definition; 2, function_name:solve_sort; 3, parameters; 4, block; 5, identifier:expr; 6, identifier:vars; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, function_definition; 11, expression_statement; 12, return_statement; 13, comment:"""Sort values on the LHS by th...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 4, 7; 4, 8; 4, 9; 4, 10; 4, 11; 4, 12; 7, 13; 8, 14; 9, 15; 10, 16; 10, 17; 10, 18; 11, 19; 12, 20; 14, 21; 14, 22; 15, 23; 15, 24; 17, 25; 18, 26; 19, 27; 19, 28; 20, 29; 20, 30; 22, 31; 22, 32; 24, 33; 24, 34; 26, 35; 28, 36; 28, 37; 30, 38; 30, 39; 31, 40; 31, 41; 32, 42; 35, 43; ...
def solve_sort(expr, vars): """Sort values on the LHS by the value they yield when passed to RHS.""" lhs_values = repeated.getvalues(__solve_for_repeated(expr.lhs, vars)[0]) sort_expression = expr.rhs def _key_func(x): return solve(sort_expression, __nest_scope(expr.lhs, vars, x)).value r...
0, module; 1, function_definition; 2, function_name:expression; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, expression_statement; 8, expression_statement; 9, return_statement; 10, identifier:previous_precedence; 11, integer:0; 12, comment:"""An expression is an atom or an infix expression. ...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 4, 7; 4, 8; 4, 9; 6, 10; 6, 11; 7, 12; 8, 13; 9, 14; 13, 15; 13, 16; 14, 17; 14, 18; 16, 19; 16, 20; 17, 21; 17, 22; 18, 23; 18, 24; 19, 25; 19, 26
def expression(self, previous_precedence=0): """An expression is an atom or an infix expression. Grammar (sort of, actually a precedence-climbing parser): expression = atom [ binary_operator expression ] . Args: previous_precedence: What operator precedence should we st...
0, module; 1, function_definition; 2, function_name:application; 3, parameters; 4, block; 5, identifier:self; 6, identifier:func; 7, expression_statement; 8, expression_statement; 9, if_statement; 10, expression_statement; 11, while_statement; 12, expression_statement; 13, return_statement; 14, comment:"""Parse the fun...
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; 7, 14; 8, 15; 9, 16; 9, 17; 9, 18; 10, 19; 11, 20; 11, 21; 12, 22; 13, 23; 15, 24; 15, 25; 16, 26; 16, 27; 18, 28; 19, 29; 19, 30; 20, 31; 20, 32; 21, 33; 22, 34; 22, 35; 23, 36; 23, 37; 25, 38; 25, 39; 26, 40; 26, 41; 27, 42; 28, 43; 30,...
def application(self, func): """Parse the function application subgrammar. Function application can, conceptually, be thought of as a mixfix operator, similar to the way array subscripting works. However, it is not clear at this point whether we want to allow it to work as such, ...
0, module; 1, function_definition; 2, function_name:value_eq; 3, parameters; 4, block; 5, identifier:self; 6, identifier:other; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, return_statement; 11, comment:"""Sorted comparison of values."""; 12, assignment; 13, assignment; 14, comparison_...
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; 10, 14; 12, 15; 12, 16; 13, 17; 13, 18; 14, 19; 14, 20; 16, 21; 16, 22; 18, 23; 18, 24; 21, 25; 21, 26; 22, 27; 23, 28; 23, 29; 24, 30; 27, 31; 27, 32; 30, 33; 30, 34; 31, 35; 31, 36; 33, 37; 33, 38; 34, 39
def value_eq(self, other): """Sorted comparison of values.""" self_sorted = ordered.ordered(self.getvalues()) other_sorted = ordered.ordered(repeated.getvalues(other)) return self_sorted == other_sorted
0, module; 1, function_definition; 2, function_name:merge; 3, parameters; 4, block; 5, identifier:a_intervals; 6, identifier:b_intervals; 7, identifier:op; 8, expression_statement; 9, expression_statement; 10, expression_statement; 11, expression_statement; 12, expression_statement; 13, expression_statement; 14, expres...
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; 8, 20; 9, 21; 10, 22; 11, 23; 12, 24; 13, 25; 14, 26; 15, 27; 16, 28; 17, 29; 18, 30; 18, 31; 19, 32; 21, 33; 21, 34; 22, 35; 22, 36; 23, 37; 23, 38; 24, 39; 24, 40; 25, 41; 25, 42; 26, 43; 26, 44...
def merge(a_intervals, b_intervals, op): """ Merge two lists of intervals according to the boolean function op ``a_intervals`` and ``b_intervals`` need to be sorted and consistent (no overlapping intervals). This operation keeps the resulting interval set consistent. Parameters...
0, module; 1, function_definition; 2, function_name:check_bam; 3, parameters; 4, block; 5, identifier:bam; 6, default_parameter; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, if_statement; 11, if_statement; 12, if_statement; 13, return_statement; 14, identifier:samtype; 15, string:"bam"...
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; 6, 14; 6, 15; 7, 16; 8, 17; 9, 18; 10, 19; 10, 20; 11, 21; 11, 22; 12, 23; 12, 24; 13, 25; 17, 26; 17, 27; 18, 28; 18, 29; 19, 30; 20, 31; 20, 32; 20, 33; 20, 34; 21, 35; 22, 36; 22, 37; 23, 38; 23, 39; 24, 40; 24, 41; 26, 42; 26, 43; 27,...
def check_bam(bam, samtype="bam"): """Check if bam file is valid. Bam file should: - exists - has an index (create if necessary) - is sorted by coordinate - has at least one mapped read """ ut.check_existance(bam) samfile = pysam.AlignmentFile(bam, "rb") if not samfile.has_index...
0, module; 1, function_definition; 2, function_name:get_input; 3, parameters; 4, block; 5, identifier:source; 6, identifier:files; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, default_parameter; 12, expression_statement; 13, expression_statement; 14, expression_statement;...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 3, 7; 3, 8; 3, 9; 3, 10; 3, 11; 4, 12; 4, 13; 4, 14; 4, 15; 4, 16; 4, 17; 4, 18; 4, 19; 4, 20; 7, 21; 7, 22; 8, 23; 8, 24; 9, 25; 9, 26; 10, 27; 10, 28; 11, 29; 11, 30; 12, 31; 13, 32; 14, 33; 15, 34; 16, 35; 16, 36; 17, 37; 17, 38; 18, 39; 19, 40; 20, 41; 20, 42; 20, 43; 32, 44; 32,...
def get_input(source, files, threads=4, readtype="1D", combine="simple", names=None, barcoded=False): """Get input and process accordingly. Data can be: - a uncompressed, bgzip, bzip2 or gzip compressed fastq file - a uncompressed, bgzip, bzip2 or gzip compressed fasta file - a rich f...
0, module; 1, function_definition; 2, function_name:validate_wavelengths; 3, parameters; 4, block; 5, identifier:wavelengths; 6, expression_statement; 7, if_statement; 8, if_statement; 9, expression_statement; 10, comment:# Check for zeroes; 11, if_statement; 12, comment:# Check for monotonicity; 13, expression_stateme...
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; 4, 15; 4, 16; 6, 17; 7, 18; 7, 19; 7, 20; 8, 21; 8, 22; 9, 23; 11, 24; 11, 25; 13, 26; 14, 27; 14, 28; 16, 29; 16, 30; 18, 31; 18, 32; 19, 33; 19, 34; 20, 35; 21, 36; 21, 37; 22, 38; 23, 39; 23, 40; 24, 41; 24, 42; 25, 43; 26, 44; ...
def validate_wavelengths(wavelengths): """Check wavelengths for ``synphot`` compatibility. Wavelengths must satisfy these conditions: * valid unit type, if given * no zeroes * monotonic ascending or descending * no duplicate values Parameters ---------- wavelengths...
0, module; 1, function_definition; 2, function_name:heapify; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, expression_statement; 8, if_statement; 9, identifier:key; 10, identifier:__marker; 11, comment:""" Repair a broken heap. If the state of an item's priority value changes you...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 4, 7; 4, 8; 6, 9; 6, 10; 7, 11; 8, 12; 8, 13; 8, 14; 12, 15; 12, 16; 13, 17; 13, 18; 14, 19; 16, 20; 16, 21; 17, 22; 18, 23; 18, 24; 18, 25; 19, 26; 19, 27; 22, 28; 22, 29; 24, 30; 24, 31; 25, 32; 26, 33; 26, 34; 27, 35; 29, 36; 29, 37; 31, 38; 32, 39; 33, 40; 34, 41; 34, 42; 35, 43;...
def heapify(self, key=__marker): """ Repair a broken heap. If the state of an item's priority value changes you can re-sort the relevant item only by providing ``key``. """ if key is self.__marker: n = len(self._heap) for pos in reversed(range(n//2)): ...
0, module; 1, function_definition; 2, function_name:__update_display_items_model; 3, parameters; 4, type; 5, block; 6, identifier:self; 7, typed_parameter; 8, typed_parameter; 9, typed_parameter; 10, None; 11, expression_statement; 12, with_statement; 13, identifier:display_items_model; 14, type; 15, identifier:data_gr...
0, 1; 1, 2; 1, 3; 1, 4; 1, 5; 3, 6; 3, 7; 3, 8; 3, 9; 4, 10; 5, 11; 5, 12; 7, 13; 7, 14; 8, 15; 8, 16; 9, 17; 9, 18; 11, 19; 12, 20; 12, 21; 12, 22; 14, 23; 16, 24; 18, 25; 20, 26; 22, 27; 23, 28; 23, 29; 24, 30; 24, 31; 25, 32; 25, 33; 26, 34; 27, 35; 27, 36; 27, 37; 27, 38; 27, 39; 27, 40; 30, 41; 30, 42; 31, 43; 31,...
def __update_display_items_model(self, display_items_model: ListModel.FilteredListModel, data_group: typing.Optional[DataGroup.DataGroup], filter_id: typing.Optional[str]) -> None: """Update the data item model with a new container, filter, and sorting. This is called when the data item model is create...
0, module; 1, function_definition; 2, function_name:sort_by_date_key; 3, parameters; 4, block; 5, identifier:data_item; 6, expression_statement; 7, return_statement; 8, comment:""" A sort key to for the created field of a data item. The sort by uuid makes it determinate. """; 9, expression_list; 10, conditional_express...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 4, 6; 4, 7; 6, 8; 7, 9; 9, 10; 9, 11; 9, 12; 10, 13; 10, 14; 10, 15; 11, 16; 11, 17; 12, 18; 12, 19; 13, 20; 13, 21; 14, 22; 14, 23; 15, 24; 15, 25; 19, 26; 20, 27; 20, 28; 21, 29; 21, 30; 26, 31; 26, 32; 30, 33; 33, 34; 33, 35
def sort_by_date_key(data_item): """ A sort key to for the created field of a data item. The sort by uuid makes it determinate. """ return data_item.title + str(data_item.uuid) if data_item.is_live else str(), data_item.date_for_sorting, str(data_item.uuid)
0, module; 1, function_definition; 2, function_name:open_mfbpchdataset; 3, parameters; 4, block; 5, identifier:paths; 6, default_parameter; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, dictionary_splat_pattern; 11, expression_statement; 12, import_from_statement; 13, comment:# TODO: Include fil...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 3, 7; 3, 8; 3, 9; 3, 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; 4, 27; 4, 28; 4, 29; 4, 30; 4, 31; 6, 32; 6, 33; 7, 34; 7, 35; 8, 36; 8, 37; 9, 38; 9, 39; 10, 40; 11, 41; 12, 42; 12, 43; 15, 44; 16, 45; 16, 46; ...
def open_mfbpchdataset(paths, concat_dim='time', compat='no_conflicts', preprocess=None, lock=None, **kwargs): """ Open multiple bpch files as a single dataset. You must have dask installed for this to work, as this greatly simplifies issues relating to multi-file I/O. Also, ple...
0, module; 1, function_definition; 2, function_name:_get_archive_filelist; 3, parameters; 4, comment:# type: (str) -> List[str]; 5, block; 6, identifier:filename; 7, expression_statement; 8, expression_statement; 9, comment:# type: List[str]; 10, if_statement; 11, if_statement; 12, return_statement; 13, comment:"""Extr...
0, 1; 1, 2; 1, 3; 1, 4; 1, 5; 3, 6; 5, 7; 5, 8; 5, 9; 5, 10; 5, 11; 5, 12; 7, 13; 8, 14; 10, 15; 10, 16; 10, 17; 10, 18; 11, 19; 11, 20; 12, 21; 14, 22; 14, 23; 15, 24; 15, 25; 16, 26; 17, 27; 17, 28; 18, 29; 19, 30; 19, 31; 20, 32; 24, 33; 24, 34; 25, 35; 26, 36; 26, 37; 27, 38; 27, 39; 28, 40; 29, 41; 32, 42; 36, 43;...
def _get_archive_filelist(filename): # type: (str) -> List[str] """Extract the list of files from a tar or zip archive. Args: filename: name of the archive Returns: Sorted list of files in the archive, excluding './' Raises: ValueError: when the file is neither a zip nor a...
0, module; 1, function_definition; 2, function_name:pbar_strings; 3, parameters; 4, block; 5, identifier:files; 6, default_parameter; 7, dictionary_splat_pattern; 8, expression_statement; 9, return_statement; 10, identifier:desc; 11, string; 12, identifier:kwargs; 13, comment:"""Wrapper for `tqdm` progress bar which al...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 3, 7; 4, 8; 4, 9; 6, 10; 6, 11; 7, 12; 8, 13; 9, 14; 14, 15; 14, 16; 16, 17; 16, 18; 16, 19; 16, 20; 17, 21; 17, 22; 18, 23; 18, 24; 19, 25; 19, 26; 20, 27; 22, 28; 22, 29; 24, 30; 29, 31; 29, 32; 30, 33; 30, 34; 32, 35; 32, 36; 33, 37; 33, 38; 35, 39; 36, 40; 36, 41; 37, 42; 37, 43;...
def pbar_strings(files, desc='', **kwargs): """Wrapper for `tqdm` progress bar which also sorts list of strings """ return tqdm( sorted(files, key=lambda s: s.lower()), desc=('<' + str(datetime.now().strftime("%Y-%m-%d %H:%M:%S")) + '> ' + desc), dynamic_ncols=True, ...
0, module; 1, function_definition; 2, function_name:sort_func; 3, parameters; 4, block; 5, identifier:self; 6, identifier:key; 7, expression_statement; 8, if_statement; 9, if_statement; 10, if_statement; 11, return_statement; 12, comment:"""Logic for sorting keys in a `Spectrum` relative to one another."""; 13, compari...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 4, 7; 4, 8; 4, 9; 4, 10; 4, 11; 7, 12; 8, 13; 8, 14; 9, 15; 9, 16; 10, 17; 10, 18; 11, 19; 13, 20; 13, 21; 14, 22; 15, 23; 15, 24; 16, 25; 17, 26; 17, 27; 18, 28; 21, 29; 21, 30; 22, 31; 24, 32; 24, 33; 25, 34; 27, 35; 27, 36; 28, 37; 29, 38; 29, 39; 31, 40; 32, 41; 32, 42; 34, 43; 3...
def sort_func(self, key): """Logic for sorting keys in a `Spectrum` relative to one another.""" if key == self._KEYS.TIME: return 'aaa' if key == self._KEYS.DATA: return 'zzy' if key == self._KEYS.SOURCE: return 'zzz' return key
0, module; 1, function_definition; 2, function_name:sort_func; 3, parameters; 4, block; 5, identifier:self; 6, identifier:key; 7, expression_statement; 8, if_statement; 9, if_statement; 10, return_statement; 11, comment:"""Sorting logic for `Quantity` objects."""; 12, comparison_operator:key == self._KEYS.VALUE; 13, bl...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 4, 7; 4, 8; 4, 9; 4, 10; 7, 11; 8, 12; 8, 13; 9, 14; 9, 15; 10, 16; 12, 17; 12, 18; 13, 19; 14, 20; 14, 21; 15, 22; 18, 23; 18, 24; 19, 25; 21, 26; 21, 27; 22, 28; 23, 29; 23, 30; 25, 31; 26, 32; 26, 33; 28, 34
def sort_func(self, key): """Sorting logic for `Quantity` objects.""" if key == self._KEYS.VALUE: return 'aaa' if key == self._KEYS.SOURCE: return 'zzz' return key
0, module; 1, function_definition; 2, function_name:sort_func; 3, parameters; 4, block; 5, identifier:self; 6, identifier:key; 7, expression_statement; 8, if_statement; 9, if_statement; 10, if_statement; 11, if_statement; 12, if_statement; 13, if_statement; 14, if_statement; 15, return_statement; 16, comment:"""Used to...
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; 7, 16; 8, 17; 8, 18; 9, 19; 9, 20; 10, 21; 10, 22; 11, 23; 11, 24; 12, 25; 12, 26; 13, 27; 13, 28; 14, 29; 14, 30; 15, 31; 17, 32; 17, 33; 18, 34; 19, 35; 19, 36; 20, 37; 21, 38; 21, 39; 22, 40; 23, 41; 23, 42; 24, 43; 25, 4...
def sort_func(self, key): """Used to sort keys when writing Entry to JSON format. Should be supplemented/overridden by inheriting classes. """ if key == self._KEYS.SCHEMA: return 'aaa' if key == self._KEYS.NAME: return 'aab' if key == self._KEYS.S...
0, module; 1, function_definition; 2, function_name:sort_func; 3, parameters; 4, block; 5, identifier:self; 6, identifier:key; 7, expression_statement; 8, if_statement; 9, if_statement; 10, if_statement; 11, return_statement; 12, comment:"""Specify order for attributes."""; 13, comparison_operator:key == self._KEYS.TIM...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 4, 7; 4, 8; 4, 9; 4, 10; 4, 11; 7, 12; 8, 13; 8, 14; 9, 15; 9, 16; 10, 17; 10, 18; 11, 19; 13, 20; 13, 21; 14, 22; 15, 23; 15, 24; 16, 25; 17, 26; 17, 27; 18, 28; 21, 29; 21, 30; 22, 31; 24, 32; 24, 33; 25, 34; 27, 35; 27, 36; 28, 37; 29, 38; 29, 39; 31, 40; 32, 41; 32, 42; 34, 43; 3...
def sort_func(self, key): """Specify order for attributes.""" if key == self._KEYS.TIME: return 'aaa' if key == self._KEYS.MODEL: return 'zzy' if key == self._KEYS.SOURCE: return 'zzz' return key
0, module; 1, function_definition; 2, function_name:TypeFactory; 3, parameters; 4, block; 5, identifier:type_; 6, expression_statement; 7, if_statement; 8, for_statement; 9, raise_statement; 10, comment:""" This function creates a standard form type from a simplified form. >>> from datetime import date, dateti...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 4, 6; 4, 7; 4, 8; 4, 9; 6, 10; 7, 11; 7, 12; 8, 13; 8, 14; 8, 15; 9, 16; 11, 17; 11, 18; 12, 19; 15, 20; 16, 21; 16, 22; 17, 23; 17, 24; 18, 25; 18, 26; 19, 27; 20, 28; 20, 29; 22, 30; 24, 31; 24, 32; 26, 33; 26, 34; 28, 35; 28, 36; 29, 37; 35, 38; 35, 39; 36, 40; 37, 41; 41, 42; 41, 43; 4...
def TypeFactory(type_): """ This function creates a standard form type from a simplified form. >>> from datetime import date, datetime >>> from pyws.functions.args import TypeFactory >>> from pyws.functions.args import String, Integer, Float, Date, DateTime >>> TypeFactory(str) == String Tr...
0, module; 1, function_definition; 2, function_name:get_sorted_dependencies; 3, parameters; 4, block; 5, identifier:service_model; 6, expression_statement; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, for_statement; 11, return_statement; 12, comment:""" Returns list of application ...
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; 8, 14; 9, 15; 10, 16; 10, 17; 10, 18; 11, 19; 13, 20; 13, 21; 14, 22; 14, 23; 15, 24; 15, 25; 18, 26; 19, 27; 19, 28; 21, 29; 21, 30; 23, 31; 23, 32; 25, 33; 25, 34; 25, 35; 25, 36; 26, 37; 28, 38; 28, 39; 30, 40; 31, 41; 31, 42; 32, 43; ...
def get_sorted_dependencies(service_model): """ Returns list of application models in topological order. It is used in order to correctly delete dependent resources. """ app_models = list(service_model._meta.app_config.get_models()) dependencies = {model: set() for model in app_models} relat...
0, module; 1, function_definition; 2, function_name:format_time_and_value_to_segment_list; 3, parameters; 4, block; 5, identifier:time_and_value_list; 6, identifier:segments_count; 7, identifier:start_timestamp; 8, identifier:end_timestamp; 9, default_parameter; 10, expression_statement; 11, expression_statement; 12, e...
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; 9, 15; 9, 16; 10, 17; 11, 18; 12, 19; 13, 20; 13, 21; 13, 22; 14, 23; 18, 24; 18, 25; 19, 26; 19, 27; 21, 28; 21, 29; 22, 30; 22, 31; 22, 32; 22, 33; 22, 34; 22, 35; 27, 36; 27, 37; 29, 38; 30, 39; 31, 40; 32, 41; 33, 42; 34, 43; 3...
def format_time_and_value_to_segment_list(time_and_value_list, segments_count, start_timestamp, end_timestamp, average=False): """ Format time_and_value_list to time segments Parameters ^^^^^^^^^^ time_and_value_list: list of tuples Have to be sorte...
0, module; 1, function_definition; 2, function_name:get_api_root_view; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, for_statement; 11, class_definition; 12, return_statement; 13, identifier:api_urls; 14, None; 15, comme...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 4, 7; 4, 8; 4, 9; 4, 10; 4, 11; 4, 12; 6, 13; 6, 14; 7, 15; 8, 16; 9, 17; 10, 18; 10, 19; 10, 20; 11, 21; 11, 22; 11, 23; 12, 24; 16, 25; 16, 26; 17, 27; 17, 28; 18, 29; 18, 30; 18, 31; 19, 32; 19, 33; 20, 34; 22, 35; 23, 36; 23, 37; 23, 38; 24, 39; 24, 40; 26, 41; 26, 42; 28, 43; 28...
def get_api_root_view(self, api_urls=None): """ Return a basic root view. """ api_root_dict = OrderedDict() list_name = self.routes[0].name for prefix, viewset, basename in self.registry: api_root_dict[prefix] = list_name.format(basename=basename) cla...
0, module; 1, function_definition; 2, function_name:get_default_base_name; 3, parameters; 4, block; 5, identifier:self; 6, identifier:viewset; 7, expression_statement; 8, expression_statement; 9, if_statement; 10, return_statement; 11, comment:""" Attempt to automatically determine base name using `get_url_name...
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; 10, 15; 12, 16; 12, 17; 13, 18; 13, 19; 14, 20; 14, 21; 15, 22; 15, 23; 17, 24; 17, 25; 20, 26; 21, 27; 21, 28; 22, 29; 22, 30; 23, 31; 25, 32; 25, 33; 25, 34; 26, 35; 26, 36; 27, 37; 27, 38; 28, 39; 29, 40; 29, 41; 33, 42; 36, 43;...
def get_default_base_name(self, viewset): """ Attempt to automatically determine base name using `get_url_name`. """ queryset = getattr(viewset, 'queryset', None) if queryset is not None: get_url_name = getattr(queryset.model, 'get_url_name', None) if get...
0, module; 1, function_definition; 2, function_name:sort_dict; 3, parameters; 4, block; 5, identifier:d; 6, default_parameter; 7, expression_statement; 8, expression_statement; 9, return_statement; 10, identifier:desc; 11, True; 12, comment:""" Sort an ordered dictionary by value, descending. Args: d (...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 4, 7; 4, 8; 4, 9; 6, 10; 6, 11; 7, 12; 8, 13; 9, 14; 13, 15; 13, 16; 14, 17; 14, 18; 16, 19; 16, 20; 18, 21; 20, 22; 20, 23; 20, 24; 22, 25; 22, 26; 23, 27; 23, 28; 24, 29; 24, 30; 25, 31; 25, 32; 28, 33; 28, 34; 33, 35; 34, 36; 34, 37
def sort_dict(d, desc=True): """ Sort an ordered dictionary by value, descending. Args: d (OrderedDict): An ordered dictionary. desc (bool): If true, sort desc. Returns: OrderedDict: The sorted dictionary. """ sort = sorted(d.items(), key=lambda x: x[1], reverse=desc)...
0, module; 1, function_definition; 2, function_name:_tupleCompare; 3, parameters; 4, block; 5, identifier:tuple1; 6, identifier:ineq; 7, identifier:tuple2; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, expression_statement; 12, expression_statement; 13, for_statement; 14, return_statement; 15, ...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 3, 7; 3, 8; 3, 9; 3, 10; 4, 11; 4, 12; 4, 13; 4, 14; 8, 15; 8, 16; 9, 17; 9, 18; 10, 19; 10, 20; 11, 21; 12, 22; 13, 23; 13, 24; 13, 25; 14, 26; 16, 27; 16, 28; 22, 29; 22, 30; 24, 31; 24, 32; 25, 33; 25, 34; 25, 35; 26, 36; 26, 37; 27, 38; 27, 39; 28, 40; 32, 41; 33, 42; 34, 43; 35,...
def _tupleCompare(tuple1, ineq, tuple2, eq=lambda a,b: (a==b), ander=AND, orer=OR): """ Compare two 'in-database tuples'. Useful when sorting by a compound key and slicing into the middle of that query. """ orholder = [] for limit in range(len...
0, module; 1, function_definition; 2, function_name:get_datasets; 3, parameters; 4, comment:# type: (str, Any) -> List[hdx.data.dataset.Dataset]; 5, block; 6, identifier:self; 7, default_parameter; 8, dictionary_splat_pattern; 9, expression_statement; 10, return_statement; 11, identifier:query; 12, string; 13, identifi...
0, 1; 1, 2; 1, 3; 1, 4; 1, 5; 3, 6; 3, 7; 3, 8; 5, 9; 5, 10; 7, 11; 7, 12; 8, 13; 9, 14; 10, 15; 12, 16; 15, 17; 15, 18; 17, 19; 17, 20; 18, 21; 18, 22; 18, 23; 18, 24; 19, 25; 19, 26; 21, 27; 21, 28; 22, 29; 22, 30; 23, 31; 23, 32; 24, 33; 25, 34; 25, 35; 30, 36; 30, 37; 32, 38; 32, 39; 34, 40; 34, 41; 38, 42; 39, 43;...
def get_datasets(self, query='*:*', **kwargs): # type: (str, Any) -> List[hdx.data.dataset.Dataset] """Get list of datasets in organization Args: query (str): Restrict datasets returned to this query (in Solr format). Defaults to '*:*'. **kwargs: See below so...
0, module; 1, function_definition; 2, function_name:get_all_organization_names; 3, parameters; 4, comment:# type: (Optional[Configuration], Any) -> List[str]; 5, block; 6, default_parameter; 7, dictionary_splat_pattern; 8, expression_statement; 9, expression_statement; 10, expression_statement; 11, comment:# only for e...
0, 1; 1, 2; 1, 3; 1, 4; 1, 5; 3, 6; 3, 7; 5, 8; 5, 9; 5, 10; 5, 11; 5, 12; 6, 13; 6, 14; 7, 15; 8, 16; 9, 17; 10, 18; 12, 19; 17, 20; 17, 21; 18, 22; 18, 23; 19, 24; 19, 25; 21, 26; 21, 27; 22, 28; 22, 29; 23, 30; 24, 31; 24, 32; 25, 33; 25, 34; 25, 35; 27, 36; 29, 37; 33, 38; 35, 39; 36, 40; 36, 41
def get_all_organization_names(configuration=None, **kwargs): # type: (Optional[Configuration], Any) -> List[str] """Get all organization names in HDX Args: configuration (Optional[Configuration]): HDX configuration. Defaults to global configuration. **kwargs: See below ...
0, module; 1, function_definition; 2, function_name:search_in_hdx; 3, parameters; 4, comment:# type: (Optional[str], Optional[Configuration], int, Any) -> List['Dataset']; 5, block; 6, identifier:cls; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, dictionary_splat_pattern; 11, expression_statemen...
0, 1; 1, 2; 1, 3; 1, 4; 1, 5; 3, 6; 3, 7; 3, 8; 3, 9; 3, 10; 5, 11; 5, 12; 5, 13; 5, 14; 5, 15; 5, 16; 5, 17; 5, 18; 5, 19; 7, 20; 7, 21; 8, 22; 8, 23; 9, 24; 9, 25; 10, 26; 11, 27; 12, 28; 13, 29; 14, 30; 15, 31; 16, 32; 17, 33; 17, 34; 17, 35; 18, 36; 18, 37; 19, 38; 21, 39; 28, 40; 28, 41; 29, 42; 29, 43; 30, 44; 30...
def search_in_hdx(cls, query='*:*', configuration=None, page_size=1000, **kwargs): # type: (Optional[str], Optional[Configuration], int, Any) -> List['Dataset'] """Searches for datasets in HDX Args: query (Optional[str]): Query (in Solr format). Defaults to '*:*'. config...
0, module; 1, function_definition; 2, function_name:sort_dict; 3, parameters; 4, type; 5, block; 6, typed_parameter; 7, typed_default_parameter; 8, typed_default_parameter; 9, attribute; 10, expression_statement; 11, if_statement; 12, return_statement; 13, identifier:d; 14, type; 15, identifier:by; 16, type; 17, string...
0, 1; 1, 2; 1, 3; 1, 4; 1, 5; 3, 6; 3, 7; 3, 8; 4, 9; 5, 10; 5, 11; 5, 12; 6, 13; 6, 14; 7, 15; 7, 16; 7, 17; 8, 18; 8, 19; 8, 20; 9, 21; 9, 22; 10, 23; 11, 24; 11, 25; 11, 26; 11, 27; 12, 28; 14, 29; 16, 30; 17, 31; 19, 32; 24, 33; 24, 34; 25, 35; 26, 36; 26, 37; 27, 38; 28, 39; 28, 40; 34, 41; 35, 42; 36, 43; 36, 44;...
def sort_dict(d: dict, by: str = 'key', allow_duplicates: bool = True) -> collections.OrderedDict: """ Sort a dictionary by key or value. The function relies on https://docs.python.org/3/library/collections.html#collections.OrderedDict . The dulicated are determined based on https...
0, module; 1, function_definition; 2, function_name:get_all_users; 3, parameters; 4, comment:# type: (Optional[Configuration], Any) -> List['User']; 5, block; 6, default_parameter; 7, dictionary_splat_pattern; 8, expression_statement; 9, expression_statement; 10, expression_statement; 11, comment:# only for error messa...
0, 1; 1, 2; 1, 3; 1, 4; 1, 5; 3, 6; 3, 7; 5, 8; 5, 9; 5, 10; 5, 11; 5, 12; 5, 13; 5, 14; 5, 15; 6, 16; 6, 17; 7, 18; 8, 19; 9, 20; 10, 21; 12, 22; 13, 23; 14, 24; 14, 25; 14, 26; 15, 27; 20, 28; 20, 29; 21, 30; 21, 31; 22, 32; 22, 33; 23, 34; 23, 35; 25, 36; 26, 37; 29, 38; 29, 39; 30, 40; 30, 41; 31, 42; 33, 43; 33, 4...
def get_all_users(configuration=None, **kwargs): # type: (Optional[Configuration], Any) -> List['User'] """Get all users in HDX Args: configuration (Optional[Configuration]): HDX configuration. Defaults to global configuration. **kwargs: See below q (str): Re...
0, module; 1, function_definition; 2, function_name:fromkeys; 3, parameters; 4, comment:# TODO : type: (Iterable, Union[Any, Callable]) -> DictWrapper; 5, comment:# https://github.com/python/mypy/issues/2254; 6, block; 7, identifier:cls; 8, identifier:iterable; 9, default_parameter; 10, expression_statement; 11, if_sta...
0, 1; 1, 2; 1, 3; 1, 4; 1, 5; 1, 6; 3, 7; 3, 8; 3, 9; 6, 10; 6, 11; 6, 12; 9, 13; 9, 14; 10, 15; 11, 16; 11, 17; 12, 18; 16, 19; 17, 20; 18, 21; 18, 22; 19, 23; 19, 24; 20, 25; 22, 26; 22, 27; 24, 28; 25, 29; 25, 30; 26, 31; 26, 32; 27, 33; 27, 34; 30, 35; 32, 36; 32, 37; 35, 38; 35, 39; 37, 40; 38, 41; 38, 42; 39, 43;...
def fromkeys(cls, iterable, value=None): # TODO : type: (Iterable, Union[Any, Callable]) -> DictWrapper # https://github.com/python/mypy/issues/2254 """Create a new d from Args: iterable: Iterable containing keys value: value to associate with each key. ...