query
stringlengths
9
3.4k
document
stringlengths
9
87.4k
metadata
dict
negatives
listlengths
4
101
negative_scores
listlengths
4
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Request configuration steps from the user.
def request_app_setup(hass, config, add_devices, discovery_info=None): from requests.compat import urljoin from requests_oauthlib import OAuth2Session configurator = hass.components.configurator authorization_base_url = urljoin(BASE_URL, '/oauth/authorize') oauth = OAuth2Session(config[CONF_CLIENT_I...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def configure_step(self):\n pass", "def configure_step(self):\n\n pass", "def _get_config(self, *args, **kwargs):\n # Just need to show the parameter screen...the parser for the command\n # does the update_many()\n self._go_to_root_menu()\n self._navigate(SubMenu.SHOW_...
[ "0.66699576", "0.6667467", "0.6287923", "0.62725496", "0.6221582", "0.61669147", "0.6054061", "0.6050561", "0.6034268", "0.5968504", "0.590665", "0.5885933", "0.5869062", "0.5830819", "0.5797171", "0.5786048", "0.57763475", "0.5760296", "0.5702746", "0.5690834", "0.5649921", ...
0.0
-1
Run when the configuration callback is called.
def trakt_configuration_callback(data): token_url = urljoin(BASE_URL, '/oauth/token') oauth.fetch_token(token_url, client_secret=config[CONF_CLIENT_SECRET], code=data.get('pin_code')) token = oauth.token['access_token'] save_token(hass, token) continue_setup_platform(hass, config...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _configure(self):\n pass", "def _on_config_changed(self, _):\n self._configure_pod()", "def configure(self):\n pass", "def configure(self):\n pass", "def configure(self, conf):\n return", "def configure(self):\r\n pass", "def configure(self):\n\n pas...
[ "0.7356386", "0.718658", "0.7073455", "0.7073455", "0.7070183", "0.7044829", "0.7043948", "0.7015198", "0.69656277", "0.69321007", "0.686319", "0.68344295", "0.6830558", "0.6830558", "0.6830558", "0.6830558", "0.6764478", "0.6732627", "0.67073286", "0.6664415", "0.6664415", ...
0.0
-1
Set up the Trakt component.
def setup_platform(hass, config, add_devices, discovery_info=None): token = load_token(hass) if not token: request_app_setup(hass, config, add_devices, discovery_info) else: continue_setup_platform(hass, config, token, add_devices, discovery_info)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup_component(self):\n self.conf, self.context = self._init_component()\n self.initialize()", "def setup(self) -> None:\n pass", "def setup(self) -> None:\n pass", "def setup(self) -> None:\n pass", "def _setup(self) -> None:\n\t\treturn", "def setup(self):\n ...
[ "0.67616314", "0.65239465", "0.65239465", "0.65239465", "0.6387798", "0.63869494", "0.63869494", "0.63869494", "0.63869494", "0.63869494", "0.63869494", "0.63869494", "0.63869494", "0.63869494", "0.63869494", "0.63869494", "0.63869494", "0.6368488", "0.63305414", "0.6329094", ...
0.0
-1
Set up the Trakt component.
def continue_setup_platform(hass, config, token, add_devices, discovery_info=None): if "trakt" in _CONFIGURING: hass.components.configurator.request_done(_CONFIGURING.pop("trakt")) add_devices([TraktMyShowCalendarSensor(hass, config, token)], True)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup_component(self):\n self.conf, self.context = self._init_component()\n self.initialize()", "def setup(self) -> None:\n pass", "def setup(self) -> None:\n pass", "def setup(self) -> None:\n pass", "def _setup(self) -> None:\n\t\treturn", "def setup(self):\n ...
[ "0.67616314", "0.65239465", "0.65239465", "0.65239465", "0.6387798", "0.63869494", "0.63869494", "0.63869494", "0.63869494", "0.63869494", "0.63869494", "0.63869494", "0.63869494", "0.63869494", "0.63869494", "0.63869494", "0.63869494", "0.6368488", "0.63305414", "0.6329094", ...
0.0
-1
Get the latest state of the sensor.
def update(self): from trakt.calendar import MyShowCalendar calendar = MyShowCalendar(days=self._days) if not calendar: _LOGGER.error("Nothing in calendar") return False self._state = len(calendar) for show in calendar: i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def state(self):\n if self.coordinator.data:\n return self.coordinator.data[self._sensor]", "def state(self):\n if self.ticker.values is not None:\n return round(\n float(\n self.ticker.values.get(\"last\")\n ),\n ...
[ "0.753419", "0.74876356", "0.74765736", "0.72214586", "0.7112677", "0.6995063", "0.69775915", "0.6945787", "0.69136775", "0.68911135", "0.68863803", "0.6863116", "0.6858303", "0.6834618", "0.6774382", "0.67590016", "0.6746638", "0.6699024", "0.6691935", "0.6685089", "0.666090...
0.0
-1
Return the name of the sensor.
def name(self): return 'Trakt My Upcoming Calendar'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name(self):\n return self._sensor.name", "def get_sensor_name(self):\n return self.data[1]", "def name(self):\n return self.device.device_data[self.device_id]['name'] + \\\n f' {self._sensor_type}'", "def name(self):\n return f\"{self._name} {SENSOR_TYPES[self.senso...
[ "0.91896784", "0.9168378", "0.890185", "0.8770976", "0.8511273", "0.8479953", "0.844435", "0.8299758", "0.8186503", "0.8105667", "0.8079737", "0.8066149", "0.8049647", "0.7700968", "0.7612295", "0.7611456", "0.7600605", "0.7600605", "0.7600605", "0.75392073", "0.75166553", ...
0.0
-1
Return the state of the sensor.
def state(self): return self._state
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def state(self):\n return self.device.device_data[self.device_id][self._sensor_type]", "def state(self):\n if self.coordinator.data:\n return self.coordinator.data[self._sensor]", "def state(self):\n return self.device.value()", "def state(self):\n return self.device.de...
[ "0.8718752", "0.81688267", "0.8066322", "0.8047302", "0.8043937", "0.7988314", "0.7980182", "0.795486", "0.7944504", "0.7931106", "0.78322214", "0.780842", "0.7798265", "0.7773271", "0.7736683", "0.76682585", "0.76501304", "0.7622975", "0.7608863", "0.7522398", "0.74831885", ...
0.0
-1
Return the icon to use in the frontend.
def icon(self): return 'mdi:calendar'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def icon(self):\n return ICON", "def icon(self):\n return ICON", "def icon(self):\n return ICON", "def icon(self):\n return ICON", "def icon(self):\n return ICON", "def icon(self):\n return ICON", "def icon(self):\n return ICON", "def icon(self):\n ...
[ "0.86562896", "0.86562896", "0.86562896", "0.86562896", "0.86562896", "0.86562896", "0.86562896", "0.86562896", "0.86562896", "0.86562896", "0.8508319", "0.8508319", "0.84885186", "0.8486859", "0.8486859", "0.8486859", "0.84036076", "0.83852637", "0.8384994", "0.8358457", "0....
0.0
-1
Return the unit of measurement this sensor expresses itself in.
def unit_of_measurement(self): return 'shows'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unit_of_measurement(self):\n return self.sensor_type[\"unit\"]", "def unit_of_measurement(self):\n return self._sensor.unit", "def unit_of_measurement(self):\n return SENSOR_TYPES[self.sensor][1]", "def unit_of_measurement(self):\n return SENSOR_TYPES[self._sensor][0]", "def...
[ "0.9081346", "0.9060374", "0.9041149", "0.90366775", "0.90002877", "0.89408666", "0.89262134", "0.89262134", "0.8914815", "0.8914815", "0.8914702", "0.88991666", "0.88991666", "0.88880575", "0.88880575", "0.8850445", "0.88333637", "0.88333637", "0.88323617", "0.88198566", "0....
0.0
-1
Return the state attributes of the sensor.
def device_state_attributes(self): return self._hass.data[DATA_UPCOMING]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def device_state_attributes(self):\r\n return self.attributes", "def device_state_attributes(self):\r\n return self._attributes", "def device_state_attributes(self):\n return self.attr", "def device_state_attributes(self):\n return self.attr", "def device_state_attributes(self) ...
[ "0.8418945", "0.82497084", "0.8243777", "0.8243777", "0.8200083", "0.8169021", "0.8169021", "0.8159991", "0.8159991", "0.8145903", "0.8145903", "0.8145903", "0.8145903", "0.8145903", "0.8145903", "0.8145903", "0.8145903", "0.8145903", "0.8145903", "0.8145903", "0.8145903", ...
0.7415868
68
Evaluate expression; Return an arraylike object.
def evaluate(self): for v in _INNVAR_EXPR.findall(self.expr): if v not in self.m_globals and v not in self.m_file_caches: try: self.m_file_caches[v] = model.load_file(self.strip_var(v)) except IOError: raise LineProcessError('Un...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _evaluate(expression, isNumpy=True, **kwargs):\n if isNumber(expression):\n if isNumpy:\n return expressionToNumber(expression)\n else:\n return expression\n # Evaluate\n expr = substitute(expression, **kwargs)\n # Symbol substitution can create a number\n if ...
[ "0.6612535", "0.6605882", "0.63574743", "0.63366485", "0.62603825", "0.6252521", "0.6118114", "0.611112", "0.6049557", "0.60417324", "0.60066825", "0.5983989", "0.59708625", "0.590639", "0.59023535", "0.58776754", "0.58280677", "0.56330013", "0.55935353", "0.5576232", "0.5536...
0.0
-1
Evaluate expression, try interpret undefined variable as column label of hintvar.
def evaluate_with_hintvar(self, hintvar=None): self.hintvalue = hintvar self.m_locals['col'] = lambda x: model.util.loc_col_str(self.hintvalue, str(x)) self.m_locals['cols'] = lambda x: model.util.loc_col_wildcard(self.hintvalue, str(x)) self.m_locals['hint'] = lambda: self.hintvalue ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_undefined_vars(self):\r\n variables = {'R1': 2.0, 'R3': 4.0}\r\n\r\n with self.assertRaisesRegexp(calc.UndefinedVariable, 'QWSEKO'):\r\n calc.evaluator({}, {}, \"5+7*QWSEKO\")\r\n with self.assertRaisesRegexp(calc.UndefinedVariable, 'r2'):\r\n calc.evaluator({'r1...
[ "0.59284544", "0.531087", "0.5252986", "0.5238921", "0.5207967", "0.52056307", "0.51976365", "0.5167777", "0.5151357", "0.511533", "0.49908173", "0.49555138", "0.49305037", "0.49269688", "0.49070445", "0.48973075", "0.4878731", "0.48532164", "0.48215866", "0.47968546", "0.478...
0.69425213
0
Wraps response in a consistent format throughout the API
def create_response(data={}, status=200, message=''): if type(data) is not dict: raise TypeError('Data should be a dictionary 😞') response = { 'success': 200 <= status < 300, 'code': status, 'message': message, 'result': data } return jsonify(response), status
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def adapt_response(self, response):\n return response", "def adapt_response(self, response):\n return response", "def wrap_results(response):\n if isinstance(response.data, list):\n return {\"results\": response.data}\n\n return response.data", "def format(self, response):\n\n ...
[ "0.71684396", "0.71684396", "0.6965196", "0.69470227", "0.6798882", "0.67131275", "0.66948044", "0.66014194", "0.6587064", "0.6583689", "0.6526347", "0.645094", "0.645094", "0.6426705", "0.63903576", "0.6374556", "0.6370342", "0.6349633", "0.63132614", "0.6310916", "0.6307778...
0.0
-1
Creates a new row by making a new instance of RowClass out of row_dict and kwargs Ignores keyvalue pairs with list values
def row_constructor(RowClass, row_dict={}, **kwargs): valid_row_dict = dict((key, val) for key, val in row_dict.items() if type(val) is not list) return RowClass(**valid_row_dict, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deserialize(cls, row: Dict):\n return cls(row)", "def create_from_row(cls, row: pd.Series) -> \"Action\":\n fields = [\n key\n for key, value in cls.__dataclass_fields__.items()\n if value.type != ClassVar\n ]\n d = {key: value for key, value in ro...
[ "0.67752624", "0.67089057", "0.66670537", "0.6566741", "0.64782006", "0.64717084", "0.64357233", "0.64337045", "0.6295816", "0.62405753", "0.6211598", "0.62066907", "0.6147813", "0.6129152", "0.6111731", "0.6024918", "0.6005934", "0.5991014", "0.5965978", "0.592485", "0.58983...
0.82523
0
Evaluates script provided in the header, given the arguments provided in the sequence of RowData objects, the request.
def EvaluateScript(self, header, request, context): # Retrieve function type func_type = self.get_func_type(header) # Retrieve data types from header arg_types = self.get_arg_types(header) ret_type = self.get_return_type(header) logging.info('EvaluateScript: {} ({} {}) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def evaluate(self, script, ret_type, params=[]):\n # Evaluate script\n result = eval(script, {'args': params, 'numpy': numpy})\n logging.debug('Result: {}'.format(result))\n\n bundledRows = SSE.BundledRows()\n if isinstance(result, str) or not hasattr(result, '__iter__'):\n ...
[ "0.5672874", "0.5321719", "0.5199288", "0.5112893", "0.51101923", "0.5086698", "0.50556666", "0.5041273", "0.5037043", "0.5030938", "0.50295895", "0.50164515", "0.49762636", "0.49678123", "0.49415082", "0.4883817", "0.4866478", "0.486476", "0.48512733", "0.48477733", "0.48474...
0.80323666
0
Retrieves the function type.
def get_func_type(header): func_type = header.functionType if func_type == SSE.SCALAR: return FunctionType.Scalar elif func_type == SSE.AGGREGATION: return FunctionType.Aggregation elif func_type == SSE.TENSOR: return FunctionType.Tensor
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_func_type(self, *args):\n return _ida_hexrays.cfunc_t_get_func_type(self, *args)", "def getTypeCode(self):\n return _libsbml.FunctionDefinition_getTypeCode(self)", "def get_func_type(self, *args):\n return _ida_hexrays.cfuncptr_t_get_func_type(self, *args)", "def cfunc_type(self)...
[ "0.77189076", "0.75608045", "0.73277724", "0.7255213", "0.7206035", "0.69244546", "0.6839413", "0.66880846", "0.66546977", "0.6588013", "0.6528519", "0.64864475", "0.63258797", "0.6306119", "0.62778944", "0.62360936", "0.6227191", "0.6193731", "0.61928153", "0.618781", "0.618...
0.6901001
6
Gets the array of arguments based on the duals, and the type (string, numeric) specified in the header.
def get_arguments(context, arg_types, duals, header): if arg_types == ArgType.String: # All parameters are of string type script_args = [d.strData for d in duals] elif arg_types == ArgType.Numeric: # All parameters are of numeric type script_args = [d.num...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_arg_types(header):\n data_types = [param.dataType for param in header.params]\n\n if not data_types:\n return ArgType.Empty\n elif len(set(data_types)) > 1 or all(data_type == SSE.DUAL for data_type in data_types):\n return ArgType.Mixed\n elif all(data_typ...
[ "0.60939234", "0.5730771", "0.5688855", "0.56779844", "0.5576366", "0.55762005", "0.55699354", "0.54309654", "0.5424725", "0.53861606", "0.53861606", "0.53777516", "0.5362959", "0.53616136", "0.5322445", "0.5303704", "0.52627987", "0.5261432", "0.5249535", "0.5240755", "0.521...
0.782661
0
Determines the argument types for all parameters.
def get_arg_types(header): data_types = [param.dataType for param in header.params] if not data_types: return ArgType.Empty elif len(set(data_types)) > 1 or all(data_type == SSE.DUAL for data_type in data_types): return ArgType.Mixed elif all(data_type == SSE.STR...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def argument_types(self):\r\n class ArgumentsIterator(collections.Sequence):\r\n def __init__(self, parent):\r\n self.parent = parent\r\n self.length = None\r\n\r\n def __len__(self):\r\n if self.length is None:\r\n self.l...
[ "0.7026803", "0.6876073", "0.6629659", "0.6575872", "0.65319955", "0.6523474", "0.64903325", "0.6366765", "0.6366765", "0.6317618", "0.6210766", "0.61756325", "0.6144205", "0.6138839", "0.61348814", "0.6119094", "0.6085055", "0.604146", "0.59975576", "0.5977733", "0.595132", ...
0.6635003
2
Evaluates a script with given parameters and construct the result to a Row of duals.
def evaluate(self, script, ret_type, params=[]): # Evaluate script result = eval(script, {'args': params, 'numpy': numpy}) logging.debug('Result: {}'.format(result)) bundledRows = SSE.BundledRows() if isinstance(result, str) or not hasattr(result, '__iter__'): # A si...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def EvaluateScript(self, header, request, context):\n # Retrieve function type\n func_type = self.get_func_type(header)\n\n # Retrieve data types from header\n arg_types = self.get_arg_types(header)\n ret_type = self.get_return_type(header)\n\n logging.info('EvaluateScript...
[ "0.6015507", "0.5322008", "0.5254576", "0.51341265", "0.4956633", "0.49006158", "0.48540375", "0.48286295", "0.48148042", "0.47891203", "0.47660857", "0.4732252", "0.47256294", "0.47207665", "0.47147837", "0.4680894", "0.46803862", "0.4657566", "0.46573547", "0.46534434", "0....
0.7702706
0
Adds string constraints to the puppet.
def add_string_constraints(self, shoulders=True, hands=False, knees=False): strings = [] if shoulders: strings.extend([tc.surfaces.Distance(self, 'Left Torso Hook', 'Left Torso Spindle', 'LeftShoulderString', invalid='long'), tc.surfaces.Distan...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_constraints(self, constraints):\n for const in constraints:\n self.add_constraint(const.type, const.column, const.check_clause)", "def addConstrs(self, constrs, name=''):\n ...", "def add_constraint(self, constraint):\n constraint_type = constraint[0]\n if constra...
[ "0.5748878", "0.572449", "0.54346013", "0.5407176", "0.54051507", "0.53580767", "0.53114223", "0.5225109", "0.52087724", "0.51949704", "0.5179917", "0.5163777", "0.5154891", "0.5153501", "0.51130545", "0.506719", "0.502777", "0.49863383", "0.49863383", "0.4974188", "0.4957412...
0.57676655
0
Initialzes the configuration based on number of strings. Activates the string constraints.
def init_config(self, add_strings): q0 = {'TorsoZ': 10.0} if add_strings['shoulders']: q0.update({'LeftShoulderString': 13.34, 'RightShoulderString': 13.34}) # If there are strings on the hands, we want the elbows bent. Otherwise, straight at the sides. ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_strings(self, config_dict):\n\n # print(config_dict)\n self.string_cond.update(config_dict)", "def __init__(self, strings):\n self.strings = strings", "def __init__(self):\n self.iteration_deep = 0\n self.max_iteration_deep = 2\n self.max_dict_key_length = 10...
[ "0.5682287", "0.5160074", "0.5144449", "0.51122385", "0.51122385", "0.510941", "0.5101239", "0.5072267", "0.5072267", "0.5046157", "0.5018387", "0.49941292", "0.49836668", "0.496977", "0.49088556", "0.48971248", "0.4884416", "0.4863736", "0.48507494", "0.48301223", "0.4816057...
0.6295696
0
Initialize via parameters dictionary and algorithm input instance
def init_params(self, params, algo_input): if algo_input is None: raise AlgorithmError("EnergyInput instance is required.") operator = algo_input.qubit_op qpe_params = params.get(QuantumAlgorithm.SECTION_KEY_ALGORITHM) num_time_slices = qpe_params.get(QPE.PROP_NUM_TIME_SLIC...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_algorithm(self):\n pass", "def __init__(self, algorithm, iters, **params):\n self.algorithm = algorithm\n self.bags = iters\n self.params = params", "def __init__(self, algorithm_instance, acon_dict):\n\n self._algorithm_instance = algorithm_instance\n\n envir...
[ "0.77140886", "0.75507295", "0.7532309", "0.7131664", "0.71033084", "0.7060248", "0.7036856", "0.7033297", "0.69813234", "0.6898677", "0.68592453", "0.6851815", "0.6848132", "0.68016756", "0.67843115", "0.6741919", "0.671088", "0.67106724", "0.67071384", "0.66643035", "0.6654...
0.6821645
13
Implement the Quantum Phase Estimation algorithm
def _construct_qpe_evolution(self): a = QuantumRegister(self._num_ancillae, name='a') c = ClassicalRegister(self._num_ancillae, name='c') q = QuantumRegister(self._operator.num_qubits, name='q') qc = QuantumCircuit(a, q, c) # initialize state_in qc.data += self._state_i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def phaseEstimator(phases,omegas,T_s,k):\n length = phases.shape[0]\n pis = np.tile(2*np.pi,length)\n a = phases - T_s*k*omegas\n phaseShifts = np.mod(a,pis)\n b = phases-phaseShifts\n omega_hat = np.mod(b,pis)\n n = omega_hat/omegas\n estimatedTime = np.sum(n)/length\n \n estimatedPh...
[ "0.67012674", "0.6679573", "0.6639128", "0.6170097", "0.61535287", "0.6096697", "0.60765845", "0.6040347", "0.6026216", "0.59780633", "0.5960935", "0.5924497", "0.5894476", "0.58858556", "0.5882251", "0.5794157", "0.5792693", "0.579205", "0.5791448", "0.57829756", "0.578021",...
0.57089937
27
Returns last digit of a^b
def last_digit(a , b): temp_arr_a = [] temp_arr_b = [] while(a>0): temp_arr_a.append(a%10) a = a//10 while(b>0): temp_arr_b.append(b%10) b = b//10 return LastDigitHelper(temp_arr_a[::-1],temp_arr_b[::-1])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bit_manipulation(self, a: str, b: str) -> str:\n x, y = int(a, 2), int(b, 2)\n while y:\n answer = x ^ y\n carry = (x & y) << 1\n x, y = answer, carry\n return bin(x)[2:]", "def last_digits(x,y,n):\n\tr = modexp(x,y, 10**n)\n\n\t#post processing to make sure we didn't cut off a leadin...
[ "0.64815557", "0.635703", "0.6323173", "0.6261635", "0.62610626", "0.60959", "0.6007518", "0.60021526", "0.59732693", "0.59294915", "0.59172", "0.5874061", "0.5871729", "0.584262", "0.5781348", "0.57368034", "0.57270294", "0.5716488", "0.5714639", "0.57011753", "0.56823134", ...
0.6889433
0
Return a humanreadable representation of this puzzle.
def __str__(self): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n puzzle_string = '—' * 13 + '\\n'\n for i in range(self.PUZZLE_NUM_ROWS):\n for j in range(self.PUZZLE_NUM_COLUMNS):\n puzzle_string += '│{0: >2}'.format(str(self.position[i][j]))\n if j == self.PUZZLE_NUM_COLUMNS - 1:\n ...
[ "0.8013328", "0.78277814", "0.7773529", "0.73918873", "0.7119878", "0.70278764", "0.6998809", "0.6988922", "0.6977293", "0.6952625", "0.69012094", "0.68929327", "0.68723154", "0.6848498", "0.6841087", "0.6836507", "0.68216294", "0.67960393", "0.67693913", "0.675468", "0.67473...
0.0
-1
Return whether this puzzle is in a solved state.
def is_solved(self): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_solution(self) -> bool:\n if self in [self.SATISFIED, self.ALL_SOLUTIONS, self.OPTIMAL_SOLUTION]:\n return True\n return False", "def did_solve(self) -> bool:\n return self._solution.info.status == \"solved\"", "def did_solve(self):\n return self._solution[\"statu...
[ "0.7891133", "0.7724571", "0.77192897", "0.75712657", "0.7528001", "0.7525148", "0.7440006", "0.7415231", "0.73069674", "0.7285772", "0.7249697", "0.7190834", "0.7167805", "0.71411747", "0.71117806", "0.70549554", "0.70549554", "0.70549554", "0.70272464", "0.69721466", "0.696...
0.6638584
32
Return a list of possible new states reachable by one move. First compute a list of possible moves based on the current puzzle state. Then, return a list of the new puzzle states that the puzzle could be in after each move.
def extensions(self): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def moves(self) -> List[List[PushState]]:\n # seen_moves = set()\n possible_moves = [[], []]\n\n if state := self.prune_states(self.state): # Could return None\n size = len(self.prune_states(state))\n else:\n return possible_moves\n\n for count, each_slot i...
[ "0.8104155", "0.77070636", "0.76407915", "0.7350543", "0.7213498", "0.7213111", "0.71725035", "0.71575123", "0.71519935", "0.6966011", "0.69576585", "0.69256186", "0.6854215", "0.6826454", "0.67404544", "0.6708204", "0.67074037", "0.67035437", "0.6647372", "0.6640965", "0.663...
0.0
-1
Return a new puzzle state specified by making the given move. Raise a ValueError if represents an invalid move. Do NOT change the state of . This is not a mutating method!
def move(self, move): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_move(self, move):\n if type(move) == str:\n move = int(move)\n\n new_state = SubtractSquareState(not self.p1_turn,\n self.current_total - move)\n return new_state", "def make_move(self, move: Tuple[int, int]) -> MoveError:\n\n ...
[ "0.7502962", "0.7377822", "0.71807957", "0.7161514", "0.7132001", "0.7102793", "0.7046578", "0.70409113", "0.7005748", "0.69040823", "0.68799317", "0.687092", "0.6799032", "0.6795804", "0.6774923", "0.6772903", "0.6765391", "0.67434096", "0.6712352", "0.65643007", "0.65218544...
0.0
-1
Ends the coverage collection and pull the coverage.ec file from the device.
def end_test_coverage(self, intent: str, path: str) -> Any: warnings.warn( 'This API is deprecated and will be removed in future versions', DeprecationWarning, ) return self.execute( Command.END_TEST_COVERAGE, { 'intent': intent, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def coverage_stop(self, features, marker):\n self.coverage.stop()\n self.coverage.save()\n self.coverage.report(file=sys.stdout)", "def exit(self):\n if self.currentEditor is not None:\n self.currentEditor.highlight()\n self.currentEditor = None\n \n ...
[ "0.5998303", "0.5972818", "0.5884237", "0.55721664", "0.5521151", "0.53794765", "0.5334757", "0.53302425", "0.53143436", "0.52861106", "0.52658516", "0.5250581", "0.51469034", "0.51262903", "0.5124094", "0.5119422", "0.50877196", "0.5087221", "0.50703496", "0.506617", "0.5065...
0.56922543
3
Open notification shade in Android (API Level 18 and above)
def open_notifications(self) -> 'WebDriver': ext_name = 'mobile: openNotifications' try: self.assert_extension_exists(ext_name).execute_script(ext_name) except UnknownMethodException: # TODO: Remove the fallback self.mark_extension_absence(ext_name).execute(Co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def open_notifications(self):\n self.android_device_driver.adb.exec_adb_cmd(\n \"shell cmd statusbar expand-notifications\").wait()", "def close_notifications(self):\n self.android_device_driver.adb.exec_adb_cmd(\n \"shell cmd statusbar collapse\").wait()", "def getInfo(notification):", "...
[ "0.6538472", "0.5247078", "0.50043887", "0.5000306", "0.49598292", "0.49338895", "0.48818278", "0.48779115", "0.48471373", "0.47721973", "0.47635004", "0.4760181", "0.47423756", "0.47071823", "0.46981022", "0.46940032", "0.46668994", "0.4657272", "0.46547294", "0.4641246", "0...
0.43589386
40
Retrieves the current package running on the device.
def current_package(self) -> str: ext_name = 'mobile: getCurrentPackage' try: return self.assert_extension_exists(ext_name).execute_script(ext_name) except UnknownMethodException: # TODO: Remove the fallback return self.mark_extension_absence(ext_name).execute...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_active_package(self):\n return self.compute", "def package(cls):\n packages = get_packages()\n return packages.modules.get(cls.__module__)", "def get_current_package(self,ignore_error_handle = False):\n message = {}\n step = 'get current package'\n try:\n ...
[ "0.7282246", "0.6776407", "0.6632866", "0.6563965", "0.65178657", "0.64670855", "0.6440218", "0.64176047", "0.64087206", "0.6304794", "0.62999666", "0.6230555", "0.62082034", "0.62060446", "0.6202685", "0.61803627", "0.6140204", "0.6125821", "0.6116732", "0.6083639", "0.60732...
0.77967405
0
Aim is to update streamb by streama using a common key. Results will be in streamc, its format is that of streamb
def main(streama, streamb, streamc): # init global var # datas from streama newida = '' newkeya = '' newdatea = date(MINYEAR, 1, 1) newmnta = '' # datas from streama oldida = '' oldkeya = '' olddatea = date(MINYEAR, 1, 1) oldmnta = '' # datas from streamb newkeyb = '...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mconcat(a, b):\r\n if a is None:\r\n return b\r\n if b is None:\r\n return a\r\n for key in b.keyset:\r\n value=get(b,key)\r\n put(a,key,value)\r\n return a", "def process(stream1, stream2, delimiter, idx1, idx2, show):\n\n def parse(stream, idx):\n \"\"\"\n ...
[ "0.54515636", "0.5139896", "0.513122", "0.5106976", "0.50897145", "0.50897145", "0.5081774", "0.5046647", "0.5000696", "0.49335608", "0.48572096", "0.48555246", "0.48349974", "0.48169935", "0.48108128", "0.4801249", "0.47977075", "0.47940183", "0.47888657", "0.4786144", "0.47...
0.64154863
0
Converts list of star names to the Simbad ID of each star. Useful for comparision with same stars written in different ways. Args
def Simbad_names(star_names, time_pause = 60, n_step = 402): all_names_my_stars = [] count = 1 for star in star_names: result_table = Simbad.query_objectids(star) if result_table != None: names_star_Simbad = result_table['ID'] all_names_my_stars.append(names_star_S...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def idstar(star):\n # query = Gravity.select().where(Gravity.gravity != 0)\n # for g in query:\n # ...: print (g.gravity, g.starid.name, g.starid.pmra)\n # In this case, since the table Gravity is linked to the table Star via starid, we get the name of the star directly using starid.name\n #...
[ "0.5715571", "0.5641292", "0.5482911", "0.54706407", "0.5448561", "0.53510606", "0.5294954", "0.5268628", "0.52538073", "0.5145962", "0.51287305", "0.5111748", "0.5074646", "0.5061919", "0.5060797", "0.5023818", "0.50056607", "0.49366295", "0.49153474", "0.49102843", "0.48934...
0.60841554
0
Checks correspondence between in stars between two dataframes Args
def check_dataframe_Simbad_list(dataframe_cat, stars_dataframe_cat, compare_Simbad, time_pause = 60, n_step = 300): index_new_dataframe = [None]*len(dataframe_cat) count_orig = 0 for index_star in range(len(dataframe_cat)): result_table = Simbad.query_objectids(stars_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _consist_numeric(col, _df1, _df2, _key1, _key2, img_dir, date_flag=False):\n\n df1, df2 = _df1.copy(), _df2.copy()\n df = pd.merge(df1, df2, left_on=_key1, right_on=_key2, how=\"inner\")\n\n if (df['%s_x' %(col)].dropna().shape[0] == 0) or (df['%s_y' %(col)].dropna().shape[0] == 0):\n if (df['%...
[ "0.60046804", "0.58307797", "0.57184386", "0.5653466", "0.5443418", "0.54433", "0.5389676", "0.5379617", "0.5378537", "0.5377078", "0.53479713", "0.53335434", "0.5291606", "0.52884996", "0.525975", "0.525401", "0.5237504", "0.5226216", "0.52243006", "0.5202435", "0.5192014", ...
0.51448524
25
Whether or not this unit can research or build
def can_act(self) -> bool: return self.cooldown < 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check(self):\n\n if not self.target.ok():\n return False\n\n if not self.progid.ok():\n return False\n\n if not self.prinapp.ok():\n return False\n\n if not self.observers.ok():\n return False\n\n return True", "def checkBuildStat...
[ "0.67942226", "0.67309034", "0.67026377", "0.66788286", "0.6576485", "0.65274984", "0.65017116", "0.6486489", "0.6476589", "0.6434314", "0.63069576", "0.629627", "0.628818", "0.6264344", "0.62504584", "0.6200449", "0.61990637", "0.61310345", "0.6117862", "0.6112563", "0.61084...
0.0
-1
returns command to ask this tile to research this turn
def research(self) -> str: return "r {} {}".format(self.pos.x, self.pos.y)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ask_query(self):\n self.__output = list()\n return input(form('What do you want to search?\\n> '))", "def askForCommand(self,command): \n\n\t\tcurrentCommand = 'Simple 2F Gripper Controller\\n-----\\nCurrent command:'\n\t\tcurrentCommand += ' rACT = ' + str(command.rACT)\n\t\tcurrentCo...
[ "0.6286195", "0.6116455", "0.60017115", "0.59199333", "0.59097", "0.58274776", "0.58121645", "0.5719114", "0.5623208", "0.5613473", "0.56038374", "0.5583697", "0.5536381", "0.55361193", "0.55297923", "0.5519147", "0.551296", "0.5472923", "0.54713726", "0.5461347", "0.54470646...
0.5385429
27
returns command to ask this tile to build a worker this turn
def build_worker(self) -> str: return "bw {} {}".format(self.pos.x, self.pos.y)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hire_egg_worker(which):\n\n return 'junk'", "def get_command(self, ctx, name):\n if name not in self.daemon.list_actions():\n return None\n\n action = self.daemon.get_action(name)\n\n @wraps(action)\n def command(*args, **kwargs):\n return action(*args, **...
[ "0.57890385", "0.5406742", "0.53898126", "0.53898126", "0.53898126", "0.5364739", "0.5350785", "0.5330255", "0.5305483", "0.5300905", "0.5178551", "0.5172274", "0.51250726", "0.5120834", "0.5104383", "0.50891614", "0.5083659", "0.5077477", "0.50729185", "0.5056625", "0.505224...
0.5417323
1
returns command to ask this tile to build a cart this turn
def build_cart(self) -> str: return "bc {} {}".format(self.pos.x, self.pos.y)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_command(self):\n\n choice = input(\"> \")\n\n if choice == \"q\":\n return \"quit\"\n elif choice.isdigit() and int(choice) in self.model.products_id_list:\n self.product = ProductDetails(choice)\n substitute = self.product.find_substitute()\n ...
[ "0.55698615", "0.5508646", "0.54311943", "0.5328725", "0.5327739", "0.5281372", "0.52217513", "0.5078604", "0.5061011", "0.503337", "0.50004625", "0.49952474", "0.49895182", "0.4984941", "0.4972213", "0.49481794", "0.49228042", "0.49187016", "0.49090078", "0.48990202", "0.489...
0.6008704
0
get cargo space left in this unit
def cargo_space_left(self): return GAME_CONSTANTS["PARAMETERS"]["RESOURCE_CAPACITY"][self.type_str] - self.num_resources
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getCargoSpaceLeft(self):\n spaceused = self.cargo[\"wood\"] + self.cargo[\"coal\"] + self.cargo[\"uranium\"]\n if self.type == UNIT_TYPES.WORKER:\n return GAME_CONSTANTS[\"PARAMETERS\"][\"RESOURCE_CAPACITY\"][\"WORKER\"] - spaceused\n else:\n return GAME_CONSTANTS[\"P...
[ "0.84558314", "0.7005404", "0.65104955", "0.6461634", "0.6446924", "0.61363596", "0.6125196", "0.61117744", "0.61117744", "0.61117744", "0.61097604", "0.60723466", "0.60601735", "0.60502756", "0.5957754", "0.594649", "0.5944935", "0.5906883", "0.5906622", "0.5903146", "0.5901...
0.82059985
1
whether or not the unit can build where it is right now
def can_build(self, game_map) -> bool: if self.is_cart(): return False cell = game_map.get_cell_by_pos(self.pos) if not cell.has_resource() and cell.citytile is None and self.can_act() and self.has_enough_resources_to_build: return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def checkBuildStatus(self):\n pass", "def check(self):\n with working_dir(self.build_directory):\n self._if_ninja_target_execute(\"test\", parallel=False)", "def in_build(self):\n\n return self.is_valid_platform() and not self['ENVIRONMENT']", "def test_quick_build1(self):\n ...
[ "0.70485204", "0.67796624", "0.67191964", "0.6672499", "0.66063327", "0.6540383", "0.65153515", "0.65011173", "0.64859194", "0.63523096", "0.627461", "0.627461", "0.6230658", "0.61680704", "0.6126321", "0.6121215", "0.6041606", "0.6013576", "0.6013005", "0.5992177", "0.598716...
0.66327286
4
whether or not the unit can move or not. This does not check for potential collisions into other units or enemy cities
def can_act(self) -> bool: return self.cooldown < 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def can_move(self):\n return self.movement", "def can_move(self):\r\n for wall in self.app.walls:\r\n if vec(self.grid_pos+self.direction) == wall:\r\n return False\r\n return True", "def isValid(self, game):\n if self.unitid == None or self.team == None or...
[ "0.73909885", "0.7233662", "0.6965862", "0.68941766", "0.6828233", "0.67508173", "0.6672692", "0.66599375", "0.66250336", "0.65575594", "0.6530847", "0.65246844", "0.6519965", "0.65069646", "0.6505861", "0.65034753", "0.64749086", "0.6459441", "0.64439416", "0.64183223", "0.6...
0.0
-1
return the command to move unit in the given direction
def move(self, dir, logs=None) -> str: if logs is not None: logs.append((self.id, ValidActions.MOVE, dir)) return "m {} {}".format(self.id, dir)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def move(self, direction):\n command = self.DIRECTIONS[direction][\"command\"]\n mem, out = self.cpu.run_program(inputs=[command])\n status = out.pop()\n if status in (1, 2):\n self.position = Point(\n self.position.x + self.DIRECTIONS[direction][\"mask\"][0],\...
[ "0.71013266", "0.7022117", "0.6867882", "0.6659519", "0.6646929", "0.66144156", "0.66144156", "0.66045064", "0.65931946", "0.65428925", "0.65335274", "0.6478598", "0.64750934", "0.64636624", "0.6457819", "0.6452718", "0.6444017", "0.6406685", "0.639863", "0.6365964", "0.63326...
0.61713034
39
return the command to transfer a resource from a source unit to a destination unit as specified by their ids
def transfer(self, dest_id, resourceType, amount, logs=None) -> str: if logs is not None: logs.append((self.id, ValidActions.TRANSFER, dest_id)) return "t {} {} {} {}".format(self.id, dest_id, resourceType, amount)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transfer(self,source,target):\n self.__transfer_dict[tuple([source,target])]()", "def execute(self, devices, command_bytes):", "def _get_zfs_send_recv_cmd(self, src, dst):\n return utils.get_rrmgr_cmd(src, dst,\n compression=self.rrmgr_compression,\n ...
[ "0.5478194", "0.5301289", "0.5278881", "0.5159828", "0.51317626", "0.51315296", "0.5104579", "0.4970517", "0.49355325", "0.49082446", "0.49053028", "0.48414853", "0.48381266", "0.4835341", "0.48319343", "0.48268133", "0.480932", "0.48074305", "0.48045364", "0.47864357", "0.47...
0.6102304
0
return the command to build a city right under the worker
def build_city(self, logs=None) -> str: if self.is_cart(): raise ValueError(f"Unit {self.id} is a cart; cannot build a city!") if logs is not None: logs.append((self.id, ValidActions.BUILD, self.pos)) return "bcity {}".format(self.id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_command(self) -> typing.Optional[str]:\n return self._values.get(\"build_command\")", "def build_command(self) -> typing.Optional[str]:\n return self._values.get(\"build_command\")", "def build_command(self) -> typing.Optional[str]:\n return self._values.get(\"build_command\")", ...
[ "0.59555453", "0.59555453", "0.59555453", "0.56855345", "0.5540091", "0.5530357", "0.55204004", "0.54828805", "0.5480421", "0.5363058", "0.53553057", "0.53334975", "0.53310096", "0.5327887", "0.53257054", "0.5297619", "0.52672607", "0.5239541", "0.5226622", "0.5131584", "0.51...
0.6060829
0
return the command to pillage whatever is underneath the worker
def pillage(self, logs=None) -> str: if self.is_cart(): raise ValueError(f"Unit {self.id} is a cart; cannot pillage!") if logs is not None: logs.append((self.id, ValidActions.PILLAGE, self.pos)) return "p {}".format(self.id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_command(pid):", "def worker_function(ident, work):\n\n\t\tdef exec_debug(command_string) :\n\t\t\t\"\"\" \n\t\t\twhen the --debug option is set this outputs the command string rather than execute the command\n\t\t\t\n\t\t\t\tArgs:\n\t\t\t\t\tcommand_string (string) : the command and all args as a simple ...
[ "0.625268", "0.60474193", "0.60308796", "0.60087234", "0.60077655", "0.5974464", "0.59351486", "0.58979607", "0.57650936", "0.5762364", "0.5713683", "0.5693018", "0.5639249", "0.5633123", "0.5572174", "0.5566328", "0.5537194", "0.54946357", "0.5472186", "0.54694927", "0.54562...
0.0
-1
Function that writes all files for all paths of the polyhedre
def createAllFiles(poly, name): allConnections = poly.getAllConnections() allPaths = poly.getPaths() for i in range(len(allPaths)): writeFinal(name + "_" + str(i) +".dot", allConnections, allPaths[i], name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_files(self, basedir):\n outdir = basedir / self.type\n outdir.mkdir(parents=True, exist_ok=True)\n\n for point, row in zip(self.points, self.array):\n filepath = outdir / point\n with filepath.open('w') as f:\n idx = 0\n for ikey in...
[ "0.6619719", "0.66185224", "0.64555454", "0.63866466", "0.6379787", "0.63196236", "0.628272", "0.6251185", "0.62502337", "0.6206444", "0.6203168", "0.6184853", "0.60938925", "0.60918677", "0.60411173", "0.60036546", "0.5994885", "0.5991923", "0.5973439", "0.5973439", "0.59527...
0.7769273
0
Function that creates all image for all paths of the polyhedre
def createAllImageFiles(poly, name) : for i in range(len(poly.getPaths())): fileName = name + "_" + str(i) + ".dot" imgName = name + "_" + str(i) + ".jpg" Command = "neato -Tjpeg " + fileName + " -o " + imgName run(Command, shell=True)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create(path=\"cubes\",pathIm=\"cubes/img\"):\r\n\tobj_name=createNames(pathImg=pathIm)\r\n\tfor i in obj_name:\r\n\t\tfor j in obj_name[i]:\r\n\t\t\tdest=path+chr(47)+str(i)+\"_\"+str(j)\r\n\t\t\tcreate_mtl(dest+\".mtl\",\"img\"+chr(47)+str(i)+chr(47)+str(j)+\".png\")\r\n\t\t\tcreate_obj(dest+\".obj\",str(i)+\...
[ "0.6484281", "0.6417693", "0.63572615", "0.6268724", "0.62588155", "0.62354445", "0.6176815", "0.6175257", "0.6138654", "0.61066836", "0.6075611", "0.60679376", "0.60361594", "0.59879905", "0.59710187", "0.5912346", "0.5880527", "0.5863448", "0.5860692", "0.58603406", "0.5857...
0.74639696
0
The main function who allows to use all programs in shell.
def __main__() : try : poly = Polyhedre(sys.argv[1]) name = sys.argv[2] createAllFiles(poly, name) createAllImageFiles(poly, name) except FileNotFoundError : print("Use an existing file")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\n\n BASIC.run(PROGRAM)", "def main():\n run_program()", "def main(self):\n cmd, path, args = self._parse_args()\n if cmd == \"shell\":\n print \"You are now in ubs shell.\"\n print \"Use \\\"python %s help\\\" to see other choice.\" % sys.argv[0]\n ...
[ "0.7589788", "0.7320712", "0.71573067", "0.7146958", "0.7141811", "0.70483035", "0.70430595", "0.7016946", "0.6968243", "0.6959962", "0.6959962", "0.6959962", "0.6959962", "0.69363195", "0.6929487", "0.69284004", "0.68697864", "0.683257", "0.68133146", "0.6742233", "0.6724584...
0.0
-1
>>> one_lnk = Link(1) >>> flip_two(one_lnk) >>> one_lnk Link(1) >>> lnk = Link(1, Link(2, Link(3, Link(4, Link(5))))) >>> flip_two(lnk) >>> lnk Link(2, Link(1, Link(4, Link(3, Link(5)))))
def flip_two(lnk): if lnk is not Link.empty and lnk.rest is not Link.empty: lnk.first, lnk.rest.first = lnk.rest.first, lnk.first flip_two(lnk.rest.rest)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def flip_two_ptr(lnk):\n def helper(lnk, prev):\n if lnk is not Link.empty and lnk.rest is not Link.empty:\n if prev:\n prev.rest = lnk.rest\n temp = lnk.rest\n lnk.rest, temp.rest = lnk.rest.rest, lnk\n helper(lnk.rest, lnk)\n helper(lnk, Non...
[ "0.82952255", "0.67274755", "0.6386259", "0.6071076", "0.6054646", "0.5969344", "0.5818467", "0.57904196", "0.5764759", "0.57519877", "0.5736876", "0.57328045", "0.5708837", "0.56891006", "0.56742984", "0.5659875", "0.5644024", "0.5611128", "0.55798846", "0.5556491", "0.55373...
0.85974514
0
>>> one_lnk = Link(1) >>> flip_two_ptr(one_lnk) >>> one_lnk Link(1) >>> lnk = Link(1, Link(2, Link(3, Link(4, Link(5))))) >>> temp = lnk.rest >>> flip_two_ptr(lnk) >>> temp Link(2, Link(1, Link(4, Link(3, Link(5)))))
def flip_two_ptr(lnk): def helper(lnk, prev): if lnk is not Link.empty and lnk.rest is not Link.empty: if prev: prev.rest = lnk.rest temp = lnk.rest lnk.rest, temp.rest = lnk.rest.rest, lnk helper(lnk.rest, lnk) helper(lnk, None)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def flip_two(lnk):\n if lnk is not Link.empty and lnk.rest is not Link.empty:\n lnk.first, lnk.rest.first = lnk.rest.first, lnk.first\n flip_two(lnk.rest.rest)", "def reverse(link):\n if link is Link.empty:\n return \"this linked list is empty\"\n link = Link(link.rest, link.first)\...
[ "0.8235925", "0.7227324", "0.64997506", "0.6399087", "0.6319393", "0.6235773", "0.61662036", "0.6136959", "0.6126622", "0.6113028", "0.6108484", "0.60924876", "0.6082385", "0.6055703", "0.6045684", "0.603583", "0.6023345", "0.6023063", "0.6021659", "0.60038805", "0.6001733", ...
0.9125939
0
>>> link = Link(1, Link(2, Link(3)))
def filter_link(link, f): while link is not Link.empty: if f(link.first): yield link.first link = link.rest # Recursive Solution # if link is not Link.empty: # if f(link.first): # yield link.first # yield from filter_link(link.rest, f)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def link(self, link):\r\n return links.Link(self, link)", "def __init__(self, link):\n self.__link = link", "def newLinkAtom(self, **attrlinks):\n return LinkAtom(self, **attrlinks)", "def link(address):", "def make_link(first, second):\n manager = Actions()\n manager.make_link(first...
[ "0.66079247", "0.6374115", "0.62634355", "0.6133141", "0.60890585", "0.6074532", "0.600528", "0.5992518", "0.5982429", "0.59778047", "0.592274", "0.5866171", "0.5822697", "0.5810218", "0.57524097", "0.57107496", "0.5705097", "0.56956184", "0.56899506", "0.5638258", "0.5585145...
0.0
-1
>>> tree_ex = Tree(2, [Tree(7, [Tree(3), Tree(6, [Tree(5), Tree(11)])]), Tree(1, [Tree(5)])]) >>> find_paths(tree_ex, 5) [[2, 7, 6, 5], [2, 1, 5]] >>> find_paths(tree_ex, 12) []
def find_paths(t, entry): paths = [] if t.label == entry: return [[entry]] for b in t.branches: for p in find_paths(b, entry): paths.append([t.label] + p) return paths
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_path(tree):\n results = []\n for neighbour in tree.neighbours:\n continue\n # TODO\n results.reverse()\n pass", "def find_treepaths(root, treepaths):\n treepaths.append(root)# possible that more than one match of the same length\n if root.children:\n path_children ...
[ "0.7400494", "0.7223099", "0.70226353", "0.696237", "0.69352806", "0.6659069", "0.66313934", "0.6546216", "0.6386295", "0.6364525", "0.6311217", "0.6282089", "0.62104976", "0.61882377", "0.6010273", "0.59932053", "0.59596497", "0.5907999", "0.5907915", "0.5903285", "0.5881109...
0.69003713
5
Return a string that would evaluate to self.
def __repr__(self): if self.rest is Link.empty: rest = '' else: rest = ', ' + repr(self.rest) return 'Link({0}{1})'.format(self.first, rest)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __repr__(self) -> str:\n return '{:s}({!r})'.format(self.__class__.__name__, self.getvalue())", "def __repr__(self) -> str:\n return '{:s}({!r})'.format(self.__class__.__name__, self.getvalue())", "def __repr__(self) -> str:\n return '{:s}({!r})'.format(self.__class__.__name__, self.ge...
[ "0.72736275", "0.72736275", "0.72736275", "0.7100371", "0.7076422", "0.69418997", "0.6940535", "0.6876189", "0.6798726", "0.6792618", "0.6779267", "0.6779267", "0.6779267", "0.67703366", "0.67703366", "0.67703366", "0.67703366", "0.67653316", "0.6762984", "0.6705609", "0.6700...
0.0
-1
Constructor for the SnapshotTargetPolicyProto class
def __init__(self, backup_type=None, copy_partially_successful_run=None, extended_retention_policy_vec=None, granularity_bucket=None, id=None, num_days_to_keep=None, retention_policy=None, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self,\n enable_worm_on_external_target=None,\n policy_type=None,\n retention_secs=None,\n version=None,\n ):\n\n # Initialize members of the class\n self.enable_worm_on_external_target = enable_worm_on_external_ta...
[ "0.6291815", "0.62309116", "0.61693263", "0.5764524", "0.56466216", "0.55173874", "0.55120885", "0.5508368", "0.54826474", "0.546535", "0.5461805", "0.54616255", "0.5451498", "0.54360384", "0.543389", "0.5433339", "0.53887415", "0.5367732", "0.53605705", "0.5355377", "0.53495...
0.5600029
5
Creates an instance of this model from a dictionary
def from_dictionary(cls, dictionary): if dictionary is None: return None # Extract variables from the dictionary backup_type = dictionary.get('backupType') copy_partially_successful_run = dictionary.get('copyPartiallySuccessfulRun') extended_r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_dictionary(cls,\n dictionary):\n if dictionary is None:\n return None\n\n # Extract variables from the dictionary\n id = dictionary.get('id')\n name = dictionary.get('name')\n mtype = dictionary.get('type')\n usage_bytes = diction...
[ "0.83181584", "0.8168118", "0.8168118", "0.8118749", "0.8089047", "0.79787344", "0.7949278", "0.79231393", "0.7898951", "0.78923255", "0.788838", "0.7882321", "0.7882212", "0.7876749", "0.78585315", "0.7836853", "0.7801407", "0.7801407", "0.7801407", "0.7801407", "0.7801407",...
0.0
-1
Construct a channel object.
def __init__( self, parent, id, *, units=None, null=None, signed=None, label=None, label_seed=None, **kwargs ): self._parent = parent super().__init__(id) self.label = label self.label_seed = label_seed ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new_channel(self, *args, **kwargs):\n logger.debug('creating channel -> connection.channel(%r, %r)' % (args, kwargs))\n if self.enabled:\n channel = self.connection.channel(*args, **kwargs)\n self._channels.append(channel)\n return channel\n else:\n ...
[ "0.76096034", "0.7085805", "0.6947256", "0.69450504", "0.6753486", "0.66237867", "0.6613922", "0.66047925", "0.63520133", "0.6349722", "0.6344446", "0.6339589", "0.62626624", "0.6259156", "0.6251609", "0.6189592", "0.6148684", "0.61289036", "0.60763115", "0.604747", "0.598094...
0.0
-1
Maximum deviation from null.
def major_extent(self) -> complex: return max((self.max() - self.null, self.null - self.min()))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def max_error(self) -> float:\n return float(np.max(np.abs(self._flattened_errors())))", "def max(self):\n # skipna == True\n return self._summarize(lambda c: c.max)", "def get_max_value(self):\n if self.is_ready():\n max_values = [dnd.get_max_value() for dnd in self.dnds...
[ "0.66094536", "0.65046316", "0.6458721", "0.6394537", "0.63921916", "0.63389707", "0.62978673", "0.62939286", "0.6280261", "0.62595344", "0.62512046", "0.62446564", "0.6238238", "0.62342966", "0.6180326", "0.6177482", "0.61723816", "0.6159018", "0.6150413", "0.6140926", "0.61...
0.0
-1
Minimum deviation from null.
def minor_extent(self) -> complex: return min((self.max() - self.null, self.null - self.min()))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def min(self):\n return self._reduce_for_stat_function(F.min, only_numeric=False)", "def min(self) -> \"Stream[float]\":\n return self.agg(np.min).astype(\"float\")", "def min(self) -> float:\n return stats.min(self)", "def min(self):\n return numpy.ma.min(self.data)", "def min_...
[ "0.69159925", "0.6710705", "0.6672135", "0.6645889", "0.65403515", "0.6534892", "0.6518658", "0.6478745", "0.64436805", "0.63997614", "0.638135", "0.6351122", "0.63509774", "0.634495", "0.6343436", "0.6341788", "0.6337545", "0.6327965", "0.6310968", "0.63020283", "0.62958074"...
0.0
-1
Channel magnitude (maximum deviation from null).
def mag(self) -> complex: return self.major_extent
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getMagFlux(self):\n return self.magflux", "def get_mag(self):\n raise NotImplementedError", "def magnitude(self):\n\t\treturn sqrt(self.dot(self))", "def magnitude(self):\n return sqrt(self & self)", "def magnitude(self):\n return self.real ** 2 + numpy.inner(self.pure, self...
[ "0.68795174", "0.6848419", "0.67904943", "0.67437845", "0.6671556", "0.6621296", "0.65718657", "0.6542814", "0.6495474", "0.6388952", "0.6388952", "0.637636", "0.63757735", "0.6370558", "0.63544625", "0.63144654", "0.63038945", "0.63005096", "0.6298169", "0.62927794", "0.6286...
0.67493135
3
Normalize a Channel, set `null` to 0 and the mag to given value.
def normalize(self, mag=1.0): def f(dataset, s, null, mag): dataset[s] -= null dataset[s] /= mag if self.signed: mag = self.mag() / mag else: mag = self.max() / mag self.chunkwise(f, null=self.null, mag=mag) self._null = 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _normalize(self):\r\n self.dataframe['norm_intensity'] = self.dataframe['intensity']\r\n self.dataframe['norm_intensity'] -= self.dataframe['norm_intensity'].min()\r\n self.dataframe['norm_intensity'] /= self.dataframe['norm_intensity'].max() * 0.01", "def normali...
[ "0.608774", "0.60527116", "0.6042676", "0.5887953", "0.5871583", "0.5869871", "0.5858427", "0.5853407", "0.5846617", "0.5843673", "0.57948995", "0.57607955", "0.566544", "0.5645322", "0.56308883", "0.5616104", "0.5607919", "0.5595453", "0.5573436", "0.5570104", "0.55578136", ...
0.7102045
0
Remove outliers from the dataset. Identifies outliers by comparing each point to its neighbors using a statistical test.
def trim(self, neighborhood, method="ztest", factor=3, replace="nan", verbose=True): warnings.warn("trim", category=wt_exceptions.EntireDatasetInMemoryWarning) outliers = [] means = [] ex_means = [] # find outliers for idx in np.ndindex(self.shape): slices = [...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter_outliers(data): \n \n idx_out = find_outliers_IQR(data)\n \n cleaned = data[~idx_out].copy()\n\n # print(f'There were {idx_out.sum()} outliers.')\n \n return cleaned", "def remove_outliers(data):\n upper_boundary = np.quantile(data, 0.992)\n lower_boundary = np.quantile(d...
[ "0.7571293", "0.73533314", "0.7310005", "0.72199756", "0.71364295", "0.712214", "0.70614946", "0.6980094", "0.693382", "0.69039583", "0.68601924", "0.6822064", "0.68056166", "0.6803707", "0.6796856", "0.67669195", "0.6759206", "0.67250484", "0.6718949", "0.671822", "0.6714428...
0.6970141
8
Takes a sequence of integers and projects (embeds) these labels into a continuous space by concatenating the correspending rows in the projection matrix W i.e. [2, 5] > [W[2] ... W[5]]
def project(self, x): assert 'int' in str(x.dtype) if x.ndim == 2: shape = (x.shape[0], x.shape[1] * self._W.shape[1]) return self._W[x.flatten()].reshape(shape) elif x.ndim == 1: return self._W[x].flatten() else: assert ValueError("proje...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def interpose(el, seq):\n return rest(mapcat(lambda x: [el, x], seq))", "def propagate_labels_simple(regions,labels):\n rlabels,_ = label(regions)\n cors = correspondences(rlabels,labels,False)\n outputs = zeros(amax(rlabels)+1,'i')\n for o,i in cors.T: outputs[o] = i\n outputs[0] = 0\n retu...
[ "0.5254593", "0.5242168", "0.5135488", "0.5073297", "0.50690424", "0.50441635", "0.5037247", "0.5024143", "0.50197333", "0.4993316", "0.4962656", "0.49546117", "0.49486738", "0.49337402", "0.49267393", "0.49264637", "0.4915613", "0.49069843", "0.49024236", "0.48953483", "0.48...
0.0
-1
A view that renders the bag contents page
def view_bag(request): return render(request, 'bag/bag.html')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def view_bag(request):\n return render(request, 'bag/bag.html')", "def view_bag(request):\n template = 'bag/bag.html'\n return render(request, template)", "def view_shoppingbag(request):\n\n return render(request, 'shoppingbag/shoppingbag.html')", "def view_basket(request):\n\n return render(r...
[ "0.8130614", "0.79764366", "0.6872428", "0.68546283", "0.66232", "0.63495225", "0.62205607", "0.6122564", "0.6059196", "0.60232246", "0.6004463", "0.59663737", "0.59508276", "0.5935793", "0.5898433", "0.5877317", "0.58662933", "0.5858933", "0.58370346", "0.58292454", "0.58270...
0.8125941
2
Add a quantity of the specified product to the shopping bag
def add_to_bag(request, item_id): a_class = get_object_or_404(Class, pk=item_id) quantity = int(request.POST.get('quantity')) redirect_url = request.POST.get('redirect_url') day = None if 'class_day' in request.POST: day = request.POST['class_day'] bag = request.session.get('bag', {}) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add(self, product, qty):\n product_id = str(product.id)\n\n if product_id in self.basket:\n self.basket[product_id]['qty'] = qty\n else:\n self.basket[product_id] = {'price': str(product.price), 'qty': qty}\n\n self.save()", "def add(self, product, product_qt...
[ "0.8333147", "0.79448044", "0.76388717", "0.7565298", "0.752918", "0.7374524", "0.7323851", "0.7291598", "0.7269899", "0.7184113", "0.71694285", "0.7169323", "0.71667796", "0.7090878", "0.7075725", "0.7074382", "0.7048924", "0.6973396", "0.6959259", "0.69576365", "0.6941769",...
0.0
-1
Adjust the quantity of the specified product to the specified amount
def adjust_bag(request, item_id): a_class = get_object_or_404(Class, pk=item_id) quantity = int(request.POST.get('quantity')) day = None if 'class_day' in request.POST: day = request.POST['class_day'] bag = request.session.get('bag', {}) if day: if quantity > 0: bag...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def balance_quantity(quantity, product_id, location):\r\n\r\n db = get_db()\r\n if location == \"product_factory\":\r\n ogquantity = db.execute(\r\n \"SELECT quantity from product WHERE product_id = ?\", (product_id,)\r\n ).fetchone()\r\n ogquantity = ogquantity[\"quantity\"]\...
[ "0.70074", "0.6897747", "0.68208647", "0.67503333", "0.6721636", "0.6696621", "0.66957915", "0.65499014", "0.65330845", "0.6530268", "0.6489693", "0.6466635", "0.6440673", "0.64043474", "0.6335166", "0.63119376", "0.63043827", "0.6213614", "0.6184061", "0.6184061", "0.6184061...
0.0
-1
Remove the item from the shopping bag
def remove_from_bag(request, item_id): try: a_class = get_object_or_404(Class, pk=item_id) day = None if 'class_day' in request.POST: day = request.POST['class_day'] bag = request.session.get('bag', {}) if day: del bag[item_id]['items_by_day'][day] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_from_basket(self, item):\n self._products.pop(item)", "def remove(self, item): \n item_id = str(item.id)\n if item_id in self.cart:\n # removal of item from cart\n del self.cart[item_id]\n # save method to update the cart in session\n ...
[ "0.82050824", "0.79479516", "0.78537154", "0.7780408", "0.776776", "0.7655925", "0.7634906", "0.7616113", "0.7611328", "0.75550723", "0.7491238", "0.7447417", "0.74056464", "0.73828065", "0.736008", "0.7352563", "0.73130274", "0.7250693", "0.7166314", "0.71483326", "0.7146646...
0.7294694
17
Composes the record headers from the given schema.
def headers(schema: Schema) -> List[str]: headers = Entry.headers() headers.extend([attr.uid for attr in schema.attributes]) return [header for header in headers if header != "item-hash"]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def count_and_set_headers(self, csv_schema, header_row):\n self.expected_headers = []\n self.flex_headers = []\n\n # Track how many times we've seen a field we were expecting. Keyed by\n # the shorter, machine-readable column names\n expected_fields = {}\n\n for schema in ...
[ "0.64783055", "0.5822722", "0.581001", "0.5769198", "0.57468027", "0.5742986", "0.56646234", "0.56415904", "0.5580238", "0.5552619", "0.55412304", "0.55337214", "0.55202013", "0.55161107", "0.55118364", "0.5504318", "0.53917146", "0.53358805", "0.52990156", "0.52901596", "0.5...
0.5697218
6
JSON representation as specified by V1
def to_json(self) -> str: return json.dumps({self._entry.key: self.to_dict()}, separators=(',', ':'), ensure_ascii=False)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def json_friendly(self):", "def as_json(self):", "def json(self):\n class ExtendedJSONEncoder(json.JSONEncoder):\n def default(self, obj):\n if isinstance(obj, datetime.date) or isinstance(obj, datetime.time):\n encoded_object = obj.isoformat()\n ...
[ "0.756398", "0.7520238", "0.7398364", "0.73505", "0.7254464", "0.7236321", "0.7230726", "0.71981585", "0.71868414", "0.7147393", "0.7117958", "0.7114805", "0.707701", "0.7067912", "0.7045124", "0.7033623", "0.7033378", "0.7022583", "0.702168", "0.7006731", "0.69911903", "0....
0.0
-1
Returns the record data as a dictionary.
def to_dict(self) -> Dict[str, Any]: data = self._entry.to_dict() del data["item-hash"] data["item"] = [self._blob.to_dict()] return data
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def as_dict(self) -> dict[str, Any]:\n return {\n \"type\": self.type,\n \"timestamp\": self.timestamp,\n \"data\": self.data or {},\n }", "def to_dict(self):\n return self._data_dict", "def recordToDict(self, record):\n fields = {}\n if recor...
[ "0.70939624", "0.7083627", "0.70595694", "0.7057455", "0.70398784", "0.6977981", "0.696365", "0.6935329", "0.6932191", "0.6887916", "0.6860571", "0.6787926", "0.6709606", "0.670344", "0.66872096", "0.66671824", "0.66655207", "0.6598191", "0.6598191", "0.6582836", "0.65758955"...
0.640054
31
Attempts to get the value for the given key.
def get(self, key: str) -> Optional[Value]: return self._blob.get(key)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_value(self, key):\n try:\n return self.map[key]\n except KeyError:\n raise KeyError('key is not in map')", "def get_value(self, key):\n return self[key]", "def value(self, key):\n item = self.default(key)\n return self.__getSafeValue(key, item)",...
[ "0.8055563", "0.80106217", "0.7934394", "0.79303366", "0.7900273", "0.7865407", "0.7849561", "0.78393054", "0.77563787", "0.7746736", "0.77373874", "0.7710292", "0.7699475", "0.76965255", "0.76806605", "0.7676845", "0.764005", "0.7594195", "0.75820845", "0.7574022", "0.756037...
0.7415804
21
Finds the instance number in a column header.
def get_instance(string): row = string.split(".") # handles "f.eid" case if len(row) < 4: return "0" # the number is somewhat arbitrary... # it is determined by Joeri's UK Phenotypes script. # (which is "get_UKphenotypes.r" --- thanks Joeri!) return row[2]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_colnumber(self, header):\n for i in range(0, len(self.data)):\n if self.data[i][0] == header:\n return i\n return None", "def _get_header_position(header_row: List[str], column_title: str) -> int:\n for pos, column in enumerate(header_row):\n if c...
[ "0.7740636", "0.7019518", "0.6729891", "0.6659433", "0.6328354", "0.6106713", "0.6029066", "0.60112745", "0.59829605", "0.59757566", "0.59574324", "0.5934573", "0.5854811", "0.585042", "0.58326006", "0.5827836", "0.58136183", "0.5813415", "0.5802109", "0.5727011", "0.57084763...
0.0
-1
Returns the start state for the search problem.
def getStartState(self): util.raiseNotDefined()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getStartState(self):\n return self._start_loc", "def getStartState(self):\n\t\tutil.raiseNotDefined()", "def getStartState(self):\n\t\tutil.raiseNotDefined()", "def getStartState(self):\r\n\t\tutil.raiseNotDefined()", "def get_start_state(self):\n util.raiseNotDefined()", "def get_start...
[ "0.75840217", "0.7533028", "0.7533028", "0.7457706", "0.7429071", "0.7384781", "0.7342245", "0.7342245", "0.7342245", "0.7342245", "0.7342245", "0.7342245", "0.7342245", "0.7342245", "0.7342245", "0.7339077", "0.69931024", "0.6990535", "0.6884872", "0.6682311", "0.6666652", ...
0.74203616
38
Returns a sequence of moves that solves tinyMaze. For any other maze, the sequence of moves will be incorrect, so only use this for tinyMaze.
def tinyMazeSearch(problem): from game import Directions s = Directions.SOUTH w = Directions.WEST return [s, s, w, s, w, w, s, w]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tinyMazeSearch(problem):\n from game import Directions\n s = Directions.SOUTH\n w = Directions.WEST\n n = Directions.NORTH\n\n return [s, s, n, s, w, s, w, w, s, w]", "def tinyMazeSearch(problem):\n from game import Directions\n\n s = Directions.SOUTH\n w = Directions.WEST\n retur...
[ "0.7176117", "0.71666056", "0.71489185", "0.7117483", "0.7117483", "0.7117483", "0.7104597", "0.7104597", "0.7104597", "0.7104597", "0.7104597", "0.7104597", "0.7104597", "0.71019185", "0.71019185", "0.71019185", "0.71019185", "0.71019185", "0.71019185", "0.71019185", "0.7101...
0.7096785
40
Search the deepest nodes in the search tree first. Your search algorithm needs to return a list of actions that reaches the goal. Make sure to implement a graph search algorithm. To get started, you might want to try some of these simple commands to
def depthFirstSearch(problem): #"*** YOUR CODE HERE ***" """ Pseudocode: function G RAPH-S EARCH ( problem) returns a solution, or failure initialize the frontier using the initial state of problem initialize the explored set to be empty loop do i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def depthFirstSearch(problem):\n \"*** YOUR CODE HERE ***\"\n class Node:\n def __init__(self, state, parent, action, pathCost):\n self.state = state #state of the game\n self.parent = parent #parent of the node\n self.action = action #action that led to that node\n ...
[ "0.7514212", "0.7227323", "0.72050494", "0.71345645", "0.7111152", "0.7071466", "0.7005544", "0.6993732", "0.6985615", "0.69755584", "0.69137734", "0.69034725", "0.6887418", "0.6877962", "0.68774015", "0.6870302", "0.6825583", "0.6765508", "0.675797", "0.67508304", "0.6738127...
0.67425895
20
Search the shallowest nodes in the search tree first. " YOUR CODE HERE " util.raiseNotDefined()
def breadthFirstSearch(problem): frontier = util.Queue() # print 'Create frontier' initial_node = node(problem.getStartState(), 0, [], 0)#(state,depth,path_actions,path_cost) frontier.push(initial_node) # print 'Push ',repr(initial_node.state) frontierSet = set([initial_node.state]) explore...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tree_search(problem, frontier):\n compteur = 0\n stop = False\n frontier.append(Node(problem.initial))\n while frontier and not stop:\n compteur+=1\n node = frontier.pop()\n if problem.goal_test(node.state):\n return node\n if(compteur <= limit):\n ...
[ "0.7009597", "0.6937325", "0.692665", "0.67874473", "0.6780228", "0.6762672", "0.6704603", "0.667238", "0.6515501", "0.65150607", "0.64995253", "0.6450133", "0.6436316", "0.6426377", "0.6425419", "0.6405938", "0.6402316", "0.6398838", "0.63698804", "0.6362112", "0.6345497", ...
0.0
-1
Search the node of least total cost first. " YOUR CODE HERE " util.raiseNotDefined()
def uniformCostSearch(problem): frontier = util.PriorityQueue() #print 'Create frontier' initial_node = node(problem.getStartState(), 0, [], 0)#(state,depth,path_actions,path_cost) frontier.push(initial_node, initial_node.path_cost) #print 'Push ',repr(initial_node.state) frontierSet = set([(in...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _find_lowest_cost_node(self) -> str:\n lowest_cost = float(\"inf\")\n lowest_cost_node = None\n for node in self.costs:\n cost = self.costs[node]\n if cost < lowest_cost and node not in self.closed_nodes:\n lowest_cost = cost\n lowest_cos...
[ "0.7115037", "0.7015215", "0.68897027", "0.68069506", "0.68069506", "0.68069506", "0.6794311", "0.6742301", "0.67333454", "0.6717681", "0.6632536", "0.6536335", "0.6526952", "0.6508806", "0.6500526", "0.6468865", "0.6422282", "0.6421325", "0.63780427", "0.63467866", "0.629742...
0.5857037
51
A heuristic function estimates the cost from the current state to the nearest goal in the provided SearchProblem. This heuristic is trivial.
def nullHeuristic(state, problem=None): return 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def uniformCostSearch(problem):\n # Initialization\n startState = problem.getStartState()\n\n if problem.isGoalState(startState):\n return [] # No action needed\n\n closedSet = set()\n queue = util.PriorityQueue()\n queue.push((startState, None, 0), 0)\n cameFrom = dict() # Stores most ...
[ "0.74263334", "0.7401543", "0.72895956", "0.72838056", "0.7258945", "0.7187053", "0.718194", "0.71579057", "0.7101961", "0.7080719", "0.70694226", "0.70437473", "0.7041541", "0.70369065", "0.7026071", "0.7017246", "0.70020163", "0.6997853", "0.69822514", "0.6965341", "0.69587...
0.0
-1
Recibe dos funciones, g y h, y calcula la suma de g(node) + h(node)
def evaluationFunction(problem, gFunc, hFunc, node): #g = getattr(searchAgents, gFunc) #h = getattr(searchAgents, hFunc) h = hFunc #return g(node) + h(node) return gFunc + h(node, problem)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def f(self):\n return self.g() + self.h()", "def f(inicio,obj):\n return g(inicio,obj)+h(inicio,obj)", "def fn(node):\n if not node: return 0 \n ans = node.val + fn(node.left) + fn(node.right)\n vals.append(ans)\n return ans", "def fn(node):\n ...
[ "0.6507196", "0.64447653", "0.6410389", "0.62614596", "0.62053573", "0.60334754", "0.60026896", "0.5902839", "0.5881443", "0.583312", "0.5824468", "0.5799991", "0.57917106", "0.574026", "0.5740071", "0.5712047", "0.56784934", "0.566337", "0.56031936", "0.5557789", "0.5553447"...
0.6279506
3
Search the node that has the lowest combined cost and heuristic first. " YOUR CODE HERE " util.raiseNotDefined()
def aStarSearch(problem, heuristic=nullHeuristic): frontier = util.PriorityQueue() #print 'Create frontier' initial_state = problem.getStartState() initial_node = node2(initial_state, 0, [], 0 , evaluationFunction(problem, 0, heuristic, initial_state))#(state,depth,path_actions,path_cost,f) fronti...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def uniformCostSearch(problem):\n \"*** YOUR CODE HERE ***\"\n\n #Creamos las estructuras de datos necesarias (priority queue y set)\n openNodes = util.PriorityQueue()\n closedNodes = set([])\n\n #Guardamos el nodo inicial\n node = Node(problem.getStartState(), '', 0, None)\n\n #Calculamos fun...
[ "0.73659074", "0.73442227", "0.7219987", "0.72039545", "0.7113731", "0.71030426", "0.7102521", "0.70941496", "0.7073968", "0.7010176", "0.6995441", "0.6978039", "0.69645333", "0.69589454", "0.68735385", "0.6854137", "0.6828859", "0.6821201", "0.67951506", "0.6792462", "0.6786...
0.6210013
79
Return all guesses for current game
def table(): print "Loading table for game_id=%i" % session["game_id"] # Select all guess belonging to current game_id guesses = datastore.get_guesses_by_game_id(engine, session["game_id"]) guesses = [dict(g) for g in guesses] return json.dumps(guesses)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_guesses(self):\n return self._guesses", "def set_guesses(self, guesses):\r\n # Global remaining_guesses\r\n self.remaining_guesses = guesses\r\n return guesses", "def get_all_games():\n games = brain.get_all_games()\n return games", "def get_atom_guess(self):\r\n ...
[ "0.7330219", "0.66942227", "0.6663961", "0.6574452", "0.617177", "0.6128632", "0.60459024", "0.590868", "0.58174664", "0.5800682", "0.57939863", "0.5788985", "0.5776312", "0.5769167", "0.5761001", "0.57423365", "0.5716191", "0.56667155", "0.5655922", "0.56395376", "0.56329805...
0.6140582
5
Create and print the highscores table
def highscore(): if request.method == "POST": if not request.form.get('hs_name'): name = "Guest" else: name = request.form.get('hs_name') total_guesses = datastore.get_number_guesses(engine, session["game_id"]) highscore_dict = { 'name': name, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def displayHighScore():\r\n compiled_scores = []\r\n all_scores = getScores()\r\n for row in all_scores.splitlines():\r\n compiled_scores += [(row.split()[1], int(row.split()[4])+int(row.split()[7])+\r\n int(row.split()[10])+int(row.split()[13]))]\r\n print(compiled_scores)\r\...
[ "0.7414745", "0.72308785", "0.68478954", "0.679465", "0.6749366", "0.66115713", "0.6525502", "0.6518692", "0.6503384", "0.6458219", "0.63666993", "0.6334345", "0.63275117", "0.6280864", "0.6263369", "0.6242989", "0.6233384", "0.6211079", "0.620052", "0.61437094", "0.6127878",...
0.5861982
37
Send the browser current game_id
def game_id(): # Use new_game method to start a new game session.clear() session["game_id"] = new_game(engine) print "Creating new game with game_id =", session["game_id"] # Redirect to home page return redirect(url_for("index"))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_game_id(self) -> str:\n return self.game_name_entry.get()", "def get_id():\n global UNIQUE_GAME_ID\n with threadLock:\n UNIQUE_GAME_ID += 1\n return str(UNIQUE_GAME_ID)", "def get_game(request):\n active_game = str(uuid4())\n GAMES[active_game] = Board()\n return {'id': ...
[ "0.6809703", "0.64957577", "0.6255549", "0.6174053", "0.6151177", "0.6024761", "0.60214674", "0.5945353", "0.58871055", "0.58468586", "0.5841496", "0.5824861", "0.57907766", "0.57907766", "0.57907766", "0.5699196", "0.5635471", "0.56036437", "0.5601251", "0.55836695", "0.5514...
0.7166306
0
Create the Rules Page
def rules(): print "Loading Rules" return render_template("rules.html")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_page(self):", "def rules():\r\n section = document.add_section()\r\n new_width, new_height = section.page_height, section.page_width\r\n section.orientation = WD_ORIENT.LANDSCAPE\r\n section.page_width = 10058400\r\n section.page_height = 7772400\r\n \r\n document.add_heading('Sys...
[ "0.6795799", "0.6687149", "0.6018615", "0.5847143", "0.57700336", "0.57147", "0.55924845", "0.55044985", "0.5496599", "0.5455442", "0.5424117", "0.53119", "0.5303927", "0.527854", "0.5263613", "0.52636105", "0.52604467", "0.5227407", "0.52262783", "0.52148724", "0.5205535", ...
0.71557677
0
Convert class labels from scalars to onehot vectors.
def dense_to_one_hot(labels_dense, num_classes, nlevels=1): if nlevels == 1: num_labels = labels_dense.shape[0] index_offset = np.arange(num_labels) * num_classes labels_one_hot = np.zeros((num_labels, num_classes), dtype=np.int32) labels_one_hot.flat[index_offset + labels_dense.rave...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def one_hot(labels, classes=None):\n return K.utils.to_categorical(labels, classes)", "def one_hot(labels, classes=None):\n\n one_hot_ = K.utils.to_categorical(labels, classes)\n return(one_hot_)", "def to_onehot(labels: torch.Tensor, num_classes: int) -> torch.Tensor:\n if len(labels.size()) == 1:...
[ "0.8250402", "0.807683", "0.80523187", "0.7977843", "0.7908335", "0.7900327", "0.7892233", "0.7869711", "0.7849721", "0.7849721", "0.7826951", "0.7826122", "0.77677035", "0.7765413", "0.77540547", "0.77540547", "0.77540547", "0.77489346", "0.7742955", "0.7737176", "0.77226317...
0.69248796
99
This is the name you send to the server so your AI will control the player named this string. Returns
def get_name(self): return "Sawyer McLane"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_name(self):\n return self._player_name", "def get_player_name(self):\n return self._player_name", "def get_current_player_name(self) -> str:\n if self.p1_turn:\n return 'p1'\n return 'p2'", "def received_NAME(self, message=None):\n\n\t\tself.player_client.send_m...
[ "0.7067024", "0.7003926", "0.6906294", "0.6905016", "0.68602276", "0.68077594", "0.6742386", "0.66986865", "0.6664352", "0.66285783", "0.65931255", "0.6551399", "0.6527991", "0.65045726", "0.6440934", "0.6370391", "0.6331449", "0.62428254", "0.62001795", "0.6152453", "0.61275...
0.58274114
45
This is called once the game starts and your AI knows its playerID and game. You can initialize your AI here.
def start(self): # store a sign controlling addition or subtraction so pieces move in the right direction self.board = fen_to_position(self.game.fen) self.transposition_table = dict()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start_game(self):\n\n\t\tpass", "def setup_game(self):", "def start_of_game(self):\n pass", "def init_new_game(self):\n self.game = get_new_game(self.game_config)", "def setup_new_game(self):\r\n self._player = Player()\r\n self._stats = GameStats(self._bb_settings)\r\n ...
[ "0.7093916", "0.69200027", "0.6894572", "0.6854116", "0.6843323", "0.68393517", "0.6837224", "0.6759875", "0.674572", "0.66806126", "0.66497874", "0.66377556", "0.66034794", "0.6472428", "0.6470742", "0.6470381", "0.6437939", "0.6389856", "0.6384487", "0.6374792", "0.63615054...
0.0
-1
This is called every time the game's state updates, so if you are tracking anything you can update it here.
def game_updated(self): # replace with your game updated logic self.update_board()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self, new_gameStateData):\r\n pass", "def update_to_state(self, game_state):\n pass", "def get_new_gamestate(self):", "def update(self):\n self._state = 23", "def on_update(self):\n \n # update physics engine\n \n \n # use code from pick up...
[ "0.75261265", "0.7332562", "0.7192848", "0.70910496", "0.7030239", "0.7003825", "0.6927637", "0.6897562", "0.6897173", "0.6893327", "0.6875674", "0.6871669", "0.6867509", "0.68637705", "0.6830196", "0.6736191", "0.67268544", "0.6650383", "0.66365564", "0.65965307", "0.6595332...
0.70569086
4
This is called when the game ends, you can clean up your data and dump files here if need be.
def end(self, won, reason): pass # replace with your end logic
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def endGame(self):\n pass", "def cleanup(self):\n pygame.quit()", "def on_cleanup(self):\n\n pygame.quit()", "def endGame(self):\n #self.active = False\n self.inGame = False\n self.hand = []\n self.position = None", "def end(self):\n self.flush()\n\n ...
[ "0.72539777", "0.6952289", "0.69519925", "0.6878009", "0.68207854", "0.6813252", "0.67674804", "0.6745981", "0.673788", "0.6642584", "0.6633985", "0.6611609", "0.65998083", "0.65976155", "0.6576002", "0.65720123", "0.65720123", "0.65720123", "0.65720123", "0.6571177", "0.6541...
0.0
-1
This is called every time it is this AI.player's turn.
def run_turn(self): # Here is where you'll want to code your AI. # We've provided sample code that: # 1) prints the board to the console # 2) prints the opponent's last move to the console # 3) prints how much time remaining this AI has to calculate moves # ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def after_turn(self):\n pass", "def update_turn(self):\n pass", "def turn(self):\n pass", "def begin_turn(self):\n pass", "def before_turn(self, playerInfo):\n self.PlayerInfo = playerInfo", "def game_play(self):", "def update(self):\n if self.game_over is Fals...
[ "0.8103139", "0.7902608", "0.7458108", "0.74227875", "0.73815614", "0.7210144", "0.7192933", "0.70859003", "0.7076296", "0.69854105", "0.6980166", "0.6939931", "0.689809", "0.6850924", "0.6807229", "0.67867386", "0.6776053", "0.67710686", "0.67556757", "0.67321014", "0.671230...
0.6611153
25
Prints the current board using pretty ASCII art
def print_current_board(self): # iterate through the range in reverse order for r in range(9, -2, -1): output = "" if r == 9 or r == 0: # then the top or bottom of the board output = " +------------------------+" elif r == -1: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_board(self):\n \n # How to show empty/p1/p2\n VALS = \".XO\"\n\n print(\"\\n a b c d e f g\")\n print(\" /--+-+-+-+-+-+--\\\\\")\n for r in range(_HEIGHT - 1, -1, -1):\n s = \"%s |\" % r\n for c in range(_WIDTH):\n # Print...
[ "0.851931", "0.84250176", "0.8418486", "0.83428967", "0.83105963", "0.82872576", "0.82647777", "0.8239299", "0.82173115", "0.8205632", "0.81975603", "0.81975603", "0.8193796", "0.8181888", "0.8174004", "0.8171793", "0.813972", "0.8139469", "0.8138493", "0.8132298", "0.8110198...
0.7858797
49
Find consecutive straight segments in this path that could be combined without loss into a single segment.
def fuse(self): # TODO: Don't fuse unless they have None as the end slants? i = 0 while i < len(self.segments) - 1: left = self.segments[i] right = self.segments[i + 1] if ( isinstance(left, LineSegment) and isinstance(right, Li...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def segments(self):\n L = len(self.vertices)\n return itertools.chain((self._subset((i,i+1)) for i in range(len(self)-1)),\n (self._subset((L-1,0)),))", "def segments(self):\n return (self._subset((i,i+1)) for i in range(len(self)-1))", "def getSegments(points...
[ "0.66591966", "0.6500738", "0.63225794", "0.62119174", "0.6040749", "0.5867619", "0.58576113", "0.58499837", "0.5784824", "0.57444483", "0.56786495", "0.56731826", "0.5599665", "0.55945885", "0.55617756", "0.5561163", "0.5559855", "0.55383956", "0.5516233", "0.5511012", "0.54...
0.55360854
18
Split segments into continuous runs of the same color.
def group_segments(segments): group = [] for seg in segments: if not group: group.append(seg) continue last_seg = group[-1] if ( seg.color == last_seg.color and points_equal(last_seg.b, seg.a) ): group.append(seg) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def split_segments(old_seg_ends, B):\n new_segment_ends = []\n for q in range(0, B.size):\n new_ends = list(np.linspace(old_seg_ends[q], old_seg_ends[q + 1], B[q] + 1))\n new_segment_ends.extend(new_ends[:-1])\n new_segment_ends.extend([1])\n new_segment_ends = np.asarray(new_segment_ends...
[ "0.6517769", "0.59771734", "0.5971747", "0.58473897", "0.5816569", "0.569773", "0.5664909", "0.5612116", "0.5564599", "0.55312043", "0.55094224", "0.5504251", "0.550151", "0.5499465", "0.54803205", "0.54728925", "0.5412093", "0.541105", "0.5402969", "0.54021615", "0.54021615"...
0.66077226
0
Submit job to compute the PageRank for each vertex in the graph. Return an object that tracks the execution of this job, from which a model with total PageRank as well as the PageRank value for each vertex in the graph is obtained.
def submit_training_job(env, graph, reset_probability=0.15, threshold=1e-2, max_iterations=20, _single_precision=False): _mt._get_metric_tracker().track('distributed.toolkit.graph_analytics.pagerank.submit_training_job') if not isinstance(graph, _SGraph): raise TypeError('graph input must b...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pagerank(self, alpha=0.85):\n try:\n self.logger.info('正在计算网络的PageRank值 ...')\n return self.order_dict(nx.pagerank(self.G, alpha=alpha), index=1)\n except Exception as e:\n self.logger.error(\"计算失败,原因:{0}\".format(e))", "def rank(self):\n return self.lib....
[ "0.54880756", "0.5422568", "0.53424877", "0.53228563", "0.53124905", "0.5295266", "0.5288873", "0.5284805", "0.52695876", "0.52413964", "0.52405745", "0.5168447", "0.5134135", "0.51277477", "0.51068217", "0.51020676", "0.5087875", "0.50740635", "0.5036986", "0.5033597", "0.50...
0.5994397
0
Initialize the model by setting up the layers.
def __init__(self, vocab_size, output_size, embedding_dim, hidden_dim, n_layers, drop_prob=0.7): super(SentimentLSTM, self).__init__() self.output_size = output_size self.n_layers = n_layers self.hidden_dim = hidden_dim # define all layers self.embed = nn.Embedding(voc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _init_layers(self):\n self._init_predictor()\n if self.use_edge_fusion:\n self._init_edge_module()", "def initialisation(self):\n self.create_variables()\n self.create_placeholders()\n self.build_model()\n self.reset_lr(None, True)\n self.build_loss...
[ "0.7877656", "0.740135", "0.73939556", "0.73799825", "0.72304994", "0.72242755", "0.7183698", "0.7181406", "0.7175707", "0.71491647", "0.70773673", "0.70694804", "0.7036073", "0.70194495", "0.7018242", "0.69936645", "0.6969751", "0.6949472", "0.69274527", "0.6899944", "0.6853...
0.0
-1
Perform a forward pass of our model on some input and hidden state.
def forward(self, x, hidden): batch_size=x.shape[0] x = self.embed(x) x,hidden = self.lstm(x,hidden) x = x.reshape(-1,self.hidden_dim) x = self.drp(x) x = self.fc(x) sig_out = self.sigmoid(x) # return last sigmoid output and hidden state sig...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def forward(self, inputs):\r\n #print (len(inputs))\r\n out = self.fc1(inputs)\r\n out = self.fc2(out)\r\n self.out = out\r\n return out\r\n #raise NotImplementedError('Implement the forward method of the model')\r", "def forward(self, input, context, state):\n ra...
[ "0.7144421", "0.70364195", "0.69690675", "0.69690675", "0.68682665", "0.68450403", "0.67740935", "0.6690039", "0.6672467", "0.6671088", "0.6670328", "0.66681725", "0.66594464", "0.665689", "0.6632595", "0.661052", "0.6605397", "0.660232", "0.6586977", "0.65848726", "0.6565298...
0.0
-1
print a debug message.
def debug(msg): if settings.DEBUG: print "DEBUG: cli.%(msg)s" % locals()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dprint(msg):\n if defaults.debug:\n print('debug: %s' % msg)", "def _debug_print(message):\n\n if _debug == True:\n print(message)", "def printdebug(self, msg):\n if self.debug > 0:\n print(msg)", "def d_print(msg):\n if (DEBUG == 1):\n print(msg)", "def ...
[ "0.86299926", "0.85264397", "0.84670085", "0.8435838", "0.842028", "0.8332297", "0.8256643", "0.82519853", "0.8235172", "0.80953634", "0.80705374", "0.79883015", "0.7953402", "0.7906601", "0.7904004", "0.7879282", "0.7858162", "0.7844527", "0.7810031", "0.7779488", "0.7724507...
0.7721042
21
accept a list of fields (field_list), then print out the results from the query.
def cli_print_record( field_list, showid=False): debug("cli_print_record(%s)" % field_list) try: raw_record_list = api.find_records(field_list) except NoRecordsFound as error: print "No records found for: %(field_list)s, %(error)s" % locals() return False except InvaildQuery as ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_some(self,table,field_list,**query_dict):\n start_sql = 'SELECT '\n sql = ''\n query_sql = ''\n for field in field_list: start_sql += field + ',' \n start_sql = start_sql[0:-1] + ' FROM %s WHERE ' % (table)\n try:\n if query_dict:\n for i...
[ "0.6308946", "0.62454486", "0.6072988", "0.598985", "0.5895528", "0.58903146", "0.5818416", "0.57984674", "0.57883525", "0.57729805", "0.57577854", "0.5754459", "0.57458764", "0.5735312", "0.5730177", "0.5688709", "0.56719226", "0.56098896", "0.5580909", "0.55553097", "0.5553...
0.7122904
0
accept a list of fields (field_list), then print out the results from the query.
def cli_add_record(record_data): new_record = None try: new_record = api.insert_record( record_data) except DuplicateRecord as error: debug("%(error)s" % locals()) print "Adding new record failed. %(error)s" % locals() return None except MissingRequiredInformaton as error...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cli_print_record( field_list, showid=False):\n debug(\"cli_print_record(%s)\" % field_list)\n try:\n raw_record_list = api.find_records(field_list)\n except NoRecordsFound as error:\n print \"No records found for: %(field_list)s, %(error)s\" % locals() \n return False\n except ...
[ "0.7121829", "0.630951", "0.62429637", "0.60731196", "0.5989517", "0.58978397", "0.5892057", "0.58181995", "0.5800399", "0.578763", "0.5774708", "0.5759425", "0.57542586", "0.5747046", "0.5735611", "0.5729593", "0.5691055", "0.56684303", "0.56089723", "0.55834615", "0.5556900...
0.0
-1
accept a list of fields (field_list), and delete all the records that the query matches.
def cli_delete_record(field_list): try: api.delete_record(field_list) except NoRecordsFound as error: print "%(error)s" % locals() return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def delete_records(self, table_name: str, conditions_list=None):\n if conditions_list:\n conditions = LemkPgUtils.get_conditions(conditions_list)\n query = f\"\"\"DELETE FROM {table_name} WHERE {\" \".join(conditions)}\"\"\"\n else:\n query = f\"\"\"DELETE FROM ...
[ "0.6383642", "0.62998796", "0.62411", "0.61262584", "0.6087179", "0.60596013", "0.59672195", "0.5961191", "0.59508616", "0.5862673", "0.5853231", "0.58176136", "0.57552975", "0.5755074", "0.57523143", "0.57236516", "0.5698125", "0.56866366", "0.56681955", "0.5665122", "0.5658...
0.710338
0
accept a field_list and record_data. All records that match the queries in field_list will be updated with record_data.
def cli_update_record(field_list, record_data): api.update_record(field_list, record_data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _update(self, data: Dict[str, Any], fields_to_modify: List[str]):\n pass", "def update_records(self, records, data):\n if not records or not len(records):\n raise Exception(\"records should not be null\")\n elif type(records) != list:\n raise Exception(\n ...
[ "0.67938155", "0.6716241", "0.6430248", "0.6369891", "0.6217489", "0.6074803", "0.6074803", "0.60155153", "0.6004583", "0.59513104", "0.58645195", "0.58612293", "0.5861092", "0.5852638", "0.57965606", "0.5770256", "0.5687764", "0.5644667", "0.5629939", "0.5596801", "0.5596036...
0.7923878
0