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 one hot encoded vector
def get_hot_enc(input, channels=3): if len(input.shape)==2: input = input.unsqueeze(dim=0).unsqueeze(dim=0) if len(input.shape)==3: input = input.view(input.shape[0], 1, input.shape[2], input.shape[2]) input_zer = (torch.zeros(input.shape[0], channels, *input.shape[2:])) if input.is_cuda...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def one_hot_encode(x, n_classes):\n return np.eye(n_classes)[x]", "def one_hot_encode(x):\n # TODO: Implement Function\n output = np.zeros((len(x), 10))\n \n for i, j in enumerate(x):\n output[i,j] = 1\n \n return output", "def _one_hot_encode(label_vector, total_num_labels):...
[ "0.8199623", "0.8149249", "0.8147892", "0.8139591", "0.81045884", "0.80887693", "0.7970159", "0.79525745", "0.79215366", "0.7897173", "0.78907615", "0.7868385", "0.7852869", "0.7850428", "0.7835545", "0.78274333", "0.7823049", "0.77925", "0.7772062", "0.7763912", "0.77631634"...
0.0
-1
Create a random color for the strand. Colors are generated from the limited set of intensity values in color_list[] to make them more distinguishable.
def create_random_color(self): # Create a list of n colors. n = 4 dc = 1.0 / (n-1) color_list = [i*dc for i in range(n)] if self.is_scaffold: rgb = [1.0, 1.0, 1.0] else: rgb = [random.choice(color_list) for i in range(3)] # Don't gener...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def random_color(num):\n # 为每个类别的边界框随机匹配相应颜色\n np.random.seed(80)\n COLORS = np.random.randint(0, 256, size=(num, 3), dtype='uint8') #\n return COLORS", "def random_color_gen():\n r = randint(0, 255)\n g = randint(0, 255)\n b = randint(0, 255)\n return [r, g, b]", "def get_random_color...
[ "0.70949805", "0.7064893", "0.7044568", "0.6960418", "0.69549197", "0.69396067", "0.6892338", "0.6872384", "0.6811107", "0.68061066", "0.67998534", "0.6678897", "0.6657388", "0.66539556", "0.66537464", "0.66448563", "0.66395354", "0.66287696", "0.6622712", "0.6622712", "0.662...
0.7926067
0
use gaussina blur to generate five images in different sigma value
def gs_blur(self,k,img): SIG = self.sigma sig = [SIG,k*SIG,k*k*SIG,k*k*k*SIG,k*k*k*k*SIG] gsArray = [0,1,2,3,4] scaleImages = [0,1,2,3,4] for i in range(5): gsArray[i] = scipy.ndimage.filters.gaussian_filter(img,sig[i]) return gsArray
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def smooth_gauss(image, variance=2, kernel_size=(9, 9)):\n return cv2.GaussianBlur(image, kernel_size, variance)", "def blur_image(im, n, ny=None) :\n g = gauss_kern(n, sizey=ny)\n improc = signal.convolve(im,g, mode='same')\n return(improc)", "def gaussianBlur(img,ksize=(5,5),sigma=10):\n #kern...
[ "0.72911", "0.70356953", "0.70228565", "0.70216244", "0.688809", "0.6779701", "0.6721023", "0.66762406", "0.66747326", "0.6656893", "0.66477764", "0.66411644", "0.65873647", "0.6579804", "0.652648", "0.6520834", "0.65015996", "0.64913064", "0.64913064", "0.64913064", "0.64913...
0.7679304
0
Aggregate a list of pairwise preferences Take a list of pairwise preferences and aggregate them into a dictionary. This is the data structure that the other functions in this package use. Note The item IDs passed to this function don't strictly need to be integers starting at zero, but algorithms that don't take an ini...
def agg_preferences(prefs_list): aggregated_preferences=defaultdict(lambda: 0) for els in prefs_list: if els[0]<els[1]: aggregated_preferences[(els[0],els[1])]+=1 else: aggregated_preferences[(els[1],els[0])]-=1 return aggregated_preferences
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def aggregateSimilarityDict(collected_list):\n similarity_dict = defaultdict(list)\n for tup in collected_list:\n similarity_dict[tup[0]] += tup[1]\n for e in similarity_dict.keys():\n similarity_dict[e] = list(set(similarity_dict[e]))\n return dict(similarity_dict)", "def _assoc_list_t...
[ "0.62119216", "0.5539312", "0.54533285", "0.5392189", "0.53661776", "0.5278248", "0.5253209", "0.5155678", "0.5139457", "0.5137095", "0.51202166", "0.5072852", "0.5035132", "0.50292885", "0.50155187", "0.49666432", "0.49405515", "0.4912827", "0.49021226", "0.48894963", "0.488...
0.668119
0
Converts the given CQL filter expression into a filter specification.
def make_filter_specification(cls, filter_string): try: return parse_filter(filter_string) except ParseException as err: raise ValueError('Expression parameters have errors. %s' % err)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_filter_expr(expr: dict) -> str:\n if not hasattr(expr, 'name'):\n if type(expr) is BNode:\n return f\"?v_{expr}\"\n else:\n return expr.n3()\n else:\n if expr.name == 'RelationalExpression':\n return f\"({parse_filter_expr(expr.expr)} {expr.op} ...
[ "0.6868336", "0.65168595", "0.6045868", "0.5538864", "0.5344862", "0.52437514", "0.52161825", "0.5209752", "0.51954806", "0.5194124", "0.5154742", "0.51334476", "0.5109715", "0.5093287", "0.5074252", "0.50446093", "0.5043379", "0.50144047", "0.50112706", "0.49924517", "0.4965...
0.7227108
0
Converts the given filter specification to a CQL filter expression.
def make_filter_string(cls, filter_specification): registry = get_current_registry() visitor_cls = registry.getUtility(IFilterSpecificationVisitor, name=EXPRESSION_KINDS.CQL) visitor = visitor_cls() filter_specification.accept(visitor) re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_filter_expr(expr: dict) -> str:\n if not hasattr(expr, 'name'):\n if type(expr) is BNode:\n return f\"?v_{expr}\"\n else:\n return expr.n3()\n else:\n if expr.name == 'RelationalExpression':\n return f\"({parse_filter_expr(expr.expr)} {expr.op} ...
[ "0.67534536", "0.6260906", "0.6005664", "0.5893943", "0.569722", "0.5672392", "0.5642282", "0.5537055", "0.5515805", "0.54488784", "0.5426874", "0.54108894", "0.53877515", "0.5353995", "0.5345101", "0.5339917", "0.53243387", "0.52931374", "0.52562296", "0.5239389", "0.5237194...
0.7834718
0
The name of the image file where the RANSAC results were saved.
def outputimagefile(self): return self._outputimagefile
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __diff_filename(self):\n diff_dir = os.path.join(self.__folder, Reference.DIFF_OUT)\n if not os.path.exists(diff_dir):\n os.makedirs(diff_dir)\n return os.path.join(diff_dir, self.__name +'.jpg')", "def _get_image_name(self) -> str:\n dirname = os.path.basename(os.getc...
[ "0.6881471", "0.6866161", "0.68547887", "0.673493", "0.66468084", "0.6646803", "0.6605829", "0.6568366", "0.6561065", "0.6553071", "0.65314674", "0.6525422", "0.6498491", "0.6491378", "0.6487832", "0.643308", "0.6419838", "0.64115185", "0.63864416", "0.6337778", "0.630379", ...
0.6435427
15
The thresholdfactor property that was used to generate this RANSAC output.
def thresholdfactor(self): return self.__thresholdfactor
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def threshold(self):\n return self._threshold", "def threshold(self):\n return self._threshold", "def threshold(self) -> float:\n return pulumi.get(self, \"threshold\")", "def actualthreshold(self):\n return self._actualthreshold", "def threshold(self) -> pulumi.Input[float]:\n ...
[ "0.6667594", "0.6667594", "0.6568505", "0.646899", "0.6327589", "0.6327589", "0.6327589", "0.6327589", "0.6327589", "0.63241935", "0.6272474", "0.6110878", "0.6088142", "0.60302424", "0.60302424", "0.60302424", "0.59295774", "0.58680624", "0.5860033", "0.5852736", "0.58409745...
0.8320701
0
Convert an integer to the equivalent floating point value.
def int_to_float(num_bits: int, value: int) -> float: if num_bits == 32: unpack_fmt = '>f' elif num_bits == 64: unpack_fmt = '>d' else: raise Exception(f"Unhandled bit size: {num_bits}") return struct.unpack(unpack_fmt, value.to_bytes(num_bits // 8, 'big'))[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def base2float(self, int_number):\r\n return float(int_number) / self.mult_base", "def _int2float(x: int) -> float:\n return round(x / 100, 2)", "def __float__(self) -> float:\n return self._translate_in_type(float, self.integer)", "def int2float(img_int):\n img = img_int.astype(np.float6...
[ "0.76041126", "0.74290216", "0.700738", "0.68990654", "0.6861193", "0.6797452", "0.67892605", "0.6732818", "0.66968614", "0.64980197", "0.6484453", "0.6427284", "0.6409113", "0.64008033", "0.6231831", "0.6173491", "0.6154221", "0.6132337", "0.61279464", "0.60990995", "0.60501...
0.6995049
3
Trains the neural network self.decoder for self.num_epochs epochs with the data in self.train_loader_enc1, self.train_loader_enc2 and self.train_loader_pred. Evaluates the neural network self.decoder with the data in self.val_loader_enc1, self.val_loader_enc2 and self.val_loader_pred after each epoch.
def train_model(self): self.encoder1.to(self.device) self.encoder2.to(self.device) self.decoder.to(self.device) average_training_losses = [] average_validation_losses = [] # epochs loop while self.epoch < self.num_epochs: self.decoder.train() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def train_epoch(self):\r\n for loader in self.loaders:\r\n if self.epoch % loader.epoch_interval == 0:\r\n self.cycle_dataset(loader)\r\n\r\n self._stats_new_epoch()\r\n self._write_tensorboard()\r\n print('{}th epoch train / eval done!'.format(self.epoch))", ...
[ "0.70879954", "0.6983035", "0.69731194", "0.69316083", "0.68704367", "0.6803237", "0.6792447", "0.67858255", "0.674697", "0.67358893", "0.6714054", "0.670374", "0.670046", "0.66954774", "0.6637441", "0.66141415", "0.66112536", "0.65787464", "0.6566826", "0.6559314", "0.655929...
0.7570841
0
Gets the storage_metadata of this CreatePersistentStorageResponse.
def storage_metadata(self): return self._storage_metadata
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def storage(self, **kwargs):\n self.logger.debug(f\"Get basic storage data\")\n url_path = 'storage'\n body = self._make_body(kwargs)\n return self._common_post(request_path=url_path, body=body)", "def get_metadata(self):\n return self._metadata", "def storage_metadata(self, ...
[ "0.6373181", "0.6350695", "0.6209902", "0.61968666", "0.61968666", "0.61641794", "0.61548156", "0.6029389", "0.60090184", "0.59917295", "0.5972053", "0.5972053", "0.5972053", "0.5972053", "0.5972053", "0.59675825", "0.5953016", "0.5910135", "0.5892782", "0.5849373", "0.583699...
0.816031
0
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, CreatePersistentStorageResponse): 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
convert time to decimal hours
def dechours(self, yr, mn, d, t): dt = datetime(int(yr), int(mn), int(d)) if self.epochhours == 0: self.epochhours = self.datehours(dt) e = self.datehours(dt) result=-1.0 if len(t) > 0: (h, m) = t.split(':') fh = float(h) fm = float(m) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculate_hours(time):\n return int(time / 3600)", "def hours_in(sec):\r\n return int(sec//3600)", "def seconds2hours(time_in_seconds):\n seconds_since_midnight = np.mod(time_in_seconds, SECONDS_PER_DAY)\n fraction_hour = seconds_since_midnight/SECONDS_PER_HOUR\n if fraction_hour[-1] == 0:\n...
[ "0.8519766", "0.75456053", "0.7494686", "0.71696913", "0.7113667", "0.70909494", "0.70143837", "0.70143837", "0.70143837", "0.70143837", "0.7012285", "0.69636405", "0.6923567", "0.69193053", "0.691077", "0.68538266", "0.68140036", "0.67198104", "0.6705499", "0.6665254", "0.66...
0.0
-1
Initialize a new Tweet. >>> t = Tweet('Rukhsana', date(2017, 9, 16), 'Hey!') >>> t.userid 'Rukhsana' >>> t.created_at datetime.date(2017, 9, 16) >>> t.content 'Hey!' >>> t.likes 0
def __init__(self, who: str, when: date, what: str) -> None: # YOUR CODE HERE self.content = what self.userid = who self.created_at = when self.likes = 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n self.tweets = {}\n self.followees = {}\n self.timestamp = 0", "def __init__(self, tweet_data):\n _hashtags = tweet_data['entities']['hashtags']\n _str_date = tweet_data['created_at']\n self.account = Account(tweet_data['user'])\n self.date = ...
[ "0.70113236", "0.69452757", "0.6816572", "0.66317755", "0.6625264", "0.65671384", "0.65075684", "0.6310752", "0.6062606", "0.6010437", "0.6004026", "0.59006846", "0.5877039", "0.58652365", "0.58576375", "0.5848883", "0.5786264", "0.5778462", "0.57525784", "0.5716749", "0.5667...
0.6894339
2
Write a simple json string and read it back
def test_json_round_trip(): j = '[{"name": "Alice", "occupation": "researcher"}]' s = Store("Azure") cell_hash = str(uuid.uuid4()) frame_name = str(uuid.uuid4()) s.write(j, cell_hash, frame_name) result = s.read(cell_hash, frame_name).decode("utf-8") assert(result == j)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_json_to_file(i):\n\n import json\n import ck.strings\n\n fn = i['json_file']\n\n if i.get('safe', '') == 'yes':\n d = i['dict']\n\n sd = {}\n\n # Check main unprintable keys\n for k in d:\n try:\n json.dumps(d[k])\n except Except...
[ "0.6661269", "0.6524767", "0.6452258", "0.64056206", "0.6395753", "0.6392254", "0.6337206", "0.6307155", "0.6307155", "0.6286008", "0.62671995", "0.62578696", "0.6256067", "0.6239974", "0.6203682", "0.6189891", "0.6176886", "0.61631113", "0.6151469", "0.61500746", "0.614285",...
0.6824434
0
Read an arrow file. First create one from a pandas df
def test_arrow_round_trip(): df = pd.DataFrame({"a":[1,3,5],"b":[2,4,6]}) batch = pa.RecordBatch.from_pandas(df, preserve_index=False) sink = pa.BufferOutputStream() writer = pa.RecordBatchFileWriter(sink, batch.schema) writer.write_batch(batch) writer.close() arrow_buffer = sink.getvalue() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_data(self, path_to_file):\n\n line_dict, rel_dict = self.create_dicts(path_to_file)\n \n line_df = self.create_dataframe(line_dict, ['line'])\n rel_df = self.create_dataframe(rel_dict, ['relation'])\n\n line_df['relation'] = rel_df['relation']\n\n return (line_df, rel_df)", "def parse...
[ "0.6525741", "0.6446826", "0.61416113", "0.60215145", "0.60176903", "0.6013754", "0.59999347", "0.5877534", "0.58546185", "0.58350945", "0.58245367", "0.5824153", "0.5814614", "0.5803779", "0.579669", "0.5779175", "0.5779175", "0.5779175", "0.5760838", "0.573812", "0.5730688"...
0.5503513
50
Get an array of layer numbers.
def get_layers(self, distance_threshold=0.01, id_list=None, wrap_atoms=True, planes=None): if distance_threshold <= 0: raise ValueError('distance_threshold must be a positive float') if id_list is not None and len(id_list)==0: raise ValueError('id_list must contain at least one i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def LayerNumbers(self):\n\t\treturn self.acad.ActiveDocument.Layers.Count", "def get_layers(self):\n layers = []\n\n for s in self.surfaces:\n n = self.miller_to_direction(s)\n r = np.dot(self.get_positions() - self.center, n).max()\n d = self.get_layer_distance(s, ...
[ "0.7002527", "0.68405604", "0.6761364", "0.6552846", "0.64896417", "0.6471238", "0.64501387", "0.6369263", "0.6247947", "0.6211646", "0.62018305", "0.6189722", "0.61398906", "0.61100006", "0.610566", "0.6095206", "0.60398895", "0.59711653", "0.59707725", "0.5955334", "0.59398...
0.0
-1
Set the horizontal binning
def setHBin(self, hbin): with self.lock: self.hbin = hbin
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def binning_axis(self) -> int:\r\n return 0", "def set_binning(self, hbin=1, vbin=1):\n hbin,vbin=self._truncate_subsampling(hbin,vbin,self.get_supported_binning_modes())\n mask=self._subsampling_modes_inv.get((\"h\",hbin),0)|self._subsampling_modes_inv.get((\"v\",vbin),0)\n res=lib.i...
[ "0.70319426", "0.6208112", "0.58532935", "0.5777778", "0.56776464", "0.564707", "0.56289035", "0.559563", "0.5594094", "0.55438536", "0.54996", "0.5451079", "0.54449046", "0.54400843", "0.54079276", "0.53943753", "0.5387027", "0.53718865", "0.53689045", "0.5332592", "0.533259...
0.5306915
23
Returns a function that maps each index in 0, 1, ..., n1 to a distinct RGB color; the keyword argument name must be a standard mpl colormap name.
def get_cmap(n, name='jet'): return plt.cm.get_cmap(name, n)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_cmap(n, name='hsv'):\n return plt.cm.get_cmap(name, n)", "def get_cmap(n, name='hsv'):\n return plt.cm.get_cmap(name, n)", "def get_cmap(n, name='Paired'):\n return plt.cm.get_cmap(name, n)", "def get_cmap(n, name=\"hsv\"):\n return plt.cm.get_cmap(name, n)", "def get_cmap(n, name=\"hsv...
[ "0.6978127", "0.6978127", "0.69469273", "0.693004", "0.693004", "0.693004", "0.6722642", "0.6580328", "0.6511515", "0.6428703", "0.63596034", "0.6328899", "0.62881744", "0.6183527", "0.61406237", "0.61141837", "0.6093948", "0.6044784", "0.6020568", "0.5991926", "0.59613526", ...
0.70282304
0
Posterior mean. Shape should be `(N, state_dim)`.
def belief_mean(self) -> types.StatesTorch: return self._belief_mean
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mean_posterior(g: to.Tensor, lpj: to.Tensor) -> to.Tensor:\n if tvo.get_device().type == \"cpu\":\n means = _mean_post_einsum(g, lpj)\n else:\n means = _mean_post_mul(g, lpj)\n\n assert means.shape == (g.shape[0], *g.shape[2:])\n assert not to.isnan(means).any() and not to.isinf(means...
[ "0.6767287", "0.6752641", "0.6221872", "0.61010945", "0.6086918", "0.60393274", "0.5947715", "0.5930188", "0.5827165", "0.58243895", "0.5820431", "0.5808242", "0.5795329", "0.57906574", "0.57709086", "0.5751889", "0.5732148", "0.5710755", "0.5705087", "0.5705087", "0.5698799"...
0.5704198
20
Gets concatenated state if including state information about surrounding regions (i.e. if self.centralize_states). Inputs a list of states for multiple regions/surrounding regions
def _get_state(self, grid_dist, surrounding_dist): if (self.centralize_states): grid_dist = torch.tensor(grid_dist, device=self.device).float() surrounding_dist = torch.tensor(surrounding_dist, device=self.device).float() cat_dist =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def collapse_states(states):\n new_states = states[:1]\n\n for state in states[1:]:\n last_state = new_states[-1]\n if state[0] == last_state[0]:\n new_states[-1] = (state[0], last_state[1] + state[1])\n else:\n new_states.append(state)\n return new_states", "d...
[ "0.5656545", "0.55274165", "0.5512473", "0.5299964", "0.5272093", "0.5156653", "0.51385856", "0.5136022", "0.51352197", "0.5118986", "0.511303", "0.5100669", "0.5100669", "0.509301", "0.50852823", "0.50829947", "0.5076006", "0.5021228", "0.49896356", "0.49757448", "0.4969326"...
0.51125574
11
Create optimizer to optimize loss.
def _create_optimizer(self): with tf.name_scope("optimizer"): self.train_step = tf.train.AdamOptimizer(self.learning_rate).minimize(self.loss)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_optimizer(self, context, optimizer, host):\n pass", "def build_optimizer(self, loss):\n self.decay_epoch = tf.Variable(0, trainable=False)\n decay_learning_rate = tf.train.exponential_decay(self.learning_rate, self.decay_epoch, 1, 0.9)\n optimizer = tf.train.AdamOptimizer(d...
[ "0.7693938", "0.73899996", "0.71870327", "0.7182736", "0.7127072", "0.71188253", "0.710322", "0.70970905", "0.70970905", "0.7077361", "0.705512", "0.6967346", "0.6941841", "0.6929393", "0.69245315", "0.6900678", "0.68969494", "0.6868925", "0.68593407", "0.6856242", "0.6844808...
0.7803392
0
Return the Euclidean distance between the two RGB colors
def distance(rgb1, rgb2): diffs = np.array(rgb1) - np.array(rgb2) return math.sqrt(np.sum(diffs**2))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def color_distance(RGB1, RGB2):\n d2_r = (RGB1[0] - RGB2[0]) ** 2\n d2_g = (RGB1[1] - RGB2[1]) ** 2\n d2_b = (RGB1[2] - RGB2[2]) ** 2\n return d2_r + d2_g + d2_b", "def calc_color_distance(rgb1, rgb2):\n\n color1_rgb = sRGBColor(rgb1[0], rgb1[1], rgb1[2])\n color2_rgb = sRGBColor(rgb2[0], rgb2[...
[ "0.87895054", "0.855287", "0.84640765", "0.8449596", "0.8374011", "0.82654315", "0.8143393", "0.7998381", "0.7231211", "0.7079828", "0.6857891", "0.67779994", "0.6618034", "0.6535649", "0.6368964", "0.6363498", "0.6355881", "0.63459855", "0.631269", "0.62538755", "0.6237393",...
0.8705056
1
This function takes two integers and returns the L.C.M.
def lcm(x, y): # choose the greater number if x > y: greater = x else: greater = y while(True): if((greater % x == 0) and (greater % y == 0)): lcm = greater break greater += 1 return lcm
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lcmu(a, b):\n return (abs(a)*abs(b))//gcdi(a, b)", "def main():\n num_1 = 12\n num_2 = 76\n print(find_lcm(num_1, num_2))", "def lcms(argg: range) -> int:\n l = 1\n for arg in argg:\n l = lcm(l, arg)\n return l", "def lcmm(*args): \n return functools.reduce(lcm, args) ...
[ "0.70547134", "0.6673959", "0.64242965", "0.63771755", "0.62594885", "0.6247478", "0.62116", "0.62116", "0.62116", "0.6197844", "0.6145786", "0.60987806", "0.603726", "0.60279113", "0.6026516", "0.60098547", "0.60025394", "0.5975837", "0.5971994", "0.59695655", "0.59519047", ...
0.55239594
94
Returns the first element of a list, or None if the list is empty
def first(xs): if not xs: return None return xs[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hd(lst):\n return lst[0] if lst else None", "def first(l):\n return next(iter(l), None)", "def first(items):\n return next(iter(items or []), None)", "def get_first_item(videos):\n\n return next(iter(videos or []), None)", "def first(items):\r\n return items[0]", "def first(self):\n ...
[ "0.80406755", "0.80302846", "0.8004325", "0.7354087", "0.7276678", "0.7266215", "0.7239502", "0.7204735", "0.7172619", "0.7144664", "0.7068981", "0.6961452", "0.6961452", "0.6958419", "0.6929445", "0.6924983", "0.6905893", "0.68780833", "0.6830949", "0.6821738", "0.6817678", ...
0.8270392
1
Returns the second element of a list, or None if the list is empty
def second(xs): if not xs: return None return xs[1]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hd(lst):\n return lst[0] if lst else None", "def _tryGet(self, list, index, default):\n\t\tif (list and (len(list) > index)):\n\t\t\treturn list[index]\n\t\telif True:\n\t\t\treturn None", "def get_value(_list, _index):\n # print(_list, len(_list))\n if _index >= len(_list):\n return None\n...
[ "0.7374417", "0.7203344", "0.71135765", "0.6994604", "0.6896665", "0.6862682", "0.67345476", "0.6667433", "0.66275537", "0.66184473", "0.66184473", "0.65583205", "0.64308536", "0.63326424", "0.6223163", "0.6186554", "0.61208856", "0.6105704", "0.6012814", "0.5998676", "0.5969...
0.81177366
1
Load the schema and returns a resolver.
def resolver(): if RESOLVER: return RESOLVER path = str(pathlib.Path(__file__).parents[1].joinpath("schema", "app.json")) with open(path) as stream: schema = json.load(stream) globals()["RESOLVER"] = RefResolver( "https://schema.timeflux.io/app.json", None ).from_schema(schem...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_schema(schema_path):\n with open(schema_path) as schema_file:\n return Utils.parse(schema_file.read())", "def load_resolved_schema(spec_path, file_name=None, schema_obj=None, path_prefix=True):\r\n\r\n # Only one of file_name or schema_obj must be set\r\n assert bool(file_name) !...
[ "0.6660053", "0.62092996", "0.61956173", "0.6049912", "0.5907215", "0.58940905", "0.58500636", "0.58086866", "0.5803281", "0.57162046", "0.5695377", "0.5653626", "0.5607665", "0.560573", "0.5571233", "0.5545572", "0.551755", "0.551191", "0.55054605", "0.5499968", "0.5473514",...
0.6954326
0
Determines if a play at xy is valid for a given color, board, rules, and board_history.
def xy_is_valid(xy, color, board, rules, board_history): response = {"status": "valid", "result": []} # =========CAN I PLACE IT========== # if xy is off the board if xy_off_board(xy, board): response["status"] = "invalid" response["result"].append("off_board") # # if location i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def play(self, xy, color):\n validity = xy_is_valid(xy, color, self.board, self.rules, self.board_history)\n self.latest_status = validity\n self.latest_status['xy'] = xy\n self.latest_status['captured_stones'] = []\n if validity[\"status\"] == \"valid\":\n self.board ...
[ "0.6903506", "0.6562439", "0.64831406", "0.6365856", "0.6294523", "0.625615", "0.6229594", "0.6219345", "0.61834276", "0.6170517", "0.61583674", "0.61532813", "0.6105162", "0.6102976", "0.6090868", "0.60690874", "0.6065058", "0.60393775", "0.6017595", "0.5988464", "0.597279",...
0.8001413
0
The filename of the file used by the Clip.
def filename(self): return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filename(self):\n return self.system.fileName()", "def get_file_name(self):\n return str(self.get_file())", "def get_filename(self) -> str:\n return self._filename", "def name(self):\n return self._filename", "def filename(self):\n # TODO(aron): write tests for this\n...
[ "0.82746905", "0.8209836", "0.81687194", "0.81594837", "0.81515497", "0.81353366", "0.8130028", "0.8121796", "0.80918604", "0.8042954", "0.8042954", "0.8042954", "0.8042954", "0.79963917", "0.7984998", "0.79836404", "0.79742104", "0.79604155", "0.7938482", "0.7931098", "0.793...
0.77803594
31
Retrieves the value of the weight at the specified index.
def getWeightValue(self, index): return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self, index):\n assert isinstance(index, np.ndarray)\n return self.weight[index]", "def get_value_by_index(self, index):\n return self['value'][index]", "def get(self, index):\n\n return self.values[index]", "def __getitem__(self, index: int) -> float:\n return self...
[ "0.87689203", "0.7181438", "0.706173", "0.69668144", "0.69288045", "0.68978924", "0.68940663", "0.68909866", "0.68904686", "0.6868183", "0.6856889", "0.6856889", "0.6833645", "0.6803058", "0.6792595", "0.6792595", "0.6655343", "0.66103756", "0.65519375", "0.6543076", "0.65280...
0.8447705
1
Get lower limition of display range.
def get_view_min(self): return self._view_min
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_lower_bound(self):\n return self._lower_bound", "def get_lower_bound(self):\n return self._lower_bound", "def get_range(self):\n if self.size == 75:\n return 260\n elif self.size == 100:\n return 315", "def min_range(self):\n return self._min_range", ...
[ "0.70793825", "0.70793825", "0.70051867", "0.6982591", "0.6977777", "0.68374324", "0.6830206", "0.6708573", "0.6671523", "0.66703904", "0.660082", "0.6587266", "0.65488833", "0.64978236", "0.648045", "0.6436708", "0.6416972", "0.6396492", "0.6379141", "0.63777936", "0.6367582...
0.0
-1
Get upper limition of display range.
def get_view_max(self): return self._view_max
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_upper_bound(self):\n return self._upper_bound", "def getUpperBound(self) -> int:\n return self.upper_bound", "def upper_bound(self) -> float:\n ...", "def upperLimit(self):\r\n if len(self.elements) > 0:\r\n return self.elements[-1].upperLimit\r\n else:\r\n ...
[ "0.73861223", "0.72667456", "0.71877134", "0.7097942", "0.69857305", "0.6927019", "0.68643683", "0.6861172", "0.68559074", "0.67552507", "0.6694817", "0.66765517", "0.6672668", "0.6481458", "0.6469655", "0.64626026", "0.6387859", "0.6379837", "0.637326", "0.6333276", "0.62843...
0.60577494
45
Get rgba array based on the index of the layer.
def get_rgba(self, index): return self._rgba_list[index]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_rgba(self, index=None):\n # return a rendering factory\n f = self._rendering_factory()\n\n if index == None:\n if self.is_4d():\n layer_list = [self._data[..., i, self._time_point] for i in \n range(self.get_data_shape()[2...
[ "0.73017335", "0.6791928", "0.6606714", "0.6560561", "0.645005", "0.62481344", "0.6133222", "0.6115999", "0.59463406", "0.5842385", "0.5842385", "0.5820957", "0.5813535", "0.57966363", "0.5750861", "0.5711173", "0.5678377", "0.5601467", "0.55793536", "0.5578241", "0.55601627"...
0.80618024
0
Return the axial rgba value.
def get_axial_rgba(self): if self._axial_rgba.tolist(): return self._axial_rgba else: return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_rgba(self):\n\n return \"#%02X%02X%02X%02X\" % (self.r, self.g, self.b, self.a)", "def color(self):\n return self._rgba", "def color(self):\n return self._rgba", "def opacity(self):\n return self._rgba[3]", "def get_rgba(self, index):\n return self._rgba_list[inde...
[ "0.7665493", "0.75385934", "0.75385934", "0.7197896", "0.7153978", "0.7125303", "0.70636415", "0.69744277", "0.69293785", "0.6912576", "0.67103034", "0.6668755", "0.6653242", "0.65992796", "0.6570265", "0.6548942", "0.65313184", "0.6473719", "0.644481", "0.6438837", "0.638270...
0.8289647
0
Return the coronal rgba value..
def get_coronal_rgba(self): if self._coronal_rgba.tolist(): return self._coronal_rgba else: return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_coronal_rgba(self):\n f = self._rendering_factory()\n idx = self._y_shift - self._cross_pos[1]\n if self.is_4d():\n self._coronal_rgba = f(np.rot90(self._data[idx, :, :,\n self._time_point]))\n else:\n ...
[ "0.7201422", "0.71037734", "0.71037734", "0.6743551", "0.67291105", "0.64537495", "0.64133525", "0.62784797", "0.6275753", "0.62312514", "0.62000173", "0.61714095", "0.6150206", "0.61316836", "0.6104551", "0.61021864", "0.6049422", "0.6041976", "0.6012458", "0.60022616", "0.5...
0.8056088
0
Return the value whether the label is global.
def is_label_global(self): return self.label_config.is_global
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_obj_label(self) -> str:\n return \"global\"", "def is_global(self) -> bool:\n return self._parent_node.is_global()", "async def casino_is_global(self):\n return await self.db.Settings.Global()", "def globalStatus(self):\n if self.status == None:\n self.branchSta...
[ "0.6459913", "0.6430877", "0.6370527", "0.6182332", "0.6061081", "0.6038071", "0.60306877", "0.6003386", "0.59911156", "0.5949277", "0.593237", "0.5917899", "0.58878857", "0.58719796", "0.58323157", "0.5736803", "0.57320786", "0.56966174", "0.56863105", "0.5678299", "0.564761...
0.82658273
0
Move the `idx` overlay layer up.
def overlay_up(self, idx): if not self.is_top_layer(idx): self.overlay_list[idx], self.overlay_list[idx+1] = \ self.overlay_list[idx+1], self.overlay_list[idx]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def overlay_down(self, idx):\n if not self.is_bottom_layer(idx):\n self.overlay_list[idx], self.overlay_list[idx-1] = \\\n self.overlay_list[idx-1], self.overlay_list[idx]", "def _shift_up(self, idx):\n\n parent = (idx - 1) // 2\n while parent >= 0 and self.value(pa...
[ "0.73223495", "0.62882745", "0.5913029", "0.5908903", "0.583966", "0.57990915", "0.57443696", "0.5712932", "0.56981754", "0.56506264", "0.56405985", "0.56179166", "0.5595325", "0.55630577", "0.54941833", "0.545449", "0.54311603", "0.5423107", "0.54217106", "0.54142565", "0.53...
0.77540404
0
Return a RGBA array according to scalar_data, alpha and colormap.
def get_rgba(self, ol): data = ol.get_data() data = np.mean(data, 1) data = data.reshape((data.shape[0],)) return aq.array2qrgba(data, ol.get_alpha()*255, ol.get_colormap(), (ol.get_min(), ol.get_max())) # The scalar_data's alpha is belong to [0, 1].
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def colorify(data, vmin=None, vmax=None, cmap=plt.cm.Spectral):\n import matplotlib.colors as colors\n\n _vmin = vmin or min(data)\n _vmax = vmax or max(data)\n cNorm = colors.normalize(vmin=_vmin, vmax=_vmax)\n\n scalarMap = plt.cm.ScalarMappable(norm=cNorm, cmap=cmap)\n colors = map(scalarMap.t...
[ "0.6210128", "0.61788344", "0.6124456", "0.6068544", "0.5982327", "0.59599197", "0.59506154", "0.58928454", "0.5832269", "0.5753322", "0.55894727", "0.55788225", "0.5572248", "0.55605644", "0.5558151", "0.5545814", "0.5535945", "0.5462764", "0.5453705", "0.5422455", "0.542019...
0.67082644
0
Make a GET request to a given url.
def make_get_request(url, headers=None): logger.info("Inside: make_get_request") logger.debug("make_get_request: parameters - {}, {}".format(url, headers)) timeout = get_config(REQUEST_TIMEOUT,"timeout") if not headers: headers = {} resp = requests.get(url, verify=...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self, url):\n return self._request('GET', url)", "def get(url, to_error=_default_to_error, **kwargs):\n\n return request('get', url, to_error=to_error, **kwargs)", "def _get(self, url):\n return self._request(url)", "def __get(self, url, headers=None):\n return self.__req(url,...
[ "0.82429326", "0.8056508", "0.8034587", "0.7971968", "0.78526175", "0.7781621", "0.77788657", "0.7770209", "0.7718354", "0.7715702", "0.76806366", "0.7614757", "0.7559035", "0.75566334", "0.7551175", "0.7539317", "0.7516167", "0.7504128", "0.7457144", "0.7453447", "0.7445646"...
0.0
-1
Set up the grid of pieces.
def _make_piece(self, center, size, var): piece = Rectangle(Point(center.getX()-size/2,center.getY()-size/2),Point(center.getX()+size/2,center.getY()+size/2)) piece.setFill(self.frame_colors[var]) return piece
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup(self):\n piece_order = ['ROOK','KNIGHT','BISHOP','QUEEN','KING','BISHOP','KNIGHT','ROOK']\n for row,colour in zip([0,7],['BLACK','WHITE']):\n for col,piece in enumerate(piece_order):\n self.board[row][col] = colour + '_' + piece\n \n for row,c...
[ "0.7582675", "0.7193293", "0.70512676", "0.6998098", "0.67977625", "0.678551", "0.67755485", "0.6744702", "0.67199856", "0.67043567", "0.66550803", "0.6587541", "0.65739185", "0.6572066", "0.6522965", "0.65181863", "0.6511927", "0.6506322", "0.6505394", "0.6487582", "0.644616...
0.0
-1
Create a Lnk object for a chart span.
def chartspan(cls, start, end): return cls(Lnk.CHARTSPAN, (int(start), int(end)))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_span(\n span_id,\n parent_span_id,\n trace_id,\n span_name,\n annotations,\n binary_annotations,\n):\n span_dict = {\n \"trace_id\": unsigned_hex_to_signed_int(trace_id),\n \"name\": span_name,\n \"id\": unsigned_hex_to_signed_int(span_id),\n \"annotation...
[ "0.64659476", "0.58839124", "0.5485254", "0.54468626", "0.5367596", "0.53323704", "0.5262647", "0.52176034", "0.5156349", "0.51273715", "0.5101258", "0.5040396", "0.4996374", "0.49871716", "0.4985119", "0.49740133", "0.4961186", "0.4957684", "0.49443293", "0.4944291", "0.4915...
0.65086657
0
The initial character position in the surface string. Defaults to 1 if there is no valid cfrom value.
def cfrom(self): cfrom = -1 try: if self.lnk.type == Lnk.CHARSPAN: cfrom = self.lnk.data[0] except AttributeError: pass # use default cfrom of -1 return cfrom
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getFirstChar(self):\n if self.i1 is None:\n self.firstChar = None\n else:\n chrNum = int(self.i1 // 10)\n if chrNum < 26:\n # should result in something like A4 for 4, B6 for 16\n self.firstChar = chr(ASCII_LETTER_A + chrNum) + str(se...
[ "0.63474506", "0.6059981", "0.60412896", "0.6038602", "0.5935954", "0.5863614", "0.5844159", "0.57206005", "0.5635819", "0.5627576", "0.5551494", "0.55496776", "0.5521113", "0.5498026", "0.549512", "0.54806155", "0.5472976", "0.54600775", "0.5453101", "0.539816", "0.5372901",...
0.6510111
0
The final character position in the surface string. Defaults to 1 if there is no valid cto value.
def cto(self): cto = -1 try: if self.lnk.type == Lnk.CHARSPAN: cto = self.lnk.data[1] except AttributeError: pass # use default cto of -1 return cto
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getFinal(endstr):\n if not endstr:\n return ''\n if endstr.endswith('ng'):\n return 'ng'\n lastchar = endstr[-1]\n if lastchar in ['m', 'b', 'n', \"x\", 'r', 'l', 't', 'x']:\n return lastchar\n return ''", "def _get_charindex(self, x, y):\r\...
[ "0.6121148", "0.60219514", "0.58900374", "0.5748897", "0.56483895", "0.56293297", "0.5540767", "0.55270535", "0.54674727", "0.54664826", "0.5466171", "0.5462317", "0.5461191", "0.5450948", "0.5438059", "0.54241866", "0.53827006", "0.5366417", "0.5346224", "0.5319952", "0.5316...
0.63492644
0
Return the list of all HandleConstraints in xmrs.
def hcons(xmrs): return [ HandleConstraint(hi, reln, lo) for hi, reln, lo in sorted(xmrs.hcons(), key=lambda hc: var_id(hc[0])) ]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getListOfConstraints(self, *args):\n return _libsbml.Model_getListOfConstraints(self, *args)", "def all_hardware_constraints(self) -> Iterator[Iterable]:\n return self._all_offset_pages(self.hardware_constraints_page)", "def get_constraint_list(self):\n constraints = []\n for i ...
[ "0.6361063", "0.59953797", "0.57934844", "0.57854056", "0.5713897", "0.5711933", "0.5551916", "0.55383396", "0.55383396", "0.5517613", "0.5405436", "0.5323331", "0.5322351", "0.53112686", "0.5259513", "0.5211235", "0.51599586", "0.5137013", "0.51319593", "0.5110022", "0.50909...
0.7200035
0
Test that we get the expected errors when trying to extract schema/template from a malformed request.
def test_extract_schema_and_xlsx_failures( cidc_api, url, data, error, message, clean_db, monkeypatch ): user_id = setup_trial_and_user(cidc_api, monkeypatch) with cidc_api.test_request_context(url, data=data): with pytest.raises(error, match=message): extract_schema_and_xlsx([])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_validation_wrong_schema(self):\n TT = TEITransformer(scenario='drama')\n tei_path = \"tests/test_wrong_schema/tei.xml\"\n schema_path = \"tests/test_wrong_schema/schema.rng\"\n TT.load_tei(tei_path, schema_path=schema_path)\n with self.assertRaises(ValueError):\n ...
[ "0.6561581", "0.65263474", "0.6472029", "0.64297855", "0.64257616", "0.6353334", "0.6343943", "0.62845355", "0.62829137", "0.6265546", "0.6211695", "0.62100035", "0.6196087", "0.61908257", "0.61750114", "0.615745", "0.61463755", "0.6137343", "0.613321", "0.61274034", "0.61218...
0.66764593
0
Destroys the test datastore. A new store will be recreated on demand
def create_test_db(self, *args, **kw): self.destroy_test_db() self.connection.use_test_datastore = True self.connection.flush()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy_test_db(self, *args, **kw):\n from django.db.backends.appengine.base import destroy_datastore, \\\n get_test_datastore_paths\n destroy_datastore(*get_test_datastore_paths())", "def tearDown(self):\r\n\r\n db.session.remove()\r\n db.drop_all()\r\n db.engine.dispose()"...
[ "0.8146242", "0.7390405", "0.73634195", "0.7312808", "0.73012584", "0.73012584", "0.73012584", "0.73012584", "0.73012584", "0.72925955", "0.7271508", "0.7271508", "0.7271508", "0.7271508", "0.7271508", "0.7271508", "0.7271508", "0.72382206", "0.7218776", "0.7218776", "0.72060...
0.0
-1
Information about the applied override's adjustment.
def adjustment(self) -> pulumi.Input['GoogleCloudChannelV1RepricingAdjustmentArgs']: return pulumi.get(self, "adjustment")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def adjust(self):\n if self._adjust is None:\n return \"\"\n return self._adjust", "def likelihood_adjustment(self) -> 'outputs.PreventionInspectTemplateInspectConfigRuleSetRuleHotwordRuleLikelihoodAdjustment':\n return pulumi.get(self, \"likelihood_adjustment\")", "def __adjust...
[ "0.64681786", "0.633576", "0.6270344", "0.6149986", "0.6149986", "0.6149986", "0.6149986", "0.6149986", "0.6149986", "0.6149986", "0.6149986", "0.603982", "0.5950941", "0.5678659", "0.56663364", "0.55828214", "0.55784184", "0.55784184", "0.5545048", "0.5538945", "0.55189", ...
0.5512131
22
The customer account contact's first name. Optional for Team customers.
def first_name(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "first_name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_contact_first_name(app):\n name = app.get(CONTACT_NAME_KEY)\n if name:\n return ' {}'.format(name.split(' ')[0])", "def get_first_name(self) -> str:\n return self.first_name", "def first_name(self, instance):\r\n return instance.user.first_name", "def get_first_name(self):...
[ "0.7792345", "0.77193826", "0.7678259", "0.7661633", "0.7622839", "0.76185143", "0.7580362", "0.7580362", "0.7580362", "0.7476706", "0.73603135", "0.73603135", "0.7353753", "0.7340589", "0.7285186", "0.7281082", "0.7132457", "0.71103144", "0.71103144", "0.71103144", "0.711031...
0.7302261
15
The customer account contact's last name. Optional for Team customers.
def last_name(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "last_name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def contact_name(self) -> str:\n return pulumi.get(self, \"contact_name\")", "def get_last_name(self) -> str:\n return self.last_name", "def contact_full_name(self):\n first = self.contact_first_name\n last = self.contact_last_name\n if first and last:\n return f'{...
[ "0.7497058", "0.7436557", "0.7363904", "0.7311615", "0.7264105", "0.72590095", "0.7216623", "0.7216623", "0.7216623", "0.7216623", "0.71846634", "0.7123019", "0.7123019", "0.7123019", "0.7123019", "0.7123019", "0.71137047", "0.70907587", "0.7084675", "0.7064056", "0.70507866"...
0.7141094
12
Optional. The customer account contact's job title.
def title(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "title")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def job_title(self):\n if \"jobTitle\" in self._prop_dict:\n return self._prop_dict[\"jobTitle\"]\n else:\n return None", "def get_job_title(self, job_name):\n return ''", "def contact_name(self) -> str:\n return pulumi.get(self, \"contact_name\")", "def comp...
[ "0.7641992", "0.71686107", "0.6784431", "0.65444165", "0.6453559", "0.6217823", "0.621471", "0.61932194", "0.61932194", "0.6184656", "0.6164579", "0.614305", "0.60314685", "0.60212153", "0.5941115", "0.5880616", "0.58134943", "0.5805665", "0.57839584", "0.57775134", "0.574934...
0.56111115
37
A condition that applies the override if a line item SKU is found in the SKU group.
def __init__(__self__, *, sku_group: Optional[pulumi.Input[str]] = None): if sku_group is not None: pulumi.set(__self__, "sku_group", sku_group)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sku_group_condition(self) -> Optional[pulumi.Input['GoogleCloudChannelV1SkuGroupConditionArgs']]:\n return pulumi.get(self, \"sku_group_condition\")", "def __init__(__self__, *,\n sku_group_condition: Optional[pulumi.Input['GoogleCloudChannelV1SkuGroupConditionArgs']] = None):\n ...
[ "0.6044042", "0.5746372", "0.5694569", "0.5430076", "0.51535046", "0.51031715", "0.503042", "0.493424", "0.48414806", "0.47995275", "0.47812307", "0.477423", "0.47433776", "0.47258678", "0.47177172", "0.46822897", "0.46800578", "0.4643023", "0.45833415", "0.45827585", "0.4582...
0.49398923
7
Represents a boolean value.
def bool_value(self) -> Optional[pulumi.Input[bool]]: return pulumi.get(self, "bool_value")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def as_bool(self):\n return self.as_type(bool)", "def as_bool(self):\n return InvenTree.helpers.str2bool(self.value)", "def __bool__(self):\n return bool(self._value)", "def __bool__(x):\n if x.value == 1:\n return True\n elif x.value == -1:\n return F...
[ "0.8171711", "0.79176533", "0.79074687", "0.77339935", "0.7702596", "0.7608289", "0.76042753", "0.75370306", "0.7447051", "0.7424214", "0.7391484", "0.73525786", "0.7333203", "0.73250335", "0.73141795", "0.7279285", "0.7265322", "0.7239891", "0.7235936", "0.7217865", "0.72163...
0.7464486
8
Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.
def day(self) -> Optional[pulumi.Input[int]]: return pulumi.get(self, "day")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def day_of_month(self) -> pulumi.Input[int]:\n return pulumi.get(self, \"day_of_month\")", "def day_of_month(self) -> pulumi.Input[int]:\n return pulumi.get(self, \"day_of_month\")", "def date_day_of_month(date):\n return date.day", "def day_of_month():\n return datetime.date.today().day"...
[ "0.78264034", "0.78264034", "0.7365147", "0.7322238", "0.7300431", "0.72926855", "0.72126603", "0.7152776", "0.7146667", "0.6988126", "0.6946233", "0.6840761", "0.6834312", "0.6823852", "0.6798959", "0.6769465", "0.6745272", "0.6745272", "0.6745272", "0.6733407", "0.6688325",...
0.55479527
82
Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
def month(self) -> Optional[pulumi.Input[int]]: return pulumi.get(self, "month")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def year_month(cls,\n year: typing.Union[int, str],\n month: typing.Union[int, str])->str:\n yearstr: str\n if isinstance(year, int):\n yearstr = str(year)\n else:\n yearstr = year\n\n monthstr: str\n if isinstance(month, ...
[ "0.7242274", "0.7129018", "0.7129018", "0.704919", "0.701828", "0.6951233", "0.6854413", "0.6851171", "0.67873573", "0.67626303", "0.66844106", "0.66844106", "0.6662342", "0.6636478", "0.66256714", "0.66154677", "0.65853566", "0.65350753", "0.64979595", "0.6473835", "0.645666...
0.7181995
1
Optional. The name of the organization at the address.
def organization(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "organization")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def organization_name(self):\n if self.organization is not None:\n return self.organization.name\n\n return ''", "def vpp_organization_name(self):\n if \"vppOrganizationName\" in self._prop_dict:\n return self._prop_dict[\"vppOrganizationName\"]\n else:\n ...
[ "0.7790106", "0.7069068", "0.6754064", "0.6665562", "0.6665562", "0.66615885", "0.66615885", "0.65078914", "0.6504788", "0.6485334", "0.64737356", "0.64331084", "0.6421723", "0.6348785", "0.6323888", "0.6315996", "0.62830526", "0.62830526", "0.62811846", "0.624367", "0.621383...
0.73722714
1
Wrapper for inserting an int64 Feature into a SequenceExample proto, e.g, An integer label.
def _int64_feature(value): if isinstance(value, list): return tf.train.Feature(int64_list=tf.train.Int64List(value=value)) else: return tf.train.Feature(int64_list=tf.train.Int64List(value=[value]))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_int_feature(val):\n return tf.train.Feature(int64_list=tf.train.Int64List(value=[val]))", "def _int64_feature(value):\n return tf.train.Feature(int64_list=tf.train.Int64List(value=[value]))", "def _int64_feature(value):\n return tf.train.Feature(int64_list=tf.train.Int64List(value=...
[ "0.7299501", "0.71171963", "0.71171963", "0.71006024", "0.71006024", "0.71006024", "0.71006024", "0.710034", "0.70988375", "0.70951355", "0.70951355", "0.70951355", "0.70951355", "0.70951355", "0.70951355", "0.7090496", "0.70794064", "0.707064", "0.707064", "0.707064", "0.704...
0.6941297
29
Wrapper for inserting a float Feature into a SequenceExample proto, e.g, An integer label.
def _float_feature(value): if isinstance(value, list): return tf.train.Feature(float_list=tf.train.FloatList(value=value)) else: return tf.train.Feature(float_list=tf.train.FloatList(value=[value]))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_float_feature(val):\n return tf.train.Feature(float_list=tf.train.FloatList(value=[val]))", "def _float_feature(value):\n\treturn tf.train.Feature(float_list=tf.train.FloatList(value=[value]))", "def _float_feature(value):\n return tf.train.Feature(float_list=tf.train.FloatList(value=[val...
[ "0.7624881", "0.7340008", "0.73208255", "0.7303178", "0.7296897", "0.7279157", "0.7279157", "0.7279157", "0.7279157", "0.7279157", "0.7274366", "0.7274366", "0.7274366", "0.7252627", "0.7246655", "0.7246655", "0.72241676", "0.7204836", "0.7155549", "0.7140837", "0.7055061", ...
0.7165053
18
Returns True if var should be enqueued under the allreduceddomains condition, otherwise False
def condition_domain_reduction(csp, var) : return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def condition_singleton(csp, var) :\n if len(csp.get_domain(var))==1:\n return True\n return False", "def condition_singleton(csp, var) :\n return len(csp.get_domain(var))==1", "def any_holds(self, domains, const, env, other_vars, ind=0, assigned_vars=[]):\r\n # All the variables in the ...
[ "0.6266483", "0.6244565", "0.5520561", "0.54768187", "0.54488117", "0.53815776", "0.5379856", "0.53665817", "0.5323892", "0.53189266", "0.53080404", "0.53080404", "0.5259626", "0.5238504", "0.5214258", "0.51896834", "0.517287", "0.51705825", "0.515921", "0.5147182", "0.514177...
0.65047663
0
Returns True if var should be enqueued under the singletondomains condition, otherwise False
def condition_singleton(csp, var) : return len(csp.get_domain(var))==1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def condition_singleton(csp, var) :\n if len(csp.get_domain(var))==1:\n return True\n return False", "def is_shared_with_domain(self):\n return self.has_label(SHAREDWITHDOMAIN_LABEL)", "def condition_domain_reduction(csp, var) :\n return True", "def condition_domain_reduction(csp, var) :\n...
[ "0.7756876", "0.63593775", "0.6247522", "0.6247522", "0.60227716", "0.60227716", "0.60098934", "0.58346474", "0.58118457", "0.58118457", "0.56884605", "0.55647767", "0.55628127", "0.5549823", "0.5527307", "0.5527307", "0.54771113", "0.5420036", "0.53995144", "0.5397797", "0.5...
0.75150746
1
Formats an array of hex_ lines as PIC memory regions.
def __formatAsPICFlash(self, hex_): flash = [0xff for _ in range(32768)] EEPROM = [0xff for _ in range(256)] IDlocs = [0xff for _ in range(16)] Config = [0xff for _ in range(14)] addressMSB = 0 for line in hex_: address, type_, Data, _ = self.__byteLine(line)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __formatHex(self,hex_):\n output = []\n lineEnd = hex_.find('\\n')\n while lineEnd > 0:\n output.append(hex_[0:lineEnd])\n hex_ = hex_[lineEnd+1:len(hex_)]\n lineEnd = hex_.find('\\n')\n Flash, EEPROM,IDlocs,Config = self.__formatAsPICFlash(output)\n...
[ "0.6395887", "0.5985178", "0.5865674", "0.5750776", "0.558059", "0.5476874", "0.5474772", "0.54195386", "0.534433", "0.531699", "0.528906", "0.52683526", "0.5236294", "0.5231788", "0.5174551", "0.50799733", "0.5066774", "0.5039858", "0.50036055", "0.50021017", "0.498331", "...
0.654575
0
Get the current observed quantum + problem state.
def observation(self): # This consists of two things: # - the measured bitstrings # - the vectorized representation of the optimization problem # # In particular, the first 10*NUM_SHOTS (i.e. 100) entries are measured # qubit values. The remaining entries are the weights ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_state(self):\r\n return self.currentObservation", "def get_state(self):\n return self.env.sim.get_state()", "def get_state(self):\n return self.fmu._get_continuous_states()", "def getObservation(self):\n return self._cur_state", "def state(self):\n return self._cu...
[ "0.72964627", "0.7266658", "0.72195053", "0.68331105", "0.67150915", "0.6708736", "0.668138", "0.6613345", "0.66111904", "0.66097796", "0.65870893", "0.65547115", "0.6547005", "0.6499935", "0.64743686", "0.64612037", "0.64449465", "0.6439338", "0.64211774", "0.6412145", "0.64...
0.0
-1
Compare two lists of samples. Sadly, the builtin assertListsEqual will only use Python's builtin equality predicate for testing the equality of elements in a list. Since we compare lists of samples a lot, we need a custom test for that.
def assertSampleListsEqualUpToTimestamp(self, a, b, msg=None): self.assertEqual(len(a), len(b), msg or 'Lists %s and %s are not the same length' % (a, b)) for i in range(len(a)): self.assertIsInstance(a[i], sample.Sample, msg or ('%s (item %s in list) is '...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def assertSampleInList(self, a, b, msg=None): # pylint:disable=invalid-name\n found = False\n for s in b:\n try:\n self.assertSamplesEqualUpToTimestamp(a, s, msg=msg)\n except self.failureException:\n continue\n found = True\n if not found:\n msg = msg or f'{a} not found...
[ "0.72095126", "0.7027555", "0.698861", "0.6925367", "0.6863228", "0.65340215", "0.6497322", "0.64874417", "0.64473253", "0.6435387", "0.63922477", "0.63859856", "0.6326854", "0.62996775", "0.62980187", "0.6297717", "0.6276233", "0.62475216", "0.62454253", "0.6224324", "0.6221...
0.7248356
0
Reads a .nii.gz image and returns as a numpy array.
def read_img(img_path): return sitk.GetArrayFromImage(sitk.ReadImage(img_path))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_nii(img_path):\n nimg = nib.load(img_path)\n return np.asanyarray(nimg.dataobj), nimg.affine, nimg.header", "def read_image(path, file_format='nii.gz'):\n path = path + '.' + file_format\n if file_format == 'npy':\n image = np.load(path)\n elif file_format == 'npz':\n image ...
[ "0.68833756", "0.6831727", "0.6752311", "0.67324984", "0.6709123", "0.66493905", "0.6587188", "0.65725565", "0.65658116", "0.6532316", "0.64667255", "0.6410613", "0.6398219", "0.6398219", "0.6395882", "0.6385923", "0.63654405", "0.6362851", "0.63444656", "0.6344321", "0.63340...
0.6196183
32
Get the minimum and maximum data values out of all fields given. Returns them in a dictionary with the 'vmin' and 'vmax' keys.
def minmax(data, fields): vmin = min(data[field].min() for field in fields) vmax = max(data[field].max() for field in fields) return dict(vmin=vmin, vmax=vmax)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_vmin_vmax(container, field, vmin, vmax):\n field_dict = container.fields[field]\n field_default_vmin, field_default_vmax = get_field_limits(field)\n if vmin is None:\n if \"valid_min\" in field_dict:\n vmin = field_dict[\"valid_min\"]\n else:\n vmin = field_de...
[ "0.7170725", "0.6705425", "0.6650606", "0.63413465", "0.63180965", "0.6250006", "0.62144965", "0.61855257", "0.6141788", "0.6137924", "0.6019095", "0.6007941", "0.59958404", "0.5957595", "0.5918519", "0.5902958", "0.5876493", "0.5865364", "0.5848997", "0.5832676", "0.58115536...
0.84713185
0
Build and return a data loader.
def get_loader(m,image_dir, attr_path, selected_attrs, crop_size=178, image_size=128, batch_size=16, dataset='CelebA', mode='train', num_workers=1): transform = [] transform.append(T.ToTensor()) #transform.append(T.Normalize(mean=[0.5], std=[0.5])) transform = T.Compose(transform) i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_loader(data, json, batch_size, shuffle, num_workers):\n dataset = FinNumDataset(data, json)\n\n data_loader = torch.utils.data.DataLoader(dataset=dataset,\n batch_size=batch_size,\n shuffle=shuffle,\n ...
[ "0.74896806", "0.7352408", "0.7116231", "0.703314", "0.6993853", "0.69911397", "0.69694024", "0.69258267", "0.6925624", "0.6866596", "0.68356377", "0.68205285", "0.6814369", "0.6809004", "0.6807265", "0.6693439", "0.66928136", "0.6689916", "0.66793126", "0.665312", "0.6646554...
0.60061276
74
determine the path to our sample data file
def data_path(filename): data_dir = os.path.join(os.path.dirname(__file__), 'data') return os.path.join(data_dir, filename)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_sample_data_dir():\n \n return resource_filename('cdat_lite.test.test_cdms', 'sample_data')", "def sample_data_path(name):\n import os.path as op\n data_dir = op.join(op.dirname(__file__), \"data\")\n data_path = op.join(data_dir, name + \".csv\")\n return op.abspath(data_path)", "def...
[ "0.815553", "0.8041992", "0.76998943", "0.76052266", "0.754311", "0.75385785", "0.74899507", "0.7474434", "0.744115", "0.73755395", "0.73610437", "0.7325869", "0.73030305", "0.7300815", "0.7299489", "0.7241678", "0.71912354", "0.7180181", "0.7169393", "0.7169393", "0.7169393"...
0.7279488
15
Get the status of the last command.
def _checkCommandStatus(self, lastCommand=False): p = self.spawnProc p.sendline('echo $?') regex = re.compile('^[0-9]+',re.M) p.expect(regex, 2) msg = '_checkCommandStatus : Execution of command FAILED' if lastCommand: msg = '_checkCommandStatus :Execution of com...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def status(self):\n if not self._last_command:\n return None\n return self._last_command.status()", "def last_command(self):\n return self._last_command", "def get_last_cmd(self):\r\n return self.command_manager.get_last_command()", "def get_last_cmd(self):\n sel...
[ "0.85841346", "0.80255747", "0.79191685", "0.75476265", "0.7470923", "0.7128421", "0.6973295", "0.6875427", "0.671908", "0.6672993", "0.6584779", "0.6539575", "0.6512024", "0.65004677", "0.64839524", "0.6448567", "0.6362467", "0.6350821", "0.63284713", "0.63284713", "0.632847...
0.6312976
22
Merge two disjoint dictionaries.
def merge(dict1: dict, dict2: dict): if dict1 is None or dict2 is None: return None keys1 = dict1.keys() keys2 = dict2.keys() if keys1 & keys2 != set(): raise Exception("Non linear patterns not supported") dict_r = {k: dict1[k] for k in keys1} dict_r.update({k: dict2[k] for k in ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mergedict(x, y):\n z = x.copy()\n z.update(y)\n return z", "def merge_dicts(d1, d2):\n return {**d1, **d2}", "def merge(a: dict, b: dict) -> dict:\n return __merge(a, b)", "def merge_two_dicts(x, y):\n\tz = x.copy()\n\tz.update(y)\n\treturn z", "def dict_merge(dict1, dict2):\n combine...
[ "0.8185076", "0.81340766", "0.80996025", "0.8063146", "0.80501664", "0.80501664", "0.7984098", "0.7963058", "0.7963058", "0.7963058", "0.79309267", "0.79159224", "0.79159224", "0.79159224", "0.79159224", "0.79159224", "0.79159224", "0.79159224", "0.79159224", "0.78350335", "0...
0.7221186
39
Atrous convolutional encoderdecoder noiseremoving network
def architecture(lq, img=None, mode=None): phase = mode == tf.estimator.ModeKeys.TRAIN #phase is true during training concat_axis = 3 ##Reusable blocks def conv_block(input, filters, phase=phase): """ Convolution -> batch normalisation -> leaky relu phase defaults to...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def encoder_decoder_archi_gan(inputs, is_train):\n\n encoder_layers = []\n\n encoded = inputs\n\n encoder_layers.append(encoded)\n\n for i in range(config.encoder_layers):\n encoded = encoder_conv_block_gan(encoded, i, is_train)\n encoder_layers.append(encoded)\n \n encoder_layers.r...
[ "0.7034987", "0.6719251", "0.66967565", "0.6695504", "0.66408736", "0.6586023", "0.65751356", "0.6571458", "0.6548709", "0.6514774", "0.6481307", "0.64681315", "0.64538115", "0.64408207", "0.6385122", "0.6372874", "0.63628376", "0.634039", "0.63384914", "0.6325727", "0.632502...
0.0
-1
Read an image and make sure it is of the correct type. Optionally resize it
def load_image(addr, resizeSize=None, imgType=np.float32): img = imread(addr, mode='F') if resizeSize: img = cv2.resize(img, resizeSize, interpolation=cv2.INTER_CUBIC) img = img.astype(imgType) return img
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_image(img_path):\n\tgot_img = False\n\twhile not got_img:\n\t\ttry:\n\t\t\timg = Image.open(img_path).convert('RGB')\n\t\t\timg = img.resize((100,100),Image.ANTIALIAS)\n\t\t\tgot_img = True\n\t\texcept IOError:\n\t\t\tprint(\"IOError incurred when reading '{}'. Will redo. Don't worry. Just chill.\".format...
[ "0.768873", "0.6867543", "0.6867074", "0.6697566", "0.6684844", "0.66799545", "0.6655961", "0.6646339", "0.65975416", "0.65720755", "0.6555251", "0.6546531", "0.6539075", "0.653144", "0.65288097", "0.6526716", "0.65264577", "0.65234715", "0.6509744", "0.6491886", "0.64854115"...
0.6561093
10
Compute the lowest common multiple of a and b
def lcm(a, b): return a * b / gcd(a, b)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lowest_common_multiple(a, b):\n # 两个数字相乘后除以最大公约数 = 两个数字的最小公倍数\n return a * b // gcd(a, b)", "def least_common_multiple(number1, number2):\n return number1 * number2 // math.gcd(number1, number2)", "def lcm(a, b):\n\treturn a * b // gcm(a, b)", "def lcm(a, b):\r\n return a * b // gcd(a, b)", ...
[ "0.8656762", "0.7699587", "0.751018", "0.74660754", "0.7448883", "0.7434913", "0.7434913", "0.74067616", "0.7391243", "0.73856294", "0.73856294", "0.73856294", "0.73856294", "0.73856294", "0.73856294", "0.73856294", "0.73856294", "0.73856294", "0.73724526", "0.7368171", "0.73...
0.7313603
25
Expiration date must be later than current date.
def clean_expiration_date(self): expiration_date = self.cleaned_data['expiration_date'] if expiration_date.date() <= datetime.date.today(): v_err('elapsed') return expiration_date
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_content_expiry_date(self):\n\n if self.expire_date < datetime.now():\n self.state = 'disabled'", "def is_expired(self):\n return self.expiration_date <= self._now()", "def new_token_expiry_date():\n\treturn timezone.now() + datetime.timedelta(days=TOKEN_VALID_DATE)", "def e...
[ "0.72060245", "0.708831", "0.70040673", "0.68701863", "0.68240446", "0.68205404", "0.6815583", "0.6783168", "0.67700243", "0.67384285", "0.6720544", "0.67083985", "0.66864276", "0.6671998", "0.66418046", "0.66262186", "0.6606598", "0.65987456", "0.6595991", "0.6579022", "0.65...
0.8067124
0
skip the musics a given number of times.
async def handle_skip( self, source: Union[Context, ApplicationCommandInteraction], skips: int ): player = self.bot.lavalink.player_manager.get(source.guild.id) if not player or not player.is_playing: if isinstance(source, Context): return await source.reply( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def skip(self, n=None):\n while n > 0:\n try:\n self.next()\n except StopIteration:\n break\n n -= 1", "def skip(t, n):\n pu(t)\n fd(t, n)\n pd(t)", "def skip(t, n):\n pu(t)\n fd(t, n)\n pd(t)", "def skip(self, n):\n ...
[ "0.68989056", "0.68135107", "0.68135107", "0.67195433", "0.6500526", "0.6234597", "0.61772317", "0.60664093", "0.6064407", "0.5871902", "0.5857181", "0.5855", "0.5850078", "0.5846271", "0.5777689", "0.5770854", "0.57670856", "0.57559097", "0.57491964", "0.57293135", "0.572841...
0.0
-1
Gets the traversible nodes connected to the given node
def get_connected_nodes(node, current_path_len) : connected_nodes = [] #A list of the connected nodes closed_list_coords = get_path_coordinates(closed_list) #Checking if the node belongs to the 1st row if(node.coords[0] != 0) : connected_node = Node((node.coords[0] - 1, node.coords[1]),...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_connected_nodes(self, node):\n assert node in self.nodes, \"No node \"+str(node)+\" in graph \"+str(self)\n result = [x.node2 for x in self.edges if x.node1 == node]\n result += [x.node1 for x in self.edges if x.node2 == node]\n return sorted(result)", "def neighbors(self, nod...
[ "0.72749406", "0.67746633", "0.6759875", "0.66136444", "0.65834", "0.6572373", "0.6556183", "0.6499591", "0.64849395", "0.6431052", "0.6393956", "0.6339296", "0.6319055", "0.6305303", "0.6277828", "0.6270185", "0.62611526", "0.62391496", "0.62284285", "0.62163776", "0.621033"...
0.60568494
34
Returns the node with the lowest f(n) value
def get_node_with_lowest_fn(nodes) : next_nodes = [nodes[0]] #The nodes having the lowest f(n) value min_fn = next_nodes[0].fn_value for a in range(1, nodes.__len__()) : if(nodes[a].fn_value < min_fn) : next_nodes.clear() next_nodes.append(nodes[a]) elif(no...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_next_node() :\r\n\r\n #Checking if any traversible nodes are left\r\n if(open_list.__len__() == 0) :\r\n raise Exception(\"No traversible nodes left\")\r\n\r\n next_nodes = get_node_with_lowest_fn(open_list) #Getting the list of nodes having min. f(n) value\r\n\r\n #In case of multiple n...
[ "0.77286935", "0.72159433", "0.71630234", "0.7093565", "0.69725245", "0.69429374", "0.6941032", "0.6941032", "0.68645775", "0.6781886", "0.67465544", "0.6687578", "0.6645233", "0.6592556", "0.65811986", "0.6534123", "0.65082204", "0.6500464", "0.648173", "0.6467217", "0.64624...
0.82525194
0
Gets the id of this Story.
def id(self) -> str: return self._id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_id(self) -> int:\n return self.id", "def get_id(self) -> int:\n return self.id", "def get_id(self):\n return self._id", "def get_id(self):\n return self._id", "def get_id(self):\n return self._id", "def get_id(self):\n return self._id", "def get_id(self...
[ "0.7230071", "0.7230071", "0.7192358", "0.7192358", "0.7192358", "0.7192358", "0.7192358", "0.7192358", "0.71823955", "0.71823955", "0.71823955", "0.71823955", "0.71823955", "0.71823955", "0.71823955", "0.71823955", "0.71823955", "0.71823955", "0.71823955", "0.71823955", "0.7...
0.0
-1
Sets the id of this Story.
def id(self, id: str): self._id = id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_id(self, id_):\n\n self.id_ = id_", "def SetId(self, id):\n self.id = int(id)", "def set_id(self, id):\n self.__id = id", "def set_id(self, id):\n self.data['id'] = id", "def set_id(self, id_=None):\n if id_ is None:\n self.id = id(self)\n else:\...
[ "0.7910972", "0.7864385", "0.7841138", "0.7560617", "0.7451817", "0.74191284", "0.74191284", "0.74191284", "0.7295644", "0.7295644", "0.7295644", "0.7295644", "0.7268525", "0.7268525", "0.7268525", "0.7268525", "0.7268525", "0.7268525", "0.7268525", "0.7268525", "0.7268525", ...
0.7126517
49
Gets the title of this Story.
def title(self) -> str: return self._title
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_title(self):\n\n return self._title", "def get_title(self):\n return self._title", "def get_title(self):\n return self._title", "def get_title(self):\n return self._title", "def GetTitle(self):\n return self._title", "def get_title(self):\n\n return self....
[ "0.8337889", "0.8288037", "0.8288037", "0.8288037", "0.8226382", "0.8225985", "0.82134277", "0.8210672", "0.81747717", "0.8133048", "0.8133048", "0.8133048", "0.8099288", "0.8099288", "0.80773455", "0.80773455", "0.80773455", "0.8061325", "0.80016226", "0.80004025", "0.798600...
0.7960736
32
Gets the language of this Story.
def language(self) -> str: return self._language
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_language(self):\n return self.lang", "def get_language(self) -> str:\n return self.language", "def get_language(self):\r\n return self.language", "def get_language(self):\n return self.language if self.language is not None else get_language()", "def getLanguage(self):\n ...
[ "0.8440217", "0.838971", "0.8366327", "0.834408", "0.83390236", "0.8177342", "0.8177342", "0.8177342", "0.8177342", "0.8126395", "0.80739707", "0.80739707", "0.8062268", "0.79925007", "0.7973103", "0.79013973", "0.78624845", "0.77977353", "0.7777915", "0.7704962", "0.76238203...
0.8058001
13
Gets the last_updated of this Story.
def last_updated(self) -> str: return self._last_updated
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_last_updated_at(self):\n return self.last_updated", "def last_updated(self):\n return self._last_updated", "def last_updated_time(self) -> datetime.datetime:\n return self.__last_updated_time", "def last_updated_time(self) -> datetime.datetime:\n return self.__last_updated...
[ "0.8506428", "0.83723813", "0.80457616", "0.80457616", "0.7930438", "0.7930438", "0.7920399", "0.79116416", "0.783833", "0.77051", "0.76783067", "0.7646555", "0.76236415", "0.76236415", "0.76236415", "0.7558648", "0.7504475", "0.74708", "0.7465272", "0.7451058", "0.73937917",...
0.79713446
4
Represents the desired status of AutodefinedReverse. The only supported value on creation is DISABLE. Deletion of this resource will return AutodefinedReverse to its default value (ENABLED).
def autodefined_reverse_flag(self) -> pulumi.Input['ResolverConfigAutodefinedReverseFlag']: return pulumi.get(self, "autodefined_reverse_flag")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def autodefined_reverse_flag(self) -> pulumi.Output['ResolverConfigAutodefinedReverseFlag']:\n return pulumi.get(self, \"autodefined_reverse_flag\")", "def autodefined_reverse(self) -> pulumi.Output['ResolverConfigAutodefinedReverse']:\n return pulumi.get(self, \"autodefined_reverse\")", "def rev...
[ "0.73051596", "0.663213", "0.5907232", "0.58916193", "0.5658327", "0.5557229", "0.5544798", "0.54859585", "0.5480024", "0.5278884", "0.525857", "0.5256612", "0.5245784", "0.5241865", "0.52145123", "0.5208916", "0.51684713", "0.51639456", "0.51639456", "0.51639456", "0.5159974...
0.7161443
1
Get an existing ResolverConfig resource's state with the given name, id, and optional extra properties used to qualify the lookup.
def get(resource_name: str, id: pulumi.Input[str], opts: Optional[pulumi.ResourceOptions] = None) -> 'ResolverConfig': opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id)) __props__ = ResolverConfigArgs.__new__(ResolverConfigArgs) __props__.__dict__[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(resource_name: str,\n id: pulumi.Input[str],\n opts: Optional[pulumi.ResourceOptions] = None,\n minimal_action: Optional[pulumi.Input[str]] = None,\n most_disruptive_allowed_action: Optional[pulumi.Input[str]] = None,\n name: Optional[pulumi.Input[str]...
[ "0.6204736", "0.60779256", "0.55041325", "0.549924", "0.5468856", "0.5464667", "0.5451863", "0.5370206", "0.5284806", "0.52826846", "0.52691156", "0.52659875", "0.52613145", "0.52353305", "0.52123976", "0.5170283", "0.5154431", "0.5097096", "0.5089075", "0.5079566", "0.506479...
0.7398485
0
ResolverAutodefinedReverseStatus, possible values are ENABLING, ENABLED, DISABLING AND DISABLED.
def autodefined_reverse(self) -> pulumi.Output['ResolverConfigAutodefinedReverse']: return pulumi.get(self, "autodefined_reverse")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def autodefined_reverse_flag(self) -> pulumi.Output['ResolverConfigAutodefinedReverseFlag']:\n return pulumi.get(self, \"autodefined_reverse_flag\")", "def autodefined_reverse_flag(self) -> pulumi.Input['ResolverConfigAutodefinedReverseFlag']:\n return pulumi.get(self, \"autodefined_reverse_flag\")...
[ "0.71167713", "0.6977469", "0.59964216", "0.5370464", "0.5363249", "0.5191072", "0.5104861", "0.50438", "0.5015002", "0.49085754", "0.49004644", "0.4890956", "0.4868065", "0.4856696", "0.48551", "0.4853732", "0.48107553", "0.47973374", "0.47712496", "0.47683477", "0.4767775",...
0.6859768
2
Represents the desired status of AutodefinedReverse. The only supported value on creation is DISABLE. Deletion of this resource will return AutodefinedReverse to its default value (ENABLED).
def autodefined_reverse_flag(self) -> pulumi.Output['ResolverConfigAutodefinedReverseFlag']: return pulumi.get(self, "autodefined_reverse_flag")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def autodefined_reverse_flag(self) -> pulumi.Input['ResolverConfigAutodefinedReverseFlag']:\n return pulumi.get(self, \"autodefined_reverse_flag\")", "def autodefined_reverse(self) -> pulumi.Output['ResolverConfigAutodefinedReverse']:\n return pulumi.get(self, \"autodefined_reverse\")", "def reve...
[ "0.71617717", "0.6632693", "0.5907064", "0.5890856", "0.56581074", "0.55559796", "0.5545745", "0.54846483", "0.5480208", "0.52781993", "0.5259221", "0.5255687", "0.5244615", "0.5240467", "0.52141154", "0.52078754", "0.5167775", "0.51627016", "0.51627016", "0.51627016", "0.515...
0.7305635
0
Return a model query with the given filters. The query can be further customised like any ndb query.
def query_items(self, request, params, payload): return util.ndb_query_from_values(self.model, params).fetch()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_query(self):\n q = db.Query(self.KIND,keys_only=self.KEYS_ONLY)\n for prop, value in self.FILTERS:\n q.filter(\"%s =\" % prop, value)\n if self.ancestor:\n q.ancestor(self.ancestor)\n q.order(self.ORDER_BY)\n return q", "def _query(self, model_clas...
[ "0.7224415", "0.71591187", "0.7055946", "0.7000515", "0.6919749", "0.673474", "0.673474", "0.6728667", "0.67158836", "0.66816056", "0.66816056", "0.6646679", "0.65985286", "0.6587082", "0.6571315", "0.6567594", "0.65670377", "0.6559406", "0.65228444", "0.6507321", "0.65055203...
0.0
-1
Constructs a unittest.TestSuite() of all tests for the package. For use with setuptools.
def make_suite(): loader = unittest.TestLoader() suite = unittest.TestSuite() for test_class in test_classes(): tests = loader.loadTestsFromTestCase(test_class) suite.addTests(tests) return suite
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_suite():\n suite = unittest.TestSuite()\n suite.addTests(unittest.makeSuite(PrimesTests))\n suite.addTests(unittest.makeSuite(OtherTests))\n return suite", "def test_suite():\n testSuite = unittest.TestSuite()\n testSuite.addTest(test_polarization.test_suite())\n testSuite.addTest(t...
[ "0.80675244", "0.80487823", "0.8047829", "0.7925123", "0.7895874", "0.7878787", "0.7877061", "0.78548247", "0.7845186", "0.78109604", "0.77671796", "0.7763236", "0.77559173", "0.7684807", "0.76843953", "0.76776135", "0.7671302", "0.7665609", "0.76624185", "0.7595074", "0.7575...
0.7632531
20
Get all unposted records
def get_haikus_unposted(cls, db_session) -> list: q = ( db_session.query(cls) .filter(cls.date_posted == None) # noqa: E711 .filter(cls.date_deleted == None) # noqa: E711 ) return q.all()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_haikus_posted(cls, db_session) -> list:\n q = (\n db_session.query(cls)\n .filter(cls.date_posted != None) # noqa: E711\n .filter(cls.date_deleted == None) # noqa: E711\n )\n return q.all()", "def getAllUnpublishedObjects(self, resource='objects/unp...
[ "0.64578223", "0.5827952", "0.58128566", "0.5749792", "0.5696416", "0.56343347", "0.56191254", "0.55949026", "0.55264634", "0.5492982", "0.54400843", "0.5439492", "0.54175967", "0.54143935", "0.5410167", "0.5410167", "0.5405344", "0.5347298", "0.5337221", "0.5321562", "0.5306...
0.76658225
0
Returns CurrentUser object for the current user
def getCurrentUser(self) -> 'CurrentUser': return self.sObj.getCurrentUser()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def current_user(self):\n user_dict = self.auth.get_user_by_session()\n return self.auth.store.user_model.get_by_id(user_dict['user_id'])", "def current_user(self):\n user_dict = self.auth.get_user_by_session()\n if user_dict is None:\n logging.debug(\"User dict is None.\")\n ...
[ "0.85787433", "0.8477104", "0.8413951", "0.81564", "0.81298435", "0.8067425", "0.8067425", "0.8067425", "0.80563146", "0.8037242", "0.8005158", "0.7941027", "0.79163885", "0.78352237", "0.7810186", "0.7801821", "0.77803624", "0.7762613", "0.77599484", "0.7748433", "0.7736615"...
0.86626786
0
Caclulate distance between two lat lons in NM
def calcDistance(lat1, lon1, lat2, lon2): yDistance = (lat2 - lat1) * nauticalMilePerLat xDistance = (math.cos(lat1 * rad) + math.cos(lat2 * rad)) * (lon2 - lon1) * (nauticalMilePerLongitude / 2) distance = math.sqrt( yDistance**2 + xDistance**2 ) return distance * milesPerNauticalMile
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculateDistanceBetweenPoints(lat1,lon1,lat2,lon2):\n\treturn Geodesic.WGS84.Inverse(lat1,lon1, lat2, lon2)['s12']", "def get_distance(lat1, lon1, lat2, lon2):\n phi1 = math.radians(lat1)\n phi2 = math.radians(lat2)\n d_phi = math.radians(lat2 - lat1)\n d_lam = math.radians(lon2 - lon1)\n a =...
[ "0.74719673", "0.732014", "0.7269725", "0.7267237", "0.72476906", "0.7234827", "0.7207824", "0.7192692", "0.7192692", "0.7192692", "0.7192692", "0.7192692", "0.7189264", "0.7188012", "0.71840775", "0.7166848", "0.71569234", "0.7154199", "0.7151719", "0.71394324", "0.71231824"...
0.7065718
24
List of all actions for `player`.
def all_actions(self, player): return [m for m in MOVES if m.norm() == 1]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_action(player):\n [print(str(i)+': '+player.available_actions[i]) for i in range(len(player.available_actions))]", "def get_list_of_actions(self):\n return self.actions", "def actions(self, state, player):\r\n raise NotImplementedError", "def get_actions(self):\n return []",...
[ "0.77593315", "0.71171564", "0.69425076", "0.68108135", "0.66736174", "0.664847", "0.6628053", "0.66256464", "0.65883964", "0.65740144", "0.65740144", "0.6564979", "0.65386254", "0.6472249", "0.6458546", "0.6430445", "0.641946", "0.6372777", "0.63657564", "0.63545865", "0.635...
0.73719287
1
Yield nlength chunks of the iterable
def grouper(iterable, n): it = iter(iterable) while True: chunk = tuple(islice(it, n)) if not chunk: return yield chunk
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _chunks(l, n):\n\tfor i in range(0, len(l), n):\n\t\tyield l[i:i + n]", "def __chunks(l, n):\n for i in range(0, len(l), n):\n yield l[i:i + n]", "def _chunks(l, n):\n for i in range(0, len(l), n):\n yield l[i:i + n]", "def chunks(l, n):\n for i in range...
[ "0.8395281", "0.82737124", "0.82725304", "0.82277685", "0.8168744", "0.8166673", "0.8163745", "0.81606853", "0.81427413", "0.8129182", "0.8122258", "0.8121848", "0.81186205", "0.8112638", "0.81101435", "0.81101435", "0.81101435", "0.81101435", "0.81101435", "0.8109245", "0.81...
0.80556524
32
Shifts the image with a mirroring/reflective padding
def shift_with_extension(image, shift): # Get the size of the image image_size = image.size[0] # Get the x and y shifts x, y = shift # Get the maximum value to shift by max_shift = max(abs(x), abs(y)) # Perform the mirror extension of the original image by the correct amount extend =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mirror_edges(im, psf_width):\n\n # How much we need to pad\n pad_i = psf_width - (im.shape[0] % psf_width)\n pad_j = psf_width - (im.shape[1] % psf_width)\n\n # Get widths\n pad_top = pad_i // 2\n pad_bottom = pad_i - pad_top\n pad_left = pad_j // 2\n pad_right = pad_j - pad_left\n\n ...
[ "0.72495055", "0.6833387", "0.67727894", "0.6752565", "0.6723942", "0.6571751", "0.65444756", "0.65148425", "0.65134305", "0.6444048", "0.64423263", "0.640395", "0.6366509", "0.6345753", "0.6268785", "0.62596667", "0.62298065", "0.6216489", "0.6189695", "0.6135056", "0.612830...
0.6219746
17
points will be a matrix of shape (n_points, d)
def bq_weights(mu_p, design_points, kernel): cov_p = gram_matrix(kernel, design_points) # TODO: this is going to be ill conditioned cov_p_inv = np.linalg.inv(cov_p) return mu_p.T.dot(cov_p_inv)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_point_cloud(n:int, d:int = 2, seed=1234) -> np.ndarray:\n initial_seed = np.random.get_state()\n np.random.seed(seed)\n points = np.random.rand(n, d)\n np.random.set_state(initial_seed)\n return points", "def new_density(points):\n inshape = points.shape\n points...
[ "0.68285674", "0.63830984", "0.631414", "0.61682296", "0.61260974", "0.6081056", "0.60808444", "0.6077192", "0.6074242", "0.60683995", "0.60680836", "0.60647446", "0.60594714", "0.605695", "0.60526156", "0.60475093", "0.60391283", "0.6030884", "0.60200596", "0.5987227", "0.59...
0.0
-1
Creates an instance of this model from a dictionary
def from_dictionary(cls, dictionary): if dictionary is None: return None # Extract variables from the dictionary alias_name = dictionary.get('aliasName') client_subnet_whitelist = None if dictionary.get('clientSubnetWhitelist') != None: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_dictionary(cls,\n dictionary):\n if dictionary is None:\n return None\n\n # Extract variables from the dictionary\n id = dictionary.get('id')\n name = dictionary.get('name')\n mtype = dictionary.get('type')\n usage_bytes = diction...
[ "0.83180064", "0.81692255", "0.81692255", "0.81188524", "0.8089153", "0.7978471", "0.7949498", "0.7922631", "0.78985846", "0.7894865", "0.78879577", "0.78826904", "0.78814775", "0.78771174", "0.78584737", "0.78399473", "0.7803621", "0.7803621", "0.7803621", "0.7803621", "0.78...
0.0
-1
Get a name to uniquely identify this environment.
def name(self): return get_env_name(self.tool_name, self._python, self._requirements, self._tagged_env_vars)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name(self):\n return self._env_name", "def environment_name(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"environment_name\")", "def environment_name(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"environment_name\")", "def get_name():\n ret...
[ "0.8126013", "0.7444833", "0.72122306", "0.7209222", "0.6947334", "0.68683714", "0.6773004", "0.67436856", "0.673777", "0.6734472", "0.6705883", "0.6665552", "0.6648302", "0.66317594", "0.65496063", "0.6546996", "0.6514892", "0.6514892", "0.6502273", "0.6502273", "0.6502273",...
0.782062
1
Get the name of the directory where the environment resides. This is not necessarily unique, and may be shared across different environments.
def dir_name(self): name = get_env_name(self.tool_name, self._python, self._requirements, self._tagged_env_vars, build=True) return hashlib.md5(name.encode('utf-8')).hexdigest()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_directory() -> str:\n return directory", "def get_config_dir():\n return Path(environ.get(CONFIG_DIR_ENV_VAR, _default_dir))", "def get_name(self) -> str:\n return os.path.split(os.getcwd())[-1]", "def dirname(self):\n module_system = str(self.conf.module.__name__).split(\".\")[-1...
[ "0.7109397", "0.6944563", "0.6851068", "0.68426394", "0.680136", "0.6743472", "0.67187154", "0.6715343", "0.6697398", "0.6687076", "0.66759825", "0.6669224", "0.66552186", "0.6649421", "0.6648871", "0.664882", "0.6600229", "0.658429", "0.65622574", "0.65563583", "0.65536004",...
0.7436034
0
Pull all values of specified key from nested JSON.
def extract_values(obj, key): arr = [] def extract(obj, arr, key): """Recursively search for values of key in JSON tree.""" if isinstance(obj, dict): for k, v in obj.items(): if isinstance(v, (dict, list)): extract(v, arr, key) elif k == key: arr.append(v) elif ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extract_values(obj, key): \n arr = [] \n def extract(obj, arr, key): \n \"\"\"Recursively search for values of key in JSON tree.\"\"\" \n if isinstance(obj, dict): \n for k, v in obj.items(): \n if isinstance(v, (dict, list)): \n extract(v, arr, ...
[ "0.7464368", "0.73698074", "0.7367376", "0.7367376", "0.7285434", "0.72756416", "0.64381087", "0.6148949", "0.610561", "0.610561", "0.610561", "0.610561", "0.610561", "0.60903573", "0.6079202", "0.60496813", "0.6016994", "0.5953837", "0.5826436", "0.5794504", "0.57905674", ...
0.74437094
1
Sandbox/List is a paginated listing of all of the assets available in the sandbox.
def GET(self): listing = sandbox.list(sandbox_name) return render.index(listing=listing)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def api_asset_list():\n return jsonify(app.bank.to_list()), 200", "def list_assets(request):\n user_assets = Asset.objects.filter(user=request.user, deleted=False).all()\n\n json_assets = ASSET_LIST_RESOURCE.to_json(dict(\n user_id=request.user.id,\n next_page_token=uuid.uuid4(),\n ...
[ "0.66616315", "0.6513344", "0.59517145", "0.5943082", "0.59125555", "0.58733916", "0.5851933", "0.5654924", "0.5587622", "0.5584311", "0.556463", "0.5525589", "0.5507053", "0.5492638", "0.5485845", "0.54561865", "0.54306954", "0.5430437", "0.54272723", "0.5421771", "0.5414294...
0.80642664
0
Determines if a top container should be the target of a merge.
def is_target(top_container): if '.' not in top_container.get('barcode', ''): return True else: return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isTop(self):\n return self.top", "def master(self):\n return self.depth == 0", "def is_target(self):\n\t\treturn self.window and self.window.target is self", "def check_for_top(self) -> bool:\n\t\tboolean_expression_has_top = False\n\t\texpression_has_top = False\n\t\tif self.boolean_expres...
[ "0.6066496", "0.59172076", "0.5885022", "0.58657634", "0.5830219", "0.58079153", "0.580488", "0.57266665", "0.5709138", "0.56877506", "0.56248736", "0.562199", "0.5593397", "0.5570706", "0.55498934", "0.54781747", "0.5474423", "0.5474365", "0.5469224", "0.5451214", "0.5411706...
0.6848274
0