query
stringlengths
9
3.4k
document
stringlengths
9
87.4k
metadata
dict
negatives
listlengths
4
101
negative_scores
listlengths
4
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Send a json payload direct to device
async def _sendjson(self, deviceid, message): try: params = json.loads(message.replace("'",'"')) payload = {} payload['action'] = 'update' payload['userAgent'] = 'app' payload['from'] = 'app' payload['params'] = params payload[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _send_json(self, payload: dict):\n data = json.dumps(payload)\n return self.send(data)", "def sendjson(self, data):\n\n import json\n\n self.sendraw(json.dumps(data))", "def _send_json(self, data):\n return self.sendMessage(json.dumps(data).encode(\"utf-8\"))", "def sen...
[ "0.7980989", "0.7514945", "0.73651516", "0.7312212", "0.71018744", "0.6894723", "0.68546855", "0.6801324", "0.6728189", "0.6722418", "0.6658556", "0.65708166", "0.65381074", "0.6450896", "0.642864", "0.6392794", "0.63624746", "0.6321453", "0.6247817", "0.6233439", "0.621992",...
0.74449843
2
Initialize left and right lane cache
def init_cache(self): self.left_lane_cache = list() self.right_lane_cache = list()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n self.side = None\n \"\"\"\n Cache to store the evaluation of board positions that we have already looked at. This avoids repeating a lot\n of work as we do not look at all the possible continuation from this position again.\n \"\"\"\n self.cache = {}\...
[ "0.62603575", "0.6206263", "0.57225484", "0.5583743", "0.55815846", "0.55552655", "0.55008185", "0.54288805", "0.5391921", "0.5384816", "0.53778046", "0.5362928", "0.53568006", "0.5348835", "0.53398573", "0.53301936", "0.5324952", "0.52990544", "0.5280529", "0.5273415", "0.52...
0.82159823
0
take the average of past cached endpoints as the new end point of line segments
def probablistic_smoothing(self, line, cache): new_line_wght = self.prob_smoothing_params["current_line_weight"] past_lines_wght = self.prob_smoothing_params["past_lines_weight"] if line is None: return np.mean(cache, axis=0).round().astype(int), cache[-self.cache_size :] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def average(self):\n return (self.current + self.last) / 2.0", "def avg_removed(self):\n avg = {}\n for path, lines in self.lines_removed.items():\n avg[path] = round(statistics.mean(lines))\n\n return avg", "def get_avg_points(self):\n pass", "def avg_added(self...
[ "0.54744446", "0.53983194", "0.5389896", "0.5363136", "0.5295096", "0.5293981", "0.5252361", "0.524959", "0.52452606", "0.52328026", "0.51629716", "0.513422", "0.5134078", "0.5078152", "0.5069658", "0.5062421", "0.50586176", "0.50559497", "0.5050954", "0.50039643", "0.5003947...
0.5614162
0
Create a color mask that only persists yellow and white color
def color_filter(self, image): converted = hls_scale(image) # white color mask white_lower_bnd, white_upper_bnd = self.color_filter_params["white_bounds"] white_mask = cv2.inRange(converted, white_lower_bnd, white_upper_bnd) # yellow color mask yellow_lower_bnd, yellow_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mask_color(self):\n return self._mask_color", "def color_motion_mask(mask, color=None):\n if color is None:\n color = (220, 20, 60)\n h, w = mask.shape\n ext_mask = np.stack([mask, mask, mask], -1).astype(np.uint8)\n color = np.ones_like(ext_mask) * color\n index = np.ones_like(e...
[ "0.68802637", "0.6729972", "0.6648039", "0.6630563", "0.6599889", "0.6505892", "0.64802855", "0.6364312", "0.6318129", "0.625346", "0.62262666", "0.620184", "0.6184398", "0.6165644", "0.61598253", "0.6154873", "0.61491185", "0.6118417", "0.6105478", "0.60970825", "0.6068026",...
0.6240644
10
Applies a Gaussian Noise kernel
def gaussian_blur(self, img): kernel_size = self.gaussian_blur_params["kernel_size"] return cv2.GaussianBlur(img, (kernel_size, kernel_size), 0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def makeGaussianKernel(sigma: float) -> np.ndarray:\n\n # Your code here.\n kernel_size = 8*sigma+1\n kernel = np.zeros([kernel_size,kernel_size], dtype=float)\n center = kernel_size//2\n \n \n s = 2*(sigma**2)\n sum_val = 0\n for i in range(0,kernel_size):\n for j in range(0,kern...
[ "0.7250341", "0.7239833", "0.71334195", "0.7074577", "0.7032351", "0.7006447", "0.69614136", "0.69235426", "0.69152766", "0.6892698", "0.6846992", "0.6845474", "0.6800762", "0.6747116", "0.6741646", "0.6683868", "0.66422224", "0.6622503", "0.6599512", "0.6595668", "0.6554001"...
0.0
-1
Applies an image mask. Only keeps the region of the image defined by the polygon formed from `vertices`. The rest of the image is set to black. `vertices` should be a numpy array of integer points.
def region_of_interest(self, img): # get region vertices r1, r2, r3, r4 = self.region_filter_params["ratios"] img_height, img_width = img.shape vertices = define_region_vertices(img_height, img_width, r1, r2, r3, r4) # defining a blank mask to start with mask = np.zeros_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __mask_region(self, img, vertices):\n\n mask = np.zeros_like(img) \n if len(img.shape) > 2:\n channel_count = img.shape[2] # i.e. 3 or 4 depending on your image\n ignore_mask_color = (255,) * channel_count\n else:\n ignore_mask_color = 255\n cv2.f...
[ "0.83760303", "0.7984245", "0.79474634", "0.7841204", "0.7665023", "0.76447153", "0.76368064", "0.7631344", "0.7631344", "0.7631344", "0.7631344", "0.7631344", "0.7631344", "0.760617", "0.760617", "0.760617", "0.760617", "0.760617", "0.760617", "0.760617", "0.7589865", "0.7...
0.55127597
39
Applies the Canny transform
def canny(self, img): low_threshold, high_threshold = self.canny_params["thresholds"] return cv2.Canny(img, low_threshold, high_threshold)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def applyCanny( self, img):\n img = togray( img )\n res = cv2.Canny( img ,480,500)\n return res", "def process(self):\n self.output_image = cv.Canny(\n self.input_image,\n self.MIN_THRESHOLD,\n self.MAX_THRESHOLD,\n )\n return self.output...
[ "0.6851333", "0.6696515", "0.646865", "0.6365283", "0.6306947", "0.6306947", "0.6306947", "0.6306947", "0.6306947", "0.6306947", "0.6306947", "0.6306947", "0.6306947", "0.6306947", "0.6306947", "0.6306947", "0.6306947", "0.6306947", "0.6306947", "0.61454356", "0.58105993", ...
0.6240188
19
Given a set of lines (both sloped left and right), return the end points of both left and right sloped lines
def get_lane_lines(self, lines, image): # get image shape img_height, img_width, _ = image.shape # get left and right lanes slope_lower_bnd, slope_upper_bnd = self.slope_params["bounds"] left_lane, right_lane = get_lanes_segments( lines, slope_lower_bnd, slope_upper_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_start_end_points(linestrings):\n starts = []\n stops = []\n for ls in linestrings:\n pt = Point(ls.coords[0])\n starts.append(round(CONUS[\"poly\"].exterior.project(pt), 2))\n pt = Point(ls.coords[-1])\n stops.append(round(CONUS[\"poly\"].exterior.project(pt), 2))\n...
[ "0.6785511", "0.66734064", "0.66500884", "0.66392875", "0.6604364", "0.6539876", "0.6521066", "0.6504693", "0.6430932", "0.63846624", "0.6295815", "0.6274992", "0.6273652", "0.62110466", "0.6155015", "0.6122678", "0.6120629", "0.61088717", "0.6102816", "0.608761", "0.6074385"...
0.0
-1
Use get_lane_lines to draw complete lines over image
def draw_lines(self, img, lines, color=[255, 0, 0], thickness=5): # draw left and right lane lines for x1, y1, x2, y2 in self.get_lane_lines(lines, img): cv2.line(img, (x1, y1), (x2, y2), color, thickness)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_lane_lines(image, lines, color=[0, 0, 255], thickness=20):\n # Make a separate image to draw lines and combine with the orignal later\n line_image = np.zeros_like(image)\n if lines is not None:\n for line in lines:\n if(len(line) > 0):\n x1, y1, x2, y2 = line.resh...
[ "0.7919993", "0.78633344", "0.7313447", "0.72849727", "0.7284691", "0.72745675", "0.71406925", "0.7067983", "0.7034421", "0.69065547", "0.6853404", "0.68370837", "0.68081594", "0.66906846", "0.6688143", "0.6620262", "0.6594507", "0.65573055", "0.65559816", "0.6551267", "0.653...
0.7423557
2
`img` should be the output of a Canny transform. Returns an image with hough lines drawn.
def hough_lines(self, img): # get parameters rho = self.hough_params["rho"] theta = self.hough_params["theta"] threshold = self.hough_params["threshold"] min_line_len = self.hough_params["min_line_len"] max_line_gap = self.hough_params["max_line_gap"] lines = cv2...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hough_lines(image):\n #30 20 20\n\n #best 40, 20, 300\n #fin test 40, 20, 50\n return cv2.HoughLinesP(image, rho=1, theta=np.pi / 90, threshold=40, minLineLength=20, maxLineGap=50)", "def get_hough_lines(image):\n return cv2.HoughLinesP(image, rho=1, theta=np.pi / 180, threshold=20,\n ...
[ "0.75403315", "0.7412711", "0.73597676", "0.7242464", "0.7199347", "0.7150264", "0.71482354", "0.71411544", "0.71411544", "0.71411544", "0.71411544", "0.7114938", "0.71109265", "0.71016014", "0.71016014", "0.71016014", "0.70694315", "0.7060614", "0.70540863", "0.70421743", "0...
0.72756684
3
Combine all the previous steps and perform lane detection on given image
def detect(self, img): # 1. color filter lane_img = self.color_filter(img.copy()) # 2. gaussian blur lane_img = self.gaussian_blur(lane_img) # 3.canny edge detection lane_img = self.canny(lane_img) # 4. region of interest crop lane_img = self.region_of_int...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def my_lane_detection_pipeline(image, debug_images=False):\n\n # Step 1 - Filter and enhance image by lane color\n image_s1 = filter_lane_color(image)\n \n # Step 2 - Canny edge detection with Gaussian blur and region mask\n image_s2 = detect_lane_edges(image_s1)\n \n # Step 3 - Raw line detec...
[ "0.7772083", "0.71431744", "0.66509396", "0.6605509", "0.64801335", "0.6470941", "0.64340734", "0.6421709", "0.63861597", "0.6371772", "0.63043404", "0.6262779", "0.6192044", "0.6145569", "0.61420614", "0.60828114", "0.6067602", "0.6050235", "0.60368454", "0.60075176", "0.598...
0.69097793
2
Use detect algorithm for data predict
def __init__(self, args, data_path, data_dir, device, log, x_shape): self._args = args self._data_path = data_path self._data_dir = data_dir self._device = device self._x_shape = x_shape self._log = log
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def predict(self, img_path):\n\n img = cv2.imread(img_path)\n img0 = img.copy()\n \n #This happens inside datasets\n # Convert\n img = letterbox(img, new_shape=self.img_size)[0]\n\n # Convert\n img = img[:, :, ::-1].transpose(2, 0, 1) # BGR to RGB, to 3x416x...
[ "0.7699658", "0.72339535", "0.7227017", "0.72005284", "0.71623325", "0.7108163", "0.7099277", "0.7093819", "0.7091404", "0.70904684", "0.70788956", "0.704531", "0.7026208", "0.69534343", "0.69499594", "0.6949794", "0.69460124", "0.69453096", "0.69453096", "0.69032896", "0.690...
0.0
-1
Use pandas load the predict data
def pd_data(self): data = pd.read_csv(self._data_path + self._data_dir) return data
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def predict(self, datafile):", "def make_predictions(df):\n t_labels = get_labels(\"labels_pca\")\n # clean data\n df = clean_data(df)\n # engineer data\n df = engineer_features(df)\n # predict\n with open(\"model.pkl\",\"r\") as mdl:\n model = pickle.load(mdl)\n mdl.close()\n ...
[ "0.7554036", "0.68880117", "0.6786599", "0.66613847", "0.66600627", "0.6659659", "0.6632678", "0.6612616", "0.65940815", "0.6571002", "0.6546713", "0.6530167", "0.6503822", "0.649749", "0.6495153", "0.6447961", "0.6447961", "0.6447512", "0.6447512", "0.6447512", "0.6413694", ...
0.0
-1
The iterator used to load the data
def data_load(self, is_normal=True): pre_data = FaceTransData(path=self._data_path, data_dir=self._data_dir, batch_size=1, shuffle=True, num_works=4, is_normal=is_normal, log=self._log) pre_iter = pre_data.data_load() return pre_iter
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __iter__(self) -> Iterator:\n return iter(self.get_data_loader())", "def __iter__(self):\n for item in self._reader:\n yield item", "def __iter__(self):\n\n # Open the data reader\n self.data.open()\n\n starts = np.arange(self.start, self.stop, self.chunksize)\...
[ "0.84665096", "0.7493596", "0.7404191", "0.73568666", "0.73096824", "0.7292843", "0.7268924", "0.7241434", "0.7241434", "0.7241434", "0.7147667", "0.7090059", "0.7038672", "0.70293057", "0.69908375", "0.6988356", "0.6944298", "0.6941825", "0.6938084", "0.69227487", "0.691172"...
0.0
-1
Solves classical Car fueling problem using greedy algorithm
def compute_min_refills(distance, tank, stops): num_refills = 0 current_refill = 0 all_stops = [] all_stops.append(0) for stop in stops: all_stops.append(stop) all_stops.append(distance) num_stops = len(all_stops) while current_refill < num_stops: last_refill = current_refi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def greedy_initial(self):\r\n sol = [] # [[0;2;5;0;4;6;0],[],...]\r\n sol_veh_type = [] # corresponding vehicle type for the solution\r\n route_way_time = []\r\n\r\n to_vist = [i+1 for i in range(store_num - 1)] # [1,5,8,...]\r\n itr = 0\r\n\r\n while len(to_vist) > 0 a...
[ "0.6332758", "0.63229316", "0.63032645", "0.62776846", "0.6268711", "0.61121124", "0.61011", "0.60272455", "0.60207784", "0.6005734", "0.5992131", "0.5982942", "0.59481394", "0.59463507", "0.58736974", "0.58717364", "0.5866816", "0.5790337", "0.57802093", "0.5777285", "0.5773...
0.0
-1
GetOutput(self) > itkMeshD2Q GetOutput(self, unsigned int idx) > itkMeshD2Q
def GetOutput(self, *args): return _itkMeshSourcePython.itkMeshSourceMD2Q_GetOutput(self, *args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetOutput(self, *args) -> \"itkMeshD2 *\":\n return _itkVTKPolyDataReaderPython.itkVTKPolyDataReaderMD2_Superclass_GetOutput(self, *args)", "def GetOutput(self, *args) -> \"itkPointSetD2 *\":\n return _itkMeshSourcePython.itkMeshSourcePSD2_GetOutput(self, *args)", "def GetOutput(self, *args) ...
[ "0.707139", "0.7049461", "0.6873616", "0.6843278", "0.6818263", "0.6817498", "0.6801467", "0.6795621", "0.6783045", "0.6737912", "0.6718591", "0.6700618", "0.669821", "0.66754043", "0.66668105", "0.6639717", "0.6619755", "0.6594609", "0.65867054", "0.6510939", "0.6499863", ...
0.69199556
2
GraftNthOutput(self, unsigned int idx, itkDataObject output)
def GraftNthOutput(self, *args): return _itkMeshSourcePython.itkMeshSourceMD2Q_GraftNthOutput(self, *args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GraftNthOutput(self, idx: 'unsigned int', output: 'itkDataObject') -> \"void\":\n return _itkVTKPolyDataReaderPython.itkVTKPolyDataReaderMD2_Superclass_GraftNthOutput(self, idx, output)", "def GraftNthOutput(self, idx: 'unsigned int', output: 'itkDataObject') -> \"void\":\n return _itkVTKPolyDa...
[ "0.89400214", "0.8895562", "0.8837933", "0.8831346", "0.86326706", "0.86299235", "0.85932654", "0.8584795", "0.85645646", "0.8523675", "0.85161006", "0.8485624", "0.8475633", "0.8475165", "0.84505266", "0.8450234", "0.84495795", "0.84248865", "0.84246755", "0.84235984", "0.84...
0.72391015
24
cast(itkLightObject obj) > itkMeshSourceMD2Q
def cast(*args): return _itkMeshSourcePython.itkMeshSourceMD2Q_cast(*args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def itkMeshSourceMD2_cast(obj: 'itkLightObject') -> \"itkMeshSourceMD2 *\":\n return _itkMeshSourcePython.itkMeshSourceMD2_cast(obj)", "def cast(obj: 'itkLightObject') -> \"itkMeshSourceMD2 *\":\n return _itkMeshSourcePython.itkMeshSourceMD2_cast(obj)", "def itkMeshSourceMD3_cast(obj: 'itkLightObject...
[ "0.8582052", "0.8537004", "0.83109564", "0.8264792", "0.8228583", "0.81956387", "0.80514306", "0.7962712", "0.7915732", "0.79055077", "0.7892144", "0.7815524", "0.78107864", "0.77667904", "0.7763599", "0.7682104", "0.763537", "0.76352715", "0.76349384", "0.76339114", "0.76305...
0.74455327
34
New() > itkMeshSourceMD2Q Create a new object of the class itkMeshSourceMD2Q and set the input and the parameters if some named or nonnamed arguments are passed to that method. New() tries to assign all the non named parameters to the input of the new objects the first non named parameter in the first input, etc. The n...
def New(*args, **kargs): obj = itkMeshSourceMD2Q.__New_orig__() import itkTemplate itkTemplate.New(obj, *args, **kargs) return obj
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def New(*args, **kargs):\n obj = itkMeshSourceMD3Q.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **kargs)\n return obj", "def New(*args, **kargs):\n obj = itkMeshSourceMD2.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **karg...
[ "0.7639044", "0.727875", "0.7128952", "0.698582", "0.6949615", "0.6797933", "0.6774174", "0.67558956", "0.6738865", "0.66925174", "0.6649819", "0.66396123", "0.6613809", "0.6544495", "0.6528151", "0.6504718", "0.6462523", "0.6440543", "0.6421221", "0.6412888", "0.63615274", ...
0.80018705
0
itkMeshSourceMD2Q_cast(itkLightObject obj) > itkMeshSourceMD2Q
def itkMeshSourceMD2Q_cast(*args): return _itkMeshSourcePython.itkMeshSourceMD2Q_cast(*args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def itkMeshSourceMD2_cast(obj: 'itkLightObject') -> \"itkMeshSourceMD2 *\":\n return _itkMeshSourcePython.itkMeshSourceMD2_cast(obj)", "def cast(obj: 'itkLightObject') -> \"itkMeshSourceMD2 *\":\n return _itkMeshSourcePython.itkMeshSourceMD2_cast(obj)", "def itkMeshSourceMD3_cast(obj: 'itkLightObject...
[ "0.86521226", "0.8496428", "0.8229923", "0.81796956", "0.8117432", "0.8107494", "0.7942349", "0.79344153", "0.77690357", "0.7740543", "0.7737454", "0.7703959", "0.7676164", "0.76738644", "0.76635903", "0.7634641", "0.76233923", "0.7613119", "0.75789106", "0.7488574", "0.74645...
0.8176313
4
GetOutput(self) > itkMeshD3Q GetOutput(self, unsigned int idx) > itkMeshD3Q
def GetOutput(self, *args): return _itkMeshSourcePython.itkMeshSourceMD3Q_GetOutput(self, *args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetOutput(self, *args) -> \"itkMeshD3 *\":\n return _itkVTKPolyDataReaderPython.itkVTKPolyDataReaderMD3_Superclass_GetOutput(self, *args)", "def GetOutput(self, *args) -> \"itkPointSetD3 *\":\n return _itkMeshSourcePython.itkMeshSourcePSD3_GetOutput(self, *args)", "def GetOutput(self, *args) ...
[ "0.7287188", "0.7221649", "0.71742666", "0.71100026", "0.7073772", "0.7030481", "0.70147634", "0.6998503", "0.69892234", "0.6967587", "0.693919", "0.6935009", "0.69286907", "0.69260216", "0.68590224", "0.6832003", "0.6768338", "0.67619294", "0.67344165", "0.6715194", "0.67117...
0.7188139
2
GraftNthOutput(self, unsigned int idx, itkDataObject output)
def GraftNthOutput(self, *args): return _itkMeshSourcePython.itkMeshSourceMD3Q_GraftNthOutput(self, *args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GraftNthOutput(self, idx: 'unsigned int', output: 'itkDataObject') -> \"void\":\n return _itkVTKPolyDataReaderPython.itkVTKPolyDataReaderMD2_Superclass_GraftNthOutput(self, idx, output)", "def GraftNthOutput(self, idx: 'unsigned int', output: 'itkDataObject') -> \"void\":\n return _itkVTKPolyDa...
[ "0.89392704", "0.8894368", "0.8836376", "0.8830004", "0.86312455", "0.8628986", "0.8591946", "0.85839427", "0.85637003", "0.8522126", "0.85147744", "0.84840816", "0.8473943", "0.84732926", "0.8448603", "0.84482354", "0.8447432", "0.8422545", "0.84224826", "0.842226", "0.84176...
0.71448874
25
cast(itkLightObject obj) > itkMeshSourceMD3Q
def cast(*args): return _itkMeshSourcePython.itkMeshSourceMD3Q_cast(*args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def itkMeshSourceMD3_cast(obj: 'itkLightObject') -> \"itkMeshSourceMD3 *\":\n return _itkMeshSourcePython.itkMeshSourceMD3_cast(obj)", "def cast(obj: 'itkLightObject') -> \"itkMeshSourceMD3 *\":\n return _itkMeshSourcePython.itkMeshSourceMD3_cast(obj)", "def itkMeshSourceMF3_cast(obj: 'itkLightObject...
[ "0.8897926", "0.87653625", "0.85445416", "0.84689623", "0.8408301", "0.83891255", "0.83023906", "0.82078826", "0.81228536", "0.8096932", "0.8038447", "0.8036079", "0.80280703", "0.8027851", "0.8007173", "0.8004767", "0.7995328", "0.79838175", "0.796514", "0.7950437", "0.79498...
0.7580068
30
New() > itkMeshSourceMD3Q Create a new object of the class itkMeshSourceMD3Q and set the input and the parameters if some named or nonnamed arguments are passed to that method. New() tries to assign all the non named parameters to the input of the new objects the first non named parameter in the first input, etc. The n...
def New(*args, **kargs): obj = itkMeshSourceMD3Q.__New_orig__() import itkTemplate itkTemplate.New(obj, *args, **kargs) return obj
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def New(*args, **kargs):\n obj = itkMeshSourceMD3.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **kargs)\n return obj", "def New(*args, **kargs):\n obj = itkMeshSourceMD2Q.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **karg...
[ "0.76424545", "0.75177705", "0.72723085", "0.72642565", "0.70665973", "0.70411664", "0.6989817", "0.69875216", "0.69681907", "0.6827896", "0.6809468", "0.6800386", "0.676918", "0.6702616", "0.6649606", "0.6634698", "0.6605022", "0.6587581", "0.65751237", "0.6470867", "0.64678...
0.821262
0
itkMeshSourceMD3Q_cast(itkLightObject obj) > itkMeshSourceMD3Q
def itkMeshSourceMD3Q_cast(*args): return _itkMeshSourcePython.itkMeshSourceMD3Q_cast(*args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def itkMeshSourceMD3_cast(obj: 'itkLightObject') -> \"itkMeshSourceMD3 *\":\n return _itkMeshSourcePython.itkMeshSourceMD3_cast(obj)", "def cast(obj: 'itkLightObject') -> \"itkMeshSourceMD3 *\":\n return _itkMeshSourcePython.itkMeshSourceMD3_cast(obj)", "def itkMeshSourceMF3_cast(obj: 'itkLightObject...
[ "0.8978029", "0.8786041", "0.8519509", "0.83915526", "0.8382306", "0.8357595", "0.8251058", "0.82282436", "0.8043792", "0.8010526", "0.7997927", "0.7983657", "0.79835016", "0.7977872", "0.793134", "0.7918131", "0.7876938", "0.7820073", "0.7818601", "0.7747988", "0.7739797", ...
0.8198177
8
Sets a region to a particular value
def fill(self, value, x, y, width, height): for sub_y in range(y, y+height): for sub_x in range(x, x+width): self[sub_x, sub_y] = value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_region(sender, instance, *args, **kwargs):\n if instance.geocity and not instance.georegion:\n instance.georegion = instance.geocity.region", "def region(self, region):\n \n self._region = region", "def region(self, region):\n\n self._region = region", "def region(self,...
[ "0.7444116", "0.70485026", "0.69882685", "0.69882685", "0.69882685", "0.6510534", "0.64740556", "0.6460807", "0.623987", "0.61803454", "0.6177924", "0.6164625", "0.61354846", "0.6115651", "0.6097895", "0.6062013", "0.6021172", "0.60110104", "0.600338", "0.59770185", "0.594213...
0.0
-1
Sets a region to a particular value See Also fill
def fill_rect(self, value, x1, y1, x2, y2): self.fill(x1, y1, x2-x1, y2-y1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fill(self, value, x, y, width, height):\n for sub_y in range(y, y+height):\n for sub_x in range(x, x+width):\n self[sub_x, sub_y] = value", "def set_region(sender, instance, *args, **kwargs):\n if instance.geocity and not instance.georegion:\n instance.georegion = i...
[ "0.66783965", "0.64947945", "0.6392438", "0.6392438", "0.6352766", "0.6349013", "0.6349013", "0.6349013", "0.6338692", "0.6298974", "0.62987196", "0.62671965", "0.62586284", "0.62586284", "0.6245167", "0.6244899", "0.6215164", "0.6141975", "0.61307424", "0.6105758", "0.610575...
0.6050459
24
Accepts assignment from similar entry objects as well as dicts containing object properties See Also Editable.from_dict
def __setitem__(self, key, value): try: value_size = ctypes.sizeof(value) except TypeError: self.entries[key].from_dict(value) else: entry_size = ctypes.sizeof(self.entries[key]) if value_size != entry_size: raise ValueError('Incorr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_from_entry(self, entry):\n self.type_cls = type(entry)\n\n self.description = entry.description\n self.updated = entry.updated\n self.notes = entry.notes\n for field in entry.entry_fields:\n self._update_property(field, entry.properties[field])", "def set_fro...
[ "0.6611453", "0.60418135", "0.5746494", "0.5703061", "0.5697961", "0.56486607", "0.54922706", "0.540645", "0.54008317", "0.5379743", "0.5379696", "0.53728473", "0.5351789", "0.52705425", "0.5257742", "0.5253824", "0.5230565", "0.5221865", "0.52115643", "0.5175359", "0.5155093...
0.0
-1
Setup the arguments for the config command
def setup_arguments(parser: argparse.ArgumentParser) -> argparse.ArgumentParser: parser.set_defaults(command=lambda x: parser.print_usage()) subparsers = parser.add_subparsers( title=f"{COMMAND} commands", description="sub commands for managing configs" ) apply_parser = subparsers.add_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def configure(self, args):\n pass", "def setup_config(self, args=None):\n self.config_parse(args=args)", "def _build_arguments(self):\n # TODO: comeback to allow test path override. maybe?\n # self._parser.add_argument(\n # '--test-path',\n # type=utils.validat...
[ "0.7788124", "0.7565329", "0.70790946", "0.7063237", "0.70369494", "0.6929233", "0.69161654", "0.6785534", "0.6651369", "0.6608182", "0.6591953", "0.65891504", "0.6581827", "0.65815383", "0.65695715", "0.6550548", "0.6495801", "0.6495481", "0.6474589", "0.6473079", "0.6441089...
0.65878296
12
Download and Apply a snapshot
def main(args: argparse.Namespace) -> None: repo_dir = get_repo_dir(args.user, args.repo) if not check_dirs([repo_dir]): create_dirs([repo_dir]) file_name = os.path.join( repo_dir, f"{args.user}.{args.repo}.tar.gz" ) if args.no_download and os.path.isfile(file_name): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def download_snapshot(self, slug, output_path):\n command = COMMAND_SNAPSHOT_DOWNLOAD.format(slug=slug)\n\n try:\n with async_timeout.timeout(self._backup_timeout):\n request = await self._hassio.websession.request(\n \"get\",\n f\...
[ "0.6515842", "0.65116477", "0.6464617", "0.63019544", "0.62119174", "0.616193", "0.6024504", "0.60233146", "0.6017557", "0.6017557", "0.5995376", "0.5970756", "0.5963496", "0.595412", "0.5953596", "0.59465307", "0.5943506", "0.5927463", "0.59239537", "0.5915086", "0.5915086",...
0.0
-1
Get room associated to camera.
def get_camera_room(camera_serial: str) -> Optional[dict]: response = api.get_camera_room_api(camera_serial) return response.json()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def room(self) -> Room:\n return self.__room", "def _get_camera(self, mode):\n cam_bp = self.blueprint_lib.find(f\"sensor.camera.{mode}\")\n cam_bp.set_attribute(\"image_size_x\", f\"{self.img_x}\")\n cam_bp.set_attribute(\"image_size_y\", f\"{self.img_y}\")\n cam_bp.set_attrib...
[ "0.6728357", "0.6713514", "0.66802335", "0.66802335", "0.6673557", "0.6614773", "0.6601712", "0.6572413", "0.64967835", "0.6476653", "0.644459", "0.6427372", "0.63323754", "0.62849903", "0.62781805", "0.6241834", "0.6104265", "0.6080289", "0.6042704", "0.6021046", "0.5986032"...
0.7647021
0
Get network associated to camera.
def get_camera_network(camera_serial: str) -> dict: client = MerakiSdkClient(config.MERAKI_AUTH_TOKEN) try: orgs = client.organizations.get_organizations() all_organizations = {} for org in orgs: all_organizations['organization_id'] = org['id'] if all_organizations:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_network(self):\n return self._network", "def network(self):\n return self._network", "def network(self):\n return self._network", "def network(self):\n return self._network", "def network(self):\n return self.__network", "def get_network(self):\n return s...
[ "0.71050507", "0.6955228", "0.6955228", "0.6955228", "0.69142604", "0.6740101", "0.65168417", "0.65069646", "0.63467383", "0.6221031", "0.61620504", "0.6125328", "0.61247253", "0.6123163", "0.6123125", "0.6123125", "0.6044055", "0.6041264", "0.6035298", "0.60240036", "0.60233...
0.69020784
5
Get meeting associated to room.
def get_room_meeting(room_id: str) -> Optional[dict]: try: response = api.get_current_meeting_api(room_id) return response.json() except Exception as err: logger.error(str(err))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_available_room(meeting_length: int) -> Optional[dict]:\n try:\n return api.get_available_room_api(meeting_length)\n except Exception as err:\n logger.error(str(err))", "def get_room(self, room_name):\r\n try:\r\n return self._rooms[room_name]\r\n except KeyErr...
[ "0.6984332", "0.69794464", "0.67528933", "0.6715093", "0.67126834", "0.6698961", "0.66711736", "0.65913105", "0.65708464", "0.653867", "0.6510884", "0.6465517", "0.64232916", "0.63283277", "0.62482256", "0.62274766", "0.6225368", "0.6223397", "0.61770236", "0.6148605", "0.608...
0.79889804
0
Get meeting associated to room.
def get_available_room(meeting_length: int) -> Optional[dict]: try: return api.get_available_room_api(meeting_length) except Exception as err: logger.error(str(err))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_room_meeting(room_id: str) -> Optional[dict]:\n try:\n response = api.get_current_meeting_api(room_id)\n return response.json()\n except Exception as err:\n logger.error(str(err))", "def get_room(self, room_name):\r\n try:\r\n return self._rooms[room_name]\r\n...
[ "0.7989579", "0.6980983", "0.67531663", "0.6716604", "0.6714134", "0.6698416", "0.6672643", "0.6593494", "0.657104", "0.65401155", "0.651163", "0.6467212", "0.6424745", "0.6329888", "0.62470394", "0.6228443", "0.6226526", "0.62244844", "0.61769843", "0.6148223", "0.6081408", ...
0.6984546
1
Get T10 associated to room.
def get_room_t10(room_id: str) -> Optional[dict]: response = api.get_room_device_info_api(room_id) return response.json()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_thermostat(self, room_id: str) -> Dict:\n for key, value in self.thermostats.items():\n if value[\"id\"] == room_id:\n return self.thermostats[key]\n\n raise InvalidRoom(\"No room with ID %s\" % room_id)", "def get_room_by_id(self, id):\n if not isinstance(i...
[ "0.5800181", "0.55277616", "0.5490227", "0.5306537", "0.52587366", "0.5116882", "0.50899786", "0.50812876", "0.50075823", "0.49847156", "0.49410293", "0.49252138", "0.4911232", "0.49048966", "0.4873999", "0.48427808", "0.48284218", "0.4821396", "0.48073527", "0.478201", "0.47...
0.77276736
0
Take picture from camera.
def take_picture_from_camera(network_id: str, camera_serial: str) -> dict: data = api.get_camera_snapshot(network_id, camera_serial) if data.status_code != 202: # Mock data return { "url": "https://spn4.meraki.com/stream/jpeg/snapshot/b2d123asdf423qd22d2", "expiry": "Acce...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def take_pic(self):\n \n try:\n if os.path.isfile(self.pics_path):\n os.remove(self.pics_path)\n self.camera.capture(self.pics_path, use_video_port=True)\n except:\n print(\"Error when recording image\")\n exit()\n \n try...
[ "0.7783912", "0.76053214", "0.76053214", "0.74867165", "0.71311605", "0.7102686", "0.6857418", "0.6752425", "0.66982776", "0.66883737", "0.66648525", "0.66109025", "0.65764976", "0.6535452", "0.6509001", "0.65053505", "0.6501816", "0.6438816", "0.6435609", "0.64022434", "0.63...
0.6403747
19
Identify user using picture.
def identify_user(picture: str) -> Optional[dict]: data = api.identify_person_api(picture) return data.json()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fetch_photo_id_image(self):\r\n if settings.FEATURES.get('AUTOMATIC_VERIFY_STUDENT_IDENTITY_FOR_TESTING'):\r\n return\r\n\r\n self.photo_id_key = self.original_verification(self.user).photo_id_key\r\n self.save()", "def ldap_get_picture(self, user):\n result = super(Aut...
[ "0.6500659", "0.61352795", "0.60135627", "0.59738946", "0.59686816", "0.59163946", "0.5890044", "0.58772194", "0.5856343", "0.58339924", "0.58264804", "0.578972", "0.5787088", "0.5768975", "0.57652503", "0.5759215", "0.57336044", "0.57251793", "0.56909114", "0.5689006", "0.56...
0.74471325
0
Send raw message to T10.
async def async_send_raw_message_to_t10(ip: str, username: str, password: str, message: str) -> dict: async with xows.XoWSClient(ip, username, password) as client: encoded_message = f"711:{message}" logger.info(f"Sending message {encoded_message} to T10 {ip} ...") return await client.xComman...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send_raw_message_to_t10(ip: str, username: str, password: str, message: str) -> dict:\n return loop.run_until_complete(async_send_raw_message_to_t10(ip, username, password, message))", "async def send_raw(self, raw_message : str):\n await self._connection.send_raw(raw_message)", "def on_t10_messa...
[ "0.74833804", "0.6996694", "0.68469405", "0.67557174", "0.6609407", "0.6496932", "0.6457618", "0.6448156", "0.6433971", "0.63890254", "0.6379464", "0.6365795", "0.63269436", "0.6312104", "0.627904", "0.6275915", "0.62649065", "0.62612236", "0.62591565", "0.62560403", "0.62076...
0.7725625
0
Send raw message to T10.
def send_raw_message_to_t10(ip: str, username: str, password: str, message: str) -> dict: return loop.run_until_complete(async_send_raw_message_to_t10(ip, username, password, message))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def async_send_raw_message_to_t10(ip: str, username: str, password: str, message: str) -> dict:\n async with xows.XoWSClient(ip, username, password) as client:\n encoded_message = f\"711:{message}\"\n logger.info(f\"Sending message {encoded_message} to T10 {ip} ...\")\n return await c...
[ "0.7725625", "0.6996694", "0.68469405", "0.67557174", "0.6609407", "0.6496932", "0.6457618", "0.6448156", "0.6433971", "0.63890254", "0.6379464", "0.6365795", "0.63269436", "0.6312104", "0.627904", "0.6275915", "0.62649065", "0.62612236", "0.62591565", "0.62560403", "0.620767...
0.74833804
1
Get person and meeting from camera serial.
def get_person_meeting_from_camera(camera_serial: str) -> Optional[dict]: # Get the network network_data = get_camera_network(camera_serial) # Get the camera capture capture_data = take_picture_from_camera(network_data["id"], camera_serial) # Identify person person_data = identify_user(capture_d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_camera_room(camera_serial: str) -> Optional[dict]:\n response = api.get_camera_room_api(camera_serial)\n return response.json()", "def process_camera():\n\n pic_array = take_picture()\n detections, shapes, descriptors = detect_faces(person_database,pic_array)\n\n names = []\n\n for desc...
[ "0.60853714", "0.5921881", "0.5721924", "0.5563192", "0.535188", "0.52540827", "0.51830184", "0.5151382", "0.5135098", "0.5082099", "0.5072988", "0.5030921", "0.5015844", "0.49833044", "0.49457884", "0.49433827", "0.4942929", "0.4939665", "0.4928585", "0.49259174", "0.492482"...
0.7313161
0
Send JSON message to T10.
def send_json_message_to_t10(ip: str, username: str, password: str, message: dict) -> dict: json_data = json.dumps(message) return loop.run_until_complete(async_send_raw_message_to_t10(ip, username, password, json_data))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_t10_message():\n send_json_message_to_t10(\"10.89.130.68\", \"cisco\", \"cisco\", request.get_json())\n return \"ok\"", "def _send_json(self, data):\n return self.sendMessage(json.dumps(data).encode(\"utf-8\"))", "def on_t10_message():\n handle_t10_message(request.get_json())\n retu...
[ "0.7853554", "0.74417216", "0.7421759", "0.70720935", "0.6974595", "0.6911024", "0.66566676", "0.6652311", "0.6516209", "0.64711666", "0.64438486", "0.64244586", "0.64066106", "0.63929725", "0.6370944", "0.6368785", "0.63646865", "0.63458747", "0.62323713", "0.6206355", "0.61...
0.79545933
0
Send JSON message to bot.
def send_json_message_to_bot(message: dict): requests.post(config.BOT_URL, json=message)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _send_json(self, data):\n return self.sendMessage(json.dumps(data).encode(\"utf-8\"))", "async def _sendjson(self, deviceid, message):\n\n try:\n params = json.loads(message.replace(\"'\",'\"'))\n payload = {}\n payload['action'] = 'update'\n payload[...
[ "0.8157835", "0.74844956", "0.7446224", "0.74032104", "0.7104426", "0.70463616", "0.7027255", "0.6956269", "0.69444907", "0.693412", "0.6928009", "0.6874159", "0.6848447", "0.6821482", "0.67961335", "0.67788446", "0.67593426", "0.6758233", "0.6726049", "0.67169255", "0.671338...
0.81353354
1
Handle Meraki MQTT data.
def handle_meraki_zone(camera_serial: str, zone_id: str, camera_data: dict): global CAMERA_STATE zone_name = get_zone_name(camera_serial, zone_id) state_key = f"{camera_serial}-{zone_id}" previous_persons_count = CAMERA_STATE.get(state_key, 0) current_persons_count = camera_data["counts"]["person"]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def on_message(client, userdata, msg):\n# print(\"message received \", str(msg.payload.decode(\"utf-8\")))\n# print(\"message topic=\", msg.topic)\n# print(\"message qos=\", msg.qos)\n# print(\"message retain flag=\", msg.retain)\n# return\n\n device_id, data_type = re.findall(MQTT_REGEX, msg.topic)[0...
[ "0.6881575", "0.6739699", "0.65735906", "0.6510144", "0.6490691", "0.63461906", "0.62681484", "0.6229065", "0.6154522", "0.613079", "0.6059457", "0.6058687", "0.599385", "0.59793496", "0.59770983", "0.5941441", "0.59233356", "0.5919994", "0.5896454", "0.587981", "0.587553", ...
0.0
-1
Start the room enter scenario.
def start_entered_scenario(camera_serial: str): global ENTER_EVENT_TRIGGERED, RECORDING_EVENT_TRIGGERED if ENTER_EVENT_ENABLED: if not ENTER_EVENT_TRIGGERED: # Set the trigger ENTER_EVENT_TRIGGERED = True related_meeting_data = get_person_meeting_from_camera(camera_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def enter(self, env):\n env = self._find_env(env, new=True)\n env.add_agents(self)", "def on_pre_enter(self):\n self.setup()\n self.start()", "def enter():\n pass", "def enter_exam_room(self, entry_time):\n self.state = DoctorState.IN_PATIENT_EXAM_ROOM\n s...
[ "0.6225163", "0.61829996", "0.60941166", "0.6021055", "0.600246", "0.5958339", "0.5880122", "0.5865989", "0.58430576", "0.58415574", "0.5835738", "0.58195513", "0.5729451", "0.5726484", "0.5711812", "0.5705859", "0.5703056", "0.5703056", "0.5697736", "0.56970465", "0.56851804...
0.6843294
0
Start the "too far" scenario.
def start_too_far_scenario(camera_serial: str): global WARN_EVENT_TRIGGERING, LAST_WARN_EVENT, WARN_COUNT # Check if we are not triggering if WARN_EVENT_TRIGGERING or not WARN_EVENT_ENABLED or not MEETING_STARTED: return # Check for elapsed time now = time.time() if now - LAST_WARN_EVE...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_too_far_scenario():\n start_too_far_scenario(config.MERAKI_CAMERAS[0][\"serial\"])\n time.sleep(WARN_EVENT_THRESHOLD)\n start_too_far_scenario(config.MERAKI_CAMERAS[0][\"serial\"])\n return \"ok\"", "def run_out_of_time(self):\n self.out_of_time = True", "def test_long_run_case_that...
[ "0.6878596", "0.63260525", "0.610769", "0.59808785", "0.597398", "0.595715", "0.58202845", "0.5783691", "0.5766969", "0.5764712", "0.57196426", "0.5715585", "0.568707", "0.5686048", "0.56856704", "0.5677685", "0.56736046", "0.5656405", "0.5649913", "0.5647992", "0.5625597", ...
0.5790409
7
Handle a MQTT incoming message.
def handle_mqtt_message(client, userdata, message): match = MQTT_ZONE_RGX.search(message.topic) if match: handle_meraki_zone(match.group("serial"), match.group("zone_id"), json.loads(message.payload.decode()))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _on_mqtt_message(\n self, client: mqtt.Client, userdata: str, message: mqtt.MQTTMessage\n ) -> None:\n self.log.debug(f\"Received message on topic: {message.topic}\")\n self.inbound_message_listener(Message(message.topic, message.payload))", "def handle_message(self, msg: mqtt.MQTTMes...
[ "0.76984787", "0.7680705", "0.765645", "0.76321375", "0.7451365", "0.72919893", "0.7248946", "0.714014", "0.7050481", "0.70168453", "0.69534844", "0.69374263", "0.6931705", "0.6880923", "0.6877551", "0.68576574", "0.68561035", "0.68345135", "0.68149096", "0.68129003", "0.6805...
0.71762437
7
Wait for T10 incoming message.
def on_t10_message(): handle_t10_message(request.get_json()) return "ok"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wait_till_read_out():\n\n\trespond = send_command('waitreadout')", "def wait_to_be_ready(self):\n count = 0\n while count < 6:\n try:\n line = self.stdout_reader.get(timeout=10)\n if \"waiting for input\" in line:\n self.cec_logger.inf...
[ "0.68457866", "0.65651", "0.65451634", "0.6505948", "0.6501762", "0.6497771", "0.6458485", "0.6448247", "0.64469844", "0.63880014", "0.6327356", "0.6255535", "0.6248234", "0.62316674", "0.61960614", "0.6172363", "0.6126402", "0.6125229", "0.6119485", "0.61002827", "0.6088884"...
0.6253874
12
Wait for bot incoming message.
def on_bot_message(): handle_bot_message(request.get_json()) return "ok"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _execute(self):\n LOG.info(\"Waiting for a message...\")", "def wait_for_messages(self):\n msg = self.inbox.get()\n return msg", "def wait_for_any_message(self, timeout=None):\n self._wait_in_process_loop(lambda: (True,None),timeout=timeout)", "def wait(self):\n self.st...
[ "0.7529862", "0.71479195", "0.69648486", "0.69636875", "0.6898867", "0.6898654", "0.6863458", "0.673636", "0.6694095", "0.6662619", "0.6604697", "0.6602691", "0.65227485", "0.644946", "0.6446817", "0.637303", "0.6355877", "0.63054746", "0.6282684", "0.62658966", "0.6253841", ...
0.5912612
62
Test message send to the T10 using a hardcoded device.
def test_t10_message(): send_json_message_to_t10("10.89.130.68", "cisco", "cisco", request.get_json()) return "ok"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_communication(self):\n\n self._serial_handler.tx_queue.put((0,b'testing\\n'))\n self._serial_handler._write()\n\n time.sleep(0.1) # Simulate real physical connection\n\n self._serial_handler._read() # Should get whatever was sent and put it on the rx_queue\n message = se...
[ "0.6542711", "0.6530367", "0.64198023", "0.64102006", "0.64058506", "0.63469845", "0.6282157", "0.6230593", "0.62144583", "0.61659074", "0.61659074", "0.61320263", "0.61084795", "0.61050886", "0.61050886", "0.60905254", "0.60530496", "0.60508513", "0.60467476", "0.60309225", ...
0.76748866
0
Test the room enter scenario.
def test_2nd_scenario(): start_entered_scenario(config.MERAKI_CAMERAS[0]["serial"]) return "ok"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_spawn(self):\n self.grid.spawn()\n self.assertEqual(xyzroom.XYZRoom.objects.all().count(), 18)\n self.assertEqual(xyzroom.XYZExit.objects.all().count(), 38)", "def test_spawn(self):\n self.grid.spawn()\n self.assertEqual(xyzroom.XYZRoom.objects.all().count(), 6)\n ...
[ "0.66628855", "0.66586757", "0.66586757", "0.6657487", "0.6653138", "0.66481704", "0.6643714", "0.6638045", "0.66297", "0.6622458", "0.66107076", "0.6598475", "0.64967424", "0.64609516", "0.6262796", "0.625852", "0.62515646", "0.61492115", "0.61164457", "0.608853", "0.5972575...
0.573402
30
Test the "too far" scenario.
def test_too_far_scenario(): start_too_far_scenario(config.MERAKI_CAMERAS[0]["serial"]) time.sleep(WARN_EVENT_THRESHOLD) start_too_far_scenario(config.MERAKI_CAMERAS[0]["serial"]) return "ok"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_case_01(self):\n if True:\n self.fail()", "def test_long_run_case_that_we_want_to_skip():\n time.sleep(30)\n assert 0", "def test_does_not_die(self):\n self.herb.fitness = 1\n nt.assert_false(self.herb.death())", "def test_return_goal_actual_weight_is_too_low(se...
[ "0.64584464", "0.6423838", "0.6304726", "0.62863934", "0.62421024", "0.6196889", "0.6177566", "0.61613077", "0.61424774", "0.6135788", "0.61356604", "0.6124425", "0.60465646", "0.6043048", "0.6029514", "0.59757197", "0.5973856", "0.5969114", "0.5948488", "0.5946179", "0.59390...
0.67676914
0
Test the bot message.
def test_bot_message(): send_json_message_to_bot(request.get_json()) return "ok"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_message_user():", "def test_im_chat_messages(self):\n pass", "def test_say(self):\n self.client.say(\"thechannel\", \"the message\")\n self.assertEqual(self.client.lines, [\"PRIVMSG #thechannel :the message\"])", "async def testsay(self, ctx, *, message):\n await ctx.send...
[ "0.7722121", "0.7584594", "0.75813186", "0.7509312", "0.74990076", "0.74154633", "0.73647", "0.72707736", "0.7200678", "0.7151783", "0.69574857", "0.6943827", "0.69241965", "0.6833125", "0.6822243", "0.6812864", "0.6770344", "0.6743081", "0.6742397", "0.6736317", "0.6707357",...
0.7850913
0
Returns all the actions that can be executed in the given state. The result should be a tuple (or other iterable) of actions as defined in the problem description file
def actions(self, state, enemy=False): vaccinate_actions = [] quarantine_actions = [] medics = 1 police = 2 if not enemy: for (i, j) in self.zoc: if state[(i, j)] == 'H': vaccinate_actions.append(('vaccinate', (i, j))) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getActions(self, state): \n util.raiseNotDefined()", "def get_actions(self, state: TState = None) -> Sequence[TAction]:\n pass", "def getLegalActions(self, state):\n return self.actionFn(state)", "def getLegalActions(self,state):\n return self.actionFn(state)", "def g...
[ "0.8188572", "0.8033066", "0.7890087", "0.78778666", "0.7853917", "0.7732462", "0.77274704", "0.76327163", "0.75801885", "0.7570939", "0.741341", "0.73030925", "0.72798634", "0.7211216", "0.7196898", "0.71914726", "0.7133285", "0.7125219", "0.7111434", "0.6985118", "0.6944727...
0.6836455
26
Return the sequence of actions to go from the root to this node.
def solution(self): return [node.action for node in self.path()[1:]]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def actions(self) -> Sequence[_A_out]:\n return self._actions", "def actions(self):\n\n return self._actions.getSlice(0)", "def actions(self):\n\n return self._actions.getSlice(0)", "def action_sequence(node):\n actions = []\n while node.previous:\n actions.append(node.actio...
[ "0.6629948", "0.6325199", "0.6325199", "0.62671596", "0.62313884", "0.6216793", "0.61685085", "0.6058641", "0.5983585", "0.595934", "0.5886717", "0.5878224", "0.58615386", "0.58615386", "0.58614296", "0.5861019", "0.58123547", "0.57966566", "0.57905746", "0.5788914", "0.57816...
0.63445014
4
Return a list of nodes forming the path from the root to this node.
def path(self): node, path_back = self, [] while node: path_back.append(node) node = node.parent return list(reversed(path_back))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def path(self):\n node, return_path = self, []\n while node:\n # Add the nodes in reverse order to a list until you reach the\n # root parent node which will terminate the loop\n return_path.append(node)\n node = node.parent\n # Reverse the list to g...
[ "0.7984329", "0.77074516", "0.7606885", "0.7442534", "0.7393407", "0.73567694", "0.73452824", "0.7337256", "0.7315247", "0.7297849", "0.7290767", "0.7246857", "0.72439355", "0.7197385", "0.7157757", "0.715197", "0.71127594", "0.710878", "0.7068614", "0.7051616", "0.70308995",...
0.7581861
4
Function that verifies if the person on the "image_path" image is "identity".
def verify_fn(img_dir, identity, database, model): encoding = encoding_images(img_dir, model) # Compute distance with identity's image # Note: there are 14 images in eache folders' name, so we should check the equal elemnts of encoding[i] and database[identity][i] dist = np.linalg.norm(encoding[0] - dat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verify(image_path):\n try:\n with Image.open(image_path) as img:\n img.verify()\n return True\n except Exception as e:\n log.warn('Path [{}] does not point to an image: [{}]'.format(image_path, e))\n return False", "def verify(image_path, identity, database, model...
[ "0.697294", "0.66908836", "0.66760993", "0.6587677", "0.65631783", "0.6516093", "0.6483401", "0.6385544", "0.6352689", "0.632886", "0.6309379", "0.6238488", "0.6147586", "0.61467844", "0.6142217", "0.60467815", "0.6031152", "0.60213774", "0.6019103", "0.6015859", "0.5983722",...
0.6522594
5
Returns counts for left,right,forward moves and size
def get(self): return self.__left, self.__right, self.__forward, self.__size
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def size(self):\n count = 0\n if self.val is None:\n return count\n else:\n count += 1\n count += self.left.size()\n count += self.right.size()\n return count", "def number_of_moves(self):\n return self._move_seq.length()", "def get_number_...
[ "0.6512511", "0.64933044", "0.6351074", "0.63320976", "0.6329205", "0.6303003", "0.6275242", "0.62682337", "0.62263876", "0.6216158", "0.62125695", "0.6186903", "0.61613995", "0.6095273", "0.60770535", "0.6046683", "0.6034366", "0.6031781", "0.6004344", "0.5996957", "0.597674...
0.0
-1
Return the last five published questions.
def get_queryset(self): return Question.objects.order_by('-pub_date')[:5]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def latest_question(questions):\n return questions.order_by('-pub_date')[:5]", "def get_queryset(self):\n\t\t# version 1: \"\"\"Return the last five published questions.\"\"\"\n\t\t# version 1: # return Question.objects.order_by('-pub_date')[:5]\n\t\treturn Question.objects.filter(pub_date__lte=timezone.now()...
[ "0.85428125", "0.7622891", "0.7476767", "0.7161068", "0.7129464", "0.70827323", "0.70247626", "0.7021093", "0.6993344", "0.6993344", "0.6969822", "0.6969822", "0.6909509", "0.6909509", "0.6909509", "0.6909509", "0.6895247", "0.68330246", "0.6668803", "0.64332634", "0.64104736...
0.69906723
15
Breaks down locator details to pattern and sensitivity
def _parse_locator(self, locator): if not ".png" in locator: pattern = locator sensitivity = None elif ".png" in locator: if not locator.endswith('.png'): locator_parts = locator.partition('=') if len(locator_parts[1]) > 0: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _find_pattern(self, locator):\n assert locator is not None and len(locator) > 0\n locator = locator.strip().lower()\n (pattern, sensitivity) = self._parse_locator(locator)\n\n if (sensitivity != None):\n sensitivity = float(sensitivity)\n pattern = Pattern(patt...
[ "0.57167387", "0.5086936", "0.50742686", "0.5012485", "0.49584556", "0.4907223", "0.48538217", "0.4822575", "0.48194072", "0.4798109", "0.47691458", "0.47607014", "0.4728942", "0.47222027", "0.47165644", "0.47142112", "0.47115433", "0.47051197", "0.46986005", "0.4696172", "0....
0.640897
0
Sets pattern details if string or pattern is provided based on the parsed locator value
def _find_pattern(self, locator): assert locator is not None and len(locator) > 0 locator = locator.strip().lower() (pattern, sensitivity) = self._parse_locator(locator) if (sensitivity != None): sensitivity = float(sensitivity) pattern = Pattern(pattern).similar...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setPattern(self, value):\n return self._set(pattern=value)", "def pattern(self, pattern):\n if pattern is None:\n raise ValueError(\"Invalid value for `pattern`, must not be `None`\") # noqa: E501\n\n self._pattern = pattern", "def __init__(self, pattern):\r\n self.p...
[ "0.68757087", "0.6574573", "0.6492863", "0.6345548", "0.6329081", "0.6091897", "0.6084366", "0.6011219", "0.59598064", "0.592104", "0.587826", "0.5774489", "0.576099", "0.57324046", "0.57065237", "0.5695025", "0.5695025", "0.5685013", "0.5674648", "0.5659409", "0.5621601", ...
0.6349062
3
Breaks down scroll details to scroll direction and scroll steps
def _parse_scroll_details(self, scroll): assert scroll is not None and len(scroll) > 0 scroll = scroll.lower() scroll_parts = scroll.partition('=') if len(scroll_parts[1]) > 0: scroll_direction = scroll_parts[0].strip() scroll_steps = int(scroll_parts[2].strip()) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __navigate_scroll(self):\n try:\n _title = self.browser.title\n _body = self.browser.find_element_by_tag_name('body')\n\n i = 0\n while i < 3:\n _html = str(self.browser.page_source)\n _content = Content(_html, _title)\n ...
[ "0.6233716", "0.60394293", "0.5952445", "0.5914971", "0.58679223", "0.58648163", "0.5825444", "0.57344365", "0.57089955", "0.5693185", "0.5679035", "0.5644303", "0.5634115", "0.5632863", "0.56320226", "0.5610666", "0.5574927", "0.55665654", "0.5554274", "0.5525112", "0.551339...
0.6904732
0
Move along a sine wave around the structure P times with amplitude A Note that when used with shape this will never terminate unless your start row is near the top (which is not ideal)
def move_along_horizontal_sine_wave(shape, period=2, amplitude=5, **kwargs): shape.curr_col += 1 shape.curr_row = int(math.sin(shape.curr_col*2*np.pi/(STATE.layout.columns/period))*amplitude+.5)+shape.start_row
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sinefunc(t, P, amp=1.0, phase=0.0, offset=0.0):\n return np.abs(amp) * np.sin(2*np.pi*t/P + 2*np.pi*phase/P ) + offset", "def sinwave(scene):\n # create an empty homogeneous transformation\n matrix = np.eye(4)\n # set Y as cos of time\n matrix[1][3] = np.cos(time.time()) * 2\n # set Z as si...
[ "0.6085118", "0.579322", "0.5745879", "0.5612391", "0.5355833", "0.53422123", "0.5332657", "0.5329603", "0.5326877", "0.53013176", "0.5282532", "0.5275713", "0.5259223", "0.52569646", "0.52524805", "0.52356255", "0.520783", "0.51946", "0.51909566", "0.5180724", "0.5166949", ...
0.7129515
0
Create an upward triangle with a central point. The "center" of of the indicies is the bottommiddle of the triangle
def _upward_triangle_indicies(height=3): return [(height-r,c) for r in range(height) for c in range(-abs(r),abs(r)+1)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _generate_equilateral_triangle_around_point(\n center_point: Coordinate, altitude: Decimal = TRIANGLE_ALTITUDE\n) -> Tuple[Coordinate, Coordinate, Coordinate]:\n # This is how you math I guess?\n side_length = 2 * altitude / Decimal(sqrt(3))\n\n ay = center_point.y + altitude / 2\n ax = center_p...
[ "0.62415767", "0.60697186", "0.5983894", "0.59038526", "0.58789426", "0.5878132", "0.5837039", "0.5795896", "0.5787857", "0.57716006", "0.573296", "0.5716611", "0.56996155", "0.56944036", "0.56332344", "0.56199664", "0.55856735", "0.55378634", "0.5525233", "0.55224067", "0.55...
0.67380613
0
Create a hexidiamond (or diamond is height/width are equal. This shape was a happy accident so don't expect much
def _hex_diamond_thing_indicies(half_height=3, half_width=3): return _populate_quadrants([(r,c) for r in range(half_height) for c in range(half_width) if r+c < (half_width+half_height)/2])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_diamond(display, coord, box_size, color, bg_color):\n half = int(box_size * 0.5)\n left, top = coord\n vertices = [\n (left + half, top),\n (left + box_size - 1, top + half),\n (left + half, top + box_size - 1),\n (left, top + half),\n ]\n pygame.draw.polygon(dis...
[ "0.7066721", "0.6805806", "0.67862946", "0.66706693", "0.64788544", "0.64521927", "0.6407428", "0.624812", "0.6217451", "0.62144434", "0.5936698", "0.5846795", "0.5817965", "0.5814759", "0.5698248", "0.5693905", "0.5652124", "0.5579387", "0.5560653", "0.55368376", "0.55243635...
0.7205246
0
Get a pb instance from the config.
def get_pb(cls): if cls.pb_singleton is None: # Init the config by reading conf file. with open(gflags.FLAGS.conf, 'r') as conf_file: cls.pb_singleton = text_format.Merge(conf_file.read(), config_pb2.Config()) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_instance(cls):\n\n if not cls._instance:\n cls._instance = Config()\n\n return cls._instance", "def get_config(cls) -> \"__Config\":\n if cls.__instance is None:\n cls.__instance = cls.__Config()\n return cls.__instance", "def get_config() -> Optional[C...
[ "0.61414784", "0.6062606", "0.57294023", "0.57033986", "0.57033986", "0.5687849", "0.5682233", "0.55206746", "0.55115753", "0.5506902", "0.5470777", "0.5435427", "0.5435427", "0.54308707", "0.5418612", "0.54126674", "0.5409956", "0.53776026", "0.53776026", "0.5318656", "0.529...
0.7611659
0
Get Hardware config by name.
def get_hardware(cls, hardware_name): if cls.hardware_dict is None: # Init the hardware_dict once. cls.hardware_dict = {hw.name: hw for hw in cls.get_pb().hardware} return cls.hardware_dict.get(hardware_name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_config(self, name):\n return self.configs[name][0]", "def get_hardware(hardware_name: str) -> str:\n fixed_name = \"-\".join(hardware_name.lower().split())\n output = _get_content(fixed_name, \"hardware\")\n\n return output", "def get_config_by_name(name):\r\n attrs = get_config_attr...
[ "0.7273563", "0.6949016", "0.6795559", "0.6699866", "0.6644472", "0.6507191", "0.6492922", "0.6463077", "0.6353336", "0.63133997", "0.63029104", "0.6268669", "0.61993456", "0.6184893", "0.6178793", "0.61781013", "0.6147628", "0.61401814", "0.6126569", "0.61248326", "0.5959862...
0.7445519
0
Get module config by name.
def get_module(cls, module_name): if cls.module_dict is None: # Init the module_dict once. cls.module_dict = {mod.name: mod for mod in cls.get_pb().modules} return cls.module_dict.get(module_name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_module_config(name):\n return _CONFIGS[name]", "def get_config(self, name):\n return self.configs[name][0]", "def get_config(name: str):\n conf_file = Path(__file__).parent.joinpath(\"configs\").joinpath(name)\n return console.read_config(conf_file)", "def config(name):\n retur...
[ "0.9189081", "0.7960085", "0.78567547", "0.7355771", "0.72880703", "0.72620124", "0.71204567", "0.70832765", "0.70003736", "0.69656384", "0.6910256", "0.68820286", "0.6808927", "0.67961526", "0.6795107", "0.6730792", "0.67243284", "0.66559315", "0.6642194", "0.66311175", "0.6...
0.626015
40
Get module config by name.
def get_tool(cls, tool_name): if cls.tool_dict is None: # Init the module_dict once. cls.tool_dict = {tool.name: tool for tool in cls.get_pb().tools} return cls.tool_dict.get(tool_name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_module_config(name):\n return _CONFIGS[name]", "def get_config(self, name):\n return self.configs[name][0]", "def get_config(name: str):\n conf_file = Path(__file__).parent.joinpath(\"configs\").joinpath(name)\n return console.read_config(conf_file)", "def config(name):\n retur...
[ "0.9189081", "0.7960085", "0.78567547", "0.7355771", "0.72880703", "0.72620124", "0.71204567", "0.70832765", "0.70003736", "0.69656384", "0.6910256", "0.68820286", "0.6808927", "0.67961526", "0.6795107", "0.6730792", "0.67243284", "0.66559315", "0.6642194", "0.66311175", "0.6...
0.0
-1
Get realpath from a path string in config. Starting with '/' indicates an absolute path, otherwise it will be taken as a relative path of the Apollo root.
def get_realpath(cls, path_str): if path_str.startswith('/'): return path_str return os.path.abspath(os.path.join(cls.apollo_root, path_str))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def realpath(path: str) -> str:\n pass", "def realpath(path):\n\n if path.startswith('//'):\n path = bpy.path.abspath(path)\n else:\n path = os.path.realpath(path)\n\n path = path.replace('\\\\', '/')\n path = os.path.realpath(path)\n\n return path", "def realpath(self, path):\n ...
[ "0.77301323", "0.75936407", "0.74692786", "0.72557855", "0.72251844", "0.70825744", "0.70761037", "0.70343393", "0.6972751", "0.68626493", "0.6804119", "0.6591446", "0.65749484", "0.6556271", "0.65054965", "0.64656866", "0.6438085", "0.63194704", "0.63104266", "0.6278452", "0...
0.8214451
0
Initialise a new Process.
def __init__(self, name, priority, exec_time, io=False, io_duration=0): self._name = name self._priority = priority self._exec_time = exec_time self._io = io self._io_time = io_duration
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new_process() -> Process:\n return multiprocessing.Process()", "def _spawn_immediate_process(self, process_id, name, module, cls, config, proc_attr):\n process_instance = self._create_process_instance(process_id, name, module, cls, config, proc_attr)\n self._process_init(process_instance)\n ...
[ "0.67804676", "0.6566872", "0.65590376", "0.64811456", "0.64623904", "0.6456713", "0.63770026", "0.63723177", "0.63717395", "0.6274823", "0.62323487", "0.623115", "0.62086385", "0.62041444", "0.6198188", "0.61816216", "0.613943", "0.6014664", "0.600128", "0.5989207", "0.59795...
0.0
-1
Return the name of the process.
def get_name(self): return self._name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_process_name(self):\n\n return self._args.t", "def get_process_name(pid):\n proc = subprocess.Popen(['ps', '-p', pid, '-o', 'comm='],\n stdout=subprocess.PIPE,\n stderr=subprocess.PIPE)\n out, err=proc.communicate()\n return out.strip(...
[ "0.85471857", "0.79289544", "0.787106", "0.7468466", "0.74120295", "0.7236602", "0.7233819", "0.7141989", "0.70894533", "0.6992078", "0.6813217", "0.6813217", "0.6813217", "0.6813217", "0.6813217", "0.6813217", "0.6813217", "0.6813217", "0.6813217", "0.6813217", "0.6813217", ...
0.0
-1
Return the current priority of the process.
def get_priority(self): return self._priority
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def priority(self):\n return self._pri", "def priority(self) -> int:\n return pulumi.get(self, \"priority\")", "def priority(self) -> pulumi.Output[Optional[int]]:\n return pulumi.get(self, \"priority\")", "def priority(self) -> pulumi.Output[Optional[int]]:\n return pulumi.get(se...
[ "0.80515665", "0.8050234", "0.7970069", "0.7970069", "0.7935408", "0.7924292", "0.7879087", "0.7751246", "0.7744972", "0.7744972", "0.7744972", "0.76415604", "0.76415604", "0.76415604", "0.76415604", "0.7559743", "0.7559743", "0.7559743", "0.7559743", "0.74217296", "0.7259617...
0.7939557
5
Update the priority to the specified value.
def set_priority(self, priority): self._priority = priority
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SetPriorityValue(self, *args, **kwargs):\n pass", "def setPriority(self, p):\n self.priority = p", "def increase_priority(self):\n if self._priority > 0:\n self._priority -= 1", "def setFrequencyPriority(self, value):\n return self._set(frequencyPriority=value)", "def...
[ "0.79277146", "0.75418645", "0.7258549", "0.7079437", "0.6995622", "0.6947802", "0.6926209", "0.68721324", "0.68432814", "0.6788194", "0.6772871", "0.6734765", "0.6734765", "0.6734765", "0.67146564", "0.6653364", "0.66505986", "0.66430587", "0.66318494", "0.65462726", "0.6501...
0.6833167
9
Increase the priority of the process by 1.
def increase_priority(self): if self._priority > 0: self._priority -= 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setpriority(self, pid=None, priority=5):\n\t \n\t import win32api,win32process,win32con\n\t \n\t priorityclasses = [win32process.IDLE_PRIORITY_CLASS,\n\t win32process.BELOW_NORMAL_PRIORITY_CLASS,\n\t win32process.NORMAL_PRIORITY_CLASS,\n\t ...
[ "0.75190824", "0.738303", "0.73639184", "0.72307944", "0.69335985", "0.68952274", "0.689241", "0.66746044", "0.65766627", "0.6558075", "0.6521801", "0.6405231", "0.6405231", "0.6405231", "0.6393191", "0.635353", "0.6293825", "0.62364954", "0.6200966", "0.61457556", "0.6068769...
0.809105
0
Decrease the priority of the process by 1.
def decrease_priority(self): self._priority += 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def increase_priority(self):\n if self._priority > 0:\n self._priority -= 1", "def delete_and_update_priority(self):\r\n for pbi in PBI.objects.filter(priority__gt=self.priority, project=self.project):\r\n pbi.priority -= 1\r\n pbi.save()\r\n\r\n self.delete(...
[ "0.71922547", "0.66789985", "0.6409615", "0.6306493", "0.6098044", "0.6078284", "0.59733015", "0.5926074", "0.5925828", "0.5851369", "0.5711457", "0.5708569", "0.5705617", "0.569331", "0.5640073", "0.56041205", "0.56020963", "0.5599344", "0.5587728", "0.5577843", "0.5575249",...
0.85394126
0
Return True if the process has IO operations, otherwise False.
def has_io(self): return self._io
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_output(self):\n status = self.is_running()\n self.write_queued_output()\n return status", "def check_command(self):\n return self.process is not None and self.process.poll() is None", "def UseOnlyOverlappedIO(self) -> bool:", "def _proc_is_alive(self):\n if self._pr...
[ "0.6728006", "0.6674621", "0.65899", "0.6285053", "0.62166375", "0.61981267", "0.61932373", "0.6167294", "0.61512375", "0.6086169", "0.6078449", "0.6056482", "0.6051593", "0.6046538", "0.60356563", "0.60111934", "0.59875995", "0.59768844", "0.59502465", "0.59484607", "0.59436...
0.73616487
0
Return the remaining time for IO operations.
def get_io_time(self): return self._io_time
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remaining(self):\n return self._timeout - (time.time() - self._start_time)", "def remaining(self):\n if not self.enabled:\n return None\n duration = self.timeout - self.elapsed\n if self.timed_out: # check timed_out after duration for real-time correctness\n ...
[ "0.7094265", "0.6950382", "0.6921343", "0.6873956", "0.6847732", "0.6833577", "0.6781705", "0.6775822", "0.6754208", "0.6717606", "0.66023207", "0.6601158", "0.6553987", "0.6542095", "0.6531", "0.64804786", "0.64761144", "0.64360166", "0.6435803", "0.64347595", "0.6434545", ...
0.65492517
13
Execute the process and update the execution time.
def execute(self, time): self._exec_time -= time
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def execute(cls, **inputs):\n instance = cls(**inputs)\n if hasattr(instance, \"process\"):\n time_start = time.time()\n result = instance.process()\n instance.runtime = time.time() - time_start\n return result\n if hasattr(instance, \"post_process\"...
[ "0.66147035", "0.64833766", "0.63807505", "0.62302387", "0.6222028", "0.62132627", "0.62011343", "0.6161882", "0.6153423", "0.6152858", "0.61500686", "0.61018723", "0.60865843", "0.6053449", "0.59204805", "0.59158033", "0.58738226", "0.586818", "0.5833741", "0.5781091", "0.57...
0.6863703
0
Return the remaining execution time left.
def get_exec_time(self): return self._exec_time
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def time_left(self):\n return self.timeout - self.current_milli_time()", "def remaining(self):\n return self._timeout - (time.time() - self._start_time)", "def Remaining(self):\n if self._timeout is None:\n return None\n\n # Get start time on first calculation\n if self._start_time ...
[ "0.8176138", "0.8112286", "0.80781066", "0.7952713", "0.79193354", "0.7779088", "0.77535784", "0.7729628", "0.7566976", "0.74021", "0.7391143", "0.7363348", "0.7210861", "0.7092081", "0.7077589", "0.7062598", "0.7053684", "0.70209646", "0.6974813", "0.69493395", "0.694678", ...
0.0
-1
Execute the IO operation.
def io_operation(self, time): self._io_time -= time if self._io_time <= 0: self._io = False return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run(self):\n\n if (self.action == 'read'):\n self.read()\n else:\n self.write()", "def execute(self) -> None:\n pass # Implement in Executors", "def execute(self) :\n \n raise NotImplementedError()", "def execute(self, stream):\n pass", "...
[ "0.6723369", "0.6628433", "0.65956306", "0.64953166", "0.6424929", "0.6424929", "0.64057785", "0.6268122", "0.624101", "0.62252724", "0.6200358", "0.6200358", "0.6200358", "0.6200358", "0.6191981", "0.6168984", "0.6162358", "0.6162358", "0.6162358", "0.6162358", "0.6162358", ...
0.0
-1
Lo mas basico por ahora. self va a atacar a other, y pertenecen ambos al menos a la clase being Incluye el resultado del ataque en la pantalla
def attack(self, other): print(self.name, "attacks", other.name) damage = self.strenght*(1.-other.defense) print("damage: ", damage) other.hp -= damage print(other.name+"'s remaining health: ", other.hp,) print("----------")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def relate(self, other):\n ...", "def mezclar_bolsa(self):", "def common(self):", "def mergeWith(self, others):", "def ir(self):\n if not self._chamados:\n self._andar = 0\n else:\n super().ir() # metodo irado de falar q ta usando function base.", "def combine(s...
[ "0.5810023", "0.56825334", "0.56774", "0.5676831", "0.56455386", "0.55973756", "0.5571818", "0.54953223", "0.54953223", "0.54655224", "0.54491484", "0.537475", "0.53681886", "0.5329239", "0.5328549", "0.5302687", "0.52881163", "0.5281063", "0.52689505", "0.52411973", "0.52404...
0.0
-1
eg VAR has { val ... } N(F) X = { Y Z } forall x in X, mu[F,X] x = sum[y,z] f x y z nu[Y, F] y nu[Z, F] z prob. must preserve order of vars (and their vals) for factor and for consistency soln. { var => [vals] } ndarray.flatten() == ndarray.resize(ndarray.size) == ndarray.shape = (ndarray.size,)
def fac2var(_Mu,Nu, G, f,v): #print #print "fac '%s' \t=>\t var '%s'" % (f,v) assert G.type(f)=='fac' and G.type(v)=='var' vars = G.N(f) # for order ii = { x:i for i,x in enumerate(vars) } # inverted index for val in G.vals(v): # forall val in var # "pin down msg var to one va...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _arrays_var(array_list, mean_img):\n dims = array_list[0].shape[2]\n out = np.zeros(array_list[0].shape)\n\n for i in range(dims):\n temp = [j[:, :, i] for j in array_list]\n mean = mean_img[:, :, i]\n var_temp = [(k - mean)**2 for k in temp] # squared error\n\n # calculat...
[ "0.5845929", "0.57198024", "0.56999534", "0.56131214", "0.557092", "0.55258644", "0.5463579", "0.5447518", "0.54396427", "0.5408366", "0.5391776", "0.53757197", "0.5358896", "0.53472465", "0.5334673", "0.5329358", "0.5328297", "0.52987504", "0.52896243", "0.5284808", "0.52438...
0.5618466
3
CASE same vars in diff factors (in particular, two factors on same vars should just be multiplied and renormalized) eg joint p(x,y) q(y,z) => pq(x,y,z) not pq(x,y,y,z)
def joint(G, xs=None): vars = G.vars() #: [var] facs = { f : G.N(f) for f in G.facs() } #: fac => vars dims = [G.node[x]['d'] for x in vars] #: [nat] _joint = ones(dims) for vals in itertools.product( *(xrange(d) for d in dims) ): # cartesian product _vars = dict(zip(vars,vals)) #: var => ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mult(p, q):\n if p.ndim == 1 and q.ndim > 1:\n p = np.tile(p,(q.shape[0],1))\n if q.ndim == 1 and p.ndim > 1:\n q = np.tile(q,(p.shape[0],1))\n if q.ndim == 1 and p.ndim == 1:\n p = p.reshape((1,4))\n q = q.reshape((1,4))\n\n ps = p[:,3]\n qs = q[:,3]\n pv = p[:,:3...
[ "0.56603324", "0.56498754", "0.55809426", "0.552647", "0.55200124", "0.5476002", "0.5393373", "0.53859407", "0.5366496", "0.5357864", "0.5348368", "0.52597344", "0.52567494", "0.52469045", "0.5240923", "0.52221805", "0.5214967", "0.5203497", "0.51892143", "0.518457", "0.51840...
0.0
-1
rcf.get( 'my.value' [,default=None] ) Return element 'key' from the dictionairy. If the element is not present but a default is specified, than return the default value. If 'verbose' is set to True, then print debug messages to the logging about which values is returned for the given key. The option argument 'totype' d...
def get(self, key, totype='', default=None, verbose=False) : # element found ? if self.values.has_key(key) : # copy value: value = self.values[key] # convert ? if totype == 'bool' : # convert to boolean: if value in...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self, key, default=None):", "def get(self, key, default=None):\n def find(found_item, _):\n \"\"\" This is the closer function which will be passed to find by key function , if key found than return the value \n otherwise return blanck\"\"\"\n if found_item:\n ...
[ "0.64534926", "0.6251469", "0.60194284", "0.5991601", "0.59772664", "0.59666896", "0.5960963", "0.59091663", "0.58856887", "0.58582264", "0.58386767", "0.57904947", "0.5755614", "0.57369614", "0.5693632", "0.56652397", "0.56638163", "0.56469303", "0.5636939", "0.56364596", "0...
0.7533211
0
Replace a key by a new value.
def replace(self, key, val) : # search for a line '<key> : <val>' # loop over lines in output file: found = False for iline in range(len(self.outfile)) : # extract: line = self.outfile[iline] # skip lines that are no key:value pair for sure...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self, key, value):\n if key in self.map:\n self.map[key] = value", "def set(self, key, value):\n self.remove(key)\n self.add(key, value)", "def update(self, key, new_value):\n raise NotImplementedError", "def put(self, key, value):\n self.__setitem__(k...
[ "0.7437087", "0.74050415", "0.7395179", "0.7248969", "0.71339524", "0.71339524", "0.70550406", "0.70550406", "0.7050555", "0.7004182", "0.7004182", "0.7004182", "0.6991815", "0.6991815", "0.69495565", "0.6931892", "0.69297993", "0.69267035", "0.6916259", "0.69054604", "0.6884...
0.0
-1
Add a new key/value pair.
def add(self, key, val, comment='') : # add lines: self.outfile.append('\n') if len(comment) > 0 : self.outfile.append('! %s\n' % comment) self.outfile.append('%s : %s\n' % (key, str(val))) # add to dictionairy: self.values[key] = val # ok ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add(self, key, value):", "def add(self, key, value):\n self.data.append((key, value))", "def add(self, key, val):\n key_ = KeyValue()\n key_.key = key\n key_.value = val\n self.values.append(key_)", "def add(self, key, value):\n if not key in self:\n s...
[ "0.8143023", "0.81188846", "0.8020425", "0.7694956", "0.7677777", "0.7665912", "0.7648051", "0.7439111", "0.7343776", "0.7343776", "0.7173332", "0.7147949", "0.7119981", "0.71059954", "0.7085393", "0.70618504", "0.6992537", "0.6961919", "0.69544464", "0.69453835", "0.693275",...
0.6522889
43
Return a line with all '${..}' parts replaced by the corresponding rcfile values. The 2item tupple (mark1,mark2) could be used to redefine the default
def substitute(self, line, marks=('${', '}')) : # ensure that common marks are evaluated correctly: start_mark = marks[0].replace('{', '\{').replace('<', '\<').replace('$', '\$') close_mark = marks[1].replace('}', '\}').replace('>', '\>') # set syntax of keywords to be matched,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def line_replacer(config,change_this_line,key):\n for arg in config['HyperParameter'][key]: \n pattern=r'{}[ ]*=.*,'.format(arg)\n replace_value=config['HyperParameter'][key][arg][counter]\n if type(replace_value) is str:\n replace_value=\"'\"+replace_value+\"'\"\n change_...
[ "0.5997842", "0.5653259", "0.55641407", "0.5496313", "0.549261", "0.5427544", "0.54236406", "0.5406687", "0.5236979", "0.5196354", "0.50934047", "0.5075184", "0.5054109", "0.5053191", "0.50487894", "0.5033384", "0.5020895", "0.49910378", "0.4947748", "0.49393365", "0.49321803...
0.64586604
0
write the dictionary to file
def WriteFile(self, filename) : # open file for writing: f = open(filename, 'w') ## loop over key/value pairs: #for k,v in self.iteritems(): # # add line; at least the specified number of characters # # is used for the key: # f.write( '%-20s:%s\n' % (k...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def file_write(filename, dic):\n d = dic \n f = open(filename, 'w') \n f.write(str(d))\n f.close()", "def save_to_file():\n dict_from_file.update(temp_dict)\n plik=open('data.txt', 'w')\n for key in dict_from_file.keys():\n plik.write(key)\n plik.write(\" \")\n plik...
[ "0.7878094", "0.7732373", "0.77017367", "0.767664", "0.7515612", "0.74871707", "0.74454683", "0.7350702", "0.72613084", "0.72161037", "0.7170939", "0.70977116", "0.70946723", "0.6982299", "0.6974492", "0.6875983", "0.6874121", "0.6859801", "0.68586725", "0.6835329", "0.681405...
0.7176695
10
This method reads an rcfile by making an instance of the RcFile class, and then returns the dictionary of values only. This makes it backwards compatible with older implementations of the rc.py module
def read(rcfilename, silent=False) : rcdict = RcFile(rcfilename, silent=silent) return rcdict.values
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def loadrc():\n from os.path import expanduser, exists\n kw = {}\n rcfile = expanduser(\"~/.otterrc\")\n if exists(rcfile):\n for l in open(rcfile):\n if l and l[0] == '#':\n continue\n l = l.strip()\n k, v = l.split('=', 1)\n kw[k] = v\...
[ "0.64410394", "0.63989705", "0.6235341", "0.61783165", "0.6018567", "0.6015222", "0.598155", "0.5962859", "0.58766705", "0.58535343", "0.5832061", "0.58206147", "0.5808365", "0.5783165", "0.5765665", "0.57173103", "0.5667324", "0.5649408", "0.5646103", "0.5645754", "0.5628989...
0.7766227
0
This method writes an rcfile dictionary. This makes it backwards compatible with older implementations of the rc.py module
def write(filename, rcdict) : # open file for writing: f = open(filename, 'w') # loop over key/value pairs: for k, v in rcdict.items(): # add line; at least the specified number of characters # is used for the key: f.write('%-20s:%s\n' % (k, v)) #endfor # close file: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_reviewboardrc(\n self,\n config: Union[str, Dict[str, object]] = {},\n *,\n parent_dir: Optional[str] = None,\n filename: str = '.reviewboardrc',\n ) -> str:\n if not parent_dir:\n parent_dir = os.getcwd()\n\n if not os.path.exists(parent_dir...
[ "0.58933717", "0.58280134", "0.57708037", "0.5677671", "0.56567436", "0.564652", "0.5606423", "0.5561287", "0.54439956", "0.54399455", "0.5397927", "0.5380859", "0.5378976", "0.5362301", "0.53517056", "0.5332659", "0.5321802", "0.5288789", "0.5269314", "0.5253592", "0.5247000...
0.7306515
0
Return true is the drivers did not enter vehicle ID, return False if the drivers have entered the vehicle ID
def notSignedIn(vID): if str(vID) == '0': return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def park_vechile(vehicle_id, driver_age):\n if (vehicle_id is None or driver_age is None or int(driver_age) <= 0):\n print(\n f\"Cannot add vehicle : {vehicle_id} with drivers age : {driver_age}. Make sure you have entered valid age and vehicle id.\"\n )\n return False\n drive...
[ "0.6174358", "0.5753446", "0.5731725", "0.5713738", "0.56289744", "0.5607331", "0.55788124", "0.5568934", "0.5467982", "0.542737", "0.5346952", "0.5346844", "0.5334291", "0.5284828", "0.5258329", "0.52553296", "0.52458316", "0.52401084", "0.5237299", "0.52186245", "0.51856196...
0.4845184
75
estimate completion time goes to 0
def resetEstComp(cur, vID): cur.execute("""UPDATE OpenTasks SET estComplete = null WHERE vID = ? """,[vID])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def estimate_completion(self):\n if self.completion_ts:\n # Task is already complete. Return the exact completion time:\n defer.returnValue(self.completed)\n # Get the timestamps from the descendent task that's doing the work:\n if self.method == 'build' or self.method ==...
[ "0.66363746", "0.6500906", "0.64684916", "0.64572805", "0.6446129", "0.6404238", "0.6401701", "0.6255227", "0.6237457", "0.62204576", "0.6218418", "0.62053406", "0.6147098", "0.6143911", "0.6140413", "0.6099619", "0.60805124", "0.6075302", "0.6014964", "0.6012597", "0.5988216...
0.0
-1
return the integer which is one larger than the order number of the last fixed task
def getNextFixOrderNum(cur,vID): orderNum = execute_query(cur, """SELECT Count(*) FROM OpenTasks where vID = ? and fixTask = 1""", [vID])[0][0] orderNum = int(orderNum) + 1 return orderNum
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_last_order_number_used():\n return Order.__last_order_number_used", "def max_known_number(self):\n return len(self.number_list)-1", "def getNextOrderNum(cur,vID):\n orderNum = execute_query(cur,\"\"\"SELECT Count(*) FROM OpenTasks where vID = ?\"\"\", [vID])[0][0]\n orderNum = int(o...
[ "0.6763644", "0.668508", "0.6189763", "0.6137287", "0.60284483", "0.5992221", "0.5902313", "0.58949655", "0.5890844", "0.58760947", "0.58221585", "0.5820193", "0.58144027", "0.5802588", "0.57986987", "0.5775288", "0.5750009", "0.57490426", "0.574343", "0.5732985", "0.5724948"...
0.7093612
0
return the integer which is one larger than the order number of the last task
def getNextOrderNum(cur,vID): orderNum = execute_query(cur,"""SELECT Count(*) FROM OpenTasks where vID = ?""", [vID])[0][0] orderNum = int(orderNum) + 1 return orderNum
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_last_order_number_used():\n return Order.__last_order_number_used", "def getNextFixOrderNum(cur,vID):\n orderNum = execute_query(cur, \"\"\"SELECT Count(*) FROM OpenTasks where vID = ? and fixTask = 1\"\"\", [vID])[0][0]\n orderNum = int(orderNum) + 1\n return orderNum", "def max_known_...
[ "0.7138854", "0.6993503", "0.6557429", "0.6089233", "0.6055018", "0.60366005", "0.59922534", "0.5963018", "0.59596205", "0.5953438", "0.5901155", "0.58949864", "0.58853245", "0.58697134", "0.58620477", "0.58304846", "0.57982224", "0.57851154", "0.57851154", "0.57851154", "0.5...
0.6504484
3
Increment later tasks' order number by 1, orderNum is the order of the inserted task should be called before inserting the task
def fixOrderBeforeInsert(cur,vID,orderNum): cur.execute("""UPDATE OpenTasks SET orderNum = orderNum + 1 WHERE vID = ? and orderNum >= ?""",[vID, orderNum])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def next_task(self):\n self.task_index = self.task_index + 1", "def set_task_order(self, order):\n for task in self.tasks:\n task.order = order", "def update_item_orders(begin_order, t_task, projects, api, cmd_count):\n for task in t_tasks.values():\n if is_in_the_same_proj(t...
[ "0.67876685", "0.6770982", "0.65684867", "0.6393463", "0.6246073", "0.623554", "0.623554", "0.6102943", "0.60974747", "0.59860617", "0.59690464", "0.5954019", "0.5953115", "0.5820547", "0.5777761", "0.57628953", "0.57628953", "0.56956476", "0.56843513", "0.56710744", "0.56121...
0.7882594
0
Read input data and return it as list of strings
def load_input(filepath: str) -> list: lines = [] with open(filepath, "r", encoding="utf-8") as file: for line in file.readlines(): lines.append(line.strip()) return lines
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read(self) -> List[str]:\n pass", "def convert_input_to_list():\n\n f = open('pizza_source.txt', 'r')\n file_to_list = f.read().split('\\n')\n\n return file_to_list", "def get_data(self):\n input_data = sys.stdin.readlines()\n input_data = [x.rstrip('\\n') for x in input_data ...
[ "0.74404186", "0.74043787", "0.7268994", "0.71911365", "0.71245223", "0.71158236", "0.70885766", "0.70574355", "0.70062494", "0.6921909", "0.6806533", "0.6780032", "0.67442507", "0.6732981", "0.6713376", "0.6696493", "0.6682388", "0.66767144", "0.6660164", "0.66531116", "0.66...
0.6315666
42
Calculates sum of priority of misplaced items
def part_one(rucksacks: list) -> int: summ = 0 for rucksack in rucksacks: split_point = len(rucksack) // 2 first = set(rucksack[:split_point]) second = set(rucksack[split_point:]) misplaced_item = list(first.intersection(second))[0] summ += PRIORITY.get(misplaced_item, 0)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def minus_priority(self):\n #return (-self.size, self.vec, self.score) # kinda \"depth-first\"\n #return (self.vec, self.score, -self.size) # kinda \"breadth-first\"\n return (self.score, -self.size, self.vec) # kinda \"depth-first with back-tracking\"", "def _total_priority(self):\n r...
[ "0.613023", "0.6108493", "0.60942686", "0.60910505", "0.59696794", "0.59104174", "0.58975667", "0.5897182", "0.5833252", "0.56657416", "0.5659038", "0.56554574", "0.5651261", "0.55769664", "0.55510724", "0.55481315", "0.55368197", "0.5523055", "0.55020446", "0.5475016", "0.54...
0.6242036
0
Searches common item (badge) within group of 3 and calculates sum of priority for all such items
def part_two(rucksacks: list) -> int: summ = 0 for i in range(0, len(rucksacks), 3): first_group = set(rucksacks[i]) second_group = set(rucksacks[i + 1]) third_group = set(rucksacks[i + 2]) badge = first_group.intersection(second_group).intersection(third_group) badge = l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def score(priority_list, totalItemCount, itemUsageDict, threshold):\n scored = list()\n for item in priority_list:\n scored.append((item, itemUsageDict[item][\"winRatio\"] * (itemUsageDict[item][\"totalCount\"]/ totalItemCount) * threshold))\n return scored", "def _greedy_packing(items: List[Item...
[ "0.6211346", "0.58101124", "0.56715894", "0.5624766", "0.5603909", "0.5542294", "0.53215784", "0.5319817", "0.5294602", "0.5222445", "0.5195872", "0.5186559", "0.51640636", "0.5154687", "0.51292366", "0.5124628", "0.5111832", "0.5103564", "0.5078185", "0.5065282", "0.5052656"...
0.6571525
0
Labels trip segments by likely mode of travel. Labels are "chilling" if traveler is stationary, "walking" if slow, "driving" if fast, and "bogus" if too fast to be real.
def label_modes(trip_list, silent=True): if silent == False: print('Preparing to label modes of travel for ' \ + str(len(trip_list)) + ' trips.') loop_counter = 0 loop_size = len(trip_list) for doc in trip_list: if silent == False: loop_counter = loop_counter ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _label_rider_by_trip_frequency(self, rider):\n if rider['total_num_trips'] <= 5*self.duration:\n label = 0\n elif rider['total_num_trips'] <= 20*self.duration:\n label = 1\n elif rider['total_num_trips'] > 20*self.duration:\n label = 2\n else:\n ...
[ "0.6683314", "0.5794343", "0.57204336", "0.5663418", "0.54465616", "0.540998", "0.53342205", "0.5294559", "0.5294559", "0.5294559", "0.5272785", "0.526113", "0.52575165", "0.52496135", "0.5243312", "0.52420646", "0.5240937", "0.52082247", "0.5200447", "0.5184323", "0.51811284...
0.63868463
1
Create a new reference
def add_reference(md5=None, pos=None): m = request.args.get('md5', None) if md5 is None else md5 u = Upload.objects.filter(md5=m).first() if not u: abort(404) p = request.args.get('pos', None) if pos is None else pos xt, t, xb, b = parse_pos(p) # make the form form = ReferenceForm(fo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_reference(self):\n self.make_reference2()", "def make_reference2(self):\n self.ref = Snapshot()", "def new_ref(s, url, start_pt=None, path=None ):\n return Ref( url, start_pt, path, store=s )", "def create_refobj(self, ):\n n = cmds.createNode(\"jb_reftrack\")\n cm...
[ "0.82459867", "0.7774234", "0.7647526", "0.7543965", "0.73071504", "0.7214215", "0.7025243", "0.70249426", "0.6691337", "0.66536695", "0.665127", "0.6640334", "0.6549366", "0.65243435", "0.6474897", "0.6436419", "0.6436419", "0.64272875", "0.642101", "0.63690186", "0.6348411"...
0.5782141
63