code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def _GetArgsDescription(self, args_type): """Get a simplified description of the args_type for a flow.""" args = {} if args_type: for type_descriptor in args_type.type_infos: if not type_descriptor.hidden: args[type_descriptor.name] = { "description": type_descriptor.de...
def function[_GetArgsDescription, parameter[self, args_type]]: constant[Get a simplified description of the args_type for a flow.] variable[args] assign[=] dictionary[[], []] if name[args_type] begin[:] for taget[name[type_descriptor]] in starred[name[args_type].type_infos] begin...
keyword[def] identifier[_GetArgsDescription] ( identifier[self] , identifier[args_type] ): literal[string] identifier[args] ={} keyword[if] identifier[args_type] : keyword[for] identifier[type_descriptor] keyword[in] identifier[args_type] . identifier[type_infos] : keyword[if] key...
def _GetArgsDescription(self, args_type): """Get a simplified description of the args_type for a flow.""" args = {} if args_type: for type_descriptor in args_type.type_infos: if not type_descriptor.hidden: args[type_descriptor.name] = {'description': type_descriptor.descr...
def is_private(prefix, base): """prefix, base -> true iff name prefix + "." + base is "private". Prefix may be an empty string, and base does not contain a period. Prefix is ignored (although functions you write conforming to this protocol may make use of it). Return true iff base begins with an (a...
def function[is_private, parameter[prefix, base]]: constant[prefix, base -> true iff name prefix + "." + base is "private". Prefix may be an empty string, and base does not contain a period. Prefix is ignored (although functions you write conforming to this protocol may make use of it). Return ...
keyword[def] identifier[is_private] ( identifier[prefix] , identifier[base] ): literal[string] identifier[warnings] . identifier[warn] ( literal[string] literal[string] , identifier[DeprecationWarning] , identifier[stacklevel] = literal[int] ) keyword[return] identifier[base] [: literal[in...
def is_private(prefix, base): """prefix, base -> true iff name prefix + "." + base is "private". Prefix may be an empty string, and base does not contain a period. Prefix is ignored (although functions you write conforming to this protocol may make use of it). Return true iff base begins with an (a...
def format_errors(errors, indent=0, prefix='', suffix=''): """ string: "example" "example" dict: "example": - """ if is_single_item_iterable(errors): errors = errors[0] if isinstance(errors, SINGULAR_TYPES): yield indent_message(repr(errors), indent...
def function[format_errors, parameter[errors, indent, prefix, suffix]]: constant[ string: "example" "example" dict: "example": - ] if call[name[is_single_item_iterable], parameter[name[errors]]] begin[:] variable[errors] assign[=] call[name[erro...
keyword[def] identifier[format_errors] ( identifier[errors] , identifier[indent] = literal[int] , identifier[prefix] = literal[string] , identifier[suffix] = literal[string] ): literal[string] keyword[if] identifier[is_single_item_iterable] ( identifier[errors] ): identifier[errors] = identifier[...
def format_errors(errors, indent=0, prefix='', suffix=''): """ string: "example" "example" dict: "example": - """ if is_single_item_iterable(errors): errors = errors[0] # depends on [control=['if'], data=[]] if isinstance(errors, SINGULAR_TYPES): y...
def init(self): """Init the connection to the Cassandra server.""" if not self.export_enable: return None # if username and/or password are not set the connection will try to connect with no auth auth_provider = PlainTextAuthProvider( username=self.username, pass...
def function[init, parameter[self]]: constant[Init the connection to the Cassandra server.] if <ast.UnaryOp object at 0x7da18f09d660> begin[:] return[constant[None]] variable[auth_provider] assign[=] call[name[PlainTextAuthProvider], parameter[]] <ast.Try object at 0x7da18f09f250> ...
keyword[def] identifier[init] ( identifier[self] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[export_enable] : keyword[return] keyword[None] identifier[auth_provider] = identifier[PlainTextAuthProvider] ( identifier[usern...
def init(self): """Init the connection to the Cassandra server.""" if not self.export_enable: return None # depends on [control=['if'], data=[]] # if username and/or password are not set the connection will try to connect with no auth auth_provider = PlainTextAuthProvider(username=self.username...
def Validate(self, value): """Validate the value. Args: value: Value is expected to be a dict-like object that a given RDFStruct can be initialized from. Raises: TypeValueError: If the value is not a valid dict-like object that a given RDFStruct can be initialized from. Re...
def function[Validate, parameter[self, value]]: constant[Validate the value. Args: value: Value is expected to be a dict-like object that a given RDFStruct can be initialized from. Raises: TypeValueError: If the value is not a valid dict-like object that a given RDFStruct c...
keyword[def] identifier[Validate] ( identifier[self] , identifier[value] ): literal[string] keyword[if] identifier[value] keyword[is] keyword[None] : keyword[return] keyword[None] keyword[if] keyword[not] identifier[isinstance] ( identifier[value] , identifier[self] . identifier[rdfclas...
def Validate(self, value): """Validate the value. Args: value: Value is expected to be a dict-like object that a given RDFStruct can be initialized from. Raises: TypeValueError: If the value is not a valid dict-like object that a given RDFStruct can be initialized from. Re...
def add_library(self, name): """Add a library to the database This method is for adding a library by name (eg: "BuiltIn") rather than by a file. """ libdoc = LibraryDocumentation(name) if len(libdoc.keywords) > 0: # FIXME: figure out the path to the library f...
def function[add_library, parameter[self, name]]: constant[Add a library to the database This method is for adding a library by name (eg: "BuiltIn") rather than by a file. ] variable[libdoc] assign[=] call[name[LibraryDocumentation], parameter[name[name]]] if compare[cal...
keyword[def] identifier[add_library] ( identifier[self] , identifier[name] ): literal[string] identifier[libdoc] = identifier[LibraryDocumentation] ( identifier[name] ) keyword[if] identifier[len] ( identifier[libdoc] . identifier[keywords] )> literal[int] : identifi...
def add_library(self, name): """Add a library to the database This method is for adding a library by name (eg: "BuiltIn") rather than by a file. """ libdoc = LibraryDocumentation(name) if len(libdoc.keywords) > 0: # FIXME: figure out the path to the library file coll...
def windowed(a, windowsize, stepsize=None, dopad=False): """ Parameters a - the input array to restructure into overlapping windows windowsize - the size of each window of samples stepsize - the number of samples to shift the window each step. If not speci...
def function[windowed, parameter[a, windowsize, stepsize, dopad]]: constant[ Parameters a - the input array to restructure into overlapping windows windowsize - the size of each window of samples stepsize - the number of samples to shift the window each step. If not ...
keyword[def] identifier[windowed] ( identifier[a] , identifier[windowsize] , identifier[stepsize] = keyword[None] , identifier[dopad] = keyword[False] ): literal[string] keyword[if] identifier[windowsize] < literal[int] : keyword[raise] identifier[ValueError] ( literal[string] ) keyword[i...
def windowed(a, windowsize, stepsize=None, dopad=False): """ Parameters a - the input array to restructure into overlapping windows windowsize - the size of each window of samples stepsize - the number of samples to shift the window each step. If not speci...
def generate_symbolic_cmd_line_arg(state, max_length=1000): """ Generates a new symbolic cmd line argument string. :return: The string reference. """ str_ref = SimSootValue_StringRef(state.memory.get_new_uuid()) str_sym = StringS("cmd_line_arg", max_length) state....
def function[generate_symbolic_cmd_line_arg, parameter[state, max_length]]: constant[ Generates a new symbolic cmd line argument string. :return: The string reference. ] variable[str_ref] assign[=] call[name[SimSootValue_StringRef], parameter[call[name[state].memory.get_new_uuid,...
keyword[def] identifier[generate_symbolic_cmd_line_arg] ( identifier[state] , identifier[max_length] = literal[int] ): literal[string] identifier[str_ref] = identifier[SimSootValue_StringRef] ( identifier[state] . identifier[memory] . identifier[get_new_uuid] ()) identifier[str_sym] = iden...
def generate_symbolic_cmd_line_arg(state, max_length=1000): """ Generates a new symbolic cmd line argument string. :return: The string reference. """ str_ref = SimSootValue_StringRef(state.memory.get_new_uuid()) str_sym = StringS('cmd_line_arg', max_length) state.solver.add(str_s...
def load_stream(self, stream): """ Load a stream of un-ordered Arrow RecordBatches, where the last iteration yields a list of indices that can be used to put the RecordBatches in the correct order. """ # load the batches for batch in self.serializer.load_stream(stream): ...
def function[load_stream, parameter[self, stream]]: constant[ Load a stream of un-ordered Arrow RecordBatches, where the last iteration yields a list of indices that can be used to put the RecordBatches in the correct order. ] for taget[name[batch]] in starred[call[name[self].ser...
keyword[def] identifier[load_stream] ( identifier[self] , identifier[stream] ): literal[string] keyword[for] identifier[batch] keyword[in] identifier[self] . identifier[serializer] . identifier[load_stream] ( identifier[stream] ): keyword[yield] identifier[batch] ...
def load_stream(self, stream): """ Load a stream of un-ordered Arrow RecordBatches, where the last iteration yields a list of indices that can be used to put the RecordBatches in the correct order. """ # load the batches for batch in self.serializer.load_stream(stream): yield...
def select_larva(self): """Select all larva.""" action = sc_pb.Action() action.action_ui.select_larva.SetInParent() # Adds the empty proto field. return action
def function[select_larva, parameter[self]]: constant[Select all larva.] variable[action] assign[=] call[name[sc_pb].Action, parameter[]] call[name[action].action_ui.select_larva.SetInParent, parameter[]] return[name[action]]
keyword[def] identifier[select_larva] ( identifier[self] ): literal[string] identifier[action] = identifier[sc_pb] . identifier[Action] () identifier[action] . identifier[action_ui] . identifier[select_larva] . identifier[SetInParent] () keyword[return] identifier[action]
def select_larva(self): """Select all larva.""" action = sc_pb.Action() action.action_ui.select_larva.SetInParent() # Adds the empty proto field. return action
def resource_headers(self, jobscript): """Given a :class:`~clusterjob.JobScript` instance, return a list of lines that encode the resource requirements, to be added at the top of the rendered job script """ resources = jobscript.resources lines = [] cores_per_node...
def function[resource_headers, parameter[self, jobscript]]: constant[Given a :class:`~clusterjob.JobScript` instance, return a list of lines that encode the resource requirements, to be added at the top of the rendered job script ] variable[resources] assign[=] name[jobscript].re...
keyword[def] identifier[resource_headers] ( identifier[self] , identifier[jobscript] ): literal[string] identifier[resources] = identifier[jobscript] . identifier[resources] identifier[lines] =[] identifier[cores_per_node] = literal[int] identifier[nodes] = literal[int]...
def resource_headers(self, jobscript): """Given a :class:`~clusterjob.JobScript` instance, return a list of lines that encode the resource requirements, to be added at the top of the rendered job script """ resources = jobscript.resources lines = [] cores_per_node = 1 nodes =...
def setColorRamp(self, colorRamp=None): """ Set the color ramp of the raster converter instance """ if not colorRamp: self._colorRamp = RasterConverter.setDefaultColorRamp(ColorRampEnum.COLOR_RAMP_HUE) else: self._colorRamp = colorRamp
def function[setColorRamp, parameter[self, colorRamp]]: constant[ Set the color ramp of the raster converter instance ] if <ast.UnaryOp object at 0x7da1b20a96c0> begin[:] name[self]._colorRamp assign[=] call[name[RasterConverter].setDefaultColorRamp, parameter[name[ColorR...
keyword[def] identifier[setColorRamp] ( identifier[self] , identifier[colorRamp] = keyword[None] ): literal[string] keyword[if] keyword[not] identifier[colorRamp] : identifier[self] . identifier[_colorRamp] = identifier[RasterConverter] . identifier[setDefaultColorRamp] ( identifier[...
def setColorRamp(self, colorRamp=None): """ Set the color ramp of the raster converter instance """ if not colorRamp: self._colorRamp = RasterConverter.setDefaultColorRamp(ColorRampEnum.COLOR_RAMP_HUE) # depends on [control=['if'], data=[]] else: self._colorRamp = colorRamp
def del_all_svc_downtimes(self, service): """Delete all service downtime Format of the line that triggers function call:: DEL_ALL_SVC_DOWNTIMES;<host_name>;<service_description> :param service: service to edit :type service: alignak.objects.service.Service :return: None...
def function[del_all_svc_downtimes, parameter[self, service]]: constant[Delete all service downtime Format of the line that triggers function call:: DEL_ALL_SVC_DOWNTIMES;<host_name>;<service_description> :param service: service to edit :type service: alignak.objects.service.Se...
keyword[def] identifier[del_all_svc_downtimes] ( identifier[self] , identifier[service] ): literal[string] keyword[for] identifier[downtime] keyword[in] identifier[service] . identifier[downtimes] : identifier[self] . identifier[del_svc_downtime] ( identifier[downtime] ) id...
def del_all_svc_downtimes(self, service): """Delete all service downtime Format of the line that triggers function call:: DEL_ALL_SVC_DOWNTIMES;<host_name>;<service_description> :param service: service to edit :type service: alignak.objects.service.Service :return: None ...
def detect_keep_boundary(start, end, namespaces): """a helper to inspect a link and see if we should keep the link boundary """ result_start, result_end = False, False parent_start = start.getparent() parent_end = end.getparent() if parent_start.tag == "{%s}p" % namespaces['text']: # mo...
def function[detect_keep_boundary, parameter[start, end, namespaces]]: constant[a helper to inspect a link and see if we should keep the link boundary ] <ast.Tuple object at 0x7da1b26af520> assign[=] tuple[[<ast.Constant object at 0x7da1b26adae0>, <ast.Constant object at 0x7da1b26ad7b0>]] va...
keyword[def] identifier[detect_keep_boundary] ( identifier[start] , identifier[end] , identifier[namespaces] ): literal[string] identifier[result_start] , identifier[result_end] = keyword[False] , keyword[False] identifier[parent_start] = identifier[start] . identifier[getparent] () identifier[p...
def detect_keep_boundary(start, end, namespaces): """a helper to inspect a link and see if we should keep the link boundary """ (result_start, result_end) = (False, False) parent_start = start.getparent() parent_end = end.getparent() if parent_start.tag == '{%s}p' % namespaces['text']: #...
def commit_config(self, message=""): """Commit configuration.""" commit_args = {"comment": message} if message else {} self.device.cu.commit(ignore_warning=self.ignore_warning, **commit_args) if not self.lock_disable and not self.session_config_lock: self._unlock()
def function[commit_config, parameter[self, message]]: constant[Commit configuration.] variable[commit_args] assign[=] <ast.IfExp object at 0x7da1b1c10b50> call[name[self].device.cu.commit, parameter[]] if <ast.BoolOp object at 0x7da1b1c13700> begin[:] call[name[self]._un...
keyword[def] identifier[commit_config] ( identifier[self] , identifier[message] = literal[string] ): literal[string] identifier[commit_args] ={ literal[string] : identifier[message] } keyword[if] identifier[message] keyword[else] {} identifier[self] . identifier[device] . identifier[cu] ...
def commit_config(self, message=''): """Commit configuration.""" commit_args = {'comment': message} if message else {} self.device.cu.commit(ignore_warning=self.ignore_warning, **commit_args) if not self.lock_disable and (not self.session_config_lock): self._unlock() # depends on [control=['if'...
def cmd_devid(self, args): '''decode device IDs from parameters''' for p in self.mav_param.keys(): if p.startswith('COMPASS_DEV_ID'): mp_util.decode_devid(self.mav_param[p], p) if p.startswith('INS_') and p.endswith('_ID'): mp_util.decode_devid(sel...
def function[cmd_devid, parameter[self, args]]: constant[decode device IDs from parameters] for taget[name[p]] in starred[call[name[self].mav_param.keys, parameter[]]] begin[:] if call[name[p].startswith, parameter[constant[COMPASS_DEV_ID]]] begin[:] call[name[mp_...
keyword[def] identifier[cmd_devid] ( identifier[self] , identifier[args] ): literal[string] keyword[for] identifier[p] keyword[in] identifier[self] . identifier[mav_param] . identifier[keys] (): keyword[if] identifier[p] . identifier[startswith] ( literal[string] ): ...
def cmd_devid(self, args): """decode device IDs from parameters""" for p in self.mav_param.keys(): if p.startswith('COMPASS_DEV_ID'): mp_util.decode_devid(self.mav_param[p], p) # depends on [control=['if'], data=[]] if p.startswith('INS_') and p.endswith('_ID'): mp_util....
def to_foreign(self, obj, name, value): """Transform to a MongoDB-safe value.""" if isinstance(value, Iterable) and not isinstance(value, Mapping): return self.List(super(Array, self).to_foreign(obj, name, i) for i in value) return super(Array, self).to_foreign(obj, name, value)
def function[to_foreign, parameter[self, obj, name, value]]: constant[Transform to a MongoDB-safe value.] if <ast.BoolOp object at 0x7da18fe924a0> begin[:] return[call[name[self].List, parameter[<ast.GeneratorExp object at 0x7da20e9549d0>]]] return[call[call[name[super], parameter[name[Array...
keyword[def] identifier[to_foreign] ( identifier[self] , identifier[obj] , identifier[name] , identifier[value] ): literal[string] keyword[if] identifier[isinstance] ( identifier[value] , identifier[Iterable] ) keyword[and] keyword[not] identifier[isinstance] ( identifier[value] , identifier[Mapping] ): ...
def to_foreign(self, obj, name, value): """Transform to a MongoDB-safe value.""" if isinstance(value, Iterable) and (not isinstance(value, Mapping)): return self.List((super(Array, self).to_foreign(obj, name, i) for i in value)) # depends on [control=['if'], data=[]] return super(Array, self).to_fo...
def destroy(self): ''' Called from tearDown of simulation tests. Cleans up everything. ''' defers = list() for x in self.iter_agents(): defers.append(x.terminate_hard()) yield defer.DeferredList(defers) yield self._journaler.close() del(self._j...
def function[destroy, parameter[self]]: constant[ Called from tearDown of simulation tests. Cleans up everything. ] variable[defers] assign[=] call[name[list], parameter[]] for taget[name[x]] in starred[call[name[self].iter_agents, parameter[]]] begin[:] call[name...
keyword[def] identifier[destroy] ( identifier[self] ): literal[string] identifier[defers] = identifier[list] () keyword[for] identifier[x] keyword[in] identifier[self] . identifier[iter_agents] (): identifier[defers] . identifier[append] ( identifier[x] . identifier[termina...
def destroy(self): """ Called from tearDown of simulation tests. Cleans up everything. """ defers = list() for x in self.iter_agents(): defers.append(x.terminate_hard()) # depends on [control=['for'], data=['x']] yield defer.DeferredList(defers) yield self._journaler.close()...
def average(self, projection=None): """ Takes the average of elements in the sequence >>> seq([1, 2]).average() 1.5 >>> seq([('a', 1), ('b', 2)]).average(lambda x: x[1]) :param projection: function to project on the sequence before taking the average :return: a...
def function[average, parameter[self, projection]]: constant[ Takes the average of elements in the sequence >>> seq([1, 2]).average() 1.5 >>> seq([('a', 1), ('b', 2)]).average(lambda x: x[1]) :param projection: function to project on the sequence before taking the aver...
keyword[def] identifier[average] ( identifier[self] , identifier[projection] = keyword[None] ): literal[string] identifier[length] = identifier[self] . identifier[size] () keyword[if] identifier[projection] : keyword[return] identifier[sum] ( identifier[self] . identifier[ma...
def average(self, projection=None): """ Takes the average of elements in the sequence >>> seq([1, 2]).average() 1.5 >>> seq([('a', 1), ('b', 2)]).average(lambda x: x[1]) :param projection: function to project on the sequence before taking the average :return: avera...
def vcs_rbridge_context_input_rbridge_id(self, **kwargs): """Auto Generated Code """ config = ET.Element("config") vcs_rbridge_context = ET.Element("vcs_rbridge_context") config = vcs_rbridge_context input = ET.SubElement(vcs_rbridge_context, "input") rbridge_id =...
def function[vcs_rbridge_context_input_rbridge_id, parameter[self]]: constant[Auto Generated Code ] variable[config] assign[=] call[name[ET].Element, parameter[constant[config]]] variable[vcs_rbridge_context] assign[=] call[name[ET].Element, parameter[constant[vcs_rbridge_context]]] ...
keyword[def] identifier[vcs_rbridge_context_input_rbridge_id] ( identifier[self] ,** identifier[kwargs] ): literal[string] identifier[config] = identifier[ET] . identifier[Element] ( literal[string] ) identifier[vcs_rbridge_context] = identifier[ET] . identifier[Element] ( literal[string] ...
def vcs_rbridge_context_input_rbridge_id(self, **kwargs): """Auto Generated Code """ config = ET.Element('config') vcs_rbridge_context = ET.Element('vcs_rbridge_context') config = vcs_rbridge_context input = ET.SubElement(vcs_rbridge_context, 'input') rbridge_id = ET.SubElement(input, 'r...
def anonymized_formula(self): """ An anonymized formula. Appends charge to the end of anonymized composition """ anon_formula = super().anonymized_formula chg = self._charge chg_str = "" if chg > 0: chg_str += ("{}{}".format('+', str(int(chg)))...
def function[anonymized_formula, parameter[self]]: constant[ An anonymized formula. Appends charge to the end of anonymized composition ] variable[anon_formula] assign[=] call[name[super], parameter[]].anonymized_formula variable[chg] assign[=] name[self]._charge ...
keyword[def] identifier[anonymized_formula] ( identifier[self] ): literal[string] identifier[anon_formula] = identifier[super] (). identifier[anonymized_formula] identifier[chg] = identifier[self] . identifier[_charge] identifier[chg_str] = literal[string] keyword[if] ...
def anonymized_formula(self): """ An anonymized formula. Appends charge to the end of anonymized composition """ anon_formula = super().anonymized_formula chg = self._charge chg_str = '' if chg > 0: chg_str += '{}{}'.format('+', str(int(chg))) # depends on [control=[...
def _computeChart(chart, date): """ Internal function to return a new chart for a specific date using properties from old chart. """ pos = chart.pos hsys = chart.hsys IDs = [obj.id for obj in chart.objects] return Chart(date, pos, IDs=IDs, hsys=hsys)
def function[_computeChart, parameter[chart, date]]: constant[ Internal function to return a new chart for a specific date using properties from old chart. ] variable[pos] assign[=] name[chart].pos variable[hsys] assign[=] name[chart].hsys variable[IDs] assign[=] <ast.ListCo...
keyword[def] identifier[_computeChart] ( identifier[chart] , identifier[date] ): literal[string] identifier[pos] = identifier[chart] . identifier[pos] identifier[hsys] = identifier[chart] . identifier[hsys] identifier[IDs] =[ identifier[obj] . identifier[id] keyword[for] identifier[obj] keyw...
def _computeChart(chart, date): """ Internal function to return a new chart for a specific date using properties from old chart. """ pos = chart.pos hsys = chart.hsys IDs = [obj.id for obj in chart.objects] return Chart(date, pos, IDs=IDs, hsys=hsys)
def visit_module(self, node): """return an astroid.Module node as string""" docs = '"""%s"""\n\n' % node.doc if node.doc else "" return docs + "\n".join(n.accept(self) for n in node.body) + "\n\n"
def function[visit_module, parameter[self, node]]: constant[return an astroid.Module node as string] variable[docs] assign[=] <ast.IfExp object at 0x7da1b1e758a0> return[binary_operation[binary_operation[name[docs] + call[constant[ ].join, parameter[<ast.GeneratorExp object at 0x7da1b1e758d0>]]] + c...
keyword[def] identifier[visit_module] ( identifier[self] , identifier[node] ): literal[string] identifier[docs] = literal[string] % identifier[node] . identifier[doc] keyword[if] identifier[node] . identifier[doc] keyword[else] literal[string] keyword[return] identifier[docs] + liter...
def visit_module(self, node): """return an astroid.Module node as string""" docs = '"""%s"""\n\n' % node.doc if node.doc else '' return docs + '\n'.join((n.accept(self) for n in node.body)) + '\n\n'
def saveLastScreenImage(self): """ Saves the last image taken on this region's screen to a temporary file """ bitmap = self.getLastScreenImage() _, target_file = tempfile.mkstemp(".png") cv2.imwrite(target_file, bitmap)
def function[saveLastScreenImage, parameter[self]]: constant[ Saves the last image taken on this region's screen to a temporary file ] variable[bitmap] assign[=] call[name[self].getLastScreenImage, parameter[]] <ast.Tuple object at 0x7da20e962860> assign[=] call[name[tempfile].mkstemp, parameter...
keyword[def] identifier[saveLastScreenImage] ( identifier[self] ): literal[string] identifier[bitmap] = identifier[self] . identifier[getLastScreenImage] () identifier[_] , identifier[target_file] = identifier[tempfile] . identifier[mkstemp] ( literal[string] ) identifier[cv2] . i...
def saveLastScreenImage(self): """ Saves the last image taken on this region's screen to a temporary file """ bitmap = self.getLastScreenImage() (_, target_file) = tempfile.mkstemp('.png') cv2.imwrite(target_file, bitmap)
def create(dataset, annotations=None, feature=None, model='darknet-yolo', classes=None, batch_size=0, max_iterations=0, verbose=True, **kwargs): """ Create a :class:`ObjectDetector` model. Parameters ---------- dataset : SFrame Input data. The columns named by the ``fe...
def function[create, parameter[dataset, annotations, feature, model, classes, batch_size, max_iterations, verbose]]: constant[ Create a :class:`ObjectDetector` model. Parameters ---------- dataset : SFrame Input data. The columns named by the ``feature`` and ``annotations`` para...
keyword[def] identifier[create] ( identifier[dataset] , identifier[annotations] = keyword[None] , identifier[feature] = keyword[None] , identifier[model] = literal[string] , identifier[classes] = keyword[None] , identifier[batch_size] = literal[int] , identifier[max_iterations] = literal[int] , identifier[verbose] =...
def create(dataset, annotations=None, feature=None, model='darknet-yolo', classes=None, batch_size=0, max_iterations=0, verbose=True, **kwargs): """ Create a :class:`ObjectDetector` model. Parameters ---------- dataset : SFrame Input data. The columns named by the ``feature`` and ``annotati...
def rollbackBlockUser(self, userId, chatroomId): """ 移除封禁聊天室成员方法 方法 @param userId:用户 Id。(必传) @param chatroomId:聊天室 Id。(必传) @return code:返回码,200 为正常。 @return errorMessage:错误信息。 """ desc = { "name": "CodeSuccessReslut", "desc": " h...
def function[rollbackBlockUser, parameter[self, userId, chatroomId]]: constant[ 移除封禁聊天室成员方法 方法 @param userId:用户 Id。(必传) @param chatroomId:聊天室 Id。(必传) @return code:返回码,200 为正常。 @return errorMessage:错误信息。 ] variable[desc] assign[=] dictionary[[<ast.Constan...
keyword[def] identifier[rollbackBlockUser] ( identifier[self] , identifier[userId] , identifier[chatroomId] ): literal[string] identifier[desc] ={ literal[string] : literal[string] , literal[string] : literal[string] , literal[string] :[{ literal[string] : liter...
def rollbackBlockUser(self, userId, chatroomId): """ 移除封禁聊天室成员方法 方法 @param userId:用户 Id。(必传) @param chatroomId:聊天室 Id。(必传) @return code:返回码,200 为正常。 @return errorMessage:错误信息。 """ desc = {'name': 'CodeSuccessReslut', 'desc': ' http 成功返回结果', 'fields': [{'name': '...
def get_queryset(self): """ Returns a VersionedQuerySet capable of handling version time restrictions. :return: VersionedQuerySet """ qs = VersionedQuerySet(self.model, using=self._db) if hasattr(self, 'instance') and hasattr(self.instance, '_querytime'): ...
def function[get_queryset, parameter[self]]: constant[ Returns a VersionedQuerySet capable of handling version time restrictions. :return: VersionedQuerySet ] variable[qs] assign[=] call[name[VersionedQuerySet], parameter[name[self].model]] if <ast.BoolOp object ...
keyword[def] identifier[get_queryset] ( identifier[self] ): literal[string] identifier[qs] = identifier[VersionedQuerySet] ( identifier[self] . identifier[model] , identifier[using] = identifier[self] . identifier[_db] ) keyword[if] identifier[hasattr] ( identifier[self] , literal[string]...
def get_queryset(self): """ Returns a VersionedQuerySet capable of handling version time restrictions. :return: VersionedQuerySet """ qs = VersionedQuerySet(self.model, using=self._db) if hasattr(self, 'instance') and hasattr(self.instance, '_querytime'): qs.querytim...
def course(self, dept, course_number): """Return an object of semester-independent course info. All arguments should be strings. >>> cis120 = r.course('cis', '120') """ response = self._request(path.join(ENDPOINTS['CATALOG'], dept, course_number)) return response['result...
def function[course, parameter[self, dept, course_number]]: constant[Return an object of semester-independent course info. All arguments should be strings. >>> cis120 = r.course('cis', '120') ] variable[response] assign[=] call[name[self]._request, parameter[call[name[path].join...
keyword[def] identifier[course] ( identifier[self] , identifier[dept] , identifier[course_number] ): literal[string] identifier[response] = identifier[self] . identifier[_request] ( identifier[path] . identifier[join] ( identifier[ENDPOINTS] [ literal[string] ], identifier[dept] , identifier[course...
def course(self, dept, course_number): """Return an object of semester-independent course info. All arguments should be strings. >>> cis120 = r.course('cis', '120') """ response = self._request(path.join(ENDPOINTS['CATALOG'], dept, course_number)) return response['result_data'][0]
def concatenate(self, tpl, axis=None): """ Concatenates sparse tensors. Parameters ---------- tpl : tuple of sparse tensors Tensors to be concatenated. axis : int, optional Axis along which concatenation should take place """ if ...
def function[concatenate, parameter[self, tpl, axis]]: constant[ Concatenates sparse tensors. Parameters ---------- tpl : tuple of sparse tensors Tensors to be concatenated. axis : int, optional Axis along which concatenation should take place ...
keyword[def] identifier[concatenate] ( identifier[self] , identifier[tpl] , identifier[axis] = keyword[None] ): literal[string] keyword[if] identifier[axis] keyword[is] keyword[None] : keyword[raise] identifier[NotImplementedError] ( literal[string] ) ...
def concatenate(self, tpl, axis=None): """ Concatenates sparse tensors. Parameters ---------- tpl : tuple of sparse tensors Tensors to be concatenated. axis : int, optional Axis along which concatenation should take place """ if axis is ...
def list_py_file_paths(directory, safe_mode=True, include_examples=None): """ Traverse a directory and look for Python files. :param directory: the directory to traverse :type directory: unicode :param safe_mode: whether to use a heuristic to determine whether a file ...
def function[list_py_file_paths, parameter[directory, safe_mode, include_examples]]: constant[ Traverse a directory and look for Python files. :param directory: the directory to traverse :type directory: unicode :param safe_mode: whether to use a heuristic to determine whether a file co...
keyword[def] identifier[list_py_file_paths] ( identifier[directory] , identifier[safe_mode] = keyword[True] , identifier[include_examples] = keyword[None] ): literal[string] keyword[if] identifier[include_examples] keyword[is] keyword[None] : identifier[include_examples] = identifier[conf] . i...
def list_py_file_paths(directory, safe_mode=True, include_examples=None): """ Traverse a directory and look for Python files. :param directory: the directory to traverse :type directory: unicode :param safe_mode: whether to use a heuristic to determine whether a file contains Airflow DAG de...
def rasterize(self, pitch, origin, resolution=None, fill=True, width=None, **kwargs): """ Rasterize a Path2D object into a boolean image ("mode 1"). Parameters ------------ ...
def function[rasterize, parameter[self, pitch, origin, resolution, fill, width]]: constant[ Rasterize a Path2D object into a boolean image ("mode 1"). Parameters ------------ pitch: float, length in model space of a pixel edge origin: (2,) float, origin position...
keyword[def] identifier[rasterize] ( identifier[self] , identifier[pitch] , identifier[origin] , identifier[resolution] = keyword[None] , identifier[fill] = keyword[True] , identifier[width] = keyword[None] , ** identifier[kwargs] ): literal[string] identifier[image] = identifier[raster] . ide...
def rasterize(self, pitch, origin, resolution=None, fill=True, width=None, **kwargs): """ Rasterize a Path2D object into a boolean image ("mode 1"). Parameters ------------ pitch: float, length in model space of a pixel edge origin: (2,) float, origin position in mo...
def _get_log_schema(self): """ Get the log schema for this SMC version. :return: dict """ if self.session and self.session_id: schema = '{}/{}/monitoring/log/schemas'.format(self.url, self.api_version) response = self.session.get( ...
def function[_get_log_schema, parameter[self]]: constant[ Get the log schema for this SMC version. :return: dict ] if <ast.BoolOp object at 0x7da1b1a29ab0> begin[:] variable[schema] assign[=] call[constant[{}/{}/monitoring/log/schemas].format, parameter[n...
keyword[def] identifier[_get_log_schema] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[session] keyword[and] identifier[self] . identifier[session_id] : identifier[schema] = literal[string] . identifier[format] ( identifier[self] . identifier[url] ,...
def _get_log_schema(self): """ Get the log schema for this SMC version. :return: dict """ if self.session and self.session_id: schema = '{}/{}/monitoring/log/schemas'.format(self.url, self.api_version) response = self.session.get(url=schema, headers={'cookie': se...
def delete_attributes(self, item_name, attributes=None, expected_values=None): """ Delete attributes from a given item. :type item_name: string :param item_name: The name of the item whose attributes are being deleted. :type attributes: dict, list or :...
def function[delete_attributes, parameter[self, item_name, attributes, expected_values]]: constant[ Delete attributes from a given item. :type item_name: string :param item_name: The name of the item whose attributes are being deleted. :type attributes: dict, list or :class:`bo...
keyword[def] identifier[delete_attributes] ( identifier[self] , identifier[item_name] , identifier[attributes] = keyword[None] , identifier[expected_values] = keyword[None] ): literal[string] keyword[return] identifier[self] . identifier[connection] . identifier[delete_attributes] ( identifier[se...
def delete_attributes(self, item_name, attributes=None, expected_values=None): """ Delete attributes from a given item. :type item_name: string :param item_name: The name of the item whose attributes are being deleted. :type attributes: dict, list or :class:`boto.sdb.item.Item` ...
def plot_chmap(cube, kidid, ax=None, **kwargs): """Plot an intensity map. Args: cube (xarray.DataArray): Cube which the spectrum information is included. kidid (int): Kidid. ax (matplotlib.axes): Axis the figure is plotted on. kwargs (optional): Plot options passed to ax.imshow(...
def function[plot_chmap, parameter[cube, kidid, ax]]: constant[Plot an intensity map. Args: cube (xarray.DataArray): Cube which the spectrum information is included. kidid (int): Kidid. ax (matplotlib.axes): Axis the figure is plotted on. kwargs (optional): Plot options pass...
keyword[def] identifier[plot_chmap] ( identifier[cube] , identifier[kidid] , identifier[ax] = keyword[None] ,** identifier[kwargs] ): literal[string] keyword[if] identifier[ax] keyword[is] keyword[None] : identifier[ax] = identifier[plt] . identifier[gca] () identifier[index] = identifier...
def plot_chmap(cube, kidid, ax=None, **kwargs): """Plot an intensity map. Args: cube (xarray.DataArray): Cube which the spectrum information is included. kidid (int): Kidid. ax (matplotlib.axes): Axis the figure is plotted on. kwargs (optional): Plot options passed to ax.imshow(...
def getLearnableLocationRepresentation(self): """ Get the cells in the location layer that should be associated with the sensory input layer representation. In some models, this is identical to the active cells. In others, it's a subset. """ learnableCells = np.array([], dtype="uint32") tot...
def function[getLearnableLocationRepresentation, parameter[self]]: constant[ Get the cells in the location layer that should be associated with the sensory input layer representation. In some models, this is identical to the active cells. In others, it's a subset. ] variable[learnableCel...
keyword[def] identifier[getLearnableLocationRepresentation] ( identifier[self] ): literal[string] identifier[learnableCells] = identifier[np] . identifier[array] ([], identifier[dtype] = literal[string] ) identifier[totalPrevCells] = literal[int] keyword[for] identifier[module] keyword[in] i...
def getLearnableLocationRepresentation(self): """ Get the cells in the location layer that should be associated with the sensory input layer representation. In some models, this is identical to the active cells. In others, it's a subset. """ learnableCells = np.array([], dtype='uint32') tota...
def _round_whole_even(i): r'''Round a number to the nearest whole number. If the number is exactly between two numbers, round to the even whole number. Used by `viscosity_index`. Parameters ---------- i : float Number, [-] Returns ------- i : int Rounded number, [-]...
def function[_round_whole_even, parameter[i]]: constant[Round a number to the nearest whole number. If the number is exactly between two numbers, round to the even whole number. Used by `viscosity_index`. Parameters ---------- i : float Number, [-] Returns ------- i : i...
keyword[def] identifier[_round_whole_even] ( identifier[i] ): literal[string] keyword[if] identifier[i] % literal[int] == literal[int] : keyword[if] ( identifier[i] + literal[int] )% literal[int] == literal[int] : identifier[i] = identifier[i] + literal[int] keyword[else] :...
def _round_whole_even(i): """Round a number to the nearest whole number. If the number is exactly between two numbers, round to the even whole number. Used by `viscosity_index`. Parameters ---------- i : float Number, [-] Returns ------- i : int Rounded number, [-] ...
def concat(cartesians, ignore_index=False, keys=None): """Join list of cartesians into one molecule. Wrapper around the :func:`pandas.concat` function. Default values are the same as in the pandas function except for ``verify_integrity`` which is set to true in case of this library. Args: ...
def function[concat, parameter[cartesians, ignore_index, keys]]: constant[Join list of cartesians into one molecule. Wrapper around the :func:`pandas.concat` function. Default values are the same as in the pandas function except for ``verify_integrity`` which is set to true in case of this library....
keyword[def] identifier[concat] ( identifier[cartesians] , identifier[ignore_index] = keyword[False] , identifier[keys] = keyword[None] ): literal[string] identifier[frames] =[ identifier[molecule] . identifier[_frame] keyword[for] identifier[molecule] keyword[in] identifier[cartesians] ] identifi...
def concat(cartesians, ignore_index=False, keys=None): """Join list of cartesians into one molecule. Wrapper around the :func:`pandas.concat` function. Default values are the same as in the pandas function except for ``verify_integrity`` which is set to true in case of this library. Args: ...
def boundary_maximum_linear(graph, xxx_todo_changeme1): r""" Boundary term processing adjacent voxels maximum value using a linear relationship. An implementation of a boundary term, suitable to be used with the `~medpy.graphcut.generate.graph_from_voxels` function. The same as `boundary_...
def function[boundary_maximum_linear, parameter[graph, xxx_todo_changeme1]]: constant[ Boundary term processing adjacent voxels maximum value using a linear relationship. An implementation of a boundary term, suitable to be used with the `~medpy.graphcut.generate.graph_from_voxels` function. ...
keyword[def] identifier[boundary_maximum_linear] ( identifier[graph] , identifier[xxx_todo_changeme1] ): literal[string] ( identifier[gradient_image] , identifier[spacing] )= identifier[xxx_todo_changeme1] identifier[gradient_image] = identifier[scipy] . identifier[asarray] ( identifier[gradient_image...
def boundary_maximum_linear(graph, xxx_todo_changeme1): """ Boundary term processing adjacent voxels maximum value using a linear relationship. An implementation of a boundary term, suitable to be used with the `~medpy.graphcut.generate.graph_from_voxels` function. The same as `boundary_d...
def get_user_config(config_file=None, default_config=False): """Return the user config as a dict. If ``default_config`` is True, ignore ``config_file`` and return default values for the config parameters. If a path to a ``config_file`` is given, that is different from the default location, load th...
def function[get_user_config, parameter[config_file, default_config]]: constant[Return the user config as a dict. If ``default_config`` is True, ignore ``config_file`` and return default values for the config parameters. If a path to a ``config_file`` is given, that is different from the default ...
keyword[def] identifier[get_user_config] ( identifier[config_file] = keyword[None] , identifier[default_config] = keyword[False] ): literal[string] keyword[if] identifier[default_config] : keyword[return] identifier[copy] . identifier[copy] ( identifier[DEFAULT_CONFIG] ) keyw...
def get_user_config(config_file=None, default_config=False): """Return the user config as a dict. If ``default_config`` is True, ignore ``config_file`` and return default values for the config parameters. If a path to a ``config_file`` is given, that is different from the default location, load th...
def on_connect(self, client, userdata, flags, rc): """ on_connect(self, client, obj, flags, rc): client the client instance for this callback userdata the private user data as set in Client() or userdata_set() flags response flags sent by the b...
def function[on_connect, parameter[self, client, userdata, flags, rc]]: constant[ on_connect(self, client, obj, flags, rc): client the client instance for this callback userdata the private user data as set in Client() or userdata_set() flags r...
keyword[def] identifier[on_connect] ( identifier[self] , identifier[client] , identifier[userdata] , identifier[flags] , identifier[rc] ): literal[string] identifier[_logger] . identifier[debug] ( literal[string] % identifier[rc] ) keyword[if] identifier[self] . identifier[reg_thread] k...
def on_connect(self, client, userdata, flags, rc): """ on_connect(self, client, obj, flags, rc): client the client instance for this callback userdata the private user data as set in Client() or userdata_set() flags response flags sent by the broke...
def plot(self, label=None, colour='g', style='-'): # pragma: no cover '''Plot the time series.''' pylab = LazyImport.pylab() pylab.plot(self.dates, self.values, '%s%s' % (colour, style), label=label) if label is not None: pylab.legend() pylab.show()
def function[plot, parameter[self, label, colour, style]]: constant[Plot the time series.] variable[pylab] assign[=] call[name[LazyImport].pylab, parameter[]] call[name[pylab].plot, parameter[name[self].dates, name[self].values, binary_operation[constant[%s%s] <ast.Mod object at 0x7da2590d6920> ...
keyword[def] identifier[plot] ( identifier[self] , identifier[label] = keyword[None] , identifier[colour] = literal[string] , identifier[style] = literal[string] ): literal[string] identifier[pylab] = identifier[LazyImport] . identifier[pylab] () identifier[pylab] . identifier[plot] ( iden...
def plot(self, label=None, colour='g', style='-'): # pragma: no cover 'Plot the time series.' pylab = LazyImport.pylab() pylab.plot(self.dates, self.values, '%s%s' % (colour, style), label=label) if label is not None: pylab.legend() # depends on [control=['if'], data=[]] pylab.show()
def _build_message(self, to, text, subject=None, mtype=None, unsubscribe_url=None): """Constructs a MIME message from message and dispatch models.""" # TODO Maybe file attachments handling through `files` message_model context var. if subject is None: subject = u'%s' % _('No Subject...
def function[_build_message, parameter[self, to, text, subject, mtype, unsubscribe_url]]: constant[Constructs a MIME message from message and dispatch models.] if compare[name[subject] is constant[None]] begin[:] variable[subject] assign[=] binary_operation[constant[%s] <ast.Mod object a...
keyword[def] identifier[_build_message] ( identifier[self] , identifier[to] , identifier[text] , identifier[subject] = keyword[None] , identifier[mtype] = keyword[None] , identifier[unsubscribe_url] = keyword[None] ): literal[string] keyword[if] identifier[subject] keyword[is] keyword[...
def _build_message(self, to, text, subject=None, mtype=None, unsubscribe_url=None): """Constructs a MIME message from message and dispatch models.""" # TODO Maybe file attachments handling through `files` message_model context var. if subject is None: subject = u'%s' % _('No Subject') # depends on ...
def PlanetStatistics(model='nPLD', compare_to='k2sff', **kwargs): ''' Computes and plots the CDPP statistics comparison between `model` and `compare_to` for all known K2 planets. :param str model: The :py:obj:`everest` model name :param str compare_to: The :py:obj:`everest` model name or \ ...
def function[PlanetStatistics, parameter[model, compare_to]]: constant[ Computes and plots the CDPP statistics comparison between `model` and `compare_to` for all known K2 planets. :param str model: The :py:obj:`everest` model name :param str compare_to: The :py:obj:`everest` model name or ...
keyword[def] identifier[PlanetStatistics] ( identifier[model] = literal[string] , identifier[compare_to] = literal[string] ,** identifier[kwargs] ): literal[string] identifier[f] = identifier[os] . identifier[path] . identifier[join] ( identifier[EVEREST_SRC] , literal[string] , literal[string] , lit...
def PlanetStatistics(model='nPLD', compare_to='k2sff', **kwargs): """ Computes and plots the CDPP statistics comparison between `model` and `compare_to` for all known K2 planets. :param str model: The :py:obj:`everest` model name :param str compare_to: The :py:obj:`everest` model name or ...
def _next_rId(self): """ Next available rId in collection, starting from 'rId1' and making use of any gaps in numbering, e.g. 'rId2' for rIds ['rId1', 'rId3']. """ for n in range(1, len(self)+2): rId_candidate = 'rId%d' % n # like 'rId19' if rId_candidate...
def function[_next_rId, parameter[self]]: constant[ Next available rId in collection, starting from 'rId1' and making use of any gaps in numbering, e.g. 'rId2' for rIds ['rId1', 'rId3']. ] for taget[name[n]] in starred[call[name[range], parameter[constant[1], binary_operation[cal...
keyword[def] identifier[_next_rId] ( identifier[self] ): literal[string] keyword[for] identifier[n] keyword[in] identifier[range] ( literal[int] , identifier[len] ( identifier[self] )+ literal[int] ): identifier[rId_candidate] = literal[string] % identifier[n] keyword[...
def _next_rId(self): """ Next available rId in collection, starting from 'rId1' and making use of any gaps in numbering, e.g. 'rId2' for rIds ['rId1', 'rId3']. """ for n in range(1, len(self) + 2): rId_candidate = 'rId%d' % n # like 'rId19' if rId_candidate not in self: ...
def format_listeners(elb_settings=None, env='dev', region='us-east-1'): """Format ELB Listeners into standard list. Args: elb_settings (dict): ELB settings including ELB Listeners to add, e.g.:: # old { "certificate": null, ...
def function[format_listeners, parameter[elb_settings, env, region]]: constant[Format ELB Listeners into standard list. Args: elb_settings (dict): ELB settings including ELB Listeners to add, e.g.:: # old { "certificate": null, ...
keyword[def] identifier[format_listeners] ( identifier[elb_settings] = keyword[None] , identifier[env] = literal[string] , identifier[region] = literal[string] ): literal[string] identifier[LOG] . identifier[debug] ( literal[string] , identifier[elb_settings] ) identifier[credential] = identifier[get...
def format_listeners(elb_settings=None, env='dev', region='us-east-1'): """Format ELB Listeners into standard list. Args: elb_settings (dict): ELB settings including ELB Listeners to add, e.g.:: # old { "certificate": null, ...
def forward(self, speed=1, **kwargs): """ Drive the robot forward by running both motors forward. :param float speed: Speed at which to drive the motors, as a value between 0 (stopped) and 1 (full speed). The default is 1. :param float curve_left: Th...
def function[forward, parameter[self, speed]]: constant[ Drive the robot forward by running both motors forward. :param float speed: Speed at which to drive the motors, as a value between 0 (stopped) and 1 (full speed). The default is 1. :param float curve_left:...
keyword[def] identifier[forward] ( identifier[self] , identifier[speed] = literal[int] ,** identifier[kwargs] ): literal[string] identifier[curve_left] = identifier[kwargs] . identifier[pop] ( literal[string] , literal[int] ) identifier[curve_right] = identifier[kwargs] . identifier[pop] (...
def forward(self, speed=1, **kwargs): """ Drive the robot forward by running both motors forward. :param float speed: Speed at which to drive the motors, as a value between 0 (stopped) and 1 (full speed). The default is 1. :param float curve_left: The am...
def create_symbol(self, *args, **kwargs): """ Extensions that discover and create instances of `symbols.Symbol` should do this through this method, as it will keep an index of these which can be used when generating a "naive index". See `database.Database.create_symbol` for more...
def function[create_symbol, parameter[self]]: constant[ Extensions that discover and create instances of `symbols.Symbol` should do this through this method, as it will keep an index of these which can be used when generating a "naive index". See `database.Database.create_symbol...
keyword[def] identifier[create_symbol] ( identifier[self] ,* identifier[args] ,** identifier[kwargs] ): literal[string] keyword[if] keyword[not] identifier[kwargs] . identifier[get] ( literal[string] ): identifier[kwargs] [ literal[string] ]= identifier[self] . identifier[project] . ...
def create_symbol(self, *args, **kwargs): """ Extensions that discover and create instances of `symbols.Symbol` should do this through this method, as it will keep an index of these which can be used when generating a "naive index". See `database.Database.create_symbol` for more ...
def remove_listener(self, event_name, listener): """Removes a listener.""" self.listeners[event_name].remove(listener) return self
def function[remove_listener, parameter[self, event_name, listener]]: constant[Removes a listener.] call[call[name[self].listeners][name[event_name]].remove, parameter[name[listener]]] return[name[self]]
keyword[def] identifier[remove_listener] ( identifier[self] , identifier[event_name] , identifier[listener] ): literal[string] identifier[self] . identifier[listeners] [ identifier[event_name] ]. identifier[remove] ( identifier[listener] ) keyword[return] identifier[self]
def remove_listener(self, event_name, listener): """Removes a listener.""" self.listeners[event_name].remove(listener) return self
async def handle_agent_message(self, agent_addr, message): """Dispatch messages received from agents to the right handlers""" message_handlers = { AgentHello: self.handle_agent_hello, AgentJobStarted: self.handle_agent_job_started, AgentJobDone: self.handle_agent_job_...
<ast.AsyncFunctionDef object at 0x7da20c7cbf10>
keyword[async] keyword[def] identifier[handle_agent_message] ( identifier[self] , identifier[agent_addr] , identifier[message] ): literal[string] identifier[message_handlers] ={ identifier[AgentHello] : identifier[self] . identifier[handle_agent_hello] , identifier[AgentJobStarte...
async def handle_agent_message(self, agent_addr, message): """Dispatch messages received from agents to the right handlers""" message_handlers = {AgentHello: self.handle_agent_hello, AgentJobStarted: self.handle_agent_job_started, AgentJobDone: self.handle_agent_job_done, AgentJobSSHDebug: self.handle_agent_job...
def _same_day_ids(self): """ :return: ids of occurrences that finish on the same day that they start, or midnight the next day. """ # we can pre-filter to return only occurrences that are <=24h long, # but until at least the `__date` can be used in F() statements ...
def function[_same_day_ids, parameter[self]]: constant[ :return: ids of occurrences that finish on the same day that they start, or midnight the next day. ] variable[qs] assign[=] call[name[self].filter, parameter[]] variable[ids] assign[=] <ast.ListComp object at 0x7da20...
keyword[def] identifier[_same_day_ids] ( identifier[self] ): literal[string] identifier[qs] = identifier[self] . identifier[filter] ( identifier[end__lte] = identifier[F] ( literal[string] )+ identifier[timedelta] ( identifier[days] = literal[int] )) ...
def _same_day_ids(self): """ :return: ids of occurrences that finish on the same day that they start, or midnight the next day. """ # we can pre-filter to return only occurrences that are <=24h long, # but until at least the `__date` can be used in F() statements # we'll have to ...
def jensen_shannon(h1, h2): # 85 us @array, 110 us @list \w 100 bins r""" Jensen-Shannon divergence. A symmetric and numerically more stable empirical extension of the Kullback-Leibler divergence. The Jensen Shannon divergence between two histograms :math:`H` and :math:`H'` of size :ma...
def function[jensen_shannon, parameter[h1, h2]]: constant[ Jensen-Shannon divergence. A symmetric and numerically more stable empirical extension of the Kullback-Leibler divergence. The Jensen Shannon divergence between two histograms :math:`H` and :math:`H'` of size :math:`m` is d...
keyword[def] identifier[jensen_shannon] ( identifier[h1] , identifier[h2] ): literal[string] identifier[h1] , identifier[h2] = identifier[__prepare_histogram] ( identifier[h1] , identifier[h2] ) identifier[s] =( identifier[h1] + identifier[h2] )/ literal[int] keyword[return] identifier[__kullba...
def jensen_shannon(h1, h2): # 85 us @array, 110 us @list \w 100 bins "\n Jensen-Shannon divergence.\n \n A symmetric and numerically more stable empirical extension of the Kullback-Leibler\n divergence.\n \n The Jensen Shannon divergence between two histograms :math:`H` and :math:`H'` of size\n ...
def output_format_lock(self, packages, **kwargs): """ Text to lock file """ self._output_config['type'] = PLAIN text = '' tmp_packages = OrderedDict() columns = self._config.get_columns() widths = {} for _pkg in packages.values(): _pkg_name = _pkg.pack...
def function[output_format_lock, parameter[self, packages]]: constant[ Text to lock file ] call[name[self]._output_config][constant[type]] assign[=] name[PLAIN] variable[text] assign[=] constant[] variable[tmp_packages] assign[=] call[name[OrderedDict], parameter[]] variable[colu...
keyword[def] identifier[output_format_lock] ( identifier[self] , identifier[packages] ,** identifier[kwargs] ): literal[string] identifier[self] . identifier[_output_config] [ literal[string] ]= identifier[PLAIN] identifier[text] = literal[string] identifier[tmp_packages] = iden...
def output_format_lock(self, packages, **kwargs): """ Text to lock file """ self._output_config['type'] = PLAIN text = '' tmp_packages = OrderedDict() columns = self._config.get_columns() widths = {} for _pkg in packages.values(): _pkg_name = _pkg.package_name _params = _pkg....
def parse_cwl_type(cwl_type_string): """ Parses cwl type information from a cwl type string. Examples: - "File[]" -> {'type': 'File', 'isArray': True, 'isOptional': False} - "int?" -> {'type': 'int', 'isArray': False, 'isOptional': True} :param cwl_type_string: The cwl type string to extract ...
def function[parse_cwl_type, parameter[cwl_type_string]]: constant[ Parses cwl type information from a cwl type string. Examples: - "File[]" -> {'type': 'File', 'isArray': True, 'isOptional': False} - "int?" -> {'type': 'int', 'isArray': False, 'isOptional': True} :param cwl_type_string: ...
keyword[def] identifier[parse_cwl_type] ( identifier[cwl_type_string] ): literal[string] identifier[is_optional] = identifier[cwl_type_string] . identifier[endswith] ( literal[string] ) keyword[if] identifier[is_optional] : identifier[cwl_type_string] = identifier[cwl_type_string] [:- liter...
def parse_cwl_type(cwl_type_string): """ Parses cwl type information from a cwl type string. Examples: - "File[]" -> {'type': 'File', 'isArray': True, 'isOptional': False} - "int?" -> {'type': 'int', 'isArray': False, 'isOptional': True} :param cwl_type_string: The cwl type string to extract ...
def get_date_less_query(days, date_field): """ Query for if date_field is within number of "days" from now. """ query = None days = get_integer(days) if days: future = get_days_from_now(days) query = Q(**{"%s__lte" % date_field: future.isoformat()}) return query
def function[get_date_less_query, parameter[days, date_field]]: constant[ Query for if date_field is within number of "days" from now. ] variable[query] assign[=] constant[None] variable[days] assign[=] call[name[get_integer], parameter[name[days]]] if name[days] begin[:] ...
keyword[def] identifier[get_date_less_query] ( identifier[days] , identifier[date_field] ): literal[string] identifier[query] = keyword[None] identifier[days] = identifier[get_integer] ( identifier[days] ) keyword[if] identifier[days] : identifier[future] = identifier[get_days_from_now...
def get_date_less_query(days, date_field): """ Query for if date_field is within number of "days" from now. """ query = None days = get_integer(days) if days: future = get_days_from_now(days) query = Q(**{'%s__lte' % date_field: future.isoformat()}) # depends on [control=['if'],...
def yesterday(self, date_from=None, date_format=None): """ Retourne la date d'hier depuis maintenant ou depuis une date fournie :param: :date_from date de référence :return datetime """ # date d'hier return self.delta(date_from=date_from, date_format=date_format, days=-1)
def function[yesterday, parameter[self, date_from, date_format]]: constant[ Retourne la date d'hier depuis maintenant ou depuis une date fournie :param: :date_from date de référence :return datetime ] return[call[name[self].delta, parameter[]]]
keyword[def] identifier[yesterday] ( identifier[self] , identifier[date_from] = keyword[None] , identifier[date_format] = keyword[None] ): literal[string] keyword[return] identifier[self] . identifier[delta] ( identifier[date_from] = identifier[date_from] , identifier[date_format] = identifier[date_format]...
def yesterday(self, date_from=None, date_format=None): """ Retourne la date d'hier depuis maintenant ou depuis une date fournie :param: :date_from date de référence :return datetime """ # date d'hier return self.delta(date_from=date_from, date_format=date_format, days=-1)
def instances(cls, parent=None): """ Returns all the instances that exist for a given parent. If no parent exists, then a blank list will be returned. :param parent | <QtGui.QWidget> :return [<XView>, ..] """ if parent is None: ...
def function[instances, parameter[cls, parent]]: constant[ Returns all the instances that exist for a given parent. If no parent exists, then a blank list will be returned. :param parent | <QtGui.QWidget> :return [<XView>, ..] ] if comp...
keyword[def] identifier[instances] ( identifier[cls] , identifier[parent] = keyword[None] ): literal[string] keyword[if] identifier[parent] keyword[is] keyword[None] : identifier[parent] = identifier[projexui] . identifier[topWindow] () keyword[return] identifier[parent] ....
def instances(cls, parent=None): """ Returns all the instances that exist for a given parent. If no parent exists, then a blank list will be returned. :param parent | <QtGui.QWidget> :return [<XView>, ..] """ if parent is None: parent =...
def get_args(): """ request the arguments for running """ ap = argparse.ArgumentParser(description="Create frames for a movie that can be compiled using ffmpeg") ap.add_argument("start", help="date string as start time") ap.add_argument("end", help="date string as end time") ap.add_argument(...
def function[get_args, parameter[]]: constant[ request the arguments for running ] variable[ap] assign[=] call[name[argparse].ArgumentParser, parameter[]] call[name[ap].add_argument, parameter[constant[start]]] call[name[ap].add_argument, parameter[constant[end]]] call[na...
keyword[def] identifier[get_args] (): literal[string] identifier[ap] = identifier[argparse] . identifier[ArgumentParser] ( identifier[description] = literal[string] ) identifier[ap] . identifier[add_argument] ( literal[string] , identifier[help] = literal[string] ) identifier[ap] . identifier[add...
def get_args(): """ request the arguments for running """ ap = argparse.ArgumentParser(description='Create frames for a movie that can be compiled using ffmpeg') ap.add_argument('start', help='date string as start time') ap.add_argument('end', help='date string as end time') ap.add_argument(...
def add_config(self, config): """ :param config: :type config: dict """ self.pre_configure() self.config = config if not self.has_revision_file(): #: Create new revision file. touch_file(self.revfile_path) self.history.load(self....
def function[add_config, parameter[self, config]]: constant[ :param config: :type config: dict ] call[name[self].pre_configure, parameter[]] name[self].config assign[=] name[config] if <ast.UnaryOp object at 0x7da18f58d780> begin[:] call[name[touch...
keyword[def] identifier[add_config] ( identifier[self] , identifier[config] ): literal[string] identifier[self] . identifier[pre_configure] () identifier[self] . identifier[config] = identifier[config] keyword[if] keyword[not] identifier[self] . identifier[has_revision_file] ...
def add_config(self, config): """ :param config: :type config: dict """ self.pre_configure() self.config = config if not self.has_revision_file(): #: Create new revision file. touch_file(self.revfile_path) # depends on [control=['if'], data=[]] self.history.l...
def listify(value): """ Wrap the given value into a list, with the below provisions: * If the value is a list or a tuple, it's coerced into a new list. * If the value is None, an empty list is returned. * Otherwise, a single-element list is returned, containing the value. :param value: A value...
def function[listify, parameter[value]]: constant[ Wrap the given value into a list, with the below provisions: * If the value is a list or a tuple, it's coerced into a new list. * If the value is None, an empty list is returned. * Otherwise, a single-element list is returned, containing the va...
keyword[def] identifier[listify] ( identifier[value] ): literal[string] keyword[if] identifier[value] keyword[is] keyword[None] : keyword[return] [] keyword[if] identifier[isinstance] ( identifier[value] ,( identifier[list] , identifier[tuple] )): keyword[return] identifier[list...
def listify(value): """ Wrap the given value into a list, with the below provisions: * If the value is a list or a tuple, it's coerced into a new list. * If the value is None, an empty list is returned. * Otherwise, a single-element list is returned, containing the value. :param value: A value...
def create_model(text_in, labels, timesteps, per_example_weights, phase=pt.Phase.train): """Creates a model for running baby names.""" with pt.defaults_scope(phase=phase, l2loss=0.00001): # The embedding lookup must be placed on a cpu. with...
def function[create_model, parameter[text_in, labels, timesteps, per_example_weights, phase]]: constant[Creates a model for running baby names.] with call[name[pt].defaults_scope, parameter[]] begin[:] with call[name[tf].device, parameter[constant[/cpu:0]]] begin[:] ...
keyword[def] identifier[create_model] ( identifier[text_in] , identifier[labels] , identifier[timesteps] , identifier[per_example_weights] , identifier[phase] = identifier[pt] . identifier[Phase] . identifier[train] ): literal[string] keyword[with] identifier[pt] . identifier[defaults_scope] ( identifier[...
def create_model(text_in, labels, timesteps, per_example_weights, phase=pt.Phase.train): """Creates a model for running baby names.""" with pt.defaults_scope(phase=phase, l2loss=1e-05): # The embedding lookup must be placed on a cpu. with tf.device('/cpu:0'): embedded = text_in.embed...
def confirm_delete_view(self, request, object_id): """ Instantiates a class-based view to provide 'delete confirmation' functionality for the assigned model, or redirect to Wagtail's delete confirmation view if the assigned model extends 'Page'. The view class used can be overrid...
def function[confirm_delete_view, parameter[self, request, object_id]]: constant[ Instantiates a class-based view to provide 'delete confirmation' functionality for the assigned model, or redirect to Wagtail's delete confirmation view if the assigned model extends 'Page'. The view class ...
keyword[def] identifier[confirm_delete_view] ( identifier[self] , identifier[request] , identifier[object_id] ): literal[string] identifier[kwargs] ={ literal[string] : identifier[self] , literal[string] : identifier[object_id] } identifier[view_class] = identifier[self] . identifier[confi...
def confirm_delete_view(self, request, object_id): """ Instantiates a class-based view to provide 'delete confirmation' functionality for the assigned model, or redirect to Wagtail's delete confirmation view if the assigned model extends 'Page'. The view class used can be overridden ...
def GetHeaders(cosmos_client, default_headers, verb, path, resource_id, resource_type, options, partition_key_range_id = None): """Gets HTTP request headers. :param cosmos_client.CosmosClient cosmos_client:...
def function[GetHeaders, parameter[cosmos_client, default_headers, verb, path, resource_id, resource_type, options, partition_key_range_id]]: constant[Gets HTTP request headers. :param cosmos_client.CosmosClient cosmos_client: :param dict default_headers: :param str verb: :param str path: :...
keyword[def] identifier[GetHeaders] ( identifier[cosmos_client] , identifier[default_headers] , identifier[verb] , identifier[path] , identifier[resource_id] , identifier[resource_type] , identifier[options] , identifier[partition_key_range_id] = keyword[None] ): literal[string] identifier[headers] ...
def GetHeaders(cosmos_client, default_headers, verb, path, resource_id, resource_type, options, partition_key_range_id=None): """Gets HTTP request headers. :param cosmos_client.CosmosClient cosmos_client: :param dict default_headers: :param str verb: :param str path: :param str resource_id: ...
def add_members(self, rtcs): '''Add other RT Components to this composite component as members. This component must be a composite component. ''' if not self.is_composite: raise exceptions.NotCompositeError(self.name) for rtc in rtcs: if self.is_member(r...
def function[add_members, parameter[self, rtcs]]: constant[Add other RT Components to this composite component as members. This component must be a composite component. ] if <ast.UnaryOp object at 0x7da18f09e1d0> begin[:] <ast.Raise object at 0x7da18f09d600> for taget[n...
keyword[def] identifier[add_members] ( identifier[self] , identifier[rtcs] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[is_composite] : keyword[raise] identifier[exceptions] . identifier[NotCompositeError] ( identifier[self] . identifier[name] ) ...
def add_members(self, rtcs): """Add other RT Components to this composite component as members. This component must be a composite component. """ if not self.is_composite: raise exceptions.NotCompositeError(self.name) # depends on [control=['if'], data=[]] for rtc in rtcs: ...
def every(minutes=NOTSET, seconds=NOTSET): """ method will been called every minutes or seconds """ def wrapper(func): # mark the function with variable 'is_cronjob=True', the function would be # collected into the list Handler._cron_jobs by meta class func.is_cronjob = True ...
def function[every, parameter[minutes, seconds]]: constant[ method will been called every minutes or seconds ] def function[wrapper, parameter[func]]: name[func].is_cronjob assign[=] constant[True] name[func].tick assign[=] binary_operation[binary_operation[name[m...
keyword[def] identifier[every] ( identifier[minutes] = identifier[NOTSET] , identifier[seconds] = identifier[NOTSET] ): literal[string] keyword[def] identifier[wrapper] ( identifier[func] ): identifier[func] . identifier[is_cronjob] = keyword[True] identifie...
def every(minutes=NOTSET, seconds=NOTSET): """ method will been called every minutes or seconds """ def wrapper(func): # mark the function with variable 'is_cronjob=True', the function would be # collected into the list Handler._cron_jobs by meta class func.is_cronjob = True ...
def rate_unstable(self): """Returns an unstable rate based on the last two entries in the timing data. Less intensive to compute.""" if not self.started or self.stalled: return 0.0 x1, y1 = self._timing_data[-2] x2, y2 = self._timing_data[-1] return (y2 - y1) / (x2 - ...
def function[rate_unstable, parameter[self]]: constant[Returns an unstable rate based on the last two entries in the timing data. Less intensive to compute.] if <ast.BoolOp object at 0x7da18f810250> begin[:] return[constant[0.0]] <ast.Tuple object at 0x7da18f09dff0> assign[=] call[name[s...
keyword[def] identifier[rate_unstable] ( identifier[self] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[started] keyword[or] identifier[self] . identifier[stalled] : keyword[return] literal[int] identifier[x1] , identifier[y1] = identifier[sel...
def rate_unstable(self): """Returns an unstable rate based on the last two entries in the timing data. Less intensive to compute.""" if not self.started or self.stalled: return 0.0 # depends on [control=['if'], data=[]] (x1, y1) = self._timing_data[-2] (x2, y2) = self._timing_data[-1] retur...
def run_oldstyle(self): ''' Make the salt client call in old-style all-in-one call method ''' arg = [self._load_files(), self.opts['dest']] local = salt.client.get_local_client(self.opts['conf_file']) args = [self.opts['tgt'], 'cp.recv', ar...
def function[run_oldstyle, parameter[self]]: constant[ Make the salt client call in old-style all-in-one call method ] variable[arg] assign[=] list[[<ast.Call object at 0x7da1b215e530>, <ast.Subscript object at 0x7da1b215c340>]] variable[local] assign[=] call[name[salt].client.ge...
keyword[def] identifier[run_oldstyle] ( identifier[self] ): literal[string] identifier[arg] =[ identifier[self] . identifier[_load_files] (), identifier[self] . identifier[opts] [ literal[string] ]] identifier[local] = identifier[salt] . identifier[client] . identifier[get_local_client] ( ...
def run_oldstyle(self): """ Make the salt client call in old-style all-in-one call method """ arg = [self._load_files(), self.opts['dest']] local = salt.client.get_local_client(self.opts['conf_file']) args = [self.opts['tgt'], 'cp.recv', arg, self.opts['timeout']] selected_target_opt...
def open_files(subseqs): """Open file statements.""" print(' . open_files') lines = Lines() lines.add(1, 'cpdef open_files(self, int idx):') for seq in subseqs: lines.add(2, 'if self._%s_diskflag:' % seq.name) lines.add(3, 'self._%s_file = fopen...
def function[open_files, parameter[subseqs]]: constant[Open file statements.] call[name[print], parameter[constant[ . open_files]]] variable[lines] assign[=] call[name[Lines], parameter[]] call[name[lines].add, parameter[constant[1], constant[cpdef open_files(self, int idx):]]...
keyword[def] identifier[open_files] ( identifier[subseqs] ): literal[string] identifier[print] ( literal[string] ) identifier[lines] = identifier[Lines] () identifier[lines] . identifier[add] ( literal[int] , literal[string] ) keyword[for] identifier[seq] keyword[in] i...
def open_files(subseqs): """Open file statements.""" print(' . open_files') lines = Lines() lines.add(1, 'cpdef open_files(self, int idx):') for seq in subseqs: lines.add(2, 'if self._%s_diskflag:' % seq.name) lines.add(3, 'self._%s_file = fopen(str(self._%s_path).encode()...
def _peek(self, n): # type: (int) -> str """ Peeks ahead n characters. n is the max number of characters that will be peeked. """ # we always want to restore after exiting this scope with self._state(restore=True): buf = "" for _ in range(n): ...
def function[_peek, parameter[self, n]]: constant[ Peeks ahead n characters. n is the max number of characters that will be peeked. ] with call[name[self]._state, parameter[]] begin[:] variable[buf] assign[=] constant[] for taget[name[_]] in starr...
keyword[def] identifier[_peek] ( identifier[self] , identifier[n] ): literal[string] keyword[with] identifier[self] . identifier[_state] ( identifier[restore] = keyword[True] ): identifier[buf] = literal[string] keyword[for] identifier[_] keyword[in] identifi...
def _peek(self, n): # type: (int) -> str '\n Peeks ahead n characters.\n\n n is the max number of characters that will be peeked.\n ' # we always want to restore after exiting this scope with self._state(restore=True): buf = '' for _ in range(n): if self._cu...
def reset_to_last_commit(): """reset a modified file to his last commit status This method does the same than a :: $ git reset --hard Keyword Arguments: <none> Returns: <nothing> """ try: repo = Repo() gitcmd = repo.git gitcmd.reset(hard=True) ...
def function[reset_to_last_commit, parameter[]]: constant[reset a modified file to his last commit status This method does the same than a :: $ git reset --hard Keyword Arguments: <none> Returns: <nothing> ] <ast.Try object at 0x7da1b28fdcf0>
keyword[def] identifier[reset_to_last_commit] (): literal[string] keyword[try] : identifier[repo] = identifier[Repo] () identifier[gitcmd] = identifier[repo] . identifier[git] identifier[gitcmd] . identifier[reset] ( identifier[hard] = keyword[True] ) keyword[except] ident...
def reset_to_last_commit(): """reset a modified file to his last commit status This method does the same than a :: $ git reset --hard Keyword Arguments: <none> Returns: <nothing> """ try: repo = Repo() gitcmd = repo.git gitcmd.reset(hard=True) ...
def Prep(self, size, additionalBytes): """ Prep prepares to write an element of `size` after `additional_bytes` have been written, e.g. if you write a string, you need to align such the int length field is aligned to SizeInt32, and the string data follows it directly. If ...
def function[Prep, parameter[self, size, additionalBytes]]: constant[ Prep prepares to write an element of `size` after `additional_bytes` have been written, e.g. if you write a string, you need to align such the int length field is aligned to SizeInt32, and the string data follo...
keyword[def] identifier[Prep] ( identifier[self] , identifier[size] , identifier[additionalBytes] ): literal[string] keyword[if] identifier[size] > identifier[self] . identifier[minalign] : identifier[self] . identifier[minalign] = identifier[size] ...
def Prep(self, size, additionalBytes): """ Prep prepares to write an element of `size` after `additional_bytes` have been written, e.g. if you write a string, you need to align such the int length field is aligned to SizeInt32, and the string data follows it directly. If all ...
def get_sections_2d(self): """Get 2-D list of sections and hdrgos sets actually used in grouping.""" sections_hdrgos_act = [] hdrgos_act_all = self.get_hdrgos() # Header GOs actually used to group hdrgos_act_secs = set() if self.hdrobj.sections: for section_name, hdr...
def function[get_sections_2d, parameter[self]]: constant[Get 2-D list of sections and hdrgos sets actually used in grouping.] variable[sections_hdrgos_act] assign[=] list[[]] variable[hdrgos_act_all] assign[=] call[name[self].get_hdrgos, parameter[]] variable[hdrgos_act_secs] assign[=] c...
keyword[def] identifier[get_sections_2d] ( identifier[self] ): literal[string] identifier[sections_hdrgos_act] =[] identifier[hdrgos_act_all] = identifier[self] . identifier[get_hdrgos] () identifier[hdrgos_act_secs] = identifier[set] () keyword[if] identifier[self] . id...
def get_sections_2d(self): """Get 2-D list of sections and hdrgos sets actually used in grouping.""" sections_hdrgos_act = [] hdrgos_act_all = self.get_hdrgos() # Header GOs actually used to group hdrgos_act_secs = set() if self.hdrobj.sections: for (section_name, hdrgos_all_lst) in self.hd...
def distinct(self): """ Only return distinct row. Return a new query set with distinct mark """ new_query_set = self.clone() new_query_set.query.distinct = True return new_query_set
def function[distinct, parameter[self]]: constant[ Only return distinct row. Return a new query set with distinct mark ] variable[new_query_set] assign[=] call[name[self].clone, parameter[]] name[new_query_set].query.distinct assign[=] constant[True] return[name[new_...
keyword[def] identifier[distinct] ( identifier[self] ): literal[string] identifier[new_query_set] = identifier[self] . identifier[clone] () identifier[new_query_set] . identifier[query] . identifier[distinct] = keyword[True] keyword[return] identifier[new_query_set]
def distinct(self): """ Only return distinct row. Return a new query set with distinct mark """ new_query_set = self.clone() new_query_set.query.distinct = True return new_query_set
def setup(cls): """ Main method to auto setup Apphook It must be called after the Apphook registration:: apphook_pool.register(MyApp) MyApp.setup() """ try: if cls.auto_setup and cls.auto_setup.get('enabled', False): if not cl...
def function[setup, parameter[cls]]: constant[ Main method to auto setup Apphook It must be called after the Apphook registration:: apphook_pool.register(MyApp) MyApp.setup() ] <ast.Try object at 0x7da1b1fa9ea0>
keyword[def] identifier[setup] ( identifier[cls] ): literal[string] keyword[try] : keyword[if] identifier[cls] . identifier[auto_setup] keyword[and] identifier[cls] . identifier[auto_setup] . identifier[get] ( literal[string] , keyword[False] ): keyword[if] keyword...
def setup(cls): """ Main method to auto setup Apphook It must be called after the Apphook registration:: apphook_pool.register(MyApp) MyApp.setup() """ try: if cls.auto_setup and cls.auto_setup.get('enabled', False): if not cls.auto_setup.get...
def qvalues1(PV,m=None,pi=1.0): """estimate q vlaues from a list of Pvalues this algorihm is taken from Storey, significance testing for genomic ... m: number of tests, (if not len(PV)), pi: fraction of expected true null (1.0 is a conservative estimate) @param PV: pvalues @param m: total number of...
def function[qvalues1, parameter[PV, m, pi]]: constant[estimate q vlaues from a list of Pvalues this algorihm is taken from Storey, significance testing for genomic ... m: number of tests, (if not len(PV)), pi: fraction of expected true null (1.0 is a conservative estimate) @param PV: pvalues @p...
keyword[def] identifier[qvalues1] ( identifier[PV] , identifier[m] = keyword[None] , identifier[pi] = literal[int] ): literal[string] identifier[S] = identifier[PV] . identifier[shape] identifier[PV] = identifier[PV] . identifier[flatten] () keyword[if] identifier[m] keyword[is] keyword[None...
def qvalues1(PV, m=None, pi=1.0): """estimate q vlaues from a list of Pvalues this algorihm is taken from Storey, significance testing for genomic ... m: number of tests, (if not len(PV)), pi: fraction of expected true null (1.0 is a conservative estimate) @param PV: pvalues @param m: total number ...
def loadExperimentDescriptionScriptFromDir(experimentDir): """ Loads the experiment description python script from the given experiment directory. :param experimentDir: (string) experiment directory path :returns: module of the loaded experiment description scripts """ descriptionScriptPath = os.pa...
def function[loadExperimentDescriptionScriptFromDir, parameter[experimentDir]]: constant[ Loads the experiment description python script from the given experiment directory. :param experimentDir: (string) experiment directory path :returns: module of the loaded experiment description scripts ] ...
keyword[def] identifier[loadExperimentDescriptionScriptFromDir] ( identifier[experimentDir] ): literal[string] identifier[descriptionScriptPath] = identifier[os] . identifier[path] . identifier[join] ( identifier[experimentDir] , literal[string] ) identifier[module] = identifier[_loadDescriptionFile] ( iden...
def loadExperimentDescriptionScriptFromDir(experimentDir): """ Loads the experiment description python script from the given experiment directory. :param experimentDir: (string) experiment directory path :returns: module of the loaded experiment description scripts """ descriptionScriptPath = o...
def _do_cb(self, cb, error_cb, *args, **kw): """ Called internally by callback(). Does cb and error_cb selection. """ try: res = self.work(*args, **kw) except Exception as e: if error_cb is None: show_err() elif error_cb: ...
def function[_do_cb, parameter[self, cb, error_cb]]: constant[ Called internally by callback(). Does cb and error_cb selection. ] <ast.Try object at 0x7da2041da350>
keyword[def] identifier[_do_cb] ( identifier[self] , identifier[cb] , identifier[error_cb] ,* identifier[args] ,** identifier[kw] ): literal[string] keyword[try] : identifier[res] = identifier[self] . identifier[work] (* identifier[args] ,** identifier[kw] ) keyword[except] i...
def _do_cb(self, cb, error_cb, *args, **kw): """ Called internally by callback(). Does cb and error_cb selection. """ try: res = self.work(*args, **kw) # depends on [control=['try'], data=[]] except Exception as e: if error_cb is None: show_err() # depends on [c...
def _set_cfunctions(self): # type: () -> None """ Set all ctypes functions and attach them to attributes. """ def cfactory(func, argtypes, restype): # type: (str, List[Any], Any) -> None """ Factorize ctypes creations. """ self._cfactory( attr...
def function[_set_cfunctions, parameter[self]]: constant[ Set all ctypes functions and attach them to attributes. ] def function[cfactory, parameter[func, argtypes, restype]]: constant[ Factorize ctypes creations. ] call[name[self]._cfactory, parameter[]] variable...
keyword[def] identifier[_set_cfunctions] ( identifier[self] ): literal[string] keyword[def] identifier[cfactory] ( identifier[func] , identifier[argtypes] , identifier[restype] ): literal[string] identifier[self] . identifier[_cfactory] ( identifi...
def _set_cfunctions(self): # type: () -> None ' Set all ctypes functions and attach them to attributes. ' def cfactory(func, argtypes, restype): # type: (str, List[Any], Any) -> None ' Factorize ctypes creations. ' self._cfactory(attr=self.core, func=func, argtypes=argtypes, restype...
def get_primes(n): """Return list of all primes less than n, Using sieve of Eratosthenes. """ if n <= 0: raise ValueError("'n' must be a positive integer.") # If x is even, exclude x from list (-1): sieve_size = (n // 2 - 1) if n % 2 == 0 else (n // 2) sieve = [True for _ in range(si...
def function[get_primes, parameter[n]]: constant[Return list of all primes less than n, Using sieve of Eratosthenes. ] if compare[name[n] less_or_equal[<=] constant[0]] begin[:] <ast.Raise object at 0x7da1b209b790> variable[sieve_size] assign[=] <ast.IfExp object at 0x7da1b2099a8...
keyword[def] identifier[get_primes] ( identifier[n] ): literal[string] keyword[if] identifier[n] <= literal[int] : keyword[raise] identifier[ValueError] ( literal[string] ) identifier[sieve_size] =( identifier[n] // literal[int] - literal[int] ) keyword[if] identifier[n] % literal...
def get_primes(n): """Return list of all primes less than n, Using sieve of Eratosthenes. """ if n <= 0: raise ValueError("'n' must be a positive integer.") # depends on [control=['if'], data=[]] # If x is even, exclude x from list (-1): sieve_size = n // 2 - 1 if n % 2 == 0 else n // 2...
def get_parallel_bucket(buckets: List[Tuple[int, int]], length_source: int, length_target: int) -> Tuple[Optional[int], Optional[Tuple[int, int]]]: """ Returns bucket index and bucket from a list of buckets, given source and target length. Algorithm assumes bu...
def function[get_parallel_bucket, parameter[buckets, length_source, length_target]]: constant[ Returns bucket index and bucket from a list of buckets, given source and target length. Algorithm assumes buckets are sorted from shortest to longest. Returns (None, None) if no bucket fits. :param bu...
keyword[def] identifier[get_parallel_bucket] ( identifier[buckets] : identifier[List] [ identifier[Tuple] [ identifier[int] , identifier[int] ]], identifier[length_source] : identifier[int] , identifier[length_target] : identifier[int] )-> identifier[Tuple] [ identifier[Optional] [ identifier[int] ], identifier[Opt...
def get_parallel_bucket(buckets: List[Tuple[int, int]], length_source: int, length_target: int) -> Tuple[Optional[int], Optional[Tuple[int, int]]]: """ Returns bucket index and bucket from a list of buckets, given source and target length. Algorithm assumes buckets are sorted from shortest to longest. R...
def _keys(expr): """ Retrieve keys of a dict :param expr: dict sequence / scalar :return: """ if isinstance(expr, SequenceExpr): dtype = expr.data_type else: dtype = expr.value_type return composite_op(expr, DictKeys, df_types.List(dtype.key_type))
def function[_keys, parameter[expr]]: constant[ Retrieve keys of a dict :param expr: dict sequence / scalar :return: ] if call[name[isinstance], parameter[name[expr], name[SequenceExpr]]] begin[:] variable[dtype] assign[=] name[expr].data_type return[call[name[compos...
keyword[def] identifier[_keys] ( identifier[expr] ): literal[string] keyword[if] identifier[isinstance] ( identifier[expr] , identifier[SequenceExpr] ): identifier[dtype] = identifier[expr] . identifier[data_type] keyword[else] : identifier[dtype] = identifier[expr] . identifier[va...
def _keys(expr): """ Retrieve keys of a dict :param expr: dict sequence / scalar :return: """ if isinstance(expr, SequenceExpr): dtype = expr.data_type # depends on [control=['if'], data=[]] else: dtype = expr.value_type return composite_op(expr, DictKeys, df_types.List...
def on_props_activated(self, menu_item): '''显示选中的文件或者当前目录的属性''' tree_paths = self.iconview.get_selected_items() if not tree_paths: dialog = FolderPropertyDialog(self, self.app, self.parent.path) dialog.run() dialog.destroy() else: for tree_...
def function[on_props_activated, parameter[self, menu_item]]: constant[显示选中的文件或者当前目录的属性] variable[tree_paths] assign[=] call[name[self].iconview.get_selected_items, parameter[]] if <ast.UnaryOp object at 0x7da20c7c9e10> begin[:] variable[dialog] assign[=] call[name[FolderProperty...
keyword[def] identifier[on_props_activated] ( identifier[self] , identifier[menu_item] ): literal[string] identifier[tree_paths] = identifier[self] . identifier[iconview] . identifier[get_selected_items] () keyword[if] keyword[not] identifier[tree_paths] : identifier[dialog]...
def on_props_activated(self, menu_item): """显示选中的文件或者当前目录的属性""" tree_paths = self.iconview.get_selected_items() if not tree_paths: dialog = FolderPropertyDialog(self, self.app, self.parent.path) dialog.run() dialog.destroy() # depends on [control=['if'], data=[]] else: f...
def generate(env): """Add Builders and construction variables for jar to an Environment.""" SCons.Tool.CreateJarBuilder(env) SCons.Tool.CreateJavaFileBuilder(env) SCons.Tool.CreateJavaClassFileBuilder(env) SCons.Tool.CreateJavaClassDirBuilder(env) env.AddMethod(Jar) env['JAR'] = 'j...
def function[generate, parameter[env]]: constant[Add Builders and construction variables for jar to an Environment.] call[name[SCons].Tool.CreateJarBuilder, parameter[name[env]]] call[name[SCons].Tool.CreateJavaFileBuilder, parameter[name[env]]] call[name[SCons].Tool.CreateJavaClassFileB...
keyword[def] identifier[generate] ( identifier[env] ): literal[string] identifier[SCons] . identifier[Tool] . identifier[CreateJarBuilder] ( identifier[env] ) identifier[SCons] . identifier[Tool] . identifier[CreateJavaFileBuilder] ( identifier[env] ) identifier[SCons] . identifier[Tool] . ident...
def generate(env): """Add Builders and construction variables for jar to an Environment.""" SCons.Tool.CreateJarBuilder(env) SCons.Tool.CreateJavaFileBuilder(env) SCons.Tool.CreateJavaClassFileBuilder(env) SCons.Tool.CreateJavaClassDirBuilder(env) env.AddMethod(Jar) env['JAR'] = 'jar' en...
def material_find_resource(filename, cdn, use_minified=None, local=True): """Resource finding function, also available in templates. Tries to find a resource, will force SSL depending on ``MATERIAL_CDN_FORCE_SSL`` settings. :param filename: File to find a URL for. :param cdn: Name of the CDN to us...
def function[material_find_resource, parameter[filename, cdn, use_minified, local]]: constant[Resource finding function, also available in templates. Tries to find a resource, will force SSL depending on ``MATERIAL_CDN_FORCE_SSL`` settings. :param filename: File to find a URL for. :param cdn: ...
keyword[def] identifier[material_find_resource] ( identifier[filename] , identifier[cdn] , identifier[use_minified] = keyword[None] , identifier[local] = keyword[True] ): literal[string] identifier[config] = identifier[current_app] . identifier[config] keyword[if] identifier[config] [ literal[strin...
def material_find_resource(filename, cdn, use_minified=None, local=True): """Resource finding function, also available in templates. Tries to find a resource, will force SSL depending on ``MATERIAL_CDN_FORCE_SSL`` settings. :param filename: File to find a URL for. :param cdn: Name of the CDN to us...
def read_config_file(path): """Returns the configuration from the specified file.""" try: with open(path, 'r') as f: return json.load(f, object_pairs_hook=OrderedDict) except IOError as ex: if ex != errno.ENOENT: raise return {}
def function[read_config_file, parameter[path]]: constant[Returns the configuration from the specified file.] <ast.Try object at 0x7da20c9913c0> return[dictionary[[], []]]
keyword[def] identifier[read_config_file] ( identifier[path] ): literal[string] keyword[try] : keyword[with] identifier[open] ( identifier[path] , literal[string] ) keyword[as] identifier[f] : keyword[return] identifier[json] . identifier[load] ( identifier[f] , identifier[object_p...
def read_config_file(path): """Returns the configuration from the specified file.""" try: with open(path, 'r') as f: return json.load(f, object_pairs_hook=OrderedDict) # depends on [control=['with'], data=['f']] # depends on [control=['try'], data=[]] except IOError as ex: if e...
def search_assignable_users_for_issues(self, username, project=None, issueKey=None, expand=None, startAt=...
def function[search_assignable_users_for_issues, parameter[self, username, project, issueKey, expand, startAt, maxResults]]: constant[Get a list of user Resources that match the search string for assigning or creating issues. This method is intended to find users that are eligible to create issues in a...
keyword[def] identifier[search_assignable_users_for_issues] ( identifier[self] , identifier[username] , identifier[project] = keyword[None] , identifier[issueKey] = keyword[None] , identifier[expand] = keyword[None] , identifier[startAt] = literal[int] , identifier[maxResults] = literal[int] , ): liter...
def search_assignable_users_for_issues(self, username, project=None, issueKey=None, expand=None, startAt=0, maxResults=50): """Get a list of user Resources that match the search string for assigning or creating issues. This method is intended to find users that are eligible to create issues in a project or...
def _init_topics(self): """Set up initial subscription of mysensors topics.""" _LOGGER.info('Setting up initial MQTT topic subscription') init_topics = [ '{}/+/+/0/+/+'.format(self._in_prefix), '{}/+/+/3/+/+'.format(self._in_prefix), ] self._handle_subscri...
def function[_init_topics, parameter[self]]: constant[Set up initial subscription of mysensors topics.] call[name[_LOGGER].info, parameter[constant[Setting up initial MQTT topic subscription]]] variable[init_topics] assign[=] list[[<ast.Call object at 0x7da20cabcbe0>, <ast.Call object at 0x7da20...
keyword[def] identifier[_init_topics] ( identifier[self] ): literal[string] identifier[_LOGGER] . identifier[info] ( literal[string] ) identifier[init_topics] =[ literal[string] . identifier[format] ( identifier[self] . identifier[_in_prefix] ), literal[string] . identifi...
def _init_topics(self): """Set up initial subscription of mysensors topics.""" _LOGGER.info('Setting up initial MQTT topic subscription') init_topics = ['{}/+/+/0/+/+'.format(self._in_prefix), '{}/+/+/3/+/+'.format(self._in_prefix)] self._handle_subscription(init_topics) if not self.persistence: ...
def scrub(data, units=False): """ For input data [w,f,e] or [w,f] returns the list with NaN, negative, and zero flux (and corresponding wavelengths and errors) removed. """ units = [i.unit if hasattr(i, 'unit') else 1 for i in data] data = [np.asarray(i.value if hasattr(i, 'unit') else i, dtype=...
def function[scrub, parameter[data, units]]: constant[ For input data [w,f,e] or [w,f] returns the list with NaN, negative, and zero flux (and corresponding wavelengths and errors) removed. ] variable[units] assign[=] <ast.ListComp object at 0x7da1b0ac4c10> variable[data] assign[=] <...
keyword[def] identifier[scrub] ( identifier[data] , identifier[units] = keyword[False] ): literal[string] identifier[units] =[ identifier[i] . identifier[unit] keyword[if] identifier[hasattr] ( identifier[i] , literal[string] ) keyword[else] literal[int] keyword[for] identifier[i] keyword[in] identi...
def scrub(data, units=False): """ For input data [w,f,e] or [w,f] returns the list with NaN, negative, and zero flux (and corresponding wavelengths and errors) removed. """ units = [i.unit if hasattr(i, 'unit') else 1 for i in data] data = [np.asarray(i.value if hasattr(i, 'unit') else i, dtype=...
def inspectorDataRange(inspector, percentage): """ Calculates the range from the inspectors' sliced array. Discards percentage of the minimum and percentage of the maximum values of the inspector.slicedArray Meant to be used with functools.partial for filling the autorange methods combobox. ...
def function[inspectorDataRange, parameter[inspector, percentage]]: constant[ Calculates the range from the inspectors' sliced array. Discards percentage of the minimum and percentage of the maximum values of the inspector.slicedArray Meant to be used with functools.partial for filling the auto...
keyword[def] identifier[inspectorDataRange] ( identifier[inspector] , identifier[percentage] ): literal[string] identifier[logger] . identifier[debug] ( literal[string] . identifier[format] ( identifier[percentage] , identifier[id] ( identifier[inspector] . identifier[slicedArray] ))) keyword[return] ...
def inspectorDataRange(inspector, percentage): """ Calculates the range from the inspectors' sliced array. Discards percentage of the minimum and percentage of the maximum values of the inspector.slicedArray Meant to be used with functools.partial for filling the autorange methods combobox. ...
def get_tunnel_statistics_output_tunnel_stat_rx_bytes(self, **kwargs): """Auto Generated Code """ config = ET.Element("config") get_tunnel_statistics = ET.Element("get_tunnel_statistics") config = get_tunnel_statistics output = ET.SubElement(get_tunnel_statistics, "output...
def function[get_tunnel_statistics_output_tunnel_stat_rx_bytes, parameter[self]]: constant[Auto Generated Code ] variable[config] assign[=] call[name[ET].Element, parameter[constant[config]]] variable[get_tunnel_statistics] assign[=] call[name[ET].Element, parameter[constant[get_tunnel_s...
keyword[def] identifier[get_tunnel_statistics_output_tunnel_stat_rx_bytes] ( identifier[self] ,** identifier[kwargs] ): literal[string] identifier[config] = identifier[ET] . identifier[Element] ( literal[string] ) identifier[get_tunnel_statistics] = identifier[ET] . identifier[Element] ( l...
def get_tunnel_statistics_output_tunnel_stat_rx_bytes(self, **kwargs): """Auto Generated Code """ config = ET.Element('config') get_tunnel_statistics = ET.Element('get_tunnel_statistics') config = get_tunnel_statistics output = ET.SubElement(get_tunnel_statistics, 'output') tunnel_stat =...
def _multiplexed_buffer_helper(self, response): """A generator of multiplexed data blocks read from a buffered response.""" buf = self._result(response, binary=True) buf_length = len(buf) walker = 0 while True: if buf_length - walker < STREAM_HEADER_SIZE_BYTES...
def function[_multiplexed_buffer_helper, parameter[self, response]]: constant[A generator of multiplexed data blocks read from a buffered response.] variable[buf] assign[=] call[name[self]._result, parameter[name[response]]] variable[buf_length] assign[=] call[name[len], parameter[name[b...
keyword[def] identifier[_multiplexed_buffer_helper] ( identifier[self] , identifier[response] ): literal[string] identifier[buf] = identifier[self] . identifier[_result] ( identifier[response] , identifier[binary] = keyword[True] ) identifier[buf_length] = identifier[len] ( identifier[buf]...
def _multiplexed_buffer_helper(self, response): """A generator of multiplexed data blocks read from a buffered response.""" buf = self._result(response, binary=True) buf_length = len(buf) walker = 0 while True: if buf_length - walker < STREAM_HEADER_SIZE_BYTES: break # d...
def greater_than(self, greater_than): """Adds new `>` condition :param greater_than: str or datetime compatible object (naive UTC datetime or tz-aware datetime) :raise: - QueryTypeError: if `greater_than` is of an unexpected type """ if hasattr(greater_than, 'strfti...
def function[greater_than, parameter[self, greater_than]]: constant[Adds new `>` condition :param greater_than: str or datetime compatible object (naive UTC datetime or tz-aware datetime) :raise: - QueryTypeError: if `greater_than` is of an unexpected type ] if call[...
keyword[def] identifier[greater_than] ( identifier[self] , identifier[greater_than] ): literal[string] keyword[if] identifier[hasattr] ( identifier[greater_than] , literal[string] ): identifier[greater_than] = identifier[datetime_as_utc] ( identifier[greater_than] ). identifier[strft...
def greater_than(self, greater_than): """Adds new `>` condition :param greater_than: str or datetime compatible object (naive UTC datetime or tz-aware datetime) :raise: - QueryTypeError: if `greater_than` is of an unexpected type """ if hasattr(greater_than, 'strftime'): ...
def aboveAt(self, offset=0): """ Returns point in the center of the region's top side (offset to the top by negative ``offset``) """ return Location(self.getX() + (self.getW() / 2), self.getY() + offset)
def function[aboveAt, parameter[self, offset]]: constant[ Returns point in the center of the region's top side (offset to the top by negative ``offset``) ] return[call[name[Location], parameter[binary_operation[call[name[self].getX, parameter[]] + binary_operation[call[name[self].getW, parameter[]] ...
keyword[def] identifier[aboveAt] ( identifier[self] , identifier[offset] = literal[int] ): literal[string] keyword[return] identifier[Location] ( identifier[self] . identifier[getX] ()+( identifier[self] . identifier[getW] ()/ literal[int] ), identifier[self] . identifier[getY] ()+ identifier[offs...
def aboveAt(self, offset=0): """ Returns point in the center of the region's top side (offset to the top by negative ``offset``) """ return Location(self.getX() + self.getW() / 2, self.getY() + offset)
async def handle_command(bot: NoneBot, ctx: Context_T) -> bool: """ Handle a message as a command. This function is typically called by "handle_message". :param bot: NoneBot instance :param ctx: message context :return: the message is handled as a command """ cmd, current_arg = parse_c...
<ast.AsyncFunctionDef object at 0x7da18f811360>
keyword[async] keyword[def] identifier[handle_command] ( identifier[bot] : identifier[NoneBot] , identifier[ctx] : identifier[Context_T] )-> identifier[bool] : literal[string] identifier[cmd] , identifier[current_arg] = identifier[parse_command] ( identifier[bot] , identifier[str] ( identifier[ctx] [ lite...
async def handle_command(bot: NoneBot, ctx: Context_T) -> bool: """ Handle a message as a command. This function is typically called by "handle_message". :param bot: NoneBot instance :param ctx: message context :return: the message is handled as a command """ (cmd, current_arg) = parse...
def handle(self, data): """ puts the data in the target. :param data: the data to post. :return: """ self.dataResponseCode.append(self._doPut(self.sendURL + '/data', data=data))
def function[handle, parameter[self, data]]: constant[ puts the data in the target. :param data: the data to post. :return: ] call[name[self].dataResponseCode.append, parameter[call[name[self]._doPut, parameter[binary_operation[name[self].sendURL + constant[/data]]]]]]
keyword[def] identifier[handle] ( identifier[self] , identifier[data] ): literal[string] identifier[self] . identifier[dataResponseCode] . identifier[append] ( identifier[self] . identifier[_doPut] ( identifier[self] . identifier[sendURL] + literal[string] , identifier[data] = identifier[data] ))
def handle(self, data): """ puts the data in the target. :param data: the data to post. :return: """ self.dataResponseCode.append(self._doPut(self.sendURL + '/data', data=data))
def dphi_fc(fdata): """Apply phi derivative in the Fourier domain.""" nrows = fdata.shape[0] ncols = fdata.shape[1] B = int(ncols / 2) # As always, we assume nrows and ncols are even a = list(range(0, int(B))) ap = list(range(-int(B), 0)) a.extend(ap) dphi = np.zeros...
def function[dphi_fc, parameter[fdata]]: constant[Apply phi derivative in the Fourier domain.] variable[nrows] assign[=] call[name[fdata].shape][constant[0]] variable[ncols] assign[=] call[name[fdata].shape][constant[1]] variable[B] assign[=] call[name[int], parameter[binary_operation[na...
keyword[def] identifier[dphi_fc] ( identifier[fdata] ): literal[string] identifier[nrows] = identifier[fdata] . identifier[shape] [ literal[int] ] identifier[ncols] = identifier[fdata] . identifier[shape] [ literal[int] ] identifier[B] = identifier[int] ( identifier[ncols] / literal[int] ) ...
def dphi_fc(fdata): """Apply phi derivative in the Fourier domain.""" nrows = fdata.shape[0] ncols = fdata.shape[1] B = int(ncols / 2) # As always, we assume nrows and ncols are even a = list(range(0, int(B))) ap = list(range(-int(B), 0)) a.extend(ap) dphi = np.zeros([nrows, ncols], np....
def check_subscription(self, request): """Redirect to the subscribe page if the user lacks an active subscription.""" subscriber = subscriber_request_callback(request) if not subscriber_has_active_subscription(subscriber): if not SUBSCRIPTION_REDIRECT: raise ImproperlyConfigured("DJSTRIPE_SUBSCRIPTION_RED...
def function[check_subscription, parameter[self, request]]: constant[Redirect to the subscribe page if the user lacks an active subscription.] variable[subscriber] assign[=] call[name[subscriber_request_callback], parameter[name[request]]] if <ast.UnaryOp object at 0x7da204622680> begin[:] ...
keyword[def] identifier[check_subscription] ( identifier[self] , identifier[request] ): literal[string] identifier[subscriber] = identifier[subscriber_request_callback] ( identifier[request] ) keyword[if] keyword[not] identifier[subscriber_has_active_subscription] ( identifier[subscriber] ): keyword[...
def check_subscription(self, request): """Redirect to the subscribe page if the user lacks an active subscription.""" subscriber = subscriber_request_callback(request) if not subscriber_has_active_subscription(subscriber): if not SUBSCRIPTION_REDIRECT: raise ImproperlyConfigured('DJSTRIP...
def update_discount_coupon_by_id(cls, discount_coupon_id, discount_coupon, **kwargs): """Update DiscountCoupon Update attributes of DiscountCoupon This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = a...
def function[update_discount_coupon_by_id, parameter[cls, discount_coupon_id, discount_coupon]]: constant[Update DiscountCoupon Update attributes of DiscountCoupon This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True ...
keyword[def] identifier[update_discount_coupon_by_id] ( identifier[cls] , identifier[discount_coupon_id] , identifier[discount_coupon] ,** identifier[kwargs] ): literal[string] identifier[kwargs] [ literal[string] ]= keyword[True] keyword[if] identifier[kwargs] . identifier[get] ( litera...
def update_discount_coupon_by_id(cls, discount_coupon_id, discount_coupon, **kwargs): """Update DiscountCoupon Update attributes of DiscountCoupon This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.u...
def add_project(self, path): """ Adds a project. :param path: Project path. :type path: unicode :return: Method success. :rtype: bool """ if not foundations.common.path_exists(path): return False path = os.path.normpath(path) ...
def function[add_project, parameter[self, path]]: constant[ Adds a project. :param path: Project path. :type path: unicode :return: Method success. :rtype: bool ] if <ast.UnaryOp object at 0x7da18bccbfd0> begin[:] return[constant[False]] v...
keyword[def] identifier[add_project] ( identifier[self] , identifier[path] ): literal[string] keyword[if] keyword[not] identifier[foundations] . identifier[common] . identifier[path_exists] ( identifier[path] ): keyword[return] keyword[False] identifier[path] = identifie...
def add_project(self, path): """ Adds a project. :param path: Project path. :type path: unicode :return: Method success. :rtype: bool """ if not foundations.common.path_exists(path): return False # depends on [control=['if'], data=[]] path = os.path....
def scan(context, root_dir): """Scan a directory for analyses.""" root_dir = root_dir or context.obj['root'] config_files = Path(root_dir).glob('*/analysis/*_config.yaml') for config_file in config_files: LOG.debug("found analysis config: %s", config_file) with config_file.open() as stre...
def function[scan, parameter[context, root_dir]]: constant[Scan a directory for analyses.] variable[root_dir] assign[=] <ast.BoolOp object at 0x7da20c7ca290> variable[config_files] assign[=] call[call[name[Path], parameter[name[root_dir]]].glob, parameter[constant[*/analysis/*_config.yaml]]] ...
keyword[def] identifier[scan] ( identifier[context] , identifier[root_dir] ): literal[string] identifier[root_dir] = identifier[root_dir] keyword[or] identifier[context] . identifier[obj] [ literal[string] ] identifier[config_files] = identifier[Path] ( identifier[root_dir] ). identifier[glob] ( lit...
def scan(context, root_dir): """Scan a directory for analyses.""" root_dir = root_dir or context.obj['root'] config_files = Path(root_dir).glob('*/analysis/*_config.yaml') for config_file in config_files: LOG.debug('found analysis config: %s', config_file) with config_file.open() as stre...
def _smallest_integer_by_dtype(dt): """Helper returning the smallest integer exactly representable by dtype.""" if not _is_known_dtype(dt): raise TypeError("Unrecognized dtype: {}".format(dt.name)) if _is_known_unsigned_by_dtype(dt): return 0 return -1 * _largest_integer_by_dtype(dt)
def function[_smallest_integer_by_dtype, parameter[dt]]: constant[Helper returning the smallest integer exactly representable by dtype.] if <ast.UnaryOp object at 0x7da1b02d1cf0> begin[:] <ast.Raise object at 0x7da1b02d2110> if call[name[_is_known_unsigned_by_dtype], parameter[name[dt]]]...
keyword[def] identifier[_smallest_integer_by_dtype] ( identifier[dt] ): literal[string] keyword[if] keyword[not] identifier[_is_known_dtype] ( identifier[dt] ): keyword[raise] identifier[TypeError] ( literal[string] . identifier[format] ( identifier[dt] . identifier[name] )) keyword[if] identifier[...
def _smallest_integer_by_dtype(dt): """Helper returning the smallest integer exactly representable by dtype.""" if not _is_known_dtype(dt): raise TypeError('Unrecognized dtype: {}'.format(dt.name)) # depends on [control=['if'], data=[]] if _is_known_unsigned_by_dtype(dt): return 0 # depend...