query
stringlengths
10
2k
document
stringlengths
20
51.2k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Get list of subscriptions
def get_subscriptions(self): url = '{}/v2/subscriptions'.format(self.url) r = requests.get(url, headers=self.headers_v2) return r.json()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_subscriptions(self):\n return self.subscriptions.all()", "def list(cls, **kwargs):\n response = Yola().list_subscriptions(**kwargs)\n return [cls(**sub) for sub in response['results']]", "def listSubscriptions() -> object:\n\n db = Db()\n return db.Subscriptions.objects().to_...
[ "0.8398169", "0.8375198", "0.8325919", "0.8277738", "0.8259095", "0.79059505", "0.78718024", "0.77910763", "0.7774858", "0.7725947", "0.7718782", "0.76882046", "0.7623318", "0.7581791", "0.7498807", "0.7496328", "0.7492321", "0.74787927", "0.7477246", "0.74727875", "0.7406269...
0.85034156
0
Get list of subscriptions
def delete_subscription(self, subscription_id): url = '{}/v2/subscriptions/{}'.format(self.url, subscription_id) print(url) r = requests.delete(url, headers=self.headers_v2) if r.status_code == 204: return 'success' return r.json()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_subscriptions(self):\n url = '{}/v2/subscriptions'.format(self.url)\n r = requests.get(url, headers=self.headers_v2)\n return r.json()", "def get_subscriptions(self):\n return self.subscriptions.all()", "def list(cls, **kwargs):\n response = Yola().list_subscriptions(...
[ "0.85034156", "0.8398169", "0.8375198", "0.8325919", "0.8277738", "0.8259095", "0.79059505", "0.78718024", "0.77910763", "0.7774858", "0.7725947", "0.7718782", "0.76882046", "0.7623318", "0.7581791", "0.7498807", "0.7496328", "0.7492321", "0.74787927", "0.7477246", "0.7472787...
0.0
-1
Return a zero of the function f with derivative df.
def find_zero(f, df): def near_zero(x): return approx_eq(f(x), 0) return improve(newton_update(f, df), near_zero)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def zzX_zero_of(f, d=0):\n return zzX_zero(poly_level(f)-d)", "def find_zero(f,p1,d):\n if p1 > 10:\n p1 = 0.5\n c = p1 - f(p1)*d/(f(p1+d)-f(p1)) # simple\n \n # we can do this in case derivative diverges because our function is symmetric\n if c < 0:\n c = -c\n \n global n_o...
[ "0.710459", "0.69687253", "0.68732387", "0.6862347", "0.6778152", "0.6637142", "0.6637142", "0.6579491", "0.6576675", "0.6561542", "0.65527314", "0.6465958", "0.6439708", "0.6392126", "0.6368971", "0.63685733", "0.6347817", "0.6342038", "0.63330156", "0.6315682", "0.63055897"...
0.72815776
0
Return the product of two polynomials.
def mul_fns(f_and_df, g_and_dg): "*** YOUR CODE HERE ***"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def product(self, x, y):\n return self( x.lift() * y.lift() )", "def product(self, x, y):\n return self._cached_product(x.value, y.value)", "def pair_product(x1, x2):\n return np.multiply(x1, x2)", "def prod(self, x, y):\n return self.reduce(x + y)", "def product(a, b):\n ret...
[ "0.73147523", "0.72763896", "0.72646916", "0.72538054", "0.72258043", "0.7211867", "0.7186754", "0.7025851", "0.6962782", "0.6938128", "0.69103223", "0.68699586", "0.6851267", "0.6796636", "0.6779231", "0.6773779", "0.6679488", "0.66560173", "0.65410644", "0.6526134", "0.6524...
0.0
-1
get number of months between date1 and date2
def monthdelta(date1, date2): delta = 0 while True: mdays = monthrange(date1.year, date1.month)[1] date1 += timedelta(days=mdays) if date1 <= date2: delta += 1 else: break return delta
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def month_diff(date1, date2):\n # First make sure, that date2 > date1\n if date1.daysTo(date2) < 0:\n date_tmp = date1\n date1 = date2\n date2 = date_tmp\n years = date2.year() - date1.year()\n months = date2.month() - date1.month()\n if months < 0:\n years -= 1\n ...
[ "0.8220923", "0.7981674", "0.78050035", "0.71566683", "0.69912905", "0.6870293", "0.66869533", "0.6676488", "0.64629275", "0.6369351", "0.63632154", "0.634212", "0.62995034", "0.62808937", "0.6219738", "0.6204618", "0.61590964", "0.6150254", "0.6134692", "0.61048067", "0.6095...
0.78957486
2
creates a numpy.array of daily timestamp between date1 and date2
def daily_date_range(date1, date2): num_days = (date2-date1).days return np.array([datetime(date1.year, date1.month, date1.day, 0)+timedelta(days=i) for i in range(num_days)])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tstamps_for_daterange(self, start_date, end_date):\n\n img_offsets = np.array([timedelta(hours=h) for h in self.h_steps])\n\n timestamps = []\n diff = end_date - start_date\n for i in range(diff.days + 1):\n daily_dates = start_date + timedelta(days=i) + img_offsets\n ...
[ "0.62646705", "0.6251543", "0.6244625", "0.58896583", "0.58510077", "0.5696359", "0.5563263", "0.55348426", "0.55319935", "0.542548", "0.5410174", "0.5364342", "0.53538656", "0.53444016", "0.533278", "0.52783984", "0.52664703", "0.52501595", "0.52376074", "0.52373147", "0.523...
0.7559687
0
Create a time stamp
def format_time(self, record): record.dbtime = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(record.created))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_time_stamp() -> str:\n\n return datetime.datetime.now().strftime(\"%Y%m%d\")", "def createTimeStamp_Time():\r\n\r\n return str(datetime.now().strftime(\"%H%M%S\"))", "def _generate_timestamp():\n\t\treturn strftime(\"%Y%m%dT%H%M%S\")", "def time_stamper() :\n\treturn datetime.now().strf...
[ "0.82344866", "0.80578434", "0.7941837", "0.7887707", "0.7724759", "0.764854", "0.76407987", "0.7609499", "0.7507878", "0.75021756", "0.7492183", "0.7405442", "0.7382047", "0.73726344", "0.73598593", "0.72908676", "0.72616744", "0.7245461", "0.72384834", "0.7209734", "0.71923...
0.0
-1
Close the cursor object and the connection to the database Used when closing the context manager or deleting the object
def close(self): self.cursor.close() self.db.close()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def close(self):\n# self.cursor.close()\n\tself.db.close()", "def close(self):\r\n if self.cursor is None:\r\n return\r\n\r\n self.cursor.close()\r\n self.cursor = None\r\n self.app_id = None\r\n self.iden_id = None", "def close(self):\n self.cursor.c...
[ "0.86554474", "0.8260736", "0.8233482", "0.8230915", "0.8141959", "0.8133902", "0.81295943", "0.8077434", "0.80626726", "0.806266", "0.8043159", "0.80188817", "0.798275", "0.79796505", "0.79384774", "0.79309344", "0.7913784", "0.78969324", "0.7894729", "0.78856033", "0.787497...
0.85049456
1
Check if rows exist in a table satisfying the given where clauses.
def exists(self, table, **where): # Format the list of where statements wheres = ' AND '.join([str(attr) + '=\'' + str(val) + '\'' for attr, val in where.items()]) if where: query = 'SELECT COUNT(*) FROM "{}" WHERE {}'.format(table, wheres) else: query = 'SELECT ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _exists(cursor, table, data):\n cursor.execute('SELECT 1 FROM {} WHERE ({}) = ({})'.format(table, *_query_fields(data)), data)\n return bool(cursor.fetchone())", "def contains(self, table_name, keys=None, any=False, eids=None):\n table = self.db.table(table_name)\n if eids is not None:\n LOG...
[ "0.6341168", "0.6322485", "0.6010342", "0.60048956", "0.5916878", "0.58578634", "0.58364034", "0.5764844", "0.5717923", "0.56689465", "0.566596", "0.5644548", "0.563038", "0.5628894", "0.56232756", "0.5587086", "0.55848366", "0.55557954", "0.5468923", "0.5435275", "0.54281336...
0.7143307
0
Uses the value in the configuration to generate the activation layer
def generate_activation(act_par): if type(act_par) == list: if len(act_par) == 2: atype, par = act_par if atype == 'elu': return ELU(alpha=par) elif atype == 'leaky': return LeakyReLU(alpha=par) elif atype == 'prelu': ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def output_layer_activation(x):\n return x", "def _return_activation(x, nl):\n if nl == 'HS':\n x = Activation(_hard_swish)(x)\n if nl == 'RE':\n x = Activation(_relu6)(x)\n return x", "def _build_activation_layer_params(self, conv_param):\n ...
[ "0.7048914", "0.66638404", "0.6513957", "0.64711577", "0.64621544", "0.641587", "0.6366923", "0.63322306", "0.62809336", "0.6253608", "0.6253608", "0.6251253", "0.6233026", "0.623275", "0.6205886", "0.6174059", "0.615047", "0.6148785", "0.6092307", "0.60719943", "0.60170734",...
0.6444262
5
Swish activation function f(x) = x sigmoid(x)
def swish(x): return x * tf.sigmoid(x)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def swish(x):\n return x * k.activations.sigmoid(x)", "def sigmoid_activation(x):\n return 1.0 / (1 + np.exp(-x))", "def sigmoid(x):\n return 1 / (1 + exp(-x))", "def sigmoid(x):\n return 1 / (1 + exp(-x))", "def sigmoid(X,W,b):\n preActivation = np.dot(X, W) + b\n return (1.0)/(1.0 + np....
[ "0.85330546", "0.80146253", "0.7924477", "0.7924477", "0.7834979", "0.7768678", "0.7701341", "0.76915896", "0.7679821", "0.7679821", "0.7679821", "0.7679821", "0.7679821", "0.7679821", "0.76798", "0.7678892", "0.7670881", "0.76577955", "0.76546377", "0.7654548", "0.7654548", ...
0.839208
1
Returns distance in metres two points at a scale in m / pixel.
def distance(a: Point, b: Point, scale: float) -> float: x_north = a.y - b.y y_east = b.x - a.x return scale * math.sqrt(x_north**2 + y_east**2)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __get_distance(point1: np.ndarray, point2: np.ndarray) -> float:\n return np.sqrt(np.sum(np.square(point1 - point2)))", "def calcMetresDistance(lat1, long1, lat2, long2):\n return (abs(lat1 - lat2) + abs(long1 - long2)) * 100\n # no, like, really badly", "def dist(a,b): # compute distance bet...
[ "0.69323415", "0.68888944", "0.6871156", "0.6864509", "0.6789273", "0.678687", "0.67551297", "0.67032665", "0.6617065", "0.6612344", "0.6612344", "0.6612344", "0.6612344", "0.6612344", "0.6600635", "0.6595335", "0.65848386", "0.6579544", "0.65792656", "0.6576208", "0.65716827...
0.7553026
0
Returns distance in metres and angle in degrees between two points at a scale in m / pixel.
def distance_bearing(a: Point, b: Point, scale: float) -> typing.Tuple[float, float]: return distance(a, b, scale), bearing(a, b)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def distance(a: Point, b: Point, scale: float) -> float:\n x_north = a.y - b.y\n y_east = b.x - a.x\n return scale * math.sqrt(x_north**2 + y_east**2)", "def dist(a,b): # compute distance between two points a & b\n return mag(sub(a,b))", "def dist(a: Point, b: Point):\n return (a.x - b.x) ** 2 ...
[ "0.70006555", "0.67366946", "0.64140326", "0.63529974", "0.63453376", "0.6335935", "0.6302976", "0.6299658", "0.6289378", "0.62801343", "0.62367475", "0.623009", "0.62291485", "0.62259954", "0.6212561", "0.62117785", "0.6203023", "0.61536294", "0.6130652", "0.6102998", "0.607...
0.6276442
10
Returns the error estimate of distance. At +2500m to the threshold this is assumed to be 100m decreasing linearly to 10m at the threshold and thereafter.
def distance_tolerance(distance: float) -> float: ret = 10.0 if distance < 0: ret += distance * (100 - ret) / -2500.0 return ret
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calc_error_dist(self):\n pass", "def raydistance_error(motiontrajectory, ptstart, ptend):\n assert len(motiontrajectory.shape) == 2\n assert motiontrajectory.shape[1] == 2\n \n mv = np.diff(motiontrajectory, axis=0) # motion vector\n md = mv / np.linalg.norm(mv, axis=1)[:, np.newaxis] ...
[ "0.68346655", "0.59785795", "0.5899985", "0.5891643", "0.58115864", "0.57261914", "0.5721195", "0.5701244", "0.5672895", "0.566193", "0.56211555", "0.5603761", "0.5581379", "0.55801815", "0.5575662", "0.55719346", "0.55618274", "0.5559863", "0.5535016", "0.5530429", "0.552588...
0.6669917
1
Return similarity of image clamped between 0 and 1, based on color histogram.
def diff_image_color(image_path0, image_path1): image0 = Image.open(image_path0) #color_image0 = get_histogram(image0) color_image0 = image0.histogram() cut_color_image0 = cut_histogram_min(color_image0) image1 = Image.open(image_path1) color_image1 = image1.histogram() #color_image1 = get_h...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def similarity_two_images_color(img1: np.ndarray, img2: np.ndarray) -> np.ndarray:\n hist_image_1 = histogram_of_image_color(img1, HIST_BINS_INTENSITY, BIN_DIFFERENCE_INTENSITY_HALF)\n hist_image_2 = histogram_of_image_color(img2, HIST_BINS_INTENSITY, BIN_DIFFERENCE_INTENSITY_HALF)\n max_difference = max(...
[ "0.7710607", "0.7021697", "0.696457", "0.6765876", "0.6655069", "0.66449726", "0.6612816", "0.6607752", "0.6590249", "0.6524321", "0.64872754", "0.64509964", "0.64006555", "0.6377595", "0.63449633", "0.6320793", "0.6315561", "0.63066345", "0.62904185", "0.6282458", "0.6277086...
0.6007296
28
Calculate distance between to earth coordinates. Result is in miles.
def earth_distance(lat1: float, lon1: float, lat2: float, lon2: float)\ -> float: # R = 6373.0 # earth radius in km R = 3963.0 # earth radius in miles lat1 = radians(lat1) lon1 = radians(lon1) lat2 = radians(lat2) lon2 = radians(lon2) dlon = lon2 - lon1 dlat = lat2 - lat1 a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _earth_distance(time='now'):\n return get_earth(time).radius", "def delta_lat_miles(self, delta_lat):\n\n return delta_lat.dist_from_radius(EARTH_RADIUS)", "def compute_distance_to_city_in_km(self, city):\n lat = math.radians(self.latitude - city.latitude)\n long = math.radians(self.lon...
[ "0.74275494", "0.6892453", "0.6786982", "0.67252445", "0.67228395", "0.67050934", "0.66883934", "0.6661304", "0.65835005", "0.6579619", "0.6579619", "0.6579619", "0.6579619", "0.6579619", "0.65778446", "0.65706176", "0.65483814", "0.65294033", "0.6504263", "0.6497094", "0.649...
0.7156023
1
saves user dict in a json file for backup purposes.
def backup_users_dict(users_dict: dict) -> None: with open('users.json', 'w') as usrs: json.dump(users_dict, usrs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def saveUser(self):\n self.user[\"Video\"] = \"\"\n with open(self.user_file, \"w+\") as json_file:\n json.dump(self.user, json_file, indent=4)", "def save_user_db(file_path: str, user_db: dict) -> None:\n # In case directory is not yet existed.\n os.makedirs(os.path.dirname(file_p...
[ "0.79160696", "0.76484644", "0.75792545", "0.7564305", "0.7516156", "0.74020296", "0.73266774", "0.73105067", "0.73105067", "0.73105067", "0.7294279", "0.7293666", "0.722183", "0.7220219", "0.7195101", "0.7185052", "0.7102662", "0.7087843", "0.7079798", "0.7076869", "0.702014...
0.83944935
0
return the array index for (x1, y1, x2, y2) coordinates
def __getxy(x1, y1, x2, y2): return x1*27+y1*9+x2*3+y2
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def xy_to_index(x, y):\n index = y * columns + x\n return index", "def get_index(self, x, y):\n i = (y - self.y0) // self.dy\n j = (x - self.x0) // self.dx\n i = min(max(i, 0), self.n-1)\n j = min(max(j, 0), self.m-1)\n return [i, j]", "def index ( self, x, y ):\n ...
[ "0.79767454", "0.7710934", "0.75416255", "0.75416255", "0.7403139", "0.7255793", "0.7206964", "0.7156717", "0.7153376", "0.7099808", "0.7084314", "0.7042873", "0.70158625", "0.69993585", "0.69844043", "0.6948298", "0.6928068", "0.6901308", "0.68569285", "0.6839039", "0.682626...
0.6508926
35
Get the environment variable or return an exception.
def get_env_variable(var_name): try: return os.environ[var_name] except KeyError: error_msg = "Set the {} environment variable".format(var_name) raise Exception(error_msg)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_env_variable(self, var_name, optional=False):\n try:\n return environ[var_name]\n except KeyError:\n if optional:\n return False\n else:\n error_msg = f'Error: You must set the {var_name} environment variable.'\n raise Exception(error_msg)", "de...
[ "0.80457675", "0.8030515", "0.7970805", "0.7830226", "0.7669435", "0.7650485", "0.75856763", "0.7574462", "0.7559217", "0.7539553", "0.7533871", "0.7533828", "0.752872", "0.7429229", "0.7423501", "0.7372745", "0.734772", "0.73405427", "0.7332478", "0.7260579", "0.71217793", ...
0.7896108
3
Returns an int64_list from a bool / enum / int / uint.
def _int64_feature(value): return tf.train.Feature(int64_list=tf.train.Int64List(value=[value]))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _BoolsToInts(arg_list):\n result = []\n for arg in arg_list:\n if isinstance(arg, (list, tuple)):\n result.append(_BoolsToInts(arg))\n elif arg is True:\n result.append(1)\n elif arg is False:\n result.append(0)\n else:\n result.append(arg)\n\n return result", "def convertT...
[ "0.68806016", "0.659591", "0.646043", "0.6447361", "0.63662255", "0.62898934", "0.62705195", "0.6215276", "0.61031455", "0.5950929", "0.5944742", "0.5901341", "0.5864068", "0.5864068", "0.5856132", "0.5843577", "0.58429956", "0.5830027", "0.5801629", "0.57937616", "0.57937616...
0.5495083
64
Returns the first ICachableItem in the ICachableSource
def first(self): # we need to create a new object to insure we don't corrupt the generator count csvsource = CSVSource(self.source, self.factory, self.key()) try: item = csvsource.items().next() return item except StopIteration: return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetFirstVisibleItem(self):\r\n\r\n return self.GetNextVisible(self.GetRootItem())", "def get_first_item(cls):\n return cls.query.first()", "def GetFirstVisibleItem(self):\r\n\r\n id = self.GetRootItem()\r\n if not id:\r\n return id\r\n\r\n while id:\r\n ...
[ "0.6724672", "0.6649137", "0.6547738", "0.6443537", "0.62967414", "0.6210913", "0.61514056", "0.6134868", "0.6129987", "0.6128372", "0.609683", "0.60472065", "0.6029116", "0.6029116", "0.60171044", "0.5992828", "0.5991311", "0.59837943", "0.5958937", "0.5958017", "0.5931253",...
0.6728782
0
create a bullet object at a random position
def __init__(self,ai_settings,screen): super(Star,self).__init__() self.screen = screen #Create a bullet star at(0,0) and then set correct position self.rect = pygame.Rect(0,0,ai_settings.star_width,ai_settings.star_height) self.rect.centerx=randint(0,ai_settings.screen_width) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def shoot_bullets(self):\n\t\tBullet(self.birb.rect.x + 75, self.birb.rect.y + 35, self)", "def __init__(self,canvas=0,spritePath=bulletSpritePath,hitboxRadius=bulletHitboxRadius,xPos=0,yPos=0,entityThatCreatedMe=None):\n Entity.__init__(self,canvas,spritePath,xPos=xPos,yPos=yPos)\n self.creationTi...
[ "0.6806717", "0.67844594", "0.6753513", "0.6724394", "0.66815054", "0.65681136", "0.6411912", "0.6355837", "0.6323023", "0.6323023", "0.63201", "0.6266729", "0.6266387", "0.6213787", "0.6136149", "0.6131877", "0.6123338", "0.6093397", "0.60899264", "0.6050741", "0.6006691", ...
0.5467092
90
Returns this Widget rendered as HTML, as a Unicode string. The 'value' given is not guaranteed to be valid input, so subclass implementations should program defensively.
def render(self, name, value, attrs=None): raise NotImplementedError('subclasses of Widget must provide a render() method')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def render(self, value):\r\n return value", "def render(self, value, context=None):\n if self.raw_html is not None:\n return format_html(self.raw_html)\n else:\n return ''", "def value_as_html(self):\n property_name = \"_%s_as_html\" % self.attribute.type\n ...
[ "0.7227829", "0.7154962", "0.6852193", "0.64977735", "0.6460291", "0.63726753", "0.63700104", "0.6328116", "0.6328116", "0.62905025", "0.6186265", "0.6186265", "0.61741966", "0.6172817", "0.61396796", "0.61157507", "0.60706156", "0.6067268", "0.60636514", "0.6045153", "0.6036...
0.64479715
5
Returns the HTML ID attribute of this Widget for use by a , given the ID of the field. Returns None if no ID is available. This hook is necessary because some widgets have multiple HTML elements and, thus, multiple IDs. In that case, this method should return an ID value that corresponds to the first ID in the widget's...
def id_for_label(self, id_): return id_
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_id():\n inp = option_text('Input widget id:')\n add_to_collected('id', inp)\n OPTIONS['id'] = inp\n return", "def id(self) -> Optional[str]:\n return self.elem.get('id')", "def id(self) -> \"str\":\n return self._attrs.get(\"id\")", "def widgetId(form, component):\n retur...
[ "0.71112394", "0.6768629", "0.647663", "0.6432829", "0.64213264", "0.6271676", "0.61995065", "0.61995065", "0.61995065", "0.61995065", "0.61995065", "0.61995065", "0.61995065", "0.61995065", "0.61995065", "0.61995065", "0.61995065", "0.61995065", "0.61995065", "0.61995065", "...
0.61123925
35
batch should be a list of (sequence, target, length) tuples... Returns a padded tensor of sequences sorted from longest to shortest,
def collate_fn(batch): all_input_ids, all_attention_mask, all_token_type_ids, all_lens, all_labels = map(torch.stack, zip(*batch)) max_len = max(all_lens).item() all_input_ids = all_input_ids[:, :max_len] all_attention_mask = all_attention_mask[:, :max_len] all_token_type_ids = all_token_type_ids[:,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pad(batch):\n batch_split = list(zip(*batch))\n seqs, num, targs, lengths, visits = batch_split[0], batch_split[1], batch_split[2], batch_split[3], batch_split[4]\n num = torch.vstack([torch.as_tensor(sample, dtype=torch.float32) for sample in zip(*num)]).T\n visits = [torch.as_tensor(s, dtype=torc...
[ "0.7159843", "0.7000354", "0.698757", "0.6889939", "0.68026847", "0.6776342", "0.6717117", "0.67051345", "0.66918606", "0.6617879", "0.6609684", "0.6569384", "0.6504918", "0.64760405", "0.6383606", "0.6375098", "0.63486534", "0.63379014", "0.6331844", "0.62943137", "0.6279707...
0.0
-1
batch should be a list of (sequence, target, length) tuples... Returns a padded tensor of sequences sorted from longest to shortest,
def collate_fn_Siamese(batch): all_input_ids, all_attention_mask, all_token_type_ids, all_lens_a, all_lens_b, all_labels = map(torch.stack, zip(*batch)) max_len_a = max(all_lens_a).item() max_len_b = max(all_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pad(batch):\n batch_split = list(zip(*batch))\n seqs, num, targs, lengths, visits = batch_split[0], batch_split[1], batch_split[2], batch_split[3], batch_split[4]\n num = torch.vstack([torch.as_tensor(sample, dtype=torch.float32) for sample in zip(*num)]).T\n visits = [torch.as_tensor(s, dtype=torc...
[ "0.71583945", "0.69991595", "0.69859695", "0.6889869", "0.68008727", "0.67753315", "0.67161214", "0.67032063", "0.6691606", "0.66165346", "0.66079116", "0.6568327", "0.6504596", "0.64738506", "0.6381436", "0.6373073", "0.63474", "0.6335738", "0.63299406", "0.6292838", "0.6278...
0.0
-1
batch should be a list of (sequence, target, length) tuples... Returns a padded tensor of sequences sorted from longest to shortest,
def collate_fn_predict(batch): all_input_ids, all_attention_mask, all_token_type_ids, all_lens = map(torch.stack, zip(*batch)) max_len = max(all_lens).item() all_input_ids = all_input_ids[:, :max_len] all_attention_mask = all_attention_mask[:, :max_len] all_token_type_ids = all_token_type_ids[:, :ma...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pad(batch):\n batch_split = list(zip(*batch))\n seqs, num, targs, lengths, visits = batch_split[0], batch_split[1], batch_split[2], batch_split[3], batch_split[4]\n num = torch.vstack([torch.as_tensor(sample, dtype=torch.float32) for sample in zip(*num)]).T\n visits = [torch.as_tensor(s, dtype=torc...
[ "0.7158758", "0.6998711", "0.6985541", "0.6888636", "0.6800438", "0.6775586", "0.67167544", "0.6702557", "0.6690936", "0.66179013", "0.66080636", "0.65683347", "0.65043914", "0.6476313", "0.6380444", "0.63729495", "0.6346849", "0.63384616", "0.6332383", "0.6292617", "0.627955...
0.0
-1
batch should be a list of (sequence, target, length) tuples... Returns a padded tensor of sequences sorted from longest to shortest,
def collate_fn_predict_Siamese(batch): all_input_ids, all_attention_mask, all_token_type_ids, all_lens_a, all_lens_b = map(torch.stack, zip(*batch)) max_len_a = max(all_lens_a).item() max_len_b = max(all_lens_b).item() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pad(batch):\n batch_split = list(zip(*batch))\n seqs, num, targs, lengths, visits = batch_split[0], batch_split[1], batch_split[2], batch_split[3], batch_split[4]\n num = torch.vstack([torch.as_tensor(sample, dtype=torch.float32) for sample in zip(*num)]).T\n visits = [torch.as_tensor(s, dtype=torc...
[ "0.7159207", "0.69991595", "0.6987073", "0.6889248", "0.68013555", "0.677509", "0.6715574", "0.67038447", "0.669207", "0.66171706", "0.66088194", "0.65674895", "0.65058535", "0.6474219", "0.6382925", "0.6373818", "0.63464737", "0.63363683", "0.63302284", "0.6293658", "0.62786...
0.0
-1
Name of the DataSync Agent.
def name(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def server_agent_name(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"server_agent_name\")", "def server_agent_name(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"server_agent_name\")", "def server_agent_name(self) -> Optional[pulumi.Input[str]]:\n return pulumi...
[ "0.66958755", "0.6403934", "0.6403934", "0.6395309", "0.630705", "0.62116325", "0.6155174", "0.6129708", "0.6129708", "0.6129708", "0.6129708", "0.6129708", "0.6129708", "0.6129708", "0.61201364", "0.61201364", "0.61201364", "0.61201364", "0.61201364", "0.61201364", "0.612013...
0.0
-1
The ID of the VPC (virtual private cloud) endpoint that the agent has access to.
def vpc_endpoint_id(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "vpc_endpoint_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vpc_endpoint_id(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"vpc_endpoint_id\")", "def vpc_id(self) -> str:\n return pulumi.get(self, \"vpc_id\")", "def vpc_id(self) -> str:\n return pulumi.get(self, \"vpc_id\")", "def vpc_id(self) -> str:\n return pulumi...
[ "0.7875883", "0.7150874", "0.7150874", "0.7150874", "0.7150874", "0.7150874", "0.7150874", "0.7111536", "0.7111536", "0.7111536", "0.699527", "0.699527", "0.699527", "0.699527", "0.699527", "0.699527", "0.699527", "0.699527", "0.699527", "0.67907846", "0.6777866", "0.674632...
0.75328296
1
Amazon Resource Name (ARN) of the DataSync Agent.
def arn(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "arn")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def invoke_arn(self) -> str:\n return pulumi.get(self, \"invoke_arn\")", "def arn(self) -> str:\n return pulumi.get(self, \"arn\")", "def arn(self) -> str:\n return pulumi.get(self, \"arn\")", "def arn(self) -> str:\n return pulumi.get(self, \"arn\")", "def arn(self) -> str:\n ...
[ "0.6824416", "0.65846545", "0.65846545", "0.65846545", "0.65846545", "0.65846545", "0.6559048", "0.6559048", "0.6559048", "0.6559048", "0.6559048", "0.6559048", "0.6559048", "0.6559048", "0.6559048", "0.6559048", "0.6559048", "0.6559048", "0.6559048", "0.6559048", "0.6559048"...
0.57399064
63
Name of the DataSync Agent.
def name(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def server_agent_name(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"server_agent_name\")", "def server_agent_name(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"server_agent_name\")", "def server_agent_name(self) -> Optional[pulumi.Input[str]]:\n return pulumi...
[ "0.6694951", "0.640341", "0.640341", "0.63942903", "0.6305633", "0.6210776", "0.6154047", "0.6128155", "0.6128155", "0.6128155", "0.6128155", "0.6128155", "0.6128155", "0.6128155", "0.6118517", "0.6118517", "0.6118517", "0.6118517", "0.6118517", "0.6118517", "0.6118517", "0...
0.0
-1
A map of tags assigned to the resource, including those inherited from the provider `default_tags` configuration block.
def tags_all(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]: return pulumi.get(self, "tags_all")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tags(self) -> Mapping[str, Any]:\n return pulumi.get(self, \"tags\")", "def tags(self) -> Mapping[str, Any]:\n return pulumi.get(self, \"tags\")", "def tags(self) -> Mapping[str, str]:\n return pulumi.get(self, \"tags\")", "def tags(self) -> Mapping[str, str]:\n return pulumi....
[ "0.74426347", "0.74426347", "0.7436904", "0.7436904", "0.7436904", "0.7436904", "0.7159035", "0.7095233", "0.70808786", "0.7056028", "0.6930104", "0.6916602", "0.6824262", "0.6796552", "0.6752453", "0.67005885", "0.6630536", "0.6630536", "0.6630536", "0.6630536", "0.6630536",...
0.0
-1
The ID of the VPC (virtual private cloud) endpoint that the agent has access to.
def vpc_endpoint_id(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "vpc_endpoint_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vpc_endpoint_id(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"vpc_endpoint_id\")", "def vpc_id(self) -> str:\n return pulumi.get(self, \"vpc_id\")", "def vpc_id(self) -> str:\n return pulumi.get(self, \"vpc_id\")", "def vpc_id(self) -> str:\n return pulumi...
[ "0.7875468", "0.71501195", "0.71501195", "0.71501195", "0.71501195", "0.71501195", "0.71501195", "0.71105874", "0.71105874", "0.71105874", "0.69948256", "0.69948256", "0.69948256", "0.69948256", "0.69948256", "0.69948256", "0.69948256", "0.69948256", "0.69948256", "0.6790082", ...
0.75323
2
Amazon Resource Name (ARN) of the DataSync Agent.
def arn(self) -> pulumi.Output[str]: return pulumi.get(self, "arn")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def invoke_arn(self) -> str:\n return pulumi.get(self, \"invoke_arn\")", "def arn(self) -> str:\n return pulumi.get(self, \"arn\")", "def arn(self) -> str:\n return pulumi.get(self, \"arn\")", "def arn(self) -> str:\n return pulumi.get(self, \"arn\")", "def arn(self) -> str:\n ...
[ "0.68244267", "0.65840626", "0.65840626", "0.65840626", "0.65840626", "0.65840626", "0.61535513", "0.6129198", "0.6129198", "0.61191714", "0.6051608", "0.6033862", "0.6033862", "0.6033862", "0.59901786", "0.59585214", "0.59103537", "0.58519167", "0.58519167", "0.58458984", "0...
0.6558831
27
Name of the DataSync Agent.
def name(self) -> pulumi.Output[str]: return pulumi.get(self, "name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def server_agent_name(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"server_agent_name\")", "def server_agent_name(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"server_agent_name\")", "def server_agent_name(self) -> Optional[pulumi.Input[str]]:\n return pulumi...
[ "0.66957754", "0.6404578", "0.6404578", "0.6394967", "0.63031226", "0.62063724", "0.61500406", "0.6124751", "0.6124751", "0.6124751", "0.6124751", "0.6124751", "0.6124751", "0.6124751", "0.6115097", "0.6115097", "0.6115097", "0.6115097", "0.6115097", "0.6115097", "0.6115097",...
0.0
-1
A map of tags assigned to the resource, including those inherited from the provider `default_tags` configuration block.
def tags_all(self) -> pulumi.Output[Mapping[str, str]]: return pulumi.get(self, "tags_all")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tags(self) -> Mapping[str, Any]:\n return pulumi.get(self, \"tags\")", "def tags(self) -> Mapping[str, Any]:\n return pulumi.get(self, \"tags\")", "def tags(self) -> Mapping[str, str]:\n return pulumi.get(self, \"tags\")", "def tags(self) -> Mapping[str, str]:\n return pulumi....
[ "0.74419177", "0.74419177", "0.7436042", "0.7436042", "0.7436042", "0.7436042", "0.71569943", "0.70952725", "0.7080317", "0.7056273", "0.69293123", "0.69156295", "0.68240654", "0.67961735", "0.6752203", "0.6700467", "0.66293275", "0.66293275", "0.66293275", "0.66293275", "0.6...
0.6410673
62
The ID of the VPC (virtual private cloud) endpoint that the agent has access to.
def vpc_endpoint_id(self) -> pulumi.Output[Optional[str]]: return pulumi.get(self, "vpc_endpoint_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vpc_endpoint_id(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"vpc_endpoint_id\")", "def vpc_endpoint_id(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"vpc_endpoint_id\")", "def vpc_id(self) -> str:\n return pulumi.get(self, \"vpc_id\")", "def vp...
[ "0.75328296", "0.75328296", "0.7150874", "0.7150874", "0.7150874", "0.7150874", "0.7150874", "0.7150874", "0.7111536", "0.7111536", "0.7111536", "0.699527", "0.699527", "0.699527", "0.699527", "0.699527", "0.699527", "0.699527", "0.699527", "0.699527", "0.67907846", "0.6777...
0.7875883
0
Test urlpatterns is not empty.
def test_urls(): assert len(urlpatterns) > 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_urlpattern_with_options(cls):\n p = re.compile('\\{\\w+\\}')\n for urlpattern in cls.urlpatterns:\n matches = p.findall(urlpattern)\n not_found = copy.copy(matches)\n for match in matches:\n if not cls.urlpattern_options.get(match.strip('{}...
[ "0.6885281", "0.6488244", "0.63631237", "0.63566864", "0.63373655", "0.6293202", "0.62435323", "0.6177724", "0.6165472", "0.61581266", "0.6152045", "0.5998634", "0.599404", "0.59667355", "0.5962423", "0.59366286", "0.58937687", "0.58869284", "0.5864858", "0.5860892", "0.58568...
0.8075284
0
Convert a nested data structure to a json string.
def dumps(obj, sort_keys=None, cls=TricksEncoder, obj_encoders=DEFAULT_ENCODERS, extra_obj_encoders=(), primitives=False, compression=None, allow_nan=False, conv_str_byte=False, **jsonkwargs): if not hasattr(extra_obj_encoders, '__iter__'): raise TypeError('`extra_obj_encoders` should be a tuple i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tojson(self, recursive=10):\n return json.dumps(self.todict(recursive=recursive))", "def json(self, data):\n import json\n data = json.dumps(data)\n return data", "def tojson(self, data):\n return json.dumps(data)", "def to_json(self, data):\n return json.dumps(d...
[ "0.66305465", "0.6598067", "0.65562546", "0.6531554", "0.6526191", "0.6510411", "0.6502573", "0.64800704", "0.64297324", "0.6398634", "0.63706595", "0.63641316", "0.6358269", "0.6351337", "0.6347967", "0.63088816", "0.6294162", "0.62680006", "0.62341964", "0.62333864", "0.622...
0.0
-1
returns full name "Firstname Lastname"
def get_full_name(self): return "{} {}".format(self.first_name, self.last_name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def full_name(first_name, last_name):\n\t\n\treturn first_name + \" \" + last_name", "def full_name(first_name, last_name):\n return first_name + \" \" + last_name", "def get_full_name(self):\n\t\tfull_name = '%s %s' % (self.first_name, self.last_name)\n\t\treturn full_name.strip()", "def get_full_name(se...
[ "0.8904935", "0.88164485", "0.8765584", "0.8722709", "0.8722709", "0.8684503", "0.8684503", "0.8684503", "0.8684503", "0.8684503", "0.8684503", "0.8684503", "0.8684503", "0.8684503", "0.8684503", "0.8684503", "0.8684503", "0.8684503", "0.8684503", "0.8684503", "0.8684503", ...
0.8277071
70
Checks if the effect won't allow the attack to continue
def immobilized(self, owner): return False, []
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def can_act(self) -> bool:\n return self.cooldown < 1", "def can_act(self) -> bool:\n return self.cooldown < 1", "def can_take_damage(self):\n result = True\n if self.side_effects[\"shield\"] > 0:\n result = False\n return result", "def canAct(self) -> bool:\n ...
[ "0.7335532", "0.7335532", "0.7250862", "0.7186726", "0.70367795", "0.696501", "0.67084503", "0.66880405", "0.6487949", "0.6447789", "0.6430839", "0.64295506", "0.6423657", "0.64154863", "0.6375035", "0.6370045", "0.636221", "0.63423866", "0.6298871", "0.6288533", "0.62810594"...
0.0
-1
Retrieves the user's API key from the user record and stores in the API instance. This is done using a session authenticated with username and password, to avoid the user having to specify all three.
def _get_api_key(self): self.api.apikey = self.api.action.user_show(id=self.username)['apikey']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def api_authentication():\r\n apikey = request.args.get('api_key', None)\r\n from flask import _request_ctx_stack\r\n if 'Authorization' in request.headers:\r\n apikey = request.headers.get('Authorization')\r\n if apikey:\r\n user = db.session.query(model.user.User...
[ "0.7394983", "0.7255855", "0.7149509", "0.69122607", "0.68423945", "0.6838871", "0.68173265", "0.6802924", "0.66542155", "0.65650326", "0.65239", "0.64883554", "0.6486136", "0.6421507", "0.6382293", "0.6346643", "0.6336477", "0.62861747", "0.6285456", "0.6222244", "0.62128776...
0.76691073
0
Creates a new CKAN Dataset with the details specified.
def create_package(self, **kwargs): results = self.api.action.package_create(**kwargs) self.get_ckan_metadata(True) return results
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_dataset(project, dataset_name):\n dataset = dataset_name\n get_dataset = project.datasets.get(dataset_name=dataset)\n project.datasets.create(dataset_name=dataset_name)\n \n return get_dataset", "def create_dataset(store, dataset, author=None, initial_head='main'):\n dataset_path = s...
[ "0.6714846", "0.6608505", "0.6479372", "0.6393278", "0.6381835", "0.6336555", "0.62755936", "0.62337315", "0.6215389", "0.62099046", "0.6203882", "0.61420345", "0.60930914", "0.60670763", "0.60598886", "0.6033183", "0.6031993", "0.60011595", "0.59976405", "0.5992104", "0.5967...
0.0
-1
Returns the path to a local copy of the resource file, downloading/updating if necessary.
def get(self): if self.resource_id: with CachedCKAN(**self.ckan_kwargs) as ckan: return ckan.get_resource(resource_id=self.resource_id) return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _localfile(name):\n return os.path.abspath(resource_filename(__name__, name))", "def get_resource(self, resource_id, cache_for=None):\n metadata = self.get_resource_metadata(resource_id)\n last_updated = self.get_resource_last_updated(resource_id)\n\n if metadata and last_updated > se...
[ "0.7247884", "0.68746537", "0.66875046", "0.66841894", "0.6614738", "0.6498192", "0.6487131", "0.64672107", "0.6448742", "0.6423599", "0.64151925", "0.63970333", "0.63970333", "0.63956195", "0.63325757", "0.6313199", "0.6262004", "0.6244602", "0.62420374", "0.6236555", "0.621...
0.0
-1
Gets a formatted time string using the provided datetime object
def get_duration(start_datetime): end_datetime = datetime.now() total_seconds = (end_datetime - start_datetime).total_seconds() hours, remainder = divmod(total_seconds, 3600) minutes, seconds = divmod(remainder, 60) return '{:02}m:{:02}s'.format(int(minutes), int(seconds))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_time_str():\n return time.strftime(time_fmt)", "def datetime_to_str(time):\n return '{hour}:{min}:{second}:{millisecond}'.format(\n hour=time.hour,\n min=time.minute, \n second=time.second,\n millisecond=str(int(round(time.microsecond / 1000.0))),\n )", "def for...
[ "0.7503794", "0.7405656", "0.7398418", "0.731703", "0.7315062", "0.7312087", "0.72994965", "0.7226463", "0.72250885", "0.722176", "0.72186106", "0.7189555", "0.7163162", "0.7119737", "0.70188636", "0.6957891", "0.6930463", "0.6917259", "0.6913564", "0.69115686", "0.6910729", ...
0.0
-1
Test a variety of ways that generation of a new Treant should fail. 1. `Treant('somedir/treant')` should raise `MultipleTreantsError` if more than one state file is in the given directory
def test_noregen(self, tmpdir, treantclass): with tmpdir.as_cwd(): # 1 t1 = treantclass('newone') t2 = treantclass('newone', new=True) assert t1.uuid != t2.uuid with pytest.raises(dtr.treants.MultipleTreantsError): t3 = treantclass('ne...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_init(self, treant, tmpdir):\n assert treant.name == self.treantname\n assert treant.location == tmpdir.strpath\n assert treant.treanttype == self.treanttype\n assert treant.abspath == (os.path.join(tmpdir.strpath,\n self.treantname)...
[ "0.60381055", "0.599281", "0.5979761", "0.5929113", "0.5919436", "0.58588606", "0.58527654", "0.58287495", "0.57682323", "0.5753016", "0.57425493", "0.56523967", "0.56501704", "0.5647308", "0.56395644", "0.5619321", "0.55897903", "0.55862457", "0.5579676", "0.557584", "0.5571...
0.7305239
0
Twolayer NPTN as described in the paper. out_channels and num_transforms refer to the first layer only.
def two_layer_nptn(x, num_classes=10, out_channels=48, num_transforms=1): with tf.variable_scope('nptn_1'): x = nptn_layer(x, 3, 3, out_channels, num_transforms) x = tf.layers.batch_normalization(x) x = parametric_relu(x) x = tf.layers.max_pooling2d(x, (2, 2), 2) with tf.variabl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nptn_layer(input, kernel_size, in_channels, out_channels, num_transforms):\n assert len(input.shape) == 4\n\n filter_shape = (kernel_size, kernel_size, in_channels,\n out_channels * num_transforms)\n filter = tf.get_variable('weights', filter_shape, dtype=input.dtype)\n bias = tf...
[ "0.67367357", "0.57352144", "0.56979936", "0.56967825", "0.5668742", "0.5588165", "0.55659705", "0.5548545", "0.5547123", "0.55060697", "0.5501692", "0.5468197", "0.5446166", "0.5425245", "0.5420839", "0.5418289", "0.5409266", "0.5403939", "0.5401453", "0.5381876", "0.5373465...
0.7447827
0
bidirectional add edge for undirected graph.
def add_edge(self, tail: Tuple[int, int], head: Tuple[int, int]): assert tail in self.vertices.keys(), "passed in tail is not a vertex yet" assert head in self.vertices.keys(), "passed in head is not a vertex yet" if tail==head: print("do not add edge to yourself") else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_edge(self, edge):\n src = edge.get_source()\n dest = edge.get_destination()\n #weightEdge = WeightedEdge(src, dest, edge.get_total_distance(), edge.get_outdoor_distance())\n if not (src in self.edges and dest in self.edges):\n raise ValueError('Node not in graph')\n ...
[ "0.7700323", "0.76026815", "0.7602562", "0.75517565", "0.7475427", "0.74472606", "0.74452895", "0.7424743", "0.7414261", "0.7386586", "0.7365856", "0.7357539", "0.7341254", "0.7325073", "0.73181874", "0.7289596", "0.72704077", "0.7258167", "0.7251808", "0.7251011", "0.7251011...
0.6679059
91
get number of connected components
def connected_components(self) -> int: # visited = set() def get_component(vert: Tuple[int, int]) -> Set[Tuple[int, int]]: """ """ nonlocal visited visited.add(vert) if graph.vertices[vert]: for neighbor in graph.vertices[vert]: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _num_conn_comp(graph):\n\n return nx.number_connected_components(graph)", "def connected_component_lengths(self):\n return [len(x) for x in nx.connected_components(self.return_undirected())]", "def number_weakly_connected_components(G):\n return sum(1 for wcc in weakly_connected_components...
[ "0.83232707", "0.8040847", "0.774941", "0.7719609", "0.771087", "0.7632936", "0.7559967", "0.7548571", "0.7458276", "0.7356123", "0.7317277", "0.72522044", "0.7251057", "0.72374845", "0.71566594", "0.7125862", "0.71134853", "0.71093506", "0.7091009", "0.70766383", "0.7076215"...
0.7983907
2
Return number of vertices in database
def hasvertices(self): if len(self.vertices) > 0: return True else: return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def obtener_cantidad_vertices(self):\n return len(self.vertices.keys())", "def num_vertices(self):\n return len(self)", "def get_vertices_count(self) -> int:\n # TODO: verify the following claim:\n raise NotImplementedError", "def num_vertices(self):\n return self.n * (1 + ...
[ "0.8077431", "0.79327136", "0.79121745", "0.7893555", "0.78797144", "0.78797144", "0.78698504", "0.7861419", "0.7772262", "0.77452165", "0.77135336", "0.769941", "0.7578606", "0.75042987", "0.73418915", "0.7338367", "0.72428036", "0.7155062", "0.70920813", "0.6984475", "0.695...
0.0
-1
Write package JSON to disk
def write_packages_json(count, packages, packages_directory): json_download_file = os.path.join( packages_directory, "packages{}.json".format(count) ) logger.info("Packages file is downloaded to '%s'", json_download_file) try: with open(json_download_file, "w") as json_file: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_package_json(self) -> None:\n # make sure folder exists\n if not self.package_path.exists():\n self.package_path.mkdir(parents=True, exist_ok=True)\n # write the json to a file\n with open(self.package_path / \"package.json\", \"w\") as f:\n json.dump(sel...
[ "0.83078134", "0.7197055", "0.7169171", "0.71443003", "0.7083302", "0.7063877", "0.7055792", "0.70456624", "0.69828856", "0.69827825", "0.6949087", "0.69180524", "0.691153", "0.68943894", "0.6867635", "0.6833136", "0.6821909", "0.68195516", "0.68179524", "0.6808427", "0.67829...
0.68645114
15
Extract a set of ngrams from a list of integers.
def create_ngram_set(input_list, ngram_value=2): return set(zip(*[input_list[i:] for i in range(ngram_value)]))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_ngram_set(input_list, ngram_value=2):\n return set(zip(*[input_list[i:] for i in range(ngram_value)]))", "def find_ngrams(input_list, n=3):\n return zip(*[input_list[i:] for i in range(n)])", "def create_ngram_set(self, input_list, ngram_value=2):\n return set(zip(*[input_list[i:] f...
[ "0.76989484", "0.7478928", "0.74681896", "0.7228818", "0.71772516", "0.7038002", "0.6977662", "0.6938288", "0.6829033", "0.6759564", "0.6719", "0.66278785", "0.66258675", "0.65890974", "0.6534543", "0.65252674", "0.64583546", "0.6402734", "0.63953984", "0.6389275", "0.6377588...
0.7822425
0
Augment the input list of list (sequences) by appending ngrams values.
def add_ngram(sequences, token_indice, ngram_range=2): new_sequences = [] for input_list in sequences: new_list = input_list[:] for ngram_value in range(2, ngram_range + 1): for i in range(len(new_list) - ngram_value + 1): ngram = tuple(new_list[i:i + ngram_value]) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_ngram(sequences, token_indice, ngram_range=2):\n new_sequences = []\n for input_list in sequences:\n new_list = input_list[:]\n for ngram_value in range(2, ngram_range + 1):\n for i in range(len(new_list) - ngram_value + 1):\n ngram = tu...
[ "0.7456609", "0.740691", "0.7316882", "0.63946664", "0.6229141", "0.62036645", "0.6144797", "0.59809494", "0.5973278", "0.5964258", "0.5932551", "0.5929449", "0.58704007", "0.58352613", "0.58208406", "0.58001685", "0.57981306", "0.5784745", "0.57427156", "0.5742448", "0.57222...
0.7426375
1
Return a list of products.
def product_array(md_array): products = [1] * len(md_array) for list in md_array: list_index = md_array.index(list) for item in list: products[list_index] *= item return products
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_products(self):\n return self._make_get_request(self._urls['products'])", "def products(self):\n return list(Product.select())", "def list_products(self):\n url = self.base_url\n # TODO add filtering support when holvi api supports it\n obdata = self.connection.make_...
[ "0.88056797", "0.8327074", "0.83108467", "0.8273931", "0.82540935", "0.81168497", "0.80588484", "0.8058481", "0.8009116", "0.80061424", "0.7991916", "0.79552424", "0.7900699", "0.78749627", "0.7828679", "0.78043324", "0.7732108", "0.7726112", "0.7702277", "0.7701761", "0.7700...
0.0
-1
Return an instance of Account for the new account.
def account(self): provider_name = self.provider_entry.get_text() provider = Provider.get_by_name(provider_name) # Create a new provider if we don't find one if not provider: provider_image = self.provider_image.image provider_website = self.provider_website_entr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def account(self):\r\n return Account(self)", "def account(self):\n return Account(self)", "def account(self, account_id):\r\n return Account(self, account_id)", "def account(self, account_code):\r\n return acc.Account(self, account_code)", "def account():\n\n bank_test = Ban...
[ "0.8290813", "0.8254896", "0.7867634", "0.77372354", "0.7327423", "0.7258345", "0.72545564", "0.720003", "0.717187", "0.7127372", "0.7089911", "0.70826364", "0.67998534", "0.6789432", "0.670145", "0.66924477", "0.6672502", "0.6589854", "0.655991", "0.6501096", "0.64618254", ...
0.6529989
19
Search for a vertex in the 2nd position of List(int, str) and return index.
def search_vertex(ls, vertex): for idx in range(len(ls)): if ls[idx][1] == vertex: return idx
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index_vertices(vertexlist, graph):\n return_list = list()\n for vertex in vertexlist:\n return_list.append(graph.vs.find(name=vertex).index)\n return return_list", "def find_vertex_index(graph, uri_str, brackets=False):\n\tif brackets:\n\t\turi_str = '<'+uri_str+'>'\n\n\ttry:\n\t\treturn grap...
[ "0.6945676", "0.67291117", "0.63841534", "0.6382502", "0.63806105", "0.6175287", "0.609422", "0.6090202", "0.6087574", "0.6026152", "0.6013369", "0.6009101", "0.60074645", "0.60070634", "0.59980595", "0.5997357", "0.59782416", "0.59773296", "0.5972704", "0.5972371", "0.596567...
0.82055616
0
create RiskSLIM MIP object
def create_risk_slim(input): assert 'coef_set' in input, 'input is missing coef_set' P = len(input['coef_set']) # setup printing and loading function_print_flag = input['print_flag'] if 'print_flag' in input else False print_from_function = lambda msg: print_log(msg) if function_print_flag else la...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(__self__,\n resource_name: str,\n args: VpcIpamPoolArgs,\n opts: Optional[pulumi.ResourceOptions] = None):\n ...", "def createRotoNodeMI():\n return gs()", "def __init__(__self__, *,\n cidr: pulumi.Input[str],\n ...
[ "0.57169443", "0.54935175", "0.5459325", "0.54075986", "0.5400031", "0.53792804", "0.5355474", "0.5321274", "0.5289824", "0.5282277", "0.5275696", "0.52704775", "0.5260886", "0.5239818", "0.5238467", "0.52272254", "0.51834756", "0.5177146", "0.5176517", "0.5174048", "0.516651...
0.65285146
0
finds the value of rho[j] in feasible_coef_values that minimizes log_loss(rho) + C_0j
def compute_objvals_at_dim(dim_index, feasible_coef_values, base_rho, base_scores, base_loss, C_0): # copy stuff because ctypes scores = np.copy(base_scores) # initialize ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def P_bol(j,rhoA):\n\n rho_j = rhoA[j]\n return rho_j * c0**2 * np.sqrt( 1 + (rho_j/rho0)**(4/3) )", "def convert_to_risk_slim_cplex_solution(rho, indices, loss=None, objval=None):\n solution_idx = range(0, indices['n_variables'])\n solution_val = np.zeros(indices['n_variables'])\n\n # rho\n ...
[ "0.65310234", "0.62829095", "0.6058815", "0.5960956", "0.5918176", "0.5790462", "0.57894534", "0.5714317", "0.5696645", "0.5694927", "0.56927633", "0.56864077", "0.5677211", "0.56683356", "0.56644833", "0.56557816", "0.56422967", "0.5613286", "0.5590972", "0.5574816", "0.5569...
0.63221544
1
Ensure that if constructing from `asdf.ExternalArrayReference` objects all of them have the same shape, dtype and target.
def _validate_homogenaity(cls, shape, target, dtype, ear): if isinstance(ear, (list, tuple)): return list(map(partial(cls._validate_homogenaity, shape, target, dtype), ear)) if not isinstance(ear, ExternalArrayReference): raise TypeError("Every element of must be an instance of ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _check_same_shape(preds: Tensor, target: Tensor) ->None:\n if preds.shape != target.shape:\n raise RuntimeError(f'Predictions and targets are expected to have the same shape, but got {preds.shape} and {target.shape}.')", "def _compare_arrays(self, data, reference, atol=1.e-5, rtol=1.e-5):\n ...
[ "0.6566082", "0.6212097", "0.6202712", "0.61445963", "0.6065236", "0.601039", "0.5992512", "0.598749", "0.5983114", "0.59633094", "0.59484833", "0.59239185", "0.59119993", "0.58783007", "0.5876212", "0.5869929", "0.58563894", "0.58546984", "0.5838123", "0.58151025", "0.580491...
0.6008059
6
Stack a loader array along each of its dimensions. This results in a dask array with the correct chunks and dimensions.
def stack_loader_array(loader_array): if len(loader_array.shape) == 1: return da.stack(loader_to_dask(loader_array)) stacks = [] for i in range(loader_array.shape[0]): stacks.append(stack_loader_array(loader_array[i])) return da.stack(stacks)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def array(self):\n return stack_loader_array(self.loader_array).reshape(self.output_shape)", "def load_chunks(self):\n for key, array in self.chunks.items():\n loaded_array = np.asarray(array)\n self.chunks[key] = loaded_array", "def stack(arrays, axis=0):\n raise Not...
[ "0.6740181", "0.62578696", "0.6237837", "0.61975235", "0.59589636", "0.59500736", "0.5881783", "0.5869132", "0.5701136", "0.5689394", "0.56675667", "0.5660353", "0.56292516", "0.55963564", "0.5542171", "0.5517344", "0.55140144", "0.5411399", "0.5389828", "0.5389679", "0.53683...
0.8333696
0
Map a call to `dask.array.from_array` onto all the elements in ``loader_array``. This is done so that an explicit ``meta=`` argument can be provided to prevent loading data from disk.
def loader_to_dask(loader_array): if len(loader_array.shape) != 1: raise ValueError("Can only be used on one dimensional arrays") # The meta argument to from array is used to determine properties of the # array, such as dtype. We explicitly specify it here to prevent dask # trying to auto calc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stack_loader_array(loader_array):\n if len(loader_array.shape) == 1:\n return da.stack(loader_to_dask(loader_array))\n stacks = []\n for i in range(loader_array.shape[0]):\n stacks.append(stack_loader_array(loader_array[i]))\n return da.stack(stacks)", "def array(self):\n aa ...
[ "0.6512419", "0.60990465", "0.58843625", "0.58693886", "0.55165154", "0.5438049", "0.5366238", "0.5358712", "0.5263945", "0.52227837", "0.52216196", "0.52055085", "0.51365423", "0.51171994", "0.51155996", "0.50952417", "0.5079183", "0.5017124", "0.5017124", "0.50152904", "0.5...
0.7210299
0
Finds the closest next Determination Date for a given CLO
def next_determination_date(ddates,clo_idx): dd = ddates.loc[ddates['Fund']==clo_idx,'Determination Date'] next_ddate = min(dd.loc[dd>pd.Timestamp.today()], key=lambda s: (s-pd.Timestamp.today())) return next_ddate
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def next_payment_date(ddates,clo_idx):\n dd = ddates.loc[ddates['Fund']==clo_idx,'Payment Date'].dropna()\n next_date = min(dd.loc[dd>pd.Timestamp.today()], key=lambda s: (s-pd.Timestamp.today()))\n return next_date", "def prior_determination_date(ddates,clo_idx):\n dd = ddates.loc[ddates['Fund']==cl...
[ "0.70815456", "0.6885164", "0.62852925", "0.62490076", "0.6035495", "0.59736896", "0.5913274", "0.5899726", "0.58242583", "0.57373506", "0.57354647", "0.572037", "0.56322455", "0.56102186", "0.55837506", "0.55447114", "0.5503305", "0.54535663", "0.54417944", "0.5431457", "0.5...
0.76319665
0
Finds the closest next Determination Date for a given CLO
def next_payment_date(ddates,clo_idx): dd = ddates.loc[ddates['Fund']==clo_idx,'Payment Date'].dropna() next_date = min(dd.loc[dd>pd.Timestamp.today()], key=lambda s: (s-pd.Timestamp.today())) return next_date
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def next_determination_date(ddates,clo_idx):\n dd = ddates.loc[ddates['Fund']==clo_idx,'Determination Date']\n next_ddate = min(dd.loc[dd>pd.Timestamp.today()], key=lambda s: (s-pd.Timestamp.today()))\n return next_ddate", "def prior_determination_date(ddates,clo_idx):\n dd = ddates.loc[ddates['Fund'...
[ "0.76311296", "0.68860203", "0.62814987", "0.62474966", "0.60339886", "0.5972924", "0.59115094", "0.58981055", "0.5821018", "0.57357585", "0.5732491", "0.5717424", "0.56315535", "0.5611521", "0.55821496", "0.5543604", "0.5502113", "0.54530454", "0.5440974", "0.54317224", "0.5...
0.70796466
1
Numerically calculate the energy of a wave function generated by `h_static`. For n=1, we'd like to see if we can backcalculate E = 1/2.
def calc_energy(n: int) -> float: E = -2 / (n + 1) ** 2 x, ψ = h_static(E) # Calculate potential between the e- field and the nucleus point by integrating. # todo: Let's do this manually first, then try to apply a scipy.integrate approach. dx = 1 result = 0 ψ2 = np.conj(ψ) * ψ sampl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def energy(n):\n return (n * pi * hbar / (2 * a)) ** 2 / (2 * m)", "def heterodyner_signal(self, n=1):\n omega = self.fvec*2*np.pi*n\n phvec = np.cumsum(omega)\n return np.exp(1j*phvec)", "def E(n):\n\n h = 2 * np.pi\n E = h ** 2/(8 * np.pi) * np.sum(n ** 2)\n\n return E", "d...
[ "0.75971985", "0.71659374", "0.71083647", "0.701199", "0.68858737", "0.6817904", "0.6749287", "0.6681984", "0.66303617", "0.6575992", "0.6444103", "0.6439027", "0.64366823", "0.6436469", "0.64302945", "0.6401461", "0.63511914", "0.63426185", "0.6292362", "0.6289546", "0.62835...
0.79739964
0
Director messages contain offset and size local to the screen that media should be displayed on. Screens have their own offsets that should be honored during ManagedWindow creation. This method will return `real` offset.
def _get_viewport_offset(self): viewport_geometry = ManagedWindow.get_viewport_geometry() if not viewport_geometry: viewport_geometry = WindowGeometry() return {'x': viewport_geometry.x, 'y': viewport_geometry.y}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _pos(self):\n sw = self.parent.winfo_screenwidth()\n sh = self.parent.winfo_screenheight()\n w = sw * 0.8\n h = sh * 0.8\n x = (sw - w) / 2\n y = (sh - h) / 2\n self.parent.geometry('%dx%d+%d+%d' % (w, h, x, y))", "def wm(self):\n return self.position",...
[ "0.61861867", "0.61233014", "0.5966426", "0.5830564", "0.57786125", "0.5739207", "0.5739207", "0.5739207", "0.5732235", "0.57232225", "0.56863743", "0.56268376", "0.56138533", "0.5548511", "0.5538241", "0.5516603", "0.55157495", "0.5514786", "0.5514532", "0.549704", "0.548602...
0.60613483
2
All the cases for a given node are in the transitions to that node.
def all_case_groups(self, node_tag): for tag in self.reverse_edges[node_tag]: for from_grp,to_grp in self.nodes[tag].transitions[node_tag]: yield to_grp
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transition(self):\n for node in self.net.nodes():\n if node not in self.evidence:\n self.update_node(node)", "def get_successors(self, node):\n succs = []\n parent_state = self.node_to_state(node)\n for it in self.children:\n child_node = (node[0] + it[0], node[1] + it[1])\n ...
[ "0.5792827", "0.5410251", "0.53993726", "0.5290269", "0.52816916", "0.5278971", "0.5252477", "0.5199749", "0.5178954", "0.5143815", "0.51037747", "0.50952506", "0.50904924", "0.5067474", "0.50654083", "0.50454456", "0.50382626", "0.50260895", "0.49898145", "0.49791223", "0.49...
0.6066631
0
Resets the rect before removing this sprite from all groups.
def kill(self): self.input_comp = None self._physics_comp = None self._graphics_comp = None self.image = None self.rect = None self.velocity = None super().kill()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def empty(self):\n if self.sprite: self.sprite._focus_exit()\n pygame.sprite.GroupSingle.empty(self)", "def reset(self):\n if self.num == 1:\n self.rect.centerx = 320\n elif self.num == 2:\n self.rect.centerx = 341\n elif self.num == 3:\n self.r...
[ "0.7026424", "0.649405", "0.63407826", "0.63016206", "0.62387794", "0.6208346", "0.6130328", "0.6112039", "0.60716164", "0.6062417", "0.60289025", "0.59968877", "0.59947747", "0.5991652", "0.59855855", "0.59000486", "0.5888754", "0.58795226", "0.5861623", "0.5858321", "0.5828...
0.0
-1
Updates this sprite (for the current frame).
def update(self, world): self.input_comp.update(self) self._physics_comp.update(self, world) self._graphics_comp.update(self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self) -> None:\n self.all_sprites.update()", "def update(self):\n self.moving_sprites.update() \n self.static_sprites.update()\n self.camera.update(self.player)", "def update(self):\n Enemy.update(self)\n self.update_movement()\n self.update_firing()\...
[ "0.7558172", "0.75376505", "0.7398363", "0.7222407", "0.71786684", "0.71690995", "0.71105015", "0.7090216", "0.7032091", "0.69928426", "0.69489574", "0.69021994", "0.68737996", "0.68682253", "0.68666464", "0.68642175", "0.6851232", "0.6833226", "0.6828903", "0.681811", "0.681...
0.0
-1
Matrix equivalent to right multiplication of quaternion. Quaternion in form [s, v1, v2, v3]
def quatRightMat(q): s = q[0] v = q[1:].reshape(-1,) R = np.zeros((4, 4)) R[0, 0] = s R[0, 1:] = -v R[1:, 0] = v R[1:, 1:] = s*np.eye(3) - skewMat(v) return R
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def quaternion_matrix(quaternion):\r\n q = numpy.array(quaternion, dtype=numpy.float64, copy=True)\r\n n = numpy.dot(q, q)\r\n if n < _EPS:\r\n return numpy.identity(4)\r\n q *= math.sqrt(2.0 / n)\r\n q = numpy.outer(q, q)\r\n return numpy.array([\r\n [1.0-q[2, 2]-q[3, 3], q[1, ...
[ "0.7681871", "0.76786864", "0.73890185", "0.732062", "0.727025", "0.72543293", "0.71807706", "0.7146851", "0.70719206", "0.7057396", "0.70505697", "0.70043933", "0.697597", "0.69444937", "0.6940276", "0.69352686", "0.6926811", "0.6913615", "0.6908075", "0.6907213", "0.6894952...
0.7554758
2
Matrix equivalent to left multiplication of quaternion. Quaternion in form [s, v1, v2, v3].T
def quatLeftMat(q): s = q[0] v = q[1:].reshape(-1,) L = np.zeros((4, 4)) L[0, 0] = s L[0, 1:] = -v L[1:, 0] = v L[1:, 1:] = s*np.eye(3) + skewMat(v) return L
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def quaternion_matrix(quaternion):\r\n q = numpy.array(quaternion, dtype=numpy.float64, copy=True)\r\n n = numpy.dot(q, q)\r\n if n < _EPS:\r\n return numpy.identity(4)\r\n q *= math.sqrt(2.0 / n)\r\n q = numpy.outer(q, q)\r\n return numpy.array([\r\n [1.0-q[2, 2]-q[3, 3], q[1, ...
[ "0.7553149", "0.75413686", "0.7275064", "0.7197161", "0.71887857", "0.7173799", "0.7157495", "0.7125688", "0.71182704", "0.7056507", "0.6861853", "0.68544185", "0.6842808", "0.6835585", "0.68055147", "0.68030894", "0.68026626", "0.67994803", "0.67944103", "0.67821795", "0.673...
0.7463609
2
Rotates a vector, v by a quaternion, q
def quatActiveRot(q, v): v_q = np.zeros((4, 1)) v_q[1:] = v v_qnew = quatLeftMat(q) @ quatRightMat(q).T @ v_q return v_qnew[1:]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def qrot(q, v):\n assert q.shape[-1] == 4\n assert v.shape[-1] == 3\n assert q.shape[:-1] == v.shape[:-1]\n\n qvec = q[..., 1:]\n uv = torch.cross(qvec.double(), v.double(), dim=len(q.shape) - 1)\n uuv = torch.cross(qvec.double(), uv.double(), dim=len(q.shape) - 1)\n return v + 2 * (q[..., :1]...
[ "0.83781636", "0.812913", "0.81218445", "0.8097214", "0.7900004", "0.77614945", "0.7343316", "0.7343316", "0.7232044", "0.72166616", "0.700715", "0.700216", "0.68774503", "0.6847234", "0.68316996", "0.677138", "0.6766945", "0.6756622", "0.67426705", "0.6660385", "0.66546357",...
0.79928476
4
Transforms a vector, v into a different frame with the transformation represented as a quaternion
def quatPassiveRot(q, v): v_q = np.zeros((4, 1)) v_q[1:] = v v_qnew = quatLeftMat(q).T @ quatRightMat(q) @ v_q return v_qnew[1:]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def quatActiveRot(q, v):\n\tv_q = np.zeros((4, 1))\n\tv_q[1:] = v\n\tv_qnew = quatLeftMat(q) @ quatRightMat(q).T @ v_q\n\treturn v_qnew[1:]", "def qrot(q, v):\n assert q.shape[-1] == 4\n assert v.shape[-1] == 3\n assert q.shape[:-1] == v.shape[:-1]\n\n qvec = q[..., 1:]\n uv = torch.cross(qvec.dou...
[ "0.74617785", "0.737833", "0.7371231", "0.7002721", "0.6993505", "0.698818", "0.67339283", "0.6691262", "0.6470421", "0.64028096", "0.6344371", "0.62991285", "0.6294629", "0.62905675", "0.61926275", "0.6156036", "0.61080223", "0.6072867", "0.6021131", "0.6021041", "0.60159594...
0.77789176
0
Return config path inside supervisor.
def path_config(self): return HOMEASSISTANT_CONFIG.format(HASSIO_SHARE_INT)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def configPath(self):\n return os.path.dirname(__file__)", "def get_instance_config_path():\n return join(settings.PROJECT_DIR, \"conf\", \"eoxserver.conf\")", "def get_config_path(config):\n section = config.sections()[0]\n return Path(config.get(section, \"path\")).expanduser().absolute()", ...
[ "0.73482144", "0.71827084", "0.7102637", "0.7015559", "0.70092297", "0.6979841", "0.69114286", "0.69023687", "0.68887746", "0.681355", "0.6752051", "0.67507976", "0.673824", "0.67243755", "0.6689632", "0.6686329", "0.6685923", "0.66779625", "0.6664221", "0.6628404", "0.662286...
0.659312
22
returns color of house
def get_color(self): return self._color
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_color(self):\n return self.color", "def color(self):\n return self['color']", "def color(self):\n if self._simplecell:\n self.fetch()\n return self._color", "def color(self):\n return self.container['color']", "def _get_color(self):\n return self.__c...
[ "0.7206233", "0.71860087", "0.715351", "0.7150324", "0.7123317", "0.7123317", "0.7123317", "0.7123317", "0.7073274", "0.70468754", "0.7046503", "0.7046313", "0.7033729", "0.70311576", "0.6992252", "0.6959284", "0.69489664", "0.6942672", "0.69395864", "0.6936185", "0.69106907"...
0.7022935
14
Round number up to next power of 10
def round_to_ten(number): count = len(str(int(number))) if number == 1: count = 0 elif number % 10 == 0: count = count - 1 return 10 ** count
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _pow_10_round(n, up=True):\n if up:\n return 10 ** math.ceil(math.log(n, 10))\n else:\n return 10 ** math.floor(math.log(n, 10))", "def nextpow10(n):\n\t\tif n == 0:\n\t\t\treturn 0\n\t\telse:\n\t\t\treturn math.ceil(math.log10(abs(n)))", "def _round_bits(n: int, radix_bits: int) -> int...
[ "0.7961042", "0.7896611", "0.7430123", "0.70755994", "0.6983163", "0.69577986", "0.6944983", "0.68983483", "0.688475", "0.68542624", "0.67367345", "0.6694048", "0.6689389", "0.6640507", "0.663728", "0.6628653", "0.6624858", "0.66201836", "0.6618172", "0.6583415", "0.65409887"...
0.7337411
3
Sets the name of the carrier for the current request lifecycle.
def set_carrier(name): _local.carrier = name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def carrier_name(self) -> str:\n return pulumi.get(self, \"carrier_name\")", "def register(self, carrier):\n self.carriers[carrier.name] = carrier()", "def get_created_carrier_name(self):\n return self.carrier_page.get_created_carrier_name()", "def current_carrier_network(self, current_c...
[ "0.74088484", "0.63650316", "0.6355849", "0.5974812", "0.5895125", "0.57192826", "0.5702686", "0.56130254", "0.55906194", "0.55515623", "0.5463671", "0.5409844", "0.5283206", "0.5283206", "0.52701265", "0.52701265", "0.52701265", "0.52701265", "0.52669305", "0.524288", "0.523...
0.7681195
0
This function returns an array of length a with the indices of array b that are closest to the values of array a.
def find_closest(a, b): a = np.atleast_1d(np.array(a)) b = np.atleast_1d(np.array(b)) out = [np.argmin(abs(b - a1)) for a1 in a] return out
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def closest_vals(arr1, arr2):\n arr1 = np.array(arr1).T\n arr1 = arr1[:, np.newaxis]\n arr2 = np.array(arr2).T\n\n return np.argmin(abs(arr2 - arr1), axis=1)", "def find_nearest(a, a0):\n idx = numpy.abs(a - a0).argmin()\n return a.flat[idx]", "def find_nearest(a, a0):\n idx = np.abs(a - a...
[ "0.7431907", "0.7145059", "0.7140231", "0.7072252", "0.6898944", "0.68932545", "0.6853787", "0.67495334", "0.6745704", "0.6686743", "0.66259295", "0.6621587", "0.657452", "0.6573349", "0.6497837", "0.6479958", "0.64772797", "0.64554095", "0.645303", "0.6403311", "0.63855433",...
0.83729213
0
Quarantine the supplied bundle using the supplied reason.
async def _quarantine_bundle(self, lta_rc: RestClient, bundle: BundleType, reason: str) -> None: self.logger.error(f'Sending Bundle {bundle["uuid"]} to quarantine: {reason}.') right_now = now() pat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def test_deleter_quarantine_bundle_with_reason(config, mocker):\n logger_mock = mocker.MagicMock()\n lta_rc_mock = mocker.patch(\"rest_tools.client.RestClient\", new_callable=AsyncMock)\n p = Deleter(config, logger_mock)\n await p._quarantine_bundle(lta_rc_mock, {\"uuid\": \"c4b345e4-2395-4f9e-b0...
[ "0.618683", "0.57495564", "0.5700352", "0.56786245", "0.5588792", "0.55714357", "0.5551414", "0.55073553", "0.5387978", "0.5371958", "0.53666514", "0.5344349", "0.5338192", "0.5324552", "0.53136617", "0.52858984", "0.52552575", "0.5249711", "0.52332675", "0.5193098", "0.51830...
0.80517364
0
Takes a DOI string and returns a JSON string of metadata.
def doi2json(doi): if "arxiv" in doi: print("This script does not yet support arXiv.") sys.exit(2) else: url = "https://dx.doi.org/" + doi headers = {"accept": "application/json"} r = requests.get(url, headers = headers) if repr(r)=="<Response [200]>": #success! #handle potential enc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_doi_metadata(identifier_doi) -> Dict:\n\n record_metadata = None\n record = search_record_by_doi(identifier_doi)\n\n if record:\n record_metadata = _metadata_builder(record[0], scheme=\"doi\")\n record_metadata[\"url\"] = f\"/records/{record[0]['id']}\"\n\n return record_metadata...
[ "0.658324", "0.6186826", "0.60670644", "0.5869886", "0.5681247", "0.55712116", "0.53361624", "0.52934235", "0.5220034", "0.51885957", "0.5179392", "0.51644266", "0.51488006", "0.5144595", "0.5139534", "0.510246", "0.5086857", "0.5024589", "0.50141627", "0.49613795", "0.494524...
0.7098311
0
Get absolute path to resource, works for dev and for PyInstaller
def resource_path(relative_path): try: base_path = sys._MEIPASS except Exception: base_path = os.path.abspath(".") return os.path.join(base_path, relative_path)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_resource_path():\n return os.path.join(os.path.dirname(__file__), \"resources\") + os.path.sep", "def resourcePath(relative):\r\n try:\r\n # PyInstaller creates a temp folder and stores path in _MEIPASS\r\n base_path = sys._MEIPASS\r\n except Exception:\r\n base_path = os.pa...
[ "0.8370207", "0.8280719", "0.8248514", "0.81387657", "0.8113593", "0.8098866", "0.80943495", "0.80799586", "0.8067939", "0.8067573", "0.8062756", "0.8062756", "0.8062756", "0.8062756", "0.8062756", "0.8062756", "0.8062756", "0.8056859", "0.80546963", "0.80450433", "0.80450433...
0.7874609
43
Go to home page
def go_home(self): if self.home_url is not None: self.set_url(self.home_url)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def home(self):\n self.goto(0, 0)", "def go_home(request):\n\n url = request.route_url('home', _app_url=get_app_url(request))\n return HTTPFound(location=url)", "def start_page():\n if not _home:\n abort(404)\n return redirect(_home)", "def start_page():\n if not _home:\n ...
[ "0.8030926", "0.8010641", "0.78565353", "0.78565353", "0.7842787", "0.7819811", "0.7761241", "0.77168256", "0.7710422", "0.7658114", "0.75707996", "0.75160396", "0.7515307", "0.7425273", "0.74167955", "0.74005103", "0.7379817", "0.7340132", "0.7321713", "0.7319783", "0.729707...
0.82052684
0
Create a com.sun.star.awt.Point struct.
def makePoint( nX, nY ): oPoint = createUnoStruct( "com.sun.star.awt.Point" ) oPoint.X = nX oPoint.Y = nY return oPoint
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_point(x_crd, y_crd):\n\n Point = namedtuple(\"Point\", \"x_crd y_crd\")\n return Point(x_crd, y_crd)", "def point(self):\n return collections.namedtuple(self.name, [self.x, self.y, self.units])", "def getPoint(self):\n return Point(*self.position)", "def pos_as_point(self) -> P...
[ "0.7243411", "0.67983496", "0.65620244", "0.65571135", "0.65474313", "0.64679706", "0.6424313", "0.6340852", "0.62910265", "0.6268829", "0.62510884", "0.62171054", "0.6176435", "0.61754274", "0.5987973", "0.59807426", "0.59644204", "0.5933073", "0.5927502", "0.59074783", "0.5...
0.8447396
1
Create a com.sun.star.awt.Rectangle struct.
def makeRectangle( nX, nY, nWidth, nHeight ): oRect = createUnoStruct( "com.sun.star.awt.Rectangle" ) oRect.X = nX oRect.Y = nY oRect.Width = nWidth oRect.Height = nHeight return oRect
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rectangle(xcenter, ycenter, width, height):\n x1, x2 = xcenter - width, xcenter + width\n y1, y2 = ycenter - height, ycenter + height\n return Shape([Point(x1, y1), Point(x1, y2), Point(x2, y2), Point(x2, y1)])", "def create_rectangle(width, height, color):\n data = [-width / 2, -height / 2,\n ...
[ "0.6828258", "0.67447984", "0.661885", "0.6615916", "0.6569584", "0.6505301", "0.64754283", "0.645183", "0.645183", "0.64407796", "0.64276874", "0.6411871", "0.64014655", "0.6366434", "0.6291482", "0.6219487", "0.62064403", "0.62053233", "0.6200718", "0.6198248", "0.6196827",...
0.8646927
1
Encodes a signed 32 bit integer.
def encode_i32(value: int) -> bytes: return int_to_le_bytes(value, NUMERIC_CONSTRAINTS[CLTypeKey.I32].LENGTH, True)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def encode32(x):\n while x < 0:\n x = x + 2**32 # Convert 2's complement negative numbers to unsigned\n assert((x >> 32) == 0) # Must be a 32bit quantity\n x = pack(x, 32, 'little', False) # Convert to little endian\n\n s = \"\"\n for b in x:\n s += '{:02x}'.format(b) # Convert l...
[ "0.732017", "0.7107245", "0.6937749", "0.6710767", "0.66709656", "0.6641764", "0.66244256", "0.65855706", "0.65325177", "0.65193176", "0.65188384", "0.6450076", "0.6440046", "0.63887787", "0.63869387", "0.6374578", "0.61871505", "0.6183587", "0.61385906", "0.61082375", "0.610...
0.7206746
1
Encodes a signed 64 bit integer.
def encode_i64(value: int) -> bytes: return int_to_le_bytes(value, NUMERIC_CONSTRAINTS[CLTypeKey.I64].LENGTH, True)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def encode_u64(value: int) -> bytes:\n return int_to_le_bytes(value, NUMERIC_CONSTRAINTS[CLTypeKey.U64].LENGTH, False)", "def EncryptInt64(self, plaintext, r_value=None):\n if not isinstance(plaintext, int) and not isinstance(plaintext, long):\n raise ValueError('Expected int or long plaintext but got...
[ "0.71692836", "0.686562", "0.67323595", "0.6639236", "0.6529915", "0.6529915", "0.6500912", "0.6465857", "0.63426864", "0.62962234", "0.62952036", "0.62636083", "0.619505", "0.6107646", "0.6053847", "0.60516316", "0.6014983", "0.6005445", "0.5932173", "0.5821946", "0.580687",...
0.73616225
0
Encodes an unsigned 8 bit integer.
def encode_u8(value: int) -> bytes: return int_to_le_bytes(value, NUMERIC_CONSTRAINTS[CLTypeKey.U8].LENGTH, False)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Write_uInt8(self,Address,Register,uInt8):\n self.Transaction(chr(Address)+chr(Register)+struct.pack('B',uInt8))", "def write_uint8(self,value):\n packed = struct.pack('!B',value)\n self.data.extend(packed)", "def u8(value: bytes, endian: str = \"little\", sign: bool = False) -> int:\n ...
[ "0.7187489", "0.70266473", "0.6738288", "0.65686345", "0.6503062", "0.6400726", "0.6365142", "0.6359848", "0.6356634", "0.6325308", "0.6324641", "0.6312194", "0.62764937", "0.6194898", "0.60572857", "0.60183847", "0.59737056", "0.59461296", "0.59255874", "0.59180444", "0.5902...
0.75584686
0
Encodes an unsigned 32 bit integer.
def encode_u32(value: int) -> bytes: return int_to_le_bytes(value, NUMERIC_CONSTRAINTS[CLTypeKey.U32].LENGTH, False)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def encode32(x):\n while x < 0:\n x = x + 2**32 # Convert 2's complement negative numbers to unsigned\n assert((x >> 32) == 0) # Must be a 32bit quantity\n x = pack(x, 32, 'little', False) # Convert to little endian\n\n s = \"\"\n for b in x:\n s += '{:02x}'.format(b) # Convert l...
[ "0.72886485", "0.725134", "0.7215473", "0.71979535", "0.7137827", "0.7022656", "0.6956605", "0.69430447", "0.691968", "0.6665251", "0.6593908", "0.6573443", "0.65679795", "0.6546468", "0.6501861", "0.64995223", "0.6489284", "0.63497615", "0.6335349", "0.6288146", "0.62744594"...
0.764139
0
Encodes an unsigned 64 bit integer.
def encode_u64(value: int) -> bytes: return int_to_le_bytes(value, NUMERIC_CONSTRAINTS[CLTypeKey.U64].LENGTH, False)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def encode_i64(value: int) -> bytes:\n return int_to_le_bytes(value, NUMERIC_CONSTRAINTS[CLTypeKey.I64].LENGTH, True)", "def pack_ssh_uint64(i):\n if not isinstance(i, int):\n raise TypeError(\"Must be an int\")\n elif i.bit_length() > 64:\n raise ValueError(\"Must be a 64bit value.\")\n\n...
[ "0.7195093", "0.71726847", "0.7013398", "0.7013398", "0.67956394", "0.6587401", "0.65525234", "0.65354306", "0.6412215", "0.63429224", "0.6282969", "0.62307477", "0.62105554", "0.6060791", "0.60438156", "0.60275346", "0.60194147", "0.59864676", "0.594548", "0.5938131", "0.591...
0.7753789
0
Encodes an unsigned 256 bit integer.
def encode_u256(value: int) -> bytes: for type_key in (CLTypeKey.U8, CLTypeKey.U32, CLTypeKey.U64, CLTypeKey.U128, CLTypeKey.U256): if is_within_range(type_key, value): break else: raise ValueError("Invalid U256: max size exceeded") as_bytes = int_to_le_bytes_trimmed(value, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def encode_int(v):\n if v < 240:\n return chr(v)\n elif v <= 2287:\n v -= 240\n d, m = divmod(v, 256)\n return chr(241 + d) + chr(m)\n elif v <= 67823:\n v -= 2288\n d, m = divmod(v, 256)\n return '\\xf9' + chr(d) + chr(m)\n elif v <= 16777215:\n ...
[ "0.64157325", "0.6330101", "0.6202689", "0.6161866", "0.614205", "0.61340094", "0.6094049", "0.5977668", "0.5955054", "0.5948855", "0.5923433", "0.58729017", "0.58054245", "0.57921547", "0.57809037", "0.5763508", "0.5760439", "0.5753819", "0.57178915", "0.5659287", "0.5655602...
0.68769276
0
Encodes an unsigned 512 bit integer.
def encode_u512(value: int): for type_key in (CLTypeKey.U8, CLTypeKey.U32, CLTypeKey.U64, CLTypeKey.U128, CLTypeKey.U256, CLTypeKey.U512): if is_within_range(type_key, value): break else: raise ValueError("Invalid U512: max size exceeded") as_bytes = int_to_le_bytes_trimmed(valu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pack(cls, le_unsigned_int, size):\n output = bytes()\n for i in range(size):\n output += chr((le_unsigned_int >> (i*8)) & 0xFF)\n return output", "def encode(x):\n i = int(16384 * x)\n return Struct('h').pack(i)", "def encode(x):\n i = int(16384 * x)\n return Str...
[ "0.5873435", "0.58695847", "0.5858977", "0.5855968", "0.5822624", "0.57660556", "0.57323843", "0.57323843", "0.571813", "0.5700974", "0.56993073", "0.55935234", "0.55502033", "0.55311394", "0.55279845", "0.5521459", "0.55198777", "0.55005956", "0.5469042", "0.54624766", "0.54...
0.7516844
0
Computes the defect probability for every child
def compute_defect_probability(self): self.defect_prob = self.defect_probability() for file_analytics in self.files_analytics.values(): file_analytics.compute_defect_probability()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def caculate_prob(self):\n t_H = self.tree.depth()\n t_h = 1\n while(t_h <= t_H):\n t_hnodes = self.get_h(t_h)\n t_sum = 0\n t_hpro = []\n t_cpro = []\n for t_n in t_hnodes:\n t_sum = self.tree.get_node(t_n).data[0] + t_sum\...
[ "0.6381905", "0.6177454", "0.6074082", "0.6028286", "0.59427", "0.5935064", "0.59331375", "0.5873684", "0.5782974", "0.577143", "0.5706628", "0.5704525", "0.5687962", "0.56712", "0.56625974", "0.5659836", "0.5653012", "0.56150997", "0.5595295", "0.55919814", "0.5586295", "0...
0.65876067
0
Create an interactive Plotly scatter plot with user defined x and y parameters as well as an optional third parameter used for point color gradient.
def plotly_scatter(dataset: pd.DataFrame, x_selection: str, y_selection: str, color_selection: str, hover: [str] = None) -> go.Figure: title = f"Scatter Analysis: {x_selection} vs. {y_selection}" if color_selection == '<select>': ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scatterplot(self, x = \"Predictor\", y = \"Response\", color = None, jitter = False, jitter_sd = .1,\n marg_x = None, marg_y = None, trendline = None, opacity = 1, template = \"ggplot2\",\n has_title = True, title = None):\n x_clean, df_clean = clean_varname(self._df, var =...
[ "0.71018946", "0.70734847", "0.67792296", "0.66735274", "0.65962356", "0.6593396", "0.6564824", "0.6528923", "0.6509285", "0.6447772", "0.6412132", "0.64114225", "0.6386084", "0.636491", "0.632595", "0.6322293", "0.63079953", "0.6305342", "0.63046676", "0.62630695", "0.625060...
0.69105273
2
Determine if this is the vert in an open edge that should not have a post
def vert_is_open(v, front, left, right, prop): if prop.open_side == "LEFT": if v in left.verts and v not in front.verts: return True elif prop.open_side == "RIGHT": if v in right.verts and v not in front.verts: return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_edge(self, v, w):\n return self.op_norm(v[0], w[0]) == (v[1] + w[1]) and (self.variant.is_bipartite() or v != w)", "def is_closed(self):\n # In Open Cascade, unlinked (open) edges can be identified\n # as they appear in the edges iterator when ignore_orientation=False\n # but a...
[ "0.6577792", "0.65098494", "0.6507211", "0.64180267", "0.6417849", "0.6377712", "0.63526595", "0.6351077", "0.63391054", "0.62962776", "0.62881887", "0.625048", "0.6244916", "0.62438977", "0.6213483", "0.61897594", "0.6179836", "0.61250985", "0.6122007", "0.6101966", "0.60872...
0.71227276
0
Obtain string representation of the Interface Status object.
def __str__(self): sb = '' sb += '\nInterfaceStatus [ ' + self.interface_name + ' ]\n' sb += '\tLinkState : ' + str(self.InterfaceState.enumval(self.link)) + '\n' sb += '\tLineProtoState : ' + str(self.InterfaceState.enumval(self.lineproto)) + '\n' return sb
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n struct_repr = \", \".join([\n \"was_available_once: \" + str(self.was_available_once),\n \"is_available: \" + str(self.is_available),\n \"signal_strength_percent: \" + str(self.signal_strength_percent)\n ])\n\n return f\...
[ "0.753813", "0.75120044", "0.74452037", "0.7416838", "0.7120765", "0.7041113", "0.70339936", "0.6861584", "0.68476593", "0.68476593", "0.68476593", "0.68324053", "0.6831681", "0.68259335", "0.6778136", "0.6778136", "0.6778136", "0.6778136", "0.6778136", "0.6778136", "0.677813...
0.8487201
0
Get a coordinate box from a map.
def bounding_box_from_map(map_car): shape, wcs = map_car.data.geometry return enmap.box(shape, wcs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_box_from_xml(bounds):\n return bounds['@maxlat'], bounds['@minlat'], bounds['@maxlon'], bounds['@minlon'],", "def get_grid_box(self, lon, lat):\n lon_1d = self.lon_arr[1,:]\n lat_1d = self.lat_arr[:,1]\n box_number_x = self._ret_box_position(lon_1d, lon)\n box_number_y = se...
[ "0.6343539", "0.62984586", "0.6088024", "0.5940011", "0.58484155", "0.5809148", "0.574483", "0.57401186", "0.57032806", "0.56887144", "0.5670047", "0.56506366", "0.5638249", "0.55707836", "0.5557778", "0.55481535", "0.5539294", "0.5528144", "0.55278516", "0.5517178", "0.55063...
0.7182905
0
Compute the perclass IoU and the mean IoU.
def iou(self): if self.confusion_matrix is None: return None ious = [] for label in range(self.num_classes): tp = np.longlong(self.confusion_matrix[label, label]) fn = np.longlong(self.confusion_matrix[label, :].sum()) - tp fp = np.longlong(self.c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def avg_iou(self):\n return np.mean(self.ious_[np.arange(len(self.labels_)), self.labels_])", "def stats_iou_per_class(cm, ignore_missing_classes=True):\n\n sums = (np.sum(cm, axis=1) + np.sum(cm, axis=0) - np.diag(cm))\n mask = (sums>0)\n sums[sums==0] = 1\n iou_per_class = np.diag(cm) / sum...
[ "0.7603079", "0.7418562", "0.7163718", "0.6903225", "0.6849643", "0.68161976", "0.6811373", "0.6756634", "0.670836", "0.6554818", "0.646996", "0.6349385", "0.6348182", "0.62550694", "0.62355584", "0.62218934", "0.62197864", "0.6167413", "0.6165298", "0.6143924", "0.6027999", ...
0.69215584
3
Min, value, and max for this range.
def __init__(self, mn, val, mx): self.mn = mn self.val = val self.mx = mx
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, min_val, max_val):\n self.values = (min_val, max_val)", "def __init__(self, min_val, max_val):\n self.values = (min_val, max_val)", "def __init__(self, min_val, max_val):\n self.values = (min_val, max_val)", "def __init__(self, min_val, max_val):\n self.values =...
[ "0.7486986", "0.7486986", "0.7486986", "0.7486986", "0.74503446", "0.73091775", "0.70252573", "0.70252573", "0.7022158", "0.6962953", "0.6898031", "0.6889545", "0.68634725", "0.6799793", "0.67597604", "0.6736738", "0.6731614", "0.6711583", "0.66995513", "0.66940516", "0.66809...
0.0
-1
method to serialise datetime obj
def serialize_obj(obj: Any) -> Any: if isinstance(obj, (datetime.date, datetime.datetime)): return obj.isoformat() else: return obj
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def serialize_datetime(self, obj):\r\n if isinstance(obj, datetime.datetime):\r\n return obj.isoformat()\r\n raise TypeError(\"Type not serializable\")", "def json_serialize_datetime(self, obj):\n if isinstance(obj, datetime.datetime):\n return int(time.mktime(obj.timet...
[ "0.8295255", "0.8106972", "0.80206555", "0.7735369", "0.7582689", "0.75627756", "0.7502528", "0.74950355", "0.74590653", "0.74358654", "0.7422188", "0.73993206", "0.73993206", "0.73969173", "0.7375495", "0.73338103", "0.72889334", "0.7284664", "0.72399163", "0.720197", "0.719...
0.67792463
44
method to serialise datetime in dict
def serialize_dict(container: Dict) -> Dict: for key, value in container.items(): container[key] = serialize_obj(value) return container
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_json(self):\n new_dict = self.__dict__.copy()\n new_dict.update({'__class__': str(self.__class__.__name__)})\n for key, value in new_dict.items():\n if isinstance(value, datetime):\n new_dict[key] = value.strftime(self.timeformat)\n return new_dict", "...
[ "0.7173971", "0.7112734", "0.701276", "0.700265", "0.69404316", "0.69391525", "0.68854564", "0.68477345", "0.6845062", "0.68033975", "0.67881083", "0.6756919", "0.67133623", "0.6696824", "0.6695848", "0.6661993", "0.6586551", "0.6556468", "0.65349954", "0.65317947", "0.651191...
0.0
-1