query
stringlengths
9
9.05k
document
stringlengths
10
222k
metadata
dict
negatives
listlengths
30
30
negative_scores
listlengths
30
30
document_score
stringlengths
4
10
document_rank
stringclasses
2 values
Verify a HMACSHA1 signature.
def verify_hmac_sha1(request): base_string = generate_signature_base_string(request) sig = hmac_sha1_signature( base_string, request.client_secret, request.token_secret) return hmac.compare_digest(sig, request.signature)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verify_signature(request):\n\n secret = settings.GITHUB_WEBHOOK_SECRET\n header = request.headers.get(\"X-Hub-Signature\")\n\n if header is None:\n abort(403)\n\n if header[:5] != \"sha1=\":\n abort(403)\n\n signature = header[5:]\n\n mac = hmac.new(secret, msg=request.data, dig...
[ "0.7692784", "0.7273302", "0.7163063", "0.7086009", "0.6865561", "0.6865561", "0.6826931", "0.682019", "0.67913204", "0.67604345", "0.67458135", "0.6701807", "0.6631988", "0.66303134", "0.6605105", "0.65309757", "0.64935553", "0.64834034", "0.6469832", "0.64626616", "0.645355...
0.8289877
0
Verify a RSASSAPKCS 1 v1.5 base64 encoded signature.
def verify_rsa_sha1(request): from .rsa import verify_sha1 base_string = generate_signature_base_string(request) sig = binascii.a2b_base64(to_bytes(request.signature)) return verify_sha1(sig, to_bytes(base_string), request.rsa_public_key)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verify(self):\n if not self.public_key:\n self.fetch_public_key()\n data = self.doc.find(\".//{http://salmon-protocol.org/ns/magic-env}data\").text\n sig = self.doc.find(\".//{http://salmon-protocol.org/ns/magic-env}sig\").text\n sig_contents = '.'.join([\n dat...
[ "0.7346409", "0.7334109", "0.70891714", "0.7031808", "0.7024463", "0.69830036", "0.6880926", "0.6834985", "0.6734993", "0.6712184", "0.66882586", "0.6635995", "0.6630199", "0.66299146", "0.65862495", "0.658204", "0.6560976", "0.653061", "0.6521858", "0.6484494", "0.64510596",...
0.73987806
0
It extracts main config file and also check for database Checks sqlite key to check if user wants to create database for snapshots By end of this function, self.main_file has the passed file or arguments details
def get_config_file(self): conf_file = self.args.file if conf_file is not None: if os.path.isfile(conf_file): config_file = open(conf_file, "r") self.main_file = yaml.load(config_file, Loader=yaml.FullLoader) elif os.path.isfile( o...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\n\n parser = argparse.ArgumentParser(\n description='Perform initial loading of build database from manifests'\n )\n parser.add_argument('-d', '--debug', action='store_true',\n help='Enable debugging output')\n parser.add_argument('-c', '--config', dest='db_rep...
[ "0.6976895", "0.6250245", "0.5813311", "0.5782699", "0.57805526", "0.57569474", "0.57136023", "0.5707065", "0.5637054", "0.55817455", "0.5576191", "0.5560063", "0.5537685", "0.5537335", "0.55360574", "0.5499451", "0.54898477", "0.5476134", "0.5471222", "0.5447025", "0.5443635...
0.75727296
0
If diff is called with both pre_snapfile and post_snap_file then just process the diff and exit
def check_diff_as_arg(self): if self.args.diff is True: if ( self.args.pre_snapfile is not None and os.path.isfile(self.args.pre_snapfile) ) and ( self.args.post_snapfile is not None and os.path.isfile(self.args.post_snapfil...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def PostProcessDiff(self, diff):\r\n return diff", "def get_diffs(history):\n\n # First get all possible representations\n mgr = plugins_get_mgr() \n keys = mgr.search('representation')['representation']\n representations = [mgr.get_by_key('representation', k) for k in keys]\n\n for i in range(...
[ "0.68141073", "0.59248495", "0.58161527", "0.56040096", "0.5586909", "0.5584296", "0.5551151", "0.55438554", "0.55191743", "0.5518006", "0.5514842", "0.54703873", "0.5464534", "0.5453087", "0.54469776", "0.5440505", "0.54154956", "0.54152906", "0.5398181", "0.53811437", "0.53...
0.75590014
0
connect to device and calls the function either to generate snapshots or compare them based on option given (snap, check, snapcheck, diff)
def connect( self, hostname, username, password, output_file, config_data=None, action=None, post_snap=None, **kwargs ): res = None if config_data is None: config_data = self.main_file if "local" in config_d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def connect(self, hostname, username, password, output_file,\n config_data=None, action=None, post_snap=None, **kwargs):\n res = None\n if config_data is None:\n config_data = self.main_file\n\n if 'local' in config_data:\n self.args.local = True\n \...
[ "0.64870423", "0.59580183", "0.5867304", "0.5853912", "0.58120286", "0.5768653", "0.57413423", "0.5724415", "0.56275874", "0.5477708", "0.54328036", "0.5409635", "0.53566366", "0.5353188", "0.5293119", "0.527405", "0.5257", "0.5200732", "0.5188381", "0.5157558", "0.51187694",...
0.63341594
1
Connect to devices based on host_dict
def connect_multiple_device( self, host_dict, config_data, pre_name, action=None, post_name=None ): res_obj = [] if config_data is not None: self.test_cases = self.extract_test_cases(config_data) # extract test cases for (iter, key_value) in iteritems(host_dict): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def connect_to_host_with_dictionary(self, host_details):\n self.connect_to_host(**host_details)", "def extract_device_information(self, host_dict):\n self.host_list = []\n if self.args.hostname is None:\n try:\n hosts_val = self.main_file[\"hosts\"]\n exc...
[ "0.70594084", "0.6506598", "0.6291214", "0.62790006", "0.62790006", "0.6208404", "0.61958295", "0.6120624", "0.60801977", "0.6076955", "0.60698855", "0.603772", "0.6030748", "0.5983176", "0.5944729", "0.59284025", "0.5926062", "0.58858335", "0.586033", "0.5859153", "0.5857681...
0.69775575
1
Function to set action based on command line arguments
def set_action_cmd(self, action): if self.args.snapcheck is True: action = "snapcheck" if self.args.check is True: action = "check" if self.args.snap is True: action = "snap" if self.args.diff is True: action = "diff" return action
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def onAction(*args):", "def onAction(*args):", "def onAction(*args):", "def onAction(*args):", "def do_action(self, action, a=None, b=None):\n pass", "def main():\n parser = argparse.ArgumentParser()\n subparsers = parser.add_subparsers(title=\"Actions\", dest=\"action\")\n subparsers.add...
[ "0.6884096", "0.6884096", "0.6884096", "0.6884096", "0.6684647", "0.65783787", "0.65472317", "0.65350646", "0.6449519", "0.64137846", "0.6376749", "0.63212985", "0.6311022", "0.6293921", "0.62880504", "0.62880504", "0.62880504", "0.62880504", "0.62880504", "0.62880504", "0.62...
0.71444446
0
Return string prefix of first size terminals separated with sep Default size is all formula.
def prefix(self, size=None, sep=""): return sep.join(map(str, self.terms[:size]))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _prettifySize(self, size) -> str:\n iteration = 0\n while size >= 1024:\n size /= 1024\n iteration += 1\n size = f'{size:.2f}'.rstrip('0').rstrip('.').rjust(6) # 6 is maximal number of digits of any input\n return f'{size} {self._SIZES_SUFFIX[iteration]}'", ...
[ "0.61862767", "0.60624576", "0.60266757", "0.59096456", "0.59057575", "0.58174723", "0.5788135", "0.572439", "0.5712042", "0.5695619", "0.56895643", "0.56745255", "0.5654441", "0.5654441", "0.56328124", "0.55670935", "0.55618083", "0.55523664", "0.5542072", "0.5541031", "0.55...
0.78489566
0
Test the initialization of a Hopfield network using 2 exemplars
def test_init_hebbian_2(self): v_one = [1, -1, -1, -1, 1, -1, -1, -1, 1] v_two = [-1, -1, -1, 1, 1, 1, -1, -1, -1] network = HopfieldNetwork([v_one, v_two]) expected = np.array([ [0, 0, 0, -2, 0, -2, 0, 0, 2], [0, 0, 2, 0, -2, 0, 2, 2, 0], [0, 2, 0, 0,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_init_hebbian_3(self):\n v_one = [1, -1, -1, -1, 1, -1, -1, -1, 1]\n v_two = [-1, -1, -1, 1, 1, 1, -1, -1, -1]\n v_three = [-1, -1, 1, -1, -1, 1, -1, -1, 1]\n network = HopfieldNetwork([v_one, v_two, v_three])\n expected = np.array([\n [0, 1, -1, -1, 1, -3, 1, ...
[ "0.7630798", "0.72439885", "0.7136967", "0.70614153", "0.6765604", "0.6640517", "0.6589477", "0.6575849", "0.65194684", "0.6511079", "0.64315563", "0.6423228", "0.64084536", "0.639286", "0.6369258", "0.63520014", "0.6336823", "0.63319004", "0.6319801", "0.63012815", "0.627478...
0.73528194
1
Test the initialization of a Hopfield network using 2 exemplars
def test_init_hebbian_3(self): v_one = [1, -1, -1, -1, 1, -1, -1, -1, 1] v_two = [-1, -1, -1, 1, 1, 1, -1, -1, -1] v_three = [-1, -1, 1, -1, -1, 1, -1, -1, 1] network = HopfieldNetwork([v_one, v_two, v_three]) expected = np.array([ [0, 1, -1, -1, 1, -3, 1, 1, 1], ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_init_hebbian_2(self):\n v_one = [1, -1, -1, -1, 1, -1, -1, -1, 1]\n v_two = [-1, -1, -1, 1, 1, 1, -1, -1, -1]\n network = HopfieldNetwork([v_one, v_two])\n expected = np.array([\n [0, 0, 0, -2, 0, -2, 0, 0, 2],\n [0, 0, 2, 0, -2, 0, 2, 2, 0],\n ...
[ "0.73528194", "0.72439885", "0.7136967", "0.70614153", "0.6765604", "0.6640517", "0.6589477", "0.6575849", "0.65194684", "0.6511079", "0.64315563", "0.6423228", "0.64084536", "0.639286", "0.6369258", "0.63520014", "0.6336823", "0.63319004", "0.6319801", "0.63012815", "0.62747...
0.7630798
0
Test that the weights matrix for a Hopfield Network trained using the Storkey Learning Rule is calculated correctly.
def test_init_storkey(self): # Single exemplar expected_weights = np.array([ [0, .3333333, .3333333], [.3333333, 0, .3333333], [.3333333, .3333333, 0] ]) v_one = [1, 1, 1] network = HopfieldNetwork([v_one], learning_rule="Storkey") npt...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_edges_and_weights():\n edges, weights, state_value = edges_weights_specified_state(\n PROBABILITYMATRIX,\n MARKET,\n SNULL)\n assert len(edges) == len(weights) == (len(state_value)**2)", "def test_init_hebbian_3(self):\n v_one = [1, -1, -1, -1, 1, -1, -1, -1, 1]\n ...
[ "0.6890599", "0.68161327", "0.6567938", "0.6298382", "0.62834656", "0.62829876", "0.62044597", "0.6201265", "0.6127504", "0.61117107", "0.6089668", "0.60799056", "0.60799056", "0.6077091", "0.6004674", "0.59894615", "0.5976039", "0.59656614", "0.5950377", "0.59462756", "0.593...
0.74996924
0
Unfreeze all layers and compile model.
def unfreeeze_all_layers(self): # Unfreeeze logger.info('MODEL: Unfreeze all layers.') for i in range(len(self.model.layers)): self.model.layers[i].trainable = True # Compile model logger.info('MODEL: Compiling...') self.model.compile(optimizer = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unfreeze(self, exclude_range=None):\n # make all layers trainable\n for i, layer in enumerate(self.model.layers):\n layer.trainable = True\n if exclude_range:\n for i, layer in enumerate(self.model.layers[:exclude_range]):\n layer.trainable = False\n ...
[ "0.7164862", "0.67806935", "0.6774033", "0.6644976", "0.66006935", "0.6467279", "0.641152", "0.6242765", "0.6199509", "0.61263496", "0.61039317", "0.61007154", "0.6037022", "0.6014011", "0.6011131", "0.60053545", "0.59933645", "0.5969294", "0.5949607", "0.5898639", "0.589004"...
0.8383477
0
Simply print message and exit
def exit_message(message): print(yellow(message)) sys.exit(1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exitWithMsg(msg):\n\tprint(msg + \" -- quitting\")\n\tsys.exit(0)", "def print_ok(msg):\n print('OK - %s' % (msg))\n sys.exit(0)", "def exit(cls, msg):\n Console.error(msg)\n sys.exit()", "def error(message):\n print message\n sys.exit(2)", "def exit_program(msg):\n print(m...
[ "0.7879534", "0.7827344", "0.7734325", "0.7541569", "0.7521398", "0.7509828", "0.74649394", "0.7446608", "0.7433818", "0.7433818", "0.73652816", "0.73389024", "0.7304005", "0.72941273", "0.72919995", "0.7286692", "0.7274794", "0.727461", "0.71813804", "0.71803355", "0.7168433...
0.7851197
1
Deletes script to Nexus 3 script API Returns false if script does not exist
def delete(self): delete_url = '{0}/{1}'.format(self.url, self.script_name) resp = False if self.get(): log.debug('Deleting script: {0}'.format(self.script_name).format(self.script_name)) req = requests.delete(delete_url, auth=(self.username, self.password)) i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_script(script_id):\n return _u2i(_pigpio_command(_control, _PI_CMD_PROCD, script_id, 0))", "def delScript(self):\r\n\r\n if not self.isClosed:\r\n if len(self.__script) > 0:\r\n self.__pha = ''\r\n else:\r\n raise HDDOPermissionException('Tr...
[ "0.679962", "0.6742753", "0.66191584", "0.6197797", "0.6021327", "0.5747512", "0.56212825", "0.5602862", "0.56010085", "0.5462902", "0.5455628", "0.5454825", "0.54141384", "0.54083973", "0.5364566", "0.5357563", "0.5348311", "0.53402734", "0.5332236", "0.5307038", "0.5263296"...
0.771621
0
Get script to Nexus 3 script API Returns false if script does not exist
def get(self): get_url = '{0}/{1}'.format(self.url, self.script_name) resp = False try: log.debug('Checking for script: {0}'.format(self.script_name)) req = requests.get(get_url, auth=(self.username, self.password)) if req.status_code == 204 or 200: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_script ( self, name ):\n script = self.scripts [name]\n if script.is_visible():\n return script\n else:\n raise KeyError ( name )", "def test_6_1_1_script_exists(host):\n assert host.file(AUDIT_SYSTEM_SCRIPT).exists", "def get_client_script(t2_url, t2_token, id):\n ...
[ "0.6129262", "0.58763593", "0.56659836", "0.56309783", "0.5549069", "0.55146426", "0.54840267", "0.54802585", "0.53971785", "0.5374223", "0.5373115", "0.5326019", "0.5275836", "0.5187021", "0.5134172", "0.51037407", "0.509923", "0.509786", "0.5096454", "0.509308", "0.50663483...
0.7004098
0
Uploads script to Nexus 3 script API If a script of the same name already exists, it will be updated/replaced
def upload(self): data = {'name': self.script_name, 'content': self.script_data, 'type': 'groovy'} payload = json.dumps(data) headers = {'Content-Type': 'application/json'} resp = False if self.get(): log.debug('Updating script: {0}'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def putscript(self, name, content):\n content = self.__prepare_content(content)\n code, data = (\n self.__send_command(\"PUTSCRIPT\", [name.encode(\"utf-8\"), content]))\n if code == \"OK\":\n return True\n return False", "def create_script(api_url, project_id, u...
[ "0.6142157", "0.6045424", "0.6017059", "0.5938109", "0.57848173", "0.5711233", "0.56841195", "0.56687057", "0.5594382", "0.558259", "0.5581312", "0.55306983", "0.55302894", "0.54607105", "0.53864473", "0.5319818", "0.5301676", "0.5299398", "0.5291218", "0.52879703", "0.526187...
0.7077887
0
Returns connection information used for the Nexus3 connection.
def _connection_info(): defaults = {'host': 'http://127.0.0.1:8081', 'user': 'admin', 'pass': 'admin123'} # return defaults connection_info = {} _opts = __salt__['config.option']('nexus3') default_addrs_used = [] for attr in defaults: if attr not in _opts...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def retrieve_connection_info():\n # Define the global variables at this module level\n global base_url\n global api_credentials\n base_url, api_credentials = core.get_connection_info()\n return", "def retrieve_connection_info():\n # Define the global variables at this module level\n global b...
[ "0.68595403", "0.68595403", "0.6789287", "0.6762546", "0.6695235", "0.66166204", "0.66132754", "0.6386712", "0.6386211", "0.6312334", "0.62269264", "0.62152576", "0.61577386", "0.60731745", "0.605599", "0.6003682", "0.60021055", "0.5997716", "0.5989627", "0.5973066", "0.59661...
0.7809009
0
Setup SMTP servers for Nexus to send emails through
def email_server(name, email_server_port, email_server_enabled=True, email_server_username=None, email_server_password=None, email_from_address='nexus@example.org', email_subject_prefix='Nexus: ', emai...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup_smtp():\n print(\"INFO: Setting up SMTP variables...\")\n conf = ConfigParser()\n conf.read(os.path.join(os.path.abspath(\n os.path.dirname(__file__)), '.', 'smtp.conf'))\n smtp = {\n \"server\": conf.get('smtp', 'smtp_server'),\n \"login\": conf.get('smtp', 'smtp_login')...
[ "0.70642143", "0.6397728", "0.6349372", "0.63154936", "0.6137803", "0.61031014", "0.59008354", "0.58652055", "0.58581156", "0.584885", "0.58382356", "0.5766413", "0.57564586", "0.57523227", "0.5674488", "0.5664537", "0.5590478", "0.5571978", "0.5555285", "0.5527018", "0.55179...
0.6890123
1
Get a list of all master feed_ids.
def get_all_master_ids(self): return self._handler.get_all_master_ids()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all_master_ids_feed_ids(self, master_id):\r\n return self._handler.get_all_master_ids_feed_ids(master_id)", "def get_feed_ids_from_application_in_master_id(self, master_id, application_name):\r\n return self._handler.get_feed_ids_from_application_in_master_id(master_id, application_name)", ...
[ "0.8965312", "0.7647371", "0.68860483", "0.66766214", "0.6332102", "0.6292719", "0.6250231", "0.62295794", "0.62160426", "0.6212974", "0.6194266", "0.6194266", "0.6176926", "0.61526465", "0.6143369", "0.6070736", "0.60541576", "0.604186", "0.6001296", "0.59624195", "0.5909811...
0.7764744
1
Get a list of all feed_ids of one master feed id.
def get_all_master_ids_feed_ids(self, master_id): return self._handler.get_all_master_ids_feed_ids(master_id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_feed_ids_from_application_in_master_id(self, master_id, application_name):\r\n return self._handler.get_feed_ids_from_application_in_master_id(master_id, application_name)", "def get_all_master_ids(self):\r\n return self._handler.get_all_master_ids()", "def get_ids(self):\n return ...
[ "0.78285694", "0.67986286", "0.66350085", "0.64969146", "0.60832095", "0.6033761", "0.60256743", "0.5877307", "0.58745205", "0.58655065", "0.5864143", "0.58540344", "0.5833321", "0.57986856", "0.5744133", "0.5711689", "0.570919", "0.57010406", "0.5676934", "0.5661927", "0.563...
0.89841104
0
Get last event posted by master feed.
def get_my_last_event(self): return self._handler.get_my_last_event()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_last_event(self):\n return self.last_event_code", "def get_event(self):\r\n return self.events[0]", "def event(self):\n return self.events[0]", "def get_last_post(verbose=False):\n\n last_post = graph.get_connections(id=\"me\", connection_name=\"feed\")[\"data\"][0]\n\n if ...
[ "0.7619493", "0.73999965", "0.7239437", "0.69868624", "0.6803671", "0.6731501", "0.668915", "0.6561142", "0.6403032", "0.63538367", "0.63285524", "0.6325984", "0.6284763", "0.6271884", "0.62529796", "0.6234729", "0.6197259", "0.6173284", "0.6164963", "0.6142161", "0.61232364"...
0.80648315
0
Retrieve the master id of the host.
def get_host_master_id(self): return self._handler.get_host_master_id()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def master_id(self):\r\n return self._arm.master_id", "def master_host(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"master_host\")", "def master_host(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"master_host\")", "def master_host(self) -> pulumi.Input[str]:\n ...
[ "0.82264674", "0.7635938", "0.7635938", "0.7635938", "0.75711745", "0.72553235", "0.7253878", "0.6930568", "0.6907149", "0.6891425", "0.6848056", "0.6799914", "0.67828083", "0.67431533", "0.67423576", "0.67391676", "0.67097235", "0.65926486", "0.6569686", "0.6569686", "0.6549...
0.91965276
0
Get radius of host.
def get_radius(self): return self._handler.get_radius()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_radius(self):\n return self.radius", "def get_radius(self):\n return self.radius", "def get_radius(self):\n return self.__radius", "def get_radius(self):\n return self.r", "def getRadius(self):\n return self.radius", "def getRadius(self):\n return self.__...
[ "0.7674797", "0.7674797", "0.76716787", "0.7541672", "0.7508762", "0.74950165", "0.7481828", "0.7481828", "0.7481828", "0.7481828", "0.7481828", "0.7249513", "0.7219139", "0.71897143", "0.71456605", "0.70461446", "0.70365214", "0.69976044", "0.686444", "0.6831587", "0.6753365...
0.7820966
0
Get the master feedid to a feed.
def get_master_id_from_feed(self, feed_id): return self._handler.get_master_id_from_feed(feed_id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_host_master_id(self):\r\n return self._handler.get_host_master_id()", "def master_id(self):\r\n return self._arm.master_id", "def get_all_master_ids_feed_ids(self, master_id):\r\n return self._handler.get_all_master_ids_feed_ids(master_id)", "def get_primary_id(self):", "def se...
[ "0.6251614", "0.61497986", "0.60610026", "0.5936967", "0.59095067", "0.5872895", "0.57819605", "0.5768666", "0.5623498", "0.56232697", "0.5604834", "0.55910164", "0.5561119", "0.5555954", "0.55416256", "0.55267906", "0.54940456", "0.54940456", "0.54864126", "0.54864126", "0.5...
0.88564694
0
Get feed all feed ids corresponding to an application.
def get_feed_ids_from_application_in_master_id(self, master_id, application_name): return self._handler.get_feed_ids_from_application_in_master_id(master_id, application_name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_app_ids_all(self, feed_elements):\n app_ids = []\n for elm in feed_elements:\n app_ids += self.get_app_ids(elm)\n return app_ids", "def _get_all_app_ids(config, client):\n rv = set()\n total_pages = client.get_published_apps(config.username, 0).json()[\"total_pages\"...
[ "0.72598046", "0.68444437", "0.6776219", "0.645753", "0.63500506", "0.62559724", "0.6120204", "0.61053705", "0.6001982", "0.59925056", "0.5814102", "0.5774021", "0.57684445", "0.57085335", "0.5564679", "0.5553488", "0.5542338", "0.55207413", "0.5516538", "0.5484414", "0.5481"...
0.7434823
0
Get feed all feed ids in radius of master feed.
def get_feed_ids_in_radius(self): return self._handler.get_feed_ids_in_radius()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all_master_ids_feed_ids(self, master_id):\r\n return self._handler.get_all_master_ids_feed_ids(master_id)", "def get_feed_ids_from_application_in_master_id(self, master_id, application_name):\r\n return self._handler.get_feed_ids_from_application_in_master_id(master_id, application_name)", ...
[ "0.71156096", "0.6680769", "0.62060213", "0.6063754", "0.59509504", "0.58917826", "0.5684985", "0.5602874", "0.55801207", "0.55441105", "0.54914516", "0.54837316", "0.54556334", "0.5413549", "0.53914434", "0.53721905", "0.5361594", "0.5347022", "0.5283596", "0.5275335", "0.52...
0.7561202
0
Get feed radius of a feed id.
def set_feed_ids_radius(self, feed_id, radius): return self._handler.set_feed_ids_radius(feed_id, radius)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def radius(self):\n return self._radius", "def radius(self):\n return self._radius", "def radius(self):\n return self._radius", "def radius(self):\n return self._radius", "def radius(self):\n return self._radius", "def getRadius(self):\n return self.radius", "d...
[ "0.6144179", "0.6144179", "0.6144179", "0.6144179", "0.6144179", "0.6081703", "0.6052028", "0.6031696", "0.6031696", "0.60082406", "0.595768", "0.5955452", "0.593676", "0.5909421", "0.5870825", "0.58496827", "0.5845195", "0.5681573", "0.5674434", "0.56120014", "0.55483836", ...
0.6167866
0
show all books, with optional parameter filtering e.g. /books/author=Roald%20Dahl&price=6.20
def show_books(): # need + or %20 for spaces in author (set encoding?) args = request.args column_names = get_column_names() sql_cmd = ["SELECT title, author FROM books"] if len(args) > 0: for j, arg in enumerate(args): if arg not in column_names: # return empty list ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_books_read():\n search_criteria = request.args.get('search')\n if search_criteria == \"\":\n list_of_books = []\n\n flash(\"Please enter an author or a title.\")\n\n return render_template('finished_book_list.html',\n list_of_books=list_of_books\n ...
[ "0.7029309", "0.6956459", "0.6916006", "0.6831943", "0.6622613", "0.6614744", "0.65805906", "0.65581375", "0.65433437", "0.65419", "0.65240115", "0.64686716", "0.6377632", "0.6343441", "0.63207304", "0.6310111", "0.6275889", "0.6228054", "0.62100327", "0.62100327", "0.6196039...
0.7635677
0
Retrieve dict of implementationspecific attrs.
def get_implementation_specific_attrs(cls): ctypes_version = cls.get_drmaa2_library().drmaa2_get_drmaa_version(); if cls.implementation_specific_attrs is None: cls.implementation_specific_attrs = cls.to_py_dict( cls.get_drmaa2_library().uge_vi_impl_spec_get(ctypes_version)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_attributes(self) -> Dict[str, str]:\n pass", "def attrs(self):\n return self.__dict__", "def _get_attribute_dic(self, attrs):\n attr_dic = {}\n for attr_pair in attrs:\n attr_dic[attr_pair[0]] = attr_pair[1]\n return attr_dic", "def load_attrs(self):\n ...
[ "0.7532809", "0.73896617", "0.7154876", "0.7135219", "0.71218294", "0.71218294", "0.7018853", "0.69749457", "0.69224215", "0.6909992", "0.68702835", "0.68654716", "0.68215257", "0.6728141", "0.67105687", "0.6702284", "0.6696501", "0.6694866", "0.6694866", "0.6694024", "0.6690...
0.78587157
0
Retrieve list of implementationspecific keys.
def get_implementation_specific_keys(cls): if cls.implementation_specific_keys is None: cls.implementation_specific_keys = cls.to_py_string_list( cls.get_drmaa2_library().drmaa2_version_impl_spec()) return cls.implementation_specific_keys
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def keys(self) -> List:\n pass", "def keys(self) -> List[str]:\n raise NotImplementedError", "def get_key_list(self) -> list:\n return self.key_functs.keys()", "def get_providers(self):\n return self.keys", "def get_providers(self):\n return self.keys", "def get_providers(s...
[ "0.7177222", "0.7160029", "0.7005477", "0.69610333", "0.69610333", "0.69610333", "0.69610333", "0.69610333", "0.69610333", "0.6854305", "0.68474376", "0.68380237", "0.68335503", "0.6814249", "0.6738982", "0.67181915", "0.671546", "0.66967744", "0.6685488", "0.66540575", "0.66...
0.75637496
0
Given a _list of items, find the first item matching _item and return it.
def find_first_match(_list, _item): for _list_item in _list: if _item["pid"] == _list_item["pid"]: return _list_item return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def findItem(items: Iterable, condition):\n for item in items:\n if condition(item):\n return item", "def first(items):\r\n return items[0]", "def get_first_item(checklist):\r\n return checklist['items'][0]", "def find_first(item, vec):\n for i in range(len(vec)):\n if it...
[ "0.7275993", "0.72591126", "0.7228444", "0.69376737", "0.69103163", "0.68174595", "0.676792", "0.67332214", "0.6728107", "0.67036474", "0.6661996", "0.6590008", "0.65873766", "0.65691674", "0.6564417", "0.65590453", "0.6532622", "0.65154046", "0.64619", "0.64268464", "0.64118...
0.8330334
0
Evaluate the equivalency of two dictionaries. This is a key/value driven comparison which is driven by the first (primary) dictionary. To fully establish equivalency between two dictionaries one would use this function twice, swapping the order of dictionaries between uses.
def equivalent_dicts(_a, _b): for _key in _a.keys(): if _a[_key] != _b[_key]: return False return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def CompareValuesDict(dic1, dic2, accepteddiff=0.04, debug =False):\n identical = True\n for key in dic1:\n val1 = dic1[key]\n val2 = dic2.get(key,None)\n if val2:\n diff = np.abs(val1-val2)\n if debug:\n print (key, diff)\n if dif...
[ "0.70684385", "0.7046959", "0.700562", "0.69282156", "0.6766398", "0.6765054", "0.6746593", "0.6686411", "0.66789526", "0.66486114", "0.6610721", "0.6605661", "0.65810055", "0.65533334", "0.65410566", "0.64807105", "0.6469771", "0.6445154", "0.6418634", "0.63982445", "0.63916...
0.74921477
0
Given _load_manifest (the expected agent response) and _stma_report (the actual response), evaluate the agent's response and produce a set of pass fail grades for the test execution.
def process_results(_load_manifest, _stma_report): _junit_results = [] # the first "test" is that the two lists should have the same number of items if len(_load_manifest) == len(_stma_report): print("result count test: pass") else: print("result count test: fail") # for the rest, e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reportEarl(results, tester, subject, test, notApplicable, passed):\n # \" help emacs\n\n # odd; no RDFS there\n result = BNode()\n results.add((result, RDF.type, EARL.TestResult)) # odd; why the indirection?\n if notApplicable:\n results.add((result, EARL.outcome, EARL.notApplicable))\n ...
[ "0.5678489", "0.565714", "0.56079245", "0.5392946", "0.53916585", "0.5390823", "0.5367856", "0.53671813", "0.53506243", "0.53493565", "0.53275806", "0.5325273", "0.5319133", "0.5304864", "0.5282382", "0.52184623", "0.5216627", "0.5209862", "0.52002263", "0.51995385", "0.51862...
0.68667597
0
Read the instances from input file.
def _ReadInstancesInternal(input_file=None, data_format=None, line_limit=100): instances = [] for line_num, line in enumerate(input_file): line_content = line.rstrip('\n') if not line_content: raise InvalidInstancesFileError('Empty line is not allowed in the ' 'i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ReadInstances(input_file, data_format, local_predict=False):\n\n line_limit = None\n if not local_predict:\n line_limit = 100\n\n instances = []\n if input_file == '-':\n instances = _ReadInstancesInternal(sys.stdin, data_format, line_limit)\n else:\n with open(input_file, 'r') as f:\n insta...
[ "0.7313702", "0.7198905", "0.7177313", "0.71192425", "0.69630516", "0.6730282", "0.66814446", "0.6618356", "0.6519186", "0.64666146", "0.6379385", "0.6336091", "0.6313279", "0.63022786", "0.6288628", "0.6277072", "0.6257375", "0.62465894", "0.6224642", "0.6218264", "0.6210629...
0.74047875
0
Read the instances from input file.
def ReadInstances(input_file, data_format, local_predict=False): line_limit = None if not local_predict: line_limit = 100 instances = [] if input_file == '-': instances = _ReadInstancesInternal(sys.stdin, data_format, line_limit) else: with open(input_file, 'r') as f: instances = _ReadInst...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _ReadInstancesInternal(input_file=None, data_format=None, line_limit=100):\n instances = []\n\n for line_num, line in enumerate(input_file):\n line_content = line.rstrip('\\n')\n if not line_content:\n raise InvalidInstancesFileError('Empty line is not allowed in the '\n ...
[ "0.74047875", "0.7198905", "0.7177313", "0.71192425", "0.69630516", "0.6730282", "0.66814446", "0.6618356", "0.6519186", "0.64666146", "0.6379385", "0.6336091", "0.6313279", "0.63022786", "0.6288628", "0.6277072", "0.6257375", "0.62465894", "0.6224642", "0.6218264", "0.621062...
0.7313702
1
Creates 2 construction planes and a solid rib body using a boundary fill between the 2 planes and the wing body
def create_rib_body(component, comp_occurrence, wing_body, root_plane, dist_from_root, thickness): # Create 2 construction planes: # 1) offset from root sketch plane # 2) offset from the first planes = component.constructionPlanes plane1_input = planes.createInput() plane1_input.setByOffset...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\r\n\t\tsuper(Empty, self).__init__()\r\n\r\n\t\t# Initialize all of the objects\r\n\t\tground = self.world.CreateStaticBody(\r\n\t\t\tshapes=[ \r\n\t\t\t\tb2EdgeShape(vertices=[(-40,0),(40,0)])\r\n\t\t\t\t#~ b2EdgeShape(vertices=[(-1.1,-40),(-1.1,40)]),\r\n\t\t\t\t]\r\n\t\t) \r\n\t\tbox=b2Fixtu...
[ "0.60816765", "0.6081264", "0.5991065", "0.593225", "0.5843406", "0.58076805", "0.5782126", "0.57510436", "0.5745507", "0.5669312", "0.559671", "0.5588889", "0.5549292", "0.55436546", "0.5537705", "0.5514598", "0.5468745", "0.5463463", "0.54537874", "0.5452253", "0.5444895", ...
0.6663028
0
create a vertical rib post
def create_rib_vertical_post(component, comp_occurrence, wing_body, rib_body, rib_post_loc, rib_post_width, rib_post_triangle_len): # log('creating rib post of width', rib_post_width, ' at ', rib_post_loc) # create 2 planes, rib_post_width apart, centered on rib_post_loc p1loc ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def createSimpleRibbon(name='noodle', totalJoints=6):\r\n # create a ribbonNurbsPlane:\r\n ribbonNurbsPlane = cmds.nurbsPlane(name=name+\"RibbonNurbsPlane\", constructionHistory=False, object=True, polygon=0, axis=(0, 1, 0), width=1, lengthRatio=8, patchesV=totalJoints)[0]\r\n # get the ribbonNurbsPlane s...
[ "0.5190086", "0.51543105", "0.514899", "0.505922", "0.50376004", "0.50276506", "0.5006099", "0.49541658", "0.49124733", "0.49059847", "0.4891948", "0.48793644", "0.48665646", "0.48644066", "0.4803227", "0.47879702", "0.4785258", "0.47821912", "0.47816136", "0.47716284", "0.47...
0.70319235
0
Creates a portfolio.csv in a temporary folder for the purposes of testing.
def portfolio_csv(tmp_path): lines = [ ('symbol,units,cost\r\n'), ('APPL,100,154.23\r\n'), ('AMZN,600,1223.43\r\n'), ] filename = tmp_path / 'portfolio.csv' with open(filename, 'w', newline='') as file: file.writelines(lines) return filename
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def createFakeCsv():\n \n df = pd.DataFrame([\"a\",\"b\",\"c\"])\n \n df.to_csv(path+'/fakeCSV.csv')\n \n os.rename('fakeCSV.csv','data.csv')", "def save_csv(companies):\n print(\"Saving companies.csv...\")\n\n Path(\"output\").mkdir(parents=True, exist_ok=True)\n file_name = 'output/c...
[ "0.68402624", "0.6277342", "0.6077372", "0.60722893", "0.6070713", "0.6005654", "0.59951186", "0.58781207", "0.58582944", "0.5818991", "0.5788376", "0.57453156", "0.56600684", "0.56543875", "0.5624302", "0.55937207", "0.55902326", "0.5582905", "0.5578713", "0.55742604", "0.55...
0.7910761
0
Creates a report1.csv in a temporary folder for the purposes of testing.
def write_csv(tmp_path): lines = [ ('NFLX,3,99.66,319,998.1,957,-41.1,-0.041\r\n'), ('XRX,40,33.94,30,1357.6,1200,-157.6,-0.116\r\n'), ] filename = tmp_path / 'report1.csv' with open(filename, 'w', newline='') as file: file.writelines(lines) return filename
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_report(rows):\n\n outfile = NamedTemporaryFile(suffix='.csv', delete=False)\n\n with open(outfile.name, 'wb') as csvfile:\n writer = csv.writer(csvfile, delimiter='\\t',\n quotechar='|', quoting=csv.QUOTE_MINIMAL)\n writer.writerow(['Column #1', 'Column #2',...
[ "0.65316457", "0.64532393", "0.64059794", "0.62989163", "0.62121904", "0.61844164", "0.6183844", "0.61654264", "0.61015725", "0.6076856", "0.6055735", "0.60490394", "0.6040111", "0.6021012", "0.592572", "0.58865726", "0.5883795", "0.58832395", "0.58616185", "0.5858969", "0.58...
0.7299336
0
Gets all matching records from the local and/or remote locations. If records with the same record name are retrieved from both locations, then the local versions of those records are given.
def get_records(self, style: Optional[str] = None, name: Union[str, list, None] = None, local: Optional[bool] = None, remote: Optional[bool] = None, refresh_cache: bool = False, return_df: bool = False, verbo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def download_records(self,\n style: Optional[str] = None,\n name: Union[str, list, None] = None,\n overwrite: bool = False,\n return_records: bool = False,\n verbose: bool = False,\n **kwargs) ->...
[ "0.60621977", "0.58138746", "0.57393664", "0.5597516", "0.5515535", "0.5491422", "0.5443597", "0.54376733", "0.5401611", "0.53456587", "0.53298694", "0.53187597", "0.5288202", "0.5280602", "0.52644515", "0.52507293", "0.52464026", "0.5178745", "0.51585114", "0.5131652", "0.51...
0.62261194
0
Gets a single matching record from the local and/or remote locations. If local is True and the record is found there, then the local copy of the record is returned without searching the remote.
def get_record(self, style: Optional[str] = None, name: Union[str, list, None] = None, local: Optional[bool] = None, remote: Optional[bool] = None, prompt: bool = True, promptfxn: Optional[Callable] = None, refres...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fetch_url_record(short_url = None):\r\n\r\n if short_url:\r\n url_record = db_collection.find_one({'name': short_url, 'deleted': False})\r\n\r\n if url_record:\r\n return url_record\r\n\r\n return None", "def get_object_from_store(self, LocalID = None, FullID = None):\n\n ...
[ "0.5522407", "0.54474115", "0.53815836", "0.5314967", "0.5265785", "0.5237", "0.51792896", "0.5159807", "0.51179576", "0.5077773", "0.5041307", "0.5025669", "0.50157624", "0.5007643", "0.50008553", "0.49951425", "0.4987228", "0.4949384", "0.4948624", "0.49479833", "0.4947569"...
0.6277496
0
Retrieves all matching records from the remote location and saves them to the local location.
def download_records(self, style: Optional[str] = None, name: Union[str, list, None] = None, overwrite: bool = False, return_records: bool = False, verbose: bool = False, **kwargs) -> Optional[n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lookup(self, connector, save=True):\r\n\r\n unknown_conn = self.remote['remote_address'].unique()\r\n discovered = Monitor.whois(self,unknown_conn)\r\n discovered = discovered.drop_duplicates()\r\n self.remote = pd.merge(self.remote, discovered, on='remote_address', how='left')\r\n ...
[ "0.5622253", "0.559509", "0.55759656", "0.52941394", "0.5257177", "0.51982594", "0.512935", "0.51213634", "0.5115208", "0.509727", "0.5080979", "0.5078986", "0.50746846", "0.50706196", "0.5023407", "0.5012331", "0.49970698", "0.4983852", "0.49609244", "0.4957117", "0.4956887"...
0.567314
0
Uploads a record to the remote database. Requires an account for the remote location with write permissions.
def upload_record(self, record: Optional[Record] = None, style: Optional[str] = None, name: Optional[str] = None, model: Union[str, io.IOBase, DM, None] = None, workspace: Union[str, pd.Series, None] = None, over...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def upload(self, remote, local, force = False):\n fl = self.list([ remote ])\n if force == False and remote in fl:\n remote_hash = fl[remote]\n h = hashlib.sha256()\n commonl.hash_file(h, local)\n if remote_hash == h.hexdigest():\n # remote h...
[ "0.5948788", "0.58447915", "0.5728103", "0.5697938", "0.56939894", "0.5683809", "0.56179106", "0.5616025", "0.5610872", "0.558251", "0.5492149", "0.54831696", "0.5455849", "0.5427187", "0.5422074", "0.54218763", "0.5373896", "0.5352577", "0.5336649", "0.53228927", "0.5296176"...
0.7111992
0
Compute volume per labeled region in a nibabelreadable image.
def volume_per_brain_region(input_file, include_labels=[], exclude_labels=[], label_names=[], save_table=False, output_table='', verbose=False): import os import numpy as np import nibabel as nb from io import open from mindboggle.guts.compute...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def treat_volume(volume):\n labels = measure.label(volume.dataobj, background=0, connectivity=2)\n new_volume = np.asarray(volume.dataobj)\n new_volume[labels > 1] = 0\n new_volume = nib.Nifti1Image(new_volume, volume.affine)\n return new_volume", "def _calculate_volume(image: sitk.Image) -> float...
[ "0.6968111", "0.684561", "0.64068925", "0.6255263", "0.62448144", "0.5957871", "0.5956027", "0.59125483", "0.589896", "0.589195", "0.58866686", "0.5872262", "0.5860881", "0.58152765", "0.57926387", "0.57890856", "0.57259107", "0.5720394", "0.5709577", "0.5692522", "0.56842273...
0.740253
0
Refreshes the registry by adding new object classes to the registry.
def _refresh_registry(cls) -> None: cls.objects_dict.clear() # Add new object instances to the registry. for name, clazz in inspect.getmembers( objects, predicate=inspect.isclass): if name == 'BaseObject': continue ancestor_names = [ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def flush(self):\n self._registry = {}", "def create_all(self, registry):\n for cls in registry.values():\n self.create_class(cls)", "def reload(self):\n\n dict_of_dicts = {}\n classes = {\n \"BaseModel\": BaseModel,\n \"User\": User,\n \"...
[ "0.6394272", "0.6323038", "0.6283143", "0.6212295", "0.6140257", "0.61334026", "0.6129184", "0.6091332", "0.6091332", "0.60746014", "0.6034455", "0.6006517", "0.59993356", "0.5990552", "0.59524333", "0.593662", "0.5932447", "0.5929284", "0.5915717", "0.5915714", "0.5911288", ...
0.80249774
0
Get the dict of all object classes.
def get_all_object_classes(cls) -> Dict[str, Type[objects.BaseObject]]: cls._refresh_registry() return copy.deepcopy(cls.objects_dict)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def obj_classes(self) -> ObjClassCollection:\n return self._obj_classes", "def get_classes(engine: Engine) -> Dict[str, PlayableClass]:\n\n classes = engine.get_classes()\n assert classes is not None\n\n class_objs = {}\n for class_idx_data in classes:\n class_data = PlayableClass(engin...
[ "0.7667667", "0.75893366", "0.7559101", "0.74697113", "0.73904556", "0.73806494", "0.734607", "0.73247796", "0.7283916", "0.7201467", "0.7191636", "0.7123383", "0.7067577", "0.70427394", "0.70182014", "0.69096184", "0.69014853", "0.6898215", "0.68955404", "0.6875728", "0.6820...
0.8815578
0
Gets an object class by its type. Types are CamelCased. Refreshes once if the class is not found; subsequently, throws an error.
def get_object_class_by_type( cls, obj_type: str ) -> Type[objects.BaseObject]: if obj_type not in cls.objects_dict: cls._refresh_registry() if obj_type not in cls.objects_dict: raise TypeError('\'%s\' is not a valid object class.' % obj_type) return cls.objec...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_obj_class(self, obj_type: str) -> Type[TgnObject]:\n pass", "def get_class(self, name):\n if name in self._objects_mapping:\n classname = self._objects_mapping[name]\n\n klass = None\n try:\n klass = getattr(self._sdk, classname)\n ...
[ "0.7283992", "0.7180004", "0.69890434", "0.6973099", "0.6911465", "0.68892777", "0.6674916", "0.6630739", "0.6510959", "0.64219165", "0.6413472", "0.6403107", "0.6401721", "0.6372965", "0.6363865", "0.63613474", "0.63378084", "0.6236045", "0.6233853", "0.6214553", "0.62052536...
0.779274
0
Returns a dictionary containing the default object values.
def get_default_object_values() -> Dict[str, AllowedDefaultValueTypes]: # TODO(wxy): Cache this as it is accessed many times. default_object_values: Dict[str, AllowedDefaultValueTypes] = json.loads( constants.get_package_file_contents( 'extensions', feconf.OBJECT_DEFAULT_VALUES_EXTENSIONS_M...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def defaults():\n return {}", "def defaults() -> dict:\n pass", "def get_defaults(self):\n default_dict = {}\n args, varargs, keyword, defaults = inspect.getargspec(self.exec_obj)\n if defaults:\n default_dict = dict(zip(args[-len(defaults):], defaults))\n r...
[ "0.82845", "0.81463146", "0.77948946", "0.77923566", "0.7525667", "0.7336973", "0.7329767", "0.71799356", "0.7150872", "0.7110671", "0.7105723", "0.7102216", "0.70912695", "0.7058654", "0.7022958", "0.69993204", "0.69076955", "0.6859796", "0.68507135", "0.68495923", "0.682812...
0.822484
1
Field `availability_zone` has been deprecated from provider version 1.187.0. New field `zone_id` instead.
def availability_zone(self) -> Optional[pulumi.Input[str]]: warnings.warn("""Field 'availability_zone' has been deprecated from version 1.187.0. Use 'zone_id' instead.""", DeprecationWarning) pulumi.log.warn("""availability_zone is deprecated: Field 'availability_zone' has been deprecated from version 1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def availability_zone(self) -> pulumi.Output[str]:\n warnings.warn(\"\"\"Field 'availability_zone' has been deprecated from version 1.187.0. Use 'zone_id' instead.\"\"\", DeprecationWarning)\n pulumi.log.warn(\"\"\"availability_zone is deprecated: Field 'availability_zone' has been deprecated from ve...
[ "0.78828347", "0.6184233", "0.5997062", "0.58832794", "0.58694875", "0.58152276", "0.58152276", "0.57848233", "0.5777503", "0.5691528", "0.56872624", "0.5612355", "0.55865484", "0.5569494", "0.5495634", "0.5302052", "0.5296739", "0.5278348", "0.5278348", "0.5278348", "0.52783...
0.79226536
0
Field `instance_charge_type` has been deprecated from provider version 1.187.0. New field `payment_type` instead.
def instance_charge_type(self) -> Optional[pulumi.Input[str]]: warnings.warn("""Field `instance_charge_type` has been deprecated from version 1.187.0. Use `payment_type` instead.""", DeprecationWarning) pulumi.log.warn("""instance_charge_type is deprecated: Field `instance_charge_type` has been deprecat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def instance_charge_type(self) -> pulumi.Output[str]:\n warnings.warn(\"\"\"Field `instance_charge_type` has been deprecated from version 1.187.0. Use `payment_type` instead.\"\"\", DeprecationWarning)\n pulumi.log.warn(\"\"\"instance_charge_type is deprecated: Field `instance_charge_type` has been d...
[ "0.83007365", "0.60657185", "0.60657185", "0.60657185", "0.589534", "0.58616686", "0.5226943", "0.5147172", "0.5119267", "0.49114642", "0.48613766", "0.48602143", "0.48096782", "0.48011026", "0.47733074", "0.47237638", "0.47086433", "0.4676503", "0.46626642", "0.4651744", "0....
0.8276222
1
The ip whitelist. See `ip_whitelist` below. Default to creating a whitelist group with the group name "default" and security_ip_list "127.0.0.1".
def ip_whitelists(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['InstanceIpWhitelistArgs']]]]: return pulumi.get(self, "ip_whitelists")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def whitelist_ips(self):\r\n if self.whitelist == '':\r\n return []\r\n return self.IPFilterList([addr.strip() for addr in self.whitelist.split(',')]) # pylint: disable=no-member\r", "def ip_whitelists(self) -> pulumi.Output[Sequence['outputs.InstanceIpWhitelist']]:\n return pulu...
[ "0.73237365", "0.7270454", "0.6940485", "0.65657693", "0.65657693", "0.6409792", "0.6382387", "0.6167399", "0.6147842", "0.61446494", "0.59210384", "0.5895136", "0.5882922", "0.58587646", "0.57926995", "0.57664114", "0.5766037", "0.57519954", "0.56909496", "0.56909496", "0.56...
0.7574016
0
Field `security_ip_list` has been deprecated from provider version 1.187.0. New field `ip_whitelist` instead.
def security_ip_lists(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]: warnings.warn("""Field 'security_ip_list' has been deprecated from version 1.187.0. Use 'ip_whitelist' instead.""", DeprecationWarning) pulumi.log.warn("""security_ip_lists is deprecated: Field 'security_ip_list' has bee...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def security_ip_lists(self) -> pulumi.Output[Sequence[str]]:\n warnings.warn(\"\"\"Field 'security_ip_list' has been deprecated from version 1.187.0. Use 'ip_whitelist' instead.\"\"\", DeprecationWarning)\n pulumi.log.warn(\"\"\"security_ip_lists is deprecated: Field 'security_ip_list' has been depre...
[ "0.8243072", "0.6721728", "0.6721728", "0.66329277", "0.65703094", "0.64522284", "0.64522284", "0.64522284", "0.64522284", "0.64522284", "0.64522284", "0.64522284", "0.59456754", "0.5926319", "0.5890349", "0.5669814", "0.5607794", "0.5505122", "0.54784125", "0.5477106", "0.53...
0.84210396
0
The used time. When the parameter `period` is `Year`, the `used_time` value is `1` to `3`. When the parameter `period` is `Month`, the `used_time` value is `1` to `9`.
def used_time(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "used_time")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def used_time(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"used_time\")", "def timesUsed(self)->int:\n return self._lic.params['usedTimes'].value", "def use_time(self) -> int:\n return self._use_time", "def build_seconds_used(self):\n return self.get_data(\"b...
[ "0.6913163", "0.66825885", "0.625654", "0.6129858", "0.5935855", "0.5914198", "0.5913351", "0.5867814", "0.58128506", "0.5792706", "0.5763643", "0.5753198", "0.5741215", "0.5721919", "0.56888837", "0.5683927", "0.56733954", "0.56202996", "0.5596637", "0.55872005", "0.55863136...
0.6752549
1
Field `availability_zone` has been deprecated from provider version 1.187.0. New field `zone_id` instead.
def availability_zone(self) -> Optional[pulumi.Input[str]]: warnings.warn("""Field 'availability_zone' has been deprecated from version 1.187.0. Use 'zone_id' instead.""", DeprecationWarning) pulumi.log.warn("""availability_zone is deprecated: Field 'availability_zone' has been deprecated from version 1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def availability_zone(self) -> pulumi.Output[str]:\n warnings.warn(\"\"\"Field 'availability_zone' has been deprecated from version 1.187.0. Use 'zone_id' instead.\"\"\", DeprecationWarning)\n pulumi.log.warn(\"\"\"availability_zone is deprecated: Field 'availability_zone' has been deprecated from ve...
[ "0.7881534", "0.6184461", "0.5995408", "0.5881424", "0.58676267", "0.5813323", "0.5813323", "0.5782358", "0.57750684", "0.56915575", "0.568835", "0.5611081", "0.55861306", "0.5567358", "0.54940695", "0.5300068", "0.52958894", "0.5276911", "0.5276911", "0.5276911", "0.5276911"...
0.7921489
1
The ip whitelist. See `ip_whitelist` below. Default to creating a whitelist group with the group name "default" and security_ip_list "127.0.0.1".
def ip_whitelists(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['InstanceIpWhitelistArgs']]]]: return pulumi.get(self, "ip_whitelists")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def whitelist_ips(self):\r\n if self.whitelist == '':\r\n return []\r\n return self.IPFilterList([addr.strip() for addr in self.whitelist.split(',')]) # pylint: disable=no-member\r", "def ip_whitelists(self) -> pulumi.Output[Sequence['outputs.InstanceIpWhitelist']]:\n return pulu...
[ "0.73237365", "0.7270454", "0.6940485", "0.65657693", "0.65657693", "0.6409792", "0.6382387", "0.6167399", "0.6147842", "0.61446494", "0.59210384", "0.5895136", "0.5882922", "0.58587646", "0.57926995", "0.57664114", "0.5766037", "0.57519954", "0.56909496", "0.56909496", "0.56...
0.7574016
1
Field `security_ip_list` has been deprecated from provider version 1.187.0. New field `ip_whitelist` instead.
def security_ip_lists(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]: warnings.warn("""Field 'security_ip_list' has been deprecated from version 1.187.0. Use 'ip_whitelist' instead.""", DeprecationWarning) pulumi.log.warn("""security_ip_lists is deprecated: Field 'security_ip_list' has bee...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def security_ip_lists(self) -> pulumi.Output[Sequence[str]]:\n warnings.warn(\"\"\"Field 'security_ip_list' has been deprecated from version 1.187.0. Use 'ip_whitelist' instead.\"\"\", DeprecationWarning)\n pulumi.log.warn(\"\"\"security_ip_lists is deprecated: Field 'security_ip_list' has been depre...
[ "0.82427394", "0.67223036", "0.67223036", "0.6633361", "0.6571254", "0.6452488", "0.6452488", "0.6452488", "0.6452488", "0.6452488", "0.6452488", "0.6452488", "0.5947045", "0.5928397", "0.58899033", "0.56706125", "0.5608827", "0.5505925", "0.547887", "0.54775333", "0.5393237"...
0.8420614
1
(Available since v1.196.0) The connection string of the instance.
def connection_string(self) -> pulumi.Output[str]: return pulumi.get(self, "connection_string")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def connection_string(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"connection_string\")", "def connection_string(self):\n return \"postgresql+psycopg2://%s:%s@%s:%s/%s\" % \\\n (os.environ['DB_USER'],\n os.environ['DB_PASSWORD'],\n o...
[ "0.7750683", "0.7586779", "0.7330858", "0.7330858", "0.7330858", "0.7330858", "0.7283894", "0.7235184", "0.721064", "0.7192975", "0.71686554", "0.7149614", "0.71178097", "0.7019766", "0.70034534", "0.6717027", "0.6499539", "0.63656163", "0.6344508", "0.63016945", "0.6293098",...
0.7995886
0
Field `instance_charge_type` has been deprecated from provider version 1.187.0. New field `payment_type` instead.
def instance_charge_type(self) -> pulumi.Output[str]: warnings.warn("""Field `instance_charge_type` has been deprecated from version 1.187.0. Use `payment_type` instead.""", DeprecationWarning) pulumi.log.warn("""instance_charge_type is deprecated: Field `instance_charge_type` has been deprecated from v...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def instance_charge_type(self) -> Optional[pulumi.Input[str]]:\n warnings.warn(\"\"\"Field `instance_charge_type` has been deprecated from version 1.187.0. Use `payment_type` instead.\"\"\", DeprecationWarning)\n pulumi.log.warn(\"\"\"instance_charge_type is deprecated: Field `instance_charge_type` h...
[ "0.8276222", "0.8276222", "0.60657185", "0.60657185", "0.60657185", "0.589534", "0.58616686", "0.5226943", "0.5147172", "0.5119267", "0.49114642", "0.48613766", "0.48602143", "0.48096782", "0.48011026", "0.47733074", "0.47237638", "0.47086433", "0.4676503", "0.46626642", "0.4...
0.83007365
0
The used time. When the parameter `period` is `Year`, the `used_time` value is `1` to `3`. When the parameter `period` is `Month`, the `used_time` value is `1` to `9`.
def used_time(self) -> pulumi.Output[Optional[str]]: return pulumi.get(self, "used_time")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def used_time(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"used_time\")", "def used_time(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"used_time\")", "def timesUsed(self)->int:\n return self._lic.params['usedTimes'].value", "def use_time(self) -> ...
[ "0.6754377", "0.6754377", "0.66839546", "0.6257581", "0.61297476", "0.59357536", "0.5910634", "0.590989", "0.5863635", "0.58105963", "0.5789511", "0.5760166", "0.5749833", "0.573828", "0.57205683", "0.5685049", "0.56833917", "0.56708103", "0.5616979", "0.5593522", "0.5589605"...
0.6914394
0
Downloads comments and labels for task
def download_training_data(data_dir, task): COMMENTS_FILE = "%s_annotated_comments.tsv" % task LABELS_FILE = "%s_annotations.tsv" % task if task == "attack": download_file(ATTACK_ANNOTATED_COMMENTS_URL, os.path.join(data_dir, COMMENTS_FILE)) download_file(ATTACK_ANNOT...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self):\n url = \"http://twitter.com/statuses/public_timeline.json\"\n task = taskqueue.Task(\n url='/tasks/fetch',\n params={'url': url}\n )\n task.add('fetch')", "def main(u, o):\n click.echo(f\"Web crawling on {u} started successfully...\")\n\n comment_regex = re.com...
[ "0.59173185", "0.55983466", "0.55412596", "0.55240625", "0.545629", "0.5442837", "0.5390655", "0.5386543", "0.53746194", "0.5357682", "0.5304612", "0.52945745", "0.52933127", "0.52467954", "0.51875186", "0.5134231", "0.5115564", "0.51142234", "0.50962555", "0.50956994", "0.50...
0.58018124
1
make the sale stat unique key
def make_sale_stat_uni_key(date_field, current_id, record_type, timely_type, status): return '/'.join([str(date_field), str(current_id), str(record_type), str(timely_type), str(status)])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _unique_key(self):\n key = f'factor_{self.counter}'\n self.counter += 1\n return key", "def _create_key(item, duplicate_sources):\n if item[\"nom\"] not in duplicate_sources:\n return item[\"nom\"]\n dateref = item[\"date_ref\"]\n year = re.search(r\"\\d{4}\", dateref).gr...
[ "0.5964135", "0.5904869", "0.57466435", "0.56874406", "0.56015605", "0.5597618", "0.5575806", "0.5511234", "0.5406621", "0.5316745", "0.53105605", "0.52563703", "0.52555954", "0.523345", "0.52184445", "0.52117026", "0.51427025", "0.51402295", "0.51227885", "0.511146", "0.5093...
0.7056007
0
Calculates the probability distribution of eating time from the given probability of entrance
def getProbabilityDistribution(probEnter = 0.8): idealTimer = probEnter * 5 initialProbs = [0.05, 0.05, 0.05, 0.05, 0.05] for i in range(5): if idealTimer <= i + 1: initialProbs[i] = 0.6 if i == 0: initialProbs[1] = 0.2 initialProbs[2] = 0.1 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculate_probability(energy, new_energy, temperature):\n if new_energy < energy:\n return 1.0\n else:\n return exp(float(energy - new_energy) / temperature)", "def calculate_probability(self):\n return 0", "def prob(E1, E2, t):\n return 1 if E1 > E2 else np.exp((E1 - E2) / t)...
[ "0.6576199", "0.6563601", "0.6512101", "0.63409036", "0.62928426", "0.6280142", "0.62578565", "0.6217531", "0.6194178", "0.6026022", "0.6013073", "0.60119826", "0.6006106", "0.60006666", "0.5981509", "0.5956107", "0.594816", "0.5940198", "0.5936049", "0.5935788", "0.5899674",...
0.7103082
0
Returns the probability that a gopher survives given the information of a arrow
def gopherSurviveProb(arrowData, leaveTime): time, cell, thickness = arrowData thickKillProb = [0.15, 0.3, 0.45] # If cell < 0, then arrow does not hit, and gopher survives if cell < 0: return 1 # position as a function of time pos = lambda t : min(t, 3) if t <= leaveTime else min(leav...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def p(self) -> Probability:\n ...", "def distribution_probability(self, game):\n dist_probability = {}\n\n total_visits = sum(self.root.n_a.values())\n\n for action, visits in self.root.n_a.items():\n dist_probability[action] = visits/total_visits\n return dist_proba...
[ "0.6157657", "0.59718114", "0.5877109", "0.5840738", "0.58210903", "0.5783116", "0.5673443", "0.5664528", "0.56313574", "0.56159836", "0.5586876", "0.5543739", "0.5527793", "0.5491544", "0.5491128", "0.54842526", "0.5472769", "0.5464558", "0.54376084", "0.54231733", "0.541738...
0.75650096
0
Takes in a board configuration and hunger level, and returns the probability the trap will kill the gopher
def trapLethality(configuration, defaultProbEnter = constants.DEFAULT_PROB_ENTER): sumProb = 0 leftData, rightData = getArrowData(configuration) # using default prob of entering as 0.8, gets the probabilities that a gopher will eat for a certain amount of time # we fix default prob enter as 0.8 for bas...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wyldingHand(self, level):\n if level == 0:\n die_result = random.randint(1,6)\n elif level == 1:\n die_result = random.randint(1,10)\n elif level == 2:\n die_result = random.randint(1,6) + random.randint(1,6)\n elif level == 3:\n die_resul...
[ "0.5877143", "0.5557593", "0.5452678", "0.5447451", "0.5355484", "0.535238", "0.5310507", "0.52576363", "0.524909", "0.5233108", "0.52221334", "0.52204585", "0.52079713", "0.5141566", "0.51374596", "0.5120156", "0.5113088", "0.5112671", "0.51031923", "0.5055932", "0.5039854",...
0.5870693
1
Takes in a board configuration, and returns whether the trap shoot a projectile or not
def shootProjectile(configuration): leftData, rightData = getArrowData(configuration) return leftData[0] > 0 or rightData[0] > 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _hunting_mode(self):\n grid = self._grid\n width, height = grid.dimensions()\n valid_shot = False\n while not valid_shot:\n pos = (randint(0, width-1), randint(0, height-1))\n hit = grid.shoot(pos)\n shot = hit.cell\n valid_shot = shot not...
[ "0.59383273", "0.5887228", "0.5659388", "0.5631519", "0.5606418", "0.5595462", "0.55769604", "0.55054677", "0.55002385", "0.54865503", "0.54664403", "0.54484254", "0.54484254", "0.54370457", "0.54236126", "0.5422462", "0.5422462", "0.5405603", "0.54010975", "0.5392141", "0.53...
0.75236654
0
Grabs request kwargs that will be needed for the endpoint. Configures the cert args. These will point to the paths for the TLS cert/key files, which change based on the environment being targetted. Possibly also includes a value that is either a boolean that indicates if the TLS certs should be verified, or a path to c...
def get_cert_kwargs(self) -> RequestKwargsType: kwargs: RequestKwargsType = {} if is_local(env=self.milmove_env): kwargs.update(deepcopy(LOCAL_TLS_CERT_KWARGS)) else: kwargs["cert"] = DP3_CERT_KEY_PEM if "verify" in kwargs and not kwargs["verify"]: u...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _Args(parser,\n include_l7_internal_load_balancing=False,\n support_managed_certs=False):\n parser.add_argument(\n '--description',\n help='An optional, textual description for the SSL certificate.')\n\n parser.display_info.AddCacheUpdater(\n flags.SslCertificatesCompleterBet...
[ "0.5983727", "0.59767306", "0.565707", "0.56561816", "0.5607078", "0.54756844", "0.54674166", "0.5447651", "0.54042596", "0.53222626", "0.5314911", "0.5300737", "0.52995116", "0.52692866", "0.52478945", "0.52375144", "0.5212041", "0.52114266", "0.5193619", "0.51902044", "0.51...
0.71141267
0
Generate a url for the provided host. The ports can be overridden with `LOCAL_PORT` and `LOCAL_PRIME_PORT` environment variables. If `BASE_DOMAIN` is set, that is returned.
def base_url(self, request_host: RequestHost) -> str: if base_domain := os.getenv("BASE_DOMAIN"): return base_domain local_port = os.getenv("LOCAL_PORT", "8080") local_protocol = "http" if request_host == RequestHost.PRIME: local_protocol = "https" lo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _form_base_url(\n self,\n deployed_subdomain: str = \"\",\n local_port: str = \"\",\n local_protocol: str = \"\",\n local_subdomain: str = \"\",\n ) -> str:\n if base_domain := os.getenv(\"BASE_DOMAIN\"):\n return base_domain\n\n if not is_local(en...
[ "0.71644074", "0.70389444", "0.7028961", "0.68531275", "0.68334365", "0.6815332", "0.6773702", "0.6721116", "0.666645", "0.6588413", "0.65780807", "0.6577354", "0.65517247", "0.65190667", "0.64845145", "0.6426308", "0.6396552", "0.63881594", "0.63243836", "0.63120204", "0.629...
0.7286316
0
Get a characteristic by iid.
def get_char_by_iid(self, iid: int) -> Characteristic | None: return self.characteristics.get(iid)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_characteristic(self, uuid):\n for char in self.list_characteristics():\n if char.uuid == uuid:\n return char\n return None", "def cid(id, get):\n return get(to_id(id))", "def characteristic(self):\n raise NotImplementedError('characteristic()')", "de...
[ "0.64852625", "0.63440585", "0.596877", "0.59676594", "0.5763151", "0.571912", "0.57088065", "0.56275076", "0.559304", "0.5519418", "0.5493551", "0.5417802", "0.5386418", "0.5377989", "0.53447205", "0.53318614", "0.53054124", "0.52991486", "0.5298759", "0.5285843", "0.5274938...
0.778612
0
Iterate over samples in dataset.
def __iter__(self): for sample in self.data: yield sample
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __iter__(self):\n for sample in self.samples:\n yield sample", "def data_iterator(self, ithFileReader):\n print('data_iterator', ithFileReader, threading.current_thread())\n while True:\n sampX, sampY = self.sampleTrain(ithFileReader) if self.config.is_train else self.sampleV...
[ "0.7399169", "0.7134551", "0.7041896", "0.6968149", "0.6951962", "0.6897533", "0.686749", "0.67310685", "0.66773194", "0.6667706", "0.6627435", "0.6604743", "0.6515866", "0.6486137", "0.6450154", "0.6434641", "0.6380018", "0.6375905", "0.6366195", "0.63489115", "0.6339575", ...
0.7762991
0
Save binary data to disk.
def _save_binary(file_name, data): with open(file_name, "wb") as f: cp.dump(data, f)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save(self, data):\n self.write(data)", "def _save(self, data: PIL.Image) -> None:\n with self._fs.open(self._filepath, mode=\"wb\") as f:\n data.save(f)", "def write_to_disk(self):\n text_file = open(self.file_path, \"w\")\n text_file.write(str(self))\n text_fi...
[ "0.75135845", "0.71439445", "0.69184995", "0.69170576", "0.68785876", "0.6877843", "0.68176526", "0.6748483", "0.67296904", "0.67230296", "0.6664535", "0.66627365", "0.66596985", "0.66102505", "0.6606599", "0.65841603", "0.65654653", "0.6519212", "0.6503923", "0.64998066", "0...
0.75111055
1
Get a tuple of information needed from bug This tuple is ordered as listed in the fieldnames tuple, defined previously
def get_bug_info_tuple(a_bug): bugInfo = a_bug.bug bugInfoId = bugInfo.id # NOTE: user input fields, such as "title" might include # non-ascii char, so MUST NOT encode to UTF bugInfoTitle = bugInfo.title bugImportance = a_bug.importance.encode('utf-8') bugStatus = a_bug.status.encode('utf-...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extractFields(deerfootRDDRecord):\n fieldsList = deerfootRDDRecord.split(\",\")\n return (fieldsList[0], [fieldsList[1], fieldsList[15], fieldsList[46]])", "def get_info_in_tuple(self):\r\n return self.key, self.value, self.get_color(), self.size_tree", "def _th_fields():\n return (\n ...
[ "0.58118415", "0.5758341", "0.5733123", "0.568874", "0.5579257", "0.5577574", "0.5548771", "0.5540192", "0.5438658", "0.5416835", "0.53957623", "0.53943574", "0.5382766", "0.53750825", "0.5359458", "0.5358601", "0.5358601", "0.53574497", "0.5352655", "0.53455436", "0.5342749"...
0.71683997
0
Ask a yes/no question via raw_input() and return their answer. "question" is a string that is presented to the user. "default" is the presumed answer if the user just hits . It must be "yes" (the default), "no" or None (meaning an answer is required of the user). The "answer" return value is True for "yes" or False for...
def query_yes_no(question, default="no"): valid = {"yes": True, "y": True, "ye": True, "no": False, "n": False} if default is None: prompt = " [y/n] " elif default == "yes": prompt = " [Y/n] " elif default == "no": prompt = " [y/N] " else: raise ValueErro...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def query_yes_no(question, default=\"yes\"):\n valid = {\"yes\":\"yes\", \"y\":\"yes\", \"ye\":\"yes\",\n \"no\":\"no\", \"n\":\"no\"}\n if default == None:\n prompt = \" [y/n] \"\n elif default == \"yes\":\n prompt = \" [Y/n] \"\n elif default == \"no\":\n promp...
[ "0.85033333", "0.8498421", "0.8495875", "0.84875906", "0.8485411", "0.84813416", "0.84813416", "0.84813416", "0.84813416", "0.84813416", "0.8480776", "0.8480101", "0.8478754", "0.8478754", "0.8478754", "0.8478754", "0.8478754", "0.8478754", "0.8478754", "0.8478754", "0.847854...
0.85266125
0
Get bugs from project[starlingx], extract relevant information and write to a csv file, if a csv file has been previously made on the same date then prompt the user on whether to overwrite it
def bugs_to_csv(promptArgs=False): username = os.environ['USER'] cachedir = "/tmp/" + username + "/.cache/.launchpadlib" anon_or_auth = 'anon_' if promptArgs is False: launchpad = Launchpad.login_anonymously( 'anonymously', 'production', cachedir, version='devel') # Clear crede...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\n\n # Script arguments... \n \"\"\" If running as standalone, hardcode theWorkspace and inFile \"\"\"\n theWorkspace = arcpy.GetParameterAsText(0)\n if not theWorkspace:\n theWorkspace = r\"d:\\_dataTest\"\n arcpy.env.workspace = theWorkspace\n arcpy.env.overwriteOutput = True\t\n\n inFil...
[ "0.5899088", "0.58329207", "0.57272035", "0.56233925", "0.56073785", "0.5601764", "0.5591777", "0.55844957", "0.55769664", "0.5548336", "0.55474854", "0.5498335", "0.5458065", "0.5452073", "0.5444459", "0.5443819", "0.5441236", "0.5441096", "0.5435781", "0.54045826", "0.53926...
0.67617875
0
Plots a dumped tail
def plot_tail(infile): # Read file xs, ys = {}, {} for line in infile: fields = line.split() run = int(fields[0]) time = float(fields[1]) running = int(fields[2]) if run not in xs: xs[run] = [] ys[run] = [] xs[run].append(time) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot(self):\n pass", "def drawPeekScrubber(self):\r\n self.c.delete(\"peekScrubber\")\r\n x = self.plot(self.peekTime,0)[0]\r\n self.c.create_line(x,0,x,self.h,fill=\"#666666\",tags=(\"peekScrubber\"))\r\n self.c.create_text(x+3,self.h-1,text=\"\", anchor = tk.SW,tags=(\"pe...
[ "0.5739749", "0.57097304", "0.5571888", "0.5547158", "0.5533651", "0.54536384", "0.5427824", "0.54238564", "0.54173416", "0.54132074", "0.54125285", "0.53828454", "0.5381655", "0.53748804", "0.5373606", "0.5352768", "0.5330561", "0.53283775", "0.53229797", "0.53101003", "0.53...
0.62833184
0
Create a new product and initial provisioning artifact (version). Arguments mirror the boto3 "create_product" API call, link below. Returns a Product object
def create(cls, **kwargs): response = cls.get_client().create_product(**kwargs) object_details = cls._flatten_object_details(response) return cls(**object_details)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_product(self):\n product = self.product_obj.create({\n \"default_code\": 'A2330',\n \"product_tmpl_id\":\n self.ref(\"product.product_product_4_product_template\"),\n \"attribute_value_ids\": [(6, 0, [\n self.ref('product.product_attribut...
[ "0.736474", "0.7065725", "0.6952491", "0.6664723", "0.66583896", "0.6298567", "0.6219104", "0.61484075", "0.6132532", "0.6075975", "0.5992252", "0.58668363", "0.58562493", "0.5805281", "0.5792189", "0.5790919", "0.5752445", "0.5726109", "0.57234776", "0.5683488", "0.567517", ...
0.713296
1
Load profile page and all async content
def load_profile_page(self, url='', user=None): if user: url = 'http://www.linkedin.com/in/' + user if 'com/in/' not in url and 'sales/gmail/profile/proxy/' not in url: raise ValueError( "Url must look like... .com/in/NAME or... '.com/sales/gmail/profile/proxy/EMA...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def profile():\n \n return render_template(\"profile.html\")", "def _load_profile(self, profile_name, cwd):\n\n profile_path = self.get_profile_path(profile_name, cwd)\n try:\n text = load_user_encoded(profile_path)\n except Exception as e:\n raise ConanExcepti...
[ "0.6262455", "0.6207622", "0.6018543", "0.601736", "0.5955579", "0.59222716", "0.5888337", "0.5866701", "0.58351237", "0.5736886", "0.5731209", "0.5688295", "0.5645998", "0.5638484", "0.5630793", "0.556826", "0.55601317", "0.5551558", "0.5527035", "0.5520383", "0.5514821", ...
0.6585661
0
Sort collection by default.
def sort_default(self, collection: TVCollection) -> TVCollection: res = collection.sort( [ (sort.name, -1 if sort.meta["default"] == "desc" else 1) for sort in self.default ], ) return res
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sort_by_default(self):\n self.data.sort()", "def sortby(self):\n ...", "def sorted(self): \n pass", "def sort(self):\n # sort the contents of the container alphabetically\n # this is done automatically whenever an item is added/removed from the Container\n self.i...
[ "0.8187675", "0.68111694", "0.6741239", "0.66326994", "0.6548276", "0.65113914", "0.6478629", "0.6418985", "0.6362281", "0.6349284", "0.63399464", "0.63165575", "0.6301031", "0.6301031", "0.6299065", "0.6228192", "0.6205299", "0.6204499", "0.61763424", "0.6158741", "0.61416",...
0.8765005
0
Tests whether ``validate_archived_at`` works as intended.
def test__validate_archived_at__0(): archived_at = DateTime(2016, 9, 9) for input_parameter, expected_output in ( (None, None), (archived_at, archived_at), ): output = validate_archived_at(input_parameter) vampytest.assert_is(output, expected_output)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_archive(self):\n\t\t# refresh the archive pool searches\n\t\tself.pool_search(refresh=True)\n\t\tif self.status == 'archived':\n\t\t\treturn True\n\t\treturn False", "def test__validate_archived_at__1():\n for input_parameter in (\n 12.6,\n ):\n with vampytest.assert_raises(TypeE...
[ "0.6989097", "0.64016664", "0.63086104", "0.6056546", "0.58871317", "0.58218855", "0.57815963", "0.57815963", "0.5774006", "0.56341404", "0.56287056", "0.5590659", "0.5590365", "0.55736464", "0.5564433", "0.55396247", "0.55396247", "0.55396247", "0.548027", "0.5474628", "0.54...
0.7679563
0
Test type builder builds correct model for simple class.
def test_type_builder_builds_correct_model_for_simple_class(): schema = [ SchemaObject( name="TestClass", properties=[ SchemaValue(name="stringValue", value_type="string"), SchemaValue(name="booleanValue", value_type="boolean"), SchemaV...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_model():", "def build_model(self):\n pass", "def build_model(self):\n pass", "def test_build_model(arguments):\n ...", "def _build_model(self, **kwargs):\n pass", "def test_generate_data_model():\n params = dict(name=\"test\", type_=str, is_required=True)\n\n data_...
[ "0.6480909", "0.64476705", "0.64476705", "0.63106567", "0.62773955", "0.61948776", "0.612976", "0.60873234", "0.6062388", "0.6038418", "0.5997456", "0.5981819", "0.5951964", "0.5946204", "0.5930419", "0.57800007", "0.57800007", "0.57701176", "0.5723253", "0.5686171", "0.56795...
0.76730573
0
Test type builder handles reference types correctly.
def test_type_builder_handles_reference_types(): schema = [ SchemaObject( name="ObjectA", properties=[SchemaReference(name="refB", reference="ObjectB")], ), SchemaObject( name="ObjectB", properties=[SchemaReference(name="refC", reference="Objec...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_type_builder_handles_optional_references():\n schema = [\n SchemaObject(\n name=\"ObjectA\",\n properties=[\n SchemaAnyOf(\n name=\"refB\",\n any_of=[\n SchemaReference(name=\"refB\", reference=\"Ob...
[ "0.68167263", "0.6634519", "0.6514114", "0.6206478", "0.612794", "0.61116755", "0.6040937", "0.6003472", "0.5952233", "0.5922092", "0.5803333", "0.5774571", "0.5761711", "0.56932217", "0.569078", "0.56899565", "0.56245303", "0.55785936", "0.5539504", "0.5478787", "0.54731476"...
0.7793226
0
Test type builder handles enums correctly.
def test_type_builder_handles_enums(): schema = [ SchemaObject( name="ClassWithEnums", properties=[ SchemaValue(name="string_value", value_type="string"), SchemaEnum( name="enumValue", value_type="string", ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_type_builder_handles_top_level_enumerations():\n schema = [\n SchemaEnum(name=\"TestEnum\", value_type=\"string\", values=[\"a\", \"b\", \"c\"]),\n ]\n\n build_result = build_types(schema)\n\n assert len(build_result) == 1\n assert build_result[0] == EnumDefinition(\n name=\"T...
[ "0.7648016", "0.7529595", "0.7135543", "0.67518234", "0.6666614", "0.64597905", "0.6453124", "0.6445864", "0.6361293", "0.6341611", "0.62588716", "0.61347663", "0.60774076", "0.60348624", "0.5964102", "0.59489006", "0.5923641", "0.5911541", "0.58989185", "0.5886955", "0.58546...
0.78581923
0
Test type builder handles nested properties correctly.
def test_type_builder_handles_nested_properties(): schema = [ SchemaObject( name="ClassWithNestedClass", properties=[ SchemaObject( name="nestedValue", properties=[ SchemaValue(name="string_value", value_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_type_builder_builds_correct_model_for_simple_class():\n schema = [\n SchemaObject(\n name=\"TestClass\",\n properties=[\n SchemaValue(name=\"stringValue\", value_type=\"string\"),\n SchemaValue(name=\"booleanValue\", value_type=\"boolean\"),\n ...
[ "0.6363378", "0.6203337", "0.619625", "0.60313326", "0.5692115", "0.56552374", "0.5647463", "0.5611493", "0.55748177", "0.55478144", "0.55398494", "0.5523354", "0.5470946", "0.5443522", "0.5416812", "0.5393458", "0.5342892", "0.529115", "0.5270347", "0.5256726", "0.5242227", ...
0.7325719
0
Test type builder handles all of references.
def test_type_builder_handles_all_of_references(): schema = [ SchemaObject( name="ClassWithAllOf", properties=[ SchemaAllOf( name="authorValue", all_of=[ SchemaReference(name="", reference="ReferencedObje...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_type_builder_handles_reference_types():\n schema = [\n SchemaObject(\n name=\"ObjectA\",\n properties=[SchemaReference(name=\"refB\", reference=\"ObjectB\")],\n ),\n SchemaObject(\n name=\"ObjectB\",\n properties=[SchemaReference(name=\"r...
[ "0.72077197", "0.6180052", "0.59246975", "0.59140575", "0.5786114", "0.5724182", "0.57107115", "0.5656812", "0.5637608", "0.56317145", "0.55415297", "0.5524211", "0.5517098", "0.5511798", "0.5498797", "0.5450148", "0.5441154", "0.5417316", "0.5417271", "0.5399191", "0.5396085...
0.6554704
1
Test that type builder handles arrays.
def test_type_builder_handles_arrays(): schema = [ SchemaObject( name="ClassWithAllOfArray", properties=[ SchemaArray( name="authorsArray", item=SchemaAllOf( name="", all_of=[ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_array() -> None:\n soup = generate_case(\"array\")\n\n tests.html_schema_doc_asserts.assert_property_names(soup, [\"fruits\", \"vegetables\", \"veggieName\", \"veggieLike\"])\n tests.html_schema_doc_asserts.assert_descriptions(\n soup,\n [\n \"A schema with an array\",\n ...
[ "0.7298947", "0.6932292", "0.67842996", "0.671393", "0.67056787", "0.6682851", "0.6587218", "0.6566467", "0.65549946", "0.65135974", "0.64931595", "0.6482682", "0.64587486", "0.6384035", "0.63399327", "0.633224", "0.6325299", "0.63200325", "0.6264428", "0.6258482", "0.6241235...
0.7177646
1
Test type builder handles toplevel enumerations.
def test_type_builder_handles_top_level_enumerations(): schema = [ SchemaEnum(name="TestEnum", value_type="string", values=["a", "b", "c"]), ] build_result = build_types(schema) assert len(build_result) == 1 assert build_result[0] == EnumDefinition( name="TestEnum", values=[("A", "...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_type_builder_handles_enums():\n schema = [\n SchemaObject(\n name=\"ClassWithEnums\",\n properties=[\n SchemaValue(name=\"string_value\", value_type=\"string\"),\n SchemaEnum(\n name=\"enumValue\",\n value_...
[ "0.65536827", "0.650204", "0.6138389", "0.589367", "0.5879099", "0.57479244", "0.55953723", "0.52773035", "0.52739215", "0.5156289", "0.5142459", "0.511223", "0.5085341", "0.50683576", "0.5045032", "0.50173175", "0.4993233", "0.49732727", "0.4959621", "0.494422", "0.4915118",...
0.7900883
0
Test type builder handles enumerations with uppercase values.
def test_type_builder_handles_enumerations_with_uppercase_values(): schema = [ SchemaEnum( name="UppercaseEnum", value_type="string", values=["HELLO_WORLD", "UPPERCASE_VALUE", "SOME_VALUE"], ), ] build_result = build_types(schema) assert len(build_re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_type_builder_handles_top_level_enumerations():\n schema = [\n SchemaEnum(name=\"TestEnum\", value_type=\"string\", values=[\"a\", \"b\", \"c\"]),\n ]\n\n build_result = build_types(schema)\n\n assert len(build_result) == 1\n assert build_result[0] == EnumDefinition(\n name=\"T...
[ "0.7376189", "0.68966943", "0.6550582", "0.62952274", "0.62109876", "0.6128571", "0.5882104", "0.5880967", "0.5828075", "0.5760271", "0.57464004", "0.5725687", "0.57232326", "0.5710865", "0.57066786", "0.56686485", "0.5667711", "0.5614356", "0.55988294", "0.5597305", "0.55899...
0.83597606
0
Test type builder handles optional references.
def test_type_builder_handles_optional_references(): schema = [ SchemaObject( name="ObjectA", properties=[ SchemaAnyOf( name="refB", any_of=[ SchemaReference(name="refB", reference="ObjectB"), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_type_builder_handles_reference_types():\n schema = [\n SchemaObject(\n name=\"ObjectA\",\n properties=[SchemaReference(name=\"refB\", reference=\"ObjectB\")],\n ),\n SchemaObject(\n name=\"ObjectB\",\n properties=[SchemaReference(name=\"r...
[ "0.66550344", "0.65000653", "0.59191287", "0.58576053", "0.57488626", "0.573702", "0.5667784", "0.5606027", "0.559241", "0.557928", "0.55759054", "0.55078894", "0.54741454", "0.5430636", "0.53924775", "0.5372546", "0.5354323", "0.5344985", "0.5306167", "0.52822375", "0.524973...
0.7671036
0
Test type builder resolves union types to Any.
def test_type_builder_resolves_union_types_to_any(): schema = [ SchemaObject( name="ObjectA", properties=[ SchemaAnyOf( name="refB", any_of=[ SchemaReference(name="refB", reference="ObjectB"), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_type_builder_builds_correct_model_for_simple_class():\n schema = [\n SchemaObject(\n name=\"TestClass\",\n properties=[\n SchemaValue(name=\"stringValue\", value_type=\"string\"),\n SchemaValue(name=\"booleanValue\", value_type=\"boolean\"),\n ...
[ "0.6010319", "0.58796465", "0.5723728", "0.5711555", "0.5564463", "0.546056", "0.54255366", "0.5421329", "0.5323494", "0.5316395", "0.5297985", "0.52913475", "0.52213854", "0.52211607", "0.520008", "0.51757437", "0.5172881", "0.5150928", "0.5150443", "0.51475406", "0.5128644"...
0.79029334
0
Test type builder handles specific noncamel case property names.
def test_type_builder_handles_specific_non_camel_case_property_names(): schema = [ SchemaObject( name="NonStandardObject", properties=[ SchemaValue(name="baseURL", value_type="string"), SchemaValue(name="DEFAULTS", value_type="any"), Sc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_option_case_is_preserved(self):\n self.assertEqual(self.config.get('names','Name1'),'Peter')\n self.assertEqual(self.config.get('names','name1'),'John')", "def test_casing(self):\n char = Character(type=['Fish', 'Great Ape'])\n assert char.type_key == 'fish'", "def test_cam...
[ "0.62754804", "0.6014975", "0.5986442", "0.59445244", "0.5930179", "0.57807136", "0.5736961", "0.5725225", "0.54955155", "0.54841685", "0.54831934", "0.54281175", "0.5423904", "0.54008615", "0.5372442", "0.5359868", "0.5341353", "0.5334772", "0.5330536", "0.53248775", "0.5306...
0.800485
0
Test type builder raises an exception on invalid schema item type.
def test_type_builder_raises_exception_on_invalid_schema_item_type(): class UnknownSchemaItem(SchemaItem): pass schema = [ SchemaObject( name="FakeObject", properties=[UnknownSchemaItem(name="objectUnknown")] ) ] with pytest.raises(ValueError): _ = build_ty...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_new_invalid(self) -> None:\n with pytest.raises(TypeError) as excinfo:\n RunwayTestDefinition({}) # type: ignore\n assert str(excinfo.value).startswith(\"expected data of type\")", "def test_type_validation(self):\r\n with self.assertRaises(ValidationError):\r\n ...
[ "0.6674543", "0.64304537", "0.6413563", "0.63524705", "0.61713845", "0.6127768", "0.6121685", "0.6114068", "0.6098547", "0.60867286", "0.60819155", "0.6056852", "0.59863347", "0.5961261", "0.59597754", "0.59593904", "0.5938577", "0.5929641", "0.5915313", "0.58979434", "0.5883...
0.8269641
0
Converts the given RPC message to a POSTable JSON dict.
def rpc_to_json(rpc_message): return json.loads(protojson.encode_message(rpc_message))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def message_to_dict(message):\n return json.loads(protojson.encode_message(message))", "def message_to_dict(message):\n return json.loads(protojson.encode_message(message))", "def jsonish_dict_to_rpc(dictionary, rpc_message_type):\n return protojson.decode_message(rpc_message_type, json.dumps(dictionary))...
[ "0.6960539", "0.6955927", "0.6923632", "0.6605717", "0.6366775", "0.63543886", "0.6229117", "0.62070465", "0.5897849", "0.58570504", "0.5847559", "0.58166486", "0.5795962", "0.5753596", "0.5634795", "0.5491812", "0.5491645", "0.54751474", "0.5469701", "0.5439593", "0.5434413"...
0.7859286
0
Converts the given dict to the specified RPC message type.
def jsonish_dict_to_rpc(dictionary, rpc_message_type): return protojson.decode_message(rpc_message_type, json.dumps(dictionary))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dict_to_protobuf(pb_klass_or_instance, values, type_callable_map=REVERSE_TYPE_CALLABLE_MAP, \\\n strict=True):\n if isinstance(pb_klass_or_instance, Message):\n instance = pb_klass_or_instance\n else:\n instance = pb_klass_or_instance()\n return _dict_to_protobuf(instance, values, typ...
[ "0.59661853", "0.59508383", "0.5746402", "0.554897", "0.5537649", "0.5505145", "0.54154176", "0.53781706", "0.5371065", "0.53386545", "0.52916396", "0.5250316", "0.52203095", "0.52121514", "0.521025", "0.521025", "0.521025", "0.5125412", "0.51159817", "0.5103396", "0.5082758"...
0.74348843
0
Valida URL, metodo regex
def validaURL(url: AnyStr) -> bool: return re.compile(patternURL).search(url) != None # Linea 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def IsValidURL(s):\n return RE_COMPLEX_URL.match(s)", "def validateURL(url):\n pattern = re.compile(\"^https*:\\/\\/\\w+(\\.\\w+){2}[\\/A-Za-z\\d\\?\\=]*$\")\n match = pattern.match(url)\n\n return True if match else False", "def validate_url(url):\n\n RE_D = re.compile(r'^(http:\\/\\/www\\.|https...
[ "0.8117477", "0.78844273", "0.78397477", "0.78119373", "0.7724845", "0.76031137", "0.75921714", "0.7587496", "0.75508994", "0.75342757", "0.75175005", "0.75038606", "0.749331", "0.7491576", "0.7467064", "0.7456615", "0.7450233", "0.7410004", "0.74003667", "0.7387946", "0.7379...
0.8143868
0
update the feature table in feature.db according the `feature_definition` file
def __update_feature_table_columns(self): self.__init_table() feature_dict_sorted_keys = feature_extractor_definition.keys() feature_dict_sorted_keys.sort() for key in feature_dict_sorted_keys: if not self.__has_feature_column(key): self.__add_feature_column(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _add_new_struct_to_existing_database(self, db, filename):\n\n pass", "def update_feature(self, dataset, fid, feature):\n uri = URITemplate(\n self.baseuri + '/{owner}/{did}/features/{fid}').expand(\n owner=self.username, did=dataset, fid=fid)\n return self.sessi...
[ "0.6128839", "0.59243894", "0.58003026", "0.5780193", "0.5721147", "0.5707873", "0.5691251", "0.56372917", "0.5597529", "0.5596243", "0.5583623", "0.55583984", "0.55456954", "0.5473877", "0.5471311", "0.5468415", "0.544526", "0.5439431", "0.5432106", "0.54298174", "0.53933895...
0.6273792
0
return non numeric column in dataframe
def get_non_num_cols(df): numerics = ['number'] newdf = df.select_dtypes(exclude=numerics).columns return newdf
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def numerical(df):\r\n numerical_var=df.select_dtypes(include =['float64','int64']).columns.tolist()\r\n return numerical_var", "def identify_numeric_columns(dataset):\n return identify_columns_by_type(dataset, include=['int64', 'float64'])", "def inspect_dtype_object(self, column: str) -> str:\n\n ...
[ "0.7147277", "0.65108675", "0.63865304", "0.6351604", "0.62760025", "0.62314975", "0.6205256", "0.61112845", "0.60901576", "0.6041115", "0.5985445", "0.5967104", "0.59248316", "0.59045786", "0.5886591", "0.5856081", "0.5848447", "0.5847602", "0.58168775", "0.5803098", "0.5800...
0.73295027
0
for each non numeric colum say X, take all value of that column, Y, and Z; we create column X_Y, and X_Z and remove column X. and insert values 0, or 1 saying ith row is equal to Y, or Z. this funcoitn removes all previous columsn X
def expand_cat_cols_rmv_all(df,exclude=None): cols=get_non_num_cols(df) for col in cols: if exclude==None or( not exclude == None and not col in exclude): vals = df[col].unique() for val in vals: new_col_name=col + "_" +val df[new_col_name]=int(df...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _fix_uniq_col(self):\n # subgradient; for two boolean arrays, multiplication seems to be the best way \n # (equivalent to logical_and)\n n_covered_col = self.a_csr.dot(np.ones(self.ncols)) \n ifix = np.zeros(self.ncols, dtype=bool)\n if (np.count_nonzero(n_covered_col) != sel...
[ "0.5856376", "0.57999414", "0.5653565", "0.5502844", "0.5488146", "0.5476521", "0.5447637", "0.5425762", "0.5381206", "0.5362524", "0.5328812", "0.53196234", "0.5311776", "0.52622557", "0.5251198", "0.5248831", "0.52471286", "0.5225482", "0.5224901", "0.5224612", "0.52196705"...
0.63553303
0
for each non numeric colum say X, take all value of that column, Y, and Z; we create column X_Y, and X_Z and remove column X. and insert values 0, or 1 saying ith row is equal to Y, or Z. this doesn't delete all column, only in rmv list
def expand_cat_cols_rmv_cols(df,rmv=None,exclude=None): cols=get_non_num_cols(df) for col in cols: if exclude==None or( not exclude == None and not col in exclude): vals = df[col].unique() for val in vals: new_col_name=col + "_" +val df[new_col_n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def expand_cat_cols_rmv_all(df,exclude=None):\n cols=get_non_num_cols(df)\n for col in cols:\n if exclude==None or( not exclude == None and not col in exclude):\n vals = df[col].unique()\n for val in vals:\n new_col_name=col + \"_\" +val\n df[new_co...
[ "0.6466997", "0.5629979", "0.55555004", "0.5472776", "0.5420885", "0.5383934", "0.53821456", "0.5256354", "0.524634", "0.51892024", "0.5180312", "0.5165463", "0.5163519", "0.5139974", "0.51307935", "0.51195717", "0.50966454", "0.508539", "0.50837415", "0.50780773", "0.5069798...
0.6152258
1
Creates a protobuf request for a CreateInstance request.
def _prepare_create_request(instance): parent_name = ('projects/' + instance._client.project) message = messages_v2_pb2.CreateInstanceRequest( parent=parent_name, instance_id=instance.instance_id, instance=data_v2_pb2.Instance( display_name=instance.display_name, ), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _MakeCreateRequest(args, messages, resources, project,\n future_reservation_ref):\n future_reservation = util.MakeFutureReservationMessageFromArgs(\n messages, resources, args, future_reservation_ref)\n future_reservation.description = args.description\n future_reservation.namePre...
[ "0.6485491", "0.63807887", "0.6208666", "0.6208666", "0.61256814", "0.60808444", "0.60808444", "0.60808444", "0.60808444", "0.60808444", "0.60808444", "0.60808444", "0.60808444", "0.60808444", "0.60808444", "0.60808444", "0.60808444", "0.60808444", "0.60808444", "0.60808444", ...
0.7608222
0
Convert a serialized "google.protobuf.Any" value to actual type.
def _parse_pb_any_to_native(any_val, expected_type=None): if expected_type is not None and expected_type != any_val.type_url: raise ValueError('Expected type: %s, Received: %s' % ( expected_type, any_val.type_url)) container_class = _TYPE_URL_MAP[any_val.type_url] return container_class....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_any_pb(pb_type, any_pb):\n msg = pb_type()\n if not any_pb.Unpack(msg):\n raise TypeError(\n 'Could not convert {} to {}'.format(\n any_pb.__class__.__name__, pb_type.__name__))\n\n return msg", "def _ConvertAnyMessage(self, value, message, path):\n if isinst...
[ "0.704799", "0.64894015", "0.6399655", "0.6360937", "0.6241234", "0.60528374", "0.5986902", "0.59579587", "0.5951016", "0.581653", "0.57675856", "0.5659024", "0.5654122", "0.5624027", "0.5538782", "0.5480514", "0.54692847", "0.54607886", "0.543138", "0.5419408", "0.5413813", ...
0.7031966
1
Check if the operation has finished.
def finished(self): if self._complete: raise ValueError('The operation has completed.') operation_name = ( 'operations/%s/locations/%s/operations/%d' % (self._instance.name, self.location_id, self.op_id)) request_pb = operations_pb2.GetOperationRequest(name=o...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_finished():", "def has_finished(self):\n return hasattr(self, '_result') or hasattr(self, '_result_exc')", "def isfinished(self):\n raise NotImplementedError()", "def isFinished():", "def isFinished():", "def isFinished():", "def _is_done(self):\n pass", "def done(self) -...
[ "0.84166205", "0.8009735", "0.7876015", "0.7847323", "0.7847323", "0.7847323", "0.78117514", "0.77427167", "0.76632965", "0.7654347", "0.761229", "0.7597715", "0.75387377", "0.7518146", "0.7516972", "0.75066316", "0.74972355", "0.7490267", "0.7490267", "0.7490267", "0.7467743...
0.80689013
1