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 |
|---|---|---|---|---|---|---|
Lower case, remove punctuation and split in spaces | def tokenize(doc):
text = doc
doc = doc.lower()
doc = re.sub('[,;]', ' ', doc)
doc = re.split('\s+', doc)
doc = sorted(list(filter(None, doc)))
ent = le.stanfordTagger(text)
print(ent)
l = []
for item in ent:
if ent[item] in ['LOCATION', 'GPE','PERSON']:
l.append(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def separate_words(text):\n splitter = re.compile('\\\\W*')\n return [s.lower() for s in splitter.split(text) if s != '']",
"def tokenize(s):\n s = \"\".join(\" \" if x in string.punctuation else x for x in s.lower()) \n return s.split()",
"def simple_tokeniser(sent):\n sent = re_tok_apos.sub... | [
"0.7641838",
"0.7539192",
"0.7358332",
"0.7325733",
"0.7306334",
"0.7274431",
"0.71878135",
"0.71537966",
"0.70991826",
"0.70684755",
"0.7042926",
"0.7040743",
"0.7040743",
"0.7005408",
"0.70052826",
"0.69857574",
"0.6979922",
"0.6957405",
"0.6955957",
"0.6951355",
"0.6940184... | 0.0 | -1 |
Convert a np array to a Torch Variable. | def np_to_var(x, is_cuda=True, dtype=torch.FloatTensor):
var = Variable(torch.from_numpy(x).type(dtype))
if is_cuda:
var = var.cuda()
return var | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def array2var(array):\n if array.ndim == 3:\n array = array.transpose((2, 0, 1))\n var = Variable(torch.from_numpy(array))\n while len(var.size()) < 4:\n var = var.unsqueeze(0)\n return var",
"def tt(ndarray):\n\n\tif not isinstance(ndarray, torch.Tensor):\n\n\t\tif not isinstance(ndarr... | [
"0.7717769",
"0.73495215",
"0.71909714",
"0.71613705",
"0.69595",
"0.6748381",
"0.65020627",
"0.63739216",
"0.6328203",
"0.62986404",
"0.62907946",
"0.62277794",
"0.61609733",
"0.61605716",
"0.61286986",
"0.60788",
"0.60764116",
"0.605695",
"0.5934174",
"0.5924699",
"0.591837... | 0.7116387 | 4 |
Loads any weights that have the same name in model and weights. Not very safe in general but works for some cases. | def soft_load_weights(model, weights):
own_state = model.state_dict()
for name, param in weights.items():
if name not in own_state:
continue
if isinstance(param, torch.nn.Parameter):
# backwards compatibility for serialized parameters
param = param.data
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_model_weights(self):\n raise NotImplementedError",
"def _load_weight_if_possible(self):\n try:\n self.keras_model.load_weights(self.model.WEIGHT_PATH)\n print('Weights loaded!')\n except OSError:\n print('No file with weights available! Starting from... | [
"0.7538464",
"0.74077415",
"0.71591365",
"0.7110203",
"0.70652926",
"0.70646226",
"0.69713277",
"0.68773854",
"0.6871105",
"0.6834261",
"0.68148255",
"0.67968804",
"0.6766848",
"0.67463875",
"0.67191374",
"0.67072165",
"0.66886383",
"0.66857386",
"0.6620952",
"0.65945643",
"0... | 0.6810044 | 11 |
Return True if user is in the group, False otherwise. | def is_user_in_group(user, group):
if user == group.get_name():
return True
elif user in group.get_users():
return True
else:
for group in group.get_groups():
return is_user_in_group(user, group)
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_user_in_group(user, group):\n users = group.get_users()\n if user in users:\n return True\n return False",
"def is_in_group(user, group_name):\n return is_in_group_user_id(user.id, group_name)",
"def is_in_group(user, group_name):\n return Group.objects.get(name=group_name).user_se... | [
"0.8791304",
"0.84474826",
"0.81782854",
"0.8154014",
"0.80775934",
"0.8077066",
"0.7991211",
"0.7917411",
"0.79046553",
"0.78879106",
"0.7874985",
"0.78737533",
"0.7837497",
"0.7784908",
"0.7714273",
"0.7684502",
"0.76652265",
"0.7655611",
"0.7571193",
"0.7561973",
"0.737242... | 0.8253319 | 2 |
Adds a new album to the albums list. | def add_album(self, album):
self.albums.append(album) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_album(self, album):\n\n self.albums.append(album)",
"def add_album(self, album):\n\n self.albums.append(album)",
"def add_album(self, album):\n\n self.album.append(album)",
"def add_album(self):\n item = self.clementine_albums.currentItem()\n albumname = item.text(0... | [
"0.84644085",
"0.84644085",
"0.84305274",
"0.7667181",
"0.74699306",
"0.74337506",
"0.68577987",
"0.6527258",
"0.6519832",
"0.6519731",
"0.6363345",
"0.63428694",
"0.6264245",
"0.62610763",
"0.61908835",
"0.61418647",
"0.60890234",
"0.60653895",
"0.597022",
"0.5966858",
"0.59... | 0.85533017 | 1 |
if present, enter the copied album's name into name field better yet, show all albums for the matched artist and choose one which means, we have to remember the selected artist, not the name | def add_album(self):
item = self.clementine_albums.currentItem()
albumname = item.text(0) if item else ''
year = item.data(0, core.Qt.UserRole) if item else ''
dlg = NewAlbumDialog(self, albumname, year).exec_()
if dlg != qtw.QDialog.Accepted:
return
name, yea... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_album(self):\n item = self.clementine_albums.currentItem()\n if not item:\n self.focus_albums()\n item = self.clementine_albums.currentItem()\n if item.text(0) in self.albums_map[self.c_artist]:\n ok = qtw.QMessageBox.question(self, self.appname, 'Albu... | [
"0.7305763",
"0.67011297",
"0.6506568",
"0.6477767",
"0.6113625",
"0.6058141",
"0.6033532",
"0.6031676",
"0.6003696",
"0.6001985",
"0.59903234",
"0.5967515",
"0.587903",
"0.5832355",
"0.5822125",
"0.5796915",
"0.5787158",
"0.5772199",
"0.57635206",
"0.5762768",
"0.5711081",
... | 0.6096268 | 5 |
save application data to json file | def save_appdata(appdata):
try:
shutil.copyfile(str(FNAME), str(FNAME) + '.bak')
except FileNotFoundError:
pass
with FNAME.open('w') as _out:
json.dump(appdata, _out) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def save_data_file(self):\n with open(self.files['data'], 'w') as outfile:\n outfile.write(self.to_json())\n outfile.close()",
"def saveData(self):\n file_location = self.json_File_Location.replace(\".json\", \"_Update.json\")\n json_file = open(file_location, \"w+\")\n... | [
"0.8235737",
"0.8037825",
"0.80249345",
"0.8001295",
"0.80012333",
"0.79615474",
"0.79033786",
"0.7886151",
"0.77991635",
"0.7781512",
"0.775169",
"0.7727923",
"0.771768",
"0.76657456",
"0.75626034",
"0.75483775",
"0.74846554",
"0.7461376",
"0.7430702",
"0.741844",
"0.741392"... | 0.75700736 | 14 |
Generate sha512 hash of file | def generate_file_sha512(fileIn):
# fileIn is read in chunks to ensure it will work with (very) large files as well
# Adapted from: http://stackoverflow.com/a/1131255/1209004
blocksize = 2**20
m = hashlib.sha512()
with open(fileIn, "rb") as f:
while True:
buf = f.read(blocksize... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sha512_file(file_name):\n\n hash_func = hashlib.sha256()\n\n with open(file_name, \"rb\") as fd:\n hash_func.update(fd.read())\n\n return hash_func.hexdigest()",
"def sha512(self):\n return sha512file(self.abspath)",
"def sha512(digest, fileName):\n\n rc = sha512sum(digest, fileNa... | [
"0.8674717",
"0.8178786",
"0.77537924",
"0.7662991",
"0.76523596",
"0.75437486",
"0.73976326",
"0.73320425",
"0.7257287",
"0.7147358",
"0.7127596",
"0.71206295",
"0.70985645",
"0.70985645",
"0.7087918",
"0.7081154",
"0.7071905",
"0.7035624",
"0.70348996",
"0.7018808",
"0.6982... | 0.8409156 | 1 |
Generate date / time string in ISO format with added time zone info | def generateDateTime(timeZone):
dateTime = datetime.datetime.now()
pst = pytz.timezone(timeZone)
dateTime = pst.localize(dateTime)
dateTimeFormatted = dateTime.isoformat()
return dateTimeFormatted | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _make_iso_time(time: datetime,\n date: datetime,\n time_zone: pytz.timezone) -> str:\n time_combined = time.replace(year=date.year,\n month=date.month,\n day=date.day)\n return time_zone.localize(time_comb... | [
"0.7840333",
"0.7366584",
"0.72371405",
"0.7191516",
"0.7009488",
"0.6980989",
"0.69739133",
"0.69647455",
"0.6787343",
"0.6751521",
"0.6745657",
"0.66263026",
"0.6609421",
"0.66087705",
"0.66023606",
"0.659833",
"0.65606576",
"0.65572995",
"0.6556752",
"0.6535241",
"0.652480... | 0.7460474 | 1 |
Returns True if the specified table exists in the database | def check_table(self, table, verbose=True):
assert(self.connected)
CHECK_TABLE_COMMAND = "SHOW TABLES LIKE '{0}'".format(table)
self.cursor.execute(CHECK_TABLE_COMMAND)
exists = False
for row in self.cursor:
exists = True
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def db_table_exists(table_name):\n return table_name in connection.introspection.table_names()",
"def table_exists(self, table_name):\n table_exists = self.query(\n sql.table_existence,\n (\n table_name,\n self._current_db,\n ),\n )\... | [
"0.87574124",
"0.8620021",
"0.8589143",
"0.8570652",
"0.8550554",
"0.8543507",
"0.8540855",
"0.85282296",
"0.8527322",
"0.8487416",
"0.84462774",
"0.8377415",
"0.8357057",
"0.83134305",
"0.8307262",
"0.82560784",
"0.82444435",
"0.8209346",
"0.82024455",
"0.81860846",
"0.81705... | 0.78308505 | 36 |
Convert a string representation of a timezone to its pytz object, or do nothing if the argument is already a pytz timezone. | def timezonize(tz):
# Checking if somthing is a valid pytz object is hard as it seems that they are spread around the pytz package.
#
# Option 1): Try to convert if string or unicode, otherwise try to instantiate a datetieme object decorated
# with the timezone in order to check if it is a valid on... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_timezone(tzstring):\n if not tzstring:\n return get_localzone()\n try:\n return pytz.timezone(tzstring)\n except pytz.UnknownTimeZoneError:\n raise VdtValueError(\"Unknown timezone {}\".format(tzstring))",
"def test_parse_timezone(\n test_input: str,\n expected:... | [
"0.6565309",
"0.64932173",
"0.63986725",
"0.62212235",
"0.6204091",
"0.6193058",
"0.60141116",
"0.60096484",
"0.5988629",
"0.5851087",
"0.5828152",
"0.5827477",
"0.5824995",
"0.5824119",
"0.57917106",
"0.57829106",
"0.5746178",
"0.57427365",
"0.57387125",
"0.5671744",
"0.5634... | 0.70754635 | 0 |
Get the timezone offset in seconds. | def get_tz_offset_s(time_dt):
return s_from_dt(time_dt.replace(tzinfo=pytz.UTC)) - s_from_dt(time_dt) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_tz_offset_seconds() -> float:\n import time\n import datetime\n tval = time.time()\n utc_offset = (datetime.datetime.fromtimestamp(tval) -\n datetime.datetime.utcfromtimestamp(tval)).total_seconds()\n return utc_offset",
"def get_tz_offset(self) -> float:\n return s... | [
"0.8397337",
"0.80670375",
"0.7852176",
"0.78206044",
"0.7805478",
"0.766054",
"0.7431062",
"0.6978177",
"0.6934711",
"0.6797635",
"0.6621001",
"0.66036135",
"0.64766586",
"0.6461449",
"0.6413871",
"0.6333384",
"0.6317646",
"0.6316567",
"0.6306335",
"0.62470603",
"0.62436557"... | 0.7072232 | 7 |
Check that the timezone is consistent with the datetime (some conditions in Python lead to have summertime set in winter). | def check_dt_consistency(date_dt):
# https://en.wikipedia.org/wiki/Tz_database
# https://www.iana.org/time-zones
if date_dt.tzinfo is None:
return True
else:
# This check is quite heavy but there is apparently no other way to do it.
if date_dt.utcoffset() != dt_fro... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _is_timezone_aware(value):\n return value.utcoffset() is not None",
"def test_guest_timezone(self):\n self.check_guest_timezone()",
"def test_guest_timezone(self):\n self.check_guest_timezone()",
"def test_guest_timezone(self):\n self.check_guest_timezone()",
"def test_guest_tim... | [
"0.7172013",
"0.7020287",
"0.7020287",
"0.7020287",
"0.7020287",
"0.7020287",
"0.7020287",
"0.7020287",
"0.7020287",
"0.7020287",
"0.7020287",
"0.7020287",
"0.7020287",
"0.7020287",
"0.7020287",
"0.7020287",
"0.7020287",
"0.70118564",
"0.6994701",
"0.6935986",
"0.69273067",
... | 0.7136581 | 1 |
Get a datetime object as if it was on the given timezone. | def as_timezone(dt, tz):
return dt.astimezone(timezonize(tz)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def now(cls, tz=None):\n return datetime()",
"def as_timezone(self, tz):\n offset = tz_to_offset(tz)\n if TIMEZONES.get(tz, {}).get('dst') and is_dst(self):\n offset += 1\n offset_secs = offset * 3600\n return DateTime(*time.gmtime(self.unixtime() + offset_secs))",
... | [
"0.7072329",
"0.70263785",
"0.6671687",
"0.66294783",
"0.6596714",
"0.6574684",
"0.65640414",
"0.65444165",
"0.65343815",
"0.64846617",
"0.6458712",
"0.6441865",
"0.64305645",
"0.6429885",
"0.6373529",
"0.63485277",
"0.6341811",
"0.6315807",
"0.62963235",
"0.6281085",
"0.6263... | 0.6506565 | 9 |
Return the epoch seconds from a datetime object, with floating point for milliseconds/microseconds. | def s_from_dt(dt):
if not (isinstance(dt, datetime.datetime)):
raise Exception('t_from_dt function called without datetime argument, got type "{}" instead.'.format(dt.__class__.__name__))
try:
# This is the only safe approach. Some versions of Python around 3.4.4 - 3.7.3
# get the dateti... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def datetime_to_epoch_microseconds(obj: \"datetime\") -> float:\n td = datetime_to_epoch_timedelta(obj)\n return (td.days * 86400 + td.seconds) * 10**6 + td.microseconds",
"def epoch_seconds(date):\r\n td = date - epoch\r\n return td.days * 86400 + td.seconds + (float(td.microseconds) / 1000000)",
... | [
"0.7708337",
"0.7534668",
"0.75267",
"0.75267",
"0.7503961",
"0.74820745",
"0.7476823",
"0.7261901",
"0.7229041",
"0.71964574",
"0.71565104",
"0.7016469",
"0.6921465",
"0.68809503",
"0.6867585",
"0.6867585",
"0.67991555",
"0.6727423",
"0.6710949",
"0.66999125",
"0.65066296",
... | 0.0 | -1 |
Return the IS08601 representation of a datetime. | def dt_to_str(dt):
return dt.isoformat() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def format_datetime(self, datetime):\n return datetime.isoformat()",
"def encode_datetime(self, datetime_obj):\n if isinstance(datetime_obj, np.datetime64):\n datetime_obj = pd.Timestamp(datetime_obj).to_pydatetime()\n\n if isinstance(datetime_obj, dt.datetime):\n retur... | [
"0.642387",
"0.64115256",
"0.6179265",
"0.6154817",
"0.6103369",
"0.6091075",
"0.60893935",
"0.60616255",
"0.59578055",
"0.5887048",
"0.58688945",
"0.5855637",
"0.5851355",
"0.5851355",
"0.5833127",
"0.58275354",
"0.5785724",
"0.57841694",
"0.5770716",
"0.5770479",
"0.5768636... | 0.5932287 | 9 |
SelfSubjectRulesReviewSpec defines the specification for SelfSubjectRulesReview. | def __init__(__self__, *,
namespace: Optional[pulumi.Input[str]] = None):
if namespace is not None:
pulumi.set(__self__, "namespace", namespace) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_create_namespaced_self_subject_rules_review(self):\n pass",
"def test_create_self_subject_rules_review_for_all_namespaces(self):\n pass",
"def test_create_namespaced_pod_security_policy_self_subject_review(self):\n pass",
"def test_create_pod_security_policy_self_subject_review_... | [
"0.63449717",
"0.5588954",
"0.54551494",
"0.5352682",
"0.5112625",
"0.49460268",
"0.4897099",
"0.4704137",
"0.47008878",
"0.469909",
"0.44764128",
"0.43327582",
"0.4287694",
"0.42650244",
"0.42153758",
"0.41998503",
"0.41939428",
"0.4148379",
"0.41315305",
"0.40836027",
"0.40... | 0.0 | -1 |
Calculate the distance between this node and another. | def get_distance(self, node):
return np.sqrt(
(self.x - node.x) ** 2 +
(self.y - node.y) ** 2
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def node_distance(self, node1, node2):\n if node1 == node2:\n return 0.0\n for i, (n1, n2) in enumerate(zip(self.paths[node1], self.paths[node2])):\n if n1 != n2:\n break\n else:\n i = min(len(self.paths[node1]), len(self.paths[node2]))\n ... | [
"0.79955065",
"0.78207004",
"0.77953506",
"0.7771455",
"0.77586424",
"0.7715895",
"0.77014387",
"0.7686135",
"0.7677449",
"0.76717895",
"0.7663155",
"0.7657914",
"0.76520455",
"0.7608686",
"0.76079816",
"0.75998396",
"0.75745165",
"0.7556511",
"0.7505602",
"0.74645674",
"0.74... | 0.7106927 | 46 |
Calculate the angle between two points relative to the x axis. | def _get_angle(point1, point2):
ydelta = point2[0] - point1[0]
xdelta = point2[1] - point1[1]
if xdelta == 0:
hypot = np.sqrt(xdelta ** 2 + ydelta ** 2)
theta = np.arcsin(ydelta / hypot)
elif ydelta == 0:
hypot = np.sqrt(xdelta ** 2 + ydelta ** 2)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def AngleFromXAxis(self,pnt1,pnt2):\n\t\treturn self.acad.ActiveDocument.Utility.AngleFromXAxis(pnt1,pnt2)",
"def angle(firstPoint, secondPoint):\n\txDiff = secondPoint.x - firstPoint.x\n\tyDiff = secondPoint.y - firstPoint.y\n\treturn math.degrees(math.atan2(yDiff, xDiff))",
"def angle(a: Point, b: Point) -> ... | [
"0.7953578",
"0.7951937",
"0.78607756",
"0.77648824",
"0.7685482",
"0.763108",
"0.75903594",
"0.7557203",
"0.75277776",
"0.7430728",
"0.73742074",
"0.7370502",
"0.7336187",
"0.73291993",
"0.73182654",
"0.73108214",
"0.7276086",
"0.72194785",
"0.72050077",
"0.7196126",
"0.7174... | 0.7579501 | 7 |
Calculate the area within node coordinates. Uses a Shoelace algorithm. | def get_area(self, coords=None):
if coords is None:
coords = np.array([(n.x, n.y) for n in self.nodes])
area = np.dot(
coords[:, 0],
np.roll(coords[:, 1], 1)
) - np.dot(
coords[:, 1],
np.roll(coords[:, 0], 1)
)
return a... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def area(self):\n if isinstance(self.crs, GeographicalCRS):\n major_axis = self.crs.ellipsoid.a\n minor_axis = self.crs.ellipsoid.b\n\n area = 0.0\n if major_axis == minor_axis: # Sphere\n for seg in self.segment_tuples:\n x1, ... | [
"0.70307374",
"0.6851782",
"0.6843728",
"0.68140864",
"0.6801344",
"0.6774753",
"0.67623734",
"0.6719352",
"0.66036206",
"0.6593812",
"0.6574193",
"0.65596557",
"0.6544657",
"0.65332055",
"0.6530595",
"0.65112495",
"0.64786255",
"0.6478264",
"0.64704114",
"0.64439243",
"0.643... | 0.6759256 | 7 |
Returns an immutable instance of the receiver (which is a class) with all fields initialized with the arguments given. | def primitiveImmutableFromArgs(interp, s_frame, argcount):
if argcount == 0:
raise PrimitiveFailedError
w_args = s_frame.pop_and_return_n(argcount)[:]
w_cls = s_frame.pop()
space = interp.space
instance_kind = w_cls.as_class_get_shadow(space).get_instance_kind()
if instance_kind == POIN... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make(cls, **kwargs):\r\n return cls().fill(**kwargs)",
"def copy(self):\n def init(self, **kwargs):\n \"\"\"Initialization.\"\"\"\n for k, v in kwargs.items():\n setattr(self, k, v)\n\n return type(type(self).__name__, (type(self),), {\"__init__\": in... | [
"0.67692214",
"0.67424184",
"0.6457933",
"0.6369019",
"0.63521767",
"0.6331948",
"0.63082266",
"0.6227109",
"0.6222395",
"0.61587524",
"0.61481214",
"0.6074191",
"0.60642207",
"0.60395646",
"0.59994024",
"0.5979151",
"0.59313273",
"0.591944",
"0.589234",
"0.5875588",
"0.58356... | 0.60579056 | 13 |
Returns the release year of the current version of SQL Server, used to skip tests for features that are not supported. If the current DB is not SQL Server, 0 is returned. | def _get_sqlserver_year():
# We used to use the major version, but most documentation on the web refers to the year
# (e.g. SQL Server 2019) so we'll use that for skipping tests that do not apply.
if not IS_MSODBCSQL:
return 0
cnxn = connect()
cursor = cnxn.cursor()
row = cursor.execute(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_current_year() -> int:\n return datetime.now().year",
"def get_year(self) -> Optional[int]:\n return self.year",
"def current_season() -> int:\n now = datetime.now()\n month, year = now.month, now.year\n if month < 4:\n year -= 1\n return year",
"def get_year(self) ->... | [
"0.6432729",
"0.6238143",
"0.6084087",
"0.6071961",
"0.60437787",
"0.6012538",
"0.59902525",
"0.5989064",
"0.58781016",
"0.5873565",
"0.58735484",
"0.5805155",
"0.5799857",
"0.5778783",
"0.5772233",
"0.57706547",
"0.573806",
"0.57295877",
"0.5710821",
"0.5710821",
"0.5710821"... | 0.8553156 | 0 |
Retrieve the next cell from the payload and truncate that one. | def cell_slice(payload):
payload_len = len(payload)
if payload_len < 7: # (payload too small, need data)
return None, payload
cmd = cell_get_cmd(payload)
if cell_is_variable_length(cmd):
cell_len = 7 + cell_get_len(payload)
else:
cell_len = 514
if payload_len < cell_le... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_next_cell(self):\r\n cell = self.cells_to_process.pop(0)\r\n return cell",
"def get_next_cell(self):\r\n if len(self.queue) == 0:\r\n return\r\n val = self.peek_queue()\r\n self.queue.remove(val)\r\n return val[0]",
"def cell_slice_old(payload):\n ... | [
"0.6867338",
"0.6645917",
"0.6467209",
"0.64171803",
"0.58763593",
"0.5837329",
"0.5694081",
"0.56871986",
"0.564695",
"0.56119597",
"0.55752903",
"0.5557979",
"0.55317",
"0.5510329",
"0.5504447",
"0.55040216",
"0.5500467",
"0.5500019",
"0.5447778",
"0.5423275",
"0.5398418",
... | 0.6453568 | 3 |
Retrieve the next cell from the payload and truncate that one. | def cell_slice_old(payload):
cell_header = lnn.cell.header(payload)
if len(payload) < cell_header.width: # (payload too small, need data)
return None, payload
if not cell_header.valid:
raise InvalidCellHeaderException(cell_header.raw)
length = cell_header.width + lnn.constants.payload_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_next_cell(self):\r\n cell = self.cells_to_process.pop(0)\r\n return cell",
"def get_next_cell(self):\r\n if len(self.queue) == 0:\r\n return\r\n val = self.peek_queue()\r\n self.queue.remove(val)\r\n return val[0]",
"def cell_slice(payload):\n pay... | [
"0.6867338",
"0.6645917",
"0.6453568",
"0.64171803",
"0.58763593",
"0.5837329",
"0.5694081",
"0.56871986",
"0.564695",
"0.56119597",
"0.55752903",
"0.5557979",
"0.55317",
"0.5510329",
"0.5504447",
"0.55040216",
"0.5500467",
"0.5500019",
"0.5447778",
"0.5423275",
"0.5398418",
... | 0.6467209 | 2 |
For variable/polychromatic beam to return highest wavenumber. | def get_highest_wavenumber_beam(self):
return Beam(
wavenumber=self.wavenumber*(1+(5*self.sigma/(self.photon_energy-5*self.sigma))), # Gaussian truncates after 4-5 sigmas
focus_x=self._focus_xFWHM,
focus_y=self._focus_yFWHM,
focus_shape=self._focus_shape,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def highest_value():\n maximum_number = 0\n for i in xrange(length):\n challenger = frames[i]\n if abs(challenger) > maximum_number:\n maximum_number = abs(challenger)\n return maximum_number",
"def _get_maxth(self):\n return self.__maxth",
"def _get_maxth(self):\n retur... | [
"0.6893418",
"0.6450662",
"0.6450662",
"0.6450662",
"0.6450662",
"0.6450662",
"0.6450662",
"0.63981175",
"0.6350696",
"0.63231474",
"0.62772673",
"0.6200433",
"0.6175622",
"0.6161478",
"0.6144084",
"0.6135762",
"0.61179805",
"0.6108476",
"0.6098942",
"0.60976535",
"0.60911095... | 0.75384724 | 0 |
Update navigator tree to show all widgets Clears the navigator tree and updates it with all widgets in the project as held in the list self.widgets. Note that the first widget in the list must be the TopLevel widget, but all the other widgets may be in any order. | def build_navigator_tree(self) -> None:
# remove old items from navigator tree
for i in self.navigator_tree.get_children():
self.navigator_tree.delete(i)
# put project widget as main branch
widget = self.widgets.widget_list[0]
self.navigator_tree.insert('', 'end', wi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clear(self):\r\n\r\n # Clear the widgets list\r\n self.widgets_list = []\r\n\r\n # Refresh the scroll area\r\n self._refresh()",
"def refreshTree(self):\n\n # Gets default rows\n rows = getsAllClients()\n\n # Puts and displays rows in tree\n self.displa... | [
"0.61343205",
"0.5962171",
"0.59187853",
"0.5918212",
"0.5869639",
"0.5792486",
"0.5764664",
"0.5722087",
"0.5718351",
"0.5683143",
"0.5656316",
"0.5638832",
"0.5603287",
"0.56009454",
"0.55993634",
"0.5586569",
"0.55416614",
"0.5526854",
"0.55138063",
"0.5513777",
"0.5494031... | 0.7316489 | 0 |
Initialize a InvitedUser object. | def __init__(self,
*,
email: str = None,
id: str = None,
state: str = None) -> None:
self.email = email
self.id = id
self.state = state | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(__self__, *,\n disabled: Optional[pulumi.Input[bool]] = None,\n email: Optional[pulumi.Input[str]] = None,\n name: Optional[pulumi.Input[str]] = None,\n roles: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,\n ... | [
"0.6828794",
"0.66189575",
"0.64790577",
"0.63488925",
"0.6284613",
"0.6196065",
"0.61419207",
"0.61193264",
"0.60272115",
"0.60252875",
"0.589412",
"0.5886105",
"0.5854022",
"0.5852413",
"0.5846101",
"0.5795913",
"0.57540786",
"0.57477",
"0.57265174",
"0.5715822",
"0.5691536... | 0.0 | -1 |
Return a `str` version of this InvitedUser object. | def __str__(self) -> str:
return json.dumps(self.to_dict(), indent=2) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __str__(self):\n return str(self.user_id) + \": \" + \\\n str(self.user_name) + \": \" + str(self.user_email)",
"def __str__(self):\n return str(self.user)",
"def __str__(self):\n return str(self.user)",
"def __str__(self):\n return str(self.user)",
"def __str_... | [
"0.8033606",
"0.7639603",
"0.7639603",
"0.7639603",
"0.7639603",
"0.7639603",
"0.7577616",
"0.7507381",
"0.7485753",
"0.7482752",
"0.7479248",
"0.746081",
"0.74289733",
"0.74257904",
"0.74237514",
"0.74120826",
"0.73980445",
"0.73436797",
"0.73262215",
"0.7320417",
"0.7317872... | 0.0 | -1 |
Return `true` when self and other are equal, false otherwise. | def __eq__(self, other: 'InvitedUser') -> bool:
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__ | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def equals(self, other): # -> bool:\n ...",
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self, other):\n return self is other",
"def __eq__(self, other):\n return self is other",
"de... | [
"0.86368364",
"0.85096663",
"0.85096663",
"0.8452104",
"0.8452104",
"0.83327323",
"0.83197045",
"0.83001256",
"0.83001256",
"0.8274258",
"0.8271709",
"0.825911",
"0.8255834",
"0.8246293",
"0.82412314",
"0.8205269",
"0.8205269",
"0.8190984",
"0.81824505",
"0.81586003",
"0.8139... | 0.0 | -1 |
Return `true` when self and other are not equal, false otherwise. | def __ne__(self, other: 'InvitedUser') -> bool:
return not self == other | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n return not self.__ne__(other)",
"def __ne__ (self, other):\n return not self == other",
"def __ne__(self, other):\n if self.__eq__(other):\n return False\n return True",
"def __ne__(self, other) -> bool:\n return not self.__eq__(other)"... | [
"0.8608476",
"0.85141045",
"0.8458375",
"0.84514666",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
... | 0.0 | -1 |
Initialize a InvitedUserList object. | def __init__(self,
*,
resources: List['InvitedUser'] = None) -> None:
self.resources = resources | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def from_dict(cls, _dict: Dict) -> 'InvitedUserList':\n args = {}\n if 'resources' in _dict:\n args['resources'] = [InvitedUser.from_dict(x) for x in _dict.get('resources')]\n return cls(**args)",
"def __init__(__self__, *,\n disabled: Optional[pulumi.Input[bool]] ... | [
"0.6309125",
"0.61608016",
"0.6019187",
"0.56903505",
"0.56819016",
"0.5635852",
"0.55509436",
"0.5547801",
"0.55188257",
"0.55143857",
"0.5487337",
"0.5472208",
"0.54710793",
"0.54536384",
"0.5419525",
"0.53484297",
"0.53484297",
"0.5314049",
"0.5271531",
"0.5263748",
"0.526... | 0.6623202 | 0 |
Return `true` when self and other are equal, false otherwise. | def __eq__(self, other: 'InvitedUserList') -> bool:
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__ | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def equals(self, other): # -> bool:\n ...",
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self, other):\n return self is other",
"def __eq__(self, other):\n return self is other",
"de... | [
"0.86368364",
"0.85096663",
"0.85096663",
"0.8452104",
"0.8452104",
"0.83327323",
"0.83197045",
"0.83001256",
"0.83001256",
"0.8274258",
"0.8271709",
"0.825911",
"0.8255834",
"0.8246293",
"0.82412314",
"0.8205269",
"0.8205269",
"0.8190984",
"0.81824505",
"0.81586003",
"0.8139... | 0.0 | -1 |
Return `true` when self and other are not equal, false otherwise. | def __ne__(self, other: 'InvitedUserList') -> bool:
return not self == other | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n return not self.__ne__(other)",
"def __ne__ (self, other):\n return not self == other",
"def __ne__(self, other):\n if self.__eq__(other):\n return False\n return True",
"def __ne__(self, other) -> bool:\n return not self.__eq__(other)"... | [
"0.8608476",
"0.85141045",
"0.8458375",
"0.84514666",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
... | 0.0 | -1 |
Initialize a UserList object. | def __init__(self,
total_results: int,
limit: int,
*,
first_url: str = None,
next_url: str = None,
resources: List['UserProfile'] = None) -> None:
self.total_results = total_results
self.limit = limit
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def from_dict(cls, _dict: Dict) -> 'UserList':\n args = {}\n if 'total_results' in _dict:\n args['total_results'] = _dict.get('total_results')\n else:\n raise ValueError('Required property \\'total_results\\' not present in UserList JSON')\n if 'limit' in _dict:\n ... | [
"0.65021604",
"0.6404631",
"0.6354217",
"0.6329496",
"0.6258958",
"0.60958654",
"0.6074207",
"0.60575765",
"0.59996086",
"0.5973459",
"0.59695065",
"0.59483683",
"0.5891206",
"0.588731",
"0.5873539",
"0.58733666",
"0.58375216",
"0.58330595",
"0.58322054",
"0.58207834",
"0.578... | 0.56218576 | 43 |
Initialize a UserList object from a json dictionary. | def from_dict(cls, _dict: Dict) -> 'UserList':
args = {}
if 'total_results' in _dict:
args['total_results'] = _dict.get('total_results')
else:
raise ValueError('Required property \'total_results\' not present in UserList JSON')
if 'limit' in _dict:
arg... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def from_dict(cls, json, user=None):\n if user is None:\n user = cls()\n\n user.username = json['username']\n user.first_name = json['first_name']\n user.last_name = json['last_name']\n\n user.password = json['password']\n\n return user",
"def from_dict(cls, _... | [
"0.6913365",
"0.6640307",
"0.6494255",
"0.64914393",
"0.6484015",
"0.62141657",
"0.61876327",
"0.61851436",
"0.61835015",
"0.6143603",
"0.6130902",
"0.60348135",
"0.6017786",
"0.60023767",
"0.5985308",
"0.59697026",
"0.5968607",
"0.5968607",
"0.5968607",
"0.59222865",
"0.5883... | 0.7946536 | 0 |
Initialize a UserList object from a json dictionary. | def _from_dict(cls, _dict):
return cls.from_dict(_dict) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def from_dict(cls, _dict: Dict) -> 'UserList':\n args = {}\n if 'total_results' in _dict:\n args['total_results'] = _dict.get('total_results')\n else:\n raise ValueError('Required property \\'total_results\\' not present in UserList JSON')\n if 'limit' in _dict:\n ... | [
"0.7946135",
"0.69112283",
"0.66399467",
"0.64941275",
"0.6491358",
"0.64842176",
"0.6212469",
"0.61871153",
"0.618346",
"0.6181364",
"0.6142668",
"0.61328083",
"0.6035949",
"0.60199064",
"0.60031784",
"0.598544",
"0.5968971",
"0.5968971",
"0.5968971",
"0.59673786",
"0.592351... | 0.56860334 | 76 |
Return `true` when self and other are equal, false otherwise. | def __eq__(self, other: 'UserList') -> bool:
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__ | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def equals(self, other): # -> bool:\n ...",
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self, other):\n return self is other",
"def __eq__(self, other):\n return self is other",
"de... | [
"0.86368364",
"0.85096663",
"0.85096663",
"0.8452104",
"0.8452104",
"0.83327323",
"0.83197045",
"0.83001256",
"0.83001256",
"0.8274258",
"0.8271709",
"0.825911",
"0.8255834",
"0.8246293",
"0.82412314",
"0.8205269",
"0.8205269",
"0.8190984",
"0.81824505",
"0.81586003",
"0.8139... | 0.0 | -1 |
Return `true` when self and other are not equal, false otherwise. | def __ne__(self, other: 'UserList') -> bool:
return not self == other | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n return not self.__ne__(other)",
"def __ne__ (self, other):\n return not self == other",
"def __ne__(self, other):\n if self.__eq__(other):\n return False\n return True",
"def __ne__(self, other) -> bool:\n return not self.__eq__(other)"... | [
"0.8608476",
"0.85141045",
"0.8458375",
"0.84514666",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
... | 0.0 | -1 |
Initialize a UserProfile object. | def __init__(self,
*,
id: str = None,
iam_id: str = None,
realm: str = None,
user_id: str = None,
firstname: str = None,
lastname: str = None,
state: str = None,
email... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, data=None, **kw):\n def _get_class_by_id(profile_id):\n from solariat_bottle.db.user_profiles.social_profile import DELIMITER, TwitterProfile, FacebookProfile\n pos = unicode(profile_id).rfind(DELIMITER) + 1\n if pos == 0:\n return self.__cl... | [
"0.6877679",
"0.6841876",
"0.6698785",
"0.63824975",
"0.6254956",
"0.62183553",
"0.62103844",
"0.62030846",
"0.6167254",
"0.60775816",
"0.6052416",
"0.60419923",
"0.6039977",
"0.6028363",
"0.5987845",
"0.5985907",
"0.5983671",
"0.59729224",
"0.5960458",
"0.5960458",
"0.595046... | 0.0 | -1 |
Initialize a UserProfile object from a json dictionary. | def from_dict(cls, _dict: Dict) -> 'UserProfile':
args = {}
if 'id' in _dict:
args['id'] = _dict.get('id')
if 'iam_id' in _dict:
args['iam_id'] = _dict.get('iam_id')
if 'realm' in _dict:
args['realm'] = _dict.get('realm')
if 'user_id' in _dict:... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def from_dict(cls, json, user=None):\n if user is None:\n user = cls()\n\n user.username = json['username']\n user.first_name = json['first_name']\n user.last_name = json['last_name']\n\n user.password = json['password']\n\n return user",
"def from_dict(user_j... | [
"0.7492409",
"0.73384494",
"0.6777528",
"0.65914595",
"0.6536642",
"0.6458009",
"0.6387035",
"0.6344842",
"0.63389087",
"0.63212615",
"0.6316952",
"0.6275039",
"0.6265137",
"0.62321395",
"0.61791956",
"0.60905844",
"0.60873216",
"0.6045833",
"0.5968518",
"0.59578556",
"0.5934... | 0.78655314 | 0 |
Initialize a UserProfile object from a json dictionary. | def _from_dict(cls, _dict):
return cls.from_dict(_dict) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def from_dict(cls, _dict: Dict) -> 'UserProfile':\n args = {}\n if 'id' in _dict:\n args['id'] = _dict.get('id')\n if 'iam_id' in _dict:\n args['iam_id'] = _dict.get('iam_id')\n if 'realm' in _dict:\n args['realm'] = _dict.get('realm')\n if 'user_... | [
"0.7863877",
"0.74940884",
"0.73393965",
"0.6779041",
"0.6590492",
"0.65363747",
"0.64573497",
"0.63873285",
"0.634594",
"0.63401145",
"0.63214177",
"0.63165385",
"0.6274718",
"0.6264561",
"0.6233034",
"0.61826956",
"0.6089119",
"0.60879326",
"0.6048591",
"0.5967625",
"0.5959... | 0.56429344 | 73 |
Return a `str` version of this UserProfile object. | def __str__(self) -> str:
return json.dumps(self.to_dict(), indent=2) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __str__(self):\n profile = {\n 'address': self.address,\n 'bio': self.bio,\n 'website': self.website,\n 'hireable': self.hireable,\n 'travel_radius': self.travel_radius,\n 'phone number': self.phone_number,\n 'camera type': sel... | [
"0.7954123",
"0.77260315",
"0.7672259",
"0.7630277",
"0.7543601",
"0.7342256",
"0.72986436",
"0.72975624",
"0.72975624",
"0.72975624",
"0.72975624",
"0.72975624",
"0.72257346",
"0.7171308",
"0.7159034",
"0.712287",
"0.70024115",
"0.6994039",
"0.695914",
"0.69315183",
"0.68900... | 0.0 | -1 |
Return `true` when self and other are equal, false otherwise. | def __eq__(self, other: 'UserProfile') -> bool:
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__ | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def equals(self, other): # -> bool:\n ...",
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self, other):\n return self is other",
"def __eq__(self, other):\n return self is other",
"de... | [
"0.86368364",
"0.85096663",
"0.85096663",
"0.8452104",
"0.8452104",
"0.83327323",
"0.83197045",
"0.83001256",
"0.83001256",
"0.8274258",
"0.8271709",
"0.825911",
"0.8255834",
"0.8246293",
"0.82412314",
"0.8205269",
"0.8205269",
"0.8190984",
"0.81824505",
"0.81586003",
"0.8139... | 0.0 | -1 |
Return `true` when self and other are not equal, false otherwise. | def __ne__(self, other: 'UserProfile') -> bool:
return not self == other | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n return not self.__ne__(other)",
"def __ne__ (self, other):\n return not self == other",
"def __ne__(self, other):\n if self.__eq__(other):\n return False\n return True",
"def __ne__(self, other) -> bool:\n return not self.__eq__(other)"... | [
"0.8608476",
"0.85141045",
"0.8458375",
"0.84514666",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
... | 0.0 | -1 |
Return a `str` version of this UserSettings object. | def __str__(self) -> str:
return json.dumps(self.to_dict(), indent=2) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __repr__(self):\n string = ''\n for key, val in self.setting().items():\n string += '{}({})\\n'.format(key, val)\n return string",
"def __str__():\n return str(_config)",
"def __str__(self):\n return str(self._config.name)",
"def __str__(self):\n config_st... | [
"0.750064",
"0.72195536",
"0.70562357",
"0.694542",
"0.6835198",
"0.68289214",
"0.6813344",
"0.68121016",
"0.6767722",
"0.6767722",
"0.6767722",
"0.6767722",
"0.6767722",
"0.6767722",
"0.6767722",
"0.6767722",
"0.6767722",
"0.6767722",
"0.6767722",
"0.6767722",
"0.6767722",
... | 0.0 | -1 |
Return `true` when self and other are equal, false otherwise. | def __eq__(self, other: 'UserSettings') -> bool:
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__ | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def equals(self, other): # -> bool:\n ...",
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self, other):\n return self is other",
"def __eq__(self, other):\n return self is other",
"de... | [
"0.86368364",
"0.85096663",
"0.85096663",
"0.8452104",
"0.8452104",
"0.83327323",
"0.83197045",
"0.83001256",
"0.83001256",
"0.8274258",
"0.8271709",
"0.825911",
"0.8255834",
"0.8246293",
"0.82412314",
"0.8205269",
"0.8205269",
"0.8190984",
"0.81824505",
"0.81586003",
"0.8139... | 0.0 | -1 |
Return `true` when self and other are not equal, false otherwise. | def __ne__(self, other: 'UserSettings') -> bool:
return not self == other | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n return not self.__ne__(other)",
"def __ne__ (self, other):\n return not self == other",
"def __ne__(self, other):\n if self.__eq__(other):\n return False\n return True",
"def __ne__(self, other) -> bool:\n return not self.__eq__(other)"... | [
"0.8608476",
"0.85141045",
"0.8458375",
"0.84514666",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
... | 0.0 | -1 |
Initialize a Attribute object. | def __init__(self,
*,
name: str = None,
value: str = None) -> None:
self.name = name
self.value = value | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, attr=None):\r\n self.attr = attr",
"def __init__(self, **initial_attributes):\n\n for attribute_name, attribute_value in initial_attributes.items():\n setattr(self, attribute_name, attribute_value)",
"def init_attrs(self):\n raise NotImplementedError",
"def ... | [
"0.7056658",
"0.6879503",
"0.6785914",
"0.67811054",
"0.67754203",
"0.67740494",
"0.674716",
"0.67174363",
"0.6643473",
"0.6580432",
"0.6562376",
"0.64930135",
"0.6447353",
"0.64043367",
"0.63952464",
"0.6376471",
"0.6375659",
"0.6339884",
"0.63354343",
"0.6324501",
"0.630082... | 0.0 | -1 |
Initialize a Attribute object from a json dictionary. | def from_dict(cls, _dict: Dict) -> 'Attribute':
args = {}
if 'name' in _dict:
args['name'] = _dict.get('name')
if 'value' in _dict:
args['value'] = _dict.get('value')
return cls(**args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def from_dict(cls, _dict: Dict) -> 'Resource':\n args = {}\n if 'attributes' in _dict:\n args['attributes'] = [Attribute.from_dict(x) for x in _dict.get('attributes')]\n return cls(**args)",
"def from_dict(cls, d):\n schema = d.get(\"schema\", None)\n if schema is no... | [
"0.7307777",
"0.70785964",
"0.70424825",
"0.6923034",
"0.6844334",
"0.67882496",
"0.67782587",
"0.67619777",
"0.67619777",
"0.67619777",
"0.67619777",
"0.67619777",
"0.67619777",
"0.67619777",
"0.67619777",
"0.67619777",
"0.67619777",
"0.67619777",
"0.67619777",
"0.67619777",
... | 0.769411 | 0 |
Initialize a Attribute object from a json dictionary. | def _from_dict(cls, _dict):
return cls.from_dict(_dict) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def from_dict(cls, _dict: Dict) -> 'Attribute':\n args = {}\n if 'name' in _dict:\n args['name'] = _dict.get('name')\n if 'value' in _dict:\n args['value'] = _dict.get('value')\n return cls(**args)",
"def from_dict(cls, _dict: Dict) -> 'Resource':\n args =... | [
"0.76936",
"0.7306454",
"0.70787275",
"0.70426023",
"0.69230086",
"0.6844292",
"0.67885995",
"0.67783016",
"0.6662153",
"0.66592896",
"0.6654158",
"0.6635298",
"0.6612619",
"0.6583059",
"0.6565027",
"0.65543807",
"0.6545053",
"0.65353084",
"0.6530162",
"0.6498741",
"0.6484253... | 0.676245 | 47 |
Return `true` when self and other are equal, false otherwise. | def __eq__(self, other: 'Attribute') -> bool:
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__ | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def equals(self, other): # -> bool:\n ...",
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self, other):\n return self is other",
"def __eq__(self, other):\n return self is other",
"de... | [
"0.86368364",
"0.85096663",
"0.85096663",
"0.8452104",
"0.8452104",
"0.83327323",
"0.83197045",
"0.83001256",
"0.83001256",
"0.8274258",
"0.8271709",
"0.825911",
"0.8255834",
"0.8246293",
"0.82412314",
"0.8205269",
"0.8205269",
"0.8190984",
"0.81824505",
"0.81586003",
"0.8139... | 0.0 | -1 |
Return `true` when self and other are not equal, false otherwise. | def __ne__(self, other: 'Attribute') -> bool:
return not self == other | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n return not self.__ne__(other)",
"def __ne__ (self, other):\n return not self == other",
"def __ne__(self, other):\n if self.__eq__(other):\n return False\n return True",
"def __ne__(self, other) -> bool:\n return not self.__eq__(other)"... | [
"0.8608476",
"0.85141045",
"0.8458375",
"0.84514666",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
... | 0.0 | -1 |
Initialize a InviteUser object. | def __init__(self,
*,
email: str = None,
account_role: str = None) -> None:
self.email = email
self.account_role = account_role | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(__self__, *,\n disabled: Optional[pulumi.Input[bool]] = None,\n email: Optional[pulumi.Input[str]] = None,\n name: Optional[pulumi.Input[str]] = None,\n roles: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,\n ... | [
"0.64279705",
"0.63488513",
"0.6292771",
"0.61952734",
"0.60580623",
"0.59670126",
"0.5954824",
"0.5933795",
"0.5891725",
"0.58446145",
"0.5834913",
"0.5830446",
"0.5829864",
"0.58279216",
"0.5781396",
"0.5755835",
"0.57069963",
"0.57065564",
"0.56902426",
"0.56470597",
"0.56... | 0.54398984 | 43 |
Return a `str` version of this InviteUser object. | def __str__(self) -> str:
return json.dumps(self.to_dict(), indent=2) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __str__(self):\n return str(self.user_id) + \": \" + \\\n str(self.user_name) + \": \" + str(self.user_email)",
"def __str__(self):\n return str(self.user)",
"def __str__(self):\n return str(self.user)",
"def __str__(self):\n return str(self.user)",
"def __str_... | [
"0.8081897",
"0.76619977",
"0.76619977",
"0.76619977",
"0.76619977",
"0.76619977",
"0.75208074",
"0.75181633",
"0.7493354",
"0.7473955",
"0.7430808",
"0.74003285",
"0.73946524",
"0.7383666",
"0.7339562",
"0.73269665",
"0.7326723",
"0.7316732",
"0.72973895",
"0.7295319",
"0.72... | 0.0 | -1 |
Return `true` when self and other are equal, false otherwise. | def __eq__(self, other: 'InviteUser') -> bool:
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__ | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def equals(self, other): # -> bool:\n ...",
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self, other):\n return self is other",
"def __eq__(self, other):\n return self is other",
"de... | [
"0.86368364",
"0.85096663",
"0.85096663",
"0.8452104",
"0.8452104",
"0.83327323",
"0.83197045",
"0.83001256",
"0.83001256",
"0.8274258",
"0.8271709",
"0.825911",
"0.8255834",
"0.8246293",
"0.82412314",
"0.8205269",
"0.8205269",
"0.8190984",
"0.81824505",
"0.81586003",
"0.8139... | 0.0 | -1 |
Return `true` when self and other are not equal, false otherwise. | def __ne__(self, other: 'InviteUser') -> bool:
return not self == other | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n return not self.__ne__(other)",
"def __ne__ (self, other):\n return not self == other",
"def __ne__(self, other):\n if self.__eq__(other):\n return False\n return True",
"def __ne__(self, other) -> bool:\n return not self.__eq__(other)"... | [
"0.8608476",
"0.85141045",
"0.8458375",
"0.84514666",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
... | 0.0 | -1 |
Initialize a InviteUserIamPolicy object. | def __init__(self,
type: str,
*,
roles: List['Role'] = None,
resources: List['Resource'] = None) -> None:
self.type = type
self.roles = roles
self.resources = resources | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def from_dict(cls, _dict: Dict) -> 'InviteUserIamPolicy':\n args = {}\n if 'type' in _dict:\n args['type'] = _dict.get('type')\n else:\n raise ValueError('Required property \\'type\\' not present in InviteUserIamPolicy JSON')\n if 'roles' in _dict:\n arg... | [
"0.6425146",
"0.6220608",
"0.5782737",
"0.55537313",
"0.53014845",
"0.5183188",
"0.5138096",
"0.51122475",
"0.5101336",
"0.5101336",
"0.5101336",
"0.5101336",
"0.5101336",
"0.5101336",
"0.5067077",
"0.4991255",
"0.49752098",
"0.4967539",
"0.49216294",
"0.49116823",
"0.4885069... | 0.0 | -1 |
Return a `str` version of this InviteUserIamPolicy object. | def __str__(self) -> str:
return json.dumps(self.to_dict(), indent=2) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_string(self):\n return \"User: {} Description: {} Ratings: {}\".format(self.id_user, self.description, self.ratings)",
"def __str__(self):\n return str(self.user_id) + \": \" + \\\n str(self.user_name) + \": \" + str(self.user_email)",
"def __repr__(self):\n\n return f... | [
"0.6604704",
"0.62324154",
"0.6134952",
"0.6105929",
"0.6105929",
"0.6105929",
"0.6105929",
"0.6105929",
"0.59805393",
"0.58869714",
"0.58837813",
"0.5883358",
"0.5868369",
"0.5868369",
"0.5868369",
"0.5868369",
"0.5866004",
"0.5819971",
"0.5818769",
"0.5800241",
"0.57885456"... | 0.0 | -1 |
Return `true` when self and other are equal, false otherwise. | def __eq__(self, other: 'InviteUserIamPolicy') -> bool:
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__ | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def equals(self, other): # -> bool:\n ...",
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self, other):\n return self is other",
"def __eq__(self, other):\n return self is other",
"de... | [
"0.86368364",
"0.85096663",
"0.85096663",
"0.8452104",
"0.8452104",
"0.83327323",
"0.83197045",
"0.83001256",
"0.83001256",
"0.8274258",
"0.8271709",
"0.825911",
"0.8255834",
"0.8246293",
"0.82412314",
"0.8205269",
"0.8205269",
"0.8190984",
"0.81824505",
"0.81586003",
"0.8139... | 0.0 | -1 |
Return `true` when self and other are not equal, false otherwise. | def __ne__(self, other: 'InviteUserIamPolicy') -> bool:
return not self == other | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n return not self.__ne__(other)",
"def __ne__ (self, other):\n return not self == other",
"def __ne__(self, other):\n if self.__eq__(other):\n return False\n return True",
"def __ne__(self, other) -> bool:\n return not self.__eq__(other)"... | [
"0.8608476",
"0.85141045",
"0.8458375",
"0.84514666",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
... | 0.0 | -1 |
Initialize a Resource object. | def __init__(self,
*,
attributes: List['Attribute'] = None) -> None:
self.attributes = attributes | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, resource_path):\n self.resource_path = resource_path",
"def __init__(__self__,\n resource_name: str,\n args: Optional[InstanceArgs] = None,\n opts: Optional[pulumi.ResourceOptions] = None):\n ...",
"def __init__(self, id=None, res... | [
"0.77654684",
"0.74447834",
"0.73715883",
"0.7362346",
"0.72837365",
"0.72837365",
"0.72751737",
"0.71823096",
"0.7173457",
"0.7168807",
"0.7149277",
"0.7147066",
"0.7147066",
"0.7147066",
"0.7147066",
"0.71366274",
"0.71366274",
"0.71366274",
"0.7130317",
"0.7128944",
"0.712... | 0.0 | -1 |
Initialize a Resource object from a json dictionary. | def from_dict(cls, _dict: Dict) -> 'Resource':
args = {}
if 'attributes' in _dict:
args['attributes'] = [Attribute.from_dict(x) for x in _dict.get('attributes')]
return cls(**args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def FromDict(resource, raw_config):\r\n resource.name = raw_config[\"name\"]\r\n resource.raw_config = raw_config",
"def from_json(cls, tag_json):\n return cls.from_dict(json.loads(tag_json))",
"def from_json(self, params: JSONDict, local_params: JSONDict, workspace: Workspace) -> Resource:\n r... | [
"0.738404",
"0.6955552",
"0.6853998",
"0.6821774",
"0.6821774",
"0.6821774",
"0.6821774",
"0.6821774",
"0.6821774",
"0.6821774",
"0.6821774",
"0.6821774",
"0.6821774",
"0.6821774",
"0.6821774",
"0.6821774",
"0.6821774",
"0.6821774",
"0.6821774",
"0.6821774",
"0.6821774",
"0... | 0.74962336 | 0 |
Initialize a Resource object from a json dictionary. | def _from_dict(cls, _dict):
return cls.from_dict(_dict) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def from_dict(cls, _dict: Dict) -> 'Resource':\n args = {}\n if 'attributes' in _dict:\n args['attributes'] = [Attribute.from_dict(x) for x in _dict.get('attributes')]\n return cls(**args)",
"def FromDict(resource, raw_config):\r\n resource.name = raw_config[\"name\"]\r\n resour... | [
"0.7496829",
"0.73838574",
"0.6959405",
"0.6851439",
"0.6785983",
"0.67197895",
"0.67067075",
"0.67067075",
"0.67067075",
"0.6693912",
"0.6677469",
"0.6665084",
"0.66607624",
"0.6619306",
"0.66190064",
"0.6608745",
"0.6562166",
"0.6556808",
"0.6545939",
"0.65292245",
"0.65219... | 0.6823815 | 44 |
Return `true` when self and other are equal, false otherwise. | def __eq__(self, other: 'Resource') -> bool:
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__ | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def equals(self, other): # -> bool:\n ...",
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self, other):\n return self is other",
"def __eq__(self, other):\n return self is other",
"de... | [
"0.86368364",
"0.85096663",
"0.85096663",
"0.8452104",
"0.8452104",
"0.83327323",
"0.83197045",
"0.83001256",
"0.83001256",
"0.8274258",
"0.8271709",
"0.825911",
"0.8255834",
"0.8246293",
"0.82412314",
"0.8205269",
"0.8205269",
"0.8190984",
"0.81824505",
"0.81586003",
"0.8139... | 0.0 | -1 |
Return `true` when self and other are not equal, false otherwise. | def __ne__(self, other: 'Resource') -> bool:
return not self == other | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n return not self.__ne__(other)",
"def __ne__ (self, other):\n return not self == other",
"def __ne__(self, other):\n if self.__eq__(other):\n return False\n return True",
"def __ne__(self, other) -> bool:\n return not self.__eq__(other)"... | [
"0.8608476",
"0.85141045",
"0.8458375",
"0.84514666",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
... | 0.0 | -1 |
Initialize a Role object from a json dictionary. | def from_dict(cls, _dict: Dict) -> 'Role':
args = {}
if 'role_id' in _dict:
args['role_id'] = _dict.get('role_id')
return cls(**args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def from_json(cls, json_data):\n ro = cls()\n ro._name = json_data['RoleName'] \n ro._id = json_data['RoleId'] \n ro._assume_role_policy_document = urllib.parse.unquote(json_data['AssumeRolePolicyDocument']) \n ro._path = json_data['Path'] \n ro._arn = json... | [
"0.81638163",
"0.6786682",
"0.6768213",
"0.66391265",
"0.6636087",
"0.6573319",
"0.6563219",
"0.64054644",
"0.633337",
"0.6282307",
"0.6282307",
"0.6282307",
"0.6282307",
"0.6282307",
"0.6282307",
"0.6282307",
"0.6282307",
"0.6282307",
"0.6282307",
"0.6282307",
"0.6282307",
... | 0.8188326 | 0 |
Initialize a Role object from a json dictionary. | def _from_dict(cls, _dict):
return cls.from_dict(_dict) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def from_dict(cls, _dict: Dict) -> 'Role':\n args = {}\n if 'role_id' in _dict:\n args['role_id'] = _dict.get('role_id')\n return cls(**args)",
"def from_json(cls, json_data):\n ro = cls()\n ro._name = json_data['RoleName'] \n ro._id = json_data['RoleId'] ... | [
"0.818874",
"0.81627274",
"0.67874324",
"0.6766542",
"0.66374755",
"0.6634753",
"0.65739197",
"0.6564038",
"0.64063835",
"0.6332199",
"0.62260586",
"0.61793834",
"0.6178073",
"0.6160237",
"0.61441493",
"0.6105749",
"0.60823375",
"0.6078415",
"0.60413396",
"0.6038034",
"0.6037... | 0.6283505 | 45 |
Return `true` when self and other are equal, false otherwise. | def __eq__(self, other: 'Role') -> bool:
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__ | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def equals(self, other): # -> bool:\n ...",
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self, other):\n return self is other",
"def __eq__(self, other):\n return self is other",
"de... | [
"0.86368364",
"0.85096663",
"0.85096663",
"0.8452104",
"0.8452104",
"0.83327323",
"0.83197045",
"0.83001256",
"0.83001256",
"0.8274258",
"0.8271709",
"0.825911",
"0.8255834",
"0.8246293",
"0.82412314",
"0.8205269",
"0.8205269",
"0.8190984",
"0.81824505",
"0.81586003",
"0.8139... | 0.0 | -1 |
Return `true` when self and other are not equal, false otherwise. | def __ne__(self, other: 'Role') -> bool:
return not self == other | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n return not self.__ne__(other)",
"def __ne__ (self, other):\n return not self == other",
"def __ne__(self, other):\n if self.__eq__(other):\n return False\n return True",
"def __ne__(self, other) -> bool:\n return not self.__eq__(other)"... | [
"0.8608476",
"0.85141045",
"0.8458375",
"0.84514666",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
"0.8406577",
... | 0.0 | -1 |
give the three point a, b, c of the triangle compute area of it | def compute_triangle_area(a,b,c):
ab = np.sqrt( ((a-b)**2).sum() )
ac = np.sqrt( ((a-c)**2).sum() )
bc = np.sqrt( ((b-c)**2).sum() )
s = (ab+ac+bc)/2
area = np.sqrt(s*(s-ab)*(s-bc)*(s-ac))
return area | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def triangle_area(a, b, c):\n\n return 0.5 * abs(\n a[0] * (b[1] - c[1]) +\n b[0] * (c[1] - a[1]) +\n c[0] * (a[1] - b[1])\n )",
"def triangleArea(a: Vec3, b: Vec3, c: Vec3) -> float:\n return cross3(b - a, c - a).length() / 2.0",
"def _triangle_area_at_points(self, p1, p2, p3):\n... | [
"0.8419155",
"0.83793163",
"0.82857144",
"0.8169227",
"0.7854244",
"0.77730525",
"0.77615124",
"0.7754544",
"0.77499104",
"0.7746773",
"0.7678351",
"0.7643196",
"0.7586341",
"0.7567303",
"0.75518763",
"0.7534569",
"0.7456452",
"0.7412497",
"0.73789054",
"0.73781306",
"0.73062... | 0.8597739 | 0 |
Random point on the triangle with vertices pt1, pt2 and pt3. | def sample_from_triangle(pt1, pt2, pt3):
s, t = sorted([np.random.rand(), np.random.rand()])
new_pt = [s * pt1[0] + (t-s)*pt2[0] + (1-t)*pt3[0],
s * pt1[1] + (t-s)*pt2[1] + (1-t)*pt3[1]]
new_pt = np.array(new_pt)
return new_pt | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def random_point_triangle(triangle, use_int_coords=True):\n xs, ys = triangle.exterior.coords.xy\n A, B, C = zip(xs[:-1], ys[:-1])\n r1, r2 = np.random.rand(), np.random.rand()\n rx, ry = (1 - math.sqrt(r1)) * np.asarray(A) \\\n + math.sqrt(r1) * (1 - r2) * np.asarray(B)... | [
"0.7258419",
"0.6510861",
"0.64062744",
"0.63660926",
"0.6342381",
"0.62745976",
"0.62549365",
"0.62299937",
"0.62196076",
"0.6212479",
"0.6062217",
"0.6054189",
"0.60170174",
"0.59852254",
"0.59471506",
"0.59268713",
"0.59156287",
"0.5903705",
"0.58819425",
"0.5867495",
"0.5... | 0.7998691 | 0 |
Get the manufacturer of this device. | def manufacturer(self) -> str:
return self.profile_device.manufacturer | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def manufacturer(self):\n return self._device.manufacturer",
"def manufacturer(self):\n return self._manufacturer",
"def getManufacturer(self):\n return self.manufacturer",
"def manufacturer(self) -> int:\n return self.__manufacturer",
"def get_manufacturer_id(self):\n re... | [
"0.90353906",
"0.8518925",
"0.831838",
"0.82277936",
"0.8218939",
"0.73049074",
"0.72226673",
"0.6550935",
"0.6506236",
"0.6468552",
"0.63674784",
"0.6205179",
"0.60913724",
"0.60829395",
"0.59624887",
"0.5934177",
"0.5861586",
"0.58068955",
"0.58068955",
"0.5800026",
"0.5797... | 0.8396049 | 2 |
Get the model description of this device. | def model_description(self) -> Optional[str]:
return self.profile_device.model_description | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def model(self):\n return self._device.device_data[self._uuid]['model']",
"def model_info(self) -> str:\n return self._model_info(self.model).decode(\"utf-8\")",
"async def get_model(self):\n\n # Display info message\n log.info(\"get_model\")\n\n # Get model\n output =... | [
"0.7637294",
"0.7517283",
"0.7403389",
"0.7367437",
"0.73138154",
"0.7278014",
"0.72698903",
"0.72151357",
"0.7151572",
"0.70998657",
"0.704313",
"0.7035607",
"0.701925",
"0.6954907",
"0.6908587",
"0.6841344",
"0.6841344",
"0.68296754",
"0.6785245",
"0.6769803",
"0.6764813",
... | 0.861879 | 0 |
Get the model name of this device. | def model_name(self) -> str:
return self.profile_device.model_name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_model_name(self) -> str:\n return self._get_string(openvr.Prop_RenderModelName_String)",
"def model_name(self) -> str:\n return self._model_name",
"def model_name(self):\n setting = self.get_setting_definition(self.key, **self.get_kwargs())\n\n return setting.get('model', No... | [
"0.8569971",
"0.8099642",
"0.80712456",
"0.8070661",
"0.80695206",
"0.80544424",
"0.8040396",
"0.80397254",
"0.79772025",
"0.7925024",
"0.78963363",
"0.7674078",
"0.7640027",
"0.7623954",
"0.7618327",
"0.76173633",
"0.7606722",
"0.75706977",
"0.75706977",
"0.75706977",
"0.745... | 0.88618046 | 0 |
Get the model number of this device. | def model_number(self) -> Optional[str]:
return self.profile_device.model_number | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def model_number(self):\n return self._read(MX_MODEL_NUMBER)",
"def get_model_number(self):\n raise DeviceException(DeviceException.FEATURE_NOT_IMPLEMENTED)",
"def get_model(self) -> str:\n return self._get_string(openvr.Prop_ModelNumber_String)",
"def model(self):\n return self._... | [
"0.8439356",
"0.83957314",
"0.82000476",
"0.8134674",
"0.7857678",
"0.7735827",
"0.75861144",
"0.7466752",
"0.74642986",
"0.74512565",
"0.7299415",
"0.710189",
"0.7064875",
"0.69204074",
"0.68762535",
"0.6875829",
"0.6866406",
"0.68414336",
"0.6763544",
"0.6738732",
"0.661430... | 0.85862035 | 0 |
Get the serial number of this device. | def serial_number(self) -> Optional[str]:
return self.profile_device.serial_number | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def device_serial_number(self) -> str:\n return pulumi.get(self, \"device_serial_number\")",
"def device_serial_number(self) -> str:\n return pulumi.get(self, \"device_serial_number\")",
"def get_serial_number(self):\n serial = create_string_buffer(64)\n self._dll.ShamrockGetSerialN... | [
"0.85749316",
"0.85749316",
"0.838224",
"0.82916015",
"0.82053393",
"0.81567883",
"0.8041377",
"0.80394715",
"0.8010104",
"0.7996449",
"0.79794234",
"0.77933717",
"0.7766314",
"0.77528393",
"0.7746556",
"0.7716774",
"0.7667199",
"0.7629051",
"0.76002884",
"0.7595293",
"0.7570... | 0.77846444 | 12 |
Get the UDN of the device. | def udn(self) -> str:
return self.profile_device.udn | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def userdn(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"userdn\")",
"def get_device(self) -> str:\n pass",
"def device_name(self) -> Optional[str]:\n return pulumi.get(self, \"device_name\")",
"def device_name(self) -> Optional[str]:\n return pulumi.get(self, \"device_... | [
"0.68344957",
"0.66185385",
"0.6527107",
"0.6527107",
"0.6477212",
"0.6477212",
"0.62987864",
"0.62559515",
"0.6252743",
"0.6248198",
"0.61649305",
"0.61649305",
"0.6161079",
"0.6143759",
"0.6135372",
"0.60293776",
"0.60211366",
"0.59990406",
"0.5948948",
"0.59196913",
"0.591... | 0.83075875 | 0 |
Get the device type of this device. | def device_type(self) -> str:
return self.profile_device.device_type | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def device_type(self):\n return self._meta['device_type']",
"def device_type(self):\n return self._device_type",
"def device_type(self):\r\n return self._arm.device_type",
"def device_type(self):\n return Context.devtype2str[self.device_typeid]",
"def device_type(self):\n ... | [
"0.88534343",
"0.88528055",
"0.85619867",
"0.85514826",
"0.85514826",
"0.8548445",
"0.8489934",
"0.84675115",
"0.84301883",
"0.84301883",
"0.84301883",
"0.8223728",
"0.80427927",
"0.80370414",
"0.7967641",
"0.79288924",
"0.7887844",
"0.7839795",
"0.7824094",
"0.77785283",
"0.... | 0.8347354 | 11 |
Get a URL for the biggest icon for this device. | def icon(self) -> Optional[str]:
if not self.profile_device.icons:
return None
if not self._icon:
icon_mime_preference = {"image/png": 3, "image/jpeg": 2, "image/gif": 1}
icons = [icon for icon in self.profile_device.icons if icon.url]
icons = sorted(
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def icon(self):\r\n try:\r\n return self.data['icon_url_base']+self.data['icon_url_name']\r\n except KeyError:\r\n return ''",
"def icon(self):\n return self._sensor[CONF_ICON]",
"def getIconPath(self):\n try:\n return self.primaryAq().zIcon\n ... | [
"0.71873707",
"0.65255845",
"0.64993227",
"0.64880276",
"0.6460456",
"0.6445128",
"0.637555",
"0.6364337",
"0.63348323",
"0.6333634",
"0.6333634",
"0.6333634",
"0.6309548",
"0.630154",
"0.63008237",
"0.6284741",
"0.6279666",
"0.62722284",
"0.6244973",
"0.62449384",
"0.6240815... | 0.725759 | 0 |
Get state_variable from service. | def _state_variable(
self, service_name: str, state_variable_name: str
) -> Optional[UpnpStateVariable]:
service = self._service(service_name)
if not service:
return None
if not service.has_state_variable(state_variable_name):
return None
return serv... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getValue(self, state):\n return self.values[state]",
"def getValue(self, state):\r\n return self.values[state]",
"def get_variable(self, svc, var):\n action = \"variableget\"\n path = \"data_request?id=%s&DeviceNum=%d&serviceId=%s&Variable=%s\" \\\n % (action, self.id,... | [
"0.6329335",
"0.62805873",
"0.6269923",
"0.626864",
"0.626864",
"0.626864",
"0.626864",
"0.626864",
"0.626864",
"0.626864",
"0.626864",
"0.626864",
"0.626864",
"0.626864",
"0.626864",
"0.61687005",
"0.61685246",
"0.61109585",
"0.6010915",
"0.6010915",
"0.6010915",
"0.601091... | 0.7827207 | 0 |
Get current service subscription state. | def is_subscribed(self) -> bool:
return bool(self._subscriptions) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_state(self):\n _, state, _, _, _, _, _ = win32serviceutil.QueryServiceStatus(self.name)\n return state",
"def get_service_status(self):\n return self.service.status()",
"def subscription(self):\n return self._subscription",
"def subscription(self):\n return self._su... | [
"0.72079974",
"0.65655756",
"0.6564854",
"0.6564854",
"0.64313346",
"0.642365",
"0.62689906",
"0.6171627",
"0.6120914",
"0.6093969",
"0.6093969",
"0.6093969",
"0.6093969",
"0.6093969",
"0.60543483",
"0.6054179",
"0.6054179",
"0.6042772",
"0.6041697",
"0.60348123",
"0.6027701"... | 0.0 | -1 |
Helper function to convert listsoflists into tupleoftuples. | def convert_iter_to_type(iterable, target_type):
if isinstance(iterable, collections.Mapping):
dic = {}
for k, v in iterable.items():
dic[k] = convert_iter_to_type(v, target_type)
output = dic
else:
lst = []
for obj in iterable:
if _is_nsiterable(o... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def element_to_tuple(list_of_elements):\n return list(map(lambda x: tuple(x), list_of_elements))",
"def _covert_list_tensor_to_tuple_tensor(list_of_tensor):\n if isinstance(list_of_tensor, list):\n tuple_of_tensor = ()\n for tensor in list_of_tensor:\n tuple_of_tensor += (tensor,)\... | [
"0.74750876",
"0.7162669",
"0.7142922",
"0.6649032",
"0.6430777",
"0.6415221",
"0.63941485",
"0.6387474",
"0.6289286",
"0.6254183",
"0.62530684",
"0.622289",
"0.6207154",
"0.62066174",
"0.62047434",
"0.6168977",
"0.6144952",
"0.61415327",
"0.6129635",
"0.60307693",
"0.6026550... | 0.0 | -1 |
Get kernel to blur an image | def get_blur_kernel(n):
return [1/n**2] * n**2 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def blur(image, kernel_size=(7, 7)):\n image = cv2.blur(image, kernel_size)\n return image",
"def blur(image, kernel_size=(7, 7)):\n image = cv2.blur(image, kernel_size)\n return image",
"def blur(img, kern=(3, 3)):\n return cv2.GaussianBlur(img, kern, 0)",
"def blurImage1(in_image: np.ndarray... | [
"0.8216179",
"0.8216179",
"0.79668653",
"0.79628295",
"0.7874814",
"0.78662455",
"0.77878606",
"0.77587205",
"0.77310765",
"0.77038145",
"0.75161815",
"0.7497952",
"0.74715525",
"0.74221534",
"0.74221534",
"0.74221534",
"0.74221534",
"0.74221534",
"0.74221534",
"0.74221534",
... | 0.77480364 | 8 |
Return a new image representing the result of applying a box blur (with kernel size n) to the given input image. This process should not mutate the input image; rather, it should create a separate structure to represent the output. | def blurred(image, n ,correct = True):
# first, create a representation for the appropriate n-by-n kernel (you may
# wish to define another helper function for this)
kernel = get_blur_kernel(n)
# then compute the correlation of the input image with that kernel
correlated = correlate(image, kernel)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def box_blur(img: np.ndarray, kernel_size: int = 3):\n imgtype = img.dtype\n h,w,c = img.shape\n\n #Get a valid kernel size\n kernel_size = valid_kernel(h,w,kernel_size)\n \n #Box Filter Blur \n blurred = cv2.boxFilter(img,-1,(kernel_size,kernel_size))\n\n return blurred.astype(imgtype)",
... | [
"0.7690706",
"0.75478446",
"0.75478446",
"0.7498462",
"0.7386526",
"0.7368193",
"0.7362892",
"0.71232164",
"0.7008699",
"0.68226784",
"0.678141",
"0.6771456",
"0.6681763",
"0.66796654",
"0.66539305",
"0.6624264",
"0.6614876",
"0.65784013",
"0.64819807",
"0.6439279",
"0.643569... | 0.6270404 | 23 |
Return internal object representation in a readable fashion. | def get_readable_inners(self):
return self.value | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __repr__(self):\n return repr(self.__dict__['_obj'])",
"def __repr__(self):\n return str(self.__dict__)",
"def __repr__(self):\n return str(self.__dict__)",
"def __repr__(self):\n return str(self.__dict__)",
"def __repr__(self):\n return str(self.__dict__)",
... | [
"0.757269",
"0.7340792",
"0.7340792",
"0.7340792",
"0.7340792",
"0.7340792",
"0.7309972",
"0.7269575",
"0.7242474",
"0.720993",
"0.72064173",
"0.71821153",
"0.70820314",
"0.7067649",
"0.703967",
"0.70325816",
"0.70282704",
"0.7026357",
"0.70200044",
"0.70167255",
"0.70167255"... | 0.0 | -1 |
Tests the GetExtents function. | def testGetExtents(self):
path_spec = path_spec_factory.Factory.NewPathSpec(
definitions.TYPE_INDICATOR_HFS,
identifier=self._IDENTIFIER_ANOTHER_FILE,
location='/a_directory/another_file',
parent=self._raw_path_spec)
file_entry = self._file_system.GetFileEntryByPathSpec(path_spec... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def extents(self):\n self._updateExtents()\n return self.mExtents",
"def test_get_xy_space():\n pass",
"def GetNiceExtentsByDivisions(minval,maxval,divisions,tolerance):\n pass",
"def test_01_get_geometry_collection_list(self):\n response = self.client.get(reverse('collection-lc'),... | [
"0.6231512",
"0.59855056",
"0.58897495",
"0.5664403",
"0.5603143",
"0.55884904",
"0.54913116",
"0.5464123",
"0.54521596",
"0.5434098",
"0.5404349",
"0.5384948",
"0.538406",
"0.53690225",
"0.5360815",
"0.5359297",
"0.5359297",
"0.53429186",
"0.5326784",
"0.5293354",
"0.5293155... | 0.7964391 | 0 |
Get dataframe of forecast dates from csv file. | def getForecastDates():
# Read in the forecast dates for each week from csv
filename = "Seasonal_Forecast_Dates.csv"
forecast_dates = pd.read_csv(filename, skiprows=1,
names=['week', 'start_date', 'end_date'])
forecast_dates[["start_year", "start_month", "start_day"]] \... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_df_from_csv(self, filename):\n df = pd.read_csv(filename)\n df.set_index('Date', drop=True, inplace=True)\n df.index = pd.to_datetime(df.index)\n return df",
"def read_csv():\n csv_file = \"dow.csv\"\n\n # read the data from the csv file, parsing the Dates to make the x... | [
"0.7430122",
"0.72256196",
"0.6724717",
"0.66575074",
"0.65499985",
"0.6504606",
"0.6443599",
"0.6415501",
"0.63777745",
"0.63611597",
"0.63290495",
"0.6312312",
"0.62973565",
"0.6274482",
"0.6257605",
"0.62445074",
"0.6226279",
"0.6223592",
"0.62231207",
"0.62216115",
"0.618... | 0.70905936 | 2 |
Returns atomic energy correction due to spin orbit coupling | def thermal(isatom, freq, scalfac,linnonlin,T):
if isatom != "true":
nfreq = len(freq)
vib_temp = []
for ifreq in range(nfreq):
freq[ifreq] = float(freq[ifreq]) * float(scalfac)
vib_temp_new = c * 100.0 * h * float(freq[ifreq]) / kB
vib_temp.append(vib_t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fluxonium_potential(self):\n return -0.5*(self.Ej * ((1+self.d)*cos(self.phis - 2. * pi * self.phi - 2. * pi * self.phiL) + (1-self.d)*cos(self.phis-2. * pi * self.phiL))) + self.El/2. * (self.phis) ** 2\n #return -0.5*(self.Ej * cos(self.phis - 2. * pi * self.phi) + self.Ej * cos(self.phis)) + s... | [
"0.6179001",
"0.596502",
"0.5924348",
"0.59050554",
"0.59035176",
"0.5862442",
"0.58465827",
"0.5841576",
"0.5836832",
"0.58058333",
"0.57856196",
"0.5779995",
"0.5763423",
"0.5755376",
"0.57425827",
"0.5733335",
"0.57227665",
"0.5719478",
"0.57152355",
"0.57119864",
"0.57048... | 0.0 | -1 |
Returns the kernel smoothed prediction at x If x is a real number then a single value is returned. Otherwise an attempt is made to cast x to numpy.ndarray and an array of corresponding ypoints is returned. | def predict(self, x = None, ydata=None):
if x is None:
x = self.xdata
elif x.ndim > 1:
raise ValueError("Each smoother must have a single covariate.")
if ydata is None:
if not hasattr(self, 'ydata'):
raise ValueError("You should fit your data... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def predict(self, x: np.ndarray):\n return self.model.predict(x)",
"def predict(self, x: np.ndarray):\n return self.fit_function(x, self.coefficients)",
"def prediction(self, x):\n if len(x.shape)==1:\n x = np.reshape(x, (1, x.shape[0]))\n return self.model.predict(x)",
... | [
"0.629058",
"0.62880933",
"0.6172902",
"0.61203057",
"0.6118859",
"0.61024666",
"0.60958093",
"0.60878646",
"0.60521317",
"0.60425115",
"0.5997413",
"0.5994776",
"0.5981809",
"0.5961522",
"0.5948109",
"0.59247184",
"0.5905884",
"0.58937746",
"0.58885735",
"0.58856577",
"0.586... | 0.6175746 | 2 |
Calculate the great circle distance between two points on the earth (specified in decimal degrees) | def calculate_distance_based_on_lon_lat(lon1, lat1, lon2, lat2):
# convert decimal degrees to radians
lon1, lat1, lon2, lat2 = map(np.radians, [lon1, lat1, lon2, lat2])
# haversine formula
dlon = lon2 - lon1
dlat = lat2 - lat1
a = sin(dlat/2)**2 + cos(lat1) * cos(lat2) * sin(dlon/2)**2
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def great_circle(lat_1, long_1, lat_2, long_2):\n long_1 = m.radians(long_1)\n lat_1 = m.radians(lat_1)\n long_2 = m.radians(long_2)\n lat_2 = m.radians(lat_2)\n\n d = 2 * 6367.45 * m.asin(\n m.sqrt(haversine(lat_2 - lat_1)\n + m.cos(lat_1)*m.cos(lat_2) *\n haversine(long... | [
"0.81450045",
"0.7863265",
"0.76322985",
"0.76064754",
"0.75978696",
"0.75965863",
"0.75944835",
"0.75720793",
"0.75630087",
"0.7555095",
"0.7528691",
"0.7517629",
"0.7492963",
"0.7467739",
"0.7452678",
"0.7434477",
"0.73914117",
"0.7357736",
"0.73484355",
"0.73318124",
"0.73... | 0.68516624 | 73 |
Computes area of spherical polygon, assuming spherical Earth. Returns result in ratio of the sphere's area if the radius is specified. Otherwise, in the units of provided radius. lats and lons are in degrees. | def calculate_polygon_area(aLon_in, aLat_in, algorithm = 0):
#TODO: take into account geodesy (i.e. convert latitude to authalic sphere, use radius of authalic sphere instead of mean radius of spherical earth)
#for i in range(len(aLon_in)):
# aLon_in[i] = aLon_in[i] + 180.0
lons = np.deg2rad(aL... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sphereArea(radius):\n area = 4 * math.pi * radius ** 2\n return area",
"def sphere_area(radius : number) -> number:\n area = 4*pi*radius*radius\n return area",
"def surface_area_sphere(radius: float) -> float:\r\n if radius < 0:\r\n raise ValueError(\"surface_area_sphere() only accept... | [
"0.7626586",
"0.7562502",
"0.7255949",
"0.70110184",
"0.69903576",
"0.6971244",
"0.6953625",
"0.68566",
"0.6814547",
"0.676086",
"0.67554843",
"0.671554",
"0.67050356",
"0.6675142",
"0.66027284",
"0.6525434",
"0.6466356",
"0.6436651",
"0.6419572",
"0.6401231",
"0.6401231",
... | 0.6284249 | 24 |
Yield successive nsized chunks from l. | def chunks(l, n):
for i in range(0, len(l), n):
yield l[i:i + n] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _chunk(self, l, n):\n for i in range(0, len(l) + 1, n):\n yield l[i:i + n]",
"def chunks(self, l, n):\n for i in range(0, len(l), n):\n yield l[i:i + n]",
"def __chunks(l, n):\n for i in range(0, len(l), n):\n yield l[i:i + n]",
"def get_chunks(self, ... | [
"0.80373776",
"0.7923372",
"0.7921526",
"0.78832066",
"0.78758025",
"0.78139895",
"0.77639675",
"0.7753964",
"0.7742553",
"0.7730092",
"0.7727218",
"0.7723365",
"0.7701169",
"0.76873696",
"0.76873696",
"0.7662493",
"0.765539",
"0.7654256",
"0.7654256",
"0.76442516",
"0.764425... | 0.7447232 | 84 |
Generate a random string of fixed length | def randomString(stringLength=10):
letters = string.ascii_letters+string.digits
rand_int = random.randint(3,11)
string_random = [random.choice(letters) for i in range(stringLength)]
chunk_array = []
for chunk in chunks(string_random,rand_int):
chunk_array.append("".join(chunk))
return ch... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _generate_random_string(length: int):\n\tall_chars = string.ascii_letters + string.digits\n\treturn ''.join(random.choices(all_chars, k=length))",
"def generate_random_string(length=6):\n n = int(length / 2 + 1)\n x = binascii.hexlify(os.urandom(n))\n s = x[:length]\n return s.decode(\"utf-8\")",... | [
"0.8680464",
"0.8573714",
"0.85486245",
"0.85297275",
"0.85209286",
"0.84331024",
"0.8432044",
"0.84157014",
"0.84120053",
"0.8389201",
"0.8345882",
"0.8343962",
"0.83406156",
"0.83348686",
"0.83240855",
"0.82986933",
"0.82911193",
"0.8281826",
"0.82818025",
"0.82811046",
"0.... | 0.0 | -1 |
Wraps hidden states in new Tensors, to detach them from their history. | def repackage_hidden(h):
if isinstance(h, torch.Tensor):
return h.detach()
else:
return tuple(repackage_hidden(v) for v in h) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def detach_hidden(hidden: Any) -> Any:\n return apply_to_tensor(hidden, Tensor.detach)",
"def reset_hidden(self, hidden, reset_flags):\n # detach it from history (pytorch mechanics)\n if self.rnn_type in ['lstm', 'mylstm']:\n h = Variable(hidden[0].data)\n c = Variable(hidd... | [
"0.6896774",
"0.6564761",
"0.6440056",
"0.63181335",
"0.62956357",
"0.61828166",
"0.61425817",
"0.61264986",
"0.61264986",
"0.6120289",
"0.6029193",
"0.60253143",
"0.6020807",
"0.5987143",
"0.5969475",
"0.5969475",
"0.5932672",
"0.5932672",
"0.591887",
"0.5889544",
"0.5871412... | 0.56539345 | 29 |
Takes a list of block dictionaries and consolidates into a single list | def merge_features(lblocks, axis=0, lowmem=False):
# first we create block structure
rblocks = {}
for block in lblocks:
for k in block:
if not k in rblocks:
rblocks[k] = {}
else:
for b in block[k]:
if not b in rblocks[k] or ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_blocks_from_blockhashes(blockhashes):\n blocks = []\n\n for (height, blockhash) in enumerate(blockhashes):\n block = {\"hash\": blockhash, \"height\": height, \"tx\": []}\n if height != 0:\n block[\"previousblockhash\"] = previousblockhash\n blocks.append(block)\n ... | [
"0.602771",
"0.59734935",
"0.58766353",
"0.5870436",
"0.5821462",
"0.56499666",
"0.56200075",
"0.5593312",
"0.5540874",
"0.5528726",
"0.54976445",
"0.54627615",
"0.5431672",
"0.5422749",
"0.5413722",
"0.5345717",
"0.53415626",
"0.5327522",
"0.530329",
"0.5268182",
"0.52579176... | 0.48754612 | 57 |
Test album owner is same as user. | def test_album_image_user(self):
self.assertEqual(self.album.user, self.photo.user) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_logged_in_owner(self):\n self.make_logged_in_owner()\n\n # test show album\n self.perm_escalate_helper(self.albumcontrol, self.showalbumrequest, self.testalbum, self.testalbum.id,\n self.u, album.display_album, ALBUM_PRIVATE)\n\n # test photo vi... | [
"0.7452961",
"0.68064195",
"0.66300493",
"0.66045606",
"0.65970826",
"0.6418253",
"0.64048105",
"0.639553",
"0.6367008",
"0.6328042",
"0.6310349",
"0.6309868",
"0.6298794",
"0.62794876",
"0.6262141",
"0.6246906",
"0.623822",
"0.6226229",
"0.6198894",
"0.6191495",
"0.61822605"... | 0.7880618 | 0 |
Set the weight initializer to use for model initialization. | def setWeightInitializer(self,weights):
self.init_w = weights | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize_weights(self):\n weights_initializer.WeightsInitializer.initialize_layer_or_model(\n self._batch)",
"def init_weights(model):\n ...",
"def _weight_initializer(self):\n for m in self.modules():\n if isinstance(m, nn.Conv2d):\n nn.init.kaiming_norm... | [
"0.7710432",
"0.76555765",
"0.74032754",
"0.7401745",
"0.7372203",
"0.7370978",
"0.7360844",
"0.7285705",
"0.72742623",
"0.72039473",
"0.717678",
"0.71608955",
"0.71608955",
"0.7104234",
"0.70275",
"0.69679344",
"0.6932771",
"0.691758",
"0.690624",
"0.6899497",
"0.68904275",
... | 0.84799975 | 0 |
Change the dropout for the model. | def changeDropout(self,dropout):
self.dropout = dropout | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dropout(self, dropout):\n if dropout >= 1.0:\n raise ValueError('The `dropout` must be < 1.')\n self._internal.set_dropout(float(dropout))",
"def setDropout(self, v):\n self._set(dropout=v)\n return self",
"def setDropout(self, v):\n self._set(dropout=v)\n ... | [
"0.7607316",
"0.75290567",
"0.75290567",
"0.75290567",
"0.6800356",
"0.6643711",
"0.6465599",
"0.6263606",
"0.62606335",
"0.59723425",
"0.5947954",
"0.59096926",
"0.59026563",
"0.58794886",
"0.58793193",
"0.5823182",
"0.57351226",
"0.57333785",
"0.5660132",
"0.55856735",
"0.5... | 0.8415655 | 0 |
Change the depth of the initial convolutional layers that are used in the model. | def changeConvolutionalDepth(self,depth):
self.conv_depth = depth | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def depthwise_conv2d_model():\n\n inputs = tf.keras.Input(shape=(10, 10, 3,))\n x = tf.keras.layers.Conv2D(16, (1, 1))(inputs)\n x = tf.keras.layers.SeparableConv2D(10, (2, 2))(x)\n x = tf.keras.layers.DepthwiseConv2D(3, (1, 1))(x)\n x = tf.keras.layers.Conv2D(8, (1, 1))(x)\n x = tf.keras.layers.... | [
"0.6474813",
"0.6407027",
"0.6390992",
"0.62380326",
"0.6197896",
"0.61661947",
"0.60927427",
"0.60693276",
"0.5994721",
"0.5953011",
"0.5912902",
"0.5871859",
"0.58689946",
"0.5864339",
"0.57825774",
"0.57817256",
"0.57783556",
"0.5775353",
"0.5756989",
"0.57569546",
"0.5745... | 0.7928441 | 0 |
Returns the name of the bidder | def __str__(self):
return self.name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def name(self):\n return self._boiler.name",
"def name(self):\n return self.heater.name",
"def get_name(self) -> str:\n return self.__name",
"def name(self):\n return f\"BlueAir {self._ba_name}\"",
"def get_name(self):\n\t\treturn self.__name",
"def get_name(self) -> str:\r\n ... | [
"0.67882985",
"0.6493603",
"0.6486475",
"0.64534485",
"0.6447056",
"0.64322764",
"0.6423376",
"0.64160794",
"0.6406642",
"0.6403452",
"0.6403452",
"0.6403452",
"0.6389195",
"0.6389195",
"0.6389195",
"0.63826567",
"0.63722795",
"0.63722795",
"0.63722795",
"0.63722795",
"0.6371... | 0.0 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.