nodes
stringlengths
501
22.4k
edges
stringlengths
138
5.07k
code
stringlengths
108
19.3k
0, module; 1, function_definition; 2, function_name:text_search; 3, parameters; 4, block; 5, identifier:self; 6, identifier:text; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, expression_statement; 11, assert_statement; 12, expression_statement; 13, expression_statement; 14, if_statement; 15, 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; 4, 14; 7, 15; 7, 16; 8, 17; 8, 18; 9, 19; 9, 20; 10, 21; 11, 22; 11, 23; 12, 24; 13, 25; 14, 26; 14, 27; 14, 28; 22, 29; 22, 30; 23, 31; 23, 32; 23, 33; 24, 34; 24, 35; 25, 36; 25, 37; 26, 38; 26, 39; 27, 40; 28, 41; 32, 42; 35, 43; 35, 4...
def text_search(self, text, sort=None, offset=100, page=1): """ Search in aquarius using text query. Given the string aquarius will do a full-text query to search in all documents. Currently implemented are the MongoDB and Elastic Search drivers. For a detailed guide on how to...
0, module; 1, function_definition; 2, function_name:query_search; 3, parameters; 4, block; 5, identifier:self; 6, identifier:search_query; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, expression_statement; 11, assert_statement; 12, expression_statement; 13, expression_statement; 14, expression_...
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; 7, 17; 7, 18; 8, 19; 8, 20; 9, 21; 9, 22; 10, 23; 11, 24; 11, 25; 12, 26; 13, 27; 14, 28; 15, 29; 16, 30; 16, 31; 16, 32; 24, 33; 24, 34; 25, 35; 25, 36; 25, 37; 26, 38; 26, 39; 27, 40; 27, 41; 28, 42; 28, 43; 29, 44;...
def query_search(self, search_query, sort=None, offset=100, page=1): """ Search using a query. Currently implemented is the MongoDB query model to search for documents according to: https://docs.mongodb.com/manual/tutorial/query-documents/ And an Elastic Search driver, which im...
0, module; 1, function_definition; 2, function_name:trunk_angles; 3, parameters; 4, block; 5, identifier:nrn; 6, default_parameter; 7, expression_statement; 8, expression_statement; 9, comment:# In order to avoid the failure of the process in case the neurite_type does not exist; 10, if_statement; 11, function_definiti...
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; 6, 16; 6, 17; 7, 18; 8, 19; 10, 20; 10, 21; 11, 22; 11, 23; 11, 24; 13, 25; 14, 26; 15, 27; 17, 28; 17, 29; 18, 30; 19, 31; 19, 32; 20, 33; 21, 34; 23, 35; 23, 36; 24, 37; 24, 38; 24, 39; 24, 40; 25, 41; 25, 42; 26, 43; 26, ...
def trunk_angles(nrn, neurite_type=NeuriteType.all): '''Calculates the angles between all the trunks of the neuron. The angles are defined on the x-y plane and the trees are sorted from the y axis and anticlock-wise. ''' vectors = trunk_vectors(nrn, neurite_type=neurite_type) # In order to avoid...
0, module; 1, function_definition; 2, function_name:resolve_symbols; 3, parameters; 4, block; 5, identifier:self; 6, identifier:tree; 7, identifier:database; 8, identifier:link_resolver; 9, expression_statement; 10, expression_statement; 11, expression_statement; 12, for_statement; 13, if_statement; 14, if_statement; 1...
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; 9, 20; 10, 21; 11, 22; 12, 23; 12, 24; 12, 25; 13, 26; 13, 27; 13, 28; 14, 29; 14, 30; 15, 31; 15, 32; 15, 33; 17, 34; 18, 35; 18, 36; 19, 37; 19, 38; 19, 39; 21, 40; 21, 41; 22, 42; 22, 43; 24, 4...
def resolve_symbols(self, tree, database, link_resolver): """ When this method is called, the page's symbol names are queried from `database`, and added to lists of actual symbols, sorted by symbol class. """ self.typed_symbols = self.__get_empty_typed_symbols() a...
0, module; 1, function_definition; 2, function_name:get_klass_parents; 3, parameters; 4, block; 5, identifier:gi_name; 6, expression_statement; 7, expression_statement; 8, expression_statement; 9, if_statement; 10, expression_statement; 11, return_statement; 12, string; 13, assignment; 14, assignment; 15, not_operator;...
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; 9, 16; 10, 17; 11, 18; 12, 19; 13, 20; 13, 21; 14, 22; 14, 23; 15, 24; 16, 25; 17, 26; 17, 27; 23, 28; 23, 29; 25, 30; 27, 31; 27, 32; 28, 33; 28, 34; 29, 35; 31, 36; 31, 37
def get_klass_parents(gi_name): ''' Returns a sorted list of qualified symbols representing the parents of the klass-like symbol named gi_name ''' res = [] parents = __HIERARCHY_GRAPH.predecessors(gi_name) if not parents: return [] __get_parent_link_recurse(parents[0], res) r...
0, module; 1, function_definition; 2, function_name:sorted_groupby; 3, parameters; 4, block; 5, identifier:df; 6, identifier:groupby; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, for_statement; 11, comment:# need to send back the last group; 12, expression_statement; 13, comment:""" ...
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; 12, 19; 14, 20; 14, 21; 15, 22; 15, 23; 16, 24; 16, 25; 17, 26; 17, 27; 18, 28; 19, 29; 23, 30; 23, 31; 27, 32; 28, 33; 28, 34; 29, 35; 29, 36; 30, 37; 30, 38; 32, 39; 32, 40; 33, 41; 33, 42; 34, 43; ...
def sorted_groupby(df, groupby): """ Perform a groupby on a DataFrame using a specific column and assuming that that column is sorted. Parameters ---------- df : pandas.DataFrame groupby : object Column name on which to groupby. This column must be sorted. Returns ------- ...
0, module; 1, function_definition; 2, function_name:add_note; 3, parameters; 4, block; 5, identifier:self; 6, identifier:note; 7, default_parameter; 8, default_parameter; 9, expression_statement; 10, if_statement; 11, if_statement; 12, if_statement; 13, return_statement; 14, identifier:octave; 15, None; 16, identifier:...
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; 22, 30; 23, 31; 23, 32; 24, 33; 24, 34; 25, 35; 25, 36; 26, 37; 26, 38; 28, 39; 28, 40; 28, 41; 28, 42; 29, 43; 29,...
def add_note(self, note, octave=None, dynamics={}): """Add a note to the container and sorts the notes from low to high. The note can either be a string, in which case you could also use the octave and dynamics arguments, or a Note object. """ if type(note) == str: i...
0, module; 1, function_definition; 2, function_name:_sort_row_col; 3, parameters; 4, type; 5, block; 6, typed_parameter; 7, generic_type; 8, expression_statement; 9, return_statement; 10, identifier:qubits; 11, type; 12, identifier:List; 13, type_parameter; 14, comment:"""Sort grid qubits first by row then by column"""...
0, 1; 1, 2; 1, 3; 1, 4; 1, 5; 3, 6; 4, 7; 5, 8; 5, 9; 6, 10; 6, 11; 7, 12; 7, 13; 8, 14; 9, 15; 11, 16; 13, 17; 15, 18; 15, 19; 16, 20; 16, 21; 17, 22; 19, 23; 19, 24; 21, 25; 24, 26; 24, 27; 25, 28; 27, 29; 27, 30; 29, 31; 30, 32; 30, 33; 32, 34; 32, 35; 33, 36; 33, 37
def _sort_row_col(qubits: Iterator[GridQubit]) -> List[GridQubit]: """Sort grid qubits first by row then by column""" return sorted(qubits, key=lambda x: (x.row, x.col))
0, module; 1, function_definition; 2, function_name:_cmp_bystrlen_reverse; 3, parameters; 4, block; 5, identifier:a; 6, identifier:b; 7, expression_statement; 8, if_statement; 9, comment:"""A private "cmp" function to be used by the "sort" function of a list when ordering the titles found in a knowledge base by ...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 4, 7; 4, 8; 7, 9; 8, 10; 8, 11; 8, 12; 8, 13; 10, 14; 10, 15; 11, 16; 12, 17; 12, 18; 13, 19; 14, 20; 14, 21; 15, 22; 15, 23; 16, 24; 17, 25; 17, 26; 18, 27; 19, 28; 21, 29; 23, 30; 24, 31; 25, 32; 25, 33; 26, 34; 26, 35; 27, 36; 28, 37; 33, 38; 35, 39
def _cmp_bystrlen_reverse(a, b): """A private "cmp" function to be used by the "sort" function of a list when ordering the titles found in a knowledge base by string- length - LONGEST -> SHORTEST. @param a: (string) @param b: (string) @return: (integer) - 0 if len(a) == len(b); 1 ...
0, module; 1, function_definition; 2, function_name:prof_main; 3, parameters; 4, block; 5, identifier:main; 6, expression_statement; 7, decorated_definition; 8, return_statement; 9, comment:""" Decorator for profiling main programs. Profiling is activated by prepending the command line options supported by...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 4, 6; 4, 7; 4, 8; 6, 9; 7, 10; 7, 11; 8, 12; 10, 13; 11, 14; 11, 15; 11, 16; 13, 17; 13, 18; 15, 19; 15, 20; 16, 21; 16, 22; 16, 23; 18, 24; 19, 25; 20, 26; 21, 27; 22, 28; 22, 29; 23, 30; 23, 31; 23, 32; 27, 33; 28, 34; 28, 35; 29, 36; 29, 37; 30, 38; 31, 39; 32, 40; 34, 41; 35, 42; 35, 4...
def prof_main(main): """ Decorator for profiling main programs. Profiling is activated by prepending the command line options supported by the original main program with the keyword `prof`. Example: $ script.py arg --foo=1 becomes $ script.py prof arg --foo=1 The decorat...
0, module; 1, function_definition; 2, function_name:_least_constraining_values_sorter; 3, parameters; 4, block; 5, identifier:problem; 6, identifier:assignment; 7, identifier:variable; 8, identifier:domains; 9, expression_statement; 10, comment:# the value that generates less conflicts; 11, function_definition; 12, exp...
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; 9, 14; 11, 15; 11, 16; 11, 17; 12, 18; 13, 19; 14, 20; 16, 21; 17, 22; 17, 23; 17, 24; 18, 25; 18, 26; 22, 27; 23, 28; 24, 29; 26, 30; 26, 31; 27, 32; 27, 33; 28, 34; 28, 35; 31, 36; 31, 37; 33, 38; 33, 39; 34, 40; 34, 41; 36, 42; 36, 43;...
def _least_constraining_values_sorter(problem, assignment, variable, domains): ''' Sort values based on how many conflicts they generate if assigned. ''' # the value that generates less conflicts def update_assignment(value): new_assignment = deepcopy(assignment) new_assignment[varia...
0, module; 1, function_definition; 2, function_name:reading_order; 3, parameters; 4, block; 5, identifier:e1; 6, identifier:e2; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, if_statement; 11, return_statement; 12, comment:""" A comparator to sort bboxes from top to bottom, left to r...
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; 11, 17; 13, 18; 13, 19; 14, 20; 14, 21; 15, 22; 15, 23; 16, 24; 17, 25; 17, 26; 19, 27; 19, 28; 21, 29; 21, 30; 22, 31; 22, 32; 23, 33; 23, 34; 24, 35; 26, 36; 26, 37; 31, 38; 31, 39; 32, 40; 32, 41; 33, 42; 33, 43;...
def reading_order(e1, e2): """ A comparator to sort bboxes from top to bottom, left to right """ b1 = e1.bbox b2 = e2.bbox if round(b1[y0]) == round(b2[y0]) or round(b1[y1]) == round(b2[y1]): return float_cmp(b1[x0], b2[x0]) return float_cmp(b1[y0], b2[y0])
0, module; 1, function_definition; 2, function_name:xy_reading_order; 3, parameters; 4, block; 5, identifier:e1; 6, identifier:e2; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, if_statement; 11, return_statement; 12, comment:""" A comparator to sort bboxes from left to right, top to...
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; 11, 17; 13, 18; 13, 19; 14, 20; 14, 21; 15, 22; 15, 23; 16, 24; 17, 25; 17, 26; 19, 27; 19, 28; 21, 29; 21, 30; 22, 31; 22, 32; 23, 33; 23, 34; 24, 35; 26, 36; 26, 37; 32, 38; 34, 39; 35, 40; 35, 41; 36, 42; 36, 43;...
def xy_reading_order(e1, e2): """ A comparator to sort bboxes from left to right, top to bottom """ b1 = e1.bbox b2 = e2.bbox if round(b1[x0]) == round(b2[x0]): return float_cmp(b1[y0], b2[y0]) return float_cmp(b1[x0], b2[x0])
0, module; 1, function_definition; 2, function_name:column_order; 3, parameters; 4, block; 5, identifier:b1; 6, identifier:b2; 7, expression_statement; 8, expression_statement; 9, comment:# TODO(senwu): Reimplement the functionality of this comparator to; 10, comment:# detect the number of columns, and sort those in re...
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; 13, 17; 13, 18; 14, 19; 16, 20; 16, 21; 17, 22; 17, 23; 18, 24; 19, 25; 19, 26; 20, 27; 20, 28; 20, 29; 21, 30; 21, 31; 21, 32; 22, 33; 22, 34; 23, 35; 23, 36; 24, 37; 26, 38; 26, 39; 33, 40; 33, 41; 34, 42; 34, 43; 3...
def column_order(b1, b2): """ A comparator that sorts bboxes first by "columns", where a column is made up of all bboxes that overlap, then by vertical position in each column. b1 = [b1.type, b1.top, b1.left, b1.bottom, b1.right] b2 = [b2.type, b2.top, b2.left, b2.bottom, b2.right] """ (top...
0, module; 1, function_definition; 2, function_name:merge_intervals; 3, parameters; 4, block; 5, identifier:elems; 6, default_parameter; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, expression_statement; 11, expression_statement; 12, for_statement; 13, expression_statement; 14, comment...
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; 6, 16; 6, 17; 7, 18; 8, 19; 9, 20; 10, 21; 11, 22; 12, 23; 12, 24; 12, 25; 13, 26; 15, 27; 19, 28; 19, 29; 20, 30; 20, 31; 21, 32; 21, 33; 22, 34; 22, 35; 25, 36; 25, 37; 26, 38; 26, 39; 27, 40; 27, 41; 29, 42; 29, 43; 31, 4...
def merge_intervals(elems, overlap_thres=2.0): """ Project in x axis Sort by start Go through segments and keep max x1 Return a list of non-overlapping intervals """ overlap_thres = max(0.0, overlap_thres) ordered = sorted(elems, key=lambda e: e.x0) intervals = [] cur = [-overl...
0, module; 1, function_definition; 2, function_name:predict; 3, parameters; 4, block; 5, identifier:self; 6, identifier:X; 7, default_parameter; 8, expression_statement; 9, comment:# Check data; 10, comment:# X = check_array(X, accept_sparse=['csr', 'csc', 'coo']) # Dont in version 0.15; 11, if_statement; 12, comment:...
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; 7, 14; 7, 15; 8, 16; 11, 17; 11, 18; 13, 19; 13, 20; 13, 21; 13, 22; 17, 23; 17, 24; 18, 25; 19, 26; 19, 27; 20, 28; 20, 29; 21, 30; 21, 31; 21, 32; 22, 33; 22, 34; 22, 35; 23, 36; 23, 37; 24, 38; 24, 39; 25, 40; 26, 41; 26, 42; 27, 43; 2...
def predict(self, X, cost_mat=None): """Predict class for X. The predicted class of an input sample is computed as the class with the highest mean predicted probability. If base estimators do not implement a ``predict_proba`` method, then it resorts to voting. Parameters ...
0, module; 1, function_definition; 2, function_name:predict_proba; 3, parameters; 4, block; 5, identifier:self; 6, identifier:X; 7, expression_statement; 8, comment:# Check data; 9, comment:# X = check_array(X, accept_sparse=['csr', 'csc', 'coo']) # Dont in version 0.15; 10, if_statement; 11, comment:# Parallel loop; ...
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; 7, 17; 10, 18; 10, 19; 12, 20; 13, 21; 15, 22; 15, 23; 15, 24; 15, 25; 16, 26; 18, 27; 18, 28; 19, 29; 20, 30; 20, 31; 21, 32; 21, 33; 22, 34; 22, 35; 23, 36; 24, 37; 24, 38; 25, 39; 25, 40; 27, 41; 27, 42; 28, 43; 28...
def predict_proba(self, X): """Predict class probabilities for X. The predicted class probabilities of an input sample is computed as the mean predicted class probabilities of the base estimators in the ensemble. If base estimators do not implement a ``predict_proba`` method, th...
0, module; 1, function_definition; 2, function_name:to_param_dict; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, expression_statement; 8, for_statement; 9, return_statement; 10, comment:""" Sorts to ensure Order is consistent for Testing """; 11, assignment; 12, pattern_list; 13, call; 14, bl...
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; 12, 18; 12, 19; 13, 20; 13, 21; 14, 22; 15, 23; 15, 24; 21, 25; 22, 26; 22, 27; 22, 28; 24, 29; 25, 30; 25, 31; 26, 32; 26, 33; 27, 34; 27, 35; 28, 36; 28, 37; 29, 38; 29, 39; 34, 40; 34, 41; 36, 42; 37, 43; ...
def to_param_dict(self): """ Sorts to ensure Order is consistent for Testing """ param_dict = {} for index, dictionary in enumerate(self.value): for key, value in dictionary.items(): param_name = '{param_name}[{index}][{key}]'.format( ...
0, module; 1, function_definition; 2, function_name:datetimes; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, if_statement; 8, return_statement; 9, comment:"""A sorted list of datetimes in this analysis period."""; 10, comparison_operator:self._timestamps_data is None; 11, block; 12, call; 13,...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 4, 6; 4, 7; 4, 8; 6, 9; 7, 10; 7, 11; 8, 12; 10, 13; 10, 14; 11, 15; 12, 16; 12, 17; 13, 18; 13, 19; 15, 20; 17, 21; 17, 22; 20, 23; 20, 24; 21, 25; 21, 26; 22, 27; 22, 28; 23, 29; 23, 30; 25, 31; 25, 32; 26, 33; 26, 34; 28, 35; 28, 36; 34, 37; 34, 38
def datetimes(self): """A sorted list of datetimes in this analysis period.""" if self._timestamps_data is None: self._calculate_timestamps() return tuple(DateTime.from_moy(moy, self.is_leap_year) for moy in self._timestamps_data)
0, module; 1, function_definition; 2, function_name:hoys; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, if_statement; 8, return_statement; 9, comment:"""A sorted list of hours of year in this analysis period."""; 10, comparison_operator:self._timestamps_data is None; 11, block; 12, call; 13, ...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 4, 6; 4, 7; 4, 8; 6, 9; 7, 10; 7, 11; 8, 12; 10, 13; 10, 14; 11, 15; 12, 16; 12, 17; 13, 18; 13, 19; 15, 20; 17, 21; 17, 22; 20, 23; 20, 24; 21, 25; 21, 26; 22, 27; 22, 28; 23, 29; 23, 30; 28, 31; 28, 32
def hoys(self): """A sorted list of hours of year in this analysis period.""" if self._timestamps_data is None: self._calculate_timestamps() return tuple(moy / 60.0 for moy in self._timestamps_data)
0, module; 1, function_definition; 2, function_name:hoys_int; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, if_statement; 8, return_statement; 9, comment:"""A sorted list of hours of year in this analysis period as integers."""; 10, comparison_operator:self._timestamps_data is None; 11, block...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 4, 6; 4, 7; 4, 8; 6, 9; 7, 10; 7, 11; 8, 12; 10, 13; 10, 14; 11, 15; 12, 16; 12, 17; 13, 18; 13, 19; 15, 20; 17, 21; 17, 22; 20, 23; 20, 24; 21, 25; 21, 26; 22, 27; 22, 28; 23, 29; 23, 30; 26, 31; 28, 32; 28, 33; 31, 34; 31, 35
def hoys_int(self): """A sorted list of hours of year in this analysis period as integers.""" if self._timestamps_data is None: self._calculate_timestamps() return tuple(int(moy / 60.0) for moy in self._timestamps_data)
0, module; 1, function_definition; 2, function_name:doys_int; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, if_statement; 8, comment:"""A sorted list of days of the year in this analysis period as integers."""; 9, not_operator; 10, block; 11, else_clause; 12, attribute; 13, return_statement; ...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 4, 6; 4, 7; 6, 8; 7, 9; 7, 10; 7, 11; 9, 12; 10, 13; 11, 14; 12, 15; 12, 16; 13, 17; 14, 18; 14, 19; 14, 20; 17, 21; 17, 22; 18, 23; 19, 24; 20, 25; 21, 26; 21, 27; 22, 28; 22, 29; 23, 30; 23, 31; 24, 32; 24, 33; 25, 34; 25, 35; 28, 36; 28, 37; 29, 38; 29, 39; 31, 40; 31, 41; 33, 42; 33, 4...
def doys_int(self): """A sorted list of days of the year in this analysis period as integers.""" if not self._is_reversed: return self._calc_daystamps(self.st_time, self.end_time) else: doys_st = self._calc_daystamps(self.st_time, DateTime.from_hoy(8759)) doys...
0, module; 1, function_definition; 2, function_name:months_int; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, if_statement; 8, comment:"""A sorted list of months of the year in this analysis period as integers."""; 9, not_operator; 10, block; 11, else_clause; 12, attribute; 13, return_stateme...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 4, 6; 4, 7; 6, 8; 7, 9; 7, 10; 7, 11; 9, 12; 10, 13; 11, 14; 12, 15; 12, 16; 13, 17; 14, 18; 14, 19; 14, 20; 17, 21; 17, 22; 18, 23; 19, 24; 20, 25; 22, 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; 34, 39; 34, 40; 36, 41; 38, 42; 39, 4...
def months_int(self): """A sorted list of months of the year in this analysis period as integers.""" if not self._is_reversed: return list(xrange(self.st_time.month, self.end_time.month + 1)) else: months_st = list(xrange(self.st_time.month, 13)) months_end = ...
0, module; 1, function_definition; 2, function_name:sorted; 3, parameters; 4, block; 5, identifier:field_name; 6, default_parameter; 7, default_parameter; 8, default_parameter; 9, expression_statement; 10, if_statement; 11, expression_statement; 12, expression_statement; 13, return_statement; 14, identifier:ascending; ...
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; 10, 22; 11, 23; 12, 24; 13, 25; 21, 26; 21, 27; 22, 28; 23, 29; 23, 30; 24, 31; 24, 32; 25, 33; 25, 34; 28, 35; 30, 36; 30, 37; 30, 38; 32, 39; 32, 40; 33, 41; 34, 42; 34, 43; 35, 4...
def sorted(field_name, ascending=True, fields=None, count=5): """Provides a sampling strategy that picks from an ordered set of rows. Args: field_name: the name of the field to sort the rows by. ascending: whether to sort in ascending direction or not. fields: an optional list of field names ...
0, module; 1, function_definition; 2, function_name:_auto; 3, parameters; 4, block; 5, identifier:method; 6, identifier:fields; 7, identifier:count; 8, identifier:percent; 9, identifier:key_field; 10, identifier:ascending; 11, expression_statement; 12, if_statement; 13, comment:"""Construct a sampling function accordin...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 3, 7; 3, 8; 3, 9; 3, 10; 4, 11; 4, 12; 11, 13; 12, 14; 12, 15; 12, 16; 12, 17; 12, 18; 12, 19; 14, 20; 14, 21; 15, 22; 16, 23; 16, 24; 17, 25; 17, 26; 18, 27; 18, 28; 19, 29; 21, 30; 22, 31; 23, 32; 23, 33; 24, 34; 25, 35; 25, 36; 26, 37; 27, 38; 27, 39; 28, 40; 29, 41; 31, 42; 31, 4...
def _auto(method, fields, count, percent, key_field, ascending): """Construct a sampling function according to the provided sampling technique, provided all its needed fields are passed as arguments Args: method: one of the supported sampling methods: {limit,random,hashed,sorted} fields: an opt...
0, module; 1, function_definition; 2, function_name:pair_SAM_alignments; 3, parameters; 4, block; 5, identifier:alignments; 6, default_parameter; 7, default_parameter; 8, expression_statement; 9, expression_statement; 10, function_definition; 11, expression_statement; 12, expression_statement; 13, for_statement; 14, if...
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; 10, 24; 11, 25; 12, 26; 13, 27; 13, 28; 13, 29; 14, 30; 14, 31; 14, 32; 15, 33; 15, 34; 20, 35; 21, 36; 21, 37; 23, 38; 24, 39; 24, 40; 25, 41; 25, 42; 26, 43; 26, 44...
def pair_SAM_alignments( alignments, bundle=False, primary_only=False): '''Iterate over SAM aligments, name-sorted paired-end Args: alignments (iterator of SAM/BAM alignments): the alignments to wrap bundle (bool): if True, bundle all alignments from one read pair into a...
0, module; 1, function_definition; 2, function_name:pair_SAM_alignments_with_buffer; 3, parameters; 4, block; 5, identifier:alignments; 6, default_parameter; 7, default_parameter; 8, expression_statement; 9, expression_statement; 10, expression_statement; 11, for_statement; 12, if_statement; 13, if_statement; 14, ident...
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; 10, 20; 11, 21; 11, 22; 11, 23; 12, 24; 12, 25; 13, 26; 13, 27; 18, 28; 19, 29; 19, 30; 20, 31; 20, 32; 23, 33; 23, 34; 23, 35; 23, 36; 23, 37; 23, 38; 24, 39; 24, 40; 25, 41; 25, 42; 26, 43; 26, ...
def pair_SAM_alignments_with_buffer( alignments, max_buffer_size=30000000, primary_only=False): '''Iterate over SAM aligments with buffer, position-sorted paired-end Args: alignments (iterator of SAM/BAM alignments): the alignments to wrap max_buffer_size (int): maxmal n...
0, module; 1, function_definition; 2, function_name:local_maxima; 3, parameters; 4, block; 5, identifier:vector; 6, default_parameter; 7, default_parameter; 8, expression_statement; 9, expression_statement; 10, for_statement; 11, expression_statement; 12, expression_statement; 13, expression_statement; 14, return_state...
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; 6, 15; 6, 16; 7, 17; 7, 18; 8, 19; 9, 20; 10, 21; 10, 22; 10, 23; 11, 24; 12, 25; 13, 26; 14, 27; 20, 28; 20, 29; 22, 30; 22, 31; 23, 32; 24, 33; 24, 34; 25, 35; 25, 36; 26, 37; 26, 38; 27, 39; 27, 40; 29, 41; 29, 42; 31, 43; 32, 4...
def local_maxima(vector,min_distance = 4, brd_mode = "wrap"): """ Internal finder for local maxima . Returns UNSORTED indices of maxima in input vector. """ fits = gaussian_filter(numpy.asarray(vector,dtype=numpy.float32),1., mode=brd_mode) for ii in range(len(fits)): if fits[ii] == fits...
0, module; 1, function_definition; 2, function_name:local_minima; 3, parameters; 4, block; 5, identifier:vector; 6, default_parameter; 7, default_parameter; 8, expression_statement; 9, expression_statement; 10, for_statement; 11, expression_statement; 12, expression_statement; 13, expression_statement; 14, return_state...
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; 6, 15; 6, 16; 7, 17; 7, 18; 8, 19; 9, 20; 10, 21; 10, 22; 10, 23; 11, 24; 12, 25; 13, 26; 14, 27; 20, 28; 20, 29; 22, 30; 22, 31; 23, 32; 24, 33; 24, 34; 25, 35; 25, 36; 26, 37; 26, 38; 27, 39; 27, 40; 29, 41; 29, 42; 31, 43; 32, 4...
def local_minima(vector,min_distance = 4, brd_mode = "wrap"): """ Internal finder for local minima . Returns UNSORTED indices of minima in input vector. """ fits = gaussian_filter(numpy.asarray(vector,dtype=numpy.float32),1., mode=brd_mode) for ii in range(len(fits)): if fits[ii] == fits...
0, module; 1, function_definition; 2, function_name:find_valley_range; 3, parameters; 4, block; 5, identifier:vector; 6, default_parameter; 7, expression_statement; 8, comment:# http://users.monash.edu.au/~dengs/resource/papers/icme08.pdf; 9, comment:# find min and max with mode = wrap; 10, expression_statement; 11, ex...
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; 6, 16; 6, 17; 7, 18; 10, 19; 11, 20; 12, 21; 13, 22; 13, 23; 14, 24; 14, 25; 14, 26; 15, 27; 19, 28; 19, 29; 20, 30; 20, 31; 21, 32; 21, 33; 22, 34; 22, 35; 23, 36; 24, 37; 24, 38; 25, 39; 25, 40; 26, 41; 27, 42; 27, 43; 27,...
def find_valley_range(vector, min_distance = 4): """ Internal finder peaks and valley ranges. Returns UNSORTED indices of maxima in input vector. Returns range of valleys before and after maximum """ # http://users.monash.edu.au/~dengs/resource/papers/icme08.pdf # find min and max with ...
0, module; 1, function_definition; 2, function_name:sort_snps; 3, parameters; 4, block; 5, identifier:snps; 6, expression_statement; 7, expression_statement; 8, comment:# move PAR and MT to the end of the dataframe; 9, if_statement; 10, if_statement; 11, comment:# convert chrom column to category for sorting; 12, comme...
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; 6, 19; 7, 20; 9, 21; 9, 22; 10, 23; 10, 24; 13, 25; 15, 26; 17, 27; 18, 28; 20, 29; 20, 30; 21, 31; 21, 32; 22, 33; 22, 34; 23, 35; 23, 36; 24, 37; 24, 38; 25, 39; 25, 40; 26, 41; 26, 42; 27, 43; 27, 44;...
def sort_snps(snps): """ Sort SNPs based on ordered chromosome list and position. """ sorted_list = sorted(snps["chrom"].unique(), key=_natural_sort_key) # move PAR and MT to the end of the dataframe if "PAR" in sorted_list: sorted_list.remove("PAR") sorted_list.append("PAR") if "...
0, module; 1, function_definition; 2, function_name:get_genetic_map_HapMapII_GRCh37; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, if_statement; 8, return_statement; 9, comment:""" Get International HapMap Consortium HapMap Phase II genetic map for Build 37. Returns ------- ...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 4, 6; 4, 7; 4, 8; 6, 9; 7, 10; 7, 11; 8, 12; 10, 13; 10, 14; 11, 15; 12, 16; 12, 17; 13, 18; 13, 19; 15, 20; 20, 21; 20, 22; 21, 23; 21, 24; 22, 25; 22, 26; 25, 27; 25, 28; 26, 29; 29, 30; 29, 31; 30, 32; 30, 33
def get_genetic_map_HapMapII_GRCh37(self): """ Get International HapMap Consortium HapMap Phase II genetic map for Build 37. Returns ------- dict dict of pandas.DataFrame HapMapII genetic maps if loading was successful, else None """ if self._genetic_map_HapM...
0, module; 1, function_definition; 2, function_name:seperate_symbols; 3, parameters; 4, block; 5, identifier:func; 6, expression_statement; 7, expression_statement; 8, expression_statement; 9, for_statement; 10, for_statement; 11, expression_statement; 12, expression_statement; 13, return_statement; 14, comment:""" ...
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; 8, 16; 9, 17; 9, 18; 9, 19; 10, 20; 10, 21; 10, 22; 10, 23; 10, 24; 10, 25; 10, 26; 10, 27; 11, 28; 12, 29; 13, 30; 15, 31; 15, 32; 16, 33; 16, 34; 18, 35; 18, 36; 19, 37; 19, 38; 21, 39; 21, 40; 27, 41; 28, 42; 28, 43; 29, ...
def seperate_symbols(func): """ Seperate the symbols in symbolic function func. Return them in alphabetical order. :param func: scipy symbolic function. :return: (vars, params), a tuple of all variables and parameters, each sorted in alphabetical order. :raises TypeError: only symfit V...
0, module; 1, function_definition; 2, function_name:name; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, expression_statement; 8, for_statement; 9, return_statement; 10, comment:""" Save name which can be used for alphabetic sorting and can be turned into a kwarg. """; 11, assignme...
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; 12, 18; 12, 19; 13, 20; 13, 21; 14, 22; 17, 23; 17, 24; 22, 25; 23, 26; 23, 27; 24, 28; 24, 29; 25, 30; 25, 31; 26, 32; 28, 33; 28, 34; 28, 35; 29, 36; 29, 37; 31, 38; 31, 39; 33, 40; 33, 41; 34, 42; 34, 43; ...
def name(self): """ Save name which can be used for alphabetic sorting and can be turned into a kwarg. """ base_str = 'd{}{}_'.format(self.derivative_count if self.derivative_count > 1 else '', self.expr) for var, count in self.variable_count: base_str += '...
0, module; 1, function_definition; 2, function_name:_init_from_dict; 3, parameters; 4, block; 5, identifier:self; 6, identifier:model_dict; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, comment:# Everything at the bottom of the toposort is independent, at the top; 11, comment:# dependen...
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; 7, 22; 8, 23; 9, 24; 12, 25; 13, 26; 14, 27; 15, 28; 17, 29; 18, 30; 19, 31; 19, 32; 21, 33; 23, 34; 23, 35; 24, 36; 24, 37; 25, 38; 25, 39; 26, 40; 26, 41; 27, 42; 27, 43; 28, 44; 2...
def _init_from_dict(self, model_dict): """ Initiate self from a model_dict to make sure attributes such as vars, params are available. Creates lists of alphabetically sorted independent vars, dependent vars, sigma vars, and parameters. Finally it creates a signature for this model so it...
0, module; 1, function_definition; 2, function_name:function_dict; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, expression_statement; 8, for_statement; 9, return_statement; 10, comment:""" Equivalent to ``self.model_dict``, but with all variables replaced by functions if appl...
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; 12, 18; 12, 19; 13, 20; 13, 21; 14, 22; 14, 23; 17, 24; 17, 25; 20, 26; 20, 27; 22, 28; 23, 29; 26, 30; 26, 31; 28, 32; 28, 33; 29, 34; 29, 35; 33, 36; 33, 37; 34, 38; 34, 39; 36, 40; 36, 41; 37, 42; 40, 43; ...
def function_dict(self): """ Equivalent to ``self.model_dict``, but with all variables replaced by functions if applicable. Sorted by the evaluation order according to ``self.ordered_symbols``, not alphabetical like ``self.model_dict``! """ func_dict = OrderedDict() ...
0, module; 1, function_definition; 2, function_name:flatten_; 3, parameters; 4, block; 5, identifier:structure; 6, expression_statement; 7, if_statement; 8, if_statement; 9, return_statement; 10, comment:"""Combine all leaves of a nested structure into a tuple. The nested structure can consist of any combination of ...
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; 9, 15; 11, 16; 11, 17; 12, 18; 13, 19; 13, 20; 14, 21; 14, 22; 14, 23; 15, 24; 17, 25; 17, 26; 18, 27; 18, 28; 18, 29; 20, 30; 20, 31; 21, 32; 22, 33; 22, 34; 22, 35; 23, 36; 28, 37; 29, 38; 29, 39; 31, 40; 31, 41; 32, 42; 32, 43; ...
def flatten_(structure): """Combine all leaves of a nested structure into a tuple. The nested structure can consist of any combination of tuples, lists, and dicts. Dictionary keys will be discarded but values will ordered by the sorting of the keys. Args: structure: Nested structure. Returns: Fla...
0, module; 1, function_definition; 2, function_name:set_python; 3, parameters; 4, block; 5, identifier:self; 6, identifier:value; 7, expression_statement; 8, if_statement; 9, expression_statement; 10, expression_statement; 11, for_statement; 12, expression_statement; 13, expression_statement; 14, return_statement; 15, ...
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; 8, 17; 9, 18; 10, 19; 11, 20; 11, 21; 11, 22; 12, 23; 13, 24; 14, 25; 16, 26; 17, 27; 18, 28; 18, 29; 19, 30; 19, 31; 22, 32; 22, 33; 23, 34; 23, 35; 24, 36; 24, 37; 26, 38; 26, 39; 27, 40; 27, 41; 29, 42; 29, 43; 31,...
def set_python(self, value): """Expect list of record instances, convert to a SortedDict for internal representation""" if not self.multiselect: if value and not isinstance(value, list): value = [value] value = value or [] records = SortedDict() for...
0, module; 1, function_definition; 2, function_name:get_filetypes; 3, parameters; 4, block; 5, identifier:filelist; 6, default_parameter; 7, default_parameter; 8, expression_statement; 9, expression_statement; 10, comment:# Get total size for each file extension; 11, expression_statement; 12, for_statement; 13, comment...
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; 6, 17; 6, 18; 7, 19; 7, 20; 8, 21; 9, 22; 11, 23; 12, 24; 12, 25; 12, 26; 14, 27; 15, 28; 15, 29; 16, 30; 20, 31; 20, 32; 22, 33; 22, 34; 23, 35; 23, 36; 26, 37; 26, 38; 26, 39; 27, 40; 27, 41; 29, 42; 30, 43; 30, 44;...
def get_filetypes(filelist, path=None, size=os.path.getsize): """ Get a sorted list of file types and their weight in percent from an iterable of file names. @return: List of weighted file extensions (no '.'), sorted in descending order @rtype: list of (weight, filetype) """ path = ...
0, module; 1, function_definition; 2, function_name:validate_sort_fields; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, expression_statement; 8, if_statement; 9, return_statement; 10, comment:""" Take care of sorting. """; 11, assignment; 12, comparison_operator:sort_fields == '*'; 13...
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; 9, 14; 11, 15; 11, 16; 12, 17; 12, 18; 13, 19; 14, 20; 14, 21; 16, 22; 16, 23; 18, 24; 19, 25; 20, 26; 20, 27; 21, 28; 22, 29; 22, 30; 23, 31; 25, 32; 25, 33; 28, 34; 28, 35; 29, 36; 31, 37; 31, 38; 33, 39; 33, 40; 35, 41; 35, 42; 37, 43;...
def validate_sort_fields(self): """ Take care of sorting. """ sort_fields = ','.join(self.options.sort_fields) if sort_fields == '*': sort_fields = self.get_output_fields() return formatting.validate_sort_fields(sort_fields or config.sort_fields)
0, module; 1, function_definition; 2, function_name:validate_sort_fields; 3, parameters; 4, block; 5, identifier:sort_fields; 6, expression_statement; 7, comment:# Allow descending order per field by prefixing with '-'; 8, expression_statement; 9, function_definition; 10, comment:# Split and validate field list; 11, ex...
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; 8, 19; 9, 20; 9, 21; 9, 22; 11, 23; 12, 24; 14, 25; 14, 26; 16, 27; 16, 28; 16, 29; 17, 30; 19, 31; 19, 32; 21, 33; 22, 34; 22, 35; 22, 36; 23, 37; 23, 38; 24, 39; 24, 40; 25, 41; 26, 42; 28, 43; 29, 44;...
def validate_sort_fields(sort_fields): """ Make sure the fields in the given list exist, and return sorting key. If field names are prefixed with '-', sort order is reversed for that field (descending). """ # Allow descending order per field by prefixing with '-' descending = set() def sort...
0, module; 1, function_definition; 2, function_name:load_data_source; 3, parameters; 4, block; 5, identifier:local_path; 6, identifier:remote_source_list; 7, identifier:open_method; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, expression_statement; 12, try_statement; 13, return_statement; 14, ...
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; 8, 14; 8, 15; 9, 16; 9, 17; 10, 18; 10, 19; 11, 20; 12, 21; 12, 22; 12, 23; 13, 24; 15, 25; 15, 26; 17, 27; 17, 28; 20, 29; 21, 30; 21, 31; 21, 32; 23, 33; 23, 34; 23, 35; 23, 36; 24, 37; 24, 38; 30, 39; 31, 40; 32, 41; 32, 42; 36, 43; 39...
def load_data_source(local_path, remote_source_list, open_method, open_method_kwargs=dict(), remote_kwargs=dict(), verbose=True): '''Flexible data retreiver to download and cache the data files locally. Usage example (this makes a local...
0, module; 1, function_definition; 2, function_name:grouped_mean; 3, parameters; 4, block; 5, identifier:arr; 6, identifier:spike_clusters; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, assert_statement; 11, assert_statement; 12, expression_statement; 13, expression_statement; 14, expre...
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; 7, 20; 8, 21; 9, 22; 10, 23; 11, 24; 12, 25; 13, 26; 14, 27; 15, 28; 16, 29; 18, 30; 19, 31; 21, 32; 21, 33; 22, 34; 22, 35; 23, 36; 23, 37; 24, 38; 24, 39; 25, 40; 25, 41; 26, 42; 26, 43; 27, 44;...
def grouped_mean(arr, spike_clusters): """Compute the mean of a spike-dependent quantity for every cluster. The two arguments should be 1D array with `n_spikes` elements. The output is a 1D array with `n_clusters` elements. The clusters are sorted in increasing order. """ arr = np.asarray(arr...
0, module; 1, function_definition; 2, function_name:sort_by; 3, parameters; 4, block; 5, identifier:self; 6, identifier:name; 7, default_parameter; 8, expression_statement; 9, expression_statement; 10, expression_statement; 11, identifier:sort_dir; 12, string; 13, comment:"""Sort by a given variable."""; 14, call; 15, ...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 3, 7; 4, 8; 4, 9; 4, 10; 7, 11; 7, 12; 8, 13; 9, 14; 10, 15; 12, 16; 14, 17; 14, 18; 15, 19; 15, 20; 17, 21; 17, 22; 18, 23; 18, 24; 18, 25; 18, 26; 19, 27; 19, 28; 20, 29; 29, 30; 29, 31; 30, 32; 30, 33; 31, 34; 31, 35
def sort_by(self, name, sort_dir='asc'): """Sort by a given variable.""" logger.log(5, "Sort by `%s` %s.", name, sort_dir) self.eval_js('table.sortBy("{}", "{}");'.format(name, sort_dir))
0, module; 1, function_definition; 2, function_name:find_column; 3, parameters; 4, block; 5, identifier:self; 6, identifier:search; 7, default_parameter; 8, expression_statement; 9, if_statement; 10, expression_statement; 11, for_statement; 12, return_statement; 13, identifier:data_type; 14, None; 15, comment:""" ...
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; 7, 14; 8, 15; 9, 16; 9, 17; 10, 18; 11, 19; 11, 20; 11, 21; 12, 22; 16, 23; 16, 24; 17, 25; 18, 26; 18, 27; 20, 28; 20, 29; 21, 30; 22, 31; 22, 32; 24, 33; 24, 34; 25, 35; 30, 36; 30, 37; 30, 38; 32, 39; 35, 40; 35, 41; 37, 42; 37, 43; 38...
def find_column(self, search, data_type=None): """ Aggresively search through your database's schema for a column. Parameters ----------- search: str glob pattern for what you're looking for data_type: str, list (optional) specify which data type(s)...
0, module; 1, function_definition; 2, function_name:to_linear; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, expression_statement; 8, if_statement; 9, expression_statement; 10, return_statement; 11, identifier:index; 12, None; 13, comment:""" Transforms the StepColormap into a LinearColo...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 4, 7; 4, 8; 4, 9; 4, 10; 6, 11; 6, 12; 7, 13; 8, 14; 8, 15; 9, 16; 10, 17; 14, 18; 14, 19; 15, 20; 15, 21; 16, 22; 16, 23; 17, 24; 17, 25; 20, 26; 21, 27; 23, 28; 23, 29; 25, 30; 25, 31; 25, 32; 25, 33; 26, 34; 26, 35; 27, 36; 27, 37; 28, 38; 28, 39; 29, 40; 29, 41; 31, 42; 31, 43; 3...
def to_linear(self, index=None): """ Transforms the StepColormap into a LinearColormap. Parameters ---------- index : list of floats, default None The values corresponding to each color in the output colormap. It has to be sorted. ...
0, module; 1, function_definition; 2, function_name:regex_opt_inner; 3, parameters; 4, block; 5, identifier:strings; 6, identifier:open_paren; 7, expression_statement; 8, expression_statement; 9, comment:# print strings, repr(open_paren); 10, if_statement; 11, expression_statement; 12, if_statement; 13, if_statement; 1...
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; 7, 24; 8, 25; 10, 26; 10, 27; 10, 28; 11, 29; 12, 30; 12, 31; 12, 32; 13, 33; 13, 34; 13, 35; 14, 36; 14, 37; 14, 38; 15, 39; 16, 40; 16, 41; 18, 42; 19, 43; 20, 44; 20...
def regex_opt_inner(strings, open_paren): """Return a regex that matches any string in the sorted list of strings.""" close_paren = open_paren and ')' or '' # print strings, repr(open_paren) if not strings: # print '-> nothing left' return '' first = strings[0] if len(strings) ==...
0, module; 1, function_definition; 2, function_name:get_substitutions_from_config; 3, parameters; 4, block; 5, identifier:config; 6, expression_statement; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, for_statement; 11, return_statement; 12, comment:""" Return a list of Substitution...
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; 18, 27; 18, 28; 18, 29; 23, 30; 23, 31; 24, 32; 24, 33; 26, 34; 27, 35; 28, 36; 29, 37; 30, 38; 30, 39; 31, 40; 34, 41; 34, 42; 35, 43; ...
def get_substitutions_from_config(config): """ Return a list of Substitution objects from the config, sorted alphabetically by pattern name. Returns an empty list if no Substitutions are specified. If there are problems parsing the values, a help message will be printed and an error will be thrown. ...
0, module; 1, function_definition; 2, function_name:next_sibling; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, if_statement; 8, return_statement; 9, comment:""" Returns the next sibling of the current node. The next sibling is searched in the parent node if we are not considering a ...
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; 10, 14; 10, 15; 11, 16; 11, 17; 11, 18; 12, 19; 16, 20; 17, 21; 18, 22; 19, 23; 19, 24; 19, 25; 20, 26; 20, 27; 21, 28; 21, 29; 22, 30; 22, 31; 23, 32; 24, 33; 25, 34; 27, 35; 27, 36; 29, 37; 29, 38; 31, 39; 31, 40; 31, 41; 32, 42; 32, 43...
def next_sibling(self): """ Returns the next sibling of the current node. The next sibling is searched in the parent node if we are not considering a top-level node. Otherwise it is searched inside the list of nodes (which should be sorted by tree ID) that is associated with the conside...
0, module; 1, function_definition; 2, function_name:previous_sibling; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, if_statement; 8, return_statement; 9, comment:""" Returns the previous sibling of the current node. The previous sibling is searched in the parent node if we are not co...
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; 10, 14; 10, 15; 11, 16; 11, 17; 11, 18; 12, 19; 16, 20; 17, 21; 18, 22; 19, 23; 19, 24; 19, 25; 20, 26; 20, 27; 21, 28; 21, 29; 22, 30; 22, 31; 23, 32; 24, 33; 25, 34; 27, 35; 27, 36; 29, 37; 29, 38; 31, 39; 31, 40; 31, 41; 32, 42; 32, 43...
def previous_sibling(self): """ Returns the previous sibling of the current node. The previous sibling is searched in the parent node if we are not considering a top-level node. Otherwise it is searched inside the list of nodes (which should be sorted by tree ID) that is associated with...
0, module; 1, function_definition; 2, function_name:delay_or_run; 3, parameters; 4, block; 5, identifier:self; 6, list_splat_pattern; 7, dictionary_splat_pattern; 8, expression_statement; 9, expression_statement; 10, expression_statement; 11, try_statement; 12, return_statement; 13, identifier:args; 14, identifier:kwar...
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; 7, 14; 8, 15; 9, 16; 10, 17; 11, 18; 11, 19; 12, 20; 16, 21; 16, 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; 24, 35; 24, 36; 25, 37; 26, 38; 28, 39; 28, 40; 35, 41; 35, 42; 37, 43; 3...
def delay_or_run(self, *args, **kwargs): """ Attempt to call self.delay, or if that fails, call self.run. Returns a tuple, (result, required_fallback). ``result`` is the result of calling delay or run. ``required_fallback`` is True if the broker failed we had to resort to `self....
0, module; 1, function_definition; 2, function_name:arrange; 3, parameters; 4, block; 5, list_splat_pattern; 6, expression_statement; 7, expression_statement; 8, function_definition; 9, return_statement; 10, identifier:args; 11, comment:"""Sort DataFrame by the input column arguments. >>> diamonds >> sample_n(5) >> ...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 4, 6; 4, 7; 4, 8; 4, 9; 5, 10; 6, 11; 7, 12; 8, 13; 8, 14; 8, 15; 9, 16; 12, 17; 12, 18; 14, 19; 15, 20; 15, 21; 15, 22; 18, 23; 18, 24; 20, 25; 21, 26; 22, 27; 23, 28; 23, 29; 24, 30; 24, 31; 25, 32; 25, 33; 26, 34; 26, 35; 27, 36; 27, 37; 33, 38; 33, 39; 35, 40; 35, 41; 36, 42; 36, 43; 3...
def arrange(*args): """Sort DataFrame by the input column arguments. >>> diamonds >> sample_n(5) >> arrange(X.price) >> select(X.depth, X.price) Out: depth price 28547 61.0 675 35132 59.1 889 42526 61.3 1323 3468 61.6 3392 23829 62.0 11903 """ names = [column._name f...
0, module; 1, function_definition; 2, function_name:filenames; 3, parameters; 4, block; 5, identifier:directory; 6, default_parameter; 7, default_parameter; 8, default_parameter; 9, expression_statement; 10, if_statement; 11, if_statement; 12, return_statement; 13, identifier:tag; 14, string; 15, identifier:sorted; 16,...
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; 10, 21; 10, 22; 11, 23; 11, 24; 12, 25; 21, 26; 22, 27; 24, 28; 26, 29; 27, 30; 28, 31; 29, 32; 29, 33; 30, 34; 31, 35; 31, 36; 33, 37; 33, 38; 33, 39; 33, 40; 34, 41; 34, 42; 35, 43; 35, ...
def filenames(directory, tag='', sorted=False, recursive=False): """ Reads in all filenames from a directory that contain a specified substring. Parameters ---------- directory : :obj:`str` the directory to read from tag : :obj:`str` optional tag to match in the filenames sorted...
0, module; 1, function_definition; 2, function_name:get_iterargs; 3, parameters; 4, block; 5, identifier:self; 6, identifier:item; 7, expression_statement; 8, comment:# iterargs should always be mandatory, unless there's a good reason; 9, comment:# not to, which I can't think of right now.; 10, expression_statement; 11...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 4, 7; 4, 8; 4, 9; 4, 10; 4, 11; 7, 12; 10, 13; 11, 14; 13, 15; 13, 16; 14, 17; 14, 18; 16, 19; 16, 20; 18, 21; 19, 22; 19, 23; 20, 24; 20, 25; 21, 26; 21, 27; 25, 28; 27, 29; 29, 30; 29, 31; 29, 32; 31, 33; 31, 34; 32, 35; 35, 36; 35, 37; 37, 38; 37, 39
def get_iterargs(self, item): """ Returns a tuple of all iterags for item, sorted by name.""" # iterargs should always be mandatory, unless there's a good reason # not to, which I can't think of right now. args = self._get_aggregate_args(item, 'mandatoryArgs') return tuple(sorted([arg for arg in ar...
0, module; 1, function_definition; 2, function_name:merge_dict; 3, parameters; 4, block; 5, identifier:a; 6, identifier:b; 7, expression_statement; 8, if_statement; 9, expression_statement; 10, for_statement; 11, return_statement; 12, comment:""" Recursively merges and returns dict a with dict b. Any list value...
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; 10, 16; 10, 17; 10, 18; 11, 19; 13, 20; 14, 21; 15, 22; 15, 23; 16, 24; 16, 25; 17, 26; 17, 27; 18, 28; 20, 29; 20, 30; 21, 31; 23, 32; 23, 33; 26, 34; 26, 35; 27, 36; 28, 37; 28, 38; 28, 39; 28, 40; 30, 41; 30, 42; 33, 43; ...
def merge_dict(a, b): """ Recursively merges and returns dict a with dict b. Any list values will be combined and returned sorted. :param a: dictionary object :param b: dictionary object :return: merged dictionary object """ if not isinstance(b, dict): return b result = de...
0, module; 1, function_definition; 2, function_name:posthoc_mannwhitney; 3, parameters; 4, block; 5, identifier:a; 6, default_parameter; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, default_parameter; 12, expression_statement; 13, expression_statement; 14, if_statement; 1...
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; 4, 21; 4, 22; 4, 23; 4, 24; 4, 25; 4, 26; 4, 27; 6, 28; 6, 29; 7, 30; 7, 31; 8, 32; 8, 33; 9, 34; 9, 35; 10, 36; 10, 37; 11, 38; 11, 39; 12, 40; 13, 41; 14, 42; 14, 43; 15, 44; 16, 45; 17, ...
def posthoc_mannwhitney(a, val_col=None, group_col=None, use_continuity=True, alternative='two-sided', p_adjust=None, sort=True): '''Pairwise comparisons with Mann-Whitney rank test. Parameters ---------- a : array_like or pandas DataFrame object An array, any object exposing the array interfa...
0, module; 1, function_definition; 2, function_name:posthoc_wilcoxon; 3, parameters; 4, block; 5, identifier:a; 6, default_parameter; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, default_parameter; 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; 3, 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; 6, 28; 6, 29; 7, 30; 7, 31; 8, 32; 8, 33; 9, 34; 9, 35; 10, 36; 10, 37; 11, 38; 11, 39; 12, 40; 13, 41; 14, 42; 14, 43; 16, 44; 17, 45; 18, ...
def posthoc_wilcoxon(a, val_col=None, group_col=None, zero_method='wilcox', correction=False, p_adjust=None, sort=False): '''Pairwise comparisons with Wilcoxon signed-rank test. It is a non-parametric version of the paired T-test for use with non-parametric ANOVA. Parameters ---------- a : array_l...
0, module; 1, function_definition; 2, function_name:calendarplot; 3, parameters; 4, block; 5, identifier:data; 6, default_parameter; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, default_parameter; 12, default_parameter; 13, dictionary_splat_pattern; 14, expression_stateme...
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; 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; 4, 34; 6, 35; 6, 36; 7, 37; 7, 38; 8, 39; 8, 40; 9, 41; 9, 42; 10, 43; 10, 44; 11, 45; 11, 46; 12,...
def calendarplot(data, how='sum', yearlabels=True, yearascending=True, yearlabel_kws=None, subplot_kws=None, gridspec_kws=None, fig_kws=None, **kwargs): """ Plot a timeseries as a calendar heatmap. Parameters ---------- data : Series Data for the plot. Must be indexed by a ...
0, module; 1, function_definition; 2, function_name:tasks; 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, expression_statement; 15, expres...
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; 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; 11, 28; 12, 29; 12, 30; 13, 31; 13, 32; 14, 33; 15, 34; 16, 35; 16, 36; 16, 37; 34, 38; 34, 39; 36, 40; 36, 41; 37, 42; 39, 43; 39, 44; 4...
def tasks(self, pattern=None, negate=False, state=None, limit=None, reverse=True, params=None, success=False, error=True): """Filters stored tasks and displays their current statuses. Note that, to be able to list the tasks sorted chronologically, celery retrieves tasks from the L...
0, module; 1, function_definition; 2, function_name:echo_headers; 3, parameters; 4, block; 5, identifier:headers; 6, default_parameter; 7, expression_statement; 8, for_statement; 9, expression_statement; 10, identifier:file; 11, None; 12, comment:"""Echo headers, sorted."""; 13, pattern_list; 14, call; 15, block; 16, c...
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; 8, 14; 8, 15; 9, 16; 13, 17; 13, 18; 14, 19; 14, 20; 15, 21; 16, 22; 16, 23; 20, 24; 21, 25; 22, 26; 22, 27; 23, 28; 24, 29; 24, 30; 25, 31; 25, 32; 28, 33; 28, 34; 29, 35; 29, 36; 31, 37; 31, 38; 32, 39; 32, 40; 39, 41; 39, 42; 40, 43; 4...
def echo_headers(headers, file=None): """Echo headers, sorted.""" for k, v in sorted(headers.items()): click.echo("{0}: {1}".format(k.title(), v), file=file) click.echo(file=file)
0, module; 1, function_definition; 2, function_name:by_own_time_per_call; 3, parameters; 4, block; 5, identifier:stat; 6, expression_statement; 7, return_statement; 8, comment:"""Sorting by exclusive elapsed time per call in descending order."""; 9, tuple; 10, conditional_expression:-stat.own_time_per_call if stat.own_...
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; 10, 14; 11, 15; 11, 16; 12, 17; 13, 18; 13, 19; 14, 20; 16, 21; 17, 22; 17, 23; 20, 24; 20, 25
def by_own_time_per_call(stat): """Sorting by exclusive elapsed time per call in descending order.""" return (-stat.own_time_per_call if stat.own_hits else -stat.own_time, by_deep_time_per_call(stat))
0, module; 1, function_definition; 2, function_name:missing_labels; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, return_statement; 8, comment:""" A 1D `~numpy.ndarray` of the sorted non-zero labels that are missing in the consecutive sequence from zero to the maximum ...
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; 16, 17; 17, 18; 17, 19; 18, 20; 18, 21; 19, 22; 20, 23; 20, 24; 22, 25; 22, 26; 24, 27; 25, 28; 25, 29; 26, 30; 26, 31; 26, 32; 27, 33; 27, 34; 30, 35; 30, 36; 34, 37; 34, 38; 38, 39; 38, 40; 39, 41; 39, 42
def missing_labels(self): """ A 1D `~numpy.ndarray` of the sorted non-zero labels that are missing in the consecutive sequence from zero to the maximum label number. """ return np.array(sorted(set(range(0, self.max_label + 1)). difference(n...
0, module; 1, function_definition; 2, function_name:fit_image; 3, parameters; 4, comment:# This parameter list is quite large and should in principle be; 5, comment:# simplified by re-distributing these controls to somewhere else.; 6, comment:# We keep this design though because it better mimics the flat; 7, comment:# ...
0, 1; 1, 2; 1, 3; 1, 4; 1, 5; 1, 6; 1, 7; 1, 8; 3, 9; 3, 10; 3, 11; 3, 12; 3, 13; 3, 14; 3, 15; 3, 16; 3, 17; 3, 18; 3, 19; 3, 20; 3, 21; 3, 22; 3, 23; 8, 24; 8, 25; 8, 26; 8, 27; 8, 28; 8, 29; 8, 30; 8, 31; 8, 32; 8, 33; 8, 34; 8, 35; 8, 36; 8, 37; 8, 38; 8, 39; 8, 40; 8, 41; 8, 42; 8, 43; 8, 44; 10, 45; 10, 46; 11, 4...
def fit_image(self, sma0=None, minsma=0., maxsma=None, step=0.1, conver=DEFAULT_CONVERGENCE, minit=DEFAULT_MINIT, maxit=DEFAULT_MAXIT, fflag=DEFAULT_FFLAG, maxgerr=DEFAULT_MAXGERR, sclip=3., nclip=0, integrmode=BILINEAR, linear=False, maxrit=None):...
0, module; 1, function_definition; 2, function_name:sort; 3, parameters; 4, block; 5, identifier:self; 6, identifier:values; 7, expression_statement; 8, for_statement; 9, comment:"""Sort the values in-place based on the connectors in the network."""; 10, identifier:level; 11, identifier:self; 12, block; 13, for_stateme...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 4, 7; 4, 8; 7, 9; 8, 10; 8, 11; 8, 12; 12, 13; 13, 14; 13, 15; 13, 16; 14, 17; 14, 18; 16, 19; 19, 20; 19, 21; 20, 22; 20, 23; 21, 24; 22, 25; 22, 26; 23, 27; 23, 28; 24, 29; 29, 30; 29, 31; 30, 32; 30, 33; 31, 34; 31, 35; 32, 36; 32, 37; 33, 38; 33, 39; 34, 40; 34, 41; 35, 42; 35, 4...
def sort(self, values): """Sort the values in-place based on the connectors in the network.""" for level in self: for wire1, wire2 in level: if values[wire1] > values[wire2]: values[wire1], values[wire2] = values[wire2], values[wire1]
0, module; 1, function_definition; 2, function_name:getWorkersName; 3, parameters; 4, block; 5, identifier:data; 6, expression_statement; 7, expression_statement; 8, expression_statement; 9, try_statement; 10, return_statement; 11, comment:"""Returns the list of the names of the workers sorted alphabetically"""; 12, as...
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; 10, 16; 12, 17; 12, 18; 13, 19; 13, 20; 14, 21; 15, 22; 15, 23; 18, 24; 18, 25; 19, 26; 19, 27; 21, 28; 23, 29; 25, 30; 25, 31; 28, 32; 28, 33; 31, 34; 31, 35; 32, 36; 32, 37; 33, 38; 34, 39; 34, 40
def getWorkersName(data): """Returns the list of the names of the workers sorted alphabetically""" names = [fichier for fichier in data.keys()] names.sort() try: names.remove("broker") except ValueError: pass return names
0, module; 1, function_definition; 2, function_name:parse_commit_message; 3, parameters; 4, type; 5, block; 6, typed_parameter; 7, generic_type; 8, expression_statement; 9, expression_statement; 10, if_statement; 11, expression_statement; 12, if_statement; 13, if_statement; 14, expression_statement; 15, return_statemen...
0, 1; 1, 2; 1, 3; 1, 4; 1, 5; 3, 6; 4, 7; 5, 8; 5, 9; 5, 10; 5, 11; 5, 12; 5, 13; 5, 14; 5, 15; 6, 16; 6, 17; 7, 18; 7, 19; 8, 20; 9, 21; 10, 22; 10, 23; 11, 24; 12, 25; 12, 26; 12, 27; 12, 28; 13, 29; 13, 30; 14, 31; 15, 32; 17, 33; 19, 34; 19, 35; 19, 36; 19, 37; 21, 38; 21, 39; 22, 40; 23, 41; 24, 42; 24, 43; 25, 44...
def parse_commit_message(message: str) -> Tuple[int, str, Optional[str], Tuple[str, str, str]]: """ Parses a commit message according to the 1.0 version of python-semantic-release. It expects a tag of some sort in the commit message and will use the rest of the first line as changelog content. :par...
0, module; 1, function_definition; 2, function_name:todos; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, expression_statement; 8, return_statement; 9, comment:""" Returns a sorted and filtered list of todos in this view. """; 10, assignment; 11, call; 12, identifier:result; 13, call; 14, attr...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 4, 6; 4, 7; 4, 8; 6, 9; 7, 10; 8, 11; 10, 12; 10, 13; 11, 14; 11, 15; 13, 16; 13, 17; 14, 18; 14, 19; 15, 20; 16, 21; 16, 22; 17, 23; 21, 24; 21, 25; 23, 26; 23, 27; 26, 28; 26, 29; 28, 30; 28, 31
def todos(self): """ Returns a sorted and filtered list of todos in this view. """ result = self._sorter.sort(self.todolist.todos()) return self._apply_filters(result)
0, module; 1, function_definition; 2, function_name:group; 3, parameters; 4, block; 5, identifier:self; 6, identifier:p_todos; 7, expression_statement; 8, comment:# preorder todos for the group sort; 9, expression_statement; 10, comment:# initialize result with a single group; 11, expression_statement; 12, for_statemen...
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; 9, 17; 11, 18; 12, 19; 12, 20; 12, 21; 14, 22; 14, 23; 14, 24; 15, 25; 17, 26; 17, 27; 18, 28; 18, 29; 19, 30; 19, 31; 20, 32; 20, 33; 21, 34; 21, 35; 21, 36; 22, 37; 22, 38; 23, 39; 23, 40; 24, 41; 27, 42; 27, 43; 29...
def group(self, p_todos): """ Groups the todos according to the given group string. """ # preorder todos for the group sort p_todos = _apply_sort_functions(p_todos, self.pregroupfunctions) # initialize result with a single group result = OrderedDict([((), p_todos...
0, module; 1, function_definition; 2, function_name:process_other_set; 3, parameters; 4, block; 5, identifier:hdf5_file; 6, identifier:which_set; 7, identifier:image_archive; 8, identifier:patch_archive; 9, identifier:groundtruth; 10, identifier:offset; 11, expression_statement; 12, expression_statement; 13, expression...
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; 11, 15; 12, 16; 13, 17; 14, 18; 16, 19; 16, 20; 17, 21; 17, 22; 18, 23; 18, 24; 20, 25; 20, 26; 22, 27; 22, 28; 24, 29; 24, 30; 26, 31; 26, 32; 26, 33; 26, 34; 26, 35; 28, 36; 28, 37; 28, 38; 28, 39; 32, 40; 32, 41; 33, 42; 33, 43;...
def process_other_set(hdf5_file, which_set, image_archive, patch_archive, groundtruth, offset): """Process the validation or test set. Parameters ---------- hdf5_file : :class:`h5py.File` instance HDF5 file handle to which to write. Assumes `features`, `targets` an...
0, module; 1, function_definition; 2, function_name:sorted_fancy_indexing; 3, parameters; 4, block; 5, identifier:indexable; 6, identifier:request; 7, expression_statement; 8, if_statement; 9, return_statement; 10, comment:"""Safe fancy indexing. Some objects, such as h5py datasets, only support list indexing ...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 4, 7; 4, 8; 4, 9; 7, 10; 8, 11; 8, 12; 8, 13; 9, 14; 11, 15; 11, 16; 12, 17; 12, 18; 12, 19; 13, 20; 15, 21; 15, 22; 17, 23; 18, 24; 19, 25; 20, 26; 22, 27; 23, 28; 23, 29; 24, 30; 24, 31; 25, 32; 25, 33; 26, 34; 29, 35; 29, 36; 31, 37; 31, 38; 32, 39; 32, 40; 33, 41; 33, 42; 33, 43;...
def sorted_fancy_indexing(indexable, request): """Safe fancy indexing. Some objects, such as h5py datasets, only support list indexing if the list is sorted. This static method adds support for unsorted list indexing by sorting the requested indices, accessing the corresponding...
0, module; 1, function_definition; 2, function_name:index_within_subset; 3, parameters; 4, block; 5, identifier:self; 6, identifier:indexable; 7, identifier:subset_request; 8, default_parameter; 9, expression_statement; 10, comment:# Translate the request within the context of this subset to a; 11, comment:# request to...
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; 8, 24; 8, 25; 9, 26; 12, 27; 12, 28; 12, 29; 14, 30; 14, 31; 17, 32; 17, 33; 20, 34; 20, 35; 23, 36; 27, 37; 27, 38; 28, 39; 29, 40; 30, 41; 30, 42; 31, 43; 33, 44; 34,...
def index_within_subset(self, indexable, subset_request, sort_indices=False): """Index an indexable object within the context of this subset. Parameters ---------- indexable : indexable object The object to index through. subset_request : ...
0, module; 1, function_definition; 2, function_name:degree_circle; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, default_parameter; 8, default_parameter; 9, line_continuation:\; 10, default_parameter; 11, default_parameter; 12, default_parameter; 13, expression_statement; 14, expression_statemen...
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; 10, 24; 10, 25; 11, 26; 11, 27; 12, 28; 12, 29; 13, 30; 14, 31; 15, 32; 16, 33; 17, 34; 31, 35; 31, 36; 32, 37; 32, 38; 33, 39; 33, 40; 36, 41; 36, 42; 38, 43; 38, 44; ...
def degree_circle(self,EdgeAttribute=None,network=None,NodeAttribute=None,\ nodeList=None,singlePartition=None,verbose=None): """ Execute the Degree Sorted Circle Layout on a network. :param EdgeAttribute (string, optional): The name of the edge column contai ning numeric values that will be used as weights...
0, module; 1, function_definition; 2, function_name:import_url; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, line_continuation:\; 8, default_parameter; 9, default_parameter; 10, line_continuation:\; 11, default_parameter; 12, default_parameter; 13, line_continuation:\; 14, default_parameter; 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; 3, 13; 3, 14; 3, 15; 3, 16; 3, 17; 3, 18; 3, 19; 3, 20; 3, 21; 3, 22; 3, 23; 3, 24; 3, 25; 3, 26; 3, 27; 3, 28; 3, 29; 3, 30; 4, 31; 4, 32; 4, 33; 4, 34; 6, 35; 6, 36; 8, 37; 8, 38; 9, 39; 9, 40; 11, 41; 11, 42; 12, 43; 12, 44; 14, 45; 14, 46; 1...
def import_url(self,caseSensitiveNetworkCollectionKeys=None,\ caseSensitiveNetworkKeys=None,dataTypeList=None,\ DataTypeTargetForNetworkCollection=None,DataTypeTargetForNetworkList=None,\ delimiters=None,delimitersForDataList=None,firstRowAsColumnNames=None,\ KeyColumnForMapping=None,Key...
0, module; 1, function_definition; 2, function_name:fromtif; 3, parameters; 4, block; 5, identifier:path; 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, default...
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; 4, 23; 6, 24; 6, 25; 7, 26; 7, 27; 8, 28; 8, 29; 9, 30; 9, 31; 10, 32; 10, 33; 11, 34; 11, 35; 12, 36; 12, 37; 13, 38; 13, 39; 14, 40; 14, 41; 15, 42; 15, 43; 16, 44; 17, 45; ...
def fromtif(path, ext='tif', start=None, stop=None, recursive=False, nplanes=None, npartitions=None, labels=None, engine=None, credentials=None, discard_extra=False): """ Loads images from single or multi-page TIF files. Parameters ---------- path : str Path to data files or directory, spec...
0, module; 1, function_definition; 2, function_name:frompng; 3, parameters; 4, block; 5, identifier:path; 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, expression_statement; 15, impo...
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; 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; 13, 33; 14, 34; 15, 35; 15, 36; 16, 37; 16, 38; 16, 39; 17, 40; 19, 41; 35, 42; 35, 43; 36, 44; 38...
def frompng(path, ext='png', start=None, stop=None, recursive=False, npartitions=None, labels=None, engine=None, credentials=None): """ Load images from PNG files. Parameters ---------- path : str Path to data files or directory, specified as either a local filesystem path or in a U...
0, module; 1, function_definition; 2, function_name:list; 3, parameters; 4, block; 5, identifier:path; 6, default_parameter; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, expression_statement; 11, expression_statement; 12, if_statement; 13, expression_statement; 14, return_statement; 15, identif...
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; 6, 15; 6, 16; 7, 17; 7, 18; 8, 19; 8, 20; 9, 21; 9, 22; 10, 23; 11, 24; 12, 25; 12, 26; 13, 27; 14, 28; 24, 29; 24, 30; 25, 31; 25, 32; 26, 33; 27, 34; 27, 35; 30, 36; 30, 37; 30, 38; 31, 39; 31, 40; 33, 41; 35, 42; 35, 43; 36, 44;...
def list(path, ext=None, start=None, stop=None, recursive=False): """ Get sorted list of file paths matching path and extension """ files = listflat(path, ext) if not recursive else listrecursive(path, ext) if len(files) < 1: raise FileNotFoundError('Cannot find files...
0, module; 1, function_definition; 2, function_name:list; 3, parameters; 4, block; 5, identifier:path; 6, default_parameter; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, expression_statement; 12, expression_statement; 13, if_statement; 14, if_statement; 15, expression_sta...
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; 6, 20; 6, 21; 7, 22; 7, 23; 8, 24; 8, 25; 9, 26; 9, 27; 10, 28; 10, 29; 11, 30; 12, 31; 13, 32; 13, 33; 14, 34; 14, 35; 14, 36; 15, 37; 16, 38; 16, 39; 17, 40; 18, 41; 19, 42; 31, 43; 31, 44; 32, ...
def list(path, filename=None, start=None, stop=None, recursive=False, directories=False): """ List files specified by dataPath. Datapath may include a single wildcard ('*') in the filename specifier. Returns sorted list of absolute path strings. """ path = uri_to_path(p...
0, module; 1, function_definition; 2, function_name:list; 3, parameters; 4, block; 5, identifier:self; 6, identifier:path; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, default_parameter; 12, expression_statement; 13, expression_statement; 14, expression_statement; 15, exp...
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; 7, 18; 7, 19; 8, 20; 8, 21; 9, 22; 9, 23; 10, 24; 10, 25; 11, 26; 11, 27; 12, 28; 13, 29; 14, 30; 15, 31; 16, 32; 17, 33; 29, 34; 29, 35; 30, 36; 30, 37; 31, 38; 31, 39; 32, 40; 32, 41; 34, 42; 34, 43; 35, 44; ...
def list(self, path, filename=None, start=None, stop=None, recursive=False, directories=False): """ List objects specified by path. Returns sorted list of 'gs://' or 's3n://' URIs. """ storageScheme, keys = self.getkeys( path, filename=filename, directories=directori...
0, module; 1, function_definition; 2, function_name:validate_v3_svc_catalog_endpoint_data; 3, parameters; 4, block; 5, identifier:self; 6, identifier:expected; 7, identifier:actual; 8, expression_statement; 9, expression_statement; 10, expression_statement; 11, for_statement; 12, return_statement; 13, comment:"""Valida...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 3, 7; 4, 8; 4, 9; 4, 10; 4, 11; 4, 12; 8, 13; 9, 14; 10, 15; 11, 16; 11, 17; 11, 18; 12, 19; 14, 20; 14, 21; 15, 22; 15, 23; 16, 24; 16, 25; 17, 26; 17, 27; 18, 28; 20, 29; 20, 30; 21, 31; 22, 32; 22, 33; 23, 34; 26, 35; 26, 36; 27, 37; 28, 38; 28, 39; 28, 40; 29, 41; 29, 42; 31, 43;...
def validate_v3_svc_catalog_endpoint_data(self, expected, actual): """Validate the keystone v3 catalog endpoint data. Validate a list of dictinaries that make up the keystone v3 service catalogue. It is in the form of: {u'identity': [{u'id': u'48346b01c6804b298cdd7349aadb732e...
0, module; 1, function_definition; 2, function_name:ordered; 3, parameters; 4, block; 5, identifier:orderme; 6, expression_statement; 7, if_statement; 8, expression_statement; 9, for_statement; 10, return_statement; 11, comment:"""Converts the provided dictionary into a collections.OrderedDict. The items in the re...
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; 8, 14; 9, 15; 9, 16; 9, 17; 10, 18; 12, 19; 13, 20; 14, 21; 14, 22; 15, 23; 15, 24; 16, 25; 16, 26; 17, 27; 19, 28; 19, 29; 20, 30; 22, 31; 22, 32; 26, 33; 26, 34; 27, 35; 27, 36; 27, 37; 29, 38; 29, 39; 30, 40; 30, 41; 33, 42; 33, 43; 34...
def ordered(orderme): """Converts the provided dictionary into a collections.OrderedDict. The items in the returned OrderedDict will be inserted based on the natural sort order of the keys. Nested dictionaries will also be sorted in order to ensure fully predictable ordering. :param orderme: the d...
0, module; 1, function_definition; 2, function_name:search; 3, parameters; 4, block; 5, identifier:self; 6, identifier:q; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, expression_statement; 12, expression_statement; 13, expression_statement; 14, return_statement; 15, ident...
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; 7, 15; 7, 16; 8, 17; 8, 18; 9, 19; 9, 20; 10, 21; 10, 22; 11, 23; 12, 24; 13, 25; 14, 26; 24, 27; 24, 28; 25, 29; 25, 30; 26, 31; 26, 32; 28, 33; 28, 34; 28, 35; 28, 36; 28, 37; 28, 38; 30, 39; 30, 40; 31, 41; 31, 42; 32, 43; 32, 4...
def search(self, q, start=1, num=10, sortField="username", sortOrder="asc"): """ The User Search operation searches for users in the portal. The search index is updated whenever users are created, updated, or ...
0, module; 1, function_definition; 2, function_name:exportImage; 3, parameters; 4, block; 5, identifier:self; 6, identifier:bbox; 7, identifier:imageSR; 8, identifier:bboxSR; 9, default_parameter; 10, default_parameter; 11, default_parameter; 12, default_parameter; 13, default_parameter; 14, default_parameter; 15, defa...
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; 3, 16; 3, 17; 3, 18; 3, 19; 3, 20; 3, 21; 3, 22; 3, 23; 4, 24; 4, 25; 4, 26; 4, 27; 4, 28; 4, 29; 4, 30; 4, 31; 4, 32; 4, 33; 4, 34; 4, 35; 4, 36; 4, 37; 4, 38; 4, 39; 4, 40; 4, 41; 4, 42; 4, 43; 9, 44; 9, 45; 10, 46; 10, 47...
def exportImage(self, bbox, imageSR, bboxSR, size=[400,400], time=None, format="jpgpng", pixelType="UNKNOWN", noData=None, noDataInterpretat...
0, module; 1, function_definition; 2, function_name:measure; 3, parameters; 4, block; 5, identifier:self; 6, identifier:fromGeometry; 7, identifier:toGeometry; 8, identifier:measureOperation; 9, default_parameter; 10, default_parameter; 11, default_parameter; 12, default_parameter; 13, default_parameter; 14, default_pa...
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; 4, 20; 4, 21; 4, 22; 4, 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; 17, 38; 18, 39; 18, 40; 19, 41; 19, 42; 20, 43; 20, 44; 21...
def measure(self,fromGeometry,toGeometry,measureOperation, geometryType="esriGeometryPoint",pixelSize=None,mosaicRule=None, linearUnit=None,angularUnit=None,areaUnit=None): """ The measure operation is performed on an image service resource. It lets a user measure...
0, module; 1, function_definition; 2, function_name:computeStatisticsHistograms; 3, parameters; 4, block; 5, identifier:self; 6, identifier:geometry; 7, identifier:geometryType; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, expression_statement; 12, expression_statement; 13, expression_statemen...
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; 8, 18; 8, 19; 9, 20; 9, 21; 10, 22; 10, 23; 11, 24; 12, 25; 13, 26; 14, 27; 14, 28; 15, 29; 15, 30; 16, 31; 16, 32; 17, 33; 25, 34; 25, 35; 26, 36; 26, 37; 27, 38; 28, 39; 29, 40; 30, 41; 31, 42; 32, 43; 33, 44...
def computeStatisticsHistograms(self,geometry,geometryType,mosaicRule=None, renderingRule=None,pixelSize=None): """ The computeStatisticsHistograms operation is performed on an image service resource. This operation is supported by any image service published ...
0, module; 1, function_definition; 2, function_name:users; 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_statement; 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; 6, 23; 6, 24; 7, 25; 7, 26; 8, 27; 8, 28; 9, 29; 9, 30; 10, 31; 10, 32; 11, 33; 12, 34; 13, 35; 14, 36; 15, 37; 15, 38; 16, 39; 16, 40; 17, 41; 17, 42; 18, 43; 18, 44; 19, 45;...
def users(self, start=1, num=10, sortField="fullName", sortOrder="asc", role=None): """ Lists all the members of the organization. The start and num paging parameters are supported. Inputs: start - The numb...
0, module; 1, function_definition; 2, function_name:find; 3, parameters; 4, block; 5, identifier:self; 6, identifier:text; 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, default_para...
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; 3, 16; 4, 17; 4, 18; 7, 19; 7, 20; 8, 21; 8, 22; 9, 23; 9, 24; 10, 25; 10, 26; 11, 27; 11, 28; 12, 29; 12, 30; 13, 31; 13, 32; 14, 33; 14, 34; 15, 35; 15, 36; 16, 37; 16, 38; 17, 39; 18, 40; 18, 41; 18, 42; 40, 43; 40, 44; 4...
def find(self, text, magicKey=None, sourceCountry=None, bbox=None, location=None, distance=3218.69, outSR=102100, category=None, outFields="*", maxLocations=20, forStorage=False...
0, module; 1, function_definition; 2, function_name:search; 3, parameters; 4, block; 5, identifier:self; 6, identifier:q; 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, expression_st...
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; 4, 20; 4, 21; 4, 22; 4, 23; 7, 24; 7, 25; 8, 26; 8, 27; 9, 28; 9, 29; 10, 30; 10, 31; 11, 32; 11, 33; 12, 34; 12, 35; 13, 36; 13, 37; 14, 38; 14, 39; 15, 40; 16, 41; 16, 42; 16, 43; 17, 44; 18, 45...
def search(self, q, t=None, focus=None, bbox=None, start=1, num=10, sortField=None, sortOrder="asc", useSecurity=True): """ This operation searches for content items in the porta...
0, module; 1, function_definition; 2, function_name:sort_models; 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, while_statement; 13, expression_statement; 14, return_...
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; 9, 18; 10, 19; 11, 20; 12, 21; 12, 22; 13, 23; 14, 24; 16, 25; 16, 26; 17, 27; 17, 28; 18, 29; 18, 30; 19, 31; 19, 32; 20, 33; 20, 34; 22, 35; 22, 36; 22, 37; 22, 38; 22, 39; 22, 40; 22, 41; 23, 42; 23, 43; 26,...
def sort_models(self): """Sorts the database models appropriately based on their relationships so that we load our data in the appropriate order. Returns: A sorted list containing the names of the models. """ model_names = [ table.name for table in self.B...
0, module; 1, function_definition; 2, function_name:keyed_helper; 3, parameters; 4, block; 5, identifier:helper; 6, expression_statement; 7, decorated_definition; 8, expression_statement; 9, return_statement; 10, comment:""" Decorator for helper functions that operate on direct values instead of model instances. ...
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; 9, 14; 11, 15; 12, 16; 12, 17; 12, 18; 13, 19; 13, 20; 15, 21; 15, 22; 17, 23; 17, 24; 17, 25; 17, 26; 17, 27; 18, 28; 18, 29; 18, 30; 18, 31; 18, 32; 18, 33; 18, 34; 18, 35; 19, 36; 19, 37; 22, 38; 23, 39; 23, 40; 24, 41; 24, 42; 25, 43;...
def keyed_helper(helper): """ Decorator for helper functions that operate on direct values instead of model instances. A keyed helper is one that can be used normally in the view's own custom callbacks, but also supports direct access in the column declaration, such as in the example: datatabl...
0, module; 1, function_definition; 2, function_name:find_bin; 3, parameters; 4, block; 5, identifier:self; 6, identifier:x; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, if_statement; 11, return_statement; 12, comment:""" Sort input or inputs according to the current bin estimat...
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; 11, 17; 13, 18; 13, 19; 14, 20; 14, 21; 15, 22; 15, 23; 16, 24; 19, 25; 19, 26; 21, 27; 21, 28; 22, 29; 22, 30; 23, 31; 23, 32; 24, 33; 25, 34; 25, 35; 27, 36; 27, 37; 28, 38; 28, 39; 28, 40; 29, 41; 29, 42; 32, 43;...
def find_bin(self, x): """ Sort input or inputs according to the current bin estimate Parameters ---------- x : array or numeric a value or array of values to fit within the estimated bins Returns ------- a...
0, module; 1, function_definition; 2, function_name:filter_by_size; 3, parameters; 4, type; 5, block; 6, typed_parameter; 7, typed_parameter; 8, typed_parameter; 9, typed_parameter; 10, generic_type; 11, expression_statement; 12, comment:# TODO Tell the user what utterances we are removing.; 13, expression_statement; 1...
0, 1; 1, 2; 1, 3; 1, 4; 1, 5; 3, 6; 3, 7; 3, 8; 3, 9; 4, 10; 5, 11; 5, 12; 5, 13; 5, 14; 5, 15; 6, 16; 6, 17; 7, 18; 7, 19; 8, 20; 8, 21; 9, 22; 9, 23; 10, 24; 10, 25; 11, 26; 13, 27; 14, 28; 15, 29; 17, 30; 19, 31; 21, 32; 23, 33; 25, 34; 27, 35; 27, 36; 28, 37; 28, 38; 31, 39; 31, 40; 34, 41; 36, 42; 36, 43; 38, 44; ...
def filter_by_size(feat_dir: Path, prefixes: List[str], feat_type: str, max_samples: int) -> List[str]: """ Sorts the files by their length and returns those with less than or equal to max_samples length. Returns the filename prefixes of those files. The main job of the method is to filte...
0, module; 1, function_definition; 2, function_name:sort_annotations; 3, parameters; 4, type; 5, block; 6, typed_parameter; 7, generic_type; 8, expression_statement; 9, return_statement; 10, identifier:annotations; 11, type; 12, identifier:List; 13, type_parameter; 14, comment:""" Sorts the annotations by their start_t...
0, 1; 1, 2; 1, 3; 1, 4; 1, 5; 3, 6; 4, 7; 5, 8; 5, 9; 6, 10; 6, 11; 7, 12; 7, 13; 8, 14; 9, 15; 11, 16; 13, 17; 15, 18; 15, 19; 16, 20; 16, 21; 17, 22; 19, 23; 19, 24; 21, 25; 22, 26; 22, 27; 24, 28; 24, 29; 25, 30; 27, 31; 27, 32; 27, 33; 29, 34; 29, 35; 30, 36; 30, 37; 31, 38; 32, 39; 33, 40; 34, 41; 35, 42; 35, 43; ...
def sort_annotations(annotations: List[Tuple[int, int, str]] ) -> List[Tuple[int, int, str]]: """ Sorts the annotations by their start_time. """ return sorted(annotations, key=lambda x: x[0])
0, module; 1, function_definition; 2, function_name:default_sort_key; 3, parameters; 4, block; 5, identifier:item; 6, default_parameter; 7, expression_statement; 8, import_from_statement; 9, import_from_statement; 10, import_from_statement; 11, if_statement; 12, if_statement; 13, return_statement; 14, identifier:order;...
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; 8, 18; 8, 19; 9, 20; 9, 21; 9, 22; 10, 23; 10, 24; 11, 25; 11, 26; 12, 27; 12, 28; 12, 29; 13, 30; 17, 31; 17, 32; 18, 33; 19, 34; 20, 35; 20, 36; 20, 37; 21, 38; 22, 39; 23, 40; 23, 41; 23, 42; 24, 43; 25, 44;...
def default_sort_key(item, order=None): """Return a key that can be used for sorting. The key has the structure: (class_key, (len(args), args), exponent.sort_key(), coefficient) This key is supplied by the sort_key routine of Basic objects when ``item`` is a Basic object or an object (other than ...
0, module; 1, function_definition; 2, function_name:uintersect1d; 3, parameters; 4, block; 5, identifier:arr1; 6, identifier:arr2; 7, default_parameter; 8, expression_statement; 9, expression_statement; 10, expression_statement; 11, return_statement; 12, identifier:assume_unique; 13, False; 14, comment:"""Find the sort...
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; 11, 17; 15, 18; 15, 19; 16, 20; 16, 21; 19, 22; 19, 23; 21, 24; 21, 25; 22, 26; 22, 27; 23, 28; 23, 29; 23, 30; 25, 31; 25, 32; 30, 33; 30, 34; 32, 35; 32, 36
def uintersect1d(arr1, arr2, assume_unique=False): """Find the sorted unique elements of the two input arrays. A wrapper around numpy.intersect1d that preserves units. All input arrays must have the same units. See the documentation of numpy.intersect1d for full details. Examples -------- ...
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, return_statement; 11, identifier:axis; 12, unary_operator; 13, identifier:kind; 14, string:"quicksort"; 15, identifier:...
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; 12, 19; 18, 20; 18, 21; 20, 22; 20, 23; 21, 24; 21, 25; 21, 26; 22, 27; 22, 28; 27, 29; 27, 30; 28, 31; 31, 32; 31, 33
def argsort(self, axis=-1, kind="quicksort", order=None): """ Returns the indices that would sort the array. See the documentation of ndarray.argsort for details about the keyword arguments. Example ------- >>> from unyt import km >>> data = [3, 8, 7]*km...
0, module; 1, function_definition; 2, function_name:serve; 3, parameters; 4, block; 5, identifier:info; 6, identifier:host; 7, identifier:port; 8, identifier:reload; 9, identifier:debugger; 10, identifier:eager_loading; 11, identifier:with_threads; 12, expression_statement; 13, comment:# Werkzeug logger is special and ...
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; 4, 21; 4, 22; 4, 23; 4, 24; 4, 25; 4, 26; 12, 27; 15, 28; 16, 29; 17, 30; 18, 31; 19, 32; 19, 33; 20, 34; 20, 35; 21, 36; 21, 37; 22, 38; 23, 39; 24, 40; 25, 41; 25, 42; 26, 43; 27, 44; 28,...
def serve(info, host, port, reload, debugger, eager_loading, with_threads): ''' Runs a local udata development server. This local server is recommended for development purposes only but it can also be used for simple intranet deployments. By default it will not support any sort of concurrency at a...
0, module; 1, function_definition; 2, function_name:get_enabled_plugins; 3, parameters; 4, block; 5, expression_statement; 6, expression_statement; 7, expression_statement; 8, for_statement; 9, return_statement; 10, string; 11, assignment; 12, assignment; 13, identifier:plugin; 14, identifier:plugins; 15, block; 16, li...
0, 1; 1, 2; 1, 3; 1, 4; 4, 5; 4, 6; 4, 7; 4, 8; 4, 9; 5, 10; 6, 11; 7, 12; 8, 13; 8, 14; 8, 15; 9, 16; 10, 17; 11, 18; 11, 19; 12, 20; 12, 21; 15, 22; 16, 23; 16, 24; 19, 25; 19, 26; 21, 27; 21, 28; 21, 29; 22, 30; 22, 31; 23, 32; 23, 33; 24, 34; 24, 35; 25, 36; 25, 37; 28, 38; 28, 39; 29, 40; 30, 41; 30, 42; 31, 43; 3...
def get_enabled_plugins(): ''' Returns enabled preview plugins. Plugins are sorted, defaults come last ''' plugins = entrypoints.get_enabled('udata.preview', current_app).values() valid = [p for p in plugins if issubclass(p, PreviewPlugin)] for plugin in plugins: if plugin not in va...
0, module; 1, function_definition; 2, function_name:extract_sort; 3, parameters; 4, block; 5, identifier:self; 6, identifier:params; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, expression_statement; 11, expression_statement; 12, string; 13, assignment; 14, assignment; 15, assignment; ...
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; 11, 16; 12, 17; 13, 18; 13, 19; 14, 20; 14, 21; 15, 22; 15, 23; 16, 24; 16, 25; 19, 26; 19, 27; 21, 28; 21, 29; 21, 30; 23, 31; 23, 32; 24, 33; 24, 34; 25, 35; 25, 36; 25, 37; 26, 38; 26, 39; 27, 40; 27, 41; 28, 42; 29, 43;...
def extract_sort(self, params): '''Extract and build sort query from parameters''' sorts = params.pop('sort', []) sorts = [sorts] if isinstance(sorts, basestring) else sorts sorts = [(s[1:], 'desc') if s.startswith('-') else (s, 'asc') for s in sorts] ...
0, module; 1, function_definition; 2, function_name:ancestors_objects; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, expression_statement; 8, for_statement; 9, expression_statement; 10, return_statement; 11, comment:"""Ancestors objects sorted by name."""; 12, assignment; 13, identifier:ances...
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; 8, 14; 8, 15; 9, 16; 10, 17; 12, 18; 12, 19; 14, 20; 14, 21; 15, 22; 15, 23; 16, 24; 16, 25; 22, 26; 22, 27; 23, 28; 24, 29; 24, 30; 25, 31; 26, 32; 27, 33; 27, 34; 28, 35; 28, 36; 31, 37; 31, 38; 32, 39; 33, 40; 33, 41; 34, 42; 35, 43; 3...
def ancestors_objects(self): """Ancestors objects sorted by name.""" ancestors_objects = [] for ancestor in self.ancestors: try: ancestor_object = GeoZone.objects.get(id=ancestor) except GeoZone.DoesNotExist: continue ancestors_...
0, module; 1, function_definition; 2, function_name:check_for_territories; 3, parameters; 4, block; 5, identifier:query; 6, expression_statement; 7, if_statement; 8, expression_statement; 9, expression_statement; 10, expression_statement; 11, expression_statement; 12, for_statement; 13, if_statement; 14, comment:# Sort...
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; 6, 16; 7, 17; 7, 18; 8, 19; 9, 20; 10, 21; 11, 22; 12, 23; 12, 24; 12, 25; 13, 26; 13, 27; 15, 28; 17, 29; 17, 30; 18, 31; 19, 32; 19, 33; 20, 34; 20, 35; 21, 36; 21, 37; 22, 38; 22, 39; 24, 40; 24, 41; 25, 42; 25, 43; 25, 4...
def check_for_territories(query): """ Return a geozone queryset of territories given the `query`. Results are sorted by population and area (biggest first). """ if not query or not current_app.config.get('ACTIVATE_TERRITORIES'): return [] dbqs = db.Q() query = query.lower() is_...