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 patches in the patch list that is ouput by apply_model_to_image_patches_list has size (1, n). This is the output that is given by the model. This needs to be resized to (resize_mask_patch_to_h x resize_mask_patch_to_w) as in the original mask. | def reshape_patches_list(patches_list,
resize_mask_patch_to_h,
resize_mask_patch_to_w):
nh_slices, nw_slices = dhap.get_patches_list_dimensions(patches_list)
for i in range(nh_slices):
for j in range(nw_slices):
patch = np.reshape(patches_l... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def extract_patch(n, patch_size, imgs):\n # Extract patches from input images\n img_patches = [img_crop(imgs[i], patch_size, patch_size) for i in range(n)]\n #gt_patches = [img_crop(gt_imgs[i], patch_size, patch_size) for i in range(n)]\n\n # Linearize list of patches\n img_patches = np.asarray([img... | [
"0.70858026",
"0.6769502",
"0.6728025",
"0.66175693",
"0.66118413",
"0.65663916",
"0.6517067",
"0.6509293",
"0.6439067",
"0.64198416",
"0.6395973",
"0.63416964",
"0.62950844",
"0.6293343",
"0.62392056",
"0.6231862",
"0.622079",
"0.6211434",
"0.6196114",
"0.6173301",
"0.615858... | 0.7416462 | 0 |
Standardize features by removing the mean and scaling to unit variance | def __init__(self, epsilon=1e-14):
self.epsilon = epsilon | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def standardiser(self):\n # Select only numeric features first\n\n #self.X = self.data.loc[:, self.data.columns != self.target].values\n numeric_columns = []\n for col in self.X.columns:\n if self.X[col].dtype!='object':\n numeric_columns.append(col)\n s... | [
"0.7736729",
"0.762883",
"0.7609136",
"0.75860715",
"0.7506896",
"0.74911505",
"0.745282",
"0.73755103",
"0.7371604",
"0.7364477",
"0.7331552",
"0.7328972",
"0.72433025",
"0.72221714",
"0.71172124",
"0.71106374",
"0.7097783",
"0.7064042",
"0.70623225",
"0.7049936",
"0.7048076... | 0.0 | -1 |
Input is the repr of a tuple of strings, output is that tuple. This only works with a tuple where the members are python identifiers. | def _eval_str_tuple(value):
if not (value.startswith('(') and value.endswith(')')):
raise ValueError(value)
orig_value = value
value = value[1:-1]
result = []
while value:
m = _strs.match(value)
if m is None:
raise ValueError(orig_value)
result.append(m... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def str_tuple(item):\n return \"{}:{}\".format(item[0], item[1])",
"def _unpack_tuple(x):\n if len(x) == 1:\n return x[0]\n else:\n return x",
"def _unpack_tuple(x):\n if len(x) == 1:\n return x[0]\n else:\n return x",
"def tuple(self, arg: SeField[Any]) -> str:\n ... | [
"0.7021662",
"0.681438",
"0.681438",
"0.6795119",
"0.6731864",
"0.65791065",
"0.65075475",
"0.64776105",
"0.64720607",
"0.6408031",
"0.638378",
"0.6339351",
"0.6337706",
"0.6323831",
"0.6266782",
"0.62131214",
"0.62034833",
"0.61979574",
"0.6196585",
"0.6192576",
"0.6184871",... | 0.6351198 | 11 |
Initialize this graph node. | def __init__(self, identifier):
self.code = None
self.filename = None
self.graphident = identifier
self.identifier = identifier
self.packagepath = None
self._deferred_imports = None
self._global_attr_names = set()
self._starimported_ignored_module_names =... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self):\n self.graph = None",
"def __init__(self):\n\n self.nodes = {}",
"def __init__(self):\n self.graph = {}\n self.edges = 0\n self.vertices = 0",
"def __init__(self):\n self.node = None\n self.data = None",
"def __init__(self):\n\n\t\tself.r... | [
"0.7894777",
"0.7673838",
"0.76377386",
"0.75560266",
"0.7510026",
"0.74931556",
"0.7485559",
"0.74696535",
"0.7388965",
"0.7363342",
"0.73553944",
"0.7346583",
"0.73146296",
"0.7310628",
"0.7299617",
"0.7265506",
"0.7264227",
"0.7223491",
"0.72187424",
"0.721711",
"0.7180702... | 0.0 | -1 |
Return True iff there is an edge from 'fromnode' to 'tonode' | def hasEdge(self, fromnode, tonode):
fromnode = self.findNode(fromnode)
tonode = self.findNode(tonode)
return self.graph.edge_by_node(fromnode, tonode) is not None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def isConnectedTo(self, node):\n for arc in self._arcsFrom:\n if arc.getFinish() is node:\n return True\n return False",
"def node_is_edge(self, node: MazeCell) -> bool:\n return node.x == 0 or node.x == self._ncols - 1 or node.y == 0 or node.y == self._nrows - 1",
... | [
"0.6863117",
"0.6763081",
"0.6406216",
"0.62857914",
"0.6188764",
"0.61810917",
"0.614652",
"0.61096525",
"0.6080101",
"0.5969294",
"0.5933178",
"0.59318316",
"0.59039205",
"0.58798075",
"0.58292407",
"0.5812069",
"0.5784916",
"0.5767504",
"0.57515097",
"0.57073575",
"0.56747... | 0.7842136 | 0 |
Create a Point instance given x and y location | def __init__(self, x=0, y=0):
self.x = x
self.y = y | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def makePoint( nX, nY ):\n oPoint = createUnoStruct( \"com.sun.star.awt.Point\" )\n oPoint.X = nX\n oPoint.Y = nY\n return oPoint",
"def makePoint( nX, nY ):\n oPoint = createUnoStruct( \"com.sun.star.awt.Point\" )\n oPoint.X = nX\n oPoint.Y = nY\n return oPoint",
"def createFromPoint(c... | [
"0.7641997",
"0.7641997",
"0.7604725",
"0.7483055",
"0.7396969",
"0.73066473",
"0.7207385",
"0.71760476",
"0.71723926",
"0.71184623",
"0.7114353",
"0.6925506",
"0.69078815",
"0.67968965",
"0.6775794",
"0.67119116",
"0.6700368",
"0.66395676",
"0.66395676",
"0.6625665",
"0.6566... | 0.6374746 | 62 |
Create a Point from tuple (x,y) | def from_tuple(cls, coords):
return cls(*coords) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_point(x_crd, y_crd):\n\n Point = namedtuple(\"Point\", \"x_crd y_crd\")\n return Point(x_crd, y_crd)",
"def _transform_point(self, x, y):\n return (x, y)",
"def test_point__tuple(self):\n\n p = tuples.Tuple([\"x\", \"y\", \"z\", \"w\"], 4.3, -4.2, 3.1, 1)\n\n self.assertEq... | [
"0.73830235",
"0.7135642",
"0.7063852",
"0.705112",
"0.705112",
"0.70222473",
"0.6901521",
"0.66803503",
"0.66792816",
"0.6671866",
"0.66661143",
"0.6652373",
"0.66371787",
"0.66328096",
"0.65565825",
"0.65180486",
"0.6495033",
"0.6487349",
"0.6485908",
"0.645265",
"0.645221"... | 0.6249484 | 36 |
Pretend it is a vector, return magnitude | def magnitude(self):
return math.sqrt(self.x**2 + self.y**2) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def magnitude(v: Vector) -> float:\n return math.sqrt(sum_of_squares(v)) #math.sqrt() is a square root function",
"def magnitude(v):\n if len(v.arr) != 4 or v[3] != 0.0:\n raise ValueError(\"Only use this function with vectors.\")\n return np.sqrt(np.sum(np.square(v.arr)))",
"def magnitude(v: V... | [
"0.832124",
"0.82788163",
"0.82092965",
"0.81846076",
"0.8156582",
"0.79914767",
"0.7989647",
"0.7856691",
"0.7827822",
"0.7702335",
"0.7689266",
"0.76656896",
"0.7621606",
"0.7583984",
"0.7542754",
"0.7485046",
"0.7386094",
"0.7345146",
"0.7332539",
"0.73227197",
"0.7270426"... | 0.7139705 | 26 |
Return copy of our point, shifted by other point. | def __add__(self, other):
return Point(self.x+other.x, self.y+other.y) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def lift(point):\n return gs.copy(point)",
"def substract(self, point):\n\n return Point(point.x - self.x, point.y - self.y, point.z - self.z)",
"def __rmul__(self, other):\n return Point(x * other for x in self.data)",
"def __rshift__(self, other):\n other.set_upstream(self)\n ... | [
"0.6810573",
"0.6583291",
"0.65027994",
"0.6431778",
"0.6392482",
"0.63614",
"0.6339803",
"0.6323356",
"0.6296831",
"0.6296831",
"0.61843824",
"0.61754584",
"0.61753106",
"0.6146929",
"0.61119086",
"0.61012584",
"0.6082639",
"0.60747087",
"0.6043413",
"0.6022057",
"0.6000911"... | 0.65983444 | 1 |
Return area of circle | def area(self):
return math.pi * self.radius ** 2 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def circle_area(circle):\n return pi * circle.radius * circle.radius",
"def area_of_circle(radius):\n return radius",
"def area(self):\n\t\t#print (self.radius*self.radius*math.pi)\n\t\tcircle_area = (self.radius*self.radius*math.pi)\n\t\treturn circle_area",
"def circle_area(radius):\n area = radiu... | [
"0.8990027",
"0.8953768",
"0.8845637",
"0.86277604",
"0.8563898",
"0.8538201",
"0.85045075",
"0.84815156",
"0.84714866",
"0.83603805",
"0.83603805",
"0.83422035",
"0.83265805",
"0.82883966",
"0.82766783",
"0.82401246",
"0.8216012",
"0.8201437",
"0.81927913",
"0.8137294",
"0.7... | 0.83280194 | 12 |
Modify self, adding other to self | def __iadd__(self, other):
self.center += other.center
self.radius += other.radius
return self | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __iadd__(self, other):\n self.MergeWith(other)\n return self",
"def __add__(self, other):\n self.__dict__.update(other)\n return self",
"def __add__(self, other):\n if not other:\n return self.clone()\n else:\n return self.using(join(self, oth... | [
"0.7888015",
"0.78237134",
"0.76593584",
"0.75777256",
"0.7520982",
"0.7481189",
"0.7450531",
"0.7444415",
"0.74033624",
"0.73803276",
"0.7376915",
"0.73514086",
"0.73514086",
"0.73514086",
"0.73514086",
"0.73514086",
"0.73514086",
"0.73514086",
"0.7341033",
"0.7307911",
"0.7... | 0.7069293 | 41 |
u"""Returns true if the given link is a service.post link | def isPostLink(self, rel, type = None): #$NON-NLS-1$
return self._isInRelList(rel, ZAtomRelTypes.ATOM_POST_LINK_REL_LIST) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hasEntityLink(self, link):\r\n return self.feed_handler.hasEntityLink(link)",
"def check_link(self, link, links_para):\n href = link['href']\n if not href.startswith('/wiki/') or href == '/wiki/Latin' or href.startswith('#'):\n return False\n if \"<i>\" in link... | [
"0.686441",
"0.6492646",
"0.6304791",
"0.622512",
"0.6222945",
"0.61115324",
"0.60729736",
"0.60076696",
"0.59114534",
"0.5892597",
"0.5892597",
"0.5892597",
"0.58833045",
"0.5854273",
"0.58165044",
"0.5810743",
"0.57981163",
"0.5754481",
"0.5749867",
"0.5748549",
"0.5718632"... | 0.6789134 | 1 |
u"""Returns true if the given link is a service.upload link | def isUploadLink(self, rel, type = None): #$NON-NLS-1$
return self._isInRelList(rel, ZAtomRelTypes.ATOM_UPLOAD_LINK_REL_LIST) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_for_file_link(link):\n for ext in lk_nr:\n if ext in link:\n return False\n return True",
"def GoogleCode_IsExternalLink(wikifier, link):\n\n if GoogleCode_Exists(wikifier, link):\n return False;\n\n if URL.match(link):\n return True\n\n if '.' in link or ... | [
"0.6765469",
"0.66029304",
"0.6389206",
"0.6314112",
"0.6230375",
"0.6119771",
"0.6099853",
"0.6089014",
"0.6083945",
"0.6082312",
"0.6023792",
"0.60067016",
"0.6002637",
"0.5935221",
"0.5919552",
"0.5911882",
"0.5908945",
"0.590535",
"0.58824784",
"0.58824575",
"0.5875554",
... | 0.75233096 | 0 |
u"""Returns true if the given link is a service.categories link | def isCategoriesLink(self, rel, type = None): #$NON-NLS-1$
return self._isInRelList(rel, ZAtomRelTypes.ATOM_CATEGORIES_LINK_REL_LIST) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def has_category(business, category):\n\t\tcategories = set()\n\t\tif business['categories']:\n\t\t\tcategories = set(strip_categories(business['categories']))\n\t\tif category in categories:\n\t\t\treturn True \n\t\treturn False",
"def verify(link: str\n ) -> bool:\n \n # Ignore any ... | [
"0.64558023",
"0.6031602",
"0.594195",
"0.5891369",
"0.58019423",
"0.58019423",
"0.57905996",
"0.5777304",
"0.5726061",
"0.57243544",
"0.56676304",
"0.55928165",
"0.55856866",
"0.5553698",
"0.55529237",
"0.5547848",
"0.5502429",
"0.5488206",
"0.5440382",
"0.5439438",
"0.54359... | 0.7418906 | 0 |
u"""Returns true if the given link is a service.categories link | def isAlternateLink(self, rel, type = None): #$NON-NLS-1$
return u"alternate" == rel.strip().lower() #$NON-NLS-1$
| {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def isCategoriesLink(self, rel, type = None): #$NON-NLS-1$\r\n return self._isInRelList(rel, ZAtomRelTypes.ATOM_CATEGORIES_LINK_REL_LIST)",
"def has_category(business, category):\n\t\tcategories = set()\n\t\tif business['categories']:\n\t\t\tcategories = set(strip_categories(business['categories']))\n\t\t... | [
"0.7418906",
"0.64558023",
"0.6031602",
"0.594195",
"0.5891369",
"0.58019423",
"0.58019423",
"0.57905996",
"0.5777304",
"0.5726061",
"0.57243544",
"0.56676304",
"0.55928165",
"0.55856866",
"0.5553698",
"0.55529237",
"0.5547848",
"0.5502429",
"0.5488206",
"0.5440382",
"0.54394... | 0.0 | -1 |
u"""Returns a AtomBlogEntry object for the entry edit link. | def getAtomEntry(self, editLink): #$NON-NLS-1$
atomRequest = self._createGetEntryRequest(editLink)
self._sendAtomRequest(atomRequest)
rval = atomRequest.getEntry()
del atomRequest
return rval | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def createEditBlogEntry(self): #$NON-NLS-1$\r\n atomdoc = self._createEditEntryDocument()\r\n self._initEditEntryDocument(atomdoc)\r\n return ZAtomEditBlogEntry(atomdoc)",
"def edit_entry(self, id, body=None, link=None, **args):\n args.update(id=id)\n if body: args.update(body=... | [
"0.8105329",
"0.73352486",
"0.72787863",
"0.6457583",
"0.6445015",
"0.64408654",
"0.63507575",
"0.61753565",
"0.6132774",
"0.6025928",
"0.5931792",
"0.57840806",
"0.5783336",
"0.5778593",
"0.577064",
"0.57661253",
"0.5755019",
"0.5700627",
"0.566708",
"0.5642813",
"0.5625639"... | 0.7395554 | 1 |
Parse the given url to get the name of the site. | def getSite(self, url):
hostname = urlparse(urlparser).hostname
site = sites.getSite(hostname)
return site | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def extractHostname(self, url):\n return url.split(\"http://\")[1].split('/')[0]",
"def get_host_name(url):\n return urlparse.urlparse(url)[1]",
"def get_hostname(url: str) -> str:\n return urlsplit(url).hostname",
"def __find_hostname(self, url):\n match = self.__REGEX_HOST.search(url)\n... | [
"0.74880683",
"0.7329385",
"0.72429836",
"0.71239716",
"0.7123659",
"0.70933086",
"0.6933584",
"0.68911266",
"0.6871884",
"0.6847901",
"0.6833968",
"0.6824228",
"0.67954427",
"0.6764458",
"0.6700904",
"0.66929585",
"0.6651882",
"0.66194004",
"0.66123146",
"0.65854925",
"0.657... | 0.72666633 | 2 |
Method to remove and return top of Stack class object. | def pop(self):
# OVERVIEW
# The goal of this method is to remove and return our Stack's top.
# Since our Stack is essentially a Python list, we can (and will) use a
# built-in method to accomplish this task, being careful to perform a
# few checks and reassign the Stack's top al... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove(self):\n return self.stack_list.pop()",
"def pop(self) -> object:\n if self.is_empty()== True: # if size of array is 0, raise exception\n raise StackException\n else:\n top_stack = self.da.get_at_index(self.size()-1) # initialize the top of the stack (last ele... | [
"0.7650018",
"0.7644351",
"0.746955",
"0.74653226",
"0.7461187",
"0.74329853",
"0.741914",
"0.740638",
"0.7386993",
"0.7381856",
"0.73684573",
"0.7352211",
"0.73419076",
"0.73408574",
"0.731923",
"0.7300132",
"0.72811455",
"0.7275078",
"0.7274448",
"0.7236757",
"0.72142214",
... | 0.770312 | 0 |
Computes the precision for the specified values of k | def accuracy(output, target, topk=(1,)):
maxk = max(topk)
batch_size = target.size(0)
_, pred = output.topk(maxk, 1, True, True)
pred = pred.t()
correct = pred.eq(target.view(1, -1).expand_as(pred))
res = []
for k in topk:
correct_k = correct[:k].view(-1).float().sum(0)
res... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def precision(gt, pred, k):\n k = min(len(pred), k)\n den = min(len(gt), k)\n return sum([int(pred[i] in gt) for i in range(k)]) / den",
"def precision_at_k(r, k):\n assert k >= 1\n r = np.asarray(r)[:k] != 0\n if r.size != k:\n raise ValueError('Relevance score length < k')\... | [
"0.76427615",
"0.74189496",
"0.7418079",
"0.72710466",
"0.72456723",
"0.72446615",
"0.7237539",
"0.72213703",
"0.7210107",
"0.7058935",
"0.6852219",
"0.6786084",
"0.67836976",
"0.6768417",
"0.67273885",
"0.67181736",
"0.67181736",
"0.67181736",
"0.67181736",
"0.67181736",
"0.... | 0.0 | -1 |
Return the filtered queryset based on the filter value. | def queryset(self, request, queryset):
v = self.value()
if v == "sent":
return queryset.filter(sent__isnull=False)
elif v == "unsent":
return queryset.filter(sent__isnull=True)
return queryset | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def queryset(self, request, queryset):\n # Compare the requested value (either '80s' or 'other')\n # to decide how to filter the queryset.\n\n if self.value() is None:\n return queryset.all()\n\n return queryset.filter(firm__pk=self.value())",
"def _filter(self, _model, **k... | [
"0.7294032",
"0.71930027",
"0.7161658",
"0.7038184",
"0.69310194",
"0.6830672",
"0.68174195",
"0.67351544",
"0.6692034",
"0.6660031",
"0.6620781",
"0.6585096",
"0.65264976",
"0.64922106",
"0.6461762",
"0.6440926",
"0.6431796",
"0.6422354",
"0.64104414",
"0.63905704",
"0.63707... | 0.0 | -1 |
Home Page for Smart Office MAPS | def index():
return render_template('index.html') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def homepage(): \n\n return render_template(\"home_map.html\")",
"def home():\n m = Map() # Create map html\n return render_template('index.html') # pulls map html using jinja2",
"def home():\n return render_template(\n \"pages/index.html\", form=EntryForm(), gmapskey=app.config[\"GOOGLE_API... | [
"0.8013002",
"0.79849064",
"0.72594804",
"0.7213107",
"0.71836364",
"0.7143764",
"0.6947734",
"0.6898038",
"0.6778141",
"0.6742523",
"0.6720937",
"0.66652215",
"0.66331846",
"0.66106796",
"0.6608274",
"0.6597242",
"0.6597242",
"0.65890205",
"0.65841913",
"0.6583467",
"0.65805... | 0.0 | -1 |
Ensure that the value is a list. | def _as_list(value):
if not isinstance(value, list):
value = [value]
return value | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_list(value):\n return isinstance(value, list)",
"def _is_list(val):\n\n return isinstance(val, list)",
"def is_list(value):\n return isinstance(value, list) or None",
"def _is_list(item):\n return isinstance(item, list)",
"def ensure_list(self, x):\n return x if isinstance(x, li... | [
"0.8437756",
"0.8436968",
"0.83317703",
"0.7786222",
"0.772368",
"0.7688077",
"0.7520433",
"0.7510139",
"0.7501689",
"0.7491762",
"0.7445257",
"0.7365977",
"0.7352119",
"0.7313862",
"0.73128366",
"0.72137696",
"0.71923774",
"0.7129483",
"0.7115061",
"0.7109882",
"0.71082",
... | 0.801115 | 3 |
Compares and returns the hamming distance of 2 DNA strands | def distance(base_strand, comparison_strand):
hamming_distance = 0
for nucleotide in range(len(base_strand)):
if base_strand[nucleotide] != comparison_strand[nucleotide]:
hamming_distance += 1
return hamming_distance | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def distance(dna_1, dna_2):\n hamming_difference = 0\n\n # turn the strings into a list of characters\n a = list(dna_1)\n b = list(dna_2)\n\n # iterate through both lists and compares. If they are not the same increment the hamming_difference\n for nucleotide_1, nucleotide_2 in map(None, dna_1, ... | [
"0.80936867",
"0.79248005",
"0.79143405",
"0.7904056",
"0.7769737",
"0.77116495",
"0.7707225",
"0.7683365",
"0.7683308",
"0.7682639",
"0.7658072",
"0.7645123",
"0.7622069",
"0.7576385",
"0.75402504",
"0.7499295",
"0.74978846",
"0.74135226",
"0.74102235",
"0.7398903",
"0.73906... | 0.7336208 | 23 |
Take file path as string; return text as string. Takes a string that is a file path, opens the file, and turns the file's contents as one string of text. | def open_and_read_file(file_path):
contents = open(file_path).read()
words = contents.split()
return words | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def open_and_read_file(file_path):\n\n # your code goes here\n text_file = open(file_path)\n text_string= text_file.read()\n text_file.close()\n return text_string",
"def open_and_read_file(file_path):\n\n text_file = open(file_path)\n full_text = text_file.read()\n\n return full_text",
... | [
"0.80689883",
"0.8046884",
"0.80130076",
"0.7990617",
"0.79206705",
"0.78633755",
"0.77989054",
"0.7678091",
"0.76585126",
"0.76138705",
"0.760622",
"0.7569624",
"0.7538406",
"0.7530203",
"0.75028515",
"0.75019044",
"0.7498211",
"0.74120235",
"0.73702693",
"0.73626786",
"0.73... | 0.0 | -1 |
Returns the coefficient of the monomial mono in self | def __getitem__(self, mono):
if type(mono) is not Monomial:
raise TypeError('Index is not a Monomial')
return next((m.coeff for m in self.monomials if m.simplifies_with(mono)), 0) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getCoefficient(self):\n return _libsbml.FluxObjective_getCoefficient(self)",
"def get_coeff(self):\n return bernoulli(self.degree+1) / factorial(self.degree + 1)",
"def coefficient(self) -> float:\n ...",
"def kmonomial(self):\n return kMonomial(self)",
"def BinomialCoeffic... | [
"0.741316",
"0.7389952",
"0.72700953",
"0.70054954",
"0.6695579",
"0.66717046",
"0.6584145",
"0.65685856",
"0.6485304",
"0.6452873",
"0.6439658",
"0.639754",
"0.62917525",
"0.6258074",
"0.62374234",
"0.6235362",
"0.6222026",
"0.6180938",
"0.6147795",
"0.61474496",
"0.6075822"... | 0.66898704 | 5 |
Function that returns a normalized absolutized version of the pathname path | def get_abs_path(path):
abs_path = lib_path.abspath(path)
return abs_path | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _normalized_path(path):\n return os.path.abspath(os.path.expanduser(path))",
"def normalized_path(pathstring: str) -> str:\n pathstring = os.path.abspath(pathstring)\n return pathstring.replace('\\\\', '/').rstrip()",
"def normalizePath(path):\n\tfrom os.path import normpath, sep\n\tresult = normp... | [
"0.8091732",
"0.7606482",
"0.7467464",
"0.74182177",
"0.73598963",
"0.72841907",
"0.7255498",
"0.72518134",
"0.72473526",
"0.7240601",
"0.7236917",
"0.72286195",
"0.71987486",
"0.7159286",
"0.71533316",
"0.71467096",
"0.7137005",
"0.7136389",
"0.71271497",
"0.71222466",
"0.71... | 0.6898641 | 37 |
Returns the tithi prevailing at a given moment Tithi is computed as the difference in the longitudes of the moon and sun at any given point of time. Therefore, even the ayanamsha does not matter, as it gets cancelled out. | def get_tithi(jd, ayanamsha_id=swe.SIDM_LAHIRI):
return get_angam(jd, TITHI, ayanamsha_id=ayanamsha_id) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new_moon_before(cls, tee):\n varepsilon = pow(2, -1000)\n tau = tee - ((1/360) * cls.lunar_phase(tee) * cls.SYNODIC_MONTH)\n return binary_search(tau - 1, min(tee, tau + 1),\n lambda l, u: cls.zodiac(l) == cls.zodiac(u) or u - l < varepsilon,\n ... | [
"0.64497256",
"0.603289",
"0.5795906",
"0.5749028",
"0.5686858",
"0.5610873",
"0.5555485",
"0.5544071",
"0.5542604",
"0.5474665",
"0.54629827",
"0.54611623",
"0.5372747",
"0.5298526",
"0.521196",
"0.5207761",
"0.5191479",
"0.5184655",
"0.5165537",
"0.5163094",
"0.51582485",
... | 0.5179321 | 18 |
Transform from corner coordinates to center coordinates. Arguments | def to_center_form(boxes):
x_min, y_min = boxes[:, 0], boxes[:, 1]
x_max, y_max = boxes[:, 2], boxes[:, 3]
center_x = (x_max + x_min) / 2.
center_y = (y_max + y_min) / 2.
width = x_max - x_min
height = y_max - y_min
return np.concatenate([center_x[:, None], center_y[:, None],
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def center2corner(center):\n x, y, w, h = center[0], center[1], center[2], center[3]\n x1 = x - w * 0.5\n y1 = y - h * 0.5\n x2 = x + w * 0.5\n y2 = y + h * 0.5\n return x1, y1, x2, y2",
"def coord_corner2center(bbox):\n x1, y1 = bbox.new([bbox[0]]), bbox.new([bbox[1]])\n x2, y2 = bbox.ne... | [
"0.71203727",
"0.7002218",
"0.69257176",
"0.68837434",
"0.68764895",
"0.68570447",
"0.6848941",
"0.68337965",
"0.67942035",
"0.67859316",
"0.6777508",
"0.6771916",
"0.67647433",
"0.6755342",
"0.67101616",
"0.66735125",
"0.667043",
"0.6652872",
"0.6625299",
"0.66167253",
"0.65... | 0.64794767 | 31 |
Encode the variances from the priorbox layers into the ground truth boxes we have matched (based on jaccard overlap) with the prior boxes. Arguments | def encode(matched, priors, variances):
# dist b/t match center and prior's center
g_cxcy = (matched[:, :2] + matched[:, 2:4]) / 2 - priors[:, :2]
# encode variance
g_cxcy /= (variances[0] * priors[:, 2:4])
# match wh / prior wh
g_wh = (matched[:, 2:4] - matched[:, :2]) / priors[:, 2:4]
g_w... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def decode(predictions, priors, variances):\n\n boxes = np.concatenate((\n priors[:, :2] + predictions[:, :2] * variances[0] * priors[:, 2:4],\n priors[:, 2:4] * np.exp(predictions[:, 2:4] * variances[1])), 1)\n boxes[:, :2] = boxes[:, :2] - (boxes[:, 2:4] / 2)\n boxes[:, 2:4] = boxes[:, 2:4... | [
"0.6248153",
"0.57379043",
"0.5628842",
"0.5615297",
"0.5598029",
"0.55784154",
"0.5573641",
"0.5526289",
"0.54952735",
"0.54880357",
"0.54696566",
"0.5392463",
"0.5378039",
"0.5376358",
"0.53649414",
"0.5341247",
"0.5311828",
"0.5286437",
"0.5260564",
"0.5258755",
"0.5245303... | 0.539961 | 11 |
Performs the function of torch.max(). In case of multiple occurrences of the maximum values, the indices corresponding to the last occurrence are returned. | def reversed_argmax(array, axis):
array_flip = np.flip(array, axis=axis)
return array.shape[axis] - np.argmax(array_flip, axis=axis) - 1 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_max_index(a):\n return a.argmax()",
"def get_max_index(a):\n return a.argmax()",
"def get_max_index(a):\n return a.argmax()",
"def find_max(list):\n return find_value_at(list, 0)",
"def max(self):\n maxs = self.client.map(_call_max, self.vecDask, pure=False)\n max_val = - ... | [
"0.73336494",
"0.73336494",
"0.73336494",
"0.7226176",
"0.72104007",
"0.72095007",
"0.71448356",
"0.71346295",
"0.7094223",
"0.7061115",
"0.69828",
"0.69208443",
"0.69136393",
"0.6895283",
"0.689524",
"0.6874744",
"0.6860859",
"0.68547",
"0.6839824",
"0.683291",
"0.67863166",... | 0.0 | -1 |
Matches each prior box with a ground truth box (box from ``boxes``). It then selects which matched box will be considered positive e.g. iou > .5 and returns for each prior box a ground truth box that is either positive (with a class argument different than 0) or negative. Arguments | def match(boxes, prior_boxes, iou_threshold=0.5):
ious = compute_ious(boxes, to_point_form(np.float32(prior_boxes)))
best_box_iou_per_prior_box = np.max(ious, axis=0)
best_box_arg_per_prior_box = reversed_argmax(ious, 0)
best_prior_box_arg_per_box = reversed_argmax(ious, 1)
best_box_iou_per_prior_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def filter_boxes(self, boxes, box_confidences, box_class_probs):\n box_scores = [x * y for x, y in zip(box_confidences, box_class_probs)]\n box_class_scores = [np.max(x, axis=-1).reshape(-1) for x in box_scores]\n box_class_scores = np.concatenate(box_class_scores)\n box_classes = [np.a... | [
"0.6769079",
"0.66871345",
"0.6677872",
"0.6507453",
"0.6489415",
"0.64167345",
"0.6326974",
"0.63136166",
"0.63087034",
"0.62650543",
"0.62302375",
"0.6227087",
"0.61921936",
"0.6179865",
"0.6179263",
"0.6123201",
"0.6098949",
"0.603543",
"0.60079914",
"0.59512824",
"0.59456... | 0.72342587 | 0 |
Makes box coordinates square. Arguments | def make_box_square(box, offset_scale=0.05):
x_min, y_min, x_max, y_max = box[:4]
center_x = (x_max + x_min) / 2.
center_y = (y_max + y_min) / 2.
width = x_max - x_min
height = y_max - y_min
if height >= width:
half_box = height / 2.
x_min = center_x - half_box
x_max = ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def box(self, x, y, w, h):\n\t\tpass",
"def square(side):\n rectangle(side,side)",
"def find_square_box(box):\n width = box['bottom_right_x'] - box['top_left_x']\n height = box['bottom_right_y'] - box['top_left_y']\n if width <= height:\n offset = int((width - height) / 2)\n box['top_... | [
"0.7888324",
"0.72516835",
"0.72114986",
"0.6968854",
"0.6968453",
"0.6850404",
"0.6767812",
"0.67180675",
"0.66432965",
"0.66346097",
"0.6611455",
"0.65708643",
"0.6515258",
"0.65043265",
"0.64862406",
"0.6468843",
"0.64415514",
"0.64369106",
"0.64362866",
"0.6396736",
"0.63... | 0.7775576 | 1 |
Transform from class index to onehot encoded vector. Arguments | def to_one_hot(class_indices, num_classes):
one_hot_vectors = np.zeros((len(class_indices), num_classes))
for vector_arg, class_args in enumerate(class_indices):
one_hot_vectors[vector_arg, class_args] = 1.0
return one_hot_vectors | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def indices_to_one_hot(cls_indeces, nb_classes):\n targets = np.array(cls_indeces).reshape(-1)\n return np.eye(nb_classes)[targets]",
"def indices_to_one_hot(data, nb_classes):\n targets = np.array(data).reshape(-1)\n return np.eye(nb_classes)[targets]",
"def indices_to_one_hot(data, nb_classes):\n... | [
"0.81888103",
"0.8167266",
"0.8167266",
"0.8167266",
"0.8167266",
"0.8143724",
"0.8131516",
"0.8027438",
"0.8024578",
"0.79597366",
"0.7944598",
"0.7897681",
"0.7897681",
"0.78873396",
"0.7880259",
"0.78104424",
"0.7762794",
"0.77268285",
"0.77020067",
"0.7679807",
"0.7670373... | 0.8020937 | 9 |
Transforms quaternion to rotation matrix Arguments | def quaternion_to_rotation_matrix(quaternion):
q_w, q_x, q_y, q_z = quaternion
sqw, sqx, sqy, sqz = np.square(quaternion)
norm = (sqx + sqy + sqz + sqw)
rotation_matrix = np.zeros((3, 3))
# division of square length if quaternion is not already normalized
rotation_matrix[0, 0] = (+sqx - sqy - ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def quaternion_to_Rot(q: array):\n\n # Create a vector from the quaternion parameters (and check dimensions)\n q = array(q).reshape(4)\n\n # Normalize the quaternion\n q = divide(q, sqrt(sum(power(q, 2))))\n\n # Auxiliary matrix\n q_hat = zeros((3, 3))\n q_hat[0, 1] = -q[3]\n q_hat[0, 2] = ... | [
"0.75479615",
"0.7411099",
"0.73781973",
"0.7350671",
"0.7331331",
"0.7330153",
"0.73054063",
"0.7278605",
"0.7245652",
"0.724428",
"0.72061",
"0.7198043",
"0.71948165",
"0.71938944",
"0.71446013",
"0.7114222",
"0.709469",
"0.70613",
"0.70243126",
"0.70067334",
"0.70015734",
... | 0.73391324 | 4 |
Calculates normalized quaternion from rotation matrix If w is negative the quaternion gets flipped, so that all w are >= 0 Arguments | def rotation_matrix_to_quaternion(rotation_matrix):
trace = np.trace(rotation_matrix)
if trace > 0:
S = np.sqrt(trace + 1) * 2
q_w = 0.25 * S
q_x = (rotation_matrix[2, 1] - rotation_matrix[1, 2]) / S
q_y = (rotation_matrix[0, 2] - rotation_matrix[2, 0]) / S
q_z = (rotati... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def QuatNormalize(wxyz):\n return wxyz/rigmech.QuatMag(wxyz)",
"def test_to_quaternion(self):\r\n R = np.identity(3)\r\n q = to_quaternion(R)\r\n zero_vec = q - np.array([0., 0., 0., 1.])\r\n self.assertAlmostEqual(np.linalg.norm(zero_vec), 0.0)\r\n\r\n for _ in range(20... | [
"0.70941436",
"0.67724615",
"0.6759295",
"0.6717163",
"0.66108894",
"0.65064186",
"0.6497051",
"0.6457497",
"0.64169526",
"0.6393731",
"0.6358234",
"0.6288224",
"0.6270907",
"0.62546784",
"0.624714",
"0.62274504",
"0.61866",
"0.6186221",
"0.61497396",
"0.6128264",
"0.6104107"... | 0.6630981 | 4 |
Sets a default configuration. When the virtual environment is started, this particular file will set the current working folder to working. | def build_vsh_rc_file(venv_path: Path, working: Optional[Path] = None) -> Path:
default_working_path = Path('.')
working = Path(working or default_working_path)
vsh_venv_config_path = venv_path / '.vshrc'
if vsh_venv_config_path.parent.exists() and not vsh_venv_config_path.exists():
if working.e... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_working_dir(self, working_dir):\n self.config.working_dir = working_dir",
"def set_as_default (self):\n\t\ttry:\n\t\t\tself.config.set('Global', 'Default', self.currentAccount.data['name'])\n\t\texcept ConfigParser.NoSectionError:\n\t\t\tself.setup_config()\n\t\t\tself.config.set('Global', 'Defaul... | [
"0.68169796",
"0.6265813",
"0.62571836",
"0.61347866",
"0.611578",
"0.61082965",
"0.6078841",
"0.6076306",
"0.6027844",
"0.60247004",
"0.5952443",
"0.59522074",
"0.59355664",
"0.5878696",
"0.58270746",
"0.58032644",
"0.5782395",
"0.5781416",
"0.57521766",
"0.57472724",
"0.574... | 0.0 | -1 |
Find the virtual environment's home given a name | def get_venv_home(name: str, check: bool = True) -> Path:
default_path = WORKON_HOME
venv_path = default_path / name
if venv_path.exists() and venv_path.is_dir():
if validate_venv_path(venv_path, check=False):
return venv_path
elif not check:
return default_path / name
ra... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_home():\n from os.path import expanduser\n home = expanduser('~')\n return home",
"def get_home():\n try:\n return str(Path.home())\n except Exception:\n return None",
"def home(self):\r\n return self._get_system_properties(self.java)['java.home']",
"def get_home_dire... | [
"0.70891017",
"0.66260606",
"0.66134346",
"0.6608549",
"0.65427387",
"0.64552015",
"0.6453647",
"0.6453647",
"0.6448932",
"0.64067745",
"0.6359344",
"0.6345983",
"0.63434476",
"0.6340942",
"0.62819105",
"0.62361205",
"0.6139852",
"0.6134057",
"0.6128991",
"0.61283123",
"0.605... | 0.7837699 | 0 |
Yields successive nsized chunks from list l. | def chunks(l, n):
for i in range(0, len(l), n):
yield l[i:i + n] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _chunk(self, l, n):\n for i in range(0, len(l) + 1, n):\n yield l[i:i + n]",
"def __chunks(l, n):\n for i in range(0, len(l), n):\n yield l[i:i + n]",
"def chunks(self, l, n):\n for i in range(0, len(l), n):\n yield l[i:i + n]",
"def chunks(l: List, n... | [
"0.8091022",
"0.80558294",
"0.8029829",
"0.80087286",
"0.80087286",
"0.7998087",
"0.79811984",
"0.7979183",
"0.79523623",
"0.7930644",
"0.79263526",
"0.79203385",
"0.7919685",
"0.7895172",
"0.78709507",
"0.7861294",
"0.78601885",
"0.78601885",
"0.78495026",
"0.78495026",
"0.7... | 0.7683181 | 59 |
Get the client's current checkpoint path. | def parameters_path(self):
return self._parameters_path | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_checkpoint_path(self) -> str:\n return self._j_checkpoint_storage.getCheckpointPath().toString()",
"def get_checkpoint_path(self) -> Optional[str]:\n j_path = self._j_checkpoint_storage.getCheckpointPath()\n if j_path is None:\n return None\n else:\n retu... | [
"0.83439976",
"0.7880315",
"0.74984187",
"0.7048852",
"0.7048852",
"0.6918276",
"0.664389",
"0.6643401",
"0.6598706",
"0.65824974",
"0.65683943",
"0.65468436",
"0.6537101",
"0.6534688",
"0.6514019",
"0.6514019",
"0.6474292",
"0.64389503",
"0.6417826",
"0.6398314",
"0.63928634... | 0.0 | -1 |
The name of the container. | def name(self):
if self.attrs.get('Name') is not None:
return self.attrs['Name'].lstrip('/') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def container_name(self):\n pass",
"def name(self):\n return self.container['name']",
"def name(self):\n return self.container['name']",
"def container_name(self):\n prefix = get_service_prefix('core' if self.core else 'service')\n return f'{prefix}{self.data.get(\"name\")}... | [
"0.92216957",
"0.88455856",
"0.88455856",
"0.8618732",
"0.8604849",
"0.8086757",
"0.79523337",
"0.79477066",
"0.7908924",
"0.7779647",
"0.76539487",
"0.7357809",
"0.7344682",
"0.72817564",
"0.7278691",
"0.7243555",
"0.7129058",
"0.7106226",
"0.7091343",
"0.7080309",
"0.702491... | 0.0 | -1 |
The labels of a container as dictionary. | def labels(self):
try:
result = self.attrs['Config'].get('Labels')
return result or {}
except KeyError as ke:
raise DockerException(
'Label data is not available for sparse objects. Call reload()'
' to retrieve all information'
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def labels(self) -> dict:\n raise NotImplementedError",
"def labels(self) -> Dict[str, str]:\n return self.attrs.get(\"Labels\", {})",
"def get_labels(self):\n labels = {}\n for i in self.binaries:\n labels[i] = self.binaries[i].label\n return labels",
"def label... | [
"0.780758",
"0.742867",
"0.7408957",
"0.7318713",
"0.7318713",
"0.7318713",
"0.7318713",
"0.7318713",
"0.7318713",
"0.7318713",
"0.7318713",
"0.7274508",
"0.72514963",
"0.7187577",
"0.71760464",
"0.71760464",
"0.71760464",
"0.71760464",
"0.71760464",
"0.70392346",
"0.70392346... | 0.7729328 | 1 |
The status of the container. For example, ``running``, or ``exited``. | def status(self):
if isinstance(self.attrs['State'], dict):
return self.attrs['State']['Status']
return self.attrs['State'] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def container_status(self) -> str:\n return pulumi.get(self, \"container_status\")",
"def container_status(self):\n if self.status == 'complete':\n return 'complete'\n try:\n task_status = self._ecs.describe_tasks(tasks=[self.name])['tasks'][0]['lastStatus']\n ... | [
"0.8564961",
"0.83400476",
"0.7631056",
"0.75022566",
"0.7377854",
"0.7377854",
"0.7377854",
"0.7253034",
"0.7253034",
"0.7253034",
"0.7253034",
"0.7253034",
"0.7253034",
"0.7253034",
"0.7253034",
"0.7253034",
"0.7253034",
"0.7253034",
"0.7253034",
"0.7253034",
"0.7253034",
... | 0.0 | -1 |
Update resource configuration of the containers. | def update(self, **kwargs):
return self.client.api.update_container(self.id, **kwargs) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pre_config_root_update(self, resource_id, resource_dict):\n pass",
"def post_config_root_update(self, resource_id, resource_dict):\n pass",
"def conf_update(self):\n pass",
"def _update(self, **kwargs):\n\n resource_name = self._get_resource_name(**kwargs)\n config = mi... | [
"0.61856455",
"0.6115363",
"0.6066538",
"0.6062876",
"0.60297996",
"0.5939574",
"0.5873353",
"0.5801175",
"0.5783469",
"0.57733077",
"0.5754558",
"0.5754455",
"0.569707",
"0.56918",
"0.5688297",
"0.56770176",
"0.5663567",
"0.56440246",
"0.56249994",
"0.56142163",
"0.55978334"... | 0.5705231 | 12 |
given a column of a dataframe, return a mask that is within sigma standard deviations of the mean. | def return_in_norm_df(df, col, sigma):
return np.abs(df[col] - df[col].mean()) <= (sigma*df[col].std()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove(df,column_to_filter,standard_deviations=3):\n import math\n #This function will flatten the row of the dataframe\n def flatten_column(row):\n return tuple(float(x) for x in row)\n stats = df.select(column_to_filter).rdd.flatM... | [
"0.6529321",
"0.646682",
"0.6448254",
"0.64123166",
"0.6312094",
"0.62070864",
"0.62050796",
"0.61857235",
"0.61750066",
"0.6127742",
"0.60509825",
"0.6017544",
"0.59766626",
"0.5941671",
"0.59408015",
"0.5926436",
"0.58585894",
"0.5840135",
"0.58331716",
"0.582442",
"0.58081... | 0.761988 | 0 |
Creates an empty BST. | def __init__(self, klass = BSTNode):
self.root = None
self.klass = klass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_tree_initiates_with_empty_root(empty_t):\n assert not empty_t.root",
"def bst_empty():\n from bbst import Bst\n return Bst()",
"def test_minimal_tree_creation():\n t = Tree(None)\n\n assert t.data is None\n assert t.parent is None\n assert len(t) == 0",
"def test_bst_empty_root(... | [
"0.70602566",
"0.6958333",
"0.68262285",
"0.67778015",
"0.6762079",
"0.67208856",
"0.67128533",
"0.6704554",
"0.665453",
"0.6582652",
"0.65667844",
"0.64836526",
"0.6395055",
"0.63614243",
"0.6323684",
"0.6317293",
"0.63156307",
"0.62981504",
"0.62758696",
"0.6275478",
"0.623... | 0.5738825 | 59 |
Returns the minimum node of this BST. | def find_min(self):
return self.root and self.root.find_min() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def min(self) -> \"Node\":\n current = self\n while current.left is not None:\n current = current.left\n return current",
"def min(self):\n node = self\n while node.left:\n node = node.left\n return node",
"def find_min(self) -> TreeNode:\n ... | [
"0.8509369",
"0.84832597",
"0.8263885",
"0.8235196",
"0.8184727",
"0.81642365",
"0.81024826",
"0.8069174",
"0.80435604",
"0.7987031",
"0.79868895",
"0.79853374",
"0.77736586",
"0.7750137",
"0.7741798",
"0.7657022",
"0.7654045",
"0.7539011",
"0.7517675",
"0.7470479",
"0.746214... | 0.7494684 | 19 |
Returns the maximum node of this BST. | def find_max(self):
return self.root and self.root.find_max() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def max_node(self):\n node = self.root\n while node.right is not None:\n node = node.right\n return _BSTNode(node.item)",
"def max(self) -> \"Node\":\n current = self\n while current.right is not None:\n current = current.right\n return current",
... | [
"0.8947528",
"0.84509754",
"0.8338327",
"0.83364254",
"0.81613714",
"0.81511897",
"0.807402",
"0.80721754",
"0.8058897",
"0.79522574",
"0.7934394",
"0.788328",
"0.782195",
"0.7806477",
"0.77526927",
"0.77124196",
"0.76119256",
"0.7483608",
"0.7477805",
"0.74405944",
"0.741942... | 0.74488384 | 19 |
Creates a presigned url for a given object | def create_presigned_url(bucket_name, object_name):
logger = logging.getLogger("SimpleReplayLogger")
s3_client = boto3.client('s3')
try:
response = s3_client.generate_presigned_url('get_object',
Params={'Bucket': bucket_name,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_presigned_url_expanded(objName):\n\n # Generate a presigned URL for the S3 client method\n s3_client = boto3.client('s3')\n try:\n response = s3_client.generate_presigned_url('get_object',\n Params={\n 'Bucket': 'ece1779-a... | [
"0.8133364",
"0.7896384",
"0.78949344",
"0.7881676",
"0.78457487",
"0.7782997",
"0.7780152",
"0.76282597",
"0.7404997",
"0.7400151",
"0.7047331",
"0.6986753",
"0.69856906",
"0.69577414",
"0.69121957",
"0.6897982",
"0.6897982",
"0.6897982",
"0.6897982",
"0.6897982",
"0.6897982... | 0.8054777 | 1 |
Gets the autocreate of this SnapshotSettingsSettings. True if the scheduled snapshot creation services is on. | def autocreate(self):
return self._autocreate | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def auto_create(self):\n return getattr(self, '_auto_create', False)",
"def automatic_snapshot_policy_enabled(self) -> pulumi.Output[Optional[bool]]:\n return pulumi.get(self, \"automatic_snapshot_policy_enabled\")",
"def automatic_snapshot_policy_enabled(self) -> Optional[pulumi.Input[bool]]:\n ... | [
"0.68548703",
"0.6820604",
"0.6812554",
"0.6757943",
"0.6326043",
"0.5969421",
"0.59252423",
"0.5905299",
"0.586716",
"0.5796094",
"0.574269",
"0.574269",
"0.574269",
"0.574269",
"0.574269",
"0.5739553",
"0.5728946",
"0.5719828",
"0.5696591",
"0.5693896",
"0.5600382",
"0.55... | 0.6932295 | 0 |
Gets the autodelete of this SnapshotSettingsSettings. True if the scheduled snapshot deletion services is on. | def autodelete(self):
return self._autodelete | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def auto_backup_settings(self) -> Optional['outputs.AutoBackupSettingsResponse']:\n return pulumi.get(self, \"auto_backup_settings\")",
"def automatic_snapshot_policy_enabled(self) -> pulumi.Output[Optional[bool]]:\n return pulumi.get(self, \"automatic_snapshot_policy_enabled\")",
"def automatic_... | [
"0.6317385",
"0.62089443",
"0.6126594",
"0.60818064",
"0.60248786",
"0.599229",
"0.5964224",
"0.59103674",
"0.5861538",
"0.58186275",
"0.5806621",
"0.5806621",
"0.5806621",
"0.5806621",
"0.5806621",
"0.5806621",
"0.5806621",
"0.5806621",
"0.57900923",
"0.57770497",
"0.5745432... | 0.59974027 | 5 |
Gets the global_visible_accessible of this SnapshotSettingsSettings. Global switch for other accessible and visible settings. | def global_visible_accessible(self):
return self._global_visible_accessible | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def global_visible_accessible(self, global_visible_accessible):\n \n self._global_visible_accessible = global_visible_accessible",
"def get_visible(self):\n return self._visible",
"def settings_access_level(self):\n return self._settings_access_level",
"def publicly_accessible(sel... | [
"0.73233014",
"0.6391534",
"0.6216303",
"0.62108564",
"0.62108564",
"0.62059635",
"0.6050767",
"0.6050767",
"0.59710634",
"0.59321105",
"0.59185183",
"0.5899473",
"0.5841545",
"0.58000904",
"0.5734658",
"0.5734658",
"0.57226336",
"0.5707068",
"0.57009524",
"0.5688687",
"0.566... | 0.8315933 | 0 |
Sets the global_visible_accessible of this SnapshotSettingsSettings. Global switch for other accessible and visible settings. | def global_visible_accessible(self, global_visible_accessible):
self._global_visible_accessible = global_visible_accessible | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def global_visible_accessible(self):\n return self._global_visible_accessible",
"def set_visible(self, is_visible):\n self._data['is_visible'] = 1 if is_visible else 0",
"def local_subdir_accessible(self, local_subdir_accessible):\n \n self._local_subdir_accessible = local_subdir_ac... | [
"0.72627556",
"0.6093525",
"0.58225685",
"0.5797308",
"0.5777964",
"0.57682264",
"0.57365865",
"0.5728755",
"0.56412536",
"0.5570574",
"0.5570574",
"0.5548593",
"0.5548593",
"0.5480559",
"0.5480559",
"0.5480559",
"0.53813386",
"0.52961475",
"0.5279266",
"0.5212252",
"0.521225... | 0.86251587 | 0 |
Gets the local_root_visible of this SnapshotSettingsSettings. True if root .snapshot directory is visible locally. | def local_root_visible(self):
return self._local_root_visible | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def nfs_root_visible(self):\n return self._nfs_root_visible",
"def local_root_visible(self, local_root_visible):\n \n self._local_root_visible = local_root_visible",
"def local_root_accessible(self):\n return self._local_root_accessible",
"def smb_root_visible(self):\n retu... | [
"0.7550526",
"0.7334119",
"0.72666454",
"0.7250183",
"0.6817636",
"0.6564266",
"0.65412456",
"0.6453651",
"0.63591343",
"0.62454104",
"0.61697316",
"0.6169289",
"0.6069978",
"0.6069978",
"0.5989373",
"0.59118474",
"0.5860254",
"0.58176404",
"0.58176404",
"0.5657198",
"0.56274... | 0.82108134 | 0 |
Gets the nfs_root_accessible of this SnapshotSettingsSettings. True if root .snapshot directory is accessible over NFS. | def nfs_root_accessible(self):
return self._nfs_root_accessible | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def nfs_root_visible(self):\n return self._nfs_root_visible",
"def nfs_subdir_accessible(self):\n return self._nfs_subdir_accessible",
"def smb_root_accessible(self):\n return self._smb_root_accessible",
"def nfs_root_accessible(self, nfs_root_accessible):\n \n self._nfs_ro... | [
"0.79957926",
"0.7781366",
"0.7698087",
"0.75820404",
"0.7135392",
"0.7123282",
"0.7123282",
"0.70617765",
"0.6910649",
"0.6754767",
"0.67291677",
"0.6672455",
"0.65811497",
"0.64857024",
"0.64857024",
"0.6453113",
"0.63925326",
"0.63893765",
"0.63854194",
"0.6383052",
"0.636... | 0.87439877 | 0 |
Gets the nfs_root_visible of this SnapshotSettingsSettings. True if root .snapshot directory is visible over NFS. | def nfs_root_visible(self):
return self._nfs_root_visible | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def nfs_root_visible(self, nfs_root_visible):\n \n self._nfs_root_visible = nfs_root_visible",
"def nfs_root_accessible(self):\n return self._nfs_root_accessible",
"def smb_root_visible(self):\n return self._smb_root_visible",
"def local_root_visible(self):\n return self._l... | [
"0.80529743",
"0.79163355",
"0.75681573",
"0.6969396",
"0.6957864",
"0.6917045",
"0.68331367",
"0.67483264",
"0.65629494",
"0.65114605",
"0.64498776",
"0.63432646",
"0.63432646",
"0.63102293",
"0.6302742",
"0.6179843",
"0.6179843",
"0.6141143",
"0.612054",
"0.6045957",
"0.591... | 0.87028396 | 0 |
Gets the reserve of this SnapshotSettingsSettings. Percentage of space to reserve for snapshots. | def reserve(self):
return self._reserve | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def default_shrinkage_percent(self):\n return self._default_shrinkage_percent",
"def reserved_disk_space_in_bytes(self):\n try:\n return int(environment.get(\"ReservedDiskSpaceInBytes\"))\n except KeyError:\n return maxsize",
"def capacity_gb(self) -> str:\n re... | [
"0.6779799",
"0.647023",
"0.6418634",
"0.64063793",
"0.63367045",
"0.6277255",
"0.6277255",
"0.62505853",
"0.61909235",
"0.61844647",
"0.6139131",
"0.6125425",
"0.6084337",
"0.6074425",
"0.60646594",
"0.6034418",
"0.6024642",
"0.6019112",
"0.6007418",
"0.5990836",
"0.5979193"... | 0.6461933 | 2 |
Gets the smb_root_visible of this SnapshotSettingsSettings. True if root .snapshot directory is visible over SMB. | def smb_root_visible(self):
return self._smb_root_visible | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def smb_root_visible(self, smb_root_visible):\n \n self._smb_root_visible = smb_root_visible",
"def smb_root_accessible(self):\n return self._smb_root_accessible",
"def nfs_root_visible(self):\n return self._nfs_root_visible",
"def nfs_root_visible(self, nfs_root_visible):\n ... | [
"0.7889886",
"0.7754541",
"0.7555248",
"0.69516695",
"0.683824",
"0.6709852",
"0.65274245",
"0.64537853",
"0.63816893",
"0.616154",
"0.60944366",
"0.59254783",
"0.57528687",
"0.5752006",
"0.5551035",
"0.54820764",
"0.54820764",
"0.5458311",
"0.5444471",
"0.5439391",
"0.543939... | 0.8683047 | 0 |
Returns true if both objects are equal | def __eq__(self, other):
return self.__dict__ == other.__dict__ | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self, other):\n return are_equal(self, other)",
"def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False",
"def __eq__(self, other):\n if i... | [
"0.8088132",
"0.8088132",
"0.8054589",
"0.7982687",
"0.7961088",
"0.7961088",
"0.79433626",
"0.79303336",
"0.7926563",
"0.7897525",
"0.78826123",
"0.78826123",
"0.78806067",
"0.7872423",
"0.7868354",
"0.78668815",
"0.7825702",
"0.7819993",
"0.78162885",
"0.78078854",
"0.78068... | 0.79670393 | 17 |
Returns true if both objects are not equal | def __ne__(self, other):
return not self == other | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True",
"def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)",
"def __ne__(self, other) -> bool:\n return not self.__eq__(other)",
"def __eq__(self, other):\n ... | [
"0.845611",
"0.8391477",
"0.8144138",
"0.81410587",
"0.8132492",
"0.8093973",
"0.80920255",
"0.80920255",
"0.80920255",
"0.8085325",
"0.8085325",
"0.8076365",
"0.8076365",
"0.8065748"
] | 0.0 | -1 |
Getter method for lsp_frr_operational_status, mapped from YANG variable /brocade_mpls_rpc/show_mpls_lsp_debug/output/lsp/show_mpls_lsp_debug_info/show_mpls_lsp_frr_info/lsp_frr_operational_status (boolean) | def _get_lsp_frr_operational_status(self):
return self.__lsp_frr_operational_status | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _set_lsp_frr_operational_status(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name=\"lsp-frr-operational-status\", rest_name=\"lsp-frr-operational-status\", parent=self, path_helper=self._path_helper, extmethod... | [
"0.8498107",
"0.7676635",
"0.74360764",
"0.5422875",
"0.53675455",
"0.49265936",
"0.49097443",
"0.48572877",
"0.48151895",
"0.47818178",
"0.4767337",
"0.46822006",
"0.46185654",
"0.46044973",
"0.45558935",
"0.44708818",
"0.44708818",
"0.44606328",
"0.44508922",
"0.44312063",
... | 0.7668752 | 2 |
Setter method for lsp_frr_operational_status, mapped from YANG variable /brocade_mpls_rpc/show_mpls_lsp_debug/output/lsp/show_mpls_lsp_debug_info/show_mpls_lsp_frr_info/lsp_frr_operational_status (boolean) | def _set_lsp_frr_operational_status(self, v, load=False):
if hasattr(v, "_utype"):
v = v._utype(v)
try:
t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="lsp-frr-operational-status", rest_name="lsp-frr-operational-status", parent=self, path_helper=self._path_helper, extmethods=self._extmeth... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _set_lsp_frr_operational_status_active(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name=\"lsp-frr-operational-status-active\", rest_name=\"lsp-frr-operational-status-active\", parent=self, path_helper=self._p... | [
"0.8045972",
"0.7257043",
"0.70318604",
"0.57810044",
"0.5279483",
"0.50738007",
"0.5040252",
"0.49470556",
"0.48776633",
"0.48071787",
"0.48071787",
"0.47252536",
"0.4723351",
"0.47117296",
"0.46775225",
"0.45377728",
"0.4516991",
"0.45093977",
"0.44773802",
"0.44383878",
"0... | 0.88611764 | 0 |
Getter method for lsp_frr_operational_status_active, mapped from YANG variable /brocade_mpls_rpc/show_mpls_lsp_debug/output/lsp/show_mpls_lsp_debug_info/show_mpls_lsp_frr_info/lsp_frr_operational_status_active (boolean) | def _get_lsp_frr_operational_status_active(self):
return self.__lsp_frr_operational_status_active | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _set_lsp_frr_operational_status_active(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name=\"lsp-frr-operational-status-active\", rest_name=\"lsp-frr-operational-status-active\", parent=self, path_helper=self._p... | [
"0.8416936",
"0.6897503",
"0.61164486",
"0.5546835",
"0.5546835",
"0.5546835",
"0.5546835",
"0.5188216",
"0.5168179",
"0.50761694",
"0.503891",
"0.503891",
"0.503891",
"0.503891",
"0.501985",
"0.49991342",
"0.49945784",
"0.49583793",
"0.4927082",
"0.491648",
"0.48928297",
"... | 0.7554115 | 1 |
Setter method for lsp_frr_operational_status_active, mapped from YANG variable /brocade_mpls_rpc/show_mpls_lsp_debug/output/lsp/show_mpls_lsp_debug_info/show_mpls_lsp_frr_info/lsp_frr_operational_status_active (boolean) | def _set_lsp_frr_operational_status_active(self, v, load=False):
if hasattr(v, "_utype"):
v = v._utype(v)
try:
t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="lsp-frr-operational-status-active", rest_name="lsp-frr-operational-status-active", parent=self, path_helper=self._path_helper, ext... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_lsp_frr_operational_status_active(self):\n return self.__lsp_frr_operational_status_active",
"def _set_lsp_frr_operational_status(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name=\"lsp-frr-operation... | [
"0.72224617",
"0.721218",
"0.5983443",
"0.5983443",
"0.5983443",
"0.5983443",
"0.58042693",
"0.5201623",
"0.51221216",
"0.50419927",
"0.50099546",
"0.49800402",
"0.4913411",
"0.49045172",
"0.4897388",
"0.4888953",
"0.48377252",
"0.48377252",
"0.48377252",
"0.48377252",
"0.482... | 0.8740736 | 0 |
Getter method for lsp_frr_computation_mode_default, mapped from YANG variable /brocade_mpls_rpc/show_mpls_lsp_debug/output/lsp/show_mpls_lsp_debug_info/show_mpls_lsp_frr_info/lsp_frr_computation_mode_default (boolean) | def _get_lsp_frr_computation_mode_default(self):
return self.__lsp_frr_computation_mode_default | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _set_lsp_frr_computation_mode_default(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name=\"lsp-frr-computation-mode-default\", rest_name=\"lsp-frr-computation-mode-default\", parent=self, path_helper=self._path... | [
"0.833185",
"0.77103645",
"0.76266336",
"0.6194933",
"0.6056341",
"0.57042193",
"0.56722873",
"0.5466951",
"0.5207193",
"0.51850915",
"0.5172301",
"0.503366",
"0.502661",
"0.5001143",
"0.49660853",
"0.4941556",
"0.4936867",
"0.48391122",
"0.48052403",
"0.48052403",
"0.4805240... | 0.8244342 | 1 |
Setter method for lsp_frr_computation_mode_default, mapped from YANG variable /brocade_mpls_rpc/show_mpls_lsp_debug/output/lsp/show_mpls_lsp_debug_info/show_mpls_lsp_frr_info/lsp_frr_computation_mode_default (boolean) | def _set_lsp_frr_computation_mode_default(self, v, load=False):
if hasattr(v, "_utype"):
v = v._utype(v)
try:
t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="lsp-frr-computation-mode-default", rest_name="lsp-frr-computation-mode-default", parent=self, path_helper=self._path_helper, extmet... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _set_lsp_frr_group_computation_mode_default(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name=\"lsp-frr-group-computation-mode-default\", rest_name=\"lsp-frr-group-computation-mode-default\", parent=self, path... | [
"0.79699135",
"0.79657465",
"0.7322391",
"0.5814956",
"0.5754385",
"0.56048536",
"0.5595537",
"0.54615647",
"0.5296846",
"0.51483524",
"0.50191766",
"0.5008154",
"0.49890527",
"0.49318716",
"0.4928059",
"0.48940605",
"0.48170868",
"0.47528708",
"0.47528708",
"0.47528708",
"0.... | 0.8620544 | 0 |
Getter method for lsp_frr_computation_mode_use_bypass_metric, mapped from YANG variable /brocade_mpls_rpc/show_mpls_lsp_debug/output/lsp/show_mpls_lsp_debug_info/show_mpls_lsp_frr_info/lsp_frr_computation_mode_use_bypass_metric (boolean) | def _get_lsp_frr_computation_mode_use_bypass_metric(self):
return self.__lsp_frr_computation_mode_use_bypass_metric | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _set_lsp_frr_computation_mode_use_bypass_metric(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name=\"lsp-frr-computation-mode-use-bypass-metric\", rest_name=\"lsp-frr-computation-mode-use-bypass-metric\", paren... | [
"0.8421086",
"0.73692024",
"0.71780527",
"0.5663312",
"0.5527433",
"0.5513476",
"0.522151",
"0.51770675",
"0.5152427",
"0.5099009",
"0.50935274",
"0.5036245",
"0.5010868",
"0.49719977",
"0.48607317",
"0.48512727",
"0.47221446",
"0.46794984",
"0.4561233",
"0.4551889",
"0.44881... | 0.817809 | 1 |
Setter method for lsp_frr_computation_mode_use_bypass_metric, mapped from YANG variable /brocade_mpls_rpc/show_mpls_lsp_debug/output/lsp/show_mpls_lsp_debug_info/show_mpls_lsp_frr_info/lsp_frr_computation_mode_use_bypass_metric (boolean) | def _set_lsp_frr_computation_mode_use_bypass_metric(self, v, load=False):
if hasattr(v, "_utype"):
v = v._utype(v)
try:
t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="lsp-frr-computation-mode-use-bypass-metric", rest_name="lsp-frr-computation-mode-use-bypass-metric", parent=self, path_he... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_lsp_frr_computation_mode_use_bypass_metric(self):\n return self.__lsp_frr_computation_mode_use_bypass_metric",
"def _set_lsp_frr_computation_mode_use_bypass_liberal(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=YANGBool, is_leaf=... | [
"0.786946",
"0.75013036",
"0.71013236",
"0.5662239",
"0.53369164",
"0.5303166",
"0.5265837",
"0.52658165",
"0.52469164",
"0.52063036",
"0.5082039",
"0.48661682",
"0.48262838",
"0.47925335",
"0.47847775",
"0.46692133",
"0.45712483",
"0.45159453",
"0.4511849",
"0.4324567",
"0.4... | 0.8709086 | 0 |
Getter method for lsp_frr_computation_mode_use_bypass_liberal, mapped from YANG variable /brocade_mpls_rpc/show_mpls_lsp_debug/output/lsp/show_mpls_lsp_debug_info/show_mpls_lsp_frr_info/lsp_frr_computation_mode_use_bypass_liberal (boolean) | def _get_lsp_frr_computation_mode_use_bypass_liberal(self):
return self.__lsp_frr_computation_mode_use_bypass_liberal | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _set_lsp_frr_computation_mode_use_bypass_liberal(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name=\"lsp-frr-computation-mode-use-bypass-liberal\", rest_name=\"lsp-frr-computation-mode-use-bypass-liberal\", pa... | [
"0.8444676",
"0.73223305",
"0.71187943",
"0.56874657",
"0.554775",
"0.53518724",
"0.52789646",
"0.52671033",
"0.5231746",
"0.5210059",
"0.5210059",
"0.5113111",
"0.5104706",
"0.5097664",
"0.49984983",
"0.47890183",
"0.47804356",
"0.47685212",
"0.47572",
"0.47547916",
"0.47516... | 0.81690013 | 1 |
Setter method for lsp_frr_computation_mode_use_bypass_liberal, mapped from YANG variable /brocade_mpls_rpc/show_mpls_lsp_debug/output/lsp/show_mpls_lsp_debug_info/show_mpls_lsp_frr_info/lsp_frr_computation_mode_use_bypass_liberal (boolean) | def _set_lsp_frr_computation_mode_use_bypass_liberal(self, v, load=False):
if hasattr(v, "_utype"):
v = v._utype(v)
try:
t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="lsp-frr-computation-mode-use-bypass-liberal", rest_name="lsp-frr-computation-mode-use-bypass-liberal", parent=self, path... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_lsp_frr_computation_mode_use_bypass_liberal(self):\n return self.__lsp_frr_computation_mode_use_bypass_liberal",
"def _set_lsp_frr_computation_mode_use_bypass_metric(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=YANGBool, is_leaf... | [
"0.78244543",
"0.7381326",
"0.69610417",
"0.55567396",
"0.5451453",
"0.5429387",
"0.54214096",
"0.5183764",
"0.5162233",
"0.5162233",
"0.5155499",
"0.51400733",
"0.4974444",
"0.49353933",
"0.48834196",
"0.48519093",
"0.4711013",
"0.4682077",
"0.46022472",
"0.4585911",
"0.4531... | 0.87123185 | 0 |
Getter method for lsp_frr_group_computation_mode_default, mapped from YANG variable /brocade_mpls_rpc/show_mpls_lsp_debug/output/lsp/show_mpls_lsp_debug_info/show_mpls_lsp_frr_info/lsp_frr_group_computation_mode_default (boolean) | def _get_lsp_frr_group_computation_mode_default(self):
return self.__lsp_frr_group_computation_mode_default | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _set_lsp_frr_group_computation_mode_default(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name=\"lsp-frr-group-computation-mode-default\", rest_name=\"lsp-frr-group-computation-mode-default\", parent=self, path... | [
"0.8408623",
"0.73061806",
"0.7200117",
"0.59754246",
"0.5881016",
"0.5666329",
"0.5522771",
"0.5484264",
"0.53997904",
"0.5197693",
"0.5168068",
"0.5158492",
"0.5147999",
"0.51287967",
"0.5083416",
"0.5057835",
"0.49414384",
"0.49007297",
"0.4866831",
"0.48664802",
"0.484529... | 0.83433825 | 1 |
Setter method for lsp_frr_group_computation_mode_default, mapped from YANG variable /brocade_mpls_rpc/show_mpls_lsp_debug/output/lsp/show_mpls_lsp_debug_info/show_mpls_lsp_frr_info/lsp_frr_group_computation_mode_default (boolean) | def _set_lsp_frr_group_computation_mode_default(self, v, load=False):
if hasattr(v, "_utype"):
v = v._utype(v)
try:
t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="lsp-frr-group-computation-mode-default", rest_name="lsp-frr-group-computation-mode-default", parent=self, path_helper=self._p... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_lsp_frr_group_computation_mode_default(self):\n return self.__lsp_frr_group_computation_mode_default",
"def _set_lsp_frr_computation_mode_default(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name=\"l... | [
"0.8087759",
"0.7513533",
"0.69342583",
"0.60713184",
"0.55445033",
"0.5486604",
"0.53767556",
"0.53767014",
"0.53499734",
"0.5219036",
"0.517432",
"0.5070598",
"0.49805456",
"0.48994392",
"0.48762545",
"0.48702678",
"0.48534527",
"0.48325768",
"0.48190033",
"0.47832537",
"0.... | 0.86390257 | 0 |
Getter method for lsp_frr_group_computation_mode_high_cost, mapped from YANG variable /brocade_mpls_rpc/show_mpls_lsp_debug/output/lsp/show_mpls_lsp_debug_info/show_mpls_lsp_frr_info/lsp_frr_group_computation_mode_high_cost (boolean) | def _get_lsp_frr_group_computation_mode_high_cost(self):
return self.__lsp_frr_group_computation_mode_high_cost | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _set_lsp_frr_group_computation_mode_high_cost(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name=\"lsp-frr-group-computation-mode-high-cost\", rest_name=\"lsp-frr-group-computation-mode-high-cost\", parent=self... | [
"0.84958905",
"0.54302967",
"0.5303526",
"0.5282854",
"0.52003866",
"0.48794517",
"0.47448814",
"0.45863968",
"0.45299825",
"0.45209962",
"0.45026517",
"0.43915978",
"0.4361399",
"0.43533733",
"0.4328703",
"0.42000404",
"0.41276917",
"0.4114523",
"0.4091025",
"0.40161976",
"0... | 0.7927862 | 1 |
Setter method for lsp_frr_group_computation_mode_high_cost, mapped from YANG variable /brocade_mpls_rpc/show_mpls_lsp_debug/output/lsp/show_mpls_lsp_debug_info/show_mpls_lsp_frr_info/lsp_frr_group_computation_mode_high_cost (boolean) | def _set_lsp_frr_group_computation_mode_high_cost(self, v, load=False):
if hasattr(v, "_utype"):
v = v._utype(v)
try:
t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="lsp-frr-group-computation-mode-high-cost", rest_name="lsp-frr-group-computation-mode-high-cost", parent=self, path_helper=s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_lsp_frr_group_computation_mode_high_cost(self):\n return self.__lsp_frr_group_computation_mode_high_cost",
"def _set_lsp_frr_group_computation_mode_exclude_groups(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=YANGBool, is_leaf=Tr... | [
"0.763769",
"0.55701786",
"0.5393118",
"0.53823775",
"0.48337376",
"0.4718402",
"0.4685708",
"0.4622383",
"0.45911598",
"0.45901704",
"0.45084974",
"0.4477713",
"0.4457728",
"0.44359723",
"0.43803176",
"0.43554437",
"0.43497387",
"0.43405652",
"0.4306007",
"0.42653343",
"0.41... | 0.8803633 | 0 |
Getter method for lsp_frr_out_port_id, mapped from YANG variable /brocade_mpls_rpc/show_mpls_lsp_debug/output/lsp/show_mpls_lsp_debug_info/show_mpls_lsp_frr_info/lsp_frr_out_port_id (uint32) | def _get_lsp_frr_out_port_id(self):
return self.__lsp_frr_out_port_id | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _set_lsp_frr_out_port_id(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name=\"lsp-frr-out-port-id\", rest_name=\"lsp-frr-ou... | [
"0.8060126",
"0.7213684",
"0.61758494",
"0.5493662",
"0.54826766",
"0.52446413",
"0.5089768",
"0.49724028",
"0.4762452",
"0.46928233",
"0.46612367",
"0.4637832",
"0.46019322",
"0.45927185",
"0.4534815",
"0.4495653",
"0.44894823",
"0.4478873",
"0.4470162",
"0.44377908",
"0.436... | 0.8188975 | 0 |
Getter method for lsp_frr_out_port_name, mapped from YANG variable /brocade_mpls_rpc/show_mpls_lsp_debug/output/lsp/show_mpls_lsp_debug_info/show_mpls_lsp_frr_info/lsp_frr_out_port_name (string) | def _get_lsp_frr_out_port_name(self):
return self.__lsp_frr_out_port_name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _set_lsp_frr_out_port_name(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=unicode, is_leaf=True, yang_name=\"lsp-frr-out-port-name\", rest_name=\"lsp-frr-out-port-name\", parent=self, path_helper=self._path_helper, extmethods=self._extmetho... | [
"0.825265",
"0.67568994",
"0.59026265",
"0.5872321",
"0.5593632",
"0.5509018",
"0.5152026",
"0.49138808",
"0.4546442",
"0.45383704",
"0.45301354",
"0.44547713",
"0.44308347",
"0.4423732",
"0.43983978",
"0.43919075",
"0.43882924",
"0.4320715",
"0.43106923",
"0.4306564",
"0.429... | 0.8020042 | 1 |
Setter method for lsp_frr_out_port_name, mapped from YANG variable /brocade_mpls_rpc/show_mpls_lsp_debug/output/lsp/show_mpls_lsp_debug_info/show_mpls_lsp_frr_info/lsp_frr_out_port_name (string) | def _set_lsp_frr_out_port_name(self, v, load=False):
if hasattr(v, "_utype"):
v = v._utype(v)
try:
t = YANGDynClass(v,base=unicode, is_leaf=True, yang_name="lsp-frr-out-port-name", rest_name="lsp-frr-out-port-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_pa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_lsp_frr_out_port_name(self):\n return self.__lsp_frr_out_port_name",
"def _get_lsp_frr_out_port_id(self):\n return self.__lsp_frr_out_port_id",
"def _set_lsp_frr_out_port_id(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=Rest... | [
"0.7309954",
"0.59053165",
"0.5826135",
"0.56937194",
"0.54177153",
"0.50977695",
"0.5072177",
"0.46242598",
"0.44801003",
"0.44384998",
"0.43193644",
"0.42911607",
"0.42853948",
"0.42145792",
"0.42064926",
"0.4174126",
"0.415789",
"0.41449904",
"0.4132658",
"0.41277787",
"0.... | 0.87259257 | 0 |
Getter method for lsp_frr_out_label, mapped from YANG variable /brocade_mpls_rpc/show_mpls_lsp_debug/output/lsp/show_mpls_lsp_debug_info/show_mpls_lsp_frr_info/lsp_frr_out_label (uint32) | def _get_lsp_frr_out_label(self):
return self.__lsp_frr_out_label | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _set_lsp_frr_out_label(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name=\"lsp-frr-out-label\", rest_name=\"lsp-frr-out-la... | [
"0.8430194",
"0.6636042",
"0.63523793",
"0.5804583",
"0.5794215",
"0.56567335",
"0.5279543",
"0.52369773",
"0.52012557",
"0.5187867",
"0.50885725",
"0.50885725",
"0.50885725",
"0.5026363",
"0.50041324",
"0.49772698",
"0.4957494",
"0.48931822",
"0.4891966",
"0.48824438",
"0.48... | 0.81042296 | 1 |
Setter method for lsp_frr_out_label, mapped from YANG variable /brocade_mpls_rpc/show_mpls_lsp_debug/output/lsp/show_mpls_lsp_debug_info/show_mpls_lsp_frr_info/lsp_frr_out_label (uint32) | def _set_lsp_frr_out_label(self, v, load=False):
if hasattr(v, "_utype"):
v = v._utype(v)
try:
t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="lsp-frr-out-label", rest_name="lsp-frr-out-label", parent=s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_lsp_frr_out_label(self):\n return self.__lsp_frr_out_label",
"def _set_lsp_frr_out_port_name(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=unicode, is_leaf=True, yang_name=\"lsp-frr-out-port-name\", rest_name=\"lsp-frr-out-port-n... | [
"0.7756851",
"0.6256894",
"0.62404376",
"0.5963347",
"0.58918333",
"0.58890176",
"0.58543605",
"0.5472239",
"0.5132592",
"0.51272404",
"0.5103478",
"0.5095727",
"0.50810826",
"0.50810826",
"0.50810826",
"0.49854556",
"0.49787453",
"0.48616073",
"0.48536897",
"0.4834673",
"0.4... | 0.8944335 | 0 |
Getter method for lsp_frr_path_cost, mapped from YANG variable /brocade_mpls_rpc/show_mpls_lsp_debug/output/lsp/show_mpls_lsp_debug_info/show_mpls_lsp_frr_info/lsp_frr_path_cost (uint32) | def _get_lsp_frr_path_cost(self):
return self.__lsp_frr_path_cost | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _set_lsp_frr_path_cost(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name=\"lsp-frr-path-cost\", rest_name=\"lsp-frr-path-c... | [
"0.82808197",
"0.53748214",
"0.5291548",
"0.52082014",
"0.50592446",
"0.49295163",
"0.4926273",
"0.4910248",
"0.4900818",
"0.48614067",
"0.47314006",
"0.47306567",
"0.47288215",
"0.47219267",
"0.47084212",
"0.46946463",
"0.46746907",
"0.4671789",
"0.46595928",
"0.4658648",
"0... | 0.7950704 | 1 |
Setter method for lsp_frr_path_cost, mapped from YANG variable /brocade_mpls_rpc/show_mpls_lsp_debug/output/lsp/show_mpls_lsp_debug_info/show_mpls_lsp_frr_info/lsp_frr_path_cost (uint32) | def _set_lsp_frr_path_cost(self, v, load=False):
if hasattr(v, "_utype"):
v = v._utype(v)
try:
t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="lsp-frr-path-cost", rest_name="lsp-frr-path-cost", parent=s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_lsp_frr_path_cost(self):\n return self.__lsp_frr_path_cost",
"def _set_lsp_config_frr_bandwidth(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_... | [
"0.7644053",
"0.5234557",
"0.51590604",
"0.51442695",
"0.5020804",
"0.50028265",
"0.49565607",
"0.4902731",
"0.48919255",
"0.48756027",
"0.4853959",
"0.48231205",
"0.4818499",
"0.48169047",
"0.47755167",
"0.47518075",
"0.47471455",
"0.47323555",
"0.47197375",
"0.47197375",
"0... | 0.8914765 | 0 |
Setter method for lsp_frr_bypass_name, mapped from YANG variable /brocade_mpls_rpc/show_mpls_lsp_debug/output/lsp/show_mpls_lsp_debug_info/show_mpls_lsp_frr_info/lsp_frr_bypass_name (string) | def _set_lsp_frr_bypass_name(self, v, load=False):
if hasattr(v, "_utype"):
v = v._utype(v)
try:
t = YANGDynClass(v,base=unicode, is_leaf=True, yang_name="lsp-frr-bypass-name", rest_name="lsp-frr-bypass-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=Fa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_lsp_frr_bypass_name(self):\n return self.__lsp_frr_bypass_name",
"def _set_lsp_frr_out_port_name(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=unicode, is_leaf=True, yang_name=\"lsp-frr-out-port-name\", rest_name=\"lsp-frr-out-po... | [
"0.75423485",
"0.5495096",
"0.5308668",
"0.51544124",
"0.49758267",
"0.49455035",
"0.47803912",
"0.4704772",
"0.465567",
"0.4479998",
"0.44140083",
"0.43949056",
"0.43298855",
"0.43173307",
"0.4300515",
"0.4297839",
"0.4297839",
"0.4296389",
"0.42400116",
"0.4231549",
"0.4231... | 0.86159325 | 0 |
Set the type of the adversary. | def set_type(self, type):
self.type = type | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_type(self, type):\n self._type = type",
"def type(self, type):\n self._type = type",
"def type(self, type):\n self._type = type",
"def type(self, type):\n\n self._type = type",
"def type(self, type):\n\n self._type = type",
"def type(self, type):\n\n self... | [
"0.69634795",
"0.6946613",
"0.6946613",
"0.6905376",
"0.6905376",
"0.6905376",
"0.6905376",
"0.6905376",
"0.6905376",
"0.6905376",
"0.6905376",
"0.6905376",
"0.6905376",
"0.6905376",
"0.6905376",
"0.6905376",
"0.6905376",
"0.6905376",
"0.6905376",
"0.6905376",
"0.6905376",
... | 0.7004524 | 0 |
Find the distance between the adversary's current position and the given position. | def find_closest_move(self, position, valid_moves):
closest = None
closest_value = 100
for move in valid_moves:
if closest:
x_dist = abs(position[0] - move[0])
y_dist = abs(position[1] - move[1])
if x_dist + y_dist < closest_value:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def distance(self, position):\n s, r = self.local_coordinates(position)\n return abs(r) + max(s - self.length, 0) + max(0 - s, 0)",
"def __distance_to(self, other: Any) -> float:\n return np.linalg.norm(self.pos - other.pos)",
"def distance(self, x, y=None):\n if y is not None:\n ... | [
"0.75052387",
"0.71465576",
"0.7074604",
"0.7062924",
"0.70498145",
"0.6973399",
"0.6944214",
"0.6880944",
"0.6870445",
"0.68356645",
"0.6770722",
"0.6741884",
"0.668929",
"0.6679016",
"0.6676169",
"0.66436857",
"0.6636165",
"0.66320497",
"0.66320497",
"0.66013455",
"0.659267... | 0.0 | -1 |
Wrapper method to create a runtime in the compute backend. | def create_runtime(self, runtime_name, memory, timeout):
return self.compute_handler.create_runtime(runtime_name, memory, timeout=timeout) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create(name, storage, backend, memory, timeout, config, debug):\n setup_lithops_logger(logging.DEBUG)\n\n verify_runtime_name(name)\n\n if config:\n config = load_yaml_config(config)\n\n config_ow = set_config_ow(backend, storage, runtime_name=name)\n config = default_config(config, confi... | [
"0.76685816",
"0.6925544",
"0.6432553",
"0.6322498",
"0.6305715",
"0.62811774",
"0.6155663",
"0.6074748",
"0.6074748",
"0.6074748",
"0.6045173",
"0.5885198",
"0.5872612",
"0.5827959",
"0.58271515",
"0.58019996",
"0.56320137",
"0.56280375",
"0.5589323",
"0.55725235",
"0.556718... | 0.8130651 | 0 |
Resets train and val histories for the accuracy and the loss. | def _reset_histories(self):
self.train_loss_history = []
self.train_acc_history = []
self.val_acc_history = []
self.val_loss_history = [] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _reset_histories(self):\n self.train_loss_history = []\n self.train_pos_dist_history = []\n self.train_neg_dist_history = []\n self.val_loss_history = []\n self.val_pos_dist_history = []\n self.val_neg_dist_history = []",
"def reset(self):\n self.train_loss.re... | [
"0.7950219",
"0.782383",
"0.7684415",
"0.7474537",
"0.73821455",
"0.73101485",
"0.71947074",
"0.7148814",
"0.7143879",
"0.7109996",
"0.70746017",
"0.694015",
"0.67946887",
"0.66489136",
"0.6634541",
"0.66319555",
"0.6560625",
"0.65465486",
"0.65204406",
"0.65204406",
"0.65179... | 0.8239719 | 0 |
Determine if two strings are IRC equal. | def irc_equal(self, lhs: str, rhs: str) -> bool:
if self.isupport.case_mapping == 'rfc1459':
def to_lower(value: str) -> str:
return (
value.lower().replace('[', '{').replace(']', '}').replace('\\', '|')
)
elif self.isupport.case_mapping... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def isEqual(string1, string2):\n return (True)",
"def test_strings_are_equal(self):\n string1 = 'this is the first string'\n string2 = 'this is the first string' # ==, !is\n string3 = 'this is the second string'\n self.assertEqual(True, comparator.strings_are_equal(string1, string2))... | [
"0.7279714",
"0.697563",
"0.69357264",
"0.6869924",
"0.66758",
"0.6645487",
"0.66199315",
"0.6604372",
"0.6563363",
"0.64631534",
"0.6456967",
"0.6437041",
"0.6385206",
"0.636128",
"0.6357843",
"0.63057494",
"0.629091",
"0.62702054",
"0.6236028",
"0.62171525",
"0.6213919",
... | 0.7523323 | 0 |
Check if a given Pandas Series has the properties of a TokenSeries. | def check_type(s: pd.Series) -> Tuple[bool, str]:
error_string = (
"should be TokenSeries: there are non-token cells (every cell should be a list of words/tokens) in the given Series."
" See help(hero.HeroTypes) for more information."
)
def is_list_of_strings(cell):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_series(s: pd.Series) -> bool:\n\n error_string = (\n \"There are non-token cells (every cell should be a list of words/tokens) in the given Series.\"\n \" See help(hero.HeroSeries) for more information.\"\n )\n\n def is_list_of_strings(cell):\n return... | [
"0.70799375",
"0.6585459",
"0.6217491",
"0.61690974",
"0.58898103",
"0.57296133",
"0.55298156",
"0.5490258",
"0.5399716",
"0.5363592",
"0.53476226",
"0.534685",
"0.53361505",
"0.5318767",
"0.5305161",
"0.5261447",
"0.52152485",
"0.5205616",
"0.5194034",
"0.5186024",
"0.510331... | 0.653638 | 2 |
Check if a given Pandas Series has the properties of a DataFrame. | def check_type(df: pd.DataFrame, input_output="") -> Tuple[bool, str]:
error_string = (
"should be DataFrame: The input should be a Pandas DataFrame"
" representing a matrix, where every cell is one entry of the matrix."
" See help(hero.HeroTypes) for more information."
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_series_like(self):\n return len(self.columns) == 1 or len(self.index) == 1",
"def check_is_pandas_dataframe(dataframe):\n # type: (Any) -> Optional[bool]\n try:\n from pandas.core.dtypes.generic import ABCDataFrame, ABCSeries\n except ImportError:\n return None\n\n return ... | [
"0.7074782",
"0.65758455",
"0.6449873",
"0.64228785",
"0.63512003",
"0.63345706",
"0.60993123",
"0.608867",
"0.60358685",
"0.6004448",
"0.5972204",
"0.59635645",
"0.5946576",
"0.5931452",
"0.5882925",
"0.58438444",
"0.5843588",
"0.5838913",
"0.57885617",
"0.5779996",
"0.56955... | 0.49925673 | 86 |
Creates a classification model. | def create_model(self, bert_config, is_training, input_ids, input_mask, segment_ids,
params, 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_i... | {
"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 |
Extract an organization ID from an input value. Raises InvalidOrganizationError | def get_organization_id(thing: object) -> t.OrganizationId:
if isinstance(thing, int):
return t.OrganizationId(thing)
try:
int_id = int(thing) # type: ignore
return t.OrganizationId(int_id)
except ValueError:
raise err.InvalidOrganizationError(id=str(thing)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def organization_id(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"organization_id\")",
"def organization_id(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"organization_id\")",
"def organization_id(self) -> pulumi.Output[Optional[str]]:\n return pulumi... | [
"0.76138717",
"0.76138717",
"0.7289276",
"0.72138625",
"0.69010395",
"0.68724054",
"0.67857325",
"0.66817015",
"0.6512641",
"0.6458772",
"0.6266288",
"0.6177749",
"0.59938073",
"0.59806913",
"0.59806913",
"0.5966473",
"0.59614027",
"0.5941713",
"0.5941713",
"0.5774257",
"0.56... | 0.76049715 | 2 |
Normalizes a relationship name to uppersnakecase. If the relationship name has a UUID suffix added by the Python client or frontend, it is removed. This also helps dealing with the Neo4j relationship type limitation of max of 65K unique names. Examples ""belongs_to_478e215d04ec4cdfac8bd5289601c9f7" > "BELONGS_TO" | def normalize_relationship_type(relationship_name: str) -> str:
from .validate import validate_relationship_name
validate_relationship_name(relationship_name)
if (
len(relationship_name) > UUID_LENGTH + 1
and relationship_name[-(UUID_LENGTH + 1)] == "_"
and dt.is_uuid(relationship_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def normalize_reference_name(name):\n return name.strip().lower().replace(\"-\", \"_\").replace(\" \", \"_\")",
"def __normalize_name(self):\n self.normalized_name = normalizeSimplified(self.name)",
"def parse_name(relation):\n if relation.player:\n char_ob = relation.player... | [
"0.63656074",
"0.62784606",
"0.59990644",
"0.59584576",
"0.59584576",
"0.59584576",
"0.59031624",
"0.57300735",
"0.5724332",
"0.5715773",
"0.5713228",
"0.5623639",
"0.5618417",
"0.55456877",
"0.5526373",
"0.55219907",
"0.54969084",
"0.54554844",
"0.5450181",
"0.54423255",
"0.... | 0.7213146 | 0 |
Return the current time as an ISO string | def nowISO():
return dt2ISO(datetime.datetime.utcnow()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def time():\n return datetime.datetime.now().strftime(\"%Y%m%dT%H%M%SZ\")",
"def _get_current_time() -> str:\n return datetime.now().strftime(\"%FT%H:%M:%S\")",
"def iso_date(self, t=None):\n if t is None:\n t = time.time()\n time_str = time.strftime(\"%Y-%m-%d %H:%M:%S\", time.l... | [
"0.80495965",
"0.78701484",
"0.7869489",
"0.78108025",
"0.7763122",
"0.7709384",
"0.77070624",
"0.7699892",
"0.7673071",
"0.76481676",
"0.75936645",
"0.75756514",
"0.7562056",
"0.75547695",
"0.75194114",
"0.75014937",
"0.75014937",
"0.7501047",
"0.7490358",
"0.74158496",
"0.7... | 0.7253964 | 31 |
Sets the VirusTotal API key to use in queries. | def SetAPIKey(self, api_key):
self._api_key = api_key | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def SetAPIKey(self, api_key):\n self._analyzer.SetAPIKey(api_key)",
"async def statset_apikey(self, key):\n self._set_api_key(key)\n await self.bot.say(\"API key successfully set.\")",
"def set_api_key(self, api_key):\n self.api_key = api_key\n self.session.auth = (\"api\", api_k... | [
"0.73122805",
"0.69164264",
"0.67768466",
"0.6775872",
"0.6627222",
"0.6482781",
"0.64259386",
"0.64079666",
"0.6364827",
"0.6294712",
"0.6281828",
"0.62537545",
"0.62132925",
"0.6186385",
"0.6142684",
"0.6119794",
"0.6116934",
"0.6003748",
"0.5963819",
"0.59464085",
"0.59115... | 0.71383744 | 2 |
Sets the VirusTotal API key to use in queries. | def SetAPIKey(self, api_key):
self._analyzer.SetAPIKey(api_key) | {
"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",
"async def statset_apikey(self, key):\n self._set_api_key(key)\n await self.bot.say(\"API key successfully set.\")",
"def set_api_key(self, api_key):\n self.api_key ... | [
"0.71383744",
"0.71383744",
"0.69164264",
"0.67768466",
"0.6775872",
"0.6627222",
"0.6482781",
"0.64259386",
"0.64079666",
"0.6364827",
"0.6294712",
"0.6281828",
"0.62537545",
"0.62132925",
"0.6186385",
"0.6142684",
"0.6119794",
"0.6116934",
"0.6003748",
"0.5963819",
"0.59464... | 0.73122805 | 0 |
Make list unique without using list(set(li)) idiom. | def _naive_unique(li):
tmp = []
for el in li:
if el not in tmp:
tmp.append(el)
return tmp | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _unique(li):\n return list(set(li))",
"def unique(li):\r\n seen = set()\r\n seen_add = seen.add\r\n return [x for x in li if not (x in seen or seen_add(x))]",
"def makeUnique(list):\n\tu = []\n\tfor l in list:\n\t\tif not l in u:\n\t\t\tu.append(l)\n\treturn u",
"def unique(lis):\n seen = ... | [
"0.8877596",
"0.858165",
"0.8179308",
"0.81335074",
"0.7839028",
"0.77683103",
"0.761383",
"0.74214804",
"0.7405645",
"0.74013895",
"0.7367397",
"0.7365076",
"0.7311826",
"0.73105276",
"0.7310121",
"0.72981596",
"0.7273902",
"0.721161",
"0.71618146",
"0.7156488",
"0.71417326"... | 0.84879524 | 2 |
Make list unique using list(set(li)) idiom. | def _unique(li):
return list(set(li)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def unique(li):\r\n seen = set()\r\n seen_add = seen.add\r\n return [x for x in li if not (x in seen or seen_add(x))]",
"def unique(lis):\n seen = set()\n ret = []\n for elm in lis:\n if elm not in seen:\n ret.append(elm)\n seen.add(elm)\n return ret",
"def _na... | [
"0.8536485",
"0.8174413",
"0.8107641",
"0.79821414",
"0.76602095",
"0.7635499",
"0.76275605",
"0.7626155",
"0.7530617",
"0.7507084",
"0.74749917",
"0.74287266",
"0.7409983",
"0.7398692",
"0.7331278",
"0.72873414",
"0.7265963",
"0.72510695",
"0.72223705",
"0.7180487",
"0.71755... | 0.88549584 | 0 |
Merge arbitrarily nestes dictionaries. | def do_merge(d, other_d=None, mod_fn=None, merge_fn=None):
if other_d is None:
other_d = {}
if mod_fn:
mod_fn = GlobalFns(mod_fn)
new_d = {mod_fn(k): v for k, v in d.iteritems()}
else:
new_d = d.copy()
if not merge_fn:
merge_fn = 'take_other'
merge_values = ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def merge_dict_recursive(target, src):\r\n for k in src.keys():\r\n if ((k in target and isinstance(target[k], dict) and\r\n isinstance(src[k], collections.Mapping))):\r\n merge_dict_recursive(target[k], src[k])\r\n else:\r\n target[k] = src[... | [
"0.7473775",
"0.74476266",
"0.7332647",
"0.73287964",
"0.72551227",
"0.7150429",
"0.7083431",
"0.7082623",
"0.7039892",
"0.7013006",
"0.70076895",
"0.7005668",
"0.69691837",
"0.6962147",
"0.69565725",
"0.69210625",
"0.69076234",
"0.6896333",
"0.68899083",
"0.6877258",
"0.6876... | 0.0 | -1 |
r""" Instantiate a new generic operation. | def __init__(
self,
formula,
aliases,
reduction_op="Sum",
axis=0,
dtype=None,
opt_arg=None,
formula2=None,
cuda_type=None,
dtype_acc="auto",
use_double_acc=False,
sum_scheme="auto",
enable_chunks=True,
rec_mu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _create_operation(self,\n identifier,\n arguments=None,\n return_type=None,\n extended_attributes=None,\n node=None):\n if not return_type:\n return_type = self._create... | [
"0.6938975",
"0.69137293",
"0.6670255",
"0.66367525",
"0.65014374",
"0.6457849",
"0.6456855",
"0.634462",
"0.6328186",
"0.6299503",
"0.6255588",
"0.6223033",
"0.6192535",
"0.61916924",
"0.6139683",
"0.6129422",
"0.6118641",
"0.61090004",
"0.6104025",
"0.609852",
"0.60837704",... | 0.0 | -1 |
Get a tf.function for detection. | def get_model_detection_function(model):
@tf.function
def detect_fn(image):
"""Detect objects in image."""
# image= tf.convert_to_tensor(image, dtype=tf.float32)
image, shapes = model.preprocess(image)
prediction_dict = model.predict(image, shapes)
detections = model.postprocess(prediction_di... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_model_detection_function(model):\n\n @tf.function\n def detect_fn(image):\n \"\"\"Detect objects in image.\"\"\"\n\n image, shapes = model.preprocess(image)\n prediction_dict = model.predict(image, shapes)\n detections = model.postprocess(prediction_dict, shapes)\n\n ... | [
"0.71129197",
"0.7107963",
"0.71027005",
"0.6684678",
"0.65463984",
"0.65268725",
"0.6505286",
"0.63129324",
"0.61612254",
"0.6149816",
"0.6118471",
"0.60945255",
"0.6056584",
"0.6024163",
"0.5923366",
"0.5874666",
"0.57565945",
"0.57503176",
"0.5718735",
"0.5704753",
"0.5693... | 0.7112774 | 1 |
Constructor. Any message fields that are implicitly/explicitly set to None will be assigned a default value. The recommend use is keyword arguments as this is more robust to future message changes. You cannot mix inorder arguments and keyword arguments. | def __init__(self, *args, **kwds):
if args or kwds:
super(ModifyParametersRequest, self).__init__(*args, **kwds)
#message fields cannot be None, assign default values for those that are
if self.major_ax is None:
self.major_ax = 0.
if self.minor_ax is None:
self.minor_ax = 0.
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, *args, **kwds):\n if args or kwds:\n super(KomodoSpeechRecCommand, self).__init__(*args, **kwds)\n #message fields cannot be None, assign default values for those that are\n if self.header is None:\n self.header = std_msgs.msg.Header()\n if self.cmd is None:\n ... | [
"0.77939296",
"0.7720264",
"0.7720264",
"0.76866186",
"0.7626193",
"0.756387",
"0.74395823",
"0.7416946",
"0.73519075",
"0.7308225",
"0.72806025",
"0.72379386",
"0.72272825",
"0.7224187",
"0.7224187",
"0.7218873",
"0.7211484",
"0.7211484",
"0.7211484",
"0.7211484",
"0.7211484... | 0.0 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.