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
Draw a line of a specified color to the buffer.
def draw_line(self, pt0, pt1, color): steep = False if abs(pt0[0]-pt1[0]) < abs(pt0[1]-pt1[1]): pt0[0], pt0[1] = pt0[1], pt0[0] pt1[0], pt1[1] = pt1[1], pt1[0] steep = True if pt0[0] > pt1[0]: pt0[0], pt1[0] = pt1[0], pt0[0] pt0[1], pt...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_line(color, start_pos, end_pos, width=1):\n pygame.draw.line(screen, color, start_pos, end_pos, width)", "def draw_line(self, point1, point2, line_width, line_color):\n line_color = check_color(line_color)\n STline.line(self.canvas, (point1, point2), line_width, line_color)", "def...
[ "0.7856051", "0.7085538", "0.7035353", "0.6967236", "0.6955049", "0.69308156", "0.6860886", "0.6836578", "0.68173677", "0.68133026", "0.6802772", "0.6789399", "0.6752608", "0.6746949", "0.6724124", "0.6590171", "0.6550718", "0.6529918", "0.6527603", "0.6503456", "0.64781106",...
0.65699226
16
Convert a string from CamelCase to snake_case.
def parse_case_camel_to_snake(camel): # requirements = re return re.sub('((?<=[a-z0-9])[A-Z]|(?!^)[A-Z](?=[a-z]))', r'_\1', camel).lower()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_snake_case(str):\n s1 = re.sub('(.)([A-Z][a-z]+)', r'\\1_\\2', str)\n s2 = re.sub('-', '_', s1)\n return re.sub('([a-z0-9])([A-Z])', r'\\1_\\2', s2).lower()", "def convert_to_snake_case(camel_case_string):\n s1 = re.sub('(.)([A-Z][a-z]+)', r'\\1_\\2', camel_case_string)\n s2 = re.su...
[ "0.8274245", "0.8262749", "0.8261688", "0.8215879", "0.8154332", "0.8059317", "0.7972546", "0.79585224", "0.7878156", "0.7826248", "0.77483594", "0.7737882", "0.7732599", "0.7685381", "0.7680826", "0.76576835", "0.76340514", "0.7619145", "0.7574448", "0.7569673", "0.7550979",...
0.7988082
6
Convert a string from snake_case to CamelCase.
def parse_case_snake_to_camel(snake, upper_first=True): snake = snake.split('_') first_part = snake[0] if upper_first: first_part = first_part.title() return first_part + ''.join(word.title() for word in snake[1:])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def snake_to_camel_case(snake_str: str) -> str:\n\n words = snake_str.strip(\"_\").split(\"_\")\n return words[0] + \"\".join(word[:1].upper() + word[1:] for word in words[1:])", "def snake_to_camel_case(string: str):\n return ''.join(string_component.title() for string_component in string.split('_'...
[ "0.86246634", "0.83741486", "0.8289731", "0.8143544", "0.81357396", "0.80857646", "0.8007097", "0.79348457", "0.7823642", "0.77712065", "0.7767378", "0.7764126", "0.77620256", "0.77437127", "0.76985806", "0.76731175", "0.7655576", "0.7531545", "0.7531545", "0.7526505", "0.749...
0.7848616
8
Convert a string timespan definition to seconds, for example converting '1m30s' to 90. If timedef is already an int, the value will be returned unmodified.
def parse_timespan(timedef): if isinstance(timedef, int): return timedef converter_order = ('w', 'd', 'h', 'm', 's') converters = { 'w': 604800, 'd': 86400, 'h': 3600, 'm': 60, 's': 1 } timedef = timedef.lower() if timedef.isdigit(): return int(timedef) elif len(timedef) == 0: return 0 seconds =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def str_to_seconds(tstring):\n if tstring.endswith('m'):\n secs = 60 * int(tstring.replace('m', ''))\n elif tstring.endswith('h'):\n secs = 60 * 60 * int(tstring.replace('h', ''))\n elif tstring.endswith('d'):\n secs = 24 * 60 * 60 * int(tstring.replace('d', ''))\n elif tstring.end...
[ "0.661844", "0.6596993", "0.64785796", "0.62308425", "0.61873764", "0.61799085", "0.61782384", "0.6168959", "0.6117218", "0.60825104", "0.60699874", "0.60465664", "0.60432637", "0.6032382", "0.6032382", "0.6024347", "0.59915835", "0.5989029", "0.59780324", "0.5857638", "0.582...
0.8204206
0
Generate a random string of size length consisting of mixed case letters and numbers. This function is not meant for cryptographic purposes.
def random_string_alphanumeric(size): # requirements = random, string return ''.join(random.choice(string.ascii_letters + string.digits) for x in range(size))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _rand_str(size=16):\n return \"\".join(random.SystemRandom().choices(string.ascii_lowercase, k=size))", "def random_string(length=25):\n return ''.join(random.choice(string.ascii_letters) for i in range(25))", "def random_str(length=8, letters=string.ascii_letters + string.digits):\r\n return \"\"...
[ "0.83059156", "0.8127696", "0.8112817", "0.81016755", "0.80542344", "0.8051191", "0.8049026", "0.8022436", "0.8022372", "0.8020393", "0.8013599", "0.79988366", "0.799749", "0.79864305", "0.7985201", "0.7980375", "0.79667085", "0.7959023", "0.79474497", "0.79383326", "0.792966...
0.8381686
0
Generate a random string of size length consisting of lowercase letters and numbers. This function is not meant for cryptographic purposes.
def random_string_lower_numeric(size): # requirements = random, string return ''.join(random.choice(string.ascii_lowercase + string.digits) for x in range(size))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _rand_str(size=16):\n return \"\".join(random.SystemRandom().choices(string.ascii_lowercase, k=size))", "def random_string_alphanumeric(size):\n\t# requirements = random, string\n\treturn ''.join(random.choice(string.ascii_letters + string.digits) for x in range(size))", "def random_string(length=1, upp...
[ "0.8234897", "0.8215414", "0.80826694", "0.79948", "0.79917085", "0.795191", "0.79310286", "0.79141015", "0.78891426", "0.78398776", "0.7821437", "0.7809333", "0.78037405", "0.78032714", "0.7795994", "0.7790688", "0.7778142", "0.7766082", "0.77655256", "0.77626395", "0.776003...
0.83950144
0
Unescape a string which uses backslashes to escape single quotes.
def unescape_single_quote(escaped): escaped = escaped.replace('\\\\', '\\') escaped = escaped.replace('\\\'', '\'') return escaped
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _unquote(s, encoding='utf-8'):\n return urllib.unquote(s).decode(encoding)", "def _Unquote(s):\n if not hasattr(s, 'strip'):\n return s\n # Repeated to handle both \"'foo'\" and '\"foo\"'\n return s.strip(\"\\\"'\")", "def _Unquote(s):\n if not hasattr(s, 'strip'):\n return s\n # Repeated to ...
[ "0.7666476", "0.75588465", "0.74770653", "0.74721175", "0.72262454", "0.7162784", "0.70051026", "0.6963691", "0.6960679", "0.69293374", "0.69101226", "0.68697846", "0.6863432", "0.6786456", "0.6667868", "0.6588384", "0.65671295", "0.6556592", "0.6544375", "0.6530809", "0.6525...
0.8027732
0
Filters a dataframe to create a json for visualisation. This function loads in a dataframe and open a json file. It takes the last entry from the json list and searches all the entries in a column this column is specified by the length of the json list. With these ids it creates a new dataframe with only the data of th...
def receive_json_ids(dataframe, jsondata, just_headers = False): dict_data = ast.literal_eval(jsondata) jsondict = {1: 'Kingdom', 2: 'Phylum', 3: 'Class', 4: 'Order', 5: 'Family', 6: 'Genus', 7: 'Species', 8 : 'Strain'} # this checks how long the jsondata is and from this it selects the correct Letter out ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_df_from_json(json_files, out_file):\n table = [[\"name\", \n \"cik\", \n \"city\",\n \"state\",\n \"street1\",\n \"street2\",\n \"zip_code\",\n \"year_of_incorp\", \n \"min_inv\", \n \"tot_off\",...
[ "0.5956797", "0.5609698", "0.55020446", "0.54574645", "0.54470164", "0.54257125", "0.5330677", "0.5296108", "0.52862954", "0.5263498", "0.52603763", "0.5250862", "0.5246143", "0.52284694", "0.5184295", "0.51831394", "0.518165", "0.51586086", "0.5155978", "0.51553744", "0.5140...
0.72070074
0
Creates the scatterplot for the TSNE manifold
def scatter(x, labels, title): # Pick a color for the different embeddings. colors = len(np.unique(labels)) palette = np.array(sns.color_palette("hls", colors)) # We create a scatter plot. f = plt.figure(figsize=(8, 8)) ax = plt.subplot(aspect='equal') sc = ax.scatter(x[:,0], x[:,1], l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tsne_plot(features: {}, labels: {}):\n # T-SNE computation\n tsne = TSNE(n_components=2, perplexity=40, n_iter=900, random_state=0)\n tsne_result = tsne.fit_transform(features)\n\n # Color specification\n n_labels = len(np.unique(labels[:,0]))\n label_set = np.unique(labels[:,1])\n palette...
[ "0.72057503", "0.7132178", "0.67768025", "0.6736781", "0.6725734", "0.6716488", "0.67094535", "0.6527351", "0.6480331", "0.6459953", "0.6376036", "0.636726", "0.63483053", "0.62898505", "0.6289107", "0.628467", "0.6283769", "0.6270437", "0.62231493", "0.6214353", "0.6178722",...
0.0
-1
Make and configure a copy of the `base_estimator_` attribute.
def _make_estimator(self, append=True, random_state=None): estimator = clone(self.base_estimator_) estimator.set_params(**dict((p, getattr(self, p)) for p in self.estimator_params)) # print estimator.get_params() if random_state is not None: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_estimator(self):\n raise NotImplementedError()", "def _validate_estimator(self, default=DecisionTreeClassifier()):\n if not isinstance(self.n_estimators, (numbers.Integral, np.integer)):\n raise ValueError(\n f\"n_estimators must be an integer, \" f\"got {type(sel...
[ "0.6869325", "0.6501932", "0.6487164", "0.6436401", "0.6214268", "0.61973447", "0.6064689", "0.5992623", "0.5946241", "0.589978", "0.58753", "0.58749306", "0.5782988", "0.57625115", "0.57625115", "0.5751477", "0.57204956", "0.56995547", "0.5597314", "0.5593558", "0.5548333", ...
0.6956835
0
The lower bound of the x domain.
def xlow(self): return self._xlow
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lower_bound(self) -> float:\n ...", "def get_xmin(self):\n return self.__xmin", "def xmin(self):\n return asarray([b[0] for b in self.bounds])", "def getMinX(self):\n return self.minx", "def x_min(self):\n return self.get_min_value(self.X_INDEX)", "def _get_observat...
[ "0.755378", "0.74567384", "0.74098676", "0.7383982", "0.72788846", "0.71961635", "0.7194346", "0.7194346", "0.71797466", "0.7095927", "0.7078646", "0.7032228", "0.6950686", "0.6947169", "0.6940819", "0.6934742", "0.6885356", "0.6872937", "0.6848953", "0.68318367", "0.67915076...
0.70035803
12
The upper bound of the x domain.
def xhigh(self): return self._xhigh
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def upper_bound(self) -> float:\n ...", "def xmax(self):\n return asarray([b[1] for b in self.bounds])", "def domain_bounds(self):\n return self._xmin, self._xmax, self._ymin, self._ymax, self._zmin, self._zmax", "def get_upper_bound(self):\n return self._upper_bound", "def xmax(sel...
[ "0.7560285", "0.7407665", "0.7165652", "0.70841944", "0.70641977", "0.6960108", "0.6901441", "0.6822403", "0.6810636", "0.6791146", "0.67753196", "0.6705533", "0.66854876", "0.6626655", "0.6611438", "0.6607535", "0.6561816", "0.65474766", "0.65267235", "0.6508877", "0.6473561...
0.0
-1
The lower bound of the y domain.
def ylow(self): return self._ylow
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def y_min(self):\n return self.get_min_value(self.Y_INDEX)", "def argminY( self ):\n min = 1e30\n for i in range( 0, self.GetN() ):\n p = ( ROOT.Double(), ROOT.Double() )\n self.GetPoint( i, p[0], p[1] )\n if p[1] < min: min = p[1]\n return min", "def getMinY(self)...
[ "0.7280139", "0.7276417", "0.72226584", "0.7168623", "0.70772773", "0.70644826", "0.70241946", "0.6878043", "0.6878043", "0.6878043", "0.6878043", "0.6878043", "0.6878043", "0.6878043", "0.6878043", "0.6878043", "0.6878043", "0.6878043", "0.6878043", "0.6878043", "0.6878043",...
0.6892845
7
The upper bound of the y domain.
def yhigh(self): return self._yhigh
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getYLimit(self):\n return self.axes.get_ylim()", "def getMaxY(self):\n return self.maxy", "def get_max_y(self) -> float:\n return self.pendulum2.get_max_y()", "def max_y_arg(self):\n return max((self(0).y,0), (self(1).y,1))[1]", "def upper_bound(self) -> float:\n ..."...
[ "0.76149464", "0.739293", "0.7347229", "0.7205525", "0.72054195", "0.70474464", "0.70457596", "0.70355254", "0.7028071", "0.7008995", "0.6927743", "0.6893805", "0.6875597", "0.68409944", "0.68193877", "0.68093294", "0.6805115", "0.67994106", "0.67994106", "0.679863", "0.67843...
0.6526077
58
Creates and saves a user with ``is_superuser`` set to ``True```.
def create_superuser(self, email, password, **extra_fields): return self.create_user(email, password, is_staff=True, is_superuser=True, **extra_fields)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_superuser(self, email, password):\n user = self.create_user(email, password)\n user.is_staff = True\n user.is_superuser = True\n user.save(using=self._db)\n\n return user", "def create_superuser(self, email, password, **extrac_fields):\n\n user = self.create_user(email, password)...
[ "0.81693876", "0.80808634", "0.80598706", "0.80303854", "0.80086094", "0.8005846", "0.7984878", "0.7981301", "0.79732907", "0.7966382", "0.7960046", "0.79431605", "0.7910489", "0.79082066", "0.7885791", "0.7876728", "0.78748", "0.7859453", "0.78576285", "0.7852983", "0.784459...
0.76822585
53
Return input list as diagonal matrix.
def diagM(l): dim = len(l) M = np.zeros((dim, dim)) np.fill_diagonal(M, l) return matrix(M)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def diagmatrixlist(inputlist=None, converter=proper, func=None, fake=True, clean=False):\n if inputlist is None:\n inputlist = []\n if func is None:\n func = diagmatrixlist\n outlist = []\n for item in inputlist:\n if islist(item):\n item = func(item)\n if not cle...
[ "0.7755619", "0.74313694", "0.7182874", "0.7018743", "0.6937086", "0.681921", "0.67138505", "0.66392463", "0.66321486", "0.65091425", "0.64636755", "0.6434628", "0.6423502", "0.62808996", "0.62422687", "0.6228172", "0.6209113", "0.61758906", "0.61608684", "0.6148629", "0.6142...
0.80969495
0
Return matrix with negative values set to zero.
def posM(M): M[np.where(M < 0)] = 0 return M
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __neg__(self):\n # \n # TODO - your code here\n #\n result = [];\n for row in self.g:\n result.append([-1*n for n in row]);\n \n return Matrix(result);", "def __neg__(self):\r\n return mat4(map(lambda x: -x, self.mlist))", "def __neg_...
[ "0.76243263", "0.7563646", "0.75580144", "0.7358723", "0.7310662", "0.72867644", "0.7284216", "0.7188416", "0.71556604", "0.71500736", "0.7108573", "0.6983111", "0.69672877", "0.6960416", "0.691239", "0.6884161", "0.68766946", "0.687511", "0.6855092", "0.68545777", "0.6849326...
0.60442895
88
Return matrix with negative values set to zero.
def negM(M): M[np.where(M > 0)] = 0 return M
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __neg__(self):\n # \n # TODO - your code here\n #\n result = [];\n for row in self.g:\n result.append([-1*n for n in row]);\n \n return Matrix(result);", "def __neg__(self):\r\n return mat4(map(lambda x: -x, self.mlist))", "def __neg_...
[ "0.76243263", "0.7563646", "0.75580144", "0.7358723", "0.72867644", "0.7284216", "0.7188416", "0.71556604", "0.71500736", "0.7108573", "0.6983111", "0.69672877", "0.6960416", "0.691239", "0.6884161", "0.68766946", "0.687511", "0.6855092", "0.68545777", "0.68493265", "0.684932...
0.7310662
4
Returns current service configuration preset
def get_preset(self, behavior): if behavior not in services: raise AssertionError('Behaviour %s is not registred in ServiceAPI (%s)' % (behavior, str(services.keys()))) provider_cls = services[behavior] provider = provider_cls() manifest = provider.get_manifest(behavior) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def preset_mode(self) -> str | None:\n state = self._state\n return state.custom_preset or _PRESETS.from_esphome(\n state.preset_compat(self._api_version)\n )", "def get_config():\n return CONFIG", "def preset_mode(self) -> Optional[str]:\n return self._preset", "def...
[ "0.6515062", "0.6276675", "0.625593", "0.62427366", "0.62224907", "0.62178314", "0.621284", "0.617045", "0.61603224", "0.6145862", "0.60998875", "0.599241", "0.5959012", "0.5957863", "0.5947781", "0.5933238", "0.59199774", "0.5905573", "0.58989686", "0.58883196", "0.58865637"...
0.68381345
0
Adjusts the learning rates of the optimizers.
def _set_learning_rates( self, lr_a=None, lr_alpha=None, lr_l=None, lr_labda=None, lr_c=None ): if lr_a: self._a_train.lr.assign(lr_a) if lr_alpha: self._alpha_train.lr.assign(lr_alpha) if self.use_lyapunov: if lr_l: self._l_train.l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def adjust_learning_rate(args, optimizer, epoch):\n if (epoch*3==args.epochs) or (epoch*3==2*args.epochs):\n lr = args.lr * (0.1 ** (epoch*3//args.epochs))\n print(\"Changing Learning Rate to {}\".format(lr))\n for param_group in optimizer.param_groups:\n param_group['lr'] = lr",...
[ "0.7902265", "0.781789", "0.7754488", "0.7667442", "0.76529497", "0.76516366", "0.7639675", "0.76214665", "0.7611798", "0.7578702", "0.75758976", "0.75666684", "0.75664407", "0.7556834", "0.754952", "0.75482213", "0.75413835", "0.7530248", "0.75238013", "0.75238013", "0.75238...
0.0
-1
Property used to clip lambda to be equal or bigger than 0.0 in order to prevent it from becoming nan when log_labda becomes inf. Further we clip it to be lower or equal than 1.0 in order to prevent lambda from exploding when the the hyperparameters are chosen badly.
def labda(self): return tf.clip_by_value(tf.exp(self.log_labda), *SCALE_LAMBDA_MIN_MAX)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clip_lambda_parameters(lambda_parameters, lambdas_config):\n # We want the projection to guarantee:\n # log_min <= log_lower <= log_upper <= log_max\n # Since we manipulate expressions involving log(log_upper-log_lower), we add\n # some eps for numerical stability, to ensure log_upper-log_lower >= eps.\n...
[ "0.6807709", "0.6133363", "0.6007942", "0.5977572", "0.59513134", "0.59020984", "0.58992976", "0.5898119", "0.5853264", "0.5846974", "0.5801608", "0.57939166", "0.5728134", "0.5699257", "0.5680772", "0.5668276", "0.56555265", "0.55422413", "0.55391026", "0.5529962", "0.549097...
0.665226
1
Initialize all Company's fields.
def __init__(self, *args, **kwargs): self._caffe = kwargs.pop('caffe') kwargs.setdefault('label_suffix', '') super(CompanyForm, self).__init__(*args, **kwargs) self.fields['name'].label = 'Nazwa'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _initFields(self):\n pass", "def __init__(self, name, **company_data):\n self.name = name\n self.__dict__.update(company_data)", "def __init__(self):\n self.constant_fields = {}\n self.post_score_renames = {}\n self.form = None\n self.form_field_regex = None...
[ "0.6863239", "0.65022624", "0.6477633", "0.64356196", "0.6250767", "0.61995405", "0.60311306", "0.6015784", "0.5975103", "0.5966057", "0.5945797", "0.58824325", "0.58824325", "0.58760387", "0.58603305", "0.58238846", "0.5793218", "0.5789367", "0.578211", "0.5773175", "0.57566...
0.5360942
80
Search product store by product id
def search_by_product(self, product_id): return self.fetch_all(""" SELECT s.name FROM product_stores as ps INNER JOIN stores as s ON s.id = ps.store_id WHERE ps.product_id=%s; """, (product_id, ))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def search_product_by_id(product_id): # 2.6.???? # TODO WHAT IS THIS\n\n for store in stores.get_all_stores().values():\n if product_id in store.inventory.products_dict:\n ans = store.inventory.products_dict[product_id]\n return ans\n raise Exception(\"product not found\")", "...
[ "0.8201761", "0.79626584", "0.79549867", "0.6679", "0.667048", "0.6665637", "0.66565716", "0.66284305", "0.6609666", "0.6539821", "0.64811045", "0.63692534", "0.6365759", "0.6345285", "0.62997335", "0.62674946", "0.62614584", "0.6250654", "0.62439996", "0.61956626", "0.618576...
0.80801195
1
Return the location string `loc` translated into a standardized form.
def _loc_translate(loc, default=None): if loc in (None, True): loc = default elif isinstance(loc, (str, Integral)): if loc in LOC_TRANSLATE.values(): # full name pass else: try: loc = LOC_TRANSLATE[loc] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def format_location(location):\n local = location.split()\n if len(local) > 1:\n if len(local) == 2 and len(local[1]) == 2:\n location = f\"{local[0].title()} {local[1].upper()}\"\n elif len(local) == 3 and len(local[2]) == 2:\n location = f\"{local...
[ "0.69732296", "0.6872208", "0.64715505", "0.62651414", "0.61977404", "0.61682653", "0.61576915", "0.6153057", "0.61100024", "0.6080847", "0.5956795", "0.5908905", "0.58818525", "0.5772944", "0.57470673", "0.5737565", "0.5731913", "0.5704558", "0.5690827", "0.56661564", "0.562...
0.69895846
0
Return the column or row gridspec range for the axes.
def _range_gridspec(self, x): if not hasattr(self, 'get_subplotspec'): raise RuntimeError(f'Axes is not a subplot.') ss = self.get_subplotspec() if x == 'x': _, _, _, _, col1, col2 = ss.get_active_rows_columns() return col1, col2 else: _, _...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _axes_domain(self, *args, **kwargs):\n # See _add_gridline_label for detials\n lon_0 = self.axes.projection.proj4_params.get('lon_0', 0)\n x_range, y_range = type(self)._axes_domain(self, *args, **kwargs)\n x_range = np.asarray(x_range) + lon_0\n return x_range, y_range", "def bounds(self):\n ...
[ "0.6727762", "0.6689823", "0.6543232", "0.63710177", "0.6327657", "0.63255554", "0.63080287", "0.62501", "0.60856366", "0.60605794", "0.60460764", "0.6028095", "0.6011696", "0.59951967", "0.5986672", "0.59041333", "0.59020406", "0.5864935", "0.58642626", "0.586413", "0.585376...
0.76912916
0
The axes number. This controls the order of abc labels and the order of appearence in the `~proplot.subplots.subplot_grid` returned by `~proplot.subplots.subplots`.
def number(self): return self._number
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tick_axis_number(ax=None,num_x_major=5,num_x_minor=None,num_y_major=5,\n num_y_minor=None,change_x=True,change_y=True):\n ax = gca(ax)\n if (num_x_minor is None):\n num_x_minor = 2 * num_x_major\n if (num_y_minor is None):\n num_y_minor = 2 * num_y_major\n if (chan...
[ "0.658098", "0.6492361", "0.64193594", "0.6222354", "0.61947435", "0.60646665", "0.5988294", "0.5959212", "0.5818488", "0.5791443", "0.5772391", "0.57558435", "0.57472575", "0.56982183", "0.5644749", "0.5644749", "0.5605827", "0.55798703", "0.55665565", "0.55303043", "0.55302...
0.0
-1
Convert the boolean "left", "right", "top", and "bottom" rc settings to a location string. Returns ``None`` if settings are unchanged.
def _parse_rcloc(x, string): # figures out string location if x == 'x': top = rc.get(f'{string}.top', context=True) bottom = rc.get(f'{string}.bottom', context=True) if top is None and bottom is None: return None elif top and bottom: return 'both' eli...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def location_str(self):\n ret = \"%s: \" % str(self.location)\n if self.char_location:\n ret += self.char_location\n elif self.x is not None:\n ret += \"(%s, %s)\" % (self.x, self.y)\n if self.parent_item:\n ret += \" [Socketed]\"\n return ret", ...
[ "0.51739573", "0.5161101", "0.50401664", "0.5020561", "0.4988331", "0.49158645", "0.48718396", "0.4846016", "0.48161334", "0.47410035", "0.47079167", "0.46945345", "0.46372974", "0.46126524", "0.4609368", "0.4591622", "0.45858857", "0.4585241", "0.45738342", "0.4567532", "0.4...
0.61846006
0
Apply alternate x axis overrides.
def _altx_overrides(self): # Unlike matplotlib API, we strong arm user into certain twin axes # settings... doesn't really make sense to have twin axes without this if self._altx_child is not None: # altx was called on this axes self._shared_y_axes.join(self, self._altx_child) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _dualx_overrides(self):\n # NOTE: We set the scale using private API to bypass application of\n # set_default_locators_and_formatters: only_if_default=True is critical\n # to prevent overriding user settings! We also bypass autoscale_view\n # because we set limits manually, and bypa...
[ "0.69636244", "0.6499312", "0.64706177", "0.63704365", "0.63455576", "0.6198285", "0.6192671", "0.615085", "0.60232383", "0.60180944", "0.59796655", "0.59656805", "0.5847485", "0.5836692", "0.5811789", "0.5811789", "0.58003503", "0.5762862", "0.5748239", "0.574348", "0.573644...
0.5682529
24
Apply alternate y axis overrides.
def _alty_overrides(self): if self._alty_child is not None: self._shared_x_axes.join(self, self._alty_child) self.spines['right'].set_visible(False) self.spines['left'].set_visible(True) self.yaxis.tick_left() self.yaxis.set_label_position('left') ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _dualy_overrides(self):\n arg = self._dualy_arg\n if arg is None:\n return\n scale = self.yaxis._scale\n olim = self.get_ylim()\n if (scale, *olim) == self._dualy_cache:\n return\n child = self._alty_child\n funcscale = axistools.Scale(\n ...
[ "0.73877794", "0.726645", "0.71623874", "0.69469917", "0.68925786", "0.676576", "0.659426", "0.659426", "0.6499343", "0.6498948", "0.64673245", "0.64503443", "0.6432815", "0.6427218", "0.63749826", "0.63413054", "0.6321191", "0.6318312", "0.623573", "0.62345433", "0.62186015"...
0.5576093
78
Lock the child "dual" y axis limits to the parent.
def _dualy_overrides(self): arg = self._dualy_arg if arg is None: return scale = self.yaxis._scale olim = self.get_ylim() if (scale, *olim) == self._dualy_cache: return child = self._alty_child funcscale = axistools.Scale( 'func...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _verticalLimit_changed(self):\n self.masterContainer.range2d.y_range.high = self.verticalLimit", "def _alty_overrides(self):\n if self._alty_child is not None:\n self._shared_x_axes.join(self, self._alty_child)\n self.spines['right'].set_visible(False)\n self.sp...
[ "0.67958367", "0.6299733", "0.61978877", "0.61506903", "0.61500907", "0.6014267", "0.5869512", "0.58608377", "0.58156776", "0.57801855", "0.5761993", "0.5750932", "0.57143724", "0.5655746", "0.56293875", "0.56244546", "0.56170636", "0.5613716", "0.5594056", "0.5594056", "0.55...
0.7377673
0
Return a circle `~matplotlib.path.Path` used as the outline for polar stereographic, azimuthal equidistant, and Lambert conformal projections. This was developed from `this cartopy example \
def _circle_path(N=100): # noqa theta = np.linspace(0, 2 * np.pi, N) center, radius = [0.5, 0.5], 0.5 verts = np.vstack([np.sin(theta), np.cos(theta)]).T return mpath.Path(verts * radius + center)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def makeCircleOutline(self):\n #circle defined\n global circ_main\n circ_main = Circle(stroke_color=BLUE).scale(2).shift(LEFT*5)\n\n #dot at circle and dot at center\n global dot_circ\n dot_circ = always_redraw(\n lambda : Dot(circ_main.get_end())\n )\n ...
[ "0.6730185", "0.6723566", "0.66747", "0.665132", "0.6631254", "0.6631254", "0.6543495", "0.6538131", "0.65189123", "0.650842", "0.64933336", "0.6448144", "0.64127535", "0.63649946", "0.63298136", "0.6275898", "0.62495387", "0.6245766", "0.621852", "0.6212398", "0.62025374", ...
0.73424065
0
See also `~proplot.subplots.subplots`, `Axes`, `GeoAxes`, `BasemapAxes`
def __init__(self, *args, **kwargs): # Store props that let us dynamically and incrementally modify # line locations and settings like with Cartesian axes self._boundinglat = None self._latmax = None self._latlines = None self._lonlines = None self._lonlines_value...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_subplot_map(subplot_num, subplot_title, nsubplots, latlon_area,\n var_levels):\n llcrnrlat_val = float(latlon_area[0])\n urcrnrlat_val = float(latlon_area[1])\n lat_ticks = np.linspace(llcrnrlat_val, urcrnrlat_val, 7, endpoint=True)\n ax_tmp = plt.subplot(gs[subplot_num])\n...
[ "0.7011268", "0.682092", "0.677713", "0.67477703", "0.670136", "0.65120953", "0.64482105", "0.6423057", "0.63425046", "0.6225653", "0.62017584", "0.6189277", "0.6178828", "0.6094234", "0.6085826", "0.6067051", "0.60514414", "0.60292953", "0.6029143", "0.60128194", "0.60038006...
0.0
-1
Stringify an iterable of dicts. This dumps each dict with JSON, and joins them with ``joinable``.
def _stringify(iterable: Iterable, joinable: str = "\n") -> str: return joinable.join(json.dumps(doc, default=json_util.default) for doc in iterable)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dumps(self, indent=1):\n str_keys_dict = OrderedDict({str(k): v for k, v in self.items()})\n for k, v in str_keys_dict.items():\n if isinstance(v, dict):\n str_keys_dict[k] = OrderedDict({str(k1): v1 for k1, v1 in v.items()})\n for k1, v1 in str_keys_dict[...
[ "0.63903606", "0.63702756", "0.63616145", "0.62354517", "0.6223313", "0.61667544", "0.614596", "0.613535", "0.61313087", "0.6118176", "0.6118176", "0.6112242", "0.6112242", "0.6091572", "0.6078463", "0.6055636", "0.6052664", "0.6025587", "0.60035354", "0.5973798", "0.5971142"...
0.7861865
0
Returns a random ply from the list of legal plies
def next_move(self, board, dice): rulebook = RuleBook(board, self, dice) legal_plies = rulebook.generate_legal_ply_list() return random.choice(legal_plies)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def randomLeggings():\n return random.choice(LEGGINGS)", "def random_legal_move():\n return random.choice(legal_moves())", "def randomChestplate():\n return random.choice(CHESTPLATES)", "def spinit(list):\n return (random.choice(list))", "def randomHelmet():\n return random.choice(HELMETS)",...
[ "0.6429419", "0.635384", "0.6205529", "0.6162186", "0.6018892", "0.5996375", "0.59512514", "0.5947652", "0.5947652", "0.5947652", "0.5851176", "0.5848463", "0.584434", "0.58240527", "0.5748063", "0.5746718", "0.57356095", "0.57247037", "0.572159", "0.570818", "0.5682471", "...
0.6272928
2
Computes the precision for the specified values of k
def accuracy(output, target, topk=(1, 5)): maxk = max(topk) batch_size = target.size(0) _, pred = output.topk(maxk, 1, True, True) pred = pred.t() correct = pred.eq(target.reshape(1, -1).expand_as(pred)) res = [] for k in topk: correct_k = correct[:k].reshape(-1).float().sum(0, kee...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def precision(gt, pred, k):\n k = min(len(pred), k)\n den = min(len(gt), k)\n return sum([int(pred[i] in gt) for i in range(k)]) / den", "def precision_at_k(r, k):\n assert k >= 1\n r = np.asarray(r)[:k] != 0\n if r.size != k:\n raise ValueError('Relevance score length < k')\...
[ "0.76427615", "0.74189496", "0.7418079", "0.72710466", "0.72456723", "0.72446615", "0.7237539", "0.72213703", "0.7210107", "0.7058935", "0.6852219", "0.6786084", "0.67836976", "0.6768417", "0.67273885", "0.67181736", "0.67181736", "0.67181736", "0.67181736", "0.67181736", "0....
0.0
-1
Returns a list of legal actions.
def get_possible_actions(game_state: gs.GameState) -> Optional[List[int]]: # noqa: C901 if game_state.is_game_ended(): return None legal_actions = [] if game_state.is_auction_started(): # if it is an auction # find max auction sun auction_suns = game_state.get_auction_suns() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def legal_actions(self):\n return self.env.legal_actions()", "def get_legal_actions(self):\n pass", "def _get_legal_actions(self):\n return self.game.get_legal_actions()", "def _get_legal_actions(self):\n raise NotImplementedError", "def legal_actions(self):\n raise NotIm...
[ "0.8528816", "0.83546525", "0.82642806", "0.81164455", "0.7654911", "0.7615163", "0.76089287", "0.75425416", "0.74945986", "0.7452249", "0.74353325", "0.7398746", "0.7342401", "0.7249083", "0.72484213", "0.72288615", "0.71232915", "0.71228725", "0.7108967", "0.7095986", "0.70...
0.0
-1
Creates a boolean mask indicating missing labels.
def is_unlabeled(y, missing_label=MISSING_LABEL): check_missing_label(missing_label) if len(y) == 0: raise ValueError("'y' is not allowed to be empty.") if not isinstance(y, np.ndarray): types = set( t.__qualname__ for t in set(type(v) for v in deepflatten(y))) types.add(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_labeled(y, missing_label=MISSING_LABEL):\n return ~is_unlabeled(y, missing_label)", "def get_mask_for_valid_labels(y_true, num_classes, ignore_value=255):\n mask_for_class_elements = y_true < num_classes\n mask_for_not_ignored = y_true != ignore_value\n mask = mask_for_class_elements & mask_fo...
[ "0.7139526", "0.68248355", "0.65871716", "0.635173", "0.6303694", "0.6146008", "0.5951915", "0.5909726", "0.5901916", "0.58459425", "0.58449423", "0.5818529", "0.5798815", "0.57935375", "0.5788884", "0.5788884", "0.57888615", "0.5728622", "0.5714743", "0.56810504", "0.5665661...
0.6468965
3
Creates a boolean mask indicating present labels.
def is_labeled(y, missing_label=MISSING_LABEL): return ~is_unlabeled(y, missing_label)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_positive_mask(labels):\n batch_shape = tf.shape(labels)[0]\n mask_1 = tf.logical_not(get_negative_mask(labels))\n mask_2 = tf.logical_not(tf.eye(batch_shape, dtype=tf.bool))\n return tf.logical_and(mask_1, mask_2)", "def get_mask_for_valid_labels(y_true, num_classes, ignore_value=255):\n m...
[ "0.6684058", "0.66000956", "0.64278036", "0.6178175", "0.6136527", "0.6009337", "0.5936251", "0.5748361", "0.5718689", "0.5711214", "0.56704587", "0.56682354", "0.56485933", "0.56300926", "0.56155103", "0.56117207", "0.5609615", "0.5593846", "0.557923", "0.55767304", "0.55508...
0.58319783
7
Return the total points after adding amount roundPoints.
def roundPoints(self, amount): self.pointsThisRound = amount self.pointsTotal += amount return self.pointsTotal
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def total_points(self, **kwargs):\n points = 0.0\n for key, value in self.stat_data.items():\n points = points + STATS[key][1](value)\n return round(points, self.__class__.default_round)", "def get_points(self):\n self.round_points = 0\n for die in self.dice:\n ...
[ "0.7794225", "0.77458435", "0.74563384", "0.70752335", "0.687383", "0.6612332", "0.6508645", "0.6455777", "0.64535975", "0.623415", "0.61971956", "0.6150033", "0.6068901", "0.60395116", "0.6026796", "0.6024767", "0.6024767", "0.5996103", "0.5982745", "0.5982685", "0.5982685",...
0.82475317
0
Give a readable representation of an instance.
def __unicode__(self): return '%s' % self.name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __repr__(self):\n return \"<instance of {}>\".format(self.__class__.__name__)", "def to_representation(self, instance):\n return instance", "def __repr__(self):\n return repr(self.__dict__['_obj'])", "def __repr__(self):\n return self.pretty_print(self.__dict__)", "d...
[ "0.7497366", "0.73179793", "0.72952557", "0.7288701", "0.7233661", "0.72258234", "0.72258234", "0.72258234", "0.72258234", "0.72258234", "0.72258234", "0.72258234", "0.72258234", "0.72258234", "0.72258234", "0.72258234", "0.72258234", "0.72258234", "0.72258234", "0.72258234", ...
0.0
-1
Give a unambiguous representation of an instance.
def __repr__(self): return '<%s#%s>' % (self.__class__.__name__, self.id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def represent(instance, *args, **kwargs):\n arguments = []\n if args:\n arguments.append(', '.join([f'{v!r}' for v in args]))\n if kwargs:\n arguments.append(', '.join([f'{k}={v!r}' for k, v in kwargs.items()]))\n return f\"{instance.__class__.__name__}({', '.join(arguments)})\"", "def ...
[ "0.66376984", "0.6537621", "0.6477478", "0.6430123", "0.641789", "0.6415765", "0.6366801", "0.6353466", "0.6337205", "0.6300465", "0.6299766", "0.62791187", "0.6257913", "0.6257781", "0.62315995", "0.623087", "0.62297136", "0.62293833", "0.62238556", "0.6221245", "0.6207133",...
0.61025745
36
Give a readable representation of an instance.
def __unicode__(self): return '%s' % self.name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __repr__(self):\n return \"<instance of {}>\".format(self.__class__.__name__)", "def to_representation(self, instance):\n return instance", "def __repr__(self):\n return repr(self.__dict__['_obj'])", "def __repr__(self):\n return self.pretty_print(self.__dict__)", "d...
[ "0.7497366", "0.73179793", "0.72952557", "0.7288701", "0.7233661", "0.72258234", "0.72258234", "0.72258234", "0.72258234", "0.72258234", "0.72258234", "0.72258234", "0.72258234", "0.72258234", "0.72258234", "0.72258234", "0.72258234", "0.72258234", "0.72258234", "0.72258234", ...
0.0
-1
Give a unambiguous representation of an instance.
def __repr__(self): return '<%s#%s>' % (self.__class__.__name__, self.id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def represent(instance, *args, **kwargs):\n arguments = []\n if args:\n arguments.append(', '.join([f'{v!r}' for v in args]))\n if kwargs:\n arguments.append(', '.join([f'{k}={v!r}' for k, v in kwargs.items()]))\n return f\"{instance.__class__.__name__}({', '.join(arguments)})\"", "def ...
[ "0.66376984", "0.6537621", "0.6477478", "0.6430123", "0.641789", "0.6415765", "0.6366801", "0.6353466", "0.6337205", "0.6300465", "0.6299766", "0.62791187", "0.6257913", "0.6257781", "0.62315995", "0.623087", "0.62297136", "0.62293833", "0.62238556", "0.6221245", "0.6207133",...
0.61025745
35
Give a readable representation of an instance.
def __unicode__(self): return '%s' % self.name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __repr__(self):\n return \"<instance of {}>\".format(self.__class__.__name__)", "def to_representation(self, instance):\n return instance", "def __repr__(self):\n return repr(self.__dict__['_obj'])", "def __repr__(self):\n return self.pretty_print(self.__dict__)", "d...
[ "0.7497366", "0.73179793", "0.72952557", "0.7288701", "0.7233661", "0.72258234", "0.72258234", "0.72258234", "0.72258234", "0.72258234", "0.72258234", "0.72258234", "0.72258234", "0.72258234", "0.72258234", "0.72258234", "0.72258234", "0.72258234", "0.72258234", "0.72258234", ...
0.0
-1
Give a unambiguous representation of an instance.
def __repr__(self): return '<%s#%s>' % (self.__class__.__name__, self.id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def represent(instance, *args, **kwargs):\n arguments = []\n if args:\n arguments.append(', '.join([f'{v!r}' for v in args]))\n if kwargs:\n arguments.append(', '.join([f'{k}={v!r}' for k, v in kwargs.items()]))\n return f\"{instance.__class__.__name__}({', '.join(arguments)})\"", "def ...
[ "0.66376984", "0.6537621", "0.6477478", "0.6430123", "0.641789", "0.6415765", "0.6366801", "0.6353466", "0.6337205", "0.6300465", "0.6299766", "0.62791187", "0.6257913", "0.6257781", "0.62315995", "0.623087", "0.62297136", "0.62293833", "0.62238556", "0.6221245", "0.6207133",...
0.61025745
34
Test files with Old Mac style (\r) new lines.
def test_oldmac(args): print('============= Testing for Correctness (Old Mac) =============') return _replace_test(args, '\r')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def winNewLines(inString):\n return reUnixNewLine.sub('\\r\\n',inString)", "def FixLineEndingsForWindows(self,str):\n # TODO: this should not really be part of this class\n if str[-2:]==\"\\r\\n\":\n return str\n if str[-1:]==\"\\n\":\n ...
[ "0.62769717", "0.61840206", "0.61330277", "0.60605717", "0.60098916", "0.5922205", "0.58722496", "0.58499676", "0.5830125", "0.5820324", "0.5800086", "0.5793824", "0.5778984", "0.57156223", "0.56969976", "0.56681", "0.56644446", "0.56610334", "0.56268644", "0.56259274", "0.56...
0.7088799
0
Initialize a Card object with its suit,rank and value attributes
def __init__(self,suit,rank): self.suit = suit self.rank = rank self.value = values[rank]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, suit: str, rank: str) -> None:\n self.suit = suit\n self.rank = rank\n self.value = Card.values[rank]\n self.hidden = False", "def __init__(self, rank, suit):\n self._rank = rank\n self._suit = suit", "def __init__(self, value, suit):\n self.v...
[ "0.8676571", "0.79790235", "0.79657143", "0.7928229", "0.7881141", "0.78622735", "0.7693859", "0.76407725", "0.76212704", "0.75948614", "0.75285524", "0.74861115", "0.74777955", "0.74388266", "0.7358639", "0.73016906", "0.7265924", "0.72590697", "0.7224853", "0.7220318", "0.7...
0.80752605
1
Sets the reward_tooltip_items of this DestinyPublicActivityStatus.
def reward_tooltip_items(self, reward_tooltip_items): self._reward_tooltip_items = reward_tooltip_items
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_reward(self, reward):\n self.reward = reward", "def show_reward(self, reward_):\n reward = reward_.reshape(self.cols, self.rows).T\n self.show_heatmap(reward, \"Pseudo Reward\")", "def plot_reward(self):\n if self.reward_im is None and self.reward_ax is None:\n fi...
[ "0.50329757", "0.5007686", "0.4965978", "0.4818254", "0.48142833", "0.4776663", "0.4732582", "0.47028562", "0.4555676", "0.455364", "0.45310986", "0.44369736", "0.44249675", "0.4415582", "0.43645728", "0.43599954", "0.43471318", "0.43036735", "0.4301712", "0.4301712", "0.4293...
0.8688591
0
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, DestinyPublicActivityStatus): return False return self.__dict__ == other.__dict__
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False", "def __eq__(self, other):\n if i...
[ "0.8088132", "0.8088132", "0.8054589", "0.7982687", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", ...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): return not self == other
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other) -> bool:\n return not self.__eq__(other)", "def __eq__(self, other):\n ...
[ "0.845611", "0.8391477", "0.8144138", "0.81410587", "0.8132492", "0.8093973", "0.80920255", "0.80920255", "0.80920255", "0.8085325", "0.8085325", "0.8076365", "0.8076365", "0.8065748" ]
0.0
-1
check if 2 grids are equal return boolean value
def grid_equal (grid1, grid2): if grid1 == grid2: return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def grid_equal (grid1, grid2):\r\n if grid1 == grid2:\r\n return True\r\n else:\r\n return False", "def grid_equal (grid1, grid2):\r\n for i in range (4):\r\n for j in range (4):\r\n if grid1[i][j] != grid2[i][j]:\r\n return False\r\n return True", "de...
[ "0.8933384", "0.87099695", "0.8585009", "0.8558586", "0.8200414", "0.80762106", "0.79177386", "0.7875002", "0.784008", "0.75213224", "0.7462791", "0.7448489", "0.7448489", "0.74154866", "0.7414818", "0.73950034", "0.7244226", "0.7191573", "0.7164593", "0.7132306", "0.71306413...
0.8914656
1
Look in a string where `@` indicates the beginning of a new entry and return the indices.
def find_entries(citation_string): for idx, token in enumerate(citation_string): if token == "@": yield idx
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_emails(s):\n # Removing lines that start with '//' because the regular expression\n # mistakenly matches patterns like 'http://foo@bar.com' as '//foo@bar.com'.\n email_pos = {}\n for email in set( re.findall(email_pattern, s) ):\n if email[0].startswith('//'):\n continue\n ...
[ "0.6102411", "0.6010226", "0.584344", "0.58310753", "0.5739727", "0.572319", "0.564796", "0.5634735", "0.5634735", "0.5634735", "0.5633217", "0.5602149", "0.5587446", "0.55604684", "0.55604684", "0.5529293", "0.5527629", "0.5518075", "0.5491215", "0.54701257", "0.54701257", ...
0.7022743
0
r""" Compare self to other
def _cmp_(self, other): if(not isinstance(other, VVHarmonicWeakMaassForms)): return False eq = (self.multiplier() == other.WR) and (self._weight_rat == other._weight_rat) eq = eq and (self.prec == other.prec) and (self._sym_type == other._sym_type) eq = eq and (self._is_dual_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n pass", "def __eq__(self, other):\n pass", "def __eq__(self, other):\n return self.index == other.index", "def __eq__(self, other):\n raise NotImplementedError", "def __eq__(self, other):\n raise NotImplementedError", "def __eq__(self, other):\...
[ "0.7890652", "0.7890652", "0.7886981", "0.7879732", "0.7879732", "0.7879732", "0.7810033", "0.7765567", "0.77633846", "0.7742791", "0.77094406", "0.77094406", "0.77094406", "0.77094406", "0.77078545", "0.7626272", "0.76236933", "0.76212025", "0.7618451", "0.7616242", "0.76159...
0.0
-1
r""" Return LaTeX string representation of self.
def _latex_(self): p = self._weight_rat.numer() q = self._weight_rat.denom() old = s = "\\begin{verbatim}\\end{verbatim}" new = "" # s="\\text{Space of Vector-Valued harmonic weak Maass forms on }" # s+=latex(self.multiplier().group)+" \\text{ of weight } \\frac{"+str(p)+...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __repr__(self): # pragma: no cover\r\n if self.latex == self.sans_parens:\r\n latex_repr = u'\"{}\"'.format(self.latex)\r\n else:\r\n latex_repr = u'\"{}\" or \"{}\"'.format(self.latex, self.sans_parens)\r\n\r\n if self.tall:\r\n wrap = u'<[{}]>'\r\n ...
[ "0.7874056", "0.77069783", "0.7481031", "0.73524547", "0.7328107", "0.72101086", "0.7167516", "0.7133799", "0.71101266", "0.709899", "0.703869", "0.69825625", "0.69733673", "0.69389904", "0.6854402", "0.6851698", "0.68008584", "0.6795204", "0.67890733", "0.6788342", "0.675256...
0.69453704
13
r""" Calculate the symmetry type (even/odd) for the combination of representation and weight.
def get_sym_type(self): t = self._weight - 0.5 if(not is_int(t)): raise ValueError("Need half-integral value of weight! Got k={0}, k-1/2={1}".format(self._weight, t)) ti = Integer(float(t)) if is_odd(ti): sym_type = -1 else: sym_type = 1 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_symmetry(self):\n\n # used to build the symmetry string\n symmetry = self.get_atoms()[0].get_symmetry_class()\n\n # used to count how many atoms there are of the current symmetry\n symmetric_atom_count = 1\n\n for atom in self.get_atoms()[1:]:\n\n # if this ato...
[ "0.6355566", "0.62997293", "0.62865067", "0.61532146", "0.5913813", "0.58368105", "0.56588554", "0.56498265", "0.56127125", "0.558194", "0.5545168", "0.5459059", "0.54154664", "0.5409102", "0.5359808", "0.53589046", "0.53527033", "0.53405666", "0.53338766", "0.53324234", "0.5...
0.72310233
0
r""" Return LaTeX string representation of self.
def _latex_(self): old = s = "\\begin{verbatim}\\end{verbatim}" new = "" s = "\\begin{verbatim}\\end{verbatim}" s += "Element of " + self._space._latex_().replace(old, new) + " With principal part " WR = self._space.multiplier() # If we have more than one non-zero element...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __repr__(self): # pragma: no cover\r\n if self.latex == self.sans_parens:\r\n latex_repr = u'\"{}\"'.format(self.latex)\r\n else:\r\n latex_repr = u'\"{}\" or \"{}\"'.format(self.latex, self.sans_parens)\r\n\r\n if self.tall:\r\n wrap = u'<[{}]>'\r\n ...
[ "0.7874056", "0.77069783", "0.7481031", "0.73524547", "0.7328107", "0.7167516", "0.7133799", "0.71101266", "0.709899", "0.703869", "0.69825625", "0.69733673", "0.69453704", "0.69389904", "0.6854402", "0.6851698", "0.68008584", "0.6795204", "0.67890733", "0.6788342", "0.675256...
0.72101086
5
Wrapper for dot product operation, in order to be compatible with both Theano and Tensorflow
def dot_product(x, kernel): if K.backend() == 'tensorflow': return K.squeeze(K.dot(x, K.expand_dims(kernel)), axis=-1) else: return K.dot(x, kernel)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dot_prod(t1: torch.Tensor, t2: torch.Tensor, verbose: bool = False):\n assert t1.size() == t2.size(), \"Sizes for dot-product must match\"\n return mo.dot_prod(t1, t2, verbose)", "def _dot(a, b):\n return np.einsum('ijk,ikl->ijl', a, b)", "def dot(a, b):\r\n a, b = as_tensor_variable(a), as_ten...
[ "0.7651723", "0.76122725", "0.75896275", "0.7535402", "0.75178", "0.74978065", "0.7466889", "0.74378735", "0.7429341", "0.7418364", "0.73810273", "0.7376632", "0.7343613", "0.7331493", "0.73104995", "0.7309816", "0.72749436", "0.727089", "0.7263545", "0.7240149", "0.72044", ...
0.74902385
8
Calulate the area under the curve using trapezoid rule.
def AUC(points): auc = 0.0 for point2, point1 in zip(points[1:], points[:-1]): #print(point2, point1) base = (point2[0] - point1[0]) / 100.0 height = ( (point2[1] - point1[1])/2.0 + point1[1] ) / 100.0 auc += (base*height) return auc
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def trapezoid_area(lower, leg , upper):\n area = (((upper+lower)/2)*leg)\n return area", "def area_under_curve(x, y):\n return torch.trapz(x=x, y=y)", "def area(self):\n return 0.5*np.abs(np.dot(self.x,np.roll(self.y,1))-np.dot(self.y,np.roll(self.x,1)))", "def area(x, y):\n return x*y/2",...
[ "0.7307549", "0.7014052", "0.6953364", "0.6681373", "0.66544855", "0.6547498", "0.65455425", "0.640952", "0.6367776", "0.6318975", "0.629288", "0.6282757", "0.6256094", "0.6256003", "0.6249781", "0.62264097", "0.6210032", "0.61856854", "0.6172808", "0.61625344", "0.6157337", ...
0.0
-1
The color palette for the plots
def get_pallete(self) -> Dict[str, Dict[str, str]]: return self.full_palette
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cmap(self):\n return self._palette", "def colormap(self):\n palette = [(0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0),\n (111, 74, 0), (81, 0, 81), (128, 64, 128), (244, 35, 232),\n (250, 170, 160), (230, 150, 140), (70, 70, 70),\n (1...
[ "0.72215426", "0.71344244", "0.7085886", "0.700568", "0.698577", "0.6982167", "0.6880612", "0.6862478", "0.68534267", "0.6704881", "0.6642504", "0.6568294", "0.65532327", "0.65447545", "0.6539193", "0.6484552", "0.64768326", "0.645193", "0.6449726", "0.6449726", "0.64342874",...
0.0
-1
Get the kappa vrc01 aa dataframe Returns pd.DataFrame the kappa vrc01 aa dataframe from an ANARCI alignment
def get_kappa_vrc01_aa(self) -> pd.DataFrame: return pd.read_feather(self.figure_data_paths.kappa_vrc01_aa_path)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_lambda_vrc01_aa(self) -> pd.DataFrame:\n return pd.read_feather(self.figure_data_paths.lambda_vrc01_aa_path)", "def get_vr01_ref_airr(self) -> pd.DataFrame:\n return pd.read_feather(self.figure_data_paths.vrc01_reference_airr_path)", "def preproc(fasta_file):\r\n \r\n #flybase fasta...
[ "0.6568845", "0.5562857", "0.5498447", "0.54653466", "0.5458336", "0.54002815", "0.53500247", "0.5220452", "0.51550066", "0.5150146", "0.5144609", "0.5140636", "0.51400375", "0.5122771", "0.50870925", "0.50739056", "0.50713927", "0.5047849", "0.49883994", "0.49727836", "0.495...
0.7584036
0
Get the lambda vrc01 aa dataframe Returns pd.DataFrame the lambda vrc01 aa dataframe from an ANARCI alignment
def get_lambda_vrc01_aa(self) -> pd.DataFrame: return pd.read_feather(self.figure_data_paths.lambda_vrc01_aa_path)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_kappa_vrc01_aa(self) -> pd.DataFrame:\n return pd.read_feather(self.figure_data_paths.kappa_vrc01_aa_path)", "def get_vr01_ref_airr(self) -> pd.DataFrame:\n return pd.read_feather(self.figure_data_paths.vrc01_reference_airr_path)", "def sa_pandas_init(self):\n\n lca = self.lca\n\n ...
[ "0.6482792", "0.58868605", "0.57496387", "0.56747735", "0.5594335", "0.5439382", "0.5367475", "0.5309153", "0.5295174", "0.52419627", "0.5188785", "0.51565063", "0.5125295", "0.51240903", "0.51061106", "0.50893843", "0.50756", "0.5070951", "0.505273", "0.5048198", "0.50437456...
0.7756964
0
Get the mature spr dataframe Returns pd.DataFrame the mature spr dataframe
def get_mature_spr_df(self) -> pd.DataFrame: return pd.read_feather(self.figure_data_paths.mature_spr_path)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pandas(self):\n names,prior,posterior = [],[],[]\n for iname,name in enumerate(self.posterior_parameter.row_names):\n names.append(name)\n posterior.append(np.sqrt(float(\n self.posterior_parameter[iname, iname]. x)))\n iprior = self.parcov.row_name...
[ "0.62534106", "0.61115843", "0.6092848", "0.5914531", "0.58889925", "0.5883527", "0.5882141", "0.5873399", "0.58594275", "0.58415014", "0.58376426", "0.5835708", "0.5808138", "0.58006", "0.57592905", "0.5751611", "0.57237345", "0.5707251", "0.5687984", "0.56701714", "0.566633...
0.735769
0
Get the fhcrc preprocessed manifest path
def get_pre_processed_fhcrc_manifest_path(self) -> Path: return self.flow_data_paths.fhcrc_preprocessed_manifest_path
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_fhcrc_processed_manifest_path(self) -> Path:\n return self.flow_data_paths.fhcrc_processed_manifest_path", "def get_pre_processed_vrc_manifest_path(self) -> Path:\n return self.flow_data_paths.vrc_preprocessed_manifest_path", "def get_vrc_processed_manifest_path(self) -> Path:\n re...
[ "0.82355773", "0.7385821", "0.70105916", "0.6928901", "0.6481178", "0.6300706", "0.62544096", "0.61917967", "0.6068125", "0.6046459", "0.59490186", "0.5940529", "0.5925866", "0.5905864", "0.5848496", "0.5787247", "0.57800484", "0.57773006", "0.57353354", "0.57251936", "0.5721...
0.8456232
0
Get the vrc preprocessed manifest path
def get_pre_processed_vrc_manifest_path(self) -> Path: return self.flow_data_paths.vrc_preprocessed_manifest_path
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_vrc_processed_manifest_path(self) -> Path:\n return self.flow_data_paths.vrc_processed_manifest_path", "def get_pre_processed_fhcrc_manifest_path(self) -> Path:\n return self.flow_data_paths.fhcrc_preprocessed_manifest_path", "def get_fhcrc_processed_manifest_path(self) -> Path:\n ...
[ "0.8122157", "0.7384365", "0.7035069", "0.6927623", "0.68263435", "0.6376462", "0.6311443", "0.62634593", "0.61096555", "0.6075289", "0.59285253", "0.59008056", "0.57407707", "0.5691818", "0.5690067", "0.5668195", "0.5668195", "0.5627052", "0.56229764", "0.5617677", "0.556105...
0.842788
0
Get the fhcrc swapped manifest path
def get_fhcrc_swap_manifest_path(self) -> Path: return self.flow_data_paths.fhcrc_swapped_manifest_path
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_fhcrc_processed_manifest_path(self) -> Path:\n return self.flow_data_paths.fhcrc_processed_manifest_path", "def get_pre_processed_fhcrc_manifest_path(self) -> Path:\n return self.flow_data_paths.fhcrc_preprocessed_manifest_path", "def get_vrc_swap_manifest_path(self) -> Path:\n ret...
[ "0.7469115", "0.7247928", "0.71629834", "0.6766603", "0.6544952", "0.6372282", "0.63124305", "0.6283842", "0.59238535", "0.5832267", "0.57961273", "0.57715434", "0.5767921", "0.5750788", "0.57071453", "0.570525", "0.5679978", "0.5676775", "0.5661969", "0.565913", "0.5624786",...
0.820003
0
Compute the distance between two x,y points.
def dist(a, b): x0, y0 = a # Destructuring assignment x1, y1 = b return math.sqrt((x1 - x0)**2 + (y1 - y0)**2)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dist(self,x, y):\n\n x1, y1 = x\n x2, y2 = y\n return np.sqrt(pow((x1 - x2), 2) + pow((y1 - y2), 2))", "def distance(x1, y1, x2, y2):\n dist = ((x1-x2)**2 + (y1-y2)**2)**0.5\n return dist", "def distance(x1, y1, x2, y2):\n return ((x2 - x1) ** 2 + (y2 - y1) ** 2) ** 0.5", "d...
[ "0.82147384", "0.8136396", "0.80773187", "0.8067292", "0.8052601", "0.80061305", "0.8004327", "0.7961775", "0.79296297", "0.7915189", "0.7845875", "0.7838246", "0.78197706", "0.77951884", "0.7776585", "0.7756899", "0.77390945", "0.7703851", "0.76833993", "0.7677335", "0.76686...
0.7431686
40
comparator (called when pushing to the heap)
def __lt__(self, other): return self.dist_from_source < other.dist_from_source
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def heap_sort(self, A):\n pass", "def heap_sort(self, A):\n pass", "def heap_sort(list):\n pass", "def __lt__(self, other):\n\n # seems like this should be == -1 but we're using a min heap\n return self._comparator.compare_measurements(self, other) == 1", "def _heapify(self):...
[ "0.6591348", "0.6591348", "0.658925", "0.65889597", "0.6513194", "0.6512085", "0.650862", "0.6505402", "0.6505402", "0.6505402", "0.65047455", "0.6460824", "0.6455891", "0.6447242", "0.64215535", "0.63799185", "0.63748467", "0.63716006", "0.636787", "0.6322795", "0.63220364",...
0.0
-1
Construct a new VariableReference.
def __init__(self, name=None, scope=None, variables=None): self.name = name self.scope: 'VariableScope' = scope self.variables: Set[MemoryVariable] = variables or set()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_variable(self, name = None):\r\n return self.Variable(self, name = name)", "def make_variable(self, name=None):\r\n return self.Variable(self, name=name)", "def make_variable(self, name=None):\r\n return self.Variable(self, name=name)", "def new(self, name: str, conditional) -> ...
[ "0.6842301", "0.6821262", "0.6821262", "0.67990375", "0.6468719", "0.6173369", "0.61438274", "0.61057633", "0.6008527", "0.58597016", "0.5818307", "0.5766487", "0.57641315", "0.5693819", "0.56853634", "0.56706727", "0.56184345", "0.557714", "0.5561737", "0.55457634", "0.55069...
0.58468145
10
Get all MemoryVariables that this identifier refers to.
def get(self) -> Set[MemoryVariable]: return self.variables
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_variables_list(self):\n variables = self.variables.values()\n # handle reference variables\n for variable in variables:\n name = variable['name']\n if name in self.references:\n variable['data'] = self.references[name]\n return variables", ...
[ "0.7053034", "0.69206697", "0.69037837", "0.6869848", "0.68115973", "0.67545646", "0.6695661", "0.6684118", "0.6630701", "0.6627313", "0.6612584", "0.6548015", "0.6533839", "0.6533839", "0.6533839", "0.6516953", "0.6510546", "0.64899004", "0.64874756", "0.6467995", "0.6462474...
0.8071724
0
Create a new VariableScope instance, to be used to store all identifiers in this scope.
def __init__(self, scp_map: 'VariableScopeMap', scope_node: T.VariableScopeNode): super().__init__() self.map = scp_map self.scope_node = scope_node self.is_class = isinstance(self.scope_node, ast.ClassDef)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initializing_scope(self):\n # TODO(apassos) ignoring the regularizer and partitioner here; figure out\n # how to deal with these.\n def _custom_getter(getter=None, name=None, shape=None, dtype=dtypes.float32, # pylint: disable=missing-docstring\n initializer=None, regularizer=No...
[ "0.6874674", "0.68339735", "0.6656265", "0.63238454", "0.61743724", "0.61082643", "0.6071707", "0.60496354", "0.60496354", "0.60396457", "0.59702694", "0.5969781", "0.5930553", "0.59227246", "0.5904457", "0.58862716", "0.58732116", "0.584882", "0.58378506", "0.583114", "0.574...
0.0
-1
Unbind all keys and axis bindings.
def unbind_all(cls): if cls.instance() is None: return cls.instance().m_axis_bindings.clear() cls.instance().m_axis_name_table.clear() cls.instance().m_button_bindings.clear() cls.instance().m_button_name_table.clear()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unload_bindings(self):\n self.ignoreAll()", "def unbind_keys(button):\n button.unbind('<Key>')\n button.unbind('<Left>')\n button.unbind('<Up>')\n button.unbind('<Right>')\n button.unbind('<Down>')", "def unbind(cls, name: st...
[ "0.7355052", "0.73135966", "0.70585966", "0.68741304", "0.66389227", "0.6554727", "0.63494813", "0.6288113", "0.6122433", "0.6012808", "0.59326375", "0.58588797", "0.58225805", "0.5808854", "0.579496", "0.56766665", "0.5662946", "0.5654133", "0.56531227", "0.564663", "0.56448...
0.80250984
0
Assumes that the value for a given key is going to be a list separated by commas. It gets rid of trailing comments. If just one item is present it returns a list with a single item, if no key is found an empty list is returned.
def get_list(self, section, key): value = self.get_safe(section, key, []) if value == []: return value # strip comments value = re.split(r'\s+#', value)[0] # split on commas value = value.split(',') # strip spaces return [x.strip() for x in ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getlist(self, key):\n \n value = self.get(key, [])\n if value is None or isinstance(value, (list, tuple)):\n return value\n else:\n return [value]", "def _get_list(self, object, key):\n\t\tif type(object) != type({}):\n\t\t\traise ParserError(\"%s is not a di...
[ "0.6413533", "0.60651153", "0.6023334", "0.6005663", "0.5795701", "0.57607067", "0.5743195", "0.5728173", "0.56835705", "0.5662005", "0.56236964", "0.5586612", "0.55735373", "0.55733585", "0.55672884", "0.55536705", "0.5541847", "0.5536365", "0.55146533", "0.550269", "0.54917...
0.7557113
0
Render main page template.
def render_main_page(self, client_id, state, user_id, user_name): return render_template( "main.html", client_id=client_id, state=state, is_logged_in=user_id is not None, user_name=user_name, categories=self._db_manager.get_category_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main_page():\n return render_template(\"main_page.html\")", "def main_page():\n return render_template(\"index.html\")", "def main():\n return render_template(\"main.html\")", "def main():\n return render_template(\"main.html\")", "def renderPage():\n return render_template(\"index.html\")...
[ "0.84542125", "0.8149654", "0.781043", "0.781043", "0.77628034", "0.76904076", "0.7510588", "0.74726844", "0.733926", "0.7320448", "0.73169184", "0.73169184", "0.72962743", "0.72170645", "0.72170645", "0.72170645", "0.72083807", "0.72083807", "0.72069556", "0.7158631", "0.714...
0.69394755
30
Render delete item page template.
def render_delete_item_page( self, client_id, state, user_id, user_name, item_id): item = self._db_manager.get_item(item_id) if item is None: flash("Invalid item.") return if item["user_id"] != user_id: flash("Only the original creator can d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_item_page(item_name, catagory_name):\n return render_template(\n 'delete_item.html', item_name=item_name, catagory_name=catagory_name\n )", "def delete():\n return render_template('layout.html')", "def delete(request):\n return render(request, 'modify.html')", "def delete_templa...
[ "0.7681434", "0.74165964", "0.7204042", "0.7025928", "0.6522235", "0.6492463", "0.6477454", "0.64534074", "0.6420184", "0.63661385", "0.6327609", "0.62736994", "0.62624943", "0.6201626", "0.61725795", "0.61488116", "0.6122013", "0.60973203", "0.6095742", "0.60839736", "0.6051...
0.7662626
1
Fixture that patches CloudPath dispatch and also sets up test assets in LocalS3Client's local storage directory.
def indexed_data(monkeypatch): client = LocalS3Client(local_storage_dir="tests/resources") monkeypatch.setitem(implementation_registry, "s3", local_s3_implementation) client.set_as_default_client() test_data_path = AnyPath("s3://partitioned-graph-data/data/staging_rewards/0.0.1") if not test_data_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setUp(self):\r\n \r\n factory.FileSystem._getConnectionPool = SimpleMock(SimpleMock(SimpleMock()))\r\n self._factory = factory.FileSystem(BaseConfiguration(\"http://s3.amazonaws.de/bucketname/keyname\"))", "def mock_s3_fixture():\n with mock_s3():\n yield", "def setUp(self):\...
[ "0.6814452", "0.6576719", "0.62469995", "0.61898136", "0.61860484", "0.61808056", "0.6052858", "0.5993104", "0.59916407", "0.5977578", "0.5952461", "0.5949529", "0.5943407", "0.5906873", "0.587632", "0.5851113", "0.58496916", "0.58405083", "0.5824925", "0.58226776", "0.580549...
0.64572006
2
Fetches belongsTo relation template. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response.
def portal_templates_id_template_get(self, id, **kwargs): kwargs['_return_http_data_only'] = True if kwargs.get('callback'): return self.portal_templates_id_template_get_with_http_info(id, **kwargs) else: (data) = self.portal_templates_id_template_get_with_http_info(id, *...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def relationship_template(cls):\n return relationship.many_to_one(cls, 'relationship_template')", "def relation(self, related=None, group=None):\n\t\tif not related:\n\t\t\treturn None\n\n\t\t# Try to get parent model for multi-table models\n\t\tif hasattr(related, 'parent_model'):\n\t\t\trelated_content_...
[ "0.5148095", "0.4523694", "0.45112363", "0.44421116", "0.43611196", "0.43501973", "0.41655436", "0.4162977", "0.41533896", "0.41294488", "0.41261658", "0.41258445", "0.40591744", "0.40569058", "0.40124512", "0.39589107", "0.39380306", "0.39271602", "0.39112172", "0.3894326", ...
0.0
-1
Fetches belongsTo relation template. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response.
def portal_templates_id_template_get_with_http_info(self, id, **kwargs): all_params = ['id', 'refresh'] all_params.append('callback') all_params.append('_return_http_data_only') params = locals() for key, val in iteritems(params['kwargs']): if key not in all_params:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def relationship_template(cls):\n return relationship.many_to_one(cls, 'relationship_template')", "def relation(self, related=None, group=None):\n\t\tif not related:\n\t\t\treturn None\n\n\t\t# Try to get parent model for multi-table models\n\t\tif hasattr(related, 'parent_model'):\n\t\t\trelated_content_...
[ "0.5147702", "0.45228958", "0.45101136", "0.4443126", "0.43609238", "0.4350289", "0.41650918", "0.41622865", "0.41526473", "0.41288102", "0.41278988", "0.41269854", "0.40613332", "0.4056541", "0.4013549", "0.39606836", "0.3941287", "0.39273748", "0.39140412", "0.38953453", "0...
0.0
-1
Exponential Moving Average serie y numero de lag
def EMA(serie, n): ewm = serie.ewm(n, adjust=False).mean() ewm[0:n] = [np.nan]*n return ewm
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exponentialMovingAverage(self,new,old, alpha):\n return alpha * new + (1 - alpha)* old", "def step_change(data, span=10, lag=1):\n moving_average = data.ewm(span=span).mean()\n lagged = pd.Series(np.append(np.repeat(np.nan, lag), moving_average[:len(moving_average)-lag]))\n diffs = data[lag:]...
[ "0.7027028", "0.690062", "0.6867722", "0.6755099", "0.6729632", "0.6700071", "0.6618212", "0.66166675", "0.6605855", "0.6578557", "0.65548164", "0.65342855", "0.6453069", "0.6449806", "0.64309686", "0.6391946", "0.63871735", "0.6334468", "0.6321428", "0.62641", "0.62590206", ...
0.59906495
30
Centers the GUI on the screen.
def center_on_screen(self): window_frame = self.frameGeometry() screen_center = QtGui.QDesktopWidget().availableGeometry().center() window_frame.moveCenter(screen_center) self.move(window_frame.topLeft())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def center(self):\n self.root.update_idletasks()\n w = self.root.winfo_screenwidth()\n h = self.root.winfo_screenheight()\n size = tuple(int(_) for _ in self.root.geometry().split('+')[0].split('x'))\n x = w/2 - size[0]/2\n y = h/2 - size[1]/2\n self.root.geometry(\...
[ "0.80871564", "0.7965393", "0.7756167", "0.7490238", "0.74812216", "0.7458817", "0.74298245", "0.7428422", "0.74227726", "0.7422224", "0.7422224", "0.7370876", "0.7362371", "0.7358651", "0.7348586", "0.720044", "0.7038817", "0.7001965", "0.7001965", "0.6972571", "0.695803", ...
0.7693732
3
List existing posts, filtering by user
def filter_posts(request): if request.is_ajax(): id_user = int(request.POST.get('id_user')) if id_user>0: return render(request, "posts_list.html", {"posts": Post.objects.filter( author_id=id_user).order_by('date_pub'), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_queryset(self):\r\n\r\n user = get_object_or_404(User, username=self.kwargs.get('username'))\r\n return Post.objects.filter(author=user).order_by('-date_posted')", "def get_queryset(self):\n return Post.objects.filter(\n user_id=self.kwargs['user_id'], status='published', ...
[ "0.7820124", "0.76876867", "0.708362", "0.70497173", "0.6913154", "0.68673676", "0.6791152", "0.6788503", "0.6744941", "0.6736987", "0.6736987", "0.6736002", "0.6715451", "0.6708982", "0.66194105", "0.6615043", "0.65990424", "0.6582033", "0.6582033", "0.65796906", "0.65347123...
0.73496056
2
Consolidates the customer and address received from the form.
def as_dict(self): dict_data = { 'first_name': self.first_name, 'last_name': self.last_name, 'email': self.email, 'phone': self.phone, 'orders_count': self.orders_count, 'currency': self.currency, } address_instance = Addres...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_customer_details(self):\n\n customer = self.invoice.customer\n addr = customer.get_billing_address()\n\n self.fontSize(FONT_S, bold=True)\n self.PDF.drawString(250, 127, \"Billed To\")\n\n self.fontSize(FONT_XXS)\n self.PDF.drawString(\n 250, 145, self.s...
[ "0.60455257", "0.5631368", "0.54577106", "0.5394011", "0.53440845", "0.5283777", "0.5259878", "0.5246589", "0.5231159", "0.52098423", "0.5175622", "0.51498336", "0.5141438", "0.5121351", "0.5116116", "0.50999254", "0.50952834", "0.5079623", "0.5075033", "0.5073125", "0.503270...
0.4727696
57
A utility method to get the absolute path to a resource in the test suite.
def get_resource(filename: str, path: str | None = None) -> str: root = Path(__file__).parent full_path = root if path is None else root / Path(path) return str(full_path / filename)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_resource_path(filename, path=Path.TEST):\n return os.path.normpath(os.path.join(path.value, filename))", "def get_absolute_resource_path(resource_path):\n return pkg_resources.resource_filename(\n cloudify_agent.__name__,\n os.path.join('resources', resource_path)\n )", "def...
[ "0.7464113", "0.73809624", "0.71504706", "0.7127172", "0.7004063", "0.6955971", "0.68538195", "0.6838208", "0.68337333", "0.6826169", "0.67501676", "0.6678867", "0.66788054", "0.6656737", "0.6656737", "0.6611073", "0.65873575", "0.6583916", "0.6574183", "0.6563887", "0.655578...
0.669425
11
y component of magnetic induction of a polygonal prism.
def by(xp, yp, zp, prisms): if xp.shape != yp.shape != zp.shape: raise ValueError("Input arrays xp, yp, and zp must have same shape!") res = 0 for prism in prisms: if prism is None or ('magnetization' not in prism.props): continue # Get the magnetization vector components...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def y(self):\r\n return self.unif[1]", "def get_y(EQ, M):\n return (EQ[1] * ((-1) * EQ[0] * M[0] + EQ[1] * M[1]) - EQ[0] * EQ[2]) / (EQ[1] ** 2 + EQ[0] ** 2)", "def y(self) -> int:\n return self.data.y_centre >> 4", "def y(self) -> float:\n return self.A[2] if self.scalar_vector else self...
[ "0.6408238", "0.631865", "0.62111986", "0.61402243", "0.6126763", "0.61127245", "0.60375494", "0.6009684", "0.6009684", "0.60026205", "0.60026205", "0.60026205", "0.60026205", "0.60026205", "0.60026205", "0.60026205", "0.60026205", "0.60026205", "0.60026205", "0.60014135", "0...
0.0
-1
r""" xx component of the gravity gradient tensor of a polygonal prism.
def gxx(xp, yp, zp, prisms): if xp.shape != yp.shape != zp.shape: raise ValueError("Input arrays xp, yp, and zp must have same shape!") res = 0 for prism in prisms: if prism is None or 'density' not in prism.props: continue density = prism.props['density'] res += ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gravity_gradients(self, p):\n Le = self._Le(p)\n wf = self._wf(p)\n EeLe = np.einsum(\"i...,i\", self.Ee, Le)\n FfWf = np.einsum(\"i...,i\", self.Ff, wf)\n return G * self.d * (EeLe - FfWf)", "def g_tensor(self,gpara,gperp):\n gx = gperp\n gy = gperp\n ...
[ "0.6354145", "0.6321417", "0.6139772", "0.6128736", "0.59286255", "0.59138256", "0.5902195", "0.58601326", "0.5850545", "0.5814345", "0.5811768", "0.57888615", "0.5781809", "0.57798153", "0.57381654", "0.5691589", "0.5687728", "0.56733", "0.5668644", "0.5664098", "0.5659108",...
0.0
-1
r""" xz component of the gravity gradient tensor of a polygonal prism.
def gxz(xp, yp, zp, prisms): if xp.shape != yp.shape != zp.shape: raise ValueError("Input arrays xp, yp, and zp must have same shape!") res = 0 for prism in prisms: if prism is None or 'density' not in prism.props: continue density = prism.props['density'] res += ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _xforce_xyz(self,x,y,z):\n return -2.*np.pi*self._rhoc_M * self.a**3*self._b*self._c * \\\n _forceInt(x, y, z, self._a2, self._b2*self._a2, self._c2*self._a2, self.n, 0)", "def g_tensor(self,gpara,gperp):\n gx = gperp\n gy = gperp\n gz = gpara\n\n self.gx = gx\n ...
[ "0.60951376", "0.5941994", "0.58845526", "0.57373935", "0.570647", "0.5699851", "0.5695791", "0.5690691", "0.5649471", "0.559517", "0.5587555", "0.55728376", "0.54975146", "0.54818726", "0.5474802", "0.5469576", "0.543638", "0.5434871", "0.5427537", "0.54242975", "0.542232", ...
0.58045506
3
r""" yy component of the gravity gradient tensor of a polygonal prism.
def gyy(xp, yp, zp, prisms): if xp.shape != yp.shape != zp.shape: raise ValueError("Input arrays xp, yp, and zp must have same shape!") res = 0 for prism in prisms: if prism is None or 'density' not in prism.props: continue density = prism.props['density'] res += ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gravity_gradients(self, p):\n Le = self._Le(p)\n wf = self._wf(p)\n EeLe = np.einsum(\"i...,i\", self.Ee, Le)\n FfWf = np.einsum(\"i...,i\", self.Ff, wf)\n return G * self.d * (EeLe - FfWf)", "def g_tensor(self,gpara,gperp):\n gx = gperp\n gy = gperp\n ...
[ "0.6461983", "0.6109174", "0.6066457", "0.6039522", "0.59815764", "0.59046745", "0.58864146", "0.5848143", "0.5841637", "0.5813708", "0.5805268", "0.5804351", "0.5768974", "0.5739872", "0.57198626", "0.5713729", "0.5699072", "0.5685788", "0.5667048", "0.5648369", "0.5641051",...
0.0
-1
Smooth approximation of max(x, 0).
def smoothmax(r, eps=1e-4): return conditional(gt(r, eps), r-eps/2, conditional(lt(r, 0), 0, r**2/(2*eps)))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def maximum(x):\n return np.maximum(x, 0)", "def softmax(x):\n e_x = np.exp(x - np.max(x))\n return (e_x / e_x.sum()) * 100", "def softmax(x): \n e_x = np.exp(x - np.max(x)) \n return e_x / e_x.sum()", "def softmax(x):\n e_x = np.exp(x - np.max(x))\n return old_div(e_x, e_x.sum()...
[ "0.76909333", "0.7242114", "0.72211206", "0.72120976", "0.7207449", "0.71837384", "0.71837384", "0.71637946", "0.71139526", "0.7112843", "0.7112843", "0.7112843", "0.7112843", "0.7112843", "0.7112843", "0.7112843", "0.7112843", "0.7112843", "0.7112843", "0.7112843", "0.711284...
0.7074154
32
Sets the authenticated_at of this Session.
def authenticated_at(self, authenticated_at): if self.local_vars_configuration.client_side_validation and authenticated_at is None: # noqa: E501 raise ValueError("Invalid value for `authenticated_at`, must not be `None`") # noqa: E501 self._authenticated_at = authenticated_at
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def expires_at(self, expires_at):\n\n self._expires_at = expires_at", "def expires_at(self, expires_at):\n\n self._expires_at = expires_at", "def expires_at(self, expires_at):\n\n self._expires_at = expires_at", "def created_at(self, created_at):\n\n self._created_at = created_at"...
[ "0.6293826", "0.6293826", "0.6293826", "0.6000543", "0.6000543", "0.6000543", "0.6000543", "0.6000543", "0.6000543", "0.6000543", "0.6000543", "0.6000543", "0.6000543", "0.6000543", "0.6000543", "0.6000543", "0.6000543", "0.6000543", "0.6000543", "0.6000543", "0.59650606", ...
0.8057676
0
Sets the id of this Session.
def id(self, id): if self.local_vars_configuration.client_side_validation and id is None: # noqa: E501 raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 self._id = id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_id(self, id):\n self.__id = id", "def set_id(self, id_):\n\n self.id_ = id_", "def setID(self, id):\n self._id = id\n return self.callRemote('setID', id)", "def SetId(self, id):\n self.id = int(id)", "def set_id(self, id):\n self.data['id'] = id", "def se...
[ "0.8060169", "0.7976997", "0.7912876", "0.79108423", "0.7716913", "0.76825213", "0.76668924", "0.750089", "0.7493255", "0.74792576", "0.74792576", "0.74792576", "0.74611783", "0.74611783", "0.74611783", "0.74611783", "0.74611783", "0.74611783", "0.74611783", "0.74611783", "0....
0.0
-1
Sets the identity of this Session.
def identity(self, identity): if self.local_vars_configuration.client_side_validation and identity is None: # noqa: E501 raise ValueError("Invalid value for `identity`, must not be `None`") # noqa: E501 self._identity = identity
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setIdentity(self) -> None:\n ...", "def user_identity(self):\n self.raw['type'] = 'IDENTITY'\n return self", "def session_id(self, session_id):\n\n self._session_id = session_id", "def setId(self, identifier):\n self.identifier = identifier", "def _set_id(self):\n ...
[ "0.7791635", "0.6197261", "0.60796916", "0.60048974", "0.5973158", "0.5969982", "0.5910119", "0.5837178", "0.5837178", "0.57847434", "0.5778571", "0.57299507", "0.5699387", "0.5699387", "0.56830496", "0.5678651", "0.5644342", "0.56363744", "0.5626771", "0.5607137", "0.5595525...
0.6231977
1
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, Session): return False return self.to_dict() == other.to_dict()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False", "def __eq__(self, other):\n if i...
[ "0.80885184", "0.80885184", "0.805514", "0.7983044", "0.7966715", "0.7966715", "0.7966715", "0.7966715", "0.7966715", "0.7966715", "0.7966715", "0.7966715", "0.7966715", "0.7966715", "0.7966715", "0.7966715", "0.7966715", "0.7966715", "0.7966715", "0.7966715", "0.7966715", ...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): if not isinstance(other, Session): return True return self.to_dict() != other.to_dict()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other) -> bool:\n return not self.__eq__(other)", "def __eq__(self, other):\n ...
[ "0.845611", "0.8391477", "0.8144138", "0.81410587", "0.8132492", "0.8093973", "0.80920255", "0.80920255", "0.80920255", "0.8085325", "0.8085325", "0.8076365", "0.8076365", "0.8065748", "0.8042487", "0.8042487", "0.8042487", "0.8042487", "0.8042487", "0.8042487", "0.8042487", ...
0.0
-1
Gets list of supported targets
def targets(): return [CSharpPackage(), CSharpPackage(use_dotnet_cli=True), NodePackage(), RubyPackage(), PythonPackage(), PHPPackage()]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def targets(self): # type: () -> t.List[HostConfig]\n return self.host_settings.targets", "def Targets(self):\n return self._targets", "def targets(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['PlanTargetsArgs']]]]:\n return pulumi.get(self, \"targets\")", "def GetTargets(self):...
[ "0.7293561", "0.7170189", "0.70282674", "0.6968068", "0.68754953", "0.6655958", "0.6650611", "0.6612449", "0.65452045", "0.65376955", "0.65350795", "0.65114605", "0.64893305", "0.64475656", "0.64280295", "0.6410246", "0.63985056", "0.6374582", "0.6373402", "0.6344824", "0.633...
0.61703265
27
This is the logic for the home page
def index(request): global user_flag global user_value # Populating variable with all question objects try: questions_list = Question.objects.order_by('title') except Question.DoesNotExist: raise Http404("Question does not exist") # Lists of all possible languages and difficult...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def home(self, *args, **kwargs):\n pass", "def home(request):\n\treturn render(request, \"compta/home.html\")", "def home():\n\n return render_template('home_page.html')", "def home():\n\n\treturn render_template('solai.html')", "def home():\n return render_template(\n 'home.html',\n ...
[ "0.81277597", "0.79730403", "0.7866615", "0.77511966", "0.7683469", "0.7673385", "0.7672684", "0.7650412", "0.76486945", "0.7625424", "0.75970364", "0.75970364", "0.75970364", "0.75970364", "0.75970364", "0.75970364", "0.75970364", "0.75970364", "0.75970364", "0.75970364", "0...
0.0
-1
returns a list of all the child tags of a given tag, this method is recursive and will search for more than one level of children (e.g. grandchildren)
def get_children(search_tag, tag_list): list_return = [] for tag in tag_list: if str(tag.parent) == str(search_tag): list_return.append(tag) list_return.extend(get_children(tag, tag_list)) return list(set(list_return)) # This will return a list of unique elements
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_children_with_tag(self, tag):\n if tag in self._children_tag_table:\n result = self._children_tag_table[tag]\n else:\n result = []\n composite_children = [c for c in self._children.values() if isinstance(c, Composite)]\n grand_children = []\n for c i...
[ "0.822328", "0.7453532", "0.7074889", "0.70508575", "0.66183245", "0.66120803", "0.65444213", "0.6512602", "0.65079546", "0.65056556", "0.64782274", "0.6452864", "0.64208204", "0.63882333", "0.6346484", "0.6325542", "0.6318275", "0.62972707", "0.62794566", "0.6278612", "0.622...
0.7754839
1
This does a UTC offset conversion from seconds to hours
def utc_offset_convert(utc_offset): offset=abs(utc_offset) hour=str(offset//3600) if len(hour)==1: hour=str(0)+hour minute=str(offset%3600//60) if len(minute)==1: minute=str(0)+minute if utc_offset>=0: sign="+" else: sign='-' HHMM=sign+hour+minute ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _tzoffset2iso8601zone(seconds):\n return \"%+03d:%02d\" % divmod((seconds // 60), 60)", "def hours_in(sec):\r\n return int(sec//3600)", "def _format_timezone_offset(converted_time):\n\n # Windows treats %z in the format string as %Z, so we compute the hour/minute offset\n # manually.\n ...
[ "0.6442525", "0.62002534", "0.61747897", "0.6165516", "0.61181265", "0.60406053", "0.59186155", "0.58711714", "0.58629006", "0.5825974", "0.5796186", "0.5794065", "0.5756647", "0.5743311", "0.57157356", "0.57036054", "0.57028925", "0.57026935", "0.56894714", "0.5685342", "0.5...
0.6693794
0
Return input type to use for field
def topcoat_input_type(field): try: widget = field.field.widget except: raise ValueError("Expected a Field, got a %s" % type(field)) input_type = getattr(widget, 'bootstrap_input_type', None) if input_type: return unicode(input_type) if isinstance(widget, TextInput): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def input_type(self):\n return self._input_type.value", "def _get_input_type(self):\n return self.__input_type", "def _get_input_type(self):\n return self.__input_type", "def _get_input_type(self):\n return self.__input_type", "def _get_input_type(self):\n return self.__input_type", "def _...
[ "0.87449074", "0.8471579", "0.8471579", "0.8471579", "0.8471579", "0.8471579", "0.8471579", "0.78139204", "0.78139204", "0.78139204", "0.78139204", "0.78139204", "0.78139204", "0.78139204", "0.78139204", "0.78139204", "0.78139204", "0.78139204", "0.78139204", "0.78139204", "0...
0.78877133
7
Projects a point cloud onto the camera image plane and creates a depth image. Zero depth means no point projected into the camera at that pixel location (i.e. infinite depth).
def project_to_image(self, point_cloud, round_px=True): if not isinstance(point_cloud, PointCloud) and not (isinstance(point_cloud, Point) and point_cloud.dim == 3): raise ValueError('Must provide PointCloud or 3D Point object for projection') if point_cloud.frame != self._frame: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_depth_frame_to_pointcloud(depth_image, camera_intrinsics ):\n\t\n\t[height, width] = depth_image.shape\n\n\tnx = np.linspace(0, width-1, width)\n\tny = np.linspace(0, height-1, height)\n\tu, v = np.meshgrid(nx, ny)\n\tx = (u.flatten() - camera_intrinsics.ppx)/camera_intrinsics.fx\n\ty = (v.flatten() - ...
[ "0.79226345", "0.7898453", "0.7608489", "0.7371517", "0.7350767", "0.7247594", "0.70062256", "0.68509597", "0.6827371", "0.67930317", "0.6710671", "0.66975486", "0.666168", "0.64433855", "0.6429538", "0.6413993", "0.6402543", "0.6399032", "0.6316864", "0.6225168", "0.61622435...
0.77850276
2
Navigates to the home page of the application. Context Template
def home(request): context = { } return render(request, 'index.html', context)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def home():\n\n return render_template('home_page.html')", "def home(request):\n return render_template('core/home.html')", "def home():\n return render_template('Main_Page.html')", "def home(request):\n\treturn render(request, \"compta/home.html\")", "def home():\n return render_template('home...
[ "0.7681595", "0.76518166", "0.75686663", "0.754621", "0.7544986", "0.7544986", "0.7544986", "0.7544986", "0.7544986", "0.7544986", "0.7544986", "0.7544986", "0.7544986", "0.7544986", "0.7544986", "0.7544986", "0.7544986", "0.7544986", "0.7544986", "0.7544986", "0.7521783", ...
0.72299683
38
Logout view that redirects the user to the home page. Context Template
def logout_view(request): auth_logout(request) return redirect('home')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def showLogoutPage(request):\n return render(request, \"core/logout.html\", {})", "def logout_view(request):\n logout(request)\n return redirect('home')", "def logoutPage(request):\n\n logout(request)\n return redirect('index')", "def logout_page(request):\n logout(request)\n return redi...
[ "0.82358855", "0.81049544", "0.8100261", "0.8030044", "0.7997599", "0.7927355", "0.7913461", "0.7912544", "0.79098403", "0.79085064", "0.79016024", "0.78912157", "0.7886612", "0.7883113", "0.78770083", "0.78415686", "0.7838008", "0.7836889", "0.78368014", "0.78129435", "0.781...
0.8187137
1