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
Test that valid JSON object implodes into valid string.
def test_implode_json(self): self.assertEqual('{"a_1": [{"a_2": 2, "f_2": 3, "g_2": 1}], "c_3": 1}', \ comparator.implode_json({"a_1": [{"a_2": 2, "f_2": 3, "g_2": 1}], "c_3": 1}))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __valid_json(string):\n try:\n obj = json.loads(string)\n except ValueError:\n return False\n else:\n return json.dumps(obj)", "def testfromjson(self):\n dicty = {\"id\": 5, \"class\": \"string\", \"list\": [], \"set\": {}}\n self.assertEqua...
[ "0.70126456", "0.6939657", "0.6939616", "0.69073474", "0.69073474", "0.68876886", "0.6769467", "0.6751211", "0.6728717", "0.6640332", "0.661407", "0.66093594", "0.65896505", "0.6534089", "0.6508719", "0.64925027", "0.6491361", "0.6448345", "0.64363533", "0.6423825", "0.641927...
0.0
-1
Read the full data set from file and return it as a Pandas DataFrame
def get_data(): return pd.read_csv( 'cetml1659on.dat', skiprows=6, sep='\s+', na_values=['-99.9', '-99.99'], )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_file_to_dataframe(self, file_path: str) -> pd.DataFrame:\n return pd.read_csv(file_path, sep=\"\\t\")", "def read_file(fname: str) -> pd.DataFrame:\n raw_data = (\n pd.read_hdf(fname).to_frame().reset_index(level=[0, 1]).loc[ANALYSIS_DATE]\n )\n raw_data[\"date\"] ...
[ "0.7898248", "0.783135", "0.7768955", "0.7768955", "0.7768955", "0.7579788", "0.7579788", "0.74528533", "0.7435008", "0.74049973", "0.739193", "0.73815155", "0.7330159", "0.7327047", "0.7322965", "0.72151095", "0.7214003", "0.7171817", "0.71651703", "0.71512496", "0.7136538",...
0.0
-1
Get questions by category id raise 404 if category not found.
def get_questions_by_category(category_id): try: category = get_category_by_id(category_id) if category is None: abort(STATUS_NOT_FOUND) questions = get_all_questions(category_id=category_id) return jsonify({ "success": True, "questions": questio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_404_get_question_by_category(self):\n res = self.client().get('/api/categories/101/questions')\n self.assertEqual(res.status_code, 404)\n data = json.loads(res.data)\n self.assertFalse(data[\"success\"])", "def retrieve_questions_by_category(category_id):\n try:\n ...
[ "0.78010434", "0.7353595", "0.70831335", "0.7049248", "0.70363176", "0.68794125", "0.68048877", "0.6764478", "0.66607267", "0.6603221", "0.6598103", "0.6581523", "0.656642", "0.6497925", "0.6470568", "0.6399294", "0.6319814", "0.627569", "0.6203658", "0.6170528", "0.60397357"...
0.7367104
1
Error handler for not found with status code 404.
def not_found(error): return jsonify({ 'success': False, 'error': STATUS_NOT_FOUND, 'message': ERROR_MESSAGES[STATUS_NOT_FOUND] }), STATUS_NOT_FOUND
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def not_found():\n return HttpError(404)", "def handleStatus_404(self):\n log.err('HTTP Error 404')", "def handle_notfound( environ ):\n return 404, [], make_error( 'Not Found', environ[ 'PATH_INFO' ] )", "def handler404(request):\n response = render_to_response('404.html', {})\n response....
[ "0.86769915", "0.8654244", "0.8410529", "0.8397226", "0.836706", "0.8279775", "0.8269981", "0.8221273", "0.8208208", "0.814195", "0.81343615", "0.81231064", "0.81194043", "0.811817", "0.81155205", "0.81098413", "0.81074953", "0.81071836", "0.81071836", "0.80904335", "0.808561...
0.7450699
93
Returns the tail of the list, i.e. the rest of the list without `self.head()`. Does not modify the underlying list.
def tail(self): if self.empty(): raise Exception("tail called on empty Cursor") else: return Cursor(self._list, self.index + 1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_tail(self):\n pointer = self.head\n while pointer.next_node:\n pointer = pointer.next_node\n return pointer", "def peek_last(self):\n if self.is_empty(): raise RuntimeError(\"Empty list\")\n return self.tail.data", "def tail(self):\n return self._tai...
[ "0.76245725", "0.73223484", "0.7311307", "0.7311307", "0.72715515", "0.7257775", "0.724409", "0.72408926", "0.7236688", "0.7060192", "0.6984749", "0.6911415", "0.6903667", "0.6886063", "0.68855834", "0.6848931", "0.68364924", "0.6809556", "0.680542", "0.68035376", "0.6784701"...
0.64794946
34
Returns a new Cursor on this Cursor's list, at the specified index. Does not copy the underlying list.
def at(self, index): return Cursor(self._list, index)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tail(self):\n if self.empty():\n raise Exception(\"tail called on empty Cursor\")\n else:\n return Cursor(self._list, self.index + 1)", "def index(self, *index):\n # .index() resets\n s = self._clone()\n if not index:\n s._index = None\n ...
[ "0.6224085", "0.6043138", "0.58508873", "0.5785007", "0.57502466", "0.56166494", "0.55539805", "0.55267805", "0.55203176", "0.5516711", "0.5506712", "0.54734635", "0.5446013", "0.54428375", "0.54048043", "0.5401309", "0.53989834", "0.5353783", "0.5310984", "0.5309808", "0.529...
0.8740931
0
Maps elements of this cursor via `map_fn` until `map_fn` returns falsy. Returns the collected list of mapped elements, and a Cursor positioned at the first element in the list that mapped to a falsy value.
def map_while(self, map_fn): mappings = [] cursor = self mapping = True while cursor.not_empty() and mapping: mapping = map_fn(cursor.head()) if mapping: mappings.append(mapping) cursor = cursor.tail() return (mappings, curs...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __map_and_filter(_input: MutableSequence[T],\n _map: Callable[[T], Any] = lambda x: x,\n _filter: Callable[[T], bool] = lambda x: True) -> MutableSequence[Any]:\n\n return [_map(x) for x in _input if _filter(x)]", "def drop_while(coll, func): \n i = 0\n while ...
[ "0.553322", "0.5507595", "0.5400299", "0.5356471", "0.5335284", "0.5266585", "0.5224523", "0.5201668", "0.52003837", "0.51346254", "0.5099721", "0.504173", "0.49930522", "0.49902922", "0.4988033", "0.49835303", "0.4975505", "0.49646297", "0.49042228", "0.48730347", "0.4867722...
0.7372497
0
Execute work until the future is complete. Callbacks and other work will be executed in a SingleThreadedExecutor until future.done() returns True or rclpy is shutdown.
def spin_until_future_complete(node, future, executor=None): executor = get_global_executor() if executor is None else executor try: executor.add_node(node) executor.spin_until_future_complete(future) finally: executor.remove_node(node)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run_until(self, future):\n @coroutine\n def inner():\n yield from future\n self._unschedule_all()\n self.loop.run_until_complete(asyncio.ensure_future(inner()))", "def _future_work_():\n pass", "def run_until_complete(self, future, timeout=None): # NEW!\r\n ...
[ "0.6649419", "0.6450642", "0.6301808", "0.5825906", "0.5812852", "0.5799747", "0.57868373", "0.57705075", "0.5758156", "0.5753766", "0.57412547", "0.5663614", "0.56243575", "0.557873", "0.55638164", "0.5550744", "0.55503356", "0.5519838", "0.551515", "0.5500011", "0.5487419",...
0.55801463
13
Increase the y axis by given (small) amount
def increase_y(self, state_amount): pos_amount = state_amount / self.space_subdivisions if self.pos_y + pos_amount < self.unit: self.pos_y = self.unit elif self.pos_y + pos_amount > 1.0 - self.unit: self.pos_y = 1.0 - self.unit else: self.pos_y = self....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_axis_y(self, new_axis_point):\r\n self.__y_axis = new_axis_point", "def set_y(self, new_y):\r\n self.y = new_y", "def y(self, value):\n if not (0 < value < SCREEN_HEIGHT - self.height):\n self.dir_y = -self.dir_y\n self._y += abs(self._y - value) * self.dir_y", ...
[ "0.7111089", "0.7067304", "0.6817044", "0.673916", "0.66344637", "0.66344637", "0.66052425", "0.6591268", "0.6522655", "0.6475032", "0.6463889", "0.64328635", "0.6428911", "0.64207256", "0.6418648", "0.64113146", "0.64089984", "0.6406062", "0.6387664", "0.63804346", "0.636935...
0.7042225
2
Set the y axis decimal position
def set_y(self, state_value): val = state_value / self.space_subdivisions + self.unit epsilon = 1e-6 if not self.unit <= val <= 1.0 - self.unit + epsilon: raise AttributeError("Value out of bounds") self.pos_y = val
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_y(self, y: float):\n self.y = y", "def setY(self, value):\n self.position[1] = value", "def __draw_yaxis(self):\n self.ax.set_ylim(self.ylims)\n # set y ticks\n yticks = [*range(0, self.ymax, 5)]\n fs = self.settings.rcParams[\"axes.labelsize\"] if self.setting...
[ "0.72356445", "0.70184404", "0.69513273", "0.6790154", "0.67710084", "0.67710084", "0.67673725", "0.67340696", "0.6716918", "0.67115784", "0.67107046", "0.67042667", "0.66998893", "0.6676879", "0.65456986", "0.65409005", "0.6536455", "0.6536455", "0.65168494", "0.6490037", "0...
0.66582704
14
Helper function to freeze weights of the base model Args
def _freeze_base_model(self, modality, freeze_mode): if freeze_mode == "all": print("Freezing the Base model.") for param in getattr(self, "Base_{}".format(modality)).parameters(): param.requires_grad = False elif freeze_mode == "partialbn" and self.base_model_na...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def freeze_model(self):\n # BN layers need to be freezed explicitly since they cannot be freezed via '.requires_grad=False'\n for module in self.modules():\n if isinstance(module, (nn.BatchNorm2d, nn.GroupNorm)):\n module.eval()\n \n # freeze all parameters\n ...
[ "0.71988785", "0.67592853", "0.6753739", "0.6696791", "0.66212523", "0.6581039", "0.6574347", "0.65439975", "0.63393384", "0.6324345", "0.63032305", "0.6297751", "0.62899", "0.6275054", "0.6209337", "0.62070376", "0.6198616", "0.61924076", "0.61850953", "0.618357", "0.6178196...
0.74430555
0
Helper function to freeze weights of the base model Args
def _aggregate_scores(self, scores, new_shape=(1, -1)): assert isinstance(scores, (dict, torch.Tensor)) assert isinstance(new_shape, tuple) if isinstance(scores, dict): for key in scores.keys(): # Reshape the tensor to B x N x feature size, # before ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _freeze_base_model(self, modality, freeze_mode):\n\n if freeze_mode == \"all\":\n print(\"Freezing the Base model.\")\n for param in getattr(self, \"Base_{}\".format(modality)).parameters():\n param.requires_grad = False\n elif freeze_mode == \"partialbn\" and...
[ "0.7442864", "0.7202029", "0.6760114", "0.6757101", "0.6699162", "0.6621716", "0.6584286", "0.6573972", "0.6545437", "0.63416934", "0.6327056", "0.63042974", "0.62992907", "0.629057", "0.6276091", "0.6209781", "0.6209242", "0.62011224", "0.61940175", "0.61866367", "0.61856973...
0.0
-1
It inserts the button to save and export the notebook as an embed_HTML
def insert_rendition(note, note_name): button_rend = open(PATH_UTILS + 'preview_HTML.py').read() note['cells'] += [nb.v4.new_code_cell(button_rend.replace('?FILENAME?', note_name))] note.cells[-1].metadata = {"init_cell": True, "tags": ['run_start'], "editable": False, "deletable": False, "tags": ['run_star...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def export_notebook():\n #system(\"jupyter nbconvert --to HTML \\\"Look At Enron data set.ipynb\\\"\")\n system(\"jupyter nbconvert --to HTML --output=Look+At+Enron+data+set.html \\\"Look At Enron data set.ipynb\\\"\")\n return", "def save_current_nb_as_html(info=False):\n assert in_ipynb()\n\n fu...
[ "0.6973831", "0.6596256", "0.6421619", "0.6389082", "0.6312435", "0.62654626", "0.6265459", "0.6041431", "0.6031877", "0.59675705", "0.59076065", "0.5876155", "0.5869668", "0.5800764", "0.5798376", "0.578653", "0.5699953", "0.5699953", "0.55925304", "0.55887675", "0.55887675"...
0.49341565
92
Construct a dumbEmoji object from its dictionary representation. If both an ID and a unicode representation are provided, the emoji ID will be used.
def fromDict(cls, emojiDict : dict, **kwargs) -> dumbEmoji: rejectInvalid = kwargs["rejectInvalid"] if "rejectInvalid" in kwargs else False if type(emojiDict) == dumbEmoji: return emojiDict if "id" in emojiDict: if emojiDict["id"] == 0: return dumbEmoji.E...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dumbEmojiFromStr(s : str) -> dumbEmoji:\n if type(s) == dumbEmoji:\n return s\n if type(s) == dict:\n return dumbEmojiFromDict(s)\n if isUnicodeEmoji(s):\n return dumbEmoji(unicode=s)\n elif isCustomEmoji(s):\n return dumbEmoji(id=int(s[s[s.index(\":\")+1:].index(\":\")+...
[ "0.71143246", "0.67178386", "0.67085356", "0.586928", "0.5608321", "0.54813236", "0.53057253", "0.5232978", "0.51436514", "0.5137245", "0.51251453", "0.5094067", "0.50500804", "0.50497", "0.5020558", "0.5019778", "0.5004183", "0.49909002", "0.49721834", "0.49710587", "0.49602...
0.8126695
0
Adds commandline arguments pertaining to training a model. These are different from the arguments dictating the model architecture.
def add_train_args(parser): parser.register('type', 'bool', str2bool) # Runtime environment runtime = parser.add_argument_group('Environment') runtime.add_argument('--no-cuda', type='bool', default=False, help='Train on CPU, even if GPUs are available.') runtime.add_argument...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_train_args(parser):\n\n # Runtime environment\n runtime = parser.add_argument_group('Environment')\n runtime.add_argument('--dataset', type=str, default=\"searchqa\",\n help='Dataset: searchqa, quasart or unftriviaqa')\n runtime.add_argument('--base_dir', type=str, defau...
[ "0.7584579", "0.7450639", "0.7416743", "0.7408205", "0.7381234", "0.72820014", "0.72462153", "0.7141932", "0.71342915", "0.7133612", "0.7102615", "0.70485526", "0.7035238", "0.7016071", "0.6951427", "0.6938835", "0.69271606", "0.68915665", "0.68802047", "0.68490934", "0.68385...
0.74698377
1
Check if the stack is full or not.
def isFull(self): if len(self.batch) == self.__batch_size: return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_full(self): #checks to see if stack is full by comparing it to the capacity\n if self.num_items == self.capacity:\n return True\n else:\n return False", "def is_empty(self):\n return len(self.stack) == 0", "def is_empty(self):\n return le...
[ "0.8321418", "0.7983887", "0.79595804", "0.7881708", "0.78058916", "0.78058916", "0.77232194", "0.7704919", "0.7687648", "0.7671286", "0.75727993", "0.756861", "0.75546515", "0.7541563", "0.7530106", "0.7512447", "0.74824774", "0.74824774", "0.7438913", "0.7427661", "0.740219...
0.6539718
91
r"""Calculates the output tensor on passing the image ``x`` through the Discriminator.
def forward(self, x, feature_matching=False): x = self.model(x) return self.output(x)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def evaluate(self, architecture_output, target_output):\n\n def discriminator_layer(image, name, n, depth, stride, training=True):\n \"\"\"This function creates one layer of the discriminator network.\n\n This function is to be called when creating the structure of the\n dis...
[ "0.6754469", "0.6599978", "0.6471476", "0.64024913", "0.63077277", "0.63015866", "0.6244399", "0.6234966", "0.62208015", "0.62035495", "0.6201749", "0.6097965", "0.6066595", "0.6060173", "0.60587645", "0.6055986", "0.6045468", "0.6043284", "0.5992526", "0.5936307", "0.5932191...
0.0
-1
Initialise. Create a dictionary reference of part ID's and their OBJ path.
def __init__(self): # Load in light information. self.lights_dictionary = utils.load_dictionary(self.LIGHTS_JSON) # Load in nice name information. self.nice_name_dictionary = utils.load_dictionary(self.NICE_JSON) # Set an initial order flag. self.part_order = 0 # ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup(self): \n self.suburbs_dict = dict()\n self.raw_proIds_dict = dict()\n self.propertyIds_dict = dict()\n self.valuations = dict()", "def __init__(self, pg):\n self._paths = []\n for key, value in pg.items():\n if key == \"paths\":\n ...
[ "0.60454375", "0.6014876", "0.5839867", "0.57908285", "0.56131625", "0.5604289", "0.56011385", "0.5597128", "0.55666476", "0.5491945", "0.54889387", "0.546553", "0.54474974", "0.54161716", "0.54092383", "0.5408581", "0.5390852", "0.53690827", "0.53604496", "0.5344424", "0.530...
0.6372537
0
Given a pack name, return it's associated path.
def get_model_path_from_pack(self, pack_request): for pack_name, pack_path in self.available_packs: if pack_name == pack_request: return pack_path
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _pkg_path(self, pkg):\n r = rospkg.RosPack()\n pkg_path = r.get_path(pkg) \n return pkg_path", "def _pkg_path(self, pkg):\n r = rospkg.RosPack()\n pkg_path = r.get_path(pkg) \n return pkg_path", "def get_path(name: str) -> str:\n return _pooch.fetc...
[ "0.6855222", "0.6855222", "0.6753942", "0.6753942", "0.6541193", "0.59934795", "0.59823704", "0.59354067", "0.59093165", "0.5906736", "0.58939755", "0.58539796", "0.585293", "0.5845841", "0.5845837", "0.57941604", "0.5792674", "0.57903576", "0.5785672", "0.5769156", "0.573316...
0.66684884
4
pass through a sigmoid function; this will be our activation function
def sig_func(x, w, b): z = np.dot(x, np.transpose(w)) + b try: s = 1 / (1 + exp(-z)) except OverflowError: s = float('inf') return s
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sigmoid_activation(x):\n return 1.0 / (1 + np.exp(-x))", "def sigmoid(X,W,b):\n preActivation = np.dot(X, W) + b\n return (1.0)/(1.0 + np.exp(-preActivation))", "def sigmoid(x):\r\n return 1 / (1 + np.exp(-x))", "def sigmoid(x):\n return 1 / (1 + exp(-x))", "def sigmoid(x):\n return 1...
[ "0.8433485", "0.82847655", "0.8192158", "0.818258", "0.818258", "0.8182444", "0.8180967", "0.81500953", "0.81484914", "0.8142061", "0.8133941", "0.8123074", "0.8123074", "0.8123074", "0.8123074", "0.8123074", "0.8123074", "0.8116751", "0.8115734", "0.8113843", "0.8104586", ...
0.0
-1
Constructor. Pass in a handle to player. Needed for when moving platforms collide with the player.
def __init__(self, screen, player, diff): self.screen = screen self.player = player self.init_difficulty = diff self.start_time = pygame.time.get_ticks() self.close = False self.close_time = 0 self.platform_list = pygame.sprite....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, player):\n\t\tself.player = player", "def __init__(self, player):\n self.player = player", "def __init__(self, *args, **kwargs):\n super(Player, self).__init__(*args, **kwargs)", "def __init__(self, player):\n self.platform_list = pygame.sprite.Group()\n self.en...
[ "0.77231866", "0.7595499", "0.7080239", "0.69828427", "0.69644624", "0.69105446", "0.6889749", "0.6837545", "0.6835783", "0.67911077", "0.67646843", "0.6741916", "0.67302036", "0.6726993", "0.671572", "0.6631071", "0.6558635", "0.6551346", "0.6535295", "0.65187436", "0.648396...
0.0
-1
Filter objects by the 'user' field.
def by_user(self, user, **kwargs): return self.select_related()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter_by_owner(self, user):\n return self.filter(owner=user)", "def get_queryset(self):\n filter_kwargs = {self.bound_to_user_field_name: self.request.auth.user}\n return super(BoundToUserMixin, self).get_queryset().filter(**filter_kwargs)", "def user_objects(cls, user):\n retu...
[ "0.77877027", "0.751539", "0.74419916", "0.7344984", "0.73082817", "0.728992", "0.72513855", "0.7216652", "0.72073907", "0.70905066", "0.70402247", "0.70261896", "0.6978064", "0.6932051", "0.6923237", "0.6903759", "0.6902897", "0.68395203", "0.67696226", "0.67499954", "0.6631...
0.62835526
47
Group objects by category and take the average of the values.
def avg_by_category(self, start_date, end_date): data = self.by_date(start_date, end_date) return data.values('category__name').annotate(avg_value=models.Avg('value')).order_by('category')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_average(values_per_category):\n sum = 0\n num_categories = 0\n for category in values_per_category:\n num_categories += 1\n sum += values_per_category[category]\n return sum / num_categories", "def create_feature_average_value_for_category(data, item):\n utils.save_log('{0} :...
[ "0.70602226", "0.6710419", "0.64120346", "0.62712085", "0.6120465", "0.5990346", "0.59093577", "0.58876765", "0.5752044", "0.5730655", "0.56454986", "0.5562313", "0.5547221", "0.5533601", "0.55290794", "0.55239445", "0.5521062", "0.55177146", "0.551102", "0.5453478", "0.54500...
0.6962641
1
Opens the SimpleChromeDriver and falls into the interpreter for playing around with things
def open_scd(): settings = get_settings() download_dir = Path(settings.chrome_download_dir).expanduser() profile_dir = Path(settings.chrome_profile_dir).expanduser() with SimpleChromeDriver(download_dir, profile_dir) as scd: scd.start() import code code.interact(local=dict(global...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start_chrome():\n os.system(\"start {CHROME_PATH} --remote-debugging-port={CHROME_DEBUG_PORT} --user-data-dir=\\\"{CHROME_USERDATA_PATH}\\\" --lang=zh-CN\".format(\n CHROME_PATH=CHROME_PATH, CHROME_DEBUG_PORT=CHROME_DEBUG_PORT, CHROME_USERDATA_PATH=CHROME_USERDATA_PATH))\n\n chrome_options = Optio...
[ "0.70674855", "0.7066412", "0.6698198", "0.6633192", "0.6588362", "0.6559349", "0.65485334", "0.65295887", "0.65019816", "0.65019816", "0.6455774", "0.6451579", "0.6418617", "0.6371837", "0.6366316", "0.63517374", "0.63277173", "0.6312584", "0.6263341", "0.625561", "0.62232",...
0.72392744
0
This route displays the main/index page.
def main(): return render_template('index.html')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index():\n return render_template(\n 'main/index.html',\n title='Main page'\n )", "def index(self):\n return render_template('main/index.html')", "def index():\n return render_template('main.html')", "def index():\n return render_template('main.html')", "def index():\n ...
[ "0.8384523", "0.8128889", "0.7971943", "0.7971943", "0.7964373", "0.7881438", "0.78651434", "0.7843105", "0.7836917", "0.7836917", "0.77871275", "0.778417", "0.7754252", "0.7754252", "0.771109", "0.7710717", "0.7702258", "0.7675622", "0.7668744", "0.7668744", "0.7668744", "...
0.7454932
78
Takes a neutron velocity V in m/s and converts it to lambda in angstroms
def V2lambda(V): return(3956/V)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nm_to_ev(lambda_):\n h = 6.2 * 10 ** -34 # (?)\n c = 299792458\n f = c / lambda_\n e = h * f * 100000000 # because of nm instead of m\n e2 = 1.0 * e / (10 ** -19)\n print(e2, \"eV\")\n return e2", "def angstrom_aod_at_lambda(aod0, lambda0, alpha=1.14, lambda1=700.0):\n return aod0 *...
[ "0.66738105", "0.66485393", "0.6566697", "0.6527834", "0.6354463", "0.6297796", "0.6270176", "0.61058545", "0.6032348", "0.6003408", "0.5979153", "0.59565634", "0.59547573", "0.5875637", "0.5864775", "0.58594537", "0.5839281", "0.58387655", "0.58381325", "0.5807664", "0.57662...
0.7585652
0
The KL divergence from the variational distribution to the prior
def KL(self): self.build_cholesky_if_needed() KL = -0.5 * self.num_inducing * self.num_nodes * self.dim_per_out for nd in range(self.num_nodes): q_sqrt_nd = self.q_sqrt_lst[nd] with params_as_tensors_for(q_sqrt_nd, convert=True): KL -= 0.5 * tf.reduce_s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def kl_divergence(self) -> Tensor:\n return self.variational_strategy.kl_divergence().sum(dim=1).mean()", "def kl_divergence(mu, logvar):\n klds = -0.5*(1 + logvar - mu.pow(2) - logvar.exp())\n total_kld = klds.sum(1).mean(0, True)\n dimension_wise_kld = klds.mean(0)\n mean_kld = klds.mean(1)....
[ "0.79924214", "0.7681632", "0.76779", "0.7626055", "0.758", "0.74929273", "0.7459091", "0.73978436", "0.7341976", "0.73240703", "0.7304507", "0.7291152", "0.7167363", "0.7139671", "0.713152", "0.71254086", "0.7113217", "0.7070393", "0.7028246", "0.69509184", "0.69250625", "...
0.0
-1
Returns if the word is in the trie.
def search(self, word): node = self.root for letter in word: if letter not in node.children: return False node = node.children[letter] return node.word
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def in_trie(self, trie, word):\n current_dict = trie\n for letter in word:\n if letter in current_dict:\n current_dict = current_dict[letter]\n else:\n return False\n else:\n if '_end_' in current_dict:\n return curr...
[ "0.838632", "0.8150416", "0.8123471", "0.7856802", "0.7830664", "0.77935004", "0.7792806", "0.77642965", "0.7753436", "0.7747724", "0.7711298", "0.76816714", "0.7677101", "0.7664614", "0.76506114", "0.76338875", "0.7628353", "0.76114196", "0.7577657", "0.75695884", "0.756079"...
0.7232451
51
Runs the passwords through a hash and appends.
def set_password(self, password): self.password_hash = generate_password_hash(str(password))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_password(args):\n for password in args:\n heashed=hash_password(password)\n print(heashed)\n # checked=check_password(heashed)", "def hash_all_password(db):\n passwords = []\n # Filter all users that needs update\n for security in db['security'].find():\n update = {}\n # ...
[ "0.68333465", "0.65163296", "0.6445835", "0.62189674", "0.61914897", "0.6129258", "0.60973704", "0.6070059", "0.60641265", "0.6053884", "0.6044887", "0.59895384", "0.5978022", "0.5972177", "0.5966764", "0.5962361", "0.5938177", "0.5904473", "0.59040856", "0.5895461", "0.58764...
0.0
-1
Computes Euclidian Distance b/w two feature vectors X1 can be a numpy ndarray and x2 is numpy array
def _euclidian_distance(self, x1, x2): a= x1-x2 a2 = a**2 b = np.sum(a2, axis=1) c = np.sqrt(b) return c
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_feature_distances(features1: np.ndarray, \r\n features2: np.ndarray) -> np.ndarray:\r\n #broadcasting trick\r\n a = features1[:, np.newaxis, :]\r\n b = features2[np.newaxis, :, :]\r\n \r\n return np.linalg.norm( (a-b), axis=-1)", "def euclidean_distance(x1:...
[ "0.7816244", "0.7808609", "0.7703177", "0.76813495", "0.7666806", "0.7592636", "0.7402267", "0.735111", "0.7240136", "0.72320914", "0.71527284", "0.7129991", "0.7124229", "0.70791507", "0.70430213", "0.7035438", "0.7012098", "0.69866854", "0.6983904", "0.69837594", "0.6963854...
0.7164826
10
Returns if the word is in the trie.
def search(self, word): curNode = self.root for c in word: if not c in curNode: return False curNode = curNode[c] # Doesn't end here if not self.end in curNode: return False return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def in_trie(self, trie, word):\n current_dict = trie\n for letter in word:\n if letter in current_dict:\n current_dict = current_dict[letter]\n else:\n return False\n else:\n if '_end_' in current_dict:\n return curr...
[ "0.838632", "0.8150416", "0.8123471", "0.7856802", "0.7830664", "0.77935004", "0.7792806", "0.77642965", "0.7753436", "0.7747724", "0.7711298", "0.76816714", "0.7677101", "0.7664614", "0.76506114", "0.76338875", "0.7628353", "0.76114196", "0.7577657", "0.75695884", "0.756079"...
0.74387366
35
Attempt to fuzzy match the target string to an operator name using the given scorer function. The alias for the match with the highest score is returned. If a match with a score above the cutoff is not found, None is returned
def _fuzzy_match( self, target: str, scorer=None, score_cutoff=85, limit=1 ) -> pd.Series: scorer = scorer or self.default_scorer() # result = pd.Series(name = target) extracted: list = process.extractBests( target, self.operator, scorer=scorer, limit=limit, score_cutof...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_fuzzy_match(object, answer, threshold=80):\n answer_phrase = generate_ngrams(answer)\n if answer_phrase:\n best_match = [fuzz.ratio(object, phr) for phr in answer_phrase]\n if np.max(best_match)>threshold:\n return np.max(best_match), answer_phrase[np.argmax(best_match)]\n ...
[ "0.6589819", "0.64425164", "0.58997977", "0.58632153", "0.58299005", "0.56999075", "0.5664272", "0.5549336", "0.5484873", "0.5475975", "0.53234446", "0.53025043", "0.52954453", "0.52909315", "0.5284119", "0.5278062", "0.5250008", "0.5246519", "0.51911473", "0.51895994", "0.51...
0.71131057
2
Attempt to fuzzy match the target string to an operator name using the given scorer function. The alias for the match with the highest score is returned. If a match with a score above the cutoff is not found, None is returned
def _fuzzy_match( self, target: str, scorer=None, score_cutoff=85, limit=1 ) -> pd.Series: scorer = scorer or self.default_scorer() # result = pd.Series(name = target) extracted: list = process.extractBests( target, self.operator, scorer=scorer, limit=limit, score_cutof...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_fuzzy_match(object, answer, threshold=80):\n answer_phrase = generate_ngrams(answer)\n if answer_phrase:\n best_match = [fuzz.ratio(object, phr) for phr in answer_phrase]\n if np.max(best_match)>threshold:\n return np.max(best_match), answer_phrase[np.argmax(best_match)]\n ...
[ "0.659055", "0.64439535", "0.59002095", "0.5863153", "0.5831834", "0.5701473", "0.5665831", "0.5550824", "0.54848444", "0.5475604", "0.5324608", "0.53036016", "0.52972806", "0.5290554", "0.5284169", "0.52791375", "0.5251146", "0.52473545", "0.5191728", "0.51911855", "0.518684...
0.71132505
1
Attempt to fuzzy match the target string to an operator name using the given scorer function. The alias for the match with the highest score is returned. If a match with a score above the cutoff is not found, None is returned
def _fuzzy_match( self, target: str, scorer=None, score_cutoff=85, limit=1 ) -> pd.Series: scorer = scorer or self.default_scorer() # result = pd.Series(name = target) extracted: list = process.extractBests( target, self.operator, scorer=scorer, limit=limit, score_cutof...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_fuzzy_match(object, answer, threshold=80):\n answer_phrase = generate_ngrams(answer)\n if answer_phrase:\n best_match = [fuzz.ratio(object, phr) for phr in answer_phrase]\n if np.max(best_match)>threshold:\n return np.max(best_match), answer_phrase[np.argmax(best_match)]\n ...
[ "0.6589819", "0.64425164", "0.58997977", "0.58632153", "0.58299005", "0.56999075", "0.5664272", "0.5549336", "0.5484873", "0.5475975", "0.53234446", "0.53025043", "0.52954453", "0.52909315", "0.5284119", "0.5278062", "0.5250008", "0.5246519", "0.51911473", "0.51895994", "0.51...
0.71131057
0
Get account record for project.
def record_get_for_project(project_id, deleted=False, session=None): session = session or get_session() result = session.query(models.ProjectAccountRecord).\ filter_by(project_id=project_id).\ filter_by(deleted=deleted).\ first() if not result: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_account(self):\n return self._account", "def get_account(self):\n return self._account", "def get_account(self, account):\n \n pass", "def account(self, account_code):\r\n return acc.Account(self, account_code)", "def account(self, account_id: str):\n retur...
[ "0.6873403", "0.6873403", "0.6768942", "0.65608275", "0.6481947", "0.6471267", "0.6470501", "0.64585155", "0.6380671", "0.63713425", "0.63052857", "0.63029593", "0.6294659", "0.61823344", "0.616734", "0.61592054", "0.61530197", "0.6139093", "0.6127555", "0.61225945", "0.60992...
0.7251701
0
Get all item record for project by project id.
def get_all_item_record_for_project(project_id, deleted=False, session=None): session = session or get_session() result = session.query(models.ProjectItemRecord).\ filter_by(project_id=project_id).\ filter_by(deleted=deleted).\ all() if not result...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all_item_record_for_project(project):\r\n db_api = flask.request.db_api\r\n try:\r\n records = db_api.get_all_item_record_for_project(project)\r\n items = db_api.get_all_item()\r\n item_dict = dict([(i.id, i) for i in items])\r\n record_dict = {}\r\n for record in r...
[ "0.813911", "0.7328739", "0.69601107", "0.67463654", "0.6533493", "0.63821095", "0.63788885", "0.634504", "0.63328993", "0.6316908", "0.6295516", "0.62620634", "0.61942583", "0.61678183", "0.6166824", "0.6155322", "0.6145036", "0.6108053", "0.60920167", "0.6046282", "0.602754...
0.79447895
1
Get account record for user.
def record_get_for_user(project_id, user_id, deleted=False): session = get_session() query = session.query(models.UserAccountRecord).\ filter_by(project_id=project_id).\ filter_by(user_id=user_id).\ filter_by(deleted=deleted) return query.all()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _GetAccountFromUser(self):\n name = self._GetAccountNameFromUser()\n number = self._GetAccountNumberFromUser()\n # Validate that the number is a number (assumes no alphabet characters in\n # the account number).\n if re.match(\"^[0-9]*$\", number) is None:\n raise ValueError(\"Account numbe...
[ "0.7582313", "0.73810774", "0.7379446", "0.73619837", "0.728641", "0.720849", "0.7114318", "0.7114318", "0.69070274", "0.6905375", "0.6758387", "0.6721938", "0.6680151", "0.66314286", "0.6567621", "0.65584415", "0.65564144", "0.6526109", "0.65027344", "0.6495356", "0.63669413...
0.66611445
13
Pads inputs w.r.t. data format.
def _padding(inputs, paddings, data_format): if data_format == 'channels_first': padded_inputs = tf.pad( inputs, [[0, 0], [0, 0], paddings, paddings]) else: padded_inputs = tf.pad( inputs, [[0, 0], paddings, paddings, [0, 0]]) return padded_inputs
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pad_dataset(dataset, padding=0):\n max_l = max(len(x) for x in dataset[\"input_ids\"])\n for name in PADDED_INPUTS:\n dataset[name] = [x + [padding if name != \"lm_labels\" else -100] * (max_l - len(x)) for x in dataset[name]]\n return dataset", "def pad(data, *args, **kwargs): # pragma: no ...
[ "0.6714534", "0.65620893", "0.63622624", "0.6301816", "0.6300907", "0.62297213", "0.6203088", "0.61806923", "0.61762965", "0.6154326", "0.61143845", "0.60824525", "0.604327", "0.60138506", "0.5969655", "0.5911536", "0.5877184", "0.5751767", "0.5698976", "0.5692566", "0.564209...
0.62052333
6
Fuses spacetodepth and transpose. Spacetodepth performs the following permutation, which is equivalent to tf.nn.space_to_depth. As spacetodepth has an implicitly transpose, input transpose is fused into spacetodepth transform. images = tf.reshape(images, [batch, h // block_size, block_size, w // block_size, block_size,...
def fused_transpose_and_space_to_depth( images, block_size=2, transpose_input=True): batch_size, h, w, c = images.get_shape().as_list() if block_size != 0: images = tf.reshape(images, [batch_size, h // block_size, block_size, w // block_size, block_size, c]) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_conv2d_transpose(g, op, block):\n\n dilations = op.attr(\"dilations\")\n groups = op.attr(\"groups\")\n paddings = op.attr(\"paddings\")\n padding_algorithm = op.attr(\"padding_algorithm\")\n strides = op.attr(\"strides\")\n output_padding = op.attr(\"output_padding\") if op.attr(\"ou...
[ "0.6252821", "0.6187393", "0.6059542", "0.60442156", "0.60276586", "0.60033554", "0.5998148", "0.59918356", "0.5949912", "0.5934507", "0.5899734", "0.5860573", "0.58351976", "0.5719159", "0.570773", "0.56841886", "0.5680008", "0.56749076", "0.56631535", "0.5646647", "0.563803...
0.7638583
0
Standard building block for residual networks with BN after convolutions.
def residual_block(inputs, filters, is_training, strides, use_projection=False, data_format='channels_first'): shortcut = inputs if use_projection: # Projection shortcut in first layer to match filters and strides shortcut = conv2d_fixed_padding( inputs=inputs, filters=fil...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_resnet(self):\r\n\r\n # INPUTS\r\n inputs_data = Input((self.data_rows, self.data_cols, 1),name='inputs_data')\r\n\r\n\r\n def residual_block(input, output_channels=64, kernel_size=(3, 3), stride=(1, 1)):\r\n x = Conv2D(output_channels, kernel_size, padding='same', strides...
[ "0.6761057", "0.6718992", "0.65846515", "0.65790915", "0.649853", "0.64868796", "0.64450806", "0.64450806", "0.6441736", "0.6411527", "0.64062256", "0.6399525", "0.63963383", "0.63919085", "0.6371196", "0.63613915", "0.62739086", "0.62727815", "0.6233148", "0.623134", "0.6202...
0.0
-1
Bottleneck block variant for residual networks with BN after convolutions.
def bottleneck_block(inputs, filters, is_training, strides, use_projection=False, data_format='channels_first'): shortcut = inputs if use_projection: # Projection shortcut only in first block within a group. Bottleneck blocks # end with 4 times the number of filters. filters_out = 4...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resnet50_base(freeze_blocks=[1,2,3], weight_regularizer=None, bias_regularizer=None):\n img_input = Input(shape=(None, None, 3))\n bn_axis = 3\n train1 = 1 not in freeze_blocks\n x = Conv2D(64, (7, 7), strides=(2, 2), padding='same', name='conv1', trainable=train1,\n kernel_regularizer=weigh...
[ "0.67967707", "0.6790556", "0.67886436", "0.6717657", "0.65665877", "0.6537484", "0.6519858", "0.65195817", "0.6465134", "0.64170057", "0.64149576", "0.63950753", "0.63930964", "0.6377483", "0.6363764", "0.63319874", "0.6259834", "0.6256376", "0.62512606", "0.62451756", "0.62...
0.57658273
78
Changes a specific byte in a byte array
def swap_byte(byte_array, index): if byte_array[index] == 0: changed_byte_array = byte_array[0:index] + b"\xff" + byte_array[index + 1 :] changed_byte_array = byte_array[0:index] + b"\x00" + byte_array[index + 1 :] return changed_byte_array
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_bit(self, index_of_byte, index_of_bit, new_value):\n if index_of_bit >= self.binary_size:\n print(\"You tried to modify a byte at %d index. This cannot be done. The maximum index is %d.\"%(index_of_bit, self.binary_size - 1))\n else:\n new_value = str(new_value)\n ...
[ "0.7607034", "0.7187944", "0.6851375", "0.6837722", "0.6780952", "0.6729589", "0.6723024", "0.6679319", "0.64730704", "0.6376428", "0.6333384", "0.62949824", "0.62935746", "0.6257262", "0.6237112", "0.6162971", "0.6119067", "0.6108211", "0.61019486", "0.609579", "0.5928492", ...
0.7412648
1
Sends a 401 response that enables basic auth
def authenticate(): return Response( 'Could not verify your credentials for that url', 401, {'WWW-Authenticate': 'Basic realm="Login Required"'})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def authenticate():\n return Response('Not Authorized', 401, {'WWW-Authenticate': 'Basic realm=\"api\"'})", "def authenticate():\n return Response(\n '', 401, {'WWW-Authenticate': 'Basic realm=\"Login Required\"'}\n )", "def authenticate():\n return Response(\n 'You have to login with pro...
[ "0.8093736", "0.80926424", "0.7958403", "0.7852648", "0.7824419", "0.7810746", "0.7810746", "0.7810746", "0.7810746", "0.7810746", "0.7810746", "0.7810746", "0.7810746", "0.7810746", "0.7810746", "0.7810746", "0.7810746", "0.7810746", "0.7810746", "0.7810746", "0.7810746", ...
0.7843114
4
Try to add the reporter as a fallback owner or if no alternative owners have been specified. This should work since only employees are allowed to use this request type and all employees are in LDAP.
def handle_empty_owners(): result = shared_ldap.find_from_email(shared.globals.REPORTER) if result is not None: shared_sd.post_comment( "Adding %s as the owner of the group." % shared.globals.REPORTER, True) return [result] # OK - something stupid is happening but let's give our...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_user(self, requestor, requestee, default=None):\n self.lock.acquire()\n self.users.add(requestor)\n ok = requestee in self.users\n self.lock.release()\n\n # if this isn't the default app, also add the user to the default app\n if default != self and default != No...
[ "0.5346557", "0.5095638", "0.50383765", "0.5028467", "0.48953253", "0.48707283", "0.4851011", "0.48406032", "0.48377118", "0.48243517", "0.48027915", "0.4784198", "0.47707832", "0.47077477", "0.46895742", "0.46746963", "0.46505794", "0.46497324", "0.4624019", "0.46179965", "0...
0.63934386
0
Loads a single training dataset.
def load_dataset(path): training_data = [] with open(path) as csv_file: reader = csv.reader(csv_file, delimiter=",") next(reader) for row in reader: training_data.append(row[1]) return training_data
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _load_training_data(self):\n self._save_training_data()", "def load_dataset():\n\n\n train_dd_loader = DailyDialogLoader(PATH_TO_TRAIN_DATA, load=False)\n train_dataloader = DataLoader(train_dd_loader, batch_size=16, shuffle=True, num_workers=0,\n collate_fn=PadCollate...
[ "0.7245358", "0.71401083", "0.7106745", "0.7064546", "0.70641655", "0.6957694", "0.695757", "0.69105434", "0.6814488", "0.68131214", "0.6791823", "0.6780509", "0.67765695", "0.67636853", "0.6733562", "0.67234486", "0.6712425", "0.67052805", "0.6686271", "0.6671118", "0.667068...
0.68193704
8
Saves the parameters into a dictionary that can later be e.g. savez'd. It is different from the Pytorch version in that the prefix of the variables is determined by the variable (/name?) scopes used when the cell was defined.
def save_parameters(self, session, out_dict=None): if out_dict is None: out_dict = {} for w in self.weights: out_dict[w.name.rsplit(':', 1)[0]] = session.run([w])[0] return out_dict
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _variables_to_save(self):\n save_vars = self.weights + self.biases\n save_names = [_.name for _ in save_vars]\n save_dict = {name: var for name, var in zip(save_names, save_vars)}\n return save_dict", "def save_parameters(self):\n paramfile = os.path.join(self._datadir, sel...
[ "0.70121944", "0.6368089", "0.636776", "0.63463885", "0.622241", "0.6198613", "0.61972576", "0.616711", "0.6138725", "0.61033726", "0.6083243", "0.6026282", "0.5963769", "0.5925412", "0.5909473", "0.5871749", "0.5840318", "0.58307344", "0.5823209", "0.5816673", "0.5795027", ...
0.6631182
1
Saves the parameters into a dictionary that can later be e.g. savez'd. It is different from the Pytorch version in that the prefix of the variables is determined by the variable (/name?) scopes used when the cell was defined.
def save_parameters(self, session, out_dict=None): if out_dict is None: out_dict = {} for layer in self.layers: layer.save_parameters(session, out_dict) return out_dict
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _variables_to_save(self):\n save_vars = self.weights + self.biases\n save_names = [_.name for _ in save_vars]\n save_dict = {name: var for name, var in zip(save_names, save_vars)}\n return save_dict", "def save_parameters(self, session, out_dict=None):\n if out_dict is None...
[ "0.70133185", "0.663021", "0.6368316", "0.63673604", "0.634539", "0.62220037", "0.61976147", "0.6197335", "0.6164007", "0.61014414", "0.60837275", "0.60256314", "0.5962757", "0.5926123", "0.5908395", "0.587091", "0.583851", "0.582901", "0.58223844", "0.58159804", "0.57932276"...
0.61386293
9
Get a list containing all elements in the arma_container.
def _get_list_of_elements(arma_container): n_elem = arma_container["n_elem"] mem = arma_container["mem"] elem_type = mem.type.target().unqualified() if 'complex' in elem_type.name: return [_cast_to_complex(mem[i]) for i in range(n_elem)] return [mem[i] for i in range(n_elem)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def all(self):\n return list(self.iterator())", "def get_array(arma_container):\n # In case the user passed the name of the varaible, instead of a gdb.Value,\n # we get the corresponding gdb.Value\n if isinstance(arma_container, str):\n arma_container = gdb.parse_and_eval(arma_container)\n...
[ "0.6568955", "0.65409666", "0.65166247", "0.6506832", "0.6444223", "0.64083475", "0.6289796", "0.62836426", "0.6215201", "0.62119395", "0.62043554", "0.6201367", "0.61920005", "0.61659324", "0.6161435", "0.61315525", "0.6113563", "0.610823", "0.61022896", "0.60991925", "0.607...
0.77745867
0
Return a fully qualified class name string for class ``cls``.
def full_classname(cls: type) -> str: return ClassImporter.full_classname(cls)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def qualified_name(cls):\n return '{}.{}'.format(cls.__module__, cls.__name__)", "def fullname(cls):\n module = cls.__module__\n if module is None or module == str.__class__.__module__:\n return cls.__class__.__name__\n return module + '.' + cls.__class__.__name__", "def class_name(cls):...
[ "0.80164295", "0.7981724", "0.7926273", "0.7926273", "0.7805226", "0.7680299", "0.73659676", "0.73585546", "0.73313534", "0.72725195", "0.72346884", "0.72346884", "0.7160803", "0.71084", "0.7064977", "0.70488745", "0.70252043", "0.70252043", "0.70180553", "0.69375885", "0.691...
0.79708624
2
Return a copy of this configuration factory that functionally works the same.
def clone(self) -> Any: return cp.copy(self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __copy__(self):\n new_config = FuzzingConfig()\n\n new_config.use_examples_for_default = self.use_examples_for_default\n new_config.use_response_for_default = self.use_response_for_default\n new_config.use_embedded = self.use_embedded\n new_config.use_wordbook = self.use_word...
[ "0.7286043", "0.69984365", "0.69428957", "0.6785458", "0.67494476", "0.6692631", "0.66480064", "0.65916646", "0.6536674", "0.6497581", "0.64873344", "0.6476193", "0.6476193", "0.6455589", "0.6430411", "0.64302033", "0.6366175", "0.6362718", "0.6353676", "0.63217604", "0.63009...
0.0
-1
Return a copy of this configuration factory that functionally works the same. However, it does not copy over any resources generated during the life of the factory.
def clone(self) -> Any: clone = super().clone() clone.clear() return clone
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __copy__(self):\n new_config = FuzzingConfig()\n\n new_config.use_examples_for_default = self.use_examples_for_default\n new_config.use_response_for_default = self.use_response_for_default\n new_config.use_embedded = self.use_embedded\n new_config.use_wordbook = self.use_word...
[ "0.6886761", "0.6744836", "0.65485", "0.6495054", "0.6481339", "0.64424306", "0.64332163", "0.643071", "0.6342509", "0.6342509", "0.6323504", "0.6312829", "0.6283929", "0.6275074", "0.62745625", "0.6247065", "0.62115985", "0.6155805", "0.61544675", "0.6102668", "0.6100096", ...
0.0
-1
Creates selenium driver for webscrapping automation Downloads it into driver folder if not installed
def _downloadDriver(self): if not self.driverFolder.exists(): os.mkdir("driver") msgTxt = "User agent: " + self.userAgent + "<br>" self.announcer.announce(self.announcer.format_sse(msgTxt)) for browserVersion in self.userAgent.split(" "): if browserVersion.spli...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup_selenium():\n # Define the options to run with headless mode enabled\n options = Options()\n options.headless = True\n\n # Instatiate the browser object here, pointing at an exectable location which should be located in the same\n # base directory as the script\n driver = webdriver.Fire...
[ "0.6866805", "0.6855302", "0.6822128", "0.6610871", "0.6569253", "0.656648", "0.6483102", "0.64660627", "0.6465365", "0.6460813", "0.63670164", "0.6320266", "0.6313826", "0.6309802", "0.6277847", "0.62708163", "0.62688744", "0.62457854", "0.6199809", "0.61945736", "0.6123801"...
0.7487497
0
Returns the nested nodes in the body of a node.
def get_children(cls, node: ast.AST) -> Iterable[ast.AST]: body: Optional[Sequence[ast.AST]] = getattr(node, 'body', None) if body is not None: for child in body: yield child
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_child_nodes(node):\r\n return list(iter_child_nodes(node))", "def nodes(self):\r\n return (node.content for node in self.traverse())", "def children(node):\n\n return snd(node)", "def getVisitableNodes(self):\n\n value = self.subnode_loop_body\n\n if value is None:\n ...
[ "0.62883824", "0.6253895", "0.60750514", "0.60332704", "0.6013374", "0.58077276", "0.5789496", "0.56801975", "0.5561987", "0.54618096", "0.5426877", "0.5400886", "0.5373536", "0.5360819", "0.53477675", "0.534337", "0.5341113", "0.528977", "0.52756613", "0.52542585", "0.524975...
0.659452
0
Pretty JSON dump of an object.
def pprint(self,obj): return(json.dumps(obj, sort_keys=True, indent=2, separators=(',', ': ')))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def json_dumps(self, obj: object) -> str:\n return json.dumps(obj, sort_keys=self.beautify, indent=4)", "def print_json(obj):\n print(json.dumps(obj, indent=2))", "def pprint(obj):\n return json.dumps(obj, sort_keys=True, indent=2, separators=(',', ': '))", "def pprint(obj):\n return json.dum...
[ "0.79998887", "0.7930918", "0.7916694", "0.7916694", "0.78797597", "0.7752486", "0.7712631", "0.7646695", "0.7569254", "0.75250614", "0.74820435", "0.74561304", "0.741061", "0.7307335", "0.72820616", "0.7219065", "0.72057736", "0.70947427", "0.70880896", "0.7081247", "0.70657...
0.79296386
2
GetOutput(self) > itkMeshD2Q GetOutput(self, unsigned int idx) > itkMeshD2Q
def GetOutput(self, *args): return _itkMeshSourcePython.itkMeshSourceMD2Q_GetOutput(self, *args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetOutput(self, *args) -> \"itkMeshD2 *\":\n return _itkVTKPolyDataReaderPython.itkVTKPolyDataReaderMD2_Superclass_GetOutput(self, *args)", "def GetOutput(self, *args) -> \"itkPointSetD2 *\":\n return _itkMeshSourcePython.itkMeshSourcePSD2_GetOutput(self, *args)", "def GetOutput(self, *args) ...
[ "0.707139", "0.7049461", "0.6873616", "0.6843278", "0.6818263", "0.6817498", "0.6801467", "0.6795621", "0.6783045", "0.6737912", "0.6718591", "0.6700618", "0.669821", "0.66754043", "0.66668105", "0.6639717", "0.6619755", "0.6594609", "0.65867054", "0.6510939", "0.6499863", ...
0.69199556
2
cast(itkLightObject obj) > itkMeshSourceMD2Q
def cast(*args): return _itkMeshSourcePython.itkMeshSourceMD2Q_cast(*args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def itkMeshSourceMD2_cast(obj: 'itkLightObject') -> \"itkMeshSourceMD2 *\":\n return _itkMeshSourcePython.itkMeshSourceMD2_cast(obj)", "def cast(obj: 'itkLightObject') -> \"itkMeshSourceMD2 *\":\n return _itkMeshSourcePython.itkMeshSourceMD2_cast(obj)", "def itkMeshSourceMD3_cast(obj: 'itkLightObject...
[ "0.8582052", "0.8537004", "0.83109564", "0.8264792", "0.8228583", "0.81956387", "0.80514306", "0.7962712", "0.7915732", "0.79055077", "0.7892144", "0.7815524", "0.78107864", "0.77667904", "0.7763599", "0.7682104", "0.763537", "0.76352715", "0.76349384", "0.76339114", "0.76305...
0.74455327
34
New() > itkMeshSourceMD2Q Create a new object of the class itkMeshSourceMD2Q and set the input and the parameters if some named or nonnamed arguments are passed to that method. New() tries to assign all the non named parameters to the input of the new objects the first non named parameter in the first input, etc. The n...
def New(*args, **kargs): obj = itkMeshSourceMD2Q.__New_orig__() import itkTemplate itkTemplate.New(obj, *args, **kargs) return obj
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def New(*args, **kargs):\n obj = itkMeshSourceMD3Q.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **kargs)\n return obj", "def New(*args, **kargs):\n obj = itkMeshSourceMD2.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **karg...
[ "0.7639044", "0.727875", "0.7128952", "0.698582", "0.6949615", "0.6797933", "0.6774174", "0.67558956", "0.6738865", "0.66925174", "0.6649819", "0.66396123", "0.6613809", "0.6544495", "0.6528151", "0.6504718", "0.6462523", "0.6440543", "0.6421221", "0.6412888", "0.63615274", ...
0.80018705
0
itkMeshSourceMD2Q_cast(itkLightObject obj) > itkMeshSourceMD2Q
def itkMeshSourceMD2Q_cast(*args): return _itkMeshSourcePython.itkMeshSourceMD2Q_cast(*args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def itkMeshSourceMD2_cast(obj: 'itkLightObject') -> \"itkMeshSourceMD2 *\":\n return _itkMeshSourcePython.itkMeshSourceMD2_cast(obj)", "def cast(obj: 'itkLightObject') -> \"itkMeshSourceMD2 *\":\n return _itkMeshSourcePython.itkMeshSourceMD2_cast(obj)", "def itkMeshSourceMD3_cast(obj: 'itkLightObject...
[ "0.86521226", "0.8496428", "0.8229923", "0.81796956", "0.8117432", "0.8107494", "0.7942349", "0.79344153", "0.77690357", "0.7740543", "0.7737454", "0.7703959", "0.7676164", "0.76738644", "0.76635903", "0.7634641", "0.76233923", "0.7613119", "0.75789106", "0.7488574", "0.74645...
0.8176313
4
GetOutput(self) > itkMeshD3Q GetOutput(self, unsigned int idx) > itkMeshD3Q
def GetOutput(self, *args): return _itkMeshSourcePython.itkMeshSourceMD3Q_GetOutput(self, *args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetOutput(self, *args) -> \"itkMeshD3 *\":\n return _itkVTKPolyDataReaderPython.itkVTKPolyDataReaderMD3_Superclass_GetOutput(self, *args)", "def GetOutput(self, *args) -> \"itkPointSetD3 *\":\n return _itkMeshSourcePython.itkMeshSourcePSD3_GetOutput(self, *args)", "def GetOutput(self, *args) ...
[ "0.7287188", "0.7221649", "0.71742666", "0.71100026", "0.7073772", "0.7030481", "0.70147634", "0.6998503", "0.69892234", "0.6967587", "0.693919", "0.6935009", "0.69286907", "0.69260216", "0.68590224", "0.6832003", "0.6768338", "0.67619294", "0.67344165", "0.6715194", "0.67117...
0.7188139
2
cast(itkLightObject obj) > itkMeshSourceMD3Q
def cast(*args): return _itkMeshSourcePython.itkMeshSourceMD3Q_cast(*args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def itkMeshSourceMD3_cast(obj: 'itkLightObject') -> \"itkMeshSourceMD3 *\":\n return _itkMeshSourcePython.itkMeshSourceMD3_cast(obj)", "def cast(obj: 'itkLightObject') -> \"itkMeshSourceMD3 *\":\n return _itkMeshSourcePython.itkMeshSourceMD3_cast(obj)", "def itkMeshSourceMF3_cast(obj: 'itkLightObject...
[ "0.8897926", "0.87653625", "0.85445416", "0.84689623", "0.8408301", "0.83891255", "0.83023906", "0.82078826", "0.81228536", "0.8096932", "0.8038447", "0.8036079", "0.80280703", "0.8027851", "0.8007173", "0.8004767", "0.7995328", "0.79838175", "0.796514", "0.7950437", "0.79498...
0.7580068
30
New() > itkMeshSourceMD3Q Create a new object of the class itkMeshSourceMD3Q and set the input and the parameters if some named or nonnamed arguments are passed to that method. New() tries to assign all the non named parameters to the input of the new objects the first non named parameter in the first input, etc. The n...
def New(*args, **kargs): obj = itkMeshSourceMD3Q.__New_orig__() import itkTemplate itkTemplate.New(obj, *args, **kargs) return obj
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def New(*args, **kargs):\n obj = itkMeshSourceMD3.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **kargs)\n return obj", "def New(*args, **kargs):\n obj = itkMeshSourceMD2Q.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **karg...
[ "0.76424545", "0.75177705", "0.72723085", "0.72642565", "0.70665973", "0.70411664", "0.6989817", "0.69875216", "0.69681907", "0.6827896", "0.6809468", "0.6800386", "0.676918", "0.6702616", "0.6649606", "0.6634698", "0.6605022", "0.6587581", "0.65751237", "0.6470867", "0.64678...
0.821262
0
itkMeshSourceMD3Q_cast(itkLightObject obj) > itkMeshSourceMD3Q
def itkMeshSourceMD3Q_cast(*args): return _itkMeshSourcePython.itkMeshSourceMD3Q_cast(*args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def itkMeshSourceMD3_cast(obj: 'itkLightObject') -> \"itkMeshSourceMD3 *\":\n return _itkMeshSourcePython.itkMeshSourceMD3_cast(obj)", "def cast(obj: 'itkLightObject') -> \"itkMeshSourceMD3 *\":\n return _itkMeshSourcePython.itkMeshSourceMD3_cast(obj)", "def itkMeshSourceMF3_cast(obj: 'itkLightObject...
[ "0.8978029", "0.8786041", "0.8519509", "0.83915526", "0.8382306", "0.8357595", "0.8251058", "0.82282436", "0.8043792", "0.8010526", "0.7997927", "0.7983657", "0.79835016", "0.7977872", "0.793134", "0.7918131", "0.7876938", "0.7820073", "0.7818601", "0.7747988", "0.7739797", ...
0.8198177
8
Return a list of nodes forming the path from the root to this node.
def path(self): node, path_back = self, [] while node: path_back.append(node) node = node.parent return list(reversed(path_back))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def path(self):\n node, return_path = self, []\n while node:\n # Add the nodes in reverse order to a list until you reach the\n # root parent node which will terminate the loop\n return_path.append(node)\n node = node.parent\n # Reverse the list to g...
[ "0.7984329", "0.77074516", "0.7606885", "0.7442534", "0.7393407", "0.73567694", "0.73452824", "0.7337256", "0.7315247", "0.7297849", "0.7290767", "0.7246857", "0.72439355", "0.7197385", "0.7157757", "0.715197", "0.71127594", "0.710878", "0.7068614", "0.7051616", "0.70308995",...
0.7581861
4
Get a pb instance from the config.
def get_pb(cls): if cls.pb_singleton is None: # Init the config by reading conf file. with open(gflags.FLAGS.conf, 'r') as conf_file: cls.pb_singleton = text_format.Merge(conf_file.read(), config_pb2.Config()) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_instance(cls):\n\n if not cls._instance:\n cls._instance = Config()\n\n return cls._instance", "def get_config(cls) -> \"__Config\":\n if cls.__instance is None:\n cls.__instance = cls.__Config()\n return cls.__instance", "def get_config() -> Optional[C...
[ "0.61414784", "0.6062606", "0.57294023", "0.57033986", "0.57033986", "0.5687849", "0.5682233", "0.55206746", "0.55115753", "0.5506902", "0.5470777", "0.5435427", "0.5435427", "0.54308707", "0.5418612", "0.54126674", "0.5409956", "0.53776026", "0.53776026", "0.5318656", "0.529...
0.7611659
0
Get realpath from a path string in config. Starting with '/' indicates an absolute path, otherwise it will be taken as a relative path of the Apollo root.
def get_realpath(cls, path_str): if path_str.startswith('/'): return path_str return os.path.abspath(os.path.join(cls.apollo_root, path_str))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def realpath(path: str) -> str:\n pass", "def realpath(path):\n\n if path.startswith('//'):\n path = bpy.path.abspath(path)\n else:\n path = os.path.realpath(path)\n\n path = path.replace('\\\\', '/')\n path = os.path.realpath(path)\n\n return path", "def realpath(self, path):\n ...
[ "0.77301323", "0.75936407", "0.74692786", "0.72557855", "0.72251844", "0.70825744", "0.70761037", "0.70343393", "0.6972751", "0.68626493", "0.6804119", "0.6591446", "0.65749484", "0.6556271", "0.65054965", "0.64656866", "0.6438085", "0.63194704", "0.63104266", "0.6278452", "0...
0.8214451
0
Return the name of the process.
def get_name(self): return self._name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_process_name(self):\n\n return self._args.t", "def get_process_name(pid):\n proc = subprocess.Popen(['ps', '-p', pid, '-o', 'comm='],\n stdout=subprocess.PIPE,\n stderr=subprocess.PIPE)\n out, err=proc.communicate()\n return out.strip(...
[ "0.85471857", "0.79289544", "0.787106", "0.7468466", "0.74120295", "0.7236602", "0.7233819", "0.7141989", "0.70894533", "0.6992078", "0.6813217", "0.6813217", "0.6813217", "0.6813217", "0.6813217", "0.6813217", "0.6813217", "0.6813217", "0.6813217", "0.6813217", "0.6813217", ...
0.0
-1
Return a list of rentals performed by the provided client for the provided car client The client performing the rental. None means all clients cars The rented car. None means all cars
def filterRentals(self, client, car): result = [] for rental in self.__repository.getAll(): if client != None and rental.client != client: continue if car != None and rental.car != car: continue result.append(rental) return resu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clients_sorted_by_rentals(self):\n rentals = self.get_list()\n number_of_rented_movies = dict.fromkeys([rental.client for rental in rentals], 0)\n for rental in rentals:\n number_of_rented_movies[rental.client] += 1\n items = sorted(number_of_rented_movies.items(), key = ...
[ "0.60510564", "0.57855946", "0.57267207", "0.5495068", "0.5456945", "0.5285654", "0.52423316", "0.52244574", "0.5095199", "0.5042458", "0.5001045", "0.48717806", "0.48693237", "0.48531705", "0.4853079", "0.4828688", "0.48279813", "0.48155066", "0.47878057", "0.47713622", "0.4...
0.7709649
0
Return the input number if its odd, or return input number + 1 if its even or zero.
def make_odd(number): if number == 0: number += 1 if number % 2 == 0: number += -1 return number
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __odd_or_even(number):\n if(number % 2) == 0:\n return 0\n else:\n return 1", "def make_number_odd(num):\n if num % 2 == 0:\n num += 1\n return num", "def even_numbers(number):\r\n\r\n if number%2 ==0:\r\n return number", "def even_odd(number):\r\n if number ...
[ "0.8168115", "0.7859249", "0.719919", "0.718165", "0.71592253", "0.7086521", "0.7042811", "0.7012443", "0.687709", "0.68506926", "0.68103355", "0.67186725", "0.66446716", "0.6642592", "0.66274685", "0.6626728", "0.6619069", "0.66058695", "0.6584184", "0.6577917", "0.65761554"...
0.7791604
2
The ID or Amazon Resource Name (ARN) of the target group.
def target_group_identifier(self) -> pulumi.Input[str]: return pulumi.get(self, "target_group_identifier")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def target_group_identifier(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"target_group_identifier\")", "def get_target_group_arn(self, short_name):\n target_group_info = self.get_target_group_info(short_name)\n return target_group_info['TargetGroupArn']", "def target_group(self)...
[ "0.8059303", "0.77209467", "0.76946956", "0.76142114", "0.7459761", "0.7424217", "0.7291563", "0.7291563", "0.7070664", "0.7054723", "0.7054723", "0.7054723", "0.7054723", "0.7054723", "0.7054723", "0.700518", "0.700518", "0.6932303", "0.6895912", "0.68954605", "0.689537", ...
0.77805084
1
The ID or Amazon Resource Name (ARN) of the target group.
def target_group_identifier(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "target_group_identifier")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def target_group_identifier(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"target_group_identifier\")", "def target_group_identifier(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"target_group_identifier\")", "def get_target_group_arn(self, short_name):\n target_group_in...
[ "0.8060474", "0.7782377", "0.77201146", "0.7695647", "0.74612945", "0.74235034", "0.72911525", "0.72911525", "0.7071454", "0.7055554", "0.7055554", "0.7055554", "0.7055554", "0.7055554", "0.7055554", "0.70069563", "0.70069563", "0.6934187", "0.6897746", "0.6897058", "0.689599...
0.76161706
4
The ID or Amazon Resource Name (ARN) of the target group.
def target_group_identifier(self) -> pulumi.Output[str]: return pulumi.get(self, "target_group_identifier")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def target_group_identifier(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"target_group_identifier\")", "def get_target_group_arn(self, short_name):\n target_group_info = self.get_target_group_info(short_name)\n return target_group_info['TargetGroupArn']", "def target_group(self) ...
[ "0.7782377", "0.77201146", "0.7695647", "0.76161706", "0.74612945", "0.74235034", "0.72911525", "0.72911525", "0.7071454", "0.7055554", "0.7055554", "0.7055554", "0.7055554", "0.7055554", "0.7055554", "0.70069563", "0.70069563", "0.6934187", "0.6897746", "0.6897058", "0.68959...
0.8060474
0
Resolve all paths to a list of files.
def _resolve_paths(paths): allowed_ext = tuple(MIMES.keys()) resolved = [] for path in paths: if os.path.isdir(path): resolved.extend( entry.path for entry in os.scandir(path) if entry.is_file() and entry.name.lower().endswith(allowed_ext) ) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resolve_specs(paths):\n specs = []\n for path in paths:\n if os.path.isdir(path):\n _, _, files = os.walk(path).next()\n specs.extend(os.path.join(path, fname) for fname in files)\n else:\n specs.append(path)\n return specs", "def handle_files_args(*pat...
[ "0.70843834", "0.7008949", "0.7005918", "0.6991757", "0.6980533", "0.6943847", "0.6908536", "0.6815965", "0.6810721", "0.67709655", "0.66659486", "0.66539854", "0.6626398", "0.6625859", "0.660965", "0.65911394", "0.6577185", "0.6509825", "0.6505772", "0.64861", "0.64778113", ...
0.7782248
0
Make sure email not in use.
def validate_email(form, field): if User.query.filter_by(email=form.email.data).first(): form.email.errors.append( "Email already associated with account!") raise ValidationError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_invalid_email_when_logging_in(self):\n pass", "def clean_email(self):\r\n if User.objects.filter(email__iexact=self.cleaned_data['email']):\r\n raise forms.ValidationError(_(u'This email address is already in use. Please supply a different email address.'))\r\n return sel...
[ "0.7547832", "0.69692755", "0.68943226", "0.68845636", "0.68845636", "0.6878333", "0.6797547", "0.6777223", "0.67052704", "0.66979927", "0.6694335", "0.66453594", "0.66256976", "0.66151065", "0.6599791", "0.6570279", "0.65497637", "0.65465266", "0.6540458", "0.65211236", "0.6...
0.0
-1
Make sure email is not in use unless it's the current user's email.
def validate_email(form, field): user = User.query.filter_by(email=form.email.data).first() if user and not user == g.user: form.email.errors = [ "Email already associated with account!", *form.email.errors ] raise ValidationError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clean_email(self):\r\n if User.objects.filter(email__iexact=self.cleaned_data['email']):\r\n raise forms.ValidationError(_(u'This email address is already in use. Please supply a different email address.'))\r\n return self.cleaned_data['email']", "def clean_email(self):\n if U...
[ "0.7446851", "0.739905", "0.739905", "0.7380747", "0.73281556", "0.72398597", "0.72120744", "0.72011906", "0.7174148", "0.71672803", "0.7081384", "0.70392203", "0.7017105", "0.6994809", "0.69502664", "0.6879769", "0.6850791", "0.67699957", "0.67592144", "0.6754703", "0.668111...
0.66117746
24
Mocks the requests.get method in app.py with a given pun
def test_parse_message_pun(self): for test_case in self.success_test_pun: expected = test_case[KEY_EXPECTED] with mock.patch("requests.get", mocked_pun): bring_message = app.on_new_address(test_case) self.assertEqual(expected, bring_message)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get(self):\n client = RestClient(host=self.host, username='')\n rest_url = 'some/url/'\n \n # Mock good response\n with responses.RequestsMock() as rsps:\n rsps.add(responses.GET, f'{self.host}/{rest_url}', status=200,\n json={'value':\"goo...
[ "0.69669604", "0.67627823", "0.6592265", "0.65826535", "0.6497083", "0.64620715", "0.6438313", "0.6414112", "0.6376383", "0.636982", "0.63449466", "0.63231426", "0.63054174", "0.6286555", "0.61875427", "0.6182093", "0.6159612", "0.61394614", "0.60945237", "0.609397", "0.60508...
0.0
-1
Mocks the requests.get method in app.py
def test_parse_message_failure_translation(self): for test_case in self.failure_test_params: expected = test_case[KEY_EXPECTED] with mock.patch("requests.get", mocked_translate): bring_message = app.on_new_address(test_case) self.assertNotEqual(expected, bring_me...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get(self):\n client = RestClient(host=self.host, username='')\n rest_url = 'some/url/'\n \n # Mock good response\n with responses.RequestsMock() as rsps:\n rsps.add(responses.GET, f'{self.host}/{rest_url}', status=200,\n json={'value':\"goo...
[ "0.757244", "0.7426668", "0.7414589", "0.72550845", "0.7225032", "0.7213081", "0.70949316", "0.704562", "0.7016927", "0.6952909", "0.6937874", "0.6872953", "0.68185633", "0.6812734", "0.6795233", "0.6713535", "0.67129856", "0.671215", "0.6706005", "0.6678081", "0.66740376", ...
0.0
-1
Tests if Rectangle inherits Base.
def test_inheritance(self): self.assertTrue(issubclass(Rectangle, Base))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_0_is_Rectangle_class(self):\r\n self.assertTrue(issubclass(type(self.S0), Rectangle) and\r\n type(self.S0) != Rectangle)", "def test_SquareinheritancefromRectangle(self):\n Square.reset_objects()\n self.assertEqual(issubclass(Square, Rectangle), True)", "def...
[ "0.7410984", "0.73879737", "0.71916723", "0.6733655", "0.64805657", "0.6343817", "0.61637074", "0.6104673", "0.59940827", "0.590253", "0.58446425", "0.5831769", "0.57768166", "0.5750307", "0.5746952", "0.574595", "0.57251126", "0.571214", "0.5711103", "0.56737524", "0.5669128...
0.86079776
0
Adds a word (and its metadata) related to a measurement to the list of all related words for that measurement
def _add_related(related, dep, all_related, index, connector=None): doc = {} doc["relationForm"] = dep doc["rawName"] = related doc["tokenIndex"] = int(index) doc["offsetStart"] = A.lookup[int(index)]["start"] doc["offsetEnd"] = A.lookup[int(index)]["end"] doc["connector"] = "" if connector ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add(self, word: str) -> None:\n self.words.add(word)\n self.added_words.add(word)", "def add_words(self, words):\r\n for word in words:\r\n self.add(word)", "def add(self, word: str) -> None:\n self.d.add(word)", "def add_words(self, words, value):\n if words...
[ "0.6651249", "0.6582952", "0.64778966", "0.63896775", "0.62895304", "0.62871456", "0.62849236", "0.6282664", "0.62679726", "0.6182581", "0.6168457", "0.61679065", "0.61659604", "0.6078923", "0.60761344", "0.6069568", "0.60609025", "0.6058869", "0.6050961", "0.6043219", "0.603...
0.56861186
57
For related words found for a measurement (usually nouns), add any connected adjectives, compounds, or modifiers.
def _add_descriptors(related): for r in related: r["descriptors"] = [] for edge in G.edges(data=True): sibling_idx = _get_connected(edge, r["tokenIndex"]) if sibling_idx and (A.lookup[int(sibling_idx)]["pos"] == "JJ" or edge[2]["dep"] in ["amod", "compound"]): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_related(stats, match, patterns_file):\n all_related = None\n measurement_formats = [\"space_between\", \"attached\", \"hyphenated\"]\n\n all_related = _parse_patterns(match[\"unit_idx\"], match[\"measurement_format\"], patterns_file)\n if all_related == None:\n all_related = _parse_patt...
[ "0.59282726", "0.5896106", "0.57640356", "0.5736976", "0.55327153", "0.5507227", "0.5498549", "0.54563355", "0.5434374", "0.5351359", "0.5312978", "0.52993435", "0.5271659", "0.5256711", "0.5176169", "0.51729816", "0.51703644", "0.51655173", "0.51633793", "0.516039", "0.51557...
0.5840201
2
Compute the heuristic for a given state in the current problem.
def compute_heuristic(self, state): if self._shape_reward_mode == "optimal": problem = self.problems[self._problem_idx] # Add action literals to state to enable planning state_lits = set(state.literals) action_lits = set( self.action_space.all_gro...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def myHeuristic(state, problem=None):\n #print(\"myHeuristic\")\n #print(problem.isGoalState((1,1)))\n xy2 = problem.goal\n return abs(state[0] - xy2[0]) + abs(state[1] - xy2[1])", "def heuristic(state, problem):\n # It would take a while for Flat Earther's to get accustomed to this paradigm\n ...
[ "0.77781177", "0.76758313", "0.74438214", "0.7409058", "0.7408299", "0.7377791", "0.7353731", "0.7306439", "0.71683395", "0.7154942", "0.70938486", "0.6993468", "0.6966539", "0.6902104", "0.679804", "0.6768399", "0.6738102", "0.67237085", "0.67138356", "0.67086256", "0.669070...
0.77858466
0
Tests model object creation with Author model. Inserting data into the model and retrieving it.
def test_insert_and_fetch_value(self): author_kent = Author( first_name="Arthur", last_name="Kent", rating=Decimal("4.1"), ) author_kent.save() qs1 = Author.objects.all().values("first_name", "last_name") self.assertEqual(qs1[0]["first_name"], ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sample_author(first_name='testfirstname', last_name='testlastname'):\n return Author.objects.create(first_name=first_name, last_name=last_name)", "def test_create_authors(self):\n payload = {\n 'first_name': 'testname1',\n 'last_name': 'testname2',\n 'nickname': 'te...
[ "0.73595816", "0.73528016", "0.6917232", "0.68811285", "0.6825536", "0.66415656", "0.6564151", "0.65254474", "0.64944285", "0.64746404", "0.64741796", "0.64724386", "0.64366996", "0.6363541", "0.63500893", "0.63140833", "0.6293489", "0.62684065", "0.6254518", "0.6235322", "0....
0.66609263
5
Return current date and time as a string.
def get_date_time(): date_time = datetime.now() date_time_string = date_time.strftime("%b-%d-%Y (%H:%M:%S)") return date_time_string
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_current_datetime_string ( ) :\n return get_current_datetime( ).strftime( \"%Y%m%d-%H%M%S\" )", "def time_now() -> str:\n return datetime_to_str(datetime_now())", "def get_now():\r\n now = dt.datetime.now()\r\n now_str = now.strftime(\"%d/%m %H:%M\")\r\n return now_str", "def get_current...
[ "0.86410594", "0.83569145", "0.82452714", "0.81948674", "0.81886935", "0.8177085", "0.8142239", "0.8139969", "0.80767894", "0.8070444", "0.8038072", "0.791959", "0.7906521", "0.7894949", "0.78761137", "0.7829549", "0.78283703", "0.78224957", "0.78067684", "0.77908033", "0.778...
0.7783489
21
Check if a link has an invalid scheme. Also transform the ``&`` character in ``&`` character.
def escape_link(self, link, smart_amp=True): data = link.split(':', 1) scheme = data[0] if scheme in self.scheme_blacklist: return '' if smart_amp: return link.replace('&', '&amp;') return link
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_link(self, link):\n false_links = [\"wikipedia:\", \"w:\", \"wikitionary:\", \"wikt:\", \"wikinews:\",\n \"n:\", \"wikibooks:\", \"b:\", \"wikiquote:\", \"q:\", \"wikisource:\",\n \"s:\", \"wikispecies:\", \"species:\", \"wikiversity\", \"v:\", \n ...
[ "0.65676564", "0.65118766", "0.6282904", "0.62509656", "0.61940354", "0.61904234", "0.61856216", "0.615911", "0.61529464", "0.6069519", "0.6041988", "0.60321385", "0.59708303", "0.5959572", "0.5953686", "0.5906121", "0.58944297", "0.585033", "0.58366746", "0.5836454", "0.5818...
0.64214295
2
Verify that we raise an appropriate exception if the operation is invoked with an unknown vm name.
def test_answer_unknownVm(self): self.failUnlessRaises(pyVmomi.vim.fault.NotFound, Answer().DoIt, self.host, 'unknownVm')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def operation_not_found(self, name):\n raise OperationError(\"Operation '%s' not found\" % name)", "def test_vmfactory_fail(self):\n self.command.output = \"foo.vmx\"\n with self.assertRaises(VMInitError):\n self.command.package = self.input_ovf", "def test_will_not_get_instance...
[ "0.653822", "0.6389487", "0.608852", "0.6059318", "0.60320866", "0.5987542", "0.59446174", "0.5939153", "0.59103185", "0.5847701", "0.5841957", "0.58180857", "0.58157957", "0.5758776", "0.5726958", "0.57252586", "0.5693958", "0.56661975", "0.5659771", "0.56591505", "0.5638999...
0.7320924
0
Yield successive nsized chunks from lst.
def chunks(lst, n): for i in range(0, len(lst), n): yield lst[i:i + n]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def chunks(self, lst, n):\n for i in range(0, len(lst), n):\n yield lst[i:i + n]", "def chunks(lst: list, n: int):\n for i in range(0, len(lst), n):\n yield lst[i : i + n]", "def chunks(lst, n):\n for i in range(0, len(lst), n):\n yield lst[i:i + n]", "de...
[ "0.83071756", "0.81939614", "0.81910837", "0.81910837", "0.8190213", "0.81267184", "0.81218547", "0.81218547", "0.80773693", "0.80526286", "0.80526286", "0.80526286", "0.80526286", "0.80526286", "0.80042696", "0.7871678", "0.7845623", "0.7828392", "0.7827006", "0.78138447", "...
0.80533457
19
Returns a stream consisting of the results of applying the given function to the items of this stream.
def map(self, mapper): def _map(iterator): return mapper(next(iterator)) return self.__class__(self, _map)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bind(self, f):\n return as_stream_iterator(y for x in self for y in f(x))", "def filter(self, function):\n return FunctionalWrapper(filter(function, self.data))", "def map(self, function):\n return FunctionalWrapper(map(function, self.data))", "def reduce(self, function):\n re...
[ "0.68622994", "0.6546545", "0.65409714", "0.6433659", "0.6394086", "0.6208269", "0.61741555", "0.616061", "0.60999846", "0.60531145", "0.60272384", "0.59801644", "0.5966168", "0.5962581", "0.58892", "0.588588", "0.58688843", "0.584554", "0.5843813", "0.5799488", "0.578355", ...
0.0
-1
Returns a stream consisting of the distinct items of this stream.
def distinct(self): memory = set() def _distinct(iterator): while True: item = next(iterator) if item in memory: continue memory.add(item) return item return self.__class__(self, _distinct)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def distinct(self):\n return DistinctQuery(self)", "def distinct(self):\n qs = copy(self)\n qs._distinct = True\n return qs", "def unique(self):\n return self.element_wise(lambda seqs: list(set(seqs)))", "def distinct(self):\n self.distinct_ = True\n\n return ...
[ "0.6983475", "0.6915483", "0.6780482", "0.64765984", "0.63660026", "0.6359798", "0.6213019", "0.5897391", "0.5876457", "0.58733404", "0.58576953", "0.5810534", "0.57947123", "0.5721542", "0.57094973", "0.56463784", "0.56267685", "0.5607414", "0.5602389", "0.5584928", "0.55782...
0.76015234
0
Returns a stream consisting of items of this stream, truncated to be no longer than max_size in length.
def limit(self, max_size): return self.__class__(itertools.islice(self, max_size))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _truncate(self):\n dif = len(self) - self._maxLen\n if dif > 0:\n #return\n self[:dif] = []", "def _limit_helper(stream: Union[BinaryIO, Generator, List], limit: int) -> Generator:\n for value in stream:\n yield value\n if limit == 1:\n return\n...
[ "0.61745995", "0.58200085", "0.57398564", "0.5702165", "0.5623146", "0.56076515", "0.55688864", "0.55473465", "0.55255014", "0.5505975", "0.5426797", "0.54205805", "0.54120886", "0.5398848", "0.5391275", "0.53815204", "0.53634936", "0.53267366", "0.53238416", "0.5316794", "0....
0.7333502
0
Returns a stream consisting of remaining items of this stream after discarding first n items.
def skip(self, n): return self.__class__(itertools.islice(self, n, None))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def drop(iterable, n, islice=islice):\n return islice(iterable, n, None)", "def drop(n, seq):\n return itertools.islice(seq, n, None)", "def take(self, n): # noqa: N805\n return List(_islice(self, n))", "def drop(iterable, n):\n counter = 0\n for element in iterable:\n if counter <...
[ "0.75482744", "0.7436712", "0.70949703", "0.6980845", "0.69610167", "0.68319", "0.6816474", "0.6816474", "0.6804587", "0.6804587", "0.66202843", "0.651614", "0.64598036", "0.64442784", "0.64442784", "0.6440829", "0.6393749", "0.63775164", "0.6363687", "0.6357983", "0.6342082"...
0.71049416
2
Returns True if no items of this stream match the given predicate, otherwise False.
def none(self, predicate): return not self.any(predicate)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def any(self, predicate):\n return any(predicate(item) for item in self)", "def all(self, predicate):\n return all(predicate(item) for item in self)", "def no(seq, pred=None):\n for elem in ifilter(pred, seq):\n return False\n return True", "def all(seq, pred=None):\n for elem i...
[ "0.66968435", "0.6578743", "0.6485255", "0.6245035", "0.62410504", "0.61962926", "0.6189238", "0.6089569", "0.6053107", "0.6053107", "0.5953874", "0.58961457", "0.58409333", "0.583326", "0.5788164", "0.5788164", "0.5745407", "0.5716643", "0.570402", "0.567105", "0.5656919", ...
0.7476168
0
Returns the smallest item of this stream.
def min(self, key=lambda _: _): return min(self, key=key)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def take_min(self):\n return self.get_first()", "def min(self):\n return self.get_first()", "def _find_min(self):\n if self.is_empty(): # is_empty inherited from base class\n raise Empty('Priority queue is empty')\n small = self._data.first()\n walk = self._data.after(small)\n wh...
[ "0.8079357", "0.7964827", "0.786516", "0.78332955", "0.76497614", "0.75355464", "0.75355464", "0.7523685", "0.74445915", "0.73460555", "0.7334136", "0.7317787", "0.7317787", "0.7303266", "0.7297569", "0.72822535", "0.7268715", "0.7267241", "0.72492516", "0.72000057", "0.71911...
0.7408102
9
Returns the largest item of this stream.
def max(self, key=lambda _: _): return max(self, key=key)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def max(self):\n return self.get_first()", "def find_max(self):\r\n maxVal = self.items[1]\r\n if maxVal is None:\r\n return None\r\n \r\n for i in range(1,len(self.items)):\r\n if self.items[i] is not None:\r\n if self.items[i] > maxVal:\r\...
[ "0.7670412", "0.7572868", "0.7463609", "0.7441727", "0.7412763", "0.7282507", "0.7238279", "0.7205189", "0.7166872", "0.7162609", "0.7157219", "0.7157219", "0.71475804", "0.7141774", "0.71350074", "0.7082565", "0.708053", "0.70803034", "0.702977", "0.6994883", "0.6988381", ...
0.711443
15
Returns the number of items of this stream.
def count(self): return sum(1 for _ in self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def items_count(self):\n return len(self.items)", "def get_num_items(self):\r\n return self.num_items", "def items_num(self):\n return len(self.items)", "def count(self):\n return len(self.read_ints())", "def items_num(self):\n\t\treturn len(self.items)", "def items_num(self):...
[ "0.8301211", "0.81344986", "0.80515355", "0.79899615", "0.79588777", "0.79588777", "0.79573154", "0.7908144", "0.78880036", "0.78873676", "0.7877877", "0.78292423", "0.7749551", "0.77141726", "0.7712948", "0.7682725", "0.7682725", "0.7682725", "0.7651507", "0.7649355", "0.764...
0.70951164
92
Toggle user admin status endpoint To toggle, access token and admin permissions are required
def post(self, user_id): user = User.query.get(user_id) if user is None: return abort(422, message="User does not exist") """ check if user's the only admin if it's an admin """ admins = User.query.filter_by(admin=True).all() if user.admin and len(ad...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def admin_required(handler):\n def admin_login(self, *args, **kwargs):\n auth = self.auth\n if not auth.get_user_by_session():\n self.redirect('/auth/login', abort=True)\n \n user = auth.get_user_by_session()\n queried_entity = User.get_by_id(user['user_id'])\n ...
[ "0.6454747", "0.63205993", "0.62615484", "0.62442005", "0.62236315", "0.6223049", "0.6207268", "0.6181463", "0.6181463", "0.61800843", "0.61779815", "0.6082381", "0.6079935", "0.60787714", "0.60214365", "0.602113", "0.60124683", "0.6005901", "0.5990312", "0.5989222", "0.59612...
0.0
-1
Get the current security object of the database. (mixed)
def getSecurity(self): return self.client.get(self.name +"/_security").getBodyData()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_security(self):\n return self.cloudant_database.get_security_document()", "def security(self):\n return self._security", "def security_class(self):\n return self._security_class", "def get_security(self, security_id: str) -> Security:\n return self.session.get_security(sel...
[ "0.7439619", "0.71845263", "0.70937705", "0.6900253", "0.61629117", "0.60930294", "0.6086127", "0.6086127", "0.6058834", "0.6051057", "0.6030994", "0.59401894", "0.59401894", "0.59401894", "0.5932471", "0.5864239", "0.5863935", "0.5863935", "0.5863935", "0.5863935", "0.586393...
0.63126576
4
Set the current "revs_limit" (revision limit) setting. (int) limit (mixed)
def setRevisionLimit(self, limit): return self.client.put(self.name +"/_revs_limit", None, limit).getBodyData()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_limit(self, limit):\n self.limit = limit\n self._prune()", "def getRevisionLimit(self):\n return self.client.get(self.name +\"/_revs_limit\").getBodyData()", "def SetLimit(self, *args):\n return _BRepAlgo.BRepAlgo_NormalProjection_SetLimit(self, *args)", "def limit(self, lim...
[ "0.6917625", "0.6857605", "0.66053945", "0.6602822", "0.6602822", "0.6602822", "0.6594543", "0.6535649", "0.65266085", "0.64890593", "0.6478399", "0.63712174", "0.6257707", "0.60748005", "0.6017279", "0.6012214", "0.5952001", "0.5936896", "0.59314567", "0.59136355", "0.590478...
0.87726605
0
Update Stack's currency with a given value.
def updateCurrency(self, currency: str, value: str) -> None: if currency == "USDT": self._USDT = float(value) elif currency == "ETH": self._ETH = float(value) elif currency == "BTC": self._BTC = float(value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def change_price(self, value): \n value = self.price", "def format_currency(value, currency=\"USD\"):\n symbol = CURRENCIES[currency][\"symbol\"]\n\n return \"%s%s\" % (symbol, round(value) / 100)", "async def set_currency(self, currency: str):\n json = {**self.get_data(), \"currencyId\": c...
[ "0.60010123", "0.5893632", "0.57380164", "0.57254374", "0.57075036", "0.56984043", "0.56984043", "0.56984043", "0.56984043", "0.56679785", "0.56300604", "0.54938513", "0.5454203", "0.5446152", "0.543147", "0.5414669", "0.5411957", "0.5407819", "0.5390974", "0.53639185", "0.53...
0.7322223
0
Returns a value in project settings file
def get_local(self, key, default=None, as_tuple=False): if as_tuple: return (self.get_local(key, default, as_tuple=False), False) else: project_data = sublime.active_window().project_data() if (project_data and "javatar" in project_data and key in ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def settings():\n return _get_settings()[1]", "def get_project_value(key, default_value=None):\r\n # Load project coniguration settings\r\n try:\r\n load_project_values()\r\n except RuntimeError:\r\n sublime.set_timeout(lambda: load_project_values(), 0)\r\n\r\n # Find value in project ...
[ "0.7651562", "0.73200214", "0.7067771", "0.69836646", "0.68459237", "0.67755395", "0.66721684", "0.6671477", "0.65649176", "0.6564709", "0.6528995", "0.6528318", "0.6519946", "0.6495842", "0.6494672", "0.6466321", "0.6431724", "0.6427801", "0.63764167", "0.63681996", "0.63494...
0.0
-1
Returns the output tensor at the given index.
def get_output_tensor(index): output_details = interpreter.get_output_details()[index] tensor = np.squeeze(interpreter.get_tensor(output_details['index'])) return tensor
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_output_tensor(self, index):\n output_details = self.model.get_output_details()[index]\n tensor = np.squeeze(self.model.get_tensor(output_details['index']))\n return tensor", "def get_output_tensor(self, index):\n output_details = self.interpreter.get_output_details()[index]\n ...
[ "0.8773681", "0.87153566", "0.86581725", "0.8473132", "0.8446493", "0.8446493", "0.8446493", "0.75534517", "0.7171569", "0.68134344", "0.6715133", "0.6542007", "0.65397805", "0.65058136", "0.6436549", "0.6430624", "0.63161963", "0.6215072", "0.6104049", "0.6095873", "0.608248...
0.88110566
0
Draw boxes from results structure onto image
def draw_boxes(image, results, min_score=0.2, max_boxes=10): results = sorted(results, key=lambda x: x['score']) results = results[0:max_boxes] for r in results: if r['score'] < min_score: continue draw_box(image, r['bounding_box'], labels[r['class_id']], r['score'])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_boxes(self, im, boxes):\n for bbox in boxes:\n l = [int(x) for x in bbox[\"coords\"]]\n l = self.scalebox(l)\n icon = self.classes_to_icons[bbox[\"label\"]]\n overlay_im_to_background(im, icon, l[0], l[1] - icon.shape[0] - 5)\n cv2.rectangle(im...
[ "0.72445345", "0.7153246", "0.7029988", "0.7007932", "0.69935673", "0.69907695", "0.6941484", "0.6920315", "0.6867858", "0.6833942", "0.6833801", "0.6787415", "0.6783118", "0.67714643", "0.67637265", "0.66858953", "0.6676106", "0.6671345", "0.6658536", "0.66494524", "0.664904...
0.7102486
2