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
Test that we get HTTP 404 if user does not exist /api/users/{}/photos
def test_users_photos_view_set_get_no_user(self): # Create user user = account_models.User.objects.create_user(email='mrtest@mypapaya.io', password='pass', username='aov_hov') # Simulate auth token = test_helpers.get_token_for_user(user) # Get data from endpoint client ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_users_photos_view_set_get_no_photos(self):\n # Create user\n user = account_models.User.objects.create_user(email='mrtest@mypapaya.io', password='pass', username='aov_hov')\n\n # Simulate auth\n token = test_helpers.get_token_for_user(user)\n\n # Get data from endpoint\n...
[ "0.76269954", "0.73762774", "0.73578393", "0.7335623", "0.72823584", "0.72040904", "0.71610665", "0.7003545", "0.69843745", "0.69487005", "0.68674755", "0.6854237", "0.6848604", "0.68369", "0.68096113", "0.677336", "0.6742478", "0.6694888", "0.6610835", "0.6531746", "0.652792...
0.83539903
0
Tranforms vector y of labels to onehot encoded matrix
def one_hot(self, y): one_hot = np.zeros((self.n_samples, self.n_classes)) # using np.array to select elements of another np.array # first diemention index # np.arange(self.n_samples) : (1, n_samples) # row vectors (0,1,2.....n_samples-1) # second dimention index ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def conv_y_to_onehot_mat(labels):\n one_idx = np.array(labels)\n nkind = len(np.unique(one_idx))\n nlabels = len(one_idx)\n\n ret = np.zeros((nkind, nlabels))\n ret[one_idx, np.arange(nlabels)] = 1\n return ret", "def onehot_encode_labels(y):\n\treturn OneHotEncoder(categories=\"auto\", sparse=...
[ "0.832859", "0.80702674", "0.79527825", "0.79276866", "0.78602135", "0.7858826", "0.7835727", "0.7730447", "0.76075125", "0.76075125", "0.7577", "0.75750107", "0.75608104", "0.75298584", "0.7508805", "0.7483317", "0.747782", "0.74323756", "0.741743", "0.74127764", "0.74104047...
0.7556181
13
Computes the precision for the specified values of k
def precision(output, target, topk=(1,)): maxk = max(topk) batch_size = target.size(0) _, pred = output.topk(maxk, 1, True, True) pred = pred.t() correct = pred.eq(target.view(1, -1).expand_as(pred)) res = [] for k in topk: correct_k = correct[:k].view(-1).float().sum(0) re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def precision(gt, pred, k):\n k = min(len(pred), k)\n den = min(len(gt), k)\n return sum([int(pred[i] in gt) for i in range(k)]) / den", "def precision_at_k(r, k):\n assert k >= 1\n r = np.asarray(r)[:k] != 0\n if r.size != k:\n raise ValueError('Relevance score length < k')\...
[ "0.76427615", "0.74189496", "0.7418079", "0.72710466", "0.72456723", "0.72446615", "0.7237539", "0.72213703", "0.7210107", "0.7058935", "0.6852219", "0.6786084", "0.67836976", "0.6768417", "0.67181736", "0.67181736", "0.67181736", "0.67181736", "0.67181736", "0.67181736", "0....
0.67273885
14
Adjusts the learning rate every epoch based on the selected schedule
def adjust_learning_rate(opt, optimizer, epoch): epoch = copy.deepcopy(epoch) lr = opt.maxlr wd = opt.weightDecay if opt.learningratescheduler == 'imagenetscheduler': if epoch >= 1 and epoch <= 18: lr = 1e-3 wd = 5e-5 elif epoch >= 19 and epoch <= 29: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_learning_rate(self):\r\n self.scheduler.step(self.clock.epoch)", "def learning_rate_schedule(current_epoch,\n current_batch,\n batches_per_epoch,\n batch_size):\n del current_batch, batches_per_epoch # not used\n i...
[ "0.819159", "0.8061095", "0.8002219", "0.79933065", "0.787285", "0.78709096", "0.78709096", "0.7857081", "0.78424907", "0.7793947", "0.7783441", "0.777311", "0.7748275", "0.7703469", "0.7651359", "0.76494527", "0.76432353", "0.7626649", "0.76263005", "0.76047295", "0.75994474...
0.7274318
68
Return the name of the Daikin Skyport sensor.
def name(self): return self._name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_sensor_name(self):\n return self.data[1]", "def name(self):\n return self._sensor.name", "def name(self):\n return self.device.device_data[self.device_id]['name'] + \\\n f' {self._sensor_type}'", "def name(self):\n return f\"{self._name} {SENSOR_TYPES[self.senso...
[ "0.77824974", "0.77624327", "0.72659254", "0.70721763", "0.70537233", "0.7033882", "0.69959414", "0.69775724", "0.69715387", "0.69558", "0.69121265", "0.6607646", "0.6555332", "0.64474416", "0.6316917", "0.6296099", "0.62794244", "0.62794244", "0.62692255", "0.62634", "0.6229...
0.0
-1
Return the device class of the sensor.
def device_class(self): if self._type in SENSOR_TYPES: return self._type return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def device_class(self):\n return self.sensor_type[\"class\"]", "def device_class(self):\n return SENSOR_TYPES[self.sensor][3].get(\"device_class\")", "def device_class(self):\n return self._sensor_type", "def device_class(self):\r\n return self._sensor_cfg[3]", "def device_class...
[ "0.93628424", "0.92430294", "0.9240069", "0.9161452", "0.9161452", "0.9156968", "0.90412056", "0.90412056", "0.8956785", "0.89529496", "0.8950599", "0.8919914", "0.8717259", "0.87069035", "0.8660478", "0.8652474", "0.83961546", "0.83828783", "0.8380708", "0.8380708", "0.83807...
0.871994
12
Get the latest state of the sensor.
def update(self): self.data.update() for sensor in self.data.daikinskyport.get_sensors(self._index): if sensor["type"] == self._type and self._sensor_name == sensor["name"]: self._state = sensor["value"]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def state(self):\n if self.coordinator.data:\n return self.coordinator.data[self._sensor]", "def state(self):\n if self.ticker.values is not None:\n return round(\n float(\n self.ticker.values.get(\"last\")\n ),\n ...
[ "0.753419", "0.74876356", "0.74765736", "0.72214586", "0.7112677", "0.6995063", "0.69775915", "0.6945787", "0.69136775", "0.68911135", "0.68863803", "0.6863116", "0.6858303", "0.6834618", "0.6774382", "0.67590016", "0.6746638", "0.6699024", "0.6691935", "0.6685089", "0.666090...
0.0
-1
Test `CONTENTLENGTH` HTTP header with nonascii characters.
def test_content_length() -> None: assert "CONTENT-LENGTH: 3" in Fauxmo.add_http_headers("foo") assert "CONTENT-LENGTH: 4" in Fauxmo.add_http_headers("föo")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_contentLength(self):\n resource = self.eventSourceResource()\n response = self.render(resource)\n\n self.assertEquals(\n response.headers.getRawHeaders(b\"Content-Length\"),\n None\n )", "def test_response_no_charset_with_ascii_content():\n content = ...
[ "0.66312027", "0.66078043", "0.6549578", "0.64147097", "0.63681847", "0.6307014", "0.6262416", "0.6202364", "0.6181332", "0.6129173", "0.60961133", "0.6081263", "0.60671216", "0.6061516", "0.60059905", "0.6005708", "0.6000909", "0.5966614", "0.59613824", "0.59385115", "0.5928...
0.7927811
0
Sets the start_day_date of this DayTrendInput.
def start_day_date(self, start_day_date): if start_day_date is None: raise ValueError("Invalid value for `start_day_date`, must not be `None`") # noqa: E501 self._start_day_date = start_day_date
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_start_date(self, start_date):\n self.set_value_into_input_field(self.start_date_inputbox_locator, start_date)", "def set_start_date(self, date):\n pass", "def start_date(self, start_date):\n \n self._start_date = start_date", "def start_date(self, start_date):\n\n s...
[ "0.76019293", "0.7512831", "0.75060135", "0.7447539", "0.7447539", "0.7447539", "0.7447539", "0.7447539", "0.7447539", "0.7447539", "0.7447539", "0.7447539", "0.74180686", "0.7405199", "0.7270857", "0.7167501", "0.7067407", "0.6699592", "0.66464996", "0.65088", "0.64305073", ...
0.80817527
1
Sets the stop_day_date of this DayTrendInput.
def stop_day_date(self, stop_day_date): if stop_day_date is None: raise ValueError("Invalid value for `stop_day_date`, must not be `None`") # noqa: E501 self._stop_day_date = stop_day_date
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_Day(self, value):\n super(GetTimestampFromDateParametersInputSet, self)._set_input('Day', value)", "def model_end_date(self, model_end_date):\n\n self._model_end_date = model_end_date", "def setDay(self, *args):\n return _libsbml.Date_setDay(self, *args)", "def set_end_date(self,...
[ "0.5830688", "0.5702961", "0.5699993", "0.5519773", "0.5478746", "0.5478746", "0.5478746", "0.5478746", "0.5478746", "0.5478746", "0.5478746", "0.5478746", "0.5441288", "0.5357725", "0.526422", "0.5257766", "0.5239948", "0.52314043", "0.51824653", "0.51824653", "0.5176137", ...
0.7989409
1
Sets the unit of this DayTrendInput.
def unit(self, unit): if unit is None: raise ValueError("Invalid value for `unit`, must not be `None`") # noqa: E501 allowed_values = ["percent", "unit"] # noqa: E501 if unit not in allowed_values: raise ValueError( "Invalid value for `unit` ({0}), must ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_unit(self,unit):\n self.unit = unit", "def unit(self, unit):\n if unit is None:\n raise ValueError(\"Invalid value for `unit`, must not be `None`\") # noqa: E501\n\n self._unit = unit", "def set_units(self, units):\n self.units = units", "def unit_type(self, un...
[ "0.69522494", "0.6503275", "0.6375011", "0.5973234", "0.59613425", "0.59613425", "0.59613425", "0.58967817", "0.5889665", "0.58807516", "0.58604324", "0.5857654", "0.5821351", "0.5821351", "0.5821351", "0.5781594", "0.5753029", "0.57411665", "0.5732448", "0.57184976", "0.5718...
0.60232496
4
Sets the value of this DayTrendInput.
def value(self, value): if value is None: raise ValueError("Invalid value for `value`, must not be `None`") # noqa: E501 self._value = value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_Day(self, value):\n super(GetTimestampFromDateParametersInputSet, self)._set_input('Day', value)", "def setDay(self, *args):\n return _libsbml.Date_setDay(self, *args)", "def setValue(self,val):\n self.input.setValues(val)", "def date(self, value):\n self.date_value = valu...
[ "0.65252745", "0.58669275", "0.577394", "0.57680964", "0.57389534", "0.571612", "0.57107055", "0.5665308", "0.5634005", "0.5597081", "0.5597081", "0.55712396", "0.55702084", "0.5563971", "0.5563971", "0.5556599", "0.5541393", "0.5519808", "0.55102617", "0.54962176", "0.549621...
0.0
-1
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, DayTrendInput): 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
Environment variable through which to access compute settings.
def compute_env_var(self): return COMPUTE_SETTINGS_VARNAME
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __getitem__(self, key):\n return os.environ[key]", "def __getitem__(self, name):\n return os.environ[name]", "def env(var):\n return os.environ[var]", "def get(self):\n self.value = os.getenv(self.name, self.default)\n return self.value", "def getenv(self, var):\n ...
[ "0.7054179", "0.6951504", "0.67896175", "0.6767603", "0.6677155", "0.6637686", "0.6535489", "0.6397796", "0.6360441", "0.6355434", "0.6318841", "0.63010055", "0.627669", "0.6241115", "0.6209582", "0.61961704", "0.6172982", "0.6167309", "0.6164459", "0.6159575", "0.6137914", ...
0.7752869
0
Path to default compute environment settings file.
def default_config_file(self): return DEFAULT_CONFIG_FILEPATH
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def default_path():\n return os.path.join(os.environ.get('OVERRIDE_ETC', '/etc'), 'auth')", "def get_local_default_file(cwd=None):\n # TODO(dittrich): May need to do this differently to support\n # Windows file systems.\n if cwd is None:\n cwd = os.getcwd()\n return Path(cwd) / '.python_sec...
[ "0.7463784", "0.7353163", "0.72213894", "0.69353837", "0.69350094", "0.68638635", "0.6851823", "0.67826015", "0.6734199", "0.6706078", "0.66723883", "0.66552407", "0.66322607", "0.66249883", "0.66054356", "0.66035", "0.65886766", "0.65657455", "0.6555468", "0.65513057", "0.64...
0.72803855
2
Get the currently active submission template.
def template(self): with open(self.compute.submission_template, "r") as f: return f.read()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_template(self):\n return self.template", "def template(self):\n template_names = self.get_template_names()\n if template_names:\n return template_names[0]\n return None", "def template(self):\n return self._template", "def template(self):\n return ...
[ "0.745584", "0.72694725", "0.7065729", "0.7065729", "0.7065729", "0.6785707", "0.65768933", "0.6463035", "0.6420406", "0.6385554", "0.63380706", "0.6334265", "0.62989163", "0.6285235", "0.62009", "0.61707306", "0.61374605", "0.61360836", "0.61270684", "0.6099739", "0.6094069"...
0.69382983
5
Path to folder with default submission templates.
def templates_folder(self): return os.path.join( os.path.dirname(__file__), "default_config", "divvy_templates" )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def template_path(self):\n return self.get_config(\"templates\")", "def __default_pptx_path(self):\n thisdir = os.path.split(__file__)[0]\n return os.path.join(thisdir, 'templates', 'default.pptx')", "def template_dir(self):\n return self.cm.get(YAML_CONFIG_TEMPLATE_DIR)", "def te...
[ "0.72251683", "0.70974743", "0.69025606", "0.6791139", "0.6746078", "0.67062426", "0.6664162", "0.66129124", "0.6546267", "0.65448135", "0.6357716", "0.63424534", "0.6316139", "0.62940246", "0.6223567", "0.620808", "0.61770606", "0.6169242", "0.61643684", "0.6160789", "0.6154...
0.7511769
0
Returns settings for the currently active compute package
def get_active_package(self): return self.compute
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getSettings(self):\n return self.cfg", "def get_settings(self):\n return self.settings", "def settings():\n return _get_settings()[1]", "def getCurrentSetting(self):\n return {}", "def current_settings(self):\n return {\n 'power_state': self.power_state,\n ...
[ "0.6665331", "0.64190954", "0.6353241", "0.6294257", "0.6268071", "0.61852217", "0.61203176", "0.61203176", "0.6099926", "0.6099926", "0.6079283", "0.6031631", "0.6017949", "0.59773076", "0.5945558", "0.5911911", "0.58727074", "0.5846969", "0.58450425", "0.58397514", "0.58295...
0.66402924
1
Create a yaml file that is readable from syn++
def create_synpp_yaml(radial1d_mdl, fname, shell_no=0, lines_db=None): logger.warning('Currently only works with Si and a special setup') if radial1d_mdl.atom_data.synpp_refs is not None: raise ValueError( 'The current atom dataset does not contain the ' 'necessary reference fil...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_create_yaml(self):\n pass", "def conversion_yaml():\r\n data ={\r\n 'name': 'george',\r\n 'age': 16,\r\n 'friends':\r\n [{'name': 'marry', 'age': 16}, {'name': 'jack', 'age': 17}]\r\n }\r\n yaml_data = yaml.dump(data)\r\n dirname = os.path.dirname(os.path.d...
[ "0.7375023", "0.68154037", "0.6794732", "0.6730538", "0.6690825", "0.6668042", "0.66404045", "0.6546248", "0.65274316", "0.6508424", "0.64678276", "0.6444203", "0.64191157", "0.6412355", "0.6396586", "0.6352065", "0.63479996", "0.6320528", "0.6315012", "0.6254327", "0.6207214...
0.6905636
1
Convert a species string to its corresponding tuple representation
def species_string_to_tuple(species_string): try: element_symbol, ion_number_string = re.match(r'^(\w+)\s*(\d+)', species_string).groups() except AttributeError: try: element_symbol, ion_number_string = species_string.split() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_to_tuple(self, tuple_str):\n return ast.literal_eval(tuple_str)", "def _point_as_tuple(input_string: str) -> _Tuple[float]:\n out = tuple(float(coordinate) for coordinate in input_string.split(','))\n if len(out) == DIMENSIONS:\n return out\n raise TypeError", "def str2tuple(...
[ "0.61903316", "0.60827345", "0.60735154", "0.6070913", "0.6016619", "0.6000554", "0.598306", "0.59710866", "0.5958342", "0.5922893", "0.57688755", "0.57461584", "0.571913", "0.5691378", "0.5686492", "0.56632787", "0.5653208", "0.56343883", "0.5628546", "0.55267763", "0.545232...
0.73020494
0
Reformat the string so the first letter is uppercase and all subsequent letters lowercase.
def reformat_element_symbol(element_string): return element_string[0].upper() + element_string[1:].lower()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def capitalize1(s):\n return s[:1].upper() + s[1:]", "def camel(s):\n return s[0].upper() + s[1:]", "def uppersnakecase(string):\n\n return uppercase(snakecase(string))", "def to_camel_case(string: str, first_lower: bool = False) -> str:\n if first_lower:\n first, _, rest = string.partitio...
[ "0.72718453", "0.7118829", "0.7050874", "0.70485324", "0.7014853", "0.6990039", "0.69769514", "0.6970745", "0.6953493", "0.6864605", "0.68444556", "0.6813772", "0.6783451", "0.67646015", "0.6745367", "0.67117923", "0.67116195", "0.6706046", "0.6706046", "0.67035097", "0.66915...
0.0
-1
Return current muted state.
def muted(self) -> bool: return self._muted
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_volume_muted(self):\n return self._state.get(\"mute\", None)", "def is_muted(self):\n # type: () -> bool\n return self._is_muted", "def is_volume_muted(self):\n return self._muted", "def is_volume_muted(self):\n return self._muted", "def is_volume_muted(self):\n ...
[ "0.7391127", "0.7318638", "0.71810913", "0.71810913", "0.71810913", "0.7133828", "0.71251386", "0.70977485", "0.70923793", "0.700781", "0.68994504", "0.6669731", "0.6659617", "0.66306776", "0.6433662", "0.63675123", "0.6311905", "0.6288667", "0.6288172", "0.61824715", "0.6143...
0.78242445
0
Return current channel name.
def channel_name(self) -> str: return self._channel_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def channel_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"channel_name\")", "def channel_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"channel_name\")", "def channel_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"channel_name\")", "def channel_...
[ "0.8172932", "0.8172932", "0.8172932", "0.8172932", "0.8172932", "0.8172932", "0.8172932", "0.8172932", "0.8172932", "0.8172932", "0.8172932", "0.8172932", "0.8172932", "0.8172932", "0.8172932", "0.8172932", "0.8172932", "0.8172932", "0.8172932", "0.8024983", "0.7765092", "...
0.8783594
0
Determine the platforms to generate projects for. Scan the build_rules.py file for the variable PROJECT_PLATFORM, and if found use that list of PlatformTypes or strings to lookup with PlatformTypes.lookup().
def get_platform(build_rules_list, verbose=False, platform=None): # Make sure the input is PlatformTypes if platform: platform = PlatformTypes.lookup(platform) # If it's not, search the build_rules for it if not isinstance(platform, PlatformTypes): # Check build_rules.py platf...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_platforms(self):\n if self.platform == 'All':\n return PLATFORMS\n else:\n return self.platform.split(':')", "def Platforms():\n return platforms", "def platforms(self) -> Any:\n\n return search_api(\"platforms\")", "def get_platform():\r\n platforms = [...
[ "0.72861755", "0.72261065", "0.67670405", "0.67277205", "0.6698047", "0.6620653", "0.65766364", "0.6475965", "0.6474783", "0.6418077", "0.6413042", "0.6290658", "0.62844545", "0.61585474", "0.612295", "0.61207044", "0.609062", "0.6090479", "0.60852396", "0.60632175", "0.60632...
0.75384194
0
Returns the patient full name
def get_name(self): return "%s %s" % ( self.first_name, self.last_name )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_full_name(self):\n full_name = '{0} {1} {2}'.format(self.last_name, self.first_name, self.patronymic)\n return full_name.strip()", "def get_patient_name(patient_bundle):\n names = patient_bundle['name']\n for name in names:\n if (name['use'] == 'official'):\n str = '...
[ "0.8142956", "0.7982782", "0.7975318", "0.79698807", "0.79370236", "0.79248863", "0.79132646", "0.79132646", "0.78673553", "0.78673553", "0.78673553", "0.78673553", "0.78673553", "0.78673553", "0.78673553", "0.78673553", "0.78673553", "0.78673553", "0.78673553", "0.78673553", ...
0.0
-1
Returns the patient age as a string
def get_age(self): today = datetime.now() return today.year \ - self.date_of_birth.year \ - ((today.month, self.date_of_birth.day) \ < (self.date_of_birth.month, self.date_of_birth.day))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def age(self):\n\n years, months, days = calculate_age(self.birthdate)\n if years:\n return \"%d year%s old\" % (years, \"s\" if years > 1 else \"\")\n elif months:\n return \"%d month%s old\" % (months, \"s\" if months > 1 else \"\")\n else:\n return \"...
[ "0.8035565", "0.75170165", "0.74285823", "0.72514933", "0.7248551", "0.7244524", "0.72393316", "0.7217577", "0.71936685", "0.71618754", "0.71560526", "0.71560526", "0.71560526", "0.71296006", "0.7092915", "0.7076271", "0.7057924", "0.7049839", "0.703297", "0.6966076", "0.6963...
0.6784251
24
Convert string of letters to list of ints.
def letter_to_num(string, dict_): patt = re.compile('[' + ''.join(dict_.keys()) + ']') num_string = patt.sub(lambda m: dict_[m.group(0)] + ' ', string) num = [int(i) for i in num_string.split()] return num
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stringToInts(string):\r\n ints=[];\r\n for char in string:\r\n ints.append(charToInt(char));\r\n return ints;", "def string_to_numbers(str):\n return [ord(ch) - ord(\"a\") for ch in str]", "def convert_str_input_into_list_of_int(guess_input):\n guess = list(guess_input)\n guess = [...
[ "0.8121091", "0.79555094", "0.71599114", "0.7147325", "0.71410745", "0.70988005", "0.7084976", "0.7076829", "0.70747817", "0.7069736", "0.7012748", "0.69850415", "0.6984709", "0.697921", "0.6944504", "0.6911245", "0.6866237", "0.683719", "0.6836756", "0.6836756", "0.6836756",...
0.6298521
41
List the nodes reachable in one step from this node.
def expand(self, problem): return [self.child(problem, action) for action in problem.actions(self.state)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nodes(self):\n return list(self.__graph.keys())", "def nodes(self):\n return self.graph.nodes", "def nodes (self):\n return self.__nodes", "def get_visited_nodes(self):\n return self.visited_nodes", "def nodes(self):\n return self.__nodes", "def get_nodes(self):...
[ "0.6938095", "0.69364226", "0.68794554", "0.6876224", "0.6868451", "0.682644", "0.6809286", "0.6809286", "0.6809286", "0.6808933", "0.6763133", "0.67613614", "0.6742428", "0.6725352", "0.6722032", "0.6684851", "0.6649455", "0.6630917", "0.66175693", "0.66077346", "0.65624684"...
0.0
-1
Return a list of actions executable in this state.
def actions(self, state): raise NotImplementedError # Override this!
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def actions(self) -> list:\n if self.debug: print(f\"AState.actions()\")\n if not self._examined:\n if self.debug: print(f\"\\tExamining...\")\n self._actions = self._generate_actions()\n self._examined = True\n return self._actions", "def get_list_of_actions...
[ "0.84870625", "0.8423679", "0.8289956", "0.81267136", "0.8035856", "0.80025005", "0.7984825", "0.7984122", "0.7945477", "0.7945477", "0.79125595", "0.7827493", "0.78011674", "0.7584649", "0.753585", "0.7520459", "0.75195354", "0.75195354", "0.75195354", "0.7458631", "0.745135...
0.6610965
80
The state that results from executing this action in this state.
def result(self, state, action): raise NotImplementedError # Override this!
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def state(self):\n result = self.getResult()\n return result.state", "def state(self):\n return get_state(self.context)", "def state(self):\n return self._state()", "def return_state(self):\n\t\treturn self.state", "def state(self):\n return self.get_state()", "def sta...
[ "0.82855654", "0.80337864", "0.790677", "0.7805141", "0.7782963", "0.77446437", "0.77446437", "0.7715299", "0.7715299", "0.7715299", "0.77140856", "0.7701688", "0.7701688", "0.7701688", "0.7701688", "0.7701688", "0.7701688", "0.7701688", "0.7701688", "0.7701688", "0.7701688",...
0.0
-1
Normalize dataset, and make mean value be 0 and variance be 1.
def normalize(dataset): minVals = dataset.min(axis=0) maxVals = dataset.max(axis=0) factors = maxVals-minVals num = dataset.shape[0] norm_data = (dataset - np.tile(minVals,(num,1)))/np.tile(factors,(num,1)) return norm_data
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normalize(dataset):\n return normalize_standard_deviation(normalize_mean(dataset))", "def normalize_data(data):\n mean = np.mean(data)\n std = np.std(data)\n return (data - mean) / std", "def normalize_data(self):\n self.x_mean, self.x_std = du.get_mean_std(self.x_train)\n self.x_...
[ "0.8087341", "0.77475476", "0.77039194", "0.7661965", "0.7661965", "0.7616042", "0.759305", "0.7490796", "0.7445253", "0.7428843", "0.74176353", "0.733317", "0.7282569", "0.72576284", "0.7238101", "0.7215192", "0.7159026", "0.7131508", "0.7111009", "0.70977306", "0.7082351", ...
0.70589536
23
Provides the color corresponding to value `x` in the form of a tuple (R,G,B,A) with float values between 0. and 1.
def rgba_floats_tuple(self, x): if x <= self.index[0]: return self.colors[0] if x >= self.index[-1]: return self.colors[-1] i = len([u for u in self.index if u < x]) # 0 < i < n. if self.index[i - 1] < self.index[i]: p = (x - self.index[i - 1]) * 1.0...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def int2color_tuple(x):\n red_val = int(1000 * x % 255)\n green_val = int(10000 * x % 255)\n blue_val = int(100000 * x % 255)\n return red_val, green_val, blue_val", "def rgba_floats_tuple(self, x):\n if x <= self.index[0]:\n return self.colors[0]\n if x >= self.index[-1]:\n ...
[ "0.77491224", "0.7438679", "0.7299516", "0.7198613", "0.68818754", "0.6812539", "0.6665866", "0.6638309", "0.64855623", "0.6476334", "0.6438518", "0.6425014", "0.6408482", "0.638992", "0.63414437", "0.6269187", "0.6256735", "0.62101454", "0.6194749", "0.61873806", "0.61656284...
0.7347677
2
Provides the color corresponding to value `x` in the form of a tuple (R,G,B,A) with float values between 0. and 1.
def rgba_floats_tuple(self, x): if x <= self.index[0]: return self.colors[0] if x >= self.index[-1]: return self.colors[-1] i = len([u for u in self.index if u < x]) # 0 < i < n. return tuple(self.colors[i - 1])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def int2color_tuple(x):\n red_val = int(1000 * x % 255)\n green_val = int(10000 * x % 255)\n blue_val = int(100000 * x % 255)\n return red_val, green_val, blue_val", "def rgba_floats_tuple(self, x):\n if x <= self.index[0]:\n return self.colors[0]\n if x >= self.index[-1]:\n ...
[ "0.7747779", "0.7347749", "0.72987974", "0.7199239", "0.6882619", "0.68135065", "0.6665508", "0.6638103", "0.64860904", "0.647651", "0.6438813", "0.64248556", "0.64094275", "0.638981", "0.63395035", "0.62716043", "0.62565523", "0.62081087", "0.61937696", "0.6189252", "0.6166"...
0.7438219
1
Transforms the StepColormap into a LinearColormap.
def to_linear(self, index=None, max_labels=10): if index is None: n = len(self.index) - 1 index = [ self.index[i] * (1.0 - i / (n - 1.0)) + self.index[i + 1] * i / (n - 1.0) for i in range(n) ] colors = [self.rgba_float...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _linear_cmap(a, b):\n a = matplotlib.colors.colorConverter.to_rgb(a)\n b = matplotlib.colors.colorConverter.to_rgb(b)\n a_linear = _gamma_expand(a)\n b_linear = _gamma_expand(b)\n color_diff = a_linear - b_linear\n palette = (np.linspace(0, 1, 256).reshape((-1, 1))\n * color_dif...
[ "0.6798547", "0.60150003", "0.59759045", "0.59223056", "0.5781109", "0.5759297", "0.57328314", "0.57292086", "0.5710134", "0.57054746", "0.57054746", "0.56976503", "0.56782645", "0.56782645", "0.56579196", "0.5612364", "0.558279", "0.5567779", "0.55352366", "0.55352366", "0.5...
0.6450575
1
Get default locale language.
def getDefaultLocaleLanguage(): # Setup textdomain try: locale.bindtextdomain(TEXT_DOMAIN, DEFAULT_LOCALE_PATH) except AttributeError: log_func.warning(u'Locale module not support text domain') language = locale.getlocale()[0] if sys_func.isWindowsPlatform(): if language in...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_default_language():\n utility = queryUtility(ILanguageAvailability)\n if utility is not None:\n return utility.getDefaultLanguage()\n return DEFAULT_LANGUAGE", "def get_locale():\n setting = Setting.query.filter(Setting.name == 'default_language').first()\n\n if setting is not None:...
[ "0.8806502", "0.8511884", "0.84435046", "0.8390333", "0.82615143", "0.80907863", "0.80733293", "0.80733293", "0.7982567", "0.7849862", "0.7790147", "0.77649754", "0.7622426", "0.7550711", "0.7549446", "0.7514336", "0.75066143", "0.7499912", "0.74473447", "0.7443539", "0.74257...
0.86924046
1
Euclidean distance function between two supplied points. The Euclidean distance is simply ((x2x1)2 + (y2y1)2).
def euclidean_distance(x1, x2): return (x2[0] - x1[0])**2 + (x2[1] - x1[1])**2
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def euclidean_distance(x1, y1, x2, y2):\n distance = math.sqrt(((x2 - x1) ** 2) + ((y2 - y1) ** 2))\n return distance", "def euclidean_distance(point1, point2):\n\n return math.sqrt(sum([(x - y) ** 2 for x, y in zip(point1, point2)]))", "def euclideanDistance(x1,y1,x2,y2):\n distance = math...
[ "0.84509206", "0.84427726", "0.8421938", "0.82437634", "0.81327283", "0.8026428", "0.8012625", "0.800964", "0.798044", "0.797934", "0.7979172", "0.7959731", "0.7929387", "0.7919496", "0.78987247", "0.78891903", "0.78400207", "0.7797807", "0.7764567", "0.7762364", "0.773712", ...
0.80995846
5
Returns whether a position is within one of the given gutters.
def is_in_gutter(self, position, gutterDict): for boundary, gutterSize in gutterDict.iteritems(): if boundary == 'left': return (position[0] < self.windowSize[0] + gutterSize) elif boundary == 'right': return (position[0] > self.windowSize[1] - gutterSiz...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __contains__(self, position):\n return sum([(c1 - c2) ** 2 for (c1, c2) in zip(self.position, position)]) <= self.radius", "def contains(self, coord):\n # print(coord, self.position, self.size)\n return (0 <= coord[0] - self.position[0] < self.size[0] and\n 0 <= coord[1] -...
[ "0.64025337", "0.62921816", "0.6259491", "0.62265915", "0.622561", "0.6149433", "0.61469346", "0.61428446", "0.6142041", "0.6097361", "0.6073942", "0.60585636", "0.605304", "0.6029945", "0.60214597", "0.599945", "0.5999253", "0.5988097", "0.5981967", "0.5980923", "0.59743726"...
0.6435935
0
The region this unit is in.
def region(self): if self._region is None: cache_key = self.expand_name("region") cached = unitdata.kv().get(cache_key) if cached: self._region = cached else: req = self._imdv2_request(self._az_url) with urlopen(req)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def region(self):\n return self._region", "def region(self):\n return self._region", "def region(self):\n # type: () -> string_types\n return self._region", "def region(self) -> str:\n return self.__region", "def region(self):\n return self._get(\"region\")", "de...
[ "0.83963853", "0.83963853", "0.83923125", "0.82858235", "0.8077418", "0.80189663", "0.787013", "0.7859489", "0.7859489", "0.7859489", "0.7859489", "0.7859489", "0.7859489", "0.7846009", "0.7846009", "0.7846009", "0.7846009", "0.7846009", "0.7846009", "0.7747181", "0.7747181",...
0.7221213
46
Request that the given tags be applied to this instance's subnet.
def tag_instance_subnet(self, tags): self._request({"instance-subnet-tags": dict(tags)})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter_create_subnet_attributes(subnet, context):\n pass", "def post_subnet_create(self, resource_dict):\n pass", "def pre_subnet_create(self, resource_dict):\n pass", "def subnets(self, subnets):\n\n self._subnets = subnets", "def subnets(self) -> Optional[pulumi.Input[Sequ...
[ "0.6099084", "0.6041251", "0.6015124", "0.5957575", "0.5943789", "0.5934497", "0.58879864", "0.58218735", "0.5704586", "0.56935924", "0.5686137", "0.56854403", "0.5627839", "0.55640954", "0.55639124", "0.5539611", "0.5537666", "0.5516058", "0.5454166", "0.5454166", "0.5454166...
0.7888464
0
Computes the precision for the specified values of k
def accuracy(output, target, topk=(1,)): maxk = max(topk) batch_size = target.size(0) _, pred = output.topk(maxk, 1, True, True) # pred是top k的索引值 pred = pred.t() correct = pred.eq(target.view(1, -1).expand_as(pred)) # target每个样本只有一个值,表示具体类别值,expand之后比较是否相等,相等的就是对的 res = [] for k in topk: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def precision(gt, pred, k):\n k = min(len(pred), k)\n den = min(len(gt), k)\n return sum([int(pred[i] in gt) for i in range(k)]) / den", "def precision_at_k(r, k):\n assert k >= 1\n r = np.asarray(r)[:k] != 0\n if r.size != k:\n raise ValueError('Relevance score length < k')\...
[ "0.7642163", "0.7419424", "0.74185395", "0.72703105", "0.7246095", "0.72445905", "0.7237792", "0.7221482", "0.72105515", "0.70590806", "0.6851433", "0.67866427", "0.6782371", "0.6766935", "0.67267346", "0.67166984", "0.67166984", "0.67166984", "0.67166984", "0.67166984", "0.6...
0.0
-1
r""" Calculate the energy balance of the adiabatic combustion chamber.
def energy_balance_func_doc(self, label): latex = ( r'\begin{split}' + '\n' r'0 = & \sum_i \dot{m}_{\mathrm{in,}i} \cdot\left( ' r'h_{\mathrm{in,}i} - h_{\mathrm{in,}i\mathrm{,ref}} \right) -' r'\dot{m}_\mathrm{out,1}\cdot\left( h_\mathrm{out,1}' r' - ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def elec_balance(index):\n t = index[0]\n return (\n pulp.lpSum([component_output[i, t] for i in index_elec_out])\n - pulp.lpSum([component_input[i, t] for i in index_elec_in])\n + elec_from_grid[t]\n - elec_to_grid[t]\n + pulp.lpSum([storage_dis...
[ "0.6442582", "0.6159527", "0.5971197", "0.59622884", "0.59230274", "0.59006584", "0.5876505", "0.581853", "0.58073527", "0.5806609", "0.5757328", "0.57550776", "0.5746388", "0.57268274", "0.5698147", "0.56885093", "0.5679078", "0.5674106", "0.56719196", "0.5664596", "0.565192...
0.0
-1
r""" Calculate the residual for specified lambda. Returns
def lambda_func(self): air = self.air_alias.val fuel = self.fuel_alias.val m_air = 0 m_fuel = 0 for i in self.inl: m_air += (i.m.val_SI * i.fluid.val[air]) m_fuel += (i.m.val_SI * i.fluid.val[fuel]) return self.lamb.val - m_air / (m_fuel * self....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lambda_(s, x_r):\n return LAMBDA / linalg.norm(np.array(s) - np.array(x_r))", "def ridge_regression(y, tx, lambda_):\n N = tx.shape[0]\n a = tx.T.dot(tx) + 2 * N * lambda_ * np.identity(tx.shape[1])\n b = tx.T.dot(y)\n w = np.linalg.solve(a, b)\n loss = compute_loss_LS(y, tx, w) \n retu...
[ "0.6616674", "0.6565892", "0.6542626", "0.65119094", "0.63592213", "0.630703", "0.6299995", "0.62974364", "0.6266426", "0.62496877", "0.6249297", "0.62278664", "0.6221768", "0.6207938", "0.6182203", "0.6166103", "0.6165815", "0.6137923", "0.61320263", "0.6105455", "0.61003715...
0.63591325
5
r""" Calculate the residual for specified lambda.
def lambda_func_doc(self, label): latex = ( r'0 = \lambda - ' r'\frac{\dot{m}_\mathrm{air}}{\dot{m}_\mathrm{air,min}}' ) return generate_latex_eq(self, latex, label)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lambda_(s, x_r):\n return LAMBDA / linalg.norm(np.array(s) - np.array(x_r))", "def ridge_regression(y, tx, lambda_):\n N = tx.shape[0]\n a = tx.T.dot(tx) + 2 * N * lambda_ * np.identity(tx.shape[1])\n b = tx.T.dot(y)\n w = np.linalg.solve(a, b)\n loss = compute_loss_LS(y, tx, w) \n retu...
[ "0.66776234", "0.6574302", "0.6453366", "0.63835025", "0.62892705", "0.6280862", "0.6279301", "0.6246613", "0.62356853", "0.6234043", "0.62037617", "0.61886454", "0.6147295", "0.61430985", "0.6142888", "0.61421275", "0.6085669", "0.6051281", "0.60396767", "0.6038392", "0.6032...
0.0
-1
r""" Calculate the residual for specified thermal input.
def ti_func_doc(self, label): latex = ( r'\begin{split}' + '\n' r'0 = & ti - LHV_\mathrm{fuel} \cdot \left[\sum_i \left(' r'\dot{m}_{\mathrm{in,}i}\cdot x_{\mathrm{fuel,in,}i}\right)-' r' \dot{m}_\mathrm{out,1}\cdot ' r'x_{\mathrm{fuel,out,1}} \right]\...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def residual(us):\n return self.h_S(z0, us) - h_P", "def _residual_edp(self, params):\n data = self.F**2\n model = np.absolute(self._model())**2\n sigma = self.sigma\n return (data[self.mask]-model[self.mask]) / sigma[self.mask] \n \n # The following three lines do not reproduce ...
[ "0.7161812", "0.7010587", "0.6793334", "0.6788789", "0.67565507", "0.67365366", "0.67257804", "0.6673853", "0.66370654", "0.6476852", "0.6452746", "0.6451984", "0.6398026", "0.63512295", "0.630085", "0.6296263", "0.62922865", "0.62588125", "0.6245017", "0.6218177", "0.6209879...
0.0
-1
Calculate the great circle distance between two points on the earth (specified in decimal degrees)
def haversine(lon1, lat1, lon2, lat2): # convert decimal degrees to radians lon1, lat1, lon2, lat2 = map(radians, [lon1, lat1, lon2, lat2]) # haversine formula dlon = lon2 - lon1 dlat = lat2 - lat1 a = sin(dlat/2)**2 + cos(lat1) * cos(lat2) * sin(dlon/2)**2 c = 2...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def great_circle(lat_1, long_1, lat_2, long_2):\n long_1 = m.radians(long_1)\n lat_1 = m.radians(lat_1)\n long_2 = m.radians(long_2)\n lat_2 = m.radians(lat_2)\n\n d = 2 * 6367.45 * m.asin(\n m.sqrt(haversine(lat_2 - lat_1)\n + m.cos(lat_1)*m.cos(lat_2) *\n haversine(long...
[ "0.81450045", "0.7863265", "0.76322985", "0.76064754", "0.75978696", "0.75965863", "0.75944835", "0.75720793", "0.75630087", "0.7555095", "0.7528691", "0.7517629", "0.7492963", "0.7467739", "0.7452678", "0.7434477", "0.73914117", "0.7357736", "0.73484355", "0.73318124", "0.73...
0.0
-1
Check to see if this is a stringlike or a (nested) iterable of stringlikes
def _isstr(value): if isinstance(value, string_types + (bytes,)): return True elif hasattr(value, "__iter__"): return all(_isstr(v) for v in value) else: return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _is_non_string_iterable(value):\n if isinstance(value, str):\n return False\n if hasattr(value, '__iter__'):\n return True\n if isinstance(value, collections.abc.Sequence):\n return True\n return False", "def nonstringiter(obj):\n return not isinstance(obj, string_types) a...
[ "0.72428274", "0.72171485", "0.72083956", "0.72008467", "0.7089729", "0.7015876", "0.69307625", "0.6881495", "0.6836383", "0.6752062", "0.6700434", "0.6683247", "0.6610116", "0.65194815", "0.64625245", "0.64341235", "0.6416324", "0.63965875", "0.63591594", "0.63533527", "0.63...
0.64909786
14
Return number of bins including under and overflow.
def extent(self): return self._ax.extent
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bin_width(self):\n return self.bins[2] - self.bins[1]", "def getBinSize(axes, bin_numbers):\n\n size = 1\n for axis, bin_number in zip(axes, bin_numbers):\n if bin_number in (\"underflow\", \"overflow\"):\n continue\n x0, x1 = axis.getBinRange(bin_number)\n size *...
[ "0.7750689", "0.738304", "0.73406583", "0.73406583", "0.7066251", "0.7012372", "0.6963531", "0.69465446", "0.69214576", "0.6907056", "0.6897614", "0.68608177", "0.6838192", "0.68368566", "0.6833741", "0.6826703", "0.6793274", "0.6745476", "0.67451423", "0.67451423", "0.672915...
0.0
-1
An array of bin widths.
def widths(self): return self._ax.widths
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetBinWidths(self):\n binwidths = [\n self._lowbinedges[i + 1] - self._lowbinedges[i]\n for i in range(len(self._lowbinedges) - 1)\n ]\n return binwidths", "def xbinwidths(self):\n return self.binwidths[0]", "def bin_widths(self):\n\n if not self.is_...
[ "0.80188465", "0.73928386", "0.7373454", "0.73602617", "0.71042633", "0.707206", "0.6632838", "0.66175485", "0.66175485", "0.6591268", "0.64581347", "0.6428289", "0.64021605", "0.63549125", "0.616558", "0.61648107", "0.609196", "0.60516256", "0.6048703", "0.60467404", "0.6040...
0.5527155
80
Testing addEdge function in a graph with existing nodes and edges
def test_case2(self): graph = BipartiteGraph() graph.addEdge("supervisor1","student1") graph.addEdge("supervisor2","student4") graph.addEdge("supervisor3","student3") val1 = graph.getSupervisorDegree("supervisor1") graph.addEdge("supervisor1","student2") curr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_graph_lists_adds_and_lists_edges(graph_no_edges):\n graph_no_edges.add_edge(82, 34, 4)\n graph_no_edges.add_edge(99, 'AA', 6)\n assert (82, 34, 4) in graph_no_edges.edges()\n assert (99, 'AA', 6) in graph_no_edges.edges()", "def test_graph_adds_nodes_and_edges(graph_no_edges):\n graph_no_...
[ "0.80612886", "0.80108225", "0.7566157", "0.7248354", "0.72148246", "0.71671706", "0.7156825", "0.7146273", "0.7090271", "0.7065316", "0.7053003", "0.7010968", "0.6981976", "0.69605076", "0.69533634", "0.6946495", "0.69227767", "0.6915955", "0.69024616", "0.689272", "0.689201...
0.0
-1
Testing transfer function cannot transfer student if student doesn't exist in the graph
def test_case11(self): self.graph1.transferStudent("student5","supervisor1","supervisor2",self.supervisors) val1 = self.graph1.getSupervisorDegree("supervisor1") val2 = self.graph1.getStudents("supervisor3") expected = (2,['student3']) self.assertEqual((val1,val2),exp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_case17(self):\n\n result = self.graph1.studentExists(\"student5\")\n\n self.assertFalse(result)", "def test_case9(self):\n \n self.graph1.transferStudent(\"student3\",\"supervisor3\",\"supervisor2\",self.supervisors)\n val1 = self.graph1.getStudentDegree(\"student3\")\...
[ "0.70894253", "0.67729074", "0.67309105", "0.66796345", "0.66724944", "0.6644819", "0.66180044", "0.6390928", "0.62946963", "0.6265691", "0.61945325", "0.6099167", "0.59965014", "0.59340435", "0.5932144", "0.5866688", "0.5834568", "0.5826046", "0.5776168", "0.5653099", "0.564...
0.68238854
1
Testing transfer function cannot transfer student if the edge doesn't exist in the graph
def test_case12(self): self.graph1.transferStudent("student3","supervisor1","supervisor2", self.supervisors) val1 = self.graph1.getSupervisorDegree("supervisor1") val2 = self.graph1.getStudents("supervisor2") val3 = self.graph1.getStudents("supervisor1") expected = (2,['studen...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_case20(self):\n\n result = self.graph1.isEdge(\"supervisor1\",\"student5\")\n self.assertFalse(result)", "def test_case19(self):\n\n result = self.graph1.isEdge(\"supervisor5\",\"student1\")\n self.assertFalse(result)", "def test_case21(self):\n\n result= self.graph1...
[ "0.70791656", "0.703867", "0.70153457", "0.67236555", "0.6713331", "0.6602299", "0.6548398", "0.65421784", "0.6527806", "0.6452925", "0.6427017", "0.63112533", "0.62249416", "0.62155473", "0.6171191", "0.61603117", "0.6154517", "0.6146566", "0.6123639", "0.61185753", "0.60815...
0.57199085
47
Overplot a fitted model if available
def plot_fitmodel(extdata, alax=False, yoffset=0, res=False, wavenum=False): # plot a fitted model if available if extdata.model: if extdata.model["type"] == "pow_elx": # in this case, fitted amplitude must be multiplied by A(V) to get the "combined" model amplitude labeltxt = r"...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_model_fits(self, x_test, plot_opts=dict()):\n \n cmodel_color = plot_opts.get('cmodel_color', 'black')\n dmodel_pre_color = plot_opts.get('dmodel_pre_color', '#cc7d21')\n dmodel_post_color = plot_opts.get('dmodel_post_color', '#0e2b4d')\n ...
[ "0.6909985", "0.6666314", "0.6605309", "0.66027224", "0.65946746", "0.6532544", "0.6477706", "0.64740866", "0.6375264", "0.6326308", "0.6323008", "0.62992734", "0.6295812", "0.6273819", "0.6231029", "0.6206302", "0.6184723", "0.61414194", "0.60699487", "0.6064143", "0.6062416...
0.6981773
0
return a dict whose key is word and value is the number which represents this word
def loadVoc(vocabFName): f = open(vocabFName, 'r') lines = f.readlines() f.close() result = dict() for idx, val in enumerate(lines): word = val.strip('\n') result[word] = idx return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def word_to_number(nb_word):\n return {\n \"Zero\": 0,\n \"One\": 1,\n \"Two\": 2,\n \"Three\": 3,\n \"Four\": 4,\n \"Five\": 5,\n }[nb_word]", "def make_word_num_map(words):\n\tword_num_map = dict()\n\tfor word in words:\n\t\tword_num_map[word] = word_num_map.get(...
[ "0.77705324", "0.7445702", "0.7418505", "0.74160606", "0.74157876", "0.7268713", "0.7161678", "0.7133519", "0.70001477", "0.69904184", "0.69216573", "0.68651825", "0.68475056", "0.6800963", "0.6792903", "0.67928314", "0.67880124", "0.6772567", "0.67563635", "0.6755108", "0.67...
0.0
-1
Calculates IoU of the given box with the array of the given boxes.
def compute_iou(box, boxes): # Calculate intersection areas iou = [box.intersection(b).area / box.union(b).area for b in boxes] return np.array(iou, dtype=np.float32)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_iou(box, boxes, box_area, boxes_area):\n # Calculate intersection areas\n x1 = np.maximum(box[0], boxes[:, 0])\n x2 = np.minimum(box[2], boxes[:, 2])\n y1 = np.maximum(box[1], boxes[:, 1])\n y2 = np.minimum(box[3], boxes[:, 3])\n intersection = np.maximum(x2 - x1, 0) * np.maximum(y2 -...
[ "0.81260604", "0.8114161", "0.8114161", "0.8114161", "0.8023655", "0.7985221", "0.7926201", "0.7756313", "0.7735808", "0.7709612", "0.77044445", "0.7636196", "0.7636196", "0.76361644", "0.7635449", "0.7606482", "0.75998926", "0.75998926", "0.7558036", "0.75137055", "0.7209433...
0.8231619
0
Performs nonmaximum suppression and returns indices of kept boxes.
def non_max_suppression(boxes, scores, threshold): assert boxes.shape[0] > 0 if boxes.dtype.kind != "f": boxes = boxes.astype(np.float32) polygons = convert_format(boxes) # Get indicies of boxes sorted by scores (highest first) ixs = scores.argsort()[::-1] pick = [] while len(ixs)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def non_maximum_suppression(boxes):\n\n boxes = sorted(boxes, key=lambda box: box[2]-box[0], reverse=True)\n nms_boxes = []\n overlap_threshold = 0.5\n\n for box in boxes:\n if not any([overlap_between(box, nms_box) > overlap_threshold for nms_box in nms_boxes]):\n nms_boxes.append(bo...
[ "0.7060741", "0.7059697", "0.6999214", "0.6772363", "0.67448497", "0.67037237", "0.66537005", "0.6622773", "0.6540944", "0.6513161", "0.6454274", "0.64403224", "0.64144313", "0.63784724", "0.6364835", "0.6160394", "0.614542", "0.61284935", "0.6108685", "0.6073372", "0.6069661...
0.69766814
3
Returns true if the password is acceptable
def verify_password(password): hash_pass = hashlib.sha1(password + app.config['SECRET_KEY']).hexdigest() valid = hash_pass == app.config['VALID_PASSWORD'] return valid
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def acceptable_password(password):\r\n LOG.debug(\"PASS\")\r\n LOG.debug(password)\r\n\r\n if password is not None:\r\n LOG.debug(len(password))\r\n\r\n if password is None:\r\n return False\r\n\r\n if len(password) < 3:\r\n return False\r\n\r\n ...
[ "0.8626997", "0.8173449", "0.8064324", "0.79879457", "0.7938492", "0.7895099", "0.7893177", "0.7867202", "0.78578645", "0.78498733", "0.78436583", "0.78344536", "0.78159624", "0.7793317", "0.77646565", "0.77186084", "0.7709541", "0.77019656", "0.7694611", "0.7668658", "0.7667...
0.0
-1
Wrap optimizer with sharpnessaware minimization.
def __init__(self, optimizer, rho=0.0, **kwargs): self.optimizer = optimizer self.rho = rho self.var_list = None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def accept_optimize():\n pass", "def __init__(self, optimizer):\n super(ShardedOptimizer, self).__init__(optimizer, name=\"ShardedOptimizer\")", "def propose_optimize():\n pass", "def optimizer(self) -> Optimizer | Minimizer:\n return self._optimizer", "def __init__(self,\n we...
[ "0.622211", "0.6093147", "0.6092281", "0.6015216", "0.59276354", "0.5896634", "0.5760848", "0.574989", "0.57333314", "0.56847763", "0.56780386", "0.56396306", "0.5577806", "0.55747044", "0.5572604", "0.5572113", "0.5467199", "0.54479754", "0.5432892", "0.54015595", "0.5358658...
0.0
-1
Returns all bordering grid squares of the input coordinate. A bordering square is only considered accessible if it is grass or a wooden box.
def get_tile_neighbors(self, coord_vec, box_indicator): neighbors = [] # Find the coordinates of the tiles' four neighbors neighbors.append(coord_vec + Vec2d(1, 0)) neighbors.append(coord_vec + Vec2d(-1, 0)) neighbors.append(coord_vec + Vec2d(0, 1)) neighbors.append(coord_vec +...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_box_grid(x, y):\n for grid in GRIDS:\n if x >= grid[0][0] and y >= grid[0][1] and \\\n x <= grid[1][0] and y <= grid[1][1]:\n return grid\n return None", "def squareGrid(row, col, grid):\n # position of the square box\n marker1, marker2 = (row//3)*3, (col//3)*3\n\n...
[ "0.6682782", "0.661425", "0.64772415", "0.63488865", "0.63103294", "0.62971926", "0.617214", "0.6170279", "0.6145764", "0.61442083", "0.6137298", "0.6060515", "0.60483766", "0.5990226", "0.5984543", "0.5975631", "0.59737635", "0.5968166", "0.59571385", "0.59552425", "0.592952...
0.0
-1
Function for loading an image into a numpy array Arguments image numpy array | PIL Image object | valid filepath Image to be loaded. grayscale bool, optional If True (default) and image is RGB, will convert to grayscale. dtype valid numpy datatype, optional Output images will be coerced to this datatype (default = floa...
def readImage(image, grayscale=True, dtype=float, alpha_action='mask'): # Load image if isinstance(image, np.ndarray): im = image.copy() elif isinstance(image, Image.Image): im = np.asarray(image) elif isinstance(image, str) and os.path.exists(image): im = np.asarray(imageio.imre...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_image(image_path: str, gray: bool=False) -> np.ndarray:\n if gray:\n return cv2.imread(image_path, cv2.IMREAD_GRAYSCALE)\n\n image = cv2.imread(image_path)\n return cv2.cvtColor(image, cv2.COLOR_BGR2RGB)", "def load_img(path, grayscale=False, target_size=None, num_read_attemps=1, load_to...
[ "0.67377615", "0.6587018", "0.6359007", "0.63237447", "0.6284826", "0.6282139", "0.62218076", "0.6217062", "0.62119144", "0.6180585", "0.6162503", "0.614253", "0.61239755", "0.6110352", "0.6110352", "0.6107771", "0.6102143", "0.608551", "0.6075922", "0.60708606", "0.6070453",...
0.7502626
0
Performs simple figureground segmentation. Arguments image any valid input to readImage Image to be segmented. background None | int | float, optional Background luminance value should be in range 0255. If None (default), will use most frequently occurring value in image. qplot bool, optional If True, will make a plot ...
def separate(image, background=None, qplot=False): # Error check if not (background is None or 0 <= background <= 255): raise TypeError('Background must be None or value in range 0:255') # Read image im = readImage(image, dtype=np.uint8) # Define background as mode average of image if not ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gen_background_mask( img ):\n\t\t\n\tif len( img.shape ) == 3: t = img[0]\n\telif len( img.shape ) == 2: t = img\n\n\tmask = img > filters.threshold_li(t)\n\n\treturn mask", "def region_of_interest(self, img):\n # defining a blank mask to start with\n mask = np.zeros_like(img)\n\n # de...
[ "0.61804014", "0.6070856", "0.60543877", "0.6038266", "0.5879243", "0.581441", "0.5798345", "0.5778074", "0.57558745", "0.5719373", "0.5704091", "0.5686173", "0.5641722", "0.5615278", "0.5577399", "0.5562916", "0.5529182", "0.5526037", "0.5525975", "0.5486765", "0.5466761", ...
0.69844574
0
Construct a styled object from a dictionary of styles.
def __init__(self, styles, nature): #: Dictionary of key-value pairs, where *keys* are the style names. self.styles = styles #: Cell *nature* used to distinguish the body cells, from the header and the footer. self.nature = nature
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_style_class(style=None):\n if style is None:\n style = get_color_style()\n style = validate_style(style)\n\n class StyleClass(pygments.style.Style):\n styles = {\n pygments.token.Token: style.get('Token',\n CONFIG['styles']['solarized']['Token']),\n ...
[ "0.6702983", "0.6483834", "0.63136864", "0.626945", "0.6249464", "0.6091667", "0.5903771", "0.585881", "0.58310914", "0.5757051", "0.5756805", "0.5752758", "0.57443184", "0.5718555", "0.566953", "0.5627384", "0.5495177", "0.5459493", "0.5416418", "0.54156905", "0.5410782", ...
0.5861052
7
get minimum F variable from open list
def getMinNode(self): currentNode = self.openList[0] for node in self.openList: if node.g + node.h < currentNode.g + currentNode.h: currentNode = node return currentNode
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_fmin(self):\n return self.model.predict(self.model.X)[0].min()", "def minimum_f_cell(self):\n return sorted(self.open_cells,key = lambda cell: cell.f)[0]", "def get_minimum_value_from_list(self, list_):\r\n return min(list_)", "def fmin(items):\n if len(items) == 0:\n r...
[ "0.7387441", "0.7334658", "0.726067", "0.723889", "0.72016907", "0.70941836", "0.70351267", "0.69417197", "0.6866306", "0.6866306", "0.6810077", "0.6797008", "0.6757014", "0.6755067", "0.6718572", "0.6655783", "0.6647424", "0.6607697", "0.6606145", "0.6603607", "0.6597495", ...
0.6403977
36
Get an element from a particular position. Assumeing the first position is "1". Return "None" if position is not in the list.
def get_position(self, position): current=self.head count=1 if position < 1: return None if self.head: while ((current.next )and (count<= position)): if count == position: return current current = current.next ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def element_at(ll, position):\n curr = ll.head\n i = 1\n while curr != None:\n if i == position:\n break\n i += 1\n curr = curr.link\n\n if curr == None:\n return \"Index out of range\"\n else:\n return curr.data", "def get_position(self, pos):\n ...
[ "0.7616497", "0.73450345", "0.7301503", "0.69983095", "0.6909981", "0.676553", "0.6650111", "0.6545128", "0.64756316", "0.6460315", "0.6456394", "0.6316106", "0.6304068", "0.62921375", "0.6292112", "0.62120014", "0.6208723", "0.6180921", "0.61444646", "0.61083376", "0.6100596...
0.6698237
6
Helper function to generate the onehotencoding. The index of the 1 is determined and padded with zeroes. The total length of the onehotencoding is always 12 (011).
def generate_one_hot(piece_name: str, color: Color) -> [int]: index_dict = {'King': 0, 'Queen': 1, 'Knight': 2, 'Bishop': 3, 'Rook': 4, 'Pawn': 5} if color == Color.BLACK: base_index = 0 else: base_index = 6 index = base_index + index_dict[piece_name] return [0] * index + [1] + [0] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def one_hot_encode(x):\n # TODO: Implement Function\n output = np.zeros((len(x), 10))\n \n for i, j in enumerate(x):\n output[i,j] = 1\n \n return output", "def one_hot(index):\n\toutput = np.zeros(100)\n\toutput[index] = 1\n\treturn output", "def one_hot_encoding(sequence):\n\n...
[ "0.79863924", "0.7893018", "0.7793367", "0.77331537", "0.7721582", "0.7711968", "0.7688953", "0.76627636", "0.76475406", "0.7644287", "0.75703573", "0.7551043", "0.7512808", "0.75032073", "0.74883187", "0.7487437", "0.74154925", "0.74110943", "0.73989713", "0.73888195", "0.73...
0.0
-1
Helper function that creates a `Parameter` for the company id. Returns None if the view doesn't use company_id (has set `company_id_field' to None`).
def get_company_id_parameter(self): company_id_field = self.view.company_id_field if company_id_field: return Parameter( name=company_id_field, in_='query', type='integer', description='The ID of the company to manage', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_company(self, name):\n return self.instance.company.id", "def get_company_id_value(self):\n return self.company_id_value", "def __init__(self, company_id):\n self.company_id = company_id", "def get_company(self, name):\n return self.website.company.id", "def get_active_c...
[ "0.6270559", "0.6250402", "0.61111104", "0.6100643", "0.6010967", "0.5970374", "0.59220684", "0.5777549", "0.5670947", "0.566579", "0.55984217", "0.5587232", "0.5525761", "0.5465311", "0.5465311", "0.54323745", "0.53816265", "0.536003", "0.5339292", "0.53248185", "0.5318889",...
0.881997
0
Returns a dictionary representing the attributes of this building under the supplied namespace (source). If the namespace does not exist in the current attributes list, it gets created and assigned an empty dictionary, which is returned. A listen callback ensures that buildings don't get saved with empty dictionaries a...
def attributes_for_source(self, source): if source not in self: self[source] = {} return self.get(source)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __convertAttributes__(xml_source):\n attributes = {}\n for attrName, attrValue in xml_source.attributes.items():\n attributes[attrName] = attrValue\n return attributes", "def build_attributes(\n cls,\n attributes: Dict[str, Any],\n namespace: ConfigNamespa...
[ "0.5807572", "0.563328", "0.5318606", "0.52755356", "0.5185805", "0.5144902", "0.5032346", "0.50310934", "0.5017158", "0.5017158", "0.5017158", "0.49815822", "0.49809468", "0.49760073", "0.49759424", "0.49728206", "0.4970488", "0.4939765", "0.48749715", "0.4870164", "0.480561...
0.6392909
0
Batch normalized DNN Conv2D Layer
def conv2dbn(l, name, **kwargs): l = nn.layers.dnn.Conv2DDNNLayer( l, name=name, **kwargs ) l = batch_norm(l, name='%sbn' % name) return l
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def apply_deconv2d(input_layer, num_classes, kernel_size=4, strides=(2, 2)):\n return tf.layers.conv2d_transpose(input_layer, num_classes, kernel_size, strides=strides, padding='same',\n kernel_initializer=tf.truncated_normal_initializer(stddev=0.01),\n ...
[ "0.69178534", "0.6741287", "0.6739064", "0.6736284", "0.6733397", "0.6670138", "0.6658744", "0.664585", "0.66451085", "0.6644496", "0.66343975", "0.66144574", "0.660567", "0.65892386", "0.6571899", "0.65711224", "0.65615237", "0.6556119", "0.65348125", "0.6533711", "0.653017"...
0.64031315
37
Batch normalized DNN Conv2D Layer
def conv2dbn2(l, name='', **kwargs): l = nn.layers.dnn.Conv2DDNNLayer( l, name=name, **kwargs ) l = nn.layers.batch_norm(l, name='%sbn' % name) return l
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def apply_deconv2d(input_layer, num_classes, kernel_size=4, strides=(2, 2)):\n return tf.layers.conv2d_transpose(input_layer, num_classes, kernel_size, strides=strides, padding='same',\n kernel_initializer=tf.truncated_normal_initializer(stddev=0.01),\n ...
[ "0.69178534", "0.6741287", "0.6739064", "0.6736284", "0.6733397", "0.6670138", "0.664585", "0.66451085", "0.6644496", "0.66343975", "0.66144574", "0.660567", "0.65892386", "0.6571899", "0.65711224", "0.65615237", "0.6556119", "0.65348125", "0.6533711", "0.653017", "0.6503614"...
0.6658744
6
Builtin macro to the N'th byte from a variable where N is specified by the top of the data stack.\n
def fetchindexed(ad): # Add the macro to the list of recognized macros. ad.AddMacro('.fetchindexed', 3, [ ['','symbol'] ]); # Define the macro functionality. def emitFunction(ad,fp,argument): (addr,ixBank,bankName) = ad.Emit_GetAddrAndBank(argument[0]); ad.EmitPush(fp,addr,ad.Emit_String(argument[0]['...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_byte(self):\n if self.num == None:\n # since extract_number gives 4 bytes, we return one byte at a time and update a count\n # the count is used to return the appropriate byte \n self.num = self.extract_number()\n self.count = 4\n mask = 1 << (self....
[ "0.5985262", "0.5589742", "0.5560929", "0.5440577", "0.54164964", "0.539576", "0.5345912", "0.5320313", "0.5312122", "0.5300884", "0.5296589", "0.5279987", "0.5275492", "0.52611953", "0.5259056", "0.5210275", "0.51812416", "0.5139802", "0.513495", "0.51168233", "0.5096506", ...
0.0
-1
Reads a file into lines.
def read_file_in_lines(filename): with open(filename) as infile: lines = infile.readlines() return [line.strip() for line in lines]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_lines(filename):\n with open(filename, 'r') as f:\n lines = f.readlines()\n return lines", "def read_file_lines(afile):\n with open(afile, 'r') as f:\n lines = f.read()\n return lines.splitlines()", "def read_file_lines(filepath):\n with open(filepath, 'r', encoding='u...
[ "0.7832972", "0.7793893", "0.7757544", "0.7584085", "0.75427794", "0.75397635", "0.7437351", "0.7343691", "0.73401964", "0.72971153", "0.7293838", "0.7269989", "0.72556716", "0.72506315", "0.7202889", "0.7172061", "0.71643543", "0.7128054", "0.71204734", "0.71169686", "0.7087...
0.7577335
4
Returns the coordinates ('x' or 'y') of edges of a Polygon exterior
def getPolyCoords(row, geom, coord_type): # Parse the exterior of the coordinate exterior = row[geom].exterior if coord_type == 'x': # Get the x coordinates of the exterior return list( exterior.coords.xy[0]) elif coord_type == 'y': # Get the y coordinates of the exterior ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_polygon_envelope(polygon, x_pixel_size, y_pixel_size):\n # retrieve polygon points\n poly_pts = list(polygon.exterior.coords)\n # split tuple points into x and y coordinates and convert them to numpy arrays\n xs, ys = [np.array(coords) for coords in zip(*poly_pts)]\n # compute bounding box\n...
[ "0.67556155", "0.653556", "0.63894284", "0.6357875", "0.63473463", "0.6297983", "0.6290994", "0.62329423", "0.6045333", "0.598115", "0.5934675", "0.5865615", "0.5845448", "0.58083516", "0.58042175", "0.5801828", "0.57940316", "0.57577807", "0.5732867", "0.5722861", "0.5720622...
0.58815426
11
Dismisses all effects requiring moderator action in the given message.
def message_dismiss(request, message_id): if request.method == 'POST': message = get_object_or_404(Message, pk=message_id) effects = message.messageeffect_set.filter(priority__in=MODERATOR_PRIORITIES) effects.update(moderator_dismissed=True) return HttpResponseRedirect(get_redirect_u...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def effect_dismiss(request, effect_id, dismiss_value):\n if request.method == 'POST':\n effect = get_object_or_404(MessageEffect, pk=effect_id)\n effect.moderator_dismissed = dismiss_value\n effect.save()\n return HttpResponseRedirect(get_redirect_url(request))\n else:\n re...
[ "0.6284797", "0.6124579", "0.58016425", "0.57924557", "0.56370044", "0.56285983", "0.55536634", "0.5393613", "0.5393037", "0.5366563", "0.53399074", "0.53074956", "0.530585", "0.5273911", "0.5263366", "0.525916", "0.5239628", "0.52203476", "0.5204413", "0.5201208", "0.5112713...
0.7254183
0
Given user_id, return the associated User object.
def user_loader(user_id): return User.query.get(user_id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_user_by_id(user_id):\n\n return User.query.get(user_id)", "def get(self, user_id):\n return User.get(user_id)", "def get_user_from_id(user_id):\n return Users.query.filter_by(id=user_id).first()", "def get_user(self, user_id):\n User = get_user_model()\n try:\n ...
[ "0.847091", "0.8392729", "0.8367965", "0.82838196", "0.8246071", "0.8243382", "0.8243337", "0.82253414", "0.8178242", "0.81777644", "0.81777644", "0.815016", "0.815016", "0.815016", "0.815016", "0.7941613", "0.7908331", "0.78712547", "0.78460014", "0.7817469", "0.77847594", ...
0.0
-1
Gets the osgi_http_whiteboard_listener of this OrgApacheSlingModelsImplModelAdapterFactoryProperties.
def osgi_http_whiteboard_listener(self) -> ConfigNodePropertyString: return self._osgi_http_whiteboard_listener
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def osgi_http_whiteboard_listener(self, osgi_http_whiteboard_listener: ConfigNodePropertyString):\n\n self._osgi_http_whiteboard_listener = osgi_http_whiteboard_listener", "def __init__(self, osgi_http_whiteboard_listener: ConfigNodePropertyString=None, osgi_http_whiteboard_context_select: ConfigNodePrope...
[ "0.6993022", "0.53720057", "0.5329542", "0.47929937", "0.4754575", "0.4621983", "0.44737133", "0.4467536", "0.44399646", "0.43709266", "0.43477085", "0.43328196", "0.43313783", "0.43156198", "0.43039495", "0.4300758", "0.42827666", "0.42802504", "0.42748606", "0.42746344", "0...
0.7769282
0
Gets the osgi_http_whiteboard_context_select of this OrgApacheSlingModelsImplModelAdapterFactoryProperties.
def osgi_http_whiteboard_context_select(self) -> ConfigNodePropertyString: return self._osgi_http_whiteboard_context_select
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def osgi_http_whiteboard_context_select(self, osgi_http_whiteboard_context_select: ConfigNodePropertyString):\n\n self._osgi_http_whiteboard_context_select = osgi_http_whiteboard_context_select", "def osgi_http_whiteboard_listener(self) -> ConfigNodePropertyString:\n return self._osgi_http_whiteboa...
[ "0.7265916", "0.5025798", "0.46598804", "0.41829097", "0.41429886", "0.41347912", "0.41249308", "0.40264204", "0.4018437", "0.39968464", "0.3993271", "0.39831963", "0.3980252", "0.39604202", "0.39552125", "0.39350805", "0.3905698", "0.38926733", "0.38639683", "0.38477796", "0...
0.7908644
0
Gets the max_recursion_depth of this OrgApacheSlingModelsImplModelAdapterFactoryProperties.
def max_recursion_depth(self) -> ConfigNodePropertyInteger: return self._max_recursion_depth
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def max_depth(self) -> int:\n return pulumi.get(self, \"max_depth\")", "def get_max_depth(self):\n return self.MAX_DEPTH", "def max_recursion_depth(self, max_recursion_depth: ConfigNodePropertyInteger):\n\n self._max_recursion_depth = max_recursion_depth", "def max_depth(self) -> int:\n ...
[ "0.74501777", "0.7340676", "0.7263453", "0.70677066", "0.7038918", "0.69855696", "0.67983764", "0.652429", "0.64539415", "0.633029", "0.632957", "0.632732", "0.6296236", "0.62616277", "0.6254619", "0.6243138", "0.62048894", "0.62002504", "0.61591053", "0.61446327", "0.6087652...
0.8128955
0
Sets the max_recursion_depth of this OrgApacheSlingModelsImplModelAdapterFactoryProperties.
def max_recursion_depth(self, max_recursion_depth: ConfigNodePropertyInteger): self._max_recursion_depth = max_recursion_depth
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def max_recursion_depth(self) -> ConfigNodePropertyInteger:\n return self._max_recursion_depth", "def reset_max_depth(self) -> None:\n # The max depth is now calculated on the fly, so this is a no-op.\n pass", "def DEFAULT_MAX_DEPTH(self): # real signature unknown; restored from __doc__\n ...
[ "0.69575775", "0.63157433", "0.6055788", "0.60365146", "0.5965228", "0.59338325", "0.58918506", "0.5792109", "0.57021093", "0.5681195", "0.5563555", "0.5532455", "0.5489835", "0.5466974", "0.54471564", "0.53561205", "0.5314023", "0.5257543", "0.52012503", "0.52012503", "0.513...
0.79402214
0
Gets the cleanup_job_period of this OrgApacheSlingModelsImplModelAdapterFactoryProperties.
def cleanup_job_period(self) -> ConfigNodePropertyInteger: return self._cleanup_job_period
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cleanup_job_period(self, cleanup_job_period: ConfigNodePropertyInteger):\n\n self._cleanup_job_period = cleanup_job_period", "def deletion_grace_period_seconds(self) -> Optional[pulumi.Input[int]]:\n return pulumi.get(self, \"deletion_grace_period_seconds\")", "def scheduled_reset_period(self...
[ "0.6810407", "0.5706186", "0.55742985", "0.5540937", "0.5442573", "0.5402934", "0.5320897", "0.5307369", "0.52713835", "0.52190536", "0.5218656", "0.52111757", "0.5136258", "0.51293296", "0.5081783", "0.50607204", "0.50219274", "0.4996031", "0.4958748", "0.4958748", "0.494995...
0.7969843
0
API Endpoint for adding books of the current user in the library.\n
def addBooks(request): if request.method == 'POST': userHash = request.data['hash'] email = request.data['email'] User = UserInformation.objects.get(loginSessionHash=userHash) title = request.data['title'] pages = request.data['pages'] author = request.data['author'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def login_and_add_book(self):\n\t\t# create book\n\t\tadd_book = {\n\t\t\t'title': 'Hello Books',\n\t\t\t'isbn': '5698745124'\n\t\t}\n\n\t\tlogin_data = self.register_and_login_in_user()\n\t\ttoken = login_data['auth_token']\n\t\tres = self.client.post(\n\t\t\tf'{URL_BOOKS}',\n\t\t\theaders=dict(Authorization=f'Be...
[ "0.74620336", "0.7219438", "0.7139932", "0.7007315", "0.69566804", "0.6773549", "0.6766081", "0.6736421", "0.67141646", "0.65646166", "0.65074444", "0.6493943", "0.64573485", "0.644542", "0.6388441", "0.6287474", "0.6280611", "0.62744933", "0.62601066", "0.6248662", "0.624515...
0.6964748
4
Finds an pairwise distance of v and w using NeedlemanWunsch and taking gaps into consideration.
def pairwise(string_v, string_w): m = len(string_v) n = len(string_w) # Initialization; D[i][j][0] contains the max alignment score of the # ith prefix of v and the jth of w; D[i][j][1] contains the back pointer. D = [[0 for _ in range(n + 1)] for _ in range(m + 1)] for i in range(1, m + 1): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def distance(v, w):\n\treturn magnitude(vector_subtract(v, w))", "def distance(v, w):\n return magnitude_of_vector(vector_subtract(v, w))", "def distance(v: Vector, w: Vector) -> float:\n return magnitude(subtract(v, w))", "def squared_distance(v, w):\n\treturn sum_squares(vector_subtract(v, w))", "d...
[ "0.77277", "0.7570434", "0.72908926", "0.7279754", "0.7119905", "0.70133895", "0.70123297", "0.68195766", "0.6768197", "0.6711635", "0.66336524", "0.63941026", "0.63593477", "0.6334352", "0.61106867", "0.6081675", "0.5992884", "0.5978472", "0.5977499", "0.5961048", "0.5958653...
0.60015064
16
List of the relative paths of the files in rootdir/subdir. Exclude file names that are a match for one of the suffixes in 'suffixes' and file names that are a match for one of the prefixes in 'prefixes'.
def list_rpaths(rootdir, subdir, suffixes=None, prefixes=None): flist = [] suffixes_len = len(suffixes) if suffixes is not None else 0 prefixes_len = len(prefixes) if prefixes is not None else 0 with change_cwd(os.path.join(rootdir, subdir)): for root, dirs, files in os.walk('.'): f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_files_suffix(suffixes, dname, Lshow=False, Ldir=False, Linverse=False, Lparents=False):\n matched_files=[]\n for suff in suffixes:\n for fname in os.listdir(dname):\n ### if matched\n if fname.endswith(suff):\n ### if Ldir, include dir || if not dir, includ...
[ "0.6962376", "0.65784943", "0.6370677", "0.6343025", "0.63312167", "0.6220182", "0.6104349", "0.6018182", "0.6008824", "0.5973622", "0.59651554", "0.59651554", "0.58939385", "0.58810604", "0.58729035", "0.58060575", "0.5723602", "0.5720859", "0.5702791", "0.5678382", "0.56679...
0.7640581
0
A dictionary of the tracked files in this branch.
def tracked_files(self, branch): d = {} ls_tree = self.git_cmd('ls-tree -r --name-only --full-tree %s' % branch) for rpath in ls_tree.splitlines(): if rpath == '.gitignore': continue if branch.startswith('timestamps'): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def files(self):\n return self._files.items()", "def retrieve_tracked_files(self):\n result = []\n\n for key in self.repo.index.entries.keys():\n\n result.append(os.path.join(self.repo.working_dir, key[0]))\n\n return result", "def get_files(self):\n return self._f...
[ "0.7225195", "0.7124153", "0.7019064", "0.7008128", "0.6827469", "0.6787554", "0.67623603", "0.6726054", "0.6623554", "0.6605468", "0.6605468", "0.6522291", "0.6482284", "0.64448774", "0.644253", "0.6414219", "0.6402616", "0.63187677", "0.62874955", "0.62830555", "0.62715495"...
0.8222042
0
Returns the data directory that contains example files.
def data_dir(): #data_path = os.path.dirname(intervene.__file__) #data_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'example_data') #print(data_path) return os.path.join(os.path.dirname(__file__), 'example_data')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def data_dir():\n return os.path.join(os.path.dirname(_here), 'test', 'data')", "def get_sample_data_dir():\n \n return resource_filename('cdat_lite.test.test_cdms', 'sample_data')", "def data_dir():\n return os.path.join(os.path.dirname(os.path.abspath(__file__)), 'data')", "def test_data_dir(se...
[ "0.85425496", "0.8442005", "0.8319282", "0.8298303", "0.82593244", "0.7942936", "0.7915708", "0.7830004", "0.780378", "0.7743608", "0.7639592", "0.7629414", "0.76055616", "0.7594035", "0.7578145", "0.75721276", "0.75603825", "0.7546257", "0.7517429", "0.74979985", "0.74731785...
0.8549583
0
Get a list of RGBA colors
def default_colors(): # default_colors = [ # # r, g, b, a # [92, 192, 98, 0.5], # [90, 155, 212, 0.5], # [246, 236, 86, 0.6], # [241, 90, 96, 0.4], # [255, 117, 0, 0.3], # [82, 82, 190, 0.2], # ] default_colors = [ # r, g, b, a [188, 1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getColors():\n return ['#8c99fc', '#cacefd', '#fff1d7', '#feda98', '#fda85a', '#fc6647']", "def get_colors(color_list):\n rgba_colors = []\n a = [0.5,0.5,0.6,0.4,0.3,0.2]\n i = 0\n for c in color_list:\n rgba_colors.append(list(colors.to_rgba(c)))\n rgba_colors[i][3] = a[i]\n ...
[ "0.7845314", "0.78049654", "0.7535439", "0.74685556", "0.73389417", "0.71918267", "0.7177978", "0.7128006", "0.7036529", "0.7030025", "0.7021125", "0.6895638", "0.688114", "0.6878077", "0.68186617", "0.67914706", "0.67870784", "0.67870784", "0.6766293", "0.6763596", "0.675388...
0.0
-1
Get a list of RGBA colors
def default_border_colors(): default_colors = [ # r, g, b, a [0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1], ] return default_colors
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getColors():\n return ['#8c99fc', '#cacefd', '#fff1d7', '#feda98', '#fda85a', '#fc6647']", "def get_colors(color_list):\n rgba_colors = []\n a = [0.5,0.5,0.6,0.4,0.3,0.2]\n i = 0\n for c in color_list:\n rgba_colors.append(list(colors.to_rgba(c)))\n rgba_colors[i][3] = a[i]\n ...
[ "0.78430086", "0.7804021", "0.75338656", "0.74672335", "0.7337773", "0.71913713", "0.7175914", "0.71270144", "0.7035135", "0.70284665", "0.702011", "0.6894757", "0.68815154", "0.68773955", "0.68166345", "0.6790124", "0.6784613", "0.6784613", "0.6766122", "0.67618954", "0.6751...
0.0
-1
Get color combinations for Venn diagram. This converts color names to RGBA
def get_colors(color_list): rgba_colors = [] a = [0.5,0.5,0.6,0.4,0.3,0.2] i = 0 for c in color_list: rgba_colors.append(list(colors.to_rgba(c))) rgba_colors[i][3] = a[i] i+=1 return rgba_colors
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def colors(self):\n\t\treturn [(0, 30, 255),(0, 30, 120)]", "def get_colors():\n colors = {}\n for h in wn.synset('chromatic_color.n.01').hyponyms():\n colors[h.lemmas()[0].name()] = [l.name() for l in h.lemmas()]\n colors[h.lemmas()[0].name()].extend(all_hyponyms(h)) \n for h in wn.synset...
[ "0.6750818", "0.6673126", "0.6603933", "0.65715647", "0.6470285", "0.6237714", "0.61807317", "0.61733174", "0.61602324", "0.61532736", "0.61465955", "0.6145959", "0.61406004", "0.61281896", "0.6124112", "0.61053634", "0.6095809", "0.60790694", "0.6074916", "0.6067916", "0.606...
0.5937673
34
Return True if we already have CAs in cert_dir (and do not need to run osgcamanage setupCA)
def cas_exist(cert_dir): cas = glob.glob(os.path.join(cert_dir, '*.0')) if cas: return True else: return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_own_cert(self):\n return os.path.isfile(self.get_own_cert_path())", "def check_ca(self):\n return m2.x509_check_ca(self.x509)", "def _check_ca_certificate(self):\n if not os.path.exists(self._ca_certificate_path):\n with open(self._ca_certificate_path, \"w\") as f:\n ...
[ "0.7079979", "0.69654286", "0.69620156", "0.64778847", "0.610083", "0.60358095", "0.5910464", "0.5890337", "0.5883409", "0.58432823", "0.58404034", "0.5830286", "0.575217", "0.5691454", "0.56905395", "0.5685879", "0.56615525", "0.56576693", "0.564608", "0.5644496", "0.5614897...
0.73669565
0
Set up test environment
def setUp(self): super().setUp() """ Log in and register a new user. Use this user's credentials to create an article. We will perform our tests on this created article using the user set up in our base test. """ user_data = { "username": "new_user", ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setUp(self):\n test_env_setup()", "def setUp(self):\n logging.debug('setting up')", "def setUp(self):\n logging.debug('setting up')", "def setUpModule():\n # pull in test environment as dict\n global TestEnv\n get_test_env(TestEnv)", "def setUpModule():\n # pull in test...
[ "0.8536583", "0.77634245", "0.77634245", "0.77119386", "0.77119386", "0.76243633", "0.7492759", "0.7419948", "0.74034655", "0.7341081", "0.7303545", "0.7300245", "0.7280562", "0.72492623", "0.72115797", "0.71997404", "0.7192515", "0.7183014", "0.7168484", "0.71679235", "0.716...
0.0
-1
Tests that a user can update the rating a specific article
def test_successful_article_rate_update(self): self.client.post( reverse('articles:rate', kwargs={'slug': self.slug}), {'rating': 4}, format="json", **self.headers) ratings_count = ArticleRating.objects.count() update_response = self.client.post(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_assign_and_read_ratings(self):\n\n self.signup('user@example.com', 'user')\n self.login('user@example.com')\n csrf_token = self.get_csrf_token_from_response(\n self.testapp.get('/explore/%s' % self.EXP_ID))\n\n # User checks rating\n ratings = self.get_json('/...
[ "0.73270273", "0.7200907", "0.7063874", "0.6943513", "0.6880346", "0.68199396", "0.6753025", "0.6682277", "0.65840596", "0.6523234", "0.6478728", "0.6453261", "0.63483196", "0.6332724", "0.6264581", "0.6239035", "0.62114555", "0.6202527", "0.6166116", "0.6158741", "0.61524296...
0.7646163
0
Status code should be 104 when invalid end date is given.
def test_range__bad_end_date(self): self.end_date = 'bad' response = self._get(get_kwargs=self._data()) self._check_response(response, 104)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_range__no_end_date(self):\n data = self._data()\n data.pop('end_date')\n response = self._get(get_kwargs=data)\n self._check_response(response, 104)", "def test_GET_enddate_error(self):\n self.register_user()\n result = self.login_user()\n access_token = ...
[ "0.7187822", "0.69151103", "0.6656257", "0.6641612", "0.65245837", "0.6436652", "0.62333614", "0.6221718", "0.62147796", "0.6201093", "0.6182071", "0.61371154", "0.61364156", "0.6134059", "0.612638", "0.61116016", "0.6083806", "0.60599566", "0.60342395", "0.6023552", "0.60149...
0.78950286
0
Return the source type, eg gps or router, of the device.
def source_type(self): return SOURCE_TYPE_GPS
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def source_type(self):\n return SOURCE_TYPE_ROUTER", "def source_type(self):\n return SOURCE_TYPE_ROUTER", "def source_type(self) -> SourceType:\n return SourceType.ROUTER", "def source_type(self) -> SourceType:\n return SourceType.ROUTER", "def source_type(self) -> SourceType:\...
[ "0.7759235", "0.7759235", "0.77496326", "0.77496326", "0.77496326", "0.7450757", "0.728249", "0.7177163", "0.66212326", "0.65801394", "0.643527", "0.6371261", "0.6225119", "0.6220295", "0.6188974", "0.6182763", "0.6179853", "0.61750805", "0.6171102", "0.61562204", "0.6087952"...
0.7988358
1
Return device specific state attributes.
def extra_state_attributes(self): return dict( self._instrument.attributes, model="{}/{}".format( self._instrument.vehicle_model, self._instrument.vehicle_name ), model_year=self._instrument.vehicle_model_year, model_family=self._instru...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def device_state_attributes(self):\r\n return self.attributes", "def device_state_attributes(self):\n return self.attr", "def device_state_attributes(self):\n return self.attr", "def device_state_attributes(self): # Can be remove from 0.99\n return self._attr", "def device_stat...
[ "0.87326586", "0.87130606", "0.87130606", "0.8661474", "0.86244243", "0.86244243", "0.86156", "0.8589153", "0.85687816", "0.85626554", "0.85169643", "0.84891194", "0.84891194", "0.84891194", "0.84891194", "0.84891194", "0.84891194", "0.84891194", "0.84891194", "0.84891194", "...
0.0
-1
Return a configured instance of Flask.
def create_app(config=None): app = Flask( __name__, template_folder='./templates', static_folder='./static' ) config = config or os.getenv('APP_SETTINGS', 'app.ProdConfig') app.config.from_object(config) register_extensions(app) register_blueprints(app) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_server() -> Flask:\n app: Flask = Flask(__name__)\n return app", "def app(self):\n\n ## set flask specific things that are non-optional\n error = lambda k: 'Fatal: You need to specify a \"flask\" section ' + \\\n 'with an entry like \"'+k+'=...\" in your .ini ...
[ "0.77011824", "0.75656456", "0.74778473", "0.73862064", "0.73360217", "0.73317564", "0.72606957", "0.72431684", "0.72383463", "0.7145467", "0.71274495", "0.7112282", "0.710187", "0.7072576", "0.7064096", "0.7048495", "0.70410323", "0.7007802", "0.7004336", "0.70031124", "0.69...
0.0
-1
Pads the input along the spatial dimensions independently of input size. Pads the input such that if it was used in a convolution with 'VALID' padding, the output would have the same dimensions as if the unpadded input was used in a convolution with 'SAME' padding.
def _fixed_padding(inputs, kernel_size, rate=1): kernel_size_effective = [kernel_size[0] + (kernel_size[0] - 1) * (rate - 1), kernel_size[0] + (kernel_size[0] - 1) * (rate - 1)] pad_total = [kernel_size_effective[0] - 1, kernel_size_effective[1] - 1] pad_beg = [pad_total[0] // 2, pad_to...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wrap_pad(input, size):\n M1 = tf.concat([input[:, :, -size[1]:, :], input, input[:, :, 0:size[1], :]], 2)\n M1 = tf.concat([M1[:, -size[0]:, :, :], M1, M1[:, 0:size[0], :, :]], 1)\n return M1", "def padding(src, min_size):\n # pad before put into convolutional layer\n src_dim = src.dim()\n if src...
[ "0.74440795", "0.74137866", "0.72507936", "0.719782", "0.71471155", "0.71313894", "0.7092866", "0.7077542", "0.69973785", "0.6968524", "0.6952354", "0.69406676", "0.6939346", "0.6938933", "0.6937089", "0.692997", "0.6927389", "0.6897429", "0.6855132", "0.68206483", "0.6800652...
0.6273295
55
Perform H_l composite function for the layer and after concatenate input with output from composite function.
def add_internal_layer(self, _input, growth_rate, training=True, bc_mode=False, dropout_keep_prob=1.0, scope="inner_layer"): # call composite function with 3x3 kernel with tf.variable_scope(scope): if not bc_mode: _output = self.composite_function(_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_internal_layer(_input, growth_rate, is_training, bc_mode=True):\n # call composite function with 3x3 kernel\n comp_out = None\n if not bc_mode:\n comp_out = composite_function(_input, out_features=growth_rate, kernel_size=3, is_training=is_training)\n elif bc_mode:\n bottleneck_ou...
[ "0.62754625", "0.60689116", "0.5933209", "0.5863085", "0.5822832", "0.5366478", "0.5276861", "0.52329427", "0.5228648", "0.5183459", "0.5181577", "0.51762015", "0.51683635", "0.5113526", "0.5079918", "0.50780797", "0.50518036", "0.5041206", "0.5035577", "0.5026877", "0.502097...
0.56978875
5
Perform H_l composite function for the layer and after concatenate input with output from composite function.
def add_internal_layer(self,_input, growth_rate, training=True, bc_mode=False, dropout_keep_prob=1.0, scope="inner_layer"): # call composite function with 3x3 kernel with tf.variable_scope(scope): if not bc_mode: _output = self.composite_function(_i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_internal_layer(_input, growth_rate, is_training, bc_mode=True):\n # call composite function with 3x3 kernel\n comp_out = None\n if not bc_mode:\n comp_out = composite_function(_input, out_features=growth_rate, kernel_size=3, is_training=is_training)\n elif bc_mode:\n bottleneck_ou...
[ "0.62754625", "0.60689116", "0.5933209", "0.5863085", "0.56978875", "0.5366478", "0.5276861", "0.52329427", "0.5228648", "0.5183459", "0.5181577", "0.51762015", "0.51683635", "0.5113526", "0.5079918", "0.50780797", "0.50518036", "0.5041206", "0.5035577", "0.5026877", "0.50209...
0.5822832
4
Get some randomm bytes as a string.
def bytes(*args, **kwargs): # real signature unknown pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generateRandomString():\n return ''.join(b64encode(urandom(32)).decode('utf-8'))", "def _random_bytes(n):\n return ''.join(map(chr, (random.randrange(256) for i in xrange(n))))", "def random_byte_string(self, maxlen = 1024):\n s = ''.join(chr(random.randint(1, 255)) for _ in range(maxlen))\n\n ...
[ "0.7750324", "0.7675637", "0.761588", "0.7610008", "0.7406441", "0.737107", "0.73479277", "0.7319009", "0.72851336", "0.7253981", "0.7228137", "0.72223026", "0.7186573", "0.71557856", "0.7129758", "0.7068876", "0.7056966", "0.70434725", "0.7028753", "0.7011845", "0.6940622", ...
0.0
-1
Create the list to use for buffering reads. Can be overridden, but must return a list that is of size ``batch_size lines_per_row``.
def _create_batch_list(self): return [None] * self.bufsize
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def batches(data, batch_size) -> list:\n rv = []\n for idx, line in enumerate(data):\n if idx != 0 and idx % batch_size == 0:\n yield rv\n rv = []\n rv.append(line)\n yield rv", "def batches(self, batch_size, cou...
[ "0.71122545", "0.66725814", "0.6623912", "0.65610766", "0.6475078", "0.62212", "0.6188999", "0.6150206", "0.6041359", "0.6031327", "0.6031211", "0.602821", "0.6027498", "0.6021841", "0.6001718", "0.6000712", "0.59650755", "0.59584486", "0.5958087", "0.59522134", "0.59224415",...
0.75191486
0
Sets the number of available licenses as a hard limit.
def license_count_hard_limit(self) -> Optional[pulumi.Input[bool]]: return pulumi.get(self, "license_count_hard_limit")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def license_count_hard_limit(self) -> pulumi.Output[Optional[bool]]:\n return pulumi.get(self, \"license_count_hard_limit\")", "def limit_num_clients(self, limit_num_clients):\n\n self._limit_num_clients = limit_num_clients", "def limit_num_downloads(self, limit_num_downloads):\n\n self._l...
[ "0.60027826", "0.58430874", "0.5798606", "0.57090884", "0.56257707", "0.55748135", "0.54968864", "0.5493055", "0.54561603", "0.54341906", "0.54324275", "0.54163176", "0.54163176", "0.54163176", "0.538495", "0.53389937", "0.53387153", "0.53313684", "0.5330356", "0.5323538", "0...
0.6171312
0