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
Returns a point (x, y) which is the bottom, right corner of the rect.
def bottomright(self): return (self.right, self.bottom)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bottom_right(self):\n return Point(self.right, self.bottom)", "def bottomRightCorner(self):\n self._updateExtents()\n return (self._mMaxX,self._mMaxY)", "def _rect_right(self):\n\treturn max(self.x, self.x + self.w)", "def get_bottom_right(left, right):\n x = right.x - (right.x - ...
[ "0.80872005", "0.75730133", "0.7417118", "0.7338264", "0.71358335", "0.6994538", "0.6989666", "0.6989666", "0.69538146", "0.69322073", "0.68699884", "0.6857761", "0.6857761", "0.6796901", "0.64759564", "0.64113855", "0.6407288", "0.6404907", "0.63987374", "0.63869905", "0.636...
0.6800102
13
Returns the center y value of the rect
def centery(self): return self.top + self.height / 2
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_y_position(self): \n return self.rect.y", "def get_rect_center(rect):\n x, y, w, h = rect\n return x + w/2, y + h/2", "def get_center_scr(self):\r\n return self.rect.center", "def get_y(self):\n\t\treturn self._collision_rect.y + 25", "def center_vertical(self, re...
[ "0.79309195", "0.790699", "0.7538333", "0.7376696", "0.73427653", "0.7278063", "0.72104806", "0.71589947", "0.7077913", "0.7062193", "0.7004303", "0.6935875", "0.6909548", "0.6908068", "0.6899377", "0.68832314", "0.68832153", "0.68709064", "0.68518996", "0.6846448", "0.681041...
0.7078019
8
Returns a point (x, y) which is the midpoint of the top edge the rect.
def midtop(self): return (self.centerx, self.top)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def midpoint(self) -> Tuple[int, int]:\n minx, miny, maxx, maxy = self.substrates.bounds\n return ((minx + maxx) // 2, (miny + maxy) // 2)", "def getMidPoint(self):\n return p.Point((self.start.normalVector + self.end.normalVector)/2.0)", "def get_pos(self):\n return self.rect.midto...
[ "0.76500976", "0.7309252", "0.725163", "0.7170698", "0.7047169", "0.69002247", "0.6897029", "0.67588174", "0.6724638", "0.6661621", "0.6647386", "0.6606155", "0.6597936", "0.65815824", "0.6506547", "0.6495151", "0.64475024", "0.644593", "0.64286613", "0.6403866", "0.63949263"...
0.76629424
0
Returns a point (x, y) which is the midpoint of the left edge the rect.
def midleft(self): return (self.left, self.centery)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _rect_left(self):\n\treturn min(self.x, self.x + self.w)", "def getMidPoint(self):\n return p.Point((self.start.normalVector + self.end.normalVector)/2.0)", "def midpoint(self) -> Tuple[int, int]:\n minx, miny, maxx, maxy = self.substrates.bounds\n return ((minx + maxx) // 2, (miny + m...
[ "0.7517219", "0.7243575", "0.7218394", "0.70709705", "0.70709705", "0.68680346", "0.6736029", "0.67191774", "0.6678974", "0.66577965", "0.6645889", "0.65988135", "0.6579809", "0.65635693", "0.643486", "0.6433358", "0.6413653", "0.63680094", "0.6360517", "0.6358098", "0.635241...
0.76932055
0
Returns a point (x, y) which is the midpoint of the bottom edge the rect.
def midbottom(self): return (self.centerx, self.bottom)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def midpoint(self) -> Tuple[int, int]:\n minx, miny, maxx, maxy = self.substrates.bounds\n return ((minx + maxx) // 2, (miny + maxy) // 2)", "def _rect_bottom(self):\n\treturn min(self.y, self.y + self.h)", "def bottomLeftCorner(self):\n self._updateExtents()\n return (self._mMinX,s...
[ "0.7225014", "0.71007353", "0.70528626", "0.70367455", "0.70005757", "0.6998103", "0.6975342", "0.67965275", "0.67694247", "0.6701562", "0.6600726", "0.6600726", "0.65750843", "0.6566296", "0.6544031", "0.6484949", "0.6414438", "0.63706785", "0.6326723", "0.6299827", "0.62867...
0.80408055
0
Returns a point (x, y) which is the midpoint of the right edge of the rect.
def midright(self): return (self.right, self.centery)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def midpoint(self) -> Tuple[int, int]:\n minx, miny, maxx, maxy = self.substrates.bounds\n return ((minx + maxx) // 2, (miny + maxy) // 2)", "def _rect_right(self):\n\treturn max(self.x, self.x + self.w)", "def getMidPoint(self):\n return p.Point((self.start.normalVector + self.end.normalV...
[ "0.72387004", "0.7190304", "0.7009031", "0.6783551", "0.67242396", "0.66471845", "0.66471845", "0.661838", "0.6569062", "0.65528", "0.654266", "0.6511605", "0.6491345", "0.6409926", "0.64068615", "0.6339525", "0.63193333", "0.62984693", "0.6268774", "0.62637895", "0.6259858",...
0.75244766
0
Returns the width and height of the rect as a tuple (width, height)
def size(self): return (self.width, self.height)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def DoGetSize(self):\r\n\r\n return self._rect.width, self._rect.height", "def size(self) -> Tuple[int, int]:\n return (self.width, self.height)", "def get_size(self) -> Tuple2IntType:\n return self.get_width(), self.get_height()", "def size(self) -> Tuple[int, int]:\n return self...
[ "0.7676337", "0.7610363", "0.74962586", "0.7493948", "0.7468956", "0.746302", "0.744947", "0.7388945", "0.73840725", "0.73544663", "0.7273201", "0.7263148", "0.72242147", "0.72208685", "0.71890175", "0.70977944", "0.70601046", "0.70275784", "0.7000254", "0.698181", "0.6897488...
0.7482307
4
Return random item for a type specified by a mode and a single format character.
def randrange_fmt(mode, char, obj): x = randrange(*fmtdict[mode][char]) if char == 'c': x = bytes([x]) if obj == 'numpy' and x == b'\x00': x = b'\x01' if char == '?': x = bool(x) if char == 'f' or char == 'd': x = struct.pack(char, x) x = struct.unpack...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def randitems(n, obj='ndarray', mode=None, char=None):\n if mode is None:\n mode = choice(cap[obj][MODE])\n if char is None:\n char = choice(tuple(fmtdict[mode]))\n multiplier = choice(cap[obj][MULT])\n fmt = mode + '#' + char * int(multiplier if multiplier else 1)\n items = gen_items(...
[ "0.67956036", "0.67956036", "0.6038709", "0.6038709", "0.56997186", "0.56226206", "0.55718905", "0.54492384", "0.5427741", "0.5372512", "0.53331137", "0.52646226", "0.52158815", "0.5094101", "0.50864553", "0.5081942", "0.5081942", "0.5053526", "0.5015463", "0.50019526", "0.49...
0.5497907
7
Return a list of random items (or a scalar).
def gen_items(n, fmt, obj): if n == 0: return gen_item(fmt, obj) lst = [0] * n for i in range(n): lst[i] = gen_item(fmt, obj) return lst
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sample(self):\n return self.items[self.np_random.choice(len(self.items))]", "def generator(self, random, args):\r\n if self.duplicates:\r\n max_count = [self.capacity // item[0] for item in self.items]\r\n return [random.randint(0, m) for m in max_count]\r\n else:\r...
[ "0.71869344", "0.6829129", "0.6770057", "0.67459834", "0.6688881", "0.6683781", "0.6612185", "0.6610508", "0.6610508", "0.6610508", "0.6610508", "0.65998596", "0.65842193", "0.6575151", "0.6557039", "0.65456676", "0.6540136", "0.6509323", "0.65030175", "0.6499195", "0.6482285...
0.0
-1
Calculate strides of a contiguous array. Layout is 'C' or 'F' (Fortran).
def strides_from_shape(ndim, shape, itemsize, layout): if ndim == 0: return () if layout == 'C': strides = list(shape[1:]) + [itemsize] for i in range(ndim - 2, -1, -1): strides[i] *= strides[i + 1] else: strides = [itemsize] + list(shape[:-1]) for i in ra...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strides_from_shape(ndim, shape, itemsize, layout):\n if ndim == 0:\n return ()\n if layout == 'C':\n strides = list(shape[1:]) + [itemsize]\n for i in range(ndim-2, -1, -1):\n strides[i] *= strides[i+1]\n else:\n strides = [itemsize] + list(shape[:-1])\n f...
[ "0.6674238", "0.6667623", "0.63901645", "0.62995565", "0.6209812", "0.62079126", "0.6108434", "0.60595614", "0.60080725", "0.5996222", "0.5996222", "0.5860129", "0.57919973", "0.57440704", "0.56975204", "0.56885684", "0.56631756", "0.5634464", "0.56175673", "0.5605618", "0.55...
0.6671998
1
Verify that the parameters represent a valid array within
def verify_structure(memlen, itemsize, ndim, shape, strides, offset): if offset % itemsize: return False if offset < 0 or offset + itemsize > memlen: return False if any(v % itemsize for v in strides): return False if ndim <= 0: return ndim == 0 and not shape and not stri...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _validate_array(t):\n basetype = t.type\n if is_array(basetype):\n raise ArrayOfArrayError(t)\n validate(basetype)", "def _validate_array_params(array_params):\n if isinstance(array_params, dict):\n # Shallow check; make sure each antenna position is a 3-vector.\n if all(len(...
[ "0.7270341", "0.69448113", "0.683705", "0.6811981", "0.6776789", "0.67708015", "0.6727861", "0.6655488", "0.6578328", "0.6572302", "0.65476936", "0.6494485", "0.64726275", "0.64687735", "0.64408755", "0.6395904", "0.6385423", "0.635954", "0.63554", "0.63529444", "0.63336235",...
0.0
-1
Location of an item in the underlying memory.
def memory_index(indices, t): memlen, itemsize, ndim, shape, strides, offset = t p = offset for i in range(ndim): p += strides[i] * indices[i] return p
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def loc(self):\n return self._loc", "def loc(self):\n return self._loc", "def item_location(self, item_location):\n\n self._item_location = item_location", "def location(self, item):\n return reverse(item)", "def findItem(self, item):\n found_location = self.__find(item)\n\n ...
[ "0.6474729", "0.6474729", "0.64583784", "0.6299048", "0.62329835", "0.619247", "0.6157666", "0.61144316", "0.61032015", "0.60921395", "0.6054449", "0.6024048", "0.6024048", "0.6024048", "0.60220253", "0.593699", "0.5908533", "0.5876502", "0.5874762", "0.5853317", "0.58503854"...
0.0
-1
Create a random slice of len slicelen that fits into listlen.
def randslice_from_slicelen(slicelen, listlen): maxstart = listlen - slicelen start = randrange(maxstart + 1) maxstep = (listlen - start) // slicelen if slicelen else 1 step = randrange(1, maxstep + 1) stop = start + slicelen * step s = slice(start, stop, step) _, _, _, control = slice_indic...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def randslice_from_slicelen(slicelen, listlen):\n maxstart = listlen - slicelen\n start = randrange(maxstart+1)\n maxstep = (listlen - start) // slicelen if slicelen else 1\n step = randrange(1, maxstep+1)\n stop = start + slicelen * step\n s = slice(start, stop, step)\n _, _, _, control = sli...
[ "0.8386598", "0.8022296", "0.7148622", "0.7131934", "0.6567083", "0.6412609", "0.6211643", "0.61631083", "0.613346", "0.6101639", "0.6099712", "0.6061299", "0.60270053", "0.60159683", "0.5992975", "0.59393466", "0.592926", "0.5924613", "0.59234124", "0.59072083", "0.5882425",...
0.8382608
1
Create two sets of slices for an array x with shape 'shape' such that shapeof(x[lslices]) == shapeof(x[rslices]).
def randslice_from_shape(ndim, shape): lslices = [0] * ndim rslices = [0] * ndim for n in range(ndim): l = shape[n] slicelen = randrange(1, l + 1) if l > 0 else 0 lslices[n] = randslice_from_slicelen(slicelen, l) rslices[n] = randslice_from_slicelen(slicelen, l) return tu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def randslice_from_shape(ndim, shape):\n lslices = [0] * ndim\n rslices = [0] * ndim\n for n in range(ndim):\n l = shape[n]\n slicelen = randrange(1, l+1) if l > 0 else 0\n lslices[n] = randslice_from_slicelen(slicelen, l)\n rslices[n] = randslice_from_slicelen(slicelen, l)\n ...
[ "0.6894566", "0.6573922", "0.64847517", "0.64847517", "0.6427743", "0.64160067", "0.64142555", "0.63429934", "0.63423526", "0.63288146", "0.6293118", "0.62560296", "0.62280154", "0.61813617", "0.59872895", "0.5902308", "0.5837056", "0.5818695", "0.57853127", "0.57816154", "0....
0.6904066
0
Interpret the raw memory of 'exporter' as a list of items with size 'itemsize'. If shape=None, the new structure is assumed to be 1D with n itemsize = bytelen. If shape is given, the usual constraint for contiguous arrays prod(shape) itemsize = bytelen applies. On success, return (items, shape). If the constraints cann...
def cast_items(exporter, fmt, itemsize, shape=None): bytelen = exporter.nbytes if shape: if prod(shape) * itemsize != bytelen: return None, shape elif shape == []: if exporter.ndim == 0 or itemsize != bytelen: return None, shape else: n, r = divmod(bytelen...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cast_items(exporter, fmt, itemsize, shape=None):\n bytelen = exporter.nbytes\n if shape:\n if prod(shape) * itemsize != bytelen:\n return None, shape\n elif shape == []:\n if exporter.ndim == 0 or itemsize != bytelen:\n return None, shape\n else:\n n, r = ...
[ "0.7727057", "0.4954598", "0.4824147", "0.4800908", "0.4739031", "0.4712107", "0.47060144", "0.46961316", "0.46703562", "0.46703562", "0.46703562", "0.46703562", "0.46573693", "0.4640518", "0.4593343", "0.45195043", "0.4501709", "0.449512", "0.44936705", "0.4489558", "0.44544...
0.7749671
0
Generate random slice for a single dimension of length n. If zero=True, the slices may be empty, otherwise they will be nonempty.
def rslice(n, allow_empty=False): minlen = 0 if allow_empty or n == 0 else 1 slicelen = randrange(minlen, n + 1) return randslice_from_slicelen(slicelen, n)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rslice(n, allow_empty=False):\n minlen = 0 if allow_empty or n == 0 else 1\n slicelen = randrange(minlen, n+1)\n return randslice_from_slicelen(slicelen, n)", "def get_slice(self, n):\n if n == 0:\n return slice(self._lo_atom, self._lo_atom + self._n_atoms)\n raise IndexErro...
[ "0.77199084", "0.7018895", "0.68136233", "0.68136233", "0.64119023", "0.6384745", "0.62981", "0.6264033", "0.61925167", "0.61633945", "0.6158656", "0.615614", "0.61386144", "0.61261", "0.6123165", "0.60484874", "0.5999658", "0.59985995", "0.59841186", "0.5928469", "0.592645",...
0.77316195
0
Generate random slices for a single dimension.
def rslices(n, allow_empty=False): for _ in range(5): yield rslice(n, allow_empty)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def samples_multidimensional_uniform(bounds, points_count):\n dim = len(bounds)\n Z_rand = np.zeros(shape=(points_count, dim))\n for k in range(0,dim):\n Z_rand[:,k] = np.random.uniform(low=bounds[k][0], high=bounds[k][1], size=points_count)\n print('shape: ', Z_rand.shape)\n return Z_rand", ...
[ "0.67492634", "0.66014093", "0.66008663", "0.6559417", "0.63823134", "0.6370442", "0.63262975", "0.63150316", "0.6308082", "0.62544554", "0.62306637", "0.62290215", "0.6168629", "0.6137895", "0.6110808", "0.6091937", "0.6086058", "0.6046475", "0.6043693", "0.60327446", "0.602...
0.57519436
40
Generate random slice tuples for 'shape'.
def rslices_ndim(ndim, shape, iterations=5): for _ in range(iterations): yield tuple(rslice(shape[n]) for n in range(ndim)) for _ in range(iterations): yield tuple(rslice(shape[n], allow_empty=True) for n in range(ndim)) yield tuple(slice(0, 1, 0) for _ in range(ndim))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def randslice_from_shape(ndim, shape):\n lslices = [0] * ndim\n rslices = [0] * ndim\n for n in range(ndim):\n l = shape[n]\n slicelen = randrange(1, l+1) if l > 0 else 0\n lslices[n] = randslice_from_slicelen(slicelen, l)\n rslices[n] = randslice_from_slicelen(slicelen, l)\n ...
[ "0.81741637", "0.81736237", "0.7037425", "0.6892798", "0.6618494", "0.6588587", "0.6519507", "0.64499134", "0.6447227", "0.6422261", "0.6409819", "0.6336206", "0.63095224", "0.6286562", "0.6275536", "0.62747407", "0.6229237", "0.62141496", "0.6178198", "0.6170909", "0.6170909...
0.61362666
22
Leftrotate the tree under node x.
def rotate_left(self, x=None): if x is None: x = self.root assert x.right is not self.nil, "Cannot rotate any further left" # Right node replaces x as the top node y = x.right # Move new top node's child under old top node. x.right = y.left if x.righ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _rotate_left(self, og_root):\r\n new_root = og_root.right\r\n og_root.right = new_root.left\r\n if new_root.left:\r\n new_root.left.parent = og_root\r\n new_root.parent = og_root.parent\r\n if og_root is self.root: # if our original root of the rotation is the tre...
[ "0.79157615", "0.78381366", "0.76984537", "0.7614066", "0.7600261", "0.75376546", "0.7511552", "0.7416094", "0.73643774", "0.7325683", "0.72307533", "0.7230648", "0.7041633", "0.7040582", "0.69988453", "0.69572175", "0.6934614", "0.6882082", "0.6835029", "0.6818333", "0.67571...
0.84179527
0
Rightrotate the tree under node x.
def rotate_right(self, x=None): if x is None: x = self.root assert x.left is not self.nil, "Cannot rotate any further right" # Left node replaces x as the top node y = x.left # Move new top node's child under old top node. x.left = y.right if x.left ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def double_with_right_child(self, node):\n node.right = self.rotate_with_left_child(node.right)\n # double rotate to the left\n return self.rotate_with_right_child(node)", "def rotate_with_right_child(self, node):\n temp = node\n # todo why the fuck i need temp?\n return_node = node.right\n ...
[ "0.7628521", "0.75943077", "0.7510121", "0.742038", "0.7366329", "0.7341106", "0.73247653", "0.7276146", "0.72076607", "0.7126255", "0.71257293", "0.7124205", "0.7109927", "0.71011907", "0.7056619", "0.70498395", "0.70308566", "0.70234567", "0.7012712", "0.6971885", "0.689212...
0.8350318
0
Recursively update balance factors going up the tree. For a single insertion, factor = 1. For a single deletion, factor = 1.
def update(self, x, factor=0): if x is self.nil: return if x.balance > 1 or x.balance < -1: self.rebalance(x) return if x is self.root: return if x is x.parent.left: x.parent.balance += factor elif x is x.parent.right:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_balances(self, recursive=True):\n if self.node:\n if recursive:\n if self.node.left:\n self.node.left.update_balances()\n if self.node.right:\n self.node.right.update_balances()\n\n self.balance = self.node....
[ "0.7114943", "0.6488515", "0.6434147", "0.62561345", "0.6224313", "0.6212973", "0.6092666", "0.5940654", "0.581709", "0.58043826", "0.5763958", "0.57568693", "0.5716241", "0.56767696", "0.5675978", "0.5668895", "0.56612366", "0.564704", "0.56425905", "0.5569215", "0.5566293",...
0.7416797
0
Get current CPS Should return a float
def get_cps(self): return self._current_cps
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cps(self):\n\n if self._cps is not None:\n return self._cps\n else:\n try:\n return self.counts / self.livetime\n except TypeError:\n raise SpectrumError(\n 'Unknown livetime; cannot calculate CPS from counts')", ...
[ "0.7728652", "0.7462495", "0.7036479", "0.7036479", "0.6906312", "0.68568826", "0.6835569", "0.65149987", "0.64797735", "0.64733404", "0.64303815", "0.6356482", "0.6325371", "0.6296346", "0.6296247", "0.6290065", "0.62089956", "0.6181946", "0.61742765", "0.61742765", "0.61445...
0.736031
3
Returns bad response on response validation errors.
def on_response_validation_error(err): return jsonify(message='Bad response'), 500
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def invalid_response():\n return Response(\n '{\"error\": \"Invalid request\"}',\n status=400,\n mimetype='application/json'\n )", "def validate_response(self, response: requests.Response) -> None:\n if 400 <= response.status_code < 500:\n msg = (\n ...
[ "0.7957971", "0.7649618", "0.74914646", "0.7456368", "0.73698705", "0.73698705", "0.73698705", "0.7343411", "0.73405534", "0.7328041", "0.7253684", "0.7207405", "0.71976", "0.71240443", "0.71097517", "0.708896", "0.7068561", "0.6963485", "0.6949408", "0.6906186", "0.68362963"...
0.82996505
0
Return self, for use with for loops.
def __iter__(self): return self
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __iter__(self):\n\n return self", "def __iter__(self) -> object:\n return self", "def __iter__(self):\r\n return self", "def __iter__(self):\n self._first()\n return self", "def __iter__(self):\n self.index = 0\n return self", "def __iter__(self):\n ...
[ "0.7343625", "0.7325457", "0.7251591", "0.7046542", "0.69823456", "0.6917468", "0.6901136", "0.6889359", "0.6784111", "0.6725885", "0.67133707", "0.66941875", "0.66941875", "0.66941875", "0.6690696", "0.6660724", "0.6660724", "0.6660724", "0.6660724", "0.66546494", "0.6647987...
0.73247856
23
returns an email address as a unquoted unicode string
def decode_email_address(address, charset="utf8"): name = decode_email_header(address[0]) addr = address[1] addr = "<" + addr + ">" if not name: return addr return name + " " + addr
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def decode_email(email):\n return", "def email(email_str):\n if is_valid_email(email_str):\n return email_str\n else:\n raise ValueError('{} is not a valid email'.format(email_str))", "def email_address(self) -> \"str\":\n return self._attrs.get(\"emailAddress\")", "def _extract...
[ "0.71394217", "0.702159", "0.69071203", "0.68899196", "0.6840699", "0.6702935", "0.66950506", "0.65692395", "0.6528242", "0.65049773", "0.65012676", "0.64955735", "0.6491553", "0.6484322", "0.6463048", "0.6436164", "0.639294", "0.63714993", "0.6341899", "0.6336248", "0.630566...
0.71918446
0
returns the email rules that match this message.
def email_destinations(message, rules): matching = set() for dest in rules: if email_matches_rule(message, rules[dest]): matching.add(dest) return list(matching)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rules(self):\n return self._alert_rules_client", "def get_rules(self):\n rules = []\n for item in self.rule:\n rules.append(item)\n return rules", "def get_rules(self):\n rules = []\n for item in self.name:\n rules.append(item)\n return...
[ "0.699283", "0.6886916", "0.6780218", "0.6646598", "0.6495222", "0.6300169", "0.6114471", "0.6104266", "0.6102272", "0.60898846", "0.60876673", "0.60361826", "0.6027149", "0.60163724", "0.5911143", "0.5886574", "0.5871772", "0.5841316", "0.5761576", "0.5761576", "0.57128936",...
0.6175876
6
Cohen's d, standardized mean difference under normality assumption. This computes the standardized mean difference, Cohen's d, effect size that is equivalent to the rank based probability ``p`` of being stochastically larger if we assume that the data is normally distributed, given by
def effectsize_normal(self, prob=None): if prob is None: prob = self.prob1 return stats.norm.ppf(prob) * np.sqrt(2)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def F_std_coeff(d):\n return (d ** 2 - 1) / 4", "def cohen_d(x_arr, y_arr):\n delta = np.mean(x_arr) - np.mean(y_arr)\n pooled_std = np.sqrt(\n (\n (len(x_arr) - 1) * np.std(x_arr, ddof=1) ** 2 +\n (len(y_arr) - 1) * np.std(y_arr, ddof=1) ** 2\n ) / (len(x_arr) + len(...
[ "0.66413516", "0.64329755", "0.6382515", "0.62766397", "0.62706274", "0.62279636", "0.6169494", "0.615108", "0.61090934", "0.6099853", "0.609961", "0.60770863", "0.6051967", "0.60413456", "0.6031248", "0.60311335", "0.5995423", "0.5995423", "0.5974874", "0.5948726", "0.594612...
0.63479984
3
Convert Cohen's d effect size to stochasticallylargerprobability. This assumes observations are normally distributed. Computed as p = Prob(x1 > x2) = F(d / sqrt(2)) where `F` is cdf of normal distribution. Cohen's d is defined as d = (mean1 mean2) / std where ``std`` is the pooled within standard deviation.
def cohensd2problarger(d): return stats.norm.cdf(d / np.sqrt(2))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cohen_d(x_arr, y_arr):\n delta = np.mean(x_arr) - np.mean(y_arr)\n pooled_std = np.sqrt(\n (\n (len(x_arr) - 1) * np.std(x_arr, ddof=1) ** 2 +\n (len(y_arr) - 1) * np.std(y_arr, ddof=1) ** 2\n ) / (len(x_arr) + len(y_arr))\n )\n return delta / pooled_std", "def...
[ "0.62903917", "0.6092724", "0.5854814", "0.5814859", "0.58076376", "0.57111233", "0.5642833", "0.5614208", "0.56010324", "0.5499328", "0.54770863", "0.5456112", "0.543066", "0.5401293", "0.5387434", "0.5343079", "0.5338465", "0.5328492", "0.53196543", "0.5310944", "0.5307831"...
0.70773894
0
Returns the facepose data Returns facepose data using the columns set in fex.facepose_columns
def facepose(self): return self[self.facepose_columns]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def facebox(self):\n \n return self[self.facebox_columns]", "def facebox(self):\n return self[self.facebox_columns]", "def get_pose_data(self):\n # print(self.PoseData)\n ft = ai.feature.Feature()\n ft.type = ai.feature.Type.CHARGING.value\n ft.received_time...
[ "0.63843197", "0.6273101", "0.59165555", "0.5586807", "0.5567384", "0.5509971", "0.54848564", "0.5475028", "0.545142", "0.5449467", "0.5415388", "0.5318611", "0.5299302", "0.5239533", "0.5221949", "0.52017903", "0.5186216", "0.51813877", "0.5175315", "0.5161512", "0.5136092",...
0.7442376
1
Returns the x landmarks. Returns the xcoordinates for facial landmarks looking for "x" in fex.landmark_columns.
def landmark_x(self): ######## TODO: NATSORT columns before returning ####### x_cols = [col for col in self.landmark_columns if "x" in col] return self[x_cols]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extract_all_face_landmarks(x_data, verbose=True):\r\n\t# Initialize dlib's face detector and create the facial landmark predictor\r\n\tdetector = dlib.get_frontal_face_detector()\r\n\tpredictor = dlib.shape_predictor(face_predictor_path)\r\n\r\n\tx_int = np.uint8(np.multiply(x_data, 256))\r\n\tface_landmarks =...
[ "0.689068", "0.68787104", "0.68787104", "0.673929", "0.66141653", "0.61886597", "0.611724", "0.5882194", "0.5851471", "0.58252877", "0.5794902", "0.57377267", "0.5733932", "0.5688064", "0.56825036", "0.5644469", "0.5632531", "0.56302077", "0.56162626", "0.56021917", "0.558027...
0.8438608
1
Returns the facebox data Returns the facebox data using fex.facebox_columns.
def facebox(self): return self[self.facebox_columns]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def facebox(self):\n return self[self.facebox_columns]", "def draw_face_box(data):\n head = extract_head(data);\n face_box = data['position_data']['face_box'][data['i']];\n sefs = data['sefs'][data['i']];\n if face_box is not None:\n cv2.rectangle(head, *face_box, (0, 255, 0));\n els...
[ "0.786718", "0.58591956", "0.5781269", "0.57674426", "0.57323515", "0.57317066", "0.57074684", "0.5695902", "0.5650277", "0.5650277", "0.5629819", "0.5547583", "0.54429126", "0.53911495", "0.53716815", "0.5363829", "0.5342121", "0.532826", "0.53220755", "0.5313227", "0.525019...
0.7945136
0
Plots detection results by Feat.
def plot_detections(self, draw_landmarks=True, draw_facelines=True, muscle=False, pose=False): from PIL import Image import matplotlib.pyplot as plt from matplotlib.patches import Rectangle import seaborn as sns from textwrap import wrap sns.set_context("paper", font_sca...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_results(infer_images, inference_predicted_class, inference_predictions, class_names=['plants', 'water']):\n plt.style.use(['dark_background', 'bmh'])\n rc('figure', figsize=(8, 8), max_open_warning=False)\n rc('axes', facecolor='none')\n plt.figure(figsize=(15, 15))\n\n for i, (infer_img, _...
[ "0.6936621", "0.6553356", "0.6532636", "0.6425827", "0.6355377", "0.6339292", "0.63373595", "0.62557954", "0.62518823", "0.6233054", "0.6231182", "0.61923826", "0.6184363", "0.61733305", "0.6170361", "0.61695814", "0.6168787", "0.61479247", "0.614077", "0.6139721", "0.6132155...
0.6414809
4
return the root item, which is smallest item
def peek(self): if self.is_empty(): raise ValueError("Heap is empty") return self._heap[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_smallest(self):\n return self._find_smallest(self.root)", "def get_min(self):\n if self.root is None: # BC1\n return float('+inf')\n\n current = self.root\n while current.left is not None: # Traverse like a linked-list\n current = current.left\n\n ...
[ "0.80904216", "0.7712999", "0.75463486", "0.75278705", "0.74578255", "0.74254566", "0.7418548", "0.7393716", "0.73874015", "0.7343374", "0.7324827", "0.73158646", "0.73106855", "0.7302941", "0.72807777", "0.7251923", "0.7242987", "0.71348315", "0.7131564", "0.7127903", "0.710...
0.0
-1
Returns the signals names list of the 128 signals available in the software Returns
def NamesGet(self): ## Make Header hex_rep = self.NanonisTCP.make_header('Signals.NamesGet', body_size=0) self.NanonisTCP.send_command(hex_rep) response = self.NanonisTCP.receive_response() # signals_names_size = self.NanonisTCP.hex_to_int32(response[0:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_signal_text_labels(self):\n\n return [self.signal_label(chn) for chn in range(self.signals_in_file)]", "def get_signal_info(self, signal_names):\n result = []\n for name in signal_names:\n description = self._pio.signal_description(name)\n domain_type = self._pi...
[ "0.7081996", "0.6256773", "0.62184995", "0.6027004", "0.602181", "0.59879315", "0.58767784", "0.58168095", "0.57998013", "0.5774171", "0.5773198", "0.57506484", "0.5691146", "0.5681253", "0.56616247", "0.5658089", "0.56555593", "0.56504756", "0.5634074", "0.5604724", "0.55868...
0.67688495
1
Returns the range limits of the selected signal
def RangeGet(self,signal_index): ## Make Header hex_rep = self.NanonisTCP.make_header('Signals.RangeGet', body_size=4) ## Arguments hex_rep += self.NanonisTCP.to_hex(signal_index,4) self.NanonisTCP.send_command(hex_rep) response = self.NanonisTC...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getLimits(self):\n lims = [x * self.getSign() + self.getOffset() for x in (self.connection.getChannel(self.chanNamePrefix % 'low_limit').read(), \\\n self.connection.getChannel(self.chanNamePrefix % 'high_limit').read())]\n return (mi...
[ "0.73762864", "0.71308875", "0.7054792", "0.6830011", "0.6793152", "0.6729338", "0.6718176", "0.67145187", "0.67106813", "0.67011774", "0.66700286", "0.6667773", "0.6657521", "0.66403186", "0.6615031", "0.6606257", "0.65952", "0.65758884", "0.6560238", "0.65521395", "0.654826...
0.6633522
14
Flat negative utility as long as the required data rate is not met; then positive. Nothing in between.
def step_utility(curr_dr, req_dr): if curr_dr >= req_dr: return MAX_UTILITY return MIN_UTILITY
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def negative(data):\n return _make.negative(data)", "def __neg__(self):\n return 0 - self", "def __neg__(self):\n return (-1)*self", "def negative(a: Decimal) -> Decimal:\n return -a", "def __neg__(self):\n return self.__mul__(-1)", "def __neg__(self):\n return self.neg(...
[ "0.7066463", "0.665684", "0.6532293", "0.64558023", "0.64310837", "0.64054364", "0.64012533", "0.6342113", "0.63170445", "0.6309546", "0.6293097", "0.6287095", "0.6280602", "0.62652326", "0.6237082", "0.6232605", "0.6226406", "0.6218029", "0.6215773", "0.62019897", "0.6201989...
0.0
-1
Get the firmware writeprotection state.
def _get_state(self): fw_wp_en = (self._interface.get('fw_wp_en') == 'on') fw_wp = (self._interface.get('fw_wp') == 'on') if fw_wp_en: return self._STATE_FORCE_ON if fw_wp else self._STATE_FORCE_OFF else: return self._STATE_ON if fw_wp else self._STATE_OFF
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_state(self):\n ret = self.send(\"?S\", recv=True)\n assert ret in \"WDR\"\n return ret", "def current_protection_state(self) -> str:\n return pulumi.get(self, \"current_protection_state\")", "def get_protection_state(self, c):\n return self.protection_state", "def p...
[ "0.6681692", "0.66042894", "0.6322094", "0.6071203", "0.58912504", "0.58912504", "0.5873062", "0.5845878", "0.58376557", "0.5716381", "0.56194377", "0.5616816", "0.56100225", "0.5602101", "0.55674225", "0.5563936", "0.5562468", "0.55550563", "0.5532806", "0.5522311", "0.55085...
0.6028243
4
Test that it raises an error if transitions is the wrong size.
def test_wrong_transitions_dim(self): with self.assertRaises(ValueError): hmm.Viterbi([1], [1], [[]], [lambda x: 1])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_transitions(self, transitions: np.ndarray) -> np.ndarray:\n if not isinstance(transitions, np.ndarray):\n raise TypeError('Transition matrix must be a numpy.ndarray')\n if not transitions.shape == (self.n_states, self.n_states):\n raise ValueError('Transition matrix mu...
[ "0.67167807", "0.66485035", "0.65419185", "0.64016193", "0.6346695", "0.6316185", "0.6251593", "0.6177131", "0.6109697", "0.6097884", "0.6073906", "0.60323924", "0.5990011", "0.59798384", "0.59667546", "0.5940059", "0.5925748", "0.5901199", "0.5878569", "0.5870042", "0.584557...
0.6723367
0
Calculate the great circle distance between two points on the earth (specified in decimal degrees)
def _greatCircleDistance(self, long1, lat1, long2, lat2): # convert decimal degrees to radians long1, lat1, long2, lat2 = map(radians, [float(long1), float(lat1), float(long2), float(lat2)]) # haversine formula dlon = long2 - long1 #print(long2) #print(long1) d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def great_circle(lat_1, long_1, lat_2, long_2):\n long_1 = m.radians(long_1)\n lat_1 = m.radians(lat_1)\n long_2 = m.radians(long_2)\n lat_2 = m.radians(lat_2)\n\n d = 2 * 6367.45 * m.asin(\n m.sqrt(haversine(lat_2 - lat_1)\n + m.cos(lat_1)*m.cos(lat_2) *\n haversine(long...
[ "0.8146062", "0.78638023", "0.7604661", "0.7595527", "0.75950956", "0.7592873", "0.757031", "0.7564319", "0.75560796", "0.75300086", "0.7516366", "0.7493803", "0.746558", "0.7450864", "0.7432722", "0.7391925", "0.7355981", "0.7347892", "0.7330029", "0.73271745", "0.732655", ...
0.7632202
2
Test that the `space` class' repr can actually be used to reconstruct it.
def test_repr(self): for k in (0, -1, 1, 1.75, 0.325, 1/7, -1.75, -0.325, -1/7): s = space(fake_curvature=k) r = repr(s) v = eval(r) self.assertTrue(s == v)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_repr():\n c = Circle(4) \n assert c.__repr__() == 'Circle(4)'", "def test_repr(self, r, rep):\n assert repr(r) == rep", "def test_repr(self):\n self.assertEqual(repr(self.card), \"A of Spades\")", "def test_repr(self):\n qg = ConcentricGrid(2, 3, 4)\n s = str(qg)\n ...
[ "0.73583317", "0.72364193", "0.7070561", "0.6968653", "0.6947609", "0.6947217", "0.6841201", "0.6831168", "0.67981154", "0.6763639", "0.6755482", "0.67387325", "0.6714545", "0.6667278", "0.66649514", "0.6640729", "0.66333807", "0.66019505", "0.6570984", "0.65403324", "0.65355...
0.68895775
6
Test that the repr of the class can be used to exactly reconstruct a point. For this test, we don't care so much what the space or point is, only that it is reconstructible exactly.
def test_repr(self): direction = (3/13, 4/13, 12/13) magnitude = 7.33337377737737773737 for k in (0, -1, 1, 1.75, 0.325, 1/7, -1.75, -0.325, -1/7): s = space(fake_curvature=k) p = s.make_point(direction, magnitude) r = repr(p) v = eval(r) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_point_positive_repr(self):\n p = Point(x=3, y=5)\n self.assertTupleEqual(p.__repr__(), (3.0, 5.0),\n 'Test of Point(x=3, y=5).__repr__() failed. Returned value != (3.0, 5.0)')", "def test_point_positive_str(self):\n p = Point(x=3, y=5)\n self.assertEqu...
[ "0.74315566", "0.7010876", "0.6719743", "0.64998335", "0.6484903", "0.634178", "0.6326949", "0.629799", "0.62194276", "0.6167945", "0.6164364", "0.6142622", "0.61114615", "0.6019057", "0.59666646", "0.5960959", "0.59585816", "0.5937703", "0.5936237", "0.58785623", "0.5838388"...
0.7450213
0
Test that the magnitude of a point constructed from the (direction, magnitude) method actually has correct magnitude. Also checks that the magnitude matches the distance to the origin.
def test_magnitude(self): # test small magnitudes with regular unit vectors u1 = (1,) u2 = (0, 1/2, 0, 1/2, 1/2, 0, 0, 0, 1/2) u3 = (12/13, 4/13, 3/13) for k in (0, -1, 1): s = space(fake_curvature=k) for d in (0, 1, 1/3, 3/2): for n in (u...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_magnitude(self):\n\n a1 = vectors.Vector(1, 2, 3)\n self.assertEqual(a1.magnitude(), math.sqrt(14))\n\n a1 = vectors.Vector(-1, -2, -3)\n self.assertEqual(a1.magnitude(), math.sqrt(14))\n\n a1 = vectors.Vector(1, 0, 0)\n self.assertEqual(a1.magnitude(), 1)\n\n ...
[ "0.6976977", "0.62176955", "0.61258674", "0.609689", "0.609689", "0.6085904", "0.6048376", "0.6014426", "0.5913031", "0.5852871", "0.58514756", "0.5800771", "0.5755077", "0.5749432", "0.57480156", "0.5734468", "0.5716839", "0.57111055", "0.56150967", "0.56097627", "0.55773836...
0.7013087
0
In Euclidean space, all of the sphere formulas look like a monomial in the radius r. Thus when we scale the r, we should expect the mass to be scaled by r^n, where n is the dimensionality and also the exponent in that monomial.
def test_euclidean_scale(self): s = space(curvature=0) magic = 77773.333773777773733 for mul in (2, 5, 1/3, 1/11, magic, 1/magic): for name, dim in ( ('sphere_s1', 1), ('sphere_v2', 2), ('sphere_s2', 2), ('sphere_v3', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sphere_volume(r):\n return (4/3) * 3.14159 * r**3", "def sphere_volume(r):\n\treturn 4/3. * math.pi * r ** 3", "def nsphere_volume(n, r):\n return math.pi ** (n / 2) * (r ** n) / gamma(n / 2 + 1)", "def calcul_v_sphere(r):\n volume = 4/3 * math.pi * (r ** 3)\n return volume", "def sphere(se...
[ "0.6940514", "0.68404996", "0.6613535", "0.65793604", "0.65733814", "0.65725887", "0.6526441", "0.6446438", "0.63393754", "0.62693536", "0.62570846", "0.6243203", "0.6241686", "0.62026006", "0.6196672", "0.60735595", "0.6071401", "0.6061628", "0.6036803", "0.60190624", "0.601...
0.6543655
6
Test that the dot product behaves as expected, first using the properties of the dot product, then using test vectors.
def test_dot_product(self): import itertools # our little magic constant magic = 0.33377777373737737777 # test for all kinds of curvatures K for k in (0, 1, -1, 1/11, -1/11, 1 + magic, -1 - magic): s = space(curvature=k) # special points ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_dot():\n assert_equal(dot(Vector(3.0, 2.0), Vector(2.0, -1.0)), 4.0)", "def test_dot(self):\n\n vec1 = Vec3(3, 4, 5)\n vec2 = Vec3(2, 3, 4)\n dot = vec1.dot(vec2)\n\n expected = 3 * 2 + 4 * 3 + 5 * 4\n\n self.assertEqual(dot, expected)", "def test_dot_different_si...
[ "0.8664247", "0.83274865", "0.8118059", "0.8098606", "0.7927716", "0.7889314", "0.7855894", "0.75989074", "0.74231285", "0.7346898", "0.7001903", "0.69980097", "0.69750464", "0.6973565", "0.69656646", "0.6964708", "0.69644076", "0.69447196", "0.69319606", "0.6923835", "0.6916...
0.6961445
17
Provides a statistical summary of the providers' forecasts and their errors. Missing values are excluded.
def statistical_analysis(var1, var2, var3, var4, var5, var6, var7, var8, var9, var10, var11, var12, param): valueCount_prov1 = round(valueCounter([var1, var4, var7, var10]),3) #how many valid OpenWeatherMap forecasts are available valueCount_prov2 = round(valueCounter([var2, var5, var8, var11]),3) #how man...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_forecast_summary(self):\n sum = {\"prior_var\":[], \"post_var\":[], \"percent_reduction\":[]}\n for forecast in self.prior_forecast.keys():\n pr = self.prior_forecast[forecast]\n pt = self.posterior_forecast[forecast]\n ur = 100.0 * (1.0 - (pt/pr))\n ...
[ "0.6572249", "0.6057412", "0.5841539", "0.5594807", "0.5581071", "0.55651456", "0.5560634", "0.5553574", "0.54943204", "0.5466428", "0.54632604", "0.54625744", "0.54508865", "0.54131085", "0.5403664", "0.5400281", "0.5382816", "0.53824395", "0.5373882", "0.53687817", "0.53681...
0.5903888
2
Extracts index of the CAND cell from the macro name
def _get_cand_index(signature): # This map translates between the last "I<n>" field value and the # actual CAND cell index. INDEX_MAP = { 10: 0, 9: 1, 8: 2, 7: 3, 6: 4, } # Split the signature parts = signature...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_cindex(circ, name, index):\n ret = 0\n for reg in circ.cregs:\n if name != reg.name:\n ret += reg.size\n else:\n return ret + index\n return ret + index", "def find_index_column(sheet, name, num):\n for idx in range(1, 26):\n if sheet[chr(idx + 64) ...
[ "0.6677239", "0.65177643", "0.64571553", "0.6414777", "0.6116624", "0.60948515", "0.6059686", "0.60338223", "0.600395", "0.59993935", "0.59941286", "0.5988476", "0.5973601", "0.5892307", "0.58767915", "0.5873143", "0.5831077", "0.5810633", "0.57852215", "0.577415", "0.5764521...
0.6356116
4
Tests to ensure Model.from_dict() works as advertised.
def test_from_dict(self): class Person(Model): name = StringField() age = IntegralField(bounds = (0, None)) siblings = ListField(of = StringField()) # In the normal case where all the data coincides with fields # correctly. person1 = Person.from_dict...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_from_dict(self):\n b1 = BaseModel()\n b1.name = \"Holberton\"\n b1.my_number = 89\n my_model_json = b1.to_dict()\n b2 = BaseModel(**my_model_json)\n self.assertEqual(b1.my_number, b2.my_number)\n self.assertEqual(b1.id, b2.id)\n self.assertEqu...
[ "0.7688621", "0.731317", "0.72200084", "0.72200084", "0.72200084", "0.72200084", "0.72200084", "0.72200084", "0.72200084", "0.72200084", "0.72200084", "0.72200084", "0.72200084", "0.72200084", "0.72200084", "0.72200084", "0.72200084", "0.72200084", "0.72200084", "0.72200084", ...
0.7694948
0
returns 1 if the point is inside any obstacles 0 otherwise
def inside_obstacle(point, obstacle): for obs in obstacle: if point[0] > obs[0][0] and point[0] < obs[0][2] and point[1] > obs[1][0] and point[1] < obs[1][2]: return 1 return 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_in_obstacle(self, x: float, y: float) -> bool:\n for obstacle in self.obstacles:\n if obstacle.contains_point((x, y)):\n return True\n return False", "def through_obstacle(line, obstacles):\r\n noofpoints = 100\r\n for i in range(noofpoints):\r\n if ins...
[ "0.7569299", "0.75461394", "0.75419754", "0.7019176", "0.70144844", "0.69907904", "0.68982977", "0.6818476", "0.6774961", "0.67379445", "0.667127", "0.66310084", "0.6615502", "0.66107047", "0.6606105", "0.6582978", "0.6573739", "0.65736836", "0.6563211", "0.6532585", "0.65290...
0.83202106
1
Returns nested string representation of the dictionary (like json.dumps).
def dumps(self, indent=1): str_keys_dict = OrderedDict({str(k): v for k, v in self.items()}) for k, v in str_keys_dict.items(): if isinstance(v, dict): str_keys_dict[k] = OrderedDict({str(k1): v1 for k1, v1 in v.items()}) for k1, v1 in str_keys_dict[k].items()...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _to_string(self) -> str:\n\n string_list = []\n for key, value in self.__dict__.items():\n if isinstance(value, dict):\n string_list.append(key)\n string_list.extend('\\n'.join([\"Key: {:24}\\tValue: {}\".format(_key, _value) for _key, _value in value.item...
[ "0.7627298", "0.72192067", "0.71890104", "0.7064385", "0.70334524", "0.70074034", "0.6991048", "0.6952123", "0.6899821", "0.6873991", "0.68563676", "0.684795", "0.68241227", "0.6818709", "0.6813821", "0.67837304", "0.6758368", "0.6736979", "0.672827", "0.6699891", "0.6698725"...
0.70391566
4
Returns all children of the requested type that have the requested attribute == requested value.
def get_objects_with_attribute(self, obj_type: str, attribute: str, value: str) -> List[TgnObject]: return [o for o in self.get_objects_by_type(obj_type) if o.get_attribute(attribute) == value]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find(root, *, type=None, attrs={}, depth=10000):\n for child in root.get_children():\n assert isinstance(child, NodeNG)\n match = True\n if type and not isinstance(child, type):\n match = False\n if not all(_check_attr(child, key, value) for (key, value) in attrs.items...
[ "0.62692064", "0.61959255", "0.6129688", "0.60676503", "0.58746266", "0.57456374", "0.57456374", "0.5730761", "0.56680083", "0.5666754", "0.56216437", "0.56107014", "0.5610693", "0.559932", "0.5574028", "0.5562178", "0.5560661", "0.54851705", "0.5461284", "0.5440673", "0.5405...
0.6883142
0
Add an item to the top of the stack.
def push(self,item): self.items.append(item)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def push(self, item):\r\n self.stack.insert(0, item)", "def push(self, item):\n self.stack.append(item)", "def push(self, item):\n self.stack.append(item)", "def push(self, item):\n # Reassign the link to top of the stack and update the\n self.top = [item] + self.top", "d...
[ "0.8537657", "0.8231838", "0.8231838", "0.8116884", "0.79721665", "0.79617554", "0.7936523", "0.78856003", "0.7831923", "0.77516866", "0.7709417", "0.7687498", "0.7645379", "0.75725293", "0.7538926", "0.74725765", "0.7427238", "0.7426789", "0.7425252", "0.74129057", "0.739656...
0.7164999
27
Return the top of the stack.
def peek(self): return self.items[len(self.items)-1]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def top(self):\n if self.stack == []:\n return None\n return self.stack[-1]", "def top(self):\n if self.stack:\n return self.stack[-1]\n raise ValueError", "def top(self):\n return self.stack[-1]", "def top(self) -> int:\n return self.stack[-1]"...
[ "0.8958158", "0.88953453", "0.87201875", "0.8571802", "0.8571802", "0.8552679", "0.85195655", "0.83358246", "0.833083", "0.83180547", "0.8304592", "0.82532", "0.82478213", "0.8205401", "0.8178111", "0.81203896", "0.8096149", "0.8084116", "0.7972592", "0.79617023", "0.78329045...
0.0
-1
Return true if and only if the stack is empty.
def isEmpty(self): if self.items == None: return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_empty(self):\n return len(self.the_stack) == 0", "def is_empty(self):\n return len(self.stack) == 0", "def empty(self) -> bool:\n if len(self.stack)==0:\n return True\n else:\n return False", "def empty(self) -> bool:\n return len(self.stack) ==...
[ "0.9229959", "0.9187908", "0.9156134", "0.91536194", "0.91056377", "0.90918183", "0.90918183", "0.9081206", "0.8974966", "0.8973743", "0.8949262", "0.88958967", "0.8875942", "0.88593787", "0.88593787", "0.8859211", "0.88169986", "0.8807362", "0.8790325", "0.8726085", "0.87163...
0.0
-1
Convert rotations given as quaternions to rotation matrices.
def quaternion_to_matrix(quaternions): r, i, j, k = torch.unbind(quaternions, -1) two_s = 2.0 / (quaternions * quaternions).sum(-1) o = torch.stack( ( 1 - two_s * (j * j + k * k), two_s * (i * j - k * r), two_s * (i * k + j * r), two_s * (i * j + k * ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def quaternion_to_rotation_matrix(q0, q1, q2, q3) -> np:\n\n # First row of the rotation matrix\n r00 = 2 * (q0 * q0 + q1 * q1) - 1\n r01 = 2 * (q1 * q2 - q0 * q3)\n r02 = 2 * (q1 * q3 + q0 * q2)\n\n # Second row of the rotation matrix\n r10 = 2 * (q1 * q2 + q0 * q3)\n r11 = 2 * (q0 * q0 + q2 ...
[ "0.7556122", "0.734608", "0.7273189", "0.7248003", "0.71576226", "0.7103836", "0.7101638", "0.7073682", "0.70327914", "0.6948816", "0.691051", "0.6897135", "0.686652", "0.67593074", "0.6753725", "0.6734849", "0.67228466", "0.6715095", "0.67141867", "0.6690246", "0.6690246", ...
0.73008364
2
Make a new device driver If your child class also has an init function, don't forget to call `super().__init__()`! If you pass a simulation_object (a callable which returns an object which implements a method called "query" which takes a string as input and produces a string as output) then this driver can be run in si...
def __init__( self, *args, id=None, simulation=False, baud_rate=57600, command_separator=" ", **kwargs, ): logger.debug("Creating new driver object for device %s", id) self.command_separator = command_separator self.simulation = simula...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, addr, name=None, i2c=None):\n\n # Initialize the device and save the simulator\n super().__init__(addr, name=name, i2c=i2c)\n self.sim = None", "def __init__(self, simulator, sim_params):\n self.kernel_api = None\n\n if simulator == \"traci\":\n se...
[ "0.61960036", "0.6151352", "0.61269534", "0.6040944", "0.58551556", "0.5850262", "0.5809987", "0.5751357", "0.5697687", "0.56727403", "0.5662593", "0.5633159", "0.5540421", "0.55293876", "0.5488719", "0.54857534", "0.5480112", "0.54695004", "0.54672223", "0.5466742", "0.54567...
0.6724382
0
Close the connection to this device. After this method is called, no other methods will work and this object should be discarded.
def close(self): logger.warning("Closing VISA connection to device %s", self.dev_id) self.instr.close() del _locks[self.dev_id] del _visa_sessions[self.dev_id]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def close(self):\n self.device.disconnect()", "def close(self):\n self.device.close()", "def close_device(self):\n raise NotImplementedError(\"implement in derived transport class\")", "def close(self) -> None:\n if self.__opened:\n self.device.close()\n self...
[ "0.83891964", "0.82722986", "0.801343", "0.793924", "0.7921128", "0.7770837", "0.77586097", "0.77462935", "0.7720507", "0.7697589", "0.76925737", "0.76883036", "0.76796466", "0.7677324", "0.76755846", "0.7658179", "0.7649552", "0.76257664", "0.7618437", "0.7616994", "0.759503...
0.0
-1
Filters out all the data points that don't have evidence in the given corpus This will only be used when only a sample of the corpus is used (for testing purposes)
def filter_data(data: List[dict], corpus: dict): corpus_doc_ids = list(corpus.keys()) data_to_keep = [] for d in data: evidence_docs = get_evidence_docs(d) for evidence_doc in evidence_docs: if evidence_doc in corpus_doc_ids: data_to_keep.append(d) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _check_samples(self, samples):\n check = [k not in self._samples for k in samples]\n num_not_in_vcf = np.sum(check)\n if num_not_in_vcf > 0:\n with open('/tmp/excluded.subjects', 'w') as f:\n for item in samples[np.array(check)]:\n f.write(\"%s\...
[ "0.6361318", "0.6335295", "0.600313", "0.59109133", "0.58922136", "0.58378917", "0.5788261", "0.57730836", "0.57625693", "0.57011586", "0.56857", "0.5643858", "0.5617604", "0.5586348", "0.5529099", "0.54720646", "0.5436433", "0.5436164", "0.54335773", "0.54274094", "0.5419971...
0.73949057
0
This function appends a string at the end of a text file (UTF8) and returns the number of characters added
def append_write(filename="", text=""): with open(filename, 'a') as new: appended = new.write(text) new.close() return appended
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def append_write(filename=\"\", text=\"\"):\n with open(filename, \"a\", encoding=\"utf-8\") as my_file:\n charcount = my_file.write(text)\n return (charcount)", "def append_write(filename=\"\", text=\"\"):\n count = 0\n with open(filename, 'a', encoding='utf-8') as f:\n count = f.write...
[ "0.80808324", "0.7698628", "0.76165926", "0.74722177", "0.702376", "0.6901683", "0.6870309", "0.679619", "0.67527986", "0.6727121", "0.6677319", "0.66663206", "0.66330814", "0.6628055", "0.6593488", "0.658327", "0.6576636", "0.65581506", "0.6462257", "0.63993156", "0.63973117...
0.62818354
24
Closes the connection but automatically commits before doing so.
def close(commit=True): if commit: connection.commit() connection.close()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def commit_and_close(self):\n self.connection.commit()\n self.cursor.close()\n self.connection.close()", "def _close_connection(self, connection):\n connection.commit()\n connection.close()", "def close(self):\n self.conn.commit()\n self.conn.close()\n lo...
[ "0.79462487", "0.78683907", "0.76800936", "0.7479128", "0.74709946", "0.74501497", "0.73357517", "0.7300451", "0.72837037", "0.71752745", "0.7140643", "0.7114005", "0.7111587", "0.7095112", "0.7093633", "0.70799047", "0.7079185", "0.7069021", "0.7069021", "0.7066565", "0.7040...
0.7458308
5
Write either failed sample IDs or SNPs to two files. One is a humanreadable csv file, the other is a csv file intended to be read into a Pandas DataFrame.
def write_fail_file(ids_failed: dict, outfile: str="failed_ids"): hr = filename + "_hr.csv" pr = filename + "_pr.csv" with open(hr, "w") as f: for k,v in ids_failed.items(): f.write(str(k) + ": " + str(v) + "\n") pd.DataFrame.from_dict(data=ids_failed, orient='index').to_csv(pr, hea...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _sample_failed_report(imissfile: str=\"plink.imiss\", lmissfile: str=\"plink.lmiss\",\n sexcheckfile: str=\"plink.sexcheck\",\n hetfailedfile: str=\"het_fail_ind.txt\",\n ibdfile: str=\"pihat_min0.2_in_founders.genome\",\n ...
[ "0.59206516", "0.5845258", "0.58105785", "0.575506", "0.5745646", "0.5745309", "0.5710545", "0.5644103", "0.556784", "0.544185", "0.5432509", "0.54268724", "0.5420259", "0.5400306", "0.53917617", "0.53685975", "0.5348828", "0.5346041", "0.53247756", "0.5324289", "0.531969", ...
0.59977597
0
Set a Phandle at root of tree
def set_phandle(self, phandle, node): if self.is_root(): self.phandles[phandle] = node else: self.parent.set_phandle(phandle, node)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_handle(self, handle): # -> None:\n ...", "def set_relative_root(self, root):\r\n self.root = root", "def set_relative_root(self, root):\r\n self.root = root", "def set_root(self):\n try:\n _check_call(_LIB.TreeliteTreeBuilderSetRootNode(\n self.tree.handle,\n ...
[ "0.65065104", "0.6168138", "0.6168138", "0.6086465", "0.6064793", "0.60237354", "0.6013145", "0.59666854", "0.5928178", "0.592426", "0.591921", "0.5821204", "0.58120984", "0.58011585", "0.5799797", "0.5778036", "0.5778036", "0.5771436", "0.57671916", "0.57671916", "0.57248354...
0.80903965
0
Return Unsigned 64 bit value
def _get_u64(property_value): size = struct.calcsize('!Q') return struct.unpack('!Q', property_value[:size])[0], property_value[size:]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_uint64(self):\n return self.read(BitTypes.UINT_64.value)", "def u64(value: bytes, endian: str = \"little\", sign: bool = False) -> int:\n return unpack(value, 64, endian, sign)", "def ReadUInt64(self, endian=\"<\"):\n return self.unpack('%sQ' % endian, 8)", "def get_uint(val):\n ...
[ "0.7732684", "0.7446968", "0.72475135", "0.69126683", "0.6825021", "0.6811793", "0.6808178", "0.6808178", "0.6703142", "0.65805477", "0.6558285", "0.64141923", "0.6322656", "0.63142073", "0.61584127", "0.614074", "0.61293703", "0.61293703", "0.61291134", "0.6006034", "0.59875...
0.77944994
0
Get a profile config entry.
def async_profile_config_entry(self, profile: str) -> Optional[ConfigEntry]: entries = self.hass.config_entries.async_entries(const.DOMAIN) for entry in entries: if entry.data.get(const.PROFILE) == profile: return entry return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_profile(self):\n return self.sqlfluff_config.get_section(\n (self.templater_selector, self.name, \"profile\")\n )", "def get_profile(path=\"~\"):\n global profiles\n profile = profiles.get(path,None)\n if not profile:\n profile = InitFileConfig(os.path.join(path,...
[ "0.66670287", "0.6411377", "0.6361126", "0.6269245", "0.62344956", "0.62108827", "0.6192574", "0.6067322", "0.6047501", "0.6047501", "0.60274976", "0.5993081", "0.5978055", "0.5957146", "0.5954137", "0.592238", "0.59220034", "0.5870727", "0.586618", "0.5852387", "0.5836615", ...
0.778216
0
Create an entry for selecting a profile.
async def async_step_user(self, user_input=None): flow = self.hass.data.get(DATA_FLOW_IMPL) if not flow: return self.async_abort(reason="no_flows") if user_input: return await self.async_step_auth(user_input) return self.async_show_form( step_id="us...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_profile(sender, **kwargs):\n\n # I import profile here cause i can't import it right in the top.\n from .profiles import Profile\n\n user = kwargs['instance']\n\n Profile.objects.get_or_create(user=user)", "def createProfile(self):\n if self.profile:\n return\n from soc.modules....
[ "0.6810462", "0.6756266", "0.6752545", "0.6702942", "0.6544468", "0.652044", "0.6486107", "0.64638823", "0.64472526", "0.6446024", "0.6337883", "0.6322042", "0.63020146", "0.6233277", "0.6228291", "0.6228291", "0.6228291", "0.62151825", "0.6207635", "0.6181077", "0.6136875", ...
0.0
-1
Construct a InfraValidator component.
def __init__( self, model: types.BaseChannel, serving_spec: infra_validator_pb2.ServingSpec, examples: Optional[types.BaseChannel] = None, request_spec: Optional[infra_validator_pb2.RequestSpec] = None, validation_spec: Optional[infra_validator_pb2.ValidationSpec] = None): blessi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validator_instance(self):\n return CodingDNASubstitution(*self.params)", "def __init__(self,validator):\n self.validator = validator", "def __init__(self, *args):\n this = _libsbml.new_SBMLExternalValidator(*args)\n try: self.this.append(this)\n except: self.this = this",...
[ "0.5603296", "0.5553809", "0.54241323", "0.53484607", "0.52278566", "0.52126884", "0.51830024", "0.51698196", "0.5162531", "0.5120903", "0.5055932", "0.501882", "0.49940273", "0.49849048", "0.48895204", "0.48774824", "0.48774824", "0.48667395", "0.48442984", "0.4812087", "0.4...
0.66081
0
The default constraint on the maximum number of pods that can be run simultaneously on a node in the node pool of this cluster. Only honored if cluster created with IP Alias support.
def default_max_pods_constraint(self) -> 'outputs.MaxPodsConstraintResponse': return pulumi.get(self, "default_max_pods_constraint")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def max_pods_per_node(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"max_pods_per_node\")", "def __init__(__self__, *,\n max_pods_per_node: Optional[pulumi.Input[str]] = None):\n if max_pods_per_node is not None:\n pulumi.set(__self__, \"max_pods_per_no...
[ "0.72490424", "0.68969697", "0.68824875", "0.67405826", "0.67405826", "0.67405826", "0.67405826", "0.67405826", "0.649803", "0.649803", "0.63067025", "0.6065648", "0.60440755", "0.59721464", "0.5968138", "0.5968138", "0.59207267", "0.5918348", "0.58353317", "0.57983226", "0.5...
0.7413817
0
An optional description of this cluster.
def description(self) -> str: return pulumi.get(self, "description")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cluster_description(self):\n if self._cluster_description is None:\n if self._parsed_globals is None:\n client = self._session.create_client(\"eks\")\n else:\n client = self._session.create_client(\n \"eks\",\n reg...
[ "0.76005006", "0.6678997", "0.6652965", "0.65934986", "0.6575377", "0.65400887", "0.65400887", "0.65400887", "0.65400887", "0.65400887", "0.65400887", "0.65400887", "0.65400887", "0.65400887", "0.65400887", "0.65400887", "0.65400887", "0.65400887", "0.65400887", "0.65400887", ...
0.0
-1
Configure the maintenance policy for this cluster.
def maintenance_policy(self) -> 'outputs.MaintenancePolicyResponse': return pulumi.get(self, "maintenance_policy")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def maintainance(self, on_off, instance_type):\n print((\"enabling\" if on_off else \"disabling\") + \" Maintainer mode\")\n tries = 60\n while True:\n reply = self.send_request(\n instance_type,\n requests.put,\n \"/_admin/cluster/mainte...
[ "0.64312863", "0.623691", "0.5964941", "0.5939729", "0.58500016", "0.5806587", "0.569082", "0.5675406", "0.560191", "0.55524373", "0.5497656", "0.5389543", "0.5386789", "0.5330773", "0.53293234", "0.5314058", "0.5286401", "0.52688134", "0.52688134", "0.5238898", "0.52187634",...
0.57226455
6
[Output only] The size of the address space on each node for hosting containers. This is provisioned from within the `container_ipv4_cidr` range. This field will only be set when cluster is in routebased network mode.
def node_ipv4_cidr_size(self) -> int: return pulumi.get(self, "node_ipv4_cidr_size")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def size(self):\r\n return sum(pool.size() for pool in self.host_to_pool.values())", "def size(self):\n return self._container._size", "def max_node_size(self):\n return self.max_node_capacity", "def get_size(self, node: int):\n return self._servers[node].size + self._queues[node]...
[ "0.63324183", "0.6079987", "0.6069866", "0.60444885", "0.5908167", "0.59070915", "0.59035134", "0.58925134", "0.58586276", "0.574201", "0.5722505", "0.57091755", "0.5695193", "0.56881124", "0.56256837", "0.5572904", "0.55593646", "0.5550266", "0.55467", "0.54951555", "0.54932...
0.7194445
0
[Output only] The current status of this cluster.
def status(self) -> str: return pulumi.get(self, "status")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getClusterStatus(self):\n data = self.connect('get','cluster/status', None)\n return data", "def get_status(self):\n try:\n c = self._oc_command([\"status\"])\n o = run_cmd(c, return_output=True)\n for line in o.split('\\n'):\n logger.debug...
[ "0.8553311", "0.78891647", "0.7813006", "0.73891544", "0.73891544", "0.73891544", "0.73891544", "0.73891544", "0.73891544", "0.73891544", "0.73891544", "0.73891544", "0.73891544", "0.73891544", "0.73891544", "0.73891544", "0.73891544", "0.73891544", "0.73891544", "0.73891544", ...
0.70313823
54
Gets the details of a specific cluster.
def get_cluster(cluster_id: Optional[str] = None, location: Optional[str] = None, project: Optional[str] = None, opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetClusterResult: __args__ = dict() __args__['clusterId'] = cluster_id __args__['location'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def detail_cluster(cluster_name, znode):\n\n _cluster_info = dict()\n _cluster_info.update(app.clusters[cluster_name].__dict__)\n _cluster_info.pop(\"auth_data\", None)\n _cluster_info[\"connection\"] = app.managers[cluster_name]._client.state\n resp = Response(json.dumps(_cluster_info),\n ...
[ "0.7897404", "0.75417316", "0.7313178", "0.7272689", "0.7173806", "0.710711", "0.7080003", "0.7046904", "0.70306623", "0.7023701", "0.7007954", "0.6987795", "0.6888798", "0.68558335", "0.6829277", "0.6829277", "0.67708707", "0.6730021", "0.6724221", "0.67015386", "0.6658421",...
0.6339357
38
Gets the details of a specific cluster.
def get_cluster_output(cluster_id: Optional[pulumi.Input[str]] = None, location: Optional[pulumi.Input[str]] = None, project: Optional[pulumi.Input[Optional[str]]] = None, opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetClusterResult]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def detail_cluster(cluster_name, znode):\n\n _cluster_info = dict()\n _cluster_info.update(app.clusters[cluster_name].__dict__)\n _cluster_info.pop(\"auth_data\", None)\n _cluster_info[\"connection\"] = app.managers[cluster_name]._client.state\n resp = Response(json.dumps(_cluster_info),\n ...
[ "0.7897798", "0.7540865", "0.731198", "0.72720367", "0.7173309", "0.7105595", "0.70795816", "0.7044785", "0.7030576", "0.7023705", "0.70082265", "0.6988782", "0.6889642", "0.6854871", "0.68287843", "0.68287843", "0.6769925", "0.67298573", "0.6723058", "0.6700514", "0.6658565"...
0.6303932
42
Initialize the sensor entity.
def __init__(self, coordinator, sensor): self._name = f"{coordinator.data['deviceName']} {SENSOR_TYPES[sensor]}" self._sensor = sensor self.coordinator = coordinator self._unique_id = f"{coordinator.data['deviceID']}-{sensor}"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _initialize(self):\n self.flush()\n print(\"Initializing sensor...\")\n try:\n self.get_sample()\n print('Initialization successful')\n except:\n print('Initialization failed. Please disconnect and reconnect sensor.')", "def initialize(self):\n ...
[ "0.7230359", "0.70916075", "0.7091005", "0.6762784", "0.67036307", "0.6690288", "0.6670451", "0.6654925", "0.65851283", "0.65650827", "0.64943004", "0.64905995", "0.6485989", "0.6478384", "0.6428585", "0.6428585", "0.6428585", "0.6416432", "0.63569015", "0.6347496", "0.632133...
0.0
-1
Return the name of the sensor.
def name(self): return self._name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name(self):\n return self._sensor.name", "def get_sensor_name(self):\n return self.data[1]", "def name(self):\n return self.device.device_data[self.device_id]['name'] + \\\n f' {self._sensor_type}'", "def name(self):\n return f\"{self._name} {SENSOR_TYPES[self.senso...
[ "0.91896784", "0.9168378", "0.890185", "0.8770976", "0.8511273", "0.8479953", "0.844435", "0.8299758", "0.8186503", "0.8105667", "0.8079737", "0.8066149", "0.8049647", "0.7700968", "0.7612295", "0.7611456", "0.7600605", "0.7600605", "0.7600605", "0.75392073", "0.75166553", ...
0.0
-1
Return the device class.
def device_class(self): if self._sensor == "batteryLevel": return DEVICE_CLASS_BATTERY return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def device_class(self):\r\n return self._device_class", "def device_class(self):\n return self._device_class", "def device_class(self):\n return self._device_class", "def device_class(self):\n return self._device_class", "def device_class(self):\n return self._device_clas...
[ "0.9174014", "0.91620594", "0.91620594", "0.91620594", "0.91620594", "0.91620594", "0.907593", "0.9070195", "0.90696234", "0.9045985", "0.900636", "0.900636", "0.900636", "0.88951564", "0.8841795", "0.8841795", "0.8813498", "0.8746576", "0.87439585", "0.87439585", "0.8701672"...
0.7558658
49
This function receives a data frame saves it as csv file. By default all csv files will be saved on the same data folder (WeatherGenerator/Data).
def save_csvFile(df,file_location,file_name,sep,encoding): try: date=datetime.datetime.now().replace(microsecond=0) fullpath=file_location + file_name df.to_csv(fullpath, sep=sep, encoding=encoding, index=False, header=True) except IOError: print('Error saving the file: ' , file_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_df(data_frame, file_path):\r\n data_frame.to_csv(file_path)\r\n return None", "def to_csv(df: pd.DataFrame, name: str, time_series=False) -> None:\n abs_dir = os.path.dirname(__file__)\n if time_series:\n rel_dir = os.path.join(abs_dir, 'eikon_time_series_files')\n else:\n r...
[ "0.7642509", "0.7587368", "0.75801885", "0.749137", "0.7390332", "0.73413545", "0.7337835", "0.7332336", "0.7270352", "0.72200686", "0.7219331", "0.7153811", "0.7128128", "0.71032315", "0.709886", "0.70687246", "0.70483303", "0.7038225", "0.70165855", "0.6952389", "0.6939272"...
0.7485409
4
This function will return a random datetime between two datetime objects.
def get_randomDate(start_date, end_date): delta = end_date - start_date int_delta = (delta.days * 24 * 60 * 60) + delta.seconds random_second = random.randrange(int_delta) random_date = start_date + datetime.timedelta(seconds=random_second) return random_date
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def random_date(start, end):\r\n return start + datetime.timedelta(\r\n # Get a random amount of seconds between `start` and `end`\r\n seconds=random.randint(0, int((end - start).total_seconds())),\r\n )", "def random_date(start, end):\r\n delta = end - start\r\n int_delta = (delta.days...
[ "0.7791904", "0.7564631", "0.7562412", "0.7530505", "0.75095034", "0.75095034", "0.75095034", "0.75095034", "0.75095034", "0.7405501", "0.73354554", "0.723516", "0.72078717", "0.71699125", "0.6945227", "0.68628716", "0.67520624", "0.66040426", "0.6575143", "0.6524325", "0.624...
0.75455165
3
Test for exception for invalid rover heading direction from the the instructions
def test_get_heading_raise_exception(self): rover = Rover(self.plateau_dimensions, self.rover_initial_position, 8) with self.assertRaises(InvalidDirectionError): rover.get_heading
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_condition(direction, steps):\n assert direction in ['L', 'R', 'U', 'D'], \"Direction information has an incorrect alphabet\"\n assert steps > 0, \"Step value is zero\"", "def move_invalid():\n check50.run(run_command).stdin(\"EAST\").stdout(\"Invalid command.\")", "def verify_legal_move(self...
[ "0.65833044", "0.6357308", "0.62598133", "0.6221409", "0.6108726", "0.6033738", "0.59482646", "0.59148085", "0.5909448", "0.5874125", "0.5872158", "0.5871811", "0.57743484", "0.5769745", "0.57350487", "0.5729894", "0.5703237", "0.5687465", "0.567887", "0.5635186", "0.56183463...
0.6877422
0
Get current scene name.
def get_current_scene_name(): scene_name = cmds.file(query=True, sceneName=True, shortName=True) scene_name = osp.splitext(scene_name)[0] return scene_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_scene_name(self):\n return self._document.GetDocumentName()", "def name(self):\n return self._scene_name", "def currentBaseSceneName(self):\n logger.debug(\"Func: currentBaseSceneName/getter\")\n\n return self._currentBaseSceneName", "def scene_name():\n\n pass", "def bsp...
[ "0.8562304", "0.8504572", "0.8130134", "0.76879084", "0.7049954", "0.67965925", "0.6732677", "0.6724501", "0.66471833", "0.6629287", "0.659216", "0.659216", "0.659216", "0.659216", "0.659216", "0.659216", "0.659216", "0.659216", "0.659216", "0.659216", "0.659216", "0.659216...
0.87072027
0
Return True if no event was received for more that self._timeout seconds.
def inactive(self): return time.time() - self.last_activity > self._timeout
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_timeout(self) -> bool:\n\n return bool(self.timeout)", "def is_timeout(self) -> bool:\n return self.runtime.timeout <= 0.0", "def haveTime(self):\n if self.timeout is None:\n return True\n return time.time() <= self._stop", "def has_timed_out(self):\n ret...
[ "0.78861916", "0.75421256", "0.7503443", "0.74547696", "0.7451348", "0.7334026", "0.7321874", "0.7296838", "0.72828937", "0.7145972", "0.71218836", "0.7006994", "0.70036685", "0.6940974", "0.6886329", "0.6866522", "0.68532044", "0.6839235", "0.68082976", "0.6778195", "0.67576...
0.63674796
41
r"""A Wrapper for tensorboard SummaryWriter. It creates a dummy writer when log_dir is empty string or None. It also has functionality that generates tb video directly from numpy images.
def __init__( self, log_dir: str, *args: Any, resume_run_id: Optional[str] = None, **kwargs: Any, ): self.writer = None if log_dir is not None and len(log_dir) > 0: self.writer = SummaryWriter(log_dir, *args, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_tensorboard_writer(results_dir):\n return SummaryWriter(os.path.join(results_dir, \"tensorboard\"))", "def build_tensorboard(self):\n self.writer = SummaryWriter(log_dir=self.log_dir)", "def __init__(self, log_dir):\n self.writer = tf.summary.create_file_writer(log_dir)", "def __in...
[ "0.70837986", "0.6822536", "0.67881095", "0.67448044", "0.6740439", "0.653547", "0.6499817", "0.649777", "0.6493077", "0.64700574", "0.6467797", "0.62770206", "0.6270831", "0.61230636", "0.60727465", "0.6061636", "0.60464215", "0.59820116", "0.5820206", "0.57858354", "0.57605...
0.62245476
13
Decorator to "register" a mock method. `name` is required. Unlike `remote_method`, and `Mock.method`, this doesn't immediately add functions to a `Registry` instead, it sets an attribute on the function, allowing such functions to be recognised when the test case is instantiated.
def mock_method(name): def decorator(func): """ Return `func`, with the `mock_method.attr_name` attribute set. """ setattr(func, mock_method.attr_name, name) return func # Set an attribute on `decorator`. This can be used to discover situations # where `mock_method...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def decorator(func):\n\n setattr(func, mock_method.attr_name, name)\n return func", "def builtin_wrapper(method_name):\n def wrapper(self, *args, **kwargs):\n if method_name not in self.__dict__:\n raise AttributeError(\n \"object '%s' has no mock method '%s'\" %...
[ "0.7267121", "0.6734391", "0.65233094", "0.64206845", "0.6276636", "0.6275976", "0.62199324", "0.61470366", "0.6111515", "0.60806227", "0.60078967", "0.59150237", "0.57728004", "0.57687855", "0.5745724", "0.57455486", "0.5732674", "0.5726623", "0.57248616", "0.5696047", "0.56...
0.74133193
0
Constructor for the InputSpec_FileTimeFilter class
def __init__(self, change_time_range_end_secs=None, change_time_range_start_secs=None, ): # Initialize members of the class self.change_time_range_end_secs = change_time_range_end_secs self.change_time_range_start_secs = change_time_range_start_secs
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, file_path, day, exec_time):\n\n self.file_path = file_path\n self.day = day\n self.exec_time = exec_time", "def from_filetime(self):\n reason = \"[!] Microsoft FILETIME timestamps are 2 sets of 8 hex characters (4 bytes), separated by a colon\"\n ts_type = se...
[ "0.6358217", "0.63409555", "0.6320702", "0.62546915", "0.6202406", "0.6152201", "0.6085748", "0.6076846", "0.6069727", "0.59726804", "0.5960691", "0.59265167", "0.5924161", "0.59126186", "0.5910627", "0.5856921", "0.57780313", "0.5768944", "0.57120574", "0.56999254", "0.56876...
0.0
-1
Creates an instance of this model from a dictionary
def from_dictionary(cls, dictionary): if dictionary is None: return None # Extract variables from the dictionary change_time_range_end_secs = dictionary.get('changeTimeRangeEndSecs') change_time_range_start_secs = dictionary.get('changeTimeRangeStartS...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_dictionary(cls,\n dictionary):\n if dictionary is None:\n return None\n\n # Extract variables from the dictionary\n id = dictionary.get('id')\n name = dictionary.get('name')\n mtype = dictionary.get('type')\n usage_bytes = diction...
[ "0.83181363", "0.8168959", "0.8168959", "0.81190246", "0.8089133", "0.79781497", "0.79491246", "0.792305", "0.7898849", "0.7895396", "0.78879154", "0.78826", "0.7881249", "0.78768563", "0.7858234", "0.7840083", "0.7804028", "0.7804028", "0.7804028", "0.7804028", "0.7804028", ...
0.0
-1
Show the user the home view.
def home(): payload = manager.get_payload() return render_template('index.html', payload=payload)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def home(request):\n if request.user.is_authenticated():\n return HttpResponseRedirect('logged-in')\n else:\n home_view = 1\n return render_to_response('content/home.html', {'version': version, \"home_view\":home_view},\n RequestContext(request))", "def...
[ "0.7822083", "0.7681199", "0.7657261", "0.7621443", "0.7581386", "0.7562457", "0.7542981", "0.74898934", "0.7455843", "0.74304396", "0.739116", "0.73809606", "0.7374586", "0.7372637", "0.7370815", "0.7368356", "0.73586553", "0.73586553", "0.73586553", "0.73586553", "0.7358655...
0.71515113
57
Make a colormap that interpolates between a set of colors
def gradient_cmap(gcolors, nsteps=256, bounds=None): from matplotlib.colors import LinearSegmentedColormap ncolors = len(gcolors) if bounds is None: bounds = np.linspace(0, 1, ncolors) reds = [] greens = [] blues = [] alphas = [] for b, c in zip(bounds, gcolors): reds.a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def colors_to_cmap(colors):\n colors = np.asarray(colors)\n if colors.shape[1] == 3:\n colors = np.hstack((colors, np.ones((len(colors),1))))\n steps = (0.5 + np.asarray(range(len(colors)-1), dtype=np.float))/(len(colors) - 1)\n return matplotlib.colors.LinearSegmentedColormap(\n 'auto_cm...
[ "0.7055231", "0.70238847", "0.697991", "0.6821794", "0.66445976", "0.64763236", "0.6431895", "0.6399483", "0.6385551", "0.6385279", "0.63844943", "0.6378595", "0.6367068", "0.63656914", "0.6358004", "0.6350998", "0.63482785", "0.63321567", "0.6314091", "0.6309613", "0.6234388...
0.57706785
79
Main route, entry point for react.
def main(methods=["GET"]): validate_auth() ## issue with path resolution after build return send_from_directory( #todo: remove templates directory reference; index.html isn't a jinja template safe_join(current_app.static_folder, 'templates'), 'index.html', cache_timeout=-1 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\n return render_template('index.html')", "def main():\n return render_template('index.html')", "def entry_point():\n return render_template(\"index.html\")", "def index():\n return render_template(\"main.html\")", "def index():\n return render_template('main.html')", "def index...
[ "0.6447276", "0.6447276", "0.64463717", "0.62885624", "0.62535536", "0.62535536", "0.6203376", "0.61515373", "0.61481404", "0.61362463", "0.6129602", "0.61003274", "0.6099093", "0.60786444", "0.60769945", "0.6044359", "0.6034689", "0.6023297", "0.60171825", "0.59856635", "0.5...
0.5889983
29
Query HAPI for resource_type and return as JSON FHIR Bundle NB not decorated with `.require_login` as that does an implicit redirect. Client should watch for 401 and redirect appropriately.
def resource_bundle(resource_type, methods=["GET"]): token = validate_auth() url = current_app.config.get('MAP_API') + resource_type params = {'_count': 1000} params.update(request.args) resp = requests.get(url, auth=BearerAuth(token), params=params) try: resp.raise_for_status() exce...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resource_by_id(resource_type, resource_id, methods=[\"GET\"]):\n token = validate_auth()\n url = f\"{current_app.config.get('MAP_API')}{resource_type}/{resource_id}\"\n resp = requests.get(url, auth=BearerAuth(token))\n try:\n resp.raise_for_status()\n except requests.exceptions.HTTPError...
[ "0.6384943", "0.59034264", "0.58505565", "0.58505565", "0.5843548", "0.57318074", "0.57253337", "0.5722467", "0.5722467", "0.5722467", "0.5722467", "0.5722467", "0.5609039", "0.5602633", "0.55896556", "0.5560408", "0.55597615", "0.54899234", "0.54797965", "0.5467379", "0.5423...
0.6920961
0
Opens MS Excel spreadsheet and converts it to a pandas DataFrame Arguments
def read_data(self, input_file, num_bin = 3): input_data = pd.read_excel(input_file) renamed_columns = list(input_data.columns) for i in range(len(renamed_columns)): """Rename 'Unnamed' columns that are formed from merged cells. These will form bins for analysis""" ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_data(self) -> pd.DataFrame:\n\n if not os.path.exists(self.file_name):\n raise FileNotFoundError(f\"File does not exist: {self.file_name}\")\n\n _, ext = os.path.splitext(self.file_name)\n assert ext == \".xls\", \"Invalid filetype attempted to load\"\n\n return pd.r...
[ "0.6927821", "0.68101346", "0.6791269", "0.6779291", "0.65881425", "0.65550566", "0.6459987", "0.64265513", "0.6392646", "0.6365372", "0.6361536", "0.6303345", "0.6301174", "0.62911224", "0.6281604", "0.6263413", "0.6236919", "0.62304354", "0.6213377", "0.6197233", "0.6163493...
0.0
-1
Check if the given word is a number. Return True in case it is together with the tuple('number', value)
def __isNumber__(self, word): try: return ('number', int(word)), True except ValueError: return None, False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isNumber(word):\n try:\n int(word)\n return True\n except ValueError:\n return False", "def is_number(text):\n return text.lower() in AVRO_NUMBERS", "def _is_num(w):\n symbols = list(w)\n for s in symbols:\n if s in string.digits:\n ...
[ "0.789358", "0.7467294", "0.7333102", "0.6969791", "0.6964006", "0.6943701", "0.6941617", "0.6911992", "0.6892562", "0.6856893", "0.6847538", "0.683996", "0.68387276", "0.68271315", "0.6822781", "0.68095434", "0.68031216", "0.67755413", "0.67716694", "0.67705446", "0.67630583...
0.80926466
0
Split the given message into words. Return an array of tuples with (TYPE, WORD)
def scan(self, message): words = message.split(" ") for word in words: self.words.append(self.__check_word__(word)) return self.words
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getWords(speech):\r\n return speech.split()", "def get_words(message):\n all_words = set(wordpunct_tokenize(message.replace('=\\\\n', '').lower()))\n\n # verwijder stopwoorden alsook worden waarvan lengte <=2\n msg_words = [word for word in all_words if word not in stopwords and len(word) > 2]\n\...
[ "0.66460824", "0.6443859", "0.6398183", "0.637118", "0.6302318", "0.62749106", "0.6269124", "0.6215595", "0.6203069", "0.62026393", "0.62026393", "0.61878115", "0.6163675", "0.6147167", "0.6147167", "0.6147167", "0.6147167", "0.6147167", "0.6146015", "0.6146015", "0.6129641",...
0.66256505
1
function that checks if a word is a number or not
def isNumber(word): try: int(word) return True except ValueError: return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_number(text):\n return text.lower() in AVRO_NUMBERS", "def _is_num(w):\n symbols = list(w)\n for s in symbols:\n if s in string.digits:\n return '<NUM>'\n return w", "def isnum(self, x):\n\n return x in '1234567890.-'", "def ...
[ "0.78436583", "0.7706737", "0.75962543", "0.7555199", "0.75409734", "0.75214046", "0.75180584", "0.7509221", "0.7465878", "0.7459621", "0.74367565", "0.7393404", "0.7370456", "0.73683584", "0.7351673", "0.7326669", "0.7314529", "0.728529", "0.7263139", "0.721123", "0.71813613...
0.8211872
0
Returns None if this is the base class. Returns the type of project if this is a valid project.
def project_type(self): project_type = self.__class__.__name__.lower() if project_type == 'baseproject': project_type = None return project_type
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def project(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"project\")", "def project(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"project\")", "def project(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"project\")", "def project(...
[ "0.6679888", "0.6679888", "0.6679888", "0.6679888", "0.6679888", "0.6679888", "0.6679888", "0.6679888", "0.6679888", "0.6679888", "0.6679888", "0.6679888", "0.6679888", "0.6679888", "0.6679888", "0.6679888", "0.6679888", "0.6679888", "0.6679888", "0.6679888", "0.6569116", "...
0.87560594
0
Add a vertex to the graph.
def add_vertex(self, vertex_id): if vertex_id not in self.vertices: self.vertices[vertex_id] = set()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_vertex(self, vertex):\n raise NotImplementedError", "def add_vertex(self, vertex):\n if isinstance(vertex, Vertex):\n self.vertices.append(vertex)\n return\n raise TypeError('Is not vertex instance!')", "def add_vertex(self, vertex_name: n):\n new_verte...
[ "0.8703537", "0.84338593", "0.8423067", "0.8409588", "0.83660835", "0.8317327", "0.8255059", "0.8086839", "0.8082268", "0.803738", "0.80348116", "0.7882737", "0.78723216", "0.7840483", "0.7840483", "0.7762625", "0.775688", "0.77160776", "0.7714244", "0.7668677", "0.76634395",...
0.71977395
45
Add a directed edge to the graph.
def add_edge(self, v1, v2): if v1 in self.vertices and v2 in self.vertices: self.vertices[v1].add(v2) else: raise IndexError("Nonexistant Vert.")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_edge(self, edge):\n src = edge.get_source()\n dest = edge.get_destination()\n #weightEdge = WeightedEdge(src, dest, edge.get_total_distance(), edge.get_outdoor_distance())\n if not (src in self.edges and dest in self.edges):\n raise ValueError('Node not in graph')\n ...
[ "0.78169996", "0.77789694", "0.7618847", "0.761851", "0.75694674", "0.7547367", "0.7483565", "0.7437083", "0.74284625", "0.7422367", "0.741715", "0.7337182", "0.73281914", "0.7266331", "0.7227267", "0.7212267", "0.71977764", "0.7194343", "0.71735585", "0.7168542", "0.7152955"...
0.64732856
84
Get all neighbors (edges) of a vertex.
def get_neighbors(self, vertex_id): return self.vertices[vertex_id]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def neighbors_in(self, vertex):\n return list(self.neighbor_in_iterator(vertex))", "def neighbors_out(self, vertex):\n return list(self.neighbor_out_iterator(vertex))", "def get_neighbours(self, vertex):\n output = []\n \n if vertex in self.adjacency_list:\n for ne...
[ "0.8146605", "0.7827587", "0.78129476", "0.7634852", "0.7618999", "0.7560592", "0.73914623", "0.7361076", "0.73325294", "0.72803164", "0.7162256", "0.71298254", "0.7084523", "0.70770735", "0.7035943", "0.6989027", "0.6977301", "0.6921764", "0.6862733", "0.68447185", "0.683753...
0.7294812
14
Read the power spectra.
def read_ps(file_name, spectra=None): data = np.loadtxt(file_name) if spectra is None: return data[:, 0], data[:, 1] l = data[:, 0] ps = {spec: data[:, i + 1] for i, spec in enumerate(spectra)} return l, ps
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def spectrum(self):\r\n f, spectrum = tsa.get_spectra(self.input.data, method=self.method)\r\n return spectrum", "def _get_all_spectra(self):\n pass", "def read_power(self):\n return(self.power)", "def read_spectrum(specfile):\n hdu = pyfits.open(specfile)\n w = [a[0] for a ...
[ "0.6329057", "0.61971503", "0.613785", "0.6120758", "0.6106788", "0.60167044", "0.5948364", "0.59256417", "0.59231085", "0.5865226", "0.5854366", "0.582095", "0.58152694", "0.578552", "0.57659465", "0.57477266", "0.5726273", "0.571724", "0.57160217", "0.5703028", "0.5693531",...
0.5718962
17
Override config_test to mitigate configtest error in vanilla installation of mod_ssl in Fedora. The error is caused by nonexistent selfsigned certificates referenced by the configuration, that would be autogenerated during the first (re)start of httpd.
def config_test(self) -> None: os_info = util.get_os_info() fedora = os_info[0].lower() == "fedora" try: super().config_test() except errors.MisconfigurationError: if fedora: self._try_restart_fedora() else: raise
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_ssl_default(self):\n assert security.security_settings.ssl_verify()", "def test_tls_client_minimum_1_point_3_missing(self):\n # thanks i hate it\n if hasattr(SSL, \"OP_NO_TLSv1_3\"):\n OP_NO_TLSv1_3 = SSL.OP_NO_TLSv1_3\n delattr(SSL, \"OP_NO_TLSv1_3\")\n ...
[ "0.6727355", "0.63705546", "0.6329668", "0.6128186", "0.6121189", "0.6027173", "0.5984769", "0.595791", "0.5845316", "0.5811212", "0.5764254", "0.5710378", "0.5709384", "0.5708145", "0.5704409", "0.56836855", "0.567058", "0.5670131", "0.5651558", "0.5639474", "0.5631079", "...
0.61838734
3
Sprite needs to be a pygame.image object.
def __init__(self, sprite): self.sprite = sprite
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n # Call the parent class (Sprite) constructor\n super().__init__()\n\n self.image = pygame.Surface([20, 20])\n self.image.fill(RED)\n\n self.rect = self.image.get_rect()", "def __init__(self):\n # Call the pare...
[ "0.6985332", "0.6973626", "0.6831595", "0.6831595", "0.67319673", "0.67185324", "0.66925913", "0.6686012", "0.6662481", "0.6637729", "0.6637485", "0.6610897", "0.660033", "0.6596914", "0.6587467", "0.65714735", "0.64629394", "0.6451392", "0.6406171", "0.63714856", "0.6319911"...
0.7154421
0
Loads environment for inference mode, used in jupyter notebook.
def load_env(data_dir, model_dir): model_params = sketch_rnn_model.get_default_hparams() with tf.gfile.Open(os.path.join(model_dir, 'model_config.json'), 'r') as f: model_params.parse_json(f.read()) return load_dataset(data_dir, model_params, inference_mode=True)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_environment(self):\n # import outside of cell so we don't get a traceback\n from sage import all_cmdline\n from sage.repl.user_globals import initialize_globals\n initialize_globals(all_cmdline, self.shell.user_ns)\n self.run_init()", "def load_environment(self, env):\...
[ "0.62730896", "0.6208105", "0.6028741", "0.586392", "0.58456445", "0.5837497", "0.57491773", "0.57484585", "0.5718714", "0.5686432", "0.563619", "0.5559297", "0.5552985", "0.55186814", "0.54520696", "0.54429024", "0.5422108", "0.5422108", "0.5422108", "0.5422108", "0.5422108"...
0.65105677
0