query
stringlengths
9
3.4k
document
stringlengths
9
87.4k
metadata
dict
negatives
listlengths
4
101
negative_scores
listlengths
4
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Return True if privacy mode is active.
def is_in_privacy_mode(self) -> bool: return self.data[Attribute.CAMERA_PRIVACY]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_aprentice(self):\n return self.user_profile_status == self.APPRENTICE", "def private(self) -> bool:\n return pulumi.get(self, \"private\")", "def authorized(self) -> bool:\n\n return (\n self.activated\n or self.on_screen\n or self.on_file\n ...
[ "0.6490553", "0.6430658", "0.64281636", "0.638807", "0.63529915", "0.63529915", "0.63529915", "0.6319265", "0.6319265", "0.6319265", "0.6319265", "0.6319265", "0.6319265", "0.6319265", "0.6319265", "0.6319265", "0.6319265", "0.6319265", "0.6319265", "0.6319265", "0.6319265", ...
0.86465675
0
Return True if camera is online.
def is_online(self) -> bool: return self.data[Attribute.ONLINE]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def online(self):\n return False", "def online(self) -> bool:\n\t\treturn self._raw_result['data']['online']", "def is_connected(self):\n if self.server: return True\n return False", "def verify_network_stream(self, link):\n\n cap = cv2.VideoCapture(link)\n if not cap.isOpe...
[ "0.7281513", "0.71982807", "0.70609236", "0.702339", "0.68787086", "0.6874467", "0.68721676", "0.6796776", "0.6791388", "0.6686526", "0.6682214", "0.66420615", "0.6639014", "0.66362894", "0.6620995", "0.6608166", "0.6605227", "0.65999436", "0.65874165", "0.6573971", "0.657156...
0.7001187
4
Camera's wireless signal strength.
def wireless_signal_strength(self) -> int: return self.data[Attribute.WIRELESS_SIGNAL_STRENGTH]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetCurrentSignalStrength(self, iwconfig=None):\n try:\n strength = int(self.wifi.GetSignalStrength(iwconfig))\n except:\n strength = 0\n return strength", "def strength(self) -> float:\n ...", "def sensorStrength(self):\n # TODO: also return type of sens...
[ "0.7031714", "0.6994032", "0.67061955", "0.6649575", "0.64029896", "0.63176775", "0.6286045", "0.61830634", "0.61751175", "0.6073168", "0.6055971", "0.6050908", "0.5939323", "0.59383196", "0.59170634", "0.5894795", "0.5874123", "0.5873845", "0.58524925", "0.5838355", "0.58368...
0.8146503
0
Request a new thumbnail for the camera.
async def request_thumbnail(self) -> None: await self.vivintskyapi.request_camera_thumbnail( self.alarm_panel.id, self.alarm_panel.partition_id, self.id )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def thumbnail(self, thumbnail):\n self._thumbnail = thumbnail", "def set_thumbnail(self, **kwargs):\n self.thumbnail_url = kwargs.get('url')", "def GetThumbnail(self, type, maxsize): # real signature unknown; restored from __doc__\n pass", "def thumbnail(self, width, height, path, **kwargs):...
[ "0.6508987", "0.6476307", "0.6436708", "0.6407975", "0.6400892", "0.63398254", "0.6334903", "0.62879765", "0.6212906", "0.62107", "0.6181639", "0.60656625", "0.6060553", "0.60002947", "0.5988563", "0.59305435", "0.59282035", "0.5918891", "0.5912826", "0.59014267", "0.58705056...
0.821199
0
Return the latest camera thumbnail URL.
async def get_thumbnail_url(self) -> str: # Sometimes this date field comes back with a "Z" at the end # and sometimes it doesn't, so let's just safely remove it. camera_thumbnail_date = datetime.strptime( self.data[Attribute.CAMERA_THUMBNAIL_DATE].replace("Z", ""), "%Y-%...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def last_camera_image_url(self) -> str:\n return self.camera_info[\"cover_path\"]", "def get_thumbnail_url(self):\n if not self.id_video or not self.original_url or not self.xml_response:\n return ''\n return self.xml_response.find('framegrab_url').text", "def get_thumbnail_url(...
[ "0.7910915", "0.7836688", "0.7768984", "0.7726674", "0.7721377", "0.7670391", "0.7665452", "0.76559013", "0.76526964", "0.75800186", "0.75523674", "0.74557847", "0.7306187", "0.7166377", "0.70493877", "0.70226187", "0.7014065", "0.6992731", "0.6937823", "0.6921818", "0.691271...
0.8384189
0
Return the rtsp URL for the camera.
async def get_rtsp_url(self, internal: bool = False, hd: bool = False) -> str: credentials = await self.alarm_panel.get_panel_credentials() url = self.data[f"c{'i' if internal else 'e'}u{'' if hd else 's'}"][0] return f"{url[:7]}{credentials[PanelCredentialAttribute.NAME]}:{credentials[PanelCred...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rtsp_stream_url(self) -> str:\n return self.properties.get(MessageField.RTSP_STREAM_URL.value)", "async def get_direct_rtsp_url(self, hd: bool = False) -> str:\n return (\n f\"rtsp://{self.data[Attribute.USERNAME]}:{self.data[Attribute.PASSWORD]}@{self.ip_address}:{self.data[Attribut...
[ "0.79006195", "0.689613", "0.6728681", "0.63702255", "0.6178544", "0.61279833", "0.6083949", "0.6080557", "0.5965044", "0.575143", "0.5714059", "0.56403685", "0.5609133", "0.55965275", "0.5580069", "0.55688417", "0.5547634", "0.55053115", "0.55026656", "0.5496402", "0.5487867...
0.6958374
1
Return the direct rtsp url for this camera, in HD if requested, if any.
async def get_direct_rtsp_url(self, hd: bool = False) -> str: return ( f"rtsp://{self.data[Attribute.USERNAME]}:{self.data[Attribute.PASSWORD]}@{self.ip_address}:{self.data[Attribute.CAMERA_IP_PORT]}/{self.data[Attribute.CAMERA_DIRECT_STREAM_PATH if hd else Attribute.CAMERA_DIRECT_STREAM_PATH_STANDA...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rtsp_stream_url(self) -> str:\n return self.properties.get(MessageField.RTSP_STREAM_URL.value)", "async def get_rtsp_url(self, internal: bool = False, hd: bool = False) -> str:\n credentials = await self.alarm_panel.get_panel_credentials()\n url = self.data[f\"c{'i' if internal else 'e'}...
[ "0.72032493", "0.68680316", "0.61045647", "0.60359323", "0.6011566", "0.5905714", "0.5760486", "0.56779563", "0.5652585", "0.56033957", "0.55442023", "0.5505961", "0.5492464", "0.5490018", "0.5473845", "0.5441808", "0.5429904", "0.54259044", "0.54249716", "0.53899205", "0.534...
0.76972985
0
Handle a pubnub message addressed to this camera.
def handle_pubnub_message(self, message: dict) -> None: super().handle_pubnub_message(message) event = None if message.get(Attribute.CAMERA_THUMBNAIL_DATE): event = THUMBNAIL_READY elif message.get(Attribute.DING_DONG): event = DOORBELL_DING elif message...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _handle_message(self, msg):\n self.event('message', msg)", "def handle(self, message):\n print(\"You received a message:\")\n print(message)\n # Overwrite this function to do something with the message!", "def received_message(self, m):\n self.receiver.handle_message(m)",...
[ "0.7261088", "0.6893499", "0.689115", "0.67964315", "0.6787809", "0.6784308", "0.67636156", "0.6758844", "0.67415947", "0.6718704", "0.67065203", "0.66710377", "0.66152173", "0.6600205", "0.65741396", "0.65554744", "0.6550199", "0.6538151", "0.6529823", "0.65268636", "0.65175...
0.7852151
0
Return all .js files in the project root folder The project file is not included.
def get_all_js_files(self, root): res = [] for fname in os.listdir(root): mo = re.match(r'(\w+)\.js$', fname) if mo: res.append({ 'name': mo.group(1), 'src': file_contents(os.path.join(root, mo.group())) }) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def collect_project_source_files():\n source_files = glob.glob(PROJECT_SOURCE_FILES_FOLDER + '/**/*.py', recursive=True)\n # Insert root main.py at the beginning.\n source_files.insert(0, os.path.join(PROJECT_ROOT_FOLDER, 'main.py'))\n return list(map(lambda path: posixpath.join(*path.split('\\\\')), s...
[ "0.7026188", "0.663383", "0.66265917", "0.6534242", "0.6475579", "0.6318005", "0.62322176", "0.62103647", "0.62050897", "0.61848503", "0.618283", "0.6143342", "0.6108959", "0.60054374", "0.59731764", "0.59707844", "0.5969685", "0.5961811", "0.59470624", "0.59345275", "0.59284...
0.7880714
0
Load data from csv.
def load_data(): # Load data X_train = pd.read_csv( "data/trimmed_merged_no_track_id_or_session_id.csv" ) # load data from csv drop_columns = ["mode"] # drop unimportant columns X_train.drop(labels=drop_columns, axis=1, inplace=True) y_train = X_train["skip"] X_train.drop(labels=...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_csv():", "def loadCSV(input_file):", "def read_csv(self, csv_input):\n # https://stackoverflow.com/a/45063514\n dtypes = {\n 'lat': 'U',\n 'long': 'U'\n }\n csv_data = pd.read_csv(csv_input, encoding='UTF-8', sep=',', na_values=[''], dtype=dtypes)\n\n ...
[ "0.78015375", "0.7773901", "0.75440395", "0.7447164", "0.7401897", "0.7377548", "0.7352664", "0.7304863", "0.7292403", "0.7289765", "0.72523564", "0.7250736", "0.7196531", "0.7195724", "0.7157978", "0.7074943", "0.7060418", "0.70362383", "0.7036197", "0.7026979", "0.70115405"...
0.0
-1
Returns accuracy on test set.
def get_test_accuracy(model, X_test, y_test): # Make predictions - test accuracy test_pred = model.predict(X_test) score = accuracy_score(test_pred, y_test) print("Test Accuracy:", score) return test_pred
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getAccuracy(self):\n\t\tcorrect = (self.testing[self.classLabel]==self.bestLabel).sum()\n\t\tself.accuracy = (correct/float(len(self.testing))) * 100.0", "def get_accuracy(self) -> float:\n self.network.load_data()\n self.network.train()\n\n n = len(self.network.y_test)\n correct ...
[ "0.8180938", "0.81681293", "0.8084099", "0.8014265", "0.7994126", "0.79616797", "0.7932465", "0.7924577", "0.7861055", "0.7811287", "0.7755529", "0.77538913", "0.77185225", "0.77163464", "0.7673537", "0.7650585", "0.76219594", "0.75354797", "0.7525053", "0.75063103", "0.74756...
0.7460319
21
Displays normalized confusion matrix.
def create_confusion_matrix(model, X_test, y_test, test_pred, title): # Confusion matrix class_names = ["Skipped", "Not Skipped"] print("Confusion Matrix: %s" % title) print(confusion_matrix(y_test, test_pred)) disp = plot_confusion_matrix( model, X_test, y_test, dis...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def showConfusionMatrix(self): \r\n sn.heatmap(self.conf_matrix, annot=True)\r\n plt.plot( label=\"Accuracy\")\r\n plt.plot( label=\"Error\")\r\n plt.figtext(0,0,'Accuracy: {}\\nError: {}\\nRecall: {}\\nPrecision: {}'.format(self.accuracy,\r\n ...
[ "0.769349", "0.76869637", "0.751314", "0.74637914", "0.7293348", "0.7269612", "0.72648704", "0.72433674", "0.72433656", "0.7228648", "0.7225077", "0.72247624", "0.7224549", "0.7219793", "0.7218805", "0.72116745", "0.71959615", "0.71941775", "0.71938807", "0.71917826", "0.7187...
0.0
-1
if we've got a cropping annotation for the given fieldname and scale, set self._rescale to False, to prevent plone.app.imaging traverser to overwrite our cropped scale since the self.modified() method does not know about the currently requested scale name, we need to use the _rescale property
def _need_rescale(self, fieldname, scale): cropped = IAnnotations(self.context).get(PAI_STORAGE_KEY) if cropped and '%s_%s' % (fieldname, scale) in cropped: self._allow_rescale = False else: self._allow_rescale = True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _crop(self, fieldname, scale, box):\n croputils = IImageCroppingUtils(self.context)\n data = croputils.get_image_data(fieldname)\n\n original_file = StringIO(data)\n image = PIL.Image.open(original_file)\n image_format = image.format or self.DEFAULT_FORMAT\n\n cropped_...
[ "0.7229034", "0.6486539", "0.63547015", "0.6094969", "0.5937726", "0.5919167", "0.5832441", "0.5809148", "0.57294387", "0.56831604", "0.5682105", "0.55893314", "0.557489", "0.55414176", "0.55127174", "0.5507968", "0.5507968", "0.5496308", "0.54725057", "0.54692656", "0.546926...
0.87613535
0
we overwrite the default method that would return the modification time of the context, to return a way back modification time in case the currently requested scale is a cropped scale. (so plone.scale does not create a new scale w/o cropping information
def modified(self): if self._allow_rescale: return super(ImageScaling, self).modified() else: return 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def modified(self):\n if self._allow_rescale:\n return super(NamedfileImageScaling, self).modified()\n else:\n return 1", "def get_modified_time(self, name):\n raise NotImplementedError(\n \"subclasses of Storage must provide a get_modified_ti...
[ "0.6460381", "0.56831473", "0.5679432", "0.5437756", "0.53410375", "0.5333899", "0.5274236", "0.5244045", "0.51951635", "0.51917946", "0.516668", "0.51533455", "0.51174325", "0.5113334", "0.509966", "0.5089414", "0.5071341", "0.5068429", "0.5064854", "0.50535154", "0.50339556...
0.6318901
1
we overwrite the default method that would return the modification time of the context, to return a way back modification time in case the currently requested scale is a cropped scale. (so plone.scale does not create a new scale w/o cropping information
def modified(self): if self._allow_rescale: return super(NamedfileImageScaling, self).modified() else: return 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def modified(self):\n if self._allow_rescale:\n return super(ImageScaling, self).modified()\n else:\n return 1", "def get_modified_time(self, name):\n raise NotImplementedError(\n \"subclasses of Storage must provide a get_modified_time() method\"\n )"...
[ "0.63181275", "0.5682004", "0.56780356", "0.5436276", "0.53405464", "0.53323674", "0.52736956", "0.5243496", "0.5193847", "0.5192097", "0.51653427", "0.51530874", "0.51168525", "0.5112648", "0.50986654", "0.5087256", "0.5069669", "0.50668234", "0.5063405", "0.50531495", "0.50...
0.6459762
0
Do NOT initialize directly, use ChartManager.get_chart method
def __init__( self, parent: Widget, chart_manager, pair_color: LinkColor, gran_color: LinkColor, quote_kind_color: LinkColor, flags: bool, width: int, height: int, ): Initializer.initialize(parent.winfo_toplevel()) Frame.__init_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _charts(self):\n # lazy instantiation here to avoid creating the charts object unless needed.\n if self.__charts is None:\n self.__charts = Charts(self)\n self.AddObserver(\"StartEvent\", partial(try_callback, self._before_render_event))\n return self.__charts", "de...
[ "0.73053795", "0.71199065", "0.6492899", "0.6401118", "0.6342331", "0.6342331", "0.6255669", "0.62405497", "0.6101077", "0.60051626", "0.59999484", "0.598143", "0.59550667", "0.5876069", "0.58671856", "0.58526546", "0.58114016", "0.5807358", "0.5770516", "0.57400477", "0.5738...
0.0
-1
Set the pair and reload data if its new.
def set_pair(self, pair: Pair): if pair != self.pair: self.pair = pair self.load_candles()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_pair(self, pair: StudentPair) -> None:\n self._edit_pair = pair\n self.line_edit_title.setText(str(self._edit_pair[\"title\"]))\n self.line_edit_lecturer.setText(str(self._edit_pair[\"lecturer\"]))\n self.combo_box_type.setCurrentText(str(self._edit_pair[\"type\"]))\n sel...
[ "0.6273834", "0.62562305", "0.62263435", "0.6111727", "0.5962303", "0.59485316", "0.59118456", "0.5875051", "0.58309335", "0.58295953", "0.58218694", "0.58065355", "0.5751621", "0.5708703", "0.5699012", "0.56972504", "0.5696664", "0.5620271", "0.55983835", "0.5595588", "0.559...
0.76077706
0
Set the granularity and reload data if its new.
def set_gran(self, gran: Gran): if gran != self.gran: self.gran = gran self.load_candles()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _resolution_changed(self):\n self.reinitialiseData()", "def reload(self):\n self._populate(self.hierarchy[-1])", "def refresh(self) -> None:\n self.data = {}\n self.load_settings_file(self.default_settings_path / \"settings.yaml\", file_key=\"internal\")\n self.load_syste...
[ "0.5652916", "0.5497101", "0.54564565", "0.5395625", "0.53053933", "0.5266499", "0.51898026", "0.51679134", "0.5159813", "0.5147838", "0.51331675", "0.5116666", "0.5112451", "0.50447494", "0.5042116", "0.5025085", "0.50143266", "0.50115645", "0.49833155", "0.4946549", "0.4946...
0.61495394
0
Set the quote kind and reload data if its new.
def set_quote_kind(self, quote_kind: QuoteKind): if quote_kind != self.quote_kind: self.quote_kind = quote_kind if self.geo is None: self.load_candles() else: self.geo.update(quote_kind=quote_kind) self.chart.redraw(self.geo)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def quotes(self, quotes):\n\n self._quotes = quotes", "def quote_type(self, quote_type):\n allowed_values = [None,\"Price\", \"Spread\", \"Rate\", \"LogNormalVol\", \"NormalVol\", \"ParSpread\", \"IsdaSpread\", \"Upfront\", \"Index\", \"Ratio\", \"Delta\", \"PoolFactor\"] # noqa: E501\n if ...
[ "0.61072516", "0.60456073", "0.5505138", "0.5404351", "0.5160823", "0.51101786", "0.50316006", "0.5006308", "0.49826854", "0.4947969", "0.4940617", "0.49285766", "0.492396", "0.49115217", "0.49072197", "0.49046135", "0.48957124", "0.48728767", "0.48653087", "0.48302495", "0.4...
0.8109521
0
Get start time of a request
def before_request(): request._prometheus_metrics_request_start_time = time.time()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start_time(self):\n return self._get(\"start_time\")", "def start_time(self) -> str:\n return pulumi.get(self, \"start_time\")", "def start_time(self) -> str:\n return pulumi.get(self, \"start_time\")", "def start_time(self):\n return self._meta['start_time']", "def start_ti...
[ "0.7987992", "0.77852345", "0.77852345", "0.7713794", "0.76825255", "0.7674555", "0.76548463", "0.76548463", "0.76548463", "0.76548463", "0.76548463", "0.76548463", "0.76548463", "0.76548463", "0.7601079", "0.7601079", "0.75667506", "0.7550781", "0.7533342", "0.75080675", "0....
0.0
-1
Register Prometheus metrics after each request
def after_request(response): request_latency = time.time() - request._prometheus_metrics_request_start_time METRICS_REQUEST_LATENCY.labels(request.method, request.path).observe( request_latency ) METRICS_REQUEST_COUNT.labels( request.method, request.path, response.status_code ).inc()...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def before_request():\n request._prometheus_metrics_request_start_time = default_timer()", "def before_request():\n request._prometheus_metrics_request_start_time = time.time()", "def register_prometheus(app: Flask, registry=REGISTRY) -> None:\n\n def after(response: Response) -> Response:\n en...
[ "0.7261535", "0.7187321", "0.71751827", "0.69744253", "0.67358434", "0.6703973", "0.65655565", "0.61613506", "0.60699874", "0.59922606", "0.5975581", "0.5957732", "0.59373957", "0.59337866", "0.59261703", "0.5708112", "0.56908506", "0.56708866", "0.5616908", "0.5616374", "0.5...
0.65932864
6
Envia un mensaje de registro al servicio de registro usando una performativa Request y una accion Register del servicio de directorio
def register_message(): global mss_cnt gmess = Graph() # Construimos el mensaje de registro gmess.bind('foaf', FOAF) gmess.bind('dso', DSO) reg_obj = agn[InfoAgent.name+'-Register'] gmess.add((reg_obj, RDF.type, DSO.Register)) gmess.add((reg_obj, DSO.Uri, InfoAgent.uri)) gmess.add(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def register_message():\n\n logger.info('Nos registramos')\n\n gr = register_agent(AgGestordeTransporte, DirectoryAgent, AgGestordeTransporte.uri, get_count())\n return gr", "def register_message():\n global mss_cnt\n\n gmess = Graph()\n\n # Construimos el mensaje de registro\n gmess.bind('f...
[ "0.6691251", "0.6527108", "0.6477159", "0.6445688", "0.59789985", "0.5869981", "0.58134043", "0.57443154", "0.5697601", "0.56877166", "0.5673448", "0.5609995", "0.56073344", "0.5529587", "0.5469366", "0.54542726", "0.5444462", "0.54406416", "0.54077536", "0.5405717", "0.53978...
0.6426234
4
Permite la comunicacion con el agente via un navegador via un formulario
def browser_iface(): return 'Nothing to see here'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def registrarAgenteJogador(self):\r\n return", "def registrarAgenteJogador(self):\r\n return 1", "def comunicacion():\n global dsgraph\n global mss_cnt\n\n #Extraemos el mensaje y creamos un grafo con el\n message= request.args['content']\n gm = Graph()\n gm.parse(data=message)\...
[ "0.6522337", "0.64792037", "0.6301096", "0.6174628", "0.60004866", "0.59829485", "0.58120006", "0.58120006", "0.57704735", "0.5689164", "0.56864554", "0.56029874", "0.5602099", "0.5598478", "0.5560209", "0.55412084", "0.5537694", "0.5468752", "0.54232013", "0.54169464", "0.54...
0.0
-1
Entrypoint que para el agente
def stop(): tidyup() shutdown_server() return "Parando Servidor"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main(self):\r\n pass", "def entry_point():", "def entry_point():", "def entry_point():", "def main(self) -> None:\n pass", "def launch(self):", "def main(self):", "def run(self):\n \n pass", "def run(self):\n pass", "def run(self):\n pass", "def run(sel...
[ "0.7666677", "0.73571783", "0.73571783", "0.73571783", "0.7303973", "0.7302566", "0.72822535", "0.7276224", "0.7247397", "0.7247397", "0.7247397", "0.7247397", "0.7247397", "0.7247397", "0.7247397", "0.7247397", "0.7247397", "0.7247397", "0.7247397", "0.7247397", "0.7247397",...
0.0
-1
Entrypoint de comunicacion del agente Simplementet retorna un objeto fijo que representa una respuesta a una busqueda de hotel Asumimos que se reciben siempre acciones que se refieren a lo que puede hacer el agente (buscar con ciertas restricciones, reservar) Las acciones se mandan siempre con un Request Prodriamos res...
def comunicacion(): global dsgraph global mss_cnt #Extraemos el mensaje y creamos un grafo con el message= request.args['content'] gm = Graph() gm.parse(data=message) msgdic = get_message_properties(gm) # Comprobamos que sea un mensaje FIPA ACL if msgdic is None: # Si no e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\n params = demisto.params()\n service_principal = params.get('credentials', {}).get('identifier')\n secret = params.get('credentials', {}).get('password')\n\n # Remove trailing slash to prevent wrong URL path to service\n server_url = params['url'][:-1] if (params['url'] and params['url'...
[ "0.55482316", "0.55241877", "0.54317117", "0.5350504", "0.5336382", "0.5291278", "0.5161638", "0.51271015", "0.50222015", "0.49934793", "0.49824604", "0.4941026", "0.4907765", "0.48800912", "0.48760772", "0.48596963", "0.48327702", "0.48133352", "0.48021013", "0.47898054", "0...
0.5444783
2
Acciones previas a parar el agente
def tidyup(): global cola1 cola1.put(0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def onActionTaken(self, agent):\n\n pass", "def transact(self):", "def transact(self):", "def step_forward(self):", "def after_turn(self):\n pass", "def prev_action(self):\n raise NotImplementedError", "def onTrainStepTaken(self, agent):\n pass", "def take_one_step(self):\n\t\...
[ "0.61127394", "0.5894486", "0.5894486", "0.5766817", "0.5702878", "0.5650589", "0.56006277", "0.55813426", "0.5556894", "0.5546448", "0.5490769", "0.5456815", "0.54158676", "0.54030174", "0.539905", "0.53859925", "0.53773886", "0.5372", "0.5372", "0.5356669", "0.53446186", ...
0.0
-1
Un comportamiento del agente
def agentbehavior1(cola): # Registramos el agente gr = register_message() # Escuchando la cola hasta que llegue un 0 fin = False while not fin: while cola.empty(): pass v = cola.get() if v == 0: fin = True else: print v # Self...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def registrarAgenteJogador(self):\r\n return 1", "def _compute_aero_torque(self):\n pass", "def get_effective_agent(self):\n raise Unimplemented()", "def registrarAgenteJogador(self):\r\n return", "def crier_ordres(self, personnage):\n adverse = self.adverse\n msg ...
[ "0.5817508", "0.5582098", "0.5572627", "0.54882556", "0.5440284", "0.5395733", "0.5393866", "0.5352673", "0.5327155", "0.52700335", "0.52678186", "0.5248248", "0.520054", "0.5200132", "0.5191209", "0.51896375", "0.51809883", "0.518049", "0.5152505", "0.51451963", "0.51447564"...
0.5321401
10
Return a list of completion strings Simple completion based on pythonlike identifiers and whitespace
def get_completions(self, info): items = [] if (info.line.strip().startswith(('import ', 'from ')) and info.is_python_like): items += module_completion(info.line, [info.filename]) elif info.obj: base = info.obj tokens = set(info.split_wo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def completenames(self, text, line, begidx, endidx):\n command = text\n if self.case_insensitive:\n command = text.lower()\n\n # Call super class method. Need to do it this way for Python 2 and 3 compatibility\n cmd_completion = cmd.Cmd.completenames(self, command)\n\n ...
[ "0.6619886", "0.66005045", "0.6515913", "0.63659024", "0.6294996", "0.6283689", "0.62707794", "0.6202358", "0.6130983", "0.61280894", "0.6114059", "0.6094237", "0.6084692", "0.6065162", "0.6063104", "0.6040103", "0.6009062", "0.5986601", "0.59493244", "0.59490955", "0.5941500...
0.6904953
0
Find the definition for an object within a set of source code This is used to find the path of pythonlike modules (e.g. cython and enaml) for a goto definition
def get_definition(self, info): token = info.obj lines = info.lines source_code = info.source_code filename = info.filename line_nr = None if '.' in token: token = token.split('.')[-1] line_nr = get_definition_with_regex(source_code, token,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def findsource(object):\r\n file = getsourcefile(object)\r\n if not file:\r\n raise IOError('source code not available')\r\n module = getmodule(object, file)\r\n if module:\r\n lines = linecache.getlines(file, module.__dict__)\r\n else:\r\n lines = linecache.getlines(file)\r\n ...
[ "0.6904011", "0.6001746", "0.59132284", "0.58806264", "0.5847208", "0.58444947", "0.5813577", "0.5789314", "0.567056", "0.5662456", "0.5642679", "0.56179917", "0.56179917", "0.56179917", "0.56179917", "0.56179917", "0.56179917", "0.56179917", "0.56179917", "0.56179917", "0.56...
0.639387
1
Locate a module path based on an import line in an pythonlike file import_line is the line of source code containing the import alt_path specifies an alternate base path for the module stop_token specifies the desired name to stop on This is used to a find the path to pythonlike modules (e.g. cython and enaml) for a go...
def python_like_mod_finder(import_line, alt_path=None, stop_token=None): if stop_token and '.' in stop_token: stop_token = stop_token.split('.')[-1] tokens = re.split(r'\W', import_line) if tokens[0] in ['from', 'import']: # find the base location tr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def moduleCompletion(line):\n def tryImport(mod, only_modules=False):\n def isImportable(module, attr):\n if only_modules:\n return inspect.ismodule(getattr(module, attr))\n else:\n return not(attr[:2] == '__' and attr[-2:] == '__')\n try:\n ...
[ "0.64819837", "0.6139575", "0.6079234", "0.5968648", "0.5918364", "0.5828221", "0.55816394", "0.5489672", "0.544243", "0.5438753", "0.5432876", "0.5428505", "0.5426799", "0.542341", "0.53607404", "0.5345444", "0.5345008", "0.53337634", "0.5321171", "0.5308447", "0.5307642", ...
0.811714
0
Find the definition of an object within a source closest to a given line
def get_definition_with_regex(source, token, start_line=-1): if not token: return None if DEBUG_EDITOR: t0 = time.time() patterns = [ # python / cython keyword definitions '^c?import.*\W{0}{1}', 'from.*\W{0}\W.*c?import ', 'from .* c?i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_relevant_line(self):\n # () -> (Phi.Line)\n line_name = self._get_line_name()\n print(\"looking for \"+str(line_name))\n return Phi.findLine(line_name)", "def findsource(object):\r\n file = getsourcefile(object)\r\n if not file:\r\n raise IOError('source code not...
[ "0.6721103", "0.6425865", "0.594324", "0.5941179", "0.59397006", "0.59163904", "0.5842844", "0.58050025", "0.5782345", "0.5758031", "0.5743304", "0.5533894", "0.5482378", "0.54344255", "0.5429776", "0.54285425", "0.5424473", "0.54120266", "0.5374897", "0.5373373", "0.5371944"...
0.66474533
1
Return a list of all pythonlike extensions
def python_like_exts(): exts = [] for lang in sourcecode.PYTHON_LIKE_LANGUAGES: exts.extend(list(sourcecode.ALL_LANGUAGES[lang])) return ['.' + ext for ext in exts]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extensions():\n\n pass", "def all_editable_exts():\r\n exts = []\r\n for (language, extensions) in sourcecode.ALL_LANGUAGES.items():\r\n exts.extend(list(extensions))\r\n return ['.' + ext for ext in exts]", "def get_loaded_extensions():\n raise NotImplementedError()", "def get_supp...
[ "0.7843823", "0.77088356", "0.7419539", "0.7320552", "0.714457", "0.70847607", "0.70469284", "0.7008349", "0.6991765", "0.6977103", "0.69406205", "0.69406205", "0.6892772", "0.68143374", "0.6790699", "0.67160887", "0.6696911", "0.6656253", "0.665139", "0.6639324", "0.66269875...
0.86687607
0
Return a list of all editable extensions
def all_editable_exts(): exts = [] for (language, extensions) in sourcecode.ALL_LANGUAGES.items(): exts.extend(list(extensions)) return ['.' + ext for ext in exts]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_extensions(self, **_params):\r\n return self.get(self.extensions_path, params=_params)", "def extensions(self):\n return list(self._list(extension.Extension, paginated=False))", "def extensions(self):\n return self.properties.get('extensions',\n E...
[ "0.6947238", "0.6891938", "0.6843709", "0.6733824", "0.66740257", "0.66740257", "0.6525709", "0.63423103", "0.6303439", "0.62761074", "0.6270803", "0.624791", "0.62398034", "0.61868507", "0.6155842", "0.604202", "0.6034626", "0.6003988", "0.5982591", "0.5959434", "0.59400076"...
0.82879215
0
Perform completion of filesystem path.
def _complete_path(path=None): if not path: return _listdir('.') dirname, rest = os.path.split(path) tmp = dirname if dirname else '.' res = [p for p in _listdir(tmp) if p.startswith(rest)] # more than one match, or single match which does not exist (typo) if len(res) > 1 or not o...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def completion() -> None:", "def finish_path(self, last_val=0):\n if self.adv_fn == \"simple\":\n self.rtg_finish_path()\n elif self.adv_fn == \"adv\":\n self.adv_path_finish()\n else:\n self.gae_path_finish(last_val)\n self.path_start_idx = self.ptr",...
[ "0.6521788", "0.64863706", "0.6081697", "0.58194625", "0.56301624", "0.56139445", "0.55415404", "0.5516951", "0.55002517", "0.54814917", "0.54412085", "0.5404463", "0.53575504", "0.5347605", "0.5322104", "0.53052616", "0.5289109", "0.5282877", "0.52677727", "0.52631444", "0.5...
0.4867119
88
Tests the recipe for AWS>GCP disk copy.
def testRunRecipe(self): warnings.filterwarnings( action="ignore", message="unclosed", category=ResourceWarning) # Load the recipe, set the arguments, and run self.test_state.LoadRecipe(RECIPE, TEST_MODULES) self.test_state.command_line_options = { 'aws_region': self.aws_region, 'gc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testFetchGs(self):\n # pylint: disable=unused-argument\n def _Fetch(_ctx, cmd, capture_output):\n # Touch file we tried to copy too.\n osutils.Touch(cmd[-1])\n\n self.gs_mock.AddCmdResult(\n ['cp', '-v', '--', partial_mock.Ignore(), partial_mock.Ignore()],\n side_effect=_Fetch)...
[ "0.64040744", "0.6082685", "0.57742435", "0.5700392", "0.5675572", "0.56447816", "0.56269157", "0.5600139", "0.55963385", "0.55918896", "0.55627227", "0.5555737", "0.55307716", "0.5498585", "0.54770666", "0.5464479", "0.54632187", "0.5451441", "0.54501855", "0.54433", "0.5442...
0.70389867
0
Clean up after the test.
def tearDown(self): log.warning("Cleaning up after test...") # All of the following artefacts are created: AWSSnapshot, AWSS3Object, # GCSObject, GCEImage, GCEDisk for c in self.test_state.GetContainers(containers.AWSSnapshot): self._removeAWSSnapshot(c.id) for c in self.test_state.GetContaine...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tearDown(self):\n self.tmp.cleanup()", "def cleanup(self):\n pass", "def cleanup(self):\n pass", "def cleanup(self):\n pass", "def cleanup(self):\n pass", "def cleanup(self):\n pass", "def cleanup(self):\n pass", "def cleanup(self):\n pass",...
[ "0.8629318", "0.8455004", "0.8455004", "0.8455004", "0.8455004", "0.8455004", "0.8455004", "0.8455004", "0.8455004", "0.8455004", "0.8455004", "0.8455004", "0.84468895", "0.8403054", "0.8403054", "0.8394459", "0.8363534", "0.8363534", "0.8363534", "0.8357604", "0.8357604", ...
0.0
-1
Deletes an AWS EBS Snapshot with ID `id`.
def _removeAWSSnapshot(self, snap_id: str): log.warning(f'Deleting AWS EBS Snapshot {snap_id}') ec2_client = boto3.client('ec2', region_name=self.aws_region) try: ec2_client.delete_snapshot(SnapshotId=snap_id) except Exception as error: # pylint: disable=broad-except log.error(f'Failed to d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_snapshot(self, snapshot_id):\r\n\r\n self.iscsi_svc.deleteObject(id=snapshot_id)", "def cli(env, snapshot_id):\n block_manager = SoftLayer.BlockStorageManager(env.client)\n deleted = block_manager.delete_snapshot(snapshot_id)\n\n if deleted:\n click.echo('Snapshot %s deleted' % ...
[ "0.78719264", "0.7736575", "0.7644279", "0.75770277", "0.736929", "0.71240944", "0.69008183", "0.68352735", "0.67959744", "0.6736099", "0.6706821", "0.66655517", "0.6488515", "0.63967794", "0.6360391", "0.61587834", "0.6127205", "0.60837644", "0.6061843", "0.60463864", "0.604...
0.78926736
0
Deletes an S3 object at `path`.
def _removeAWSS3Object(self, path: str): log.warning(f'Deleting AWS S3 object {path}') bucket, key = storage_utils.SplitStoragePath(path) s3_client = boto3.client('s3') try: s3_client.delete_object(Bucket=bucket, Key=key) except Exception as error: # pylint: disable=broad-except log.err...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_object(self, s3_path):\n logging.info(\"Deleting \\\"{}\\\" file from S3\".format(s3_path))\n bucket_name, key = S3Util.get_bucket_and_key(s3_path)\n self.s3_resource.ObjectSummary(bucket_name, key).delete()", "def delete_object(self, object_path):\n bucket_name, save_path ...
[ "0.8589754", "0.81548566", "0.7849945", "0.7838405", "0.7520646", "0.7260223", "0.7242306", "0.7200459", "0.709181", "0.7063145", "0.7008641", "0.6976428", "0.6947444", "0.6919413", "0.69042146", "0.6903383", "0.69029564", "0.6900946", "0.6897261", "0.68503684", "0.685027", ...
0.85541904
1
Delete a GCS object at `path`.
def _removeGCSObject(self, path: str): log.warning(f'Deleting GCS object {path}') try: storage.GoogleCloudStorage(self.gcp_project_id).DeleteObject(path) except Exception as error: # pylint: disable=broad-except log.error(f'Failed to delete GCS Object {path}: {str(error)}')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def rm(path: str):\n _ = path.strip('/').split('/')\n bucket = _[0]\n key = '/'.join(_[1:])\n if path.endswith('/'):\n key += '/'\n async with _create_client() as client:\n try:\n await client.delete_object(Bucket=bucket, Key=key)\n logger.info(f'Delete file...
[ "0.78189796", "0.7468063", "0.7263031", "0.7235776", "0.7158689", "0.7100991", "0.7084128", "0.7063686", "0.7039927", "0.70041424", "0.69738555", "0.6940997", "0.69260657", "0.68535155", "0.6739612", "0.6701492", "0.66956896", "0.6692519", "0.66546154", "0.66297257", "0.65918...
0.8232839
0
Remove GCE Image with name `name`.
def _removeGCEImage(self, name: str): log.warning(f'Deleting GCE Image {name}') try: compute.GoogleComputeImage( self.gcp_project_id, self.gcp_zone, name ).Delete() except Exception as error: # pylint: disable=broad-except log.error(f'Failed to delete GCE Image {name}: {str(erro...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_image(Name=None):\n pass", "def del_image(self, name):\r\n if self.images is None or name not in self.images:\r\n return\r\n l = self.images\r\n self.images = None\r\n l.setdefault('/empties/', [])\r\n # push the number on the empties list\r\n l[...
[ "0.77334917", "0.75917494", "0.7531193", "0.722961", "0.7067009", "0.69292396", "0.68562293", "0.6789977", "0.67663544", "0.6758139", "0.6702444", "0.66960543", "0.66144276", "0.6586997", "0.6548269", "0.6530188", "0.64906603", "0.6479747", "0.6467619", "0.6458344", "0.645698...
0.8452742
0
Remove the disk with name `name`.
def _removeGCEDisk(self, name: str): log.warning(f'Deleting GCE Disk {name}') try: gce_disk_client = common.GoogleCloudComputeClient( project_id=self.gcp_project_id).GceApi().disks() gce_disk_client.delete( project=self.gcp_project_id, zone=self.gcp_zone, disk...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rm(self, name: str) -> None:\n path = self.get_path(name)\n if os.path.exists(path):\n os.remove(path)", "def vm_diskdelete(args):\n name = args.name\n diskname = args.diskname\n pool = args.pool\n config = Kconfig(client=args.client, debug=args.debug, region=args.region,...
[ "0.75362515", "0.71105665", "0.70604837", "0.69789946", "0.69264275", "0.69136286", "0.6910295", "0.68948543", "0.6887401", "0.684326", "0.67783725", "0.6729041", "0.67081046", "0.66445243", "0.6617731", "0.65383613", "0.6531545", "0.65064126", "0.64904535", "0.6488289", "0.6...
0.76121897
0
Read project information to run e2e test.
def ReadProjectInfo() -> Dict[str, str]: project_info_file = os.environ.get('PROJECT_INFO') if project_info_file is None: raise OSError('Error: please make sure that you defined the ' '"PROJECT_INFO" environment variable pointing ' 'to your project settings.') try: json...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_read_project(self):\n pass", "def test_read_project(self):\n pass", "def test_get_project(self):\n pass", "def test_project_detail(self):\n rv = self.app.get(\"/Assignment0\")\n self.assertIn(\"Assignment0\", rv.data)\n self.assertIn(\"2015-02-04 21:57:12.15...
[ "0.76227367", "0.76227367", "0.6705366", "0.6565403", "0.6225712", "0.6197374", "0.6003806", "0.59884864", "0.5940054", "0.5864681", "0.58614016", "0.58614016", "0.58614016", "0.585416", "0.583981", "0.5817701", "0.5744278", "0.5716439", "0.5716439", "0.57119983", "0.5707653"...
0.6311821
4
Add blogpost to manuscript
def add_blogpost(manuscript, subject, url): line_number = 0 with open(manuscript, "r") as file: lines = file.readlines() for line in lines: if ("## ブロマガ全集" in line): lines.insert(line_number + 2, f"- [{subject}]({url})\n") with open(manuscript, "w") as file: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main(blog, date):\n template = front_matter({\n \"title\": blog,\n \"date\": get_date(\"%Y-%m-%d %H:%M:%S %z\"),\n })\n new_blog(date + '-' + blog + '.markdown', template)", "def add_blog(self, text):\n self.blog.add_blog(text)\n self.refre...
[ "0.6208906", "0.6076283", "0.59839743", "0.59753376", "0.5914017", "0.5913528", "0.58720726", "0.58409494", "0.5834559", "0.582747", "0.57706946", "0.57343227", "0.56686044", "0.5657509", "0.56546366", "0.5640166", "0.5577207", "0.557562", "0.557433", "0.556912", "0.55233467"...
0.7508624
0
Update paleo channel blogposts.
def main(): # Pick files token_file = os.path.abspath(TOKEN_FILE) creds_file = os.path.abspath(CREDS_FILE) manuscript_file = os.path.abspath(MANUSCRIPT_FILE) # Authorize Gmail API creds = gmail.authorize(SCOPES, token_file, creds_file) # Build Gmail API service = gmail.build_service(c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cli():\n update_all_posts()\n push_updates()", "def updatePost(updatePostEvent):\n postId = updatePostEvent[\"data\"][\"post_id\"]\n with conn.cursor() as cur:\n for key, value in updatePostEvent[\"data\"].items():\n if key not in unableToUpdate:\n query = 'UPDATE...
[ "0.5982719", "0.5916697", "0.58925104", "0.5890833", "0.5881056", "0.5785574", "0.5755134", "0.5648949", "0.5598788", "0.5589578", "0.5584814", "0.5547204", "0.5526978", "0.5522043", "0.5500021", "0.5494415", "0.5486405", "0.54856944", "0.5431346", "0.5415686", "0.5410492", ...
0.5808636
5
Evalutes whether the passed dict matches the complex logic of the LogicNode
def eval_logic(self, checkDict): result = True #gets individual evaluations from children passList = [] for child in self.children: myVal = child.eval_comparison(checkDict) passList.append(child.eval_comparison(checkDict)) #if only one child returns the o...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_RestrictingNodeTransformer__visit_In_Dict():\n assert restricted_eval('2 in {1: 1, 2: 2, 3: 3}') is True", "def eval_act_logic(self, act_logic_str):\n if self.ignore_act_logic:\n return True\n # return true for empty string\n if len(act_logic_str) == 0:\n re...
[ "0.61918426", "0.6141805", "0.6042099", "0.5969799", "0.5877197", "0.586158", "0.58614135", "0.58304363", "0.581069", "0.5801263", "0.5798829", "0.57972205", "0.57903963", "0.57780564", "0.57741153", "0.57624376", "0.57561654", "0.57198983", "0.5661767", "0.56597126", "0.5608...
0.6642864
0
Embeds a batch of states and returns a batch of embeddings.
def forward(self, states): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def encode(self, images):\n\n i = 0\n N = len(images)\n embs = None\n\n while True:\n end = min(N, i + self.batch_size)\n batch = images[i: end]\n\n size = end - i\n if size < self.batch_size:\n batch += self._input_padding[:sel...
[ "0.6478759", "0.64233774", "0.63584566", "0.6301887", "0.60907364", "0.5999774", "0.5967661", "0.59666103", "0.5826861", "0.5792818", "0.5779593", "0.5755447", "0.5737904", "0.5717163", "0.5715993", "0.56992686", "0.56904775", "0.5687835", "0.56503177", "0.5648871", "0.563578...
0.0
-1
add the keeper to the player's field
def play(self, game, playerNumber): # needs check for keeper limit? super(Keeper, self).play(game, playerNumber) p = game.players[playerNumber] p.field.add(self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_player(self, player):\n\t\tself.players.append(player)", "def add_player(self, players):\n try:\n players[self.ward]\n except:\n players[self.ward] = self", "def add_played_disk(self, x, y, player):\n self.played_disks.append((x, y, player))", "def add_playe...
[ "0.6364632", "0.6120998", "0.601679", "0.5704426", "0.5608644", "0.55661637", "0.5504809", "0.54787284", "0.54737884", "0.54316384", "0.5415775", "0.5406429", "0.5401013", "0.53916353", "0.5390193", "0.53633857", "0.53564775", "0.5346505", "0.5302579", "0.5288975", "0.5288402...
0.7416112
0
Read NWA data and plot results
def read_data_test_MLOG(self): self.na.set_query_timeout(10e3) self.na.set_format('mlog') fpts, mags = self.na.read_data() plt.figure() plt.plot(fpts, mags) plt.show()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Plot_RCWA_Ssim(Path) :\n #/Users/simonvassant/Documents/20090707_TestsPython/Result_Champ/SSim_O21Pr_2000H_res1000F1.res\n x,y=[],[]\n fs = open(Path, 'r') \n#index_array = 0\n while 1: \n txt = fs.readline()\n if txt =='': \n break\n x.append(float(txt[0:12]))\n ...
[ "0.60809547", "0.59711033", "0.59694964", "0.58526397", "0.5809397", "0.5761579", "0.5761087", "0.5738626", "0.57299054", "0.5708017", "0.5697068", "0.5625891", "0.56195134", "0.5602345", "0.5590794", "0.5582271", "0.5557602", "0.555228", "0.5509402", "0.54959875", "0.5489333...
0.5621301
12
Read NWA data and plot results
def read_data_test_Polar(self): self.na.set_query_timeout(10e3) self.na.set_format('polar') fpts, mags, phases = self.na.read_data() plt.figure() plt.plot(fpts, mags) plt.plot(fpts, phases) plt.show()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Plot_RCWA_Ssim(Path) :\n #/Users/simonvassant/Documents/20090707_TestsPython/Result_Champ/SSim_O21Pr_2000H_res1000F1.res\n x,y=[],[]\n fs = open(Path, 'r') \n#index_array = 0\n while 1: \n txt = fs.readline()\n if txt =='': \n break\n x.append(float(txt[0:12]))\n ...
[ "0.60809547", "0.59711033", "0.59694964", "0.58526397", "0.5809397", "0.5761579", "0.5761087", "0.5738626", "0.57299054", "0.5708017", "0.5697068", "0.5625891", "0.5621301", "0.56195134", "0.5602345", "0.5590794", "0.5582271", "0.5557602", "0.555228", "0.5509402", "0.54959875...
0.0
-1
should be able to clear average and take averaged trace
def take_one_averaged(self): self.na.set_center_frequency(6.160574e9) self.na.set_span(10e6) self.na.set_power(-5, 1) self.na.set_ifbw(1e3) self.na.set_query_timeout(40e3) set_format = self.na.set_format('polar') print "set_format returned: ", set_format ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset_average(self):\n self._total_time = 0\n self._average_time = 0\n self._calls = 0", "def clear_averaging(self):\n self.write('SENS:AVER:CLE')", "def ResetAvgFilter(self):\n self.k = 1\n self.prevAvg = 0", "def reset(self):\n self.avg = 0\n self...
[ "0.74404645", "0.7266164", "0.6948134", "0.65590173", "0.6538304", "0.6257147", "0.6257147", "0.62516356", "0.6093857", "0.60403436", "0.60174435", "0.5992177", "0.5988711", "0.59871846", "0.5923661", "0.5902001", "0.59007776", "0.58243155", "0.5820704", "0.5818743", "0.58016...
0.64930433
5
From BERT repository Get the vocab file and casing info from the Hub module.
def create_tokenizer_from_hub_module(self): with tf.Graph().as_default(): bert_module = hub.Module(self.params["BERT_MODEL_HUB"]) tokenization_info = bert_module( signature="tokenization_info", as_dict=True) with tf.Session() as sess: vocab_fil...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_vocab(self):\n\n\t\tself.parse_transcript() \n\t\tself.purge_words()\n\t\tself.analyze_words()\n\t\tself.sort_word_analysis()", "def get_vocab():\n if data_dir is not None and vocab_filename is not None:\n vocab_filepath = os.path.join(data_dir, vocab_filename)\n if tf.gfile.Exists(vocab_fil...
[ "0.6224301", "0.617789", "0.6144918", "0.5987793", "0.5987313", "0.59658396", "0.59385157", "0.5870894", "0.58384573", "0.5824791", "0.5618645", "0.5575307", "0.5560295", "0.5522708", "0.55189157", "0.5506514", "0.5476414", "0.5438602", "0.5422487", "0.5402238", "0.5400183", ...
0.5293677
28
Transform the string into BERT features
def sentences_to_features(self, sentences, labels): input_examples = [run_classifier.InputExample(guid="", text_a=s, text_b=None, label=l) for s, l in zip(sentences, labels)] # here, "" is just a dummy label input_features = run_classifier.convert_examples_to_features(input_e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_bert_features(raw_text, tokenizer, model):\n # Load pre-trained model tokenizer (vocabulary)\n text_preprocessed = bert_preprocess(raw_text)\n \n # tokenize\n #tokenizer = BertTokenizer.from_pretrained('bert-base-uncased')\n tokenized_text = tokenizer.tokenize(text_preprocessed)[:512]\...
[ "0.6911272", "0.6759593", "0.6526839", "0.64172846", "0.63434416", "0.62007135", "0.6190314", "0.6180227", "0.6179751", "0.6128173", "0.6090893", "0.60580146", "0.6048897", "0.60008186", "0.5982143", "0.5967461", "0.59670514", "0.5959061", "0.59244144", "0.5888641", "0.588864...
0.5555488
41
Creates a classification model.
def create_model(is_predicting, input_ids, input_mask, segment_ids, labels, num_labels): bert_module = hub.Module( ClassifierModel.BERT_MODEL_HUB, trainable=True) bert_inputs = dict( input_ids=input_ids, input_mask=input_mask, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_model(self):\n self.classifier = DecisionTreeClassifier(max_depth=1)", "def create_model(self, C : float =1):\n self.classifier = RandomForestClassifier(max_depth=5)", "def create_model():\n\n # Create a sequential model (a simple NN is created) adding a softmax activation at the en...
[ "0.7451048", "0.716728", "0.70753753", "0.69427526", "0.69337225", "0.69306064", "0.6929345", "0.68631464", "0.68004555", "0.6769279", "0.6737084", "0.66838384", "0.66709864", "0.660953", "0.65912193", "0.6564333", "0.6534873", "0.6526978", "0.6525293", "0.6521778", "0.651739...
0.0
-1
Returns `model_fn` closure for TPUEstimator. model_fn_builder actually creates the model function using the passed parameters for num_labels, learning_rate, etc.
def model_fn_builder(num_labels, learning_rate, num_train_steps, num_warmup_steps): def model_fn(features, labels, mode, params): """The `model_fn` for TPUEstimator.""" input_ids = features["input_ids"] input_mask = features["input_mask"] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def model_fn_builder(model_config,\n train_params):\n def model_fn(features, labels, mode, params):\n \"\"\"The `model_fn` for TPUEstimator.\"\"\"\n logging.info(\"*** Features ***\")\n for name in sorted(features.keys()):\n logging.info(\" name = %s, shape = %s\" % (name, featu...
[ "0.7927153", "0.79216784", "0.78488064", "0.7728147", "0.7653819", "0.7596977", "0.7499681", "0.7498984", "0.74952537", "0.74641263", "0.746087", "0.7454586", "0.7400736", "0.73545307", "0.7325875", "0.73120433", "0.72905254", "0.72691625", "0.72314054", "0.71903694", "0.7071...
0.81900585
0
The `model_fn` for TPUEstimator.
def model_fn(features, labels, mode, params): input_ids = features["input_ids"] input_mask = features["input_mask"] segment_ids = features["segment_ids"] label_ids = features["label_ids"] is_predicting = (mode == tf.estimator.ModeKeys.PREDICT) #...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _augment_model_fn(self, model_fn, batch_axis):\n\n def _model_fn(features, labels, mode, config, params):\n \"\"\"A Estimator `model_fn` for TPUEstimator.\"\"\"\n with self._ctx.with_mode(mode) as ctx:\n model_fn_wrapper = _ModelFnWrapper(model_fn, config, params, ctx)\n\n if mode !=...
[ "0.7227465", "0.7181237", "0.70457387", "0.6964359", "0.68955207", "0.6842497", "0.68148303", "0.67315537", "0.6647428", "0.66089046", "0.65367836", "0.6524187", "0.6450448", "0.64265084", "0.6296868", "0.6282705", "0.6272923", "0.62583596", "0.6243498", "0.6196114", "0.61711...
0.57536846
47
Split X, y as train and test sets. Then convert them to features, classify and score. Shows train and test score to infer whether model is too simple or overfitted.
def train(self, X, y): tf.logging.set_verbosity( tf.logging.INFO) # comment if you don't want to display the information during training/evaluation X_train, X_test, y_train, y_test = train_test_split( X, y, test_size=self.params["TEST_SIZE"], random_state=42, stratify=y) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def TrainTestSplit(self,X, y):\n X_train, X_test, y_train, y_test = train_test_split(X, y, \n test_size=0.33,\n random_state=42)\n return X_train, X_test, y_train, y_test", "def tra...
[ "0.7304593", "0.72026986", "0.7181663", "0.7158527", "0.7110067", "0.7026293", "0.70036715", "0.6956012", "0.69486713", "0.6906381", "0.6901432", "0.6900246", "0.6840159", "0.68293583", "0.6827838", "0.6819217", "0.6759291", "0.67436206", "0.6722954", "0.6708005", "0.67071015...
0.647704
48
Predicts output based on training done during former step
def predict_estimator(self, X, y=None, labels=[0, 1]): # throw an exception if classifier is not trained if not self.classifier_trained: raise Exception("Train estimator first") if len(X) == 1: # predict doesn't work if only one element X.append("") labels = labe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def predict():\n\n predict_cfg = get_predict_args()\n device = get_device()\n print(device)\n\n # load checkpoint\n ckpt_path = find_ckpt_in_directory(predict_cfg.ckpt)\n ckpt = torch.load(ckpt_path, map_location=device)\n best_iter = ckpt[\"best_iter\"]\n cfg = ckpt[\"cfg\"]\n aspect = ...
[ "0.7502397", "0.7433937", "0.73870665", "0.7331327", "0.7303667", "0.72871506", "0.72688246", "0.7240414", "0.7220206", "0.7153669", "0.71483386", "0.70746833", "0.7046412", "0.7046357", "0.70393884", "0.7022155", "0.7013938", "0.7006865", "0.6990209", "0.6966313", "0.6959013...
0.0
-1
Necessary to export the model
def serving_input_fn(self): label_ids = tf.placeholder(tf.int32, [None], name='label_ids') input_ids = tf.placeholder( tf.int32, [None, self.params["MAX_SEQ_LENGTH"]], name='input_ids') input_mask = tf.placeholder( tf.int32, [None, self.params["MAX_SEQ_LENGTH"]], name='in...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dump_model(self):", "def export_model(self, save_path: str, save_format: Optional[str] = None) -> None:", "def export_model(self):\n\n model_pkg = dict()\n\n for k, v in self.__dict__.items():\n if k not in ['datas'] and not k.startswith('_'):\n model_pkg[k] = v\n\n ...
[ "0.7629469", "0.7263386", "0.6981971", "0.69330186", "0.69330186", "0.69330186", "0.69330186", "0.69330186", "0.68604165", "0.6842855", "0.6696678", "0.66769975", "0.66073906", "0.66003066", "0.6590629", "0.65098584", "0.6466474", "0.64420897", "0.6336027", "0.6336027", "0.62...
0.0
-1
Defines input column according to model (raw text or clean text)
def define_input_output(self): if self.classifier_model.text_preprocessing == ClassifierModel.TEXT_CLEAN: self.clean_range() self.input_col = self.df["clean_text"] elif self.classifier_model.text_preprocessing == ClassifierModel.TEXT_RAW: self.input_col = self.df[se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reconstruct_input_ext(self, model_in):", "def on_columnvalue_modified( self, *data ):\n\t\tif (len(data) == 4):\t( cell, path, model, user_data ) = data\n\t\telse:\t\t\t( cell, path, new_text, model, user_data ) = data\n\t\t(datatype,) = user_data\n\t\tcolid = self.window2.type2colid[datatype]\n\t\tif \t(dat...
[ "0.5679452", "0.56548154", "0.5609584", "0.5550475", "0.5462915", "0.5444646", "0.53719866", "0.52677375", "0.5246684", "0.52359515", "0.52223074", "0.51953554", "0.5169166", "0.5150608", "0.51421463", "0.5139192", "0.5078079", "0.507589", "0.50427675", "0.5032137", "0.499628...
0.6507603
0
Call the Classifiermodel method
def train(self): if self.input_col is None: raise Exception("Preprocessing not specified") self.classifier_model.train(self.input_col, self.output_col)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def trainModel( self, featureTrain, classTrain):", "def apply_classifier(self):\n for detected_object in self.detected_objects:\n detected_object.predict_class(self.original_image)", "def classify(self, data):\n \"*** YOUR CODE HERE ***\"\n return self.sklearn_classifier.predict...
[ "0.68371236", "0.67320436", "0.65875846", "0.65784526", "0.64575154", "0.64436054", "0.64287776", "0.63473463", "0.63165176", "0.63009554", "0.62688", "0.6236218", "0.6235001", "0.6223766", "0.62237513", "0.6220831", "0.62114865", "0.619955", "0.61918926", "0.61892086", "0.61...
0.62022305
17
Make predictions for the given dataset Warning, the train methods already split the dataset into train and test and evaluate the model on the test set, this method should be used only to test the good generalization of the model, on a data set it has never seen
def predict_estimator_test(self, X, y=None): if self.classifier_model.classifier_trained: results = self.classifier_model.predict_estimator( X, y, self.classifier_model.label_list) return results
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test(self, dataset): \n predictions = np.zeros(len(dataset), int)\n \n accuracy = self.random_forest.score(dataset[:,:-1], dataset[:,-1]) # Predict and compute accuracy.\n predictions = self.predict(dataset[:,:-1]) # Predict and return list of predictions.\n \n return...
[ "0.7167993", "0.7110903", "0.71050954", "0.69779205", "0.6971445", "0.69079924", "0.6887662", "0.6883227", "0.6852751", "0.6805507", "0.6804817", "0.675774", "0.67502844", "0.6743817", "0.6736981", "0.6736298", "0.67184407", "0.6714148", "0.6714112", "0.6701825", "0.66946995"...
0.0
-1
Adds an item to the stack
def push(self, item): super().add_item_to_front(item)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def push(self, item):\n self.stack.append(item)", "def push(self, item):\n self.stack.append(item)", "def push(self, item):\r\n self.stack.insert(0, item)", "def push(self, item):\n\n self._stack.append(item)", "def append(self, item):\r\n self.stack.append(item)", "def...
[ "0.8976076", "0.8976076", "0.8965512", "0.87010676", "0.8623993", "0.8406798", "0.8379469", "0.8236489", "0.81122154", "0.81077427", "0.81018645", "0.8097757", "0.80937", "0.80937", "0.80937", "0.80937", "0.80937", "0.80827004", "0.8045621", "0.80422616", "0.798588", "0.795...
0.79412425
22
Removes and returns an item for the stack on a LIFO basis
def pop(self): return super().remove_item_from_front()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove(self):\n return self.stack_list.pop()", "def pop(self): # 06:30 Lecture Week 2 \"Stacks\" (16:24)\n if self.isEmpty():\n raise Exception(\"Stack underflow\")\n item = self.first.Item # save item to return\n self.first = self.first.Next # delete last Node added\n self.N -...
[ "0.81453216", "0.79197675", "0.7856534", "0.77557087", "0.76387227", "0.75160515", "0.74301594", "0.7404803", "0.74040264", "0.7393654", "0.73591006", "0.73380005", "0.73172677", "0.7300573", "0.729812", "0.72950584", "0.72745514", "0.72589195", "0.72188485", "0.7211036", "0....
0.6968351
41
Returns the element at the top of the stack
def top(self): return super().peek()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def top(self):\n\t\tif self.is_empty():\n\t\t\traise Empty('Stack is empty')\n\t\treturn self._head._element", "def top(self):\n if self.stack == []:\n return None\n return self.stack[-1]", "def top(self):\n if self.is_empty():\n raise Empty('Stack is empty')\n ...
[ "0.8426997", "0.83845615", "0.8306367", "0.8226858", "0.807717", "0.80328375", "0.80252784", "0.8019078", "0.797039", "0.79673326", "0.7955196", "0.79414254", "0.7932987", "0.7927457", "0.7792212", "0.77724975", "0.7744826", "0.7740041", "0.76800865", "0.76103806", "0.7591366...
0.71395046
61
Initialize state data once.
def __call__(self, **kwargs): for item, value in kwargs.items(): if item not in self._state["data"]: self._state["data"][item] = value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_initial_state(self):\n pass", "def initialize(self):\n\n for i, item in enumerate(self.v.items()):\n state, value = item\n if value == None:\n raise ValueError, \"state '%s' has no value\" % state\n self.S[i]=value\n self.storage=Stora...
[ "0.7450729", "0.73820895", "0.72283614", "0.72150916", "0.71687126", "0.7122427", "0.7085805", "0.7071513", "0.7037798", "0.7025954", "0.7009983", "0.6964747", "0.69580865", "0.6846593", "0.6830056", "0.6822155", "0.68070364", "0.67243207", "0.67123103", "0.67005974", "0.6700...
0.0
-1
Return a saved state value, None if item is undefined.
def __getitem__(self, item): return self._state["data"].get(item, None)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __getitem__(self, item):\n return self._state[\"data\"].get(item, None)", "def __getitem__(self, item):\n return self._state[\"data\"].get(item, None)", "def __getitem__(self, item):\n return self._state[\"data\"].get(item, None)", "def __getattr__(self, item):\r\n return self...
[ "0.63567495", "0.63567495", "0.63567495", "0.6147721", "0.6147721", "0.6143838", "0.61314815", "0.60985714", "0.60985714", "0.60985714", "0.5938411", "0.5815865", "0.5792894", "0.57494944", "0.57324725", "0.57256", "0.5721121", "0.5721121", "0.5684823", "0.5684823", "0.568482...
0.6427416
0
Return a saved state value, None if item is undefined.
def __getattr__(self, item): return self._state["data"].get(item, None)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __getitem__(self, item):\r\n return self._state[\"data\"].get(item, None)", "def __getitem__(self, item):\r\n return self._state[\"data\"].get(item, None)", "def __getitem__(self, item):\n return self._state[\"data\"].get(item, None)", "def __getitem__(self, item):\n return se...
[ "0.64281183", "0.64281183", "0.6357475", "0.6357475", "0.6357475", "0.61450446", "0.6130774", "0.6099511", "0.6099511", "0.6099511", "0.59375536", "0.58148605", "0.5792937", "0.57490504", "0.5732397", "0.5725432", "0.572095", "0.572095", "0.56847996", "0.56847996", "0.5684799...
0.6148605
5
Clear session state and request a rerun.
def clear(self): self._state["data"].clear() self._state["session"].request_rerun()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset():\n if app.config['SESSION_KEY'] in session:\n session.pop(app.config['SESSION_KEY'])\n return redirect(url_for('home'))", "def trigger_rerun():\n session_infos = Server.get_current()._session_info_by_id.values()\n for session_info in session_infos:\n this_session = session_i...
[ "0.7043216", "0.69138795", "0.67887557", "0.67887557", "0.67887557", "0.6764239", "0.6704957", "0.65826434", "0.64558333", "0.644461", "0.6416975", "0.6393411", "0.6388334", "0.62632084", "0.62208897", "0.6181936", "0.60033035", "0.5980395", "0.5871535", "0.5871535", "0.58715...
0.6886666
2
Rerun the app with all state values up to date from the beginning to fix rollbacks.
def sync(self): # Ensure to rerun only once to avoid infinite loops # caused by a constantly changing state value at each run. # # Example: state.value += 1 if self._state["is_rerun"]: self._state["is_rerun"] = False elif self._state["hash"] is not ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rerun():\n widget_states = _get_widget_states()\n raise RerunException(RerunData(widget_states))", "def rollback(self, apps):\n while len(apps) > 0:\n app = apps.pop()\n print(\"Rolling back app %s ...\" % app.name)\n app.rollback_job()", "def restart(self):\n ...
[ "0.6341983", "0.6264009", "0.6008757", "0.6008757", "0.6008757", "0.59590656", "0.59546226", "0.5923881", "0.5918356", "0.5912256", "0.58985865", "0.5896702", "0.58921117", "0.58627576", "0.5841164", "0.5841025", "0.5810446", "0.5789196", "0.5786671", "0.57622343", "0.5748626...
0.0
-1
Create a dataset from a list of Examples and Fields.
def __init__(self, examples, filter_pred=None, **kwargs): if filter_pred is not None: make_list = isinstance(examples, list) examples = filter(filter_pred, examples) if make_list: examples = list(examples) self.examples = examples
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def CreateDataset(all_arrays):\n dataset = Dataset()\n\n dataset._addData(all_arrays[0])\n dataset._addData(all_arrays[1])\n dataset._addData(all_arrays[3])\n dataset._addData(all_arrays[5])\n dataset._addData(all_arrays[6])\n dataset._addData(all_arrays[9])\n dataset._addData(all_arrays[8]...
[ "0.66175133", "0.65675855", "0.6489426", "0.64110506", "0.6397567", "0.63752276", "0.6319362", "0.6216499", "0.6209005", "0.6183818", "0.61597437", "0.6138031", "0.61348975", "0.6127125", "0.61253273", "0.61253273", "0.61253273", "0.6124141", "0.6122481", "0.60865337", "0.606...
0.0
-1
Create Dataset objects for multiple splits of a dataset.
def splits(cls, root='.data', train=None, validation=None, test=None, **kwargs): path = cls.download(root) train_data = None if train is None else cls(os.path.join(path, train), **kwargs) val_data = None if validation is None else cls(os.path.join(path, validation), **kwargs) test_data =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def as_dataset(self, split, shuffle_files=None):\n return self._as_dataset(split=split, shuffle_files=shuffle_files)", "def __split_dataset(self):\n self.train, self.valid, _, _ = train_test_split(self.data, self.data, test_size=0.2)\n self.valid, self.test, _, _ = train_test_split(self.valid, s...
[ "0.714736", "0.71266127", "0.7124513", "0.6978415", "0.69318837", "0.6857103", "0.6852228", "0.6806051", "0.6730736", "0.67166394", "0.66391075", "0.66319656", "0.6599639", "0.65770274", "0.6532192", "0.6507811", "0.65007865", "0.64922684", "0.6482739", "0.64560986", "0.63962...
0.0
-1
Download and unzip an online archive (.zip, .gz, or .tgz).
def download(cls, root, check=None): path = os.path.join(root, cls.name) check = path if check is None else check if not os.path.isdir(check): for url in cls.urls: if isinstance(url, tuple): url, filename = url else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def download_and_unzip(url, zip_path, csv_path, data_folder):\n\n download_from_url(url, zip_path)\n\n unzip(zip_path, csv_path, data_folder)\n\n print('Done.')", "def _download(url, outpath=None, dirname=None, branch='master', release=None):\n six.print_('downloading...')\n outfolder = outpath or os.ge...
[ "0.766572", "0.75655353", "0.7496965", "0.73008174", "0.72016865", "0.7129517", "0.71224624", "0.70703506", "0.70628434", "0.7030601", "0.6981109", "0.6945264", "0.6934098", "0.68902963", "0.6858346", "0.683862", "0.68155247", "0.6783569", "0.6730443", "0.6667935", "0.6647641...
0.0
-1
Interleave bits from two sort keys to form a joint sort key. Examples that are similar in both of the provided keys will have similar values for the key defined by this function. Useful for tasks with two text fields like machine translation or natural language inference.
def interleave_keys(a, b): def interleave(args): return ''.join([x for t in zip(*args) for x in t]) return int(''.join(interleave(format(x, '016b') for x in (a, b))), base=2)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def addKey(s1, s2): \r\n return [i ^ j for i, j in zip(s1, s2)]", "def concatKey(str1,str2):\n return concat(concat(str1, '_'), str2)", "def inner_join(sorted1, sorted2, key1, key2):\n p1 = 0\n p2 = 0\n result = []\n\n while (p1 < len(sorted1) and p2 < len(sorted2)):\n # if entries\n ...
[ "0.61941266", "0.61463404", "0.5867205", "0.5854237", "0.57316273", "0.57308954", "0.56912524", "0.56198055", "0.5488593", "0.53060853", "0.53048044", "0.52917767", "0.5274578", "0.5135413", "0.5129714", "0.5127249", "0.5121423", "0.51084983", "0.5099582", "0.50963557", "0.50...
0.7362512
0
Download file, with logic (from tensor2tensor) for Google Drive
def download_from_url(url, path): if 'drive.google.com' not in url: try: return urllib.request.urlretrieve(url, path) except Exception: res = requests.get(url) with open(path, 'wb') as out: out.write(res.content) print('downloading from Google ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def maybe_download(filename):\n\n if not tf.gfile.Exists(WORK_DIRECTORY):\n tf.gfile.MakeDirs(WORK_DIRECTORY)\n filepath = os.path.join(WORK_DIRECTORY, filename)\n if not tf.gfile.Exists(filepath):\n filepath, _ = urllib.request.urlretrieve(SOURCE_URL + filename, filepath)\n with tf.gfile.GFile(filepat...
[ "0.6828218", "0.67926407", "0.6701384", "0.6701384", "0.6690748", "0.6690537", "0.66409", "0.6583277", "0.65828484", "0.65616095", "0.65463537", "0.646932", "0.646782", "0.6464549", "0.6458871", "0.6456325", "0.64409536", "0.6418602", "0.64159805", "0.6411759", "0.6410923", ...
0.63422894
23
Used to keep track of scope via white space
def get_indent(self, s): return len(s) - len(s.lstrip())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scope(self): # noqa: ANN201", "def enterScope(self, name):", "def scope(self, name):\r\n raise NotImplementedError", "def beginScope():", "def name_scope(self):\n pass", "def _getScopeName(self):\r\n return self.name # + \"@b%d\" % self.blscope_ids[-1]\r", "def scope_line(self, text):...
[ "0.6925732", "0.67302036", "0.64443195", "0.63425654", "0.6285401", "0.6097456", "0.5997095", "0.5971598", "0.59524256", "0.5929008", "0.5902731", "0.5902731", "0.58621186", "0.5850101", "0.58111405", "0.58057463", "0.57699937", "0.5768783", "0.57478744", "0.57442987", "0.566...
0.0
-1
Send HTTP get requests to a URL with a delay following Poisson distribution.
async def send_requests(url: str, count: int = 100, lamda: float = 5.0) -> None: successful = failed = 0 current = 0 while count - current > 0: request = urllib.request.Request(url) try: response = urllib.request.urlopen(request) except Exception: failed += 1 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self, url: str) -> None:\n\n if self.number_of_requests_made % self.change_ip_after == 0:\n self.renew_ip()\n\n else:\n self.wait()\n\n self.last_call_timestamp = round(time.time(), 2)\n super().get(url)\n\n self.number_of_requests_made += 1", "def...
[ "0.69498026", "0.64508325", "0.63998294", "0.62229043", "0.62177193", "0.619114", "0.6111653", "0.6070869", "0.6041272", "0.59756577", "0.592942", "0.5914116", "0.5910035", "0.586417", "0.58601296", "0.5842746", "0.5841606", "0.5837707", "0.5828307", "0.58107495", "0.5783712"...
0.5814416
19
GET / retorna status code 302
def test_get(self): animal = Animal.objects.create(propriedade=self.propriedade1, sexo=1, brinco = 'A123452', ) response = self.client.get(reverse('...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_redirect(self):\r\n sess = FuturesSession()\r\n future = sess.get(httpbin('redirect-to?url=get'))\r\n self.assertIsInstance(future, Future)\r\n resp = future.result()\r\n self.assertIsInstance(resp, Response)\r\n self.assertEqual(200, resp.status_code)\r\n\r\n ...
[ "0.763196", "0.73813707", "0.72912335", "0.728111", "0.72572887", "0.713811", "0.70875144", "0.6918813", "0.69020045", "0.6795535", "0.6774023", "0.6738423", "0.6714167", "0.66844994", "0.6627861", "0.65451616", "0.6530949", "0.6511822", "0.64325136", "0.64173377", "0.6387123...
0.0
-1
GET / retorna status code 404
def test_get_autenticado(self): login = self.client.login(username='user1', password='12345') animal = Animal.objects.create(propriedade=self.propriedade1, sexo=1, brinco = 'A113456', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def not_found():\n return HttpError(404)", "def not_found(self, error):\n return jsonify({'error': 'NOT FOUND'}), 404", "def normal404(e):\n return jsonify({\"error\": \"Not found\"}), 404", "def handleStatus_404(self):\n log.err('HTTP Error 404')", "def not_found():\n raise cherrypy.HTT...
[ "0.8387215", "0.7864697", "0.7690975", "0.76671004", "0.7622888", "0.7616264", "0.7606746", "0.76056755", "0.7594924", "0.7594645", "0.75129735", "0.74642843", "0.74385124", "0.74385124", "0.7401526", "0.7398156", "0.7396078", "0.7374972", "0.7358382", "0.7358309", "0.735549"...
0.0
-1
verifica se tem o link para voltar para a listagem de animais
def test_animais_list_link(self): PropriedadeUser.objects.create(propriedade=self.propriedade1, user=self.user1, owner=True) login = self.client.login(username='user1', password='12345') response = self.client.get(reve...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getLink(self):", "def add_link():\n return True", "def requestShowLink(self, *args, **kwargs): # real signature unknown\n pass", "def is_valid_listings(link):\n if link.has_attr(\"href\") and link.attrs[\"href\"].startswith(LISTING_PREFIX):\n return True\n return False", "def rem...
[ "0.5543123", "0.5494667", "0.53836703", "0.5344362", "0.52966595", "0.5271885", "0.52616286", "0.5257237", "0.5244915", "0.5165959", "0.51506627", "0.5111753", "0.50975", "0.5086898", "0.5062339", "0.5051371", "0.50483936", "0.5039112", "0.50307196", "0.49970207", "0.49806777...
0.5964893
0
verifica os textos no html
def test_textos_no_html(self): PropriedadeUser.objects.create(propriedade=self.propriedade1, user=self.user1, owner=True) login = self.client.login(username='user1', password='12345') response = self.client.get(reverse...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getText():", "def getText():", "def getText():", "def getText():", "def getText():", "def is_text( self ):\n return self.get_main_type() == 'text'", "def obtain_text():\n pass", "def hasRawText(self, text):\n r = re.compile(r'<(p|blockquote|div|form|table|ul|ol|dl|pre|h\\d)[^>]*?...
[ "0.675838", "0.675838", "0.675838", "0.675838", "0.675838", "0.66166764", "0.6557563", "0.65164775", "0.6472427", "0.64069116", "0.6390485", "0.6258951", "0.6230542", "0.6212179", "0.6210339", "0.6207658", "0.6206313", "0.6205104", "0.62009335", "0.61976314", "0.6178452", "...
0.6883659
0
For update de Wallet balance.
def save(self, *args, **kwargs): wallet = self.wallet.withdraw(self.value) super(Payment, self).save(*args, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_balance(self):\n if self.calculated_balance < 0:\n raise AccountBalanceError('calculated_balance on account {} is below 0'.format(self))\n self.balance = self.calculated_balance\n self.save()", "async def update_account_balance():\n\n try:\n balance = App.clie...
[ "0.72338796", "0.70078224", "0.69661176", "0.68936557", "0.6885542", "0.68758094", "0.68758094", "0.6799369", "0.67223907", "0.66990334", "0.66625327", "0.66507715", "0.66184336", "0.66184336", "0.66184336", "0.6594879", "0.6594879", "0.6594879", "0.6592823", "0.6580972", "0....
0.6641524
12
Computes the rowwise cosine similarity matrix of a rating matrix.
def similarity_matrix(feat_mat): sim_mat = cosine_similarity(feat_mat) np.fill_diagonal(sim_mat, 0) return sim_mat
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cosine_sim_cf(matrix):\n if type(matrix) is not lil_matrix:\n matrix = lil_matrix(matrix)\n\n n = matrix.shape[0]\n rows, cols, data = [], [], []\n user_items = [sorted([(item, idx) for idx, item in enumerate(matrix.rows[i])]) for i in range(n)]\n\n for i in range(n):\n i_ratings, ...
[ "0.77840763", "0.7654144", "0.7522678", "0.7134965", "0.71157086", "0.6820214", "0.67638975", "0.66730607", "0.6665848", "0.6656157", "0.6655661", "0.6623994", "0.66095823", "0.6570017", "0.6487632", "0.64274234", "0.6385559", "0.63674223", "0.63396907", "0.6329559", "0.63160...
0.72332346
3
Computes the elementwise average (mean) of some matrices.
def sim_avg(sim_mats): return np.array(sim_mats).mean(axis=0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def matrix_mean(matrix):\n return sum(map(mean,matrix))", "def mean_matrix(datasets, axes = None, label = None):\n fn = lambda fd, axis: fd[axis].mean()\n \n return fn_matrix(datasets, fn, axes, label)", "def amean (inarray,dimension=None,keepdims=0):\r\n if inarray.dtype in [N.int_, N.short,N.u...
[ "0.7331233", "0.69245744", "0.67887264", "0.67166", "0.66820306", "0.66804636", "0.66455996", "0.66441685", "0.66332096", "0.66087085", "0.6591833", "0.6468679", "0.64240265", "0.64155746", "0.640505", "0.640505", "0.63970006", "0.63970006", "0.63970006", "0.6351404", "0.6338...
0.68238235
2
Computes the elementwise minimum of some matrices.
def sim_min(sim_mats): return np.array(sim_mats).min(axis=0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def matrix_min(data):\n if is_SparseDataFrame(data):\n data = [np.min(data[col]) for col in data.columns]\n elif is_sparse_dataframe(data):\n data = [sparse_series_min(data[col]) for col in data.columns]\n elif isinstance(data, pd.DataFrame):\n data = np.min(data)\n elif isinstance...
[ "0.6745464", "0.6651574", "0.6647899", "0.64386827", "0.6284703", "0.6036429", "0.6033137", "0.5970848", "0.5958427", "0.5948367", "0.5947503", "0.59440386", "0.59381294", "0.5921218", "0.59118783", "0.5897402", "0.5858605", "0.5849506", "0.58406216", "0.5815177", "0.5813334"...
0.7239349
0
Computes the elementwise maximum of some matrices.
def sim_max(sim_mats): return np.array(sim_mats).max(axis=0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def three_array_max(array_list: List[np.ndarray]) -> np.ndarray:\n temp = np.maximum(array_list[0], array_list[1])\n all_maxs = np.maximum(temp, array_list[2])\n\n return all_maxs", "def d_max(x, y):\n axis = np.argmax(x.shape)\n return np.max(np.array([x, y]), axis=axis)", "def max(x, reduce_in...
[ "0.6566944", "0.6431522", "0.63984", "0.6369676", "0.6349694", "0.6326043", "0.6279134", "0.6229197", "0.6208424", "0.61817044", "0.61411893", "0.60957426", "0.60940033", "0.6092088", "0.60329014", "0.6031537", "0.60274714", "0.6022276", "0.60205376", "0.6020099", "0.5998723"...
0.69111717
0
Supports an additional argument ``jsonp_callback``. If specified, the JSON serialized data string will be wrapped in parenthesis and prefixed by the value of ``jsonp_callback``.
def __init__(self, *args, **kwargs): self.jsonp_callback = kwargs.pop('jsonp_callback', None) super(JsonResponse, self).__init__(*args, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def makeJSONP(callback, data):\n response_data = callback\n response_data += '('\n response_data += json_dumps(data)\n response_data += ');'\n return response_data", "def to_jsonp(self, data, options=None):\r\n options = options or {}\r\n json = self.to_json(data, options)\r\n ...
[ "0.77660763", "0.77004063", "0.71376044", "0.7129176", "0.7104028", "0.7059136", "0.69853944", "0.69456315", "0.6932959", "0.68902475", "0.68627375", "0.678367", "0.62437904", "0.6236117", "0.6163715", "0.57675", "0.5750369", "0.5558858", "0.5427558", "0.5421836", "0.5384548"...
0.6793149
11
Takes in an Image message and identifies the locations of the three dumbbells
def identify_dbs(image): locations = {"red": Point(), "green": Point(), "blue": Point()} masks = {"red": [], "green": [], "blue": []} bridge = cv_bridge.CvBridge() image = bridge.imgmsg_to_cv2(image, "bgr8") hsv = cv2.cvtColor(image, cv2.COLOR_BGR2HSV) # upper and lower bounds for red # us...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def belt(image):\n\n # Belt Detector\n x, y = circular_detector(image, 70, 80)\n\n return x, y", "def describe(image):\n needle = cv2.imread(image, 0)\n orb = cv2.ORB()\n keypoints, description = orb.detectAndCompute(needle, None)\n print(keypoints)\n print(description)\n return keypoints, descrip...
[ "0.5904444", "0.58341223", "0.5803662", "0.5694714", "0.564857", "0.5638822", "0.5634845", "0.5602222", "0.55758303", "0.5494642", "0.5491051", "0.548308", "0.5441922", "0.5413018", "0.54116", "0.5403581", "0.5379999", "0.53695244", "0.53540814", "0.5338005", "0.53375745", ...
0.6506251
0
Takes in a list of Image messages and identifies the block number in each image
def identify_blocks(images): locations = {1: Point(), 2: Point(), 3: Point()} blocks = {"left": 0, "middle": 0, "right": 0} pipeline = keras_ocr.pipeline.Pipeline() cv2_images = [] for image in images: bridge = cv_bridge.CvBridge() cv2_images.append(bridge.imgmsg_to_cv2(image, "bgr8...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getBlocks(self):\n blocks = self.getBlocksMsg(b'\\x00')\n last_locator = self.largeMessageControl(blocks, 'inv', 0)\n\n while last_locator[1] < TARGET_BLOCK:\n blocks = self.getBlocksMsg(bytearray.fromhex(convertLittleBig(last_locator[0])))\n last_locator = self.large...
[ "0.5884302", "0.5805182", "0.5722689", "0.5625986", "0.5602621", "0.55785567", "0.5520678", "0.5473761", "0.5423533", "0.53958166", "0.5387366", "0.53733194", "0.537314", "0.5340807", "0.5339228", "0.5338712", "0.533123", "0.53037155", "0.5302177", "0.52923036", "0.5285601", ...
0.6633512
0
Initialize attributes for simulated use.
def __init__(self,gameboard,events,mouse_pos): super().__init__(gameboard) self.events = events self.mouse_pos = mouse_pos
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_attrs(self):\n raise NotImplementedError", "def _init_attributes(self):\n self.attr = {\n 'name': None,\n 'tags': [],\n 'openHours': None,\n 'type': None,\n 'parent': None,\n 'locationId': None,\n 'bannerAbbreviat...
[ "0.7777734", "0.76090693", "0.74320334", "0.72761893", "0.7228054", "0.7202334", "0.71504873", "0.7127317", "0.7108561", "0.69425267", "0.6913489", "0.6910913", "0.6900658", "0.68599164", "0.6859132", "0.6831615", "0.6831615", "0.67674065", "0.67426705", "0.6740823", "0.67338...
0.0
-1
Return inputted mouse position.
def get_mouse_pos(self): return self.mouse_pos
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_mouse_position(self):\n raise NotImplementedError", "def mousePos():\n data = display.Display().screen().root.query_pointer()._data\n return data[\"root_x\"], data[\"root_y\"]", "def read_current_mouse_position():\n import pyautogui\n pyautogui.FAILSAFE = False\n return pyautogui....
[ "0.80970645", "0.79738057", "0.7952894", "0.7875623", "0.7716459", "0.7669065", "0.7658517", "0.7630226", "0.7630226", "0.74635327", "0.7459193", "0.73358524", "0.7272576", "0.7244995", "0.71246344", "0.70662653", "0.70661056", "0.7031796", "0.69420946", "0.6930538", "0.69280...
0.8032351
1
Initialize type and button.
def __init__(self, event_type, button): self.type = event_type self.button = button
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n self.handlers = {}\n self.start_state = None\n self.end_states = []\n self.btn = Button()", "def _init_ui(self):\r\n\t\t\r\n\t\tself.input_frame = Input(self)\r\n\t\tself.input_frame.pack()\r\n\t\t\r\n\t\tbutton_ok = Button(self, text = \"Ping\", command = self._...
[ "0.6788451", "0.6683954", "0.65892327", "0.6497996", "0.64862543", "0.6442674", "0.6437974", "0.64198774", "0.64093477", "0.63769287", "0.63739365", "0.63739365", "0.6325634", "0.6292619", "0.6286793", "0.62425756", "0.62415385", "0.6241002", "0.6228872", "0.619486", "0.61938...
0.7603971
0
calls the appropriate funciton to resample an image based on the interpolation method
def resize(self, image, fx, fy, interpolation): if interpolation == 'bilinear': return self.bilinear_interpolation(image, fx, fy) elif interpolation == 'nearest_neighbor': return self.nearest_neighbor(image, fx, fy)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resampled_to_img(self, target_image, interpolation=None):\n # IMPORTANT: Polymorphism can be implemented by walking the \n # MRO and finding a method that does not raise\n # NotImplementedError. \n raise NotImplementedError", "def Resampler(name):\n\n def resample_average(path, ds...
[ "0.777782", "0.72679806", "0.69222504", "0.6829409", "0.67728364", "0.6588891", "0.6578838", "0.65778905", "0.65753907", "0.6556866", "0.6504161", "0.64685297", "0.6434631", "0.6428031", "0.64210665", "0.6419218", "0.6414669", "0.6380477", "0.6313253", "0.6260271", "0.6226804...
0.63449955
18
resizes an image using bilinear interpolation approximation for resampling
def nearest_neighbor(self, image, fx, fy): #Write your code for nearest neighbor interpolation here w = image.shape[1] h = image.shape[0] newW = int(w*float(fx)) newH = int(h*float(fy)) ratioW = w/newW ratioH = h/newH import numpy as np newImg ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scale_image(image, scale=1, interpolation='linear'):\n if interpolation == 'linear':\n return cv2.resize(image, None, fx=scale, fy=scale, interpolation=cv2.INTER_LINEAR)\n if interpolation == 'nearest':\n return cv2.resize(image, None, fx=scale, fy=scale, interpolation=cv2.INTER_NEAREST)", ...
[ "0.6840502", "0.68318045", "0.68003356", "0.6773299", "0.6769946", "0.6753389", "0.67483824", "0.670136", "0.6658069", "0.65596086", "0.65593255", "0.6544679", "0.65280706", "0.6521803", "0.6505017", "0.649654", "0.64671725", "0.6443924", "0.64256537", "0.64148885", "0.640677...
0.0
-1
resizes an image using bilinear interpolation approximation for resampling
def bilinear_interpolation(self, image, fx, fy): # Write your code for bilinear interpolation here w = image.shape[1] h = image.shape[0] newW = int(w*float(fx)) newH = int(h*float(fy)) ratioW = w / newW ratioH = h / newH import numpy as np impo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scale_image(image, scale=1, interpolation='linear'):\n if interpolation == 'linear':\n return cv2.resize(image, None, fx=scale, fy=scale, interpolation=cv2.INTER_LINEAR)\n if interpolation == 'nearest':\n return cv2.resize(image, None, fx=scale, fy=scale, interpolation=cv2.INTER_NEAREST)", ...
[ "0.6840322", "0.6831431", "0.68000495", "0.67738384", "0.6769506", "0.67526364", "0.674664", "0.6701318", "0.6659351", "0.65608776", "0.6559787", "0.65459263", "0.6527563", "0.6523229", "0.65071964", "0.6495799", "0.6469559", "0.64450675", "0.64279085", "0.64148057", "0.64094...
0.60840994
71
get final coach for each session coach with more than half the season will be the credited coach for eventual playoff and championship won
def get_final_coach_for_each_season(self): self.final_coach_for_season = ( self.num_days_coach_for_season .groupby(['Season','TeamID']) .agg({"CoachName":"count"}) .reset_index() .rename(columns={"CoachName":"coach_counts"}) .merge(self.num...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_championship_won_for_each_coach(self):\n self.championship_team = (\n self.raw_data_postseason\n .merge(self.season_max_days,how='left',on=['Season'])\n .query(\"DayNum == season_max_days\")\n .groupby(['Season','WTeamID'])\n .agg({\"NumOT\":\"c...
[ "0.69078004", "0.66235226", "0.65739715", "0.64645517", "0.54283714", "0.53823304", "0.5381159", "0.5307479", "0.5282068", "0.52351725", "0.51759636", "0.51322395", "0.5129283", "0.50992453", "0.5090998", "0.5084592", "0.5073128", "0.5072545", "0.5070027", "0.50515336", "0.50...
0.757074
0
Get teams who won the championship for each year
def get_championship_won_for_each_coach(self): self.championship_team = ( self.raw_data_postseason .merge(self.season_max_days,how='left',on=['Season']) .query("DayNum == season_max_days") .groupby(['Season','WTeamID']) .agg({"NumOT":"count"}) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_player_games(self, year, use_local=True):", "def collect_teams(year):\n\n team_list = Team.objects.filter(year=year).order_by('location')\n teams = []\n for t in team_list:\n team = {\n 'id': t.abbreviation,\n 'team': t,\n }\n teams.append(team)\n re...
[ "0.70646495", "0.67921704", "0.6662633", "0.6608853", "0.6473593", "0.6421649", "0.6351773", "0.6312248", "0.6311487", "0.63097686", "0.6242666", "0.6128153", "0.6068329", "0.6029508", "0.6004093", "0.59811854", "0.5938113", "0.593734", "0.5913684", "0.5901109", "0.58794063",...
0.6963645
1
Combine teams who made to playoff and won championship to one dataframe
def combine_playoff_championship_for_each_coach(self): self.final_coach_with_postseason_champion_each_year = ( self.final_coach_with_postseason_each_year .merge(self.championship_team,how='left',on=['Season','TeamID']) .fillna(0) )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_championship_won_for_each_coach(self):\n self.championship_team = (\n self.raw_data_postseason\n .merge(self.season_max_days,how='left',on=['Season'])\n .query(\"DayNum == season_max_days\")\n .groupby(['Season','WTeamID'])\n .agg({\"NumOT\":\"c...
[ "0.72284454", "0.7174533", "0.6835919", "0.65570146", "0.65117526", "0.64460844", "0.6409053", "0.62457347", "0.6203352", "0.6171146", "0.6097149", "0.60657734", "0.6041406", "0.6035894", "0.60347044", "0.6033802", "0.60308903", "0.60294217", "0.59119236", "0.59107935", "0.58...
0.6916625
2
Get win rate for regular season for each coach
def get_win_rate_regular_season_for_each_coach(self): self.games_won_for_coaches = ( self.raw_data_regularseason [['Season','DayNum','WTeamID']] # merge for winning team .merge(self.num_days_coach_for_season[['Season','TeamID','FirstDayNum','LastDayNum','CoachName...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_win_rate_post_season_for_each_coach(self):\n # get winning games for coaches\n self.post_games_won_for_coaches = (\n self.raw_data_postseason\n [['Season','DayNum','WTeamID']]\n # merge for winning team\n .merge(self.num_days_coach_for_season[['Seas...
[ "0.7728886", "0.6802758", "0.66279066", "0.6522059", "0.64248955", "0.6424082", "0.6392534", "0.62645185", "0.6220719", "0.6031486", "0.6006317", "0.5837831", "0.5770262", "0.57343024", "0.57129455", "0.5707701", "0.56960624", "0.5694389", "0.56909186", "0.56840575", "0.56737...
0.8015784
0
Get win rate for post season for each coach
def get_win_rate_post_season_for_each_coach(self): # get winning games for coaches self.post_games_won_for_coaches = ( self.raw_data_postseason [['Season','DayNum','WTeamID']] # merge for winning team .merge(self.num_days_coach_for_season[['Season','TeamID...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_win_rate_regular_season_for_each_coach(self):\n self.games_won_for_coaches = (\n self.raw_data_regularseason\n [['Season','DayNum','WTeamID']]\n # merge for winning team\n .merge(self.num_days_coach_for_season[['Season','TeamID','FirstDayNum','LastDayNum',...
[ "0.7711851", "0.6832915", "0.6480246", "0.63182116", "0.6245573", "0.61112136", "0.611068", "0.602987", "0.59854066", "0.5965334", "0.5964837", "0.57526016", "0.57137907", "0.5671769", "0.5644969", "0.5635259", "0.56290424", "0.5599348", "0.5596914", "0.5574907", "0.5569233",...
0.8241553
0
Test that upload Logger Type file without microsite_id will not be inserted to database
def test_logger_type_upload_MicrositeId_None(self): test_filename = 'server/tests/test_data_files/Test/Test_New_Logger_Type_MicrositeId_None.csv' with self.app.test_client() as client: with client.session_transaction() as sess: sess['logged_in'] = True response = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_upload_wrong_file_type(self):\n file = dict(\n file=(BytesIO(b'my file contents'), \"foto.doc\"),\n )\n response = self.client.post('/upload',\n content_type='multipart/form-data',\n data=file)\n s...
[ "0.676866", "0.66889274", "0.65706724", "0.64305943", "0.640982", "0.639273", "0.6387645", "0.63190717", "0.62991345", "0.6276941", "0.62692577", "0.62305576", "0.6219944", "0.6209555", "0.6150867", "0.61412674", "0.6103418", "0.6050772", "0.602671", "0.6003001", "0.5965992",...
0.81712246
0