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 only case the ALU is not subtracting is when there is really an add instruction | def set_subtract():
subtract.next = not (self.en_i and self.funct3_i==f3.RV32_F3_ADD_SUB and not self.funct7_6_i) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ff_add(a, b):\n return a ^ b",
"def plus_minus(seq):\n items = even_odd_sums(seq)\n res = items[0] - seq[0]*2\n return items[1] - res",
"def a_plus_abs_b(a, b):\n if b < 0:\n op = sub(a,b)\n else:\n op = add(a,b)\n return op",
"def subtract(self, other):\n return sel... | [
"0.6286971",
"0.62498116",
"0.6223453",
"0.62028307",
"0.61329687",
"0.60642546",
"0.6061482",
"0.6051722",
"0.60442245",
"0.60414076",
"0.60414076",
"0.60382634",
"0.60382634",
"0.6004325",
"0.599462",
"0.599462",
"0.5981972",
"0.59596246",
"0.5918643",
"0.59178936",
"0.5909... | 0.6664661 | 0 |
Setup and teardown of table and dictionary needed for the tests. | def dict_setup(node, table_name, dict_name, type="UInt64"):
try:
with Given("I have a table"):
node.query(f"CREATE TABLE {table_name} (x UInt64, y UInt64, z {type}) ENGINE = Memory")
with And("I have a dictionary"):
node.query(f"CREATE DICTIONARY {dict_name} (x UInt64 HIERA... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setUp(self):\n self.db_handler = DynamoDBHandler(ModelTests.TABLE_NAME)\n self.init_table()\n self.items = {}\n self.init_items()\n self.populate_table()",
"def setUp(self):\n db.drop_all() # clean up the last tests\n db.create_all() # make our sqlalchemy ta... | [
"0.77008426",
"0.6868767",
"0.6853295",
"0.6817796",
"0.6812315",
"0.67862475",
"0.67136294",
"0.66340196",
"0.6620664",
"0.6586339",
"0.65696",
"0.6566889",
"0.6561284",
"0.6548671",
"0.65470773",
"0.65272516",
"0.6517655",
"0.65142345",
"0.649937",
"0.6495379",
"0.6485675",... | 0.0 | -1 |
Check if hashed passwords matches actual passwords | def verify_password(self, password):
self.password_hash = generate_password_hash(password)
return check_password_hash(self.password_hash, password) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __is_correct_password(salt: bytes, pw_hash: bytes, password: str) -> bool:\n return hmac.compare_digest(\n pw_hash, hashlib.pbkdf2_hmac(\"sha256\", password.encode(), salt, 100000)\n )",
"def test_hash_verification(self):\n pw = generate_password(8)\n for hash_method in (ldap_des_c... | [
"0.7773421",
"0.7761072",
"0.77314556",
"0.7620705",
"0.76132506",
"0.7600026",
"0.7573024",
"0.75554",
"0.75554",
"0.7551925",
"0.75274336",
"0.7526061",
"0.7523328",
"0.7513111",
"0.7512852",
"0.7488642",
"0.7465477",
"0.74520874",
"0.7440951",
"0.74401003",
"0.7425358",
... | 0.68958116 | 99 |
Add a user to a list of groups | def add_to_groups(self, username, groups):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_users_to_groups(output=True):\n\n for group in DEFAULT_GROUPS:\n user = User.objects.get(username=group)\n role_title = Group.objects.get(name=group)\n user.groups.add(role_title)",
"def handle(self, user):\n\n if not self.group_users:\n return\n for group... | [
"0.7959347",
"0.7613312",
"0.75907815",
"0.7535479",
"0.7512015",
"0.73366547",
"0.7294287",
"0.7258351",
"0.71683913",
"0.7149175",
"0.7146797",
"0.7065619",
"0.70454955",
"0.7023687",
"0.70080197",
"0.6912349",
"0.68801075",
"0.68131226",
"0.67715776",
"0.6770404",
"0.67440... | 0.8326638 | 0 |
Check if Einstein time is short enough for observation. | def check_einstein_time(tE_string, tE_err_string=None):
einstein_time = float(tE_string)
logger.debug("Evaluating Einstein Time: " + str(einstein_time) + " days")
if tE_err_string != None and tE_err_string != "":
einstein_time_err = float(tE_err_string)
logger.debug("Evaluating Einstein Time Error: " + str(eins... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def exceeded(self):\r\n return int(time.time()) - self.start_time >= self.length",
"def is_equidistant(self) -> bool:\n if len(self.time) < 3:\n return True\n return len(self.time.to_series().diff().dropna().unique()) == 1",
"def is_time(self) -> bool:\n return self.times... | [
"0.63402826",
"0.62989354",
"0.5850202",
"0.5821961",
"0.5764869",
"0.57548577",
"0.55080265",
"0.54802835",
"0.5414565",
"0.5410703",
"0.54004383",
"0.5364942",
"0.53267974",
"0.5299109",
"0.52583176",
"0.52540416",
"0.52495885",
"0.52080303",
"0.51965034",
"0.51921725",
"0.... | 0.6906599 | 0 |
Initialize the corresponding dataloader. | def __init__(self, datasets: Union[str, list], **kwargs) -> None:
if isinstance(datasets, str):
datasets = [datasets]
self._data = None
for dataset in datasets:
assert dataset in DATASETS, f"[!] Dataset not found: {dataset}"
if self._data is None:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, dataloader):\n self._dataloader = dataloader\n\n self._iterator = iter(self._dataloader)",
"def __init__(self, **kwargs):\n DataLoader.__init__(self, **kwargs)",
"def __init__(self, **kwargs):\n DataLoader.__init__(self, **kwargs)\n \n self._results_... | [
"0.77023107",
"0.76563346",
"0.7520428",
"0.73514766",
"0.73419636",
"0.72050345",
"0.71969324",
"0.7108783",
"0.70690864",
"0.70409447",
"0.6913584",
"0.68940794",
"0.6878479",
"0.6861133",
"0.68547475",
"0.683929",
"0.6747361",
"0.67407745",
"0.6688399",
"0.6675329",
"0.664... | 0.0 | -1 |
Get complex types with dictionary property. | async def get_valid(self, **kwargs: Any) -> JSON:
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})
_hea... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def type_object(self, json):\n json_prop = _utils.json_prop_finder(json)\n d = {k: (self.switcher(v)) for k, v in json_prop.items()}\n return d",
"def extract_complex_object(self, obj):\n\n fields_iterator = None\n if hasattr(obj, \"_sa_class_manager\"):\n fields_ite... | [
"0.603866",
"0.56728345",
"0.55048907",
"0.5492899",
"0.54849964",
"0.54294926",
"0.5416811",
"0.5377584",
"0.53303564",
"0.52699876",
"0.52378505",
"0.52168626",
"0.5165352",
"0.51569545",
"0.514792",
"0.51444256",
"0.51213795",
"0.5117491",
"0.5106372",
"0.50992984",
"0.509... | 0.0 | -1 |
This defines the index page. It holds form available at the page. | def index(request):
# Writing action of form when categories are submitted
if request.method == 'POST':
form = CategoryForm(request.POST)
if form.is_valid():
# Fetching the three categories listed by user
category1 = form.cleaned_data['field0']
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index_page():\n\n\n return render_template(\"application-form.html\")",
"def index():\n return render_template('form.html')",
"def index(self):\n\t\treturn render_template('index.html')",
"def index(self):\n return render_template('main/index.html')",
"def index():\n\n return {\n ... | [
"0.7650761",
"0.7626611",
"0.7221549",
"0.71963304",
"0.71010256",
"0.7016205",
"0.69369036",
"0.68885905",
"0.68818045",
"0.6874555",
"0.6852876",
"0.68191147",
"0.68191147",
"0.681449",
"0.6805807",
"0.68000275",
"0.67993474",
"0.6781361",
"0.675917",
"0.675917",
"0.675917"... | 0.0 | -1 |
//!sets level starting with that location will be removed.Value of level can be set to TopAbs_SHAPE,TopAbs_COMPOUND,TopAbs_SOLID,TopAbs_SHELL,TopAbs_FACE.By default TopAbs_SHAPE. In this case location will be removed for all shape types for exception of compound. | def RemoveLevel(self, *args):
return _ShapeUpgrade.ShapeUpgrade_RemoveLocations_RemoveLevel(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def SetRemoveLevel(self, *args):\n return _ShapeUpgrade.ShapeUpgrade_RemoveLocations_SetRemoveLevel(self, *args)",
"def remove_from_level(level, position):\n size = level_size(level)\n index = position_to_index(position, size)\n level = level[:index] + AIR + level[1 + index:]\n return level",
... | [
"0.69633234",
"0.6592906",
"0.5793451",
"0.54201317",
"0.53798324",
"0.533431",
"0.53304696",
"0.53104514",
"0.52707696",
"0.5202042",
"0.51855147",
"0.5164337",
"0.511984",
"0.51059043",
"0.5004643",
"0.5001569",
"0.49961305",
"0.49958217",
"0.49889192",
"0.49889192",
"0.498... | 0.68731207 | 1 |
Sets maximal allowed tolerance | def SetMaxTolerance(self, *args):
return _ShapeUpgrade.ShapeUpgrade_ShapeDivide_SetMaxTolerance(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_tolerance(self, tol):\n self.tolerance = tol",
"def tolerance(self, tolerance: float) -> None:\n self._tolerance = tolerance",
"def tol(self, value):\n self._tol = value",
"def SetMaxTolerance(self, *args):\n return _ShapeUpgrade.ShapeUpgrade_Tool_SetMaxTolerance(self, *ar... | [
"0.7575807",
"0.7251177",
"0.72455317",
"0.7190651",
"0.7162679",
"0.714949",
"0.7128505",
"0.69645315",
"0.6915495",
"0.6896754",
"0.6891016",
"0.68512464",
"0.6842049",
"0.683829",
"0.6787669",
"0.6635915",
"0.660438",
"0.6577805",
"0.6539775",
"0.6486394",
"0.64784396",
... | 0.6776699 | 15 |
Sets minimal allowed tolerance | def SetMinTolerance(self, *args):
return _ShapeUpgrade.ShapeUpgrade_ShapeDivide_SetMinTolerance(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_tolerance(self, tol):\n self.tolerance = tol",
"def tolerance(self, tolerance: float) -> None:\n self._tolerance = tolerance",
"def set_tolerance(rel_tolerance=1e-09, abs_tolerance=0.0):\n global REL_TOLERANCE, ABS_TOLERANCE\n REL_TOLERANCE = rel_tolerance\n ABS_TOLERANCE = abs_t... | [
"0.75836384",
"0.7346595",
"0.7309868",
"0.7186628",
"0.71214104",
"0.7098364",
"0.70511806",
"0.7031828",
"0.6907544",
"0.6808125",
"0.671106",
"0.6693079",
"0.66902786",
"0.66878897",
"0.6629868",
"0.6617134",
"0.65965813",
"0.65845656",
"0.6509486",
"0.6388936",
"0.6333996... | 0.6564057 | 18 |
Initializes with single supporting surface. | def Init(self, *args):
return _ShapeUpgrade.ShapeUpgrade_SplitSurface_Init(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, surface, rect):\n self.surface = surface\n self.rect = rect",
"def __init__(self, surface, rect):\n self.surface = surface\n self.rect = rect",
"def __init__(self, width, height, color, main_surface):\n self.main_surface = main_surface\n self.width =... | [
"0.7385582",
"0.7385582",
"0.7038294",
"0.6999862",
"0.66294426",
"0.65653646",
"0.64566725",
"0.62938106",
"0.6285407",
"0.62542224",
"0.6239235",
"0.6224603",
"0.62018985",
"0.6166028",
"0.6153085",
"0.6012398",
"0.5994198",
"0.59897316",
"0.59859276",
"0.59735435",
"0.5968... | 0.6135313 | 15 |
Sets basic precision value | def SetPrecision(self, *args):
return _ShapeUpgrade.ShapeUpgrade_Tool_SetPrecision(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _set_precision(self, precision) :\n self.__precision = self.parent().monoid().filter(precision)",
"def _set_precision(self, precision) :\n self.__precision = self.parent().action().filter(precision)",
"def change_precision(self, precision):\n if precision <= 0:\n print(\"Pre... | [
"0.79208887",
"0.78027874",
"0.7742799",
"0.75182056",
"0.73694354",
"0.7308137",
"0.7294265",
"0.715803",
"0.7084881",
"0.6973207",
"0.69669694",
"0.6856543",
"0.684738",
"0.6845806",
"0.68156695",
"0.6778273",
"0.67639995",
"0.6725386",
"0.66963935",
"0.6689762",
"0.6689762... | 0.756268 | 3 |
Returns basic precision value | def Precision(self, *args):
return _ShapeUpgrade.ShapeUpgrade_Tool_Precision(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_precision(self):\n ...",
"def precision(self) :\n return self.__precision",
"def precision(self) :\n return self.__precision",
"def precision(self):\n return PRECISION_WHOLE",
"def precision(self):\n tpos, fpos = len(self.__true_positives), len(self.__false_positi... | [
"0.84822035",
"0.81232446",
"0.81232446",
"0.7989849",
"0.79167944",
"0.7716119",
"0.7662741",
"0.7614419",
"0.7543757",
"0.7543757",
"0.7440554",
"0.7360122",
"0.73393255",
"0.731444",
"0.729698",
"0.7289147",
"0.72859526",
"0.7224211",
"0.71808773",
"0.7148724",
"0.71195567... | 0.6510254 | 84 |
Sets minimal allowed tolerance | def SetMinTolerance(self, *args):
return _ShapeUpgrade.ShapeUpgrade_Tool_SetMinTolerance(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_tolerance(self, tol):\n self.tolerance = tol",
"def tolerance(self, tolerance: float) -> None:\n self._tolerance = tolerance",
"def set_tolerance(rel_tolerance=1e-09, abs_tolerance=0.0):\n global REL_TOLERANCE, ABS_TOLERANCE\n REL_TOLERANCE = rel_tolerance\n ABS_TOLERANCE = abs_t... | [
"0.75836384",
"0.7346595",
"0.7309868",
"0.7186628",
"0.7098364",
"0.70511806",
"0.7031828",
"0.6907544",
"0.6808125",
"0.671106",
"0.6693079",
"0.66902786",
"0.66878897",
"0.6629868",
"0.6617134",
"0.65965813",
"0.65845656",
"0.6564057",
"0.6509486",
"0.6388936",
"0.6333996"... | 0.71214104 | 4 |
Sets maximal allowed tolerance | def SetMaxTolerance(self, *args):
return _ShapeUpgrade.ShapeUpgrade_Tool_SetMaxTolerance(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_tolerance(self, tol):\n self.tolerance = tol",
"def tolerance(self, tolerance: float) -> None:\n self._tolerance = tolerance",
"def tol(self, value):\n self._tol = value",
"def set_tolerance(self, tol):\n self.precision = tol\n return",
"def set_tol(self, tol : fl... | [
"0.7575807",
"0.7251177",
"0.72455317",
"0.7162679",
"0.714949",
"0.7128505",
"0.69645315",
"0.6915495",
"0.6896754",
"0.6891016",
"0.68512464",
"0.6842049",
"0.683829",
"0.6787669",
"0.6776699",
"0.6635915",
"0.660438",
"0.6577805",
"0.6539775",
"0.6486394",
"0.64784396",
... | 0.7190651 | 3 |
Returns maximal allowed tolerance | def MaxTolerance(self, *args):
return _ShapeUpgrade.ShapeUpgrade_Tool_MaxTolerance(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tolerance(self):\n return self.params['tolerance']",
"def tolerance(self) -> float:\n return self._tolerance",
"def get_tolerance(self):\n return self.tolerance",
"def tolerance(self):\n return self._tolerance",
"def tol(self) -> Real:\n return self._tol",
"def tol(... | [
"0.7366287",
"0.73536164",
"0.7236754",
"0.7230163",
"0.7211587",
"0.7169938",
"0.6895662",
"0.68270594",
"0.6706353",
"0.66190666",
"0.6607559",
"0.6569687",
"0.6477027",
"0.6422727",
"0.64022225",
"0.6376976",
"0.6371638",
"0.6338574",
"0.6308676",
"0.63068366",
"0.6263653"... | 0.69495094 | 6 |
Returns tolerance limited by [myMinTol,myMaxTol] | def LimitTolerance(self, *args):
return _ShapeUpgrade.ShapeUpgrade_Tool_LimitTolerance(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tolerance(self):\n return self.params['tolerance']",
"def get_tolerance(self):\n return self.tolerance",
"def get_tolerances(self) -> Tuple[float, float]:\n return self.rtol, self.atol",
"def set_tolerance(self, tol):\n self.tolerance = tol",
"def tolerance(self):\n r... | [
"0.6783507",
"0.67646116",
"0.6659864",
"0.66036636",
"0.65690917",
"0.6549585",
"0.6545838",
"0.6473082",
"0.6440615",
"0.6293775",
"0.6283182",
"0.6241491",
"0.6237966",
"0.6234752",
"0.61963147",
"0.61372864",
"0.6107417",
"0.6098067",
"0.6036497",
"0.59854215",
"0.5970462... | 0.65561855 | 5 |
Returns the Geom_Pline conversion mode. | def GetPlaneMode(self, *args):
return _ShapeUpgrade.ShapeUpgrade_ConvertSurfaceToBezierBasis_GetPlaneMode(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetLineMode(self, *args):\n return _ShapeUpgrade.ShapeUpgrade_ConvertCurve3dToBezier_GetLineMode(self, *args)",
"def getPointMode(self):\n l = [point.mode for point in self.points]\n if l.count(l[0]) == len(l):\n return l[0]\n else:\n raise ValueError(\"The m... | [
"0.6028927",
"0.5718504",
"0.5663904",
"0.5663904",
"0.56470746",
"0.5342906",
"0.52665293",
"0.51830626",
"0.5117621",
"0.50849855",
"0.49635884",
"0.49352667",
"0.49198526",
"0.48445207",
"0.48368344",
"0.48325792",
"0.4805562",
"0.4797635",
"0.47678855",
"0.47631493",
"0.4... | 0.44984958 | 60 |
Returns the Geom_SurfaceOfRevolution conversion mode. | def GetRevolutionMode(self, *args):
return _ShapeUpgrade.ShapeUpgrade_ConvertSurfaceToBezierBasis_GetRevolutionMode(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetRevolutionMode(self, *args):\n return _ShapeUpgrade.ShapeUpgrade_ShapeConvertToBezier_GetRevolutionMode(self, *args)",
"def surface_type(self):\n surf_type = BRepAdaptor_Surface(self.topods_shape()).GetType()\n if surf_type == GeomAbs_Plane:\n return \"plane\"\n if s... | [
"0.68073547",
"0.6676888",
"0.60060275",
"0.60013795",
"0.5947809",
"0.5943867",
"0.5923771",
"0.58328015",
"0.57163036",
"0.5692931",
"0.5685827",
"0.5682485",
"0.5673048",
"0.5668966",
"0.56524885",
"0.56268483",
"0.5622178",
"0.55830413",
"0.5572949",
"0.55569386",
"0.5545... | 0.7220516 | 0 |
Returns the Geom_SurfaceOfLinearExtrusion conversion mode. | def GetExtrusionMode(self, *args):
return _ShapeUpgrade.ShapeUpgrade_ConvertSurfaceToBezierBasis_GetExtrusionMode(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetExtrusionMode(self, *args):\n return _ShapeUpgrade.ShapeUpgrade_ShapeConvertToBezier_GetExtrusionMode(self, *args)",
"def surface_type(self):\n surf_type = BRepAdaptor_Surface(self.topods_shape()).GetType()\n if surf_type == GeomAbs_Plane:\n return \"plane\"\n if sur... | [
"0.63550276",
"0.59579855",
"0.5753288",
"0.5748688",
"0.56427443",
"0.5589648",
"0.5532947",
"0.54658955",
"0.5415165",
"0.53459036",
"0.5329777",
"0.5310284",
"0.53090024",
"0.52937967",
"0.5245303",
"0.5213941",
"0.51732045",
"0.514939",
"0.51313865",
"0.51313865",
"0.5128... | 0.6706385 | 0 |
Sets mode for conversion Geom_BSplineSurface to Bezier | def SetBSplineMode(self, *args):
return _ShapeUpgrade.ShapeUpgrade_ConvertSurfaceToBezierBasis_SetBSplineMode(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def SetBSplineMode(self, *args):\n return _ShapeUpgrade.ShapeUpgrade_ShapeConvertToBezier_SetBSplineMode(self, *args)",
"def GetBSplineMode(self, *args):\n return _ShapeUpgrade.ShapeUpgrade_ConvertSurfaceToBezierBasis_GetBSplineMode(self, *args)",
"def GetBSplineMode(self, *args):\n return... | [
"0.80295265",
"0.7968187",
"0.7794852",
"0.6390057",
"0.63317794",
"0.63120216",
"0.61427385",
"0.61041903",
"0.6069391",
"0.5934792",
"0.58578503",
"0.56352234",
"0.55604357",
"0.5526916",
"0.5485791",
"0.5444641",
"0.540916",
"0.52239686",
"0.5163655",
"0.51610017",
"0.5144... | 0.8228533 | 0 |
Returns the Geom_BSplineSurface conversion mode. | def GetBSplineMode(self, *args):
return _ShapeUpgrade.ShapeUpgrade_ConvertSurfaceToBezierBasis_GetBSplineMode(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetBSplineMode(self, *args):\n return _ShapeUpgrade.ShapeUpgrade_ShapeConvertToBezier_GetBSplineMode(self, *args)",
"def SetBSplineMode(self, *args):\n return _ShapeUpgrade.ShapeUpgrade_ConvertSurfaceToBezierBasis_SetBSplineMode(self, *args)",
"def SetBSplineMode(self, *args):\n return... | [
"0.75277096",
"0.6792406",
"0.6337008",
"0.6324092",
"0.63187283",
"0.62850636",
"0.62155503",
"0.6146812",
"0.6062252",
"0.5756596",
"0.56190765",
"0.5534137",
"0.5384958",
"0.5380733",
"0.5354056",
"0.533499",
"0.52618486",
"0.52523834",
"0.5056058",
"0.5048983",
"0.4990361... | 0.79362077 | 0 |
Sets the tool for splitting 3D curves. | def SetSplitCurve3dTool(self, *args):
return _ShapeUpgrade.ShapeUpgrade_EdgeDivide_SetSplitCurve3dTool(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def SetSplitCurve3dTool(self, *args):\n return _ShapeUpgrade.ShapeUpgrade_WireDivide_SetSplitCurve3dTool(self, *args)",
"def SetSplitCurve3dTool(self, *args):\n return _ShapeUpgrade.ShapeUpgrade_FixSmallCurves_SetSplitCurve3dTool(self, *args)",
"def GetSplitCurve3dTool(self, *args):\n retu... | [
"0.7559136",
"0.7409748",
"0.67455554",
"0.6464632",
"0.63120854",
"0.62310034",
"0.60851526",
"0.6015876",
"0.59357697",
"0.5753738",
"0.57381135",
"0.56797737",
"0.56070745",
"0.55725837",
"0.55565035",
"0.5535728",
"0.5500445",
"0.54065377",
"0.5386424",
"0.53501654",
"0.5... | 0.7414354 | 1 |
Returns the tool for splitting 3D curves. | def GetSplitCurve3dTool(self, *args):
return _ShapeUpgrade.ShapeUpgrade_EdgeDivide_GetSplitCurve3dTool(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def SetSplitCurve3dTool(self, *args):\n return _ShapeUpgrade.ShapeUpgrade_WireDivide_SetSplitCurve3dTool(self, *args)",
"def SetSplitCurve3dTool(self, *args):\n return _ShapeUpgrade.ShapeUpgrade_EdgeDivide_SetSplitCurve3dTool(self, *args)",
"def SetSplitCurve3dTool(self, *args):\n return _... | [
"0.69237256",
"0.6847464",
"0.6750769",
"0.6060824",
"0.5965369",
"0.56710464",
"0.56695193",
"0.56354946",
"0.5510244",
"0.5438564",
"0.5353403",
"0.53532153",
"0.53520167",
"0.53327066",
"0.5206754",
"0.51656216",
"0.5154033",
"0.50743943",
"0.50620276",
"0.50482184",
"0.50... | 0.7621104 | 0 |
Sets the tool for dividing edges on Face. | def SetWireDivideTool(self, *args):
return _ShapeUpgrade.ShapeUpgrade_FaceDivide_SetWireDivideTool(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def SetEdgeDivideTool(self, *args):\n return _ShapeUpgrade.ShapeUpgrade_WireDivide_SetEdgeDivideTool(self, *args)",
"def SetSplitFaceTool(self, *args):\n return _ShapeUpgrade.ShapeUpgrade_ShapeDivide_SetSplitFaceTool(self, *args)",
"def SetSplitSurfaceTool(self, *args):\n return _ShapeUpgr... | [
"0.73247457",
"0.6982535",
"0.6469358",
"0.64138013",
"0.6390941",
"0.6339365",
"0.6101947",
"0.60236335",
"0.5706682",
"0.56896865",
"0.5643145",
"0.5626584",
"0.5564299",
"0.5515455",
"0.54182106",
"0.53925765",
"0.53867596",
"0.5370086",
"0.5297695",
"0.5250379",
"0.516759... | 0.6646553 | 2 |
Returns the tool for dividing edges on Face. This tool must be already initialized. | def GetWireDivideTool(self, *args):
return _ShapeUpgrade.ShapeUpgrade_FaceDivide_GetWireDivideTool(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetEdgeDivideTool(self, *args):\n return _ShapeUpgrade.ShapeUpgrade_WireDivide_GetEdgeDivideTool(self, *args)",
"def SetEdgeDivideTool(self, *args):\n return _ShapeUpgrade.ShapeUpgrade_WireDivide_SetEdgeDivideTool(self, *args)",
"def GetSplitCurve2dTool(self, *args):\n return _ShapeUpg... | [
"0.70778215",
"0.6244577",
"0.61596006",
"0.61085516",
"0.5761488",
"0.56627595",
"0.5571614",
"0.54976946",
"0.5472899",
"0.53859943",
"0.52640104",
"0.5247115",
"0.52338845",
"0.52220607",
"0.5158737",
"0.5098492",
"0.50857455",
"0.5064597",
"0.5063543",
"0.50499827",
"0.49... | 0.64441156 | 1 |
Sets the tool for splitting 3D curves. | def SetSplitCurve3dTool(self, *args):
return _ShapeUpgrade.ShapeUpgrade_FixSmallCurves_SetSplitCurve3dTool(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def SetSplitCurve3dTool(self, *args):\n return _ShapeUpgrade.ShapeUpgrade_WireDivide_SetSplitCurve3dTool(self, *args)",
"def SetSplitCurve3dTool(self, *args):\n return _ShapeUpgrade.ShapeUpgrade_EdgeDivide_SetSplitCurve3dTool(self, *args)",
"def GetSplitCurve3dTool(self, *args):\n return _... | [
"0.7559136",
"0.7414354",
"0.67455554",
"0.6464632",
"0.63120854",
"0.62310034",
"0.60851526",
"0.6015876",
"0.59357697",
"0.5753738",
"0.57381135",
"0.56797737",
"0.56070745",
"0.55725837",
"0.55565035",
"0.5535728",
"0.5500445",
"0.54065377",
"0.5386424",
"0.53501654",
"0.5... | 0.7409748 | 2 |
GetMinArea(ShapeUpgrade_RemoveInternalWires self) > Standard_Real | def GetMinArea(self):
return _ShapeUpgrade.ShapeUpgrade_RemoveInternalWires_GetMinArea(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def SetMinArea(self, *args):\n return _ShapeUpgrade.ShapeUpgrade_RemoveInternalWires_SetMinArea(self, *args)",
"def area_thresh(self):\n return 0.75",
"def unconditioned_building_area(self):\n if self._area_unconditioned is None:\n if self.simulation_dir.exists():\n ... | [
"0.65748245",
"0.61258984",
"0.60874254",
"0.6056265",
"0.57354957",
"0.5698518",
"0.55945426",
"0.5562446",
"0.5561264",
"0.55386513",
"0.5534515",
"0.54811585",
"0.5479072",
"0.5474434",
"0.54713434",
"0.5471264",
"0.5448832",
"0.5444373",
"0.54427207",
"0.5423615",
"0.5392... | 0.7934624 | 0 |
GetRemoveFaceMode(ShapeUpgrade_RemoveInternalWires self) > Standard_Boolean | def GetRemoveFaceMode(self):
return _ShapeUpgrade.ShapeUpgrade_RemoveInternalWires_GetRemoveFaceMode(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def SetRemoveFaceMode(self, *args):\n return _ShapeUpgrade.ShapeUpgrade_RemoveInternalWires_SetRemoveFaceMode(self, *args)",
"def RemovedFaces(self, *args):\n return _ShapeUpgrade.ShapeUpgrade_RemoveInternalWires_RemovedFaces(self, *args)",
"def _should_remove(self, mac, obj):\n ret = Fals... | [
"0.77575475",
"0.63419527",
"0.6012463",
"0.5810497",
"0.56537396",
"0.55814636",
"0.5533348",
"0.54354405",
"0.531506",
"0.5275111",
"0.52659386",
"0.5256472",
"0.52136815",
"0.5180423",
"0.51565593",
"0.51513654",
"0.5136039",
"0.51342934",
"0.51178956",
"0.5116975",
"0.511... | 0.8691666 | 0 |
Returns the surface conversion mode. | def GetSurfaceConversion(self, *args):
return _ShapeUpgrade.ShapeUpgrade_ShapeConvertToBezier_GetSurfaceConversion(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_mode(self):\r\n return self._api.get_mode()",
"def mode(self):\n return self._wepy_mode",
"def get_mode(self):\r\n return self.mode",
"def get_mode(self, ):\n return self.get_parameter('mode')",
"def get_mode(self):\r\n _debug('simq03b_api.get_mode')\r\n \r... | [
"0.67243534",
"0.67074084",
"0.66986763",
"0.6680794",
"0.6667503",
"0.66055286",
"0.66044426",
"0.6599074",
"0.6599074",
"0.65908694",
"0.6541977",
"0.6508127",
"0.65055466",
"0.64904684",
"0.6487276",
"0.6487276",
"0.6487276",
"0.6469752",
"0.6469752",
"0.6469752",
"0.64473... | 0.607345 | 46 |
Sets mode for conversion Geom_Line to bezier. | def Set3dLineConversion(self, *args):
return _ShapeUpgrade.ShapeUpgrade_ShapeConvertToBezier_Set3dLineConversion(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def SetLineMode(self, *args):\n return _ShapeUpgrade.ShapeUpgrade_ConvertCurve3dToBezier_SetLineMode(self, *args)",
"def GetLineMode(self, *args):\n return _ShapeUpgrade.ShapeUpgrade_ConvertCurve3dToBezier_GetLineMode(self, *args)",
"def set_mode_line():\n global DRAW_MODE, CURRENT_LABEL, SHAP... | [
"0.74519515",
"0.6810064",
"0.6123785",
"0.600373",
"0.5863812",
"0.57544833",
"0.57189596",
"0.5587433",
"0.5543378",
"0.55286753",
"0.5525946",
"0.54867446",
"0.5416875",
"0.53822654",
"0.5381516",
"0.53375995",
"0.53114086",
"0.5268469",
"0.5223884",
"0.5202134",
"0.519895... | 0.5617361 | 7 |
Returns the Geom_Line conversion mode. | def Get3dLineConversion(self, *args):
return _ShapeUpgrade.ShapeUpgrade_ShapeConvertToBezier_Get3dLineConversion(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetLineMode(self, *args):\n return _ShapeUpgrade.ShapeUpgrade_ConvertCurve3dToBezier_GetLineMode(self, *args)",
"def type(self):\n return self.LINE",
"def type(self):\n return self.LINE",
"def line_style(self):\n return self.container['line_style']",
"def set_mode_line():\n ... | [
"0.69979954",
"0.6489694",
"0.6489694",
"0.62692165",
"0.6123401",
"0.60467076",
"0.5908159",
"0.58181435",
"0.5461584",
"0.53327733",
"0.53297937",
"0.53203493",
"0.5294195",
"0.52740693",
"0.52477145",
"0.5246122",
"0.52148926",
"0.51511645",
"0.5150903",
"0.5150903",
"0.51... | 0.55851775 | 8 |
Returns the Geom_Pline conversion mode. | def GetPlaneMode(self, *args):
return _ShapeUpgrade.ShapeUpgrade_ShapeConvertToBezier_GetPlaneMode(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetLineMode(self, *args):\n return _ShapeUpgrade.ShapeUpgrade_ConvertCurve3dToBezier_GetLineMode(self, *args)",
"def getPointMode(self):\n l = [point.mode for point in self.points]\n if l.count(l[0]) == len(l):\n return l[0]\n else:\n raise ValueError(\"The m... | [
"0.6028927",
"0.5718504",
"0.5663904",
"0.5663904",
"0.56470746",
"0.5342906",
"0.52665293",
"0.51830626",
"0.5117621",
"0.50849855",
"0.49635884",
"0.49352667",
"0.49198526",
"0.48368344",
"0.48325792",
"0.4805562",
"0.4797635",
"0.47678855",
"0.47631493",
"0.475874",
"0.475... | 0.48445207 | 13 |
Returns the Geom_SurfaceOfRevolution conversion mode. | def GetRevolutionMode(self, *args):
return _ShapeUpgrade.ShapeUpgrade_ShapeConvertToBezier_GetRevolutionMode(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetRevolutionMode(self, *args):\n return _ShapeUpgrade.ShapeUpgrade_ConvertSurfaceToBezierBasis_GetRevolutionMode(self, *args)",
"def surface_type(self):\n surf_type = BRepAdaptor_Surface(self.topods_shape()).GetType()\n if surf_type == GeomAbs_Plane:\n return \"plane\"\n ... | [
"0.7220516",
"0.6676888",
"0.60060275",
"0.60013795",
"0.5947809",
"0.5943867",
"0.5923771",
"0.58328015",
"0.57163036",
"0.5692931",
"0.5685827",
"0.5682485",
"0.5673048",
"0.5668966",
"0.56524885",
"0.56268483",
"0.5622178",
"0.55830413",
"0.5572949",
"0.55569386",
"0.55450... | 0.68073547 | 1 |
Returns the Geom_SurfaceOfLinearExtrusion conversion mode. | def GetExtrusionMode(self, *args):
return _ShapeUpgrade.ShapeUpgrade_ShapeConvertToBezier_GetExtrusionMode(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetExtrusionMode(self, *args):\n return _ShapeUpgrade.ShapeUpgrade_ConvertSurfaceToBezierBasis_GetExtrusionMode(self, *args)",
"def surface_type(self):\n surf_type = BRepAdaptor_Surface(self.topods_shape()).GetType()\n if surf_type == GeomAbs_Plane:\n return \"plane\"\n ... | [
"0.6706385",
"0.59579855",
"0.5753288",
"0.5748688",
"0.56427443",
"0.5589648",
"0.5532947",
"0.54658955",
"0.5415165",
"0.53459036",
"0.5329777",
"0.5310284",
"0.53090024",
"0.52937967",
"0.5245303",
"0.5213941",
"0.51732045",
"0.514939",
"0.51313865",
"0.51313865",
"0.51284... | 0.63550276 | 1 |
Sets mode for conversion Geom_BSplineSurface to Bezier | def SetBSplineMode(self, *args):
return _ShapeUpgrade.ShapeUpgrade_ShapeConvertToBezier_SetBSplineMode(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def SetBSplineMode(self, *args):\n return _ShapeUpgrade.ShapeUpgrade_ConvertSurfaceToBezierBasis_SetBSplineMode(self, *args)",
"def GetBSplineMode(self, *args):\n return _ShapeUpgrade.ShapeUpgrade_ConvertSurfaceToBezierBasis_GetBSplineMode(self, *args)",
"def GetBSplineMode(self, *args):\n ... | [
"0.8228533",
"0.7968187",
"0.7794852",
"0.6390057",
"0.63317794",
"0.63120216",
"0.61427385",
"0.61041903",
"0.6069391",
"0.5934792",
"0.58578503",
"0.56352234",
"0.55604357",
"0.5526916",
"0.5485791",
"0.5444641",
"0.540916",
"0.52239686",
"0.5163655",
"0.51610017",
"0.51440... | 0.80295265 | 1 |
Returns the Geom_BSplineSurface conversion mode. | def GetBSplineMode(self, *args):
return _ShapeUpgrade.ShapeUpgrade_ShapeConvertToBezier_GetBSplineMode(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetBSplineMode(self, *args):\n return _ShapeUpgrade.ShapeUpgrade_ConvertSurfaceToBezierBasis_GetBSplineMode(self, *args)",
"def SetBSplineMode(self, *args):\n return _ShapeUpgrade.ShapeUpgrade_ConvertSurfaceToBezierBasis_SetBSplineMode(self, *args)",
"def SetBSplineMode(self, *args):\n ... | [
"0.79362077",
"0.6792406",
"0.6337008",
"0.6324092",
"0.63187283",
"0.62850636",
"0.62155503",
"0.6146812",
"0.6062252",
"0.5756596",
"0.56190765",
"0.5534137",
"0.5384958",
"0.5380733",
"0.5354056",
"0.533499",
"0.52618486",
"0.52523834",
"0.5056058",
"0.5048983",
"0.4990361... | 0.75277096 | 1 |
GetMaxArea(ShapeUpgrade_ShapeDivideArea self) > Standard_Real | def GetMaxArea(self):
return _ShapeUpgrade.ShapeUpgrade_ShapeDivideArea_GetMaxArea(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetMaxArea(self):\n return _ShapeUpgrade.ShapeUpgrade_FaceDivideArea_GetMaxArea(self)",
"def area(self) -> float:\n raise NotImplementedError",
"def test_area(self):\r\n rect = Rectangle(30, 50, 130, 60)\r\n assert rect.area == 100 * 10\r\n\r\n rect = Rectangle(10.5, 20.7... | [
"0.74941796",
"0.67980504",
"0.6713502",
"0.6687993",
"0.66031176",
"0.6595009",
"0.6540382",
"0.6524208",
"0.64990103",
"0.6459898",
"0.6450405",
"0.643739",
"0.6436167",
"0.6433217",
"0.6402985",
"0.6393424",
"0.6380888",
"0.63362676",
"0.6334712",
"0.6316191",
"0.6316191",... | 0.75911236 | 0 |
Initialises tool with shape and default parameter. | def __init__(self, *args):
_ShapeUpgrade.ShapeUpgrade_ShapeDivideClosed_swiginit(self,_ShapeUpgrade.new_ShapeUpgrade_ShapeDivideClosed(*args)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def Init(self, *args):\n return _XCAFDoc.XCAFDoc_ShapeTool_Init(self, *args)",
"def __init__(self):\n self.label = \"Check\"\n self.alias = \"Check Shapefiles\"\n\n # List of tool classes associated with this toolbox\n if core.get_pass():\n self.tools = [Dbound, Over... | [
"0.7115825",
"0.6702152",
"0.66625714",
"0.65608054",
"0.6480813",
"0.64780533",
"0.64022285",
"0.6348298",
"0.63036203",
"0.62201875",
"0.62201303",
"0.6204592",
"0.6159096",
"0.61532027",
"0.6130424",
"0.60896534",
"0.6088488",
"0.6068835",
"0.60644794",
"0.60554254",
"0.60... | 0.0 | -1 |
Initialises tool with shape and default parameter. | def __init__(self, *args):
_ShapeUpgrade.ShapeUpgrade_ShapeDivideClosedEdges_swiginit(self,_ShapeUpgrade.new_ShapeUpgrade_ShapeDivideClosedEdges(*args)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def Init(self, *args):\n return _XCAFDoc.XCAFDoc_ShapeTool_Init(self, *args)",
"def __init__(self):\n self.label = \"Check\"\n self.alias = \"Check Shapefiles\"\n\n # List of tool classes associated with this toolbox\n if core.get_pass():\n self.tools = [Dbound, Over... | [
"0.7115825",
"0.6702152",
"0.66625714",
"0.65608054",
"0.6480813",
"0.64780533",
"0.64022285",
"0.6348298",
"0.63036203",
"0.62201875",
"0.62201303",
"0.6204592",
"0.6159096",
"0.61532027",
"0.6130424",
"0.60896534",
"0.6088488",
"0.6068835",
"0.60644794",
"0.60554254",
"0.60... | 0.0 | -1 |
Initializes with pcurve with its first and last parameters. | def Init(self, *args):
return _ShapeUpgrade.ShapeUpgrade_SplitCurve2d_Init(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def oncurve(self, P):\n\t\traise Exception(NotImplemented)",
"def __init__(self, x, y, curve=P256):\n if not (x == 0 and y == 1 and curve is None) and not curve.is_point_on_curve((x, y)):\n raise ValueError(\n 'coordinates are not on curve <{}>\\n\\tx={:x}\\n\\ty={:x}'.format(cur... | [
"0.63540757",
"0.63319755",
"0.6321312",
"0.6221332",
"0.6163412",
"0.61110634",
"0.6084599",
"0.60605454",
"0.6041657",
"0.6022385",
"0.59975326",
"0.5962483",
"0.58978516",
"0.5874007",
"0.58618236",
"0.585367",
"0.5846622",
"0.5839911",
"0.58303124",
"0.58296055",
"0.58281... | 0.5366141 | 81 |
Sets the tool for splitting 3D curves. | def SetSplitCurve3dTool(self, *args):
return _ShapeUpgrade.ShapeUpgrade_WireDivide_SetSplitCurve3dTool(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def SetSplitCurve3dTool(self, *args):\n return _ShapeUpgrade.ShapeUpgrade_EdgeDivide_SetSplitCurve3dTool(self, *args)",
"def SetSplitCurve3dTool(self, *args):\n return _ShapeUpgrade.ShapeUpgrade_FixSmallCurves_SetSplitCurve3dTool(self, *args)",
"def GetSplitCurve3dTool(self, *args):\n retu... | [
"0.7412877",
"0.74089164",
"0.6744717",
"0.64623165",
"0.6309311",
"0.62283784",
"0.6084661",
"0.6015942",
"0.5935219",
"0.5752765",
"0.57381445",
"0.56801414",
"0.56085247",
"0.5575743",
"0.5558147",
"0.55363154",
"0.5502655",
"0.54068005",
"0.53872025",
"0.53493327",
"0.534... | 0.7557631 | 0 |
Sets mode for conversion Geom_Line to bezier. | def SetLineMode(self, *args):
return _ShapeUpgrade.ShapeUpgrade_ConvertCurve3dToBezier_SetLineMode(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def GetLineMode(self, *args):\n return _ShapeUpgrade.ShapeUpgrade_ConvertCurve3dToBezier_GetLineMode(self, *args)",
"def set_mode_line():\n global DRAW_MODE, CURRENT_LABEL, SHAPE_SIZE\n global mouse_pos, line_start_pos\n\n if DRAW_MODE==\"line\":\n # draw the line on the mask\n cv.line(... | [
"0.68112683",
"0.6126845",
"0.6003501",
"0.58623594",
"0.57562804",
"0.5718319",
"0.56179297",
"0.5586626",
"0.55428815",
"0.5530814",
"0.5528116",
"0.54893583",
"0.5417803",
"0.53828734",
"0.5382452",
"0.53364253",
"0.53100944",
"0.5270934",
"0.5224873",
"0.52019984",
"0.520... | 0.7453583 | 0 |
Returns the Geom_Line conversion mode. | def GetLineMode(self, *args):
return _ShapeUpgrade.ShapeUpgrade_ConvertCurve3dToBezier_GetLineMode(self, *args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def type(self):\n return self.LINE",
"def type(self):\n return self.LINE",
"def line_style(self):\n return self.container['line_style']",
"def set_mode_line():\n global DRAW_MODE, CURRENT_LABEL, SHAPE_SIZE\n global mouse_pos, line_start_pos\n\n if DRAW_MODE==\"line\":\n # d... | [
"0.6489637",
"0.6489637",
"0.62687826",
"0.61225206",
"0.60453916",
"0.5906718",
"0.5818232",
"0.55846375",
"0.5461789",
"0.5332307",
"0.5329474",
"0.5319977",
"0.5293353",
"0.5273559",
"0.5247966",
"0.52468127",
"0.5214354",
"0.5150715",
"0.5150715",
"0.5150051",
"0.5110428"... | 0.69970685 | 0 |
Returns the current renderer. | def GetCurrentRenderer(self):
renderer = str(pm.mel.currentRenderer())
if renderer == "_3delight":
renderer = "3delight"
return renderer | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_renderer(self) :\n \n return self._renderer",
"def get_renderer ( self, object ):\n return self.renderer",
"def GetCurrentRenderer(self): \n renderer=str(pm.mel.currentRenderer())\n if renderer == \"_3delight\":\n renderer=\"3delight\"\n \... | [
"0.8795734",
"0.83975834",
"0.8160026",
"0.7751973",
"0.74687475",
"0.7454062",
"0.6911511",
"0.68880373",
"0.681084",
"0.66897607",
"0.6682753",
"0.649957",
"0.6281214",
"0.6233523",
"0.6233523",
"0.61285716",
"0.61110336",
"0.6071637",
"0.60646504",
"0.59865713",
"0.5972019... | 0.83190143 | 2 |
Returns if motion blur is enabled. | def get_motionblur(self):
renderer = str(self.GetCurrentRenderer())
mb = int(False)
if renderer == "mentalRay":
mb = int(pm.getAttr('miDefaultOptions.motionBlur'))
elif renderer == "mayaHardware" or renderer == "mayaHardware2":
mb = int(pm.getAttr('hardwareRenderG... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def motionBlur(self):\r\n if mxs.classOf(self._nativePointer) == mxs.VRayPhysicalCamera:\r\n return self._nativePointer.use_moBlur\r\n elif mxs.classOf(self._nativePointer) == mxs.Physical:\r\n return self._nativePointer.motion_blur_enabled\r\n else:\r\n return... | [
"0.855206",
"0.7297706",
"0.7254074",
"0.6358772",
"0.59426713",
"0.59313804",
"0.5764127",
"0.5578933",
"0.557826",
"0.54543334",
"0.545377",
"0.54164034",
"0.539264",
"0.5358831",
"0.5355965",
"0.535261",
"0.53243005",
"0.52851593",
"0.5268232",
"0.5264813",
"0.5261564",
... | 0.72787124 | 2 |
Get the number of nodes that are in this subtree. | def __len__(self):
return 1 + sum([len(child) for child in self.children]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def node_count(self):\n return self._root.count()",
"def count(self):\n return self.__tree.node_count",
"def node_count(self):\n return self._node_count",
"def node_count(self):\n if self.value:\n cnt = 0\n else:\n left_cnt = self.left.node_count()\n ... | [
"0.8753881",
"0.8686981",
"0.84768975",
"0.8424745",
"0.84224695",
"0.8404088",
"0.8404088",
"0.8392303",
"0.8288235",
"0.8216588",
"0.8195542",
"0.8192926",
"0.8157069",
"0.812862",
"0.8110593",
"0.81012976",
"0.8070625",
"0.8033041",
"0.8005174",
"0.80017686",
"0.7991357",
... | 0.0 | -1 |
Hide all UI_objects to the canvas | def hide_all(self):
for UI_object in self.__UI_objects:
UI_object.hide() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hide(self):\n self.visible = False",
"def hide(self):\n self.frame.grid_forget()\n self.visible = False",
"def clearButtons(self):\n for ch in self.cboxes:\n ch.hide()\n for tbx in self.tboxes:\n tbx.hide()\n for btnum in r... | [
"0.68500817",
"0.6847392",
"0.68048775",
"0.6749276",
"0.66924477",
"0.6656583",
"0.6610509",
"0.6607181",
"0.65725327",
"0.6568934",
"0.65598154",
"0.64795846",
"0.647536",
"0.6465274",
"0.6450272",
"0.6430348",
"0.642022",
"0.63843185",
"0.638182",
"0.63438743",
"0.6339428"... | 0.80319124 | 0 |
Decodes a Platform.sh environment variable. | def decode(variable):
try:
if sys.version_info[1] > 5:
return json.loads(base64.b64decode(variable))
else:
return json.loads(base64.b64decode(variable).decode('utf-8'))
except json.decoder.JSONDecodeError:
print('Error decoding JSON, code %d', json.decoder.JSONDec... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_env(key: str) -> str:\n value = os.getenv(key)\n assert isinstance(value, str), (\n f\"the {key} environment variable must be set and a string, \" f\"{value=}\"\n )\n return value",
"def parse(env, platform_name=None):\n\n platform_name = platform_name or PLATFO... | [
"0.58628464",
"0.57395405",
"0.57205755",
"0.56262934",
"0.56074154",
"0.5546978",
"0.54179484",
"0.5410667",
"0.53220564",
"0.5305576",
"0.52621686",
"0.5250759",
"0.5237902",
"0.522902",
"0.5214382",
"0.5195442",
"0.5167963",
"0.51660407",
"0.5145286",
"0.5132241",
"0.51245... | 0.0 | -1 |
Inputs (x1, y1) = Top left corner of the bounding box (x2, y2) = Bottom right corner of the bounding box img = Image/frame represented as numpy array thickness = Thickness of the bounding box's outline outlineColor = Color of the bounding box's outline textColor = Color of the text to draw fontsize = Font size | def draw_bounding_box( y1, x1, y2, x2,
img,
thickness=4,
fontsize=15,
outlineColor=(255, 255, 0),
textColor=(255, 255, 0),
display_str=() ):
img = Image.fromarray( img )
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def visualize_bbox(img, bbox, class_name, color=(255, 0, 0) , thickness=2):\n BOX_COLOR = (255, 0, 0) # Red\n TEXT_COLOR = (255, 255, 255) # White\n\n x_min, y_min, x_max, y_max = bbox\n\n cv2.rectangle(img, (x_min, y_min), (x_max, y_max), color=color, thickness=thickness)\n\n ((text_width, text_hei... | [
"0.71785116",
"0.69911927",
"0.6828794",
"0.68199205",
"0.6808578",
"0.6774739",
"0.67630386",
"0.674848",
"0.67297834",
"0.66221625",
"0.6572747",
"0.6561717",
"0.65552133",
"0.6529843",
"0.64994663",
"0.64472884",
"0.6432188",
"0.6392486",
"0.638972",
"0.63762563",
"0.63645... | 0.7823458 | 0 |
Returns the index of the maximum action for state with state_ind with probability that is equal to eps and the index of random action with probability that is equal to 1 eps | def getTheta (q_table, state_ind, old_theta_ind, last_event_type, entropy, actions):
global eps, actions_list_size
max_ind_array = np.where (q_table[state_ind] == np.amax (q_table[state_ind]))
target_index = max_ind_array[0][0]
#print ("max ind array = {}".format (max_ind_array))
if len (max_ind_a... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_action(self, state):\n if np.random.rand() <= self.epsilon:\n action_idx = random.randrange(self.action_size)\n else:\n \n # Use all traces for RNN\n #q = self.model.predict(state) # 1x8x3\n #action_idx = np.argmax(q[0][-1])\n\n # Only u... | [
"0.76977414",
"0.7671051",
"0.7621475",
"0.75354666",
"0.7526756",
"0.72618294",
"0.72145224",
"0.7165702",
"0.71164906",
"0.7068185",
"0.70634365",
"0.70619565",
"0.7031132",
"0.70090735",
"0.6985051",
"0.69408137",
"0.694024",
"0.6937659",
"0.6921361",
"0.69062394",
"0.6870... | 0.6584681 | 40 |
The number of cylinders in this container | def num_cylinders(self):
return self._shape_count(_sff.cylinder) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def num_carns(self):\n return self._num_carns",
"def number_of_beds(self):\n return self._number_of_beds",
"def ndim(self) -> int:\r\n return len(self.plates)",
"def amount(self):\n return len(self.circles)",
"def voxel_count(self):\n return self.cols * self.rows * self.s... | [
"0.7316151",
"0.7230605",
"0.7199111",
"0.71748316",
"0.7133321",
"0.70749176",
"0.6951788",
"0.69374174",
"0.688491",
"0.68442714",
"0.68316555",
"0.68249893",
"0.68123204",
"0.68100363",
"0.6804419",
"0.6802201",
"0.67777395",
"0.6772248",
"0.67662376",
"0.67447776",
"0.672... | 0.85618603 | 0 |
The number of vertices in this vertex container | def num_vertices(self):
return len(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def num_vertices(self):\n return len(self.vertices)",
"def num_vertices(self):\n return len(self.vertices)",
"def vertexCount(self):\n return self._nVertices",
"def return_num_vertices(self):\n return self.__size",
"def getNumVertices(self):\n return len(self.V)",
"def ... | [
"0.90056276",
"0.90056276",
"0.89246273",
"0.8827253",
"0.8825078",
"0.8795182",
"0.8726353",
"0.87256724",
"0.87251335",
"0.86311513",
"0.854305",
"0.853468",
"0.8499106",
"0.83895457",
"0.8204924",
"0.81147677",
"0.80841315",
"0.79607904",
"0.7934397",
"0.7852774",
"0.76900... | 0.90454966 | 0 |
The number of polygons in this list of polygons | def num_polygons(self):
return len(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def num_polygons(self):\n return len(self.polygons)",
"def __len__(self):\n return self.num_polygons",
"def num_polys(self):\n ret_val = self._num_polys()\n return ret_val",
"def __len__(self):\n return len(self.geometries)",
"def numnems(self):\n count = 0\n ... | [
"0.87641025",
"0.82531774",
"0.68556637",
"0.67988664",
"0.67623955",
"0.66983974",
"0.6694302",
"0.66148466",
"0.66136044",
"0.6604743",
"0.6604743",
"0.658392",
"0.6572166",
"0.65646136",
"0.65007806",
"0.649425",
"0.6465763",
"0.6459146",
"0.64498335",
"0.6431514",
"0.6416... | 0.87221754 | 1 |
The number of polygons in this mesh | def num_polygons(self):
return len(self.polygons) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def num_polygons(self):\n return len(self)",
"def __len__(self):\n return self.num_polygons",
"def num_vertices(self):\n return len(self)",
"def num_vertices(self):\n return len(self.vertices)",
"def num_vertices(self):\n return len(self.vertices)",
"def return_num_vert... | [
"0.8774638",
"0.83259225",
"0.74750274",
"0.7461491",
"0.7461491",
"0.72735655",
"0.72728455",
"0.72378105",
"0.72350544",
"0.71806896",
"0.7138571",
"0.713383",
"0.71037674",
"0.7057894",
"0.70563143",
"0.70441306",
"0.70249957",
"0.7021999",
"0.6986647",
"0.6980518",
"0.691... | 0.87698954 | 1 |
Add a combo box to the table. | def add_combo_box(self, name, value=None, options=None, label=None, add_indicator=None):
widget=QtWidgets.QComboBox(self)
widget.setObjectName(_fromUtf8(self.name+"_"+name))
if options:
widget.addItems(options)
if value is not None:
widget.setCurrentIndex(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fill_combobox(self):\n sqlstring = \"SELECT first_name, last_name from employees WHERE enabled = 1 ORDER BY last_name ASC\"\n self.CB_employee.addItem(\"\")\n for employee in self.ms.c.execute(sqlstring):\n self.CB_employee.addItem(\" \".join((employee[0], employee[1])))\n ... | [
"0.6479501",
"0.6444276",
"0.64136606",
"0.6408375",
"0.60777354",
"0.59715515",
"0.59644485",
"0.5907017",
"0.58931273",
"0.5776916",
"0.57204485",
"0.5639301",
"0.5613162",
"0.56096745",
"0.5606949",
"0.5536406",
"0.55315447",
"0.55124986",
"0.54901284",
"0.5455962",
"0.544... | 0.75430167 | 0 |
Add a padding (expandable spacer) with the given proportion | def add_padding(self, prop=1):
self.add_spacer(0)
self.formLayout.setRowStretch(self.formLayout.rowCount(),prop) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def AddStretchSpacer(self, proportion=1):\r\n \r\n item = AuiToolBarItem()\r\n item.window = None\r\n item.label = \"\"\r\n item.bitmap = wx.NullBitmap\r\n item.disabled_bitmap = wx.NullBitmap\r\n item.active = True\r\n item.dropdown = False\r\n item.s... | [
"0.677421",
"0.60711706",
"0.59689176",
"0.59173",
"0.5717027",
"0.5657732",
"0.5651791",
"0.5574912",
"0.55698055",
"0.5520841",
"0.55201274",
"0.547455",
"0.5468247",
"0.5460681",
"0.53776824",
"0.5371872",
"0.5346132",
"0.53434986",
"0.53413355",
"0.5337884",
"0.533659",
... | 0.70951134 | 0 |
Read a Spark DataFrame | def read_data(self, file_path, format, **kwargs) -> DataFrame:
return self.spark.read.format(format).options(**kwargs).load(file_path) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def read(spark, datasetURI):\n csvDF = spark.read.csv(datasetURI, header=True, inferSchema=True).persist()\n csvDF.printSchema()\n return csvDF",
"def creat_data_frame(spark, file_path):\n df = spark.read \\\n .format(\"csv\") \\\n .option(\"header\", \"true\") \\\n .option(\"inf... | [
"0.7311225",
"0.71915567",
"0.69781435",
"0.69261575",
"0.6670915",
"0.66212225",
"0.63687",
"0.6354497",
"0.63329566",
"0.6297085",
"0.6278322",
"0.6260915",
"0.62291515",
"0.6188617",
"0.6137936",
"0.6128456",
"0.61263883",
"0.61120707",
"0.6092912",
"0.60926306",
"0.605989... | 0.728864 | 1 |
Set the API key for Travitia API. | async def travaitiaapikey(self, ctx: commands.Context, *, api_key: str):
await ctx.bot.set_shared_api_tokens("travitia", api_key=api_key)
try:
await ctx.message.delete()
except (discord.Forbidden, discord.HTTPException):
await ctx.send(
"Please delete your... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def SetAPIKey(self, api_key):\n self._api_key = api_key",
"def SetAPIKey(self, api_key):\n self._api_key = api_key",
"def SetAPIKey(self, api_key):\n self._analyzer.SetAPIKey(api_key)",
"def set_api_key(api_key):\n Movie.__api_key = api_key",
"def set_api_key(self, api_key):\n self.a... | [
"0.79116094",
"0.79116094",
"0.76854616",
"0.7584675",
"0.75487274",
"0.7469647",
"0.74007523",
"0.71975803",
"0.7017971",
"0.6838372",
"0.68087924",
"0.6797763",
"0.6742338",
"0.66927934",
"0.66907936",
"0.6665551",
"0.65813804",
"0.6490527",
"0.64600384",
"0.645998",
"0.645... | 0.60389215 | 38 |
Create ddimensional vector of zeros. | def __init__(self, d):
self._coords = [0] * d | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def zero():\n return Vec2d(0, 0)",
"def zerovec(self, X):\n return np.zeros(X.size())",
"def zeros(num):\n if num < 1:\n raise IndexError('num must be >= 1.')\n return Vector.fromSequence([0] * num)",
"def set_zero_vector(self):\n self.vector = np.zeros(self.dime... | [
"0.7440335",
"0.7352454",
"0.7329235",
"0.7241969",
"0.7208623",
"0.71280175",
"0.69346184",
"0.6905745",
"0.6901112",
"0.6901112",
"0.68693686",
"0.68550956",
"0.6840902",
"0.68296504",
"0.6787206",
"0.6740598",
"0.6716851",
"0.66584647",
"0.6658448",
"0.6647531",
"0.6597019... | 0.0 | -1 |
Return True if vector has some coordinate as other. | def __eq__(self, other):
return self._coords == other._coords | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __contains__(self, vector: Vector) -> bool:\n for vec in self.__elements:\n if vec == vector:\n return True\n return False",
"def __eq__(self, other):\n\n if hasattr(other, 'vector'):\n return self.vector == other.vector",
"def __contains__(self, ot... | [
"0.7386056",
"0.6925932",
"0.6909491",
"0.6907202",
"0.6833427",
"0.68188816",
"0.68101674",
"0.6785289",
"0.67538005",
"0.6739484",
"0.67376906",
"0.6729678",
"0.6708428",
"0.66966003",
"0.66542083",
"0.66538906",
"0.66105145",
"0.6599835",
"0.65960217",
"0.6590563",
"0.6586... | 0.6321718 | 42 |
Round number of repeats based on depth multiplier. | def _rep(self, num_repeats):
return int(np.ceil(self.depth_mul * num_repeats)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _round_repeats(self, repeats):\n return int(math.ceil(self.depth_coefficient * repeats))",
"def round_repeats(repeats):\n return int(math.ceil(depth_coefficient * repeats))",
"def _round_repeats(self, repeats, depth_coefficient):\n\n if not depth_coefficient:\n return repeats\n\n retur... | [
"0.8876546",
"0.87485105",
"0.86348873",
"0.8589512",
"0.85847086",
"0.8439529",
"0.83897537",
"0.83897537",
"0.83897537",
"0.8308418",
"0.6887175",
"0.6887175",
"0.6861657",
"0.6199542",
"0.6199542",
"0.6029677",
"0.5980465",
"0.59490407",
"0.59474444",
"0.5848384",
"0.58335... | 0.77939695 | 10 |
Initialize this dataset class. | def __init__(self, opt):
BaseDataset.__init__(self, opt)
self.dir_A = opt.dataroot
self.classes_A, self.class_to_idx_A = self._find_classes(self.dir_A) # find classes in '/path/to/data/trainA'
samples_A = make_dataset(self.dir_A, self.class_to_idx_A, extensions=self.img_extension, is_va... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self):\n self.__dataset = None",
"def __init__(self, dataset):\n self._dataset = dataset",
"def __init__(self, dataset: Dataset):\n self.dataset = dataset",
"def __init__(self, config):\n logger.info(f\"{self.__class__.__name__}: Dataset initializing ...\")\n s... | [
"0.8165497",
"0.81633174",
"0.80131304",
"0.7613447",
"0.7420924",
"0.7392658",
"0.7351553",
"0.734302",
"0.71106404",
"0.71014416",
"0.709644",
"0.70961076",
"0.7022668",
"0.6963963",
"0.6961043",
"0.6888757",
"0.6879233",
"0.6872671",
"0.6859463",
"0.68498707",
"0.68434393"... | 0.65405107 | 81 |
Return a data point and its metadata information. | def __getitem__(self, index):
A_path = self.A_paths[index]
A_target = self.A_targets[index] # make sure index is within then range
A_img = Image.open(A_path).convert('RGB')
A = self.transform(A_img)
return {'A': A, 'A_paths': A_path, 'A_target': A_target} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def point(self):\n return self.x, self.y, self.z",
"def to_data(self):\n point = {\n 'point': [self.pt[0], self.pt[1], self.pt[2]],\n 'layer_height': self.layer_height,\n\n 'mesh_normal': self.mesh_normal.to_data(),\n 'up_vector': self.up_vector.to_data()... | [
"0.6609213",
"0.66000307",
"0.6576587",
"0.6538189",
"0.6522471",
"0.63398576",
"0.6292962",
"0.6292962",
"0.6158413",
"0.61515987",
"0.6140255",
"0.6135196",
"0.6117057",
"0.6066671",
"0.60508525",
"0.602694",
"0.5992149",
"0.59920007",
"0.59893256",
"0.5978015",
"0.59645194... | 0.0 | -1 |
Does file end with a desired file extension? | def is_good_file(filename):
for e in extensions:
if filename.endswith(e):
return True
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def has_file_allowed_extension(filename, extensions):\n return filename.lower().endswith(extensions)",
"def has_file_allowed_extension(filename, extensions):\n return filename.lower().endswith(extensions)",
"def match_extensions(filename):\n return any(filename.endswith(e) for e in extensions)",
... | [
"0.80380464",
"0.80380464",
"0.79956967",
"0.79648685",
"0.79251164",
"0.7876383",
"0.7796232",
"0.7745756",
"0.7685461",
"0.76847696",
"0.7657303",
"0.76551753",
"0.7642444",
"0.762275",
"0.76113856",
"0.7562726",
"0.7508613",
"0.75061005",
"0.7504372",
"0.7504372",
"0.74996... | 0.8136703 | 0 |
//description Gets an issue's description. | def description(request):
description = request.issue.description or ""
return HttpTextResponse(description) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def description(self, description):\n if description is None:\n raise ValueError(\"Invalid value for `description`, must not be `None`\") # noqa: E501\n\n self._description = description",
"def description(self, description):\n if description is None:\n raise ValueErro... | [
"0.70843625",
"0.70843625",
"0.7052416",
"0.7052416",
"0.6976018",
"0.6976018",
"0.6912514",
"0.67899215",
"0.6785565",
"0.6703576",
"0.66949415",
"0.66938907",
"0.66829985",
"0.66030645",
"0.66030645",
"0.66030645",
"0.66030645",
"0.6595546",
"0.6560232",
"0.6551289",
"0.655... | 0.66010463 | 17 |
//patch// View a raw patch. | def patch(request):
if _use_new_ui(request):
return _serve_new_ui(request)
return _patch_helper(request) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def patch(self):\n return self._get(\"patch\")",
"def patch_helper(request, nav_type='patch'):\n _add_next_prev(request.patchset, request.patch)\n request.patch.nav_type = nav_type\n parsed_lines = patching.ParsePatchToLines(request.patch.lines)\n if parsed_lines is None:\n return HttpTextResponse(... | [
"0.6698278",
"0.65849596",
"0.6516471",
"0.64393127",
"0.63603514",
"0.61752164",
"0.61571336",
"0.6124074",
"0.6073481",
"0.6040204",
"0.60376924",
"0.6034696",
"0.60107815",
"0.6003021",
"0.5998934",
"0.59958607",
"0.5962419",
"0.593135",
"0.59272915",
"0.59272915",
"0.5927... | 0.52326274 | 59 |
Returns the context setting for a user. The value is validated against models.CONTEXT_CHOICES. If an invalid value is found, the value is overwritten with django_settings.DEFAULT_CONTEXT. | def _get_context_for_user(request):
get_param = request.GET.get('context') or None
if 'context' in request.GET and get_param is None:
# User wants to see whole file. No further processing is needed.
return get_param
if request.user:
account = models.Account.current_user_account
default_context = a... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_context(self, extra_ctx=None, **kwargs):\n ctx = {\n 'user': self.user,\n }\n if extra_ctx:\n ctx.update(extra_ctx)\n ctx.update(kwargs)\n return ctx",
"def context_or_settings(context, name):\n if name in context:\n return context[name]\... | [
"0.5921447",
"0.5920965",
"0.58994466",
"0.5869174",
"0.57438976",
"0.570805",
"0.5680959",
"0.5678378",
"0.56438684",
"0.56351316",
"0.5612569",
"0.5576295",
"0.5476071",
"0.54733783",
"0.54426706",
"0.54159015",
"0.53977877",
"0.5391101",
"0.53767556",
"0.53592825",
"0.5359... | 0.7496478 | 0 |
Remove control chars other than \r\n\t from a string to be put in XML. | def _strip_invalid_xml(s):
if _badchars_re.search(s):
return ''.join(c for c in s if c >= ' ' or c in '\r\n\t')
else:
return s | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove_control_chars(json_string):\n return re.sub('[\\x00-\\x1f]', '',json_string)",
"def safe(self, string):\n if sys.version_info.major >= 3 and isinstance(string, bytes):\n string = string.decode('utf8')\n elif sys.version_info.major < 3:\n if not isinstance(str... | [
"0.70880306",
"0.68337435",
"0.660946",
"0.6538524",
"0.6515923",
"0.650001",
"0.6465329",
"0.6443006",
"0.6407508",
"0.6394598",
"0.6293774",
"0.6224377",
"0.6210481",
"0.6174142",
"0.615921",
"0.61291057",
"0.6120389",
"0.606574",
"0.60568714",
"0.6044151",
"0.6038428",
"... | 0.66832525 | 2 |
Repond with user prefs in JSON. | def api_settings(_request):
account = models.Account.current_user_account
return {
'xsrf_token': account.get_xsrf_token(),
'email': account.email,
'nickname': account.nickname,
'deprecated_ui': account.deprecated_ui,
'default_context': account.default_context,
'default_column_width': account... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_pref_file():\r\n pref_dict = {\"default_user\": None}\r\n\r\n with open(os.path.join(os.path.dirname(__file__), \"preferences.json\"), \"w\") as pref:\r\n pref.write(json.dumps(pref_dict, indent=4))\r\n\r\n return pref_dict",
"def read_preferences_file(self):\n user_data_dir = fin... | [
"0.68435293",
"0.6222283",
"0.6033892",
"0.5981084",
"0.59733754",
"0.5910302",
"0.5899807",
"0.5895981",
"0.5846855",
"0.58296293",
"0.5817442",
"0.5809213",
"0.5805376",
"0.5756036",
"0.5751465",
"0.57503515",
"0.5724446",
"0.57068986",
"0.5692286",
"0.56819165",
"0.5680495... | 0.0 | -1 |
Factory method for returning the mongoengine connection configured for the current environment. | def get_mongo_connection(url=None, collection=None):
db_url = url or get_config('DATABASE_URL')
collection = collection or 'value'
return mongoengine.connect('value', host=db_url) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_connection():\n\n return MongoClientManager().client.__getattr__(MONGODB_SETTINGS['db'])",
"def get_connection():\n return MongoClient(\"mongodb://username:password@localhost:27017\")",
"def _connect(self):\n conn = pymongo.MongoClient(self._config.get('mongodb', 'host'), self._config.... | [
"0.77614856",
"0.7658913",
"0.7576519",
"0.72847205",
"0.72457707",
"0.7224856",
"0.7224856",
"0.7224856",
"0.7224856",
"0.7204966",
"0.71928376",
"0.71507174",
"0.71462977",
"0.71183294",
"0.697264",
"0.6938498",
"0.69305515",
"0.68535906",
"0.6801091",
"0.6758535",
"0.67526... | 0.7298293 | 3 |
Filter a field in coefficient space by cutting off all coefficient above a given threshold. This is accomplished by changing the scale of a field, forcing it into coefficient space at that small scale, then coming back to the original scale. | def filter_field(self, field, frac=0.25):
dom = field.domain
logger.info("filtering field {} with frac={} using a set-scales approach".format(field.name,frac))
orig_scale = field.meta[:]['scale']
field.set_scales(frac, keep_data=True)
field['c']
field['g']
field.s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def truncate(coeffs, threshold=99):\n sortedindex = np.argsort(np.abs(coeffs))[::-1]\n Ncoeff = coeffs.shape[-1]\n cutoff = np.int(np.round(Ncoeff*threshold/100.))\n \n# print \"Keeping %2.0f %% (N=%s) of the biggest coefficients\"%(threshold,cutoff)\n\n coeffs_trunc = coe... | [
"0.66243243",
"0.6155232",
"0.5961836",
"0.59596664",
"0.59515524",
"0.59503454",
"0.59227955",
"0.5901453",
"0.5839324",
"0.5837533",
"0.5819895",
"0.5819479",
"0.57622945",
"0.57198757",
"0.5702025",
"0.5699182",
"0.5676905",
"0.56598055",
"0.561742",
"0.5614789",
"0.556739... | 0.51612794 | 76 |
Process a toplevel query's sort_by attribute into a list. This mostly handles the sorting direction tuples. | def _process_sorts(sorts: Iterable[Union[str, Tuple[str, bool]]]) -> List[str]:
processed: List[str] = []
for sort in sorts:
# Plain strings can be kept as-is
if isinstance(sort, str):
processed.append(sort)
# Non-string objects are expected to be tuples showing sort order
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sortby(self):\n ...",
"def get_sort_query(self, kind, order, is_number):\n pass",
"def iter_sort_items(self, expr: str) -> Iterable[str]:\n\n def format_op(s: str) -> str:\n s_exp = self.sort_ops.get(s)\n if s_exp:\n return s_exp\n raise ... | [
"0.6683985",
"0.65840226",
"0.63519675",
"0.63487804",
"0.63215697",
"0.63130003",
"0.6298719",
"0.6152857",
"0.6096061",
"0.6063548",
"0.5913473",
"0.5900168",
"0.58567566",
"0.58196336",
"0.5735046",
"0.5725251",
"0.572298",
"0.57044476",
"0.5699898",
"0.56860685",
"0.56775... | 0.5613607 | 26 |
config param exists so we can test this. Use the config param if it exists, otherwise default to the self._config. | def _parse_config(self, config=None):
# TODO: Load user configuration from the file
# self._current_user_name = get_from_conf(
# config, "user_name", self._current_user_name
# )
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _setConfig(self,config):\n if config:\n self.config = config\n else:\n from layman import config\n self.config = config",
"def _getConfigParam(self, name, default=None):\n return self.config.get(self._configPrefix + name.lower(), default)",
"def _get_c... | [
"0.7048344",
"0.6880876",
"0.68463653",
"0.68393356",
"0.6703687",
"0.66853696",
"0.6555337",
"0.6555337",
"0.6555337",
"0.6555337",
"0.6555337",
"0.6555337",
"0.6555337",
"0.6555337",
"0.6555337",
"0.6555337",
"0.6555337",
"0.6555337",
"0.6555337",
"0.6555337",
"0.6555337",
... | 0.0 | -1 |
Adds an IP with tags and tests for that value and tags match. | def test_add_ip(self):
ip = '1.1.1.1'
info = self.api.add_ipadress(ip, tags=['asd'])
self.assertEqual(info['value'], ip)
tags = [t['name'] for t in info['tags']]
self.assertEqual(tags, ['asd']) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new_ip(self, ip):\n if not ip in self.ip_list:\n self.ip_list.add(ip)\n host = self.hs.id_to_object(ip)\n host.add_tag('sniffer')\n host.save()\n print_success(\"New ip address: {}\".format(ip))",
"def add_ip(self, inf, ip):\n self.interfac... | [
"0.5837578",
"0.57650524",
"0.5568527",
"0.5546674",
"0.5476374",
"0.5373979",
"0.5338458",
"0.5328271",
"0.5325144",
"0.5319836",
"0.5268834",
"0.5266891",
"0.5252261",
"0.52108634",
"0.5196284",
"0.51931304",
"0.5179951",
"0.5156865",
"0.5152717",
"0.5151065",
"0.513029",
... | 0.7080992 | 0 |
Adds an url with tags and tests for that value and tags match. | def test_add_url(self):
url = 'http://test.com/'
info = self.api.add_url(url, tags=['asd'])
self.assertEqual(info['value'], url)
tags = [t['name'] for t in info['tags']]
self.assertEqual(tags, ['asd']) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_urlintagwithmultipleamps(self):\n tag = tags.invisible[tags.a(href=url.URL.fromString('http://localhost/').add('foo', 'bar').add('baz', 'spam'))]\n self.assertEqual(flatten(tag), '<a href=\"http://localhost/?foo=bar&baz=spam\"></a>')\n\n tag = tags.invisible[loaders.xmlstr('<a xml... | [
"0.6001312",
"0.59806013",
"0.5927227",
"0.5837496",
"0.5759826",
"0.5743623",
"0.5733461",
"0.5685452",
"0.5574459",
"0.5535147",
"0.5453522",
"0.5435983",
"0.53890324",
"0.53791344",
"0.53482157",
"0.52934843",
"0.5290717",
"0.5279088",
"0.5261116",
"0.525802",
"0.52541846"... | 0.6975916 | 0 |
Adds a valid URL is normalized. | def test_observable_url_normalize(self):
result = self.api.observable_add('http://test.com')
self.assertEqual(result['value'], 'http://test.com/')
result = self.api.observable_add('https://test.com/something/../asd')
self.assertEqual(result['value'], 'https://test.com/asd') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def normalize_url(self, url):\n pass",
"def test_normalized_urls():\n assert normalize_url(\"http://example.com/\") == \"http://example.com/\"",
"def validate_url(self):\n pass",
"def test_non_urls():\n assert normalize_url(\"\") is None\n assert normalize_url(\"abc xyz\") is None\n ... | [
"0.7348397",
"0.6483342",
"0.6479667",
"0.64090276",
"0.63775617",
"0.6351611",
"0.6349781",
"0.62123084",
"0.61811256",
"0.6087994",
"0.60803074",
"0.60364044",
"0.60253674",
"0.6011891",
"0.59728545",
"0.5946934",
"0.59323907",
"0.5911922",
"0.5905894",
"0.5903741",
"0.5870... | 0.5744651 | 40 |
This function initiallzes an instance of the PGM2 class. It takes as input one node potentiol (for node N0) and one edge potential (for the edge from N0 to N1). And it initializes a data structure that represents the PGM. The data structure that you use, and how you use it, is up to you. My recommendation is to pick a ... | def __init__(self, node_0, edge_0_1):
# -------------------------------------------------------------------------
# YOUR CODE GOES HERE
#
#self._joint = edge_0_1
self._table = {}
# calculate the intersection of h and e using the simple product rule
for h... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, firstD, secondD, cells, prob=0):\n\t\tself.init_time = datetime.datetime.now()\n\t\tself.space = np.array([[Cell(str(i)+ ':' + str(j), self.init_time, 0) for i in range(secondD)] for j in range(firstD)])\t\t\n\t\tself.grains = cells + 1\n\t\tself.generate_grains(self.grains)\n\t\tself.empty_cell... | [
"0.58597004",
"0.5592434",
"0.55256325",
"0.54918534",
"0.5486858",
"0.5453016",
"0.5438962",
"0.5372968",
"0.5366257",
"0.53638643",
"0.53334886",
"0.5329202",
"0.5314544",
"0.5297933",
"0.52675843",
"0.526636",
"0.5213053",
"0.5191655",
"0.5186655",
"0.5186294",
"0.51673466... | 0.53414464 | 10 |
Convert class labels from scalars to onehot vectors. | def dense_to_one_hot(labels_dense, num_classes=10):
num_labels = labels_dense.shape[0]
#print('check num_labels',num_labels)
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
... | {
"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.77540547",
"0.77540547",
"0.77540547",
"0.77489346",
"0.7742955",
"0.7737176",
"0.77226317... | 0.7711196 | 22 |
Creating functions based on the spec Each function contains at least two files __init__.py and function.json file. __init__.py The actual function code function.json The function.json file is the one used to specify the triggers and bindings for the functions host to understand the function and setup for action. | def _serialize_and_write_functions(
self, code_model: CodeModel, env: Environment,
function_app_path: Path
) -> None:
for operation_group in code_model.operation_groups:
# Todo: Current default serializer is Http. Extend this to change
# based on different o... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_function(self):\n logger.info(\"Preparing stuf to create function\")\n self.create_package('devel')\n\n self.upload_package()\n\n function_definition = self.get_function_configuration()\n\n # Set the first release Code block\n function_definition['Code'] = {\n ... | [
"0.6696308",
"0.66161495",
"0.60246754",
"0.591528",
"0.5870153",
"0.57817525",
"0.5750469",
"0.5719456",
"0.5709099",
"0.5709099",
"0.57040733",
"0.5680156",
"0.56516236",
"0.56479573",
"0.5636794",
"0.5626002",
"0.5605237",
"0.55962276",
"0.5589083",
"0.5587972",
"0.5586868... | 0.6054329 | 2 |
Render a page with a 404 return code and a message. | def not_found(self, request):
fmt = 'The path <q>%s</q> was not understood by this server.'
msg = fmt % (request['parsed_uri'],)
openid_url = request['query'].get('openid_url')
return self.render(request, msg, 'error', openid_url, status='404 Not Found') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def page_not_found(e):\n return render_template(\"404.html\"), 404",
"def page_not_found(e):\n return render_template('404.html'), 404",
"def page_not_found(e):\n return render_template('404.html'), 404",
"def page_not_found():\n return render_template(\"errors/404.html\"), 404",
"def page_not_... | [
"0.85667086",
"0.8558075",
"0.8558075",
"0.85441977",
"0.85192037",
"0.8472716",
"0.8451948",
"0.8372159",
"0.83661896",
"0.8311772",
"0.8302066",
"0.8269469",
"0.82340425",
"0.8168948",
"0.8145789",
"0.81164515",
"0.80792093",
"0.8073571",
"0.80484486",
"0.8036818",
"0.80364... | 0.0 | -1 |
Check if tags are structured as an array. | def check_line(self, line: str, line_num: int) -> Lints:
yield from super().check_line(line, line_num)
if self.in_header and line != "---\n":
for m in self.TAG_QUOTED.finditer(line):
yield LintError("header-tags-quoted", line_num, m.start()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_array_param(param):\n return param.get('tags') and param['tags']['type'] == 'array'",
"def items_should_contain_array_of_tags(context):\n items = context.response.json()['items']\n for item in items:\n assert 'tags' in item\n assert isinstance(item['tags'], list)\n assert len... | [
"0.7718015",
"0.7256747",
"0.6805293",
"0.67114294",
"0.6710392",
"0.667268",
"0.6494877",
"0.64811397",
"0.6458117",
"0.63630074",
"0.6333833",
"0.62253135",
"0.61914885",
"0.6177461",
"0.61699194",
"0.6125645",
"0.6093846",
"0.60797966",
"0.60701096",
"0.5994015",
"0.594880... | 0.0 | -1 |
can_place Shows if course can be added | def can_place(self, course: 'Course'):
if type(course) != Course:
raise TypeError("Cannot use argument of type {} in list of type <class 'Course'>.".format(type(course)))
key = course.get_course_code()
# Check if the course already exists and can only be taken once
if key i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_valid_data_course_add(self, app, auth):\n app.admin.add_new_course()\n course_data = CreateCourse.random()\n app.course.create_course(course_data)\n assert (app.course.new_course_page() == course_data.full_course_name), \\\n \"The course was not created!\"",
"def t... | [
"0.60943234",
"0.6083227",
"0.5890757",
"0.58249575",
"0.5793272",
"0.57876885",
"0.5757724",
"0.56998646",
"0.5690117",
"0.5613246",
"0.559161",
"0.55423373",
"0.5520477",
"0.5518645",
"0.5490318",
"0.54786175",
"0.5464594",
"0.54640347",
"0.5434951",
"0.5432169",
"0.543161"... | 0.7568668 | 0 |
Adds a Course to the Semester. | def add_course(self, course: 'Course'):
new_diff = self._total_diff + course.difficulty
new_diff_rating = new_diff / (len(self._courses) + 1)
# Add course
self._courses[course.get_course_code()] = course
# Update attributes
self._total_load += course.credit_load
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_course(self, course):\n if course in self.courses:\n raise NameError('This student is already enrolled in that course')\n else:\n self.courses[course] = 0\n\n return self",
"def addCourse(self):\n\t\tcourseName = input(\"What is the new course name? \")\n\t\tco... | [
"0.79203165",
"0.7878807",
"0.77552915",
"0.76133174",
"0.7377536",
"0.7227456",
"0.6952985",
"0.67963254",
"0.6751742",
"0.6616688",
"0.6543197",
"0.648297",
"0.6482348",
"0.64466375",
"0.6362376",
"0.6340498",
"0.6231549",
"0.6219198",
"0.62129265",
"0.62123996",
"0.6169566... | 0.7607257 | 4 |
Scaling chosen features of X to the range of 0 1. | def inverse_transform(self, X):
# No warning for y, since there's no y variable.
# This correpsonds to function signature in scikit-learn's code base
X = X.copy() # type: pd.DataFrame
X.loc[:, self._feature_mask_] *= self.scale_
X.loc[:, self._feature_mask_] += self.min_
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def scale(x, feature_range=(-1,1)):\r\n x = x * 2 - 1\r\n return x",
"def _scale_features(self, features):\n assert isinstance(features, np.ndarray), \"Input is not a numpy array!\"\n\n return self.scaler.transform(features.reshape(1, -1))",
"def scale(x, feature_range=(-1, 1)):\n \n ... | [
"0.76554257",
"0.7420464",
"0.71408904",
"0.7080646",
"0.6957377",
"0.69530046",
"0.6914667",
"0.68141735",
"0.6800518",
"0.6660761",
"0.66262877",
"0.65796053",
"0.6553622",
"0.65444887",
"0.64846337",
"0.6387242",
"0.63655835",
"0.63610154",
"0.6310749",
"0.6304135",
"0.630... | 0.656766 | 12 |
Match data and return matched subset. This is a convenience method, calling `fit` and `transform` at once. For details, see documentation of each function. | def fit_transform(self, X, a, y):
self.fit(X, a, y)
return self.transform(X, a, y) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def match_data(self, datasets):\n raise NotImplementedError",
"def transform(self, X, a, y):\n self.matching.match(X, a, use_cached_result=True)\n matched_sample_indices = self.find_indices_of_matched_samples(X, a)\n X = X.loc[matched_sample_indices]\n a = a.loc[matched_sample_... | [
"0.71688086",
"0.6358792",
"0.6054603",
"0.582406",
"0.5682957",
"0.56584185",
"0.5603816",
"0.55849797",
"0.55393904",
"0.5504698",
"0.5488578",
"0.548804",
"0.5442387",
"0.54015714",
"0.53826",
"0.5346606",
"0.53218085",
"0.53192055",
"0.53041536",
"0.5303217",
"0.5232629",... | 0.48760554 | 79 |
Add annotations to the plot. | def annotate(self, left_right=True, positions=True, size=12, **kwargs):
kwargs = kwargs.copy()
if not 'color' in kwargs:
if self._black_bg:
kwargs['color'] = 'w'
else:
kwargs['color'] = 'k'
bg_color = ('k' if self._black_bg else 'w')
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __draw_annotations(self):\n final = self.__resolve_annotation_conflicts(self.annotations)\n\n shrinkB = self.settings.rcParams[\"lines.markersize\"]+self.settings.rcParams[\"lines.markeredgewidth\"]\n for a in final:\n if a.put_circle_around_point:\n self.ax.plot(... | [
"0.79216033",
"0.7689584",
"0.7278804",
"0.725689",
"0.7219912",
"0.7022795",
"0.6977749",
"0.69443965",
"0.6853739",
"0.6848855",
"0.6794269",
"0.67667395",
"0.67413896",
"0.66848207",
"0.6644075",
"0.6633686",
"0.6633686",
"0.66336215",
"0.6592462",
"0.65151274",
"0.6447543... | 0.0 | -1 |
This function prints and plots the confusion matrix. Normalization can be applied by setting `normalize=True`. | def plot_confusion_matrix(cm, classes,
normalize=False,
title='Confusion matrix',
cmap=plt.cm.Reds):
plt.imshow(cm, interpolation='nearest', cmap=cmap)
plt.title(title)
plt.colorbar()
tick_marks = np.arange(len(classes)... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def plot_confusion_matrix(cm, classes=[0,1], normalize=False, title='Confusion matrix', print_matrix=False):\n\n if normalize:\n cm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis]\n print(\"Normalized confusion matrix\")\n else:\n print('Confusion matrix, without normalization')\n\n... | [
"0.81925154",
"0.8093376",
"0.8027219",
"0.80169857",
"0.7991475",
"0.7988959",
"0.79785",
"0.7973596",
"0.7959107",
"0.7956459",
"0.793519",
"0.79322356",
"0.79320693",
"0.79289055",
"0.79240024",
"0.79221827",
"0.792161",
"0.79209834",
"0.7920566",
"0.7919846",
"0.791543",
... | 0.0 | -1 |
Get the Q value | def Q(self):
return self._Q | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def q(self):\n return self._x",
"def __float__(self):\n return self.q[0]",
"def _getq(self, q=None):\n if q is None:\n return self.q\n elif isvector(q, self.n):\n return getvector(q, self.n)\n else:\n return getmatrix(q, (None, self.n))",
"d... | [
"0.80239016",
"0.77056783",
"0.7598243",
"0.75624883",
"0.7501151",
"0.74757296",
"0.73531705",
"0.73323375",
"0.7299839",
"0.72208214",
"0.7203861",
"0.71745545",
"0.7075498",
"0.70396656",
"0.70038885",
"0.6982754",
"0.69488585",
"0.6941816",
"0.69298387",
"0.6912405",
"0.6... | 0.76124793 | 2 |
Checks if username is valid | def valid_user(username, user_list):
if len(username) >= 6 and len(username) <= 20 and username != "username":
for user in user_list:
if user[1] == username:
print("This username already exists")
return False
return True # This will only occ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _check_username(self, username):\n if self.username_regex.search(username) is not None:\n print(\"Correct username\")\n return True\n else: \n print(\"Wrong username\")\n return False",
"def valid_username(u):\n return u and USER_RE.match(u)",
"d... | [
"0.86229235",
"0.85481226",
"0.85249335",
"0.84246534",
"0.84196126",
"0.84176826",
"0.8415171",
"0.8372874",
"0.8335565",
"0.8331672",
"0.83215636",
"0.8255167",
"0.82265055",
"0.8198224",
"0.81747764",
"0.8146451",
"0.81412554",
"0.81391454",
"0.81326556",
"0.81073767",
"0.... | 0.68741167 | 84 |
Checks if password is valid | def valid_pass(password):
if len(password) >= 8 and len(password) <= 25 and password != "forgot":
return True
else:
print("This is not a vaid password")
print("Password should be between 8 and 25 letters")
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_valid_password(self):\n pass_field = Field(\"\".join(['x' * (int(self.app.config['MAX_PWD_LEN']))]))\n\n valid_password(None, pass_field)",
"def is_password_valid(password):\n #TODO : This should also be handled by the front_end\n pass",
"def _check_password(self, password)... | [
"0.84734625",
"0.84652275",
"0.8318968",
"0.8265102",
"0.8162916",
"0.81371313",
"0.81049967",
"0.7999795",
"0.7994257",
"0.7988714",
"0.79752916",
"0.7968649",
"0.79615563",
"0.79155594",
"0.7903858",
"0.7897538",
"0.7889451",
"0.7885488",
"0.78673494",
"0.7865589",
"0.78367... | 0.80422235 | 7 |
Create and save a User with the given email and password. | def create_user(self, password=None, phone=None, **extra_fields):
extra_fields.setdefault('is_staff', False)
extra_fields.setdefault('is_superuser', False)
return self._create_user(password=password, phone=phone, **extra_fields) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _create_user(self, email, password, **extra_fields):\n if not email:\n raise ValueError('The given email must be set')\n email = self.normalize_email(email)\n user = self.model(email=email, **extra_fields)\n user.set_password(password)\n user.save(using=self._db)\n return user",
"def... | [
"0.85437864",
"0.8511318",
"0.85077024",
"0.8502027",
"0.85019606",
"0.84889764",
"0.84889764",
"0.84882575",
"0.84882575",
"0.84882575",
"0.84854496",
"0.84765774",
"0.84759104",
"0.8474798",
"0.8474798",
"0.8474798",
"0.8474798",
"0.8474798",
"0.8474798",
"0.8474798",
"0.84... | 0.0 | -1 |
Verify the area of a triangle with vertex coordinates (0,0), (1,0), and (0,2). | def test_get_triangle_area():
v1 = (0,0); v2 = (1,0); v3 = (0,2)
verticies = [v1,v2,v3]
expected = 1
computed = get_triangle_area(verticies)
tol = 1E-14
success = abs(expected-computed) < tol
msg = 'computed area={} != {} (expected)'.format(computed,expected)
assert success,msg | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_triangle(self):\n result = shape_area.triangle_area(10,5)\n self.assertEqual(result,25)",
"def test(x_0, y_0, x_1, y_1, x_2, y_2):\n \n print(\"A triangle with vertices (\" + str(x_0) + \",\" + str(y_0) + \"),\")\n print(\"(\" + str(x_1) + \",\" + str(y_1) + \"), and\")\n print... | [
"0.7829949",
"0.77930367",
"0.7683705",
"0.7673025",
"0.74176407",
"0.7340041",
"0.73106563",
"0.7212374",
"0.7176812",
"0.7175224",
"0.71460783",
"0.70483494",
"0.70321816",
"0.69973224",
"0.69386905",
"0.69305235",
"0.6911131",
"0.6878243",
"0.6850272",
"0.684948",
"0.68386... | 0.8612337 | 0 |
Return the multivariate Gaussian distribution on array pos. | def multivariate_gaussian(pos, mu, Sigma):
n = mu.shape[0]
Sigma_det = np.linalg.det(Sigma)
Sigma_inv = np.linalg.inv(Sigma)
N = np.sqrt((2*np.pi)**n * Sigma_det)
# This einsum call calculates (x-mu)T.Sigma-1.(x-mu) in a vectorized
# way across all the input variables.
fac = np.eins... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _multivariate_gaussian(self, x, mu_k, sigma_k):\n return multivariate_normal.pdf(x, mu_k, sigma_k)",
"def _gaussian_distribution(self, x: ndarray, mu: float, sigma: float) -> ndarray:\n return 1 / (np.sqrt(2 * np.pi) * sigma) * np.exp(\n -np.power(\n (x - mu) / sigma, ... | [
"0.74337304",
"0.7273195",
"0.6920084",
"0.6832639",
"0.6686568",
"0.6648015",
"0.6607854",
"0.6576324",
"0.655485",
"0.65200686",
"0.6499127",
"0.6422663",
"0.63527197",
"0.6331296",
"0.63252306",
"0.6309765",
"0.6288433",
"0.6261378",
"0.62431514",
"0.6224997",
"0.62122464"... | 0.7773556 | 0 |
Encode the probability density function. | def encode_pdf(pdf):
count = len(pdf)
pdf = map(lambda x: '(' + str(x[0]) + ', ' + str(x[1]) + ')', pdf)
pdf = '[' + ', '.join(pdf) + ']'
return pdf | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def probability_density(self, X):\n raise NotImplementedError",
"def pdf(self,x):\n return self.categoricalDist.pdf(x)",
"def probability_density(dic):\n\n var = dic['var']\n par = dic['par']\n y1 = dic['y']\n y = y1.conjugate() * y\n return dic_result(var,par,y)",
"def _j... | [
"0.6327656",
"0.6055408",
"0.6014623",
"0.58712167",
"0.5743965",
"0.5733626",
"0.5657458",
"0.56321996",
"0.56108826",
"0.56029785",
"0.55729485",
"0.5542125",
"0.5542125",
"0.5482188",
"0.5461297",
"0.5458609",
"0.542501",
"0.54144204",
"0.5408753",
"0.5391781",
"0.53871274... | 0.509465 | 47 |
Convert a batch of indices to a batch of data | def idx_to_data(self, idx, return_flattened=False):
batch = self.data_container[idx]
if return_flattened:
inputs_targets = []
for key, dtype in self.dtypes_input.items():
inputs_targets.append(tf.constant(batch[key], dtype=dtype))
inputs_target... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def gather_list_batch(data, indices):\n\n assert isinstance(indices, (tuple, list)) or (isndarray(indices) and len(indices.shape) == 1)\n\n if isndarray(data):\n return data[indices]\n\n assert len(data) > 0 and len(indices) > 0\n\n sample = np.array(data[0]) # Try to convert the first element ... | [
"0.7341998",
"0.66324705",
"0.6629144",
"0.6596083",
"0.6503591",
"0.6503591",
"0.64109075",
"0.6410791",
"0.633435",
"0.63177687",
"0.63177687",
"0.6284597",
"0.6282956",
"0.6280257",
"0.62560016",
"0.62560016",
"0.62077683",
"0.62025505",
"0.62005365",
"0.61640215",
"0.6159... | 0.6373288 | 8 |
Convert a batch of indices to a batch of data from TensorFlow | def idx_to_data_tf(self, idx):
dtypes_flattened = list(self.dtypes_input.values())
dtypes_flattened.append(self.dtype_target)
inputs_targets = tf.py_function(lambda idx: self.idx_to_data(idx.numpy(), return_flattened=True),
inp=[idx], Tout=dtypes_fla... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def gather_list_batch(data, indices):\n\n assert isinstance(indices, (tuple, list)) or (isndarray(indices) and len(indices.shape) == 1)\n\n if isndarray(data):\n return data[indices]\n\n assert len(data) > 0 and len(indices) > 0\n\n sample = np.array(data[0]) # Try to convert the first element ... | [
"0.7016998",
"0.69512653",
"0.67934865",
"0.6771877",
"0.6751317",
"0.667927",
"0.6595642",
"0.65689045",
"0.65528566",
"0.65024877",
"0.64998865",
"0.64721966",
"0.6424543",
"0.6391614",
"0.6391614",
"0.6352938",
"0.633336",
"0.62440056",
"0.62440056",
"0.623342",
"0.6191109... | 0.68931806 | 2 |
Creates a classification model. | def create_model(bert_config, is_training, input_ids, input_mask, segment_ids,
num_labels, use_one_hot_embeddings):
model = modeling.BertModel(
config=bert_config,
is_training=is_training,
input_ids=input_ids,
input_mask=input_mask,
token_type_ids=segment_ids,
use_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_model(self):\n self.classifier = DecisionTreeClassifier(max_depth=1)",
"def create_model(self, C : float =1):\n self.classifier = RandomForestClassifier(max_depth=5)",
"def create_model():\n\n # Create a sequential model (a simple NN is created) adding a softmax activation at the en... | [
"0.7451048",
"0.716728",
"0.70753753",
"0.69427526",
"0.69337225",
"0.69306064",
"0.6929345",
"0.68631464",
"0.68004555",
"0.6769279",
"0.6737084",
"0.66838384",
"0.66709864",
"0.660953",
"0.65912193",
"0.6564333",
"0.6534873",
"0.6526978",
"0.6525293",
"0.6521778",
"0.651739... | 0.0 | -1 |
Create dataset objects for splits of the Simple QA dataset. This is the most flexible way to use the dataset. | def splits(cls, text_field, label_field, root='../data',
train='train.txt', validation='valid.txt', test='test.txt'):
print("root path for relation dataset: {}".format(root))
path = cls.download_or_unzip(root)
prefix_fname = 'annotated_fb_data_'
return super(SimpleQaRelat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _init_dataset(self, data_config, split='train'):\n assert split in {'train', 'valid'}\n\n # load datasets\n print(f'Load {split} dataset')\n if data_config['type'] == 'npy':\n dataset = MSDMelDataset(\n data_config['mel_root'], data_config[f'{split}_tids_fn... | [
"0.67538923",
"0.66747713",
"0.6671417",
"0.6534649",
"0.65177923",
"0.6478847",
"0.64270556",
"0.6424253",
"0.6392685",
"0.6356818",
"0.6315091",
"0.6299448",
"0.6264418",
"0.6218217",
"0.619587",
"0.612361",
"0.61080515",
"0.608875",
"0.60740155",
"0.60730666",
"0.60573524"... | 0.0 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.