query
stringlengths
9
9.05k
document
stringlengths
10
222k
metadata
dict
negatives
listlengths
30
30
negative_scores
listlengths
30
30
document_score
stringlengths
4
10
document_rank
stringclasses
2 values
write the assembly code that is the translation of "push static index " command
def push_static_segment(self, index): label = self.__cur_filename + "." + str(index) self.value_to_d(label) self.push_d_to_stack() # self.write("@" + self.__cur_filename + "." + str( # index) + "\nD=M\n@" + str( # index) + "\nA=D+A\nD=M\n@SP\nA=M\nM=D\n@SP\nM=M+1\...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def push_command(self, segment, index):\n if segment == \"constant\":\n self.push_constant_segment(index)\n if segment in CodeWriter.segments:\n self.push_lcl_arg_this_that_segments(\n CodeWriter.segments.get(segment), index)\n if segment == \"temp\" or seg...
[ "0.668529", "0.6558973", "0.65578336", "0.6318722", "0.6243088", "0.5947952", "0.5910139", "0.5908968", "0.5861579", "0.57764864", "0.5717023", "0.5671633", "0.56115663", "0.5542587", "0.54160666", "0.5389698", "0.53755105", "0.5359938", "0.53435194", "0.5343007", "0.5335252"...
0.6616193
1
write the assembly code that is translation of "push (pointer\temp) index" command
def push_pointer_temp_segments(self, segment, index): if segment == "temp": ram_address = str(index + 5) self.write( # @place //point to ram[i+5] # D=M // put value in D # @SP // look at SP # A=M // Put number of SP in A ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_push_pop(self, command: VMCommandType.C_PUSH or VMCommandType.C_POP, segment: str, index: int) -> None:\n index = str(index)\n self._write(f\"//{command.name} {segment} {index}\")\n if command == VMCommandType.C_PUSH:\n\n if segment in ['local', 'argument', 'this', 'that']...
[ "0.6573817", "0.65685195", "0.6423772", "0.6379691", "0.6358366", "0.6309137", "0.62252474", "0.6093906", "0.6054042", "0.6043883", "0.59830177", "0.595141", "0.5902289", "0.58915156", "0.5871431", "0.58686185", "0.5814998", "0.5804932", "0.57944924", "0.5701942", "0.56958544...
0.67953604
0
write the assembly code that is the translation of "pop static index" command
def pop_static_segment(self, index): label = self.__cur_filename + "." + str(index) self.pop_stack_to_d() self.d_to_value(label) # self.write( # "@" + self.__cur_filename + "." + str(index) + "\nD=M\n@" + # str(index) + # "\nD=D+A\n@R13\nM=D\n@SP\nAM=M...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_push_pop(self, command, segment, index):\n\n seg_code, asm_code = PushPopCodes.CONVERSION[command][segment] # [compute_index]\n if any([segment == global_ for global_ in ('static', 'constant', 'temp', 'pointer')]):\n seg_code = GlobalSegment.converter(segment, index)\n ...
[ "0.68993485", "0.6449726", "0.6443823", "0.6150595", "0.6034826", "0.5951294", "0.5877844", "0.5685986", "0.5525963", "0.5426329", "0.5334026", "0.53265184", "0.5310511", "0.52294725", "0.5206164", "0.5159241", "0.5154673", "0.5145686", "0.51342005", "0.51110196", "0.50899047...
0.6477412
1
Writes assembly to push number saved in label to stack
def push_address(self, label): self.address_to_d(label) self.push_d_to_stack()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def push(stack,number):\n stack.append(number)", "def _push(register):\n ucode = assemble(SET, PUSH, Z)\n ucode += assemble(SET, Z, register)\n return ucode", "def instruction_push(self, value):\n if Vm.is_register(value):\n value = self.get_register(value)\n\n self.stack_p...
[ "0.6334154", "0.62551993", "0.62171286", "0.61944693", "0.61450493", "0.6103678", "0.61017627", "0.60808253", "0.60588753", "0.60146135", "0.60002327", "0.5988384", "0.5759573", "0.57279927", "0.57174927", "0.57174927", "0.5709555", "0.5681906", "0.568143", "0.56755507", "0.5...
0.64812756
0
verify that cochranebot is retrieving all included, excluded and relevant trials tested against manually gathered data
def test_cochranebot(self): ec = Client() with open('data/trialpubs_rtrial.csv', 'rb') as csvfile: spamreader = csv.reader(csvfile) for row in spamreader: article = ec.efetch(db='pubmed', id=row[1]) for a in article: crud.pubmed...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_results(self):\n pass", "def test_fetch_related_data_valid(self):\n resp = requests.post(\n _CONF[\"re_api_url\"] + \"/api/v1/query_results\",\n params={\"stored_query\": \"ws_fetch_related_data\", \"show_public\": True},\n data=json.dumps({\"obj_key\":...
[ "0.6251158", "0.6026952", "0.60217386", "0.6013398", "0.6011575", "0.59491897", "0.59455425", "0.5874486", "0.5853005", "0.5841487", "0.58099294", "0.5804872", "0.5802371", "0.57827616", "0.5781016", "0.5778916", "0.5778653", "0.5764293", "0.5747267", "0.57386076", "0.5735272...
0.71222466
0
Computes a mask of artifacts found in the air region
def artifact_mask(imdata, airdata, distance, zscore=10.): from statsmodels.robust.scale import mad if not np.issubdtype(airdata.dtype, np.integer): airdata[airdata < .95] = 0 airdata[airdata > 0.] = 1 bg_img = imdata * airdata if np.sum((bg_img > 0).astype(np.uint8)) < 100: ret...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mask_image(image):\n pass", "def _build_multiband_mask(data, tractor, filt2pixscale, fill_value=0.0,\n threshmask=0.01, r50mask=0.05, maxshift=10,\n relmaxshift=0.1,\n sigmamask=3.0, neighborfactor=1.0, verbose=False):\n imp...
[ "0.6451196", "0.64490503", "0.6387833", "0.6377713", "0.635505", "0.6348255", "0.6184203", "0.617509", "0.6136588", "0.61225694", "0.60633063", "0.5996967", "0.5992219", "0.597716", "0.597716", "0.5929597", "0.5926675", "0.59101397", "0.5898637", "0.5898637", "0.5898637", "...
0.6544685
0
Return the optimized quantum kernel object.
def quantum_kernel(self) -> TrainableKernel | None: return self._quantum_kernel
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def quantum_kernel(self) -> TrainableKernel:\n return self._quantum_kernel", "def kernel(self):\n return self._kernel", "def kernel(self):\n\n return self._kernel", "def quantum_kernel(self, quantum_kernel: TrainableKernel) -> None:\n self._quantum_kernel = quantum_kernel", "def...
[ "0.77661026", "0.6382727", "0.61703086", "0.61265665", "0.5892582", "0.57897985", "0.57752", "0.57335687", "0.5599768", "0.5597967", "0.5591809", "0.5577554", "0.5574917", "0.5522982", "0.5521412", "0.5514417", "0.5483699", "0.54347056", "0.5406137", "0.54044884", "0.53846866...
0.77061915
1
Return the quantum kernel object.
def quantum_kernel(self) -> TrainableKernel: return self._quantum_kernel
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def quantum_kernel(self) -> TrainableKernel | None:\n return self._quantum_kernel", "def kernel(self):\n return self._kernel", "def kernel(self):\n\n return self._kernel", "def quantum_kernel(self, quantum_kernel: TrainableKernel) -> None:\n self._quantum_kernel = quantum_kernel",...
[ "0.82963735", "0.7117556", "0.6965454", "0.667391", "0.65745264", "0.6378804", "0.6344309", "0.6320058", "0.6210617", "0.61182547", "0.6078536", "0.593486", "0.58818907", "0.5868996", "0.5858175", "0.5833624", "0.58220917", "0.5813135", "0.5605837", "0.55729353", "0.5556427",...
0.84323263
0
Set the quantum kernel.
def quantum_kernel(self, quantum_kernel: TrainableKernel) -> None: self._quantum_kernel = quantum_kernel
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def quantum_kernel(self) -> TrainableKernel:\n return self._quantum_kernel", "def quantum_kernel(self) -> TrainableKernel | None:\n return self._quantum_kernel", "def kernel(self, kernel):\n self._context[\"kernel\"] = kernel", "def quantum(self):\n return self._quantum", "def k...
[ "0.6779304", "0.66138345", "0.5853848", "0.55402267", "0.5477815", "0.5475737", "0.5475342", "0.54662347", "0.5443568", "0.536306", "0.5348736", "0.52818775", "0.52370477", "0.5214639", "0.5214639", "0.5195658", "0.51934177", "0.5168066", "0.51556057", "0.51505375", "0.513924...
0.8328942
0
Set the initial point
def initial_point(self, initial_point: Sequence[float] | None) -> None: self._initial_point = initial_point
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_initial_point(self, point):\r\n return self._studio.set_initial_point(point)", "def SetInitialPoints(self, x0, radius=0.05):\n raise NotImplementedError, \"must be overwritten...\"", "def setPoint(self,set_point):\n self.set_point = set_point\n self.Integrator=0\n sel...
[ "0.8223448", "0.73401177", "0.7077025", "0.7077025", "0.70066893", "0.6990482", "0.6990482", "0.6990482", "0.696648", "0.6952676", "0.6918243", "0.6882875", "0.6882875", "0.6882875", "0.6861304", "0.6845189", "0.6838384", "0.6829357", "0.67497885", "0.66675735", "0.6647039", ...
0.8324846
0
Train the QuantumKernel by minimizing loss over the kernel parameters. The input quantum kernel will not be altered, and an optimized quantum kernel will be returned.
def fit( self, data: np.ndarray, labels: np.ndarray, ) -> QuantumKernelTrainerResult: # Number of parameters to tune num_params = len(self._quantum_kernel.training_parameters) if num_params == 0: msg = "Quantum kernel cannot be fit because there are no use...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def train(self):\n learning_rate = tf.train.exponential_decay(self.learning_rate, self.global_step, self.decay_steps,self.decay_rate, staircase=True)\n self.learning_rate_=learning_rate\n #noise_std_dev = tf.constant(0.3) / (tf.sqrt(tf.cast(tf.constant(1) + self.global_step, tf.float32))) #gra...
[ "0.59873915", "0.59490603", "0.5915985", "0.5883994", "0.58273995", "0.5799081", "0.5763309", "0.5750903", "0.57495004", "0.5748005", "0.5747231", "0.5747231", "0.57468843", "0.5728521", "0.5699693", "0.5689149", "0.5687", "0.5682753", "0.5675334", "0.5672981", "0.5670131", ...
0.7239004
0
Function which maps strings to default KernelLoss objects.
def _str_to_loss(self, loss_str: str) -> KernelLoss: if loss_str == "svc_loss": loss_obj = SVCLoss() else: raise ValueError(f"Unknown loss {loss_str}!") return loss_obj
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def define_loss(name_loss):\n call_dict = {\n \"pixel_weighted_cross_entropy\": pixel_weighted_cross_entropy,\n \"MeanSquaredLogarithmicError\": tf.keras.losses.MeanSquaredLogarithmicError(),\n \"MeanAbsolutePercentageError\": tf.keras.losses.MeanAbsolutePercentageError(),\n \"MeanSq...
[ "0.62653315", "0.60764617", "0.58024836", "0.5724632", "0.57098025", "0.5663101", "0.5659429", "0.55111545", "0.5438147", "0.5395816", "0.5377557", "0.532755", "0.52873075", "0.52296346", "0.52212906", "0.5209717", "0.5169079", "0.5089147", "0.5080287", "0.506357", "0.4992839...
0.6825977
0
Load information of printers from printers_info.json for special printers (laserjet, ...) and from CouchDB
def load_printers_info(self, ssid = "", passwd = ""): system_cfg = ma_misc.load_system_config_file() pp_info = system_cfg["printer_power_config"] # Load printer from printer_config.json if it exist printers_info = [] if os.path.exists(ma_misc.get_abs_path("/config/printers_info.j...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def _fetch_data(self) -> PrinterInfo:\n return await self.api.get_printer()", "def __load_printers_screen(self):\n self.fc.flow_load_home_screen(skip_value_prop=True)\n self.home.load_printer_selection()", "def PapersFile(filename, researchers=None):\n try:\n with open(file...
[ "0.5886019", "0.5772695", "0.5620251", "0.5428073", "0.5381602", "0.5158986", "0.5073214", "0.5033829", "0.5021244", "0.50189716", "0.49738154", "0.49445233", "0.49212605", "0.48765582", "0.48641178", "0.48359078", "0.48205912", "0.47603965", "0.4747563", "0.47434998", "0.473...
0.64852726
0
Inserts atomically the given product in the database only if it does not exist.
def insert(self, product): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_product(self, store, product):\n self.db.query(\"\"\"\n INSERT IGNORE INTO product_store(product_id, store_id)\n VALUES (:product_id, :store_id)\n \"\"\", product_id=product.id, store_id=store.id)", "def insert_product(conn: Connection, cursor: Cursor, product: Product...
[ "0.74688303", "0.70980644", "0.6952994", "0.67361945", "0.6712165", "0.6595917", "0.64493", "0.64490354", "0.632292", "0.63119054", "0.61918914", "0.6176982", "0.61756736", "0.6115685", "0.60971236", "0.597233", "0.59058416", "0.5890329", "0.5874489", "0.5797417", "0.5796033"...
0.7480517
0
Get list of all uppercase, nonprivate globals (doesn't start with ``_``).
def get_all_constants(): return filter( lambda key: key.upper() == key and type(globals()[key]) in _ALLOWED, filter( # filter _PRIVATE variables lambda x: not x.startswith("_"), globals() ) )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_global_variable_names(self):\n return [b\"\".join(_i).strip().decode()\n for _i in self._f.variables[\"name_glo_var\"][:]]", "def names(self):\n if not self.extensions:\n self.discover()\n\n names = list(self.builtins.keys())\n names += self.extension...
[ "0.65987283", "0.6519283", "0.64087915", "0.6397711", "0.6282579", "0.6149311", "0.61121523", "0.6107066", "0.6086508", "0.6046856", "0.600155", "0.59877175", "0.59594077", "0.5946974", "0.58663285", "0.5837615", "0.58037347", "0.5791912", "0.57640016", "0.5758467", "0.575098...
0.72972983
0
Check if given value is a nested dict. Return to DictToObj to make next key if it is, otherwise return value. Accepts value as any type.
def depth_wrap(self, value): return DictToObj(**value) if isinstance(value, dict) else value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_dict(value):\n return isinstance(value, dict)", "def _is_dict(val):\n\n return isinstance(val, dict)", "def find_and_normalize(value):\n if isinstance(value, dict):\n # if value is a dictionary, try to normalize the values\n return {k: normalize_dict_value(v) for k, v in value.i...
[ "0.62922126", "0.59196603", "0.5886212", "0.58830994", "0.58311015", "0.58263195", "0.58061564", "0.5683668", "0.56683624", "0.5626282", "0.5559164", "0.55487156", "0.55349225", "0.54663247", "0.5459389", "0.5430812", "0.53931975", "0.5360564", "0.5348292", "0.53209615", "0.5...
0.7465929
0
Plots modelled vs fact values, prediction intervals and anomalies
def plotModelResults(model, X_train=X_train, X_test=X_test, plot_intervals=False, plot_anomalies=False): prediction = model.predict(X_test) plt.figure(figsize=(15, 7)) plt.plot(prediction, "g", label="prediction", linewidth=2.0) plt.plot(y_test.values, label="actual", linewidth=2.0) plt.draw() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_observed_predictions(self):\n \n # Plot of X vs Y\n fig = plt.figure(figsize=(15,5))\n plt.subplot(1,3,1) \n for k in self.phd_filter['estimated_positions'].keys():\n plt.plot(self.phd_filter['estimated_positions'][k][0], self.phd_filter['estimated_positions'...
[ "0.72141445", "0.7094132", "0.7083906", "0.7031311", "0.6946831", "0.6926368", "0.68594", "0.68517894", "0.6832782", "0.6826498", "0.68244064", "0.680611", "0.67760015", "0.67683166", "0.67379886", "0.6681417", "0.6677499", "0.6674758", "0.6661941", "0.6638399", "0.66133505",...
0.7127247
1
Plots sorted coefficient values of the model
def plotCoefficients(model): coefs = pd.DataFrame(model.coef_, X_train.columns) coefs.columns = ["coef"] coefs["abs"] = coefs.coef.apply(np.abs) coefs = coefs.sort_values(by="abs", ascending=False).drop(["abs"], axis=1) plt.figure(figsize=(15, 7)) plt.title('sorted coefficient values of the mo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_param_coef(model, kind = 'barh', figsize = (10,5)):\n \n ## Getting coefficients as a Series\n params = model.params[1:]\n params.sort_values(inplace=True)\n\n plt.figure(figsize=figsize) # Used if large number of params\n ax = params.plot(kind=kind)\n ax.axvline()\n ax.set_xlabel('Co...
[ "0.6950986", "0.6653416", "0.6442287", "0.6432601", "0.6198331", "0.6052277", "0.60361195", "0.5943452", "0.59333116", "0.59144074", "0.59040105", "0.5879166", "0.58561134", "0.57948273", "0.5781439", "0.57497084", "0.5747465", "0.56771994", "0.5662481", "0.5582474", "0.55717...
0.81056565
0
Redirect unauthorized users to Login page
def unauthorized(): flash("You must be logged in to view that page.") return redirect(url_for("auth.login_view"))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deny_access():\n flash('You must login first.')\n return redirect(url_for('home'))", "def unauthorized():\n #flash('You must be logged in to view that page.')\n return redirect(url_for('login'))", "def unauthorized():\n flash('You must be logged in to view that page.', 'warning')\n return...
[ "0.7885277", "0.7828317", "0.7790391", "0.7782898", "0.7733388", "0.7565648", "0.74400365", "0.74228525", "0.7286238", "0.72427565", "0.7149471", "0.71421796", "0.7074911", "0.70560527", "0.6910923", "0.68940735", "0.6820885", "0.681096", "0.681096", "0.681096", "0.6777992", ...
0.7946542
0
Return the default root to browse for work files.
def work_root(session): return session["AVALON_WORKDIR"]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def root(self):\n return self.paths.root", "def getRootDirectory(self):\n if Globals.WORKFLOWS_BASEDIR[0] == '~':\n return os.path.expanduser(Globals.WORKFLOWS_BASEDIR)\n else:\n return os.path.join('', Globals.WORKFLOWS_BASEDIR)", "def getRootFolder():\n return CURREN...
[ "0.7114813", "0.71028745", "0.703575", "0.694814", "0.6931757", "0.6906329", "0.6878669", "0.6863175", "0.68568075", "0.68493104", "0.68395", "0.6827026", "0.67757815", "0.67136824", "0.67033213", "0.6702037", "0.6661972", "0.6661776", "0.66499364", "0.663676", "0.66359705", ...
0.738596
0
Download latest data from djay's repo and save as CSV and parquet
def download_data_and_save(): url = 'https://github.com/djay/covidthailand/wiki/combined.csv' s=requests.get(url).content global df global last_updated df=pd.read_csv(io.StringIO(s.decode('utf-8')), parse_dates= ['Date']) df.to_parquet(file_name, compression='UNCOMPRESSED') df.to_csv('jaydata.csv') last...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def download_entire_db(storage_path=DEFAULT_STORAGE,\n remove_previous=True,\n return_df=False,\n return_latest_date=False,\n write=['feather']):\n # first check if we have the latest data\n if not os.path.exists(stor...
[ "0.63299006", "0.621378", "0.6141003", "0.5992171", "0.5946401", "0.59386027", "0.59314555", "0.5892599", "0.5807861", "0.5783493", "0.57541656", "0.5749618", "0.5723117", "0.57158256", "0.5700869", "0.5681727", "0.567026", "0.5659256", "0.5641617", "0.56213766", "0.55987954"...
0.7693024
0
Test Location.label_loc with absolute GPS statistical features enabled.
def test_labelloc_withabsolutegpsstatisticalfeatures(self): # arrange # Set up config object: test_config = Config(description='test') test_config.fftfeatures = 0 test_config.gen_gps_abs_stat_features = True test_config.samplesize = 10 # Create location object ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_labelloc_noabsolutegpsstatisticalfeatures(self):\n\n # arrange\n # Set up config object:\n test_config = Config(description='test')\n\n test_config.fftfeatures = 0\n test_config.gen_gps_abs_stat_features = False\n test_config.samplesize = 10\n\n # Create lo...
[ "0.82587284", "0.5913708", "0.586609", "0.5829915", "0.58048755", "0.5758274", "0.5751892", "0.57459646", "0.5734637", "0.56580013", "0.56200325", "0.55770975", "0.5560992", "0.5535244", "0.5496505", "0.5414507", "0.5376598", "0.53615177", "0.53532636", "0.5336349", "0.533139...
0.817451
1
Test Location.label_loc with absolute GPS statistical features DISABLED.
def test_labelloc_noabsolutegpsstatisticalfeatures(self): # arrange # Set up config object: test_config = Config(description='test') test_config.fftfeatures = 0 test_config.gen_gps_abs_stat_features = False test_config.samplesize = 10 # Create location object t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_labelloc_withabsolutegpsstatisticalfeatures(self):\n\n # arrange\n # Set up config object:\n test_config = Config(description='test')\n\n test_config.fftfeatures = 0\n test_config.gen_gps_abs_stat_features = True\n test_config.samplesize = 10\n\n # Create l...
[ "0.76650965", "0.59771025", "0.59456563", "0.57202727", "0.5714992", "0.55983496", "0.557157", "0.55456287", "0.54897755", "0.5459754", "0.5446841", "0.5408201", "0.5403587", "0.5363416", "0.5292578", "0.523019", "0.5227264", "0.5206462", "0.51974165", "0.5189523", "0.5180746...
0.8145983
0
Initialize the omelet class to default to a cheese omelet
def __init__(self, kind = "cheese"): self.kind = kind return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init___0(self, material, pot):\n super(CraftFlowerPot, self).__init__(material)\n self.pot = pot", "def __init__(self):\n self.weapon = Weapon()\n self.armor = Armor()", "def __init__(self, **kws):\n super(ShadowOE, self).__init__(**kws)\n self_repair_oe(self)\n ...
[ "0.6135666", "0.61161035", "0.6110623", "0.60414153", "0.60340273", "0.60114837", "0.60032016", "0.5991832", "0.5981804", "0.598039", "0.597246", "0.59713155", "0.59690803", "0.59690803", "0.59690803", "0.59690803", "0.59690803", "0.59690803", "0.59690803", "0.59690803", "0.5...
0.66496104
0
copy online network to target network, peroidic
def sync_target_network(self): for t, e in zip( self.target_network.trainable_variables, self.online_network.trainable_variables ): t.assign(e)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def copy_network(source_net):\n return make_net_model({\"id\": source_net.id,\n \"subnets\": source_net.subnets,\n \"ports\": source_net.ports,\n \"tenant_id\": source_net.tenant_id,\n \"mtu\": source_net.mtu...
[ "0.70412326", "0.6334663", "0.62573373", "0.6223805", "0.60759014", "0.6038528", "0.59680825", "0.58896947", "0.5827701", "0.5781734", "0.57366914", "0.5725397", "0.5721637", "0.5701984", "0.5684228", "0.5659789", "0.56411946", "0.56411946", "0.5637547", "0.56332433", "0.5585...
0.64003277
1
Initializing the item name, tier, and size of each item
def __init__(self, name_i, tier, size): self.name_i = name_i self.tier = tier self.size = size
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_items(self):\r\n raise NotImplementedError()", "def Initialize(self):\r\n # Get the inventory out of our data, and put into our list\r\n self.inventory = []\r\n \r\n # For each selling group\r\n for group_key in self.data:\r\n group_name = self.data[group_key].get('name', 'Unk...
[ "0.6605062", "0.65770495", "0.6542128", "0.64269257", "0.6422978", "0.6383543", "0.6322213", "0.6140014", "0.6109038", "0.606267", "0.60554284", "0.6041834", "0.6036873", "0.60288185", "0.6019083", "0.6014715", "0.6014715", "0.60133576", "0.6002917", "0.59948486", "0.5969228"...
0.71958584
0
Printing a label showing the items attributes
def item_label(self): label_to_print = ("\nYou have selected " + self.name_i + " in tier " + str(self.tier) + ".") return label_to_print
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_attr(self):\n return \"name : {0}\\nprice : {1}\\ndescription : {2}\".format(\n self.name, self.price, self.description\n )", "def display(self):\n # type: ()->None\n print('============')\n for key, value in self._ifAttributes.items():\n if isin...
[ "0.7061089", "0.6969736", "0.69504136", "0.69041467", "0.6752261", "0.67401075", "0.67064905", "0.66495377", "0.6613585", "0.6569877", "0.6564885", "0.65612376", "0.65490896", "0.64934504", "0.647834", "0.6471152", "0.6442141", "0.6442141", "0.6389373", "0.6364043", "0.634070...
0.7303143
0
Initializing the store name and items within it
def __init__(self, name_s, items_in_store): self.name_s = name_s self.items_in_store = items_in_store
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n self.store_list = []\n self.store_dict = {}", "def __init__(self):\n self.store = {}", "def __init__(self):\n self.store = []", "def load(self, *args, **kwargs):\r\n for store_attr in self.__store_attrs__:\r\n setattr(self, store_attr, {})",...
[ "0.75381166", "0.7047941", "0.6938934", "0.6681717", "0.6678482", "0.6434165", "0.63803244", "0.6212124", "0.61939925", "0.61879385", "0.61879385", "0.61879385", "0.61084527", "0.60860556", "0.5996445", "0.5975856", "0.5972399", "0.59704316", "0.596472", "0.59624475", "0.5954...
0.75853765
0
Printing a label showing the store's name
def store_name_print(self): store_label = ("You are in " + self.name_s + ". These are the items in the store: ") return store_label
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_name(self):\n return self.name", "def display_name(self):", "def item_label(self):\r\n label_to_print = (\"\\nYou have selected \" + self.name_i\r\n + \" in tier \" + str(self.tier) + \".\")\r\n return label_to_print", "def Label(self) -> str:", "def d...
[ "0.6490905", "0.6334748", "0.6331835", "0.6329434", "0.6303864", "0.6273446", "0.61647904", "0.61626345", "0.61626345", "0.61233497", "0.61201924", "0.61045754", "0.6082442", "0.60380787", "0.6036265", "0.60207206", "0.599945", "0.599945", "0.599945", "0.599945", "0.599945", ...
0.8540053
0
All of the rules around tier trading (lower tier to one higher tier) exceptions for skipping tiers, exceptions for size of an item, and exceptions for stores that won't trade with one another
def tier_trading(self, item): # Initial tier is the item the user has going into the store and final # tier is the item the user has when leaving the store initial_tier = self.item.tier final_tier = item.tier # Not allowing items that are too large to be carried ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_market_1_2(self):\n\n def check_1_2(buyers: List[float], sellers: List[float], expected_num_of_deals: int,\n expected_prices: List[float]):\n market = Market([\n AgentCategory(\"buyer\", buyers),\n AgentCategory(\"seller\", sellers),\n ...
[ "0.5647007", "0.56367314", "0.5541436", "0.5508058", "0.5463875", "0.5443511", "0.54412055", "0.54409426", "0.5437534", "0.5428172", "0.54033935", "0.5394521", "0.535955", "0.5358054", "0.535762", "0.5312676", "0.53124523", "0.52677286", "0.526649", "0.52452695", "0.5234601",...
0.71313167
0
Making the added item the item you are carrying to the next store
def carry(self, item): # If you can add with the tier, # you have to check that its viable to carry if self.add is True: # This takes the new item and makes it your current item if item.size is True: self.item = item
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add(self, item):", "def DoAdd(self,event):\r\n newItem = self.data.add()\r\n if newItem and newItem not in self.items:\r\n self.items = self.data.getItemList()\r\n index = self.items.index(newItem)\r\n self.list.InsertItems([newItem],index)", "def remember(sel...
[ "0.7579375", "0.6856524", "0.67478365", "0.6704805", "0.66888845", "0.66888845", "0.66888845", "0.66683346", "0.6630195", "0.65703636", "0.6520401", "0.6507441", "0.6489442", "0.64795065", "0.64756703", "0.64615965", "0.6452446", "0.6451788", "0.6419928", "0.64104974", "0.640...
0.69463456
1
Create or update using the account object from a Stripe API query.
def sync_account_from_stripe_data(data, user=None): kwargs = {"stripe_id": data["id"]} if user: kwargs["user"] = user obj, created = models.Account.objects.get_or_create( **kwargs ) common_attrs = ( "business_name", "business_url", "charges_enabled", "country", "defau...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self, account):\n model = models.load('Account', account)\n return self.client.update_account(model=model)", "def account_update(request):\r\n params = request.params\r\n json_body = request.json_body\r\n user_acct = request.user\r\n\r\n if 'name' in params and params['name']...
[ "0.6285609", "0.6247926", "0.6075058", "0.6042732", "0.59946454", "0.59308195", "0.5920385", "0.5913981", "0.58721095", "0.580506", "0.5720275", "0.57019967", "0.5691452", "0.56282055", "0.5616456", "0.55910414", "0.5501329", "0.5437297", "0.5401647", "0.5399654", "0.5390728"...
0.6403822
0
Returns a single string containing the characters of line1 and line2 interleaved.
def interleaveChars(line1, line2): new_line = '' for k in range(max(len(line1), len(line2))): try: new_line = new_line + line1[k] + line2[k] except IndexError: minimum_index = min(len(line1), len(line2)) if len(line1) < len(line2): new_line = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def path2str(a,b,path):\n (s1,s2) = zip(*path)\n line1 = \" \"+\"\".join([get_char(s1,a,x) for x in range(1,len(s1))])\n line2 = \" \"+\"\".join([get_char(s2,b,x) for x in range(1,len(s2))])\n return \"%s\\n%s\"%(line1,line2)", "def other_lines(line):\r\n res = \"\"\r\n for j, i in enumerate(line):\r...
[ "0.6276888", "0.61599076", "0.59781003", "0.59442437", "0.58187866", "0.5743206", "0.57222503", "0.56596047", "0.56248736", "0.5607028", "0.55997264", "0.5594275", "0.5547277", "0.55345404", "0.552285", "0.5512957", "0.55045265", "0.5502379", "0.5489695", "0.5464381", "0.5462...
0.7746645
0
This method will check if stellar and token service is up or not
def check_stellar_service(self): _THREEFOLDFOUNDATION_TFTSTELLAR_SERVICES = { "TEST": "https://testnet.threefold.io/threefoldfoundation/transactionfunding_service/fund_transaction", "STD": "https://tokenservices.threefold.io/threefoldfoundation/transactionfunding_service/fund_transaction...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_auth_token_validity(self):\n endpoint = self.url + 'api/v1/readiness'\n response = self.perform_get_request(endpoint)\n\n if response.status_code != 200:\n self.print_error_response(response, \"error\")\n return response.status_code == 200", "def ready(self):\n\n ...
[ "0.6444967", "0.6400159", "0.63745767", "0.63322216", "0.63115424", "0.63091975", "0.6306925", "0.6238312", "0.6224449", "0.62157923", "0.6185214", "0.618375", "0.6155983", "0.61444443", "0.6121904", "0.6119091", "0.611306", "0.6100856", "0.6087277", "0.60573834", "0.6030632"...
0.71702254
0
This method will create a testnet wallet and fund it from the facuet
def create_testnet_funded_wallet(self, name: str) -> bool: wallet = self.new(name) try: wallet.network = "TEST" wallet.activate_through_friendbot() wallet.add_known_trustline("TFT") wallet.save() except Exception as e: self.delete(name)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_wallet(self, walletName):\n return", "def new_wallet(punkr, wallet_name, wallet_filepath, testnet):\n\tnetwork = \"BTCTEST\" if testnet else \"BTC\"\n\tn_accounts = 5\n\twallet_file = [{\"NETWORK\": network, \"LAST_UPDATE_TIME\": str(round(time.time()))}]\n\twrite_wallet_group(punkr, wallet_nam...
[ "0.713806", "0.7080357", "0.6841944", "0.6729907", "0.67137986", "0.670942", "0.6680294", "0.66283524", "0.6585636", "0.63962716", "0.63936967", "0.639238", "0.62532353", "0.61869", "0.6169703", "0.61672896", "0.6122436", "0.6108567", "0.61072177", "0.6105866", "0.60963434", ...
0.7743847
0
Successful division. No errors should be logged!
def test_divide_success(self): with self.assertNoLogs(): divide_by(10, 2)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_divide(self):\n\n result = random.randint(2, 10)\n\n b = random.randint(100, 1000)\n a = result * b\n\n path = \"/divide/{}/{}\".format(a, b)\n\n response = self.get_response(path)\n self.assertEqual(200, response.getcode())\n\n self.assertIn(str(result).en...
[ "0.70467925", "0.6969829", "0.6935141", "0.6742717", "0.6697616", "0.6694353", "0.66728747", "0.65661716", "0.65489525", "0.65161055", "0.6468033", "0.64383525", "0.6412735", "0.64014363", "0.6399103", "0.6396423", "0.63572794", "0.63466173", "0.63433814", "0.63377744", "0.63...
0.7433682
0
Error message was logged when it shouldn't have been, so the test "fails".
def test_failed_because_errors(self): with self.assertRaisesRegex(AssertionError, 'The follow messages were unexpectedly logged:\n' ' ERROR:root:Divide by zero!\n' ' ERROR:root:It is really not a go...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_level_error(self):\n self.assertEqual(DiscordReportFormatter().format(self.record(loglevel=logging.ERROR)), \":exclamation: **test**\")", "def fail(msg):\n log('FAIL', msg)", "def _failed(self, msg):\n self.log(msg)\n self.result.passed = False\n self.result.add_error(msg)\n...
[ "0.7375006", "0.7330192", "0.72771984", "0.71003824", "0.70662755", "0.7061895", "0.70378035", "0.7009644", "0.6966064", "0.69561654", "0.69047225", "0.68592227", "0.6837153", "0.6836754", "0.6834289", "0.67814523", "0.6778286", "0.677269", "0.6729667", "0.6724797", "0.671456...
0.7334441
1
Test if data_pipeline.correctness_queries.get_day_of_week_has_min_passenger_count works properly
def test_get_day_of_week_has_min_passenger_count(self): test_df_data = [ (1, "2019", "5", "2"), (2, "2019", "2", "3"), (3, "2019", "5", "4"), (2, "2019", "15", "2"), (1, "2019", "20", "1"), (1, "2019", "21", "1"), (1, "2019", "...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Daysleftverification():\n pass", "def test_weekly_bussiness_days_only(self):\n print()\n print(\"Test Bussiness Days Only\")\n start_date = timezone.now()\n start_date = start_date.replace(day=1, month = 9, year = 2020)\n end_date = start_date.replace(day=30)\n ex...
[ "0.5871245", "0.58364636", "0.5767866", "0.5629109", "0.55750144", "0.55392015", "0.5538313", "0.55348647", "0.5491123", "0.542842", "0.54109657", "0.5398166", "0.5385898", "0.5364978", "0.53605425", "0.5357022", "0.5334728", "0.5332238", "0.53287965", "0.5320464", "0.5314989...
0.7069835
0
Test if data_pipeline.correctness_queries.get_top_3_bussiest_hours works properly
def test_get_top_3_bussiest_hours(self): test_df_data = [ (1, "2019", "5", "2"), (1, "2019", "4", "2"), (2, "2019", "2", "3"), (3, "2019", "5", "4"), (2, "2019", "15", "2"), (1, "2019", "20", "12"), (3, "2019", "21", "6"), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_02_stats_hours(self):\r\n hour = unicode(datetime.datetime.utcnow().strftime('%H'))\r\n with self.flask_app.test_request_context('/'):\r\n hours, hours_anon, hours_auth, max_hours,\\\r\n max_hours_anon, max_hours_auth = stats.stats_hours(1)\r\n print hour...
[ "0.62927157", "0.5938339", "0.5855853", "0.58484954", "0.57894254", "0.5777164", "0.5769903", "0.57514346", "0.5750488", "0.574201", "0.56904614", "0.5669828", "0.56650686", "0.5652594", "0.559968", "0.55960065", "0.5593413", "0.55661947", "0.553094", "0.5513089", "0.5511591"...
0.6793127
0
Test if data_pipeline.correctness_queries.calculate_average_velocity works properly
def test_calculate_average_velocity(self): test_df_data = [ ("yellow", datetime(2020, 5, 1, 00, 43, 55), datetime(2020, 5, 1, 00, 56, 23), 2.0), ("yellow", datetime(2019, 5, 1, 00, 40, 45), datetime(2019, 5, 1, 00, 45, 40), 4.0), ("yellow", datetime(2019, 5, 1, 00, 14, 55), d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_avgs_forced(self):\n u = leabra.Unit()\n\n for t in range(10):\n u.force_activity(1.0)\n u.calculate_net_in()\n u.cycle('minus')\n\n for name in ['avg_ss', 'avg_s', 'avg_m', 'avg_s_eff']:\n self.assertTrue(getattr(u, name) != 0.15)", "def ...
[ "0.6591455", "0.64424074", "0.6209116", "0.61662704", "0.6116582", "0.5955632", "0.58702403", "0.58546084", "0.58340156", "0.58340156", "0.58340156", "0.5784871", "0.5784871", "0.5784871", "0.5781268", "0.57470304", "0.57110924", "0.5704145", "0.57028663", "0.5698085", "0.569...
0.6682664
0
Handles a given data that was received from a given participant.
def handle_new_data(self, par: Participant, data: bytes): msg = pickle.loads(data) # msg.add_timestamp() packet = create_packet(pickle.dumps(msg)) if msg.recipient_id == ChatMsg.BROADCAST_ID: self.broadcast(par, packet) else: with self.participants_lock: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def data_received(self, data):\n pass", "async def process_data(self, received):\n\t\treceived_json = utilities.is_json(received)\n\n\t\tif not received_json:\n\t\t\traise exceptions.ClientError('INVALID_JSON')\n\n\t\taction = received_json.get('c').upper()\n\t\tdata = received_json.get('d')\n\n\t\tlog.in...
[ "0.7184753", "0.68992877", "0.68864083", "0.67645", "0.67272043", "0.66351765", "0.6581626", "0.6524952", "0.65221244", "0.6485354", "0.6482573", "0.6478093", "0.64770335", "0.64770335", "0.645136", "0.64454925", "0.64134896", "0.63631153", "0.6345823", "0.6299564", "0.629146...
0.71815485
1
get variance of a column
def var_calc(data, col, mean): v = sum([(mean - row[col])**2 for row in data]) return v
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def variance(dataset):\n avg = sum(dataset)/len(dataset)\n v = 0.0\n for data in dataset:\n v += (data - avg) * (data - avg)\n v = v / len(dataset)\n return v", "def var(self):\n return self._reduce_for_stat_function(F.variance, only_numeric=True)", "def variance(self):\r\n\t\t_mea...
[ "0.7580434", "0.74382085", "0.73808205", "0.7334348", "0.7334348", "0.7334348", "0.7294423", "0.7265539", "0.72501725", "0.72501725", "0.7214993", "0.7209476", "0.71661973", "0.7131148", "0.713093", "0.7109735", "0.7082851", "0.70800924", "0.70260274", "0.6935706", "0.6910801...
0.75313175
1
This method use to convert the validation_parameter yaml file in to dictionary.
def validation_param_detail(yaml_file_name, file_header): validation_param = ast.literal_eval( json.dumps( yaml.load( open(f"{Common.config_path}/{yaml_file_name}"), Loader=yaml.FullLoader, )[file_header] ) )...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _load_datas(self) -> tp.Dict[str, dict]:\n with open(self._file, \"r\") as stream:\n try:\n load: tp.Dict[str, dict] = yaml.safe_load(stream)\n logger.info(\"YAML imported\")\n return load\n except yaml.YAMLError as exc:\n ...
[ "0.6266341", "0.61263883", "0.6017826", "0.5975201", "0.58717465", "0.5855274", "0.5806027", "0.57824606", "0.5743604", "0.5720802", "0.57186246", "0.57156897", "0.5677745", "0.5672848", "0.56250745", "0.5624371", "0.5614839", "0.561349", "0.5576375", "0.5574626", "0.5574251"...
0.7242423
0
This method use to copy the report to the mail server.
def mail_send(): report_file_path = ( f'{os.path.abspath(".")}/{Common.get_config_value("report_location")}' ) with open(f"{report_file_path}/subject", "rb") as subject_handler: subject = pickle.load(subject_handler) with open(f"{report_file_path}/{'recipient'}", ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def copy_reports(ctx):\n log = Path('./log.html')\n report = Path('./report.html')\n dest = Path('.') / 'reports'\n print(log.absolute())\n shutil.copy(log.absolute(), str(dest))\n print(report.absolute())\n shutil.copy(report.absolute(), str(dest))", "def copy_report(cls, req):\n try...
[ "0.66558003", "0.663249", "0.65546817", "0.6072897", "0.60541415", "0.5861861", "0.5839789", "0.56571484", "0.5613469", "0.5533403", "0.55320024", "0.54980195", "0.54978985", "0.5492887", "0.5484395", "0.54776347", "0.54748154", "0.5438299", "0.5434142", "0.53976876", "0.5383...
0.6915833
0
Get the formdata stored in the database for existing slice.
def query_form_data(self) -> FlaskResponse: # pylint: disable=no-self-use form_data = {} slice_id = request.args.get("slice_id") if slice_id: slc = db.session.query(Slice).filter_by(id=slice_id).one_or_none() if slc: form_data = slc.form_data.copy() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_form_data(self, request):\n return request.session[self.id]['form_data']", "def data(self):\n return self.form_data_records.all()", "def form(self):\n return security.get_field_storage()", "def form_data(self) -> dict:\n return copy.deepcopy(self.data)", "def formdata_fo...
[ "0.6242891", "0.5917092", "0.59127903", "0.5908999", "0.5649218", "0.5646924", "0.5505118", "0.54274", "0.5397204", "0.5354651", "0.52573454", "0.5252558", "0.52318925", "0.5187183", "0.51682335", "0.5094683", "0.5076582", "0.5027347", "0.5024734", "0.49970075", "0.4993842", ...
0.6888265
0
Computes the selfresponse of a day. Using the midpoint price and trade signs of a ticker computes the self
def taq_self_response_day_responses_physical_short_long_data(ticker, date, tau, tau_p): date_sep = date.split('-') year = date_sep[0] month = date_sep[1] day = date_sep[2] try: # Load data midpoint = pickle.load(open( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def taq_cross_response_day_responses_physical_short_long_data(ticker_i,\n ticker_j, date,\n tau, tau_p):\n\n date_sep = date.split('-')\n\n year = date_sep[0]\n month = date_sep[1]\n ...
[ "0.59756964", "0.5721606", "0.56588024", "0.56400836", "0.5582676", "0.5556038", "0.55067074", "0.54864675", "0.5456194", "0.5449335", "0.54021597", "0.5332129", "0.5315137", "0.5314631", "0.5217208", "0.51631117", "0.51577264", "0.51490784", "0.51453584", "0.5137176", "0.512...
0.63424236
0
Computes the crossresponse of a day. Using the midpoint price of ticker i and trade signs of ticker j computes
def taq_cross_response_day_responses_physical_short_long_data(ticker_i, ticker_j, date, tau, tau_p): date_sep = date.split('-') year = date_sep[0] month = date_sep[1] day = date_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def price_intrinsic_event(ts: pd.Series, d_up: int, d_down: int, mode='up'):\n result = []\n s_ext = None\n s_ie = None\n first_tick = True\n for i in range(len(ts)):\n s_tick = ts[i]\n if i==52:\n print(mode, s_tick, s_ext, s_ie)\n if first_tick:\n s_ext =...
[ "0.5439863", "0.5383517", "0.5343861", "0.5301872", "0.5300619", "0.52630836", "0.5228739", "0.5209745", "0.51902205", "0.51476014", "0.514731", "0.5134423", "0.51186323", "0.5117966", "0.5115876", "0.51111", "0.5099028", "0.5094724", "0.508584", "0.5059777", "0.5039917", "...
0.6075908
0
Obtiene los datos almacenados en el fichero html o czm. En caso de proporcionar un fichero czm, lo descomprime y localiza los correspondientes html.
def parse_html(self): if self.file_extension == '.czm': # Caso de fichero comprimido czm. folder_path = extract_file(self.input_file) # Descomprime el archivo de entrada. self.html_path = find_extension(folder_path, '.html') # Busca el html en el directorio de extracción. else: #...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_html_local():\n import os\n TESTDATA_FILENAME = os.path.join(os.path.dirname(__file__), 'html.html')\n with open(TESTDATA_FILENAME, 'r') as html_file:\n testdata = html_file.read()\n return testdata", "def load_local_cache(self):\n folder = os.path.dirname(__file__)\n pat...
[ "0.5648512", "0.55513966", "0.55512184", "0.54202163", "0.5416303", "0.53751886", "0.536233", "0.5348468", "0.5309761", "0.5236569", "0.522201", "0.51944107", "0.5166921", "0.5164137", "0.5132901", "0.5132632", "0.50992656", "0.50512755", "0.5026132", "0.5012757", "0.5004745"...
0.71627754
0
Increment the click count for a banner instance.
def add_click(banner_instance_id): now = datetime.now() try: instance = BannerInstance.objects.get(pk=banner_instance_id) except BannerInstance.DoesNotExist: return stats, created = instance.clickstats_set.get_or_create( month=now.month, year=now.year) stats.clicks = models....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def old_add_click(user_id, banner_id, banner_img_id):\n now = datetime.now()\n\n try:\n instance = BannerInstance.objects.get(user=user_id,\n badge=banner_id,\n image=banner_img_id)\n except BannerInstance.Doe...
[ "0.73129094", "0.708402", "0.6976489", "0.69326395", "0.6815909", "0.681555", "0.64860684", "0.6381182", "0.63259375", "0.62075543", "0.60920036", "0.6080995", "0.60764986", "0.606927", "0.60619557", "0.60306746", "0.59640867", "0.59557176", "0.59520924", "0.5934467", "0.5924...
0.76503223
0
Increment the click counter for an existing banner instance.
def old_add_click(user_id, banner_id, banner_img_id): now = datetime.now() try: instance = BannerInstance.objects.get(user=user_id, badge=banner_id, image=banner_img_id) except BannerInstance.DoesNotExist: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_click(banner_instance_id):\n now = datetime.now()\n try:\n instance = BannerInstance.objects.get(pk=banner_instance_id)\n except BannerInstance.DoesNotExist:\n return\n\n stats, created = instance.clickstats_set.get_or_create(\n month=now.month, year=now.year)\n stats.cl...
[ "0.7911445", "0.7085947", "0.6834381", "0.6797167", "0.6767621", "0.65757096", "0.6557681", "0.62565607", "0.6249831", "0.6087246", "0.6075462", "0.60666686", "0.6016656", "0.5982194", "0.5976539", "0.5966401", "0.5918518", "0.59141904", "0.5882809", "0.5866998", "0.581686", ...
0.7578354
1
Test the daily change log GET query
def test_get_daily_change_log(self): msg = "Response status is not 200" response = self.api.get_daily_change_log(self.year, self.month, self.day) self.assertEqual(response.status_code, 200, msg)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def call_change_log(input_filter):\n try:\n if input_filter is None:\n latest = _find_latest()\n service_endpoint = _find_filter(\"change_log\")\n else:\n keyword = input_filter.split(\" \")[0]\n if \"release\" == keyword or \"build\" == keyword:\n ...
[ "0.6750745", "0.62024486", "0.6168554", "0.6000085", "0.59664017", "0.5952706", "0.59521675", "0.59489435", "0.59134334", "0.5908279", "0.59079903", "0.58948773", "0.5848589", "0.5848589", "0.58312255", "0.5787771", "0.5737467", "0.57173496", "0.5682364", "0.5677256", "0.5674...
0.76991117
0
Test the daily schedule GET query
def test_get_daily_schedule(self): msg = "Response status is not 200" response = self.api.get_daily_schedule(self.year, self.month, self.day) self.assertEqual(response.status_code, 200, msg)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_schedule(self):\n response = self.client.open('/v1/schedule/{id}'.format(id=56),\n method='GET',\n content_type='application/json')\n self.assert200(response, \"Response body is : \" + response.data.decode('utf-8'))", ...
[ "0.7284644", "0.6984216", "0.68243486", "0.64916325", "0.62380075", "0.62294143", "0.62083495", "0.6168855", "0.6110963", "0.6047306", "0.6041012", "0.60194623", "0.60194623", "0.5956807", "0.5946089", "0.5931232", "0.5854017", "0.5840527", "0.57402974", "0.57389796", "0.5728...
0.75768304
0
Test the daily transfers GET query
def test_get_daily_transfers(self): msg = "Response status is not 200" response = self.api.get_daily_transfers(self.year, self.month, self.day) self.assertEqual(response.status_code, 200, msg)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_us_daily_data(self):\n dag = self.dagbag.get_dag(self.dag_id)\n extract_task = dag.get_task('extract')\n resp = self.extract.getDailyUSDataFromAPI()\n self.assertIsNotNone(resp)\n self.assertEqual(type(resp), list)", "def test_get_ny_daily_data(self):\n dag ...
[ "0.6819842", "0.63028544", "0.6054779", "0.60273737", "0.59726286", "0.58922124", "0.5855581", "0.582179", "0.5754511", "0.57059926", "0.5637548", "0.560289", "0.55917805", "0.5573884", "0.5553008", "0.5540516", "0.55374", "0.5519405", "0.5480411", "0.547051", "0.53985786", ...
0.76110256
0
Test the game boxscore GET query
def test_get_game_boxscore(self): msg = "Response status is not 200" response = self.api.get_game_boxscore(self.game_id) self.assertEqual(response.status_code, 200, msg)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_game_boxscore(self):\n pass", "def test_lti20_get_with_score_success(self):\r\n self.setup_system_xmodule_mocks_for_lti20_request_test()\r\n SCORE = 0.55 # pylint: disable=invalid-name\r\n COMMENT = u\"ಠ益ಠ\" # pylint: disable=invalid-name\r\n self.xmodule.module_...
[ "0.7821025", "0.6891424", "0.6549504", "0.654488", "0.64962345", "0.6298019", "0.6252287", "0.6227112", "0.61780983", "0.6173702", "0.6146739", "0.6139047", "0.6076613", "0.6050198", "0.5965529", "0.5949204", "0.5902227", "0.58764565", "0.58663094", "0.5863751", "0.58514583",...
0.7600288
1
Test the game faceoffs GET query
def test_get_game_faceoffs(self): msg = "Response status is not 200" response = self.api.get_game_faceoffs(self.game_id) self.assertEqual(response.status_code, 200, msg)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_game(self):\n pass", "def test_get_series_faceoffs(self):\n msg = \"Response status is not 200\"\n response = self.api.get_series_faceoffs(self.series_id, self.team_id)\n self.assertEqual(response.status_code, 200, msg)", "def test_get_seasonal_faceoffs(self):\n ...
[ "0.627467", "0.6230688", "0.59633964", "0.5894223", "0.58337426", "0.58319384", "0.57196885", "0.56227386", "0.56224674", "0.5608227", "0.5599788", "0.5598041", "0.5570167", "0.5555414", "0.5540742", "0.5518731", "0.5499328", "0.5480086", "0.54741335", "0.54565734", "0.544861...
0.7430239
0
Test the game play by play GET query
def test_get_game_play_by_play(self): msg = "Response status is not 200" response = self.api.get_game_play_by_play(self.game_id) self.assertEqual(response.status_code, 200, msg)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_game(self):\n pass", "def test_plays_get(self):\n pass", "def test_show_game(self, mock_find):\n mock_find.return_value = sample_game\n\n result = self.client.get(f'game/{sample_game_id}')\n self.assertEqual(result.status, '200 OK')\n self.assertIn(b'Fable...
[ "0.7244607", "0.71967304", "0.6643511", "0.6635827", "0.64665365", "0.6450294", "0.6440595", "0.6427455", "0.62878364", "0.62685674", "0.62065935", "0.6200521", "0.61930734", "0.61559564", "0.615276", "0.606092", "0.6003518", "0.59911054", "0.597633", "0.5953338", "0.5944287"...
0.73539644
0
Test the game summary GET query
def test_get_game_summary(self): msg = "Response status is not 200" response = self.api.get_game_summary(self.game_id) self.assertEqual(response.status_code, 200, msg)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_game(self):\n pass", "def test_get_rating(self):\n url = reverse('rate-game')\n data = {'igdb': self.game.igdb}\n response = self.client.get(url, data, format='json')\n\n self.assertEqual(response.status_code, status.HTTP_200_OK)", "def test_get_stats(self):\n ...
[ "0.69823015", "0.6614276", "0.6456565", "0.6426102", "0.6419532", "0.6401779", "0.639539", "0.6379202", "0.6374731", "0.6366534", "0.6338249", "0.62811285", "0.6258669", "0.6200744", "0.6198182", "0.6169895", "0.614911", "0.6143185", "0.6137223", "0.6115115", "0.6083495", "...
0.76470804
0
Test the game time on ice GET query
def test_get_game_time_on_ice(self): msg = "Response status is not 200" response = self.api.get_game_time_on_ice(self.game_id) self.assertEqual(response.status_code, 200, msg)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_ctcpQuery_TIME(self):\n self.client.ctcpQuery_TIME(self.user, self.channel, \"data\")\n self.assertEqual(self.client.methods[0][1][0], \"Wolf\")", "def timed_recipes():\n time = request.args.get('time', 0, type=int) #raw input from HTML page\n global time_global\n time_global = time #s...
[ "0.6588473", "0.62984604", "0.61421025", "0.60960823", "0.6068669", "0.60357976", "0.60270256", "0.59776783", "0.59738624", "0.59485495", "0.59384114", "0.5913308", "0.5893076", "0.5890543", "0.5875471", "0.5857228", "0.5828253", "0.5819252", "0.57961583", "0.5768936", "0.575...
0.75270134
0
Test the league hierarchy GET query
def test_get_league_hierarchy(self): msg = "Response status is not 200" response = self.api.get_league_hierarchy() self.assertEqual(response.status_code, 200, msg)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_league_leaders___goaltending(self):\n msg = \"Response status is not 200\"\n response = self.api.get_league_leaders___goaltending(self.season, self.nhl_season)\n self.assertEqual(response.status_code, 200, msg)", "def get_teams():", "def test_get_waivers(league):\n pass", ...
[ "0.5885389", "0.5808132", "0.5779013", "0.56745213", "0.56745213", "0.5648634", "0.564286", "0.5610568", "0.5600678", "0.56002533", "0.5581501", "0.5579735", "0.5567289", "0.55095917", "0.55095917", "0.5505311", "0.5467903", "0.54224515", "0.5420787", "0.5412208", "0.54078734...
0.7333138
0
Test the league leaders goaltending GET query
def test_get_league_leaders___goaltending(self): msg = "Response status is not 200" response = self.api.get_league_leaders___goaltending(self.season, self.nhl_season) self.assertEqual(response.status_code, 200, msg)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_leaders(self):\n leaders = app.get_leaders()\n self.assertEqual(len(leaders), 1)", "def test_get_league_leaders___daily(self):\n msg = \"Response status is not 200\"\n response = self.api.get_league_leaders___daily(self.year1, self.nhl_season, self.year2, self.month, self...
[ "0.6431315", "0.6394764", "0.6337049", "0.6226904", "0.6158575", "0.6081985", "0.60763633", "0.6057462", "0.6011711", "0.6006049", "0.6006049", "0.59738404", "0.5925006", "0.59244335", "0.5886274", "0.5882376", "0.5863715", "0.5858639", "0.58246046", "0.5807679", "0.5798975",...
0.70024484
0
Test the league leaders skaters GET query
def test_get_league_leaders___skaters(self): msg = "Response status is not 200" response = self.api.get_league_leaders___skaters(self.season, self.nhl_season) self.assertEqual(response.status_code, 200, msg)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_league_leaders___goaltending(self):\n msg = \"Response status is not 200\"\n response = self.api.get_league_leaders___goaltending(self.season, self.nhl_season)\n self.assertEqual(response.status_code, 200, msg)", "def getskaters(league, year):\n \n url = 'https://www.elitep...
[ "0.6306518", "0.6195511", "0.6122547", "0.60679996", "0.5873768", "0.58507216", "0.5844217", "0.5805256", "0.57405007", "0.5729962", "0.5724926", "0.5661511", "0.5658414", "0.5638917", "0.5638917", "0.5617566", "0.56170064", "0.56163764", "0.55668753", "0.5539919", "0.5514962...
0.75554633
0
Test the league leaders daily GET query
def test_get_league_leaders___daily(self): msg = "Response status is not 200" response = self.api.get_league_leaders___daily(self.year1, self.nhl_season, self.year2, self.month, self.day) self.assertEqual(response.status_code, 200, msg)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_league_leaders___goaltending(self):\n msg = \"Response status is not 200\"\n response = self.api.get_league_leaders___goaltending(self.season, self.nhl_season)\n self.assertEqual(response.status_code, 200, msg)", "def get_live_league_games(self):\n url = self.__build_url(...
[ "0.64266825", "0.6088202", "0.6067655", "0.6011895", "0.6009591", "0.59091693", "0.58928233", "0.5872137", "0.5804075", "0.5792063", "0.5774524", "0.56921333", "0.56318873", "0.5621923", "0.5610025", "0.55668557", "0.55649453", "0.55383253", "0.55383253", "0.5536631", "0.5502...
0.7729664
0
Test the player profile GET query
def test_get_player_profile(self): msg = "Response status is not 200" response = self.api.get_player_profile(self.player_id) self.assertEqual(response.status_code, 200, msg)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_profile_api_get(self):\n response = self.client.get(self.url)\n self.assertEqual(response.status_code, 200)", "def test_user_profiles(self):\n\n result = self.client.get(\"/profile/1\")\n self.assertIn(b'In house:',result.data)", "def test_profile_view_with_get_request(self...
[ "0.715138", "0.69354767", "0.66744447", "0.66298866", "0.6522077", "0.6498074", "0.64490443", "0.64323413", "0.6412542", "0.6404606", "0.6394829", "0.6389007", "0.638077", "0.63788587", "0.63068837", "0.628112", "0.62540287", "0.6241686", "0.623938", "0.62371486", "0.6232058"...
0.7471449
0
Test the schedule GET query
def test_get_schedule(self): msg = "Response status is not 200" response = self.api.get_schedule(self.season, self.nhl_season) self.assertEqual(response.status_code, 200, msg)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_schedule(self):\n response = self.client.open('/v1/schedule/{id}'.format(id=56),\n method='GET',\n content_type='application/json')\n self.assert200(response, \"Response body is : \" + response.data.decode('utf-8'))", ...
[ "0.78130096", "0.72501385", "0.71555805", "0.6836282", "0.6690873", "0.6393354", "0.6346312", "0.6346312", "0.6253425", "0.62280595", "0.62097174", "0.6148491", "0.6139531", "0.6109585", "0.61014396", "0.6070241", "0.6062938", "0.6040468", "0.60402167", "0.603731", "0.6009663...
0.7499619
1
Test the seasonal faceoffs GET query
def test_get_seasonal_faceoffs(self): msg = "Response status is not 200" response = self.api.get_seasonal_faceoffs(self.season, self.nhl_season, self.team_id) self.assertEqual(response.status_code, 200, msg)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_series_faceoffs(self):\n msg = \"Response status is not 200\"\n response = self.api.get_series_faceoffs(self.series_id, self.team_id)\n self.assertEqual(response.status_code, 200, msg)", "def test_get_game_faceoffs(self):\n msg = \"Response status is not 200\"\n re...
[ "0.69125676", "0.6225111", "0.60290164", "0.59899116", "0.5802472", "0.56523234", "0.5614949", "0.556702", "0.5538653", "0.55261755", "0.5482514", "0.5478625", "0.5460789", "0.54540384", "0.5448252", "0.54354453", "0.5388054", "0.5383504", "0.53354776", "0.5330793", "0.532816...
0.76514786
0
Test the seasonal statistics season to date GET query
def test_get_seasonal_statistics___season_to_date(self): msg = "Response status is not 200" response = self.api.get_seasonal_statistics___season_to_date(self.season, self.nhl_season, self.team_id) self.assertEqual(response.status_code, 200, msg)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_season_19_march(self, calendar, expected):\n date = datetime.date(2017, 3, 19)\n assert calendar.get_season(date) == expected", "def season_series(game_id, pref_team, other_team, last_season=False):\n\n # Init empty dictionaries and lists\n games_against = list()\n pref_toi = ...
[ "0.6488457", "0.64031446", "0.6378643", "0.6372086", "0.637144", "0.6295986", "0.6283952", "0.6231796", "0.62276757", "0.6166024", "0.61479753", "0.6134804", "0.6105703", "0.60799634", "0.60419226", "0.59999406", "0.59853125", "0.5904157", "0.5847667", "0.5772186", "0.5722408...
0.7406181
0
Test the series faceoffs GET query
def test_get_series_faceoffs(self): msg = "Response status is not 200" response = self.api.get_series_faceoffs(self.series_id, self.team_id) self.assertEqual(response.status_code, 200, msg)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_seasonal_faceoffs(self):\n msg = \"Response status is not 200\"\n response = self.api.get_seasonal_faceoffs(self.season, self.nhl_season, self.team_id)\n self.assertEqual(response.status_code, 200, msg)", "def test_get_game_faceoffs(self):\n msg = \"Response status is not...
[ "0.63659525", "0.6274763", "0.6004583", "0.5769966", "0.56767803", "0.5642956", "0.55568945", "0.5544736", "0.55370724", "0.5443267", "0.54249376", "0.5291469", "0.52887356", "0.52806836", "0.5275418", "0.5269461", "0.52411884", "0.52320826", "0.52245426", "0.5215843", "0.516...
0.75441194
0
Test the series schedule GET query
def test_get_series_schedule(self): msg = "Response status is not 200" response = self.api.get_series_schedule(self.season, self.nhl_season) self.assertEqual(response.status_code, 200, msg)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_schedule(self):\n response = self.client.open('/v1/schedule/{id}'.format(id=56),\n method='GET',\n content_type='application/json')\n self.assert200(response, \"Response body is : \" + response.data.decode('utf-8'))", ...
[ "0.7387384", "0.72467446", "0.7052105", "0.69450575", "0.65608746", "0.63881254", "0.61849254", "0.61465645", "0.61095977", "0.60332006", "0.60331863", "0.60053384", "0.5992959", "0.59806794", "0.5902658", "0.5902658", "0.5888331", "0.5865715", "0.5865688", "0.5849924", "0.58...
0.75348
0
Test the series statistics GET query
def test_get_series_statistics(self): msg = "Response status is not 200" response = self.api.get_series_statistics(self.series_id, self.team_id) self.assertEqual(response.status_code, 200, msg)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_stats(self):\n pass", "def test_get_statistics(self):\n url, parsed = self.prepare_urls(\n 'v1:activity-statistics', subdomain=self.company.subdomain)\n \n response = self.client.get(url, HTTP_HOST=parsed.netloc)\n self.assertEqual(response.status_code, ...
[ "0.6823767", "0.6569968", "0.6483406", "0.6431322", "0.63950604", "0.63902247", "0.6246216", "0.6245389", "0.6225796", "0.6154094", "0.60972464", "0.60878384", "0.6080355", "0.6075575", "0.60446024", "0.60390395", "0.6034756", "0.60305405", "0.6027657", "0.6020266", "0.601501...
0.76166797
0
Test the team profile roster GET query
def test_get_team_profile___roster(self): msg = "Response status is not 200" response = self.api.get_team_profile___roster(self.team_id) self.assertEqual(response.status_code, 200, msg)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_retrieve_team(self):\n pass", "def test_profile_api_get(self):\n response = self.client.get(self.url)\n self.assertEqual(response.status_code, 200)", "def test_user_profiles(self):\n\n result = self.client.get(\"/profile/1\")\n self.assertIn(b'In house:',result.data)...
[ "0.6926268", "0.6525174", "0.6479693", "0.64320976", "0.6371014", "0.6363267", "0.62988174", "0.6262419", "0.624958", "0.62191385", "0.62137794", "0.62137794", "0.62025636", "0.6198376", "0.61955756", "0.6180634", "0.6177118", "0.61642116", "0.61623186", "0.6161422", "0.60748...
0.7592548
0
Creating the task for a decorated function. We use precreated definition for the function definition. Here we create the tasks params from runtime input
def for_func(cls, task_definition, task_args, task_kwargs, task_name=None): # type: (Type[TrackingTask], TaskDefinition, List[Any], Dict[str,Any], str) -> TrackingTask param_values = build_func_parameter_values( task_definition, task_args, task_kwargs ) # we need to add RESUL...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_task():", "def task(func=None, *args, **kwargs):\n if not func:\n return partial(task, *args, **kwargs)\n\n try:\n name = kwargs.pop('name').lower()\n except KeyError:\n name = func.__name__.lower()\n\n # Extract docs for the given func\n help = inspect.getdoc(func)...
[ "0.68024963", "0.6456286", "0.6352895", "0.6313644", "0.63123035", "0.6252772", "0.6204225", "0.6178651", "0.6170662", "0.6169007", "0.60672736", "0.60399085", "0.59938693", "0.59636354", "0.593646", "0.5916978", "0.5913193", "0.58065563", "0.57692134", "0.57685465", "0.57470...
0.6618668
1
Build results parameter for the task definition, if parameter definition is not specify it will build a naive one.
def build_result_param(task_passport, param_def=None, name=RESULT_PARAM): # type: (TaskPassport, Optional[ParameterDefinition], str) -> ParameterValue if not param_def: from targets.values import ObjectValueType # naive creation of result param definition - default named "result" and single va...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def for_func(cls, task_definition, task_args, task_kwargs, task_name=None):\n # type: (Type[TrackingTask], TaskDefinition, List[Any], Dict[str,Any], str) -> TrackingTask\n param_values = build_func_parameter_values(\n task_definition, task_args, task_kwargs\n )\n # we need to...
[ "0.60977167", "0.569616", "0.56945527", "0.56390786", "0.56121373", "0.55510247", "0.5422493", "0.538809", "0.5347187", "0.5298091", "0.5277759", "0.52400565", "0.5186664", "0.5184157", "0.51723224", "0.51663744", "0.5152246", "0.5131948", "0.5119991", "0.51066685", "0.510576...
0.7427619
0
Return userselectable player colors.
def get_player_colors() -> List[Tuple[float, float, float]]: return PLAYER_COLORS
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_color_options(self):\n mask = (self.all_colors != self.player_1.color) & (self.all_colors != self.player_2.color)\n return self.all_colors[mask]", "def player(self):\n return self._color", "def colors(self):\n\t\treturn [(0, 30, 255),(0, 30, 120)]", "def getColors():\n return ...
[ "0.7071576", "0.65006506", "0.6178279", "0.6084722", "0.60692674", "0.60692674", "0.60415405", "0.6031914", "0.5914376", "0.5901996", "0.5861808", "0.5831872", "0.5828773", "0.57755935", "0.5774033", "0.5739374", "0.5718225", "0.570366", "0.56386864", "0.5619595", "0.55762", ...
0.74135023
0
Given a profile name, returns an icon string for it. (nonaccount profiles only)
def get_player_profile_icon(profilename: str) -> str: from ba._enums import SpecialChar appconfig = _ba.app.config icon: str try: is_global = appconfig['Player Profiles'][profilename]['global'] except KeyError: is_global = False if is_global: try: icon = appc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_icon(icon_name):\n theme = 'Adwaita'\n size = '256x256'\n path = f'/usr/share/icons/{theme}/{size}/mimetypes/{icon_name}.png'\n return path", "def icon(self) -> Optional[str]:\n if not self.profile_device.icons:\n return None\n\n if not self._icon:\n icon_...
[ "0.6854238", "0.64918226", "0.63131255", "0.6252918", "0.6091051", "0.60665846", "0.5969339", "0.5947331", "0.59099644", "0.59091586", "0.58574885", "0.5828271", "0.57584375", "0.5742529", "0.57087815", "0.56968963", "0.5680406", "0.5660262", "0.55977094", "0.55735266", "0.55...
0.7548534
0
Given a profile, return colors for them.
def get_player_profile_colors( profilename: Optional[str], profiles: Dict[str, Dict[str, Any]] = None ) -> Tuple[Tuple[float, float, float], Tuple[float, float, float]]: appconfig = _ba.app.config if profiles is None: profiles = appconfig['Player Profiles'] # Special case: when being asked ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extract_colors(self, palette, colors):\n return [palette[i:i + 3] for i in range(0, colors * 3, 3)]", "def colors(palette):\n all_colors = {\n 'cmyk': ['cian', 'magenta', 'yellow', 'black'],\n 'rgb': ['red', 'green', 'blue']\n }\n if palette == 'all':\n result = all_colors\n ...
[ "0.5830559", "0.57657254", "0.5662291", "0.5521145", "0.5510788", "0.5453417", "0.54493946", "0.5431452", "0.5426124", "0.54001963", "0.5375466", "0.5375466", "0.53640836", "0.5361749", "0.53547364", "0.53527325", "0.5331734", "0.5330822", "0.52988523", "0.52957225", "0.52901...
0.71337414
0
Initializer. Sets the root atrribute.
def __init__(self, root=None): self.set_root(root)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(__self__, *,\n root: str):\n pulumi.set(__self__, \"root\", root)", "def __init__(self, root):\n self.root = root", "def __init__(self, root):\n self.root = root", "def set_root(self, root):\n self.root = root\n if self.root is not None:\n ...
[ "0.74845326", "0.7389079", "0.7389079", "0.7107158", "0.7083658", "0.7083658", "0.6996753", "0.6973504", "0.6973504", "0.6973504", "0.6973504", "0.6973504", "0.6934671", "0.6894475", "0.68277246", "0.68115973", "0.6806485", "0.6804686", "0.6797701", "0.6780247", "0.6778689", ...
0.7891337
0
Add recipients to the dataframe df
def add_recipients(df, all_emails): user = df["sender"].iloc[0] # ID of the user emails = all_emails[user] df["emails"] = str(list(emails)) df["emails"] = df["emails"].map(literal_eval) return df
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def recipients(self) -> ty.List[str]:", "def add_recipients(self, recipient):\n\n if isinstance(recipients, list):\n self.recipients.extend(recipients)\n else:\n self.recipients.append(recipients)", "def addRecipients(self, *recipients, **options):\n\t\trecipientList = None\...
[ "0.64898384", "0.5991729", "0.5791777", "0.5666866", "0.5626737", "0.542722", "0.54160875", "0.5401793", "0.53864133", "0.5327382", "0.5323828", "0.53161055", "0.5289273", "0.52850306", "0.5265288", "0.52221984", "0.5194427", "0.5190469", "0.5185033", "0.5160836", "0.51566947...
0.8299125
0
Split dataset in train and dev set For each sender, we put in the dev set the percentage 'percent' of the last messages he sent
def split_train_dev_set(df, percent=0.2): train = [] dev = [] for k, g in df.groupby("sender")["mid", "recipients"]: n_msg = g.shape[0] n_dev = int(n_msg * percent) g = g.sort_values("date") g_train = g[:-n_dev] g_dev = g[-n_dev:] train.append(g_train) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def train_dev_test_split(data, train_pct=0.7):\n train_len, dev_len, test_len = create_split_bounds(len(data), train_pct)\n\n # Train (70%)\n train = data[0:train_len]\n\n # Dev (15%)\n dev_ub = (train_len + dev_len)\n dev = data[train_len:dev_ub]\n\n # Test (15%)\n test = data[dev_ub:]\n\n...
[ "0.6471576", "0.638265", "0.60906136", "0.5971797", "0.5919757", "0.58789855", "0.58069074", "0.57621354", "0.5725568", "0.570499", "0.5691336", "0.5688783", "0.56200325", "0.5596931", "0.5567449", "0.5562502", "0.5562502", "0.55386794", "0.5532109", "0.5525198", "0.5484341",...
0.74170476
0
Unified digamma interface for both scalar and tensor
def digamma(F): def compute(value): """Return digamma(value) """ if isinstance(value, Number): if sc is not None: return sc.digamma(value, dtype='float32') else: raise ValueError('Numbers are not supported as input if scipy is not insta...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def digamma(self, x):\n return self.tensor(scipy.special.digamma(x), **self.context(x))", "def get_gamma(self, conv_op):", "def _gamma(self, nOrT : float) -> vector:\n pass", "def gamma(a, *args, **kwds):\n if not args:\n return gamma1(a, **kwds)\n if len(args) > 1:\n raise ...
[ "0.7885991", "0.6467042", "0.6347419", "0.615746", "0.6086793", "0.60245913", "0.60166717", "0.5984936", "0.5957237", "0.5947791", "0.5887235", "0.58837724", "0.5845816", "0.5816172", "0.5813464", "0.57714283", "0.5719225", "0.5716652", "0.5715878", "0.5702326", "0.57019794",...
0.7478069
1
Unified gammaln interface for both scalar and tensor
def gammaln(F): def compute(value): """Return log(gamma(value)) """ if isinstance(value, Number): if sc is not None: return sc.gammaln(value, dtype='float32') else: raise ValueError('Numbers are not supported as input if scipy is not in...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def g_tf(self, t, x):\n raise NotImplementedError", "def G(x,mu,T):\r\n den1 = np.cosh(mu/(kb*T))/np.sinh(x/(kb*T))\r\n den2 = np.tanh(x/(kb*T))\r\n\r\n return 1/(den1 + den2)", "def gram(tensor):\n B, C, H, W = tensor.shape\n x = tensor.view(B, C, H * W)\n x_t = x.transpose(1, 2)\n ...
[ "0.6060318", "0.57873374", "0.57604545", "0.57305557", "0.57169485", "0.5711657", "0.56976205", "0.56711286", "0.56430244", "0.55699176", "0.5566212", "0.5566212", "0.5539514", "0.553861", "0.553861", "0.54894525", "0.54779935", "0.54725635", "0.5463034", "0.54101217", "0.539...
0.6981411
0
Unified erf interface for both scalar and tensor
def erf(F): def compute(value): if isinstance(value, Number): if sc is not None: return sc.erf(value) else: raise ValueError('Numbers are not supported as input if scipy is not installed') return F.npx.erf(value) return compute
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __rtruediv__(self, other):\n if type(other) == int:\n other = float(other)\n\n if type(other) == float:\n other = Tensor(other)\n\n return F.Div.apply(other, self)", "def etrf_func(et_inst, etr):\n return et_inst / etr", "def erfinv(F):\n def compute(value):...
[ "0.61441076", "0.5948338", "0.58884615", "0.58737636", "0.5780899", "0.5732495", "0.57194626", "0.56602204", "0.5599126", "0.55774677", "0.55525124", "0.55525124", "0.5538047", "0.5528037", "0.5518084", "0.5512317", "0.55019224", "0.5449315", "0.5449315", "0.541799", "0.53787...
0.5973085
1
Unified erfinv interface for both scalar and tensor
def erfinv(F): def compute(value): if isinstance(value, Number): if sc is not None: return sc.erfinv(value) else: raise ValueError('Numbers are not supported as input if scipy is not installed') return F.npx.erfinv(value) return compute
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_erfinvgpu():\r\n x = tensor.fmatrix()\r\n f = theano.function([x], tensor.Elemwise(erfinv)(x), mode=mode_with_gpu)\r\n f2 = theano.function([x], tensor.Elemwise(erfinv)(x), mode=mode_without_gpu)\r\n assert isinstance(f.maker.fgraph.toposort()[1].op, cuda.GpuElemwise)\r\n assert isinstance(...
[ "0.63675636", "0.59563935", "0.5727211", "0.5579402", "0.55519414", "0.552155", "0.5502911", "0.54482144", "0.54465944", "0.54444", "0.54401636", "0.54321337", "0.5431826", "0.54293454", "0.5415887", "0.53891486", "0.5361678", "0.53529096", "0.5344718", "0.5316236", "0.531455...
0.6681612
0
Convert `size` to the proper format for performing sample_n.
def sample_n_shape_converter(size): if size is None: return size if size == (): size = None else: if isinstance(size, int): size = (size,) size = (-2,) + size return size
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sample(self, size=1):\n pass", "def sample(self, size=1):\n raise NotImplementedError", "def sample(self, size=1):\n raise NotImplementedError", "def sample(self, size=1):\n raise NotImplementedError", "def sample(self, size=1):\n raise NotImplementedError", "def si...
[ "0.6491499", "0.644417", "0.644417", "0.644417", "0.644417", "0.6307906", "0.61841846", "0.6110933", "0.6095567", "0.6046121", "0.60005844", "0.5945416", "0.58638716", "0.58388513", "0.58120185", "0.5791173", "0.57303107", "0.5729424", "0.5702283", "0.569273", "0.56858146", ...
0.72721404
0
Get running mode from parameters, return mx.ndarray if inputs are python scalar. Returns ndarray or _Symbol the running mode inferred from `params`
def getF(*params): mode_flag = 0 for param in params: if isinstance(param, nd.NDArray): if mode_flag < 0: raise TypeError("Expect parameters to have consistent running mode," + " got {}".format([type(p) for p in params])) mode_flag ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def eval(params: ObjectiveParams, x: jnp.ndarray) -> jnp.ndarray:\n pass", "def __call__(self, params):\n # Parameters array is set out as follows\n amplitude, frequency, width, splitting, asymmetry, inclination, background = params\n\n # First calculate mode height\n height = ...
[ "0.5480924", "0.53888917", "0.5246502", "0.5027918", "0.49867314", "0.49590427", "0.49328247", "0.48096263", "0.47644615", "0.4760116", "0.4740504", "0.4706389", "0.4703221", "0.4683819", "0.46297646", "0.4629591", "0.4608945", "0.459903", "0.4596818", "0.45630422", "0.455579...
0.68523127
0
Sum along the right most `ndim` dimensions of `x`,
def sum_right_most(x, ndim): if ndim == 0: return x axes = list(range(-ndim, 0)) return x.sum(axes)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sum_to_0d(x):\n assert_equal(x.ndim, 1)\n return np.squeeze(np.sum(x, keepdims=True))", "def fn(x):\n if x.ndim == 1:\n return np.sum(x**2)\n else:\n return np.sum(x**2, axis=1)", "def sum(input, axis=None, dtype=None, keepdims=False, acc_dtype=None):\r\n\r\n ou...
[ "0.7435214", "0.7172801", "0.71126914", "0.7001956", "0.69788593", "0.67381954", "0.66838723", "0.6625336", "0.65609515", "0.6529158", "0.6526043", "0.64935225", "0.6470894", "0.633765", "0.6333073", "0.61884475", "0.61837065", "0.6137801", "0.61003137", "0.6072012", "0.60717...
0.7416953
1
r"""Convert probability to logit form. For the binary case, the logit stands for log(p / (1 p)). Whereas for the multinomial case, the logit denotes log(p).
def prob2logit(prob, binary=True, F=None): if F is None: F = getF(prob) _clipped_prob = _clip_prob(prob, F) if binary: return F.np.log(_clipped_prob) - F.np.log1p(-_clipped_prob) # The clipped prob would cause numerical error in the categorical case, # no idea about the reason behind...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_log(p):\n if p==0:\n return 0.\n return p*np.log2(p)", "def log_prob_from_logits(x):\n axis = len(x.shape) - 1\n m = x.max(dim=axis, keepdim=True)[0]\n return x - m - torch.log(torch.exp(x - m).sum(dim=axis, keepdim=True))", "def __convert_to_log(self):\n for i in range(sel...
[ "0.74829304", "0.74557555", "0.71970844", "0.7192654", "0.7146311", "0.7016303", "0.70100516", "0.6971464", "0.69537616", "0.6879932", "0.6847324", "0.6826809", "0.6820477", "0.68073004", "0.67631704", "0.6761048", "0.6733924", "0.6727841", "0.6713067", "0.670189", "0.6698916...
0.7715462
0
r"""Convert logit into probability form. For the binary case, `sigmoid()` is applied on the logit tensor. Whereas for the multinomial case, `softmax` is applied along the last dimension of the logit tensor.
def logit2prob(logit, binary=True, F=None): if F is None: F = getF(logit) if binary: return F.npx.sigmoid(logit) return F.npx.softmax(logit)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def logit_to_prob(logits: Tensor, criterion):\n logits = logits.detach()\n\n if logits.size(1) == 2:\n # return logits.softmax()[:, 0:1, ...] # Take probabilities of the first class (salt)\n return logits.argmax(dim=1).float()\n elif logits.size(1) == 1:\n if isinstance(criterion, Lo...
[ "0.77745926", "0.7349798", "0.7289276", "0.7000452", "0.69920874", "0.69692165", "0.6897187", "0.6863697", "0.6681502", "0.6525396", "0.64454716", "0.6444862", "0.6443073", "0.64346546", "0.64190495", "0.6400037", "0.6391899", "0.63872296", "0.6378657", "0.63768727", "0.63609...
0.8353626
0
Pick hpp and cpp files from root_dir.
def pick_names(root_dir): yield from glob.glob(root_dir + '*.hpp') yield from glob.glob(root_dir + '*.cpp') yield from glob.glob(root_dir + '*/*.hpp') yield from glob.glob(root_dir + '*/*.cpp')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compile_files(root):\n files = [os.path.join(root, f) for f in os.listdir(root) if not f.startswith(\".\")]\n \n return files", "def collect_source_hpp_files(self):\n for pattern in self.package_info.source_hpp_patterns:\n for filename in fnmatch.filter(self.source_hpp_files, patte...
[ "0.6328643", "0.60408527", "0.5922166", "0.5662393", "0.56297636", "0.5574656", "0.553501", "0.54752284", "0.54556996", "0.5424433", "0.5414791", "0.5400118", "0.5385033", "0.5349106", "0.53307927", "0.5320421", "0.53197724", "0.53057617", "0.5264746", "0.5254683", "0.5254379...
0.6893323
0
Create index list from lines.
def create_indices(filename, lines): def find(key, condition): """Find and return index from str-list.""" for i, line in enumerate(lines): if condition(line, key): return i return None guard = ('INCLUDE_GUARD_KEN3_' + filename.replace('/', '_').r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _mk_index(self):\n index = defaultdict(list)\n for line_no, line in enumerate(self._stripped_lines):\n if line:\n index[line].append(line_no)\n return index", "def convert_to_idx(lines):\n for idx, l in enumerate(lines):\n line_temp = []\n for v...
[ "0.7470838", "0.66146404", "0.63532335", "0.6253512", "0.6164719", "0.60606533", "0.60555553", "0.603775", "0.6023929", "0.6022914", "0.59796697", "0.596683", "0.58972496", "0.58872414", "0.5877942", "0.58715916", "0.5844947", "0.58292127", "0.5813339", "0.5806315", "0.579762...
0.67960334
1
Parse args by argparse and run each tests. return the number of problems.
def main(): import argparse # parse sys.argv parser = argparse.ArgumentParser(description='stylecheck') parser.add_argument('-v', '--version', action='version', version=('%(prog)s ' + __version__)) parser.add_argument('-r', '--root_dir', type=str, default='../../ken3/', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main_parse_args(args):\n # Must return so that check command return value is passed back to calling routine\n # otherwise py.test will fail\n return main(parse_args(args))", "def main_parse_args(args):\n # Must return so that check command return value is passed back to calling routine\n # oth...
[ "0.6928231", "0.6928231", "0.68075883", "0.6721361", "0.6493426", "0.6487286", "0.6456215", "0.6433835", "0.6417222", "0.6359237", "0.63254005", "0.62279946", "0.61762255", "0.6158491", "0.6154577", "0.61514056", "0.6150639", "0.6141171", "0.6136545", "0.6133445", "0.6099427"...
0.73299044
0
Fetch the `adult`_ dataset from OpenML and add `fairness_info`. It contains information about individuals from the 1994 U.S. census. The prediction task is a binary classification on whether the income of a person exceeds 50K a year. Without preprocessing, the dataset has 48,842 rows and 14 columns. There are two prote...
def fetch_adult_df(preprocess=False): (train_X, train_y), (test_X, test_y) = lale.datasets.openml.fetch( "adult", "classification", astype="pandas", preprocess=preprocess ) orig_X = pd.concat([train_X, test_X]).sort_index() orig_y = pd.concat([train_y, test_y]).sort_index() if preprocess: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_adult():\n\n # LOAD DATA FROM FILE.\n filename = \"resources//adult.csv\"\n data = pd.read_csv(filename, header=0, sep=';', na_values='?', skipinitialspace=True)\n\n # Drop rows with no associated attribute to be predicted.\n dataset = data.dropna(axis=0).reset_index(drop=True)\n\n # Tar...
[ "0.69851494", "0.5851929", "0.5836584", "0.5834903", "0.5524742", "0.55068153", "0.54627234", "0.5451403", "0.53736883", "0.5355152", "0.5237675", "0.5232444", "0.5209591", "0.52065873", "0.52061564", "0.5141777", "0.51299536", "0.50939786", "0.50627285", "0.5025816", "0.5016...
0.74761355
0
Fetch the `bankmarketing`_ dataset from OpenML and add `fairness_info`. It contains information from marketing campaigns of a Portuguise bank. The prediction task is a binary classification on whether the client will subscribe a term deposit. Without preprocessing, the dataset has 45,211 rows and 16 columns. There is o...
def fetch_bank_df(preprocess=False): (train_X, train_y), (test_X, test_y) = lale.datasets.openml.fetch( "bank-marketing", "classification", astype="pandas", preprocess=preprocess ) orig_X = pd.concat([train_X, test_X]).sort_index() orig_y = pd.concat([train_y, test_y]).sort_index().astype(np.flo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fetch_creditg_df(preprocess=False):\n (train_X, train_y), (test_X, test_y) = lale.datasets.openml.fetch(\n \"credit-g\", \"classification\", astype=\"pandas\", preprocess=preprocess\n )\n orig_X = pd.concat([train_X, test_X]).sort_index()\n orig_y = pd.concat([train_y, test_y]).sort_index()\...
[ "0.63251835", "0.6065339", "0.571608", "0.5660217", "0.5498817", "0.5390651", "0.5337347", "0.5248668", "0.5205282", "0.520257", "0.51983756", "0.5128283", "0.51207227", "0.51053", "0.5100456", "0.5098109", "0.50645053", "0.5015704", "0.49290195", "0.4923787", "0.49193215", ...
0.7153502
0
Fetch the `compastwoyears`_ dataset, also known as ProPublica recidivism, from OpenML and add `fairness_info`. It contains information about individuals with a binary classification for recidivism, indicating whether they were rearrested within two years after the first arrest. Without preprocessing, the dataset has 5,...
def fetch_compas_df(preprocess=False): (train_X, train_y), (test_X, test_y) = lale.datasets.openml.fetch( "compas", "classification", astype="pandas", preprocess=False ) orig_X = pd.concat([train_X, test_X]).sort_index().astype(np.float64) orig_y = pd.concat([train_y, test_y]).sort_index().astyp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _fetch_poverty_data(year=None):\n global _SIMPLECOUNT_COLUMNS\n\n try:\n if year is None:\n year = _get_max_year([30, 31]) + 1\n ext = 'txt' if year > 2003 else 'dat'\n url = f'https://www2.census.gov/programs-surveys/saipe/datasets/{year}/{year}-state-and-county/est{str(y...
[ "0.5696417", "0.5382185", "0.53093463", "0.5219285", "0.5203716", "0.50891244", "0.50868815", "0.50795543", "0.4973219", "0.49639267", "0.48544794", "0.48360437", "0.47963792", "0.47578", "0.47394678", "0.47330853", "0.47229314", "0.4706171", "0.46899372", "0.46881524", "0.46...
0.57578635
0
Fetch the `creditg`_ dataset from OpenML and add `fairness_info`. It contains information about individuals with a binary classification into good or bad credit risks. Without preprocessing, the dataset has 1,000 rows and 20 columns. There are two protected attributs, personal_status/sex and age, and the disparate impa...
def fetch_creditg_df(preprocess=False): (train_X, train_y), (test_X, test_y) = lale.datasets.openml.fetch( "credit-g", "classification", astype="pandas", preprocess=preprocess ) orig_X = pd.concat([train_X, test_X]).sort_index() orig_y = pd.concat([train_y, test_y]).sort_index() if preproces...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fetch_bank_df(preprocess=False):\n (train_X, train_y), (test_X, test_y) = lale.datasets.openml.fetch(\n \"bank-marketing\", \"classification\", astype=\"pandas\", preprocess=preprocess\n )\n orig_X = pd.concat([train_X, test_X]).sort_index()\n orig_y = pd.concat([train_y, test_y]).sort_index...
[ "0.6245842", "0.62042207", "0.5980086", "0.5979343", "0.596901", "0.5781662", "0.5664889", "0.54308754", "0.52764714", "0.523854", "0.52193516", "0.5175672", "0.51554215", "0.51460844", "0.5101795", "0.5093209", "0.5040949", "0.5015455", "0.500302", "0.4987256", "0.4943781", ...
0.7794629
0
Fetch the `ricci_vs_destefano`_ dataset from OpenML and add `fairness_info`. It contains test scores for 2003 New Haven Fire Department promotion exams with a binary classification into promotion or no promotion. Without preprocessing, the dataset has 118 rows and 5 columns. There is one protected attribute, race, and ...
def fetch_ricci_df(preprocess=False): (train_X, train_y), (test_X, test_y) = lale.datasets.openml.fetch( "ricci", "classification", astype="pandas", preprocess=preprocess ) orig_X = pd.concat([train_X, test_X]).sort_index() orig_y = pd.concat([train_y, test_y]).sort_index() if preprocess: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_crime():\n\n # LOAD DATA FROM FILE.\n # filename = \"resources\\CommViolPredUnnormalizedData.csv\"\n filename = os.path.join('resources', 'CommViolPredUnnormalizedData.csv')\n data = pd.read_csv(filename, header=0, sep=';', na_values='?', skipinitialspace=True)\n data = data.sample(frac=1, ...
[ "0.60793525", "0.56824106", "0.55488175", "0.5391206", "0.5280374", "0.5272079", "0.5163806", "0.5151898", "0.51127636", "0.5112031", "0.5104344", "0.5057335", "0.5053118", "0.5042274", "0.5005593", "0.49973428", "0.49894446", "0.49864098", "0.4983684", "0.49792227", "0.49539...
0.64957756
0
Fetch the `SpeedDating`_ dataset from OpenML and add `fairness_info`. It contains data gathered from participants in experimental speed dating events from 20022004 with a binary classification into match or no match. Without preprocessing, the dataset has 8378 rows and 122 columns. There are two protected attributes, w...
def fetch_speeddating_df(preprocess=False): (train_X, train_y), (test_X, test_y) = lale.datasets.openml.fetch( "SpeedDating", "classification", astype="pandas", preprocess=preprocess ) orig_X = pd.concat([train_X, test_X]).sort_index() orig_y = pd.concat([train_y, test_y]).sort_index() if pr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fetch_adult_df(preprocess=False):\n (train_X, train_y), (test_X, test_y) = lale.datasets.openml.fetch(\n \"adult\", \"classification\", astype=\"pandas\", preprocess=preprocess\n )\n orig_X = pd.concat([train_X, test_X]).sort_index()\n orig_y = pd.concat([train_y, test_y]).sort_index()\n ...
[ "0.6423143", "0.56349117", "0.55778897", "0.55274427", "0.543159", "0.54287815", "0.54009044", "0.53658", "0.53312093", "0.5254397", "0.5204903", "0.5196296", "0.51811713", "0.5179319", "0.51710814", "0.5153022", "0.51122874", "0.5095287", "0.50768846", "0.5049329", "0.504363...
0.7672038
0
Fetch the `Boston housing`_ dataset from sklearn and add `fairness info`. It contains data about housing values in the suburbs of Boston with various features that can be used to perform regression. Without preprocessing, the dataset has 506 rows and 14 columns. There is one protected attribute, 1000(Bk 0.63)^2 where B...
def fetch_boston_housing_df(preprocess=False): (train_X, train_y), (test_X, test_y) = lale.datasets.boston_housing_df( test_size=0.33 ) orig_X = pd.concat([train_X, test_X]).sort_index() orig_y = pd.concat([train_y, test_y]).sort_index() black_median = np.median(train_X["B"]) label_media...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def boston_housing(path):\n import pandas as pd\n path = os.path.expanduser(path)\n filename = 'housing.data'\n if not os.path.exists(os.path.join(path, filename)):\n url = 'https://archive.ics.uci.edu/ml/machine-learning-databases/' \\\n 'housing/housing.data'\n maybe_download_and_extract(path,...
[ "0.6684607", "0.581394", "0.5723166", "0.5659722", "0.5574842", "0.5574334", "0.5517893", "0.55022323", "0.54419386", "0.5398367", "0.5341427", "0.53124756", "0.5263555", "0.52362233", "0.5231383", "0.5202813", "0.51838523", "0.5171175", "0.51505613", "0.5139579", "0.5131126"...
0.7559818
0
Fetch the `Titanic`_ dataset from OpenML and add `fairness_info`. It contains data gathered from passengers on the Titanic with a binary classification into "survived" or "did not survive". Without preprocessing, the dataset has 1309 rows and 13 columns. There are two protected attributes, sex and age, and the disparat...
def fetch_titanic_df(preprocess=False): (train_X, train_y), (test_X, test_y) = lale.datasets.openml.fetch( "titanic", "classification", astype="pandas", preprocess=preprocess ) orig_X = pd.concat([train_X, test_X]).sort_index() orig_y = pd.concat([train_y, test_y]).sort_index() if preprocess...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fetch_adult_df(preprocess=False):\n (train_X, train_y), (test_X, test_y) = lale.datasets.openml.fetch(\n \"adult\", \"classification\", astype=\"pandas\", preprocess=preprocess\n )\n orig_X = pd.concat([train_X, test_X]).sort_index()\n orig_y = pd.concat([train_y, test_y]).sort_index()\n ...
[ "0.6747928", "0.63016564", "0.62839663", "0.60561347", "0.60010546", "0.59578633", "0.58950406", "0.5850569", "0.5814808", "0.5755448", "0.5728233", "0.5719631", "0.55487067", "0.5457546", "0.54344165", "0.5389166", "0.5348718", "0.52571726", "0.5237557", "0.5216662", "0.5209...
0.7596984
0
Fetch a subset of the `MEPS`_ dataset from aif360 and add fairness info. It contains information collected on a nationally representative sample of the civilian noninstitutionalized population of the United States, specifically reported medical expenditures and civilian demographics. This dataframe corresponds to data ...
def fetch_meps_panel19_fy2015_df(preprocess=False): if preprocess: dataset = aif360.datasets.MEPSDataset19() return _get_pandas_and_fairness_info_from_meps_dataset(dataset) else: return _fetch_meps_raw_df(Panel.PANEL19, FiscalYear.FY2015)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fetch_meps_panel20_fy2015_df(preprocess=False):\n if preprocess:\n dataset = aif360.datasets.MEPSDataset20()\n return _get_pandas_and_fairness_info_from_meps_dataset(dataset)\n else:\n return _fetch_meps_raw_df(Panel.PANEL20, FiscalYear.FY2015)", "def fetch_meps_panel21_fy2016_df(p...
[ "0.64445114", "0.5858826", "0.5274336", "0.52656657", "0.52416533", "0.52222276", "0.5196359", "0.5155861", "0.5104297", "0.50710475", "0.50138426", "0.50120264", "0.49469", "0.49226528", "0.4912551", "0.49049845", "0.48814613", "0.48812187", "0.48770392", "0.48349184", "0.48...
0.60806876
1
Fetch a subset of the `MEPS`_ dataset from aif360 and add fairness info. It contains information collected on a nationally representative sample of the civilian noninstitutionalized population of the United States, specifically reported medical expenditures and civilian demographics. This dataframe corresponds to data ...
def fetch_meps_panel20_fy2015_df(preprocess=False): if preprocess: dataset = aif360.datasets.MEPSDataset20() return _get_pandas_and_fairness_info_from_meps_dataset(dataset) else: return _fetch_meps_raw_df(Panel.PANEL20, FiscalYear.FY2015)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fetch_meps_panel19_fy2015_df(preprocess=False):\n if preprocess:\n dataset = aif360.datasets.MEPSDataset19()\n return _get_pandas_and_fairness_info_from_meps_dataset(dataset)\n else:\n return _fetch_meps_raw_df(Panel.PANEL19, FiscalYear.FY2015)", "def fetch_meps_panel21_fy2016_df(p...
[ "0.61030173", "0.5879692", "0.52908427", "0.52520216", "0.5252003", "0.5244566", "0.5168578", "0.5160194", "0.5130663", "0.50891715", "0.5025752", "0.5015951", "0.49473947", "0.49432728", "0.494278", "0.4915356", "0.48921657", "0.48886055", "0.48507094", "0.48061758", "0.4800...
0.649011
0