query
stringlengths
10
2k
document
stringlengths
20
51.2k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Removes spaces in url string to create valid url string.
def remove_spaces(url_block): temp = "" for i in range(len(url_block)): if url_block[i] == ' ': temp += '+' else: temp += url_block[i] return temp
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_url_safe(self, url):\n return url.replace(' ', '%20')\\\n .replace('(', '%28')\\\n .replace(')', '%29')\\\n .replace('\"', '%22')", "def clean_url(url):\r\n s = url\r\n url = url.encode('utf8')\r\n url = ''.join([urllib.quote(c) if ord(c...
[ "0.78549093", "0.75857085", "0.754694", "0.74819076", "0.73716813", "0.7328548", "0.72510725", "0.7249905", "0.72443867", "0.7220416", "0.7211594", "0.72077847", "0.71933407", "0.71812534", "0.7157822", "0.71138614", "0.7111603", "0.71088624", "0.70936674", "0.70649815", "0.7...
0.0
-1
Compute the sigmoid of z
def sigmoid(z): s = 1/(1+ np.exp(-z)) return s
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sigmoid(z):\r\n \r\n return vSigmoid(z);", "def sigmoid(z): \n return 1/(1 + np.e**(-z))", "def sigmoid(z):\r\n \r\n return 1.0 / (1.0+np.exp(-z))", "def sigmoid(z):\n return 1 / (1 + e ** -z)", "def sigmoid(z):\n return 1 / (1 + np.exp(-1 * z))", "def sigmoid(self, z):\n ...
[ "0.923692", "0.9115246", "0.90348065", "0.9032433", "0.89829516", "0.89823914", "0.8982109", "0.89585716", "0.89368236", "0.892768", "0.8925039", "0.89058864", "0.88919073", "0.8888038", "0.88755494", "0.8872198", "0.88692564", "0.8862156", "0.88610345", "0.88493705", "0.8845...
0.8856633
19
Try to load file and return it as list of encoded patches
def try_load_file(path) -> List[str] or None: try: with open(path, 'r') as file: file_doc = Doc() file_doc.site = 0 pos = 0 result = [] for line in file: for char in line: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_image_patch(filename):\n im = Image.open(filename) # .convert('L')\n width, height = im.size\n pixels = list(im.getdata())\n features = [pixels[i * width:(i + 1) * width] for i in range(height)]\n features = np.asarray(im, dtype=np.float32).flatten()\n features /= 255.0\n return feat...
[ "0.64726204", "0.62505126", "0.5903177", "0.5896279", "0.5820001", "0.5782224", "0.573012", "0.5581746", "0.5480112", "0.54575527", "0.5454", "0.545235", "0.54362994", "0.54290473", "0.542834", "0.54239833", "0.54218155", "0.5421541", "0.5420233", "0.5420149", "0.5404467", ...
0.0
-1
Rendering the home page
def home(): m = Map() # Create map html return render_template('index.html') # pulls map html using jinja2
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def home():\n\n return render_template('home_page.html')", "def render_home():\r\n\treturn render_template(\"index.html\")", "def home():\n\n return render_template(\"home.html\")", "def home():\n return render_template(\"home.html\")", "def home():\n return render_template(\"home.html\")", "...
[ "0.8829311", "0.8817377", "0.8708124", "0.86629224", "0.86629224", "0.86587995", "0.86587995", "0.86587995", "0.86587995", "0.86587995", "0.86587995", "0.86587995", "0.86587995", "0.86587995", "0.86587995", "0.86587995", "0.86587995", "0.86587995", "0.86587995", "0.86587995", ...
0.0
-1
Rendering the home page
def map_page(): m = Map() # Create map html return render_template('index.html') # pulls map html using jinja2
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def home():\n\n return render_template('home_page.html')", "def render_home():\r\n\treturn render_template(\"index.html\")", "def home():\n\n return render_template(\"home.html\")", "def home():\n return render_template(\"home.html\")", "def home():\n return render_template(\"home.html\")", "...
[ "0.8829311", "0.8817377", "0.8708124", "0.86629224", "0.86629224", "0.86587995", "0.86587995", "0.86587995", "0.86587995", "0.86587995", "0.86587995", "0.86587995", "0.86587995", "0.86587995", "0.86587995", "0.86587995", "0.86587995", "0.86587995", "0.86587995", "0.86587995", ...
0.0
-1
Read image from path and return as a tensor of shape [h, w, channels] with the [h, w] == IMAGE_SIZE of type float32
def read_ball_img(image_path): # tf.decode_image does not return the image size, this is an ugly workaround to handle both jpeg and png image = tf.image.decode_png(tf.read_file(image_path), channels=3) image = tf.image.convert_image_dtype(image, tf.float32) return image
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_image_as_tensor(path: Path) -> tf.Tensor:\n img_data = tf.io.read_file(str(path))\n img_tensor = tf.io.decode_jpeg(img_data, channels=3)\n\n return img_tensor", "def _read_image(path):\n data = tf.read_file(path)\n image = tf.image.decode_image(data, channels=3)\n image.set_shape((None...
[ "0.7803744", "0.7791343", "0.7289354", "0.727124", "0.7214965", "0.71977097", "0.719677", "0.718498", "0.71406484", "0.71292204", "0.70598954", "0.70402795", "0.70198274", "0.70051795", "0.70051795", "0.70019186", "0.6998618", "0.69443035", "0.69430023", "0.693112", "0.693112...
0.70031416
15
Get Total polar surface area
def TPSA(row): m = Chem.MolFromSmiles(row.SMILES) total_polar_surface_area = Descriptors.TPSA(m) return total_polar_surface_area
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def surface_area(self) -> float:\n return 4 * np.pi * self.radius**2", "def getArea(self):\n return math.pi * self.radius ** 2", "def getArea(self):\n return math.pi * self.__radius * self.__radius", "def area(self):\n return math.pi * self._r ** 2", "def areas(self):\n\n ...
[ "0.7777839", "0.7402006", "0.7385267", "0.7289801", "0.7253699", "0.723019", "0.722946", "0.7174154", "0.7174154", "0.7151825", "0.71299565", "0.71074015", "0.70817155", "0.706501", "0.705641", "0.6988291", "0.68975425", "0.6841427", "0.68396616", "0.6791542", "0.6768324", ...
0.0
-1
Assigns the name to the client id.
def assign_participant(self, client_id, name): def execute_sql(cursor): # First, check if the id already exists cursor.execute( "SELECT participantName FROM Participants WHERE id = ?", (client_id,) ) row = cursor.fetchone() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def change_client_name(self, name, client):\n if self.name_is_unique(name):\n client.set_name(name)\n self.send_message('Usuario actualizado exitosamente.', client.get_socket())\n else:\n self.send_message('Nombre repetido.', client.get_socket())", "def svn_client_c...
[ "0.7299926", "0.70642865", "0.70382226", "0.6763455", "0.667108", "0.6669093", "0.66261256", "0.65662277", "0.6563408", "0.6563408", "0.6563408", "0.6563408", "0.65221035", "0.64570737", "0.64570737", "0.64325535", "0.64325535", "0.64325535", "0.64325535", "0.64325535", "0.64...
0.0
-1
Refresh the stock of the shop by picking random items according to the given tech level. All previous stock is deleted. If level = 1 is given, a new shop tech level is generated at random.
def refreshStock(self, level : int = -1): self.shipsStock.clear() self.weaponsStock.clear() self.modulesStock.clear() self.turretsStock.clear() # self.currentTechLevel = random.randint(bbConfig.minTechLevel, bbConfig.maxTechLevel) if level == -1: self.currentT...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dispatch_items_randomly(self, level):\n for item in self.list:\n item.position = Item.define_random_position(item, level)", "def calculate_init_stock(self, good=None):\n # random quantity * systemsize * techlevel (hence, it can be zero)\n size = self.planet.system_size\n ...
[ "0.58185315", "0.5667246", "0.5654058", "0.53406847", "0.52687126", "0.5077955", "0.5072522", "0.5072522", "0.50423217", "0.5030303", "0.49926", "0.49758303", "0.49298072", "0.49267536", "0.4905332", "0.48856035", "0.48844653", "0.4878494", "0.48532072", "0.4835317", "0.48244...
0.7923747
0
Decide whether a user can afford to buy a module from the shop's stock
def userCanAffordModuleIndex(self, user : bbUser.bbUser, index : int) -> bool: return self.userCanAffordItemObj(user, self.modulesStock[index].item)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def userBuyModuleObj(self, user : bbUser.bbUser, requestedModule : bbModule.bbModule):\n if self.userCanAffordItemObj(user, requestedModule):\n self.modulesStock.removeItem(requestedModule)\n user.credits -= requestedModule.getValue()\n user.inactiveShips.addItem(requestedMo...
[ "0.70982605", "0.6951467", "0.66625106", "0.6492152", "0.6342462", "0.6278365", "0.6202352", "0.60872567", "0.60636747", "0.6027457", "0.60244405", "0.6011888", "0.5997595", "0.59927183", "0.59882945", "0.5983915", "0.59592366", "0.5954179", "0.5953777", "0.59459627", "0.5939...
0.62770075
6
Buy the given module from the given user, adding the appropriate credits to their balance and adding the module to the shop stock.
def userSellModuleObj(self, user : bbUser.bbUser, module : bbModule.bbModule): user.credits += module.getValue() self.modulesStock.addItem(module) user.inactiveModules.removeItem(module)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def userBuyModuleObj(self, user : bbUser.bbUser, requestedModule : bbModule.bbModule):\n if self.userCanAffordItemObj(user, requestedModule):\n self.modulesStock.removeItem(requestedModule)\n user.credits -= requestedModule.getValue()\n user.inactiveShips.addItem(requestedMo...
[ "0.8151885", "0.7730614", "0.660402", "0.65770423", "0.65631425", "0.65222275", "0.64936644", "0.6486815", "0.6439176", "0.6432775", "0.64279884", "0.63970876", "0.6379256", "0.636527", "0.63427365", "0.633951", "0.6336728", "0.6335715", "0.63278216", "0.62839043", "0.6270996...
0.7865355
1
Buy the module at the given index in the given user's modules bbInventory, adding the appropriate credits to their balance and adding the module to the shop stock.
def userSellModuleIndex(self, user : bbUser.bbUser, index : int): self.userSellModuleObj(user, user.inactiveModules[index].item)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def userBuyModuleIndex(self, user : bbUser.bbUser, index : int):\n self.userBuyModuleObj(user, self.modulesStock[index].item)", "def userBuyShipIndex(self, user : bbUser.bbUser, index : int):\n self.userBuyShipObj(user, self.shipsStock[index].item)", "def userBuyWeaponIndex(self, user : bbUser.bb...
[ "0.8694855", "0.7195289", "0.71288925", "0.7079173", "0.6926473", "0.6704519", "0.61328787", "0.59253204", "0.5846645", "0.5846351", "0.5791958", "0.57431024", "0.57143444", "0.57041574", "0.56748855", "0.56604457", "0.5660299", "0.5650956", "0.5629446", "0.5615227", "0.55931...
0.69305867
4
Buy the given turret from the given user, adding the appropriate credits to their balance and adding the turret to the shop stock.
def userSellTurretObj(self, user : bbUser.bbUser, turret : bbTurret.bbTurret): user.credits += turret.getValue() self.turretsStock.addItem(turret) user.inactiveTurrets.removeItem(turret)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def userBuyTurretObj(self, user : bbUser.bbUser, requestedTurret : bbTurret.bbTurret):\n if self.userCanAffordItemObj(user, requestedTurret):\n self.turretsStock.removeItem(requestedTurret)\n user.credits -= requestedTurret.getValue()\n user.inactiveShips.addItem(requestedTu...
[ "0.82251906", "0.8155633", "0.6883359", "0.6736529", "0.64991075", "0.64374715", "0.6336301", "0.6317039", "0.6314101", "0.6303089", "0.6294355", "0.6289981", "0.623364", "0.62253153", "0.62149304", "0.62137175", "0.6210037", "0.61327016", "0.612677", "0.6108", "0.60649776", ...
0.788418
2
Recreate a bbShop instance from its dictionaryserialized representation the opposite of bbShop.toDict
def fromDict(cls, shopDict : dict, **kwargs) -> bbShop: shipsStock = bbInventory.bbInventory() for shipListingDict in shopDict["shipsStock"]: shipsStock.addItem(bbShip.bbShip.fromDict(shipListingDict["item"]), quantity=shipListingDict["count"]) weaponsStock = bbInventory.bbInventory...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_dict(self, data, session=False):\n for name, field in self._fields.items():\n if not session and name not in self._permanent_fields:\n continue\n # Check if Field has been added since it was saved - leave default\n if name not in data:\n ...
[ "0.6258055", "0.6031494", "0.5930857", "0.5867563", "0.57707405", "0.576839", "0.57591015", "0.56572807", "0.5656643", "0.5656643", "0.5596343", "0.55737543", "0.5573605", "0.5534926", "0.5526491", "0.54953814", "0.54726946", "0.5460249", "0.54492575", "0.54329866", "0.542914...
0.6227879
1
creates a skeleton for a flask project and an initial app called main
def create_project(self,*pages,config_folder = "config",FunctionBased = False): self._make_initial_directories() self._make_initial_files(*pages,FunctionBased = FunctionBased)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_app():\n app = Flask(__name__)\n\n\n @app.route('/')\n def barebones():\n return 'the barebones'\n\n return app", "def create_app():\n app = Flask(__name__)\n\n @app.route('/')\n def root():\n \"\"\"Base view.\"\"\"\n return 'TODO - part 2 and beyond!'\n\n ...
[ "0.79735875", "0.7869407", "0.759055", "0.7404261", "0.7327039", "0.72308815", "0.7207223", "0.71908814", "0.7174959", "0.7152325", "0.71510434", "0.7146426", "0.7112529", "0.70975477", "0.70885324", "0.70749867", "0.7073768", "0.70728564", "0.70442694", "0.69847053", "0.6978...
0.0
-1
Check if the controller is in the parameter server
def check_parameter_server(self, controller): for name in get_rosparam_controller_names("/"): if name == controller: return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_firewall_component(server):\r\n if server['status'] != 'no_edit':\r\n return True\r\n\r\n return False", "def is_used_request(request):\n return getattr(request, 'param', None) is not NOT_USED", "def is_controlled(self):\n return False if self._remote_controller == \"\" else True...
[ "0.6461893", "0.6322898", "0.6285191", "0.5989404", "0.59603727", "0.5916422", "0.5915487", "0.5843136", "0.58398074", "0.5790812", "0.5760535", "0.56450933", "0.5600348", "0.558775", "0.55728436", "0.5572414", "0.554491", "0.551133", "0.54693836", "0.5464618", "0.54548997", ...
0.8469041
0
Sets the name of this VirtualVolume.
def name(self, name): self._name = name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def volume_name(self, volume_name):\n\n self._volume_name = volume_name", "def set_name(self, name):\n self._name = name", "def SetName(self, name):\n self.name = name", "def set_name(self, name):\n self.__name = name", "def set_name(self, name):\n self.__name = name", ...
[ "0.7484202", "0.745157", "0.73794454", "0.7374094", "0.7374094", "0.7357047", "0.7357047", "0.7357047", "0.7357047", "0.7357047", "0.73517925", "0.7345596", "0.7304309", "0.72377944", "0.7233226", "0.72279835", "0.709498", "0.709498", "0.70897764", "0.70779335", "0.6981333", ...
0.0
-1
Sets the operational_status of this VirtualVolume.
def operational_status(self, operational_status): self._operational_status = operational_status
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_vpn_state(self, status):\n if hasattr(self, status):\n self.change_to(getattr(self, status))", "def setstatus(self, status):\n with self.lock:\n self.status = status", "def status(self, status):\n self._set_property_(self.STATUS, str(status))", "def set_stat...
[ "0.610897", "0.5962572", "0.59539366", "0.585962", "0.585962", "0.585962", "0.5845064", "0.5843375", "0.5797951", "0.5769159", "0.568192", "0.568192", "0.568192", "0.568192", "0.568192", "0.568192", "0.568192", "0.568192", "0.568192", "0.568192", "0.568192", "0.568192", "...
0.80436105
1
Sets the service_status of this VirtualVolume.
def service_status(self, service_status): self._service_status = service_status
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_status(self, status):\n self.status = status", "def set_status(self, status):\n self.status = status", "def set_status(self, status):\n self.status = status", "def setstatus(self, status):\n with self.lock:\n self.status = status", "def SetStatus(self, status)...
[ "0.66898036", "0.66898036", "0.66898036", "0.66737175", "0.6634566", "0.65363693", "0.643551", "0.63888526", "0.6354354", "0.6343253", "0.62771344", "0.6261598", "0.6235222", "0.6235222", "0.6235222", "0.6235222", "0.6235222", "0.6235222", "0.6235222", "0.6235222", "0.6235222...
0.82243454
0
Sets the capacity of this VirtualVolume.
def capacity(self, capacity): self._capacity = capacity
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_capacity(self, cap):\n self._capacity.type = 'value'\n self._capacity._value = float(cap) # TODO getter/setter", "def set_capacity(self, cap):\n return self.get_interaction().set_capacity(cap)", "def set_capacity(self, capacity):\r\n params = {\r\n 'AutoScalingGroupName...
[ "0.6970933", "0.6915781", "0.68999064", "0.68919855", "0.66857976", "0.6562229", "0.63230324", "0.6159389", "0.60042834", "0.5782733", "0.56820244", "0.567997", "0.5665047", "0.563284", "0.56165946", "0.5607699", "0.55999744", "0.55999744", "0.5591248", "0.55322313", "0.55139...
0.7412129
0
Sets the consistency_group of this VirtualVolume.
def consistency_group(self, consistency_group): self._consistency_group = consistency_group
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def consistency_group_num(self, consistency_group_num):\n\n self._consistency_group_num = consistency_group_num", "def update(self, consistencygroup, **kwargs):\n if not kwargs:\n return\n\n body = {\"consistencygroup\": kwargs}\n\n return self._update(\"/consistencygroups/...
[ "0.7149782", "0.6853538", "0.6334857", "0.6207128", "0.60788566", "0.59625685", "0.5907258", "0.5852775", "0.5852775", "0.5852775", "0.58254033", "0.57997113", "0.57150644", "0.57144755", "0.5689289", "0.56772465", "0.56529635", "0.5553101", "0.5501922", "0.54839724", "0.5481...
0.8369485
1
Sets the vpd_id of this VirtualVolume.
def vpd_id(self, vpd_id): self._vpd_id = vpd_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pvd(self, pvd):\n\n self.logger.debug(\"In 'pvd' setter.\")\n\n self._pvd = pvd", "def volume_id(self, volume_id):\n self._volume_id = volume_id", "def vat_id(self, vat_id):\n\n self._vat_id = vat_id", "def vat_id(self, vat_id: str):\n\n self._vat_id = vat_id", "def v...
[ "0.6969665", "0.67383546", "0.64475673", "0.6406723", "0.62326676", "0.5910629", "0.58898014", "0.58898014", "0.57697004", "0.5754855", "0.5741645", "0.5686967", "0.56776226", "0.5590102", "0.55152565", "0.54322034", "0.54322034", "0.5386286", "0.53834975", "0.5319886", "0.53...
0.85892636
0
Sets the thin_enabled of this VirtualVolume.
def thin_enabled(self, thin_enabled): self._thin_enabled = thin_enabled
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def thin_provision(self, thin_provision):\n if self.local_vars_configuration.client_side_validation and thin_provision is None: # noqa: E501\n raise ValueError(\"Invalid value for `thin_provision`, must not be `None`\") # noqa: E501\n\n self._thin_provision = thin_provision", "def enab...
[ "0.6482025", "0.5572778", "0.54370624", "0.5342755", "0.52419966", "0.52073795", "0.5206315", "0.52043945", "0.52043945", "0.52000064", "0.5179025", "0.51321137", "0.5130963", "0.51092947", "0.50526917", "0.50484157", "0.5041937", "0.5037425", "0.49942026", "0.49941552", "0.4...
0.8542228
0
Sets the expansion_status of this VirtualVolume.
def expansion_status(self, expansion_status): self._expansion_status = expansion_status
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_expand(self, expand):\n\n self.props[\"expand\"] = expand", "def expandable(self, expandable):\n\n self._expandable = expandable", "def allow_volume_expansion(self) -> Optional[bool]:\n return pulumi.get(self, \"allow_volume_expansion\")", "def allow_volume_expansion(self) -> Opt...
[ "0.5789183", "0.54652447", "0.5223804", "0.5223804", "0.5223804", "0.5223804", "0.5223804", "0.5187743", "0.51768696", "0.50857395", "0.50851804", "0.50851804", "0.50851804", "0.5048075", "0.50174797", "0.5014594", "0.49771363", "0.49771363", "0.49771363", "0.49771363", "0.49...
0.8117614
0
Sets the initialization_status of this VirtualVolume.
def initialization_status(self, initialization_status): self._initialization_status = initialization_status
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setstatus(self, status):\n with self.lock:\n self.status = status", "def setStatus(self, status):\n self.__status = status", "def __init__(__self__, *,\n provisioning_status: Optional[pulumi.Input['StorageSpacesPropertiesProvisioningStatusArgs']] = None):\n i...
[ "0.56455207", "0.56097454", "0.55460435", "0.5544368", "0.5544368", "0.5544368", "0.5422396", "0.5419974", "0.53774214", "0.53522897", "0.534101", "0.533698", "0.53162193", "0.53162193", "0.53162193", "0.53162193", "0.53162193", "0.53162193", "0.53162193", "0.53162193", "0.53...
0.7869383
0
Sets the storage_array_family of this VirtualVolume.
def storage_array_family(self, storage_array_family): self._storage_array_family = storage_array_family
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_family_array(self, name, family, value, index=None):\n util.set_array_if_not_same(self._family_arrays[name][family],\n value, index)", "def model_family(self, model_family: str):\n\n self._model_family = model_family", "def setUseStorage(self, value):\n ...
[ "0.6358175", "0.572155", "0.53161937", "0.52799076", "0.5259348", "0.5142962", "0.50805575", "0.5027383", "0.50160766", "0.49891466", "0.49276325", "0.49118283", "0.49117503", "0.48248723", "0.47402743", "0.47171727", "0.46770522", "0.46538273", "0.4637978", "0.4636576", "0.4...
0.84063625
0
Sets the system_id of this VirtualVolume.
def system_id(self, system_id): self._system_id = system_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def system(self, system):\n\n self._system = system", "def system(self, system):\n\n self._system = system", "def system_vlan_num(self, system_vlan_num):\n\n self._system_vlan_num = system_vlan_num", "def set_system_name(self, system_name):\n\n\t\tif system_name is not None and not isins...
[ "0.6435196", "0.6435196", "0.6375089", "0.62820965", "0.5808125", "0.5782071", "0.5747657", "0.56810486", "0.561093", "0.5564335", "0.5561811", "0.5560505", "0.555318", "0.5481213", "0.5431305", "0.5376882", "0.53742164", "0.53479266", "0.53288454", "0.52925205", "0.52721816"...
0.79966134
1
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, VirtualVolume): return False return self.__dict__ == other.__dict__
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False", "def __eq__(self, other):\n if i...
[ "0.808826", "0.808826", "0.8054592", "0.79827315", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): return not self == other
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other) -> bool:\n return not self.__eq__(other)", "def __eq__(self, other):\n ...
[ "0.845611", "0.8391477", "0.8144138", "0.81410587", "0.8132492", "0.8093973", "0.80920255", "0.80920255", "0.80920255", "0.8085325", "0.8085325", "0.8076365", "0.8076365", "0.8065748" ]
0.0
-1
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, ListVulnerabilitiesRequest): return False return self.__dict__ == other.__dict__
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False", "def __eq__(self, other):\n if i...
[ "0.808826", "0.808826", "0.8054592", "0.79827315", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): return not self == other
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other) -> bool:\n return not self.__eq__(other)", "def __eq__(self, other):\n ...
[ "0.845611", "0.8391477", "0.8144138", "0.81410587", "0.8132492", "0.8093973", "0.80920255", "0.80920255", "0.80920255", "0.8085325", "0.8085325", "0.8076365", "0.8076365", "0.8065748" ]
0.0
-1
Create a new InputExample.
def __init__(self, guid, text_a, text_b=None, label=None, logits=None, meta: Optional[Dict] = None, idx=-1, num_choices=1): self.guid = guid self.text_a = text_a self.text_b = text_b self.label = label self.logits = logits self.idx = idx self.num_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_example(self, content, set_type):\n return InputExample(content=content, processor=self)", "def create_input(self, name, service, input_format=None, description=None):\n\n if not description: description = name\n\n # Note: Format is only relevant for HTTP sources.\n # ...
[ "0.74833566", "0.66668946", "0.6510095", "0.6506385", "0.6452735", "0.64490294", "0.62113017", "0.6176637", "0.6123469", "0.6103582", "0.6094721", "0.594659", "0.58926135", "0.5834265", "0.57247436", "0.5699933", "0.56722575", "0.567023", "0.56511265", "0.56355", "0.5628377",...
0.0
-1
Serialize this instance to a Python dictionary.
def to_dict(self): output = copy.deepcopy(self.__dict__) return output
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_dict(self):\n serialized = self._serializer().dump(self)\n return serialized.data", "def to_dict(self):\n return to_dict(self.__dict__)", "def to_dict(self):\n return dumpd(self)", "def to_dict(self):\r\n return self.__dict__", "def to_dict(self):\n return s...
[ "0.85705614", "0.8489506", "0.8483257", "0.8405309", "0.83966506", "0.83966506", "0.83966506", "0.83966506", "0.83966506", "0.83966506", "0.8390355", "0.8388496", "0.83509785", "0.83370554", "0.831165", "0.8303297", "0.8290091", "0.82854676", "0.82784045", "0.82483166", "0.82...
0.0
-1
Serialize this instance to a JSON string.
def to_json_string(self): return json.dumps(self.to_dict(), indent=2, sort_keys=True) + "\n"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def serialize(self) -> str:\n return json.dumps(self.__dict__)", "def serialize(self):\n return json.dumps(self.as_dict())", "def to_json(self) -> str:\n return json.dumps(self.to_dict())", "def to_json(self) -> str:\n return json.dumps(self.to_dict())", "def to_json(self) -> st...
[ "0.906579", "0.89350706", "0.89004624", "0.89004624", "0.89004624", "0.89004624", "0.89004624", "0.89004624", "0.89004624", "0.89004624", "0.89004624", "0.88283694", "0.8805552", "0.8763156", "0.8707908", "0.86420715", "0.863601", "0.863601", "0.8541049", "0.85313785", "0.852...
0.0
-1
Create a new InputExample.
def __init__(self, guid, text_a, text_b=None, label=None, logits=None, meta: Optional[Dict] = None, idx=-1, num_choices=1,answer_idx=[]): self.guid = guid self.text_a = text_a self.text_b = text_b self.label = label self.logits = logits self.idx = idx ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_example(self, content, set_type):\n return InputExample(content=content, processor=self)", "def create_input(self, name, service, input_format=None, description=None):\n\n if not description: description = name\n\n # Note: Format is only relevant for HTTP sources.\n # ...
[ "0.74844205", "0.6667367", "0.6507806", "0.6506553", "0.6453331", "0.6449548", "0.6210729", "0.6177141", "0.6122623", "0.61033857", "0.60960156", "0.59476984", "0.5893111", "0.5835057", "0.5724173", "0.57007885", "0.5672324", "0.5670384", "0.5651038", "0.5635032", "0.56285304...
0.0
-1
Serialize this instance to a Python dictionary.
def to_dict(self): output = copy.deepcopy(self.__dict__) return output
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_dict(self):\n serialized = self._serializer().dump(self)\n return serialized.data", "def to_dict(self):\n return to_dict(self.__dict__)", "def to_dict(self):\n return dumpd(self)", "def to_dict(self):\r\n return self.__dict__", "def to_dict(self):\n return s...
[ "0.85705614", "0.8489506", "0.8483257", "0.8405309", "0.83966506", "0.83966506", "0.83966506", "0.83966506", "0.83966506", "0.83966506", "0.8390355", "0.8388496", "0.83509785", "0.83370554", "0.831165", "0.8303297", "0.8290091", "0.82854676", "0.82784045", "0.82483166", "0.82...
0.0
-1
Serialize this instance to a JSON string.
def to_json_string(self): return json.dumps(self.to_dict(), indent=2, sort_keys=True) + "\n"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def serialize(self) -> str:\n return json.dumps(self.__dict__)", "def serialize(self):\n return json.dumps(self.as_dict())", "def to_json(self) -> str:\n return json.dumps(self.to_dict())", "def to_json(self) -> str:\n return json.dumps(self.to_dict())", "def to_json(self) -> st...
[ "0.906579", "0.89350706", "0.89004624", "0.89004624", "0.89004624", "0.89004624", "0.89004624", "0.89004624", "0.89004624", "0.89004624", "0.89004624", "0.88283694", "0.8805552", "0.8763156", "0.8707908", "0.86420715", "0.863601", "0.863601", "0.8541049", "0.85313785", "0.852...
0.0
-1
Return an instance of this string that is marked as shortenable
def shortenable(s): return s, True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stringify_short(self):\n return self.stringify()", "def get_short_flag(self):\n return self.short_flag", "def short_code(self, sid):\r\n return ShortCode(self, sid)", "def short_codes(self):\r\n return ShortCodes(self)", "def nextShort(self) -> \"short\":\n raise NotI...
[ "0.6693068", "0.66084087", "0.64610904", "0.6360165", "0.5789961", "0.57614636", "0.5606999", "0.5565531", "0.54839414", "0.54011315", "0.53984505", "0.53884774", "0.5373937", "0.53497344", "0.5323252", "0.5268928", "0.524313", "0.5239879", "0.5225803", "0.52181965", "0.51808...
0.6781918
0
Creates new storage blob with provided name.
def new_blob(self, blob_name): return storage.Blob(blob_name, self.bucket)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def CreateBlob(self, blob_key, blob):\n self._blobs[blobstore.BlobKey(unicode(blob_key))] = blob", "def upload_file(file_name):\n blob_client = blob_svc_client.get_blob_client(container=container_name, \n blob=file_name.rsplit('/', maxsplit=1)[-1])\n\n ...
[ "0.69727933", "0.6930854", "0.6649648", "0.6394113", "0.62141454", "0.62107706", "0.61868376", "0.6183597", "0.61417305", "0.6131775", "0.61157864", "0.5998787", "0.5932819", "0.5923683", "0.59099483", "0.5853209", "0.58165365", "0.5808207", "0.5799668", "0.57435995", "0.5718...
0.8235651
0
Compute interpolated keyframe curframe at given time t.
def interpolateLinear( t): k = np.searchsorted( keytime, t, side='right') - 1 u = (t - keytime[k]) / (keytime[k + 1] - keytime[k]) curframe = (1.0-u)*keyframe[k] + u*keyframe[k+1] return curframe
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def interpolateCubic( t):\n curframe = []\n frame = np.searchsorted( keytime, t, side='right') - 1\n\n for i in range(11):\n poly = S[i]\n res = poly[frame](t)\n curframe.append(res)\n\n return curframe", "def make_frame(t):\r\n while world['t'] < hours_per_second*t:\r\n ...
[ "0.62958246", "0.5940751", "0.5886671", "0.5645419", "0.5560966", "0.5451722", "0.5347515", "0.5313439", "0.5242148", "0.5220911", "0.5180004", "0.5165218", "0.51633304", "0.51428956", "0.51402813", "0.51286083", "0.51018995", "0.50735223", "0.50711644", "0.5036631", "0.50275...
0.79002583
0
Compute interpolated keyframe curframe at given time t.
def interpolateCubic( t): curframe = [] frame = np.searchsorted( keytime, t, side='right') - 1 for i in range(11): poly = S[i] res = poly[frame](t) curframe.append(res) return curframe
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def interpolateLinear( t):\n k = np.searchsorted( keytime, t, side='right') - 1\n u = (t - keytime[k]) / (keytime[k + 1] - keytime[k])\n curframe = (1.0-u)*keyframe[k] + u*keyframe[k+1]\n\n return curframe", "def make_frame(t):\r\n while world['t'] < hours_per_second*t:\r\n update(w...
[ "0.79002583", "0.5940751", "0.5886671", "0.5645419", "0.5560966", "0.5451722", "0.5347515", "0.5313439", "0.5242148", "0.5220911", "0.5180004", "0.5165218", "0.51633304", "0.51428956", "0.51402813", "0.51286083", "0.51018995", "0.50735223", "0.50711644", "0.5036631", "0.50275...
0.62958246
1
Create new InputMetaLayer object. This is currently not a complete wrapper on the Layer Input, as it only wraps the keyword arguments that are used in most common models.
def __init__(self, input_shape: Union[int, Tuple[int]], name: str = None, **kwargs): super().__init__(**kwargs) if isinstance(input_shape, int): input_shape = (input_shape, ) self._input_shape = input_shape self._name = name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_layer(layer, **kwargs):\r\n from .io import from_layer\r\n return from_layer(layer=layer, **kwargs)", "def make_input(name, data, dtype=None, **tags):\n from ..utils import make_placeholder_for\n input_var = make_placeholder_for(name, data, dtype=dtype, **tags)\n input_layer = Inp...
[ "0.64052975", "0.63433474", "0.6247636", "0.60580474", "0.59910697", "0.5989174", "0.59566367", "0.58870226", "0.5884702", "0.573339", "0.5700957", "0.5667299", "0.5654726", "0.5627717", "0.56261784", "0.5621748", "0.56090343", "0.5589271", "0.5551422", "0.55495834", "0.55215...
0.51207465
69
Searches for an attendee in the dictionary. On failure, this method raises an MissingAttendeeException.
def Find_attendee(self, email): if email in self.Attendees: return self.Attendees[email] else: raise MissingAttendeeException(email)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def query(self):\n if not self.invite:\n self.invite = Invite.get_by_unique_id(self.invite_unique_id)\n\n invite_attendee = InviteAttendee.query(\n ndb.AND(\n InviteAttendee.invite == self.invite.key,\n InviteAttendee.is_organizer == True\n ...
[ "0.57232606", "0.5619452", "0.5422725", "0.5229931", "0.52166516", "0.51550144", "0.5071238", "0.48276898", "0.47516736", "0.47301325", "0.4717967", "0.47106192", "0.4573977", "0.45541188", "0.4506827", "0.44506383", "0.4412202", "0.4361697", "0.4359595", "0.43563908", "0.434...
0.72808045
0
Add an attendee to the workshop, using their email address as key. If the email address is already present in the list of attendees or is on the waitlist, this method raises a PreexistingAddressException. If the address is on the waitlist, it will print a message reminding the user to call Promote_from_waitlist() inste...
def Add_attendee(self, email): if (email not in self.Attendees) and (email not in self.Waitlist): self.Attendees[email] = Attendee(email) else: if email in self.Waitlist: print("Call Promote_from_waitlist() to move an applicant from " "the waitli...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Add_to_waitlist(self, email):\n if email not in self.Waitlist:\n self.Waitlist.add(email)\n else:\n raise PreexistingAddressException(email)", "def add(self, attendees):\n if attendees:\n if isinstance(attendees, str):\n self.__attendees.ap...
[ "0.6951151", "0.6493141", "0.638492", "0.63520235", "0.6294123", "0.6257834", "0.60932446", "0.6046712", "0.5832052", "0.5677826", "0.56330425", "0.5532017", "0.55039465", "0.54828507", "0.5451385", "0.54199326", "0.5349298", "0.5217281", "0.521642", "0.52089477", "0.5205778"...
0.82025707
0
Check if an applicant is accepted or waitlisted. This method first checks the attendee list, then checks the waitlist. If the supplied email address is not found, raises a MissingAddressException.
def Get_applicant_status(self, email): status = None if email in self.Attendees: status = ApplicantStatus.Accepted elif email in self.Waitlist: status = ApplicantStatus.Waitlisted else: raise MissingAddressException(email) return status
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Add_attendee(self, email):\n if (email not in self.Attendees) and (email not in self.Waitlist):\n self.Attendees[email] = Attendee(email)\n else:\n if email in self.Waitlist:\n print(\"Call Promote_from_waitlist() to move an applicant from \"\n ...
[ "0.62334037", "0.5781845", "0.56028545", "0.55881464", "0.5553194", "0.5428202", "0.53361905", "0.5327851", "0.53183365", "0.530265", "0.5272272", "0.51593596", "0.5106135", "0.50733864", "0.5050823", "0.50445324", "0.49496946", "0.4940701", "0.49240455", "0.49218234", "0.489...
0.64265865
0
Compute how many attendees signed in to each session on a day. For every attendee that signs in to one of the offered sessions, this method increments the counter for that session (or initializes it to one for a session that hasn't been encountered yet.
def Show_attendance_by_session(self, day): sessions = {} for x in self.Attendees.values(): if (x.Sessions[day] in sessions) and (x.Sessions[day] is not ""): sessions[x.Sessions[day]] = sessions[x.Sessions[day]] + 1 else: sessions[x.Sessions[day]] =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_num_of_sessions(self):\n return len(self.current_sessions)", "def prepare_count_incidents(self, object):\n roles = object.actorrole_set.all()\n return Incident.objects.filter(actors_role__in=roles).count()", "def getSessionCount(self):\n logger.debug('Getting the number of s...
[ "0.57090175", "0.5537584", "0.5531266", "0.54969347", "0.5439328", "0.53762466", "0.5323897", "0.53211915", "0.53091717", "0.53065026", "0.52897257", "0.52137667", "0.5194744", "0.51804066", "0.51711667", "0.5168871", "0.51473755", "0.51372963", "0.51321065", "0.50912875", "0...
0.7209948
0
Add post by calling posts service. Adds user id of the user making the post as author_id to form data sent to posts service.
def add_post(): user = get_user() if not user: return 'Error: not logged in.', 401 url = app.config['POSTS_ENDPOINT'] + 'add' form_data = dict(**request.form.to_dict(), author_id=user['user_id']) images = ((img.filename, img.read()) for img in request.files.getlist("images") if...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_post(request):\n if request.session.get('id_user') is None:\n request.session['res'] = 'Warn'\n messages.add_message(request, messages.WARNING,\n \"The session has expired\")\n return HttpResponseRedirect(reverse('home'))\n form = PostForm(request.POST...
[ "0.7602229", "0.72879845", "0.7005604", "0.69434804", "0.6921558", "0.6888893", "0.6812449", "0.6746644", "0.6545158", "0.6529506", "0.64980423", "0.6371167", "0.6338856", "0.6317552", "0.63172317", "0.63016665", "0.6293583", "0.62622327", "0.6239217", "0.623715", "0.62160236...
0.6413327
11
Constructor for the UpdateNetworkWarmSpareSettingsModel class
def __init__(self, enabled=None, spare_serial=None, uplink_mode=None, virtual_ip_1=None, virtual_ip_2=None): # Initialize members of the class self.enabled = enabled self.spare_serial = spare_serial ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, *args, **kwds):\n if args or kwds:\n super(KltSettings, self).__init__(*args, **kwds)\n #message fields cannot be None, assign default values for those that are\n if self.max_features is None:\n self.max_features = 0\n if self.window_size is None:\n self.wind...
[ "0.58650357", "0.58364075", "0.56694484", "0.5654198", "0.56180215", "0.5558292", "0.55111986", "0.5496053", "0.54935926", "0.54797506", "0.54699427", "0.5432645", "0.541772", "0.53851205", "0.5382769", "0.5381621", "0.5377827", "0.53581154", "0.53518355", "0.5346524", "0.534...
0.0
-1
Creates an instance of this model from a dictionary
def from_dictionary(cls, dictionary): if dictionary is None: return None # Extract variables from the dictionary enabled = dictionary.get('enabled') spare_serial = dictionary.get('spareSerial') uplink_mode = dictionary.get('uplinkMode'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_dictionary(cls,\n dictionary):\n if dictionary is None:\n return None\n\n # Extract variables from the dictionary\n id = dictionary.get('id')\n name = dictionary.get('name')\n mtype = dictionary.get('type')\n usage_bytes = diction...
[ "0.83181584", "0.8168118", "0.8168118", "0.8118749", "0.8089047", "0.79787344", "0.7949278", "0.79231393", "0.7898951", "0.78923255", "0.788838", "0.7882321", "0.7882212", "0.7876749", "0.78585315", "0.7836853", "0.7801407", "0.7801407", "0.7801407", "0.7801407", "0.7801407",...
0.7384797
99
the total of the sizes desired from this iterator. The actual total may be different.
def target_totalsize(self): return self._cfg.get('totalsize', None)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def totalsize(self):\n return sum([sz for sz in self.iterate()])", "def get_size(self) -> int:\n total_size = 0\n for entry in self.__entries:\n total_size += entry.get_size()\n return total_size", "def size(self) -> int:\n\n return self.sizes.sum()", "def size(s...
[ "0.8967633", "0.80836415", "0.805573", "0.798454", "0.78757304", "0.7668775", "0.7647352", "0.74896413", "0.746906", "0.74311477", "0.7368163", "0.73571527", "0.73442554", "0.7338029", "0.7319467", "0.73103803", "0.7305982", "0.7300571", "0.7300571", "0.7300571", "0.7300571",...
0.0
-1
Give a mock reader and writer when a stream connection is opened.
def mock_open_connection(self): def create_connection(*args, **kwargs): reader = MockStreamReader(loop=self.loop) writer = MockStreamWriter(None, None, reader, self.loop) writer.write = mock.Mock() fut = asyncio.Future(loop=self.loop) fut.set_result((r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mock_tcp_connection() -> Generator[CoroutineMock, Any, None]:\n with patch('aioswitcher.api.open_connection') as conn:\n reader = Mock(StreamReader)\n writer = Mock(StreamWriter)\n conn.return_value = (reader, writer)\n yield reader", "def mock_stream(data):\n protocol = moc...
[ "0.7795498", "0.7233274", "0.66034263", "0.6403565", "0.63792", "0.6328056", "0.62839264", "0.6120355", "0.609141", "0.60079086", "0.5939413", "0.59386855", "0.58975446", "0.58960325", "0.5892057", "0.5866836", "0.5760095", "0.57350403", "0.57150084", "0.5706348", "0.5706348"...
0.78338385
0
Initializes a sim state model from the given JSON dict.
def __init__(self, src_path, json, *args, **kwargs): super(SimState, self).__init__(*args, **kwargs) self.src_path = src_path self.json = json self.name = json['name'] self.super = json['super'] self.vars = [] for json_var in json['vars']: self.vars.append(SimVar(json_var))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def state_from_json(self, js: Union[Dict[str, Any], str]) -> \"State\":\n state: FrameState = self.__sim.new_state(json_str(js))\n return State(self, state=state)", "def from_json(self, config_js: Union[Dict[str, Any], str]):\n self.__sim = self.__sim.from_json(json_str(config_js))", "def ...
[ "0.7310419", "0.7136584", "0.7001818", "0.6644982", "0.64461297", "0.63815403", "0.6281719", "0.6263004", "0.6263004", "0.6263004", "0.6263004", "0.6263004", "0.6263004", "0.6263004", "0.6263004", "0.6263004", "0.6263004", "0.6263004", "0.6263004", "0.6263004", "0.6263004", ...
0.7188024
1
Test retriving a list of ingredients.
def test_retrive_ingredient_list(self): Ingredient.objects.create(user=self.user, name='Kale') Ingredient.objects.create(user=self.user, name='Salt') res = self.client.get(INGREDIENTS_URL) ingredients = Ingredient.objects.all().order_by('-name') serilizer = IngredientSerialize...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_retreive_ingredients_list(self):\n Ingredients.objects.create(user=self.user, name='Kale')\n Ingredients.objects.create(user=self.user, name='Carrot')\n\n res = self.client.get(INGREDIENT_URL)\n\n ingredients = Ingredients.objects.all().order_by('-name')\n serializer = I...
[ "0.7930593", "0.78405124", "0.78053796", "0.76870245", "0.7683865", "0.7640372", "0.7586847", "0.75048697", "0.7493256", "0.7422351", "0.735028", "0.7328322", "0.7293226", "0.7277591", "0.7223209", "0.7203523", "0.7056605", "0.7031455", "0.69995844", "0.6978001", "0.6976303",...
0.78382385
2
Test creating invalid ingredient fails
def test_create_ingredient_invalid(self): payload = {'name': ''} res = self.client.post(INGREDIENTS_URL, payload) self.assertEqual(res.status_code, status.HTTP_400_BAD_REQUEST)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_ingredient_invalid(self):\n\n payload = {'name': ''}\n\n res = self.client.post(INGREDIENTS_URL, payload)\n\n self.assertEqual(res.status_code, status.HTTP_400_BAD_REQUEST)", "def test_create_ingredient_invalid(self):\n payload = {\n 'name': ''\n }\n ...
[ "0.832965", "0.8300355", "0.82751215", "0.8057688", "0.7770255", "0.74378127", "0.7305816", "0.7297803", "0.71882874", "0.716899", "0.7070017", "0.70322067", "0.7011709", "0.6996802", "0.69841146", "0.69791144", "0.6854592", "0.67813057", "0.6730749", "0.67242676", "0.6705703...
0.8349848
0
PPO forward pass during exploration. Besides the action distribution, this method also returns the parameters of the policy distribution to be used for computing KL divergence between the old policy and the new policy during training.
def _forward_exploration(self, batch: NestedDict) -> Mapping[str, Any]: output = {} # TODO (Artur): Remove this once Policy supports RNN if self.encoder.config.shared: batch[STATE_IN] = None else: batch[STATE_IN] = { ACTOR: None, C...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculate_policy(self, state):\n # short aliases\n s = state # s stands for state\n g = self.config['gamma'] # g stands for gamma\n n = self.action_space.n # n stands for the number of actions\n a = self.config['alpha']\n pi_s = self.policy[state] # pi_s stands for...
[ "0.69694346", "0.6721106", "0.6600235", "0.6448375", "0.6432647", "0.6429928", "0.6376032", "0.6318261", "0.6232728", "0.6215525", "0.61996806", "0.6198685", "0.6126165", "0.61068016", "0.6092286", "0.6079757", "0.6035482", "0.60280526", "0.6023603", "0.6018219", "0.6005443",...
0.55313677
94
Returns true if the input string is an exact match or is a parent of the current rule. For example, the input "foo" would match "foo/bar".
def ParentOrMatch(self, other): return self._dir == other or self._dir.startswith(other + "/")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_parent_of(a, b):\n a = a.rstrip(\"/\") + \"/\"\n b = b.rstrip(\"/\") + \"/\"\n return b.startswith(a)", "def stringcheck(self, rule, string):\n if not \"*\" in rule:\n return rule in string\n elif rule[0] == \"*\":\n return string.endswith(rule[1:])\n el...
[ "0.6126698", "0.61080897", "0.595353", "0.5909226", "0.58374923", "0.58259046", "0.57361436", "0.5688292", "0.56122553", "0.55804825", "0.55572253", "0.55557173", "0.5533373", "0.5527504", "0.5467835", "0.5460459", "0.54595035", "0.5457578", "0.54355943", "0.5397742", "0.5397...
0.6591054
0
Initializes the current rules with an empty rule list.
def __init__(self): self._rules = []
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, *args):\n this = _libsbml.new_ListOfRules(*args)\n try: self.this.append(this)\n except: self.this = this", "def __init__(self, rules):\n self.rules = rules\n\n self._rhs_rules = defaultdict(list)\n self._rhs_unary_rules = defaultdict(list)\n\n ...
[ "0.6711449", "0.6559701", "0.64717335", "0.6440759", "0.6372311", "0.6318276", "0.62302643", "0.6225394", "0.6114428", "0.60714287", "0.60714287", "0.60714287", "0.60714287", "0.60714287", "0.60563016", "0.6040242", "0.5943357", "0.59213316", "0.58914596", "0.5876889", "0.586...
0.6947913
0
Get a random 'bacon ipsum' sentence
def lorem(): return jsonify(objects=choice(BACON_IPSUM))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_random_phrase():\n return random.choices(PHRASES, WEIGHTS, k=1)[0]", "def get_random_phrase(self):\n return random.choice(self.phrases)", "def get_random_str(main_str):\n random.seed(time.time())\n sentences = tokenize.sent_tokenize(main_str)\n random_sentence = random.choice(sentenc...
[ "0.70955956", "0.70277435", "0.6908854", "0.68263525", "0.6803456", "0.68022555", "0.6786628", "0.6775289", "0.6743554", "0.67390364", "0.6733594", "0.6728541", "0.6712171", "0.663811", "0.65662116", "0.65206885", "0.64819235", "0.64735246", "0.6473171", "0.6469222", "0.64596...
0.0
-1
Get a user by their ID.
def get_user(user_id): try: return UserModel.objects.get(id=user_id) except UserModel.DoesNotExist: return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_user_by_id(self, id):\n\t\treturn self.users.get(id)", "def get(id):\n return User.query.filter_by(id=id).first()", "def get(self, id):\n\t\ttry:\n\t\t\tflask_app.logger.debug('We are getting the user: %d', id)\n\t\t\treturn user_service.get(id)\n\t\texcept AssertionError as e:\n\t\t\tuser_space...
[ "0.88861406", "0.86365294", "0.85202235", "0.8517583", "0.8488731", "0.84511024", "0.8395609", "0.8386479", "0.83738387", "0.8367229", "0.835282", "0.8351773", "0.8351773", "0.8351773", "0.8351773", "0.8349936", "0.8319482", "0.8300946", "0.83005583", "0.8246705", "0.8239341"...
0.8028615
40
Compute error in assigned energy.
def error_in_assigned_energy(predictions, ground_truth): errors = {} both_sets_of_meters = iterate_through_submeters_of_two_metergroups( predictions, ground_truth) for pred_meter, ground_truth_meter in both_sets_of_meters: sections = pred_meter.good_sections() ground_truth_energy = g...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculate_energy_conservation_error(self):\n assert self.data is not None\n # calculate total energy at start and end of simulation\n energy_start = self.measure_total_energy(self.t0)\n energy_end = self.measure_total_energy(self.t1)\n \n # calculate accuracy\n ...
[ "0.7673071", "0.7261708", "0.70349896", "0.6841539", "0.6831616", "0.67946625", "0.6758311", "0.6587101", "0.6583621", "0.65466523", "0.6533069", "0.6529721", "0.65093976", "0.64881486", "0.6468679", "0.64505327", "0.6443367", "0.6417644", "0.6359125", "0.6347714", "0.6335141...
0.6870523
3
RNN cell function with tanh activation
def _rnn_tanh_cell(inputs, hidden, w_ih, w_hh, b_ih, b_hh): if b_ih is None: igates = P.MatMul(False, True)(inputs, w_ih) hgates = P.MatMul(False, True)(hidden, w_hh) else: igates = P.MatMul(False, True)(inputs, w_ih) + b_ih hgates = P.MatMul(False, True)(hidden, w_hh) + b_hh ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def activation(x):\n # return np.tanh(x)\n return np.maximum(0,x)", "def apply_activation(self, tens):\n if(self.activation == \"ReLU\"): # pylint: disable=no-else-return\n return tf.nn.relu(tens)\n elif(self.activation == \"Leaky_ReLU\"):\n return tf.nn.leaky_relu(tens)\n elif(self.activa...
[ "0.69215816", "0.6788837", "0.67736083", "0.67255974", "0.6679339", "0.6654235", "0.6556268", "0.6556268", "0.6527681", "0.64941", "0.6482483", "0.64754736", "0.6464059", "0.6446869", "0.644436", "0.6429654", "0.6415111", "0.63848644", "0.6321934", "0.63138586", "0.6306427", ...
0.6808671
1
RNN cell function with relu activation
def _rnn_relu_cell(inputs, hidden, w_ih, w_hh, b_ih, b_hh): if b_ih is None: igates = P.MatMul(False, True)(inputs, w_ih) hgates = P.MatMul(False, True)(hidden, w_hh) else: igates = P.MatMul(False, True)(inputs, w_ih) + b_ih hgates = P.MatMul(False, True)(hidden, w_hh) + b_hh ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(\n self,\n n_in_channel=1,\n nclass=10,\n attention=True,\n activation=\"glu\",\n dropout=0.5,\n train_cnn=True,\n rnn_type=\"BGRU\",\n n_RNN_cell=128,\n n_layers_RNN=2,\n dropout_recurrent=0,\n cnn_integration=False,\...
[ "0.69049406", "0.6694786", "0.6610544", "0.6543841", "0.6488849", "0.64725643", "0.6468668", "0.6452474", "0.6450946", "0.64453447", "0.63995737", "0.6399099", "0.6392296", "0.63896805", "0.6389588", "0.63879484", "0.6385305", "0.63842195", "0.6382756", "0.6370192", "0.635885...
0.68751925
1
Returns instance of nonlinearity class (from torch.nn)
def create_nonlinearity(name): module = import_module("torch.nn") clazz = getattr(module, name) instance = clazz() return instance
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_class_nonlinearity(name):\n module = import_module(\"torch.nn\")\n clazz = getattr(module, name)\n\n return clazz", "def get_nonlinearity(name):\n if name == 'relu':\n return nn.ReLU(inplace=True)\n elif name == 'softplus':\n return nn.Softplus()\n elif name == 'swish':\n ...
[ "0.79875916", "0.7752334", "0.7361392", "0.64611924", "0.6386992", "0.634787", "0.62646323", "0.60385823", "0.6031603", "0.6024365", "0.60142076", "0.6009464", "0.59846556", "0.591352", "0.5907569", "0.58670866", "0.580639", "0.57910013", "0.5784239", "0.5772914", "0.5715353"...
0.8535837
0
Sums the values of the common keys in dictionary.
def sum_dictionares(dicts: dict): def reducer(accumulator, element): for key, value in element.items(): accumulator[key] = accumulator.get(key, 0) + value return accumulator return reduce(reducer, dicts, {})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dict_sum(d):\n return sum(k*v for k, v in d.items())", "def value_sum(my_dict):\n \n # Enter code here\n a = 0\n for key in my_dict:\n a += my_dict[key]\n return a", "def _sum_over_dicts(total_n_grams: Dict[int, Tensor], n_grams: Dict[int, Tensor]) ->Dict[int, Tensor]:\n for n i...
[ "0.6692155", "0.66515815", "0.6525686", "0.6519993", "0.6500651", "0.64367247", "0.6334926", "0.62519944", "0.61483663", "0.59957457", "0.5956586", "0.5954998", "0.59507287", "0.5906354", "0.5846831", "0.58201337", "0.57652277", "0.5752573", "0.5737671", "0.5719358", "0.57102...
0.6337445
6
Draw an SVG line segment between the given points under parent
def draw_svg_line(points_list, parent, style): line_attribs = {'style': simplestyle.formatStyle(style), inkex.addNS('label', 'inkscape'): 'line', 'd': to_path_string(points_list, False)} inkex.etree.SubElement(parent, inkex.addNS('path', 'svg'), line_attribs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_line(self, x1, y1, x2, y2, style=None, parent=None):\n attrs = {'d': 'M %5f %5f L %5f %5f' % (x1, y1, x2, y2)}\n return self.create_path(attrs, style, parent)", "def line(points):\n return LineString(points)", "def createLineSegment(self):\n return _libsbml.Curve_createLineSe...
[ "0.64222807", "0.64101565", "0.6381611", "0.6279581", "0.6241095", "0.6101679", "0.6073024", "0.6025312", "0.60190606", "0.60175586", "0.5999782", "0.59509224", "0.59188807", "0.59128755", "0.59081477", "0.5896285", "0.5848721", "0.5810793", "0.5793197", "0.5773654", "0.57647...
0.7689063
0
This class method saves a list of json into a file
def save_to_file(cls, list_objs): filename = cls.__name__ dictt = [] if list_objs: for i in list_objs: dictt.append(cls.to_dictionary(i)) with open(filename + ".json", "w") as myfile: myfile.write(cls.to_json_string(dictt))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_to_file(cls, list_objs):\n filen = cls.__name__ + \".json\"\n\n list = []\n if list_objs is not None:\n for i in list_objs:\n i = i.to_dictionary()\n json_dict = json.loads(cls.to_json_string(i))\n list.append(json_dict)\n\n ...
[ "0.84365845", "0.8304052", "0.8297322", "0.82886374", "0.8286166", "0.8252678", "0.8243943", "0.8242665", "0.8226171", "0.8221869", "0.8221248", "0.82067615", "0.8189573", "0.81281996", "0.8106368", "0.80998546", "0.8095289", "0.80938625", "0.8037074", "0.8031842", "0.7923981...
0.8151563
13
recursive function checks if n is prime, i is iterative checker should always be 2
def is_prime(n, i): if n == 2: # 2 is prime return True elif n < 2: # less then 2 or even not prime return False elif n % i == 0: # divisible by 3 or greater not prime return False else: if int(n ** 0.5) + 1 == i: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isprime(n):\r\n\treturn is_prime(n)", "def isprime(n):\n\treturn is_prime(n)", "def isprime(n):\n if n == 2: return True\n if n == 3: return True\n if n % 2 == 0: return False\n if n % 3 == 0: return False\n i = 5\n w = 2\n while i * i <= n:\n if n % i == 0:\n return False...
[ "0.8216246", "0.8142434", "0.8015298", "0.801398", "0.79860234", "0.7963012", "0.796197", "0.79593444", "0.7947045", "0.79118127", "0.7889574", "0.7883453", "0.7878145", "0.7852416", "0.784652", "0.78342605", "0.7832309", "0.7830177", "0.78268653", "0.78036916", "0.78035414",...
0.80664206
2
Retrieve the campaign with the specified campaign ID.
def getCampaignById(service, campaignId): endCampaign = None # Again using AWQL to retrieve campaigns. query = (adwords.ServiceQueryBuilder() .Select('Id', 'Name', 'CampaignGroupId', 'Status', 'ServingStatus', 'StartDate', 'EndDate', 'BudgetId', 'BudgetName', 'BudgetStatus', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_campaign(self, campaign_id: str) -> dict:\n return self.http_request(\"GET\", f'/campaign/{campaign_id}')", "def get(self, campaign_id):\n campaign = Campaign.query.filter_by(mailchimp_id=campaign_id).first()\n if campaign is None:\n return {\"message\": \"Campaign could n...
[ "0.872054", "0.8059463", "0.7973154", "0.7601841", "0.74812067", "0.7131718", "0.70441926", "0.6969936", "0.66165847", "0.6594302", "0.6531368", "0.641937", "0.62838286", "0.61385536", "0.6132557", "0.6094689", "0.60525316", "0.5987939", "0.59317404", "0.5921593", "0.5842648"...
0.74734056
5
Takes a list of strings and creates a new list from it by selecting only the list items with a length in a given range.
def easy_words(a_list): easy_list = [word for word in a_list if len(word) in range(4,7)] return easy_list
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def medium_words(a_list):\n\n medium_list = [word for word in a_list if len(word) in range(6,9)]\n return medium_list", "def remove_shorts(word_list, minimum_length):\n\tworking_word_list = []\n\tfor word in word_list:\n\t\tif len(word) >= minimum_length:\n\t\t\tworking_word_list.append(word)\n\treturn wor...
[ "0.6459617", "0.64349717", "0.6273469", "0.6204543", "0.61294156", "0.606697", "0.5928466", "0.5861417", "0.5834409", "0.5818952", "0.57784605", "0.57328063", "0.57142603", "0.5713083", "0.5701296", "0.57009983", "0.57005084", "0.5699972", "0.5687869", "0.56783694", "0.564832...
0.6362166
2
Takes a list of strings and creates a new list from it by selecting only the list items with a length in a given range.
def medium_words(a_list): medium_list = [word for word in a_list if len(word) in range(6,9)] return medium_list
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_shorts(word_list, minimum_length):\n\tworking_word_list = []\n\tfor word in word_list:\n\t\tif len(word) >= minimum_length:\n\t\t\tworking_word_list.append(word)\n\treturn working_word_list", "def easy_words(a_list):\n\n easy_list = [word for word in a_list if len(word) in range(4,7)]\n return e...
[ "0.64369166", "0.636221", "0.62713736", "0.6205217", "0.61299384", "0.6068557", "0.5928568", "0.58618736", "0.5835389", "0.58201027", "0.577964", "0.57324237", "0.5715334", "0.5713236", "0.57024086", "0.5702396", "0.5702099", "0.56998324", "0.5686282", "0.56797135", "0.564861...
0.6460133
0
Takes a list of strings and creates a new list from it by selecting only the list items above a given length.
def hard_words(a_list): return [word for word in a_list if len(word) > 7]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_shorts(word_list, minimum_length):\n\tworking_word_list = []\n\tfor word in word_list:\n\t\tif len(word) >= minimum_length:\n\t\t\tworking_word_list.append(word)\n\treturn working_word_list", "def small_word_filter(words, min_=1):\n new_words = []\n for w in words:\n if(len(w) > min_):\n ...
[ "0.68708795", "0.6526671", "0.6393872", "0.63184375", "0.62557274", "0.6120661", "0.6115258", "0.60673976", "0.59717935", "0.59681296", "0.59609413", "0.59354407", "0.59325707", "0.5886559", "0.58851147", "0.586564", "0.5864631", "0.57966626", "0.5776216", "0.5774818", "0.569...
0.68514585
1
A Mock object that tracks the arguments passed to ``mock_requests_get``.
def mock_get_args(): return MagicMock()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mock_requests_get(request, monkeypatch, mock_get_args):\n\n def mock_get(url, *args, **kwargs):\n mock_get_args(url, *args, **kwargs)\n\n mock_resp = MagicMock()\n if url == qml.data.data_manager.FOLDERMAP_URL:\n json_data = _folder_map\n elif url == qml.data.data_mana...
[ "0.70834166", "0.70166415", "0.70166415", "0.68699217", "0.68622553", "0.6665555", "0.65695417", "0.6492705", "0.6428181", "0.63369954", "0.6305749", "0.62332165", "0.62080306", "0.6169455", "0.6141721", "0.612852", "0.608851", "0.6052431", "0.6016587", "0.60133666", "0.60116...
0.72228837
0
Test that load_interactive raises errors as expected.
def test_load_interactive_invalid_inputs( self, mock_input, _mock_sleep, mock_load, side_effect, error_message ): # pylint: disable=redefined-outer-name mock_input.side_effect = side_effect with pytest.raises(ValueError, match=error_message): qml.data.load_interactive()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_load_interactive_without_confirm(\n self, mock_input, _mock_sleep, mock_load\n ): # pylint:disable=redefined-outer-name\n mock_input.side_effect = [\"1\", \"1\", \"2\", \"\", \"\", \"n\"]\n assert qml.data.load_interactive() is None\n mock_load.assert_not_called()", "def ...
[ "0.70544934", "0.6809864", "0.6506324", "0.60931635", "0.60766405", "0.60399216", "0.59700453", "0.59311086", "0.5883256", "0.5854243", "0.5846857", "0.58448637", "0.58174115", "0.58081365", "0.5711355", "0.56946075", "0.5689444", "0.5625806", "0.5598438", "0.5582914", "0.557...
0.7494969
0
Split given iterable onto chunks
def _split_on_chunks(self, iterable, size): return utils.split_on_chunks(iterable, size)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def iter_chunks(iterable, size):\n it = iter(iterable)\n while True:\n chunk = tuple(itertools.islice(it, size))\n if len(chunk) == 0:\n break\n yield chunk", "def chunks(iterable: Iterable, size: int) -> Iterable:\n it = iter(iterable)\n item = list(itertools.islice(i...
[ "0.81159973", "0.810018", "0.8098471", "0.8038265", "0.7903734", "0.7899264", "0.7899264", "0.7899264", "0.78685635", "0.78611284", "0.7848479", "0.7809545", "0.78014433", "0.77784353", "0.77582365", "0.7746395", "0.7701635", "0.7692304", "0.7682479", "0.75928974", "0.7571888...
0.8425778
0
Check whether `name` is on PATH and marked as executable.
def command_exists(name, path=None): if path is None: path = sys.path for prefix in path: filename = os.path.join(prefix, name) is_executable = os.access(filename, os.X_OK) is_file = os.path.isfile(filename) if is_executable and is_file: return True retu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_exe_in_path(name):\n if sys.platform == 'win32' and not name.endswith('.exe'):\n name += '.exe'\n\n for dir in os.environ['PATH'].split(os.pathsep):\n if os.path.exists(os.path.join(dir, name)):\n return True\n\n return False", "def program_exists(name):\n for path in ...
[ "0.7582222", "0.7334834", "0.68563867", "0.6797505", "0.6730911", "0.6702017", "0.66863793", "0.6633461", "0.6565157", "0.6505376", "0.64872324", "0.64478695", "0.64478695", "0.64443296", "0.63127434", "0.6298172", "0.62905246", "0.6283094", "0.625587", "0.625315", "0.6245806...
0.7199737
2
Creates an output file name concatenating a formatted date and uuid, but without an extension.
def out_file_core(): date = str(datetime.datetime.now().strftime("%Y%d%m_%H%M%S")) return f"log-{date}-{str(uuid.uuid4())}"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def file_name(product, ext='json'):\n return f\"./output/{product}_{datetime.now().strftime('%Y-%m-%d_%H%M%S')}_transformed_{version}.{ext}\"", "def datetime_filename(prefix='output_',extension='.txt'):\n outputname = prefix + '{:%Y%m%d%H%M%S}utc{}'.format(\n datetime.datetime.utcnow(),extension)\n retur...
[ "0.7627474", "0.7597961", "0.74421334", "0.7399471", "0.7236587", "0.7156143", "0.70930046", "0.7051153", "0.69733477", "0.6964265", "0.6907357", "0.6892586", "0.68481576", "0.6834502", "0.67985445", "0.6789728", "0.6768949", "0.6739769", "0.67366415", "0.6734724", "0.6719701...
0.7540315
2
The VSwitch ID to launch in.
def vswitch_id(self) -> pulumi.Input[str]: return pulumi.get(self, "vswitch_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vswitch_id(self) -> str:\n return pulumi.get(self, \"vswitch_id\")", "def vswitch_id(self) -> str:\n return pulumi.get(self, \"vswitch_id\")", "def vswitch_id(self) -> str:\n return pulumi.get(self, \"vswitch_id\")", "def vswitch_id(self) -> str:\n return pulumi.get(self, \"vs...
[ "0.83531034", "0.83531034", "0.83531034", "0.83531034", "0.8014658", "0.8014658", "0.8014658", "0.7972313", "0.7972313", "0.7972313", "0.7038184", "0.6870708", "0.67459774", "0.6664893", "0.6610916", "0.65496516", "0.6355625", "0.632998", "0.626324", "0.6253746", "0.61938035"...
0.82426065
6
The id of the VPC.
def vpc_id(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "vpc_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vpc_id(self) -> str:\n return pulumi.get(self, \"vpc_id\")", "def vpc_id(self) -> str:\n return pulumi.get(self, \"vpc_id\")", "def vpc_id(self) -> str:\n return pulumi.get(self, \"vpc_id\")", "def vpc_id(self) -> str:\n return pulumi.get(self, \"vpc_id\")", "def vpc_id(self...
[ "0.8599307", "0.8599307", "0.8599307", "0.8599307", "0.8599307", "0.8599307", "0.82964474", "0.82964474", "0.82964474", "0.82964474", "0.82964474", "0.82964474", "0.82964474", "0.82964474", "0.82964474", "0.814231", "0.8096529", "0.80824566", "0.8080263", "0.8080263", "0.8080...
0.79214036
35
The id of the VPC.
def vpc_id(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "vpc_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vpc_id(self) -> str:\n return pulumi.get(self, \"vpc_id\")", "def vpc_id(self) -> str:\n return pulumi.get(self, \"vpc_id\")", "def vpc_id(self) -> str:\n return pulumi.get(self, \"vpc_id\")", "def vpc_id(self) -> str:\n return pulumi.get(self, \"vpc_id\")", "def vpc_id(self...
[ "0.86007315", "0.86007315", "0.86007315", "0.86007315", "0.86007315", "0.86007315", "0.82978016", "0.82978016", "0.82978016", "0.82978016", "0.82978016", "0.82978016", "0.82978016", "0.82978016", "0.82978016", "0.8143681", "0.8097862", "0.80837685", "0.80816704", "0.80816704", ...
0.7922732
36
The VSwitch ID to launch in.
def vswitch_id(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "vswitch_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vswitch_id(self) -> str:\n return pulumi.get(self, \"vswitch_id\")", "def vswitch_id(self) -> str:\n return pulumi.get(self, \"vswitch_id\")", "def vswitch_id(self) -> str:\n return pulumi.get(self, \"vswitch_id\")", "def vswitch_id(self) -> str:\n return pulumi.get(self, \"vs...
[ "0.83531034", "0.83531034", "0.83531034", "0.83531034", "0.82426065", "0.82426065", "0.82426065", "0.8014658", "0.8014658", "0.8014658", "0.7038184", "0.6870708", "0.67459774", "0.6664893", "0.6610916", "0.65496516", "0.6355625", "0.632998", "0.626324", "0.6253746", "0.619380...
0.7972313
12
(Available in 1.196.0+) The connection string of the DRDS instance.
def connection_string(self) -> pulumi.Output[str]: return pulumi.get(self, "connection_string")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rdb_storage_connection_string(self) -> str:\n return pulumi.get(self, \"rdb_storage_connection_string\")", "def connection_string(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"connection_string\")", "def get_db_connect_string(self):\n template_string = \"host={} db...
[ "0.7215253", "0.7137665", "0.71175855", "0.7048221", "0.6999686", "0.6860355", "0.6818071", "0.6782746", "0.6754", "0.6754", "0.6754", "0.6754", "0.6748736", "0.67219", "0.65497816", "0.65237206", "0.6468309", "0.64042175", "0.62382597", "0.61834353", "0.61751384", "0.61683...
0.7330818
1
The id of the VPC.
def vpc_id(self) -> pulumi.Output[str]: return pulumi.get(self, "vpc_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vpc_id(self) -> str:\n return pulumi.get(self, \"vpc_id\")", "def vpc_id(self) -> str:\n return pulumi.get(self, \"vpc_id\")", "def vpc_id(self) -> str:\n return pulumi.get(self, \"vpc_id\")", "def vpc_id(self) -> str:\n return pulumi.get(self, \"vpc_id\")", "def vpc_id(self...
[ "0.8599307", "0.8599307", "0.8599307", "0.8599307", "0.8599307", "0.8599307", "0.814231", "0.8096529", "0.80824566", "0.8080263", "0.8080263", "0.8080263", "0.8080263", "0.8080263", "0.8080263", "0.7928086", "0.79214036", "0.79214036", "0.79214036", "0.79214036", "0.79214036"...
0.82964474
14
The VSwitch ID to launch in.
def vswitch_id(self) -> pulumi.Output[str]: return pulumi.get(self, "vswitch_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vswitch_id(self) -> str:\n return pulumi.get(self, \"vswitch_id\")", "def vswitch_id(self) -> str:\n return pulumi.get(self, \"vswitch_id\")", "def vswitch_id(self) -> str:\n return pulumi.get(self, \"vswitch_id\")", "def vswitch_id(self) -> str:\n return pulumi.get(self, \"vs...
[ "0.83531034", "0.83531034", "0.83531034", "0.83531034", "0.82426065", "0.82426065", "0.82426065", "0.7972313", "0.7972313", "0.7972313", "0.7038184", "0.6870708", "0.67459774", "0.6664893", "0.6610916", "0.65496516", "0.6355625", "0.632998", "0.626324", "0.6253746", "0.619380...
0.8014658
9
Test that an joinedload locates the correct "from" clause with which to attach to, when presented with a query that already has a complicated from clause.
def test_withjoinedload(self): Thing, tests, options = ( self.classes.Thing, self.tables.tests, self.tables.options, ) s = fixture_session() q = s.query(Thing).options(sa.orm.joinedload(Thing.category)) result = q.select_from( te...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_left_join_method_is_successful(setup1, setup2):\n assert left_join(setup1, setup2) == [['Apple', 'Jack']]", "def test_customjoin_deprecated(self):\n\n m = mapper(User, users, properties={\n 'orders':relation(mapper(Order, orders, properties={\n 'items':relation(mapper...
[ "0.583333", "0.5811244", "0.5717283", "0.5636187", "0.55718243", "0.544287", "0.53375626", "0.5284296", "0.52810687", "0.5258701", "0.51547813", "0.5143612", "0.5139339", "0.51384854", "0.5105937", "0.5047086", "0.5011428", "0.50101984", "0.494263", "0.49410388", "0.49380353"...
0.6702169
0
Returns the actual SQL query for the AlterTableAppendCommand class.
def visit_alter_table_append_command(element, compiler, **kw): if element.ignore_extra: fill_option = 'IGNOREEXTRA' elif element.fill_target: fill_option = 'FILLTARGET' else: fill_option = '' query_text = \ 'ALTER TABLE {target} APPEND FROM {source} {fill_option}'.format...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_sql(self):\n if self._action == \"create\":\n return self.platform().compile_create_sql(self.table)\n else:\n if not self._dry:\n # get current table schema\n table = self.platform().get_current_schema(\n self.connection, \...
[ "0.61561954", "0.58244586", "0.5734942", "0.5728625", "0.5588223", "0.5555393", "0.5479704", "0.5460645", "0.5452044", "0.543878", "0.54340225", "0.53969157", "0.5389629", "0.53329724", "0.5209249", "0.51985204", "0.5143985", "0.5119753", "0.5108535", "0.5104118", "0.50800306...
0.6292511
0
Formats and returns the refresh statement for materialized views.
def compile_refresh_materialized_view(element, compiler, **kw): text = "REFRESH MATERIALIZED VIEW {name}" return text.format(name=element.name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def refresh_view():\n pass", "def materialized_view(self) -> 'outputs.MaterializedViewDefinitionResponse':\n return pulumi.get(self, \"materialized_view\")", "def refresh():\n DB.drop_all()\n DB.create_all()\n df_meas = open_api.measurements(city='Los Angeles', parameter='pm25', ...
[ "0.591154", "0.57353634", "0.5610612", "0.5570274", "0.5335929", "0.53214926", "0.5156682", "0.5115354", "0.51139015", "0.5090437", "0.5088428", "0.50692326", "0.50692326", "0.50692326", "0.503191", "0.4998386", "0.4929042", "0.49238044", "0.48634622", "0.48527357", "0.484435...
0.70793104
0
initalizing weight and biases in both hidden and output layer.
def initialize_weights_and_bias(self, X_train): n_samples, n_features = np.shape(X_train) n_output = 1 # This is the numeber of gridcells and we want to make one prediction pr cell. # It this doesn't work calculate the number of griddcells. self.b_h = [] #np.ones((se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_weight(self):\n init_layer(self.conv1)\n init_layer(self.conv2)\n init_bn(self.norm1)\n init_bn(self.norm2)", "def __init__(self):\r\n # A dummy layer does nothing\r\n self.weights = np.zeros(shape=(input.shape[1], 10))\r\n bias = np.zeros(shape=(10,))\r\...
[ "0.7916427", "0.76706874", "0.73590094", "0.73410743", "0.7329646", "0.73054445", "0.7270373", "0.72660536", "0.7238125", "0.72188145", "0.72188145", "0.72188145", "0.7215192", "0.7202427", "0.7170466", "0.71700937", "0.71562946", "0.712844", "0.7127917", "0.7106147", "0.7101...
0.0
-1
Returns the number of inversions for a state.
def inversions(state): state_copy = state.copy() state_copy.remove(0) # Copy state to remove blank for inversion calculation inversion_counter = 0 for index_one in range(len(state_copy)): # Iterate each element for index_two in range(index_one, len(state_copy)): # Check all succeding values...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __len__(self):\n i = 0\n for S in self.states():\n i += 1\n return i", "def __count_inversions(puzzle):\n puzzleLength = len(puzzle)\n count = 0\n for i in range(puzzleLength):\n for j in range(i + 1, puzzleLength):\n if(puzzle[i] > puzzle[j]):\n ...
[ "0.6958889", "0.6923659", "0.67913723", "0.6670424", "0.65887254", "0.6557737", "0.6545806", "0.65103275", "0.64936066", "0.64935213", "0.648256", "0.63235605", "0.62633175", "0.61957735", "0.6104713", "0.6042709", "0.59470165", "0.5933602", "0.58902717", "0.58220905", "0.578...
0.8024678
0
Create and return a logger object.
def get_logger(self, logname, logfile, loglevel, propagate): # TODO: simplify logger = logging.getLogger(logname) logger_handler = WatchedFileHandler(logfile, mode='w') # removed \t%(name)-6s log_fmt = '%(asctime)s\t%(levelname)-8s\t%(message)s' logger_handler.setFormatte...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_logger():\r\n global logger\r\n logger = logging.getLogger(logger_name)\r\n\r\n formatter = logging.Formatter(fmt='%(asctime)s %(levelname)s %(message)s')\r\n \r\n handler = logging.StreamHandler()\r\n handler.setFormatter(formatter)\r\n logger.addHandler(handler)\r\n \r\n ret...
[ "0.8251532", "0.82361585", "0.7985667", "0.762031", "0.75903314", "0.75695664", "0.74686754", "0.7452237", "0.74471945", "0.74125844", "0.74087673", "0.7403086", "0.73688155", "0.73530847", "0.7334406", "0.7322634", "0.7304218", "0.7304071", "0.7283704", "0.72814864", "0.7275...
0.6974631
61
Softens an image using one of several filters.
def __blur(src, type, radius): if (type is BlurType.Box_Blur): ksize = int(2 * round(radius) + 1) return cv2.blur(src, (ksize, ksize)) elif (type is BlurType.Gaussian_Blur): ksize = int(6 * round(radius) + 1) return cv2.GaussianBlur(src, (ksize, ksize), ro...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def custom_filter(image: Image) -> Image:\n image = image.filter(ImageFilter.Kernel(\n size=(3, 3), kernel=(1, 0, 1, 0, 0, 0, 1, 0, 1)))\n return image", "def apply_filter(self, image):\n pass", "def _apply_image_filters(self, image, filters=[]):\n derivative = image\n for fil...
[ "0.6940464", "0.68777573", "0.66782075", "0.6674472", "0.6443564", "0.6308458", "0.62127733", "0.61987185", "0.6174309", "0.61593276", "0.6157818", "0.6157092", "0.6131218", "0.61281127", "0.6121643", "0.61205", "0.6056204", "0.60542923", "0.6044621", "0.6041386", "0.6034381"...
0.0
-1
Renders the home page.
def index(): return render_template( 'index.html', nav=nav, title='Home Page', year=datetime.now().year )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def render_home():\r\n\treturn render_template(\"index.html\")", "def home():\n\n return render_template('home_page.html')", "def home():\n\n return render_template(\"home.html\")", "def home():\n return render_template('home.html')", "def home():\n return render_template('home.html')", "def ...
[ "0.85574406", "0.853399", "0.8351404", "0.82762724", "0.82762724", "0.82762724", "0.82762724", "0.82762724", "0.82762724", "0.82762724", "0.82762724", "0.82762724", "0.82762724", "0.82762724", "0.82762724", "0.82762724", "0.82762724", "0.82762724", "0.82762724", "0.827363", "...
0.0
-1
Renders the about page.
def about(): return render_template( 'about.html', nav=nav, title='About this site', year=datetime.now().year, message='This site shows different applications of Flask' )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def about():\n return render_template('about.html', title='About')", "def about():\n\n return render_template('about_page.html', title='About')", "def about():\n\n\treturn render_template(\"about.html\")", "def on_about(self):\n render_about_window()", "def about():\n return render_temp...
[ "0.85650355", "0.85034525", "0.84489655", "0.84044397", "0.8394454", "0.82935613", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82680845",...
0.79610586
44
If the dataset name exists in the datasets directory then create the restriction.
def create_simple_restriction(datasets, datset_name, restriction): if datset_name in datasets and restriction is not None: dataset = datasets[datset_name] return get_restriction(restriction, dataset)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def on_the_add_dataset_page_input_the_dataset_name_my_acl_dataset(driver, dataset_name):\n assert wait_on_element(driver, 5, '//h3[text()=\"Add Dataset\"]')\n assert wait_on_element(driver, 5, '//input[@ix-auto=\"input__Name\"]', 'inputable')\n driver.find_element_by_xpath('//input[@ix-auto=\"input__Name\...
[ "0.6280435", "0.5983717", "0.5944235", "0.59015095", "0.5740324", "0.5702436", "0.56856525", "0.56805444", "0.5628198", "0.5618277", "0.5610081", "0.56033325", "0.5593702", "0.55411804", "0.5522255", "0.5480434", "0.54674894", "0.5434529", "0.54227555", "0.540465", "0.5401859...
0.7332457
0
Removes continuous spaces in the input string
def remove_white_spaces(input_string): return re.sub(r'\s+', ' ', input_string).strip()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def space_strip(string):\n string= re.sub(\"(?m)^\\s+\", \"\", string)\n return re.sub(\"(?m)\\s+$\", \"\", string)", "def _clean(s):\n return re.sub(r'\\s+', ' ', s.strip())", "def strip_space(string):\n return string.replace(' ', '')", "def _clean(self, string):\n return ...
[ "0.7920748", "0.792018", "0.79087067", "0.7735077", "0.76851404", "0.76348305", "0.76239526", "0.7579808", "0.7579808", "0.7554661", "0.7442556", "0.73901474", "0.73479307", "0.73362243", "0.7305368", "0.7305168", "0.73049015", "0.72840154", "0.72809654", "0.72323513", "0.720...
0.77524805
3
Apply material to enhancement.
def apply_material(self, material, click_speed=0.02): if material == self.COSMIC_CUBE_FRAGMENT: self.emulator.click_button(self.ui['ENHANCE_POTENTIAL_COSMIC_CUBES'].button, min_duration=click_speed, max_duration=click_speed) if material == self.BLACK_AN...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def AddMaterial(self, *args):\n return _XCAFDoc.XCAFDoc_MaterialTool_AddMaterial(self, *args)", "def set_material(self, material):\r\n for b in self.buf:\r\n b.set_material(material)", "def SetMaterial(self, *args):\n return _XCAFDoc.XCAFDoc_MaterialTool_SetMaterial(self, *args)", "def ...
[ "0.68676233", "0.6725604", "0.6718896", "0.6648932", "0.6104146", "0.6005966", "0.5948341", "0.59381694", "0.5825577", "0.5793475", "0.5784584", "0.5746602", "0.57320285", "0.5729688", "0.5660907", "0.56268257", "0.5605521", "0.5593973", "0.5560146", "0.55429226", "0.5538297"...
0.64542854
4
Testing query for a valid JSON object with geometry
def test_query(config): p = PostgreSQLProvider(config) feature_collection = p.query() assert feature_collection.get('type', None) == 'FeatureCollection' features = feature_collection.get('features', None) assert features is not None feature = features[0] properties = feature.get('properties...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verify_geojson(data):\n \"\"\"Enforces camelcasing of properties\"\"\"\n if 'id' in data:\n del data['id']\n try:\n data['type'] = data['type'] if 'type' in data else \"Feature\"\n data['geometry'] = data['geometry'] if 'geometry' in data else None\n if 'properties' not in ...
[ "0.6865174", "0.6826283", "0.6515802", "0.6502722", "0.64604735", "0.64476997", "0.6436213", "0.63668895", "0.6349757", "0.63069063", "0.6238578", "0.61512023", "0.6110774", "0.6105001", "0.6078701", "0.6077076", "0.6045062", "0.6017747", "0.5981394", "0.5950614", "0.5920943"...
0.5601387
31
Tests paging over multiple cells with a uuid marker. This test is going to setup three compute nodes in two cells for a total of six compute nodes. Then it will page over them with a limit of two so there should be three pages total.
def test_compute_node_get_all_uuid_marker(self): # create the compute nodes in the non-cell0 cells count = 0 for cell in self.cell_mappings[1:]: for x in range(3): compute_node_uuid = getattr(uuids, 'node_%s' % count) with context.target_cell(self.ctxt...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_pagination(self):\n for page in range(1, 5):\n self._test_one_page(page=page)", "def test_compute_node_get_all_uuid_marker_not_found(self):\n self.assertRaises(exception.MarkerNotFound,\n self.host_api.compute_node_get_all,\n sel...
[ "0.616888", "0.60022867", "0.5704711", "0.57018703", "0.5632693", "0.56228155", "0.5618183", "0.5546407", "0.55371195", "0.54653454", "0.54582494", "0.5401345", "0.53926927", "0.53656214", "0.534024", "0.53057027", "0.5303484", "0.5280429", "0.526458", "0.5252341", "0.5229615...
0.80667603
0
Simple test to make sure we get MarkerNotFound raised up if we try paging with a uuid marker that is not found in any cell.
def test_compute_node_get_all_uuid_marker_not_found(self): self.assertRaises(exception.MarkerNotFound, self.host_api.compute_node_get_all, self.ctxt, limit=10, marker=uuids.not_found)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_compute_node_get_all_uuid_marker(self):\n # create the compute nodes in the non-cell0 cells\n count = 0\n for cell in self.cell_mappings[1:]:\n for x in range(3):\n compute_node_uuid = getattr(uuids, 'node_%s' % count)\n with context.target_cel...
[ "0.6131959", "0.575854", "0.5649487", "0.5622347", "0.5599029", "0.5560959", "0.55298895", "0.5527114", "0.54683435", "0.5444438", "0.5415254", "0.5400935", "0.5399502", "0.53878593", "0.5372187", "0.5353005", "0.53506416", "0.5350108", "0.534317", "0.5332988", "0.533246", ...
0.6794282
0
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, DelegatedAdministratorDto): return False return self.__dict__ == other.__dict__
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False", "def __eq__(self, other):\n if i...
[ "0.8088132", "0.8088132", "0.8054589", "0.7982687", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", ...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): return not self == other
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other) -> bool:\n return not self.__eq__(other)", "def __eq__(self, other):\n ...
[ "0.845611", "0.8391477", "0.8144138", "0.81410587", "0.8132492", "0.8093973", "0.80920255", "0.80920255", "0.80920255", "0.8085325", "0.8085325", "0.8076365", "0.8076365", "0.8065748" ]
0.0
-1