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
Test if ith object has at least one attribute value as in values.
def _has_at_least_one_value(self, i, values): for a in values: j = self.attributes.index(a) v = values[a] if self[i][j] == v: return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_attr(self, name):\n return name in self and not self[name] in EMPTY_VALUES", "def _has_values(self, i, values):\n for a in values:\n j = self.attributes.index(a)\n v = values[a]\n if self[i][j] != v:\n return False\n return True", "de...
[ "0.70248365", "0.69457525", "0.6656487", "0.64049226", "0.64049226", "0.63894224", "0.6377084", "0.6371646", "0.6359832", "0.63261044", "0.63092935", "0.6277216", "0.620286", "0.61922383", "0.6173832", "0.6173832", "0.617009", "0.61589897", "0.61460346", "0.61460346", "0.6145...
0.7703603
0
Make and return compound (= original + complementary) context.
def compound(self): complementary_cxt = self.complementary() compound_table = [self.table[i] + complementary_cxt.table[i] for i in range(len(self.objects))] return Context(compound_table, self.objects, self.attributes + com...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def copy(self):\n rv = Context(self.decimal, self.year_mode, self.quantize_interest,\n self.quantize_currency)\n return rv", "def cget_representation_context(representation):\n assert representation is not None, \"This is a bug\"\n\n version, subset, asset, project = cpare...
[ "0.58621174", "0.56428766", "0.5634684", "0.55592126", "0.5528197", "0.5446185", "0.54385996", "0.53360796", "0.5193938", "0.51734984", "0.5138041", "0.51301104", "0.5090778", "0.50727236", "0.5049161", "0.503264", "0.500528", "0.50052077", "0.50011003", "0.4940245", "0.49299...
0.71345913
0
Make random context, useful for testing.
def make_random_context(num_obj, num_att, d): obj_ls = ['g' + str(x) for x in range(num_obj)] att_ls = ['m' + str(x) for x in range(num_att)] table = [[int(d > random.random()) for _ in range(num_att)] for _ in range(num_obj)] return Context(table, obj_ls, att_ls)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def seed():", "def random_state(state):\n old_state = RandomState()\n state.set_global()\n yield\n old_state.set_global()", "def generate_context(self) -> Context:\n self._transient_context = Context()\n return self._transient_context", "def generate_random(self: object) -> None:\n ...
[ "0.6258607", "0.6205847", "0.6091151", "0.5997577", "0.59703875", "0.59703875", "0.58561", "0.58427304", "0.57903767", "0.5789003", "0.578871", "0.578098", "0.5760028", "0.5742718", "0.5738766", "0.5716231", "0.5712584", "0.5712584", "0.57073", "0.57063144", "0.5705966", "0...
0.7311829
0
Testing list of reported events with limit
def test_limit(self) -> None: channel = self.make_request( "GET", self.url + "?limit=5", access_token=self.admin_user_tok, ) self.assertEqual(200, channel.code, msg=channel.json_body) self.assertEqual(channel.json_body["total"], 20) self.asse...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testMoreEvents(self):\n splitter = SplitterFactory()\n jobFactory = splitter(self.singleFileSubscription)\n\n jobGroups = jobFactory(events_per_job=1000,\n performance=self.performanceParams)\n\n self.assertEqual(len(jobGroups), 1)\n\n self.asser...
[ "0.67866373", "0.6778284", "0.6770849", "0.67432696", "0.6477754", "0.6274708", "0.6200425", "0.6163394", "0.61155015", "0.6108119", "0.609398", "0.60556704", "0.60327744", "0.6014211", "0.59874356", "0.5962993", "0.59364414", "0.5924628", "0.5863921", "0.58372223", "0.583410...
0.71334475
0
Testing list of reported events with a defined starting point and limit
def test_limit_and_from(self) -> None: channel = self.make_request( "GET", self.url + "?from=5&limit=10", access_token=self.admin_user_tok, ) self.assertEqual(200, channel.code, msg=channel.json_body) self.assertEqual(channel.json_body["total"], 20) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def events_between(self, starting_measure, starting_offset, ending_measure, ending_offset):\n output_events = []\n for i in range(starting_measure - 1, ending_measure - 1 + 1):\n for event in self.event_groups[i].events:\n if i == starting_measure - 1:\n i...
[ "0.62582815", "0.62312603", "0.6084364", "0.60386384", "0.60299057", "0.5983324", "0.59013546", "0.5806697", "0.5779787", "0.5741872", "0.57410085", "0.5736532", "0.57252514", "0.5719931", "0.5711772", "0.5692633", "0.5652234", "0.5635039", "0.5623844", "0.5592603", "0.558614...
0.6490504
0
Testing list of reported events with a filter of room
def test_filter_room(self) -> None: channel = self.make_request( "GET", self.url + "?room_id=%s" % self.room_id1, access_token=self.admin_user_tok, ) self.assertEqual(200, channel.code, msg=channel.json_body) self.assertEqual(channel.json_body["total...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_filter_user_and_room(self) -> None:\n\n channel = self.make_request(\n \"GET\",\n self.url + \"?user_id=%s&room_id=%s\" % (self.other_user, self.room_id1),\n access_token=self.admin_user_tok,\n )\n\n self.assertEqual(200, channel.code, msg=channel.json...
[ "0.70420647", "0.65640336", "0.6479507", "0.6427254", "0.63308644", "0.61916304", "0.61171573", "0.60622156", "0.5943582", "0.5896896", "0.57922286", "0.5764191", "0.57424766", "0.5734207", "0.5713547", "0.56532145", "0.5650365", "0.5642602", "0.56422746", "0.562086", "0.5620...
0.7759454
0
Testing list of reported events with a filter of user
def test_filter_user(self) -> None: channel = self.make_request( "GET", self.url + "?user_id=%s" % self.other_user, access_token=self.admin_user_tok, ) self.assertEqual(200, channel.code, msg=channel.json_body) self.assertEqual(channel.json_body["tot...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_filter_user_and_room(self) -> None:\n\n channel = self.make_request(\n \"GET\",\n self.url + \"?user_id=%s&room_id=%s\" % (self.other_user, self.room_id1),\n access_token=self.admin_user_tok,\n )\n\n self.assertEqual(200, channel.code, msg=channel.json...
[ "0.6936873", "0.6494265", "0.6479182", "0.64130163", "0.63875455", "0.6339563", "0.6235167", "0.610124", "0.60740095", "0.60681087", "0.603701", "0.6025905", "0.60069674", "0.5936405", "0.59047425", "0.58318835", "0.58245337", "0.58144695", "0.5805334", "0.5790437", "0.578063...
0.73923767
0
Testing list of reported events with a filter of user and room
def test_filter_user_and_room(self) -> None: channel = self.make_request( "GET", self.url + "?user_id=%s&room_id=%s" % (self.other_user, self.room_id1), access_token=self.admin_user_tok, ) self.assertEqual(200, channel.code, msg=channel.json_body) se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_filter_room(self) -> None:\n\n channel = self.make_request(\n \"GET\",\n self.url + \"?room_id=%s\" % self.room_id1,\n access_token=self.admin_user_tok,\n )\n\n self.assertEqual(200, channel.code, msg=channel.json_body)\n self.assertEqual(channe...
[ "0.76308376", "0.6389203", "0.63811326", "0.6315443", "0.6304196", "0.62385494", "0.62282383", "0.60201687", "0.601349", "0.5966037", "0.59357476", "0.58643967", "0.5805025", "0.5805025", "0.5782005", "0.56589717", "0.56469536", "0.56199026", "0.56002545", "0.5592264", "0.553...
0.7921824
0
Testing search order. Order by timestamps.
def test_valid_search_order(self) -> None: # fetch the most recent first, largest timestamp channel = self.make_request( "GET", self.url + "?dir=b", access_token=self.admin_user_tok, ) self.assertEqual(200, channel.code, msg=channel.json_body) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_order(self):\n\n # issue a valid query\n # Assure proper execution, and get results from quilt_history\n o = str(quilt_test_core.call_quilt_script('quilt_submit.py', [\n '-y', 'out_of_order']))\n\n o = self.check_query_and_get_results3(o)\n\n # Check results\n...
[ "0.72361386", "0.6569934", "0.65050995", "0.6474437", "0.6456082", "0.633678", "0.6248746", "0.61275387", "0.61030513", "0.6011395", "0.59952134", "0.589628", "0.5876904", "0.58597946", "0.5856868", "0.58429617", "0.58400095", "0.5835469", "0.5823607", "0.5755642", "0.5755642...
0.73637056
0
Testing that a invalid search order returns a 400
def test_invalid_search_order(self) -> None: channel = self.make_request( "GET", self.url + "?dir=bar", access_token=self.admin_user_tok, ) self.assertEqual(400, channel.code, msg=channel.json_body) self.assertEqual(Codes.INVALID_PARAM, channel.json_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_400_invalid_search(self):\n res = self.client().post('/api/questions/search', json={'search': 'This should fail'})\n res_body = json.loads(res.data)\n\n self.assertEqual(res.status_code, 400)\n self.assertFalse(res_body['success'])\n self.assertEqual(res_body['message'],...
[ "0.75018567", "0.7158932", "0.7119247", "0.70114154", "0.6923285", "0.6917125", "0.6822356", "0.67775583", "0.67404056", "0.67396665", "0.672678", "0.6684986", "0.66496515", "0.6613712", "0.66112727", "0.660449", "0.65978855", "0.65961367", "0.6592199", "0.6565199", "0.656103...
0.7162226
1
Testing that a negative limit parameter returns a 400
def test_limit_is_negative(self) -> None: channel = self.make_request( "GET", self.url + "?limit=-5", access_token=self.admin_user_tok, ) self.assertEqual(400, channel.code, msg=channel.json_body) self.assertEqual(Codes.INVALID_PARAM, channel.json_bo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_exceed_limit_request(self):\n actions.login(ADMIN_EMAIL)\n ids_list = list(range(SkillAggregateRestHandler.MAX_REQUEST_SIZE))\n get_url = '%s?%s' % (self.URL, urllib.urlencode({\n 'ids': ids_list}, True))\n\n response = transforms.loads(self.get(get_url).body)\n ...
[ "0.7617022", "0.7143843", "0.709307", "0.7042369", "0.6976879", "0.6941879", "0.6916557", "0.68980557", "0.6858989", "0.680703", "0.6793832", "0.6782149", "0.67627925", "0.6762043", "0.67223275", "0.6576358", "0.649637", "0.6467667", "0.645585", "0.6455209", "0.6427124", "0...
0.80326337
0
Testing that an invalid `report_id` returns a 400.
def test_invalid_report_id(self) -> None: # `report_id` is negative channel = self.make_request( "GET", "/_synapse/admin/v1/event_reports/-123", access_token=self.admin_user_tok, ) self.assertEqual(400, channel.code, msg=channel.json_body) se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_invalid_report_id(self) -> None:\n\n # `report_id` is negative\n channel = self.make_request(\n \"DELETE\",\n \"/_synapse/admin/v1/event_reports/-123\",\n access_token=self.admin_user_tok,\n )\n\n self.assertEqual(400, channel.code, msg=channel....
[ "0.7850871", "0.6897314", "0.6565259", "0.65553325", "0.6430627", "0.63368964", "0.6311277", "0.6301224", "0.62615025", "0.6256362", "0.62535536", "0.6204354", "0.6088427", "0.60642743", "0.6035252", "0.60337836", "0.6016078", "0.60159826", "0.60128593", "0.59775776", "0.5975...
0.81147087
0
Testing that a not existing `report_id` returns a 404.
def test_report_id_not_found(self) -> None: channel = self.make_request( "GET", "/_synapse/admin/v1/event_reports/123", access_token=self.admin_user_tok, ) self.assertEqual(404, channel.code, msg=channel.json_body) self.assertEqual(Codes.NOT_FOUND, c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_report_id_not_found(self) -> None:\n\n channel = self.make_request(\n \"DELETE\",\n \"/_synapse/admin/v1/event_reports/123\",\n access_token=self.admin_user_tok,\n )\n\n self.assertEqual(404, channel.code, msg=channel.json_body)\n self.assertEqu...
[ "0.80737585", "0.76326716", "0.72465545", "0.7060298", "0.6815434", "0.6761219", "0.656321", "0.6505561", "0.6406881", "0.6399025", "0.63805026", "0.63716185", "0.6366132", "0.6341178", "0.63260156", "0.6313996", "0.63133943", "0.6300672", "0.6275042", "0.6266949", "0.6266460...
0.84145755
0
Testing delete a report.
def test_delete_success(self) -> None: channel = self.make_request( "DELETE", self.url, access_token=self.admin_user_tok, ) self.assertEqual(200, channel.code, msg=channel.json_body) self.assertEqual({}, channel.json_body) channel = self.mak...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_superuser_delete_assessment(self):\n response = self.superuser.delete(self.assessment_report_url)\n self.assertEqual(response.status_code, status.HTTP_204_NO_CONTENT)\n response = self.superuser.get(self.assessment_report_url)\n self.assertEqual(response.status_code, status.HTT...
[ "0.7181926", "0.7076668", "0.70488626", "0.70294976", "0.6937398", "0.6934279", "0.6881542", "0.6798384", "0.67498845", "0.6746264", "0.6628536", "0.6619082", "0.65968037", "0.6595696", "0.6588093", "0.6546987", "0.65190804", "0.64991343", "0.6493712", "0.64831465", "0.646830...
0.7636673
0
Testing that an invalid `report_id` returns a 400.
def test_invalid_report_id(self) -> None: # `report_id` is negative channel = self.make_request( "DELETE", "/_synapse/admin/v1/event_reports/-123", access_token=self.admin_user_tok, ) self.assertEqual(400, channel.code, msg=channel.json_body) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_invalid_report_id(self) -> None:\n\n # `report_id` is negative\n channel = self.make_request(\n \"GET\",\n \"/_synapse/admin/v1/event_reports/-123\",\n access_token=self.admin_user_tok,\n )\n\n self.assertEqual(400, channel.code, msg=channel.jso...
[ "0.8114839", "0.6898392", "0.65659076", "0.6555996", "0.6431462", "0.63372266", "0.6312958", "0.63020974", "0.6263201", "0.62577367", "0.62554604", "0.6206936", "0.60895234", "0.6066999", "0.6037492", "0.6035575", "0.60181403", "0.60166055", "0.60134876", "0.5979885", "0.5976...
0.7851341
1
Testing that a not existing `report_id` returns a 404.
def test_report_id_not_found(self) -> None: channel = self.make_request( "DELETE", "/_synapse/admin/v1/event_reports/123", access_token=self.admin_user_tok, ) self.assertEqual(404, channel.code, msg=channel.json_body) self.assertEqual(Codes.NOT_FOUND...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_report_id_not_found(self) -> None:\n\n channel = self.make_request(\n \"GET\",\n \"/_synapse/admin/v1/event_reports/123\",\n access_token=self.admin_user_tok,\n )\n\n self.assertEqual(404, channel.code, msg=channel.json_body)\n self.assertEqual(...
[ "0.841445", "0.7632993", "0.7246946", "0.70600617", "0.681505", "0.6762001", "0.656388", "0.65051955", "0.6408046", "0.6397647", "0.6379985", "0.6372422", "0.6366025", "0.6340298", "0.63259286", "0.63136077", "0.6312867", "0.6301502", "0.6274185", "0.6266179", "0.6265957", ...
0.80735993
1
run() fetches the game price using information from the command line
def run(): parser = argparse.ArgumentParser(description='Retrieve the latest prices for a specified video game') parser.add_argument('title', help='Title of the game') parser.add_argument('-p', '--platform', help='Platform the game is on') args = parser.parse_args() if (not args.platform): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\n CheckFile(argv)\n bot = Trade()\n count = 0\n bot.period = 20\n while True:\n bot.Pull()\n if count == 0:\n bot.GetLittle()\n if bot.response == None:\n [bot.Sell(i, bot.share[i]) if bot.share[i] >= 1 else None for i in bot.price]\n ...
[ "0.60610706", "0.6005787", "0.59277415", "0.59141546", "0.5859248", "0.5801375", "0.57632864", "0.5726609", "0.57263625", "0.5714792", "0.5714792", "0.5712169", "0.5698735", "0.5679258", "0.5668227", "0.5641781", "0.56235695", "0.5609285", "0.5577383", "0.5566178", "0.5531977...
0.78085846
0
Generate plotlybased stabilization plot from output from find_stable_poles. Arguments
def stabplot(lambda_stab, orders_stab, freq_range=None, frequency_unit='rad/s', damped_freq=False, psd_freq=None, psd_y=None, psd_plot_scale='log', renderer='browser_legacy'): if damped_freq: dampedornot = 'd' omega = np.abs(np.imag(lambda_stab)) else: dampedornot = 'n' omeg...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stabplot(lambd, orders, phi=None, model=None, freq_range=None, frequency_unit='rad/s', damped_freq=False, psd_freq=None, psd_y=None, psd_plot_scale='log', \n renderer=None, pole_settings=None, selected_pole_settings=None, to_clipboard='none', return_ix=False):\n\n \n\n\n # Treat input settings\n if...
[ "0.59795356", "0.59778273", "0.57227975", "0.5714864", "0.5668321", "0.5655379", "0.5626232", "0.560986", "0.5528758", "0.5513254", "0.5480079", "0.54680276", "0.54550433", "0.5433568", "0.5413373", "0.5396023", "0.53728133", "0.5363724", "0.5355438", "0.5349676", "0.53473616...
0.6043595
0
Connects to given host address and port.
def connect(self, host=None, port=None): host = self.host if host is None else host port = self.port if port is None else port self.socket.connect(host, port)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def connect(self, host, port):\n pass", "def connect(self, connection_host, connection_port):\n self.connection.connect((connection_host, connection_port))", "def connect_to_server(host, port) -> socket.SocketIO:\n # Create a TCP/IP socket\n sock = socket.socket(socket.AF_INET, socket.SOCK_...
[ "0.8277495", "0.7886647", "0.76533353", "0.76506543", "0.76097435", "0.7587816", "0.7525606", "0.75252724", "0.75134", "0.7500646", "0.74626714", "0.74174386", "0.735934", "0.7358163", "0.73108876", "0.7268154", "0.7267805", "0.7256103", "0.7247818", "0.7234581", "0.7214534",...
0.827836
0
Send message inside the given file.
def send_file_message(self, filename): data = self._readFile(filename) self.print_debug_message(data) self.socket.send(data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send(self, fileName, message):\n project = e5App().getObject(\"Project\")\n if project.isProjectFile(fileName):\n self.__cooperationClient.sendEditorCommand(\n project.getHash(),\n project.getRelativeUniversalPath(fileName),\n message\n ...
[ "0.7248147", "0.7027971", "0.696669", "0.68094087", "0.67991465", "0.66986513", "0.65315217", "0.6488928", "0.64625514", "0.64422685", "0.64363587", "0.6415983", "0.6381144", "0.62902164", "0.62902164", "0.62902164", "0.62902164", "0.62902164", "0.62902164", "0.62902164", "0....
0.7932562
0
Receive a response from the remote host.
def receive_response(self): return self.socket.receive()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_response(command):\n connection = get_client()\n\n connection.send(command)\n\n data = connection.recv()\n connection.close()\n\n return data", "async def recv(self):\n return await self.receptor.response_queue.get()", "def receive_response(self, private_key, responder_id, msg_tag...
[ "0.6692667", "0.66210544", "0.6615369", "0.6444271", "0.63223696", "0.6285314", "0.62418765", "0.61905557", "0.6184888", "0.6167005", "0.6090777", "0.60867804", "0.6071184", "0.60570836", "0.60519344", "0.6039995", "0.602022", "0.6015102", "0.60061765", "0.59997016", "0.59486...
0.7255923
0
Counts the number of ocurrences of a a category value in a tagged file. Stores the result in a global dictionary.
def countTagsInFile(fname): with open(fname, 'r', encoding='utf-8') as f: for line in f: words = line.split(' ') for w in words: tag = w.split('_')[1].rstrip() cat = tag[0].upper() if tag not in dictionaries[cat]: dictionaries[cat][tag] = 1 else: dic...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tag_counts (count_file):\r\n tagcounts = defaultdict(int)\r\n f = open(count_file, 'r')\r\n for line in f:\r\n fields = line.split()\r\n if fields[1] != 'WORDTAG':\r\n continue\r\n count = int(fields[0])\r\n tag = fields[2]\r\n tagcounts[tag] += count \r\...
[ "0.7715151", "0.6849592", "0.6818911", "0.6436489", "0.64020634", "0.63433975", "0.63389724", "0.63330853", "0.6318879", "0.63180465", "0.62615657", "0.62595445", "0.61637187", "0.6145789", "0.61236924", "0.60972047", "0.60384583", "0.6026211", "0.60130787", "0.59736466", "0....
0.765532
1
Segments a given category frequency dictionary into a lower number of categories, as close as it can to the relative frequencies indicated in weights.
def segmentDict(dict, weights): # Normalize weights weights = normalize(weights) segments = {} actual_weights = [] total_instances = 0 percent_instances = 0 i = 0 cat = None for k,v in dict.items(): total_instances += v if cat == None: cat = k[0].upper() sorted_d = sorted(dict.items...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def categoryFrequency(categoryList): #TODO delete units\n n=len(categoryList)\n freq = dict()\n for i in categoryList:\n if i in freq.keys():\n freq[i]=freq[i]+1/float(n)\n else:\n freq[i]=1/float(n)\n sortedFreq=sorted([(v,k) for (k,v) in freq.items()], reverse = ...
[ "0.5892979", "0.5838423", "0.5622817", "0.5414212", "0.53944296", "0.5326376", "0.52474064", "0.52364326", "0.5097868", "0.5033735", "0.502306", "0.4973841", "0.4943396", "0.492052", "0.4912217", "0.48782256", "0.48415238", "0.4830099", "0.48221216", "0.4802242", "0.48008767"...
0.6690722
0
Get all files in a directory. Check the file extensions to determine if it is a changable file. Write qualified files to the changeable files list. The copyright date is checked by a different procedure.
def get_requested_files(directory_path, file_extension_list, changeable_files_list): # process each file in the directory filepaths = glob.glob(directory_path + "/*") for filepath in filepaths: unused, ext = os.path.splitext(filepath) # check for the requested files if ext in file_ex...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_date(dest=dest):\n for root, _, files in os.walk(dest):\n ignore = [\"README.md\",\"SUMMARY.md\"]\n _ = [edit_files(root + \"/\" + file) for file in files if (file not in ignore and file.endswith(\".md\"))]", "def process_all_files():\n src_files = get_doc_files()\n\n for src_pa...
[ "0.6463595", "0.60821253", "0.60237235", "0.6008348", "0.60045683", "0.59918845", "0.5943025", "0.59408975", "0.5901942", "0.58879", "0.58497125", "0.5778965", "0.57649547", "0.5728319", "0.5727412", "0.57250494", "0.5697347", "0.56716734", "0.5655342", "0.5637762", "0.562500...
0.6124572
1
Find and replace the copyright date in input file_path. The new file is output to the updated_file_list in the calling function. "True" is returned if the file was updated, otherwise "False"
def modify_input_file(filepath, updated_file_list): lines = 0 # current input line number file_changed = False # the file has changed # find and change matching lines pattern = re.compile("[Cc]opyright") with open(filepath, mode='r', encoding='utf-8', newline='') as file_in: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def edit_files(i_file):\n a_file = open(i_file, \"r\")\n content = a_file.readlines()\n\n content[3] = f\"years: {datetime.now().year}\\n\"\n content[4] = f'lastupdated: \"{date.today()}\"\\n'\n a_file = open(i_file, \"w\") #open the same file and overrite line3 & 4\n a_file.writelines(content)\n...
[ "0.604624", "0.5977958", "0.5909992", "0.5897362", "0.58621687", "0.58343244", "0.5745788", "0.5733377", "0.55461645", "0.5482797", "0.5452656", "0.5441414", "0.5390062", "0.53553164", "0.5338147", "0.528025", "0.52801585", "0.5274388", "0.5259699", "0.5258172", "0.5230019", ...
0.7235687
0
Update version number in the source files. The directory list and file extensions are in main().
def update_source_files(source_directory_list, source_extension_list): # get source files in the directory list source_total = 0 for unused, source_directory in enumerate(source_directory_list): source_files_list = [] get_requested_files(source_directory, source_extension_list, source_files_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_version_files (component):\n\n vprint (\"Updating version files for \" + component)\n\n retval = []\n\n ## Update component/VERSION.txt\n path = get_path(component, \"VERSION.txt\")\n with open (path, \"r+\") as version_file:\n new_version = re.sub (component + \" version .*\",\n ...
[ "0.67035234", "0.64823806", "0.63954556", "0.6380026", "0.6160189", "0.61480564", "0.6115521", "0.6089588", "0.60198855", "0.600825", "0.6003172", "0.5936001", "0.5881396", "0.58597773", "0.5844964", "0.5829816", "0.57968193", "0.577143", "0.57502824", "0.5740181", "0.5700411...
0.6538263
1
Write the updated file to disk. Used by both the project files and the source files. Rename the current file by appending a ".orig" extension. Write a new file to replace the .orig file.
def write_output_file(updated_file, file_path): orig_file = file_path + ".orig" # remove an existion .orig file if os.path.isfile(orig_file): os.remove(orig_file) # rename the current file os.rename(file_path, orig_file) # write the new file with open(file_path, mode='w', encoding='u...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def replace(file,original_text,replacement_text):\n with open(file, \"rt\") as fin:\n with open(str(file+\"temp\"), \"wt\") as fout:\n for line in fin:\n fout.write(line.replace(original_text,replacement_text))\n os.rename(str(file+\"temp\"),file)\n return", ...
[ "0.6319781", "0.6288311", "0.6250029", "0.6249721", "0.6226605", "0.6155845", "0.6119171", "0.6113191", "0.60984194", "0.605242", "0.60221267", "0.6005523", "0.5968745", "0.5966853", "0.59334344", "0.59334344", "0.5924986", "0.58883196", "0.5884015", "0.5861894", "0.5781545",...
0.7659451
0
Returns n + reversed(n).
def reverse_and_add(n): return n + int(str(n)[::-1])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rev(n):\n return int(''.join(reversed(str(n))))", "def reverse(n):\n return(int(str(n)[::-1]))", "def reverse_last(vals, n):\n if len(vals)<=n:\n return vals[::-1]\n else:\n old=vals[0:len(vals)-n]\n new=vals[-1:len(vals)-n-1:-1]\n return old+new", "def reverseTheList(...
[ "0.7608247", "0.75295496", "0.728547", "0.6924487", "0.68271923", "0.6680292", "0.66388965", "0.6602577", "0.6486767", "0.6343752", "0.63146275", "0.6301133", "0.62174916", "0.616755", "0.61604625", "0.6144047", "0.6141926", "0.6127323", "0.6058644", "0.6056239", "0.6048981",...
0.8104129
0
Iterator indexing control points of a Bezier simplex.
def BezierIndex(dim, deg): def iterate(c, r): if len(c) == dim - 1: yield c + (r, ) else: for i in range(r, -1, -1): yield from iterate(c + (i, ), r - i) yield from iterate((), deg)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __iter__(self):\n for point in self.points:\n yield point", "def get_controlpoints(self, index):\n if index < 2: # is index in very beginning\n current_controlpoints = self.controlpoints[0:4] # use first points\n elif index > len(self.controlpoints) - 2: # is ind...
[ "0.6138841", "0.60835415", "0.59836525", "0.59470624", "0.59358245", "0.59015346", "0.5879152", "0.58778214", "0.5873675", "0.58443034", "0.58370155", "0.5782884", "0.5742098", "0.56580085", "0.56258917", "0.5603704", "0.55990475", "0.55845714", "0.557098", "0.5552596", "0.55...
0.6090857
1
Count the number of elements whose value is not 0.
def count_nonzero(a): return (np.count_nonzero(a))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def num_of_nonzero_elements(my_vector):\n counter = 0\n for element in my_vector:\n if element != 0:\n counter += 1\n return counter", "def get_zeros(self):\n return self.serie.isin([0]).sum()", "def num_empty(self):\n count = 0\n for i in self.__buckets:\n ...
[ "0.7499776", "0.74260056", "0.7189956", "0.70507324", "0.7043536", "0.6923293", "0.6901537", "0.68947256", "0.6805576", "0.67249465", "0.67243916", "0.6666576", "0.66371304", "0.6594162", "0.65321916", "0.65197927", "0.6511688", "0.65069556", "0.64964545", "0.6477194", "0.644...
0.75625044
0
Get an index with nonzero element.
def nonzero_indices(a): return (np.nonzero(a)[0])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _find0(self):\n for index in range(0, self.size):\n if self.elements[index] == 0:\n return index\n return self.size", "def non_zero_idx_val(seq):\n return [(i, v) for i, v in enumerate(seq) if v > 0]", "def find_empty(counts): \n for index,count in enumerate...
[ "0.7123152", "0.69450545", "0.6875251", "0.66805685", "0.6558049", "0.64854866", "0.64763135", "0.6397523", "0.6385339", "0.63798714", "0.63608164", "0.6356379", "0.63298357", "0.627602", "0.6251115", "0.62202823", "0.61571443", "0.61149204", "0.60853887", "0.60822195", "0.60...
0.78467286
0
Run county and state level projections for a specific intervention.
def run_projections( state_input_file, county_input_file, intervention: Intervention, run_validation=True ) -> Tuple[DodInterventionResult, DodInterventionResult]: states_key_name = f"states.{intervention.name}" states_df = build_processed_dataset.get_usa_by_states_df( state_input_file, intervention...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run_projections(\n input_file, run_validation=True\n) -> TopCountiesPipelineProjectionResult:\n # Run County level projections\n intervention = Intervention.SELECTED_MITIGATION\n\n counties_key_name = f\"counties.{intervention.name}\"\n # note i think build_processed_dataset should porbably be r...
[ "0.6431515", "0.5800134", "0.574178", "0.54861444", "0.5438259", "0.53394425", "0.5185603", "0.518323", "0.51795524", "0.5169798", "0.51546836", "0.51012677", "0.5046388", "0.5035656", "0.5010574", "0.50065094", "0.5000971", "0.499779", "0.49879894", "0.49829248", "0.4957002"...
0.73377126
0
Deploys results from an intervention to specified output directory.
def deploy_results(intervention_result: DodInterventionResult, output: str): dataset_deployer.upload_csv( intervention_result.key, intervention_result.projection_df.to_csv(), output ) dataset_deployer.deploy_shape_files( output, intervention_result.key, *intervention_result.shapefile_data ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deploy_results(result: TopCountiesPipelineResult, key: str, output: str):\n dataset_deployer.upload_json(key, result.api.json(), output)", "def get_output(self, output_dir=\"tools_output\"):\n\n output_dir = self.project_dir / output_dir / self.name\n # create output directory if didn't exis...
[ "0.65361625", "0.60336024", "0.5989197", "0.58939755", "0.5884008", "0.58762157", "0.58761215", "0.5833462", "0.57733375", "0.576358", "0.57186383", "0.56984663", "0.5694056", "0.56569403", "0.5604466", "0.55966806", "0.559395", "0.5547209", "0.55382", "0.5537242", "0.5533864...
0.7408499
0
fields is a sequence of (name, value) elements for regular form fields. files is a sequence of (name, filelike) elements for data to be uploaded as files. Yield body's chunk as bytes
def iter(self, fields, files): encoder = codecs.getencoder('utf-8') for key, value in fields.iteritems(): key = self.u(key) yield encoder('--{}\r\n'.format(self.boundary)) yield encoder(self.u( 'Content-Disposition: form-data; name="{}"\r\n').format(ke...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def encode_multipart_formdata(self, fields, files):\r\n if files is None:\r\n files = []\r\n if fields is None:\r\n fields = {}\r\n\r\n readers = []\r\n BOUNDARY = '----------ThIs_Is_tHe_bouNdaRY_$'\r\n CRLF = '\\r\\n'\r\n L1 = []\r\n for key i...
[ "0.6703004", "0.6487768", "0.6286864", "0.62665135", "0.6258376", "0.6140374", "0.60724163", "0.6047501", "0.5997188", "0.5991683", "0.59880644", "0.59826344", "0.59681565", "0.5966974", "0.5966974", "0.5966974", "0.5966974", "0.5918873", "0.59077895", "0.5839803", "0.5824988...
0.8044235
0
Makes a batched request against the Facebook Ads API endpoint.
def make_batch_request(self, batch): args = {} args['access_token'] = self.access_token args['batch'] = json.dumps(batch) args = {k.encode('utf-8'): unicode(v).encode('utf-8') for k, v in args.items()} logger.info('Making a batched request with %s' % args) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def run_requests(self):\n loop = asyncio.get_event_loop()\n tasks = []\n async with aiohttp.ClientSession(connector=self.connector) as session:\n\n for index, id in enumerate(self.ids):\n if id not in self.processed_ids:\n url = self.base_url ...
[ "0.60785455", "0.58264667", "0.5737969", "0.5705558", "0.5633526", "0.5589942", "0.55709636", "0.555063", "0.54238087", "0.5399167", "0.53891563", "0.53837866", "0.53830326", "0.53726614", "0.5364764", "0.5341414", "0.5318793", "0.5305902", "0.52968866", "0.5242328", "0.52419...
0.6579774
0
Makes a batched request with label against the Facebook Ads API.
def make_labeled_batch_request(self, batch): try: labels = batch.keys() queries = batch.values() data = self.make_batch_request(queries) # For debugging self.data = data return dict(zip(labels, data)) except urllib2.HTTPError as e: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_batch_request(self, batch):\n args = {}\n args['access_token'] = self.access_token\n args['batch'] = json.dumps(batch)\n args = {k.encode('utf-8'): unicode(v).encode('utf-8')\n for k, v in args.items()}\n logger.info('Making a batched request with %s' % ar...
[ "0.60108954", "0.52968585", "0.51935077", "0.51130617", "0.49954018", "0.49781558", "0.49417585", "0.49284583", "0.49239787", "0.49023873", "0.48961797", "0.48732227", "0.4869587", "0.48607367", "0.4852175", "0.48043475", "0.47995743", "0.47840145", "0.47726312", "0.4725853", ...
0.6057076
0
Returns debug information about the given token.
def debug_token(self, token): path = 'debug_token' args = { 'input_token': token, 'access_token': '%s|%s' % (self.app_id, self.app_secret) } return self.make_request(path, 'GET', args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_device_token_info(self, device_token):\n url = DEVICE_TOKEN_URL + device_token\n status, response = self._request('GET', None, url)\n if status == 404:\n return None\n elif status != 200:\n raise AirshipFailure(status, response)\n return json.loads(r...
[ "0.61889523", "0.6077173", "0.60240054", "0.59475166", "0.5887552", "0.5765328", "0.571191", "0.5630604", "0.5609732", "0.55547845", "0.5550004", "0.55489063", "0.5496969", "0.54789287", "0.5475456", "0.5461978", "0.54539835", "0.5444571", "0.5423897", "0.5423897", "0.5423897...
0.75205034
0
Returns the users of the given ad account.
def get_adusers(self, account_id, batch=False): path = 'act_%s/users' % account_id return self.make_request(path, 'GET', batch=batch)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all_users(self, account_name=None, account_id=None, path=None,\n user_name=None, user_id=None, search=False ):\n userlist=[]\n accounts = self.get_all_accounts(account_id=account_id, account_name=account_name,\n search=search)\...
[ "0.7507129", "0.7396333", "0.7098", "0.7009831", "0.70055866", "0.69502074", "0.6932174", "0.68302804", "0.68110144", "0.67669076", "0.67633724", "0.67538893", "0.67271054", "0.6725447", "0.669157", "0.6640427", "0.6639801", "0.6636435", "0.6625716", "0.6609267", "0.6600872",...
0.8482868
0
Returns the fields of the given ad account.
def get_adaccount(self, account_id, fields=None, batch=False): path = 'act_%s' % account_id args = {'fields': fields} if fields else {} return self.make_request(path, 'GET', args, batch=batch)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_fields(self, key=None):\n return self._get_query('fields', self._build_params(key=key), Field)", "def list_fields(fc):\n return [f.name for f in arcpy.ListFields(fc)]", "def get_fields(self, table_name):\n return self.get_table_meta(table_name)['fields']", "def get_fields(self, dm_na...
[ "0.64900297", "0.64633363", "0.6435302", "0.6278439", "0.6271584", "0.6231578", "0.61347127", "0.61293006", "0.6110465", "0.60895866", "0.6078529", "0.6078529", "0.6067266", "0.6041993", "0.60249627", "0.59713835", "0.5970587", "0.59226525", "0.5899934", "0.58937836", "0.5856...
0.66040295
0
Return the fields for the given ad campaign group.
def get_adcampaign_group(self, campaign_group_id, fields, batch=False): path = '%s' % campaign_group_id args = {'fields': fields} return self.make_request(path, 'GET', args, batch=batch)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_adcampaigns_of_campaign_group(self, campaign_group_id, fields,\n batch=False):\n path = '%s/adcampaigns' % campaign_group_id\n args = {'fields': fields}\n return self.make_request(path, 'GET', args, batch=batch)", "def get_adgroup(self, adgrou...
[ "0.68681467", "0.6605877", "0.62355703", "0.6148244", "0.6107268", "0.60888064", "0.59329355", "0.5819793", "0.5795829", "0.57690173", "0.5762033", "0.57099044", "0.5699368", "0.56639004", "0.5526836", "0.5524331", "0.54867035", "0.54537773", "0.54388326", "0.5430076", "0.542...
0.7202808
0
Returns the fields of all ad campaign groups from the given ad account.
def get_adcampaign_groups(self, account_id, fields, batch=False): path = 'act_%s/adcampaign_groups' % account_id args = { 'fields': fields, 'limit': self.DATA_LIMIT } return self.make_request(path, 'GET', args, batch=batch)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_adgroups_by_adaccount(self, account_id, fields=None,\n status_fields=None, batch=False):\n path = 'act_%s/adgroups' % account_id\n args = {'fields': fields} if fields else {}\n if status_fields:\n args['adgroup_status'] = status_fields\n ...
[ "0.72821957", "0.6975432", "0.6340183", "0.6284819", "0.61755216", "0.6174087", "0.6126248", "0.60715556", "0.5999946", "0.592391", "0.5749097", "0.5744151", "0.5610665", "0.55707353", "0.5536677", "0.55062884", "0.5487591", "0.5441287", "0.54341173", "0.5427679", "0.54129875...
0.80460984
0
Delete specific campaign group.
def delete_adcampaign_group(self, campaign_group_id, batch=False): path = '%s' % campaign_group_id return self.make_request(path, 'DELETE', batch=batch)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_group(self, group_id):\n url = self.groups_url + \"/%s\" % group_id\n return requests.delete(url, headers=self.headers)", "def delete_group(self, group):\n raise NotImplementedError('delete_group')", "async def delete_contact_group(dbcon: DBConnection, contact_group_id: int) -> ...
[ "0.7501498", "0.74689204", "0.744864", "0.7417873", "0.737822", "0.7363642", "0.7334851", "0.7320734", "0.72889686", "0.7264399", "0.7235754", "0.7199511", "0.7180974", "0.71728706", "0.7139698", "0.7083039", "0.70539457", "0.70402956", "0.7021091", "0.70121497", "0.69845533"...
0.8175089
0
Returns the fields for the given ad campaign.
def get_adcampaign(self, campaign_id, fields, batch=False): path = '%s' % campaign_id args = {'fields': fields} return self.make_request(path, 'GET', args, batch=batch)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_fields_for_cr(cr_id):\n # Construct request\n url = \"{}/reports/{}/patient_fields\"\n url = url.format(FABRIC_API_URL, cr_id)\n\n sys.stdout.flush()\n result = requests.get(url, auth=auth)\n return result.json()", "def get_adcampaign_detail(self, account_id, campaign_id, date_preset):\...
[ "0.65898985", "0.6338148", "0.6232564", "0.60172665", "0.59051216", "0.58895314", "0.58822185", "0.5873872", "0.5861341", "0.5854177", "0.5851545", "0.58459795", "0.57753587", "0.576402", "0.5692089", "0.5692089", "0.56912607", "0.56907666", "0.5686218", "0.56728125", "0.5672...
0.711426
0
Return the fields of all adcampaigns from the given adcampaign group.
def get_adcampaigns_of_campaign_group(self, campaign_group_id, fields, batch=False): path = '%s/adcampaigns' % campaign_group_id args = {'fields': fields} return self.make_request(path, 'GET', args, batch=batch)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_adcampaign_group(self, campaign_group_id, fields, batch=False):\n path = '%s' % campaign_group_id\n args = {'fields': fields}\n return self.make_request(path, 'GET', args, batch=batch)", "def get_adcreatives_by_adgroup(self, adgroup_id, fields, batch=False):\n path = '{0}/adcr...
[ "0.75774086", "0.67639214", "0.670902", "0.6692576", "0.64996964", "0.64950144", "0.63905364", "0.6336975", "0.60845774", "0.6055715", "0.59464204", "0.5822739", "0.57892954", "0.5702668", "0.5640149", "0.5562213", "0.5470797", "0.54013616", "0.53902537", "0.5338464", "0.5331...
0.8035114
0
Returns the fields for the given ad group.
def get_adgroup(self, adgroup_id, fields=None, batch=False): path = '%s' % adgroup_id args = {'fields': fields} if fields else {} return self.make_request(path, 'GET', args, batch=batch)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_fields(self, dm_name):\n dm = self.get_dm(dm_name)\n return dm['mdmFields']", "def list_group():\n data, code, message = FIELD_SERVICE.list_group()\n return __result(data, code, message)", "def get_fields(maps_dg):\n fields = []\n for mapi in maps_dg:\n fields.append(nm...
[ "0.6449476", "0.62611914", "0.625818", "0.62575144", "0.62036747", "0.6120664", "0.6064907", "0.5937128", "0.5926256", "0.5881843", "0.5869837", "0.5859543", "0.5796039", "0.57387525", "0.5731148", "0.5718497", "0.5698123", "0.56732863", "0.56500703", "0.56445265", "0.5642179...
0.6635314
0
Returns the fields of all ad groups from the given ad account.
def get_adgroups_by_adaccount(self, account_id, fields=None, status_fields=None, batch=False): path = 'act_%s/adgroups' % account_id args = {'fields': fields} if fields else {} if status_fields: args['adgroup_status'] = status_fields return s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_adcampaign_groups(self, account_id, fields, batch=False):\n path = 'act_%s/adcampaign_groups' % account_id\n args = {\n 'fields': fields,\n 'limit': self.DATA_LIMIT\n }\n return self.make_request(path, 'GET', args, batch=batch)", "def get_all_groups(self,...
[ "0.73521173", "0.6695194", "0.63296837", "0.6296121", "0.60746205", "0.58177465", "0.57922953", "0.5769778", "0.5761587", "0.5732374", "0.57210445", "0.5718868", "0.571857", "0.5706689", "0.5658657", "0.5629515", "0.5623619", "0.55995756", "0.557363", "0.55527174", "0.5529558...
0.72566795
1
Returns the fields of all ad groups from the given ad campaign.
def get_adgroups_by_adcampaign(self, campaign_id, fields=None, status_fields=None, batch=False): path = '%s/adgroups' % campaign_id args = {'fields': fields} if fields else {} if status_fields: args['adgroup_status'] = status_fields return s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_adcampaign_groups(self, account_id, fields, batch=False):\n path = 'act_%s/adcampaign_groups' % account_id\n args = {\n 'fields': fields,\n 'limit': self.DATA_LIMIT\n }\n return self.make_request(path, 'GET', args, batch=batch)", "def get_adcampaigns_of_c...
[ "0.7530305", "0.65122443", "0.6437828", "0.6331688", "0.6045154", "0.5912933", "0.5782121", "0.56986874", "0.5694998", "0.56798816", "0.56371003", "0.56278396", "0.5623327", "0.56128645", "0.5500975", "0.54885703", "0.54868734", "0.54770875", "0.54585457", "0.5445233", "0.544...
0.73259014
1
Returns the fields for the given ad creative.
def get_adcreative(self, creative_id, fields, batch=False): path = '%s' % creative_id args = {'fields': fields} return self.make_request(path, 'GET', args, batch=batch)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_fields_for_cr(cr_id):\n # Construct request\n url = \"{}/reports/{}/patient_fields\"\n url = url.format(FABRIC_API_URL, cr_id)\n\n sys.stdout.flush()\n result = requests.get(url, auth=auth)\n return result.json()", "def meta_fields(item):\n return scom.meta_fields(item)", "def deal...
[ "0.6293726", "0.58557326", "0.5828929", "0.57436365", "0.5670117", "0.56427336", "0.56157863", "0.55968785", "0.55868536", "0.5586053", "0.5585029", "0.5538533", "0.5538533", "0.55381703", "0.55337745", "0.5524702", "0.5506261", "0.54799724", "0.54741216", "0.54603386", "0.54...
0.7481938
0
Returns the ad images for the given ad account.
def get_adimages(self, account_id, hashes=None, batch=False): path = 'act_%s/adimages' % account_id args = {} if hashes is not None: args = {'hashes': hashes} return self.make_request(path, 'GET', args, batch=batch)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_image_list(self, account):\n images = self.driver(account).list_images()\n return [image.name for image in images]", "def cmd_account_images(client, args):\n account_images = client.get_account_images(args.username, args.page)\n data = [item.__dict__ for item in account_images]\n g...
[ "0.7314663", "0.71794915", "0.65721077", "0.64426255", "0.6411373", "0.6164322", "0.602651", "0.5982048", "0.59179264", "0.5905286", "0.58921134", "0.5881818", "0.58739316", "0.5863717", "0.58315206", "0.58247125", "0.5811616", "0.5795393", "0.5752705", "0.573772", "0.5731795...
0.7258551
1
Returns the stats for a Facebook campaign group.
def get_stats_by_adcampaign_group( self, campaign_group_id, fields=None, filters=None, batch=False, start_time=None, end_time=None): args = {} if fields: args['fields'] = json.dumps(fields) if filters: args['filters'] = json.dumps(filters) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getGrpStats(group):\n return {'min': group.min(), 'max': group.max(),\n 'count': group.count(), 'mean': group.mean(), 'sum':group.sum()}", "def get_campaign_stats(self,campaign_id):\n campaign = Campaign(campaign_id)\n fields = ['account_name',\n 'campaign_name',\...
[ "0.6227779", "0.60927224", "0.60745287", "0.60659075", "0.5944774", "0.5805374", "0.575456", "0.5705138", "0.56683", "0.5656494", "0.5629444", "0.5595925", "0.552353", "0.546793", "0.54674387", "0.53961784", "0.53895855", "0.5380818", "0.53679377", "0.53511876", "0.53357524",...
0.6892386
0
Returns the stats for a Facebook campaign by adgroup.
def get_stats_by_adgroup( self, account_id, adgroup_ids=None, batch=False, start_time=None, end_time=None): args = {} if adgroup_ids is not None: args['adgroup_ids'] = json.dumps(adgroup_ids) if start_time: args['start_time'] = self.__parse_time(st...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_stats_by_adcampaign_group(\n self, campaign_group_id, fields=None, filters=None, batch=False,\n start_time=None, end_time=None):\n args = {}\n if fields:\n args['fields'] = json.dumps(fields)\n if filters:\n args['filters'] = json.dumps(filte...
[ "0.6947843", "0.6364444", "0.62626386", "0.60540676", "0.59857357", "0.59130126", "0.5794092", "0.57710516", "0.57229096", "0.56759286", "0.5656072", "0.5655446", "0.5593035", "0.5501304", "0.5412198", "0.53732365", "0.53527164", "0.534602", "0.53379744", "0.53250647", "0.531...
0.651328
1
Returns the ad report stats for the given account.
def get_adreport_stats(self, account_id, date_preset, time_increment, data_columns, filters=None, actions_group_by=None, batch=False): path = 'act_%s/reportstats' % account_id args = { 'date_preset': date_preset, 'time_increme...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_stats_by_adaccount(self, account_id, batch=False, start_time=None, end_time=None):\n args = {}\n start_time = start_time or 0\n path = 'act_{0}/stats/{1}'.format(account_id, self.__parse_time(start_time))\n if end_time:\n path = path + '/{0}'.format(self.__parse_time(...
[ "0.7248535", "0.6493395", "0.6449132", "0.64028156", "0.59609824", "0.59464306", "0.593626", "0.5906503", "0.5861286", "0.5833227", "0.5813863", "0.58119303", "0.58100086", "0.58036923", "0.5796423", "0.57952833", "0.5760015", "0.57439005", "0.5737804", "0.56976837", "0.56845...
0.6803735
1
Returns completed result of the given async job
def get_async_job_result(self, account_id, job_id, batch=False): path = 'act_%s/reportstats' % account_id args = { 'report_run_id': job_id } return self.make_request(path, 'GET', args=args, batch=batch)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def my_job_async(mustfail):\n if mustfail:\n raise RuntimeError('Job failed, as requested!')\n\n return {\n 'message': 'job well done',\n 'payload': {'coolstuff': 'here'},\n 'readiness': 1.0\n }", "def get_result(self, timeout):\n\n ba...
[ "0.699001", "0.6720908", "0.668794", "0.6670894", "0.6610265", "0.64277935", "0.64068246", "0.6380871", "0.62620497", "0.6219399", "0.6183571", "0.61668086", "0.610857", "0.60896164", "0.60810596", "0.60508716", "0.6036827", "0.6029165", "0.6024251", "0.60072297", "0.6003556"...
0.6900781
1
Returns the aggregated conversion stats for the given ad account.
def get_conversion_stats_by_adaccount(self, account_id, batch=False): path = 'act_%s/conversions' % account_id return self.make_request(path, 'GET', batch=batch)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_conversion_stats(self, adgroup_id, batch=False):\n path = '%s/conversions' % adgroup_id\n return self.make_request(path, 'GET', batch=batch)", "def get_conversion_stats_by_adgroup(self, account_id, adgroup_ids=None,\n include_deleted=False, batch=False...
[ "0.7043421", "0.6315266", "0.6203622", "0.60176706", "0.5397881", "0.5308747", "0.5242094", "0.52374476", "0.5203921", "0.5127736", "0.50927025", "0.5086971", "0.5065482", "0.5055341", "0.5028451", "0.49794018", "0.49695638", "0.4959153", "0.49582964", "0.49520278", "0.493874...
0.8317373
0
Returns the conversion stats for a single ad group.
def get_conversion_stats(self, adgroup_id, batch=False): path = '%s/conversions' % adgroup_id return self.make_request(path, 'GET', batch=batch)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_conversion_stats_by_adgroup(self, account_id, adgroup_ids=None,\n include_deleted=False, batch=False):\n path = 'act_%s/adgroupconversions' % account_id\n args = {}\n if adgroup_ids is not None:\n args['adgroup_ids'] = json.dumps(adgrou...
[ "0.7126618", "0.6879782", "0.6557388", "0.58285874", "0.58243865", "0.581837", "0.57725024", "0.55744255", "0.5480726", "0.54243845", "0.5361287", "0.5352107", "0.5349627", "0.52375495", "0.52040744", "0.5131106", "0.5118021", "0.5033729", "0.50227857", "0.50193995", "0.50003...
0.82147694
0
Returns the remarketing pixel.
def get_remarketing_pixel(self, account_id, batch=False): logger.warn("This method is deprecated and is replaced with get_ads_pixels.") path = 'act_%s/remarketingpixelcode' % account_id return self.make_request(path, 'GET', batch=batch)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_px(self):\n pass", "def getPixel(self):\r\n return self.__buffer[y][x]", "def pixel_ref(self):\n return self._pixel_ref", "def pixel_type(self):\n pass", "def gpix(self):\n return self._gpix", "def getimage(self):", "def getPixels(self):\n self._logger....
[ "0.6252342", "0.5916868", "0.58560795", "0.5755901", "0.57525766", "0.57007796", "0.56927764", "0.5637961", "0.56269395", "0.5596106", "0.5575986", "0.5571929", "0.5563752", "0.55550534", "0.55192196", "0.5498717", "0.5465229", "0.5461728", "0.54475176", "0.5447481", "0.54397...
0.69339037
0
Returns the information for the given offsite pixel.
def get_offsite_pixel(self, offsite_pixel_id, batch=False): path = '%s' % offsite_pixel_id return self.make_request(path, 'GET', batch=batch)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_pixel(self, x, y):\n if x < 0 or x > 7 or y < 0 or y > 15:\n # Ignore out of bounds pixels.\n return\n if y < 8:\n return self.get_led( y * 16 + x)\n else:\n return self.get_led((y-8) * 16 + (x+8))", "def retrieve_pixel(self, x, y, index):\...
[ "0.66749126", "0.6524832", "0.64080584", "0.6356776", "0.6308759", "0.6170481", "0.61681867", "0.6124925", "0.59940475", "0.5963207", "0.59393615", "0.59164435", "0.59158933", "0.5904558", "0.5904007", "0.5900166", "0.5849955", "0.5826816", "0.58201385", "0.58138734", "0.5810...
0.7272531
0
Returns the list of offsite pixels for the given account.
def get_offsite_pixels(self, account_id, batch=False): path = 'act_%s/offsitepixels' % account_id return self.make_request(path, 'GET', batch=batch)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_ads_pixels(self, account_id, fields=None, batch=False):\n path = 'act_%s/adspixels' % account_id\n args = {'fields': fields} if fields else {}\n return self.make_request(path, 'GET', args, batch=batch)", "def neighbour_pixels(x, y):\n return [\n (x - 1, y - 1), (x, y - 1), ...
[ "0.6172726", "0.5849796", "0.58011657", "0.5752363", "0.55722404", "0.54265267", "0.5412152", "0.53439766", "0.52993065", "0.52671695", "0.52521837", "0.5125096", "0.5120147", "0.51007414", "0.50539196", "0.50453466", "0.50400776", "0.5027511", "0.49755818", "0.4962378", "0.4...
0.7049922
0
Returns the keyword stats for the given ad group.
def get_keyword_stats(self, adgroup_id, batch=False): path = '%s/keywordstats' % adgroup_id return self.make_request(path, 'GET', batch=batch)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_keywords_and_impressions(client, customer_id, page_size):\n ga_service = client.get_service('GoogleAdsService', version='v2')\n results = []\n\n query = ('SELECT ad_group_criterion.keyword.text, '\n 'metrics.impressions, metrics.clicks, metrics.cost_micros '\n 'FROM keyword_view WH...
[ "0.607016", "0.60511845", "0.5765904", "0.5403789", "0.53584504", "0.5270912", "0.51138765", "0.5043539", "0.4957441", "0.49099302", "0.48909253", "0.48906374", "0.4882828", "0.48628682", "0.48413464", "0.48088658", "0.48002428", "0.4779215", "0.47685438", "0.47670633", "0.47...
0.82910204
0
Returns the rate card for Homepage Ads.
def get_ratecard(self, account_id, batch=False): path = 'act_%s/ratecard' % account_id return self.make_request(path, 'GET', batch=batch)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self):\n user = get_authenticated_user()\n return get_card(user)", "def get_card (self, card):\n\t\treturn self._card", "def kpi_card4(df=data):\n total = df['passenger_count'].sum().round()\n return [\n html.H4('Total Passenger Amount', className='card-title'),\n html...
[ "0.55201805", "0.53813046", "0.5323483", "0.5319892", "0.5319833", "0.5310196", "0.5271338", "0.5227973", "0.52195853", "0.5211209", "0.51686454", "0.5116151", "0.5108667", "0.5050621", "0.5028366", "0.5001399", "0.4989199", "0.4986583", "0.49688375", "0.49473494", "0.4931473...
0.64530134
0
Returns the reach estimate for the given currency and targeting.
def get_reach_estimate(self, account_id, targeting_spec, currency=None, creative_action_spec=None, bid_for=None, batch=False): path = 'act_%s/reachestimate' % account_id args = { 'targeting_spec': json.dumps(targeting_spec), } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_cost(org, target, amount):\n rep, _ = target.Dominion.reputations.get_or_create(organization=org)\n base = 200\n if amount > 0:\n base -= rep.respect + rep.affection\n else:\n base += rep.respect + rep.affection\n if base < 0:\n base = 0\n...
[ "0.6184802", "0.55034554", "0.54555136", "0.54076797", "0.53823316", "0.5301148", "0.5263448", "0.5148293", "0.5114286", "0.51138216", "0.5108673", "0.50789857", "0.5073114", "0.5045106", "0.5020766", "0.5020766", "0.50109684", "0.500113", "0.49957886", "0.49835432", "0.49826...
0.71005875
0
Returns the list of ad campaigns and related data.
def get_adcampaign_list(self, account_id): fields = 'id, name, campaign_status, start_time, end_time, ' \ 'daily_budget, lifetime_budget, budget_remaining' batch = [ self.get_adaccount(account_id, ['currency'], batch=True), self.get_adcampaigns(account_id, fields...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_drip_campaigns(self):\n return list(DripCampaign.objects(user_id=self.user_id))", "def list_campaigns(self, **kwargs) -> ApiResponse:\n return self._request(kwargs.pop('path'), params=kwargs)", "def getAllCampaigns(service):\n # Using AWQL to retrieve campaigns.\n query = (adwords....
[ "0.7791002", "0.76178706", "0.74240816", "0.7406647", "0.73380303", "0.7225367", "0.7168782", "0.7105438", "0.7103571", "0.68827987", "0.68807346", "0.6824061", "0.68058723", "0.67796344", "0.66644067", "0.6588232", "0.6488719", "0.6457609", "0.64117867", "0.6348168", "0.6261...
0.7850429
0
Returns the detail of an ad campaign.
def get_adcampaign_detail(self, account_id, campaign_id, date_preset): campaign_fields = [ 'name', 'campaign_status', 'daily_budget', 'lifetime_budget', 'start_time', 'end_time'] campaign_data_columns = [ 'campaign_name', 'reach', 'frequency', 'clicks', 'a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_campaign(self, campaign_id: str) -> dict:\n return self.http_request(\"GET\", f'/campaign/{campaign_id}')", "def get_campaign_info(self, id):\n logger.info(\"Function call: get_campaign_info from: {}\".format(id, ))\n return self.__handle_error(\"Empty campaign id\") if not id else s...
[ "0.730492", "0.7148773", "0.70886153", "0.6952887", "0.66787946", "0.6621084", "0.64367497", "0.6201446", "0.61358225", "0.6095113", "0.60102504", "0.5969368", "0.59596705", "0.59596705", "0.59596705", "0.5865227", "0.58570576", "0.58103025", "0.5659969", "0.56390685", "0.560...
0.73936963
0
Returns the autocomplete data for the given query and type.
def get_autocomplete_data(self, q, type, want_localized_name=False, list=None, limit=None, batch=False): path = '%s/search' % q args = {'type': type} if want_localized_name: args['want_localized_name'] = want_localized_name if list: a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def autocomplete(\n self,\n query,\n fields=None,\n operator=None,\n order_by_relevance=True,\n backend=\"default\",\n ):\n search_backend = get_search_backend(backend)\n return search_backend.autocomplete(\n query,\n self,\n ...
[ "0.61557144", "0.60404307", "0.60142326", "0.5925829", "0.5909921", "0.587843", "0.58297956", "0.5817675", "0.5782266", "0.572731", "0.57246333", "0.5627573", "0.5599135", "0.55556315", "0.5546945", "0.55009896", "0.5431673", "0.54116696", "0.53997016", "0.53606945", "0.53248...
0.8000939
0
Returns the page access token for the given page.
def get_page_access_token(self, page_id, batch=False): path = '%s' % page_id args = {'fields': 'access_token'} return self.make_request(path, 'GET', args, batch=batch)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def page_token(self):\n return self._properties.get(\"pageToken\")", "def get_token():\n params = {'get_token': 'get_token'}\n return load_page(API, params=params, headers={'content-type': 'application/json'})['token']", "def get_access_token(self):\n access_token = self._auth_provider._get...
[ "0.6895106", "0.6298637", "0.61150604", "0.59867823", "0.59867823", "0.5959107", "0.5922044", "0.5917908", "0.59148884", "0.5853093", "0.57995343", "0.5794838", "0.574418", "0.57328886", "0.5731778", "0.57293093", "0.56982315", "0.56935376", "0.5673225", "0.5673225", "0.56254...
0.8188665
0
Returns data for the give page post.
def get_page_post(self, page_post_id, fields=None, batch=False): path = '%s' % page_post_id args = {} if fields: args['fields'] = json.dumps(fields) return self.make_request(path, 'GET', args, batch=batch)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def getPostData(self, PostID):\n url = self.urlGen(id=str(PostID))\n XML =None\n with async_timeout.timeout(10):\n async with self.session.get(url=url) as XML:\n XML = await XML.read()\n XML = self.ParseXML(ET.XML(XML))\n data = XML['posts'...
[ "0.66914964", "0.6609694", "0.6597313", "0.65585893", "0.65549135", "0.64523876", "0.63400614", "0.63219726", "0.61648834", "0.6111833", "0.60791177", "0.60451114", "0.6033017", "0.60295993", "0.60295993", "0.6004108", "0.5989076", "0.59873974", "0.595117", "0.594713", "0.593...
0.6994447
0
Creates an ad image in the given ad account.
def create_adimage(self, account_id, image_data, batch=False): path = 'act_%s/adimages' % account_id files = {image_data.name: image_data} return self.make_request(path, 'POST', None, files, batch=batch)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_custom_audience_pixel(self, account_id, batch=False):\n path = \"act_%s/adspixels\" % account_id\n return self.make_request(path, 'POST', batch=batch)", "def create_adcreative(self, account_id, name=None, object_story_id=None, object_story_spec=None, batch=False):\n path = 'act_%s...
[ "0.61451757", "0.6033003", "0.5863322", "0.58397895", "0.58106166", "0.56329113", "0.5490508", "0.5458526", "0.53882515", "0.5354105", "0.53367656", "0.533547", "0.53347516", "0.5307588", "0.5294122", "0.52878755", "0.5280777", "0.5263223", "0.5253173", "0.52526194", "0.52413...
0.8006185
0
Creates a link page post on the given page.
def create_link_page_post(self, page_id, link=None, message=None, picture=None, thumbnail=None, name=None, caption=None, description=None, published=None, call_to_action=None, batch=False): page_access_token = self.get_page_access_token(page_id) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def newPost(self, postLink, zserverBlogEntry): #$NON-NLS-1$\r\n atomEntry = self.createNewBlogEntry()\r\n self._populateAtomEntry(atomEntry, zserverBlogEntry)\r\n # publish entry\r\n atomRespEntry = self.createAtomEntry(postLink, atomEntry)\r\n return atomRespEntry", "def creat...
[ "0.6794848", "0.6332408", "0.62787837", "0.62066936", "0.61507404", "0.60811317", "0.6072727", "0.60461605", "0.5974542", "0.5972283", "0.5949421", "0.5910934", "0.58736694", "0.58677185", "0.5863532", "0.5835382", "0.58146477", "0.5803325", "0.5781549", "0.5762776", "0.57156...
0.77158016
0
Creates an ad campaign group for the given account.
def create_adcampaign_group(self, account_id, name, campaign_group_status, objective=None, batch=False): path = 'act_%s/adcampaign_groups' % account_id args = { 'name': name, 'campaign_group_status': campaign_group_status, } if obje...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_adgroup(self, account_id, name, campaign_id,\n creative_id, bid_type=None, bid_info=None, max_bid=None,\n tracking_specs=None, view_tags=None, objective=None,\n adgroup_status=None, targeting=None, conversion_specs=None, batch=False):\n ...
[ "0.76186574", "0.74259675", "0.7047342", "0.68341404", "0.6452709", "0.6438533", "0.6134367", "0.6082146", "0.60691714", "0.59890187", "0.5978779", "0.5971765", "0.5952626", "0.5949488", "0.5948537", "0.5902305", "0.5878081", "0.58696204", "0.5868034", "0.5843602", "0.5812845...
0.7662178
0
Updates condition of the given ad campaign group.
def update_adcampaign_group(self, campaign_group_id, name=None, campaign_group_status=None, objective=None, batch=False): path = '%s' % campaign_group_id args = {} if name is not None: args['name'] = name if camp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_targetgroup(self, group_id, **kwargs):\r\n result = False\r\n if self._db(self._db.targetgroup.id==group_id).select():\r\n result = True\r\n self._db(self._db.targetgroup.id==group_id).update(**kwargs)\r\n self._db.commit()\r\n return result", "def...
[ "0.6300758", "0.56560814", "0.5560324", "0.5507527", "0.5466104", "0.5375947", "0.53550124", "0.53035486", "0.52953994", "0.5244216", "0.5243708", "0.52355415", "0.51365495", "0.51355237", "0.5129476", "0.5116882", "0.51126", "0.5084277", "0.50788194", "0.503468", "0.49954182...
0.63916516
0
Creates an adset (formerly called ad campaign) for the given account and the campaign (formerly called "campaign group").
def create_adset(self, account_id, campaign_group_id, name, campaign_status, daily_budget=None, lifetime_budget=None, start_time=None, end_time=None, bid_type=None, bid_info=None, promoted_object=None, targeting=None, batch=False): if daily_budget i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_campaign(account, row, name, acc_type):\n country = None\n if acc_type == Account.COUNTRY:\n country_name = row['LOCATION']\n country = Country.objects.filter(name__iexact=country_name).first()\n if not country:\n logging.getLogger('peacecorps.sync_accounting').warn...
[ "0.64609", "0.6443122", "0.6287087", "0.62106", "0.59949636", "0.597882", "0.59783816", "0.5938531", "0.5885494", "0.5864603", "0.5810597", "0.5745423", "0.57439005", "0.57156086", "0.57071507", "0.56509084", "0.56193465", "0.5615964", "0.5598836", "0.5580792", "0.55519617", ...
0.73807245
0
Updates the given adset.
def update_adset(self, campaign_id, name=None, campaign_status=None, daily_budget=None, lifetime_budget=None, start_time=None, end_time=None, bid_type=None, bid_info=None, promoted_object=None, targeting=None, batch=False): path = '%s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self, sentenceset):\n self._sentences.update(sentenceset.get_sentences())", "def update(self, set, where):\n # Build set\n set_sql = ''\n set_values = []\n for key, value in set.items():\n if key == '*': # Literal expression\n set_sql = val...
[ "0.63086176", "0.60864925", "0.5909108", "0.5838955", "0.56002444", "0.55611414", "0.55611414", "0.55611414", "0.55611414", "0.5538671", "0.55356807", "0.5447409", "0.54078513", "0.53757405", "0.5352285", "0.53373814", "0.5321228", "0.5267401", "0.5262136", "0.521705", "0.521...
0.65183246
0
Delete the given ad campaign.
def delete_adcampaign(self, campaign_id, batch=False): path = '%s' % campaign_id return self.make_request(path, 'DELETE', batch=batch)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rpc_campaign_delete(self, campaign_id):\n\t\tsession = db_manager.Session()\n\t\tsession.delete(db_manager.get_row_by_id(session, db_models.Campaign, campaign_id))\n\t\tsession.commit()\n\t\tsession.close()\n\t\treturn", "def delete_campaign(self, campaignId, **kwargs) -> ApiResponse:\n return self._r...
[ "0.81015474", "0.7873376", "0.7808877", "0.7040319", "0.6679311", "0.664675", "0.6078404", "0.59033364", "0.5760971", "0.57252777", "0.5590775", "0.55322367", "0.55265343", "0.55118585", "0.5483344", "0.54706794", "0.54280573", "0.5372056", "0.5353199", "0.53330624", "0.53118...
0.8450083
0
Creates an ad creative in the given ad account.
def create_adcreative(self, account_id, name=None, object_story_id=None, object_story_spec=None, batch=False): path = 'act_%s/adcreatives' % account_id args = {} if name: args['name'] = name if object_story_id: args['object_story_id'] = object_story_id if ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_advert():\r\n advertiser, category, zone = create_objects()\r\n ad = AdBase.objects.create(\r\n title='Ad Title',\r\n url='www.example.com',\r\n advertiser=advertiser,\r\n category=category,\r\n zone=zone,\r\n )\r\n return ad", "def create_adset(self, acc...
[ "0.69750094", "0.633123", "0.605164", "0.59996223", "0.59628886", "0.5786098", "0.57572544", "0.57314056", "0.57057285", "0.55416316", "0.54866284", "0.54634756", "0.546215", "0.53990257", "0.53784597", "0.5348084", "0.5325721", "0.5310224", "0.52901614", "0.52826846", "0.527...
0.79304534
0
Create a custom audience for the given account.
def create_custom_audience(self, account_id, name, subtype=None, description=None, rule=None, opt_out_link=None, retention_days=30, batch=False): path = "act_%s/customaudiences" % account_id args = { 'name': name, } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_custom_audience_from_website(\n self, account_id, name, domain, description=None,\n retention_days=30, prefill=True, batch=False):\n path = \"act_%s/customaudiences\" % account_id\n args = {\n 'name': name,\n 'subtype': \"WEBSITE\"\n }\n ...
[ "0.69903755", "0.6747098", "0.5886402", "0.57386774", "0.56866586", "0.5684474", "0.5681401", "0.56380796", "0.5489181", "0.54728997", "0.54438716", "0.53915864", "0.53431445", "0.53252304", "0.52722365", "0.5258361", "0.5257858", "0.524561", "0.51642907", "0.5159867", "0.513...
0.8034021
0
Adds users to a Custom Audience, based on a list of unique user tracking ids. There is a limit imposed by Facebook that only 10000 users may be uploaded at a time. schema Allowed values are "UID", "EMAIL_SHA256", "PHONE_SHA256", "MOBILE_ADVERTISER_ID" app_ids List of app ids. This is required for schema type UID, as of...
def add_users_to_custom_audience(self, custom_audience_id, tracking_ids, schema='MOBILE_ADVERTISER_ID', app_ids=None, batch=False): path = "%s/users" % custom_audience_id payload = {'schema': schema, 'data': tracking_ids} if app_ids: payload['app_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_all_friends(twitter, users):\n ###TODO-- Completed\n\n #calling get_friends here to receive friends ID's for all the values of screen_name,\n # limiting the values to receive to 5000\n for user in users:\n user['friends'] = get_friends(twitter, user['screen_name'])[:5000]\n #print...
[ "0.53511375", "0.53367573", "0.5245062", "0.51884025", "0.5148435", "0.5121158", "0.5026242", "0.50204164", "0.5012364", "0.5008828", "0.49615628", "0.49122536", "0.48883018", "0.48880377", "0.487912", "0.4874466", "0.4869419", "0.4867456", "0.48221523", "0.4818214", "0.48026...
0.8153835
0
Create a custom audience pixel for the given account. This method only needed once per ad account.
def create_custom_audience_pixel(self, account_id, batch=False): path = "act_%s/adspixels" % account_id return self.make_request(path, 'POST', batch=batch)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_custom_audience(self, account_id, name, subtype=None,\n description=None, rule=None, opt_out_link=None,\n retention_days=30, batch=False):\n path = \"act_%s/customaudiences\" % account_id\n args = {\n 'name': name,\n ...
[ "0.6403576", "0.62565124", "0.5535345", "0.5103156", "0.5053856", "0.49941942", "0.49930894", "0.49631172", "0.49131462", "0.49072927", "0.48941672", "0.48804632", "0.48549256", "0.4849889", "0.48173803", "0.48096266", "0.47709522", "0.47580764", "0.47232842", "0.47097245", "...
0.80888146
0
Create a custom audience from website for the given account.
def create_custom_audience_from_website( self, account_id, name, domain, description=None, retention_days=30, prefill=True, batch=False): path = "act_%s/customaudiences" % account_id args = { 'name': name, 'subtype': "WEBSITE" } rule = {'ur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_custom_audience(self, account_id, name, subtype=None,\n description=None, rule=None, opt_out_link=None,\n retention_days=30, batch=False):\n path = \"act_%s/customaudiences\" % account_id\n args = {\n 'name': name,\n ...
[ "0.7066297", "0.5953314", "0.5626082", "0.5513869", "0.53991276", "0.5362004", "0.52921796", "0.52679944", "0.5255033", "0.5245276", "0.5200376", "0.51080674", "0.51068354", "0.51045805", "0.51035374", "0.5065382", "0.5017878", "0.49941573", "0.49939954", "0.49919534", "0.498...
0.80276316
0
Create a lookalike audience for the given target audience.
def create_lookalike_audience(self, account_id, name, audience_id, lookalike_spec, batch=False): path = "act_%s/customaudiences" % account_id args = { 'name': name, 'origin_audience_id': audience_id, 'lookalike_spec': json.dumps(looka...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_custom_audience(self, account_id, name, subtype=None,\n description=None, rule=None, opt_out_link=None,\n retention_days=30, batch=False):\n path = \"act_%s/customaudiences\" % account_id\n args = {\n 'name': name,\n ...
[ "0.5625991", "0.5403802", "0.5344336", "0.52933955", "0.51975965", "0.5187194", "0.5138217", "0.4931905", "0.49309886", "0.4832704", "0.47631374", "0.46816403", "0.46627328", "0.46468496", "0.46085468", "0.45594066", "0.45591733", "0.4554906", "0.45450443", "0.45251665", "0.4...
0.73080236
0
Creates an offsite pixel for the given account.
def create_offsite_pixel(self, account_id, name, tag, batch=False): path = 'act_%s/offsitepixels' % account_id args = { 'name': name, 'tag': tag, } return self.make_request(path, 'POST', args, batch=batch)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_custom_audience_pixel(self, account_id, batch=False):\n path = \"act_%s/adspixels\" % account_id\n return self.make_request(path, 'POST', batch=batch)", "def createNeoPixelObject():\r\n return neopixel.NeoPixel(machine.Pin(PIN), NUM_NEOPIXELS)", "def get_offsite_pixels(self, account...
[ "0.6237579", "0.55753154", "0.54230386", "0.53433794", "0.5102814", "0.5056824", "0.50096446", "0.49614307", "0.49268848", "0.479304", "0.47540647", "0.4753462", "0.46652997", "0.46337742", "0.4580019", "0.45632777", "0.45229763", "0.4512287", "0.45116362", "0.45088103", "0.4...
0.7383441
0
Returns facebook connection objects for given account
def get_connection_objects(self, account_id, business_id=None, batch=False): path = 'act_{}/connectionobjects'.format(account_id) args = {} if business_id: args['business_id'] = business_id return self.make_request(path, 'GET', args, batch=batc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_accounts():\n graph = facebook.GraphAPI(mytoken)\n pages = graph.get_object('me/accounts')\n pages_info=[]\n for page in pages['data']:\n pages_info.append( ( page['name'], page['access_token'] ) )\n return pages_info", "def social_connection(request):\n backend_map = {'faceb...
[ "0.62899584", "0.59851533", "0.57604873", "0.5618666", "0.5599102", "0.5426997", "0.5426842", "0.5399525", "0.53759795", "0.5356126", "0.5348449", "0.5337424", "0.5334071", "0.52884686", "0.5246142", "0.5237798", "0.5228069", "0.5206267", "0.5201796", "0.51963705", "0.5180999...
0.6598974
0
Get broad targeting categories for the given account
def get_broad_targeting_categories(self, account_id, user_adclusters=None, excluded_user_adclusters=None, batch=False): path = 'act_{}/broadtargetingcategories'.format(account_id) args = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_categories(self, blogid=1):\n return self.execute('metaWeblog.getCategories', blogid, self.username, self.password)", "def get_categories(self):\n _url = urljoin(self.base_url, self.API_CATEGORIES)\n return requests.get(_url)", "def get_categories(teach_id):\n query = \"SELECT c...
[ "0.6130099", "0.59468395", "0.5759809", "0.5756579", "0.57555073", "0.5742155", "0.55958956", "0.5588522", "0.5574741", "0.55350673", "0.5518989", "0.5507046", "0.5492137", "0.5491411", "0.54852617", "0.54808754", "0.54740864", "0.544625", "0.5427394", "0.5423977", "0.5418358...
0.7665715
0
Sorts a list of indexrings. Takes a list of unsorted index rings and sorts them into an "exterior" and "interior" components. Any doublynested rings are considered exterior rings.
def sort_rings(index_rings, vertices): # sort index_rings into corresponding "polygons" areas = list() for index_ring in index_rings: e0, e1 = [list(t) for t in zip(*index_ring)] areas.append(float(Polygon(vertices[e0, :]).area)) # maximum area must be main mesh idx = areas.index(n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sort_rings(ring_list, om_pickle_file):\n basic_output_on.dprint(\"\\nSorting closed rings...\",'nr')\n bdry_ring = max(ring_list, key=lambda rg: rg.maxR)\n outside_point = bdry_ring.center + 2*bdry_ring.maxR # is outside all rings\n\n sorted_closed_ring_indices = ['core']\n sorted_closed_ring_i...
[ "0.66547817", "0.6604381", "0.5821195", "0.56872296", "0.56680274", "0.5609566", "0.5548704", "0.5486942", "0.5448702", "0.5442542", "0.540447", "0.5400091", "0.5396913", "0.5388861", "0.538794", "0.53742737", "0.53636485", "0.5361872", "0.53531635", "0.5348274", "0.53459334"...
0.72343975
0
Extraction of overlapping reads with a nondefault minimal overlap.
def test_overlapping_alignments_2(): generate_bam_file(gqd.sam_content, gqd.sam_bam_prefix) gqd.gene_wise_quantification._min_overlap = 5 sam = pysam.Samfile(gqd.sam_bam_prefix + ".bam") # 1 overlapping base in the 5' end of the reads => not enough assert mapping_ids(gqd.gene_wise_quantification._ov...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def combine_reads(filtered_reads, positions):\n\n\tcombined_reads = []\n\ttrue_reads = []\n\n\tfor r in filtered_reads:\n\t\t# Find associated position\n\t\tr_position = float(r.get_position())\n\t\tdesired_start = -1\n\n\t\tfor p in positions:\n\t\t\tlow_position = p - 25\n\t\t\thigh_position = p + 25\n\t\t\tif r...
[ "0.6202679", "0.5979547", "0.59313875", "0.58274823", "0.56923795", "0.5663266", "0.5656279", "0.56381226", "0.5562358", "0.5528029", "0.5521263", "0.5499392", "0.5463479", "0.5456421", "0.5451385", "0.5450649", "0.5383085", "0.53803396", "0.53411436", "0.5327845", "0.5281667...
0.61179787
1
test extract keywords with mult cols
def test_extract_multiple_columns_basic(self): keywords = ["PatientID", "SOPInstanceUID"] self.dicom.extract_keywords(keywords) # ensure columns were added columns = self.dicom.metadata.column_names if u'PatientID' not in columns: raise Exception("PatientID not added...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_guided():\n top_n = 5\n seed_keywords = [\"time\", \"night\", \"day\", \"moment\"]\n keywords = model.extract_keywords(doc_one,\n min_df=1,\n top_n=top_n,\n seed_keywords=seed_keywords)\...
[ "0.6677044", "0.6215139", "0.6187469", "0.6122244", "0.60693324", "0.5876271", "0.58554405", "0.5853709", "0.5804128", "0.5798819", "0.57620394", "0.56455034", "0.56223565", "0.5598598", "0.55157304", "0.54846966", "0.5472483", "0.546747", "0.54632664", "0.54573935", "0.54454...
0.6477459
1
test extract keyword with invalid column
def test_extract_invalid_column(self): self.dicom.extract_keywords(["invalid"]) # ensure column was added columns = self.dicom.metadata.column_names if u'invalid' not in columns: raise Exception("Invalid column not added") # compare expected and actual result ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_extract_multiple_invalid_columns(self):\n keywords = [\"invalid\", \"another_invalid_col\"]\n self.dicom.extract_keywords(keywords)\n\n # test that columns were added\n columns = self.dicom.metadata.column_names\n if u'invalid' not in columns:\n raise Exceptio...
[ "0.67696226", "0.62111384", "0.60892504", "0.5949599", "0.5847804", "0.5776143", "0.5772083", "0.5753665", "0.5750476", "0.5643494", "0.5636122", "0.5633555", "0.5622981", "0.5614792", "0.55934906", "0.5545634", "0.5531861", "0.552274", "0.5515511", "0.54943573", "0.54789686"...
0.7023457
0
test extract keyword mult invalid cols
def test_extract_multiple_invalid_columns(self): keywords = ["invalid", "another_invalid_col"] self.dicom.extract_keywords(keywords) # test that columns were added columns = self.dicom.metadata.column_names if u'invalid' not in columns: raise Exception("invalid colum...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_extract_invalid_column(self):\n self.dicom.extract_keywords([\"invalid\"])\n\n # ensure column was added\n columns = self.dicom.metadata.column_names\n if u'invalid' not in columns:\n raise Exception(\"Invalid column not added\")\n\n # compare expected and act...
[ "0.7062179", "0.6464477", "0.61323917", "0.60444987", "0.58714956", "0.5868322", "0.57832515", "0.5718176", "0.56897604", "0.5673974", "0.5634569", "0.5604178", "0.5597052", "0.55365217", "0.549694", "0.5495881", "0.548916", "0.5480683", "0.5460633", "0.54129183", "0.5369866"...
0.7282601
0
Write a content into several files.
def write(self, content): for f in self.files: f.write(content) f.flush() # Want this content is displayed immediately on file
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def writeMultipleFiles(self, filePaths, ss): \n \n for i,filePath in enumerate(filePaths): \n self.writeSingleFileLines(filePath, [ss[i]])", "def write(self, txt):\n for fp in self.files:\n fp.write(txt)", "def save(self, content_dir):\n print_verbose(\n ...
[ "0.6787142", "0.6576334", "0.6377544", "0.6341663", "0.624191", "0.6238459", "0.62333816", "0.62244797", "0.6208775", "0.61102337", "0.6087412", "0.6084252", "0.6036357", "0.60239494", "0.6023563", "0.6013627", "0.5981921", "0.5963397", "0.59628314", "0.5941813", "0.5930109",...
0.7432771
0
If "l" is exist in sys.argv or test_status is Failed then keeping the log file. If test_status is Passed and missing "l" from sys.argv then deleting log file.
def save_log(self, test_status: str = Status.FAILED): self.__log.close() sys.stdout = self.__original_stdout if test_status == Status.PASSED and Logger.__KEEP_LOG_FLAG not in sys.argv: if os.path.isfile(self.__log_file_path): os.remove(self.__log_file_path) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tearDown(self):\n if os.path.isfile(LOGFILENAME):\n os.remove(LOGFILENAME)", "def test_999_remove_testfiles(self):\n __dir_game_saves = os.path.dirname(__file__)\n __dir_game_saves = os.path.join(__dir_game_saves, 'games')\n __test_filename = consts.TEST_FILENAME\n ...
[ "0.6096151", "0.5994757", "0.5989817", "0.59152883", "0.57627594", "0.57280034", "0.5577114", "0.5575816", "0.55489534", "0.55463153", "0.5500023", "0.5493735", "0.547919", "0.54714", "0.5455382", "0.5437092", "0.5426079", "0.5415492", "0.5404435", "0.5372536", "0.53498775", ...
0.72162974
0
Create log_files folder if it is not exist.
def __init_log_folder(): try: os.makedirs(Logger.__log_dir) except OSError as e: if e.errno != errno.EEXIST: raise e
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_log_dir():\n if not os.path.exists(FLASK_APP.config[\"LOG_DIR\"]):\n os.makedirs(FLASK_APP.config[\"LOG_DIR\"])", "def _make_log_dir(self, path):\n\n try:\n os.makedirs('/'.join([self._logpath, path]))\n except OSError, e:\n # Return True if dir already exists\...
[ "0.823581", "0.78673404", "0.7663976", "0.7578191", "0.74438775", "0.7357689", "0.726618", "0.6999556", "0.69408005", "0.69014996", "0.6886535", "0.6809073", "0.67766184", "0.6761393", "0.6745055", "0.67383313", "0.6719447", "0.6610581", "0.66070086", "0.6602989", "0.6599631"...
0.80325365
1
rips should be a union of angle bins as a Dionysus simplicial complex. n is the number of data points in each bin. numbins is the number of bins of data points, EXCLUDING unions. Returns times the zigzag birth and death times (list of lists length n).
def build_zigzag_times(rips,n,numbins): times = [[] for x in range(0,rips.__len__())] i=0 for x in rips: dim = x.dimension() t = []; for k in range(0,dim+1): t.append(x[k]) xmin = math.floor(min(t)/n) xmax = math.floor(max(t)/n) if xmax == 0: bd ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def phase_bins(nbins, phase, x):\n\n min_phase, max_phase = 0, 1\n phase_bins = np.linspace(min_phase, max_phase, nbins + 1)\n x_binned, phase_binned = [], []\n x_means, Ns, per_bin_variances = [np.empty(nbins) for i in range(3)]\n for j in range(nbins):\n m = (phase_bins[j] < phase) * (phase...
[ "0.51185775", "0.505989", "0.50545937", "0.504589", "0.49802086", "0.4979069", "0.49762407", "0.49633297", "0.49416855", "0.49260277", "0.49035257", "0.48899776", "0.48686045", "0.4860368", "0.4850373", "0.48298892", "0.48205316", "0.48146975", "0.48073372", "0.47839314", "0....
0.69338244
0
Import a population seed from a pickled AEGIS object.
def get_seed(self, seed_path): try: infile = open(seed_path, "rb") obj = pickle.load(infile) if not isinstance(obj, Population): s = "Seed import failed: {} does not hold a Population\ object.".format(seed_path) self.abo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def import_data(seed: object = 42) -> object:\n\n # Read input data\n df = pd.read_csv(\"x_train_gr_smpl.csv\").astype(int)\n\n # label data-frame rows based on sample data\n for x in range(10):\n index = ~pd.read_csv(\"y_train_smpl_%s.csv\" % x, squeeze=True).astype(bool) # reversed flags (~)\...
[ "0.61895996", "0.5868044", "0.5637332", "0.5533471", "0.53152096", "0.5220497", "0.5161766", "0.51506436", "0.51140994", "0.5089465", "0.5054022", "0.5033288", "0.5019555", "0.49898914", "0.49854407", "0.49566922", "0.4949991", "0.4930906", "0.49032718", "0.48958465", "0.4887...
0.6940851
0
Import N = number of runs populations from given seed path.
def get_seed_all(self, seed_path): self.logprint("Reading seed population from ./{}".format(seed_path)) if seed_path.endswith(".pop"): self.logprint("Import succeeded.") return [self.get_seed(seed_path)] elif os.path.isdir(seed_path): pop_files = [f for f in o...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_seed(self, seed_path):\n try:\n infile = open(seed_path, \"rb\")\n obj = pickle.load(infile)\n if not isinstance(obj, Population):\n s = \"Seed import failed: {} does not hold a Population\\\n object.\".format(seed_path)\n ...
[ "0.5271225", "0.5231763", "0.50995815", "0.50318307", "0.501359", "0.5006482", "0.4980782", "0.49768418", "0.49583787", "0.49352026", "0.49234396", "0.49177733", "0.49165896", "0.49038863", "0.48806596", "0.48763213", "0.48065647", "0.478646", "0.47783965", "0.4767288", "0.47...
0.6520888
0
Print an error message to the Simulation log, then abort.
def abort(self, errtype, message): self.log += "\n{0}: {1}\n".format(errtype.__name__, message) self.endtime = timenow(False) self.log += "\nSimulation terminated {}.".format(timenow()) self.logsave() raise errtype(message)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def abort(self, msg):\n\n print\n print \"*** ERROR in module [ \" + self.name + \" ]: DEBUG INFO: \" + str(self.parent.debugInfo)\n print\n print \"*** ERROR in module [ \" + self.name + \" ]: \" + msg\n\n if (\"logfile\" in dir(self)):\n print\n print \"Lo...
[ "0.74888575", "0.71220666", "0.71215695", "0.70035875", "0.69939435", "0.6936464", "0.67833465", "0.67662495", "0.67484874", "0.6704806", "0.67036784", "0.66994905", "0.6696277", "0.6694784", "0.6692499", "0.6643295", "0.6635498", "0.66208345", "0.6586786", "0.6577234", "0.65...
0.7880541
0
Execute simulation runs in series, with no external parallelisation.
def execute_series(self): for n in xrange(self.conf["n_runs"]): self.runs[n].execute()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run(self, steps):\n self.sim.run(steps)", "def run(self):\n for worker in self.simulation_workers:\n worker.start()", "def main():\n run_simulation(spectral=False, ml=False, num_procs=1)\n run_simulation(spectral=True, ml=False, num_procs=1)\n run_simulation(spectr...
[ "0.7059126", "0.6820462", "0.6784799", "0.6616469", "0.6533175", "0.6498618", "0.647814", "0.6432363", "0.638237", "0.6335111", "0.6320436", "0.63103276", "0.6306981", "0.62909955", "0.62752616", "0.62674004", "0.625852", "0.623389", "0.6202473", "0.6198507", "0.6148332", "...
0.8158664
0
Ensure that a default exception/code is used if invalid code is provided.
def test_raise_using_invalid_code(self): with self.assertRaises(CloudantFeedException) as cm: raise CloudantFeedException('foo') self.assertEqual(cm.exception.status_code, 100)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def raise_if_exception(code):\n if isinstance(code, IndexError or Exception):\n raise code\n else:\n return code", "def from_code(code):\n builtin = _awscrt.get_corresponding_builtin_exception(code)\n if builtin:\n return builtin()\n\n name = _awscrt.get_error_name(code)\n ...
[ "0.66130775", "0.6153171", "0.61259", "0.5967256", "0.59447294", "0.58569986", "0.582162", "0.57786494", "0.5746705", "0.5723983", "0.5721174", "0.5689755", "0.5681505", "0.5680904", "0.5679687", "0.5622346", "0.5620689", "0.55826855", "0.55438507", "0.54782844", "0.5449786",...
0.63326275
1
Test constructing an infinite feed when no feed option is set
def test_constructor_no_feed_option(self): feed = InfiniteFeed(self.db, chunk_size=1, timeout=100) self.assertEqual(feed._url, '/'.join([self.db.database_url, '_changes'])) self.assertIsInstance(feed._r_session, Session) self.assertFalse(feed._raw_data) self.assertDictEqual(feed....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_constructor_with_feed_option(self):\n feed = InfiniteFeed(self.db, chunk_size=1, timeout=100, feed='continuous')\n self.assertEqual(feed._url, '/'.join([self.db.database_url, '_changes']))\n self.assertIsInstance(feed._r_session, Session)\n self.assertFalse(feed._raw_data)\n ...
[ "0.7384605", "0.6958748", "0.68842244", "0.63966936", "0.59803945", "0.55666584", "0.55181646", "0.54984444", "0.5465487", "0.5432391", "0.5425945", "0.5402392", "0.53030765", "0.52970344", "0.5292091", "0.5266229", "0.5241125", "0.5219706", "0.5172429", "0.51707923", "0.5149...
0.7717671
0
Test constructing an infinite feed when the continuous feed option is set.
def test_constructor_with_feed_option(self): feed = InfiniteFeed(self.db, chunk_size=1, timeout=100, feed='continuous') self.assertEqual(feed._url, '/'.join([self.db.database_url, '_changes'])) self.assertIsInstance(feed._r_session, Session) self.assertFalse(feed._raw_data) self....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_constructor_no_feed_option(self):\n feed = InfiniteFeed(self.db, chunk_size=1, timeout=100)\n self.assertEqual(feed._url, '/'.join([self.db.database_url, '_changes']))\n self.assertIsInstance(feed._r_session, Session)\n self.assertFalse(feed._raw_data)\n self.assertDictE...
[ "0.7359666", "0.72050756", "0.6745793", "0.5607414", "0.55818623", "0.5508452", "0.5485362", "0.54570514", "0.54559946", "0.53594476", "0.5344274", "0.53138936", "0.5304105", "0.5261766", "0.52536184", "0.5185192", "0.51846963", "0.5160076", "0.5123175", "0.51123613", "0.5069...
0.74537617
0
Test constructing an infinite feed when a feed option is set to an invalid value raises an exception.
def test_constructor_with_invalid_feed_option(self): feed = InfiniteFeed(self.db, feed='longpoll') with self.assertRaises(CloudantArgumentError) as cm: invalid_feed = [x for x in feed] self.assertEqual( str(cm.exception), 'Invalid infinite feed option: longpol...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_feed_value_throws_on_invalid_data(self):\n self.assertRaises(\n ValueError, self.factory.make_from_feed_value, \"foo\", 1\n )", "def test_constructor_no_feed_option(self):\n feed = InfiniteFeed(self.db, chunk_size=1, timeout=100)\n self.assertEqual(feed._url, '/'.j...
[ "0.72401696", "0.70973885", "0.6830153", "0.6814605", "0.6310616", "0.6292677", "0.6060589", "0.6053885", "0.6037701", "0.5884711", "0.5862154", "0.58607936", "0.5860144", "0.5858658", "0.5857198", "0.578971", "0.5787647", "0.5776569", "0.5743222", "0.5715131", "0.5706377", ...
0.8217915
0
Ensure that a CouchDB client cannot be used with an infinite feed.
def test_invalid_source_couchdb(self): with self.assertRaises(CloudantFeedException) as cm: invalid_feed = [x for x in InfiniteFeed(self.client)] self.assertEqual(str(cm.exception), 'Infinite _db_updates feed not supported for CouchDB.')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_constructor_with_invalid_feed_option(self):\n feed = InfiniteFeed(self.db, feed='longpoll')\n with self.assertRaises(CloudantArgumentError) as cm:\n invalid_feed = [x for x in feed]\n self.assertEqual(\n str(cm.exception),\n 'Invalid infinite feed opti...
[ "0.6145271", "0.6022078", "0.58353573", "0.57538754", "0.5435746", "0.536181", "0.53121054", "0.52930915", "0.51392436", "0.51142395", "0.5085797", "0.5076746", "0.50685304", "0.5026746", "0.49882182", "0.4977487", "0.49086696", "0.4906861", "0.48924825", "0.48916247", "0.488...
0.7346228
0