Dataset Viewer
Auto-converted to Parquet Duplicate
code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def append_dynamic(self, t, dynamic, canvas=0, color='blue'): """! @brief Append single dynamic to specified canvas (by default to the first with index '0'). @param[in] t (list): Time points that corresponds to dynamic values and considered on a X axis. @param[in] dynamic (list): V...
def function[append_dynamic, parameter[self, t, dynamic, canvas, color]]: constant[! @brief Append single dynamic to specified canvas (by default to the first with index '0'). @param[in] t (list): Time points that corresponds to dynamic values and considered on a X axis. @param[in] dyna...
keyword[def] identifier[append_dynamic] ( identifier[self] , identifier[t] , identifier[dynamic] , identifier[canvas] = literal[int] , identifier[color] = literal[string] ): literal[string] identifier[description] = identifier[dynamic_descr] ( identifier[canvas] , identifier[t] , identifier[dynam...
def append_dynamic(self, t, dynamic, canvas=0, color='blue'): """! @brief Append single dynamic to specified canvas (by default to the first with index '0'). @param[in] t (list): Time points that corresponds to dynamic values and considered on a X axis. @param[in] dynamic (list): Value poin...
def pretty_print(node): """漂亮地打印一个节点 Args: node (TYPE): Description """ for pre, _, node in RenderTree(node): print('{}{}'.format(pre, node.name))
def function[pretty_print, parameter[node]]: constant[漂亮地打印一个节点 Args: node (TYPE): Description ] for taget[tuple[[<ast.Name object at 0x7da204622080>, <ast.Name object at 0x7da204620b20>, <ast.Name object at 0x7da204622b30>]]] in starred[call[name[RenderTree], parameter[name...
keyword[def] identifier[pretty_print] ( identifier[node] ): literal[string] keyword[for] identifier[pre] , identifier[_] , identifier[node] keyword[in] identifier[RenderTree] ( identifier[node] ): identifier[print] ( literal[string] . identifier[format] ( identifier[pre] , identifie...
def pretty_print(node): """漂亮地打印一个节点 Args: node (TYPE): Description """ for (pre, _, node) in RenderTree(node): print('{}{}'.format(pre, node.name)) # depends on [control=['for'], data=[]]
def set_state(self, entity_id, new_state, **kwargs): "Updates or creates the current state of an entity." return remote.set_state(self.api, new_state, **kwargs)
def function[set_state, parameter[self, entity_id, new_state]]: constant[Updates or creates the current state of an entity.] return[call[name[remote].set_state, parameter[name[self].api, name[new_state]]]]
keyword[def] identifier[set_state] ( identifier[self] , identifier[entity_id] , identifier[new_state] ,** identifier[kwargs] ): literal[string] keyword[return] identifier[remote] . identifier[set_state] ( identifier[self] . identifier[api] , identifier[new_state] ,** identifier[kwargs] )
def set_state(self, entity_id, new_state, **kwargs): """Updates or creates the current state of an entity.""" return remote.set_state(self.api, new_state, **kwargs)
def gateway_by_type(self, type=None, on_network=None): # @ReservedAssignment """ Return gateways for the specified node. You can also specify type to find only gateways of a specific type. Valid types are: bgp_peering, netlink, ospfv2_area. :param RoutingNode self: the routing node to check ...
def function[gateway_by_type, parameter[self, type, on_network]]: constant[ Return gateways for the specified node. You can also specify type to find only gateways of a specific type. Valid types are: bgp_peering, netlink, ospfv2_area. :param RoutingNode self: the routing node to check ...
keyword[def] identifier[gateway_by_type] ( identifier[self] , identifier[type] = keyword[None] , identifier[on_network] = keyword[None] ): literal[string] identifier[gateways] = identifier[route_level] ( identifier[self] , literal[string] ) keyword[if] keyword[not] identifier[type] : keywor...
def gateway_by_type(self, type=None, on_network=None): # @ReservedAssignment '\n Return gateways for the specified node. You can also\n specify type to find only gateways of a specific type.\n Valid types are: bgp_peering, netlink, ospfv2_area.\n \n :param RoutingNode self: the routing node to check...
def attributes(self): """ A dictionary mapping names of attributes to BiomartAttribute instances. This causes overwriting errors if there are diffferent pages which use the same attribute names, but is kept for backward compatibility. """ if not self._attribute_pages: ...
def function[attributes, parameter[self]]: constant[ A dictionary mapping names of attributes to BiomartAttribute instances. This causes overwriting errors if there are diffferent pages which use the same attribute names, but is kept for backward compatibility. ] if <ast...
keyword[def] identifier[attributes] ( identifier[self] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[_attribute_pages] : identifier[self] . identifier[fetch_attributes] () identifier[result] ={} keyword[for] identifier[page] keyword[in]...
def attributes(self): """ A dictionary mapping names of attributes to BiomartAttribute instances. This causes overwriting errors if there are diffferent pages which use the same attribute names, but is kept for backward compatibility. """ if not self._attribute_pages: se...
def present(name, deployment_id, metric_name, alert_config, api_key=None, profile='telemetry'): ''' Ensure the telemetry alert exists. name An optional description of the alarm (not currently supported by telemetry API) deployment_id Specifies the ID of the root deployment resource ...
def function[present, parameter[name, deployment_id, metric_name, alert_config, api_key, profile]]: constant[ Ensure the telemetry alert exists. name An optional description of the alarm (not currently supported by telemetry API) deployment_id Specifies the ID of the root deploymen...
keyword[def] identifier[present] ( identifier[name] , identifier[deployment_id] , identifier[metric_name] , identifier[alert_config] , identifier[api_key] = keyword[None] , identifier[profile] = literal[string] ): literal[string] identifier[ret] ={ literal[string] : identifier[metric_name] , literal[strin...
def present(name, deployment_id, metric_name, alert_config, api_key=None, profile='telemetry'): """ Ensure the telemetry alert exists. name An optional description of the alarm (not currently supported by telemetry API) deployment_id Specifies the ID of the root deployment resource ...
def pos(self): """ Lazy-loads the part of speech tag for this word :getter: Returns the plain string value of the POS tag for the word :type: str """ if self._pos is None: poses = self._element.xpath('POS/text()') if len(poses) > 0: ...
def function[pos, parameter[self]]: constant[ Lazy-loads the part of speech tag for this word :getter: Returns the plain string value of the POS tag for the word :type: str ] if compare[name[self]._pos is constant[None]] begin[:] variable[poses] assign[=...
keyword[def] identifier[pos] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[_pos] keyword[is] keyword[None] : identifier[poses] = identifier[self] . identifier[_element] . identifier[xpath] ( literal[string] ) keyword[if] identifier[len...
def pos(self): """ Lazy-loads the part of speech tag for this word :getter: Returns the plain string value of the POS tag for the word :type: str """ if self._pos is None: poses = self._element.xpath('POS/text()') if len(poses) > 0: self._pos = poses...
async def handle_client_request(self, req, res): """ Entry point for the request + response middleware chain. This is called by growler.HTTPResponder (the default responder) after the headers have been processed in the begin_application method. This iterates over all mid...
<ast.AsyncFunctionDef object at 0x7da18bcc8070>
keyword[async] keyword[def] identifier[handle_client_request] ( identifier[self] , identifier[req] , identifier[res] ): literal[string] identifier[mw_generator] = identifier[self] . identifier[middleware] ( identifier[req] . identifier[method] , identifier[req] . identifier[path] ) ...
async def handle_client_request(self, req, res): """ Entry point for the request + response middleware chain. This is called by growler.HTTPResponder (the default responder) after the headers have been processed in the begin_application method. This iterates over all middlew...
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'key') and self.key is not None: _dict['key'] = self.key if hasattr(self, 'matching_results') and self.matching_results is not None: _dict['m...
def function[_to_dict, parameter[self]]: constant[Return a json dictionary representing this model.] variable[_dict] assign[=] dictionary[[], []] if <ast.BoolOp object at 0x7da2044c2920> begin[:] call[name[_dict]][constant[key]] assign[=] name[self].key if <ast.BoolOp obj...
keyword[def] identifier[_to_dict] ( identifier[self] ): literal[string] identifier[_dict] ={} keyword[if] identifier[hasattr] ( identifier[self] , literal[string] ) keyword[and] identifier[self] . identifier[key] keyword[is] keyword[not] keyword[None] : identifier[_dict] ...
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'key') and self.key is not None: _dict['key'] = self.key # depends on [control=['if'], data=[]] if hasattr(self, 'matching_results') and self.matching_results is not None: _dict['matc...
def device_unmounted(self, device): """Show unmount notification for specified device object.""" if not self._mounter.is_handleable(device): return self._show_notification( 'device_unmounted', _('Device unmounted'), _('{0.ui_label} unmounted', devi...
def function[device_unmounted, parameter[self, device]]: constant[Show unmount notification for specified device object.] if <ast.UnaryOp object at 0x7da20c6e5300> begin[:] return[None] call[name[self]._show_notification, parameter[constant[device_unmounted], call[name[_], parameter[cons...
keyword[def] identifier[device_unmounted] ( identifier[self] , identifier[device] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[_mounter] . identifier[is_handleable] ( identifier[device] ): keyword[return] identifier[self] . identifier[_show_noti...
def device_unmounted(self, device): """Show unmount notification for specified device object.""" if not self._mounter.is_handleable(device): return # depends on [control=['if'], data=[]] self._show_notification('device_unmounted', _('Device unmounted'), _('{0.ui_label} unmounted', device), device.i...
def update(self, play): """ Update the accumulator with the current play :returns: new tally :rtype: dict, ``{ 'period': per, 'time': clock, 'team': cumul, 'play': play }`` """ new_tally = { } #if any(isinstance(play.event, te) for te in self.trigger_even...
def function[update, parameter[self, play]]: constant[ Update the accumulator with the current play :returns: new tally :rtype: dict, ``{ 'period': per, 'time': clock, 'team': cumul, 'play': play }`` ] variable[new_tally] assign[=] dictionary[[], []] if c...
keyword[def] identifier[update] ( identifier[self] , identifier[play] ): literal[string] identifier[new_tally] ={} keyword[if] identifier[self] . identifier[_count_play] ( identifier[play] ): identifier[team] = identifier[self] . identifier[_get_team] ( ide...
def update(self, play): """ Update the accumulator with the current play :returns: new tally :rtype: dict, ``{ 'period': per, 'time': clock, 'team': cumul, 'play': play }`` """ new_tally = {} #if any(isinstance(play.event, te) for te in self.trigger_event_types): ...
def reject_source(ident, comment): '''Reject a source for automatic harvesting''' source = get_source(ident) source.validation.on = datetime.now() source.validation.comment = comment source.validation.state = VALIDATION_REFUSED if current_user.is_authenticated: source.validation.by = cur...
def function[reject_source, parameter[ident, comment]]: constant[Reject a source for automatic harvesting] variable[source] assign[=] call[name[get_source], parameter[name[ident]]] name[source].validation.on assign[=] call[name[datetime].now, parameter[]] name[source].validation.comment ...
keyword[def] identifier[reject_source] ( identifier[ident] , identifier[comment] ): literal[string] identifier[source] = identifier[get_source] ( identifier[ident] ) identifier[source] . identifier[validation] . identifier[on] = identifier[datetime] . identifier[now] () identifier[source] . ident...
def reject_source(ident, comment): """Reject a source for automatic harvesting""" source = get_source(ident) source.validation.on = datetime.now() source.validation.comment = comment source.validation.state = VALIDATION_REFUSED if current_user.is_authenticated: source.validation.by = cur...
def expandService(service_element): """Take a service element and expand it into an iterator of: ([type_uri], uri, service_element) """ uris = sortedURIs(service_element) if not uris: uris = [None] expanded = [] for uri in uris: type_uris = getTypeURIs(service_element) ...
def function[expandService, parameter[service_element]]: constant[Take a service element and expand it into an iterator of: ([type_uri], uri, service_element) ] variable[uris] assign[=] call[name[sortedURIs], parameter[name[service_element]]] if <ast.UnaryOp object at 0x7da18dc07af0> beg...
keyword[def] identifier[expandService] ( identifier[service_element] ): literal[string] identifier[uris] = identifier[sortedURIs] ( identifier[service_element] ) keyword[if] keyword[not] identifier[uris] : identifier[uris] =[ keyword[None] ] identifier[expanded] =[] keyword[for] ...
def expandService(service_element): """Take a service element and expand it into an iterator of: ([type_uri], uri, service_element) """ uris = sortedURIs(service_element) if not uris: uris = [None] # depends on [control=['if'], data=[]] expanded = [] for uri in uris: type_ur...
def euler_angles(self): """:obj:`tuple` of float: The three euler angles for the rotation. """ q_wxyz = self.quaternion q_xyzw = np.roll(q_wxyz, -1) return transformations.euler_from_quaternion(q_xyzw)
def function[euler_angles, parameter[self]]: constant[:obj:`tuple` of float: The three euler angles for the rotation. ] variable[q_wxyz] assign[=] name[self].quaternion variable[q_xyzw] assign[=] call[name[np].roll, parameter[name[q_wxyz], <ast.UnaryOp object at 0x7da1b12b4be0>]] ret...
keyword[def] identifier[euler_angles] ( identifier[self] ): literal[string] identifier[q_wxyz] = identifier[self] . identifier[quaternion] identifier[q_xyzw] = identifier[np] . identifier[roll] ( identifier[q_wxyz] ,- literal[int] ) keyword[return] identifier[transformations] . ...
def euler_angles(self): """:obj:`tuple` of float: The three euler angles for the rotation. """ q_wxyz = self.quaternion q_xyzw = np.roll(q_wxyz, -1) return transformations.euler_from_quaternion(q_xyzw)
def plot_survival(self, on, how="os", survival_units="Days", strata=None, ax=None, ci_show=False, with_condition_color="#B38600", no_condition_c...
def function[plot_survival, parameter[self, on, how, survival_units, strata, ax, ci_show, with_condition_color, no_condition_color, with_condition_label, no_condition_label, color_map, label_map, color_palette, threshold]]: constant[Plot a Kaplan Meier survival curve by splitting the cohort into two groups ...
keyword[def] identifier[plot_survival] ( identifier[self] , identifier[on] , identifier[how] = literal[string] , identifier[survival_units] = literal[string] , identifier[strata] = keyword[None] , identifier[ax] = keyword[None] , identifier[ci_show] = keyword[False] , identifier[with_condition_color] = literal...
def plot_survival(self, on, how='os', survival_units='Days', strata=None, ax=None, ci_show=False, with_condition_color='#B38600', no_condition_color='#A941AC', with_condition_label=None, no_condition_label=None, color_map=None, label_map=None, color_palette='Set2', threshold=None, **kwargs): """Plot a Kaplan Meier ...
def change_cell(self, x, y, ch, fg, bg): """Change cell in position (x;y). """ self.console.draw_char(x, y, ch, fg, bg)
def function[change_cell, parameter[self, x, y, ch, fg, bg]]: constant[Change cell in position (x;y). ] call[name[self].console.draw_char, parameter[name[x], name[y], name[ch], name[fg], name[bg]]]
keyword[def] identifier[change_cell] ( identifier[self] , identifier[x] , identifier[y] , identifier[ch] , identifier[fg] , identifier[bg] ): literal[string] identifier[self] . identifier[console] . identifier[draw_char] ( identifier[x] , identifier[y] , identifier[ch] , identifier[fg] , identifier...
def change_cell(self, x, y, ch, fg, bg): """Change cell in position (x;y). """ self.console.draw_char(x, y, ch, fg, bg)
def _emit_internal(self, sid, event, data, namespace=None, id=None): """Send a message to a client.""" if six.PY2 and not self.binary: binary = False # pragma: nocover else: binary = None # tuples are expanded to multiple arguments, everything else is sent ...
def function[_emit_internal, parameter[self, sid, event, data, namespace, id]]: constant[Send a message to a client.] if <ast.BoolOp object at 0x7da1b21ba290> begin[:] variable[binary] assign[=] constant[False] if call[name[isinstance], parameter[name[data], name[tuple]]] begin[:...
keyword[def] identifier[_emit_internal] ( identifier[self] , identifier[sid] , identifier[event] , identifier[data] , identifier[namespace] = keyword[None] , identifier[id] = keyword[None] ): literal[string] keyword[if] identifier[six] . identifier[PY2] keyword[and] keyword[not] identifier[self...
def _emit_internal(self, sid, event, data, namespace=None, id=None): """Send a message to a client.""" if six.PY2 and (not self.binary): binary = False # pragma: nocover # depends on [control=['if'], data=[]] else: binary = None # tuples are expanded to multiple arguments, everything e...
def routeByMonthAbbr(self, request, year, monthAbbr): """Route a request with a month abbreviation to the monthly view.""" month = (DatePictures['Mon'].index(monthAbbr.lower()) // 4) + 1 return self.serveMonth(request, year, month)
def function[routeByMonthAbbr, parameter[self, request, year, monthAbbr]]: constant[Route a request with a month abbreviation to the monthly view.] variable[month] assign[=] binary_operation[binary_operation[call[call[name[DatePictures]][constant[Mon]].index, parameter[call[name[monthAbbr].lower, parame...
keyword[def] identifier[routeByMonthAbbr] ( identifier[self] , identifier[request] , identifier[year] , identifier[monthAbbr] ): literal[string] identifier[month] =( identifier[DatePictures] [ literal[string] ]. identifier[index] ( identifier[monthAbbr] . identifier[lower] ())// literal[int] )+ lit...
def routeByMonthAbbr(self, request, year, monthAbbr): """Route a request with a month abbreviation to the monthly view.""" month = DatePictures['Mon'].index(monthAbbr.lower()) // 4 + 1 return self.serveMonth(request, year, month)
def _extents(self): """ A (cx, cy) 2-tuple representing the effective rendering area for text within this text frame when margins are taken into account. """ return ( self._parent.width - self.margin_left - self.margin_right, self._parent.height - self.mar...
def function[_extents, parameter[self]]: constant[ A (cx, cy) 2-tuple representing the effective rendering area for text within this text frame when margins are taken into account. ] return[tuple[[<ast.BinOp object at 0x7da20c6ab8b0>, <ast.BinOp object at 0x7da20c6a9b40>]]]
keyword[def] identifier[_extents] ( identifier[self] ): literal[string] keyword[return] ( identifier[self] . identifier[_parent] . identifier[width] - identifier[self] . identifier[margin_left] - identifier[self] . identifier[margin_right] , identifier[self] . identifier[_parent] ...
def _extents(self): """ A (cx, cy) 2-tuple representing the effective rendering area for text within this text frame when margins are taken into account. """ return (self._parent.width - self.margin_left - self.margin_right, self._parent.height - self.margin_top - self.margin_bottom)
def _batch_gather_with_broadcast(params, indices, axis): """Like batch_gather, but broadcasts to the left of axis.""" # batch_gather assumes... # params.shape = [A1,...,AN, B1,...,BM] # indices.shape = [A1,...,AN, C] # which gives output of shape # [A1,...,AN, C, B1,...,BM] # Here w...
def function[_batch_gather_with_broadcast, parameter[params, indices, axis]]: constant[Like batch_gather, but broadcasts to the left of axis.] variable[leading_bcast_shape] assign[=] call[name[tf].broadcast_dynamic_shape, parameter[call[call[name[tf].shape, parameter[]]][<ast.Slice object at 0x7da1b03e3...
keyword[def] identifier[_batch_gather_with_broadcast] ( identifier[params] , identifier[indices] , identifier[axis] ): literal[string] identifier[leading_bcast_shape] = identifier[tf] . identifier[broadcast_dynamic_shape] ( identifier[tf] . identifier[shape] ( identifier...
def _batch_gather_with_broadcast(params, indices, axis): """Like batch_gather, but broadcasts to the left of axis.""" # batch_gather assumes... # params.shape = [A1,...,AN, B1,...,BM] # indices.shape = [A1,...,AN, C] # which gives output of shape # [A1,...,AN, C, B1,...,BM...
def get_library_name(database='Human'): """return enrichr active enrichr library name. :param str database: Select one from { 'Human', 'Mouse', 'Yeast', 'Fly', 'Fish', 'Worm' } """ # make a get request to get the gmt names and meta data from Enrichr # old code # response = requests.get(...
def function[get_library_name, parameter[database]]: constant[return enrichr active enrichr library name. :param str database: Select one from { 'Human', 'Mouse', 'Yeast', 'Fly', 'Fish', 'Worm' } ] if compare[name[database] <ast.NotIn object at 0x7da2590d7190> list[[<ast.Constant object a...
keyword[def] identifier[get_library_name] ( identifier[database] = literal[string] ): literal[string] keyword[if] identifier[database] keyword[not] keyword[in] [ literal[string] , literal[string] , literal[string] , literal[string] , literal[str...
def get_library_name(database='Human'): """return enrichr active enrichr library name. :param str database: Select one from { 'Human', 'Mouse', 'Yeast', 'Fly', 'Fish', 'Worm' } """ # make a get request to get the gmt names and meta data from Enrichr # old code # response = requests.get('h...
def parse(self): """ Parse the vmstat file :return: status of the metric parse """ file_status = True for input_file in self.infile_list: file_status = file_status and naarad.utils.is_valid_file(input_file) if not file_status: return False status = True data = {} # s...
def function[parse, parameter[self]]: constant[ Parse the vmstat file :return: status of the metric parse ] variable[file_status] assign[=] constant[True] for taget[name[input_file]] in starred[name[self].infile_list] begin[:] variable[file_status] assign[=] <ast.Bool...
keyword[def] identifier[parse] ( identifier[self] ): literal[string] identifier[file_status] = keyword[True] keyword[for] identifier[input_file] keyword[in] identifier[self] . identifier[infile_list] : identifier[file_status] = identifier[file_status] keyword[and] identifier[naarad] . ide...
def parse(self): """ Parse the vmstat file :return: status of the metric parse """ file_status = True for input_file in self.infile_list: file_status = file_status and naarad.utils.is_valid_file(input_file) if not file_status: return False # depends on [control=['if'...
def remove_role_from_user(self, user, role): """Removes a role from a user. :param user: The user to manipulate :param role: The role to remove from the user """ rv = False user, role = self._prepare_role_modify_args(user, role) if role in user.roles: ...
def function[remove_role_from_user, parameter[self, user, role]]: constant[Removes a role from a user. :param user: The user to manipulate :param role: The role to remove from the user ] variable[rv] assign[=] constant[False] <ast.Tuple object at 0x7da18fe91870> assign[=...
keyword[def] identifier[remove_role_from_user] ( identifier[self] , identifier[user] , identifier[role] ): literal[string] identifier[rv] = keyword[False] identifier[user] , identifier[role] = identifier[self] . identifier[_prepare_role_modify_args] ( identifier[user] , identifier[role] )...
def remove_role_from_user(self, user, role): """Removes a role from a user. :param user: The user to manipulate :param role: The role to remove from the user """ rv = False (user, role) = self._prepare_role_modify_args(user, role) if role in user.roles: rv = True ...
def set_fft_params(func): """Decorate a method to automatically convert quantities to samples """ @wraps(func) def wrapped_func(series, method_func, *args, **kwargs): """Wrap function to normalize FFT params before execution """ if isinstance(series, tuple): data = se...
def function[set_fft_params, parameter[func]]: constant[Decorate a method to automatically convert quantities to samples ] def function[wrapped_func, parameter[series, method_func]]: constant[Wrap function to normalize FFT params before execution ] if call[nam...
keyword[def] identifier[set_fft_params] ( identifier[func] ): literal[string] @ identifier[wraps] ( identifier[func] ) keyword[def] identifier[wrapped_func] ( identifier[series] , identifier[method_func] ,* identifier[args] ,** identifier[kwargs] ): literal[string] keyword[if] iden...
def set_fft_params(func): """Decorate a method to automatically convert quantities to samples """ @wraps(func) def wrapped_func(series, method_func, *args, **kwargs): """Wrap function to normalize FFT params before execution """ if isinstance(series, tuple): data = s...
def nlargest(n, iterable, key=None): """Find the n largest elements in a dataset. Equivalent to: sorted(iterable, key=key, reverse=True)[:n] """ # Short-cut for n==1 is to use max() if n == 1: it = iter(iterable) sentinel = object() if key is None: result = max...
def function[nlargest, parameter[n, iterable, key]]: constant[Find the n largest elements in a dataset. Equivalent to: sorted(iterable, key=key, reverse=True)[:n] ] if compare[name[n] equal[==] constant[1]] begin[:] variable[it] assign[=] call[name[iter], parameter[name[iterabl...
keyword[def] identifier[nlargest] ( identifier[n] , identifier[iterable] , identifier[key] = keyword[None] ): literal[string] keyword[if] identifier[n] == literal[int] : identifier[it] = identifier[iter] ( identifier[iterable] ) identifier[sentinel] = identifier[object] () ...
def nlargest(n, iterable, key=None): """Find the n largest elements in a dataset. Equivalent to: sorted(iterable, key=key, reverse=True)[:n] """ # Short-cut for n==1 is to use max() if n == 1: it = iter(iterable) sentinel = object() if key is None: result = max(...
def _parse_response(resp): """ Get xmlrpc response from scgi response """ # Assume they care for standards and send us CRLF (not just LF) try: headers, payload = resp.split("\r\n\r\n", 1) except (TypeError, ValueError) as exc: raise SCGIException("No header delimiter in SCGI response...
def function[_parse_response, parameter[resp]]: constant[ Get xmlrpc response from scgi response ] <ast.Try object at 0x7da18bcc9720> variable[headers] assign[=] call[name[_parse_headers], parameter[name[headers]]] variable[clen] assign[=] call[name[headers].get, parameter[constant[Conte...
keyword[def] identifier[_parse_response] ( identifier[resp] ): literal[string] keyword[try] : identifier[headers] , identifier[payload] = identifier[resp] . identifier[split] ( literal[string] , literal[int] ) keyword[except] ( identifier[TypeError] , identifier[ValueError] ) keyword[as]...
def _parse_response(resp): """ Get xmlrpc response from scgi response """ # Assume they care for standards and send us CRLF (not just LF) try: (headers, payload) = resp.split('\r\n\r\n', 1) # depends on [control=['try'], data=[]] except (TypeError, ValueError) as exc: raise SCGIExce...
def sessions(status, access_key, id_only, all): ''' List and manage compute sessions. ''' fields = [ ('Session ID', 'sess_id'), ] with Session() as session: if is_admin(session): fields.append(('Owner', 'access_key')) if not id_only: fields.extend([ ...
def function[sessions, parameter[status, access_key, id_only, all]]: constant[ List and manage compute sessions. ] variable[fields] assign[=] list[[<ast.Tuple object at 0x7da207f9aec0>]] with call[name[Session], parameter[]] begin[:] if call[name[is_admin], parameter[name...
keyword[def] identifier[sessions] ( identifier[status] , identifier[access_key] , identifier[id_only] , identifier[all] ): literal[string] identifier[fields] =[ ( literal[string] , literal[string] ), ] keyword[with] identifier[Session] () keyword[as] identifier[session] : keyword[if...
def sessions(status, access_key, id_only, all): """ List and manage compute sessions. """ fields = [('Session ID', 'sess_id')] with Session() as session: if is_admin(session): fields.append(('Owner', 'access_key')) # depends on [control=['if'], data=[]] # depends on [control=['...
def cosmological_quantity_from_redshift(z, quantity, strip_unit=True, **kwargs): r"""Returns the value of a cosmological quantity (e.g., age) at a redshift. Parameters ---------- z : float The redshift. quantity : str The name of the quantity ...
def function[cosmological_quantity_from_redshift, parameter[z, quantity, strip_unit]]: constant[Returns the value of a cosmological quantity (e.g., age) at a redshift. Parameters ---------- z : float The redshift. quantity : str The name of the quantity to get. The name may be a...
keyword[def] identifier[cosmological_quantity_from_redshift] ( identifier[z] , identifier[quantity] , identifier[strip_unit] = keyword[True] , ** identifier[kwargs] ): literal[string] identifier[cosmology] = identifier[get_cosmology] (** identifier[kwargs] ) identifier[val] = identifier[getattr] ( ide...
def cosmological_quantity_from_redshift(z, quantity, strip_unit=True, **kwargs): """Returns the value of a cosmological quantity (e.g., age) at a redshift. Parameters ---------- z : float The redshift. quantity : str The name of the quantity to get. The name may be any attribute of ...
def message_user(self, username, domain, subject, message): """Currently use send_message_chat and discard subject, because headline messages are not stored by mod_offline.""" kwargs = { 'body': message, 'from': domain, 'to': '%s@%s' % (username, domain), ...
def function[message_user, parameter[self, username, domain, subject, message]]: constant[Currently use send_message_chat and discard subject, because headline messages are not stored by mod_offline.] variable[kwargs] assign[=] dictionary[[<ast.Constant object at 0x7da1b0b10eb0>, <ast.Constant o...
keyword[def] identifier[message_user] ( identifier[self] , identifier[username] , identifier[domain] , identifier[subject] , identifier[message] ): literal[string] identifier[kwargs] ={ literal[string] : identifier[message] , literal[string] : identifier[domain] , litera...
def message_user(self, username, domain, subject, message): """Currently use send_message_chat and discard subject, because headline messages are not stored by mod_offline.""" kwargs = {'body': message, 'from': domain, 'to': '%s@%s' % (username, domain)} if self.api_version <= (14, 7): # TOD...
def create_view(self, query_criteria=None, uid='_all_users'): ''' a method to add a view to a design document of a uid :param query_criteria: dictionary with valid jsonmodel query criteria :param uid: [optional] string with uid of design document to update ...
def function[create_view, parameter[self, query_criteria, uid]]: constant[ a method to add a view to a design document of a uid :param query_criteria: dictionary with valid jsonmodel query criteria :param uid: [optional] string with uid of design document to update ...
keyword[def] identifier[create_view] ( identifier[self] , identifier[query_criteria] = keyword[None] , identifier[uid] = literal[string] ): literal[string] identifier[title] = literal[string] % identifier[self] . identifier[__class__] . identifier[__name__] ...
def create_view(self, query_criteria=None, uid='_all_users'): """ a method to add a view to a design document of a uid :param query_criteria: dictionary with valid jsonmodel query criteria :param uid: [optional] string with uid of design document to update :return:...
def tx_hash( cls, tx ): """ Calculate the hash of a transction structure given by bitcoind """ tx_hex = bits.btc_bitcoind_tx_serialize( tx ) tx_hash = hashing.bin_double_sha256(tx_hex.decode('hex'))[::-1].encode('hex') return tx_hash
def function[tx_hash, parameter[cls, tx]]: constant[ Calculate the hash of a transction structure given by bitcoind ] variable[tx_hex] assign[=] call[name[bits].btc_bitcoind_tx_serialize, parameter[name[tx]]] variable[tx_hash] assign[=] call[call[call[name[hashing].bin_double_sha...
keyword[def] identifier[tx_hash] ( identifier[cls] , identifier[tx] ): literal[string] identifier[tx_hex] = identifier[bits] . identifier[btc_bitcoind_tx_serialize] ( identifier[tx] ) identifier[tx_hash] = identifier[hashing] . identifier[bin_double_sha256] ( identifier[tx_hex] . identifie...
def tx_hash(cls, tx): """ Calculate the hash of a transction structure given by bitcoind """ tx_hex = bits.btc_bitcoind_tx_serialize(tx) tx_hash = hashing.bin_double_sha256(tx_hex.decode('hex'))[::-1].encode('hex') return tx_hash
def _from_dict(cls, _dict): """Initialize a ListCollectionFieldsResponse object from a json dictionary.""" args = {} if 'fields' in _dict: args['fields'] = [ Field._from_dict(x) for x in (_dict.get('fields')) ] return cls(**args)
def function[_from_dict, parameter[cls, _dict]]: constant[Initialize a ListCollectionFieldsResponse object from a json dictionary.] variable[args] assign[=] dictionary[[], []] if compare[constant[fields] in name[_dict]] begin[:] call[name[args]][constant[fields]] assign[=] <ast.L...
keyword[def] identifier[_from_dict] ( identifier[cls] , identifier[_dict] ): literal[string] identifier[args] ={} keyword[if] literal[string] keyword[in] identifier[_dict] : identifier[args] [ literal[string] ]=[ identifier[Field] . identifier[_from_dict] ( ide...
def _from_dict(cls, _dict): """Initialize a ListCollectionFieldsResponse object from a json dictionary.""" args = {} if 'fields' in _dict: args['fields'] = [Field._from_dict(x) for x in _dict.get('fields')] # depends on [control=['if'], data=['_dict']] return cls(**args)
def check_py_version(): """Check if a propper Python version is used.""" try: if sys.version_info >= (2, 7): return except: pass print(" ") print(" ERROR - memtop needs python version at least 2.7") print(("Chances are that you can install newer version from your " ...
def function[check_py_version, parameter[]]: constant[Check if a propper Python version is used.] <ast.Try object at 0x7da1b10a4100> call[name[print], parameter[constant[ ]]] call[name[print], parameter[constant[ ERROR - memtop needs python version at least 2.7]]] call[name[print], p...
keyword[def] identifier[check_py_version] (): literal[string] keyword[try] : keyword[if] identifier[sys] . identifier[version_info] >=( literal[int] , literal[int] ): keyword[return] keyword[except] : keyword[pass] identifier[print] ( literal[string] ) ident...
def check_py_version(): """Check if a propper Python version is used.""" try: if sys.version_info >= (2, 7): return # depends on [control=['if'], data=[]] # depends on [control=['try'], data=[]] except: pass # depends on [control=['except'], data=[]] print(' ') print('...
def save_task_info(self, res, mem_gb=0): """ :param self: an object with attributes .hdf5, .argnames, .sent :parent res: a :class:`Result` object :param mem_gb: memory consumption at the saving time (optional) """ mon = res.mon name = mon.operation[6:] # strip 'total ' if self.hdf5: ...
def function[save_task_info, parameter[self, res, mem_gb]]: constant[ :param self: an object with attributes .hdf5, .argnames, .sent :parent res: a :class:`Result` object :param mem_gb: memory consumption at the saving time (optional) ] variable[mon] assign[=] name[res].mon varia...
keyword[def] identifier[save_task_info] ( identifier[self] , identifier[res] , identifier[mem_gb] = literal[int] ): literal[string] identifier[mon] = identifier[res] . identifier[mon] identifier[name] = identifier[mon] . identifier[operation] [ literal[int] :] keyword[if] identifier[self] . ide...
def save_task_info(self, res, mem_gb=0): """ :param self: an object with attributes .hdf5, .argnames, .sent :parent res: a :class:`Result` object :param mem_gb: memory consumption at the saving time (optional) """ mon = res.mon name = mon.operation[6:] # strip 'total ' if self.hdf5: ...
def is_redundant_multiplicon(self, value): """ Returns True if the passed multiplicon ID is redundant, False otherwise. - value, (int) multiplicon ID """ if not hasattr(self, '_redundant_multiplicon_cache'): sql = '''SELECT id FROM multiplicons WHERE is_redun...
def function[is_redundant_multiplicon, parameter[self, value]]: constant[ Returns True if the passed multiplicon ID is redundant, False otherwise. - value, (int) multiplicon ID ] if <ast.UnaryOp object at 0x7da1b0ae1000> begin[:] variable[sql] assign[=] c...
keyword[def] identifier[is_redundant_multiplicon] ( identifier[self] , identifier[value] ): literal[string] keyword[if] keyword[not] identifier[hasattr] ( identifier[self] , literal[string] ): identifier[sql] = literal[string] identifier[cur] = identifier[self] . identi...
def is_redundant_multiplicon(self, value): """ Returns True if the passed multiplicon ID is redundant, False otherwise. - value, (int) multiplicon ID """ if not hasattr(self, '_redundant_multiplicon_cache'): sql = 'SELECT id FROM multiplicons WHERE is_redundant="-1"' ...
def _ConvertManagedPropertyType(self, propType): """ Convert vmodl.reflect.DynamicTypeManager.PropertyTypeInfo to pyVmomi managed property definition """ if propType: name = propType.name version = propType.version aType = propType.type flags = self._Con...
def function[_ConvertManagedPropertyType, parameter[self, propType]]: constant[ Convert vmodl.reflect.DynamicTypeManager.PropertyTypeInfo to pyVmomi managed property definition ] if name[propType] begin[:] variable[name] assign[=] name[propType].name var...
keyword[def] identifier[_ConvertManagedPropertyType] ( identifier[self] , identifier[propType] ): literal[string] keyword[if] identifier[propType] : identifier[name] = identifier[propType] . identifier[name] identifier[version] = identifier[propType] . identifier[version] ...
def _ConvertManagedPropertyType(self, propType): """ Convert vmodl.reflect.DynamicTypeManager.PropertyTypeInfo to pyVmomi managed property definition """ if propType: name = propType.name version = propType.version aType = propType.type flags = self._ConvertAnno...
def reverse_timezone(self, query, timeout=DEFAULT_SENTINEL): """ Find the timezone for a point in `query`. GeoNames always returns a timezone: if the point being queried doesn't have an assigned Olson timezone id, a ``pytz.FixedOffset`` timezone is used to produce the :class:`ge...
def function[reverse_timezone, parameter[self, query, timeout]]: constant[ Find the timezone for a point in `query`. GeoNames always returns a timezone: if the point being queried doesn't have an assigned Olson timezone id, a ``pytz.FixedOffset`` timezone is used to produce the ...
keyword[def] identifier[reverse_timezone] ( identifier[self] , identifier[query] , identifier[timeout] = identifier[DEFAULT_SENTINEL] ): literal[string] identifier[ensure_pytz_is_installed] () keyword[try] : identifier[lat] , identifier[lng] = identifier[self] . identifier[_c...
def reverse_timezone(self, query, timeout=DEFAULT_SENTINEL): """ Find the timezone for a point in `query`. GeoNames always returns a timezone: if the point being queried doesn't have an assigned Olson timezone id, a ``pytz.FixedOffset`` timezone is used to produce the :class:`geopy....
def add_transcription(self, gene: Gene, rna: Union[Rna, MicroRna]) -> str: """Add a transcription relation from a gene to an RNA or miRNA node. :param gene: A gene node :param rna: An RNA or microRNA node """ return self.add_unqualified_edge(gene, rna, TRANSCRIBED_TO)
def function[add_transcription, parameter[self, gene, rna]]: constant[Add a transcription relation from a gene to an RNA or miRNA node. :param gene: A gene node :param rna: An RNA or microRNA node ] return[call[name[self].add_unqualified_edge, parameter[name[gene], name[rna], name[T...
keyword[def] identifier[add_transcription] ( identifier[self] , identifier[gene] : identifier[Gene] , identifier[rna] : identifier[Union] [ identifier[Rna] , identifier[MicroRna] ])-> identifier[str] : literal[string] keyword[return] identifier[self] . identifier[add_unqualified_edge] ( identifier...
def add_transcription(self, gene: Gene, rna: Union[Rna, MicroRna]) -> str: """Add a transcription relation from a gene to an RNA or miRNA node. :param gene: A gene node :param rna: An RNA or microRNA node """ return self.add_unqualified_edge(gene, rna, TRANSCRIBED_TO)
def fetch_and_parse(method, uri, params_prefix=None, **params): """Fetch the given uri and return python dictionary with parsed data-types.""" response = fetch(method, uri, params_prefix, **params) return _parse(json.loads(response.text))
def function[fetch_and_parse, parameter[method, uri, params_prefix]]: constant[Fetch the given uri and return python dictionary with parsed data-types.] variable[response] assign[=] call[name[fetch], parameter[name[method], name[uri], name[params_prefix]]] return[call[name[_parse], parameter[call[na...
keyword[def] identifier[fetch_and_parse] ( identifier[method] , identifier[uri] , identifier[params_prefix] = keyword[None] ,** identifier[params] ): literal[string] identifier[response] = identifier[fetch] ( identifier[method] , identifier[uri] , identifier[params_prefix] ,** identifier[params] ) key...
def fetch_and_parse(method, uri, params_prefix=None, **params): """Fetch the given uri and return python dictionary with parsed data-types.""" response = fetch(method, uri, params_prefix, **params) return _parse(json.loads(response.text))
def memoize(func): """ Memoization decorator for a function taking one or more arguments. """ class Memodict(dict): """ just a dict""" def __getitem__(self, *key): return dict.__getitem__(self, key) def __missing__(self, key): """ this makes it faster """ ...
def function[memoize, parameter[func]]: constant[ Memoization decorator for a function taking one or more arguments. ] class class[Memodict, parameter[]] begin[:] constant[ just a dict] def function[__getitem__, parameter[self]]: return[call[name[dict].__getit...
keyword[def] identifier[memoize] ( identifier[func] ): literal[string] keyword[class] identifier[Memodict] ( identifier[dict] ): literal[string] keyword[def] identifier[__getitem__] ( identifier[self] ,* identifier[key] ): keyword[return] identifier[dict] . identifier[__g...
def memoize(func): """ Memoization decorator for a function taking one or more arguments. """ class Memodict(dict): """ just a dict""" def __getitem__(self, *key): return dict.__getitem__(self, key) def __missing__(self, key): """ this makes it faster """ ...
def _set_pseudotime(self): """Return pseudotime with respect to root point. """ self.pseudotime = self.distances_dpt[self.iroot].copy() self.pseudotime /= np.max(self.pseudotime[self.pseudotime < np.inf])
def function[_set_pseudotime, parameter[self]]: constant[Return pseudotime with respect to root point. ] name[self].pseudotime assign[=] call[call[name[self].distances_dpt][name[self].iroot].copy, parameter[]] <ast.AugAssign object at 0x7da18f58faf0>
keyword[def] identifier[_set_pseudotime] ( identifier[self] ): literal[string] identifier[self] . identifier[pseudotime] = identifier[self] . identifier[distances_dpt] [ identifier[self] . identifier[iroot] ]. identifier[copy] () identifier[self] . identifier[pseudotime] /= identifier[np] ...
def _set_pseudotime(self): """Return pseudotime with respect to root point. """ self.pseudotime = self.distances_dpt[self.iroot].copy() self.pseudotime /= np.max(self.pseudotime[self.pseudotime < np.inf])
def resetCanvasDimensions(self, windowHeight, windowWidth): 'sets total available canvas dimensions to (windowHeight, windowWidth) (in char cells)' self.plotwidth = windowWidth*2 self.plotheight = (windowHeight-1)*4 # exclude status line # pixels[y][x] = { attr: list(rows), ... } ...
def function[resetCanvasDimensions, parameter[self, windowHeight, windowWidth]]: constant[sets total available canvas dimensions to (windowHeight, windowWidth) (in char cells)] name[self].plotwidth assign[=] binary_operation[name[windowWidth] * constant[2]] name[self].plotheight assign[=] binary...
keyword[def] identifier[resetCanvasDimensions] ( identifier[self] , identifier[windowHeight] , identifier[windowWidth] ): literal[string] identifier[self] . identifier[plotwidth] = identifier[windowWidth] * literal[int] identifier[self] . identifier[plotheight] =( identifier[windowHeight]...
def resetCanvasDimensions(self, windowHeight, windowWidth): """sets total available canvas dimensions to (windowHeight, windowWidth) (in char cells)""" self.plotwidth = windowWidth * 2 self.plotheight = (windowHeight - 1) * 4 # exclude status line # pixels[y][x] = { attr: list(rows), ... } self.pix...
def verify_words(self): """Verify the fields source, imagery_used and comment of the changeset for some suspect words. """ if self.comment: if find_words(self.comment, self.suspect_words, self.excluded_words): self.label_suspicious('suspect_word') if ...
def function[verify_words, parameter[self]]: constant[Verify the fields source, imagery_used and comment of the changeset for some suspect words. ] if name[self].comment begin[:] if call[name[find_words], parameter[name[self].comment, name[self].suspect_words, name[self]....
keyword[def] identifier[verify_words] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[comment] : keyword[if] identifier[find_words] ( identifier[self] . identifier[comment] , identifier[self] . identifier[suspect_words] , identifier[self] . identifier[...
def verify_words(self): """Verify the fields source, imagery_used and comment of the changeset for some suspect words. """ if self.comment: if find_words(self.comment, self.suspect_words, self.excluded_words): self.label_suspicious('suspect_word') # depends on [control=['if'...
End of preview. Expand in Data Studio

Dataset Card for "DeepCC_Python"

More Information needed

Downloads last month
70