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
Return an instance of the Database class.
def __getitem__(self, dbname): return Database(dbname=dbname, connection=self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def db(self) -> Database:\n return self.impl.db", "def db(self):\n return DbManager(self)", "def get_database(self, database, instance=None):\n return self._get(_database.Database, database)", "def get(cls) -> SqliteDatabase:\n if cls.database_instance is None:\n cls.da...
[ "0.8304717", "0.81511277", "0.8004637", "0.80035734", "0.7900513", "0.788104", "0.7828194", "0.77566564", "0.772421", "0.76034975", "0.75110656", "0.75013053", "0.74948174", "0.7488735", "0.74659693", "0.7462993", "0.74615395", "0.74420714", "0.74136084", "0.7413051", "0.7310...
0.7022874
37
Retrieve all documents from database. Return a response body as dictionary.
def get_all(self): url = self._dbname + '/_all' return self._connection.get(url).json()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_documents(self) -> Iterable[dict]:\n\n return self._db[\"documents\"]", "def bulk_get_documents():\n ids = flask.request.json\n if not ids:\n raise UserError(\"No ids provided\")\n if not isinstance(ids, list):\n raise UserError(\"ids is not a list\")\n\n with blueprint....
[ "0.7672632", "0.692513", "0.6871703", "0.6724037", "0.67206156", "0.6693477", "0.66917866", "0.6641344", "0.663724", "0.661075", "0.6602389", "0.65902025", "0.65882415", "0.64788723", "0.64744323", "0.64557517", "0.64430666", "0.6397225", "0.63501567", "0.63461", "0.63415027"...
0.7154066
1
Here we have to return the item requested by `idx` The PyTorch DataLoader class will use this method to make an iterable for our training or validation loop.
def __getitem__(self, idx): img = self.images[idx] label = self.labels[idx] return img, label
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __getitem__(self, index):\r\n\r\n # Generate indexes of the batch\r\n indexes = self.indexes[index * self.batch_size:(index + 1) * self.batch_size]\r\n\r\n # Find list of IDs\r\n list_ids_temp = [self.list_IDs[k] for k in indexes]\r\n\r\n # Calls function to load batch of dat...
[ "0.74890965", "0.7338219", "0.7252154", "0.7252154", "0.7225329", "0.7225329", "0.72103685", "0.7205269", "0.7197051", "0.7196518", "0.7185896", "0.7159239", "0.70329314", "0.70329314", "0.69596696", "0.6953008", "0.6911623", "0.6876456", "0.68624467", "0.6838756", "0.6836303...
0.0
-1
Application wide handler for `page not found` error
def page_not_found(e): # Respons to api request if request.accept_mimetypes.accept_json and \ not request.accept_mimetypes.accept_html: resp = jsonify({'error': 'not found'}) resp.status_code = 404 return resp return render_template('errors/404.html'), 404
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def page_not_found(e):\n return render_template(\"404.html\"), 404", "def page_not_found(e):\n return render_template('404.html')", "def page_not_found(e):\n return render_template('404.html'), 404", "def page_not_found(e):\n return render_template('404.html'), 404", "def _page_not_found():\n ...
[ "0.8328757", "0.8324451", "0.8306104", "0.8306104", "0.8282943", "0.8278657", "0.8278657", "0.8278657", "0.8278657", "0.8278657", "0.8278657", "0.8278657", "0.8278657", "0.82782984", "0.82782984", "0.82782984", "0.82782984", "0.82782984", "0.82782984", "0.82782984", "0.827268...
0.7564999
44
Gets the informationtype of this UserPreference. The type of private information; e.g. is it information that identifies the user (e.g. id number)? is it location information about the user? Is it about their activities?
def informationtype(self): return self._informationtype
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_type(self):\n if \"userType\" in self._prop_dict:\n return self._prop_dict[\"userType\"]\n else:\n return None", "def user_type(self):\n if \"userType\" in self._prop_dict:\n return self._prop_dict[\"userType\"]\n else:\n return Non...
[ "0.70244217", "0.70244217", "0.66223395", "0.6511475", "0.6403962", "0.6396905", "0.6316669", "0.6290872", "0.6229755", "0.6112609", "0.6112609", "0.60983986", "0.6092006", "0.6092006", "0.60521835", "0.60354835", "0.6029368", "0.602728", "0.6024328", "0.5959934", "0.5924556"...
0.738233
0
Sets the informationtype of this UserPreference. The type of private information; e.g. is it information that identifies the user (e.g. id number)? is it location information about the user? Is it about their activities?
def informationtype(self, informationtype): self._informationtype = informationtype
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_type(self):\n if \"userType\" in self._prop_dict:\n return self._prop_dict[\"userType\"]\n else:\n return None", "def user_type(self):\n if \"userType\" in self._prop_dict:\n return self._prop_dict[\"userType\"]\n else:\n return Non...
[ "0.5897687", "0.5897687", "0.5833581", "0.5798439", "0.575587", "0.575587", "0.5705809", "0.56874186", "0.56419927", "0.56419927", "0.5571181", "0.55467516", "0.54814386", "0.54786813", "0.54754466", "0.546143", "0.546143", "0.5440057", "0.5411394", "0.5381352", "0.53481793",...
0.7156067
0
Sets the category of this UserPreference. The category of the service invading the privacy of the user.
def category(self, category): self._category = category
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_category(self, category):\n\n\t\tif category is not None and not isinstance(category, str):\n\t\t\traise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: category EXPECTED TYPE: str', None, None)\n\t\t\n\t\tself.__category = category\n\t\tself.__key_modified['category'] = 1", "def category(self, category: s...
[ "0.6148977", "0.61171514", "0.59065515", "0.56177014", "0.5612471", "0.5423099", "0.53397524", "0.52552575", "0.5167303", "0.5159331", "0.5105742", "0.51022834", "0.5055925", "0.4898449", "0.48853084", "0.48734626", "0.48195198", "0.4765104", "0.47620714", "0.47319126", "0.47...
0.6104452
5
Gets the preference of this UserPreference. The user's privacy preference. High means they are sensitive to disclosing private information. Medium they have concerns; and low means they have few privacy concerns with this question.
def preference(self): return self._preference
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_preference(cls, user, preference_key, default=None):\r\n\r\n try:\r\n user_pref = cls.objects.get(user=user, key=preference_key)\r\n return user_pref.value\r\n except cls.DoesNotExist:\r\n return default", "def user_preferences(self):\n return self._u...
[ "0.6533348", "0.6528942", "0.6478107", "0.64710844", "0.64710844", "0.64710844", "0.6251502", "0.6200216", "0.6193726", "0.6190971", "0.6179328", "0.61479455", "0.6108699", "0.61078143", "0.6043957", "0.5972695", "0.59200466", "0.5893652", "0.5890291", "0.5860554", "0.5832112...
0.7332115
0
Gets the action of this UserPreference. The action being carried out on the private date e.g. accessing, disclosing to a third party. This is an optional parameter in the case where users drill down to more detailed preferences.
def action(self): return self._action
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def action(self) -> Optional[str]:\n return pulumi.get(self, \"action\")", "def action(self) -> Optional[str]:\n return pulumi.get(self, \"action\")", "def action(self) -> Optional[str]:\n return pulumi.get(self, \"action\")", "def get_action(self):\n return self.__action", "def...
[ "0.7054317", "0.7054317", "0.7054317", "0.6913263", "0.6885165", "0.6768079", "0.66591793", "0.66279525", "0.6453167", "0.64418346", "0.64170974", "0.6410642", "0.6272838", "0.625536", "0.6210096", "0.6159967", "0.6085725", "0.6085725", "0.6085725", "0.6085725", "0.6085725", ...
0.67523766
8
Sets the action of this UserPreference. The action being carried out on the private date e.g. accessing, disclosing to a third party. This is an optional parameter in the case where users drill down to more detailed preferences.
def action(self, action): self._action = action
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_action(self, action):\n self.action = action", "def set_action(self, action):\n self.action = action", "def set_action(self,action):\n self.__action = action", "def set_action(self, action):\n self._action = action\n return self", "def setAction(self, action):\n ...
[ "0.717679", "0.717679", "0.7100732", "0.6970779", "0.68790585", "0.68238956", "0.678415", "0.678415", "0.678415", "0.678415", "0.678415", "0.678415", "0.67498076", "0.6652996", "0.65466654", "0.6514857", "0.6495008", "0.639691", "0.623708", "0.6096908", "0.6071225", "0.6071...
0.6727978
13
Gets the purpose of this UserPreference. The purpose for which the service is using the private data. This is an optional parameter in the case where users drill down to more detailed preferences.
def purpose(self): return self._purpose
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def purpose(self) -> str:\n return pulumi.get(self, \"purpose\")", "def purpose(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"purpose\")", "def purpose(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"purpose\")", "def purpose(self) -> Optional[pulumi.Input['C...
[ "0.68959767", "0.6782144", "0.6767882", "0.6743495", "0.5690282", "0.5690282", "0.56498134", "0.5514734", "0.5472327", "0.5429083", "0.54241467", "0.54016215", "0.5375653", "0.5375189", "0.5375189", "0.5358013", "0.5339238", "0.5339238", "0.53197485", "0.52952516", "0.5246787...
0.70088947
0
Sets the recipient of this UserPreference. The recipient of any disclosed privacy information. This is an optional parameter in the case where users drill down to more detailed preferences.
def recipient(self, recipient): self._recipient = recipient
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def recipient_email(self, recipient_email):\n\n self._recipient_email = recipient_email", "def setRecipients(self, *recipients):\n assert [r for r in recipients if r], \"setRecipients called with %r\" % (recipients,)\n self.recipients = recipients", "def recipient(self):\n return se...
[ "0.59488815", "0.55685467", "0.5555495", "0.52072185", "0.5094615", "0.50062287", "0.49588314", "0.49154642", "0.48755875", "0.48619398", "0.4857391", "0.48545724", "0.48483944", "0.48152375", "0.4797693", "0.47932798", "0.4772352", "0.4730175", "0.47197193", "0.47166342", "0...
0.6684624
0
Returns true if both objects are equal
def __eq__(self, other): 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.7961088", "0.7961088", "0.79433626", "0.79303336", "0.7926563", "0.7897525", "0.78826123", "0.78826123", "0.78806067", "0.7872423", "0.7868354", "0.78668815", "0.7825702", "0.7819993", "0.78162885", "0.78078854", "0.78068...
0.79670393
40
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
convert a date string to a datetime obj
def stringToDate(str): format = '%m/%d/%Y:%H:%M' try: newDate = datetime.datetime.strptime(str, format) return newDate except ValueError as e: print('Invalid format. Type --help for help.') sys.exit()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def str_to_datetime(datestr):\n\n from dateutil import parser\n from datetime import datetime\n\n date = parser.parse(datestr)\n return date", "def parse_datetime(date_str: str) -> datetime:\n return dateutil.parser.parse(date_str)", "def to_datetime(date_string):\n return dt.strptime(date_st...
[ "0.80567396", "0.8017137", "0.7864569", "0.78634626", "0.7813418", "0.7802854", "0.776981", "0.77460647", "0.7680245", "0.7561667", "0.7559936", "0.7558161", "0.75354403", "0.75292635", "0.7522666", "0.7504948", "0.7501718", "0.7500525", "0.7492992", "0.74874043", "0.74746895...
0.69908804
68
convert a datetime obj to UNIX timestamp
def dateToTimeStamp(dt): timestamp = dt.timestamp() timestamp = int(timestamp) return timestamp
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_unix(cls, timestamp):\n if not isinstance(timestamp, datetime.datetime):\n raise TypeError(\"Time.milliseconds expects a datetime object\")\n return timestamp.timestamp()", "def _datetime_to_timestamp(self, dt):\n return time.mktime(dt.timetuple())", "def datetime2UnixTim...
[ "0.75118583", "0.7441151", "0.7413134", "0.7333397", "0.7227382", "0.7154435", "0.71492493", "0.7147078", "0.71339035", "0.7101312", "0.7041612", "0.7019332", "0.7011078", "0.6962526", "0.69107395", "0.69055146", "0.68959236", "0.68573284", "0.68507534", "0.6836119", "0.67825...
0.66668206
34
get the storage profile backend
def get_profile_backend(self, profile): return self._get_attribute(profile, 'backend')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_storage_backend(self):\n return self.client.info()['Driver']", "def get_backend():\n return __SETTINGS__._BACKEND", "def get_storage_profile(self) -> Optional[ManagedClusterStorageProfile]:\n profile = self.models.ManagedClusterStorageProfile()\n if self.mc.storage_profile is no...
[ "0.8109166", "0.7166763", "0.7088159", "0.70828015", "0.7081954", "0.69376177", "0.674958", "0.66896605", "0.6652242", "0.6646807", "0.66389835", "0.65603095", "0.6507067", "0.64663154", "0.64635766", "0.64633214", "0.64539784", "0.6421563", "0.6377023", "0.63766414", "0.6250...
0.80633515
1
Draw rectangles around features found in an image
def draw_rectangles(self, draw_img): if not self.features_detected: raise Exception('Detect features before drawing') for (x,y,w,h) in self.features: cv2.rectangle(draw_img,(x,y),(x+w,y+h),(255,0,0),2) return draw_img
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_rects(img, rects, color):\n for x1, y1, x2, y2 in rects:\n cv2.rectangle(img, (x1, y1), (x2, y2), color, 2)", "def drawdebugrects(self,image):\r\n \r\n if util.isgray(image):\r\n faceColor = 255 \r\n \"\"\"leftEyeColor = 255 ...
[ "0.71270686", "0.67524135", "0.6650638", "0.66389924", "0.658751", "0.65783095", "0.64755803", "0.6401808", "0.6380531", "0.63659096", "0.6352395", "0.63284403", "0.63259363", "0.6304608", "0.63043827", "0.627144", "0.62679374", "0.62504333", "0.62408173", "0.6218318", "0.621...
0.7837111
0
Converts a RAM offset to a ROM offset.
def ram2rom(bank,ram_offset): if bank == 0: rom_offset = ram_offset else: rom_offset = bank * 0x4000 + ram_offset - 0x4000 return rom_offset
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_program_memory(self, offset, val):\n self.SPItrans([0x40 | (offset & 1) << 3, 0x00, offset & 0xff, val & 0xff])", "def byte_offset_to_physical_offset(self, offset):\n return self.offset + offset", "def map_mem(self, address):\n return self.rom.mapMem(self, address)", "def read_p...
[ "0.596083", "0.5677476", "0.5521827", "0.5423537", "0.52856374", "0.5282188", "0.5269767", "0.52220654", "0.51163393", "0.5089427", "0.5012535", "0.5012016", "0.4989005", "0.4971654", "0.49634978", "0.49581927", "0.4935217", "0.4935036", "0.49329716", "0.49247158", "0.4896975...
0.81001043
0
Respond that the config was inserted in the database. This function creates a corresponding response object and inserts it in the scheduler output queue. The response depends if the insertion succeeded or failed.
def respond_config_inserted(identifier: str, success: bool) -> None: if success: response = communication.Response( success=True, message=( f'Configuration with identifier {identifier} ' f'was successfully added to the schedule.' ), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def respond_interval_inserted(identifier: str, success: bool) -> None:\n if success:\n response = communication.Response(\n success=True,\n message=(\n f'Interval with identifier {identifier} '\n f'was successfully added.'\n ),\n c...
[ "0.60303116", "0.5676817", "0.5573638", "0.55667096", "0.543245", "0.5423769", "0.53902036", "0.531135", "0.5289624", "0.5272679", "0.5165895", "0.51614034", "0.51545453", "0.50827277", "0.50684375", "0.50513464", "0.50505483", "0.5029978", "0.50130916", "0.49962315", "0.4987...
0.7150801
0
Normalizes a column header name. By default, lowercases it and replaces underscores with spaces (e.g. because Esri fields can't contain spaces).
def header_converter(self, s): header = clean_string(s.lower().replace("_", " ")) if hasattr(self, "locale"): return self.column_headers[self.locale].get(header, header) else: return header
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normalizeHeaderName(name):\n # type: (AnyStr) -> AnyStr\n return name.lower()", "def convert_header_names(word: str, delim='-') -> str:\n return delim.join(x.capitalize() or '_' for x in word.split('_'))", "def clean_headers(df):\n filtered_headers = [header.replace(\"'\",'').replace(' ', '').r...
[ "0.7891797", "0.7151179", "0.6780989", "0.66824234", "0.66265243", "0.65931004", "0.6575037", "0.64540786", "0.63369936", "0.6316234", "0.62316495", "0.62180614", "0.62162244", "0.6162555", "0.61588436", "0.61355364", "0.61355364", "0.61355364", "0.61170626", "0.6101007", "0....
0.75482494
1
Corrects the postal code, abbreviates the province or territory name, and formats the last line of the address.
def clean_address(self, s): # The letter "O" instead of the numeral "0" is a common mistake. s = re.sub( r"\b[A-Z][O0-9][A-Z]\s?[O0-9][A-Z][O0-9]\b", lambda x: x.group(0).replace("O", "0"), clean_string(s) ) for k, v in province_or_territory_abbreviations().items(): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _format_address(address):\n if 'country' in address and address['country']:\n country = address['country']\n if country == 'CA':\n address['country'] = 'CANADA'\n elif country == 'US':\n address['country'] = 'UNITED STATES OF AMERICA'\n ...
[ "0.67925024", "0.66052836", "0.65351456", "0.64845693", "0.630982", "0.6286695", "0.62632084", "0.6248758", "0.6235853", "0.619288", "0.61679214", "0.6145944", "0.6136241", "0.6096363", "0.60831267", "0.60495055", "0.6038855", "0.60049254", "0.59960675", "0.596689", "0.593596...
0.75109243
0
Flattens an object list to list values from the input key.
def flatten_objects_to_list(objects, key): return_list = [] for object in objects: return_list.append(object[key]) return return_list
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _force_key_as_list(self, key):\r\n return [key] if isinstance(key, (str, unicode)) else key", "def unflatten(arg):\n if hasattr(arg, \"iteritems\"):\n items = arg.iteritems()\n elif hasattr(arg, \"items\"):\n items = arg.items()\n else:\n items = arg\n\n data = {}\n ...
[ "0.6282146", "0.62681746", "0.62389696", "0.6218957", "0.6179673", "0.61769456", "0.5984717", "0.5960501", "0.5908372", "0.5891378", "0.5885682", "0.58415806", "0.58358103", "0.5822948", "0.57968175", "0.57681143", "0.57681143", "0.5759571", "0.57543474", "0.5676075", "0.5660...
0.74044377
0
Check if the diagonal contains only distances of 0.
def diag_is_zero(self): return max(numpy.diag(self)) == 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_diagonal_dominant(self):\r\n\r\n for i in range(self.SIZE):\r\n row_sum = 0\r\n for j in range(self.SIZE):\r\n if i != j:\r\n row_sum += abs(self.matrix[i][j])\r\n if abs(self.matrix[i][i]) < row_sum:\r\n if not self...
[ "0.7113069", "0.6907501", "0.67899483", "0.67822784", "0.6727201", "0.67067105", "0.6683085", "0.6666364", "0.6605932", "0.6605932", "0.6593007", "0.65881306", "0.652949", "0.6521399", "0.64931494", "0.64712787", "0.6446754", "0.63964283", "0.6367554", "0.63312495", "0.632270...
0.7694892
0
Applies batch normalization. Using the implementation in github.com/ tensorflow/tpu/blob/master/models/official/amoeba_net/network_utils.pyL550
def FProp(self, theta, inputs): if py_utils.testonly_skip_norm_layers(): return inputs p = self.params inputs_dtype = inputs.dtype inputs = tf.cast(inputs, p.dtype) inputs = py_utils.with_dependencies([ py_utils.assert_shape_match([tf.shape(inputs)[-1]], tf.shape( theta.be...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def batch_norm(inputs, training, data_format):\n # We set fused=True for a significant performance boost. See\n # https://www.tensorflow.org/performance/performance_guide#common_fused_ops\n return tf.compat.v1.layers.batch_normalization(\n inputs=inputs, axis=1 if data_format == 'channels_first' else 3,\n ...
[ "0.7592111", "0.7517549", "0.72370327", "0.720235", "0.7191406", "0.7172832", "0.7151566", "0.7124053", "0.70797896", "0.7074559", "0.7063098", "0.7060001", "0.7037771", "0.7016266", "0.700559", "0.69971794", "0.6991894", "0.6938576", "0.6908847", "0.6883035", "0.6853779", ...
0.0
-1
Add a provisioning request This endpoint is used to submit a new provisioing request
def add_provisioning_request(): if connexion.request.is_json: discovery = PortProvisionRequest.from_dict(connexion.request.get_json()) return discovery.save()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_add_provisioning_request(self):\n body = PortProvisionRequest()\n response = self.client.open('/api/provisioning/port',\n method='POST',\n data=json.dumps(body),\n content_type='applicati...
[ "0.6709356", "0.6354247", "0.58084023", "0.5807036", "0.5684748", "0.5630783", "0.55059826", "0.5458795", "0.5450733", "0.5444115", "0.5385391", "0.5382746", "0.53086185", "0.53068244", "0.5298163", "0.5272548", "0.5271485", "0.52280164", "0.5197333", "0.5136484", "0.5135528"...
0.7784216
0
Create a pandas DataFrame from a numpy array
def create_pandas_dataframe(data, index, columns): return pd.DataFrame(data, index, columns)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_nparray_to_df(nparray: np.ndarray) -> pd.DataFrame:\n return pd.DataFrame(data=nparray[1:, 1:],\n index=nparray[1:, 0],\n columns=nparray[0, 1:])", "def array_to_df (a_array,b_as_column='') :\n if b_as_column == '' :\n loc_result = __pd.DataFram...
[ "0.77702105", "0.7429296", "0.7328162", "0.67364043", "0.66789114", "0.6568491", "0.655613", "0.6528087", "0.6488552", "0.6457486", "0.64539254", "0.6452575", "0.643567", "0.6351581", "0.6342924", "0.633087", "0.6290506", "0.6256135", "0.62464374", "0.6239635", "0.62120587", ...
0.60647607
23
Spawns `pedestrians` in random locations.
def spawn_pedestrians( world: carla.World, # pylint: disable=no-member num_pedestrians: int, speeds: Sequence[float] = (1.0, 1.5, 2.0), ) -> Sequence[carla.Vehicle]: # pylint: disable=no-member # Blueprints library. bl = world.get_blueprint_library() # Output container actors = list() for n in r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def randomly_spawn_mothership(self) -> None:\n return", "def spawn(self, y, x, h, w):\n self.pos = (np.random.randint(y, y + h), np.random.randint(x, x + w))", "def random_placement(area):\n\n area.create_houses(True)\n\n for house in area.houses:\n place_house(area, house)", "def ...
[ "0.6385664", "0.6308284", "0.62233245", "0.61066777", "0.59956706", "0.59764", "0.59498715", "0.5949812", "0.5937989", "0.5913861", "0.58850455", "0.5882951", "0.5826011", "0.58222336", "0.5793148", "0.5746932", "0.5733028", "0.5714152", "0.57048285", "0.5701444", "0.56843114...
0.7601863
0
Converts a `CARLA` measurement with attributes `x`, `y` and `z` to neural network friendly tensor.
def carla_xyz_to_ndarray(xyz: Any) -> np.ndarray: return np.asarray( [xyz.x, xyz.y, xyz.z], dtype=np.float32, )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transl(x, y, z):\n displace_vector = [[x],\n [y],\n [z]]\n return np.matrix(displace_vector)", "def tensor(self, X):\n return tf.convert_to_tensor(X, dtype=self.dtype)", "def call(self, x):\n reval = tf.matmul(x, self.components_) + self.mean_...
[ "0.55218256", "0.54678756", "0.5464549", "0.5452774", "0.5447583", "0.5443619", "0.5443619", "0.5443619", "0.53828794", "0.53746426", "0.52829725", "0.5265383", "0.5208572", "0.5187509", "0.5124086", "0.5115632", "0.5111242", "0.50903374", "0.5083897", "0.5065753", "0.5063487...
0.50507134
22
Converts a `CARLA` rotation to a neural network friendly tensor.
def carla_rotation_to_ndarray( rotation: carla.VehicleControl # pylint: disable=no-member ) -> np.ndarray: return np.asarray( [rotation.pitch, rotation.yaw, rotation.roll], dtype=np.float32, )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ndarray_to_rotation(array: np.ndarray) -> carla.Rotation: # pylint: disable=no-member\n return carla.Rotation(*list(map(float, array))) # pylint: disable=no-member", "def carla_rotation_to_numpy_rotation_matrix(carla_rotation):\n roll, pitch, yaw = carla_rotation_to_RPY(carla_rotation)\n numpy_array...
[ "0.6352738", "0.62339824", "0.6024309", "0.6001538", "0.59880286", "0.5941041", "0.5924012", "0.58854604", "0.57720107", "0.57476383", "0.5648926", "0.56421536", "0.56418765", "0.56293344", "0.56293344", "0.5628499", "0.5621215", "0.55792403", "0.557715", "0.5545402", "0.5527...
0.5578244
18
Returns the rotation matrix (3x3) given rotation in degrees.
def rot2mat(rotation: np.ndarray) -> np.ndarray: rotation_radians = ndarray_to_rotation(rotation) pitch = np.deg2rad(rotation_radians.pitch) roll = np.deg2rad(rotation_radians.roll) yaw = np.deg2rad(rotation_radians.yaw) return transforms3d.euler.euler2mat(roll, pitch, yaw).T
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rotation_matrix(rotate):\n tx, ty, tz = rotate\n Rx = np.array([[1, 0, 0], [0, np.cos(tx), -np.sin(tx)], [0, np.sin(tx), np.cos(tx)]])\n Ry = np.array([[np.cos(ty), 0, -np.sin(ty)], [0, 1, 0], [np.sin(ty), 0, np.cos(ty)]])\n Rz = np.array([[np.cos(tz), -np.sin(tz), 0], [np.sin(tz), np.cos(tz), 0], ...
[ "0.76316816", "0.76136047", "0.75888276", "0.75798786", "0.74915266", "0.7455403", "0.73837405", "0.732388", "0.7304468", "0.72709274", "0.7251569", "0.7243167", "0.7238756", "0.71931994", "0.71853215", "0.7162346", "0.7159403", "0.71549994", "0.7144595", "0.714456", "0.71171...
0.763637
0
Assert that preupload correctly posts a valid DigestCollection.
def test_pre_upload_ok(self): namespace = 'default-gzip' good_digests = generate_collection(namespace, ['a pony']) self.assertEqual(good_digests.namespace.namespace, namespace) response = self.call_api( 'preupload', self.message_to_dict(good_digests), 200) message = response.json.get(u'items...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_pre_upload_invalid_hash(self):\n bad_collection = handlers_endpoints_v1.DigestCollection(\n namespace=handlers_endpoints_v1.Namespace())\n bad_digest = hash_content(bad_collection.namespace.namespace, 'some stuff')\n bad_digest = 'g' + bad_digest[1:] # that's not hexadecimal!\n bad_col...
[ "0.66060954", "0.62266684", "0.6076893", "0.5997191", "0.58350533", "0.5833532", "0.5799326", "0.5795468", "0.57431734", "0.5702004", "0.56863225", "0.5676118", "0.56317985", "0.56190366", "0.56003374", "0.5591057", "0.5562161", "0.55481374", "0.55475736", "0.55439943", "0.54...
0.7695466
0
Assert that status 400 is returned when the digest is invalid.
def test_pre_upload_invalid_hash(self): bad_collection = handlers_endpoints_v1.DigestCollection( namespace=handlers_endpoints_v1.Namespace()) bad_digest = hash_content(bad_collection.namespace.namespace, 'some stuff') bad_digest = 'g' + bad_digest[1:] # that's not hexadecimal! bad_collection.it...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def assertHttpBadRequest(self, resp):\r\n return self.assertEqual(resp.status_code, 400)", "def test_bad_requests_give_400(self):\n self.assertEqual(self._request({}), 400)", "def test_validate_with_invalid_digest_value(self):\n digest_value = \"invalid\"\n kwargs = {'digest_value':...
[ "0.71915936", "0.706649", "0.7063762", "0.70434695", "0.68241256", "0.67997074", "0.66844296", "0.6675763", "0.66534567", "0.66534156", "0.6629669", "0.6610178", "0.6581304", "0.6578812", "0.6488719", "0.6472232", "0.64715564", "0.64515173", "0.6390317", "0.63737464", "0.6360...
0.6786917
6
Assert that status 400 is returned when the namespace is invalid.
def test_pre_upload_invalid_namespace(self): bad_collection = handlers_endpoints_v1.DigestCollection( namespace=handlers_endpoints_v1.Namespace(namespace='~tildewhatevs')) bad_collection.items.append( generate_digest(bad_collection.namespace.namespace, 'pangolin')) with self.call_should_fail...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_bad_requests_give_400(self):\n self.assertEqual(self._request({}), 400)", "def assertHttpBadRequest(self, response):\r\n self.assertEqual(response.status_code, 400)", "def assertHttpBadRequest(self, resp):\r\n return self.assertEqual(resp.status_code, 400)", "def test_400_bad_re...
[ "0.73932964", "0.7241316", "0.72264194", "0.6742868", "0.66893035", "0.6584689", "0.6557967", "0.651333", "0.65025246", "0.6495613", "0.6469016", "0.64400566", "0.6436624", "0.64005506", "0.63752896", "0.63164693", "0.62773484", "0.6269367", "0.6266376", "0.62650573", "0.6253...
0.6461189
11
Assert that inline content storage fails when there is no ticket.
def test_store_inline_no_upload_ticket(self): namespace = 'default-gzip' request = self.store_request(namespace, 'silence') request.upload_ticket = None with self.call_should_fail('400'): self.call_api('store_inline', self.message_to_dict(request), 200)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_store_inline_empty_content(self):\n namespace = 'default-gzip'\n request = self.store_request(namespace, '')\n embedded = validate(\n request.upload_ticket, handlers_endpoints_v1.UPLOAD_MESSAGES[0])\n key = model.get_entry_key(embedded['n'], embedded['d'])\n\n # assert that store_inl...
[ "0.72132635", "0.67731094", "0.6345822", "0.6216823", "0.62062633", "0.60311335", "0.588034", "0.5870477", "0.58235025", "0.58128965", "0.5783678", "0.57435703", "0.57328844", "0.5728127", "0.57182455", "0.5710613", "0.5708009", "0.5651936", "0.56476486", "0.5646798", "0.5645...
0.7105201
1
Assert that retrieval fails with status 416 when offset is invalid.
def test_retrieve_partial_bad_offset_fails(self): content = 'Of Man\'s first Disobedience, and the Fruit' namespace = 'default' request = self.store_request(namespace, content) embedded = validate( request.upload_ticket, handlers_endpoints_v1.UPLOAD_MESSAGES[0]) self.call_api('store_inline',...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_failing(self):\n request = self.factory.get(\n '/path', HTTP_RANGE='bytes=17-20'\n )\n response = RangedFileResponse(\n request, io.BytesIO(b'sui2khiau2tsiang5'), content_type='audio/wav'\n )\n self.assertEqual(response.status_code, 416)", "def te...
[ "0.7262901", "0.62768227", "0.6056359", "0.598298", "0.59184366", "0.58583575", "0.5762025", "0.5746183", "0.5715588", "0.57110554", "0.56968623", "0.5693887", "0.56691706", "0.5651546", "0.5647315", "0.5646933", "0.56463635", "0.5645531", "0.5640704", "0.56295735", "0.561448...
0.6226121
2
Assert that HTTP 404 response is served when content is absent.
def test_retrieve_not_found(self): # get a valid digest content = """\xe1\xbc\x84\xce\xbd\xce\xb4\xcf\x81\xce\xb1 \xce\xbc\xce\xbf\xce\xb9 \xe1\xbc\x94\xce\xbd\xce\xbd\xce\xb5\xcf\x80\xce\xb5""" namespace = 'default' collection = generate_collection(namespace, [content]) preupload_s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def assert404(self, response):\n self.assertEqual(response.status_code, 404)", "def assertHttpNotFound(self, resp):\r\n return self.assertEqual(resp.status_code, 404)", "def assert404(self, response):\n self.assertTrue(response.status_code == 404)", "def test_show_404(self):\r\n\r\n ...
[ "0.82266843", "0.81710106", "0.81665844", "0.7910996", "0.7790125", "0.7763649", "0.77431107", "0.77375907", "0.77250487", "0.77114826", "0.77010334", "0.7693292", "0.76752394", "0.76638293", "0.76015097", "0.7572155", "0.7531474", "0.7521057", "0.75166315", "0.74495476", "0....
0.0
-1
Assert that server_details returns the correct version.
def test_server_details_ok(self): response = self.call_api('server_details', {}, 200).json self.assertEqual(utils.get_app_version(), response['server_version'])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_version(server):\n\n assert isinstance(server.version(), six.string_types)", "def test_versionInfo(self):\n self.assertEqual(\n nevow.__version_info__,\n (nevow.version.major, nevow.version.minor, nevow.version.micro))", "def test_get_version(self):\n pass", "d...
[ "0.7979112", "0.7291312", "0.71832013", "0.71026605", "0.69860035", "0.6926059", "0.6913602", "0.6879224", "0.6864865", "0.6836533", "0.6797532", "0.67337537", "0.671789", "0.6587996", "0.6583096", "0.65811616", "0.65788925", "0.65699327", "0.656066", "0.65569293", "0.6527511...
0.8166473
0
Test passing an invalid query parameter.
def test_type_as_query_arg(app, lang_type, example_records, client, h, prefix): # Ensure we cannot pass invalid query parameters res = client.get(f'{prefix}?invalid=test', headers=h) assert res.status_code == 200 assert 'invalid' not in res.json['links']['self'] # It should not be possible to pass ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_invalid_query_params(self):\n url = reverse(\"metrics\")\n client = APIClient()\n\n params = {\"limit\": \"foo\"}\n url = url + \"?\" + urlencode(params, quote_via=quote_plus)\n response = client.get(url, **self.headers)\n self.assertEqual(response.status_code, st...
[ "0.73425215", "0.71054655", "0.69906384", "0.6975498", "0.68644947", "0.68282956", "0.6779271", "0.66352904", "0.66285586", "0.65905184", "0.65332484", "0.65195274", "0.65124476", "0.65031457", "0.6501962", "0.6496102", "0.647967", "0.6443454", "0.6413289", "0.63844556", "0.6...
0.0
-1
Advance the list by one element in FIFO order
def _advance(ls: List[any]) -> Optional[any]: try: return ls.pop(0) except IndexError: return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def advance(self):\n elem = next(self._iterable)\n for deque in self._deques:\n deque.append(elem)", "def shiftDeque(d):\n while True:\n try:\n yield d.popleft()\n except IndexError:\n break", "def add_next(self, item, index):\n if index in...
[ "0.66917545", "0.64109516", "0.62421197", "0.6234606", "0.6137212", "0.61101466", "0.6084792", "0.60154593", "0.5955123", "0.5943641", "0.59276056", "0.5866266", "0.58610576", "0.58502537", "0.5837725", "0.5797237", "0.5784957", "0.5776639", "0.57741725", "0.57723534", "0.576...
0.5389257
90
Constructs a new setting from a given dataset. This method will automatically instantiate a new class matching the type of the given dataset. It will fill all values provided by the dataset and then return the created instance
def make_daysetting_from_data(data): factory = { "color": ColorType, "scalar": ScalarType } if data["type"] not in factory: raise Exception("Unkown setting type: {}".format(data["type"])) try: instance = factory[data["type"]](data) except Exception: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, dataset):\n\n if isinstance(dataset, DataConfig):\n self.__data_config = dataset\n self.dataset = dataset.dataset\n elif isinstance(dataset, str):\n logger.debug(\"Dataset argument {} is string, looking up known dataset.\".format(dataset))\n ...
[ "0.6707087", "0.627974", "0.62739533", "0.6227424", "0.6220415", "0.6178334", "0.60869604", "0.5980886", "0.5864001", "0.5813324", "0.57430923", "0.5737196", "0.5734911", "0.57111776", "0.5693735", "0.56838965", "0.5682534", "0.5666111", "0.56640273", "0.56602865", "0.5655319...
0.640752
1
Sets the control points on the curves.
def set_control_points(self, control_points): for curve_index, points in enumerate(control_points): self.curves[curve_index].control_points = points
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_control_points(cls):\r\n \"\"\" EXECUTE THIS FUNCTION IN THE FARM CLASS! \"\"\"\r\n \r\n # t: consists of N points\r\n # p: is a finer grid made from t (default is 10 times N points)\r\n cls.t = np.fromfunction(lambda j : (1.0/2.0 + j)*cls.DT, (cls.N, ))\r\n cls.p ...
[ "0.69553864", "0.6765051", "0.6365332", "0.60315007", "0.59942174", "0.5981036", "0.5970902", "0.59575534", "0.5913922", "0.5906109", "0.58882546", "0.58809596", "0.5862599", "0.5862599", "0.58566064", "0.58499694", "0.58457136", "0.5823314", "0.58125895", "0.5798629", "0.575...
0.87548643
0
Compute the energy of an audio signal
def track_energy(wave, win_len, hop_len, win): wave = np.lib.pad( wave, pad_width=(win_len-hop_len, 0), mode='constant', constant_values=0 ) # post padding wave = librosa.util.fix_length( wave, int(win_len * np.ceil(len(wave) / win_len)) ) # cut into frames wavmat = libros...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def energy(data):\n return sum(pow(data, 2))", "def energy(data):\n\n return np.real(np.mean(np.abs(data)**2, axis=1))", "def _calc_energy( self, V_a, eos_d ):\n pass", "def energy_func(self):\n i = self.inl[0].to_flow()\n o = self.outl[0].to_flow()\n\n T_m = (T_mix_ph(i, T0...
[ "0.74858344", "0.73468274", "0.72648364", "0.7205266", "0.713724", "0.70454234", "0.7033085", "0.7014199", "0.69486386", "0.686572", "0.68204486", "0.6807079", "0.67907506", "0.6739542", "0.6724279", "0.6708096", "0.669785", "0.66828525", "0.6668826", "0.6641229", "0.6641229"...
0.0
-1
Build index.html for cherrypy Render the template and return the html file to be delivered to the browser
def index(self, scan=None, test=None, reload=None): if scan == 'on': self.plugin.beodevices.scan_subnet(self.plugin.fromip, self.plugin.toip) if test == 'on': self.plugin.beodevices.update_devices_info() tmpl = self.tplenv.get_template('index.html') # add values ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\n return render_template('index.html')", "def main():\n return render_template('index.html')", "def index():\n # Render template\n return render_template('index.html')", "def get_index():\n return render_template('index.html')", "def index():\n return render_template(\"index.h...
[ "0.78016955", "0.78016955", "0.77203834", "0.77076375", "0.7637089", "0.7637089", "0.7637089", "0.7637089", "0.7637089", "0.7637089", "0.7637089", "0.7637089", "0.7637089", "0.7637089", "0.7637089", "0.7637089", "0.7637089", "0.7637089", "0.7637089", "0.7637089", "0.7637089",...
0.0
-1
Return string after translating the suffix correctly.
def translate_fam_letter(string): letter_map = {"M": ".2", "MM": ".2", "P": ".0", "S": ".4", # this is dangerous (there may be more than one sibling) "B": ".4", # this is dangerous (there may be more than one sibling) "F": ".3...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _suffix(self) -> str:\n return \"\"", "def suffix(self):\n return self._suffix", "def suffix(self):\n return self._suffix", "def suffix(self):\n return self._suffix", "def suffix ( self ) :\n return self.__suffix", "def suffix ( self ) :\n return self.__suffi...
[ "0.74656254", "0.6967761", "0.6967761", "0.6967761", "0.69223803", "0.69223803", "0.689928", "0.6898379", "0.6898379", "0.68521976", "0.68294054", "0.67576414", "0.6695978", "0.6670723", "0.66402435", "0.65456873", "0.6470673", "0.645351", "0.64408004", "0.6437943", "0.641664...
0.0
-1
Creates bimodal gaussian from gaussian function.
def bimodal_gaussian(t, amp1=2.5, to1=20, sig1=5, amp2=1.75, to2=32, sig2=3): g1 = gaussian(t, to1, sig1, amp1) g2 = gaussian(t, to2, sig2, amp2) return g1 + g2
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gaussian(x, mu, sigma):\n return (np.exp(-(x - mu)**2 / 2.0 / sigma**2) /\n np.sqrt(2.0 * np.pi) / sigma)", "def gaussian(x, mean, sigma):\n return np.exp(-np.square(x-mean)/(2*np.square(sigma))) / (np.sqrt(2*np.pi*sigma**2))", "def _gaussian_distribution(self, x: ndarray, mu: float, sigma...
[ "0.760031", "0.7352755", "0.73426646", "0.72606367", "0.72026026", "0.7182496", "0.6951342", "0.69454867", "0.6873863", "0.6869742", "0.68392676", "0.68373543", "0.6835207", "0.6829774", "0.6813556", "0.67944705", "0.6775187", "0.6775187", "0.6775187", "0.6758869", "0.6723592...
0.6978091
6
Define standard datetime string
def format_datetime(epoch): return strftime("%a %b %d %Y %I:%M:%S%p", localtime(epoch))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dtstr():\n return dt.strftime(dt.now(),'%Y %m %d, %H:%M:%S')", "def strftime(self, *args, **kwargs):\n return String(super(Datetime, self).strftime(*args, **kwargs))", "def get_datetime_string():\n return datetime.now().strftime(DATETIME_FORMAT)", "def get_datetime_str():\n return time.st...
[ "0.6937582", "0.6927269", "0.6853922", "0.6849562", "0.67262864", "0.6701413", "0.6589623", "0.6550059", "0.6550059", "0.6529452", "0.65084386", "0.6485776", "0.6476153", "0.646095", "0.6427314", "0.6423523", "0.6392761", "0.6392737", "0.63662696", "0.6363606", "0.63599855", ...
0.0
-1
Takes two distance matrices and performs a Mantel test. The Mantel test is a significance test of the correlation between two distance matrices.
def test(X, Y, perms=10000, method='pearson', tail='two-tail'): # Make sure that X and Y are formatted as Numpy arrays. X, Y = np.asarray(X, dtype=float), np.asarray(Y, dtype=float) # Check that X and Y are valid distance matrices. if spatial.distance.is_valid_dm(X) == False and spatial.distance.is_valid_y(X)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setUp(self):\r\n super(MantelTests, self).setUp()\r\n\r\n # Create two small test distance matrices.\r\n sample_ids = [\"S1\", \"S2\", \"S3\"]\r\n m1 = array([[0, 1, 2], [1, 0, 3], [2, 3, 0]])\r\n m2 = array([[0, 2, 7], [2, 0, 6], [7, 6, 0]])\r\n m1_dm = DistanceMatrix...
[ "0.6865427", "0.6755211", "0.6429166", "0.6348402", "0.6217155", "0.61987853", "0.61615896", "0.6088757", "0.6064452", "0.6026304", "0.6025648", "0.5994077", "0.596311", "0.5960525", "0.59274274", "0.5925849", "0.5899003", "0.58827", "0.5864597", "0.5861688", "0.5835084", "...
0.0
-1
Get list of products
def get_all_products(access_keeper): logger.debug('getting products...') headers = get_authorization_headers(access_keeper) response = requests.get('https://api.moltin.com/v2/products', headers=headers) raise_response_errors(response) products = response.json()['data'] logger.debug(f'{len(prod...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_products(self):\n return self._make_get_request(self._urls['products'])", "def get_all_products(self):\n\t\tpass", "def products(self):\n response = requests.get(self._url(self._PRODUCTS_PATH), headers=self._headers)\n return response.json()", "def list_products(self):\n ...
[ "0.8801383", "0.83071506", "0.8174317", "0.8165491", "0.8093002", "0.8045835", "0.8035913", "0.79976684", "0.7916318", "0.7863756", "0.7787328", "0.7776258", "0.7766564", "0.7736289", "0.76729137", "0.76634645", "0.7628119", "0.76261294", "0.76057017", "0.7578552", "0.7574292...
0.7544413
22
Encode a given string to 1hot encoder matrix. Each row represents a 1hot encoding character.
def encode(self, string): encoded = np.zeros((len(string), len(self.__chars))) for i, c in enumerate(string): encoded[i, self.__char2idx[c]] = 1 return encoded
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def one_hot_encoder(self, DNA_string):\n\n if self.selex_predict_str_adaptor != 0:\n DNA_string = \"A\" * self.selex_predict_str_adaptor + DNA_string + 'A' * self.selex_predict_str_adaptor\n\n trantab = DNA_string.maketrans('ACGT', '0123')\n str_arr = [\"\" for x in range(self.num_o...
[ "0.79152924", "0.77565753", "0.7552682", "0.7469745", "0.72085565", "0.71125835", "0.70782804", "0.7054675", "0.69762754", "0.69446176", "0.6868482", "0.6853921", "0.67842835", "0.67389077", "0.67045826", "0.66605264", "0.6659397", "0.6570717", "0.6463458", "0.6424995", "0.64...
0.6961741
9
Revert the indices of 1hot to the original characters.
def decode(self, indices): return ''.join(list(map(lambda v: self.__idx2char[v], indices)))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def decode_one_hot(x):\n s = []\n for onehot in x:\n one_index = np.argmax(onehot)\n c = indices_char[one_index]\n s.append(c) \n return ''.join(s)", "def one_hot_enc(self, word):\n word = self.text_to_int(word)\n word = Variable(torch.tensor(word))\n word = tor...
[ "0.6956735", "0.68600917", "0.6824224", "0.6659191", "0.6556727", "0.65523386", "0.65027565", "0.64718795", "0.6389349", "0.6369143", "0.63402545", "0.6296131", "0.62766284", "0.62686855", "0.62587446", "0.6238152", "0.6202982", "0.6202982", "0.6202982", "0.6202982", "0.61787...
0.0
-1
A required method by PyTorch Datasets, which is used to interface with a PyTorch DataLoader.
def __len__(self): if self.TRAIN_BOOL is True: count = len(self.dict_batch_1[b'data']) count += len(self.dict_batch_2[b'data']) count += len(self.dict_batch_3[b'data']) count += len(self.dict_batch_4[b'data']) count += len(self.dict_batch_5[b'data']) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def train_dataloader(self) -> torch.utils.data.DataLoader: \n return torch.utils.data.DataLoader(self.dataset_train, **self.dl_kwargs)", "def test_dataloader(self) -> torch.utils.data.DataLoader: \n return torch.utils.data.DataLoader(self.dataset_test, **self.dl_kwargs)", "def __i...
[ "0.7848463", "0.755778", "0.7401026", "0.7232123", "0.7121414", "0.70845634", "0.7061457", "0.70463866", "0.70271957", "0.70192647", "0.70050615", "0.69205135", "0.6872101", "0.6861064", "0.68521905", "0.6790742", "0.6741337", "0.66997504", "0.6685074", "0.66627693", "0.66087...
0.0
-1
Returns the string label corresponding to an integer label ID.
def getMetaLabel(self, idx): return self.label_dict[idx].decode("utf-8")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def id_for_label(self, id_):\n return id_", "def id_for_label(self, id_):\n return id_", "def get_label_id(self) -> int:\n pass", "def get_label_name(label_id):\n if self._int_to_label == {}:\n print(\"ERROR\")\n print(\"Need to import data first\")\n ...
[ "0.79286325", "0.7828818", "0.76953506", "0.7663193", "0.75637794", "0.73407304", "0.72113633", "0.70319164", "0.6985439", "0.6975497", "0.6957828", "0.6908309", "0.6753622", "0.6753622", "0.6736257", "0.6726225", "0.6671618", "0.66641635", "0.6615971", "0.66124606", "0.66108...
0.0
-1
Return queryset with child comments sorted by created time.
def child_comments_in_order(self): return self.order_by("created_at").select_related("user")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parent_comments_in_reverse_order(self):\n return self.exclude(parent__isnull=False).order_by(\"-created_at\")\\\n .select_related(\"user\")", "def comments(self):\n return self.get_queryset().filter(content_type__model='comment').order_by('-comments__createdAt')", "def get_queryset...
[ "0.7657182", "0.75776434", "0.7485589", "0.7161098", "0.68852997", "0.65679145", "0.6383862", "0.62792706", "0.62332606", "0.6180204", "0.6004198", "0.59232384", "0.5752263", "0.5707279", "0.5683538", "0.5670516", "0.5643314", "0.5631976", "0.56158996", "0.560286", "0.5556957...
0.8498989
0
Check whether the current grid is valid and return bool.
def valid(self): # Verify correct vertex values self.verify_vertex_values() # Check for duplicate values in lines for line in range(9): seen = [] for row in range(9): if self.grid[line][row] is None: pass elif se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_valid(self):\n if self.get_row() != -1 and self.get_column() != -1:\n return True\n else:\n return False", "def _is_valid(self):\n for cell in self._cells_iterable():\n if cell not in self._valid_elements:\n return False\n return ...
[ "0.7920779", "0.7716549", "0.75221163", "0.7479439", "0.7447236", "0.7432786", "0.74020654", "0.73892415", "0.731774", "0.72541356", "0.7241043", "0.7229743", "0.72189623", "0.71809644", "0.7157131", "0.71539134", "0.7137221", "0.7113721", "0.711343", "0.70851755", "0.7084775...
0.7767098
1
Calculate P_k(t2 | t1), a delta smoothed estimate of the conditional probability of the two tuples t1, t2, within a window of k.
def windowConditionalProb(counter, t2, t1, k, delta=0.05): rel_map = counter.relgram_map if k in counter.windows: window_index = counter.windows.index(k) else: print("Relgram Statistics for k = {} not computed!".format(k)) return None if t2 in rel_map[t1]: t1_t2_count = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def diff_k_p2(p1, p2, t=0.):\n return p2", "def diff_k_p1(p1, p2, t=0.):\n return p1", "def conditionalProb(counter, t2, t1, alpha=0.5, delta=0.05):\n score = 0\n Z = 0\n for window in counter.windows:\n Z += (alpha ** window)\n score += (alpha ** window) * windowCo...
[ "0.7134826", "0.70182467", "0.6233212", "0.61481005", "0.6000674", "0.5977806", "0.5783279", "0.5763546", "0.57388145", "0.56944525", "0.568175", "0.56729245", "0.5659935", "0.5571314", "0.5542993", "0.55337095", "0.55323213", "0.55293614", "0.55042565", "0.548086", "0.547501...
0.75366694
0
Add headers to both force latest IE rendering engine or Chrome Frame, and also to cache the rendered page for 10 minutes.
def add_header(r): r.headers["Cache-Control"] = "no-cache, no-store, must-revalidate" r.headers["Pragma"] = "no-cache" r.headers["Expires"] = "0" r.headers['Cache-Control'] = 'public, max-age=0' return r
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_header(response):\n response.headers['X-UA-Compatible'] = 'IE=Edge,chrome=1'\n response.headers['Cache-Control'] = 'public, max-age=60'\n return response", "def add_header(response):\n response.headers['X-UA-Compatible'] = 'IE=Edge,chrome=1'\n response.headers['Cache-Control'] = 'public, m...
[ "0.82239413", "0.8223081", "0.8223081", "0.8223081", "0.8223081", "0.8196386", "0.8163827", "0.8163827", "0.8163827", "0.8163827", "0.8163827", "0.8163827", "0.8163827", "0.8163827", "0.8163827", "0.8163827", "0.8163827", "0.8163827", "0.8163827", "0.8163827", "0.8163827", ...
0.71290123
57
Reads a file to a Dataframe.
def my_reader(filename, sheetname='Sheet1', separ=','): global df_read filename_list = filename.split('.') extension = filename_list[-1] if extension == 'csv': df_read = pd.read_csv(filename, sep=separ) if extension == 'data': df_read = pd.read_csv(filename, sep=separ, header=...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_file_to_dataframe(self, file_path: str) -> pd.DataFrame:\n return pd.read_csv(file_path, sep=\"\\t\")", "def read_data(filepath):\n df = pd.read_csv(filepath)\n return df", "def read_data(filepath):\n df = pd.read_csv(filepath)\n return df", "def read_data(filepath...
[ "0.8018143", "0.77899146", "0.77899146", "0.77899146", "0.7416994", "0.74105006", "0.7376638", "0.73196816", "0.7315504", "0.72933996", "0.7281744", "0.72561127", "0.72343147", "0.7178972", "0.7175295", "0.7146634", "0.71346414", "0.7101362", "0.70862615", "0.70787644", "0.70...
0.0
-1
Splits tha Dataframe to a train and test Dataframe.
def my_train_test_split(act_my_data, act_test_size=0.5): act_train_df, act_test_df = train_test_split(act_my_data, test_size=act_test_size) return act_train_df, act_test_df
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def train_test_split(df):\n training_size = int(len(df) * .67)\n test_size = int(len(df) - training_size)\n train, test = df[0:training_size], df[training_size:len(df)]\n return train, test", "def train_test_split(df, test_size=0.3):\r\n # split df here\r\n train_size = int(df.shape[0] * (1 - t...
[ "0.844805", "0.8430184", "0.8188947", "0.81744057", "0.81308454", "0.80413634", "0.8023334", "0.7996662", "0.7935957", "0.790046", "0.7868415", "0.78513366", "0.77936083", "0.77797997", "0.7738744", "0.7681881", "0.7673551", "0.76102066", "0.7550606", "0.74824446", "0.7463039...
0.70738095
44
Returns the bounding boxes for the faces that appear in the frame.
def update(self, frame, frameCenter): # GrayScale conversion from OpenCV gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) # call the detector for the multiple faces from the input rects = self.detector.detectMultiScale(gray, scaleFactor=1.05, minNeighbors=9, minSize=(30, 30), flags=cv2.CASCADE_SCALE_IMAGE...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_bounding_boxes(frame):\n\n blob = cv2.dnn.blobFromImage(frame,1/255,(320,320),(0,0,0),1,crop=False)\n net.setInput(blob)\n\n output_layer_names = net.getUnconnectedOutLayersNames()\n layer_outputs = net.forward(output_layer_names)\n\n all_boxes, confidences = get_all_boxes(layer_outputs)\n\n...
[ "0.7164721", "0.7122802", "0.70745176", "0.7041347", "0.695731", "0.6920476", "0.69052875", "0.68970275", "0.68761414", "0.6874528", "0.6874378", "0.6869635", "0.6788745", "0.6737209", "0.6736851", "0.67288315", "0.6723314", "0.6689454", "0.66346496", "0.6629943", "0.66219133...
0.0
-1
Return the interactions this component uses. TODO could this just return the only nonempty one, since there can only be one? @ In, None @ Out, interactions, list, list of Interaction instances
def get_interaction(self): try: return (self._produces + self._stores + self._demands)[0] except IndexError: # there are no interactions! return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def interactions(self) -> Sequence[Interaction[_C_out,_A_out]]:\n return self._interactions", "def interactions(self) -> Sequence[Interaction[_C_out, Tuple[int,...]]]:\n return self._simulation.interactions", "def interactions(self) -> Sequence[Interaction[_C_out,_A_out]]:\n return self._s...
[ "0.75529075", "0.7466095", "0.7421031", "0.7022946", "0.682388", "0.67961085", "0.65666246", "0.6277766", "0.5861724", "0.5782191", "0.56991154", "0.5604135", "0.55619895", "0.5559137", "0.54566085", "0.5427054", "0.53891176", "0.5382058", "0.5319858", "0.5299573", "0.5285783...
0.667716
6
Returns the variable that is used to define this component's capacity. @ In, None @ Out, var, str, name of capacity resource
def get_capacity_var(self): return self.get_interaction().get_capacity_var()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_capacity_var(self):\n return self._capacity_var", "def get_capacity_param(self):\n intr = self.get_interaction()\n return intr.get_capacity(None, None, None, None, raw=True)", "def capacity(self) -> typing.Optional[str]:\n value = self._properties.get(\"capacity\")\n return f\"{v...
[ "0.80675346", "0.6781067", "0.6497393", "0.6241257", "0.6236735", "0.6177602", "0.6130046", "0.6130046", "0.6130046", "0.6130046", "0.6130046", "0.6130046", "0.6130046", "0.6079173", "0.6079173", "0.6079173", "0.6079173", "0.60548913", "0.6019886", "0.6019886", "0.6019886", ...
0.7681512
1
Returns the dispatchability indicator of this component. TODO Note that despite the name, this is NOT boolean, but a string indicator. @ In, None @ Out, dispatchable, str, dispatchability (e.g. independent, dependent, fixed)
def is_dispatchable(self): return self.get_interaction().is_dispatchable()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_dispatchable(self):\n return self._dispatchable", "def compliance_status(self) -> str:\n return pulumi.get(self, \"compliance_status\")", "def compliance(self) -> pulumi.Output['outputs.ComplianceNoteResponse']:\n return pulumi.get(self, \"compliance\")", "def classification(self) -> ...
[ "0.5989074", "0.5641539", "0.54033077", "0.53395367", "0.5182405", "0.51655066", "0.51575965", "0.51071817", "0.50781125", "0.5076977", "0.49998572", "0.49968374", "0.4993749", "0.4978742", "0.49595362", "0.49579173", "0.49579173", "0.49552572", "0.49498314", "0.48833358", "0...
0.5724547
1
Determines the maximum production possible for this component. @ In, meta, dict, metadata information for current status in run @ In, raven_variables, dict, variables from RAVEN TODO part of meta! @ In, dispatch, DispatchState, expression of the current activity levels in the system @ In, t, int, index of "time" at whi...
def produce_max(self, meta, raven_variables, dispatch, t): #balance = defaultdict(float) interaction = self.get_interaction() balance, meta = interaction.produce_max(meta, raven_variables, dispatch, t) #for resource, quantity in int_balance.items(): # balance[resource] += quantity return balanc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def produce_max(self, meta, raven_vars, dispatch, t):\n request, meta = self.get_capacity(meta, raven_vars, dispatch, t)\n balance, meta = self.produce(request, meta, raven_vars, dispatch, t)\n # dict((prod, self._capacity[p]) for p, prod in enumerate(self._produces))\n return balance, meta", "def pr...
[ "0.74389774", "0.7183633", "0.6034818", "0.5793284", "0.57668215", "0.57578975", "0.5752119", "0.5749403", "0.5696631", "0.55939186", "0.54445386", "0.5428297", "0.5426092", "0.53879386", "0.53809106", "0.5345843", "0.52379626", "0.5219953", "0.5207181", "0.51965785", "0.5189...
0.6999346
2
Allows hardsetting the capacity of this interaction. This destroys any underlying ValuedParam that was there before. @ In, cap, float, capacity value @ Out, None
def set_capacity(self, cap): self._capacity.type = 'value' self._capacity._value = float(cap) # TODO getter/setter
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_capacity(self, cap):\n return self.get_interaction().set_capacity(cap)", "def capacity(self, capacity):\n\n self._capacity = capacity", "def capacity(self, value: typing.Union[str, int, None]):\n self._properties[\"capacity\"] = _types.integer_or_string(value)", "def set_capacity(sel...
[ "0.7207605", "0.634901", "0.6179275", "0.5969272", "0.5923734", "0.58853227", "0.58645564", "0.5801194", "0.57781994", "0.57559454", "0.57559454", "0.57559454", "0.57559454", "0.57559454", "0.57559454", "0.57559454", "0.57251793", "0.5718485", "0.5707878", "0.5657219", "0.564...
0.7055933
1
Returns the minimum level of this interaction. Returns an evaluated value unless "raw" is True, then gives ValuedParam @ In, meta, dict, additional variables to pass through @ In, raven_vars, dict, TODO part of meta! consolidate! @ In, dispatch, dict, TODO part of meta! consolidate! @ In, t, int, TODO part of meta! con...
def get_minimum(self, meta, raven_vars, dispatch, t, raw=False): if raw: return self._minimum request = {self._minimum_var: None} inputs = {'request': request, 'meta': meta, 'raven_vars': raven_vars, 'dispatch': dispatch, 't': t} evaluated, m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def min_level(self):\n return self.__min", "def produce_min(self, meta, raven_vars, dispatch, t):\n if self._minimum:\n request, meta = self.get_minimum(meta, raven_vars, dispatch, t)\n else:\n request = {next(iter(self.get_inputs())): 0.0} # TODO is this a good choice when no min var avai...
[ "0.6753292", "0.65013677", "0.63005966", "0.62827766", "0.62479746", "0.6230658", "0.6230658", "0.6142672", "0.61193293", "0.61193293", "0.60946864", "0.60024303", "0.59456754", "0.5901405", "0.5889794", "0.5862116", "0.5811626", "0.58044755", "0.5787887", "0.57598114", "0.57...
0.71186125
0
Returns the set of resources that are outputs to this interaction. @ In, None @ Out, outputs, set, set of outputs
def get_outputs(self): return set()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_outputs(self):\n outputs = set()\n outputs.update(self.get_interaction().get_outputs())\n return outputs", "def get_resources(self):\n res = set()\n res.update(self.get_inputs())\n res.update(self.get_outputs())\n return res", "def get_outputs(self):\n outputs = set(np.atleast_1...
[ "0.76896405", "0.7511008", "0.74381655", "0.7184242", "0.7166503", "0.7166503", "0.7150385", "0.7117294", "0.7092376", "0.7013465", "0.6936313", "0.6874341", "0.6783292", "0.6777383", "0.67731726", "0.67696375", "0.67319626", "0.6652208", "0.6652208", "0.6652208", "0.6652208"...
0.7355123
3
Check to see if capacity limits of this component have been violated. @ In, res, str, name of capacitylimiting resource @ In, amt, float, requested amount of resource used in interaction @ In, balance, dict, results of requested interaction @ In, meta, dict, additional variable passthrough @ In, raven_vars, dict, TODO ...
def _check_capacity_limit(self, res, amt, balance, meta, raven_vars, dispatch, t): cap = self.get_capacity(meta, raven_vars, dispatch, t)[0][self._capacity_var] try: if abs(balance[self._capacity_var]) > abs(cap): #ttttt # do the inverse problem: how much can we make? balance, meta...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _check_capacity_limit(self, res, amt, balance, meta, raven_vars, dispatch, t, level):\n # note \"amt\" has units of AMOUNT not RATE (resource, not resource per second)\n sign = np.sign(amt)\n # are we storing or providing?\n #print('DEBUGG supposed current level:', level)\n if sign < 0:\n #...
[ "0.81101316", "0.7062868", "0.67671955", "0.5967685", "0.5855561", "0.5821423", "0.5807003", "0.57726336", "0.57157713", "0.5688964", "0.56562155", "0.56528187", "0.56473243", "0.55285233", "0.5523255", "0.5518745", "0.5502126", "0.5447026", "0.5437369", "0.541805", "0.541681...
0.8324179
0
Returns the set of resources that are outputs to this interaction. @ In, None @ Out, outputs, set, set of outputs
def get_outputs(self): outputs = set(np.atleast_1d(self._produces)) return outputs
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_outputs(self):\n outputs = set()\n outputs.update(self.get_interaction().get_outputs())\n return outputs", "def get_resources(self):\n res = set()\n res.update(self.get_inputs())\n res.update(self.get_outputs())\n return res", "def get_outputs(self):\n return set()", "def get_...
[ "0.7688987", "0.7513798", "0.7356075", "0.71827364", "0.7164275", "0.7164275", "0.7152217", "0.71154803", "0.7090229", "0.70115966", "0.6935741", "0.6872568", "0.67809206", "0.67762345", "0.67722744", "0.6767754", "0.6730913", "0.665036", "0.665036", "0.665036", "0.665036", ...
0.74381936
2
Returns the set of resources that are outputs to this interaction. @ In, None @ Out, outputs, set, set of outputs
def get_outputs(self): outputs = Interaction.get_outputs(self) outputs.update(np.atleast_1d(self._stores)) return outputs
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_outputs(self):\n outputs = set()\n outputs.update(self.get_interaction().get_outputs())\n return outputs", "def get_resources(self):\n res = set()\n res.update(self.get_inputs())\n res.update(self.get_outputs())\n return res", "def get_outputs(self):\n outputs = set(np.atleast_1...
[ "0.76896405", "0.7511008", "0.74381655", "0.7355123", "0.7184242", "0.7166503", "0.7166503", "0.7150385", "0.7117294", "0.7092376", "0.7013465", "0.6936313", "0.6874341", "0.6783292", "0.6777383", "0.67731726", "0.67696375", "0.67319626", "0.6652208", "0.6652208", "0.6652208"...
0.6335106
35
Check to see if capacity limits of this component have been violated. overloads Interaction method, since units for storage are "res" not "res per second" @ In, res, str, name of capacitylimiting resource @ In, amt, float, requested amount of resource used in interaction @ In, balance, dict, results of requested intera...
def _check_capacity_limit(self, res, amt, balance, meta, raven_vars, dispatch, t, level): # note "amt" has units of AMOUNT not RATE (resource, not resource per second) sign = np.sign(amt) # are we storing or providing? #print('DEBUGG supposed current level:', level) if sign < 0: # we are being...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _check_capacity_limit(self, res, amt, balance, meta, raven_vars, dispatch, t):\n cap = self.get_capacity(meta, raven_vars, dispatch, t)[0][self._capacity_var]\n try:\n if abs(balance[self._capacity_var]) > abs(cap):\n #ttttt\n # do the inverse problem: how much can we make?\n ba...
[ "0.73435444", "0.612147", "0.6029243", "0.5966412", "0.5806626", "0.5783032", "0.5740476", "0.572541", "0.56472945", "0.55836636", "0.5444334", "0.5432238", "0.537833", "0.5375539", "0.5367818", "0.53530115", "0.52981216", "0.52951413", "0.52919245", "0.5291475", "0.5291475",...
0.72398823
1
Create and return the session scoped user data directory
def session_user_data_dir(session_data_dir, session_username): user_data_dir = os.path.join(session_data_dir, session_username) if not os.path.exists(user_data_dir): os.mkdir(user_data_dir) return user_data_dir
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_user_data_dir(self):\n self._user_data_dir = tempfile.TemporaryDirectory(prefix=f'{self.USER_DATA_DIR_PREFIX}_tmp_')\n return self._user_data_dir.name", "def user_data_dir(data_dir, username):\n user_data_dir = os.path.join(data_dir, username)\n if not os.path.exists(user_data_dir...
[ "0.7710768", "0.7425073", "0.71175796", "0.6977174", "0.6898327", "0.68482685", "0.6775326", "0.6659154", "0.66424274", "0.6355724", "0.6323745", "0.631497", "0.62177485", "0.62093264", "0.6187468", "0.6185723", "0.615499", "0.6146501", "0.6116718", "0.60926324", "0.6069982",...
0.8119631
0
The application client type
def client_type(self) -> Optional[str]: return pulumi.get(self, "client_type")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ClientType(self):\n self.__client_type = FRegulatoryUtils.getClientType(self.__contact)\n return self.__client_type", "def _app_type(self):\n return self._event['app_type']", "def server_type(self):\n ...", "def get_target_type():\n is_cli = prompt_yn(\"is this a command-li...
[ "0.7808763", "0.7427066", "0.68974113", "0.67553407", "0.6514633", "0.64236295", "0.63967574", "0.6387474", "0.6372728", "0.6357988", "0.63532615", "0.63532615", "0.63505316", "0.6313311", "0.6310744", "0.631004", "0.62674904", "0.62451446", "0.6239589", "0.6239277", "0.62392...
0.82905835
0
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
def type(self) -> str: return pulumi.get(self, "type")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resource_type(self) -> Optional[str]:\n return pulumi.get(self, \"resource_type\")", "def resource_type(self) -> Optional[str]:\n return pulumi.get(self, \"resource_type\")", "def resource_type(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"resource_type\")", "def ...
[ "0.7918774", "0.7918774", "0.78666556", "0.78666556", "0.78666556", "0.78666556", "0.78666556", "0.7706737", "0.7553459", "0.72828007", "0.70600736", "0.6980601", "0.6921472", "0.68694425", "0.67290044", "0.67053574", "0.6655504", "0.6646448", "0.65517074", "0.6542098", "0.65...
0.66402596
50
Returns Linker resource for a given name.
def get_linker(linker_name: Optional[str] = None, resource_uri: Optional[str] = None, opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetLinkerResult: __args__ = dict() __args__['linkerName'] = linker_name __args__['resourceUri'] = resource_uri opts = pulumi.Invoke...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_link(self, name):\n return self._link_reg[name]", "def get_resource_from_name(name):\n return _name_to_resources.get(name, None)", "def get_linker_output(linker_name: Optional[pulumi.Input[str]] = None,\n resource_uri: Optional[pulumi.Input[str]] = None,\n ...
[ "0.68210036", "0.6313673", "0.62242836", "0.5728099", "0.5676354", "0.5623828", "0.5490361", "0.5455136", "0.54451567", "0.543473", "0.541519", "0.5369731", "0.53509015", "0.53067946", "0.5296344", "0.5293343", "0.5273132", "0.5230027", "0.5225598", "0.52185607", "0.5200879",...
0.5804629
3
Returns Linker resource for a given name.
def get_linker_output(linker_name: Optional[pulumi.Input[str]] = None, resource_uri: Optional[pulumi.Input[str]] = None, opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetLinkerResult]: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_link(self, name):\n return self._link_reg[name]", "def get_resource_from_name(name):\n return _name_to_resources.get(name, None)", "def get_linker(linker_name: Optional[str] = None,\n resource_uri: Optional[str] = None,\n opts: Optional[pulumi.InvokeOptions] = None...
[ "0.68210036", "0.6313673", "0.5804629", "0.5728099", "0.5676354", "0.5623828", "0.5490361", "0.5455136", "0.54451567", "0.543473", "0.541519", "0.5369731", "0.53509015", "0.53067946", "0.5296344", "0.5293343", "0.5273132", "0.5230027", "0.5225598", "0.52185607", "0.5200879", ...
0.62242836
2
Sets the scope of this GetOauthAccessToken.
def scope(self, scope): self._scope = scope
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def auth_token_provider_scope(self, auth_token_provider_scope):\n\n self._auth_token_provider_scope = auth_token_provider_scope", "def scope(self, scope):\n self._scope = scope", "def oauth_scopes(self) -> pulumi.Input[Sequence[pulumi.Input[str]]]:\n return pulumi.get(self, \"oauth_scopes\...
[ "0.61239964", "0.5729581", "0.5624162", "0.5500636", "0.5464855", "0.5292399", "0.52756095", "0.5247207", "0.51246613", "0.50785697", "0.50749266", "0.5071316", "0.5071316", "0.5071316", "0.5071316", "0.5071316", "0.5016877", "0.5013042", "0.50125283", "0.50035864", "0.495744...
0.57666874
1
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, GetOauthAccessToken): 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
POST /api/tams_api/enrollments_api/enrollments username, course_id
def post(self, request): # Only superusers can create an account if not request.user.is_superuser: return Response(status=status.HTTP_403_FORBIDDEN) username = request.POST.get('username') course_id = request.POST.get('course_id') if not username: retur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def students_update_enrollment(request, course_id):\r\n course_id = SlashSeparatedCourseKey.from_deprecated_string(course_id)\r\n\r\n action = request.GET.get('action')\r\n identifiers_raw = request.GET.get('identifiers')\r\n identifiers = _split_input_list(identifiers_raw)\r\n auto_enroll = request...
[ "0.6677553", "0.62678236", "0.6196534", "0.6187969", "0.61222297", "0.61106974", "0.6041338", "0.59688336", "0.58251595", "0.5716932", "0.57095486", "0.56842655", "0.56739736", "0.5642513", "0.56059015", "0.55944926", "0.5588214", "0.55854106", "0.5580774", "0.5508757", "0.54...
0.7292936
0
convert utc time to unix time
def getUnixTime(utc_time): temp=time.strptime(utc_time, "%a %b %d %H:%M:%S +0000 %Y") return calendar.timegm(temp)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def utc_to_unix_time(self, t):\n (y,m,d) = str(t).split('-')\n return datetime(int(y), int(m), int(d)).strftime('%s')", "def utc_to_unix(t):\n t = t.split('.')[0]\n dt = datetime.strptime(t, '%Y-%m-%dT%H:%M:%S')\n tz = pytz.timezone('UTC')\n dt = tz.localize(dt)\n unix_time = int(dt....
[ "0.8105295", "0.7840509", "0.77686346", "0.7434898", "0.7400697", "0.7027996", "0.68857497", "0.686126", "0.6845806", "0.68235254", "0.6818207", "0.6786848", "0.67100006", "0.6701036", "0.66940135", "0.667985", "0.66578925", "0.6655679", "0.6582062", "0.65193355", "0.6518884"...
0.8166597
0
Override to parse the start date time of the test from the response.
async def _parse_source_response_date_time(self, response: Response) -> datetime: datetime_parts = [ int(part) for part in (await self._soup(response)).find(id="start_of_the_test").string.split(".") ] return datetime(*datetime_parts) # type: ignore
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _parse_start(self, response):\n date_str = response.css(\".date time::attr(datetime)\").extract_first()\n time_str = \"\".join(response.css(\"article.time::text\").extract()).strip()\n if not time_str:\n time_str = \"\".join(response.css(\"article.time *::text\").extract()).stri...
[ "0.7545447", "0.75290364", "0.7269613", "0.7173199", "0.70514417", "0.6728485", "0.67172855", "0.66125816", "0.66035366", "0.64855677", "0.64855635", "0.6394465", "0.63635665", "0.6351467", "0.63334215", "0.6329598", "0.63294935", "0.6321205", "0.6275387", "0.62672544", "0.62...
0.73272145
2
Return a weight variable with given shape. Values in the variable are normally distribution
def weight_variable(shape): initial = tf.truncated_normal(shape) return tf.Variable(initial)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def weight_variable(shape):\r\n initial = tf.truncated_normal(shape, stddev=0.1)\r\n return tf.Variable(initial)", "def weight_variable(shape):\r\n initial = tf.truncated_normal(shape, stddev=0.1)\r\n return tf.Variable(initial)", "def weight_variable(shape):\r\n initial = tf.truncated_normal(shape, stdde...
[ "0.8167291", "0.8167291", "0.8167291", "0.8166853", "0.81457704", "0.81457704", "0.81457704", "0.81457704", "0.81457704", "0.81457704", "0.81457704", "0.81457704", "0.81457704", "0.81457704", "0.81420803", "0.80653334", "0.80435413", "0.79841685", "0.79613173", "0.794438", "0...
0.7982093
18
Sets the dataset_id of this InlineResponseDefault1.
def dataset_id(self, dataset_id): if dataset_id is None: raise ValueError("Invalid value for `dataset_id`, must not be `None`") # noqa: E501 self._dataset_id = dataset_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(__self__, *,\n dataset_id: Optional[pulumi.Input[str]] = None):\n if dataset_id is not None:\n pulumi.set(__self__, \"dataset_id\", dataset_id)", "def source_dataset_id(self, source_dataset_id):\n if source_dataset_id is None:\n raise ValueError(\"...
[ "0.63282347", "0.6255009", "0.61360615", "0.60884243", "0.60570693", "0.60160017", "0.60039407", "0.59261894", "0.59261894", "0.59261894", "0.58970255", "0.5854266", "0.5790116", "0.57628506", "0.57227457", "0.5698502", "0.5682343", "0.5591337", "0.5587497", "0.55863637", "0....
0.6885173
0
Sets the description of this InlineResponseDefault1.
def description(self, description): self._description = description
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_description(self, description):\r\n self.__description = description", "def set_description(self, desc: str) -> None:\n self.metadata.data[\"description\"] = desc", "def set_description(self, description):\n self.description = description", "def set_description(self, description)...
[ "0.66183543", "0.65854454", "0.6557995", "0.6526507", "0.6480774", "0.64497495", "0.64345354", "0.64170796", "0.6406813", "0.6402176", "0.6402176", "0.6402176", "0.6402176", "0.63463145", "0.6239801", "0.6239801", "0.6239801", "0.6239801", "0.6235728", "0.62024283", "0.618663...
0.63790315
35
Sets the name of this InlineResponseDefault1.
def name(self, name): if name is None: raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 self._name = name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_name(self, name):\n\t\tself.name_ = name", "def set_name(self, name):\n self.name = name", "def set_name(self, name):\n self.name = name", "def set_name(self, name):\n self.name = name", "def set_name(self, name):\n self.name = name", "def set_name(self, name):\n ...
[ "0.7000422", "0.69908214", "0.69908214", "0.69908214", "0.69908214", "0.69908214", "0.6979785", "0.69143873", "0.68998045", "0.68897456", "0.6843567", "0.6819892", "0.6800285", "0.6790905", "0.67900187", "0.67900187", "0.67733103", "0.67733103", "0.6732732", "0.6689249", "0.6...
0.0
-1
Sets the task_name of this InlineResponseDefault1.
def task_name(self, task_name): self._task_name = task_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _setTaskName(self, taskName):\n self._taskName = taskName\n self._progressChangedNotifier.notify(self)", "def task_name(self, task_name: str):\n if task_name is None:\n raise ValueError(\"Invalid value for `task_name`, must not be `None`\") # noqa: E501\n\n self._task_...
[ "0.7198639", "0.6968075", "0.641446", "0.6254486", "0.62096256", "0.6151299", "0.59945893", "0.5981083", "0.59787136", "0.59611887", "0.59547806", "0.5929917", "0.592802", "0.592802", "0.592802", "0.592802", "0.592802", "0.5897991", "0.58553874", "0.5850184", "0.58480126", ...
0.7577595
0
Sets the user_id of this InlineResponseDefault1.
def user_id(self, user_id): self._user_id = user_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def id_user(self, id_user):\n\n self._id_user = id_user", "def user_id(self, user_id):\n if user_id is None:\n raise ValueError(\"Invalid value for `user_id`, must not be `None`\") # noqa: E501\n\n self._user_id = user_id", "def user_id(self, user_id):\n if user_id is No...
[ "0.7504955", "0.700793", "0.700793", "0.69559765", "0.6842524", "0.68103206", "0.6660308", "0.64519554", "0.6404908", "0.6269297", "0.6166563", "0.60911876", "0.60542905", "0.603385", "0.5971589", "0.5971589", "0.5971589", "0.5971589", "0.5971589", "0.5971589", "0.5971589", ...
0.7372273
6
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, InlineResponseDefault1): 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
Put the attributes in dictionary format. They are originally in a list containing tuple pairs. returns
def _get_attribute_dic(self, attrs): attr_dic = {} for attr_pair in attrs: attr_dic[attr_pair[0]] = attr_pair[1] return attr_dic
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_attributes(self):\n \n retdict = {}\n retdict['s'] = str(self.s)\n if self.t != None:\n retdict['t'] = str(self.t)\n retdict['a'] = str(self.a)\n retdict['b'] = str(self.b)\n retdict['c'] = str(self.c)\n retdict['d'] = str(self.d)\n retu...
[ "0.7466157", "0.7338422", "0.71757597", "0.70290375", "0.70115995", "0.6956532", "0.679067", "0.6779112", "0.676057", "0.675987", "0.6594606", "0.6592889", "0.6592889", "0.6592889", "0.65810835", "0.65619534", "0.65513647", "0.6541424", "0.65388393", "0.6532938", "0.6515294",...
0.725325
2
get_queryset should add the correct extra attributes.
def test_get_queryset(self): # Create a fresh user user = User.objects.create_user( username='hjkdhds@12ioavoi3.local', password='moo') user.add_to_group(self.group1.pk) # Create a fresh message and flag it thread = mommy.make('connectmessages.Thread', group=self.gro...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_queryset(self, request, queryset):\n\n return queryset", "def get_queryset(self):\n return None", "def get_queryset(self):\n return None", "def get_queryset(self, *args, **kwargs):\n queryset = super().get_queryset(*args, **kwargs)\n\n queryset = StockSerializers.St...
[ "0.71883446", "0.6951079", "0.6951079", "0.68909055", "0.6890632", "0.676962", "0.676962", "0.65448177", "0.6538309", "0.6518651", "0.6490697", "0.64789975", "0.64745545", "0.64653164", "0.64630985", "0.6418326", "0.639211", "0.6376393", "0.6350245", "0.6346319", "0.6343889",...
0.0
-1
The identity_block is the block that has no conv layer at shortcut Arguments
def identity_block(self, input_tensor, kernel_size, filters, stage, block, use_bias=True, batch_norm_trainable=True): nb_filter1, nb_filter2, nb_filter3 = filters conv_name_base = 'res' + str(stage) + block + '_branch' bn_name_base = 'bn' + str(stage) + block + '_branch' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def identity_block(self, input_tensor, filters, activation, stage, block, start_with_batch_norm = True):\n\n # Set the naming convention\n conv_name_base = 'res' + str(stage) + block + '_branch'\n batch_norm_name_base = 'batch_norm' + str(stage) + block + '_branch'\n\n x_shortcut = inpu...
[ "0.7417824", "0.72852165", "0.72147304", "0.72146046", "0.721052", "0.71971375", "0.71670413", "0.7152859", "0.7131995", "0.71131915", "0.7111289", "0.708507", "0.70782053", "0.7077924", "0.70730114", "0.70315313", "0.7029831", "0.7029831", "0.70171803", "0.70157117", "0.7009...
0.69374657
24
conv_block is the block that has a conv layer at shortcut Arguments
def conv_block(self, input_tensor, kernel_size, filters, stage, block, strides=(2, 2), use_bias=True, batch_norm_trainable=True): nb_filter1, nb_filter2, nb_filter3 = filters conv_name_base = 'res' + str(stage) + block + '_branch' bn_name_base = 'bn' + str(stage) + block + '_bran...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def conv_block(self, output_channel, filter_, activate):\n return self.add_layer(conv_block, output_channel, filter_, activate)", "def conv_block(input, filters, phase=phase):\r\n\r\n conv_block = tf.layers.conv2d(\r\n inputs=input,\r\n filters=filters,\r\n kernel_s...
[ "0.75353014", "0.74855703", "0.73647773", "0.72222644", "0.7209214", "0.720638", "0.7202829", "0.7185739", "0.71778566", "0.7174462", "0.71601367", "0.71582484", "0.7157478", "0.71517885", "0.7130951", "0.71057576", "0.707301", "0.70585597", "0.7031059", "0.70303994", "0.7010...
0.70994836
16
Return the value of the h.authority config settings. Falls back on returning request.domain if h.authority isn't set.
def default_authority(request): return request.registry.settings.get("h.authority", request.domain)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def effective_authority(request):\n if request.identity and request.identity.auth_client:\n return request.identity.auth_client.authority\n\n # We could call the method directly here, but instead we'll go through the\n # request method attached below. This allows us to benefit from caching\n # i...
[ "0.68583006", "0.6794211", "0.64944965", "0.6270468", "0.6172108", "0.6113083", "0.5994615", "0.5977845", "0.57958686", "0.57872874", "0.57351005", "0.5711627", "0.56501937", "0.56018865", "0.5581103", "0.5575125", "0.55097246", "0.5508197", "0.5508197", "0.5508197", "0.55029...
0.7876543
1
Truncate xtick labels with an ellipsis after `stop_index`
def truncate_xticklabels(plot, stop_index=30): for label in plot.get_xticklabels(): t = label.get_text() if len(t) < stop_index: continue else: label.set_text(t[:stop_index] + '...') return plot.get_xticklabels()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def truncate_labels(labels):\n def do_one_row(row):\n erase = False\n for i, _ in enumerate(row):\n if erase:\n row[i] = -1\n else:\n if row[i] == 10:\n erase = True\n return row\n\n ret = np.copy(labels)\n ret = r...
[ "0.6083702", "0.5959954", "0.57749104", "0.555258", "0.55249304", "0.54223025", "0.5411453", "0.5373801", "0.5356702", "0.5335157", "0.532265", "0.5292864", "0.51761854", "0.5173749", "0.51684403", "0.51598763", "0.51417184", "0.51403195", "0.5099067", "0.50803995", "0.506559...
0.84581554
0
AutoprovisioningNodePoolDefaults contains defaults for a node pool created by NAP.
def __init__(__self__, *, boot_disk_kms_key: Optional[pulumi.Input[str]] = None, disk_size_gb: Optional[pulumi.Input[int]] = None, disk_type: Optional[pulumi.Input[str]] = None, image_type: Optional[pulumi.Input[str]] = None, managemen...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def autoprovisioning_node_pool_defaults(self) -> Optional[pulumi.Input['AutoprovisioningNodePoolDefaultsArgs']]:\n return pulumi.get(self, \"autoprovisioning_node_pool_defaults\")", "def node_config_defaults(self) -> Optional[pulumi.Input['NodeConfigDefaultsArgs']]:\n return pulumi.get(self, \"node...
[ "0.86969364", "0.6977837", "0.59966993", "0.5859701", "0.575943", "0.57324386", "0.56806487", "0.5671278", "0.560926", "0.56036353", "0.558288", "0.5562576", "0.5510274", "0.5471399", "0.54708153", "0.5429106", "0.54229975", "0.54216766", "0.5419271", "0.5419271", "0.5391037"...
0.0
-1
The ID of a BigQuery Dataset.
def dataset_id(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "dataset_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dataset_id(self) -> str:\n return pulumi.get(self, \"dataset_id\")", "def dataset_id(self) -> str:\n return pulumi.get(self, \"dataset_id\")", "def dataset_id(self) -> str:\n return pulumi.get(self, \"dataset_id\")", "def dataset_id(self) -> str:\n return self._dataset_id", ...
[ "0.81362456", "0.81362456", "0.81362456", "0.80097246", "0.7964272", "0.75436383", "0.75411695", "0.7160429", "0.66891587", "0.66492206", "0.6630024", "0.6624311", "0.65819645", "0.65759516", "0.64916605", "0.6317154", "0.6267738", "0.61867064", "0.61143833", "0.607298", "0.6...
0.74934447
7
This field is deprecated. Leave this unset and instead configure BinaryAuthorization using evaluation_mode. If evaluation_mode is set to anything other than EVALUATION_MODE_UNSPECIFIED, this field is ignored.
def enabled(self) -> Optional[pulumi.Input[bool]]: warnings.warn("""This field is deprecated. Leave this unset and instead configure BinaryAuthorization using evaluation_mode. If evaluation_mode is set to anything other than EVALUATION_MODE_UNSPECIFIED, this field is ignored.""", DeprecationWarning) pul...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(__self__, *,\n enabled: Optional[pulumi.Input[bool]] = None,\n evaluation_mode: Optional[pulumi.Input['BinaryAuthorizationEvaluationMode']] = None):\n if enabled is not None:\n warnings.warn(\"\"\"This field is deprecated. Leave this unset and instead ...
[ "0.8132143", "0.6803469", "0.55793554", "0.5579164", "0.4852749", "0.48117784", "0.47908556", "0.4617451", "0.45631117", "0.45353624", "0.44183743", "0.43746224", "0.42730844", "0.42720217", "0.42677683", "0.4259761", "0.42459857", "0.4240406", "0.42338163", "0.4214717", "0.4...
0.74069196
1
CidrBlock contains an optional name and one CIDR block.
def __init__(__self__, *, cidr_block: Optional[pulumi.Input[str]] = None, display_name: Optional[pulumi.Input[str]] = None): if cidr_block is not None: pulumi.set(__self__, "cidr_block", cidr_block) if display_name is not None: pulumi.set(__self_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cidr_block(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"cidr_block\")", "def cidr_blocks(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['CidrBlockArgs']]]]:\n return pulumi.get(self, \"cidr_blocks\")", "def ipv4_cidr_block(self) -> Optional[pulumi.Input[str]]:\n ...
[ "0.72494173", "0.69008994", "0.652641", "0.6459805", "0.6427073", "0.63278306", "0.6290132", "0.6216575", "0.61874634", "0.58915496", "0.58310604", "0.58310604", "0.57936865", "0.57326955", "0.57326955", "0.5689116", "0.5689116", "0.5676451", "0.5465345", "0.5397414", "0.5314...
0.5753289
13