nodes
stringlengths
501
22.4k
edges
stringlengths
138
5.07k
code
stringlengths
108
19.3k
0, module; 1, function_definition; 2, function_name:get_sortkey; 3, parameters; 4, block; 5, identifier:table; 6, expression_statement; 7, comment:# Just pick the first column in the table in alphabetical order.; 8, comment:# Ideally we would get the primary key from bcdc api, but it doesn't; 9, comment:# seem to be av...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 4, 6; 4, 7; 4, 8; 4, 9; 4, 10; 4, 11; 6, 12; 10, 13; 11, 14; 13, 15; 13, 16; 14, 17; 14, 18; 16, 19; 16, 20; 17, 21; 17, 22; 20, 23; 20, 24; 22, 25; 23, 26; 23, 27; 24, 28; 24, 29; 25, 30; 25, 31; 27, 32; 27, 33; 30, 34; 30, 35; 34, 36; 34, 37; 36, 38; 36, 39; 38, 40; 38, 41; 39, 42; 42, 4...
def get_sortkey(table): """Get a field to sort by """ # Just pick the first column in the table in alphabetical order. # Ideally we would get the primary key from bcdc api, but it doesn't # seem to be available wfs = WebFeatureService(url=bcdata.OWS_URL, version="2.0.0") return sorted(wfs.ge...
0, module; 1, function_definition; 2, function_name:_get_sorted; 3, parameters; 4, block; 5, identifier:self; 6, identifier:resources; 7, expression_statement; 8, expression_statement; 9, for_statement; 10, return_statement; 11, comment:"""Order the resources by priority - the most specific paths come first. ...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 4, 7; 4, 8; 4, 9; 4, 10; 7, 11; 8, 12; 9, 13; 9, 14; 9, 15; 10, 16; 12, 17; 12, 18; 15, 19; 15, 20; 15, 21; 15, 22; 16, 23; 16, 24; 19, 25; 21, 26; 22, 27; 24, 28; 24, 29; 25, 30; 25, 31; 26, 32; 26, 33; 27, 34; 27, 35; 28, 36; 28, 37; 29, 38; 29, 39; 31, 40; 31, 41; 33, 42; 33, 43; ...
def _get_sorted(self, resources): """Order the resources by priority - the most specific paths come first. :param resources: List of :class:`wsgiservice.resource.Resource` classes to be served by this application. """ tmp = [] for resource in re...
0, module; 1, function_definition; 2, function_name:_group_models; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, expression_statement; 8, comment:# Add models to appropriate list. We only aggregate models which; 9, comment:# completed successfully and have a valid AIC and BMD.; 10, for_statem...
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; 10, 17; 10, 18; 10, 19; 12, 20; 12, 21; 12, 22; 13, 23; 13, 24; 13, 25; 14, 26; 16, 27; 16, 28; 17, 29; 17, 30; 18, 31; 18, 32; 19, 33; 19, 34; 21, 35; 22, 36; 23, 37; 23, 38; 24, 39; 24, 40; 25, 41; 26, 42; 26, 43; 2...
def _group_models(self): """ If AIC and BMD are numeric and identical, then treat models as identical. Returns a list of lists. The outer list is a list of related models, the inner list contains each individual model, sorted by the number of parameters in ascending order. ...
0, module; 1, function_definition; 2, function_name:search; 3, parameters; 4, block; 5, identifier:term; 6, default_parameter; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, expression_statement; 11, expression_statement; 12, expression_statement; 13, return_statement; 14, identifier:category; 15...
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; 6, 14; 6, 15; 7, 16; 7, 17; 8, 18; 8, 19; 9, 20; 9, 21; 10, 22; 11, 23; 12, 24; 13, 25; 15, 26; 15, 27; 23, 28; 23, 29; 24, 30; 24, 31; 29, 32; 29, 33; 30, 34; 30, 35; 31, 36; 31, 37; 31, 38; 31, 39; 31, 40; 36, 41; 36, 42; 37, 43; 37, 44...
def search(term, category=Categories.ALL, pages=1, sort=None, order=None): """Return a search result for term in category. Can also be sorted and span multiple pages.""" s = Search() s.search(term=term, category=category, pages=pages, sort=sort, order=order) return s
0, module; 1, function_definition; 2, function_name:popular; 3, parameters; 4, block; 5, default_parameter; 6, default_parameter; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, return_statement; 11, identifier:category; 12, None; 13, identifier:sortOption; 14, string:"title"; 15, comment...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 4, 7; 4, 8; 4, 9; 4, 10; 5, 11; 5, 12; 6, 13; 6, 14; 7, 15; 8, 16; 9, 17; 10, 18; 16, 19; 16, 20; 17, 21; 17, 22; 20, 23; 20, 24; 21, 25; 21, 26; 22, 27; 22, 28
def popular(category=None, sortOption = "title"): """Return a search result containing torrents appearing on the KAT home page. Can be categorized. Cannot be sorted or contain multiple pages""" s = Search() s.popular(category, sortOption) return s
0, module; 1, function_definition; 2, function_name:recent; 3, parameters; 4, block; 5, default_parameter; 6, default_parameter; 7, default_parameter; 8, default_parameter; 9, expression_statement; 10, expression_statement; 11, expression_statement; 12, return_statement; 13, identifier:category; 14, None; 15, identifie...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 3, 7; 3, 8; 4, 9; 4, 10; 4, 11; 4, 12; 5, 13; 5, 14; 6, 15; 6, 16; 7, 17; 7, 18; 8, 19; 8, 20; 9, 21; 10, 22; 11, 23; 12, 24; 22, 25; 22, 26; 23, 27; 23, 28; 26, 29; 26, 30; 27, 31; 27, 32; 28, 33; 28, 34; 28, 35; 28, 36
def recent(category=None, pages=1, sort=None, order=None): """Return most recently added torrents. Can be sorted and categorized and contain multiple pages.""" s = Search() s.recent(category, pages, sort, order) return s
0, module; 1, function_definition; 2, function_name:pick_action_todo; 3, parameters; 4, block; 5, expression_statement; 6, for_statement; 7, return_statement; 8, comment:""" only for testing and AI - user will usually choose an action Sort of works """; 9, pattern_list; 10, call; 11, comment:#print('todo = ...
0, 1; 1, 2; 1, 3; 1, 4; 4, 5; 4, 6; 4, 7; 5, 8; 6, 9; 6, 10; 6, 11; 6, 12; 7, 13; 9, 14; 9, 15; 10, 16; 10, 17; 12, 18; 13, 19; 13, 20; 17, 21; 18, 22; 18, 23; 22, 24; 22, 25; 23, 26; 23, 27; 23, 28; 25, 29; 26, 30; 27, 31; 27, 32; 28, 33; 28, 34; 29, 35; 29, 36; 30, 37; 30, 38; 31, 39; 31, 40; 32, 41; 33, 42; 33, 43; ...
def pick_action_todo(): """ only for testing and AI - user will usually choose an action Sort of works """ for ndx, todo in enumerate(things_to_do): #print('todo = ', todo) if roll_dice(todo["chance"]): cur_act = actions[get_action_by_name(todo["name"])] if to...
0, module; 1, function_definition; 2, function_name:power; 3, parameters; 4, block; 5, identifier:set_; 6, expression_statement; 7, expression_statement; 8, expression_statement; 9, return_statement; 10, comment:"""Returns all subsets of given set. :return: Powerset of given set, i.e. iterable containing all its s...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 4, 6; 4, 7; 4, 8; 4, 9; 6, 10; 7, 11; 8, 12; 9, 13; 11, 14; 11, 15; 12, 16; 12, 17; 13, 18; 13, 19; 15, 20; 17, 21; 17, 22; 19, 23; 19, 24; 21, 25; 21, 26; 22, 27; 22, 28; 27, 29; 27, 30; 28, 31; 28, 32; 30, 33; 30, 34; 32, 35; 32, 36; 36, 37; 37, 38; 37, 39; 38, 40; 38, 41; 41, 42
def power(set_): """Returns all subsets of given set. :return: Powerset of given set, i.e. iterable containing all its subsets, sorted by ascending cardinality. """ ensure_countable(set_) result = chain.from_iterable(combinations(set_, r) for r in xran...
0, module; 1, function_definition; 2, function_name:to_json; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, default_parameter; 8, expression_statement; 9, return_statement; 10, identifier:indent; 11, None; 12, identifier:sort_keys; 13, True; 14, comment:"""Return a JSON string representation of t...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 3, 7; 4, 8; 4, 9; 6, 10; 6, 11; 7, 12; 7, 13; 8, 14; 9, 15; 15, 16; 15, 17; 16, 18; 16, 19; 17, 20; 17, 21; 17, 22; 20, 23; 20, 24; 21, 25; 21, 26; 22, 27; 22, 28; 23, 29; 23, 30
def to_json(self, indent=None, sort_keys=True): """Return a JSON string representation of this instance :param indent: specify an indent level or a string used to indent each level :param sort_keys: the output is sorted by key """ return json.dumps(self.to...
0, module; 1, function_definition; 2, function_name:bin_spikes; 3, parameters; 4, block; 5, identifier:spike_times; 6, identifier:binsz; 7, expression_statement; 8, expression_statement; 9, for_statement; 10, return_statement; 11, comment:"""Sort spike times into bins :param spike_times: times of spike instances ...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 4, 7; 4, 8; 4, 9; 4, 10; 7, 11; 8, 12; 9, 13; 9, 14; 9, 15; 9, 16; 10, 17; 12, 18; 12, 19; 13, 20; 13, 21; 14, 22; 14, 23; 16, 24; 19, 25; 19, 26; 23, 27; 24, 28; 25, 29; 25, 30; 26, 31; 26, 32; 28, 33; 28, 34; 31, 35; 32, 36; 32, 37; 33, 38; 33, 39; 34, 40; 34, 41; 35, 42; 35, 43; 4...
def bin_spikes(spike_times, binsz): """Sort spike times into bins :param spike_times: times of spike instances :type spike_times: list :param binsz: length of time bin to use :type binsz: float :returns: list of bin indicies, one for each element in spike_times """ bins = np.empty((len(...
0, module; 1, function_definition; 2, function_name:make_dynamic_class; 3, parameters; 4, block; 5, identifier:typename; 6, identifier:field_names; 7, expression_statement; 8, if_statement; 9, expression_statement; 10, expression_statement; 11, expression_statement; 12, expression_statement; 13, expression_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; 7, 20; 8, 21; 8, 22; 9, 23; 10, 24; 11, 25; 12, 26; 13, 27; 14, 28; 15, 29; 16, 30; 17, 31; 18, 32; 19, 33; 21, 34; 21, 35; 22, 36; 23, 37; 23, 38; 24, 39; 24, 40; 25, 41; 25, 42; 26, 43; 26, 44; ...
def make_dynamic_class(typename, field_names): """a factory function to create type dynamically The factory function is used by :func:`objson.load` and :func:`objson.loads`. Creating the object deserialize from json string. The inspiration come from :func:`collections.namedtuple`. the difference is tha...
0, module; 1, function_definition; 2, function_name:list_processed_parameter_group_histogram; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, expression_statement; 11, expression_statement; 12, if_statement; 13, if_statement; 14, i...
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; 6, 17; 6, 18; 7, 19; 7, 20; 8, 21; 8, 22; 9, 23; 9, 24; 10, 25; 11, 26; 12, 27; 12, 28; 13, 29; 13, 30; 14, 31; 14, 32; 15, 33; 15, 34; 16, 35; 26, 36; 26, 37; 27, 38; 27, 39; 28, 40; 29, 41; 29, 42; 30, 43; 31, 44; 3...
def list_processed_parameter_group_histogram(self, group=None, start=None, stop=None, merge_time=20): """ Reads index records related to processed parameter groups between the specified start and stop time. Each iteration returns a chunk of chronologically-sorted records. :para...
0, module; 1, function_definition; 2, function_name:list_completeness_index; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, default_parameter; 8, expression_statement; 9, expression_statement; 10, if_statement; 11, if_statement; 12, return_statement; 13, identifier:start; 14, None; 15, identifier...
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; 10, 19; 10, 20; 11, 21; 11, 22; 12, 23; 18, 24; 18, 25; 19, 26; 19, 27; 20, 28; 21, 29; 21, 30; 22, 31; 23, 32; 23, 33; 28, 34; 31, 35; 32, 36; 32, 37; 33, 38; 33, 39; 33, 40; 33, 41; 33, 42; 33, 43; 34,...
def list_completeness_index(self, start=None, stop=None): """ Reads completeness index records between the specified start and stop time. Each iteration returns a chunk of chronologically-sorted records. :rtype: ~collections.Iterable[.IndexGroup] """ params = {}...
0, module; 1, function_definition; 2, function_name:list_packets; 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, if_statement; 14, if_statement; 15, if_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; 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; 13, 31; 14, 32; 14, 33; 15, 34; 15, 35; 16, 36; 16, 37; 17, 38; 29, 39; 29, 40; 30, 41; 30, 42; 31, 43; 32, 44; 32...
def list_packets(self, name=None, start=None, stop=None, page_size=500, descending=False): """ Reads packet information between the specified start and stop time. Packets are sorted by generation time and sequence number. :param ~datetime.datetime start: Minimum generation time...
0, module; 1, function_definition; 2, function_name:list_events; 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; 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; 4, 21; 6, 22; 6, 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; 14, 37; 15, 38; 15, 39; 16, 40; 16, 41; 17, 42; 17, 43; 18, 44; 18, 45...
def list_events(self, source=None, severity=None, text_filter=None, start=None, stop=None, page_size=500, descending=False): """ Reads events between the specified start and stop time. Events are sorted by generation time, source, then sequence number. :param str so...
0, module; 1, function_definition; 2, function_name:copy_file; 3, parameters; 4, block; 5, identifier:source; 6, identifier:destination; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, expression_statement; 12, expression_statement; 13, identifier:unique; 14, False; 15, iden...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 3, 7; 3, 8; 3, 9; 3, 10; 4, 11; 4, 12; 7, 13; 7, 14; 8, 15; 8, 16; 9, 17; 9, 18; 10, 19; 10, 20; 11, 21; 12, 22; 22, 23; 22, 24; 23, 25; 23, 26; 24, 27; 24, 28; 24, 29; 24, 30; 24, 31; 24, 32
def copy_file(source, destination, unique=False, sort=False, case_sensitive=True, create_path=False): """ Python utility to create file Args: source: absolute/relative path of source file destination: absolute/relative path of destination file. Use same as source for re...
0, module; 1, function_definition; 2, function_name:set; 3, parameters; 4, block; 5, identifier:self; 6, dictionary_splat_pattern; 7, expression_statement; 8, expression_statement; 9, if_statement; 10, if_statement; 11, if_statement; 12, if_statement; 13, expression_statement; 14, if_statement; 15, if_statement; 16, if...
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; 6, 28; 7, 29; 8, 30; 9, 31; 9, 32; 10, 33; 10, 34; 11, 35; 11, 36; 12, 37; 12, 38; 13, 39; 14, 40; 14, 41; 15, 42; 15, 43; 16, 44; 16, 45; 1...
def set(self, **kwargs): """Sets an internal setting for acquistion, using keywords. Available parameters to set: :param acqtime: duration of recording (input) window (seconds) :type acqtime: float :param aifs: sample rate of the recording (input) operation (Hz) ...
0, module; 1, function_definition; 2, function_name:readlist; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, expression_statement; 8, comment:# Create and start threads; 9, for_statement; 10, for_statement; 11, expression_statement; 12, comment:# Create; 13, expression_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; 9, 16; 9, 17; 9, 18; 9, 19; 10, 20; 10, 21; 10, 22; 11, 23; 13, 24; 15, 25; 15, 26; 17, 27; 17, 28; 19, 29; 19, 30; 19, 31; 19, 32; 19, 33; 21, 34; 21, 35; 22, 36; 23, 37; 23, 38; 24, 39; 24, 40; 26, 41; 26, 42; 28, 43; 29, ...
def readlist(self): """Sort the reads, and create lists to be used in creating sorted .fastq files""" printtime('Sorting reads', self.start) # Create and start threads for i in range(self.cpus): # Send the threads to the appropriate destination function threads = ...
0, module; 1, function_definition; 2, function_name:build_markdown_table; 3, parameters; 4, block; 5, identifier:headers; 6, identifier:rows; 7, default_parameter; 8, expression_statement; 9, expression_statement; 10, expression_statement; 11, expression_statement; 12, for_statement; 13, return_statement; 14, identifie...
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; 9, 17; 10, 18; 11, 19; 12, 20; 12, 21; 12, 22; 13, 23; 17, 24; 17, 25; 18, 26; 18, 27; 19, 28; 19, 29; 22, 30; 23, 31; 23, 32; 25, 33; 25, 34; 27, 35; 27, 36; 29, 37; 29, 38; 30, 39; 31, 40; 31, 41; 32, 42; 34, 43; 34...
def build_markdown_table(headers, rows, row_keys=None): """Build a lined up markdown table. Args: headers (dict): A key -> value pairing fo the headers. rows (list): List of dictionaries that contain all the keys listed in the headers. row_keys (list): A sorted list of keys to d...
0, module; 1, function_definition; 2, function_name:sort_item; 3, parameters; 4, block; 5, identifier:iterable; 6, identifier:number; 7, default_parameter; 8, expression_statement; 9, return_statement; 10, identifier:reverse; 11, False; 12, comment:"""Sort the itertable according to the given number item."""; 13, call;...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 3, 7; 4, 8; 4, 9; 7, 10; 7, 11; 8, 12; 9, 13; 13, 14; 13, 15; 15, 16; 15, 17; 15, 18; 17, 19; 17, 20; 18, 21; 18, 22; 20, 23; 20, 24; 24, 25
def sort_item(iterable, number, reverse=False): """Sort the itertable according to the given number item.""" return sorted(iterable, key=itemgetter(number), reverse=reverse)
0, module; 1, function_definition; 2, function_name:ports_as_list; 3, parameters; 4, block; 5, identifier:port_str; 6, expression_statement; 7, if_statement; 8, if_statement; 9, expression_statement; 10, expression_statement; 11, expression_statement; 12, expression_statement; 13, expression_statement; 14, if_statement...
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; 6, 24; 7, 25; 7, 26; 8, 27; 8, 28; 9, 29; 10, 30; 11, 31; 12, 32; 13, 33; 14, 34; 14, 35; 15, 36; 15, 37; 16, 38; 17, 39; 18, 40; 20, 41; 20, 42; 20, 43; 20, 44; 20, 45...
def ports_as_list(port_str): """ Parses a ports string into two list of individual tcp and udp ports. @input string containing a port list e.g. T:1,2,3,5-8 U:22,80,600-1024 @return two list of sorted integers, for tcp and udp ports respectively. """ if not port_str: LOGGER.info("In...
0, module; 1, function_definition; 2, function_name:tsses; 3, parameters; 4, block; 5, identifier:db; 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, if_stateme...
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; 6, 25; 6, 26; 7, 27; 7, 28; 8, 29; 8, 30; 9, 31; 9, 32; 10, 33; 10, 34; 11, 35; 11, 36; 12, 37; 13, 38; 14, 39; 14, 40; 15, 41; 15, 42; 15, 43; 16, 44; 16, 45; 1...
def tsses(db, merge_overlapping=False, attrs=None, attrs_sep=":", merge_kwargs=None, as_bed6=False, bedtools_227_or_later=True): """ Create 1-bp transcription start sites for all transcripts in the database and return as a sorted pybedtools.BedTool object pointing to a temporary file. To ...
0, module; 1, function_definition; 2, function_name:interfeatures; 3, parameters; 4, block; 5, identifier:self; 6, identifier:features; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, default_parameter; 12, expression_statement; 13, for_statement; 14, identifier:new_featuret...
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; 7, 14; 7, 15; 8, 16; 8, 17; 9, 18; 9, 19; 10, 20; 10, 21; 11, 22; 11, 23; 12, 24; 13, 25; 13, 26; 13, 27; 13, 28; 25, 29; 25, 30; 26, 31; 26, 32; 28, 33; 28, 34; 28, 35; 28, 36; 28, 37; 28, 38; 28, 39; 28, 40; 28, 41; 28, 42; 28, 43; 28, ...
def interfeatures(self, features, new_featuretype=None, merge_attributes=True, dialect=None, attribute_func=None, update_attributes=None): """ Construct new features representing the space between features. For example, if `features` is a list of exon...
0, module; 1, function_definition; 2, function_name:_reconstruct; 3, parameters; 4, block; 5, identifier:keyvals; 6, identifier:dialect; 7, default_parameter; 8, default_parameter; 9, expression_statement; 10, if_statement; 11, if_statement; 12, expression_statement; 13, comment:# Re-encode when reconstructing attribut...
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; 7, 25; 7, 26; 8, 27; 8, 28; 9, 29; 10, 30; 10, 31; 11, 32; 11, 33; 12, 34; 14, 35; 14, 36; 14, 37; 16, 38; 16, 39; 16, 40; 17, 41; 17, 42; 17, 43; 17, 44; 17, 45...
def _reconstruct(keyvals, dialect, keep_order=False, sort_attribute_values=False): """ Reconstructs the original attributes string according to the dialect. Parameters ========== keyvals : dict Attributes from a GFF/GTF feature dialect : dict Dialect containing...
0, module; 1, function_definition; 2, function_name:create_db; 3, parameters; 4, block; 5, identifier:data; 6, identifier:dbfn; 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; 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; 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; 4, 44; 4, 45; 4, 46; 4, 47; ...
def create_db(data, dbfn, id_spec=None, force=False, verbose=False, checklines=10, merge_strategy='error', transform=None, gtf_transcript_key='transcript_id', gtf_gene_key='gene_id', gtf_subfeature='exon', force_gff=False, force_dialect_check=False, from_string=Fa...
0, module; 1, function_definition; 2, function_name:order_by_on_list; 3, parameters; 4, block; 5, identifier:objects; 6, identifier:order_field; 7, default_parameter; 8, expression_statement; 9, if_statement; 10, function_definition; 11, expression_statement; 12, identifier:is_desc; 13, False; 14, comment:""" Utili...
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; 9, 16; 10, 17; 10, 18; 10, 19; 11, 20; 15, 21; 15, 22; 16, 23; 16, 24; 18, 25; 19, 26; 19, 27; 19, 28; 20, 29; 20, 30; 22, 31; 23, 32; 26, 33; 27, 34; 27, 35; 28, 36; 29, 37; 29, 38; 30, 39; 30, 40; 32, 41; 32, 42; 33, 43; 3...
def order_by_on_list(objects, order_field, is_desc=False): """ Utility function to sort objects django-style even for non-query set collections :param objects: list of objects to sort :param order_field: field name, follows django conventions, so "foo__bar" means `foo.bar`, can be a callable. :para...
0, module; 1, function_definition; 2, function_name:render_table; 3, parameters; 4, block; 5, identifier:request; 6, identifier:table; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, default_parameter; 12, comment:# pragma: no mutate; 13, default_parameter; 14, default_param...
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; 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; 7, 33; 7, 34; 8, 35; 8, 36; 9, 37; 9, 38; 10, 39; 10, 40; 11, 41; 11, 42; 13, 43; 13, 44; 14, 45; 14, 46;...
def render_table(request, table, links=None, context=None, template='tri_table/list.html', blank_on_empty=False, paginate_by=40, # pragma: no mutate page=None, paginator=None, ...
0, module; 1, function_definition; 2, function_name:assemble_concatenated_meta; 3, parameters; 4, block; 5, identifier:concated_meta_dfs; 6, identifier:remove_all_metadata_fields; 7, expression_statement; 8, comment:# Concatenate the concated_meta_dfs; 9, if_statement; 10, expression_statement; 11, comment:# Sanity che...
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; 9, 21; 9, 22; 10, 23; 13, 24; 14, 25; 15, 26; 16, 27; 18, 28; 19, 29; 22, 30; 23, 31; 23, 32; 24, 33; 24, 34; 25, 35; 25, 36; 26, 37; 26, 38; 27, 39; 27, 40; 28, 41; 28, 42; 30, 43; 30, 44;...
def assemble_concatenated_meta(concated_meta_dfs, remove_all_metadata_fields): """ Assemble the concatenated metadata dfs together. For example, if horizontally concatenating, the concatenated metadata dfs are the column metadata dfs. Both indices are sorted. Args: concated_meta_dfs (list of pa...
0, module; 1, function_definition; 2, function_name:assemble_data; 3, parameters; 4, block; 5, identifier:data_dfs; 6, identifier:concat_direction; 7, expression_statement; 8, if_statement; 9, comment:# Sort both indices; 10, expression_statement; 11, return_statement; 12, comment:""" Assemble the data dfs together. Bo...
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; 8, 15; 8, 16; 10, 17; 11, 18; 13, 19; 13, 20; 15, 21; 15, 22; 15, 23; 15, 24; 15, 25; 15, 26; 15, 27; 16, 28; 16, 29; 16, 30; 17, 31; 17, 32; 21, 33; 24, 34; 25, 35; 26, 36; 27, 37; 28, 38; 28, 39; 30, 40; 30, 41; 30, 42; 30, 43; 3...
def assemble_data(data_dfs, concat_direction): """ Assemble the data dfs together. Both indices are sorted. Args: data_dfs (list of pandas dfs) concat_direction (string): 'horiz' or 'vert' Returns: all_data_df_sorted (pandas df) """ if concat_direction == "horiz": ...
0, module; 1, function_definition; 2, function_name:sort_run; 3, parameters; 4, block; 5, identifier:run; 6, expression_statement; 7, comment:# Sort errors first, then by name. Also show errors that were manually; 8, comment:# approved, so the paging sort order stays the same even after users; 9, comment:# approve a di...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 4, 6; 4, 7; 4, 8; 4, 9; 4, 10; 4, 11; 6, 12; 10, 13; 10, 14; 11, 15; 13, 16; 13, 17; 14, 18; 15, 19; 15, 20; 16, 21; 16, 22; 17, 23; 17, 24; 18, 25; 20, 26; 20, 27; 23, 28; 23, 29; 25, 30; 25, 31; 31, 32; 31, 33
def sort_run(run): """Sort function for runs within a release.""" # Sort errors first, then by name. Also show errors that were manually # approved, so the paging sort order stays the same even after users # approve a diff on the run page. if run.status in models.Run.DIFF_NEEDED_...
0, module; 1, function_definition; 2, function_name:group_and_sort_statements; 3, parameters; 4, block; 5, identifier:stmt_list; 6, default_parameter; 7, expression_statement; 8, function_definition; 9, expression_statement; 10, expression_statement; 11, expression_statement; 12, for_statement; 13, comment:# Sort the r...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 4, 7; 4, 8; 4, 9; 4, 10; 4, 11; 4, 12; 4, 13; 4, 14; 4, 15; 4, 16; 6, 17; 6, 18; 7, 19; 8, 20; 8, 21; 8, 22; 9, 23; 10, 24; 11, 25; 12, 26; 12, 27; 12, 28; 12, 29; 14, 30; 14, 31; 14, 32; 15, 33; 16, 34; 21, 35; 22, 36; 23, 37; 23, 38; 24, 39; 24, 40; 25, 41; 25, 42; 26, 43; 26, 44; ...
def group_and_sort_statements(stmt_list, ev_totals=None): """Group statements by type and arguments, and sort by prevalence. Parameters ---------- stmt_list : list[Statement] A list of INDRA statements. ev_totals : dict{int: int} A dictionary, keyed by statement hash (shallow) with ...
0, module; 1, function_definition; 2, function_name:make_stmt_from_sort_key; 3, parameters; 4, block; 5, identifier:key; 6, identifier:verb; 7, expression_statement; 8, function_definition; 9, expression_statement; 10, expression_statement; 11, if_statement; 12, return_statement; 13, comment:"""Make a Statement from 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; 8, 15; 8, 16; 9, 17; 10, 18; 11, 19; 11, 20; 11, 21; 11, 22; 11, 23; 12, 24; 15, 25; 16, 26; 16, 27; 17, 28; 17, 29; 18, 30; 18, 31; 19, 32; 19, 33; 20, 34; 21, 35; 21, 36; 22, 37; 22, 38; 23, 39; 26, 40; 26, 41; 27, 42; 29, 43; 29...
def make_stmt_from_sort_key(key, verb): """Make a Statement from the sort key. Specifically, the sort key used by `group_and_sort_statements`. """ def make_agent(name): if name == 'None' or name is None: return None return Agent(name) StmtClass = get_statement_by_name(v...
0, module; 1, function_definition; 2, function_name:ungrounded_texts; 3, parameters; 4, block; 5, identifier:stmts; 6, expression_statement; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, expression_statement; 11, return_statement; 12, comment:"""Return a list of all ungrounded entities ...
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; 11, 17; 13, 18; 13, 19; 14, 20; 14, 21; 15, 22; 15, 23; 16, 24; 16, 25; 19, 26; 19, 27; 19, 28; 19, 29; 21, 30; 21, 31; 23, 32; 23, 33; 25, 34; 25, 35; 26, 36; 26, 37; 27, 38; 27, 39; 28, 40; 28, 41; 29, 42; 31, 43; ...
def ungrounded_texts(stmts): """Return a list of all ungrounded entities ordered by number of mentions Parameters ---------- stmts : list of :py:class:`indra.statements.Statement` Returns ------- ungroundc : list of tuple list of tuples of the form (text: str, count: int) sorted in ...
0, module; 1, function_definition; 2, function_name:save_sentences; 3, parameters; 4, block; 5, identifier:twg; 6, identifier:stmts; 7, identifier:filename; 8, default_parameter; 9, expression_statement; 10, expression_statement; 11, expression_statement; 12, expression_statement; 13, expression_statement; 14, for_stat...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 3, 7; 3, 8; 4, 9; 4, 10; 4, 11; 4, 12; 4, 13; 4, 14; 4, 15; 4, 16; 8, 17; 8, 18; 9, 19; 10, 20; 11, 21; 12, 22; 13, 23; 14, 24; 14, 25; 14, 26; 16, 27; 20, 28; 20, 29; 21, 30; 21, 31; 22, 32; 22, 33; 23, 34; 23, 35; 26, 36; 26, 37; 26, 38; 26, 39; 27, 40; 27, 41; 31, 42; 31, 43; 34, ...
def save_sentences(twg, stmts, filename, agent_limit=300): """Write evidence sentences for stmts with ungrounded agents to csv file. Parameters ---------- twg: list of tuple list of tuples of ungrounded agent_texts with counts of the number of times they are mentioned in the list of sta...
0, module; 1, function_definition; 2, function_name:_get_node_key; 3, parameters; 4, block; 5, identifier:self; 6, identifier:node_dict_item; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, return_statement; 11, comment:"""Return a tuple of sorted sources and targets given a node dict."""...
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; 22, 25; 24, 26; 25, 27; 25, 28; 26, 29; 26, 30; 28, 31; 30, 32; 31, 33; 31, 34; 32, 35; 32, 36; 34, 37; 36, 38
def _get_node_key(self, node_dict_item): """Return a tuple of sorted sources and targets given a node dict.""" s = tuple(sorted(node_dict_item['sources'])) t = tuple(sorted(node_dict_item['targets'])) return (s, t)
0, module; 1, function_definition; 2, function_name:_get_node_groups; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, expression_statement; 8, for_statement; 9, comment:# Make a dictionary of nodes based on source/target as a key; 10, expression_statement; 11, for_statement; 12, comment:# Const...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 4, 6; 4, 7; 4, 8; 4, 9; 4, 10; 4, 11; 4, 12; 4, 13; 4, 14; 6, 15; 7, 16; 8, 17; 8, 18; 8, 19; 8, 20; 10, 21; 11, 22; 11, 23; 11, 24; 13, 25; 14, 26; 16, 27; 16, 28; 18, 29; 18, 30; 20, 31; 20, 32; 20, 33; 20, 34; 20, 35; 21, 36; 21, 37; 22, 38; 22, 39; 23, 40; 23, 41; 24, 42; 24, 43; 25, 4...
def _get_node_groups(self): """Return a list of node id lists that are topologically identical. First construct a node_dict which is keyed to the node id and has a value which is a dict with keys 'sources' and 'targets'. The 'sources' and 'targets' each contain a list of tuples ...
0, module; 1, function_definition; 2, function_name:get_statements; 3, parameters; 4, block; 5, default_parameter; 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...
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; 4, 19; 4, 20; 4, 21; 5, 22; 5, 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; 16, 45; ...
def get_statements(subject=None, object=None, agents=None, stmt_type=None, use_exact_type=False, persist=True, timeout=None, simple_response=False, ev_limit=10, best_first=True, tries=2, max_stmts=None): """Get a processor for the INDRA DB web API matching gi...
0, module; 1, function_definition; 2, function_name:get_statements_by_hash; 3, parameters; 4, block; 5, identifier:hash_list; 6, default_parameter; 7, default_parameter; 8, default_parameter; 9, expression_statement; 10, if_statement; 11, if_statement; 12, if_statement; 13, if_statement; 14, expression_statement; 15, r...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 3, 7; 3, 8; 4, 9; 4, 10; 4, 11; 4, 12; 4, 13; 4, 14; 4, 15; 6, 16; 6, 17; 7, 18; 7, 19; 8, 20; 8, 21; 9, 22; 10, 23; 10, 24; 11, 25; 11, 26; 12, 27; 12, 28; 13, 29; 13, 30; 14, 31; 15, 32; 23, 33; 24, 34; 25, 35; 26, 36; 27, 37; 27, 38; 28, 39; 29, 40; 30, 41; 31, 42; 31, 43; 32, 44;...
def get_statements_by_hash(hash_list, ev_limit=100, best_first=True, tries=2): """Get fully formed statements from a list of hashes. Parameters ---------- hash_list : list[int or str] A list of statement hashes. ev_limit : int or None Limit the amount of evidence returned per Statem...
0, module; 1, function_definition; 2, function_name:get_statements_for_paper; 3, parameters; 4, block; 5, identifier:ids; 6, default_parameter; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, expression_statement; 11, expression_statement; 12, expression_statement; 13, expression_statement; 14, re...
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; 13, 26; 14, 27; 24, 28; 24, 29; 25, 30; 25, 31; 26, 32; 26, 33; 27, 34; 27, 35; 29, 36; 29, 37; 31, 38; 31, 39; 33, 40; 33, 41; 35, 42; 36, 43; 36, 44;...
def get_statements_for_paper(ids, ev_limit=10, best_first=True, tries=2, max_stmts=None): """Get the set of raw Statements extracted from a paper given by the id. Parameters ---------- ids : list[(<id type>, <id value>)] A list of tuples with ids and their type. The...
0, module; 1, function_definition; 2, function_name:process_directory_statements_sorted_by_pmid; 3, parameters; 4, block; 5, identifier:directory_name; 6, expression_statement; 7, expression_statement; 8, expression_statement; 9, for_statement; 10, return_statement; 11, comment:"""Processes a directory filled with CSXM...
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; 15, 22; 15, 23; 16, 24; 19, 25; 19, 26; 21, 27; 21, 28; 22, 29; 22, 30; 24, 31; 26, 32; 28, 33; 28, 34; 31, 35; 31, 36; 34, 37; 34, 38; 35, 39; 35, 40; 36, 41; 39, 42; 39, 43; 4...
def process_directory_statements_sorted_by_pmid(directory_name): """Processes a directory filled with CSXML files, first normalizing the character encoding to utf-8, and then processing into INDRA statements sorted by pmid. Parameters ---------- directory_name : str The name of a direct...
0, module; 1, function_definition; 2, function_name:process_file_sorted_by_pmid; 3, parameters; 4, block; 5, identifier:file_name; 6, expression_statement; 7, expression_statement; 8, expression_statement; 9, for_statement; 10, return_statement; 11, comment:"""Processes a file and returns a dictionary mapping pmids to ...
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; 15, 22; 15, 23; 16, 24; 19, 25; 19, 26; 21, 27; 21, 28; 22, 29; 22, 30; 24, 31; 26, 32; 28, 33; 28, 34; 31, 35; 31, 36; 34, 37; 34, 38; 35, 39; 35, 40; 36, 41; 39, 42; 39, 43; 4...
def process_file_sorted_by_pmid(file_name): """Processes a file and returns a dictionary mapping pmids to a list of statements corresponding to that pmid. Parameters ---------- file_name : str A csxml file to process Returns ------- s_dict : dict Dictionary mapping pmid...
0, module; 1, function_definition; 2, function_name:flatten_stmts; 3, parameters; 4, block; 5, identifier:stmts; 6, expression_statement; 7, expression_statement; 8, for_statement; 9, return_statement; 10, comment:"""Return the full set of unique stms in a pre-assembled stmt graph. The flattened list of statements...
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; 14, 18; 15, 19; 15, 20; 17, 21; 17, 22; 18, 23; 18, 24; 20, 25; 22, 26; 23, 27; 23, 28; 24, 29; 24, 30; 29, 31; 30, 32; 31, 33; 31, 34; 32, 35; 32, 36; 34, 37; 34, 38; 36, 39; 36, 40; 38, 41; 39, 42; 39, 43; ...
def flatten_stmts(stmts): """Return the full set of unique stms in a pre-assembled stmt graph. The flattened list of statements returned by this function can be compared to the original set of unique statements to make sure no statements have been lost during the preassembly process. Parameters ...
0, module; 1, function_definition; 2, function_name:combine_duplicate_stmts; 3, parameters; 4, block; 5, identifier:stmts; 6, expression_statement; 7, comment:# Helper function to get a list of evidence matches keys; 8, function_definition; 9, comment:# Iterate over groups of duplicate statements; 10, expression_statem...
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; 8, 14; 8, 15; 8, 16; 10, 17; 11, 18; 11, 19; 11, 20; 12, 21; 15, 22; 16, 23; 16, 24; 16, 25; 17, 26; 17, 27; 18, 28; 18, 29; 19, 30; 19, 31; 20, 32; 20, 33; 20, 34; 20, 35; 20, 36; 20, 37; 20, 38; 20, 39; 20, 40; 20, 41; 20, 42; 23, 43; 2...
def combine_duplicate_stmts(stmts): """Combine evidence from duplicate Statements. Statements are deemed to be duplicates if they have the same key returned by the `matches_key()` method of the Statement class. This generally means that statements must be identical in terms of their ...
0, module; 1, function_definition; 2, function_name:sort_data; 3, parameters; 4, block; 5, identifier:data; 6, identifier:cols; 7, expression_statement; 8, return_statement; 9, comment:"""Sort `data` rows and order columns"""; 10, call; 11, attribute; 12, argument_list; 13, subscript; 14, identifier:reset_index; 15, ke...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 4, 7; 4, 8; 7, 9; 8, 10; 10, 11; 10, 12; 11, 13; 11, 14; 12, 15; 13, 16; 13, 17; 15, 18; 15, 19; 16, 20; 16, 21; 17, 22; 17, 23; 20, 24; 20, 25; 21, 26; 23, 27; 27, 28
def sort_data(data, cols): """Sort `data` rows and order columns""" return data.sort_values(cols)[cols + ['value']].reset_index(drop=True)
0, module; 1, function_definition; 2, function_name:check_internal_consistency; 3, parameters; 4, block; 5, identifier:self; 6, dictionary_splat_pattern; 7, expression_statement; 8, expression_statement; 9, for_statement; 10, return_statement; 11, identifier:kwargs; 12, comment:"""Check whether the database is internal...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 4, 7; 4, 8; 4, 9; 4, 10; 6, 11; 7, 12; 8, 13; 9, 14; 9, 15; 9, 16; 10, 17; 13, 18; 13, 19; 15, 20; 15, 21; 16, 22; 16, 23; 16, 24; 16, 25; 17, 26; 17, 27; 17, 28; 20, 29; 20, 30; 22, 31; 23, 32; 23, 33; 24, 34; 25, 35; 25, 36; 31, 37; 31, 38; 32, 39; 32, 40; 33, 41; 34, 42; 34, 43; 3...
def check_internal_consistency(self, **kwargs): """Check whether the database is internally consistent We check that all variables are equal to the sum of their sectoral components and that all the regions add up to the World total. If the check is passed, None is returned, otherwise a ...
0, module; 1, function_definition; 2, function_name:tag_create; 3, parameters; 4, block; 5, identifier:self; 6, identifier:label; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, default_parameter; 12, expression_statement; 13, expression_statement; 14, comment:# filter input...
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; 7, 26; 7, 27; 8, 28; 8, 29; 9, 30; 9, 31; 10, 32; 10, 33; 11, 34; 11, 35; 12, 36; 13, 37; 15, 38; 16, 39; 16, 40; 16, 41; 16, 42; 18, 43; 19, 44; 19, 45; ...
def tag_create(self, label, instances=None, domains=None, nodebalancers=None, volumes=None, entities=[]): """ Creates a new Tag and optionally applies it to the given entities. :param label: The label for the new Tag :type label: str :param entities: A list of...
0, module; 1, function_definition; 2, function_name:insert_graph; 3, parameters; 4, block; 5, identifier:cur; 6, identifier:nodelist; 7, identifier:edgelist; 8, default_parameter; 9, expression_statement; 10, if_statement; 11, if_statement; 12, if_statement; 13, if_statement; 14, expression_statement; 15, expression_st...
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; 8, 16; 8, 17; 9, 18; 10, 19; 10, 20; 11, 21; 11, 22; 12, 23; 12, 24; 13, 25; 13, 26; 14, 27; 15, 28; 19, 29; 19, 30; 20, 31; 21, 32; 21, 33; 22, 34; 23, 35; 23, 36; 24, 37; 25, 38; 25, 39; 26, 40; 27, 41; 27, 42; 28, 43; 28,...
def insert_graph(cur, nodelist, edgelist, encoded_data=None): """Insert a graph into the cache. A graph is stored by number of nodes, number of edges and a json-encoded list of edges. Args: cur (:class:`sqlite3.Cursor`): An sqlite3 cursor. This function is meant to be run within a ...
0, module; 1, function_definition; 2, function_name:embed_ising; 3, parameters; 4, block; 5, identifier:source_h; 6, identifier:source_J; 7, identifier:embedding; 8, identifier:target_adjacency; 9, default_parameter; 10, expression_statement; 11, expression_statement; 12, expression_statement; 13, expression_statement;...
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; 14, 21; 18, 22; 18, 23; 19, 24; 19, 25; 20, 26; 20, 27; 21, 28; 21, 29; 23, 30; 23, 31; 25, 32; 25, 33; 26, 34; 26, 35; 26, 36; 27, 37; 27, 38; 30, 39; 30, 40; 31, 41; 31, 42; 33, 43; 3...
def embed_ising(source_h, source_J, embedding, target_adjacency, chain_strength=1.0): """Embed an Ising problem onto a target graph. Args: source_h (dict[variable, bias]/list[bias]): Linear biases of the Ising problem. If a list, the list's indices are used as variable labels. ...
0, module; 1, function_definition; 2, function_name:add_identity; 3, parameters; 4, block; 5, identifier:cls; 6, identifier:db; 7, identifier:identity; 8, identifier:backend; 9, expression_statement; 10, expression_statement; 11, try_statement; 12, if_statement; 13, return_statement; 14, comment:""" Load and identity l...
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; 10, 15; 11, 16; 11, 17; 11, 18; 11, 19; 11, 20; 12, 21; 12, 22; 13, 23; 15, 24; 15, 25; 16, 26; 16, 27; 16, 28; 16, 29; 17, 30; 17, 31; 18, 32; 18, 33; 19, 34; 19, 35; 20, 36; 20, 37; 21, 38; 21, 39; 22, 40; 26, 41; 27, 42; 28, 43;...
def add_identity(cls, db, identity, backend): """ Load and identity list from backend in Sorting Hat """ uuid = None try: uuid = api.add_identity(db, backend, identity['email'], identity['name'], identity['username']) logger.debug("Ne...
0, module; 1, function_definition; 2, function_name:add_identities; 3, parameters; 4, block; 5, identifier:cls; 6, identifier:db; 7, identifier:identities; 8, identifier:backend; 9, expression_statement; 10, expression_statement; 11, expression_statement; 12, for_statement; 13, expression_statement; 14, comment:""" Loa...
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; 10, 15; 11, 16; 12, 17; 12, 18; 12, 19; 13, 20; 15, 21; 15, 22; 16, 23; 16, 24; 19, 25; 20, 26; 20, 27; 21, 28; 21, 29; 22, 30; 25, 31; 25, 32; 26, 33; 26, 34; 27, 35; 27, 36; 31, 37; 31, 38; 32, 39; 32, 40; 37, 41; 38, 42; 39, 43;...
def add_identities(cls, db, identities, backend): """ Load identities list from backend in Sorting Hat """ logger.info("Adding the identities to SortingHat") total = 0 for identity in identities: try: cls.add_identity(db, identity, backend) ...
0, module; 1, function_definition; 2, function_name:remove_identity; 3, parameters; 4, block; 5, identifier:cls; 6, identifier:sh_db; 7, identifier:ident_id; 8, expression_statement; 9, expression_statement; 10, try_statement; 11, return_statement; 12, comment:"""Delete an identity from SortingHat. :param sh_d...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 3, 7; 4, 8; 4, 9; 4, 10; 4, 11; 8, 12; 9, 13; 10, 14; 10, 15; 11, 16; 13, 17; 13, 18; 14, 19; 14, 20; 14, 21; 15, 22; 15, 23; 19, 24; 20, 25; 21, 26; 22, 27; 22, 28; 23, 29; 24, 30; 24, 31; 25, 32; 25, 33; 26, 34; 26, 35; 28, 36; 29, 37; 30, 38; 30, 39; 31, 40; 31, 41; 32, 42; 32, 43...
def remove_identity(cls, sh_db, ident_id): """Delete an identity from SortingHat. :param sh_db: SortingHat database :param ident_id: identity identifier """ success = False try: api.delete_identity(sh_db, ident_id) logger.debug("Identity %s delete...
0, module; 1, function_definition; 2, function_name:remove_unique_identity; 3, parameters; 4, block; 5, identifier:cls; 6, identifier:sh_db; 7, identifier:uuid; 8, expression_statement; 9, expression_statement; 10, try_statement; 11, return_statement; 12, comment:"""Delete a unique identity from SortingHat. :p...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 3, 7; 4, 8; 4, 9; 4, 10; 4, 11; 8, 12; 9, 13; 10, 14; 10, 15; 11, 16; 13, 17; 13, 18; 14, 19; 14, 20; 14, 21; 15, 22; 15, 23; 19, 24; 20, 25; 21, 26; 22, 27; 22, 28; 23, 29; 24, 30; 24, 31; 25, 32; 25, 33; 26, 34; 26, 35; 28, 36; 29, 37; 30, 38; 30, 39; 31, 40; 31, 41; 32, 42; 32, 43...
def remove_unique_identity(cls, sh_db, uuid): """Delete a unique identity from SortingHat. :param sh_db: SortingHat database :param uuid: Unique identity identifier """ success = False try: api.delete_unique_identity(sh_db, uuid) logger.debug("Uni...
0, module; 1, function_definition; 2, function_name:unique_identities; 3, parameters; 4, block; 5, identifier:cls; 6, identifier:sh_db; 7, expression_statement; 8, try_statement; 9, comment:"""List the unique identities available in SortingHat. :param sh_db: SortingHat database """; 10, block; 11, exce...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 4, 7; 4, 8; 7, 9; 8, 10; 8, 11; 10, 12; 11, 13; 11, 14; 12, 15; 12, 16; 12, 17; 13, 18; 13, 19; 14, 20; 16, 21; 16, 22; 17, 23; 19, 24; 20, 25; 21, 26; 21, 27; 22, 28; 23, 29; 25, 30; 25, 31; 29, 32; 30, 33; 30, 34; 31, 35; 31, 36; 36, 37; 36, 38; 38, 39
def unique_identities(cls, sh_db): """List the unique identities available in SortingHat. :param sh_db: SortingHat database """ try: for unique_identity in api.unique_identities(sh_db): yield unique_identity except Exception as e: logger.d...
0, module; 1, function_definition; 2, function_name:refresh_identities; 3, parameters; 4, block; 5, identifier:enrich_backend; 6, default_parameter; 7, default_parameter; 8, expression_statement; 9, function_definition; 10, expression_statement; 11, expression_statement; 12, expression_statement; 13, expression_stateme...
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; 9, 22; 9, 23; 10, 24; 11, 25; 12, 26; 13, 27; 14, 28; 14, 29; 14, 30; 14, 31; 15, 32; 22, 33; 23, 34; 24, 35; 24, 36; 25, 37; 25, 38; 26, 39; 26, 40; 27, 41; 27, 42; 28, 43; 28, 44; ...
def refresh_identities(enrich_backend, author_field=None, author_values=None): """Refresh identities in enriched index. Retrieve items from the enriched index corresponding to enrich_backend, and update their identities information, with fresh data from the SortingHat database. Instead of the whol...
0, module; 1, function_definition; 2, function_name:delete_orphan_unique_identities; 3, parameters; 4, block; 5, identifier:es; 6, identifier:sortinghat_db; 7, identifier:current_data_source; 8, identifier:active_data_sources; 9, expression_statement; 10, function_definition; 11, function_definition; 12, function_defin...
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; 9, 23; 10, 24; 10, 25; 10, 26; 11, 27; 11, 28; 11, 29; 12, 30; 12, 31; 12, 32; 13, 33; 13, 34; 13, 35; 14, 36; 15, 37; 16, 38; 18, 39; 18, 40; 18, 41; 18, 42; 20, 43; 20, 44; ...
def delete_orphan_unique_identities(es, sortinghat_db, current_data_source, active_data_sources): """Delete all unique identities which appear in SortingHat, but not in the IDENTITIES_INDEX. :param es: ElasticSearchDSL object :param sortinghat_db: instance of the SortingHat database :param current_data...
0, module; 1, function_definition; 2, function_name:delete_inactive_unique_identities; 3, parameters; 4, block; 5, identifier:es; 6, identifier:sortinghat_db; 7, identifier:before_date; 8, expression_statement; 9, expression_statement; 10, expression_statement; 11, expression_statement; 12, if_statement; 13, expression...
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; 8, 16; 9, 17; 10, 18; 11, 19; 12, 20; 12, 21; 13, 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; 22, 36; 22, 37; 23, 38; 23, 39; 24, 40; 24, 41; 24, 42; 24, 43; 25...
def delete_inactive_unique_identities(es, sortinghat_db, before_date): """Select the unique identities not seen before `before_date` and delete them from SortingHat. :param es: ElasticSearchDSL object :param sortinghat_db: instance of the SortingHat database :param before_date: datetime str to filt...
0, module; 1, function_definition; 2, function_name:retain_identities; 3, parameters; 4, block; 5, identifier:retention_time; 6, identifier:es_enrichment_url; 7, identifier:sortinghat_db; 8, identifier:data_source; 9, identifier:active_data_sources; 10, expression_statement; 11, expression_statement; 12, expression_sta...
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; 10, 18; 11, 19; 12, 20; 13, 21; 15, 22; 17, 23; 19, 24; 19, 25; 20, 26; 20, 27; 21, 28; 21, 29; 22, 30; 22, 31; 23, 32; 23, 33; 25, 34; 25, 35; 27, 36; 27, 37; 29, 38; 29, 39; 31, 40; 31, 41; 31, 42; 33, 43; 33...
def retain_identities(retention_time, es_enrichment_url, sortinghat_db, data_source, active_data_sources): """Select the unique identities not seen before `retention_time` and delete them from SortingHat. Furthermore, it deletes also the orphan unique identities, those ones stored in SortingHat but not in I...
0, module; 1, function_definition; 2, function_name:get_review_sh; 3, parameters; 4, block; 5, identifier:self; 6, identifier:revision; 7, identifier:item; 8, expression_statement; 9, expression_statement; 10, expression_statement; 11, expression_statement; 12, return_statement; 13, comment:""" Add sorting hat enrichme...
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; 12, 17; 14, 18; 14, 19; 15, 20; 15, 21; 16, 22; 16, 23; 19, 24; 19, 25; 21, 26; 21, 27; 23, 28; 23, 29; 24, 30; 24, 31; 25, 32; 26, 33; 26, 34; 27, 35; 28, 36; 28, 37; 29, 38; 29, 39; 35, 40; 35, 41; 41, 42; 41, 43;...
def get_review_sh(self, revision, item): """ Add sorting hat enrichment fields for the author of the revision """ identity = self.get_sh_identity(revision) update = parser.parse(item[self.get_field_date()]) erevision = self.get_item_sh_fields(identity, update) return erevision
0, module; 1, function_definition; 2, function_name:get_item_sh; 3, parameters; 4, block; 5, identifier:self; 6, identifier:item; 7, default_parameter; 8, default_parameter; 9, expression_statement; 10, expression_statement; 11, comment:# Item enriched; 12, expression_statement; 13, if_statement; 14, if_statement; 15, ...
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; 7, 21; 7, 22; 8, 23; 8, 24; 9, 25; 10, 26; 12, 27; 13, 28; 13, 29; 14, 30; 14, 31; 14, 32; 15, 33; 16, 34; 16, 35; 16, 36; 18, 37; 19, 38; 19, 39; 20, 40; 26, 41; 26, 42; 27, 43; 27, 44; 28...
def get_item_sh(self, item, roles=None, date_field=None): """ Add sorting hat enrichment fields for different roles If there are no roles, just add the author fields. """ eitem_sh = {} # Item enriched author_field = self.get_field_author() if not roles: ...
0, module; 1, function_definition; 2, function_name:get_sh_ids; 3, parameters; 4, block; 5, identifier:self; 6, identifier:identity; 7, identifier:backend_name; 8, expression_statement; 9, comment:# Convert the dict to tuple so it is hashable; 10, expression_statement; 11, expression_statement; 12, return_statement; 13...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 3, 7; 4, 8; 4, 9; 4, 10; 4, 11; 4, 12; 8, 13; 10, 14; 11, 15; 12, 16; 14, 17; 14, 18; 15, 19; 15, 20; 18, 21; 18, 22; 20, 23; 20, 24; 22, 25; 23, 26; 23, 27; 24, 28; 24, 29; 25, 30; 25, 31; 30, 32; 30, 33
def get_sh_ids(self, identity, backend_name): """ Return the Sorting Hat id and uuid for an identity """ # Convert the dict to tuple so it is hashable identity_tuple = tuple(identity.items()) sh_ids = self.__get_sh_ids_cache(identity_tuple, backend_name) return sh_ids
0, module; 1, function_definition; 2, function_name:get_sh_identity; 3, parameters; 4, block; 5, identifier:self; 6, identifier:item; 7, default_parameter; 8, expression_statement; 9, function_definition; 10, expression_statement; 11, for_statement; 12, expression_statement; 13, comment:# by default a specific user dic...
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; 7, 17; 7, 18; 8, 19; 9, 20; 9, 21; 9, 22; 10, 23; 11, 24; 11, 25; 11, 26; 11, 27; 12, 28; 14, 29; 14, 30; 15, 31; 16, 32; 21, 33; 21, 34; 22, 35; 22, 36; 22, 37; 22, 38; 22, 39; 23, 40; 23, 41; 25, 42; 25, 43; 25, 44;...
def get_sh_identity(self, item, identity_field=None): """ Return a Sorting Hat identity using bugzilla user data """ def fill_list_identity(identity, user_list_data): """ Fill identity with user data in first item in list """ identity['username'] = user_list_data[0]['__text__'] ...
0, module; 1, function_definition; 2, function_name:areas_of_code; 3, parameters; 4, block; 5, identifier:git_enrich; 6, identifier:in_conn; 7, identifier:out_conn; 8, default_parameter; 9, expression_statement; 10, expression_statement; 11, expression_statement; 12, return_statement; 13, identifier:block_size; 14, int...
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; 16, 19; 16, 20; 17, 21; 17, 22; 20, 23; 20, 24; 22, 25; 22, 26; 24, 27; 24, 28; 24, 29; 24, 30; 25, 31; 25, 32; 27, 33; 27, 34; 28, 35; 28, 36; 29, 37; 29, 38; 30, 39; 30, 40
def areas_of_code(git_enrich, in_conn, out_conn, block_size=100): """Build and index for areas of code from a given Perceval RAW index. :param block_size: size of items block. :param git_enrich: GitEnrich object to deal with SortingHat affiliations. :param in_conn: ESPandasConnector to read from. :...
0, module; 1, function_definition; 2, function_name:get_my_feed; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, expression_statement; 11, expression_statement; 12, return_statement; 13, identifier:limit; 14, integer:150; 15, ident...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 3, 7; 3, 8; 3, 9; 4, 10; 4, 11; 4, 12; 6, 13; 6, 14; 7, 15; 7, 16; 8, 17; 8, 18; 9, 19; 9, 20; 10, 21; 11, 22; 12, 23; 22, 24; 22, 25; 23, 26; 23, 27; 25, 28; 25, 29; 26, 30; 26, 31; 27, 32; 27, 33; 28, 34; 28, 35; 29, 36; 29, 37; 29, 38; 36, 39; 36, 40; 37, 41; 37, 42; 38, 43; 38, 4...
def get_my_feed(self, limit=150, offset=20, sort="updated", nid=None): """Get my feed :type limit: int :param limit: Number of posts from feed to get, starting from ``offset`` :type offset: int :param offset: Offset starting from bottom of feed :type sort: str :p...
0, module; 1, function_definition; 2, function_name:filter_feed; 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, expression_statement; 13, assert_statement; 14, if_statement; 15, if_sta...
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; 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; 13, 31; 14, 32; 14, 33; 15, 34; 15, 35; 15, 36; 15, 37; 16, 38; 17, 39; 31, 40; 31, 41; 33, 42; 35, 43; 36, 44; 36...
def filter_feed(self, updated=False, following=False, folder=False, filter_folder="", sort="updated", nid=None): """Get filtered feed Only one filter type (updated, following, folder) is possible. :type nid: str :param nid: This is the ID of the network to get the ...
0, module; 1, function_definition; 2, function_name:minus; 3, parameters; 4, block; 5, identifier:repo_list_a; 6, identifier:repo_list_b; 7, expression_statement; 8, expression_statement; 9, for_statement; 10, expression_statement; 11, for_statement; 12, return_statement; 13, comment:"""Method to create a list of repos...
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; 9, 16; 9, 17; 10, 18; 11, 19; 11, 20; 11, 21; 12, 22; 14, 23; 14, 24; 17, 25; 18, 26; 18, 27; 21, 28; 24, 29; 24, 30; 25, 31; 27, 32; 27, 33; 28, 34; 28, 35; 30, 36; 31, 37; 31, 38; 34, 39; 35, 40; 35, 41; 36, 42; 37, 43; 37...
def minus(repo_list_a, repo_list_b): """Method to create a list of repositories such that the repository belongs to repo list a but not repo list b. In an ideal scenario we should be able to do this by set(a) - set(b) but as GithubRepositories have shown that set() on them is not reliab...
0, module; 1, function_definition; 2, function_name:search; 3, parameters; 4, block; 5, identifier:self; 6, identifier:text; 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, id...
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; 28, 31; 28, 32; 30, 33; 30, 34; 32, 35; 32, 36; 33, 37; 33, 38; 34, 39; 34, 40; 34, 41; 34, 42; 34, 43; 35, 4...
def search(self, text, limit=1000, order_by=None, sort_order=None, filter=None): """ Do a fulltext search for series in the Fred dataset. Returns information about matching series in a DataFrame. Parameters ---------- text : str text to do fulltext search on, e.g., '...
0, module; 1, function_definition; 2, function_name:search_by_release; 3, parameters; 4, block; 5, identifier:self; 6, identifier:release_id; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, expression_statement; 12, expression_statement; 13, expression_statement; 14, if_stat...
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; 7, 16; 7, 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; 25, 30; 25, 31; 26, 32; 26, 33; 27, 34; 27, 35; 28, 36; 31, 37; 31, 38; 33, 39; 33, 40; 36, 41; 38, 42; 38, 43; 39, 44...
def search_by_release(self, release_id, limit=0, order_by=None, sort_order=None, filter=None): """ Search for series that belongs to a release id. Returns information about matching series in a DataFrame. Parameters ---------- release_id : int release id, e.g., 151 ...
0, module; 1, function_definition; 2, function_name:search_by_category; 3, parameters; 4, block; 5, identifier:self; 6, identifier:category_id; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, expression_statement; 12, expression_statement; 13, expression_statement; 14, if_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; 7, 16; 7, 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; 25, 30; 25, 31; 26, 32; 26, 33; 27, 34; 27, 35; 28, 36; 31, 37; 31, 38; 33, 39; 33, 40; 36, 41; 38, 42; 38, 43; 39, 44...
def search_by_category(self, category_id, limit=0, order_by=None, sort_order=None, filter=None): """ Search for series that belongs to a category id. Returns information about matching series in a DataFrame. Parameters ---------- category_id : int category id, e.g., ...
0, module; 1, function_definition; 2, function_name:format_name; 3, parameters; 4, block; 5, identifier:subject; 6, expression_statement; 7, if_statement; 8, return_statement; 9, comment:"""Convert a subject into the canonical form for distinguished names. This function does not take care of sorting the subject in...
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; 14, 18; 14, 19; 15, 20; 16, 21; 17, 22; 19, 23; 19, 24; 20, 25; 20, 26; 22, 27; 22, 28; 26, 29; 26, 30; 27, 31; 27, 32; 28, 33; 29, 34; 29, 35; 30, 36; 30, 37; 31, 38; 33, 39; 33, 40; 34, 41; 34, 42; 35, 4...
def format_name(subject): """Convert a subject into the canonical form for distinguished names. This function does not take care of sorting the subject in any meaningful order. Examples:: >>> format_name([('CN', 'example.com'), ]) '/CN=example.com' >>> format_name([('CN', 'example...
0, module; 1, function_definition; 2, function_name:parse_name; 3, parameters; 4, block; 5, identifier:name; 6, expression_statement; 7, expression_statement; 8, if_statement; 9, try_statement; 10, comment:# Check that no OIDs not in MULTIPLE_OIDS occur more then once; 11, for_statement; 12, return_statement; 13, 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; 6, 13; 7, 14; 8, 15; 8, 16; 8, 17; 9, 18; 9, 19; 11, 20; 11, 21; 11, 22; 12, 23; 14, 24; 14, 25; 15, 26; 17, 27; 18, 28; 19, 29; 19, 30; 20, 31; 20, 32; 21, 33; 21, 34; 22, 35; 23, 36; 23, 37; 25, 38; 25, 39; 27, 40; 28, 41; 29, 42; 29, 43; 30, ...
def parse_name(name): """Parses a subject string as used in OpenSSLs command line utilities. The ``name`` is expected to be close to the subject format commonly used by OpenSSL, for example ``/C=AT/L=Vienna/CN=example.com/emailAddress=user@example.com``. The function does its best to be lenient on devi...
0, module; 1, function_definition; 2, function_name:prune_overridden; 3, parameters; 4, block; 5, identifier:ansi_string; 6, expression_statement; 7, expression_statement; 8, comment:# Sequences with multiple color codes.; 9, for_statement; 10, return_statement; 11, comment:"""Remove color codes that are rendered ineff...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 4, 6; 4, 7; 4, 8; 4, 9; 4, 10; 6, 11; 7, 12; 9, 13; 9, 14; 9, 15; 10, 16; 12, 17; 12, 18; 13, 19; 13, 20; 15, 21; 15, 22; 15, 23; 15, 24; 15, 25; 15, 26; 15, 27; 15, 28; 18, 29; 18, 30; 21, 31; 23, 32; 23, 33; 25, 34; 25, 35; 25, 36; 27, 37; 28, 38; 28, 39; 30, 40; 30, 41; 30, 42; 31, 43; ...
def prune_overridden(ansi_string): """Remove color codes that are rendered ineffective by subsequent codes in one escape sequence then sort codes. :param str ansi_string: Incoming ansi_string with ANSI color codes. :return: Color string with pruned color sequences. :rtype: str """ multi_seqs =...
0, module; 1, function_definition; 2, function_name:LDA_discriminants; 3, parameters; 4, block; 5, identifier:x; 6, identifier:labels; 7, expression_statement; 8, comment:# validate inputs; 9, try_statement; 10, comment:# make the LDA; 11, expression_statement; 12, return_statement; 13, comment:""" Linear Discrimin...
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; 9, 14; 9, 15; 11, 16; 12, 17; 14, 18; 15, 19; 16, 20; 16, 21; 17, 22; 17, 23; 18, 24; 19, 25; 20, 26; 20, 27; 21, 28; 21, 29; 23, 30; 23, 31; 24, 32; 24, 33; 25, 34; 29, 35; 29, 36; 30, 37; 30, 38; 33, 39; 33, 40; 34, 41; 34, 42; 37, 43; ...
def LDA_discriminants(x, labels): """ Linear Discriminant Analysis helper for determination how many columns of data should be reduced. **Args:** * `x` : input matrix (2d array), every row represents new sample * `labels` : list of labels (iterable), every item should be label for \ s...
0, module; 1, function_definition; 2, function_name:PCA_components; 3, parameters; 4, block; 5, identifier:x; 6, expression_statement; 7, comment:# validate inputs; 8, try_statement; 9, comment:# eigen values and eigen vectors of data covariance matrix; 10, expression_statement; 11, comment:# sort eigen vectors accordi...
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; 8, 16; 8, 17; 10, 18; 12, 19; 14, 20; 16, 21; 17, 22; 18, 23; 18, 24; 19, 25; 19, 26; 20, 27; 20, 28; 21, 29; 22, 30; 23, 31; 23, 32; 24, 33; 24, 34; 26, 35; 26, 36; 28, 37; 28, 38; 29, 39; 29, 40; 30, 41; 33, 42; 33, 43; 34...
def PCA_components(x): """ Principal Component Analysis helper to check out eigenvalues of components. **Args:** * `x` : input matrix (2d array), every row represents new sample **Returns:** * `components`: sorted array of principal components eigenvalues """ # validat...
0, module; 1, function_definition; 2, function_name:file_search; 3, parameters; 4, block; 5, identifier:self; 6, identifier:query; 7, default_parameter; 8, default_parameter; 9, expression_statement; 10, expression_statement; 11, try_statement; 12, return_statement; 13, identifier:offset; 14, None; 15, identifier:timeo...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 3, 7; 3, 8; 4, 9; 4, 10; 4, 11; 4, 12; 7, 13; 7, 14; 8, 15; 8, 16; 9, 17; 10, 18; 11, 19; 11, 20; 12, 21; 18, 22; 18, 23; 19, 24; 20, 25; 20, 26; 21, 27; 21, 28; 23, 29; 23, 30; 24, 31; 25, 32; 25, 33; 26, 34; 28, 35; 30, 36; 30, 37; 30, 38; 31, 39; 31, 40; 32, 41; 32, 42; 33, 43; 34...
def file_search(self, query, offset=None, timeout=None): """ Search for samples. In addition to retrieving all information on a particular file, VirusTotal allows you to perform what we call "advanced reverse searches". Reverse searches take you from a file property to a list of files that ...
0, module; 1, function_definition; 2, function_name:sort; 3, parameters; 4, type; 5, block; 6, typed_parameter; 7, generic_type; 8, expression_statement; 9, return_statement; 10, identifier:records; 11, type; 12, identifier:List; 13, type_parameter; 14, string:"Sort records into a canonical order, suitable for comparis...
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
def sort(records: Sequence[Record]) -> List[Record]: "Sort records into a canonical order, suitable for comparison." return sorted(records, key=_record_key)
0, module; 1, function_definition; 2, function_name:hclust_linearize; 3, parameters; 4, block; 5, identifier:U; 6, expression_statement; 7, import_from_statement; 8, expression_statement; 9, return_statement; 10, comment:"""Sorts the rows of a matrix by hierarchical clustering. Parameters: U (ndarray) : ma...
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; 11, 16; 12, 17; 13, 18; 13, 19; 14, 20; 14, 21; 19, 22; 19, 23; 20, 24; 20, 25; 21, 26; 22, 27; 22, 28; 23, 29; 26, 30; 26, 31; 30, 32; 30, 33; 31, 34; 31, 35
def hclust_linearize(U): """Sorts the rows of a matrix by hierarchical clustering. Parameters: U (ndarray) : matrix of data Returns: prm (ndarray) : permutation of the rows """ from scipy.cluster import hierarchy Z = hierarchy.ward(U) return hierarchy.leaves_list(hierarchy...
0, module; 1, function_definition; 2, function_name:randn_ktensor; 3, parameters; 4, block; 5, identifier:shape; 6, identifier:rank; 7, default_parameter; 8, default_parameter; 9, expression_statement; 10, comment:# Check input.; 11, expression_statement; 12, comment:# Draw low-rank factor matrices with i.i.d. Gaussian...
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; 7, 15; 7, 16; 8, 17; 8, 18; 9, 19; 11, 20; 13, 21; 14, 22; 20, 23; 20, 24; 21, 25; 21, 26; 22, 27; 22, 28; 24, 29; 24, 30; 26, 31; 26, 32; 28, 33; 28, 34; 30, 35; 32, 36; 36, 37; 36, 38; 37, 39; 37, 40; 38, 41; 38, 42; 39, 43; 39, ...
def randn_ktensor(shape, rank, norm=None, random_state=None): """ Generates a random N-way tensor with rank R, where the entries are drawn from the standard normal distribution. Parameters ---------- shape : tuple shape of the tensor rank : integer rank of the tensor n...
0, module; 1, function_definition; 2, function_name:sort_by_number_values; 3, parameters; 4, comment:# pragma: no cover, looks like not used!; 5, block; 6, identifier:x00; 7, identifier:y00; 8, expression_statement; 9, if_statement; 10, if_statement; 11, comment:# So is equal; 12, return_statement; 13, comment:"""Compa...
0, 1; 1, 2; 1, 3; 1, 4; 1, 5; 3, 6; 3, 7; 5, 8; 5, 9; 5, 10; 5, 11; 5, 12; 8, 13; 9, 14; 9, 15; 10, 16; 10, 17; 12, 18; 14, 19; 14, 20; 15, 21; 16, 22; 16, 23; 17, 24; 19, 25; 19, 26; 20, 27; 20, 28; 21, 29; 22, 30; 22, 31; 23, 32; 23, 33; 24, 34; 26, 35; 28, 36; 31, 37; 33, 38; 34, 39
def sort_by_number_values(x00, y00): # pragma: no cover, looks like not used! """Compare x00, y00 base on number of values :param x00: first elem to compare :type x00: list :param y00: second elem to compare :type y00: list :return: x00 > y00 (-1) if len(x00) > len(y00), x00 == y00 (0) if id e...
0, module; 1, function_definition; 2, function_name:get_scheduler_ordered_list; 3, parameters; 4, block; 5, identifier:self; 6, identifier:realm; 7, expression_statement; 8, comment:# Get the schedulers for the required realm; 9, expression_statement; 10, for_statement; 11, comment:# Now we sort the schedulers so we ta...
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; 7, 23; 9, 24; 10, 25; 10, 26; 10, 27; 12, 28; 13, 29; 14, 30; 15, 31; 15, 32; 15, 33; 16, 34; 17, 35; 18, 36; 19, 37; 20, 38; 22, 39; 24, 40; 24, 41; 26, 42; 26, 43; 27, 44; 2...
def get_scheduler_ordered_list(self, realm): """Get sorted scheduler list for a specific realm List is ordered as: alive first, then spare (if any), then dead scheduler links :param realm: realm we want scheduler from :type realm: alignak.objects.realm.Realm :return: sorted sch...
0, module; 1, function_definition; 2, function_name:log_initial_states; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, comment:# Raise hosts initial status broks; 8, for_statement; 9, comment:# And then services initial status broks; 10, for_statement; 11, comment:"""Raise hosts and services i...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 4, 6; 4, 7; 4, 8; 4, 9; 4, 10; 6, 11; 8, 12; 8, 13; 8, 14; 10, 15; 10, 16; 10, 17; 13, 18; 13, 19; 14, 20; 16, 21; 16, 22; 17, 23; 20, 24; 23, 25; 24, 26; 24, 27; 25, 28; 25, 29; 26, 30; 26, 31; 28, 32; 28, 33
def log_initial_states(self): """Raise hosts and services initial status logs First, raise hosts status and then services. This to allow the events log to be a little sorted. :return: None """ # Raise hosts initial status broks for elt in self.hosts: ...
0, module; 1, function_definition; 2, function_name:get_groupnames; 3, parameters; 4, block; 5, identifier:self; 6, identifier:hostgroups; 7, expression_statement; 8, expression_statement; 9, for_statement; 10, return_statement; 11, comment:"""Get names of the host's hostgroups :return: comma separated names o...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 4, 7; 4, 8; 4, 9; 4, 10; 7, 11; 8, 12; 9, 13; 9, 14; 9, 15; 10, 16; 12, 17; 12, 18; 14, 19; 14, 20; 15, 21; 15, 22; 16, 23; 16, 24; 21, 25; 22, 26; 23, 27; 23, 28; 24, 29; 25, 30; 25, 31; 26, 32; 26, 33; 27, 34; 29, 35; 29, 36; 31, 37; 31, 38; 32, 39; 32, 40; 33, 41; 36, 42; 41, 43; ...
def get_groupnames(self, hostgroups): """Get names of the host's hostgroups :return: comma separated names of hostgroups alphabetically sorted :rtype: str """ group_names = [] for hostgroup_id in self.hostgroups: hostgroup = hostgroups[hostgroup_id] ...
0, module; 1, function_definition; 2, function_name:get_groupaliases; 3, parameters; 4, block; 5, identifier:self; 6, identifier:hostgroups; 7, expression_statement; 8, expression_statement; 9, for_statement; 10, return_statement; 11, comment:"""Get aliases of the host's hostgroups :return: comma separated ali...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 3, 6; 4, 7; 4, 8; 4, 9; 4, 10; 7, 11; 8, 12; 9, 13; 9, 14; 9, 15; 10, 16; 12, 17; 12, 18; 14, 19; 14, 20; 15, 21; 15, 22; 16, 23; 16, 24; 21, 25; 22, 26; 23, 27; 23, 28; 24, 29; 25, 30; 25, 31; 26, 32; 26, 33; 27, 34; 29, 35; 29, 36; 31, 37; 31, 38; 32, 39; 32, 40; 33, 41; 36, 42; 41, 43; ...
def get_groupaliases(self, hostgroups): """Get aliases of the host's hostgroups :return: comma separated aliases of hostgroups alphabetically sorted :rtype: str """ group_aliases = [] for hostgroup_id in self.hostgroups: hostgroup = hostgroups[hostgroup_id] ...
0, module; 1, function_definition; 2, function_name:satellites_list; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, expression_statement; 8, with_statement; 9, identifier:daemon_type; 10, string; 11, comment:"""Get the arbiter satellite names sorted by type Returns a list of the satellit...
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; 12, 14; 13, 15; 13, 16; 13, 17; 14, 18; 15, 19; 16, 20; 16, 21; 16, 22; 17, 23; 18, 24; 18, 25; 19, 26; 19, 27; 21, 28; 21, 29; 21, 30; 21, 31; 21, 32; 21, 33; 22, 34; 22, 35; 22, 36; 22, 37; 24, 38; 24, 39; 28, 40; 29, 41; 30, 42; 31, 43...
def satellites_list(self, daemon_type=''): """Get the arbiter satellite names sorted by type Returns a list of the satellites as in: { reactionner: [ "reactionner-master" ], broker: [ "broker-master" ], ...
0, module; 1, function_definition; 2, function_name:sort_labeled_intervals; 3, parameters; 4, block; 5, identifier:intervals; 6, default_parameter; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, if_statement; 11, identifier:labels; 12, None; 13, string; 14, assignment; 15, assignment; 16...
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; 9, 15; 10, 16; 10, 17; 10, 18; 13, 19; 14, 20; 14, 21; 15, 22; 15, 23; 16, 24; 16, 25; 17, 26; 18, 27; 21, 28; 21, 29; 23, 30; 23, 31; 26, 32; 27, 33; 28, 34; 28, 35; 29, 36; 33, 37; 36, 38; 36, 39; 36, 40; 37, 41; 37, 42; 42, 43; ...
def sort_labeled_intervals(intervals, labels=None): '''Sort intervals, and optionally, their corresponding labels according to start time. Parameters ---------- intervals : np.ndarray, shape=(n, 2) The input intervals labels : list, optional Labels for each interval Return...
0, module; 1, function_definition; 2, function_name:labeled_intervals; 3, parameters; 4, block; 5, identifier:intervals; 6, identifier:labels; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, default_parameter; 12, default_parameter; 13, dictionary_splat_pattern; 14, expressi...
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; 4, 35; 4, 36; 4, 37; 4, 38; 4, 39; 4, 40; 7, 41; 7, 42; 8, 43; 8, 44; 9, 45; 9, 46; 10, 47;...
def labeled_intervals(intervals, labels, label_set=None, base=None, height=None, extend_labels=True, ax=None, tick=True, **kwargs): '''Plot labeled intervals with each label on its own row. Parameters ---------- intervals : np.ndarray, shape=(n, 2) se...
0, module; 1, function_definition; 2, function_name:finish_directory_parse; 3, parameters; 4, comment:# type: () -> None; 5, block; 6, identifier:self; 7, expression_statement; 8, if_statement; 9, if_statement; 10, string; 11, not_operator; 12, block; 13, comparison_operator:self.icb_tag.file_type != 4; 14, block; 15, ...
0, 1; 1, 2; 1, 3; 1, 4; 1, 5; 3, 6; 5, 7; 5, 8; 5, 9; 7, 10; 8, 11; 8, 12; 9, 13; 9, 14; 10, 15; 11, 16; 12, 17; 13, 18; 13, 19; 14, 20; 16, 21; 16, 22; 17, 23; 18, 24; 18, 25; 20, 26; 23, 27; 23, 28; 24, 29; 24, 30; 26, 31; 26, 32; 27, 33; 27, 34; 28, 35; 31, 36; 31, 37; 32, 38; 35, 39; 38, 40
def finish_directory_parse(self): # type: () -> None ''' A method to finish up the parsing of this UDF File Entry directory. In particular, this method checks to see if it is in sorted order for future use. Parameters: None. Returns: Nothing. ...
0, module; 1, function_definition; 2, function_name:filepaths; 3, parameters; 4, block; 5, identifier:path; 6, default_parameter; 7, default_parameter; 8, default_parameter; 9, expression_statement; 10, if_statement; 11, if_statement; 12, identifier:exclude; 13, tuple; 14, identifier:hidden; 15, True; 16, identifier:em...
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; 10, 20; 10, 21; 11, 22; 11, 23; 11, 24; 19, 25; 20, 26; 21, 27; 21, 28; 22, 29; 22, 30; 23, 31; 24, 32; 25, 33; 25, 34; 26, 35; 27, 36; 28, 37; 29, 38; 29, 39; 30, 40; 31, 41; 32, 42; 32, 43; 32,...
def filepaths(path, exclude=(), hidden=True, empty=True): """ Return list of absolute, sorted file paths path: Path to file or directory exclude: List of file name patterns to exclude hidden: Whether to include hidden files empty: Whether to include empty files Raise PathNotFoundError if p...
0, module; 1, function_definition; 2, function_name:_get_sorted_methods; 3, parameters; 4, block; 5, identifier:self; 6, identifier:methods; 7, expression_statement; 8, if_statement; 9, comment:# Comparison function we'll use to sort the methods:; 10, function_definition; 11, return_statement; 12, comment:"""Get a copy...
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; 10, 15; 10, 16; 10, 17; 11, 18; 13, 19; 14, 20; 16, 21; 16, 22; 17, 23; 17, 24; 17, 25; 17, 26; 17, 27; 17, 28; 17, 29; 17, 30; 17, 31; 17, 32; 17, 33; 17, 34; 18, 35; 18, 36; 20, 37; 23, 38; 24, 39; 24, 40; 24, 41; 26, 42; 27, 43;...
def _get_sorted_methods(self, methods): """Get a copy of 'methods' sorted the way they would be on the live server. Args: methods: JSON configuration of an API's methods. Returns: The same configuration with the methods sorted based on what order they'll be checked by the server. """...
0, module; 1, function_definition; 2, function_name:_format_ase2clusgeo; 3, parameters; 4, block; 5, identifier:obj; 6, default_parameter; 7, expression_statement; 8, comment:#atoms metadata; 9, expression_statement; 10, if_statement; 11, expression_statement; 12, expression_statement; 13, expression_statement; 14, for...
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; 6, 20; 6, 21; 7, 22; 9, 23; 10, 24; 10, 25; 10, 26; 11, 27; 12, 28; 13, 29; 14, 30; 14, 31; 14, 32; 15, 33; 16, 34; 17, 35; 18, 36; 19, 37; 23, 38; 23, 39; 24, 40; 24, 41; 25, 42; 26, 43; 27, 44; ...
def _format_ase2clusgeo(obj, all_atomtypes=None): """ Takes an ase Atoms object and returns numpy arrays and integers which are read by the internal clusgeo. Apos is currently a flattened out numpy array Args: obj(): all_atomtypes(): sort(): """ #atoms metadata total...
0, module; 1, function_definition; 2, function_name:sort_loading_order; 3, parameters; 4, block; 5, identifier:step_files; 6, expression_statement; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, for_statement; 11, return_statement; 12, comment:"""Sort step files into correct loading orde...
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; 10, 19; 11, 20; 13, 21; 13, 22; 14, 23; 14, 24; 15, 25; 15, 26; 19, 27; 20, 28; 20, 29; 27, 30; 27, 31; 27, 32; 28, 33; 28, 34; 30, 35; 30, 36; 31, 37; 32, 38; 35, 39; 35, 40; 36, 41; 36, 42; 37, 43; ...
def sort_loading_order(step_files): """Sort step files into correct loading order. The correct loading order is first tools, then workflows without subworkflows, and then workflows with subworkflows. This order is required to avoid error messages when a working directory is used. """ tools = []...
0, module; 1, function_definition; 2, function_name:get_contents_dir; 3, parameters; 4, block; 5, identifier:node; 6, expression_statement; 7, expression_statement; 8, for_statement; 9, return_statement; 10, comment:"""Return content signatures and names of all our children separated by new-lines. Ensure that the n...
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; 19, 23; 19, 24; 20, 25; 21, 26; 21, 27; 22, 28; 23, 29; 23, 30; 24, 31; 24, 32; 25, 33; 25, 34; 29, 35; 29, 36; 32, 37; 32, 38; 33, 39; 33, 40; 34, 41; 37, 42; 38, 43; ...
def get_contents_dir(node): """Return content signatures and names of all our children separated by new-lines. Ensure that the nodes are sorted.""" contents = [] for n in sorted(node.children(), key=lambda t: t.name): contents.append('%s %s\n' % (n.get_csig(), n.name)) return ''.join(content...
0, module; 1, function_definition; 2, function_name:sort_nodes; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, expression_statement; 8, expression_statement; 9, for_statement; 10, comment:# Now that we have our dependency tree properly built, topologically; 11, comment:# sort the nodes and reo...
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; 8, 18; 9, 19; 9, 20; 9, 21; 12, 22; 13, 23; 15, 24; 15, 25; 15, 26; 17, 27; 17, 28; 18, 29; 18, 30; 19, 31; 19, 32; 19, 33; 20, 34; 20, 35; 21, 36; 21, 37; 21, 38; 22, 39; 22, 40; 23, 41; 23, 42; 25, 43; 25, 44...
def sort_nodes(self): """Topologically sort all of our nodes. Topologically sorting our nodes makes nodes that are inputs to other nodes come first in the list of nodes. This is important to do before programming a sensorgraph into an embedded device whose engine assumes a topo...
0, module; 1, function_definition; 2, function_name:GenerateHelpText; 3, parameters; 4, block; 5, identifier:self; 6, identifier:env; 7, default_parameter; 8, expression_statement; 9, if_statement; 10, function_definition; 11, expression_statement; 12, return_statement; 13, identifier:sort; 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; 9, 18; 9, 19; 10, 20; 10, 21; 10, 22; 11, 23; 12, 24; 16, 25; 16, 26; 17, 27; 18, 28; 18, 29; 19, 30; 21, 31; 21, 32; 21, 33; 22, 34; 22, 35; 23, 36; 23, 37; 24, 38; 24, 39; 26, 40; 27, 41; 28, 42; 28, 43; 29, ...
def GenerateHelpText(self, env, sort=None): """ Generate the help text for the options. env - an environment that is used to get the current values of the options. cmp - Either a function as follows: The specific sort function should take two arguments and return -1, 0 or ...
0, module; 1, function_definition; 2, function_name:unique; 3, parameters; 4, block; 5, identifier:s; 6, expression_statement; 7, expression_statement; 8, if_statement; 9, comment:# Try using a dict first, as that's the fastest and will usually; 10, comment:# work. If it doesn't work, it will usually fail quickly, so ...
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; 4, 26; 4, 27; 4, 28; 6, 29; 7, 30; 8, 31; 8, 32; 13, 33; 14, 34; 14, 35; 14, 36; 15, 37; 23, 38; 23, 39; 23, 40; 24, 41; 26, 42; 27, 43; 27, 44; 27, 45; 2...
def unique(s): """Return a list of the elements in s, but without duplicates. For example, unique([1,2,3,1,2,3]) is some permutation of [1,2,3], unique("abcabc") some permutation of ["a", "b", "c"], and unique(([1, 2], [2, 3], [1, 2])) some permutation of [[2, 3], [1, 2]]. For best speed, all ...
0, module; 1, function_definition; 2, function_name:get_text_contents; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, try_statement; 8, comment:"""Fetch the decoded text contents of a Unicode encoded Entry. Since this should return the text contents from the file system, we ch...
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; 10, 14; 10, 15; 10, 16; 10, 17; 10, 18; 10, 19; 11, 20; 12, 21; 13, 22; 13, 23; 19, 24; 20, 25; 21, 26; 21, 27; 22, 28; 22, 29; 24, 30; 25, 31; 27, 32; 27, 33; 31, 34; 31, 35; 32, 36; 32, 37; 33, 38; 34, 39; 34, 40; 38, 41; 38, 42
def get_text_contents(self): """Fetch the decoded text contents of a Unicode encoded Entry. Since this should return the text contents from the file system, we check to see into what sort of subclass we should morph this Entry.""" try: self = self.disambiguate(must_e...
0, module; 1, function_definition; 2, function_name:_order_pases; 3, parameters; 4, block; 5, identifier:self; 6, identifier:passes; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, for_statement; 11, return_statement; 12, comment:"""Topologically sort optimization passes. This en...
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; 17, 23; 17, 24; 17, 25; 17, 26; 17, 27; 17, 28; 18, 29; 18, 30; 20, 31; 20, 32; 23, 33; 24, 34; 24, 35; 25, 36; 25, 37; 25, 38; 28, 39; 28, 40; 28, 41; 30, 42; 32, 43;...
def _order_pases(self, passes): """Topologically sort optimization passes. This ensures that the resulting passes are run in order respecting before/after constraints. Args: passes (iterable): An iterable of pass names that should be included in the optimiza...
0, module; 1, function_definition; 2, function_name:local_services; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, if_statement; 8, try_statement; 9, comment:"""Get a list of id, name pairs for all of the known synced services. This method is safe to call outside of the background eve...
0, 1; 1, 2; 1, 3; 1, 4; 3, 5; 4, 6; 4, 7; 4, 8; 6, 9; 7, 10; 7, 11; 8, 12; 8, 13; 10, 14; 11, 15; 12, 16; 13, 17; 14, 18; 14, 19; 15, 20; 16, 21; 17, 22; 18, 23; 18, 24; 20, 25; 20, 26; 21, 27; 21, 28; 22, 29; 22, 30; 23, 31; 23, 32; 25, 33; 25, 34; 28, 35; 28, 36; 29, 37; 30, 38; 33, 39; 33, 40; 35, 41; 35, 42; 36, 43...
def local_services(self): """Get a list of id, name pairs for all of the known synced services. This method is safe to call outside of the background event loop without any race condition. Internally it uses a thread-safe mutex to protect the local copies of supervisor data and ensure ...
0, module; 1, function_definition; 2, function_name:format_script; 3, parameters; 4, block; 5, identifier:sensor_graph; 6, expression_statement; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, expression_statement; 11, for_statement; 12, for_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; 4, 18; 4, 19; 4, 20; 4, 21; 4, 22; 6, 23; 7, 24; 8, 25; 9, 26; 10, 27; 11, 28; 11, 29; 11, 30; 12, 31; 12, 32; 12, 33; 13, 34; 13, 35; 13, 36; 14, 37; 15, 38; 16, 39; 16, 40; 16, 41; 18, 42; 19, 43; 20, 44; 20,...
def format_script(sensor_graph): """Create a binary script containing this sensor graph. This function produces a repeatable script by applying a known sorting order to all constants and config variables when iterating over those dictionaries. Args: sensor_graph (SensorGraph): the sensor g...
0, module; 1, function_definition; 2, function_name:msregularize; 3, parameters; 4, block; 5, identifier:msname; 6, identifier:newname; 7, expression_statement; 8, comment:# Find out all baselines.; 9, expression_statement; 10, expression_statement; 11, expression_statement; 12, comment:# Now iterate in time,band over ...
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; 7, 19; 9, 20; 10, 21; 11, 22; 13, 23; 13, 24; 13, 25; 15, 26; 15, 27; 15, 28; 15, 29; 16, 30; 17, 31; 18, 32; 18, 33; 18, 34; 20, 35; 20, 36; 21, 37; 21, 38; 22, 39; 22, 40; 24, 41; 24, 42; 25, 43; 25, 4...
def msregularize(msname, newname): """ Regularize an MS The output MS will be such that it has the same number of baselines for each time stamp. Where needed fully flagged rows are added. Possibly missing rows are written into a separate MS <newname>-add. It is concatenated with the original MS an...
0, module; 1, function_definition; 2, function_name:iter; 3, parameters; 4, block; 5, identifier:self; 6, identifier:columnnames; 7, default_parameter; 8, default_parameter; 9, expression_statement; 10, import_from_statement; 11, return_statement; 12, identifier:order; 13, string; 14, identifier:sort; 15, True; 16, com...
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; 10, 18; 11, 19; 17, 20; 17, 21; 18, 22; 19, 23; 19, 24; 21, 25; 24, 26; 24, 27; 24, 28; 24, 29
def iter(self, columnnames, order='', sort=True): """Return a tableiter object. :class:`tableiter` lets one iterate over a table by returning in each iteration step a reference table containing equal values for the given columns. By default a sort is done on the given columns to...