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 |
|---|---|---|---|---|---|---|
The target tag to checkout. This function must work out which tag should be checked out and return that. A good start is to use `git_ls_remote_tags(self.clone_url)` to obtain a list of tags from the remote. If you specify `clone_url` you should also specify this. Returns | def target_tag(self):
raise NotImplementedError | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def git_tag(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"git_tag\")",
"def _tag_to_sha1(self):\n def get_sha1(url):\n # Ceph (and other projects) uses annotated tags for releases. This\n # has the side-effect of making git ls-remote return the sha1 for\n ... | [
"0.6066978",
"0.55798763",
"0.55575454",
"0.5528704",
"0.5371438",
"0.5319996",
"0.5315837",
"0.52859247",
"0.5279796",
"0.5232324",
"0.51878875",
"0.5127066",
"0.5117217",
"0.5114513",
"0.51007175",
"0.50845635",
"0.50557953",
"0.504492",
"0.5013877",
"0.49968374",
"0.498249... | 0.5020696 | 18 |
return a usermodifiable plugin setting. | def get_setting(self, id):
return __settings__.getSetting(id) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def user_settings(self):\n return self._user_settings",
"def preference():\n preference = bpy.context.preferences.addons[name].preferences\n return preference",
"def settings():\n return _get_settings()[1]",
"def ui_user_settings(self) -> Optional[UIUserSettings]:\n return None",
"def ... | [
"0.6594315",
"0.63958514",
"0.63856536",
"0.63530064",
"0.63530064",
"0.632438",
"0.62978953",
"0.61703277",
"0.6154525",
"0.6122752",
"0.5982431",
"0.594215",
"0.58979535",
"0.589158",
"0.58614314",
"0.584904",
"0.58471745",
"0.5815053",
"0.58142775",
"0.5788841",
"0.5753671... | 0.61951405 | 7 |
Function that loads the instance of the chain from a file. | def load(self, filename='test'):
file = open(filename+'.txt','r')
loaded_chain = pickle.load(file)
self.N = loaded_chain.N
self.m = loaded_chain.m
self.R = loaded_chain.R
self.a = loaded_chain.a
self.force = loaded_chain.force
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load(self, filename=None):\n if filename is None:\n filename = BlockChainConf.DEFAULT_CHAIN_DUMP_FILENAME\n\n with open(filename, \"r\") as chain:\n chain = loads(chain)\n\n # verify the integrity of the chain\n # before simply assuming that it is\n ... | [
"0.7297373",
"0.6743561",
"0.6719113",
"0.6674942",
"0.6601602",
"0.65875155",
"0.658136",
"0.65740955",
"0.65287006",
"0.6510903",
"0.6477763",
"0.64765435",
"0.64707905",
"0.6457832",
"0.6452281",
"0.64499456",
"0.64326555",
"0.6415128",
"0.64141405",
"0.64132404",
"0.64089... | 0.69252604 | 1 |
Get time difference for one index step in self.data assuming uniform time steps. | def get_dt_per_index(self):
dt = self.data[1,-1] - self.data[0,-1]
return dt | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_delta(self, index):\n return self.function[index] - self.function[index-1]",
"def timestep(self) -> Optional[float]:\n dt = None\n if len(self.time) > 1 and self.is_equidistant:\n dt = (self.time[1] - self.time[0]).total_seconds() # type: ignore\n return dt",
"d... | [
"0.6904996",
"0.6823715",
"0.6719912",
"0.66179395",
"0.65868384",
"0.65379906",
"0.64149296",
"0.628704",
"0.628704",
"0.6260789",
"0.6260239",
"0.62280893",
"0.61737454",
"0.61193305",
"0.6116847",
"0.60995185",
"0.60741377",
"0.607013",
"0.6028518",
"0.6027731",
"0.6007085... | 0.7689221 | 0 |
Function measuring the total kinetic energy for all times in the simulation (t_measure is None) or for one particular time t_measure. In the rescaled equation of motion the kinetic energy is calculated by E_kin = 0.5(m/m0)v2, where m0 is the base mass used for the time scaling parameter beta. Returns | def measure_kinetic_energy(self, t_measure=None):
assert self.data is not None
time = self.get_time()
N = self.get_N()
m0 = self.sim_chain.m0
#print 'm0', m0
if t_measure is not None:
# find index for time closest to t_measure
idx = self._... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def measure_kinetic_energy_distr(self, t_measure=None):\n assert self.data is not None\n time = self.get_time()\n N = self.get_N()\n m0 = self.sim_chain.m0\n #print 'm0', m0\n \n if t_measure is not None:\n # find index for time closest to t_measure\n ... | [
"0.8105596",
"0.7505201",
"0.7173598",
"0.64484125",
"0.63278216",
"0.59436506",
"0.5919195",
"0.59171844",
"0.58279824",
"0.55792224",
"0.55198205",
"0.550474",
"0.55004984",
"0.5450113",
"0.5446609",
"0.54263586",
"0.5424931",
"0.54099715",
"0.5391762",
"0.53913695",
"0.532... | 0.8812414 | 0 |
Function measuring the total kinetic energy for all times in the simulation (t_measure is None) or for one particular time t_measure. In the rescaled equation of motion the kinetic energy is calculated by E_kin = 0.5(m/m0)v2, where m0 is the base mass used for the time scaling parameter beta. Returns | def measure_kinetic_energy_distr(self, t_measure=None):
assert self.data is not None
time = self.get_time()
N = self.get_N()
m0 = self.sim_chain.m0
#print 'm0', m0
if t_measure is not None:
# find index for time closest to t_measure
idx = ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def measure_kinetic_energy(self, t_measure=None):\n assert self.data is not None\n time = self.get_time()\n N = self.get_N()\n m0 = self.sim_chain.m0\n #print 'm0', m0\n \n if t_measure is not None:\n # find index for time closest to t_measure\n ... | [
"0.881432",
"0.7503709",
"0.7174916",
"0.6449701",
"0.6328805",
"0.59452975",
"0.592042",
"0.5919419",
"0.58276355",
"0.55787253",
"0.5522134",
"0.55065703",
"0.5500261",
"0.54508346",
"0.54491395",
"0.5427619",
"0.5425175",
"0.54099274",
"0.5392322",
"0.5391076",
"0.5325635"... | 0.8107577 | 1 |
Function calculating the relative error in energy conservation between the start and the end of the simulation. Returns | def calculate_energy_conservation_error(self):
assert self.data is not None
# calculate total energy at start and end of simulation
energy_start = self.measure_total_energy(self.t0)
energy_end = self.measure_total_energy(self.t1)
# calculate accuracy
error = abs(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def diff_of_errors(self):\n self.e_of_e = self.azimuth_error - self.altitude_error\n return self.e_of_e",
"def calculate_error(self):\n self.network.index_nodes()\n self._calculate_dist()\n _, relative_error = self._relative_error()\n _, absolute_error = self._absolute_e... | [
"0.6875453",
"0.6840907",
"0.65401095",
"0.64742965",
"0.646986",
"0.64060026",
"0.63589954",
"0.63352466",
"0.6291437",
"0.62892836",
"0.6278621",
"0.62616163",
"0.6260354",
"0.6234737",
"0.6232844",
"0.62310743",
"0.6223826",
"0.6219136",
"0.61880994",
"0.61745226",
"0.6158... | 0.8447843 | 0 |
Function that finds the time for which the wave reaches the end of the chain. This only works if the wave is travelling from left to right and if there are no other disturbances. Returns | def find_exit_time(self):
# check when last bead starts moving
vel_last_bead = self.get_bead_velocity(self.get_N()-1)
nonzero = np.flatnonzero( vel_last_bead )
if nonzero.size == 0:
warnings.warn('The wave did not exit the chain or it could not be determined... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def endTime(self) -> float:\n try: return self.times[-1]\n except IndexError: return 0.0",
"def get_time_walking(self):\n return self.time_step_to_enqueue - self.time_entered",
"def timestep(self) -> Optional[float]:\n dt = None\n if len(self.time) > 1 and self.is_equidistant... | [
"0.6803967",
"0.66370136",
"0.612646",
"0.6028129",
"0.59619063",
"0.59619063",
"0.59619063",
"0.58898365",
"0.5848702",
"0.58400786",
"0.58278865",
"0.58025205",
"0.578827",
"0.57436454",
"0.5735698",
"0.5734913",
"0.57159877",
"0.56937367",
"0.56919426",
"0.5689621",
"0.564... | 0.7566171 | 0 |
Verify the password entered as the user's returns True if it is. | def verify_password(self, password):
return check_password_hash(self.password_hash, password) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def verify_password(self, password):\n return self.PASS == password",
"def verify_password(self, password):\n return self.PASSWORD == password",
"def check_password(self, password):\n return self.password == password",
"def _check_password(self, password):\n if self.password_regex... | [
"0.8476461",
"0.83159363",
"0.81507164",
"0.8098722",
"0.80463326",
"0.7978972",
"0.79780746",
"0.7898308",
"0.786349",
"0.78121054",
"0.77694076",
"0.7753661",
"0.7746007",
"0.7729557",
"0.7712195",
"0.76998615",
"0.768733",
"0.76785",
"0.76726246",
"0.76444733",
"0.76362795... | 0.7765312 | 15 |
Test retrieve list the resgate to authenticated user | def test_retrieve_list_resgate_to_user_authenticated(self):
sample_resgate(user=self.user, value=500)
sample_resgate(user=self.user, value=200)
response = self.client.get(RESGATE_URL)
resgates = Resgate.objects.all().order_by('quantity')
serializer = ResgateSerializer(resgates,... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_list_user(self):\n pass",
"def _get_list(self, user=None):\n request = self.factory.get(self.list_url, format='json')\n force_authenticate(request, user)\n resp = self.list_view(request)\n resp.render()\n return resp",
"def test_csc_authorization_request_list_... | [
"0.757011",
"0.7447695",
"0.74397236",
"0.7430594",
"0.74106807",
"0.7409776",
"0.73974997",
"0.73469055",
"0.72892547",
"0.7219288",
"0.71494305",
"0.7131195",
"0.70773554",
"0.7071965",
"0.70706135",
"0.70423615",
"0.70396",
"0.70183665",
"0.70000446",
"0.6991642",
"0.69740... | 0.7997639 | 0 |
Unload a config entry. | async def async_unload_entry(hass: HomeAssistant, config_entry: ConfigEntry):
unload_ok = await hass.config_entries.async_unload_platforms(
config_entry, PLATFORMS
)
if unload_ok:
shell = hass.data[DOMAIN]
shell.remove_entry(config_entry)
if shell.is_idle():
# als... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def async_unload_entry(hass, config_entry):\n unload_ok = await hass.config_entries.async_forward_entry_unload(\n config_entry, \"climate\"\n )\n return unload_ok",
"async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:\n hass.data.pop(DOMAIN)\n return True",
... | [
"0.697284",
"0.6888074",
"0.6779855",
"0.6747459",
"0.6689002",
"0.6657831",
"0.66162205",
"0.65925974",
"0.65595686",
"0.65411645",
"0.6507643",
"0.6507643",
"0.6507643",
"0.6507643",
"0.64977276",
"0.64931643",
"0.6486601",
"0.6486601",
"0.6486601",
"0.6486601",
"0.6469397"... | 0.6603433 | 7 |
Create a fuzzer stats object from a file object (i.e., one created by `open`ing a fuzzer_stats file). | def __init__(self, stats_file):
stats = dict()
self._stats = dict()
for line in stats_file:
stat = next((regex.match(line).groupdict()
for regex in FUZZER_STATS_RES if regex.match(line)),
dict())
stats.update(stat)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def from_file(cls, file_path, ngram_sizes, profile_len):\n profile = cls.from_files((file_path, ), ngram_sizes, profile_len)\n return profile",
"def fromfile(cls, f):\n raise NotImplementedError(\"ScalableRedisLocalBloomFilter not support fromfile\")",
"def from_file(cls, file_obj):\n ... | [
"0.59987247",
"0.5713597",
"0.56680816",
"0.56616545",
"0.56160724",
"0.5563072",
"0.5530028",
"0.54662895",
"0.54297715",
"0.5404788",
"0.537576",
"0.535557",
"0.53377",
"0.5336782",
"0.5324666",
"0.5320681",
"0.5294768",
"0.52943027",
"0.52939016",
"0.5271914",
"0.5267865",... | 0.78831124 | 0 |
Open text file and get a random quote | def get_random_quote():
with open ("./data/quotes.txt", "r") as quotes:
all_quotes = quotes.read().rstrip("\n").split("\n\n")
quote = choice(all_quotes)
return quote | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def random_quote(filename):\n \n quote = random_line(filename)\n \n divided = quote.split('~')\n if len(divided) > 0:\n return divided\n else:\n return [\"OH MY GOD WHO'S FLYING THIS THING!?!!\", \"..oh right, that would be me.\"]",
"def random_text(random_file=None):\n if rand... | [
"0.7541011",
"0.7301967",
"0.65078884",
"0.6476318",
"0.64463925",
"0.64085835",
"0.6345679",
"0.6206244",
"0.6189888",
"0.61851126",
"0.6156133",
"0.6156133",
"0.6098664",
"0.59371656",
"0.5931141",
"0.5884301",
"0.58657694",
"0.5854964",
"0.5853227",
"0.5845242",
"0.5807402... | 0.80525166 | 0 |
initializes an instance of MaskedDict. | def __init__(self, mapping=None, **kwargs):
masked_kwargs = {}
if len(kwargs) > 0:
masked_kwargs = self._mask_dict(kwargs)
if isinstance(mapping, MaskedDict):
super().__init__(self._unify(mapping, masked_kwargs))
elif isinstance(mapping, (dict, Headers)):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def createMaskDictionary(self):\n try:\n self.maskMap = dict(list(zip(self.inds,list(range(len(self.inds))))))\n self.maskSet = set(self.inds)\n except Exception as error:\n print(\"failed in createMaskDictionary\", error)",
"def _mask_dict(self, value):\n\n ... | [
"0.7080748",
"0.6873385",
"0.6763534",
"0.62099147",
"0.6161549",
"0.58566666",
"0.581862",
"0.5805196",
"0.5759827",
"0.57326835",
"0.5640996",
"0.56272954",
"0.5606814",
"0.5573266",
"0.55711085",
"0.5569299",
"0.5569299",
"0.55552834",
"0.55372727",
"0.553018",
"0.55181307... | 0.69754046 | 1 |
masks all required keys of given object. if given object is not a dict or Headers or a collection of those objects, it returns the same input value. | def _mask(self, value):
if isinstance(value, Headers):
return self._mask_headers(value)
elif isinstance(value, dict):
return self._mask_dict(value)
elif isinstance(value, LIST_TYPES):
return self._mask_list(value)
return value | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __filter(self, obj):\n filtered_keys = ['file_path', \"Data\", \"raw_block_data\", \"Reserved1\", \"raw\"]\n if isinstance(obj, list):\n return dict([t for t in obj if t[0] not in filtered_keys])\n elif isinstance(obj, dict):\n return {k: self.__filter(v) for k, v in ... | [
"0.5934604",
"0.5906701",
"0.57353526",
"0.5728575",
"0.568431",
"0.544349",
"0.5416225",
"0.54113907",
"0.5407144",
"0.53866047",
"0.53618664",
"0.53585476",
"0.53103936",
"0.5291394",
"0.52232087",
"0.5208283",
"0.5191213",
"0.51746154",
"0.5168266",
"0.51556057",
"0.513415... | 0.63471526 | 0 |
masks all required keys of given dict. | def _mask_dict(self, value):
return MaskedDict(value) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _constrain_keys(self, dictionary):\n\n constrained = { k: dictionary[k] for k in self._keys if k in dictionary }\n return constrained",
"def filter_dic_by_keys(dic,allowed_keys):\n new_dic = {}\n for key in dic:\n if key in allowed_keys:\n new_dic[key] = dic[key]\n re... | [
"0.70720047",
"0.6939193",
"0.6886857",
"0.6400166",
"0.63745916",
"0.6341682",
"0.63234985",
"0.626198",
"0.6232509",
"0.6179334",
"0.6176964",
"0.6052771",
"0.5942515",
"0.5895701",
"0.5892139",
"0.58912116",
"0.58583605",
"0.5822355",
"0.5821932",
"0.57996243",
"0.5797359"... | 0.52084357 | 73 |
Initialize vocabulary from file. | def initialize_vocabulary(vocabulary_path):
if gfile.Exists(vocabulary_path):
rev_vocab = []
with gfile.GFile(vocabulary_path, mode="rb") as f:
rev_vocab.extend(f.readlines())
rev_vocab = [line.strip() for line in rev_vocab]
vocab = dict([(x, y) for (y, x) in enumerate(re... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_vocabulary():\n global vocabulary_list, vocabulary_dict\n vocabulary_list = []\n vocabulary_dict = {}\n\n with open(_VOCABULARY_PATH, 'r') as f:\n for index, line in enumerate(f):\n line = line.strip()\n vocabulary_dict[line] = index\n vocabulary_list.ap... | [
"0.77525496",
"0.76920307",
"0.76315725",
"0.7592861",
"0.75801814",
"0.75644326",
"0.744741",
"0.7426106",
"0.7416072",
"0.71661425",
"0.71474075",
"0.7117412",
"0.70894724",
"0.7076142",
"0.7025968",
"0.6955337",
"0.69535863",
"0.6949669",
"0.69139093",
"0.69139093",
"0.690... | 0.7466838 | 6 |
Tokenize data file and turn into tokenids using given vocabulary file. This function loads data linebyline from data_path, calls the above sentence_to_token_ids, and saves the result to target_path. See comment for sentence_to_token_ids on the details of tokenids format. | def data_to_token_ids(data_path, target_path, vocabulary_path,
tokenizer=None, normalize_digits=True):
if not gfile.Exists(target_path):
print("Tokenizing data in %s" % data_path)
vocab, _ = initialize_vocabulary(vocabulary_path)
with gfile.GFile(data_path, mode="rb") a... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def data_to_token_ids(data_path, target_path, vocabulary_path):\n if not gfile.Exists(target_path):\n print(\"Tokenizing data in %s\" % data_path)\n vocab, _ = initialize_vocabulary(vocabulary_path)\n with gfile.GFile(data_path, mode=\"rb\") as data_file:\n with gfile.GFile(targe... | [
"0.8816745",
"0.8454071",
"0.8386838",
"0.8367866",
"0.8281572",
"0.81035906",
"0.73665535",
"0.7266313",
"0.7236026",
"0.7134199",
"0.70931756",
"0.7089215",
"0.7089215",
"0.70587397",
"0.7038851",
"0.69479877",
"0.6746699",
"0.67301655",
"0.6648532",
"0.6557762",
"0.6437708... | 0.84504086 | 2 |
Version of binary search the searches a list tweets and returns the index of the tweet with datetime closest to targetDate. If no tweet has the same datetime, then it returns the index of the tweet with the closest datetime that is less than targetDate. | def binary_search_tweets_by_date(tweets, targetDate, start, end):
# no exact match in tweets
if (start >= end):
# TODO will this cover edge cases?? (end and beginning of list?)
print("closest? %d" % (start - 1))
return start - 1
middle = int((start + end) / 2)
value = tweets[mid... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _nearest_datetime(self, datetime_list, target_datetime):\n if not datetime_list:\n raise errors.ParserError(\n \"Input parameter datetime_list length is zero. Required\"\n \" parameters: [datetime.datetime], datetime.datetime\")\n work_list = [entry for entry in datetime_list if en... | [
"0.6240756",
"0.5805783",
"0.57438844",
"0.57079625",
"0.5690412",
"0.56784815",
"0.56695646",
"0.5656176",
"0.56467867",
"0.56262356",
"0.5610325",
"0.5540843",
"0.5538456",
"0.5527916",
"0.54886323",
"0.54868394",
"0.5458419",
"0.54359776",
"0.5407455",
"0.53993624",
"0.536... | 0.84336317 | 0 |
Computes the accuracy over the k top predictions for the specified values of k | def recall(output, target):
with torch.no_grad():
pred_mask = output > 0.5
indx = (target == 1).nonzero(as_tuple = True)
pred_ = pred_mask[indx]
sum_val = pred_.cpu().numpy().sum()
num_item = pred_.size(0)
return float(sum_val), num_item | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def topk_accuracy(y, y_pred, k=2):\n pred = []\n for i in range(len(y)):\n if y[i] in y_pred[i][:k]:\n pred.append(1)\n else:\n pred.append(0)\n return sum(pred) / len(pred)",
"def accuracy(y_pred, y_actual, topk=(1, )):\n maxk = max(topk)\n batch_size = y_actua... | [
"0.8331134",
"0.82850444",
"0.82384115",
"0.8230215",
"0.82205373",
"0.8186799",
"0.81852037",
"0.8175596",
"0.8171878",
"0.8170227",
"0.81669253",
"0.8164907",
"0.816416",
"0.8162547",
"0.8162547",
"0.8162547",
"0.8162547",
"0.8162547",
"0.8162547",
"0.8162547",
"0.8162547",... | 0.0 | -1 |
Computes the accuracy over the k top predictions for the specified values of k | def roc(output, target):
with torch.no_grad():
scores = output[:,0]
labels = target[:,0]
fpr, tpr, _ = roc_curve(labels, scores)
roc_auc = auc(fpr, tpr)
return fpr, tpr, roc_auc | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def topk_accuracy(y, y_pred, k=2):\n pred = []\n for i in range(len(y)):\n if y[i] in y_pred[i][:k]:\n pred.append(1)\n else:\n pred.append(0)\n return sum(pred) / len(pred)",
"def accuracy(y_pred, y_actual, topk=(1, )):\n maxk = max(topk)\n batch_size = y_actua... | [
"0.8330614",
"0.8285004",
"0.82375455",
"0.8229273",
"0.82195294",
"0.8185992",
"0.8184316",
"0.8174685",
"0.817106",
"0.8169587",
"0.8166069",
"0.8164076",
"0.816332",
"0.816176",
"0.816176",
"0.816176",
"0.816176",
"0.816176",
"0.816176",
"0.816176",
"0.816176",
"0.816176... | 0.0 | -1 |
find the key(s) as a list given a value | def get_key(self, value):
return [item[0] for item in self.items() if item[1] == value] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getKeysByValue(dictOfElements, valueToFind):\n listOfKeys = list()\n listOfItems = dictOfElements.items()\n for item in listOfItems:\n if valueToFind in item[1]:\n listOfKeys.append(item[0])\n return listOfKeys",
"def getKeyObjs(self,\n key,\n ... | [
"0.7294867",
"0.7202516",
"0.67429525",
"0.6727987",
"0.6690367",
"0.6680713",
"0.6617256",
"0.65429217",
"0.6519446",
"0.6498922",
"0.64938074",
"0.647499",
"0.63790405",
"0.6359644",
"0.6346069",
"0.6284425",
"0.6282641",
"0.6272108",
"0.62660825",
"0.62537044",
"0.6244109"... | 0.68743443 | 2 |
The logs destination table name in LogAnalytics. | def destination_table(self) -> str:
return pulumi.get(self, "destination_table") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def table_name() -> str:\n pass",
"def table_name(self) -> str:\n return self.model._meta.db_table",
"def table_name(self):\n return self._new_table.name",
"def destination_name(self) -> str:\n return jsii.get(self, \"destinationName\")",
"def table(self):\n return self._... | [
"0.65109307",
"0.6300741",
"0.6298458",
"0.6218483",
"0.620911",
"0.61835194",
"0.6166983",
"0.6013469",
"0.5985346",
"0.5982442",
"0.59794414",
"0.59794414",
"0.59794414",
"0.59489053",
"0.5928267",
"0.58581996",
"0.58544797",
"0.58007693",
"0.5798249",
"0.5777849",
"0.57715... | 0.78806025 | 0 |
The kind of the data connector Expected value is 'AmazonWebServicesS3'. | def kind(self) -> str:
return pulumi.get(self, "kind") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def type(self):\n return 's3_file'",
"def s3(self) -> Optional[pulumi.Input['FlowSourceFlowConfigSourceConnectorPropertiesS3Args']]:\n return pulumi.get(self, \"s3\")",
"def s3(self) -> Optional[pulumi.Input['FlowDestinationFlowConfigDestinationConnectorPropertiesS3Args']]:\n return pulumi... | [
"0.7101592",
"0.6382904",
"0.62786746",
"0.6172987",
"0.5983033",
"0.5960209",
"0.5882715",
"0.5785173",
"0.56921196",
"0.56104594",
"0.55726856",
"0.5519479",
"0.5505047",
"0.54568756",
"0.54085416",
"0.5391368",
"0.5383419",
"0.538221",
"0.53737456",
"0.5356605",
"0.5336429... | 0.0 | -1 |
The Aws Role Arn that is used to access the Aws account. | def role_arn(self) -> str:
return pulumi.get(self, "role_arn") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def role_arn(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"role_arn\")",
"def iam_role_arn(self) -> str:\n return pulumi.get(self, \"iam_role_arn\")",
"def role_arn(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"role_arn\")",
"def role_arn(self) -> Optional[... | [
"0.7859716",
"0.7818562",
"0.7792153",
"0.7790065",
"0.7790065",
"0.7646814",
"0.7646814",
"0.7646814",
"0.7646814",
"0.75785947",
"0.754369",
"0.7472943",
"0.7472943",
"0.7425578",
"0.7425578",
"0.730205",
"0.7194245",
"0.71664315",
"0.69302464",
"0.6870352",
"0.6862583",
... | 0.825717 | 0 |
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" | def type(self) -> str:
return pulumi.get(self, "type") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def resource_type(self) -> Optional[str]:\n return pulumi.get(self, \"resource_type\")",
"def resource_type(self) -> Optional[str]:\n return pulumi.get(self, \"resource_type\")",
"def resource_type(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"resource_type\")",
"def ... | [
"0.79189175",
"0.79189175",
"0.786668",
"0.786668",
"0.786668",
"0.786668",
"0.786668",
"0.7708302",
"0.7553687",
"0.7282897",
"0.70600027",
"0.6980107",
"0.69215655",
"0.6869818",
"0.67290455",
"0.67049664",
"0.66546607",
"0.6647418",
"0.6551141",
"0.65431774",
"0.65431774",... | 0.6639902 | 47 |
Gets a data connector. | def get_aws_s3_data_connector(data_connector_id: Optional[str] = None,
resource_group_name: Optional[str] = None,
workspace_name: Optional[str] = None,
opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetAwsS3DataConnector... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def connector(self):\n if '_connector' not in self.__dict__:\n from meerschaum.connectors.parse import parse_instance_keys\n conn = parse_instance_keys(self.connector_keys)\n if conn:\n self._connector = conn\n else:\n return None\n ... | [
"0.716545",
"0.69513404",
"0.6916345",
"0.6474228",
"0.62699723",
"0.59994715",
"0.5985978",
"0.59775656",
"0.5926097",
"0.59190464",
"0.57951444",
"0.5786412",
"0.57449067",
"0.57268184",
"0.5652334",
"0.5602421",
"0.55951303",
"0.5580157",
"0.5568359",
"0.5560098",
"0.55547... | 0.5302964 | 38 |
Gets a data connector. | def get_aws_s3_data_connector_output(data_connector_id: Optional[pulumi.Input[str]] = None,
resource_group_name: Optional[pulumi.Input[str]] = None,
workspace_name: Optional[pulumi.Input[str]] = None,
opts: Op... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def connector(self):\n if '_connector' not in self.__dict__:\n from meerschaum.connectors.parse import parse_instance_keys\n conn = parse_instance_keys(self.connector_keys)\n if conn:\n self._connector = conn\n else:\n return None\n ... | [
"0.716545",
"0.69513404",
"0.6916345",
"0.6474228",
"0.62699723",
"0.59994715",
"0.5985978",
"0.59775656",
"0.5926097",
"0.59190464",
"0.57951444",
"0.5786412",
"0.57449067",
"0.57268184",
"0.5652334",
"0.5602421",
"0.55951303",
"0.5580157",
"0.5568359",
"0.5560098",
"0.55547... | 0.0 | -1 |
r"""Return Symmetric transfer error for correspondences given the homography matrix. | def symmetric_transfer_error(
pts1: torch.Tensor, pts2: torch.Tensor, H: torch.Tensor, squared: bool = True, eps: float = 1e-8
) -> torch.Tensor:
if not isinstance(H, torch.Tensor):
raise TypeError(f"H type is not a torch.Tensor. Got {type(H)}")
if (len(H.shape) != 3) or not H.shape[-2:] == (3, 3):... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def numerical_discretization_error(h,phi,verbose=True):\n \n # Constants\n F_s = 1.25\n C_low = 0.95\n C_hi = 3.05\n delta_M = max(abs(phi[1]-phi[0]),abs(phi[2]-phi[1]),abs(phi[2]-phi[0]))\n \n # Mesh refinement ratios\n r21 = h[1]/h[0]\n r32 = h[2]/h[1]\n \n # Result ratios\n ... | [
"0.5850211",
"0.5575032",
"0.5415471",
"0.54094034",
"0.5363411",
"0.53338623",
"0.52439326",
"0.51818657",
"0.5167479",
"0.50386864",
"0.5029029",
"0.5026875",
"0.5023002",
"0.50207406",
"0.49991953",
"0.4997481",
"0.4996831",
"0.49913982",
"0.4975098",
"0.49723813",
"0.4963... | 0.5767665 | 1 |
The position of the bins for the histogram based on the current state. | def bins(self):
if self.hist_x_min is None or self.hist_x_max is None or self.hist_n_bin is None:
return None
if self.x_log:
return np.logspace(np.log10(self.hist_x_min),
np.log10(self.hist_x_max),
self.hist_n_bin + ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _state_index(state):\n delta_y, delta_x, bird_lmh, pipe_lmh, is_flapping = state\n actions, height, width, _, _, _ = Q.shape\n\n y = int((height / 2) + (delta_y / step_r) - 1)\n x = int((width / 2) + (delta_x / step_c) - 1)\n\n return y, x, bird_lmh, pipe_lmh, is_flapping",
... | [
"0.6542076",
"0.64838105",
"0.6472693",
"0.6454198",
"0.6454198",
"0.63957804",
"0.6357156",
"0.63331324",
"0.6308721",
"0.61814",
"0.61669534",
"0.6082462",
"0.60565984",
"0.6012493",
"0.5985953",
"0.59749657",
"0.59617686",
"0.59433514",
"0.59186447",
"0.59174275",
"0.58810... | 0.66593826 | 0 |
Gets all the students enrolled at a given discipline. | def get_all_enrolled(self, discipline_id):
students = MyCollection()
for item in self.__student_repository.get_all():
newID = str(discipline_id) + "." + str(item.entity_id)
if not self.__link_repository.find_by_id(newID) is None:
students.append(item)
retu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_list_of_students(self):\n return self._students",
"def see_course_students(self, username: str, token: str, course_abbreviation: str) -> List[Tuple[str, float]]:\n\n # Validate user first\n if not self.validate(username=username, token=token, check_privilege='instructor'):\n ... | [
"0.6636556",
"0.65213585",
"0.64412504",
"0.63758266",
"0.6309053",
"0.60178405",
"0.6000484",
"0.5990565",
"0.58965695",
"0.5857444",
"0.58322364",
"0.5810654",
"0.5789635",
"0.5771224",
"0.57041836",
"0.5665716",
"0.56607765",
"0.56401736",
"0.56319636",
"0.56120855",
"0.56... | 0.8016953 | 0 |
Returns the number of rows | def getHeight(self):
return len(self._data) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getNumRows(self) -> int:\n ...",
"def num_rows(self):\n return (len(self.rows))",
"def row_count(self) -> int:\n return len(self.rows)",
"def row_count(self) -> int:\n return len(self.rows)",
"def num_rows(self):\n return len(self.rows)",
"def get_num_rows(self):\n ... | [
"0.9167888",
"0.87361133",
"0.8671115",
"0.8671115",
"0.8664039",
"0.859863",
"0.8573683",
"0.85122824",
"0.84661454",
"0.8450843",
"0.8403553",
"0.83711433",
"0.8354763",
"0.8353423",
"0.8316117",
"0.8315366",
"0.8231687",
"0.81339204",
"0.8110674",
"0.79617697",
"0.79578274... | 0.0 | -1 |
Returns current date_time as a string formatted according to date_time_format | def getCurTime(date_time_format):
date_time = datetime.now().strftime(date_time_format)
return date_time | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_datetime_string():\n return datetime.now().strftime(DATETIME_FORMAT)",
"def get_current_datetime_string ( ) :\n return get_current_datetime( ).strftime( \"%Y%m%d-%H%M%S\" )",
"def get_date_time():\n date_time = datetime.now()\n date_time_string = date_time.strftime(\"%b-%d-%Y (%H:%M:%S)\")\n... | [
"0.78290385",
"0.7808572",
"0.7717457",
"0.76274353",
"0.75742733",
"0.75616765",
"0.75522995",
"0.7446897",
"0.7428614",
"0.7423829",
"0.7372298",
"0.7340058",
"0.7332794",
"0.7331382",
"0.7287851",
"0.7236078",
"0.72161525",
"0.7209651",
"0.7204208",
"0.7161558",
"0.7138435... | 0.74127203 | 10 |
Equivalence testing. Includes add options. Uses np.isclose/allclose because of floating point errors. | def __eq__(self, other):
if self.add_mode != other.add_mode:
return False
if not np.isclose(self.add_tol, other.add_tol):
return False
if not np.isclose(self.top, other.top):
return False
if not np.isclose(self.base, other.base):
return Fa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def approx_eq(a, b):\n return abs(a-b) < approx_eq.eps",
"def testEquality(self):\n pass",
"def test_equal7():\n x = randtool(\"float\", -10, 10, [3, 3, 1])\n y = randtool(\"float\", -10, 10, [3, 3, 3, 1])\n res = np.equal(x, y)\n obj.run(res=res, x=x, y=y)",
"def test_equivalent():\n ... | [
"0.66884506",
"0.66298187",
"0.6588867",
"0.6521295",
"0.65080017",
"0.64760125",
"0.6457921",
"0.64531416",
"0.64067405",
"0.64042586",
"0.6397953",
"0.63951844",
"0.6378238",
"0.637586",
"0.6370783",
"0.6356843",
"0.6336451",
"0.6333534",
"0.6326138",
"0.63204026",
"0.63084... | 0.59338415 | 61 |
Error raised on `mincount` or `maxcount` mismatch. | def __init__(self, msg, result):
if result:
msg += " " + repr(result)
super(CountError, self).__init__(msg) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_value_error(self):\n with self.assertRaises(ValueError):\n Band.count(\n column=Band.name, distinct=[Band.name, Band.popularity]\n ).run_sync()",
"def __check_args_val(self):\n if self.__min_range < 0:\n error_msg = \"min_range must be greate... | [
"0.625764",
"0.59701705",
"0.5904351",
"0.5852577",
"0.5842705",
"0.58019817",
"0.57818514",
"0.5766287",
"0.5730042",
"0.57134247",
"0.564207",
"0.5638233",
"0.5618093",
"0.5579585",
"0.5578919",
"0.5570125",
"0.5550614",
"0.5542382",
"0.5519826",
"0.55096906",
"0.5508919",
... | 0.0 | -1 |
Compute softmax values for each sets of scores in x. | def softmax(x, axis=1):
sf = np.exp(x)
sf = sf/np.sum(sf, axis=axis)[:,np.newaxis]
return sf | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def softmax(self, scores):\n\n\n # for each sample, for each class ,caclulate\n # np.exp(scores) : still (n_samples, n_classes)\n\n # axis = 1\n # a00, a01, a02 as a sinlge one to perfrom np_sum\n # which is the same sample \n # sum_exp : still (n_samples, 1)\n\n # ... | [
"0.77987385",
"0.7762009",
"0.7761647",
"0.77591646",
"0.76599663",
"0.76599663",
"0.76599663",
"0.76599663",
"0.75852114",
"0.743222",
"0.7408266",
"0.739256",
"0.73593086",
"0.73172486",
"0.7269417",
"0.7262718",
"0.72612756",
"0.72568876",
"0.7230255",
"0.7215012",
"0.7201... | 0.0 | -1 |
Gets the mapping between the quantized itds and their indices in array format. For example, if max_itd was 10 and number of bins are 4, then the mapping is [7.5, 2.5, 2.5, 7.5] so that the itds in [10, 5] get mapped to 7.5, itds in [5, 0] get mapped to 2.5 and so on. | def get_itd_dict(max_itd, num_bins):
bin_length = 2 * max_itd / num_bins
return np.array([-max_itd + (idx + 0.5) * bin_length for idx in range(num_bins)], dtype=np.float32) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mapping(nside, angs):\n\n\tnpix = hp.nside2npix(nside)\n\tmaph = np.zeros(npix)\n\n\tpix = hp.ang2pix(nside, angs[:, 1], angs[:, 0])\n\tvals, times = np.unique(pix, return_counts=True)\n\n\tmaph[vals] = times\n\tmaph *= float(npix)/len(angs)\n\n\treturn maph",
"def expanded_counts_map(self):\n if self... | [
"0.573825",
"0.5602729",
"0.5558952",
"0.5529166",
"0.55139065",
"0.54682636",
"0.5410151",
"0.5392798",
"0.53857505",
"0.5366342",
"0.53211",
"0.5304279",
"0.5264794",
"0.5264794",
"0.5255112",
"0.52435905",
"0.52350354",
"0.523417",
"0.52142906",
"0.5166145",
"0.5109116",
... | 0.7774667 | 0 |
Apply the aggfunc over all record in the pivoted key. | def reduce(self, key, values, task):
agg = None
for val in values:
record = happy.json.decode(val)
agg = self.func(agg, record)
if self.is_dict:
dict = {self.aggkey: key}
dict.update(agg)
else:
dict = {self.aggkey: key, self.agg... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def agg(self, arg):\n # DataFrame{'a': [1, 1, 2], 'b': [1, 2, 3], 'c': [2, 2, 1]})\n # a.groupby('a').agg('sum') -- applied on rest\n # a.groupby('a').agg(['sum', 'min']) -- both applied on rest\n # a.groupby('a').agg({'b': ['min', 'mean']}) -- applied on\n # TODO\n # a.gr... | [
"0.6628297",
"0.63989544",
"0.6041443",
"0.5890193",
"0.58217376",
"0.5793229",
"0.57927704",
"0.57683957",
"0.5751809",
"0.57484484",
"0.558088",
"0.5578804",
"0.556982",
"0.5560431",
"0.5559629",
"0.55526286",
"0.5543373",
"0.55056953",
"0.5423093",
"0.5420336",
"0.54202354... | 0.5772775 | 7 |
Renders the home page which is the CNS of the web app currently, nothing pretty. | def home():
# Configuration for RDS instance
mode="append"
jdbc_url = "jdbc:postgresql://momentum-db.cgk0xpvhfuev.us-east-2.rds.amazonaws.com:5432/postgres"
config = {"user":"root",
"password": "rootroot",
"driver":"org.postgresql.Driver"}
form = SubmissionForm(request.form)
#vari... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def render_home():\r\n\treturn render_template(\"index.html\")",
"def home():\n\n return render_template('home_page.html')",
"def home():\n\n\treturn render_template('index.html', title='Home Page',\n\t\t\t\t\t\t year=datetime.now().year)",
"def home():\n return render_template('homepage.html')",
"... | [
"0.8199188",
"0.80576104",
"0.80488557",
"0.8033065",
"0.8031662",
"0.7976707",
"0.7973834",
"0.7964061",
"0.79375345",
"0.7927567",
"0.7913349",
"0.79078937",
"0.7893412",
"0.7892316",
"0.7892316",
"0.7884442",
"0.7884442",
"0.7882657",
"0.78776795",
"0.78776795",
"0.7877679... | 0.0 | -1 |
Renders the about page. | def about():
return render_template(
'about.html',
title='Tools',
year=datetime.now().year,
message='Your application description page.'
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def about():\n return render_template('about.html', title='About')",
"def about():\n\n return render_template('about_page.html', title='About')",
"def about():\n\n\treturn render_template(\"about.html\")",
"def on_about(self):\n render_about_window()",
"def about():\n return render_temp... | [
"0.85650355",
"0.85034525",
"0.84489655",
"0.84044397",
"0.8394454",
"0.82935613",
"0.82709616",
"0.82709616",
"0.82709616",
"0.82709616",
"0.82709616",
"0.82709616",
"0.82709616",
"0.82709616",
"0.82709616",
"0.82709616",
"0.82709616",
"0.82709616",
"0.82709616",
"0.82680845",... | 0.80967313 | 27 |
Ensure the application is setup for testing. | def setUp(self):
self.fixtures_path = os.path.join(
os.path.dirname(os.path.abspath(__file__)), "fixtures/"
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setUp(self):\n self.app = app.test_client()\n self.app.testing = True",
"def setUp(self):\r\n self.app = app.test_client()\r\n self.app.testing = True",
"def setUp(self) -> None:\n self.app = app.app.test_client()\n self.app.testing = True",
"def setUp(self):\n ... | [
"0.81337184",
"0.8072278",
"0.8020857",
"0.8011397",
"0.8000315",
"0.7987713",
"0.79771906",
"0.7976462",
"0.7975251",
"0.79618055",
"0.79618055",
"0.7932902",
"0.7932902",
"0.7932902",
"0.79290366",
"0.7928467",
"0.7927925",
"0.7881998",
"0.7845801",
"0.784254",
"0.784254",
... | 0.0 | -1 |
Tests whether ``Emoji.is_unicode_emoji`` works as intended. | def test__Emoji__is_unicode_emoji():
emoji = BUILTIN_EMOJIS['x']
vampytest.assert_true(emoji.is_unicode_emoji())
emoji = Emoji()
vampytest.assert_false(emoji.is_unicode_emoji()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_unicode_emoji(self):\n ...",
"def isUnicodeEmoji(c : str) -> bool:\n return c in UNICODE_EMOJI",
"def is_custom_emoji(self):\n ...",
"def isemoji(c):\n if type(c) == str:\n c = c.encode('utf-8')\n c = bytes(c)\n return c.decode() in UNICODE_EMOJI",
"def test__Emoji__... | [
"0.88940513",
"0.8131408",
"0.7909953",
"0.7290816",
"0.7220463",
"0.7157336",
"0.6910333",
"0.6644217",
"0.6623495",
"0.6515711",
"0.6499878",
"0.6453534",
"0.63682616",
"0.6361044",
"0.6201488",
"0.6195488",
"0.61566913",
"0.61179996",
"0.6096853",
"0.60940593",
"0.60675395... | 0.8479685 | 1 |
Tests whether ``Emoji.as_emoji`` works as intended. | def test__Emoji__as_emoji():
emoji = BUILTIN_EMOJIS['x']
vampytest.assert_instance(emoji.as_emoji, str)
emoji = Emoji()
vampytest.assert_instance(emoji.as_emoji, str) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_unicode_emoji(self):\n ...",
"def is_custom_emoji(self):\n ...",
"def test__Emoji__is_unicode_emoji():\n emoji = BUILTIN_EMOJIS['x']\n vampytest.assert_true(emoji.is_unicode_emoji())\n \n emoji = Emoji()\n vampytest.assert_false(emoji.is_unicode_emoji())",
"def test__Emoji... | [
"0.8034817",
"0.7946594",
"0.78906673",
"0.7661292",
"0.74768245",
"0.7103569",
"0.7062346",
"0.70191073",
"0.69194645",
"0.68687993",
"0.6687607",
"0.6584737",
"0.6531542",
"0.64271945",
"0.63429177",
"0.6295433",
"0.62394994",
"0.61641717",
"0.600939",
"0.5991873",
"0.59451... | 0.7849484 | 3 |
Tests whether ``Emoji.as_emoji`` works as intended. | def test__Emoji__created_at():
emoji = BUILTIN_EMOJIS['x']
vampytest.assert_instance(emoji.created_at, DateTime)
emoji = Emoji()
vampytest.assert_instance(emoji.created_at, DateTime)
emoji_id = 202301010044
emoji = Emoji.precreate(emoji_id)
vampytest.assert_instance(emoji.created_a... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_unicode_emoji(self):\n ...",
"def is_custom_emoji(self):\n ...",
"def test__Emoji__is_unicode_emoji():\n emoji = BUILTIN_EMOJIS['x']\n vampytest.assert_true(emoji.is_unicode_emoji())\n \n emoji = Emoji()\n vampytest.assert_false(emoji.is_unicode_emoji())",
"def test__Emoji... | [
"0.80345666",
"0.7946438",
"0.7890378",
"0.7849855",
"0.7661249",
"0.74768496",
"0.7104061",
"0.7062429",
"0.7019053",
"0.69196486",
"0.68689847",
"0.66875017",
"0.65847075",
"0.65316683",
"0.6426341",
"0.6343639",
"0.6295995",
"0.6240001",
"0.6164506",
"0.60098535",
"0.59914... | 0.51115566 | 64 |
Tests whether ``Emoji.url_as`` works as intended. | def test__emoji__url_as():
emoji = BUILTIN_EMOJIS['x']
vampytest.assert_is(emoji.url_as(), None)
emoji = Emoji()
vampytest.assert_instance(emoji.url_as(), str) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test__emoji__url():\n emoji = BUILTIN_EMOJIS['x']\n vampytest.assert_is(emoji.url, None)\n\n emoji = Emoji()\n vampytest.assert_instance(emoji.url, str)",
"def _is_url(string):\n return \"http\" in string",
"def __isUrl(self, url):\n if type(url)==str:\n return url.startswi... | [
"0.7296026",
"0.6418828",
"0.6296035",
"0.62819874",
"0.6280449",
"0.62021464",
"0.6181494",
"0.6174985",
"0.6170844",
"0.6158205",
"0.6143138",
"0.6077028",
"0.60766995",
"0.6046148",
"0.6036756",
"0.6006145",
"0.60017115",
"0.5981001",
"0.5961318",
"0.5954714",
"0.59336215"... | 0.77342886 | 0 |
Returns the data type for this input. | def getDataType(self):
return self._dataType | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def data_type(self):\r\n return self._data_type",
"def data_type(self):\n return self._data_type",
"def data_type(self):\n return self._data_type",
"def data_type(self):\n return self._data_type",
"def data_type(self) -> int:\n return self.data[\"args\"][\"dataType\"]",
... | [
"0.8530812",
"0.850248",
"0.850248",
"0.850248",
"0.8316372",
"0.81443715",
"0.80893695",
"0.8044638",
"0.79946756",
"0.79320747",
"0.78541845",
"0.76246744",
"0.76058185",
"0.7539731",
"0.7506998",
"0.7506998",
"0.7506998",
"0.7506998",
"0.7506998",
"0.7506998",
"0.7490063",... | 0.8077339 | 7 |
Gets the connection of this input. | def getConnection(self):
return self._connection | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def connection(self):\n return self.get_connection()",
"def get_connection(self):\n return self.connection",
"def get_connection(self):\n return self.connection",
"def get_connection(self):\n\n return self.REMOTE_CONNECTION",
"def get_connection(self):\n return self._conn... | [
"0.7793481",
"0.77450186",
"0.77450186",
"0.7708858",
"0.76813614",
"0.76813614",
"0.75481796",
"0.75481796",
"0.75481796",
"0.7475889",
"0.7441586",
"0.73879254",
"0.7254571",
"0.7221151",
"0.71862173",
"0.71638554",
"0.7111704",
"0.70047295",
"0.6985687",
"0.69437593",
"0.6... | 0.7245913 | 13 |
Registers the given type with the given mapping. The mapping is as dictionary representing the part below the ``mappings/type_name``. | def register_type(self, type_name, mapping, model=None):
assert type_name not in self.mappings
self.mappings[type_name] = TypeMapping(type_name, mapping, model) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def register_type(type, factory):\n\n _types[type] = factory",
"def addMapping(self, baseType, refType):\n if not self.apiName(baseType) or not self.apiName(refType):\n self.logMsg('diag', 'ScriptOutputGenerator::addMapping: IGNORE map from', baseType, '<->', refType)\n return\n\n... | [
"0.659044",
"0.62441874",
"0.61884737",
"0.6116328",
"0.6108244",
"0.6079804",
"0.59829605",
"0.59829605",
"0.5971039",
"0.5866957",
"0.5824829",
"0.5775262",
"0.570444",
"0.56397647",
"0.55957794",
"0.55684936",
"0.54903",
"0.54837775",
"0.54763997",
"0.546228",
"0.54155296"... | 0.83780503 | 0 |
Return the first_name plus the last_name, with a space in between. | def get_full_name(self):
full_name = '%s %s' % (self.first_name, self.last_name)
return full_name.strip() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def full_name(first_name, last_name):\n return first_name + \" \" + last_name",
"def full_name(first_name, last_name):\n\t\n\treturn first_name + \" \" + last_name",
"def get_formated_name(first_name,last_name):\n\tfull_name = first_name + '' + last_name\n\treturn full_name.title()",
"def get_full_name(se... | [
"0.83424175",
"0.8227792",
"0.8099884",
"0.80680513",
"0.80531704",
"0.8045193",
"0.7995028",
"0.799401",
"0.799401",
"0.799401",
"0.79797614",
"0.7964116",
"0.79576445",
"0.79403675",
"0.7937235",
"0.7933996",
"0.7915679",
"0.79016924",
"0.78933924",
"0.7869724",
"0.7856853"... | 0.7787285 | 46 |
Returns if the given point is within the region's bounds. | def within(self, x, y):
return x >= self.top_x and x <= self.bottom_x and y >= self.bottom_y and y <= self.top_y | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_point_in(self, point):\n return (self.upperleft[0] <= point[0] <= self.upperright[0] and self.upperleft[1] <= point[1] <= self.bottomleft[1])",
"def is_point_in(self, point):\n return (self.upperleft[0] <= point[0] <= self.upperright[0] and self.upperleft[1] <= point[1] <= self.bottomleft[1]... | [
"0.82760227",
"0.82760227",
"0.8240641",
"0.8236321",
"0.793338",
"0.7882126",
"0.7774449",
"0.77332246",
"0.7725425",
"0.77082616",
"0.769302",
"0.7682509",
"0.76629364",
"0.7659592",
"0.76361287",
"0.7554421",
"0.7554421",
"0.75246084",
"0.75089645",
"0.75038016",
"0.749756... | 0.70205784 | 45 |
Generate a random string with the combination of lowercase and uppercase letters | def randomString(stringLength):
letters = string.ascii_letters
return ''.join(random.choice(letters) for i in range(stringLength)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def random_string(length=1, uppercase=False, lowercase=False):\n characters = digits\n code = str()\n\n if uppercase:\n characters += ascii_uppercase\n if lowercase:\n characters += ascii_lowercase\n\n while len(code) < length:\n character = choice(characters)\n if len(co... | [
"0.7946826",
"0.7738986",
"0.7679305",
"0.7657063",
"0.7609224",
"0.7529105",
"0.7509637",
"0.74899936",
"0.73721504",
"0.73713845",
"0.73095775",
"0.7270342",
"0.7263459",
"0.7245338",
"0.7229803",
"0.7196288",
"0.7176311",
"0.71762294",
"0.7166171",
"0.7165482",
"0.7164123"... | 0.0 | -1 |
Implements the sigmoid activation in numpy | def sigmoid(Z):
A = 1 / (1 + np.exp(-Z))
cache = Z
return A, cache | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sigmoid(x: np.ndarray \n ) -> np.ndarray:\n return 1/(1+np.exp(-x))",
"def sigmoid(X,W,b):\n preActivation = np.dot(X, W) + b\n return (1.0)/(1.0 + np.exp(-preActivation))",
"def sigmoid_activation(x):\n return 1.0 / (1 + np.exp(-x))",
"def sigmoid(x):\r\n return 1 / (1 + ... | [
"0.8374216",
"0.8308304",
"0.8258762",
"0.8215258",
"0.8150142",
"0.8140216",
"0.8140216",
"0.8140216",
"0.8140216",
"0.8140216",
"0.8140216",
"0.8125962",
"0.81212926",
"0.81212926",
"0.80962545",
"0.8082652",
"0.8068939",
"0.80095696",
"0.80017805",
"0.79810584",
"0.7977735... | 0.0 | -1 |
Implement the backward propagation for a single RELU unit. | def relu_backward(dA, cache):
Z = cache
dZ = np.array(dA, copy=True) # just converting dz to a correct object.
# When z <= 0, you should set dz to 0 as well.
dZ[Z <= 0] = 0
assert (dZ.shape == Z.shape)
return dZ | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def backward(ctx, grad_output):\n loss, reg, u, lbda = ctx.saved_tensors\n\n device = u.device\n\n # do clever computations\n eps = 1e-10\n grad, = torch.autograd.grad(loss, u, only_inputs=True,\n retain_graph=True)\n x = (u - eps * grad)... | [
"0.7334515",
"0.7148403",
"0.7119119",
"0.71164113",
"0.7100485",
"0.70844537",
"0.70552343",
"0.7051098",
"0.70438045",
"0.6991595",
"0.6959472",
"0.6944986",
"0.69260585",
"0.69260585",
"0.69166666",
"0.6907065",
"0.6907065",
"0.68829346",
"0.6877464",
"0.6859403",
"0.68530... | 0.0 | -1 |
Mock invalid resource request | def test_failed_get_resource(self, mock_spotify_api_class, invalid_request):
with patch('bpm.spotify.requests.get') as mock_requests:
mock_requests.return_value = invalid_request
result = mock_spotify_api_class.get_resource("")
assert result == {} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_request_invalid_resource(self):\n response = requests.get(self.url + '/invalid')\n\n self.assertEqual(response.status_code, 404)",
"def test_request_users_user_invalid_resource(self):\n response = requests.get(self.url + '/users/John/invalid')\n\n self.assertEqual(response.st... | [
"0.7710774",
"0.71495163",
"0.70958686",
"0.7039983",
"0.69686395",
"0.69127584",
"0.68761307",
"0.6871811",
"0.6862427",
"0.6808083",
"0.6799884",
"0.678101",
"0.6778663",
"0.67719936",
"0.677014",
"0.67622745",
"0.67454875",
"0.67185193",
"0.6689774",
"0.6657523",
"0.665510... | 0.7731558 | 0 |
Mock invalid get_artist request | def test_failed_get_artist(self, mock_spotify_api_class, invalid_request):
with patch('bpm.spotify.requests.get') as mock_requests:
mock_requests.return_value = invalid_request
result = mock_spotify_api_class.get_artist("")
assert result == {} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_artist_uri_exception(self):\n with mock.patch(\"spotlogin_api.get_artists_call\", self.mock_key):\n result = spotify_login.get_artists(self.user[INPUT])\n self.assertEqual(result, [])",
"def test_artist_uri(self):\n expect = [\"1\", \"2\", \"3\"]\n with mock.patch(... | [
"0.8202394",
"0.7825108",
"0.7747017",
"0.7682118",
"0.7655476",
"0.7509539",
"0.713856",
"0.68857276",
"0.67138904",
"0.6677388",
"0.66096854",
"0.65280837",
"0.6525405",
"0.63761026",
"0.6369316",
"0.6367515",
"0.63253385",
"0.618725",
"0.6176389",
"0.6174812",
"0.6141477",... | 0.8042449 | 1 |
Mock invalid get_album request | def test_failed_get_album(self, mock_spotify_api_class, invalid_request):
with patch('bpm.spotify.requests.get') as mock_requests:
mock_requests.return_value = invalid_request
result = mock_spotify_api_class.get_album("")
assert result == {} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_successful_get_album(self, mock_spotify_api_class, valid_request):\n\n with patch('bpm.spotify.requests.get') as mock_requests:\n mock_requests.return_value = valid_request\n result = mock_spotify_api_class.get_album(\n lookup_id=\"mock_album_id\")\n ... | [
"0.75944906",
"0.69998634",
"0.66803163",
"0.6554143",
"0.65514165",
"0.6549048",
"0.6463268",
"0.6393017",
"0.63563603",
"0.63479763",
"0.6307147",
"0.62963694",
"0.6293594",
"0.628512",
"0.62592274",
"0.6228446",
"0.6209262",
"0.61892456",
"0.61891246",
"0.61663604",
"0.614... | 0.80538833 | 0 |
Clean feature text by removing some trigger words. | def _setCleanString(self, words):
if self.type=='DIAGNOSIS':
excludes = ['DX']
elif self.type == 'SECOND_LEVEL_DIAGNOSIS':
#excludes = ['Assessment','Impression', 'Possible', 'ModifierCertainty']
excludes = ['Assessment','Impression']
elif self.type =... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clean_text(text):\n global cleaned_text\n # remove numbers\n text_nonum = re.sub(r'\\d+', '', text)\n # remove punctuations and convert characters to lower case\n text_nopunct = \"\".join([char.lower() for char in text_nonum if char not in string.punctuation]) \n # sub... | [
"0.69853854",
"0.68567544",
"0.68567544",
"0.68567544",
"0.68567544",
"0.68567544",
"0.68567544",
"0.67625684",
"0.67229354",
"0.6711405",
"0.66636276",
"0.66161007",
"0.6605238",
"0.65820163",
"0.6540656",
"0.6537748",
"0.6535306",
"0.65057236",
"0.649371",
"0.6470646",
"0.6... | 0.0 | -1 |
Get list of SubsetClass objects | def get_subset_list(self):
return self.subset_list | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_subclasses(self, class_name):\n return class_name.__subclasses__()",
"def get_subclasses(base_class: callable) -> list:\n all_subclasses = []\n\n for subclass in base_class.__subclasses__():\n if not inspect.isabstract(subclass):\n all_subclasses.append(subclass)\n a... | [
"0.75091916",
"0.7346443",
"0.7221337",
"0.7215894",
"0.71816915",
"0.7139952",
"0.7101745",
"0.7056139",
"0.70469975",
"0.70382833",
"0.7025034",
"0.70103014",
"0.6997125",
"0.697387",
"0.6952888",
"0.69027346",
"0.69002396",
"0.6820751",
"0.68092775",
"0.6805835",
"0.676698... | 0.0 | -1 |
Parses product's original price. | def _parse_price_original(self, response, add_xpath=None):
xpathes = '//*[@id="price"]/.//*[contains(@class, "a-text-strike")]' \
'/text()'
if add_xpath:
xpathes += ' |' + add_xpath
price_original = response.xpath(xpathes).re(FLOATING_POINT_RGEX)
if price_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_product_price(self):\n\n price = \"0.0000\"\n\n try:\n price = self.trees.get_element_by_id(\"priceblock_ourprice\").text\n except:\n try:\n price = self.trees.get_element_by_id(\n \"price_inside_buybox\").text\n except... | [
"0.6839624",
"0.65610844",
"0.6504688",
"0.6498432",
"0.648165",
"0.6474342",
"0.6441958",
"0.6412932",
"0.6395594",
"0.6359413",
"0.63303304",
"0.6290909",
"0.62858135",
"0.6274683",
"0.62719834",
"0.62652487",
"0.6217433",
"0.6181562",
"0.616996",
"0.6154291",
"0.613523",
... | 0.7738633 | 0 |
Tear down table Review of database used for tests. | def tearDown(self) -> None:
user = storage.get(User, self.user_id)
if user is not None:
storage.delete(user)
city = storage.get(City, self.city_id)
if city is not None:
storage.delete(city)
state = storage.get(State, self.state_id)
if state is not ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tearDown(self):\n Review.query.delete()",
"def tearDown(self):\n QuestionerDB.destroy_tables()",
"def tearDown(self):\n del self.review",
"def tearDown(self):\r\n\r\n db.session.rollback()\r\n db.drop_all()",
"def tearDown(self):\n\n # Remove all tables from te... | [
"0.7806141",
"0.7200003",
"0.70534617",
"0.69181514",
"0.6877547",
"0.6851557",
"0.683085",
"0.68290234",
"0.6826844",
"0.68198663",
"0.68195254",
"0.6807949",
"0.6804568",
"0.6793951",
"0.6793951",
"0.6773339",
"0.67720014",
"0.67720014",
"0.67720014",
"0.67720014",
"0.67501... | 0.0 | -1 |
Test create action when given wrong city_id or no ID at all. | def testNotFound(self):
response = requests.get(url=self.invalid_url)
headers = response.headers
json_data = response.json()
self.assertEqual(response.status_code, 404, WRONG_STATUS_CODE_MSG)
self.assertEqual(
headers['Content-Type'], 'application/json', WRONG_TYPE_R... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def testCityId(self):\n place = Place()\n self.assertTrue(hasattr(place, \"city_id\"))\n self.assertEqual(place.city_id, \"\")",
"def test_required_city(self):\r\n self.url_params['city'] = 'New York'\r\n response = self.client.post(self.url, self.url_params)\r\n self.as... | [
"0.6927521",
"0.68364066",
"0.6782573",
"0.67120415",
"0.6681824",
"0.6598809",
"0.6576543",
"0.6569103",
"0.65482163",
"0.65401435",
"0.6519946",
"0.65198463",
"0.64539194",
"0.6346804",
"0.6278168",
"0.615056",
"0.615001",
"0.61143786",
"0.61076456",
"0.60571116",
"0.604627... | 0.0 | -1 |
Tear down table Place of database used for tests. | def tearDown(self) -> None:
storage.delete(self.place)
storage.delete(self.user)
storage.delete(self.city)
storage.delete(self.state)
storage.save() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tearDown(self):\n QuestionerDB.destroy_tables()",
"def tearDown(self):\n\n InitializeDb('TEST_DATABASE_URI').drop_tables()",
"def tearDown(self):\n\n # Remove all tables from test db\n db.session.remove()\n db.drop_all()",
"def tearDown(self):\n self.database.tru... | [
"0.81152445",
"0.79166496",
"0.7883226",
"0.78818905",
"0.7876722",
"0.77786773",
"0.7768633",
"0.77477974",
"0.77433956",
"0.77424127",
"0.7742055",
"0.77314675",
"0.7724903",
"0.7724903",
"0.7692925",
"0.7686271",
"0.76857466",
"0.76783323",
"0.76783323",
"0.76783323",
"0.7... | 0.0 | -1 |
Tear down table Place of database used for tests. | def tearDown(self) -> None:
place = storage.get(Place, self.place_id)
if place is not None:
storage.delete(place)
user = storage.get(User, self.user_id)
if user is not None:
storage.delete(user)
city = storage.get(City, self.city_id)
if city is not... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tearDown(self):\n QuestionerDB.destroy_tables()",
"def tearDown(self):\n\n InitializeDb('TEST_DATABASE_URI').drop_tables()",
"def tearDown(self):\n\n # Remove all tables from test db\n db.session.remove()\n db.drop_all()",
"def tearDown(self):\n self.database.tru... | [
"0.81152445",
"0.79166496",
"0.7883226",
"0.78818905",
"0.7876722",
"0.77786773",
"0.7768633",
"0.77477974",
"0.77433956",
"0.77424127",
"0.7742055",
"0.77314675",
"0.7724903",
"0.7724903",
"0.7692925",
"0.7686271",
"0.76857466",
"0.76783323",
"0.76783323",
"0.76783323",
"0.7... | 0.0 | -1 |
Tear down table Place of database used for tests. | def tearDown(self) -> None:
user = storage.get(User, self.user_id)
if user is not None:
storage.delete(user)
city = storage.get(City, self.city_id)
if city is not None:
storage.delete(city)
state = storage.get(State, self.state_id)
if state is not ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tearDown(self):\n QuestionerDB.destroy_tables()",
"def tearDown(self):\n\n InitializeDb('TEST_DATABASE_URI').drop_tables()",
"def tearDown(self):\n\n # Remove all tables from test db\n db.session.remove()\n db.drop_all()",
"def tearDown(self):\n self.database.tru... | [
"0.81152445",
"0.79166496",
"0.7883226",
"0.78818905",
"0.7876722",
"0.77786773",
"0.7768633",
"0.77477974",
"0.77433956",
"0.77424127",
"0.7742055",
"0.77314675",
"0.7724903",
"0.7724903",
"0.7692925",
"0.7686271",
"0.76857466",
"0.76783323",
"0.76783323",
"0.76783323",
"0.7... | 0.0 | -1 |
Test create action when given wrong city_id or no ID at all. | def testNotFound(self):
response = requests.post(url=self.invalid_url)
headers = response.headers
json_data = response.json()
self.assertEqual(response.status_code, 404, WRONG_STATUS_CODE_MSG)
self.assertEqual(
headers['Content-Type'], 'application/json', WRONG_TYPE_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def testCityId(self):\n place = Place()\n self.assertTrue(hasattr(place, \"city_id\"))\n self.assertEqual(place.city_id, \"\")",
"def test_required_city(self):\r\n self.url_params['city'] = 'New York'\r\n response = self.client.post(self.url, self.url_params)\r\n self.as... | [
"0.69279075",
"0.6837271",
"0.6781261",
"0.67097485",
"0.66823864",
"0.66005194",
"0.65781796",
"0.6569976",
"0.65462977",
"0.65426886",
"0.65218204",
"0.65218204",
"0.64570284",
"0.6350171",
"0.6277144",
"0.6150996",
"0.61502135",
"0.6116714",
"0.61073214",
"0.60546905",
"0.... | 0.0 | -1 |
Tear down table Place of database used for tests. | def tearDown(self) -> None:
place = storage.get(Place, self.place_id)
if place is not None:
storage.delete(place)
user = storage.get(User, self.user_id)
if user is not None:
storage.delete(user)
city = storage.get(City, self.city_id)
if city is not... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tearDown(self):\n QuestionerDB.destroy_tables()",
"def tearDown(self):\n\n InitializeDb('TEST_DATABASE_URI').drop_tables()",
"def tearDown(self):\n\n # Remove all tables from test db\n db.session.remove()\n db.drop_all()",
"def tearDown(self):\n self.database.tru... | [
"0.8114736",
"0.7916872",
"0.7883494",
"0.78821254",
"0.78759474",
"0.77787673",
"0.7767903",
"0.7747948",
"0.774509",
"0.7742561",
"0.77416223",
"0.7731595",
"0.7724659",
"0.7724659",
"0.76930416",
"0.76865244",
"0.7686251",
"0.7677107",
"0.7677107",
"0.7677107",
"0.7677107"... | 0.0 | -1 |
Test valid update action. | def testUpdate(self):
data = {'name': 'toto2'}
response = requests.put(url=self.url, json=data)
headers = response.headers
json_data = response.json()
self.assertTrue(self.place == storage.get(Place, self.place_id))
self.assertEqual(response.status_code, 200, WRONG_STATU... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_update(self):\n pass",
"def test_update(self):\n pass",
"def test_update(self):\n pass",
"def test_update_case(self):\n pass",
"def test_update_scenario(self):\n pass",
"def test_update(app):\n\n assert False",
"def test_user_update_request(self):\n ... | [
"0.8056447",
"0.8056447",
"0.8056447",
"0.8054608",
"0.7876594",
"0.7816667",
"0.78033584",
"0.780004",
"0.7638284",
"0.74196744",
"0.72867405",
"0.7276324",
"0.72365797",
"0.7224716",
"0.72109437",
"0.7186029",
"0.7172556",
"0.71655226",
"0.7156753",
"0.7150692",
"0.70963746... | 0.0 | -1 |
Test update action when given wrong review_id or no ID at all. | def testNotFound(self):
data = {'text': 'toto'}
response = requests.put(url=self.invalid_url, json=data)
headers = response.headers
json_data = response.json()
self.assertEqual(response.status_code, 404, WRONG_STATUS_CODE_MSG)
self.assertEqual(
headers['Conte... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_review(review_id):\n user_input = request.get_json()\n if user_input is None:\n abort(400, {'message': 'Not a JSON'})\n obj = storage.get(Review, review_id)\n if obj is None:\n abort(404)\n for k, v in user_input.items():\n if k not in ['id', 'user_id', 'place_id',\n ... | [
"0.69150305",
"0.68658453",
"0.6835037",
"0.6818989",
"0.6817949",
"0.6808015",
"0.67921317",
"0.67099774",
"0.6611546",
"0.6515712",
"0.64476645",
"0.6412282",
"0.6337633",
"0.6265362",
"0.62552536",
"0.6243858",
"0.62043476",
"0.61957747",
"0.61705637",
"0.6134737",
"0.6132... | 0.0 | -1 |
Tear down table Place of database used for tests. | def tearDown(self) -> None:
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tearDown(self):\n QuestionerDB.destroy_tables()",
"def tearDown(self):\n\n InitializeDb('TEST_DATABASE_URI').drop_tables()",
"def tearDown(self):\n\n # Remove all tables from test db\n db.session.remove()\n db.drop_all()",
"def tearDown(self):\n self.database.tru... | [
"0.81152445",
"0.79166496",
"0.7883226",
"0.78818905",
"0.7876722",
"0.77786773",
"0.7768633",
"0.77477974",
"0.77433956",
"0.77424127",
"0.7742055",
"0.77314675",
"0.7724903",
"0.7724903",
"0.7692925",
"0.7686271",
"0.76857466",
"0.76783323",
"0.76783323",
"0.76783323",
"0.7... | 0.0 | -1 |
initializes singly linked list | def __init__(self):
self.__head = None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, lst=[]):\n self.__length = 0 # current length of the linked list\n self.__head = None # pointer to the first node in the list\n for e in lst: # initialize the list,\n self.add(e) # by adding elements one by one",
"def __init__(self):\n node = ListNode... | [
"0.7819301",
"0.75272244",
"0.74747753",
"0.74489033",
"0.7416293",
"0.73759764",
"0.735071",
"0.7339788",
"0.73205805",
"0.7307857",
"0.72945845",
"0.7277682",
"0.72619003",
"0.72428554",
"0.72428554",
"0.72428554",
"0.72428554",
"0.72428554",
"0.7234285",
"0.7206142",
"0.72... | 0.69875455 | 59 |
Calculates the area of a (closed) polygon. | def AreaOfPolygon(points):
# Note: area will be negative for clockwise shapes.
# See http://paulbourke.net/geometry/polyarea/
A = 0
N = len(points)
for i in xrange(0, N):
x_i = points[i][0]
y_i = points[i][1]
x_ip1 = points[(i+1) % N][0]
y_ip1 = points[(i+1) % N][1]
A += (x_i * y_ip1 - x_i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def polygon_area_2d(polygon):\r\n return geometry.gmPolygonArea(polygon)",
"def area(self):\n if len(self.exterior) < 3:\n raise Exception(\"Cannot compute the polygon's area because it contains less than three points.\")\n poly = self.to_shapely_polygon()\n return poly.area",
... | [
"0.8261107",
"0.8153791",
"0.81427395",
"0.8081045",
"0.7949097",
"0.7886497",
"0.7796098",
"0.77608496",
"0.7628831",
"0.7604285",
"0.7590112",
"0.7585494",
"0.758179",
"0.74789864",
"0.73947597",
"0.73615026",
"0.7306913",
"0.72621137",
"0.72477007",
"0.72420216",
"0.722568... | 0.7476623 | 14 |
Initializing Backtesting function Init function generates performance of the test and several risk metrics. The object lets you specify wether you want to lag the trades to avoid overfitting, the transaction costs and the percentage of the portfolio to be invested per trade (50% as 0.5). | def __init__(self, returns: pd.Series, trades: pd.Series, lagged=True, transaction_cost=0, percent_invested_per_trade=1):
if lagged:
trades = trades.shift(1)
trades.iloc[0] = False
self.strategy_returns = ((returns * percent_invested_per_trade) * trades)
self.trades = tr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize(context):\n set_benchmark(sid(21519)) # I can't remember what stock this was supposed to be, but it's likely I just used SPY as the benchmark\n attach_pipeline(make_pipeline_buy(), 'pipeline_buy')\n schedule_function(rebalance, date_rules.month_start(), time_rules.market_open(minutes=60))",... | [
"0.6660802",
"0.65762806",
"0.65509987",
"0.63649786",
"0.63537765",
"0.63515097",
"0.6269131",
"0.622983",
"0.620218",
"0.62021136",
"0.5998702",
"0.59936905",
"0.5974918",
"0.59488976",
"0.59316",
"0.59255105",
"0.59209776",
"0.5903755",
"0.5900044",
"0.5889675",
"0.5874257... | 0.6500694 | 3 |
Root mean squared error of the noise. Notes | def rmsi(self, tmin=None, tmax=None):
res = self.ml.noise(tmin=tmin, tmax=tmax)
N = res.size
return np.sqrt(sum(res ** 2) / N) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def nrmse_mean(self) -> float:\n return float(self.rmse() / np.mean(self.true))",
"def root_mean_squared_error(y_true, y_pred):\n return sm.mean_squared_error(y_true, y_pred)**0.5",
"def rmse(self):\n return (self.model_error()**2).mean()**.5",
"def MeanSqError(self):\r\n\t\treturn self.mse"... | [
"0.7394492",
"0.7190651",
"0.7167971",
"0.71633774",
"0.71475536",
"0.71330255",
"0.713175",
"0.70594305",
"0.70372224",
"0.7004368",
"0.6888598",
"0.6883944",
"0.6862308",
"0.68339473",
"0.6824615",
"0.67701703",
"0.67544264",
"0.6719578",
"0.6689541",
"0.6675475",
"0.666965... | 0.0 | -1 |
Convert class labels from scalars to onehot vectors. | def dense_to_one_hot(labels_dense, num_classes):
num_labels = labels_dense.shape[0]
index_offset = numpy.arange(num_labels) * num_classes
labels_one_hot = numpy.zeros((num_labels, num_classes))
labels_one_hot.flat[index_offset + labels_dense.ravel()] = 1
return labels_one_hot | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def one_hot(labels, classes=None):\n return K.utils.to_categorical(labels, classes)",
"def one_hot(labels, classes=None):\n\n one_hot_ = K.utils.to_categorical(labels, classes)\n return(one_hot_)",
"def to_onehot(labels: torch.Tensor, num_classes: int) -> torch.Tensor:\n if len(labels.size()) == 1:... | [
"0.8250402",
"0.807683",
"0.80523187",
"0.7977843",
"0.7908335",
"0.7900327",
"0.7892233",
"0.7869711",
"0.7849721",
"0.7849721",
"0.7826951",
"0.7826122",
"0.77677035",
"0.7765413",
"0.77489346",
"0.7742955",
"0.7737176",
"0.77226317",
"0.77123284",
"0.7711196",
"0.769438",
... | 0.77540547 | 16 |
Construct a DataSet. one_hot arg is used only if fake_data is true. `dtype` can be either `uint8` to leave the input as `[0, 255]`, or `float32` to rescale into `[0, 1]`. | def __init__(self,
images,
labels,
flatten=True,
fake_data=False,
one_hot=False,
dtype=dtypes.float32):
dtype = dtypes.as_dtype(dtype).base_dtype
if dtype not in (dtypes.uint8, dtypes.float32):
raise TypeError('Inval... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def one_hot(x, num_classes, dtype=jnp.float32):\n return jax.nn.one_hot(x, num_classes).astype(dtype)",
"def labels_to_one_hot(\n labels: np.ndarray, categories: int, axis: int = 0,\n keepdims=False, dtype=bool\n):\n if keepdims:\n assert labels.shape[axis] == 1\n result_ndim = la... | [
"0.6928174",
"0.6369147",
"0.6323994",
"0.63234",
"0.62837005",
"0.62296724",
"0.62211317",
"0.6197287",
"0.6187345",
"0.6175172",
"0.61683804",
"0.616712",
"0.6161089",
"0.61586016",
"0.61586016",
"0.6153537",
"0.61487806",
"0.6142396",
"0.611468",
"0.6113707",
"0.61130196",... | 0.0 | -1 |
Return list of items from values that are not in sieve. | def _not_matching(values, sieve):
return [val for val in values if val not in sieve] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sieve_to_list(sieve):\n return [i for i, v in enumerate(sieve) if v]",
"def without(values, seq):\n for item in seq:\n if item not in values:\n yield item",
"def sieve(upto):\n return list(prime_numbers(upto))",
"def eliminate_non_primes(primes_dict, highest):\r\n for i in r... | [
"0.68290514",
"0.6534574",
"0.6419981",
"0.62810576",
"0.62718767",
"0.6205897",
"0.6136561",
"0.6098665",
"0.6013295",
"0.600476",
"0.5991886",
"0.59869736",
"0.5915345",
"0.5893112",
"0.5883273",
"0.5842418",
"0.5832324",
"0.57902133",
"0.5783464",
"0.5756454",
"0.57543355"... | 0.90435326 | 0 |
Copy values of settings related to extensions. | def _copy_extension_settings(self, other):
other.useExtendedMasterSecret = self.useExtendedMasterSecret
other.requireExtendedMasterSecret = self.requireExtendedMasterSecret
other.useExperimentalTackExtension = self.useExperimentalTackExtension
other.sendFallbackSCSV = self.sendFallbackSC... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def copy_settings(self, settings):\n for section in self.sections():\n for (key, value) in self.items(section):\n settings._set_direct('%s/%s' % (section, key), value)",
"def merge_onto(cls, settings):\r\n for key, value in cls.SETTINGS.iteritems():\r\n setattr(... | [
"0.6393733",
"0.6238517",
"0.608783",
"0.5940507",
"0.591193",
"0.5878439",
"0.5871641",
"0.58619654",
"0.5810686",
"0.5796161",
"0.57870215",
"0.5780483",
"0.57590586",
"0.57351756",
"0.5704458",
"0.5701928",
"0.5674465",
"0.5656633",
"0.563907",
"0.5607393",
"0.55626565",
... | 0.72990024 | 0 |
Function returns kth largest element of the array arr. | def kth_largest(arr: list, k: int):
# Do not search if k is larger than total number of elements
if k > len(arr):
raise IndexError
# Count all numbers
nums = Counter(arr)
# Go from the largest to smaller ones
for key in sorted(nums, reverse=True):
if nums[key] >= k:
r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def findKthLargest(self, nums: List[int], k: int) -> int:\n return sorted(nums)[-k]",
"def find_max_in_array(arr, k):\r\n print(\" Amazon interview question\")\r\n arr[:] = sorted(arr)\r\n return ((arr[len(arr)-k]))",
"def _get_k_largest(lst, k):\n sorted_lst = sorted([(val, index) for index... | [
"0.8239319",
"0.8185059",
"0.7342936",
"0.7302325",
"0.7260176",
"0.71511894",
"0.7093941",
"0.7041373",
"0.6886961",
"0.6805416",
"0.67292297",
"0.67229253",
"0.66168725",
"0.65874934",
"0.6574318",
"0.6528232",
"0.6458543",
"0.6446442",
"0.64453226",
"0.6426782",
"0.6398156... | 0.8680779 | 0 |
Returns a Queue instance, based on the naming conventions for naming the internal Redis keys. Can be used to reverselookup Queues by their Redis keys. | def from_queue_key(cls, queue_key, connection=None):
prefix = cls.redis_queue_namespace_prefix
if not queue_key.startswith(prefix):
raise ValueError('Not a valid RQ queue key: %s' % (queue_key,))
name = queue_key[len(prefix):]
return cls(name) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get(queue_name: str, **kwargs) -> Queue:\n return Queue(queue_name, **kwargs)",
"def get_queue_by_name(name):\n sqs = boto3.resource('sqs')\n return sqs.get_queue_by_name(QueueName=name)",
"def instantiate_queue(self):\n serialized_queue = self.cache.get('queue')\n queue = ast.litera... | [
"0.75315624",
"0.67545503",
"0.671125",
"0.64585036",
"0.63612545",
"0.634525",
"0.63383913",
"0.6289547",
"0.62185454",
"0.60933477",
"0.60207605",
"0.590932",
"0.58856547",
"0.5863217",
"0.5863217",
"0.5863217",
"0.5863217",
"0.5863217",
"0.5863217",
"0.5863217",
"0.5863217... | 0.6954376 | 1 |
Returns whether the current queue is empty. | def is_empty(self):
return self.count.addCallback(lambda x: x == 0) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_empty(self):\n return len(self.the_queue) == 0",
"def is_empty(self):\n return len(self.__queue) > 0",
"def is_empty(self):\n return len(self.queue) == 0",
"def is_empty(self):\n return len(self.queue) == 0",
"def is_empty(self):\n return self.queue == []",
"def ... | [
"0.91658485",
"0.9143935",
"0.9122913",
"0.9122913",
"0.91169757",
"0.91141385",
"0.91135883",
"0.90542364",
"0.9025458",
"0.89572537",
"0.89100605",
"0.8892409",
"0.8892409",
"0.8885007",
"0.88354754",
"0.88002664",
"0.8750151",
"0.8728153",
"0.86569214",
"0.8620383",
"0.857... | 0.0 | -1 |
Creates a human readable timestamp for a log records created date | def create_timestamp(record):
timestamp = datetime.fromtimestamp(record.created)
return timestamp.strftime("%y-%m-%d %H:%M:%S,%f"), | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def createTimeStamp_Date():\r\n\r\n return str(datetime.now().strftime(\"%Y%m%d\"))",
"def _generate_timestamp():\n\t\treturn strftime(\"%Y%m%dT%H%M%S\")",
"def creationTime(self):\n \n if not self.logMessage is None :\n return self.logMessage[\"date\"]",
"def created_date_tim... | [
"0.75440264",
"0.7430879",
"0.7421513",
"0.7401074",
"0.7395671",
"0.7369621",
"0.7369621",
"0.7369621",
"0.7242946",
"0.71840227",
"0.71748006",
"0.7135654",
"0.7042526",
"0.70321727",
"0.7023399",
"0.7016882",
"0.7005842",
"0.6996357",
"0.69534373",
"0.695168",
"0.6949026",... | 0.82257223 | 0 |
Returns TRUE if is a simple name, i.e. a variable | def is_simple (self, phrase):
return not self.contains(phrase,'()&|>#') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_variable(arg: Expr) -> bool:\n return str(arg)[0].islower()",
"def _is_valid_varname(self, name):\n if name in RESERVED or re.match(r'^str[0-9]+$', name): return False\n return True if VALID_NAME_RE.match(name) else False",
"def is_named(self):\n return self._name != \"\"",
"de... | [
"0.7559958",
"0.7335903",
"0.7318223",
"0.72577274",
"0.7211276",
"0.7190335",
"0.71310145",
"0.7034176",
"0.6981017",
"0.69023615",
"0.68884474",
"0.6868805",
"0.68431044",
"0.6798527",
"0.67605734",
"0.67360294",
"0.67237914",
"0.67007697",
"0.6686572",
"0.66413504",
"0.660... | 0.0 | -1 |
Receives a datetime object and converts/returns a readable string using TIME_OFFSETS | def pretty_date(date):
if not type(date) == datetime:
raise ValueError('the mistake of time format :(')
how_long_days = (NOW - date).days
if how_long_days < 0:
raise ValueError('back to the future :)')
if how_long_days >= 2:
return date.strftime('%m/%d/%y')
how_long_s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_mdal_datetime_to_string(date_object):\n return date_object.strftime('%Y-%m-%d %H:%M:%S') + ' UTC'",
"def datetime_to_str(obj: \"datetime\") -> str:\n if obj.tzinfo is not None and obj.tzinfo.utcoffset(obj) is not None:\n # aware time; translate to UTC\n obj = obj.astimezone(timezone.u... | [
"0.6418073",
"0.63996863",
"0.63537246",
"0.6300806",
"0.6196256",
"0.6168139",
"0.6167333",
"0.6144194",
"0.61431414",
"0.61418384",
"0.61122686",
"0.60789824",
"0.6055",
"0.6033069",
"0.60270244",
"0.60261077",
"0.6024031",
"0.6003754",
"0.5999002",
"0.5996622",
"0.5992118"... | 0.0 | -1 |
cast(itkLightObject obj) > itkMultipleValuedCostFunction | def cast(*args):
return _ITKCostFunctionsPython.itkMultipleValuedCostFunction_cast(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def itkMultipleValuedCostFunction_cast(*args):\n return _ITKCostFunctionsPython.itkMultipleValuedCostFunction_cast(*args)",
"def itkSingleValuedCostFunction_cast(*args):\n return _ITKCostFunctionsPython.itkSingleValuedCostFunction_cast(*args)",
"def itkCostFunction_cast(*args):\n return _ITKCostFunctionsPyt... | [
"0.68567395",
"0.6773496",
"0.66973597",
"0.60631686",
"0.6060822",
"0.605731",
"0.6044652",
"0.6036246",
"0.6025099",
"0.60049087",
"0.5984869",
"0.5977172",
"0.5970118",
"0.59609",
"0.5955341",
"0.5954479",
"0.5938679",
"0.5938515",
"0.5915387",
"0.59153557",
"0.5897448",
... | 0.6191864 | 3 |
itkMultipleValuedCostFunction_cast(itkLightObject obj) > itkMultipleValuedCostFunction | def itkMultipleValuedCostFunction_cast(*args):
return _ITKCostFunctionsPython.itkMultipleValuedCostFunction_cast(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def itkSingleValuedCostFunction_cast(*args):\n return _ITKCostFunctionsPython.itkSingleValuedCostFunction_cast(*args)",
"def cast(*args):\n return _ITKCostFunctionsPython.itkMultipleValuedCostFunction_cast(*args)",
"def itkCostFunction_cast(*args):\n return _ITKCostFunctionsPython.itkCostFunction_cast... | [
"0.74155736",
"0.7088268",
"0.7025455",
"0.675666",
"0.6262628",
"0.62276316",
"0.61747235",
"0.6164341",
"0.6148341",
"0.6146601",
"0.6146601",
"0.61123735",
"0.6100914",
"0.60832304",
"0.60732114",
"0.60649455",
"0.6055226",
"0.6052216",
"0.60455227",
"0.60082674",
"0.60068... | 0.7812542 | 0 |
__init__(self, itkMultipleValuedVnlCostFunctionAdaptor arg0) > itkMultipleValuedVnlCostFunctionAdaptor __init__(self, unsigned int spaceDimension, unsigned int numberOfValues) > itkMultipleValuedVnlCostFunctionAdaptor | def __init__(self, *args):
_ITKCostFunctionsPython.itkMultipleValuedVnlCostFunctionAdaptor_swiginit(self,_ITKCostFunctionsPython.new_itkMultipleValuedVnlCostFunctionAdaptor(*args)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, *args):\n _ITKCostFunctionsPython.itkSingleValuedVnlCostFunctionAdaptor_swiginit(self,_ITKCostFunctionsPython.new_itkSingleValuedVnlCostFunctionAdaptor(*args))",
"def __init__(self):\n self.counts = [0] * 10\n self.values = [0] * 10\n self.softmaxvalues = [0] * 10\n... | [
"0.8038969",
"0.6591238",
"0.65163654",
"0.65163654",
"0.6435984",
"0.643533",
"0.64204484",
"0.6357679",
"0.6320587",
"0.6275293",
"0.62540746",
"0.6233346",
"0.62326366",
"0.62116253",
"0.6208342",
"0.6203066",
"0.6199327",
"0.6198185",
"0.6181563",
"0.6154848",
"0.6147635"... | 0.83159935 | 0 |
New() > itkSingleValuedCostFunction Create a new object of the class itkSingleValuedCostFunction and set the input and the parameters if some named or nonnamed arguments are passed to that method. New() tries to assign all the non named parameters to the input of the new objects the first non named parameter in the fir... | def New(*args, **kargs):
obj = itkSingleValuedCostFunction.__New_orig__()
import itkTemplate
itkTemplate.New(obj, *args, **kargs)
return obj | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def New(*args, **kargs):\n obj = itkMultipleValuedCostFunction.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **kargs)\n return obj",
"def New(*args, **kargs):\n obj = itkMultipleValuedCostFunction.__New_orig__()\n import itkTemplate\n itkTempla... | [
"0.7723821",
"0.7723821",
"0.7121841",
"0.68110704",
"0.6725217",
"0.6415977",
"0.61406636",
"0.613606",
"0.61343974",
"0.6119916",
"0.6068808",
"0.60300875",
"0.59698987",
"0.59527266",
"0.59503216",
"0.59495646",
"0.59379244",
"0.5934891",
"0.5923206",
"0.5923037",
"0.59203... | 0.80295295 | 0 |
__init__(self, itkSingleValuedVnlCostFunctionAdaptor arg0) > itkSingleValuedVnlCostFunctionAdaptor __init__(self, unsigned int spaceDimension) > itkSingleValuedVnlCostFunctionAdaptor | def __init__(self, *args):
_ITKCostFunctionsPython.itkSingleValuedVnlCostFunctionAdaptor_swiginit(self,_ITKCostFunctionsPython.new_itkSingleValuedVnlCostFunctionAdaptor(*args)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, *args):\n _ITKCostFunctionsPython.itkMultipleValuedVnlCostFunctionAdaptor_swiginit(self,_ITKCostFunctionsPython.new_itkMultipleValuedVnlCostFunctionAdaptor(*args))",
"def __init__(self):\n super().__init__()\n self.lambdaVar = 1.0\n self.k = 1.0\n self.type = 'Weibull'\n ... | [
"0.7685287",
"0.64842904",
"0.6394776",
"0.6361042",
"0.63502413",
"0.6340219",
"0.63308734",
"0.6323486",
"0.63199824",
"0.62925303",
"0.629233",
"0.6268257",
"0.62559795",
"0.6255175",
"0.6249225",
"0.6231415",
"0.62258214",
"0.62257004",
"0.62199414",
"0.6209779",
"0.62073... | 0.80749786 | 0 |
New() > itkCumulativeGaussianCostFunction Create a new object of the class itkCumulativeGaussianCostFunction and set the input and the parameters if some named or nonnamed arguments are passed to that method. New() tries to assign all the non named parameters to the input of the new objects the first non named paramete... | def New(*args, **kargs):
obj = itkCumulativeGaussianCostFunction.__New_orig__()
import itkTemplate
itkTemplate.New(obj, *args, **kargs)
return obj | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def Initialize(self, *args):\n return _ITKCostFunctionsPython.itkCumulativeGaussianCostFunction_Initialize(self, *args)",
"def New(*args, **kargs):\n obj = itkSingleValuedCostFunction.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **kargs)\n return obj",
"d... | [
"0.76406366",
"0.6777402",
"0.6644777",
"0.6644777",
"0.65909535",
"0.63629323",
"0.6212108",
"0.59742695",
"0.5970456",
"0.59307927",
"0.5881906",
"0.5835621",
"0.58244735",
"0.58137393",
"0.5791065",
"0.5779603",
"0.5729771",
"0.56756324",
"0.5662055",
"0.56127125",
"0.5609... | 0.82282716 | 0 |
cast(itkLightObject obj) > itkShapePriorMAPCostFunctionBaseID2D | def cast(*args):
return _ITKCostFunctionsPython.itkShapePriorMAPCostFunctionBaseID2D_cast(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def itkShapePriorMAPCostFunctionBaseID2D_cast(*args):\n return _ITKCostFunctionsPython.itkShapePriorMAPCostFunctionBaseID2D_cast(*args)",
"def itkShapePriorMAPCostFunctionID2D_cast(*args):\n return _ITKCostFunctionsPython.itkShapePriorMAPCostFunctionID2D_cast(*args)",
"def itkShapePriorMAPCostFunctionBaseIF2... | [
"0.7402193",
"0.736436",
"0.6932077",
"0.6825769",
"0.67275953",
"0.66758806",
"0.6536828",
"0.64221704",
"0.6349755",
"0.63437295",
"0.62780184",
"0.627702",
"0.6260978",
"0.624791",
"0.6245359",
"0.6190462",
"0.61855584",
"0.6162477",
"0.61377466",
"0.61098933",
"0.61024517... | 0.67980325 | 4 |
New() > itkShapePriorMAPCostFunctionBaseID2D Create a new object of the class itkShapePriorMAPCostFunctionBaseID2D and set the input and the parameters if some named or nonnamed arguments are passed to that method. New() tries to assign all the non named parameters to the input of the new objects the first non named pa... | def New(*args, **kargs):
obj = itkShapePriorMAPCostFunctionBaseID2D.__New_orig__()
import itkTemplate
itkTemplate.New(obj, *args, **kargs)
return obj | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def New(*args, **kargs):\n obj = itkShapePriorMAPCostFunctionID2D.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **kargs)\n return obj",
"def New(*args, **kargs):\n obj = itkShapePriorMAPCostFunctionBaseIF2F.__New_orig__()\n import itkTemplate\n ... | [
"0.7859559",
"0.72506917",
"0.7111656",
"0.6952734",
"0.6752223",
"0.6688855",
"0.66374797",
"0.66074467",
"0.6545098",
"0.6496016",
"0.6473271",
"0.6472858",
"0.6455897",
"0.64059615",
"0.64023423",
"0.63349795",
"0.63248104",
"0.6269903",
"0.6254803",
"0.62450993",
"0.62361... | 0.80188876 | 0 |
itkShapePriorMAPCostFunctionBaseID2D_cast(itkLightObject obj) > itkShapePriorMAPCostFunctionBaseID2D | def itkShapePriorMAPCostFunctionBaseID2D_cast(*args):
return _ITKCostFunctionsPython.itkShapePriorMAPCostFunctionBaseID2D_cast(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def itkShapePriorMAPCostFunctionID2D_cast(*args):\n return _ITKCostFunctionsPython.itkShapePriorMAPCostFunctionID2D_cast(*args)",
"def cast(*args):\n return _ITKCostFunctionsPython.itkShapePriorMAPCostFunctionBaseID2D_cast(*args)",
"def cast(*args):\n return _ITKCostFunctionsPython.itkShapePrior... | [
"0.8059939",
"0.741364",
"0.7310701",
"0.7218592",
"0.6999392",
"0.6989232",
"0.67793167",
"0.6531053",
"0.6515155",
"0.6418107",
"0.63821524",
"0.63667536",
"0.6357133",
"0.6297474",
"0.62740946",
"0.62629515",
"0.6228706",
"0.62225485",
"0.6216169",
"0.61915874",
"0.6162562... | 0.8146036 | 0 |
cast(itkLightObject obj) > itkShapePriorMAPCostFunctionBaseID3D | def cast(*args):
return _ITKCostFunctionsPython.itkShapePriorMAPCostFunctionBaseID3D_cast(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def itkShapePriorMAPCostFunctionBaseID3D_cast(*args):\n return _ITKCostFunctionsPython.itkShapePriorMAPCostFunctionBaseID3D_cast(*args)",
"def itkShapePriorMAPCostFunctionID3D_cast(*args):\n return _ITKCostFunctionsPython.itkShapePriorMAPCostFunctionID3D_cast(*args)",
"def itkShapePriorMAPCostFunctionBaseIF3... | [
"0.765587",
"0.7590273",
"0.7241004",
"0.7191077",
"0.69812584",
"0.68650025",
"0.68480945",
"0.67250085",
"0.67246157",
"0.6723659",
"0.66978204",
"0.66961163",
"0.6691662",
"0.6682997",
"0.6675467",
"0.66576064",
"0.6637757",
"0.66243994",
"0.6619101",
"0.66139716",
"0.6611... | 0.7022614 | 4 |
New() > itkShapePriorMAPCostFunctionBaseID3D Create a new object of the class itkShapePriorMAPCostFunctionBaseID3D and set the input and the parameters if some named or nonnamed arguments are passed to that method. New() tries to assign all the non named parameters to the input of the new objects the first non named pa... | def New(*args, **kargs):
obj = itkShapePriorMAPCostFunctionBaseID3D.__New_orig__()
import itkTemplate
itkTemplate.New(obj, *args, **kargs)
return obj | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def New(*args, **kargs):\n obj = itkShapePriorMAPCostFunctionID3D.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **kargs)\n return obj",
"def New(*args, **kargs):\n obj = itkShapePriorMAPCostFunctionBaseIF3F.__New_orig__()\n import itkTemplate\n ... | [
"0.81509084",
"0.75158095",
"0.74788725",
"0.70048195",
"0.6930799",
"0.6778899",
"0.67786765",
"0.6765041",
"0.6734921",
"0.6649917",
"0.6607235",
"0.66031843",
"0.65964043",
"0.6546659",
"0.6528885",
"0.65001625",
"0.64995486",
"0.6495318",
"0.64883286",
"0.64736485",
"0.64... | 0.82873875 | 0 |
itkShapePriorMAPCostFunctionBaseID3D_cast(itkLightObject obj) > itkShapePriorMAPCostFunctionBaseID3D | def itkShapePriorMAPCostFunctionBaseID3D_cast(*args):
return _ITKCostFunctionsPython.itkShapePriorMAPCostFunctionBaseID3D_cast(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def itkShapePriorMAPCostFunctionID3D_cast(*args):\n return _ITKCostFunctionsPython.itkShapePriorMAPCostFunctionID3D_cast(*args)",
"def itkShapePriorMAPCostFunctionBaseIF3F_cast(*args):\n return _ITKCostFunctionsPython.itkShapePriorMAPCostFunctionBaseIF3F_cast(*args)",
"def itkShapePriorMAPCostFunctionIF3F_ca... | [
"0.82259583",
"0.76284313",
"0.7584132",
"0.7522367",
"0.7500625",
"0.68675256",
"0.6863805",
"0.68413615",
"0.68204564",
"0.68165815",
"0.6795051",
"0.6782787",
"0.6776827",
"0.6765706",
"0.67442673",
"0.6735905",
"0.6729121",
"0.67268574",
"0.67170894",
"0.66971713",
"0.669... | 0.8269036 | 0 |
cast(itkLightObject obj) > itkShapePriorMAPCostFunctionBaseIF2F | def cast(*args):
return _ITKCostFunctionsPython.itkShapePriorMAPCostFunctionBaseIF2F_cast(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def itkShapePriorMAPCostFunctionBaseIF2F_cast(*args):\n return _ITKCostFunctionsPython.itkShapePriorMAPCostFunctionBaseIF2F_cast(*args)",
"def itkShapePriorMAPCostFunctionIF2F_cast(*args):\n return _ITKCostFunctionsPython.itkShapePriorMAPCostFunctionIF2F_cast(*args)",
"def itkShapePriorMAPCostFunctionBaseIF3... | [
"0.7732978",
"0.76513124",
"0.7143757",
"0.70580995",
"0.7009345",
"0.6803063",
"0.67561036",
"0.66619277",
"0.66618305",
"0.66050565",
"0.6483759",
"0.6461715",
"0.6449706",
"0.6404627",
"0.64021987",
"0.6369229",
"0.63311225",
"0.6320394",
"0.6312051",
"0.62927467",
"0.6274... | 0.7132708 | 3 |
New() > itkShapePriorMAPCostFunctionBaseIF2F Create a new object of the class itkShapePriorMAPCostFunctionBaseIF2F and set the input and the parameters if some named or nonnamed arguments are passed to that method. New() tries to assign all the non named parameters to the input of the new objects the first non named pa... | def New(*args, **kargs):
obj = itkShapePriorMAPCostFunctionBaseIF2F.__New_orig__()
import itkTemplate
itkTemplate.New(obj, *args, **kargs)
return obj | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def New(*args, **kargs):\n obj = itkShapePriorMAPCostFunctionIF2F.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **kargs)\n return obj",
"def New(*args, **kargs):\n obj = itkShapePriorMAPCostFunctionBaseID2D.__New_orig__()\n import itkTemplate\n ... | [
"0.79926646",
"0.7676445",
"0.7589776",
"0.75172645",
"0.73620135",
"0.6886727",
"0.68273354",
"0.6432282",
"0.6349666",
"0.62498766",
"0.62194204",
"0.6216748",
"0.61991113",
"0.6192615",
"0.6185199",
"0.61798614",
"0.61431026",
"0.6082182",
"0.60580087",
"0.60551614",
"0.60... | 0.8114097 | 0 |
itkShapePriorMAPCostFunctionBaseIF2F_cast(itkLightObject obj) > itkShapePriorMAPCostFunctionBaseIF2F | def itkShapePriorMAPCostFunctionBaseIF2F_cast(*args):
return _ITKCostFunctionsPython.itkShapePriorMAPCostFunctionBaseIF2F_cast(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def itkShapePriorMAPCostFunctionIF2F_cast(*args):\n return _ITKCostFunctionsPython.itkShapePriorMAPCostFunctionIF2F_cast(*args)",
"def cast(*args):\n return _ITKCostFunctionsPython.itkShapePriorMAPCostFunctionBaseIF2F_cast(*args)",
"def itkShapePriorMAPCostFunctionBaseIF3F_cast(*args):\n return _ITKCo... | [
"0.81383324",
"0.76122206",
"0.76005226",
"0.75105363",
"0.74460924",
"0.73059297",
"0.71942693",
"0.71331555",
"0.70842826",
"0.6861749",
"0.676298",
"0.6663682",
"0.6600659",
"0.65509576",
"0.65186906",
"0.6431403",
"0.6402381",
"0.6400854",
"0.63979787",
"0.63807166",
"0.6... | 0.82572144 | 0 |
cast(itkLightObject obj) > itkShapePriorMAPCostFunctionBaseIF3F | def cast(*args):
return _ITKCostFunctionsPython.itkShapePriorMAPCostFunctionBaseIF3F_cast(*args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def itkShapePriorMAPCostFunctionBaseIF3F_cast(*args):\n return _ITKCostFunctionsPython.itkShapePriorMAPCostFunctionBaseIF3F_cast(*args)",
"def itkShapePriorMAPCostFunctionIF3F_cast(*args):\n return _ITKCostFunctionsPython.itkShapePriorMAPCostFunctionIF3F_cast(*args)",
"def itkShapePriorMAPCostFunctionBaseIF2... | [
"0.7795408",
"0.76776487",
"0.72645265",
"0.7242612",
"0.712184",
"0.7072205",
"0.6929815",
"0.68027264",
"0.676116",
"0.67082465",
"0.6673979",
"0.66652864",
"0.6657718",
"0.65898156",
"0.6581608",
"0.6558047",
"0.65441793",
"0.6537029",
"0.6528598",
"0.6525689",
"0.6507767"... | 0.71879184 | 4 |
New() > itkShapePriorMAPCostFunctionBaseIF3F Create a new object of the class itkShapePriorMAPCostFunctionBaseIF3F and set the input and the parameters if some named or nonnamed arguments are passed to that method. New() tries to assign all the non named parameters to the input of the new objects the first non named pa... | def New(*args, **kargs):
obj = itkShapePriorMAPCostFunctionBaseIF3F.__New_orig__()
import itkTemplate
itkTemplate.New(obj, *args, **kargs)
return obj | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def New(*args, **kargs):\n obj = itkShapePriorMAPCostFunctionIF3F.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **kargs)\n return obj",
"def New(*args, **kargs):\n obj = itkShapePriorMAPCostFunctionBaseID3D.__New_orig__()\n import itkTemplate\n ... | [
"0.82073593",
"0.78588796",
"0.7847664",
"0.7519005",
"0.74740106",
"0.7001361",
"0.6984212",
"0.67322737",
"0.6636905",
"0.6616767",
"0.66042227",
"0.6585948",
"0.6546605",
"0.65184456",
"0.6460646",
"0.64299595",
"0.64247364",
"0.64082634",
"0.6389345",
"0.6384726",
"0.6376... | 0.82622445 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.