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 True only if the Tile has count 0 i.e. it has no mines adjacent to it
def isZero(self): return self.count == 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def any_empty_tiles(self):\n for i in range(self.TILES_PER_ROW):\n for j in range(self.TILES_PER_ROW):\n if self.main_grid_values[i][j] == 0:\n return True\n\n return False", "def isTileBlank(tile):\n for b in tile:\n if b: return False\n re...
[ "0.7799078", "0.7427767", "0.7185542", "0.7111375", "0.69787025", "0.6943347", "0.69299424", "0.6899662", "0.6868513", "0.66971016", "0.66778773", "0.6673429", "0.66724366", "0.66404444", "0.66022205", "0.6578065", "0.6565698", "0.65389836", "0.6528692", "0.6512142", "0.64862...
0.6246743
75
sets up the Frame and Labels to be used
def setUpFrame(self): #adds labels to the Board self.mineLabel = tk.Label(self, text="Mines: "+str(self.numMines)) self.mineLabel.grid(row=0, column=0, sticky="W", columnspan=int((self.cols-2)/2)) self.smileButton = tk.Label(self, image=self.images[1]) self.smileButton.grid(row=0...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Define_Frame(self):\n self.frame=Frame(self.master, relief=GROOVE, bd=4)\n self.frame.grid(row=0,column=1,rowspan=2,columnspan=2)\n frame_title = Label(self.frame,text=\"Stage Control\",relief=RAISED,bd=2,width=24, bg=\"light yellow\",font=(\"Times\", 16))\n frame_title.grid(row=0, ...
[ "0.7544622", "0.75399923", "0.7160371", "0.700181", "0.6993383", "0.6987549", "0.693042", "0.68723804", "0.68431395", "0.6841213", "0.68293494", "0.6811473", "0.67933005", "0.67782164", "0.6755658", "0.67353123", "0.67290145", "0.66983646", "0.66882557", "0.66620207", "0.6655...
0.76427805
0
Returns a list of Tiles adjacent to self.tiles[row][col]
def getAdjacentTiles(self, row, col): adjacency = [] if row-1 >= 0: if col-1 >= 0: adjacency.append(self.tiles[row-1][col-1]) if col+1 < self.cols: adjacency.append(self.tiles[row-1][col+1]) adjacency.append(self.tiles[row-1][col]) if col-1 >= 0: adjacency.app...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def adjacent_tiles(self,tile,pattern):\n\n # Initialize the list of tiles to return\n adj_tiles = []\n\n # Find the row and column of the input tile\n for i in self.tilelist:\n for j in i:\n if j == tile:\n row = self.tilelist.index(i)\n ...
[ "0.72973114", "0.71875554", "0.7148474", "0.71376336", "0.705874", "0.6981794", "0.69214076", "0.68788856", "0.68238246", "0.68225366", "0.67235833", "0.6686271", "0.6669075", "0.6657436", "0.6635436", "0.6622865", "0.65752494", "0.6510529", "0.6490984", "0.6426009", "0.64188...
0.80199665
0
Gets the name of this Brand. Name of the brand.
def name(self): return self._name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_name(self) -> str:\n\n return self.name_", "def get_name(self) -> str:\n return self.name", "def get_name(self) -> str:\n return self.name", "def get_name(self) -> str:\n return self.name", "def get_name(self) -> str:\n return self._name", "def get_name(self) ->...
[ "0.7795435", "0.7675976", "0.7675976", "0.7675976", "0.7671389", "0.7671389", "0.76659703", "0.76659703", "0.7632508", "0.7612448", "0.760823", "0.75720346", "0.75720346", "0.75720346", "0.75720346", "0.75720346", "0.75720346", "0.75720346", "0.75720346", "0.75720346", "0.757...
0.0
-1
Sets the name of this Brand. Name of the brand.
def name(self, name): if name is None: raise ValueError("Invalid value for `name`, must not be `None`") self._name = name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SetName(self, name):\n self.name = name", "def set_name(self, name):\n self.name = name", "def set_name(self, name):\n self.name = name", "def set_name(self, name):\n self.name = name", "def set_name(self, name):\n self.name = name", "def set_name(self, name):\n ...
[ "0.7802179", "0.7787452", "0.7787452", "0.7787452", "0.7787452", "0.7787452", "0.77743727", "0.77438456", "0.76746845", "0.7666501", "0.7666501", "0.758367", "0.7513335", "0.7492586", "0.74826497", "0.74622566", "0.7456038", "0.74225175", "0.73982596", "0.73982596", "0.733680...
0.6975718
70
Gets the ocpc of this Brand. Open Cannabis Product Code for the brand.
def ocpc(self): return self._ocpc
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_occr(self):\n return self._occr_array", "def getObcType(): \n return simuConfig[\"OBC\"]", "def getC(self):\n\t\treturn self.c", "def _get_cbase(self):\n from PSCalib.CalibParsBasePnccdV1 import CalibParsBasePnccdV1\n return CalibParsBasePnccdV1()", "def brand(self) -> objec...
[ "0.62935966", "0.6091956", "0.58740455", "0.5798331", "0.5681632", "0.5631757", "0.55966634", "0.558785", "0.558676", "0.5518612", "0.54687154", "0.5444637", "0.5432168", "0.5428139", "0.5394201", "0.53779477", "0.5367507", "0.53472936", "0.52756715", "0.5263588", "0.5236587"...
0.7520303
0
Gets the flowers of this Brand. OCPCs of the flowers from this brand.
def flowers(self): return self._flowers
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def funnels(self):\r\n return resources.Funnels(self)", "def getScatterers(self):\n return self.scatterers", "def travelers(self):\n return self._travelers", "def flowers(self, flowers):\n\n self._flowers = flowers", "def fcvs(self): \n return self._link_reg.fcvs",...
[ "0.6138125", "0.5807703", "0.54127574", "0.5399067", "0.5316327", "0.5261371", "0.52180266", "0.5177034", "0.51683444", "0.50811946", "0.49370635", "0.49328735", "0.4917407", "0.49171916", "0.49171916", "0.49038213", "0.49015483", "0.4899251", "0.48930192", "0.48838463", "0.4...
0.7915461
0
Gets the edibles of this Brand. OCPCs of the edibles from this brand.
def edibles(self): return self._edibles
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self) -> list:\n return self.__expedition", "def get_escobas(self):\n return self.escobas", "def escobas(self):\n return self._escobas", "def edibles(self, edibles):\n\n self._edibles = edibles", "def energies(self) -> np.ndarray:\n return np.array([item.energy fo...
[ "0.6675802", "0.661738", "0.66034377", "0.62080145", "0.6023536", "0.5934542", "0.5931936", "0.58610815", "0.5732703", "0.5711136", "0.56978786", "0.5690391", "0.5612935", "0.55846983", "0.55846983", "0.55751747", "0.5565897", "0.55330265", "0.5528248", "0.55117154", "0.54840...
0.7684369
0
Gets the products of this Brand. OCPCs of the products from this brand.
def products(self): return self._products
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_products(self):\n return self._make_get_request(self._urls['products'])", "def ListProducts(self):\n return copy.deepcopy(self._products)", "def products(self):\r\n return products.Products(self)", "def products(self):\n return list(Product.select())", "def get(self):\n...
[ "0.76241523", "0.7566509", "0.7565762", "0.756514", "0.7535659", "0.751238", "0.7440312", "0.7398282", "0.7388195", "0.72041655", "0.71844614", "0.71142894", "0.71076566", "0.7074467", "0.7047273", "0.7024207", "0.69793373", "0.6892202", "0.67760795", "0.6706479", "0.6648986"...
0.7824494
0
Sets the updated_at of this Brand. Date and time record was updated, UTC.
def updated_at(self, updated_at): self._updated_at = updated_at
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def updated_at(self, updated_at: \"datetime\"):\n self._attrs[\"updatedAt\"] = updated_at", "def updated_at(self, updated_at: \"datetime\"):\n self._attrs[\"updatedAt\"] = updated_at", "def updated_at(self, updated_at: \"datetime\"):\n self._attrs[\"updatedAt\"] = updated_at", "def save(...
[ "0.80089986", "0.80089986", "0.80089986", "0.6998452", "0.6779702", "0.6779702", "0.6779702", "0.6750131", "0.66970265", "0.645862", "0.639973", "0.639973", "0.63979906", "0.63979906", "0.63979906", "0.63037896", "0.6228222", "0.62032646", "0.6170691", "0.6170691", "0.6085778...
0.7651877
8
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, Brand): return False return self.__dict__ == other.__dict__
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False", "def __eq__(self, other):\n if i...
[ "0.8089204", "0.8089204", "0.8055265", "0.7983358", "0.7967577", "0.7967577", "0.7967577", "0.7967577", "0.7967577", "0.7967577", "0.7967577", "0.7967577", "0.7967577", "0.7967577", "0.7967577", "0.7967577", "0.7967577", "0.7967577", "0.7967577", "0.7967577", "0.7967577", "...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): return not self == other
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other) -> bool:\n return not self.__eq__(other)", "def __eq__(self, other):\n ...
[ "0.8456082", "0.83912885", "0.81436425", "0.81406975", "0.8131807", "0.8093013", "0.80912536", "0.80912536", "0.80912536", "0.8084505", "0.8084505", "0.8075543", "0.8075543", "0.8065009" ]
0.0
-1
Fetch an account from account table by id.
def getAccountById(accountNumber, column: str="*"): cursor = connection.cursor(dictionary=True) if column == None: column = "account_number, account_type, owner_id, open_date, status, balance" join="" if "account_type" in column: column = column.replace("account_type", " t.description a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def account(self, account_id: str):\n return get_from_list(self.accounts, \"id\", account_id)", "def get_account_by_id(self, id_):\n return next((account for account in self.accounts\n if account.id == id_), None)", "def get(self, account_id):\n self.client.get_account(...
[ "0.7722388", "0.7696326", "0.75732964", "0.7395148", "0.7151799", "0.7004236", "0.69436747", "0.68923986", "0.67813635", "0.67745876", "0.6617013", "0.65324706", "0.6490152", "0.64764893", "0.6441378", "0.6440555", "0.6424269", "0.6400412", "0.6363036", "0.6363036", "0.635322...
0.0
-1
Initialize this priority queue.
def __init__(self): # Initialize a new binary min heap to store the items self.heap = MinHeap()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, initial_node):\n self.__nodes = MinPriorityQueue({initial_node : initial_node.estimate})", "def __init__(self):\n self.frontier_index = 0 # the number of items ever added to the frontier\n self.frontierpq = [] # the frontier priority queue", "def __init__(self):\r\n\r\...
[ "0.75090885", "0.74737185", "0.7275305", "0.7167532", "0.71084565", "0.7091826", "0.7090116", "0.7077953", "0.6942416", "0.6933994", "0.6912742", "0.6909663", "0.6839447", "0.6829182", "0.68145674", "0.6789476", "0.6762883", "0.67626905", "0.67386436", "0.67363226", "0.672859...
0.6892697
12
Return a string representation of this priority queue.
def __repr__(self): return 'PriorityQueue({} items, front={})'.format(self.size(), self.front())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __repr__(self):\n return str(self._queue_items)", "def __str__(self):\n data_str = [str(i) for i in self._data]\n return \"QUEUE { \" + \", \".join(data_str) + \" }\"", "def __str__(self):\n data_str = [str(i) for i in self._data]\n return \"QUEUE { \" + \", \".join(data_...
[ "0.80490476", "0.76343757", "0.76343757", "0.7606811", "0.7515623", "0.74697816", "0.7391219", "0.72890997", "0.72077906", "0.71557087", "0.7066766", "0.7015214", "0.69701236", "0.69701236", "0.69701236", "0.69171065", "0.69171065", "0.69171065", "0.69171065", "0.69171065", "...
0.7990086
1
Return True if this priority queue is empty, or False otherwise.
def is_empty(self): return self.heap.is_empty()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_empty(self):\n return len(self.priority_queue) == 0", "def is_empty(self):\n return len(self.the_queue) == 0", "def is_empty(self):\n return self.queue == []", "def is_empty(self):\n return len(self.queue) == 0", "def is_empty(self):\n return len(self.queue) == 0",...
[ "0.916854", "0.8780092", "0.8745896", "0.87435997", "0.87435997", "0.8738199", "0.8725628", "0.8692041", "0.868676", "0.86847174", "0.86025757", "0.8592845", "0.8589161", "0.8536647", "0.8532508", "0.85269547", "0.8518892", "0.85126805", "0.85126805", "0.84871095", "0.8473837...
0.8540069
13
Return the number of items in this priority queue.
def length(self): return self.heap.size()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def size(self):\n return len(self._queue_items)", "def items_count(self):\n return len(self.items)", "def items_num(self):\n return len(self.items)", "def get_num_items(self):\r\n return self.num_items", "def items_num(self):\n\t\treturn len(self.items)", "def items_num(self):...
[ "0.7935694", "0.7764795", "0.77374953", "0.77127", "0.7679694", "0.7679694", "0.760963", "0.75787795", "0.7573082", "0.7573082", "0.7573082", "0.7573082", "0.75700706", "0.75480986", "0.75378764", "0.75378764", "0.7501952", "0.7458939", "0.736914", "0.73530656", "0.7349804", ...
0.6848756
92
Return the item at the front of this priority queue without removing it, or None if this priority queue is empty.
def front(self): if self.size() < 1: return None else: # TODO: Return min item from heap, if any ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def front(self):\n return self.queue[0] if not self.empty() else None", "def top(self): # O(1)\n if not self.queue:\n return None\n return self.queue[0]", "def peek_front(self):\n\n if self.items:\n return self.items[0]\n return Non...
[ "0.83861667", "0.812015", "0.79910254", "0.7972703", "0.79355526", "0.79029673", "0.7864357", "0.7844265", "0.76888186", "0.7597412", "0.75942206", "0.7568451", "0.7565252", "0.75484496", "0.7531286", "0.75137365", "0.75074184", "0.7491985", "0.74702764", "0.74702764", "0.746...
0.83011127
1
Remove and return the item at the front of this priority queue, and insert the given item in order according to the given priority.
def push_pop(self, item, priority): if self.size() < 1: raise ValueError('Priority queue is empty and has no front item') else: # TODO: Replace and return min item from heap, if any ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def enqueue(self, item, priority):\n # TODO: Insert given item into heap\n ...", "def push(self, priority: float, item):\n heappush(self._heap, (-1 * priority, item))", "def add(self, item, priority=0) -> None:\n if item in self.entry_finder:\n self.remove(item)\n ...
[ "0.7093361", "0.70350254", "0.6742636", "0.6527571", "0.6505629", "0.645512", "0.626797", "0.6210028", "0.61004966", "0.60370773", "0.60328144", "0.60213953", "0.6011833", "0.5995145", "0.59813595", "0.59383404", "0.59279823", "0.5927908", "0.59254074", "0.5917036", "0.590679...
0.78216314
0
Returns the domain of X values for this line.
def domain(self): lower, upper = sorted((self.x1, self.x2)) return FloatRange(lower=lower, upper=upper)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def domain(self) -> NDArrayFloat:\n\n return ndarray_copy(self._domain)", "def _axes_domain(self, *args, **kwargs):\n # See _add_gridline_label for detials\n lon_0 = self.axes.projection.proj4_params.get('lon_0', 0)\n x_range, y_range = type(self)._axes_domain(self, *args, **kwargs)\n x_range ...
[ "0.7240038", "0.670912", "0.6480548", "0.644691", "0.6432765", "0.64078355", "0.63080204", "0.6278737", "0.6278737", "0.6257812", "0.62101346", "0.6198268", "0.61593205", "0.61583245", "0.61583245", "0.6129598", "0.61284596", "0.61077106", "0.60557747", "0.6044892", "0.603960...
0.73572046
0
Returns the range of Y values for this line.
def range(self): lower, upper = sorted((self.y1, self.y2)) return FloatRange(lower=lower, upper=upper)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def yvals(self):\n return self.germs", "def yvals(self):\n return self.germs", "def y_points(self):\n return self._y_points", "def y(self):\n return self.y", "def Y(self):\n return self.y\n pass", "def y(self):\n return self.dataset.y", "def yminmax ( se...
[ "0.73793143", "0.73793143", "0.70917195", "0.7071098", "0.70636785", "0.70402914", "0.70298576", "0.7024401", "0.7011353", "0.6993154", "0.6985624", "0.6970569", "0.6970569", "0.6970569", "0.6970569", "0.6970569", "0.6970569", "0.6970569", "0.6970569", "0.6970569", "0.6970569...
0.7000042
9
Yields a Line for each pair of points in the polygon.
def lines(self): for pair in pairs(self.points): yield Line(pair, shape=self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _lines_from_points(points, points_form_closed_loop=False):\n if points_form_closed_loop:\n return list(zip(points[:-1],points[1:]))\n return list(zip(points, tuple(points[1:])+(points[0],)))", "def line(x1, y1, x2, y2):\r\n\r\n x1 = normalize(x1)\r\n y1 = normalize(y1)\r\n x2 = normaliz...
[ "0.68208283", "0.6730272", "0.66045207", "0.6540537", "0.6299681", "0.6237254", "0.61816174", "0.6175961", "0.61647254", "0.6123132", "0.60234046", "0.60123557", "0.6010977", "0.5986616", "0.5942319", "0.5904839", "0.58956665", "0.5895638", "0.5843104", "0.5839472", "0.583947...
0.79969424
0
Returns the distance from (x, y) to object o.
def key(o): return hypot((x - o.x), (y - o.y))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def distance_to(self, obj):\n\t\tx, y = self.position\n\t\tobj_x, obj_y = obj.position\n\t\treturn hypot(x - obj_x, y - obj_y)", "def distance_to(self, x, y):\n\t\tdx = x - self.x\n\t\tdy = y - self.y\n\t\treturn math.sqrt((dx**2)+(dy**2))", "def distance(self, x: int, y: int) -> float:\n return math.sq...
[ "0.7896175", "0.7743293", "0.73797154", "0.7269582", "0.7183777", "0.7140131", "0.7135656", "0.7084489", "0.7072841", "0.70662445", "0.70607775", "0.7042719", "0.701314", "0.7007436", "0.7002215", "0.69914156", "0.6989765", "0.69608366", "0.69496274", "0.6944206", "0.6933016"...
0.69839984
17
Class method to instantiate a Category objects using dictionaries.
def create(cls, dictionary): return cls(**dictionary)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, categories, **kwargs):\n with KWArgs(kwargs) as k:\n metadata = k.optional(\"metadata\")\n options = k.options(growth=False)\n\n # henryiii: We currently expand \"abc\" to \"a\", \"b\", \"c\" - some\n # Python interfaces protect against that\n\n ...
[ "0.6690005", "0.65088975", "0.6493289", "0.64693344", "0.64125854", "0.62283474", "0.6194736", "0.6092039", "0.60627675", "0.6061843", "0.60178274", "0.59953386", "0.595151", "0.5944069", "0.5908155", "0.58945733", "0.58731633", "0.5862321", "0.584185", "0.5836703", "0.583385...
0.652989
2
Overrides JSONify instance method to return class attributes as a dictionary.
def to_json(self): return { "category_name": self.category_name, "summary": self.summary, "image": self.image, "category_slug": self.category_slug, }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def jsonify(self) -> JsonDict:\n\n Attributes = type(self)._Attributes\n\n # Create json dictionary\n json_dict: JsonDict = {}\n # Add every resource attribute to dictionary\n for key in Attributes:\n\n # If necessary jsonify attribute before adding it\n var...
[ "0.7466688", "0.7436162", "0.7151983", "0.7151983", "0.71180433", "0.7102775", "0.69805235", "0.6901591", "0.6814638", "0.6798607", "0.67791635", "0.67791635", "0.6761625", "0.6761625", "0.6761625", "0.6761625", "0.6761625", "0.6761625", "0.6761625", "0.67395794", "0.6685309"...
0.0
-1
Override magic method to return a developerfriendly string representation of the object on repr(category_object)
def __repr__(self): return f"Category=(id={self.id},category_name={self.category_name},category_slug={self.category_slug})"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __repr__(self):\n return '{}:{}:{}'.format(self.category, self.name, self.id)", "def __repr__(self):\n\n return f'<Category cat_code={self.cat_code} name={self.name}>'", "def __repr__(self):\n\n return f\"<Cat id={self.cat_id} name={self.name}\"", "def __repr__(self):\n\n retu...
[ "0.7909407", "0.76931256", "0.7598569", "0.75420475", "0.7461687", "0.7396662", "0.73540694", "0.7169469", "0.71685416", "0.7161115", "0.7109059", "0.70717186", "0.7037763", "0.7030703", "0.69059324", "0.6898647", "0.6874442", "0.6865749", "0.67619854", "0.67369884", "0.67369...
0.7837578
1
Class method to instantiate Item objects using dictionaries.
def create(cls, dictionary): return cls(**dictionary)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, items=[]):\n dict.__init__(self, items)", "def __init__(self):\n # Item Dictionary (key: call number, value: Item object)\n self.item_list = {}\n\n # Add some items manually for testing purposes.\n book1 = Book(\"In praise of Idleness\", \"B-1\", 3, \"bertran...
[ "0.7520205", "0.74394494", "0.7268069", "0.7072326", "0.6831127", "0.6684697", "0.66595703", "0.6544573", "0.6505831", "0.647886", "0.6441534", "0.6441534", "0.6422792", "0.64028776", "0.63857216", "0.6380046", "0.6356581", "0.62885493", "0.62881935", "0.6287938", "0.62819076...
0.64655805
10
Returns class attributes as a dictionary.
def to_json(self): return { "item_name": self.item_name, "summary": self.summary, "content": self.content, "date_published": self.date_published, "item_slug": self.item_slug, "category_name": self.category_name, }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_dict(self):\n d = {}\n for attr in self.__class__.attributes:\n d[attr] = getattr(self, attr)\n return d", "def attributes(self):\n return dict(self.__attributes)", "def as_dict(self):\n result = {}\n for attr in self.__attr:\n result[attr] = g...
[ "0.81409836", "0.80984646", "0.7868926", "0.780666", "0.7725961", "0.76040274", "0.7588187", "0.7588187", "0.7588187", "0.75708634", "0.75549364", "0.75041884", "0.74750537", "0.7364832", "0.73308027", "0.73076165", "0.7287587", "0.72772384", "0.7248498", "0.72314215", "0.720...
0.0
-1
Get resnet with deconv layers.
def get_deconv_resnet(base_network, pretrained=False, **kwargs): net = DeconvResnet( base_network=base_network, pretrained_backbone=pretrained, **kwargs) return net
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resnet50_v1b_deconv(**kwargs):\n return get_deconv_resnet('resnet50_v1b', **kwargs)", "def resnet18_v1b_deconv(**kwargs):\n return get_deconv_resnet('resnet18_v1b', **kwargs)", "def resnet101_v1b_deconv(**kwargs):\n return get_deconv_resnet('resnet101_v1b', **kwargs)", "def resnet():\n return...
[ "0.7195827", "0.6876899", "0.6849386", "0.6753572", "0.62811035", "0.622978", "0.6229372", "0.6033808", "0.60275984", "0.5997466", "0.5986289", "0.5975139", "0.5969439", "0.5949569", "0.59469706", "0.5941289", "0.59397143", "0.59260434", "0.5917289", "0.59127927", "0.5904779"...
0.8153153
0
Resnet18 v1b model with deconv layers. Returns HybridBlock A Resnet18 v1b model with deconv layers.
def resnet18_v1b_deconv(**kwargs): return get_deconv_resnet('resnet18_v1b', **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resnet18(pretrained=False, **kwargs):\n model = ResNetFeatures(BasicBlock, [2, 2, 2, 2], **kwargs)\n if pretrained:\n _load_pretrained(model, model_zoo.load_url(model_urls['resnet18']))\n return model", "def resnet18(pretrained=False, **kwargs):\n model = ResNet(BasicBlock, [2, 2, 2, 2], *...
[ "0.62846977", "0.6198227", "0.6192097", "0.6112437", "0.61038554", "0.60721475", "0.60721475", "0.60721475", "0.60721475", "0.60721475", "0.6058464", "0.59820086", "0.59820086", "0.59615123", "0.59469116", "0.5931862", "0.5890543", "0.5742647", "0.5706555", "0.5705783", "0.57...
0.6445889
0
Converts offset+length coordinates to sentence_id and token_id. Returns (sentence_start, token_start), (sentence_end, token_end)
def offset_to_tokens(self, offset, length): first_sent_id = None first_tok_id = None #print offset #print length for sent_id, (sent_json, sent_conll) in enumerate( zip(self.tokenized['sentences'], self.conll)): #print first_sent_id for t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def token_positions(separation):\n offsets = (-separation, 0, separation)\n for x_pos in offsets:\n for y_pos in offsets:\n yield x_pos, y_pos", "def get_text_positions(self, node, padded):\n # type: (AstNode, bool) -> Tuple[Tuple[int, int], Tuple[int, int]]\n if not hasattr(node, '...
[ "0.6784497", "0.64283454", "0.6420033", "0.6386695", "0.6348043", "0.6061477", "0.60567343", "0.6041508", "0.6039938", "0.5996507", "0.5840656", "0.57864076", "0.5765366", "0.5730394", "0.5728136", "0.5719357", "0.57179654", "0.56979686", "0.5688681", "0.56320363", "0.5586682...
0.71816325
0
Remove all keys with 'None' values
def remove_null_fields(data): for k, v in data.items(): if isinstance(v, dict): remove_null_fields(v) if isinstance(v, list): for element in v: remove_null_fields(element) if not data[k]: del data[k] return data
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_none_values(dict_):\r\n\r\n res = {}\r\n res.update((key, value) for key, value in dict_.iteritems() \\\r\n if value is not None)\r\n return res", "def remove_empty_values(_dict):\n return {k: v for k, v in list(_dict.items()) if v is not None}", "def _drop_none_values(dic...
[ "0.78185385", "0.7728757", "0.77087957", "0.7640597", "0.7625029", "0.7470555", "0.746766", "0.7439462", "0.74163985", "0.73381305", "0.7328983", "0.7318468", "0.7174069", "0.7173493", "0.7167079", "0.7152745", "0.7128931", "0.71138406", "0.7113512", "0.70439094", "0.70121497...
0.67479134
30
Find vertices in neighborhood of peak vertices.
def peak_neighborhood(apsp, peak, n_size): dpeaks = apsp[peak, :] nhood = np.where(dpeaks < n_size)[0] return nhood
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def peak_indices(self, **kwargs):\n kwarg_defaults = {\n 'width': 5, # ensure small spikes are ignored\n }\n kwarg_defaults.update(kwargs)\n return signal.find_peaks(self.ys, **kwarg_defaults)", "def find_delaunay_with_max_vertices(bbox, nvertex):\n # find bracketing va...
[ "0.6164366", "0.6151801", "0.6076451", "0.6051318", "0.6048757", "0.60092044", "0.6003077", "0.59836006", "0.5955315", "0.5863139", "0.58380353", "0.58234304", "0.58089036", "0.58047277", "0.57400477", "0.57065547", "0.56949335", "0.56949335", "0.5683954", "0.5674413", "0.565...
0.64697915
0
Create an sideside grids with letters.
def drawTable(window, letters_sequence): side_len = len(letters_sequence) for row in range(side_len): for col in range(side_len): letter_container = tk.Frame(master=window, relief=tk.RIDGE, borderwidth=1) letter_container.grid(row=row, column=col) label = tk.Label(master=letter_container, text...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __makeRandomLetterGrid(self):\n for x in range(self.numRows):\n row = []\n for y in range(self.numCols):\n row.append(self.__getRandChar())\n self.grid.append(row)\n return self.grid", "def grid_maker(width, height):\n grid = [['.' for i in range(width)] for j in range(height)]...
[ "0.73568916", "0.6841155", "0.680963", "0.680963", "0.680963", "0.67504424", "0.66500115", "0.6538193", "0.65352905", "0.65002054", "0.6479047", "0.6477178", "0.6473601", "0.6465422", "0.6415647", "0.6390261", "0.63567835", "0.63449454", "0.6286283", "0.6283769", "0.6228581",...
0.6200661
22
calculate which cell the user is in
def which_cell(loc_x, loc_y): column = int(math.ceil((loc_x - LEFT_MARGIN) / CELL_SIZE)) row = int(math.ceil((loc_y - TOP_MARGIN) / CELL_SIZE)) cell_id = (row - 1) * CELL_COLUMN + column return cell_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_cell(self, key):\n\n val = 0\n\n # -------------------------------------------------------------------------\n # YOUR CODE GOES HERE\n #\n \n #h = key[0]\n #e = key[1]\n\n val = self._table[(key[0], key[1])]\n\n \n #\n # END O...
[ "0.6724067", "0.6615881", "0.630538", "0.6197737", "0.61816096", "0.61797416", "0.6166913", "0.61540014", "0.6113651", "0.60996574", "0.6070644", "0.6042115", "0.60301346", "0.59936833", "0.5969771", "0.5969771", "0.5969771", "0.5959949", "0.59336597", "0.5904554", "0.5881604...
0.6538963
2
Sets the label of the Y axis.
def ylabel(ylabel): impl.ylabel(**locals())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setYLabel(self, label):\n self.__y_label__ = label", "def ylabel(self, ylabel):\n self._checkfigure()\n self.axes.set_ylabel(ylabel)", "def ylabel(self, ylabel: str):\n self.ax.set_ylabel(ylabel)\n self.canvas.draw()", "def yaxis(self,label,units):\n if units != ...
[ "0.91020226", "0.8639282", "0.8614327", "0.840456", "0.81369096", "0.7430895", "0.7296278", "0.72888494", "0.7132633", "0.70668435", "0.7019508", "0.69993544", "0.69993544", "0.69914144", "0.6950526", "0.69498634", "0.6911716", "0.6897401", "0.68614024", "0.68591887", "0.6845...
0.7285991
8
Sets the limits of the X axis.
def xlim(left=None, right=None): impl.xlim(**locals())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setlimits(self, Xlim=[], Ylim=[]):\n self.data['Xmin'] = Xlim[0]\n self.data['Xmax'] = Xlim[1]\n self.data['Ymin'] = Ylim[0]\n self.data['Ymax'] = Ylim[1]", "def set_xlim(self, xlim):\n # x coordinate of center of leftmost pixel\n self.xmin = xlim[0]\n # x coo...
[ "0.74963087", "0.73023665", "0.7281398", "0.7207445", "0.71357775", "0.7126959", "0.70931154", "0.70135653", "0.69958925", "0.6951889", "0.6831607", "0.6807157", "0.6726934", "0.66732", "0.66696686", "0.6628141", "0.6574339", "0.6567856", "0.65483", "0.6522343", "0.65136844",...
0.66285276
15
Sets the limits of the Y axis.
def ylim(bottom=None, top=None): impl.ylim(**locals())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SetYAxisRange(self, lower, upper):\n self.Y_AXIS_RANGE = (lower, upper)", "def adjust_ylimits(self, ylim1, ylim2):\n self.axplot.set_ylim(ylim1, ylim2)\n self.fig.canvas.draw()\n return", "def ylim(self, bottom=None, top=None):\r\n for ax in self._subaxes:\r\n ...
[ "0.8061535", "0.7923708", "0.74688894", "0.73747885", "0.7372493", "0.7259172", "0.7175118", "0.70162785", "0.69975215", "0.698756", "0.69716555", "0.6960105", "0.6943429", "0.69336736", "0.6931652", "0.69080925", "0.69026226", "0.683826", "0.6831573", "0.68192655", "0.679114...
0.7187827
6
Return all articles if no audience specified, otherwise only those from that Audience
def articles(self, audience_filter=None): articles = ArticlePage.objects.live().descendant_of(self) if audience_filter is not None: articles = articles.filter(audience__name=audience_filter) articles = articles.order_by('-date') return articles
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def articles(self):\n return self.get_queryset().filter(content_type__model='article').order_by('-articles__published_at')", "def articles(self, subject_filter=None):\n articles = ArticlePage.objects.live().descendant_of(self)\n if subject_filter is not None:\n articles = articles...
[ "0.53986216", "0.53402317", "0.53081733", "0.5305304", "0.5211257", "0.5153814", "0.5101621", "0.50824296", "0.50327814", "0.5030341", "0.50282896", "0.5019423", "0.49807727", "0.4972056", "0.49614388", "0.49547437", "0.4866086", "0.48600337", "0.48344988", "0.4825311", "0.48...
0.68878406
0
Return all articles if no subject specified, otherwise only those from that Subject
def articles(self, subject_filter=None): articles = ArticlePage.objects.live().descendant_of(self) if subject_filter is not None: articles = articles.filter( Q(subject_1=subject_filter) | Q(subject_2=subject_filter)) articles = articles.order_by('-date') retur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter_subjects(self):\n return self.filter_nodes('//Subjects/Subject')", "def get_queryset(self):\n return filter_subjects(Subject.objects.all(), self.request.user)", "def list_courses_subjects(self, all=False):\n q = {'facet': 'true',\n 'facet.field': 'course_subject',\n...
[ "0.68461657", "0.65303606", "0.6318721", "0.6296977", "0.6280416", "0.6242551", "0.6236301", "0.616833", "0.5941876", "0.58910584", "0.585484", "0.5786363", "0.57801485", "0.5764462", "0.57628167", "0.57169193", "0.57076377", "0.570699", "0.5700736", "0.5694488", "0.5654827",...
0.72850305
0
Create an instance of a BinarySearchTree.
def __init__(self, itr=None): self.root = None self.size_number = 0 if hasattr(itr, "__iter__"): for val in itr: self.insert(val) elif itr: self.insert(itr)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def as_binary_search_tree(self):\n root = self.get_root()\n bst = BinarySearchTree(root)\n\n for patient in self.dataset:\n bst.insert_node(patient)\n\n return bst", "def new_binary_search() -> Search:\n return _BinarySearch()", "def binary_search_tree():\n\n class ...
[ "0.72438735", "0.6635437", "0.6485625", "0.64213", "0.6288287", "0.6244008", "0.62323475", "0.62214464", "0.622079", "0.62168694", "0.6216834", "0.62110347", "0.6083435", "0.608223", "0.6055379", "0.6055156", "0.6018737", "0.6011335", "0.5977908", "0.58925766", "0.58774215", ...
0.0
-1
Helper to replace the connections to node to nxt.
def _replace_node(self, nxt, node): nxt.left = node.left nxt.right = node.right nxt.parent = node.parent if node is self.root: self.root = nxt if nxt.left: nxt.left.parent = nxt if nxt.right: nxt.right.parent = nxt if nxt.parent...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def connect_nodes(self):\n for src_id, trg_id in itertools.product(self.selected_nodes, repeat=2):\n if src_id != trg_id:\n app.edges[src_id].add(trg_id)\n self.mark_as_unsaved()\n self.update()", "def switchNeighbors(head):\n if head == None or head.next == None...
[ "0.6306071", "0.61568826", "0.61550254", "0.6123998", "0.58381", "0.5836165", "0.5787948", "0.5719936", "0.5719666", "0.5714374", "0.55667543", "0.55650383", "0.5557494", "0.55529934", "0.55362725", "0.55246353", "0.5511303", "0.5506245", "0.5463353", "0.5454586", "0.5420207"...
0.68727446
0
Get the next node in the inorder traversal.
def _nxt_inorder(self, nxt, node, val): if node.left and node.right: gen = self.in_order_traversal() path = None while path is not val: path = next(gen) nxt = self.search(next(gen)) return nxt
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_next(node):\n return node['next']", "def next_node(self):\n return self.__next_node", "def next_node(self):\n return self.__next_node", "def next_node(self):\n return self.__next_node", "def next_node(self):\n\n return self.__next_node", "def get_next(self):\n ...
[ "0.7658224", "0.74273574", "0.74273574", "0.74273574", "0.7292845", "0.7152428", "0.7059316", "0.69884145", "0.69321275", "0.6794008", "0.67697394", "0.67697394", "0.67294276", "0.6562343", "0.6526503", "0.6512164", "0.6501449", "0.64894426", "0.6481631", "0.64757925", "0.647...
0.67002624
13
Return the number of nodes in the tree.
def size(self): return self.size_number
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def count(self):\n return self.__tree.node_count", "def node_count(self):\n return self._root.count()", "def count_nodes(self):\n if self.is_empty():\n return 0\n elif self.is_leaf():\n return 1\n else:\n if self.get_left():\n i...
[ "0.8656381", "0.86320984", "0.84407073", "0.84076333", "0.8394626", "0.8391233", "0.8295542", "0.8294371", "0.82921994", "0.82752913", "0.82752913", "0.82745266", "0.82310945", "0.8218198", "0.8178848", "0.8131863", "0.80808544", "0.80391836", "0.7983322", "0.79684716", "0.79...
0.0
-1
Return the difference in length between the left and right sides... ...of the tree. (negative value if left is longer)
def balance(self, node=None): if node is None: node = self.root if self.root is None: return 0 if not node.left and not node.right: return 0 elif not node.left: return node.right.balance_number elif not node.right: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def len(self):\n L,R = 0,0\n if self.left is not None:\n L = self.left.len()\n if self.right is not None:\n R = self.right.len()\n return 1 + L + R", "def size(self):\n return 1 + self.left.size + self.right.size", "def height(self):\n # TODO: Che...
[ "0.7270083", "0.686351", "0.6815158", "0.6737347", "0.6716406", "0.67107517", "0.66871667", "0.6685304", "0.6665056", "0.6656043", "0.66509336", "0.66208935", "0.6604172", "0.65751135", "0.65655", "0.6541879", "0.6515349", "0.64931285", "0.64686966", "0.646301", "0.64439785",...
0.0
-1
Replace node's parent with node... ...and rebalances the children of both.
def rotate(self, val): node = self.search(val) n_par = node.parent if n_par: is_left = n_par.right == node else: raise ValueError("Cannot rotate the root node of the tree.") child = node.left if is_left else node.right self._remove_parent(node) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parent_connect(self, node):\n if self.parent.get() >= self.data:\n self.parent.set_left(node)\n if node and node.left is not None:\n node.set_parent(self.parent)\n else:\n self.parent.set_right(node)\n if node ...
[ "0.70451975", "0.7036572", "0.6993256", "0.69221485", "0.6908622", "0.6842949", "0.6812604", "0.68073535", "0.6737627", "0.67104006", "0.6628708", "0.6588119", "0.65507805", "0.65296876", "0.65284246", "0.65221155", "0.6512239", "0.6484722", "0.64616656", "0.64141977", "0.639...
0.0
-1
Recursively finds value into the tree.
def _find(self, val, cur_node): if val == cur_node.data: return cur_node elif val > cur_node.data: if not cur_node.right: return None return self._find(val, cur_node.right) elif val < cur_node.data: if not cur_node.left: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find(self, value):\n # initialize node as root\n node = self.root\n\n # find value\n while node != None:\n\n # value found: return node\n if node.value == value:\n return node\n\n # value is smaller than node: search in left sub tree\n...
[ "0.7765131", "0.74240434", "0.73877656", "0.71973884", "0.71703017", "0.71458304", "0.70642525", "0.70642525", "0.69761145", "0.69579077", "0.69363284", "0.6894101", "0.6880418", "0.68432087", "0.67583996", "0.6751013", "0.6746667", "0.67390174", "0.6735716", "0.6731326", "0....
0.711601
6
Convert sparse matrix to tuple representation.
def sparse_to_tuple(sparse_mx): def to_tuple(mx): if not sp.isspmatrix_coo(mx): mx = mx.tocoo() coords = np.vstack((mx.row, mx.col)).transpose() values = mx.data shape = mx.shape return coords, values, shape if isinstance(sparse_mx, list): f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sparse_to_tuple(sparse_mx):\n def to_tuple(mx):\n if not sp.isspmatrix_coo(mx):\n mx = mx.tocoo()\n coords = np.vstack((mx.row, mx.col)).transpose()\n values = mx.data\n shape = mx.shape\n return coords, values, shape", "def sparse_to_tuple(sparse_mx):\n de...
[ "0.8586838", "0.82655185", "0.82655185", "0.82655185", "0.82655185", "0.82655185", "0.82655185", "0.82655185", "0.8091658", "0.79862845", "0.6028059", "0.59843165", "0.5970733", "0.5969924", "0.5944586", "0.5944388", "0.5909681", "0.5909681", "0.5909681", "0.5909681", "0.5909...
0.8252689
9
Convert a scipy sparse matrix to a torch sparse tensor.
def sparse_mx_to_torch_sparse_tensor(sparse_mx): sparse_mx = sparse_mx.tocoo().astype(np.float32) indices = torch.from_numpy(np.vstack((sparse_mx.row, sparse_mx.col)).astype(np.int64)) values = torch.from_numpy(sparse_mx.data) shape = torch.Size(sparse_mx.shape) return torch.sparse.FloatTensor(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def csr2tensor(self, matrix: sp.csr_matrix):\n matrix = matrix.tocoo()\n x = torch.sparse.FloatTensor(\n torch.LongTensor(np.array([matrix.row, matrix.col])),\n torch.FloatTensor(matrix.data.astype(np.float32)),\n matrix.shape,\n ).to(self.device)\n retu...
[ "0.8299787", "0.8148542", "0.8045949", "0.80325705", "0.80300856", "0.80300856", "0.80300856", "0.80300856", "0.80300856", "0.80300856", "0.80300856", "0.80300856", "0.80300856", "0.80300856", "0.80300856", "0.80300856", "0.80300856", "0.79973555", "0.79973555", "0.7985302", ...
0.80134654
17
Render website's home page.
def home(): form = SignInForm(request.form) if request.method == 'POST': # Pass this to the Consumer Notebook API session['username'] = request.form['username'] session['api_key'] = request.form['api_key'] return redirect('/products/') return render_template('home.html', form...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def render_home():\r\n\treturn render_template(\"index.html\")", "def home():\n return render_template('homepage.html')", "def home():\n\n return render_template('home_page.html')", "def homepage():\n return render_template('home/index.html', \n title=\"Bem vindo!\")", "...
[ "0.87248576", "0.85797024", "0.85035866", "0.8486288", "0.84611857", "0.84365207", "0.84302676", "0.841985", "0.8396901", "0.8396901", "0.8375347", "0.8356703", "0.83518267", "0.8341115", "0.8341115", "0.8337803", "0.8337803", "0.8337803", "0.8337803", "0.8337803", "0.8337803...
0.0
-1
Render the website's about page.
def about(): return render_template('about.html')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def about():\n return render_template('about.html', title='About')", "def about():\n\n return render_template('about_page.html', title='About')", "def about():\n\n\treturn render_template(\"about.html\")", "def about():\n return render_template(\n 'about.html',\n title='About',\n ...
[ "0.87910306", "0.8698105", "0.86404276", "0.86124563", "0.8490408", "0.84784615", "0.8467779", "0.84352976", "0.84289914", "0.8424242", "0.8424242", "0.8424242", "0.8424242", "0.8424242", "0.8424242", "0.8424242", "0.8424242", "0.8424242", "0.8424242", "0.8424242", "0.8424242...
0.8325753
28
Add headers to both force latest IE rendering engine or Chrome Frame, and also to cache the rendered page for 10 minutes.
def add_header(response): response.headers['X-UA-Compatible'] = 'IE=Edge,chrome=1' response.headers['Cache-Control'] = 'public, max-age=600' return response
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_header(response):\n response.headers['X-UA-Compatible'] = 'IE=Edge,chrome=1'\n response.headers['Cache-Control'] = 'public, max-age=60'\n return response", "def add_header(response):\r\n response.headers['X-UA-Compatible'] = 'IE=Edge,chrome=1'\r\n response.headers['Cache-Control'] = 'publi...
[ "0.82229227", "0.819543", "0.8162872", "0.8162872", "0.8162872", "0.8162872", "0.8162872", "0.8162872", "0.8162872", "0.8162872", "0.8162872", "0.8162872", "0.8162872", "0.8162872", "0.8162872", "0.8162872", "0.8162872", "0.8162872", "0.8162872", "0.8162872", "0.8162872", "...
0.8222085
2
Sets the goal for the PID controller.
def set_goal(self, goal): self._pid_lock.acquire() # Acquire Lock self._goal = goal self._pid_lock.release() # Release Lock
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_goal(self, **kwargs):\n return self.env.set_goal(**kwargs)", "def goal(self, goal):\n\n self._goal = goal", "def set_goal(self, goal: GoalType) -> None:\n self.goal = goal", "def set_goal(self, x):\n self.controllers[0].set_goal(x)\n self.controllers[1].set_goal(x)"...
[ "0.72353566", "0.6878171", "0.6867699", "0.686121", "0.6811669", "0.66538084", "0.6361599", "0.6180388", "0.6142914", "0.60614246", "0.60093695", "0.59347427", "0.5907836", "0.5900681", "0.58977747", "0.5873667", "0.5873667", "0.5847958", "0.57549393", "0.5752069", "0.5594057...
0.7567917
0
Retrieves the charging state of the robot via the charging state packet.
def read_charging_state(self): data = self._read_packet(Charging.PACKET_ID, Charging.DATA_BYTES) if len(data) == Charging.DATA_BYTES: return struct.unpack("B", data)[0] else: return 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_device_state(self, charger):\n data = {\n \"device_id\": self.uuid,\n \"cmd\": \"get_state\",\n \"token\": charger.token(),\n \"account_token\": self.api_token\n }\n headers = {\n \"Content-Type\": \"application/json\"\n }\n...
[ "0.7075033", "0.6326543", "0.6314042", "0.631315", "0.6306474", "0.6249806", "0.62402195", "0.6222469", "0.61727875", "0.6145988", "0.6135337", "0.6102278", "0.60604155", "0.6010413", "0.5940022", "0.59325576", "0.5901887", "0.5881399", "0.584315", "0.583885", "0.58024025", ...
0.75002456
0
Retrieves the charging state of the robot via the charging state packet.
def read_oi_mode(self): data = self._read_packet(Charging.PACKET_ID, Charging.DATA_BYTES) if len(data) == Charging.DATA_BYTES: return struct.unpack("B", data)[0] else: return 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_charging_state(self):\n data = self._read_packet(Charging.PACKET_ID, Charging.DATA_BYTES)\n\n if len(data) == Charging.DATA_BYTES:\n return struct.unpack(\"B\", data)[0]\n else:\n return 0", "def get_device_state(self, charger):\n data = {\n \...
[ "0.75003284", "0.70748156", "0.6325578", "0.63120884", "0.63117313", "0.63056195", "0.62482435", "0.6240006", "0.6221754", "0.61708844", "0.61445165", "0.6133273", "0.60995054", "0.60584265", "0.6009942", "0.5938652", "0.5931961", "0.59012944", "0.58802134", "0.58432066", "0....
0.0
-1
Return whether a number is even.
def is_even(number): if number % 2 == 0: return 'yes' return 'no'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_even(number: int) -> bool:\n return number % 2 == 0", "def is_even(num: int) -> bool:\n return num % 2 == 0", "def is_even(number):\n if ((number%2) == 0):\n return True\n else:\n return False", "def is_even(num):\n return num % 2 == 0", "def is_even(number):\n return...
[ "0.90315455", "0.8981182", "0.893769", "0.8900721", "0.88869804", "0.8846242", "0.8763093", "0.8759402", "0.8726761", "0.8693053", "0.8473234", "0.84665304", "0.8402124", "0.8401722", "0.834881", "0.8339033", "0.8299708", "0.8097581", "0.80703545", "0.8019871", "0.80136925", ...
0.81970197
17
Return the time series spec or create one if it doesn't exist. New time series is linked to Instrument instr by FieldName.
def create_time_series(fieldName, instr): spec = acm.FTimeSeriesSpec[fieldName] if not spec: spec = acm.FTimeSeriesSpec() spec.Description('%s PnL History' % instr) spec.FieldName(fieldName) spec.RecType(acm.EnumFromString('B92RecordType', 'Instrument')) spec.Commit() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_time_series(for_date, instr, spec):\n return acm.FTimeSeries.Select01(\"day = '%s' and recaddr = %i \"\n \"and timeSeriesSpec = %i and runNo = 1\"\n % (for_date, instr.Oid(), spec.Oid()), '')", "def create(self, name: str, meta: Dict = {}, type: str = \"timeseries\", **kwargs):\n ...
[ "0.5437413", "0.53278315", "0.5132824", "0.4910915", "0.48935473", "0.48539826", "0.48432764", "0.48351282", "0.4805524", "0.47721493", "0.47332403", "0.4718104", "0.47017023", "0.4692835", "0.4662472", "0.46499807", "0.4611805", "0.46080402", "0.4596876", "0.4580391", "0.457...
0.7088663
0
Returns True if session creation is allowed (as determined by the super class's is_session_creation_enabled value and no requestspecific override has disabled sessions for this subject, False otherwise. This means session creation is disabled if the super is_session_creation_enabled property is False or if a request at...
def session_creation_enabled(self): return (self._session_creation_enabled and self.web_registry.session_creation_enabled)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allow_new_session(self):\n return self._currSessionDiscardable", "def private_session(self):\n return bool(\n lib.sp_session_is_private_session(self._session._sp_session))", "def sessionValid(self):\n return self.request.getSession().isValid()", "def sessionNew(self):\n ...
[ "0.6674522", "0.6288012", "0.611987", "0.58222526", "0.5800123", "0.57902366", "0.5765897", "0.56896955", "0.561705", "0.56134635", "0.55813694", "0.5521292", "0.5455969", "0.54093575", "0.53659534", "0.53659534", "0.53562754", "0.5306992", "0.52831423", "0.52757114", "0.5268...
0.8258925
0
Convert a date in a string into a python date, where the dataframe and the variable name are known.
def string_to_datetime(dataframe): print("Which variable would you like to convert from a date string to a python date?") existing_variable = input() print("What would you like to call the new date variable?") new_variable = input() dataframe[new_variable] = dataframe[existing_variable].dt.strftim...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def string_object_to_datetime(dataframe):\n\n print(\"Which variable would you like to convert from a date string to a python date?\")\n existing_variable = input()\n print(\"What would you like to call the new date variable?\")\n new_variable = input()\n\n dataframe[new_variable] = datetime.strptim...
[ "0.7501158", "0.6790072", "0.6781764", "0.6770597", "0.672437", "0.6669885", "0.66560954", "0.6652141", "0.66447526", "0.6644526", "0.66266483", "0.6503308", "0.64974356", "0.6488791", "0.6486182", "0.6479067", "0.64767814", "0.64334184", "0.6429908", "0.63495094", "0.6342947...
0.74788135
1
Convert a date in a string into a python date.
def string_object_to_datetime(dataframe): print("Which variable would you like to convert from a date string to a python date?") existing_variable = input() print("What would you like to call the new date variable?") new_variable = input() dataframe[new_variable] = datetime.strptime(dataframe[exis...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def string_to_date(string):\n params = string.strip().split('-')\n year = int(params[0])\n month = int(params[1])\n day = int(params[2])\n d = date(year, month, day)\n return d", "def string_to_date(date_string):\n\n return date(int(date_string[:4]),\n ...
[ "0.8394523", "0.83896685", "0.8342368", "0.81185216", "0.80319333", "0.7970225", "0.7964554", "0.79382867", "0.7936457", "0.7912861", "0.7905172", "0.7897728", "0.78488463", "0.784251", "0.7809031", "0.7806497", "0.77931345", "0.77851725", "0.7772604", "0.7752496", "0.7685233...
0.0
-1
Calculate the haversine or greatcircle distance in metres between two points with latitudes and longitudes, where they are known as the origin and destination.
def calculate_distance(origin, destination): datetime1, lat1, lon1 = origin datetime2, lat2, lon2 = destination radius = 6371 # km dlat = math.radians(lat2 - lat1) dlon = math.radians(lon2 - lon1) a = math.sin(dlat / 2) * math.sin(dlat / 2) + math.cos(math.radians(lat1)) \ * math.cos(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def distance(origin, destination): ## https://stackoverflow.com/questions/44743075/calculate-the-distance-between-two-coordinates-with-python\n lat1, lon1 = origin\n lat2, lon2 = destination\n radius = 6371*0.62 # miles\n\n dlat = math.radians(lat2 - lat1)\n dlon = math.radians(lon2 - lon1)\n a ...
[ "0.75903994", "0.7581176", "0.75455487", "0.7531257", "0.7419517", "0.74132216", "0.73949015", "0.7383521", "0.7311661", "0.72562194", "0.7238989", "0.7202122", "0.7194691", "0.71847636", "0.71827453", "0.7173336", "0.71522576", "0.71509475", "0.714448", "0.71255165", "0.7122...
0.7787034
0
Calculate the speed in knots between two locations which are dictionaries containing latitude, longitude and date_time.
def knots_two_points(origin, destination): distance_m = calculate_distance(origin, destination) datetime1_timestamp, lat1, lon1 = origin datetime2_timestamp, lat2, lon2 = destination datetime1 = datetime1_timestamp.timestamp() datetime2 = datetime2_timestamp.timestamp() seconds = abs((dateti...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def car_speed(time_loc, prev_time_loc):\n timestamp, lat, longitude = time_loc\n prev_timestamp, prev_lat, prev_longitude = prev_time_loc\n\n dist = geopy.distance.distance((lat, longitude), (prev_lat, prev_longitude)).miles\n # Time difference in milliseconds\n time_diff = timestamp - prev_timestam...
[ "0.58214194", "0.579355", "0.56663066", "0.56069", "0.5578686", "0.55682963", "0.55682963", "0.55682963", "0.55682963", "0.55682963", "0.55472785", "0.5474715", "0.5464001", "0.54027903", "0.5389351", "0.5357196", "0.53546923", "0.5334414", "0.5303193", "0.5286532", "0.527008...
0.72649795
0
Set the timezone to be UTC.
def set_utc(date_time): utc = datetime.timezone(datetime.timedelta(0)) date_time = date_time.replace(tzinfo=utc) return date_time
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_timezone(self, to_tz):\n self.startdate = to_tz.localize(self.startdate.replace(tzinfo=None))\n self.enddate = to_tz.localize(self.enddate.replace(tzinfo=None))\n self.timezone = to_tz", "def fromutc(self, dt):\n if dt.tzinfo is None:\n return dt.replace(tzinfo=self...
[ "0.72103435", "0.71776843", "0.7111709", "0.7052505", "0.68563294", "0.68358237", "0.68358237", "0.68358237", "0.68358237", "0.68358237", "0.66069865", "0.65402013", "0.6403162", "0.6390136", "0.6363629", "0.6363629", "0.63539517", "0.6352093", "0.6342055", "0.63034976", "0.6...
0.72553647
0
Analyse the distance between the points. Even when the ship is stationary, the lat and long vary slightly. Where there is an error in the lat and long being the same in consecutive points, the distance should be greater than 0 (to 6 dp, which is equivalent to 0.19 cm at the Equator).
def analyse_distance_between_points(position_df): print("Analysing distance between consecutive points.") maximum_distance = 0.019 # 1 x 10^-6 of a degree is 0.019 m # no distance value position_df.loc[position_df['distance'].apply(math.isnan), 'measureland_qualifier_flag_distance'] = 9 # missing val...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculateDistanceBetweenPoints(lat1,lon1,lat2,lon2):\n\treturn Geodesic.WGS84.Inverse(lat1,lon1, lat2, lon2)['s12']", "def road_distance(lat1, lon1, lat2, lon2):\n point1 = lat1, lon1\n point2 = lat2, lon2\n url = \"https://maps.googleapis.com/maps/api/distancematrix/json?origins={0},{1}&destination...
[ "0.7262544", "0.66239125", "0.6588583", "0.6551321", "0.6533308", "0.6515686", "0.64724946", "0.64680743", "0.64418674", "0.6419749", "0.63746256", "0.6371783", "0.6368408", "0.6347524", "0.631554", "0.6312636", "0.6309692", "0.62915975", "0.62739503", "0.626852", "0.62599057...
0.6638487
1
Check if the content of a cell is alphanumeric.
def is_name(self, cell): tokens = self._cell_tokenizer.tokenize(cell.get_text()) cell_type = self._get_token_type(self._cell_parser.parse(tokens)) if cell_type == 'NAME': return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def must_contain_letter(cell):\n # Check if it's nan first\n if check_empty(cell):\n return True\n return not bool(re.search(\"[a-zA-Z]\", str(cell)))", "def isalnum(self):\n return isalnum(self)", "def must_be_alphanumeric_space_period(cell):\n # Check if it's nan first\n if check...
[ "0.7554838", "0.7366656", "0.72585887", "0.71913785", "0.676146", "0.67552257", "0.6679915", "0.6565086", "0.65643585", "0.65448135", "0.6518306", "0.6448328", "0.6436826", "0.6424519", "0.64207846", "0.6384992", "0.6382942", "0.6381801", "0.63701177", "0.62881315", "0.627213...
0.0
-1
Check if the content of a cell only has numbers.
def is_number(self, cell): for token in self._cell_tokenizer.tokenize(cell.get_text()): if self._get_token_type(token) == 'NAME': return False return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def must_contain_digit(cell):\n # Check if it's nan first\n if check_empty(cell):\n return True\n return not bool(re.search(\"\\d\", str(cell)))", "def must_be_numeric(cell):\n # Check if it's nan first\n if check_empty(cell):\n return True\n # If it's not nan, check it's a number...
[ "0.8166208", "0.7570343", "0.72052854", "0.7055605", "0.6967532", "0.6934029", "0.6917894", "0.6893806", "0.6839475", "0.6811044", "0.6756402", "0.6728491", "0.66914386", "0.66888285", "0.66629595", "0.6654778", "0.6630367", "0.66051346", "0.66025007", "0.65843946", "0.655187...
0.76327354
1
This function takes a filename as input, and returns a dataframe with raw data read from that file in a Pandas DataFrame. The DataFrame index should be the year, month and day of the observation. DataFrame headers should be "agency_cd", "site_no", "Date", "Discharge", "Quality". The "Date" column should be used as the ...
def ReadData( fileName ): # define column names colNames = ['agency_cd', 'site_no', 'Date', 'Discharge', 'Quality'] # open and read the file DataDF = pd.read_csv(fileName, header=1, names=colNames, delimiter=r"\s+",parse_dates=[2], comment='#', n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _data_reader(file):\n # Create a dictionary so that filename matches a site name.\n site_dict = {'D05536000': 'NB Niles', 'D05536101': 'NS Channel-Wilmette',\n 'D05536105': 'NB Albany', 'D05536118': 'NB Grand Avenue',\n 'D05536121': 'CH River-Lock', 'D05536123': 'CH River-...
[ "0.6936041", "0.6728832", "0.64776355", "0.64624935", "0.6454058", "0.6410114", "0.6397511", "0.6382039", "0.6367535", "0.6330921", "0.6298072", "0.62846416", "0.6276603", "0.62696755", "0.6258542", "0.6252047", "0.62465036", "0.6205528", "0.62012005", "0.61507493", "0.613114...
0.7225768
0
Compute this metric. This applies the underlying single table metric to all the tables found in the dataset and then returns the average score obtained.
def _compute(self, real_data, synthetic_data, metadata=None): if set(real_data.keys()) != set(synthetic_data.keys()): raise ValueError('`real_data` and `synthetic_data` must have the same tables') if metadata is None: metadata = {'tables': defaultdict(type(None))} elif n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def average(self):\n if self._average is None:\n self._average = sum([df.df for df in self])/len(self)\n return self._average", "def accuracy(self):\n return (self.table[0, 0] + self.table[1, 1]) / self.N", "def compute(cls, real_data, synthetic_data, metadata):\n score_b...
[ "0.5845553", "0.5827169", "0.58184224", "0.57921374", "0.5787292", "0.5787292", "0.57844794", "0.57567334", "0.57013696", "0.57012653", "0.56799257", "0.5663485", "0.5659538", "0.56120795", "0.5596597", "0.558179", "0.5576306", "0.55562055", "0.5548604", "0.55410093", "0.5537...
0.68125516
0
Compute this metric. This applies the underlying single table metric to all the tables found in the dataset and then returns the average score obtained.
def compute(cls, real_data, synthetic_data, metadata=None, **kwargs): return cls._compute(cls, real_data, synthetic_data, metadata, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _compute(self, real_data, synthetic_data, metadata=None):\n if set(real_data.keys()) != set(synthetic_data.keys()):\n raise ValueError('`real_data` and `synthetic_data` must have the same tables')\n\n if metadata is None:\n metadata = {'tables': defaultdict(type(None))}\n ...
[ "0.68142813", "0.58462036", "0.5827312", "0.5820935", "0.5792314", "0.57902944", "0.57902944", "0.57860005", "0.57581997", "0.5703834", "0.5702944", "0.5681203", "0.56641424", "0.5660703", "0.5614353", "0.5600012", "0.5583549", "0.55781615", "0.55567557", "0.55478483", "0.554...
0.0
-1
Returns the `raw_score` as is, since it is already normalized.
def normalize(cls, raw_score): assert cls.min_value == 0.0 return super().normalize(raw_score)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normalize(cls, raw_score):\n return super().normalize(raw_score)", "def normalize(cls, raw_score):\n return super().normalize(raw_score)", "def normalize(cls, raw_score):\n return super().normalize(raw_score)", "def normalize(cls, raw_score):\n return super().normalize(raw_sco...
[ "0.86552733", "0.86552733", "0.86552733", "0.86552733", "0.6420823", "0.62899595", "0.61581314", "0.61364454", "0.6024978", "0.58937484", "0.5882669", "0.587955", "0.58536804", "0.58515644", "0.58515644", "0.58515644", "0.5838352", "0.58057374", "0.58057374", "0.58057374", "0...
0.7839835
4
Sets the allowed_processes of this RuntimeAntiMalwareRule.
def allowed_processes(self, allowed_processes): self._allowed_processes = allowed_processes
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def denied_processes(self, denied_processes):\n\n self._denied_processes = denied_processes", "def _set_processes(self, processes: int = 1):\n self.__processes = processes", "def set_process_limits(): # pragma: no cover\n # Set a new session id so that this process and all its children w...
[ "0.6635991", "0.6162344", "0.5399079", "0.52147853", "0.50356615", "0.48677087", "0.48677087", "0.48211288", "0.48211288", "0.4768049", "0.4627171", "0.46265787", "0.45992205", "0.4593496", "0.45846242", "0.45787704", "0.45422518", "0.4504017", "0.45009166", "0.44671568", "0....
0.8159298
0
Sets the crypto_miner of this RuntimeAntiMalwareRule.
def crypto_miner(self, crypto_miner): self._crypto_miner = crypto_miner
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SetMiningMethod(self,miningMethod):\n self.theMiningSystem.miningMethod = miningMethod", "def setArmor(self, armor):\n self.av = armor", "def setCryptographicHandlers( self , tkip = None , aes = None ):\n\t\tself.handleTKIP = tkip\n\t\tself.handleAES \t= aes", "def set_encryption(key):\n g...
[ "0.50891584", "0.4544723", "0.45225394", "0.44707024", "0.43791777", "0.4358885", "0.43324634", "0.43239263", "0.429425", "0.42103016", "0.4189996", "0.41426286", "0.41291493", "0.41247395", "0.40786296", "0.40624338", "0.40478006", "0.40322292", "0.40299213", "0.4029869", "0...
0.7893291
0
Sets the encrypted_binaries of this RuntimeAntiMalwareRule.
def encrypted_binaries(self, encrypted_binaries): self._encrypted_binaries = encrypted_binaries
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def with_binaries(self, *args, **kw):\n for arg in args:\n if isinstance(arg, dict):\n self._binaries.update(arg)\n self._binaries.update(kw)\n return self", "def with_binaries(self, *args, **kw):\r\n for arg in args:\r\n if isinstance(arg, dict):\r\n self._binaries.update(arg...
[ "0.54808533", "0.54465693", "0.49112743", "0.4622234", "0.44396767", "0.4362359", "0.42449024", "0.42383167", "0.41990164", "0.4191991", "0.4178983", "0.41608432", "0.4141621", "0.41358182", "0.41355053", "0.40910557", "0.40817374", "0.4080167", "0.40563214", "0.40544382", "0...
0.8090969
0
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, RuntimeAntiMalwareRule): return False return self.to_dict() == other.to_dict()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False", "def __eq__(self, other):\n if i...
[ "0.8089139", "0.8089139", "0.8054507", "0.79827213", "0.79669285", "0.79669285", "0.79669285", "0.79669285", "0.79669285", "0.79669285", "0.79669285", "0.79669285", "0.79669285", "0.79669285", "0.79669285", "0.79669285", "0.79669285", "0.79669285", "0.79669285", "0.79669285", ...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): if not isinstance(other, RuntimeAntiMalwareRule): return True return self.to_dict() != other.to_dict()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other) -> bool:\n return not self.__eq__(other)", "def __eq__(self, other):\n ...
[ "0.845611", "0.8391477", "0.8144138", "0.81410587", "0.8132492", "0.8093973", "0.80920255", "0.80920255", "0.80920255", "0.8085325", "0.8085325", "0.8076365", "0.8076365", "0.8065748", "0.8042487", "0.8042487", "0.8042487", "0.8042487", "0.8042487", "0.8042487", "0.8042487", ...
0.0
-1
Returns if the word is in the trie.
def search(self, word: str) -> bool: curr_chars = self.chars for c in list(word): if c not in curr_chars: return False curr_chars = curr_chars[c] return self.end_of_word in curr_chars
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def in_trie(self, trie, word):\n current_dict = trie\n for letter in word:\n if letter in current_dict:\n current_dict = current_dict[letter]\n else:\n return False\n else:\n if '_end_' in current_dict:\n return curr...
[ "0.8386537", "0.8149872", "0.8123037", "0.78559494", "0.78300846", "0.77929264", "0.77922416", "0.7763923", "0.775279", "0.77465785", "0.77099645", "0.76809365", "0.76762706", "0.766352", "0.7650309", "0.7633329", "0.7627476", "0.76109934", "0.7576837", "0.7568961", "0.756020...
0.69898564
64
Creates a new logger
def get_logger(name: str) -> logging.Logger: return logging.getLogger(name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_logger() -> logging.Logger:\n pass # TODO: Replace with implementation!", "def create_logger():\r\n global logger\r\n logger = logging.getLogger(logger_name)\r\n\r\n formatter = logging.Formatter(fmt='%(asctime)s %(levelname)s %(message)s')\r\n \r\n handler = logging.StreamHandler()...
[ "0.8295717", "0.8191174", "0.80328846", "0.78084475", "0.76689386", "0.7653146", "0.757199", "0.74503464", "0.7420157", "0.7410213", "0.73745996", "0.7364926", "0.724486", "0.7133973", "0.7127582", "0.7124735", "0.7116582", "0.7115856", "0.7112961", "0.7100703", "0.70960975",...
0.0
-1
Add noncaching headers on every request.
def add_header(req): req.headers["Cache-Control"] = "no-cache, no-store, must-revalidate" req.headers["Pragma"] = "no-cache" req.headers["Expires"] = "0" req.headers['Cache-Control'] = 'public, max-age=0' return req
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_header(req):\n req.headers[\"Cache-Control\"] = \"no-cache\"\n return req", "def add_header(response):\n\n # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control\n response.cache_control.no_store = True\n return response", "def add_header(response):\n\n # ht...
[ "0.7498003", "0.74891114", "0.74891114", "0.7480332", "0.73788553", "0.7341551", "0.7238963", "0.7235771", "0.715491", "0.7140068", "0.70831376", "0.70831376", "0.70827484", "0.707869", "0.70710677", "0.70710677", "0.70710677", "0.70710677", "0.70710677", "0.70710677", "0.707...
0.73557943
5
Convert list of list of tokens to a padded LongTensor.
def get_long_tensor(tokens_list): token_len = max(len(x) for x in tokens_list) tokens = list() for i, s in enumerate(tokens_list): token = torch.LongTensor(token_len).fill_(constant.PAD_ID) token[:len(s)] = torch.LongTensor(s) tokens += [token] return tokens
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_long_tensor(tokens_list, batch_size, pad_id=PAD_ID):\r\n sizes = []\r\n x = tokens_list\r\n while isinstance(x[0], list):\r\n sizes.append(max(len(y) for y in x))\r\n x = [z for y in x for z in y]\r\n tokens = torch.LongTensor(batch_size, *sizes).fill_(pad_id)\r\n for i, s in e...
[ "0.83324534", "0.83317626", "0.7581357", "0.6468442", "0.6441819", "0.63014394", "0.6284548", "0.62198114", "0.6195129", "0.6077769", "0.6075234", "0.60302067", "0.6011669", "0.60083175", "0.60041034", "0.5956764", "0.5878247", "0.57599753", "0.5746662", "0.5743087", "0.57039...
0.8126538
2
Randomly dropout tokens (IDs) and replace them with tokens.
def word_dropout(tokens, dropout): return [constant.UNK_ID if x != constant.UNK_ID and np.random.random() < dropout \ else x for x in tokens]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def replace_tokens(self, tokens):\n details = []\n idx = 0\n if len(tokens) >= min_token_num:\n for i in range(len(tokens)):\n old_token = tokens[i]\n if old_token in self.vocab and self.get_random_prob() < self.token_prob:\n tokens[i...
[ "0.64954305", "0.6290737", "0.6272901", "0.6272901", "0.6272901", "0.6148785", "0.59451646", "0.5890986", "0.5751701", "0.5737682", "0.57351816", "0.563494", "0.56142646", "0.55326474", "0.54899573", "0.5485592", "0.547473", "0.542751", "0.54229766", "0.53995466", "0.5398629"...
0.7062326
0
This function initializes the weights' values in the convolutional and dense layers, so as the vector of biases b.
def initializer(init, shape): if init == "zero": # The generated tensor has only zero-valued elements return tf.zeros(shape) elif init == "he": # fan_in gives the number of element in the tensor fan_in = np.prod(shape[0:-1]) std = 1 / np.sqrt(fan_in) # The generat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize_weights(self, weights_initializer, bias_initializer):\n wshapes = [\n [self.input_size, self.hidden_size[0]],\n [self.hidden_size[0], self.hidden_size[1]],\n [self.hidden_size[1], self.output_size]\n ]\n\n bshapes = [\n [1, self.hidden...
[ "0.7570135", "0.7550888", "0.75300604", "0.74037695", "0.7336945", "0.7335739", "0.72270304", "0.72270304", "0.72270304", "0.72160053", "0.7208797", "0.7205478", "0.71851903", "0.7161098", "0.7158058", "0.71547014", "0.71547014", "0.71547014", "0.71451426", "0.7138595", "0.71...
0.0
-1
This function determines what kind of activation function is implemented in the convolutional and dense layers.
def nonlinearity(nl): if nl == "relu": return tf.nn.relu elif nl == "tanh": return tf.nn.tanh elif nl == "linear" or nl == "none": return lambda x: x
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def encoder_activation_func(num_layer):\n ec_funct = []\n for i in range(num_layer):\n ec_funct.append('relu')\n ec_funct.append('softmax')\n\n return ec_funct", "def get_activation_function(func_name):\n return {\n 'linear': lambda x: x,\n 'relu': lambda x: x * (x > 0),\n ...
[ "0.7104166", "0.69043595", "0.68694824", "0.684561", "0.6825571", "0.68055254", "0.67536145", "0.6724984", "0.6681779", "0.6620056", "0.65422744", "0.6515124", "0.645811", "0.641034", "0.6402853", "0.63730896", "0.6362094", "0.62887573", "0.624553", "0.61857927", "0.61839116"...
0.0
-1
Parse a Postal Station (STN|RPO|Station) word
def parse_stn(self): index = self.index start = self.index if index == self.length: return None, 0 if self.words[index]['word'] == 'stn' or self.words[index]['word'] == 'station' or self.words[index]['word'] == 'rpo': index += 1 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_station_name (station_name):\n try:\n _,chinese_name,code,full_pinyin,short_pinyin = station_name.split('|')\n except ValueError:\n # print(station_name)\n _,chinese_name,code,full_pinyin,short_pinyin,_ = station_name.split('|')\n return {chinese_name:code,full_pinyin:code,s...
[ "0.623392", "0.6233269", "0.61185384", "0.60672194", "0.5706585", "0.5652462", "0.5631425", "0.5517574", "0.5503128", "0.5474191", "0.5456381", "0.5427626", "0.53800154", "0.53769773", "0.5357613", "0.53118235", "0.527336", "0.5262144", "0.52560794", "0.5253394", "0.5230342",...
0.6842843
0
Parse a Street Direction
def streetdir(self): if self.index >= self.length: return False self._dir, n = self.parse_streetdir() if self._dir is not None: self.idx_dir = self.index self.index += n if self.index < self.length and self.words[self.index]['word'] ==...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_streetdir(self):\n \n first = self.words[self.index]['word']\n if self.index + 1 < self.length:\n second = self.words[self.index+1]['word']\n else:\n second = None\n \n if first in ['northwest', 'northeast', 'southwest', 'southeast']:\n ...
[ "0.68816584", "0.64081746", "0.6017326", "0.5995247", "0.5952264", "0.5760724", "0.5744269", "0.5657991", "0.5613136", "0.5596745", "0.531961", "0.5315846", "0.52867997", "0.52714086", "0.5266984", "0.5236074", "0.5217547", "0.5201011", "0.5187263", "0.5169789", "0.51335555",...
0.0
-1
ReLU function, takes input h and return result of ReLU(h)
def relu(h): return np.maximum(h, 0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def relu_prime(h):\n return_value = h\n return_value[return_value <= 0] = 0\n return_value[return_value > 0 ] = 1\n return return_value", "def ReLU(self, x):\n self.x = x\n output = np.maximum(0, x)\n return output", "def _rnn_relu_cell(inputs, hidden, w_ih, w_hh, b_ih, b_hh):\n if b_ih...
[ "0.6746711", "0.664049", "0.6611213", "0.6571714", "0.65068805", "0.64704126", "0.6451632", "0.6394144", "0.634299", "0.6341994", "0.63404304", "0.6331816", "0.63282824", "0.6320288", "0.63083297", "0.6306409", "0.6283333", "0.6253684", "0.62309307", "0.620276", "0.6181885", ...
0.77946955
0
Derivative of the ReLU function
def relu_prime(h): return_value = h return_value[return_value <= 0] = 0 return_value[return_value > 0 ] = 1 return return_value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def grad_ReLU(self):\n y = self.x\n y[y<=0] = 0\n y[y>0] = 1\n return y\n raise NotImplementedError(\"ReLU gradient not implemented\")", "def relu_backward(dout, x):\n ############################################################################\n # TODO: Implement the ReL...
[ "0.76084167", "0.7193548", "0.71533364", "0.70321727", "0.700122", "0.700122", "0.69264287", "0.68933725", "0.68828493", "0.6828402", "0.68114156", "0.6805358", "0.6728544", "0.67052656", "0.66641754", "0.66311115", "0.6624153", "0.66214824", "0.66152894", "0.655448", "0.6531...
0.0
-1
Initialises weights depending on layer sizes and whether Xavier Initialisation is needed
def init_weights(n_input_layer, n_hidden_layer, n_hidden_layer_2, n_output_layer, xavier_init): W1, W2, W3 = None, None, None if xavier_init: # Checks if Xavier initialisation is wanted # Initialises weights depending on number of layers present using: # Normally distributed random number *...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize_weights_xavier(self):\n\t\tself.weights = [np.random.uniform(-1/sqrt(size1), 1/sqrt(size1)) for size1, size2 in zip(self.sizes[:-1], self.sizes[1:])]\n\t\tself.biases = [np.zeros([size, ]) for size in self.sizes[1:]]", "def init_weights_(self):\n raise NotImplementedError", "def _initiali...
[ "0.76051825", "0.7580625", "0.7418632", "0.7384778", "0.73651063", "0.72985464", "0.72827876", "0.723169", "0.72292835", "0.72177035", "0.72110796", "0.7196356", "0.7196356", "0.7196356", "0.71878", "0.7185429", "0.7176544", "0.71507525", "0.71335864", "0.71014833", "0.708755...
0.7777824
0
Get the details for an individual vocab
def retrieve(self, request, pk=None): queryset = Vocab.objects.all() vocab = get_object_or_404(queryset, pk=pk) serializer = VocabDetailSerializer(vocab, context={"request": request}) return Response(serializer.data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_vocab(which_vocab):\n path = os.path.join(mg.WORKING_PATH, 'vocab', ''.join([which_vocab, '.json'\n ]))\n if os.path.exists(path):\n with open(path, 'r') as js:\n return(json.load(js))\n else:\n return(dict())", "def load_vocab():\n # vocab loaded internally a...
[ "0.70155954", "0.6758839", "0.66370237", "0.658239", "0.641147", "0.6386239", "0.63847965", "0.6307677", "0.6295874", "0.6261076", "0.6252203", "0.6244632", "0.6216861", "0.6213393", "0.61783177", "0.6141274", "0.61408085", "0.61311096", "0.6130657", "0.6122938", "0.6116046",...
0.69035906
1
Sends the full photo to the user. Returns None if the photo_id does not belong to user_id. If user_is not provided, defaults to the currently logged in user.
def send_photo(photo_id, user_id=None): path = get_photo_path(photo_id, user_id) if path: return send_file(path)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send_photo(self, bot, update, photo, **kwargs):\n\n bot.sendChatAction(update.message.chat_id, action=\"upload_photo\")\n return bot.sendPhoto(update.message.chat_id, photo=photo, **kwargs)", "def get_photo(photo_id, user_id=None):\n\n\tif user_id == None:\n\t\tuser_id = current_user.get_user()...
[ "0.63316363", "0.62885314", "0.626324", "0.6196697", "0.6100797", "0.6003126", "0.58738434", "0.58505243", "0.57199496", "0.5655445", "0.551319", "0.54837596", "0.54803497", "0.54596967", "0.54332525", "0.53843236", "0.5357086", "0.5357048", "0.53344876", "0.5292925", "0.5277...
0.74784166
0
Creates a JWT token for account activation.
def create_jwt_for_account_activation(email: str) -> str: logging.debug('Creating a JWT for account activation - %s', email) return jwt.encode( key=config.JWT_ACTIVATION_SECRET_KEY, algorithm='HS256', payload={ 'sub': 'activation', 'email': email, 'exp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_auth_token():\n data = get_request_data(request)\n address = data.get(\"address\")\n expiration = int(data.get(\"expiration\"))\n\n pk = get_provider_private_key(use_universal_key=True)\n token = jwt.encode({\"exp\": expiration, \"address\": address}, pk, algorithm=\"HS256\")\n token =...
[ "0.7311987", "0.71036845", "0.6983588", "0.68776363", "0.68750894", "0.68676454", "0.6818633", "0.6811045", "0.67879117", "0.67571187", "0.6742507", "0.6725463", "0.6708632", "0.66643095", "0.66524696", "0.6650436", "0.66484785", "0.6637267", "0.6597703", "0.65425956", "0.652...
0.8025082
0
Retrieves an email from the payload of a JWT token. Raises exception if the JWT token is not valid.
def retrieve_email_from_jwt_for_account_activation(token: str) -> str: logging.debug("Retrieving email from JWT for account activation.") try: payload = jwt.decode(token.encode('utf-8'), key=config.JWT_ACTIVATION_SECRET_KEY, algorithm='HS256') except Exception as e: # TODO logging.de...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_email():\n headers = request.headers\n token = headers['Authorization'].split()[1]\n return Token.objects(access_token=token).first().email", "def get_email(self, token, uid):\n\n email_info_resp = get_remote(get_config('login.weibo.email_info_url') + token)\n email_info_resp_json ...
[ "0.7630464", "0.7101012", "0.70788604", "0.6519509", "0.6437453", "0.6377152", "0.6299448", "0.62386537", "0.6229537", "0.61632866", "0.6106897", "0.60842735", "0.6023732", "0.60121953", "0.60055405", "0.5980921", "0.5976147", "0.5867186", "0.585634", "0.585634", "0.585634", ...
0.7602766
1
Redefines constants and vectors used to be appropriate for time and solver step.
def redef_vars(self): # Try using redefined source / boundary terms if self.redefined == True: self._redef_via_predef_eqn() else: # If they haven't been set you'll get an exception. self._redef_sp1_vars()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_constants(cls):\r\n \"\"\" EXECUTE THIS FUNCTION IN THE FARM CLASS! \"\"\"\r\n cls.SOL = (cls.BLA*cls.CHR)/(2.0*cls.RAD)\r\n cls.REG = (cls.RPM*cls.RAD*cls.CHR*cls.PI)/(30*cls.NU)\r\n cls.DT = 2*cls.PI/cls.N", "def update_variables(self):\n self.dl21 = self.l21-self.l11; ...
[ "0.65729994", "0.6406866", "0.6043489", "0.6019538", "0.60185367", "0.59551966", "0.5934071", "0.5906838", "0.5875958", "0.5804494", "0.56491876", "0.5634645", "0.5632997", "0.5622783", "0.56130815", "0.5609937", "0.5606358", "0.55974984", "0.5550542", "0.5540554", "0.5521201...
0.5579886
18
The landing page of the StockEye application. Direct implementation of the HomeView.
def home(request): assert isinstance(request, HttpRequest) return render( request, 'app/index.html', { 'title':'Home Page', 'year':datetime.now().year, } )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def home(request):\n assert isinstance(request, HttpRequest)\n return render(\n request,\n 'AscensionESports_Baseline/index.html',\n {\n 'background': getSiteBackground(),\n 'color': getSiteColor(),\n 'title':'Home Page',\n 'year':datetime.now(...
[ "0.76001287", "0.7538219", "0.7534859", "0.74867", "0.7381001", "0.7379283", "0.73678327", "0.7352212", "0.733345", "0.73329055", "0.73291034", "0.73186225", "0.7316763", "0.7311779", "0.73037845", "0.7296801", "0.7263586", "0.72535205", "0.72402614", "0.72295815", "0.7218529...
0.0
-1
Renders the about page.
def about(request): assert isinstance(request, HttpRequest) return render( request, 'app/about.html', { 'title':'About', 'message':'Your application description page.', 'year':datetime.now().year, } )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def about():\n return render_template('about.html', title='About')", "def about():\n\n return render_template('about_page.html', title='About')", "def about():\n\n\treturn render_template(\"about.html\")", "def on_about(self):\n render_about_window()", "def about():\n return render_temp...
[ "0.85650355", "0.85034525", "0.84489655", "0.84044397", "0.8394454", "0.82935613", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82680845",...
0.7612688
72
Displays the selected stock, providing the name, sentiment, and the price of said stock. Direct implementation of the StockView.
def stock(request, s_id): assert isinstance(request, HttpRequest) try: #Get the requested stock with (stock_id) stocks = StockList.objects.filter(stock_id=s_id).get() stock_id = stocks.stock_id stock_name = stocks.symbol stock_value = stocks.value #do we have a s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stock_view(request):\n if request.method == 'GET':\n try:\n symbol = request.GET['symbol']\n except KeyError:\n return {}\n try:\n response = requests.get(API_URL + '/stock/{}/company'.format(symbol))\n data = response.json()\n retu...
[ "0.62709934", "0.62612647", "0.62485635", "0.60026693", "0.592461", "0.59138197", "0.58526856", "0.57856214", "0.57244945", "0.5683895", "0.56825393", "0.56317514", "0.56277454", "0.5605878", "0.55981827", "0.5585482", "0.5584243", "0.55689496", "0.55596864", "0.55541444", "0...
0.7422457
0
Sets the pthid of this Thread.
def pthid(self, pthid): self._pthid = pthid
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def thid(self, thid):\n\n self._thid = thid", "def thread_id(self, thread_id):\n\n self._thread_id = thread_id", "def thread_id(self, thread_id):\n\n self._thread_id = thread_id", "def thread_id(self, thread_id):\n\n self._thread_id = thread_id", "def pid(self, pid):\n\n ...
[ "0.72480106", "0.6926966", "0.6926966", "0.6926966", "0.6742504", "0.6742504", "0.6700898", "0.66840965", "0.63728267", "0.627035", "0.622268", "0.6181539", "0.61787826", "0.6133578", "0.6112368", "0.6112368", "0.6035746", "0.59666836", "0.5958457", "0.59483874", "0.5893692",...
0.8066558
0
Sets the thid of this Thread.
def thid(self, thid): self._thid = thid
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def thread_id(self, thread_id):\n\n self._thread_id = thread_id", "def thread_id(self, thread_id):\n\n self._thread_id = thread_id", "def thread_id(self, thread_id):\n\n self._thread_id = thread_id", "def set_tid(self, tid):\n self.__tid = tid", "def pthid(self, pthid):\n\n ...
[ "0.71798706", "0.71798706", "0.71798706", "0.7097371", "0.6712861", "0.5938794", "0.57075554", "0.5689583", "0.5666702", "0.5609876", "0.56035346", "0.56035346", "0.559792", "0.55645794", "0.5563854", "0.5559026", "0.5547788", "0.55468583", "0.5533373", "0.55246586", "0.55246...
0.8122559
0
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, Thread): return False return self.__dict__ == other.__dict__
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False", "def __eq__(self, other):\n if i...
[ "0.80891633", "0.80891633", "0.8055254", "0.7983334", "0.7967544", "0.7967544", "0.7967544", "0.7967544", "0.7967544", "0.7967544", "0.7967544", "0.7967544", "0.7967544", "0.7967544", "0.7967544", "0.7967544", "0.7967544", "0.7967544", "0.7967544", "0.7967544", "0.7967544", ...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): return not self == other
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other) -> bool:\n return not self.__eq__(other)", "def __eq__(self, other):\n ...
[ "0.8456063", "0.83918154", "0.8144437", "0.8140196", "0.8132038", "0.8093834", "0.80918837", "0.80918837", "0.80918837", "0.80852824", "0.80852824", "0.807626", "0.807626", "0.80657643" ]
0.0
-1
Test the conversion of json issues to object issues
def test_convert_json_to_issues(self): with open("convert_json_to_issues.json", "r") as issues_file: response_json = json.loads(issues_file.read()) issues = jiratimereport.convert_json_to_issues(response_json) issues_expected_result = [ Issue(10005, "MYB-5", "Summary of...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testfromjson(self):\n dicty = {\"id\": 5, \"class\": \"string\", \"list\": [], \"set\": {}}\n self.assertEqual([dicty, dicty],\n Base.from_json_string(json.dumps([dicty, dicty])))", "def test_json_loads_object() -> None:\n assert json_loads_object('{\"c\":1.2}') == {\...
[ "0.6965997", "0.6955709", "0.6955709", "0.6949413", "0.6914408", "0.6651135", "0.65893173", "0.6551188", "0.6508977", "0.6478302", "0.64725137", "0.64644873", "0.6453786", "0.6436468", "0.6400618", "0.6383816", "0.6380621", "0.6368812", "0.63525397", "0.6345754", "0.632622", ...
0.7233345
0