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
Initialize the weights for a threelayer NeurAlnet.
def init_three_layer_neuralnet(weight_scale=1, bias_scale=0, input_feat_dim=786, num_classes=10, num_neurons=(20, 30)): assert len(num_neurons) == 2, 'You must provide number of neurons for two layers...' model = {} #model['W1'] = np.random.randn((num_neurons[0],(input_feat_dim) * ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize_weights(self):\n for layer in self._cnn_layers:\n weights_initializer.WeightsInitializer.initialize_layer_or_model(layer)", "def init_weights(self, init_w=3e-3):\n self.l3.weight.data.uniform_(-init_w, init_w)\n self.l3.bias.data.uniform_(-init_w, init_w)", "def init_weight...
[ "0.79067075", "0.7669529", "0.7669529", "0.7632534", "0.7572091", "0.7540383", "0.7451609", "0.74509233", "0.7328358", "0.72914076", "0.72808665", "0.7278476", "0.72780025", "0.7255002", "0.7246403", "0.7240769", "0.722558", "0.7191863", "0.71906", "0.71878254", "0.7182721", ...
0.7196815
17
Returns the HTTP method name GET
def http_method_get(): return 'GET'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Method(self):\n if self._method is None:\n return \"GET\"\n if len(self._method) == 0:\n return \"GET\"\n return self._method", "def http(self):\n return str(self._http_method)", "def get_requestmethod(self):\n return self.request.method.lower()", ...
[ "0.8306711", "0.76220036", "0.7500386", "0.73727673", "0.7364916", "0.7157615", "0.7126186", "0.71170104", "0.70944446", "0.70392275", "0.69559395", "0.68129003", "0.6693486", "0.66734713", "0.66029227", "0.65808684", "0.6526694", "0.64517176", "0.64175993", "0.6383641", "0.6...
0.8762958
0
Returns the HTTP method name PUT
def http_method_put(): return 'PUT'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def method(cls, request):\n res = cls.METHOD_MAP[request.method]\n if res == 'PUT' and not cls.ALLOW_PUT:\n res = 'POST'\n return res", "def do_PUT(self,):\n self.http_method = 'PUT'\n # Nothing to do for now.\n pass", "def set_http_method(self, data):\n ...
[ "0.77511984", "0.6850959", "0.6550133", "0.65359324", "0.64282995", "0.6407797", "0.6372866", "0.62921625", "0.6220337", "0.621884", "0.621884", "0.621884", "0.6213165", "0.62056", "0.6152816", "0.6067618", "0.6054269", "0.60278046", "0.6017964", "0.6013699", "0.5994535", "...
0.8843079
0
Returns the HTTP method name OPTIONS
def http_method_options(): return 'OPTIONS'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def OPTIONS(self, req):\r\n resp = req.get_response(self.app)\r\n return resp", "def test_options_method(self):\n self.getPage('/', method='OPTIONS')\n self.assertStatus('204 No Content')\n self.assertHeader('Content-Type', 'application/json')", "def do_OPTIONS(self):\n ...
[ "0.7280697", "0.68967044", "0.677709", "0.6652472", "0.64486396", "0.64293647", "0.6351074", "0.6345839", "0.6338993", "0.63255847", "0.62920564", "0.62860376", "0.62719226", "0.6256214", "0.62554836", "0.6251201", "0.6225097", "0.61777556", "0.61113334", "0.6059994", "0.6016...
0.87228066
0
Initialize all model parameters. As implemented by Rei et al., all parameters are initialized randomly from normal distribution with mean 0 and stddev 0.1.
def reset_parameters(self) -> None: for name, param in self.named_parameters(): if not (name == 'word_embedding.weight' and self.use_pretrained_embeddings): nn.init.normal(param, std=0.1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset_parameters(self):\n logger.info('===== Initialize %s with normal distribution =====' % self.__class__.__name__)\n for n, p in self.named_parameters():\n init_like_transformer_xl(n, p, std=0.02)", "def init_parameters(self):\n stdv = 1. / math.sqrt(self.weight.data.size(1...
[ "0.78610694", "0.7582738", "0.7483658", "0.740261", "0.7398663", "0.73502207", "0.72955215", "0.7233056", "0.7183961", "0.7157458", "0.71418774", "0.71418774", "0.71399", "0.7128387", "0.7127656", "0.70206094", "0.70205384", "0.70205384", "0.70205384", "0.69743395", "0.697043...
0.67405355
33
This function gets a list og images path, their labels and extra information (if it exists) and returns a DataLoader for these files. You also can set some transformations using torchvision.transforms in order to perform data
def get_data_loader (imgs_path, labels, extra_info=None, transform=None, params=None): dt = BuildDataset(imgs_path, labels, extra_info, transform) # Checking the params values. If it's not defined in params of if params is None, the default values are described # below: batch_size = 30 shuf = Tru...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dataloaders():\n # train data path\n data_train = '../dataset/train/'\n # set transformations\n train_transforms = transforms.Compose([\n transforms.Resize((224, 224)),\n transforms.ToTensor(),\n transforms.Normalize([0.485, 0.456, 0.406],\n ...
[ "0.77482015", "0.72592366", "0.7259135", "0.71204084", "0.69235456", "0.6871608", "0.68648225", "0.68612236", "0.6852074", "0.68047774", "0.6782689", "0.6772087", "0.6763712", "0.674983", "0.6716621", "0.66805345", "0.6659849", "0.6635305", "0.6612253", "0.66064763", "0.66042...
0.76188034
1
Return a boolean indicating if a challenge over the delivery mechanism `using` exists for the specified `recipient`.
def exists(self, purpose, using, sender, recipient): Relation = self.models[using] query = sqlalchemy.exists()\ .where(Relation.purpose == purpose)\ .where(Relation.sender == sender)\ .where(Relation.recipient == recipient) return self.session.query(query).sca...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_bt(donor, recipient):\n\n donor_int = convert_input_to_int(donor)\n recipient_int = convert_input_to_int(recipient)\n\n result_pac = _particular_antigen_comp(donor_int, recipient_int)\n \n # Resurn False if there is problem\n if -1 in result_pac:\n result = False\n else:\n ...
[ "0.5495751", "0.524509", "0.5156199", "0.5126833", "0.5074475", "0.48784915", "0.47754917", "0.47590843", "0.47066382", "0.46952116", "0.46779624", "0.46764147", "0.46650684", "0.46518534", "0.46380547", "0.4631348", "0.45893213", "0.4583416", "0.45752397", "0.45734134", "0.4...
0.64588815
0
Returns whether or not the image can be scaled greater than its natural size.
def GetAllowUpscaling(self): return self._allow_upscaling
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _image_is_large_enough(im):\n return (im.shape[0] >= MIN_DIM) and (im.shape[1] >= MIN_DIM)", "def is_image_size_exceeded(self):\n return self._tag == 'image_size_exceeded'", "def is_image_size_exceeded(self):\n return self._tag == 'image_size_exceeded'", "def check_scaled_shape(orig: tor...
[ "0.7315121", "0.687083", "0.687083", "0.68363494", "0.6745173", "0.66207945", "0.65709674", "0.64342874", "0.6375007", "0.62838215", "0.6265864", "0.6260985", "0.61634946", "0.6145041", "0.60976964", "0.6086517", "0.6083105", "0.6068527", "0.60418683", "0.6023307", "0.6011755...
0.0
-1
Filters the translated hot words, removes the falty ones.
def filter_hot_words(self, hot_words: list): to_remove = [] for hot_word_item in hot_words: hot_word = hot_word_item['hot_word'] # True if the hot word is in the subtitles of it's range. (E.g. hot word 'hello' which is said at 00:42, when the subtitles at 00:52-00:56 is 'that i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def purge_words(self):\n\n\t\tword_list = self.transcript_string.encode('utf-8').split()\n\t\tpurged_word_list = {}\n\t\tfor word in word_list:\n\t\t\tif word.isalpha():\n\t\t\t\tif word.islower():\n\t\t\t\t\tpurged_word_list.setdefault(word, []).append(word)\n\t\t\t\telse:\n\t\t\t\t\tlower_word = word.lower()\n\t...
[ "0.72165924", "0.71021116", "0.70784116", "0.7025296", "0.69302964", "0.69285756", "0.6843647", "0.68259734", "0.6811816", "0.68061525", "0.6752033", "0.6689809", "0.668574", "0.6681092", "0.66449416", "0.6611373", "0.66062933", "0.66019243", "0.660015", "0.65934384", "0.6568...
0.7496576
0
Return a string of yyyymmdd
def get_hundred_days_end_date(): date_finished = start_100days + timedelta(days=100) return date_finished.strftime('%Y-%m-%d')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def date_string(date):\n day = date.day\n month = date.month\n year = date.year\n formatted_string = str(month) + \"/\"\n formatted_string += str(day) + \"/\"\n formatted_string += str(year)\n return formatted_string", "def string_date(mnthDay, year):\n return(mnthDay + '/' + str(year))",...
[ "0.7528554", "0.75284827", "0.74983245", "0.7497909", "0.7497909", "0.72311854", "0.71115863", "0.70839596", "0.708211", "0.7054959", "0.70416725", "0.70331466", "0.70206845", "0.70001286", "0.69369537", "0.6928049", "0.6860247", "0.68497235", "0.68336797", "0.6806661", "0.68...
0.0
-1
Return the int number of days
def get_days_between_pb_start_first_joint_pycon(): time_diff = pycon_date - pybites_founded return time_diff.days
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_number_days(self):\r\n return 1", "def days(self):\n return int(self.hours / 24)", "def get_number_days(self):\r\n raise NotImplementedError", "def days(self) -> Optional[int]:\n return pulumi.get(self, \"days\")", "def calculate_days(time):\n return int(time / 86400)...
[ "0.8572998", "0.79770666", "0.78697264", "0.7768571", "0.77367055", "0.7435355", "0.7410059", "0.73998773", "0.7327887", "0.7300378", "0.7300378", "0.722814", "0.7210647", "0.71758914", "0.7134838", "0.7130534", "0.7106202", "0.7003841", "0.6971776", "0.6958325", "0.6902935",...
0.0
-1
Returns the string that represents the students who are taking course representing this gene
def toStudentString(self): return "{0}th year, section {1}, {2} {3}".format(self.batch, self.batch_id, self.batch, self.batch_id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n return str(self.__student_name) + \" has grade \" + str(self.__grade_value) + \" at \" + str(self.__discipline_name)", "def get_students(self):\n return u', '.join([c.student.username for c in self.candidates.all()])", "def courses_string(self):\n course_string = \"\"\...
[ "0.67230797", "0.66457313", "0.6540934", "0.64843184", "0.6455758", "0.6317664", "0.6285246", "0.6270023", "0.62513644", "0.6121006", "0.6097064", "0.60364044", "0.600569", "0.59990203", "0.5918503", "0.58928704", "0.58891445", "0.58570594", "0.58399194", "0.58343685", "0.574...
0.6736186
0
Check if the class constructor works as expected and return the object for further testing.
def _check_init(self): # instantiate the guest class we want to test system_name = 'dummy_system' host_name = 'dummy.domain.com' user = 'root' passwd = 'somepwd' extensions = {} guest_obj = linux.GuestLinux( system_name, host_name, user, passwd, extens...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_constructor(cls, data):\n do_constructor_test(cls, data)", "def test_constructor(self):\n pass", "def test_constructor(self):\n # Args\n name = 'Mathew'\n age = 13\n grade = 14\n\n # Object construction\n obj = models.Student(name=name, age=age, grad...
[ "0.7512195", "0.7436349", "0.7236492", "0.6905665", "0.6816729", "0.67608124", "0.6759611", "0.66864574", "0.66864574", "0.6604161", "0.64998424", "0.6455616", "0.6392665", "0.63310206", "0.6319648", "0.6315541", "0.6288798", "0.6228272", "0.6190136", "0.61773", "0.6176235", ...
0.6768672
5
Verify that operations will fail if login was not initially performed.
def test_fail_must_login(self): guest_obj = self._check_init() msg = 'You need to login first' with self.assertRaisesRegex(RuntimeError, msg): guest_obj.hotplug(vols=[dict()]) with self.assertRaisesRegex(RuntimeError, msg): guest_obj.install_packages([]) s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_valid_login_form_but_failed_authentication(self):\n\n\n\t\tpass", "def test_successful_login(self):\n pass", "def test_login_required(self):\n self.client.logout()\n response = self.client.get(self.path)\n assert response.status_code == 401", "def test_user_login_attempt_...
[ "0.7331652", "0.717295", "0.70790964", "0.69579977", "0.6922603", "0.6922603", "0.68700266", "0.6833775", "0.682583", "0.67004853", "0.66941065", "0.66797644", "0.665933", "0.66476256", "0.6636679", "0.66336805", "0.6631653", "0.6614114", "0.66136", "0.6607701", "0.65941113",...
0.7164778
2
Generate a list of tuples for each parameter combination.
def _lst_of_tpls(step, parsing_function, filt=None): lst = [] for key in step: if step[key][0]: # On/Off flag if len(step[key]) > 1: content_d = step[key][1] content_vals = list(values_iterator(content_d)) for ll in modified_cartesian(*map(ens...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_param_combinations(cls):\n for key, val in cls.param.items():\n if not isinstance(val, (list, Quantity)):\n cls.param[key] = [val]\n elif isinstance(val, Quantity) and val.size == 1:\n try:\n # check if val.value is iterable, e.g...
[ "0.74393016", "0.7103918", "0.6654603", "0.6607627", "0.65625143", "0.65065986", "0.64834595", "0.6482626", "0.64520377", "0.63832045", "0.63596267", "0.63573396", "0.63059705", "0.629146", "0.6282082", "0.624011", "0.6204423", "0.6194751", "0.6188562", "0.61789954", "0.61785...
0.0
-1
Converts a list of strings to a string by concatenating all elements of the list
def collapse(L): output = "" for s in L: output = output + s return output
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stringer(list):\n\tstring = \"\"\n\tfor x in list:\n\t\tstring = string + str(x)\n\treturn string", "def list2string(a_list):\n\n the_string = ''\n for elem in a_list:\n the_string += str(elem)\n return the_string", "def list_to_str(list_to_convert):\n return ' '.join(to_str(item) for it...
[ "0.8453379", "0.7835792", "0.7774174", "0.77046573", "0.76607585", "0.7659138", "0.75962234", "0.7586205", "0.7480312", "0.74594104", "0.7456558", "0.7406451", "0.7406451", "0.7392881", "0.73865795", "0.7349557", "0.73336154", "0.732984", "0.7289963", "0.7260283", "0.71723825...
0.6520408
57
Generator producing (variant, flags, procid suffix) tuples.
def _variants_gen(self, test): return self._get_variants_gen(test).gen(test)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pbvs(self):\n for name in self._pbvs:\n yield name, self._data[name]", "def enumerate_flags(flag, f_map):\r\n # Reset string based flags to null\r\n f_type = ''\r\n f_flag = ''\r\n # Iterate through flags\r\n for i in f_map:\r\n if i & flag:\r\n if f_map[i] ...
[ "0.5874131", "0.54996216", "0.5489868", "0.548638", "0.5433615", "0.54015326", "0.53355205", "0.53145593", "0.525165", "0.5228467", "0.5218353", "0.52072763", "0.51341736", "0.51242363", "0.5108781", "0.5105059", "0.5088956", "0.50823116", "0.5080956", "0.5046883", "0.5046413...
0.49333814
29
given inputs, return the model name.
def name_network(opt): optim = opt['optimizer'].__name__ nn_tuple = (opt['method'], opt['upsampling_rate'], 2*opt['input_radius']+1, 2*opt['receptive_field_radius']+1, (2*opt['output_radius']+1)*opt['upsampling_rate'], optim, str(opt['dropout_rate...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_model_name(pipe) -> str:\n # https://stackoverflow.com/questions/14596884/remove-text-between-and\n model_name = pipe.named_steps.get(\"regressor\").__class__.__name__\n model_name = re.sub(r\"[\\(\\[].*?[\\)\\]]\", \"\", model_name)\n return model_name", "def get_model_name(self) -> str:\n ...
[ "0.69351393", "0.6915368", "0.68039066", "0.67734003", "0.6753022", "0.6664535", "0.6607528", "0.65705955", "0.65566576", "0.6485479", "0.6437007", "0.638261", "0.63298595", "0.6317528", "0.6288472", "0.62851954", "0.6268043", "0.62622315", "0.625182", "0.6220927", "0.6207089...
0.0
-1
Determine the most appropriate time unit for given durations (in seconds). e.g. 5400 seconds => 'minutes', 36000 seconds => 'hours'
def infer_time_unit(time_seconds_arr: Collection[float]) -> TimeUnit: if not time_seconds_arr: return "hours" max_time_seconds = max(time_seconds_arr) if max_time_seconds <= 60 * 2: return "seconds" elif max_time_seconds <= 60 * 60 * 2: return "minutes" elif max_time_seconds ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_time_with_unit(time):\n sec_in_min = 60\n sec_in_hour = 60 * 60\n sec_in_day = 24 * 60 * 60\n\n if time % sec_in_day == 0:\n time = time / sec_in_day\n unit = 'days'\n\n elif time % sec_in_hour == 0:\n time = time / sec_in_hour\n unit = 'hours'\n\n else:\n ...
[ "0.7136529", "0.6778668", "0.6730564", "0.6648333", "0.6615159", "0.641955", "0.6380402", "0.6376466", "0.636579", "0.63577235", "0.63571787", "0.63510007", "0.6313127", "0.6309142", "0.6308569", "0.63017017", "0.63001853", "0.6296119", "0.62938917", "0.6288306", "0.6286464",...
0.76923347
0
Set up test data.
def setUpTestData(cls): cls.post = PostFactory()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setUp(self):\n\n self.test_data_path = 'testing/test_data/'", "def setUp(self):\n self.dataset = get_test_dataset()", "def setUpTestData(cls):\n # volunteer user\n common.initialize_empty_volunteer()", "def setUpTestData(cls):\n data_gen.run()", "def setUpTestData(cls...
[ "0.8356669", "0.8261018", "0.82422227", "0.8072365", "0.8072365", "0.8072365", "0.8072365", "0.78744835", "0.78552526", "0.78354627", "0.7806609", "0.77783763", "0.77616584", "0.7706849", "0.76822346", "0.7679143", "0.7657998", "0.7632633", "0.76242787", "0.7600424", "0.76004...
0.7431029
40
Set up test data.
def setUpTestData(cls): cls.post = PostFactory( author__first_name='Peter', author__last_name='Mustermann', title='My test title', subtitle='A subtitle for the test post', views=10, last_viewed=(timezone.now() - datetime.timedelta(days=1)),...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setUp(self):\n\n self.test_data_path = 'testing/test_data/'", "def setUp(self):\n self.dataset = get_test_dataset()", "def setUpTestData(cls):\n # volunteer user\n common.initialize_empty_volunteer()", "def setUpTestData(cls):\n data_gen.run()", "def setUpTestData(cls...
[ "0.83564", "0.825977", "0.82419825", "0.8071621", "0.8071621", "0.8071621", "0.8071621", "0.7874065", "0.7855246", "0.783438", "0.7805763", "0.77781427", "0.7761605", "0.77067", "0.7682978", "0.76799023", "0.7657977", "0.76328367", "0.76242405", "0.7600356", "0.7600356", "0...
0.0
-1
Function to plot confusion matrix
def plot_confusion_matrix(cm_res): fig, ax = plt.subplots(figsize=(5,5)) ax.matshow(cm_res, cmap=plt.cm.Blues, alpha=0.3) for i in range(cm_res.shape[0]): for j in range(cm_res.shape[1]): ax.text(x=j, y=i,s=cm_res[i, j], va='center', ha='center') plt.xlabel('predicted label') pl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_confusion_matrix(self):\r\n interp = ClassificationInterpretation.from_learner(self.learn)\r\n interp.plot_confusion_matrix()", "def plot_confusion_matrix(cm, class_names):\n figure = plt.figure(figsize=(10, 10))\n plt.imshow(cm, interpolation='nearest', cmap=plt.cm.Blues)\n plt.title(\...
[ "0.8478089", "0.8205788", "0.8115429", "0.8079986", "0.8079258", "0.7961643", "0.79558533", "0.7955642", "0.7939076", "0.79071355", "0.7905456", "0.7897702", "0.78975624", "0.7884876", "0.7883841", "0.78764665", "0.7854401", "0.78497845", "0.78492254", "0.7848755", "0.7848366...
0.7838849
24
Get current CPS Should return a float
def get_cps(self): return self._current_cps
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cps(self):\n\n if self._cps is not None:\n return self._cps\n else:\n try:\n return self.counts / self.livetime\n except TypeError:\n raise SpectrumError(\n 'Unknown livetime; cannot calculate CPS from counts')", ...
[ "0.7728652", "0.7462495", "0.7036479", "0.7036479", "0.6906312", "0.68568826", "0.6835569", "0.65149987", "0.64797735", "0.64733404", "0.64303815", "0.6356482", "0.6325371", "0.6296346", "0.6296247", "0.6290065", "0.62089956", "0.6181946", "0.61742765", "0.61742765", "0.61445...
0.736031
4
Adds an ellipse to the path. The ellipse is centered at (x, y) position with the radii radiusx and radiusy starting at startAngle and ending at endAngle going in the given direction by anticlockwise (defaulting to clockwise).
def ellipse(self, x, y, radiusx, radiusy, rotation=0, startangle=0, endangle=2 * pi, anticlockwise=False): self._impl.ellipse(x, y, radiusx, radiusy, rotation, startangle, endangle, anticlockwise)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ellipse(radii = (10,5), angle_resolution = 2.5, layer = 0):\n D = Device(name = 'ellipse')\n a = radii[0]\n b = radii[1]\n t = np.linspace(0, 360, int(np.ceil(360/angle_resolution) + 1)) * pi/180\n r = a*b / (sqrt((b*cos(t))**2 + (a*sin(t))**2))\n xpts = r*cos(t)\n ypts = r*sin(t)\n D.a...
[ "0.70993745", "0.7076818", "0.7053882", "0.69406706", "0.69009733", "0.6515239", "0.6399076", "0.6370522", "0.63027185", "0.62943065", "0.62662375", "0.62526673", "0.6249456", "0.62357867", "0.6227983", "0.615513", "0.61407757", "0.6098419", "0.6048517", "0.60385895", "0.6021...
0.8068204
0
Strokes the subpaths with the current stroke style A drawing operator that strokes the current path according to the current line style settings.
def stroke(self): yield self._impl.stroke()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def drawPath(self, path=[]):\n subpath = NSBezierPath.alloc().init()\n subpath.moveToPoint_(path[0][0])\n for p in path[1:]:\n if len(p) == 3:\n # curve\n A, B, C = p\n subpath.curveToPoint_controlPoint1_controlPoint2_(C, A, B)\n ...
[ "0.6791704", "0.6543874", "0.64537156", "0.6299587", "0.61801714", "0.61571586", "0.61285424", "0.59662116", "0.58908224", "0.57941234", "0.5636247", "0.55894214", "0.55426615", "0.55118006", "0.5475801", "0.54658383", "0.54588306", "0.5454855", "0.5415362", "0.54041046", "0....
0.58439285
9
Generate correct raw file name
def generate_raw_filename(self, source_name, table_name, environment, seq_number, upload_time, load_type, file_format): file_date = upload_time.strftime( "%Y-%m-%d-%H-%M-%S-%f")[:-3] # [:-3] => Removing the 3 last characters as %f is for millis. res = f'{source...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _generate_raw_file_name(self, well, channel, desc):\n \n return \"bPLATE_w\" + well + \"_\" + desc + \"_c\" + channel + \".png\"", "def filename(self):\n translator = {ord(\" \"): \"_\", ord(\",\"): None}\n return f'{self._full_name.translate(translator)}.txt'", "def create_...
[ "0.77225375", "0.7711418", "0.7579269", "0.7487112", "0.747396", "0.73942417", "0.73497057", "0.7323699", "0.727302", "0.72628933", "0.7253202", "0.72417855", "0.7239149", "0.7204239", "0.7171283", "0.71490014", "0.7135367", "0.7100103", "0.7099384", "0.70858616", "0.70850325...
0.8009716
0
Return all posts that meet filter condition.
def _filter_posts(posts): return filter(_filter_post, posts)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_queryset(self):\n return Post.objects.filter(\n user_id=self.kwargs['user_id'], status='published', visibility='public'\n )", "def get_posts(self, published=False) -> Type[QuerySet]:\n categories = self.get_descendant_categories()\n posts = Post.objects.filter(categ...
[ "0.6588944", "0.65259814", "0.6524261", "0.6440159", "0.6440159", "0.6428598", "0.63367355", "0.6293211", "0.6293211", "0.6205887", "0.61178625", "0.6086331", "0.6085104", "0.605817", "0.60261106", "0.59669924", "0.5914808", "0.5889088", "0.58236146", "0.5791187", "0.57852423...
0.79431695
0
Return a (new) dict with unicode keys (and values when "keys_only" is False) of the given dict converted to strings. `dct_or_tuples` can be a dict or a list of tuples, like any dict constructor supports.
def native_stringify_dict(dct_or_tuples, encoding='utf-8', keys_only=True): d = {} for k, v in iteritems(dict(dct_or_tuples)): k = _to_native_str(k, encoding) if not keys_only: if isinstance(v, dict): v = native_stringify_dict(v, encoding=encoding, keys_only=keys_only...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def turn_keys_into_str(d):\n return { str(k) : v for k,v in d.items() }", "def dict_keys_to_strings(d):\n return dict((str(k), v) for (k, v) in d.iteritems())", "def keys2string(dictionary):\r\n if not isinstance(dictionary, dict):\r\n return dictionary\r\n return dict((str(k), keys2string(v...
[ "0.594834", "0.58237106", "0.5659761", "0.5448072", "0.54046094", "0.53325355", "0.5317286", "0.5286176", "0.5277159", "0.5270095", "0.5221863", "0.51999557", "0.5174706", "0.5174112", "0.5104936", "0.5064424", "0.50573957", "0.50328857", "0.50328857", "0.50065607", "0.497288...
0.8036426
0
Take a name of a chart of account group, return a unique id.
def convert_chart_name_to_id(chart_name): ordered_coa = OrderedDict(chart_of_accounts) r = list(ordered_coa.keys()).index(chart_name) return r
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_group_id(self, group_name):\n uri_vars = {\"q\": group_name, \"start\": 0, \"count\": \"Infinity\"}\n group_uri = urllib.parse.urlencode(uri_vars)\n full_url = self.base_url + f\"/group/group/findgroup.html?{group_uri}\"\n result_str = self.fetch(full_url)\n result = json...
[ "0.67854327", "0.66633403", "0.66633403", "0.64480585", "0.63715523", "0.6307626", "0.6299566", "0.6159691", "0.6140655", "0.613161", "0.60611457", "0.60367745", "0.60367745", "0.60367745", "0.60313237", "0.5992874", "0.5987244", "0.59473", "0.59427625", "0.5941881", "0.59336...
0.6856148
0
Return the type of REB given the component type.
def get_reb_type(component_type=None): reb_types = {'LCA-13574': 'REB5', 'LCA-13537': 'WREB', 'LCA-13540': 'GREB'} if component_type is None: component_type = os.environ['LCATR_UNIT_TYPE'] return reb_types[component_type]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_typ(self, refobj):\n enum = cmds.getAttr(\"%s.type\" % refobj)\n try:\n return JB_ReftrackNode.types[enum]\n except IndexError:\n raise ValueError(\"The type on the node %s could not be associated with an available type: %s\" %\n (refob...
[ "0.6491551", "0.6180145", "0.5927247", "0.5898221", "0.5818322", "0.57855165", "0.5784528", "0.57647336", "0.5718823", "0.5688912", "0.5686143", "0.5663892", "0.5643369", "0.5634173", "0.5622059", "0.5616487", "0.5596298", "0.5596298", "0.556142", "0.556142", "0.5556404", "...
0.8346656
0
Return the current local time in ISO8601 format.
def local_time(): return datetime.datetime.now().isoformat()[:len('2017-01-24T10:44:00')]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isoformat_now():\n return datetime_isoformat(datetime.datetime.utcnow())", "def iso_date(self, t=None):\n if t is None:\n t = time.time()\n time_str = time.strftime(\"%Y-%m-%d %H:%M:%S\", time.localtime(t))\n\n return time_str", "def format_iso_now():\n return datetime...
[ "0.73521173", "0.7343142", "0.7200751", "0.7113275", "0.70603114", "0.70281315", "0.70219713", "0.69816965", "0.69295645", "0.6829765", "0.68031347", "0.68031347", "0.6777069", "0.6761387", "0.675151", "0.6747227", "0.67304754", "0.6696272", "0.66799724", "0.66794264", "0.664...
0.79332876
0
Remove stop words from list of tokenized words
def remove_stopwords(words): new_words = [] for word in words: if word not in stopwords.words('english'): new_words.append(word) return new_words
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_stop_words(stop_list, tokens):\n return [t for t in tokens if len(t) > 2 and not t in stop_list]", "def remove_stopwords(tokens):\n stop_words = set(stopwords.words('english'))\n\n tokens = [w for w in tokens if w not in stop_words]\n\n return tokens", "def remove_stop_words(tokenized_wo...
[ "0.86630034", "0.86183923", "0.85973936", "0.8596811", "0.8580546", "0.8363658", "0.8350171", "0.8328014", "0.8318595", "0.8263289", "0.82468146", "0.820217", "0.81783086", "0.81630206", "0.8158307", "0.8138284", "0.81271654", "0.8113883", "0.8099041", "0.8048383", "0.8027641...
0.8002353
26
Use deque to keep track of max value for each subarray. Deque will hold the element index, not value. So we can know that an element is outside of current subarray. Deque will hold the element in descending order by value, to keep only important (used) elements.
def max_value_each_subarray(numbers, size): # deque to store indices of number for each subarray in descending order by value index_deque = deque() for i in range(len(numbers)): # remove old indices in deque that is outside the current window (subarray) while index_deque and index_deque[0] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def printMaxdeque(arr, n, k):\n Qi = deque()\n\n # Process first k (or first window) elements of array\n for i in range(k):\n\n # For every element, the previous smaller elements are useless\n # so remove them from Qi\n while Qi and arr[i] >= arr[Qi[-1]]:\n Qi.pop()\n\n ...
[ "0.6845109", "0.65044117", "0.6232624", "0.6166709", "0.5958844", "0.5947466", "0.5910465", "0.59100413", "0.58948076", "0.5858383", "0.5837346", "0.5826088", "0.5806984", "0.58012", "0.5789011", "0.57802486", "0.57648814", "0.5743485", "0.5732978", "0.5727742", "0.57197654",...
0.77701163
0
Assign new word ids to all words, shrinking any gaps.
def compactify(self): logger.debug("rebuilding dictionary, shrinking gaps") # build mapping from old id -> new id idmap = dict(zip(sorted(itervalues(self.token2id)), range(len(self.token2id)))) # reassign mappings to new ids self.token2id = {token: idmap[tokenid] for token, tok...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_words(self, words):\n\n self.words = words\n self.generate_letter_maps()\n self.word_set = set(self.words)", "def makeWords(self):\r\n clean_s = self.cleanString(self.text)\r\n LoW = clean_s.split() \r\n for x in LoW: \r\n if x not in self.words: \r\n ...
[ "0.64656854", "0.62301034", "0.6127339", "0.6056872", "0.6056872", "0.60211265", "0.5911058", "0.5832938", "0.5824608", "0.5822144", "0.5820971", "0.5802004", "0.5741793", "0.57397556", "0.5735784", "0.57317626", "0.5726835", "0.5718523", "0.5716599", "0.5704006", "0.5693564"...
0.58744216
7
converts a python datetime object to the format "X days, Y hours ago"
def human_datetime(date_time): current_datetime = datetime.datetime.now() delta = str(current_datetime - date_time) if delta.find(',') > 0: days, hours = delta.split(',') days = int(days.split()[0].strip()) hours, minutes = hours.split(':')[0:2] else: hours, minutes = del...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pretty_date(time=False):\n now = datetime.now()\n if type(time) is int:\n diff = now - datetime.fromtimestamp(time)\n elif isinstance(time, datetime):\n diff = now - time\n elif not time:\n diff = now - now\n else:\n diff = now - no...
[ "0.6758125", "0.6710449", "0.670244", "0.6684732", "0.66366637", "0.6582775", "0.65302557", "0.6524999", "0.65025395", "0.6452566", "0.64351326", "0.64166343", "0.6328326", "0.63259465", "0.629831", "0.62807226", "0.6239508", "0.61612463", "0.61457866", "0.61207676", "0.61095...
0.6508292
8
Define features that the classifier should pay attention to, in this case boolean variables corresponding to each word in the headline. This feature extractor forms what's known as a bagofwords representation of each headline (omitting stopwords like the, and, or, etc.) so that our classifier can tell whether the prese...
def get_features(words): features = {} for word in [i for i in words.split() if i not in stopwords.words('english')]: features['contains_%s' % word.lower()] = True return features
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def other_features_(tweet, cleaned_tweet):\n #print(\"WARNING>>>>>>>>>>>>>>>>> VADERSENTIMENT DISABLED\")\n sentiment = nlp.sentiment_analyzer.polarity_scores(tweet)\n\n words = cleaned_tweet #Get text only\n\n syllables = textstat.syllable_count(words) #count syllables in words\n num_chars = sum(l...
[ "0.62264705", "0.61904985", "0.61709034", "0.61294776", "0.60737765", "0.6015608", "0.6006047", "0.5946113", "0.5932229", "0.58858156", "0.5878836", "0.5853682", "0.5823766", "0.58153343", "0.58038986", "0.5782711", "0.57561535", "0.5717475", "0.5711429", "0.57003695", "0.568...
0.6240162
0
Parse Hive and RPi number from filename.
def parse_filename(filename): # , time_fmt=TIME_INFILE_FMT): # Split the name up into its "blocks" parts = filename.split("_") hive_str, rpi_str = parts[1:3] day_str = parts[3] method = parts[5] # Parse Hive and RPi number hive = int(hive_str[-1]) rpi = int(rpi_str[-1]) method = me...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_filename(cls, filename):\n words = filename.split('_')\n return words[0], int(words[1][1:]), int(words[2])", "def parse_file_name(file_name):\n\n elements = file_name.split(\"_\")\n if file_name.find(\"_VI_\") > 0:\n client = elements[0]\n capture_range = \"R1\"\n condition = e...
[ "0.71044034", "0.6366977", "0.622163", "0.6111986", "0.60856956", "0.60606414", "0.6021114", "0.5991827", "0.59881985", "0.59307176", "0.5923358", "0.58942133", "0.5889518", "0.5878116", "0.58255917", "0.5812841", "0.58060014", "0.5800758", "0.5790461", "0.5754505", "0.574971...
0.73076844
0
The number of addresses stored in this chunk. This number must be greater than 0.
def num_addresses(self): if hasattr(self, '_m_num_addresses'): return self._m_num_addresses if hasattr(self, '_m_num_addresses') else None self._m_num_addresses = self.num_addresses_raw.value return self._m_num_addresses if hasattr(sel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __len__(self):\n return len(self.chunk_idxes)", "def getNrEntries(self):\n return len(self.data)", "def n(self):\n return len(self.data.sites)", "def len(self):\n return self.n", "def nbytes(self) -> int:\n return self._nbytes(False)", "def size(self):\n\t\treturn s...
[ "0.71210885", "0.7101971", "0.70615786", "0.7047328", "0.70200795", "0.6985893", "0.693689", "0.6904222", "0.68969774", "0.68919426", "0.6890482", "0.68878216", "0.6879838", "0.68661666", "0.6863345", "0.6861907", "0.6838387", "0.68356484", "0.68356484", "0.68356484", "0.6835...
0.7966312
0
Returns a dict representation of AzureBlobFileListSource.
def to_dict(self) -> Dict[str, Any]: return { "container_url": self.container_url, "file_list": self.file_list }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_dict(cls, data: Dict[str, Any]) -> \"AzureBlobFileListSource\":\n return cls(\n container_url=data.get(\"container_url\", None),\n file_list=data.get(\"file_list\", None),\n )", "def to_dict(self) -> Dict[str, Any]:\n return {\n \"azure_blob_source\"...
[ "0.6697057", "0.646585", "0.5074083", "0.49475747", "0.49164894", "0.49164894", "0.48751244", "0.48744115", "0.48526344", "0.48169485", "0.48034796", "0.47941533", "0.47752905", "0.47723955", "0.47667518", "0.47665128", "0.47626123", "0.4761574", "0.47511676", "0.47096226", "...
0.5171957
2
Returns a dict representation of ClassifierDocumentTypeDetails.
def to_dict(self) -> Dict[str, Any]: return { "azure_blob_source": self.azure_blob_source.to_dict() if self.azure_blob_source else None, "azure_blob_file_list_source": self.azure_blob_file_list_source.to_dict() if self.azure_blob_file_list_source else None, }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bson_type(self) -> type:\n return dict", "def to_dict(self) -> Dict:\n _dict = {}\n if hasattr(self, 'type') and self.type is not None:\n _dict['type'] = self.type\n return _dict", "def to_dict(self) -> Dict:\n _dict = {}\n if hasattr(self, 'type') and s...
[ "0.62522095", "0.62033254", "0.62033254", "0.61488175", "0.6103108", "0.6064147", "0.6036003", "0.60354334", "0.59610957", "0.59232855", "0.5881857", "0.587467", "0.5869987", "0.5853256", "0.582415", "0.57667696", "0.5747747", "0.5729175", "0.5698487", "0.5677633", "0.5675090...
0.0
-1
Sets the document_properties of this DocumentConfig. Sets DocumentProperties of document
def document_properties(self, document_properties): self._document_properties = document_properties
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def properties_set(self, properties):\n self._put('properties', properties)", "def properties(self, properties):\n\n self._properties = properties", "def properties(self, properties):\n\n self._properties = properties", "def properties(self, properties):\n\n self._properties = pro...
[ "0.6376842", "0.6088672", "0.6088672", "0.6088672", "0.58022785", "0.56545067", "0.5642283", "0.5642283", "0.5512304", "0.53775585", "0.5306117", "0.5254916", "0.5244487", "0.51528966", "0.51253986", "0.5120294", "0.5120294", "0.5117298", "0.5070175", "0.50669146", "0.5006822...
0.8747354
0
Gets the default_page_config of this DocumentConfig. Sets default page config for new document
def default_page_config(self): return self._default_page_config
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def default_page_config(self, default_page_config):\n\n self._default_page_config = default_page_config", "def default_configs(cls):\n return {\n 'redirect_path': None,\n 'nif_page_structure': None,\n 'nif_text_links': None,\n }", "def get_default_page_size...
[ "0.7626318", "0.62549955", "0.5998884", "0.5929868", "0.5858916", "0.58239734", "0.5728213", "0.5669584", "0.56615496", "0.56432384", "0.56432384", "0.5621277", "0.56022805", "0.55287355", "0.5525079", "0.5516802", "0.5506587", "0.5479628", "0.54604733", "0.54407585", "0.5430...
0.81328297
0
Sets the default_page_config of this DocumentConfig. Sets default page config for new document
def default_page_config(self, default_page_config): self._default_page_config = default_page_config
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def default_page_config(self):\n return self._default_page_config", "def default_configs(cls):\n return {\n 'redirect_path': None,\n 'nif_page_structure': None,\n 'nif_text_links': None,\n }", "def setDocumentDefaultLanguage(self,languageCode): \n se...
[ "0.6943829", "0.5758662", "0.57537353", "0.5751394", "0.5737069", "0.5694196", "0.56294113", "0.5562378", "0.5556328", "0.55203587", "0.5500069", "0.54929984", "0.54777294", "0.54760796", "0.54760796", "0.54386526", "0.5411754", "0.537824", "0.5373581", "0.53475034", "0.53249...
0.856045
0
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, DocumentConfig): 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.8456063", "0.83918154", "0.8144437", "0.8140196", "0.8132038", "0.8093834", "0.80918837", "0.80918837", "0.80918837", "0.80852824", "0.80852824", "0.807626", "0.807626", "0.80657643" ]
0.0
-1
Create a named master token in repo
def create_master_token(user, repo, config, name): url = "{}/repos/{}/{}/master_tokens".format(config['url_base'], user, repo) postdata = ("master_token[name]={}".format(name)) try: resp = (api_call(url, 'post', config['debug'], data=postdata)) token = resp.json() except ValueError as e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_master_token(user, repo, name, config):\n url = \"{}/repos/{}/{}/master_tokens\".format(config['url_base'], user, repo)\n\n try:\n resp = (api_call(url, 'get', config['debug']))\n tokens = resp.json()\n except ValueError as ex:\n abort(\"Unexpected response from packagecloud A...
[ "0.6700398", "0.66905636", "0.6212681", "0.6142964", "0.6142964", "0.60569453", "0.60398424", "0.60097146", "0.59920156", "0.59392905", "0.5925242", "0.58485144", "0.5763348", "0.5707669", "0.5657991", "0.56554145", "0.56389594", "0.557431", "0.55690265", "0.55591094", "0.554...
0.8327568
0
Create a named master token in repo
def create_read_token(mastertoken, config, name): mt_path = mastertoken['paths']['self'] url = "{}{}/read_tokens.json".\ format(config['domain_base'], mt_path) postdata = ("read_token[name]={}".format(name)) try: resp = (api_call(url, 'post', config['debug'], data=postdata)) tok...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_master_token(user, repo, config, name):\n url = \"{}/repos/{}/{}/master_tokens\".format(config['url_base'], user, repo)\n postdata = (\"master_token[name]={}\".format(name))\n\n try:\n resp = (api_call(url, 'post', config['debug'], data=postdata))\n token = resp.json()\n except...
[ "0.8327568", "0.6700398", "0.6212681", "0.6142964", "0.6142964", "0.60569453", "0.60398424", "0.60097146", "0.59920156", "0.59392905", "0.5925242", "0.58485144", "0.5763348", "0.5707669", "0.5657991", "0.56554145", "0.56389594", "0.557431", "0.55690265", "0.55591094", "0.5549...
0.66905636
2
Convert float or int to string by adding "_" in front of data.
def __init__(self, fill_value=np.nan): self.fill_value = fill_value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def float2str(v, fmt='9.3f'):\n astr = ('%' + fmt) % v\n astr = astr.replace(' ', '__')\n return astr", "def __str__(self):\n if self.is_int():\n return str(self._num)\n else:\n return \"{0:d} / {1:d}\".format(self._num, self._den)", "def float_to_str(float_in):\n ...
[ "0.6430642", "0.6338068", "0.6300146", "0.6249707", "0.621928", "0.6142988", "0.61105746", "0.60753876", "0.5983089", "0.59180164", "0.59158653", "0.5913688", "0.58966327", "0.58854944", "0.5883954", "0.5874572", "0.5872153", "0.58465034", "0.5829623", "0.5795462", "0.5777019...
0.0
-1
Prepare parsed value before binding to a wildcard field.
def prepare_generic_value(cls, qname: Optional[str], value: Any) -> Any: if qname: if not is_dataclass(value): value = AnyElement(qname=qname, text=converter.serialize(value)) elif not isinstance(value, (AnyElement, DerivedElement)): value = DerivedElemen...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __prepare_value(self, val, none_symbol=\"-\"):\n\t\t# If type is a tuple, then it is a \n\t\t# (func_unit_label, replica_id) pair. \n\t\t# Concatenate then using \"_\" symbol.\n\t\tif type(val) == type(()):\n\t\t\tval = \"_\".join(map(str, val))\n\n\t\t# Cast value to string/character type,\n\t\t# if it is not...
[ "0.5834774", "0.5810264", "0.56561303", "0.56331146", "0.54817086", "0.5394734", "0.52866143", "0.5224691", "0.51903427", "0.5183724", "0.51782906", "0.5149907", "0.5118589", "0.50305766", "0.50225097", "0.49811178", "0.49375096", "0.49343422", "0.4930732", "0.49180707", "0.4...
0.44221345
78
root > left> right
def preorder_print(self, start , traversal): if start: traversal += (str(start.value) + "-") traversal = self.preorder_print(start.left, traversal) traversal = self.preorder_print(start.right, traversal) return traversal
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_right_sided_tree_with_two_nodes_root_has_child(empty_t):\n empty_t.insert(10)\n empty_t.insert(15)\n assert empty_t.root.right\n assert not empty_t.root.left", "def test_left_sided_tree_with_two_nodes_root_has_child(empty_t):\n empty_t.insert(10)\n empty_t.insert(5)\n assert empty_t...
[ "0.7174473", "0.7106898", "0.6968067", "0.6657949", "0.66005564", "0.65476197", "0.6528059", "0.6518019", "0.651312", "0.65034956", "0.6389875", "0.636526", "0.6305374", "0.6299839", "0.62493986", "0.6231868", "0.61965674", "0.61937064", "0.6192425", "0.6186225", "0.61751723"...
0.0
-1
Fully Connected layers to encode molecule to latent space
def __init__(self, in_dimension, layer_1d, layer_2d, layer_3d, latent_dimension): super(VAEEncoder, self).__init__() self.latent_dimension = latent_dimension # Reduce dimension up to second last layer of Encoder self.encode_nn = nn.Sequential( nn.Linear(in_d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, in_dimension, layer_1d, layer_2d, layer_3d, categorical_dimension, latent_dimension):\n super(VAEEncoderGumbel, self).__init__()\n self.latent_dimension = latent_dimension\n self.categorical_dimension = categorical_dimension\n\n # Reduce dimension up to second last la...
[ "0.63667285", "0.62881476", "0.6068788", "0.6042128", "0.6030988", "0.6012907", "0.6005724", "0.5987612", "0.5970382", "0.59615433", "0.59530526", "0.5945157", "0.5941547", "0.5897244", "0.5893889", "0.58908755", "0.58544695", "0.5829381", "0.5821063", "0.5816213", "0.579633"...
0.60127
7
Gets the sagemaker session based on the region.
def get_session(region, default_bucket): boto_session = boto3.Session(region_name=region) sagemaker_client = boto_session.client("sagemaker") runtime_client = boto_session.client("sagemaker-runtime") return sagemaker.session.Session( boto_session=boto_session, sagemaker_client=sagemake...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_session(role_arn, region):\n creds = assume_role(role_arn)\n aws_access_key_id = creds['AccessKeyId']\n aws_secret_access_key = creds['SecretAccessKey']\n aws_session_token = creds['SessionToken']\n session = Session(\n region_name=region,\n aws_access_key_id=aws_access_key_id,...
[ "0.72133726", "0.69645214", "0.6821182", "0.6732865", "0.6669828", "0.6535392", "0.64751256", "0.640031", "0.640031", "0.6363474", "0.6222177", "0.6178903", "0.61673164", "0.6164098", "0.6162528", "0.6159535", "0.614002", "0.6104558", "0.60881495", "0.60721684", "0.60703295",...
0.77983874
0
If a `CodeChunk`'s imports has an empty string element then no imports should be added to its list.
def test_import_with_semaphore(): c = CodeChunk('import moda\nimport modb', imports=['modc', 'modd', ''], programmingLanguage='python') dc = DocumentCompiler() dc.compile(c) assert len(c.imports) == 3 assert 'moda' not in c.imports assert 'modb' not in c.imports assert 'modc' in c.imports ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_import_appending():\n c = CodeChunk('import moda\\nimport modb\\nimport modc', imports=['modc', 'modd'], programmingLanguage='python')\n\n dc = DocumentCompiler()\n dc.compile(c)\n\n assert len(c.imports) == 4\n assert 'moda' in c.imports\n assert 'modb' in c.imports\n assert 'modc' i...
[ "0.62469757", "0.6100427", "0.5903527", "0.58822393", "0.55376273", "0.55159897", "0.5433019", "0.5334626", "0.52961516", "0.5283698", "0.5122479", "0.50964546", "0.5095202", "0.5088767", "0.50736326", "0.50468874", "0.5025342", "0.50150484", "0.49955752", "0.49926186", "0.49...
0.57657427
4
Reset all metrics being tracked.
def reset_all(self) -> None: for metric in self: metric.reset()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset_state(self):\n for name in self.metrics:\n self.metrics[name].reset_state()", "def reset(self):\n self.sum_metric = 0.\n self.num_inst = 0.\n self.metrics.reset_stats()", "def reset_metric_stats(self):\n\n self.__stats_table = {}", "def reset_metric_sta...
[ "0.79626423", "0.7926381", "0.7903128", "0.7817595", "0.7777698", "0.7663794", "0.7500871", "0.7488629", "0.7488629", "0.7471367", "0.740485", "0.7390822", "0.73524266", "0.73055613", "0.72683334", "0.72230726", "0.72230726", "0.72230726", "0.71705353", "0.71117944", "0.70540...
0.8568797
0
Choose a target from a DataFrame by entering a column name as a string and transform it into a pandas Series. target_name = name of column as a string; string must be valid column name to function properly. Returns a pandas Series to be divided by the train_val_test_split function.
def choose_target(self, df, target_name: str): return self.df[target_name]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def train_val_test_split(df, target):\n X_tv, X_test, y_tv, y_test = train_test_split(df, df[target],\n test_size=0.15,\n random_state=42)\n\n X_train, X_val, y_train, y_val = train_test_split(X_tv, y_tv,\n ...
[ "0.6094018", "0.5807433", "0.580354", "0.54472744", "0.5382598", "0.53478867", "0.53355896", "0.52918446", "0.52052116", "0.51958317", "0.5185669", "0.51713055", "0.5130914", "0.51235497", "0.51215947", "0.5119517", "0.5098133", "0.50930333", "0.50707334", "0.5069176", "0.506...
0.6306015
0
Inference method. Switch model to `eval` mode, call `.forward(x)` and apply activation function (if activation is not `None`) with `torch.no_grad()`
def predict(self, x): if self.training: self.eval() with torch.no_grad(): x = self.forward(x) if self.activation: x = self.activation(x) return x
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def forward(self, X: Tensor) -> Tensor:\n if self.training:\n if self.transform_on_train:\n return self.transform(X)\n elif self.transform_on_eval:\n if fantasize.off() or self.transform_on_fantasize:\n return self.transform(X)\n return X", ...
[ "0.6526352", "0.651388", "0.6480945", "0.64613914", "0.6435927", "0.6370633", "0.63260037", "0.6275474", "0.6260221", "0.62179124", "0.62119097", "0.61964834", "0.61907905", "0.6180332", "0.6172987", "0.61366016", "0.6095803", "0.6087415", "0.6079169", "0.60746664", "0.607315...
0.58446175
47
Get the exception raised by a call to Authlete's /api/auth/introspection API. `validate()` method internally calls Authlete's /api/auth/introspection API. If the API call threw an exception, the exception would be set to this property. Note that this property remains `None` if the API call succeeds, and in that success...
def introspectionException(self): return self._introspectionException
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_error(self):\n return self.exc_info", "def error(self):\n error = self._wrapped.error\n if error:\n return error\n\n return self.json['response'].get('error')", "def _get_exception(self):\r\n \r\n return self._exception", "def getError(self):\n ...
[ "0.5725096", "0.56532234", "0.56244725", "0.5560414", "0.54884034", "0.5328981", "0.53238696", "0.5323401", "0.5320804", "0.53202164", "0.5310185", "0.52892", "0.5259154", "0.5239123", "0.5228751", "0.5222633", "0.521861", "0.5188351", "0.5187827", "0.51410365", "0.5134306", ...
0.68661803
0
Get the error response that should be sent back to the client. This property is internally set by `validate()` method when `validate()` returns `False`. This error response complies with RFC 6750 (The OAuth
def errorResponse(self): return self._errorResponse
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def error(self):\n error = self._wrapped.error\n if error:\n return error\n\n return self.json['response'].get('error')", "def getError(self):\n \n return self.resp[\"error\"]", "def error(self) -> 'outputs.StatusResponse':\n return pulumi.get(self, \"error\...
[ "0.74217415", "0.7156245", "0.6838512", "0.68062073", "0.6802848", "0.6762135", "0.6613932", "0.6585937", "0.65834725", "0.65599173", "0.6544715", "0.6544715", "0.6544715", "0.6535925", "0.6372491", "0.6350434", "0.63342226", "0.62947935", "0.6293635", "0.62888056", "0.628094...
0.8221533
0
Test 3d convolutions for different parameter combinations
def test_convolution(): # Default test inputs_shape = [3,3,4,5,3] filters_shape = [3,1,4,4,3] test_convolution_for_parameters(inputs_shape, filters_shape, "Default test") # All dimensions 1 inputs_shape = [1,1,1,1,1] filters_shape = [1,1,1,1,1] test_convolution_for_parameters(inp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_conv3d():\n img_r = np.array([\n [0.3, 0.5, 0.7, 0.9],\n [0.1, 0.3, 0.5, 0.7],\n [0.9, 0.7, 0.5, 0.3],\n ])\n img_g = np.array([\n [0.4, 0.6, 0.8, 1.0],\n [0.5, 0.5, 0.5, 0.5],\n [0.1, 0.7, 0.5, 0.9],\n ])\n img_b = np.array([\n [0.2, 0.2, 0....
[ "0.73780936", "0.6383354", "0.6345057", "0.6343941", "0.63429266", "0.6312333", "0.6230704", "0.62282795", "0.619535", "0.618918", "0.61800474", "0.6161069", "0.6161069", "0.6156718", "0.6151113", "0.61489284", "0.6144277", "0.61298144", "0.6124748", "0.61162496", "0.61162496...
0.6799151
1
Returns the users worksheet object.
def get_drive_users_worksheet(): cfg = _get_gdrive_cfg() spreadsheet_key = cfg['users_spreadsheet_key'] worksheet_name = cfg['users_worksheet_name'] return get_drive_worksheet(spreadsheet_key, worksheet_name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_worksheet(self):\n return self.worksheet", "def get_worksheet(self, workbook):\n for worksheet_name in workbook.sheet_names():\n return workbook.sheet_by_name(worksheet_name)", "def get_username_sheet(self, service):\n range_name = ['Sheet2!A3:I']\n spreadsheet_id...
[ "0.6924459", "0.69238585", "0.64166534", "0.64061856", "0.6330203", "0.62881774", "0.6182801", "0.6155738", "0.6117755", "0.60069835", "0.59094083", "0.5861389", "0.5804214", "0.57992446", "0.5772481", "0.5767388", "0.57651013", "0.5756753", "0.5711808", "0.5630398", "0.56185...
0.8065527
0
Returns the content of the users spreadsheet as a pandas DataFrame.
def get_drive_users_dataframe(): return get_spreadsheet_as_dataframe(get_drive_users_worksheet())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _load_df(self):\n oauth_json = self.plugin_config[\"service_account_credentials\"]\n with tempfile.NamedTemporaryFile(mode=\"w+\", suffix=\".json\") as ntf:\n json.dump(oauth_json, ntf)\n ntf.seek(0)\n\n gc = gspread.service_account(filename=ntf.name)\n \n ...
[ "0.6594553", "0.6516374", "0.6475768", "0.6306412", "0.6242413", "0.61876976", "0.61392283", "0.6108449", "0.60097414", "0.6009438", "0.5943775", "0.59120303", "0.5883266", "0.5842872", "0.58382463", "0.5803326", "0.57777005", "0.575882", "0.5756633", "0.5745314", "0.57434356...
0.7955558
0
r"""Forward calculation of AdaptiveHingeLoss
def forward(self, pos_outputs: torch.Tensor, neg_outputs: torch.Tensor, mask: torch.Tensor = None) -> torch.Tensor: # Calculate loss by functional method loss = adaptive_hinge_loss(pos_outputs, neg_outputs, self.margin) # Apply masking and take re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_hinge_loss_backward():\n from your_code import HingeLoss\n X = np.array([[-1, 2, 1], [-3, 4, 1]])\n w = np.array([1, 2, 3])\n y = np.array([1, -1])\n\n loss = HingeLoss(regularization=None)\n\n _true = np.array([-1.5, 2, 0.5])\n _est = loss.backward(X, w, y)\n print(_est)", "def ...
[ "0.7575838", "0.71304584", "0.68219256", "0.68219256", "0.6796376", "0.6787192", "0.67445844", "0.668207", "0.6666828", "0.6633004", "0.6629026", "0.66172093", "0.6573176", "0.6540491", "0.6531738", "0.6529122", "0.65183014", "0.6508137", "0.6493203", "0.64780575", "0.6473787...
0.0
-1
Renders the home page.
def home(): return render_template( 'index.html', title= "Pi-Lapse", year=datetime.now().year, image = Cam.do.GetLastImage(), )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def render_home():\r\n\treturn render_template(\"index.html\")", "def home():\n\n return render_template('home_page.html')", "def home():\n\n return render_template(\"home.html\")", "def home():\n return render_template('home.html')", "def home():\n return render_template('home.html')", "def ...
[ "0.85574406", "0.853399", "0.8351404", "0.82762724", "0.82762724", "0.82762724", "0.82762724", "0.82762724", "0.82762724", "0.82762724", "0.82762724", "0.82762724", "0.82762724", "0.82762724", "0.82762724", "0.82762724", "0.82762724", "0.82762724", "0.82762724", "0.827363", "...
0.0
-1
appends the two vertices and the weight given
def addEdge(self,u,v,w): self.graph.append([u,v,w])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_edges(self, vertex1, vertex2, weight=1): \n edge_one = Edge(vertex1, weight)\n self._adjacency_list[vertex2.value].append(edge_one)\n\n edge_two = Edge(vertex2, weight)\n self._adjacency_list[vertex1.value].append(edge_two)", "def add_edge(self, vertex1, vertex2, weight=None)...
[ "0.6780067", "0.6747227", "0.6725507", "0.6704947", "0.66476935", "0.660621", "0.65830314", "0.6486341", "0.6478135", "0.64777964", "0.64629734", "0.6357153", "0.63404775", "0.632293", "0.632293", "0.6303368", "0.625096", "0.6247057", "0.618549", "0.617833", "0.6160426", "0...
0.66210467
5
tokenizer NLTK compatible tokenizer function stemmer NLTK compatible stemmer stopwords list of ignored words
def __init__(self, tokenizer, stemmer=None, stopwords=None): self.tokenizer = tokenizer self.stemmer = stemmer self.index = defaultdict(list) self.documents = {} self.__unique_id = 0 #can be used as docid if not stopwords: self.stopwords = list() el...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tokenize_stem_stop(text: Union[List[str], str]):\n text = __join_if_list(text)\n\n tokens = lower_and_tokenize(text)\n\n # stem words (e.g {installing, installed, ...} ==> install)\n # exclude stopwords (like \"a\", \"the\", \"in\", etc.)\n stopwords = __get_stopwords()\n stemmer = SnowballSt...
[ "0.75358516", "0.739511", "0.7298067", "0.7296248", "0.72947234", "0.7251969", "0.7157368", "0.7139848", "0.71324193", "0.7129927", "0.7121134", "0.7055909", "0.70352787", "0.7025401", "0.7006193", "0.6981204", "0.6980988", "0.69493276", "0.69412225", "0.69412225", "0.6923084...
0.0
-1
Logs in and starts the bot.
def start(self): self.login(not self.quiet) self.start_time = time.time() while True: self.print_time() try: self.tick() except Exception as e: print(e)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bot():\n log(log.DEBUG, 'Starting bot')\n bot = BotSad()\n bot.listen()", "def start():\n if not cfg.irc:\n logging.warning(\"Skipping IRC module: no configuration provided\")\n return\n\n server = cfg.irc.server\n port = cfg.irc.port\n ssl = cfg.irc.ssl\n nick = cfg.irc...
[ "0.7021864", "0.695243", "0.6898673", "0.6834677", "0.67946595", "0.6779326", "0.67540824", "0.67540824", "0.67540824", "0.67540824", "0.67465174", "0.67043626", "0.66331834", "0.6569195", "0.65573835", "0.6551823", "0.6543411", "0.6541788", "0.65219414", "0.6454123", "0.6441...
0.6198346
30
get the unsigned small int from the bytearray
def get_usint(bytearray_, byte_index): data = bytearray_[byte_index] & 0xff packed = struct.pack('B', data) value = struct.unpack('>B', packed)[0] return value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_sint(bytearray_, byte_index):\n data = bytearray_[byte_index]\n packed = struct.pack('B', data)\n value = struct.unpack('>b', packed)[0]\n return value", "def unsigned_int(data: Union[bytes, mmap], offset: int) -> int:\n return unpack(\"<I\", data[offset : offset + 4])[0]", "def unmarsha...
[ "0.73919255", "0.7033323", "0.6664482", "0.6537887", "0.65292495", "0.64598113", "0.6411864", "0.6388857", "0.63241404", "0.6302267", "0.62863934", "0.6281517", "0.62661505", "0.6237345", "0.6217063", "0.61989236", "0.61836475", "0.6162952", "0.6159936", "0.61519384", "0.6145...
0.7744286
0
save config to json file.
def write_to_json(dicts, filename: str): with open(filename, 'w', encoding='utf-8') as f: mmcv.dump(dicts, f, file_format='json')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save():\n with open(CONFIG_FILE, 'w') as f:\n json.dump(config, f, indent=4, sort_keys=True)", "def save_config_file(self):\n with open(self.config_file_name, 'w',encoding='utf-8') as outfile:\n json.dump(self._config, outfile,indent=2)", "def save(self):\n with open(self...
[ "0.8761327", "0.8658513", "0.84899926", "0.84879494", "0.841632", "0.8360352", "0.8352494", "0.83037126", "0.82846683", "0.8270394", "0.8239452", "0.8161462", "0.80975044", "0.8069556", "0.8044488", "0.80321527", "0.7934344", "0.7912357", "0.7895751", "0.78288454", "0.7823001...
0.0
-1
expand dilation rate according to config.
def expands_rate(d: int, config: dict) -> list: exp_rate = config['exp_rate'] large_rates = [] small_rates = [] for _ in range(config['num_branches'] // 2): large_rates.append( tuple([ np.clip(int(round((1 + exp_rate) * d[0])), config['mmin'], config['mmax']).item(),...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def expand_rates(dilation: tuple, config: dict) -> list:\n exp_rate = config['exp_rate']\n\n large_rates = []\n small_rates = []\n for _ in range(config['num_branches'] // 2):\n large_rates.append(\n tuple([\n np.clip(\n int(round((1 + exp_rate) * dil...
[ "0.6573199", "0.57066834", "0.54425156", "0.52719223", "0.5239665", "0.51852995", "0.51185656", "0.5096761", "0.5095261", "0.5086896", "0.5057924", "0.50515497", "0.5023763", "0.5023763", "0.50166017", "0.5005134", "0.49972174", "0.4995947", "0.49879476", "0.4985548", "0.4958...
0.63823354
1
The derivative of the quaternions is $\dot{q} = 1/2 .B(w).q$ This funtion returns $\dot{q}$.
def dqdt(self, q, w): K = 1e1 cq = np.asarray(q).reshape((4,1)) epslon = 1.0 - np.sum(cq**2.0) B = np.asarray([ [ 0, -w[0], -w[1], -w[2]], [w[0], 0, w[2], -w[1]], [w[1], -w[2], 0, w[0]], [w[2], w[1], -w[0], 0] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def quatdot(q_1,q_2):\n dot = np.zeros((1,4))\n dot = q_1[0,0]*q_2[0,0] + q_1[0,1]*q_2[0,1] + q_1[0,2]*q_2[0,2] + q_1[0,3]*q_2[0,3]\n return dot", "def quat_diff(q1, q2):\n q1 = np.asarray(q1)\n if np.dot(q1, q2) < 0:\n # Quaternions have opposite handedness, flip q1 since it's already an n...
[ "0.70362544", "0.675976", "0.6707952", "0.6606437", "0.65517974", "0.65517974", "0.6474904", "0.64455616", "0.63427335", "0.6292772", "0.6274824", "0.6274786", "0.62291175", "0.621315", "0.6184794", "0.61796385", "0.6130893", "0.61247826", "0.61067384", "0.6076927", "0.607294...
0.64469373
7
Language which represents the KnowledgeBase. When the KnowledgeBase is created/updated, expect this to be present for non enus languages. When unspecified, the default language code enus applies.
def language_code(self) -> str: return pulumi.get(self, "language_code")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def language(self):\n if \"language\" in self._prop_dict:\n return self._prop_dict[\"language\"]\n else:\n return None", "def default_language(self):\n return self._default_language", "def language(self):\r\n return self._get('language', {})", "def Language(s...
[ "0.7966426", "0.7953516", "0.78912544", "0.7852318", "0.7715714", "0.7715714", "0.7681941", "0.76714456", "0.76279193", "0.76199186", "0.75987357", "0.758563", "0.7566198", "0.75015247", "0.75015247", "0.75015247", "0.75015247", "0.7486182", "0.7402421", "0.7380627", "0.73731...
0.7034323
39
% uvsBackwardWarp warp the image using mot's inverse and cut the result to destrect % % wcoi = uvsBackwardWarp(mot, mei, destrect) % % if mot is the motion from A > B, then this function warps a piece of B (input coi) % (aka. source) to be aligned with A (aka. dest). The pixels that should exist % in the result is defi...
def uvsBackwardWarp(mot, mei, destrect): return uvsWarp(uvsInv(mot), mei, destrect)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def uvsWarp(mot, coi, destrect, crop_it=True):\n def resampleMei(coi, srect, drect):\n isrect = coi2imcoord(coi, srect)\n crect = np.array([np.floor(isrect[0]), np.ceil(isrect[1]), np.floor(isrect[2]), np.ceil(isrect[3])]).astype(np.int)\n cutim = coi.im[crect[2] - 1:crect[3], crect[0] - 1:...
[ "0.77316964", "0.7610888", "0.6444645", "0.6406545", "0.59483546", "0.5853615", "0.56882215", "0.56737745", "0.5669469", "0.5632815", "0.5550323", "0.55162334", "0.5506807", "0.5485707", "0.548363", "0.5367726", "0.53165793", "0.52847135", "0.5253065", "0.5172092", "0.516134"...
0.853704
0
r""" Returns a latex representation of ``self``.
def _latex_(self): return "\\textnormal{Extended code coming from %s}" % self.original_code()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _latex_(self):\n from sage.misc.latex import latex\n if self.parent()._chart.manifold().options.textbook_output:\n return latex(ExpressionNice(self._express))\n else:\n return latex(self._express)", "def _latex_(self):\n if len(self) == 0:\n return...
[ "0.8130144", "0.7742041", "0.75899255", "0.75315434", "0.7474316", "0.73811716", "0.73695254", "0.73695254", "0.72907764", "0.7266171", "0.71987057", "0.7133031", "0.7102864", "0.70735586", "0.7047238", "0.70289284", "0.6959999", "0.69542575", "0.69277024", "0.69138044", "0.6...
0.70928264
13
r""" Returns the code which was extended to get ``self``.
def original_code(self): return self._original_code
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_fullcode(self):\n raise NotImplementedError", "def get_code(self):\n return self.code", "def get_code(self):\n return self.code", "def get_code(self):\n return self.code", "def get_code(self):\n return self.code", "def code(self):\n raise NotImplementedEr...
[ "0.7335384", "0.7119818", "0.7119818", "0.7119818", "0.7119818", "0.7093062", "0.68371904", "0.6772116", "0.6730541", "0.6688757", "0.6688757", "0.6688757", "0.6688757", "0.6564078", "0.6564078", "0.65147245", "0.6414707", "0.64112246", "0.64049786", "0.63868916", "0.6348793"...
0.6671761
13
r""" Returns a latex representation of ``self``.
def _latex_(self): return "\\textnormal{Extended matrix-based encoder for }%s" % self.code()._latex_()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _latex_(self):\n from sage.misc.latex import latex\n if self.parent()._chart.manifold().options.textbook_output:\n return latex(ExpressionNice(self._express))\n else:\n return latex(self._express)", "def _latex_(self):\n if len(self) == 0:\n return...
[ "0.813055", "0.7742117", "0.75898784", "0.75318044", "0.7475059", "0.73816997", "0.73699653", "0.73699653", "0.7290636", "0.7266264", "0.7197854", "0.7133372", "0.70929784", "0.7074358", "0.7047943", "0.7029408", "0.69603556", "0.69545966", "0.6927638", "0.69127727", "0.69072...
0.7103756
12
r""" Tests equality between GRSEvaluationVectorEncoder objects.
def __eq__(self, other): return isinstance(other, ExtendedCodeExtendedMatrixEncoder) \ and self.code() == other.code()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testEquals(self):\n v1 = Vector(3, 4, 5)\n assert (v1 == [3, 4, 5])\n assert (v1 != [0, 2, 4])\n v2 = Vector(3.0, 4.0, 5.000)\n assert (v1 == v2)\n v3 = Vector(2, 2)\n assert v1 != v3", "def test_eq(self):\n dummy = DummyCryptographicObject()\n s...
[ "0.723918", "0.7088468", "0.69903713", "0.6945737", "0.6684595", "0.6669018", "0.6552606", "0.6521893", "0.6447362", "0.64316934", "0.6321504", "0.63044703", "0.625286", "0.6200175", "0.61608356", "0.61295444", "0.61096865", "0.61061776", "0.6090075", "0.6066554", "0.60406274...
0.6342411
10
r""" Returns a latex representation of ``self``.
def _latex_(self): return "\\textnormal{Decoder of } %s \\textnormal{ through } %s" % (self.code(), self.original_decoder())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _latex_(self):\n from sage.misc.latex import latex\n if self.parent()._chart.manifold().options.textbook_output:\n return latex(ExpressionNice(self._express))\n else:\n return latex(self._express)", "def _latex_(self):\n if len(self) == 0:\n return...
[ "0.8129983", "0.7741687", "0.7588933", "0.7531301", "0.7474333", "0.73807627", "0.73685867", "0.73685867", "0.7264507", "0.71969354", "0.71327853", "0.7102904", "0.70918775", "0.70737284", "0.70485276", "0.7028597", "0.69583845", "0.6953737", "0.6927092", "0.6912397", "0.6907...
0.729019
8
Test default product price of 10.
def test_default_product_price(self): prod = Product('Test Product') self.assertEqual(prod.price, 10)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_default_product_price(self):\n prod = Product('Test Product')\n self.assertEqual(prod.price, 10)", "def test_default_product_price(self):\n prod = Product('Test Product')\n self.assertEqual(prod.price, 10)", "def test_default_product_price(self):\n prod = Product('Te...
[ "0.8597318", "0.8597318", "0.8597318", "0.8597318", "0.8597318", "0.8597318", "0.8597318", "0.8597318", "0.8597318", "0.8597318", "0.8597318", "0.8508324", "0.84518147", "0.71186036", "0.704046", "0.704046", "0.704046", "0.704046", "0.704046", "0.704046", "0.70326275", "0.6...
0.8586228
11
Tests default number of products generated by generate_products()
def test_default_num_products(self): lst = generate_products() self.assertEqual(len(lst), 30)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_default_num_products(self):\n self.assertEqual(len(generate_products()), 30)", "def test_default_num_products(self):\n gen_prods = generate_products()\n self.assertEqual(len(gen_prods), 30)", "def test_default_num_products(self):\n products = generate_products()\n se...
[ "0.91296756", "0.9075361", "0.9070118", "0.905361", "0.90149516", "0.8846964", "0.88136226", "0.86528575", "0.7243414", "0.7099614", "0.70335793", "0.69389725", "0.69351995", "0.6924681", "0.6877562", "0.67750454", "0.6757516", "0.67434067", "0.67346734", "0.66926825", "0.666...
0.8912227
5
Picks a random name from the list.
def StrawPicker(): names_list = [] print("Welcome to the straw picker. Start entering your names. Type 'done' once you're finished.") while True: names = input(f"Enter your name #{len(names_list)}: ") if QuBa(names): return if len(names) < 1: print("Enter name...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rand_name(self, names):\n return randint(0, len(names) - 1)", "def get_random_name(name_list):\n length_of_list = len(name_list)\n while True:\n random_index = random.randrange(0, length_of_list-1)\n selected_name = name_list[random_index]\n if selected_name.__class__ == \"\...
[ "0.74304783", "0.74072784", "0.7244708", "0.7063784", "0.7003607", "0.699525", "0.69714457", "0.6869781", "0.6860768", "0.68387717", "0.68387717", "0.68387717", "0.68159276", "0.67590094", "0.6577033", "0.6566063", "0.65360725", "0.6500961", "0.64921767", "0.64859986", "0.644...
0.0
-1
Mismatched reference number should result in 400 Bad Request
def test_invalid_reference_number(self, order_placed): session, basket_id, order_number = self.prepare_basket() data = cs_factories.build_accepted_reply_data(order_number + 'ABC') data = cs_factories.sign_reply_data(data) url = reverse('cybersource-reply') resp = self.client.post...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_search_number_invalid():\n response = search.number({\"body\": \"{}\"}, {})\n\n assert response[\"statusCode\"] == 422", "def test_invalid_number_format(self, cred, number):\n resp = requests.get(verify_url.format('json', cred[0], cred[1],\n 'Tes...
[ "0.62988603", "0.62063324", "0.6174329", "0.60760444", "0.5975261", "0.5960889", "0.58496654", "0.5783991", "0.5769594", "0.5756139", "0.5750984", "0.57436454", "0.5740046", "0.567881", "0.56173325", "0.5606158", "0.5576578", "0.557638", "0.5576145", "0.5567842", "0.5566971",...
0.6307137
0
Missing basket should result in 400 Bad Request
def test_missing_basket(self, order_placed): session, basket_id, order_number = self.prepare_basket() del session[CHECKOUT_BASKET_ID] session.save() data = cs_factories.build_accepted_reply_data(order_number) data = cs_factories.sign_reply_data(data) url = reverse('cybers...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_make_order_with_some_data_missing(self):\n response = self.api_test_client.post('{}/orders'.format(\n self.BASE_URL), json={'item_name': 'Watermelon'}, headers={\n 'Content-Type': 'application/json'})\n\n self.assertEqual(response.status_code, 400)\n self.ass...
[ "0.6878292", "0.6727795", "0.6649479", "0.6560381", "0.65224785", "0.6503759", "0.6360137", "0.6357374", "0.6354312", "0.63415647", "0.63219607", "0.6317589", "0.6268862", "0.62635577", "0.6210256", "0.6189585", "0.61752766", "0.6161976", "0.6160678", "0.6130462", "0.6128098"...
0.6645629
3
This function checks if supplied string is valid postal code
def is_valid_postal_code(postal_code): is_code_valid = False postcode_regex = re.compile(r'^\d{2}-\d{3}$') if postcode_regex.search(postal_code) is not None: is_code_valid = True return is_code_valid
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_valid_postal_code(postal_code):\n assert postal_code is not None\n postal_code = postal_code.replace(\" \", \"\")\n postal_code_re = re.compile(r\"\\s*(\\w\\d\\s*){3}\\s*\")\n return postal_code_re.match(postal_code) is not None", "def is_valid(postal_code):\n return bool(re.match(UK_POST_C...
[ "0.82687515", "0.7746152", "0.72998667", "0.71536326", "0.7143606", "0.69778144", "0.6975321", "0.68734545", "0.6776917", "0.6737602", "0.6666134", "0.65536946", "0.6457006", "0.6357623", "0.6326112", "0.6295655", "0.62380266", "0.621906", "0.62129", "0.61996776", "0.61954695...
0.8105043
1
This function checks if supplied string is valid phone number
def is_valid_phone_number(phone_number): is_number_valid = False phone_number_regex = re.compile(r'^(\(?(00|\+)\d{2}\)?[ ]?)?' '\d{3}(-| )?\d{3}(-| )?\d{3}$') if phone_number_regex.search(phone_number) is not None: is_number_valid = True return is_number_v...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_phone(phone:str) -> bool:\r\n phone = phone.replace(\"-\", \"\").replace(\"(\", \"\").replace(\")\", \"\")\r\n return phone.isdigit() and len(phone) == 10", "def is_valid_phone(phone):\n assert phone is not None\n phone = str(phone)\n return len(phone) == 10 and is_valid_integer(phone...
[ "0.8415704", "0.82334816", "0.82121587", "0.81900877", "0.7879169", "0.7813166", "0.77842945", "0.7780823", "0.77609295", "0.77481323", "0.7722979", "0.77156234", "0.7571289", "0.7457664", "0.7454932", "0.7438889", "0.73954123", "0.7366052", "0.7360524", "0.7276312", "0.71979...
0.78296316
5
Path of the dataset
def path(self) -> str: return self._path
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dataset_path(cls):\n basepath = os.path.dirname(__file__)\n filepath = os.path.abspath(\n os.path.join(basepath, \"..\", \"datasets\", get_env('DATA_FILENAME')))\n return filepath", "def data_path(self):\n raise NotImplementedError", "def dataset_path(dataset, work_di...
[ "0.8352372", "0.82656807", "0.81583446", "0.78586286", "0.78065914", "0.76334023", "0.7621331", "0.7545332", "0.754097", "0.73564833", "0.71988016", "0.718612", "0.7182692", "0.71603316", "0.7131362", "0.7128759", "0.7092238", "0.70898545", "0.7027398", "0.6996553", "0.698539...
0.0
-1
Tests if a file name matches the specified rule. The asterisk () and question mark (?) are used as wildcard characters. The asterisk matches any sequence of characters. The question mark matches any single character. Relative path and file name are handled separately to support path rules. Cached regular expressions ar...
def _match_rule(self, name: str, rule: str) -> bool: if not rule in self._regexps: regexps = [] for part in os.path.normpath(rule).split(os.sep): if part: pattern = re.escape(part).replace("\*", ".*").replace("\?", ".") regexp = re....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fnmatch(pattern, filename) -> bool:\n return _fnmatch(filename, pattern)", "def fnmatch(name, pat):\r\n\r\n import os\r\n name = os.path.normcase(name)\r\n pat = os.path.normcase(pat)\r\n return fnmatchcase(name, pat)", "def _memorized_fnmatch(name: str, pattern: str) -> bool:\n return bo...
[ "0.64606524", "0.6336369", "0.6165459", "0.6021528", "0.59203416", "0.59064513", "0.5876877", "0.5864417", "0.5844378", "0.5809621", "0.5808497", "0.5772728", "0.57571006", "0.5636819", "0.5630715", "0.5626623", "0.5614563", "0.56032395", "0.5560497", "0.5546664", "0.5546338"...
0.77445894
0
Total size of the dataset in bytes.
def size(self) -> int: size = 0 for file in self.files.values(): size += file.size return size
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dataset_size(self):\n return self.dataset.size", "def get_size(self):\n return self._data_size", "def size(self):\n return self.data.size", "def size(self):\n size = 0\n size += self.data.size * sys.getsizeof(self.data)\n return size / 1024.0 / 1024.0 / 1024.0", ...
[ "0.8643168", "0.84633255", "0.8322903", "0.8239863", "0.8221664", "0.8116774", "0.80928177", "0.80311275", "0.8027191", "0.79666793", "0.79666793", "0.79666793", "0.79666793", "0.79666793", "0.79473597", "0.7945532", "0.7945532", "0.7945532", "0.7945532", "0.7940871", "0.7913...
0.0
-1
Time created. ISO 8601 formatted string.
def created_time(self) -> datetime.datetime: return self.__created_time
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def creation_time_str(self):\n return \"%Y/%m/%d %I:%M:%S\".format(self.creation_time)", "def time_created(self) -> str:\n return pulumi.get(self, \"time_created\")", "def time_created(self) -> str:\n return pulumi.get(self, \"time_created\")", "def time_created(self) -> str:\n re...
[ "0.8401408", "0.8109342", "0.8109342", "0.8109342", "0.807968", "0.7854243", "0.7854243", "0.7854243", "0.7828848", "0.7828848", "0.7656885", "0.7656885", "0.7656885", "0.7656885", "0.7656885", "0.7656885", "0.7656885", "0.7656885", "0.7656885", "0.7656885", "0.7656885", "0...
0.71917355
52
Timestamp of when the object was last updated.
def last_updated_time(self) -> datetime.datetime: return self.__last_updated_time
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def last_update_time(self):\n return self._last_update_time", "def dt_last_update(self):\n return self.last_update", "def get_last_update_time(self):\n return self.last_update_time", "def last_updated_time(self) -> str:\n return pulumi.get(self, \"last_updated_time\")", "def get...
[ "0.8392645", "0.8252183", "0.8152232", "0.811495", "0.8103357", "0.80886155", "0.80707425", "0.806056", "0.806056", "0.806056", "0.8056289", "0.7986817", "0.7986817", "0.7949598", "0.7936673", "0.7874884", "0.7859868", "0.7859868", "0.7824391", "0.7824391", "0.7824391", "0....
0.83315057
2
Marquee unique identifier for user who owns the object.
def owner_id(self) -> str: return self.__owner_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_id(self):\r\n return self.username", "def get_id(self):\n return self.username", "def get_id(self):\n return self.username", "def get_id(self):\n return self.username", "def get_username_and_id(self, obj):\n return \"%s - %s\" % (obj.user.username, obj.user.id)", ...
[ "0.65524006", "0.6486596", "0.6486596", "0.6486596", "0.64279425", "0.6352936", "0.63522375", "0.63522375", "0.62513864", "0.62360954", "0.6226164", "0.6224656", "0.619318", "0.6169323", "0.61637706", "0.61637706", "0.6161642", "0.61595386", "0.6158728", "0.61572266", "0.6157...
0.62903804
8
Switch off all traffic lights.
def switch_off_traffic_lights(self): for actor in self.world.get_actors(): if actor.type_id == 'traffic.traffic_light': actor.freeze(True) # We set the traffic light to 'green' because 'off' state sets the traffic light to # 'red'. acto...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def off(self):\n for light in self.all:\n GPIO.output(light, 0)", "def turn_off(self):\n print(\"Turning the lights off\")\n self.led.all_off()\n self.client.publish(STATE_TOPIC, OFF) #publish", "def turn_all_off(self):\n for led_type in LED:\n self.led_...
[ "0.8490833", "0.82648283", "0.79812765", "0.7934629", "0.7876847", "0.780806", "0.77698123", "0.77615196", "0.76732785", "0.7631892", "0.7563462", "0.7537031", "0.74757755", "0.7449703", "0.7438994", "0.73976654", "0.7394915", "0.7392608", "0.7389212", "0.7364708", "0.7322593...
0.82133853
2
2D gaussian mask should give the same result as MATLAB's fspecial('gaussian',[shape],[sigma])
def matlab_style_gauss2D(shape=(3,3),sigma=0.5): m,n = [(ss-1.)/2. for ss in shape] y,x = np.ogrid[-m:m+1,-n:n+1] h = np.exp( -(x*x + y*y) / (2.*sigma*sigma) ) h[ h < np.finfo(h.dtype).eps*h.max() ] = 0 sumh = h.sum() if sumh != 0: h /= sumh return h
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gaussian(size,sigma):\n a,b=np.ogrid[-size/2:size/2,-size/2:size/2]\n mask = a**2+b**2\n mask = np.exp(-mask.astype('float')/(2*float(sigma**2)))\n return mask", "def fspecial_gaussian(shape=(3, 3), sigma=0.5):\n m, n = [(ss - 1.) / 2. for ss in shape]\n y, x = np.ogrid[-m:m + 1, -n:n + 1]\...
[ "0.78294706", "0.75623554", "0.7225895", "0.71551406", "0.6947775", "0.6848298", "0.6787578", "0.6768947", "0.6715355", "0.6711355", "0.6686647", "0.6681261", "0.6675395", "0.6641459", "0.66110253", "0.6584013", "0.65656", "0.6559058", "0.65044975", "0.6503381", "0.64848197",...
0.67504513
9
Decorator that takes a dispatch function generating a key. The `register` function registers a specific function for a given key.
def dispatch_function(func: Callable[..., Hashable]) -> Callable[..., Callable[..., Any]]: registry = {} def dispatch(key): if key not in registry: raise KeyError('Unknown dispatch key') return registry[key] def inner(*args, **kwargs): return dispatch(func(*args, **kwa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __call__(self, key):\n\n def wrapper(func):\n self._registry[key] = func\n\n return wrapper", "def register(operation_key, *param_keys):\n\n def decorator(operation_fn):\n _operations[operation_key] = Operation(operation_fn, param_keys)\n return operation_fn\n\n r...
[ "0.7176514", "0.710963", "0.6334265", "0.6172376", "0.6148694", "0.6060668", "0.6031623", "0.59911543", "0.5963857", "0.58924454", "0.58859557", "0.5858617", "0.5851258", "0.5840743", "0.5749145", "0.5709298", "0.56514025", "0.56159204", "0.5517159", "0.5501998", "0.5494398",...
0.73192203
0
An instance of the IxVmCard class.
def IxVmCard(self): from ixnetwork_restpy.testplatform.sessions.ixnetwork.availablehardware.virtualchassis.ixvmcard.ixvmcard import IxVmCard return IxVmCard(self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def card(self):\r\n return Card(self)", "def card(self):\r\n return Card(self)", "def card(self, card_id):\r\n return Card(self, card_id)", "def cards(self):\r\n return Cards(self)", "def __init__(self, cards):\n self.cards = cards", "def card(self, card_id_or_shortlink...
[ "0.74185973", "0.74185973", "0.68895876", "0.6431621", "0.6060165", "0.59308195", "0.58022684", "0.57869285", "0.567778", "0.5664859", "0.5644574", "0.5600152", "0.5594605", "0.55514187", "0.5437419", "0.5418851", "0.53957754", "0.5360924", "0.5355112", "0.53486013", "0.53454...
0.8685731
0
Returns the index of the smallest number in the list
def smallest_elem_index(input_list): if len(input_list) == 0: raise Exception("List must contain at least 1 element") min_index = 0 for i in range(1, len(input_list)): if input_list[i] < input_list[min_index]: min_index = i return min_index
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __idx_of_minimum(cls, lst: list) -> int:\n\t\treturn lst.index(min(lst))", "def find_smallest(list):\n smallest_index = 0\n smallest_number = list[0]\n for index, number in enumerate(list):\n if number < smallest_number:\n smallest_index = index\n smallest_number = numbe...
[ "0.8595814", "0.8263448", "0.80947757", "0.8088723", "0.80792564", "0.80502915", "0.79955035", "0.7917306", "0.7905462", "0.7878911", "0.7817335", "0.7723657", "0.76911163", "0.76485485", "0.7588212", "0.7574464", "0.75733656", "0.7556274", "0.7545079", "0.7495229", "0.748802...
0.82020956
2
Return bit n of x
def bitget(x, n): return (x >> n) & 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bit_in_place(x, n):\n return (x & 2**n)", "def get_least_significant_bits(x, n):\n\n return x & ones(n)", "def get_bit(x, k):\n\n return (x >> k) & 1", "def bitset(x, n, bv):\n if bv==1:\n x |= 2**n\n else:\n x ^= bit_in_place(x, n)\n return(x)", "def maskbits(x: int, n:...
[ "0.8589173", "0.8109716", "0.7823501", "0.76113826", "0.7491007", "0.7443527", "0.72958004", "0.72410333", "0.72111225", "0.7173552", "0.7128075", "0.70718056", "0.7058484", "0.7033193", "0.7033193", "0.7010388", "0.69977206", "0.69831204", "0.6953104", "0.69281876", "0.69197...
0.8600585
0
Return bit n of x in its original bit position
def bit_in_place(x, n): return (x & 2**n)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bitget(x, n):\n return (x >> n) & 1", "def get_bit_position(x, k):\n\n return x & (1 << k)", "def get_bit(x, k):\n\n return (x >> k) & 1", "def get_least_significant_bits(x, n):\n\n return x & ones(n)", "def maskbits(x: int, n:int) -> int:\n if n >= 0:\n return x & ((1 << n) - 1)\...
[ "0.83914876", "0.7657135", "0.75990677", "0.7565446", "0.7442597", "0.7248466", "0.724008", "0.7188463", "0.7089641", "0.7035547", "0.7018076", "0.7016306", "0.69679385", "0.68901557", "0.68874586", "0.6870331", "0.6821012", "0.680033", "0.67678535", "0.67585415", "0.67511576...
0.82951474
1
Set bit n of x to bv
def bitset(x, n, bv): if bv==1: x |= 2**n else: x ^= bit_in_place(x, n) return(x)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_bit(num, i, v):\n return num & ~(1 << i) | (v << i)", "def set_bit(x, k):\n\n return x | (1 << k)", "def bit_in_place(x, n):\n return (x & 2**n)", "def _setBitOn(x, bitNum):\n _checkInt(x, minvalue=0, description='input value')\n _checkInt(bitNum, minvalue=0, description='bitnumber'...
[ "0.73331165", "0.7274809", "0.70870394", "0.70672095", "0.6891524", "0.68700516", "0.6834659", "0.66597354", "0.65392697", "0.64237887", "0.6411081", "0.64078087", "0.6276178", "0.6186617", "0.6076803", "0.605834", "0.60241014", "0.59893996", "0.59105474", "0.59104097", "0.58...
0.82798404
0
Construct a pandas DataFrame to store force and height data for each segment.
def construct_df(): iterable = [['approach', 'contact', 'retract', 'pause'], ['force', 'height']] index = pd.MultiIndex.from_product(iterable, names=['segment', 'channel']) return pd.DataFrame(columns=index)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def df(self):\n data = {\"sites\": self.sites, \"values\": self.values,\n \"stdeviations\": self.stdeviations}\n return pd.DataFrame(data, columns=[\"sites\", \"values\", \"stdeviations\"])", "def dataframe(self):\n df = pd.DataFrame({'x':self.x, 'y':self.y, 'd':self.d})\n\n ...
[ "0.6224242", "0.61453617", "0.60876125", "0.59639996", "0.59558415", "0.5940582", "0.5920973", "0.58822733", "0.5823352", "0.5808823", "0.5732611", "0.5708954", "0.5691875", "0.5675526", "0.56592643", "0.5648363", "0.56477416", "0.56220776", "0.5603953", "0.5583329", "0.55641...
0.6792288
0
The MAC Security (MACsec) CAK to associate with the dedicated connection. The valid values are 64 hexadecimal characters (09, AE). Required if using `ckn`.
def cak(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "cak")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cbc_mac(key, data):\n engine = AES.new(key, AES.MODE_CBC, get_zero_vector(16))\n return engine.encrypt(data)[-16:]", "def getMacName(self):\r\n return CipherSuite.canonicalMacName(self.cipherSuite)", "def macFor(cls, board):\n return cls.MAC_PREFIX + '{:02X}'.format(int(board))", "def...
[ "0.6890307", "0.6483881", "0.61452806", "0.6109432", "0.608284", "0.60670954", "0.60127324", "0.5965188", "0.5965188", "0.59520465", "0.58886176", "0.58886176", "0.5854882", "0.5834354", "0.5799104", "0.57475615", "0.56925696", "0.5676094", "0.56540793", "0.56383044", "0.5614...
0.0
-1