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
Get storage driver, preferably cached, from a pool name.
def get_driver(self, pool_id, pool_conf=None): try: return self._drivers[pool_id] except KeyError: # NOTE(cpp-cabrera): cache storage driver connection self._drivers[pool_id] = self._init_driver(pool_id, pool_conf) return self._drivers[pool_id]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_storage_backend(self):\n return self.client.info()['Driver']", "def storage_backend_get_by_name(context, name, inactive=False):\n return _find_storage_backend(context, dict(name = name), True, None, inactive=inactive)", "def _get_driver(self, driver_name):\n driver = lb_const.SERVICE_T...
[ "0.6834399", "0.68316096", "0.6733757", "0.67019266", "0.66133344", "0.6580576", "0.65020525", "0.63906044", "0.6277041", "0.6253371", "0.6227523", "0.6190082", "0.6147456", "0.61158353", "0.60346544", "0.60328054", "0.60253716", "0.6005569", "0.5980574", "0.5942194", "0.5914...
0.7380291
0
Open the URL for the given DOI in the default browser
def open_doi(doi): webbrowser.open_new_tab(DOI_URL % doi)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def open_in_browser(self):\n webbrowser.open(self.url)", "def open(url):\r\n webbrowser.open(url)", "def browser_open(story_id, arguments):\r\n\r\n story = load_story(story_id, arguments)\r\n\r\n webbrowser.open(story.url)", "def open_url(name):\n url = localReadConfig.get_webServer(name)\...
[ "0.7175303", "0.70528334", "0.6925984", "0.68447846", "0.66982275", "0.6694972", "0.654901", "0.65459543", "0.64876926", "0.6484498", "0.6445093", "0.64057773", "0.63870794", "0.6381969", "0.63739616", "0.6357972", "0.6353263", "0.62887174", "0.62686133", "0.6265236", "0.6234...
0.82702404
0
Given a FireBrowser object will then check to see if there are notifications then will go through the list and respond appropriately to them.
def run(browser: FireBrowser): midline("STATUS UPDATING") if browser.find_tab("Portal") is not -1: browser.switch_tab("Portal") elif not browser.tab_names: login.run(browser) else: login.run(browser) file = FileHandle("status") data = file.read_to_data() bro...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def notifications(self):\r\n return notifications.Notifications(self)", "def notifications(self):\r\n return notifications.Notifications(self)", "def get_user_notifications(self, login):", "async def update_cache_from_notification(self) -> List[Notification]:\n new_notifications = []\n ...
[ "0.5953895", "0.5953895", "0.5901647", "0.584553", "0.5815878", "0.58042645", "0.5801946", "0.5765564", "0.57637656", "0.5749498", "0.5722716", "0.5661563", "0.5660522", "0.56066173", "0.5565932", "0.55315346", "0.55289805", "0.5522268", "0.5481762", "0.54630154", "0.5443189"...
0.6035755
0
figure out filename (or eventually URI) of pregenerated NEMSformat recording for a given cell/batch/loader string very baphyspecific. Needs to be coordinated with loader processing in nems0.xform_helper
def generate_recording_uri(cellid, batch, loader): options = {} if loader in ["ozgf100ch18", "ozgf100ch18n"]: options = {'rasterfs': 100, 'includeprestim': True, 'stimfmt': 'ozgf', 'chancount': 18} elif loader in ["ozgf100ch18pup", "ozgf100ch18npup"]: options = {'rasterf...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getWaveformFileName(self):\n return self.waveform_info.split(\":\")[1][:20]", "def _get_output_filename(dataset_dir, split_name):\n return '%s/fer_%s.tfrecord' % (dataset_dir, split_name)", "def parse_rarefaction_fname(name_string):\r\n\r\n root, ext = os.path.splitext(name_string)\r\n root_l...
[ "0.58643293", "0.57457685", "0.5731537", "0.5680883", "0.5600236", "0.55516845", "0.55441797", "0.55333227", "0.5529272", "0.55155426", "0.54681367", "0.5426146", "0.541352", "0.5407", "0.54030865", "0.537808", "0.5370207", "0.53593916", "0.53360903", "0.5330803", "0.5321981"...
0.6297846
0
Unit test for Roybal_Student_Analytics constructor.
def test_init(self): s = Student_Analytics() self.assertEqual(len(s.data),89)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, student):\n pass", "def __init__(self, student, start_date, day_periods):\n self.student = student\n self.start_date = start_date\n self.day_periods = day_periods\n self.student_name = student.full_name_lastname_first(\n show_middle_name=False)\n ...
[ "0.6371787", "0.6314157", "0.6181478", "0.6096545", "0.6089736", "0.60254514", "0.5956355", "0.59550136", "0.594131", "0.58837605", "0.58226454", "0.5809876", "0.57946306", "0.5790085", "0.578611", "0.57836026", "0.57833344", "0.57766145", "0.5764777", "0.5755531", "0.574614"...
0.75536776
0
Unit test for Roybal_Student_Analytics classify_grade method.
def test_classify_grade(self): s = Student_Analytics() self.assertEqual(s.classify_grade(5.00),"A+")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_avg_grade(self):\n\t\ts = Student_Analytics()\n\t\tself.assertEqual(s.classify_grade(s.avg_grade(3)),\"B\")", "def classification_score(self, x, y):\t\n\t\tpass", "def test_classify(self):\n classifiers, estimates =\\\n ada_boost.train_dataset(self.larger_matrix,\n ...
[ "0.8039397", "0.65274847", "0.640173", "0.6289307", "0.6219212", "0.5914755", "0.5887433", "0.5776925", "0.5719986", "0.56444573", "0.56377053", "0.56352776", "0.56190753", "0.56097853", "0.5556611", "0.55541223", "0.55449235", "0.5517405", "0.55008376", "0.54830605", "0.5482...
0.8334534
0
Unit test for Roybal_Student_Analytics element_count method.
def test_element_count(self): s = Student_Analytics() self.assertEqual(s.element_count(2,"F"),6)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_elements_count():\n # GIVEN\n bboxes = [8.67066,49.41423,8.68177,49.4204]\n time = \"2010-01-01/2011-01-01/P1Y\"\n keys = [\"building\"]\n values = [\"\"]\n\n timestamps = [\"2010-01-01T00:00:00Z\", \"2011-01-01T00:00:00Z\"]\n counts = [53.0, 256.0]\n expected = pd.DataFrame({\"tim...
[ "0.68616205", "0.6832444", "0.67097497", "0.66983885", "0.667081", "0.66494507", "0.66494507", "0.66494507", "0.66494507", "0.6644853", "0.66385466", "0.6608439", "0.6572097", "0.64722455", "0.64489216", "0.6442627", "0.6383579", "0.63805336", "0.6367451", "0.63651866", "0.63...
0.8672462
0
Unit test for Roybal_Student_Analytics avg_grade method.
def test_avg_grade(self): s = Student_Analytics() self.assertEqual(s.classify_grade(s.avg_grade(3)),"B")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_classify_grade(self):\n\t\ts = Student_Analytics()\n\t\tself.assertEqual(s.classify_grade(5.00),\"A+\")", "def test_multiple_averages(self):\n user = self.make_user()\n enrollment = EnrollmentFactory(grade_level__school_year__school=user.school)\n GradeFactory(\n score=50...
[ "0.7095265", "0.6956697", "0.68770933", "0.68014836", "0.68014836", "0.6484994", "0.6410727", "0.6400051", "0.63546544", "0.63439816", "0.627917", "0.62735564", "0.62159175", "0.6123687", "0.6123593", "0.6098858", "0.6067414", "0.60544163", "0.5998449", "0.59840584", "0.59782...
0.8476935
0
Unit test for Roybal_Student_Analytics grade_change method.
def test_grade_change(self): s = Student_Analytics() self.assertEqual(int(s.grade_change()),0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_avg_grade(self):\n\t\ts = Student_Analytics()\n\t\tself.assertEqual(s.classify_grade(s.avg_grade(3)),\"B\")", "def test_grade(self, grade):\n self.client.login(username=self.student.username, password=self.password)\n with patch('lms.djangoapps.grades.course_grade_factory.CourseGradeFactor...
[ "0.6894253", "0.67889714", "0.6747671", "0.6735463", "0.65195036", "0.63752735", "0.63277483", "0.6276599", "0.62044054", "0.6194973", "0.6135887", "0.6101513", "0.6052034", "0.5957101", "0.5942507", "0.59255475", "0.58964777", "0.5884683", "0.58781224", "0.58647764", "0.5830...
0.8471558
0
Disconnect the underlying socket connection
def disconnect_socket(self): self.running = False if self.socket is not None: self.socket.close() self.current_host_and_port = None self.socket = None self.notify('disconnected')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def disconnect(self):\n self.connected = False\n self.socket.close()", "def disconnect(self):\n self.connected = False\n try:\n self.protocol.send_message(self.sock, '__!goodbye__')\n data = self.protocol.recover_message(self.sock)\n except:\n p...
[ "0.8091306", "0.8073663", "0.8069597", "0.7900187", "0.7873242", "0.7846093", "0.7717508", "0.7700298", "0.7663556", "0.76379234", "0.75356364", "0.7519973", "0.7475285", "0.74681747", "0.74621254", "0.7447179", "0.74322003", "0.74192196", "0.7402269", "0.7398234", "0.7384707...
0.81088334
0
Close the socket and clear the current host and port details.
def cleanup(self): try: self.socket.close() except: pass # ignore errors when attempting to close socket self.socket = None self.current_host_and_port = None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def close(self):\n print('Closing server socket (host {}, port {})'.format(self.host, self.port))\n if self.sock:\n self.sock.close()\n self.sock = None", "def close(self):\n self.socket.close()", "def close(self):\n self.socket.close()", "def close(self):\n ...
[ "0.75493366", "0.747122", "0.747122", "0.747122", "0.747122", "0.747122", "0.747122", "0.7457175", "0.7457175", "0.7422063", "0.7360431", "0.73594326", "0.7347399", "0.7302408", "0.72775865", "0.7206107", "0.71936274", "0.7185615", "0.7109103", "0.7105997", "0.70846534", "0...
0.779209
0
Returns the network connected to the tenant router. Assumes a single router with a single tenant network connected.
def _tenant_network(self): port = self._connection.network.ports.find_by_device_owner('network:router_interface') if port: return self._connection.network.networks.get(port.network_id) else: raise errors.ImproperlyConfiguredError('Could not find tenancy network')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _external_network(self):\n try:\n router = next(self._connection.network.routers.all())\n except StopIteration:\n raise errors.ImproperlyConfiguredError('Could not find tenancy router.')\n return self._connection.network.networks.get(router.external_gateway_info['netw...
[ "0.77449316", "0.7281764", "0.7092121", "0.70122546", "0.6769052", "0.6733666", "0.6733666", "0.6733666", "0.6582788", "0.65117043", "0.6201502", "0.61733115", "0.6108502", "0.60738486", "0.60403067", "0.6020271", "0.600645", "0.5939682", "0.5937701", "0.5896336", "0.58795285...
0.796581
0
Returns the external network that connects the tenant router to the outside world.
def _external_network(self): try: router = next(self._connection.network.routers.all()) except StopIteration: raise errors.ImproperlyConfiguredError('Could not find tenancy router.') return self._connection.network.networks.get(router.external_gateway_info['network_id'])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _tenant_network(self):\n port = self._connection.network.ports.find_by_device_owner('network:router_interface')\n if port:\n return self._connection.network.networks.get(port.network_id)\n else:\n raise errors.ImproperlyConfiguredError('Could not find tenancy network'...
[ "0.7765178", "0.7262986", "0.6995677", "0.6902639", "0.6894767", "0.67648536", "0.6673926", "0.66279644", "0.6617179", "0.6617179", "0.6617179", "0.64150774", "0.64139897", "0.6407208", "0.63487035", "0.6331511", "0.6266315", "0.6229477", "0.6182302", "0.6143386", "0.61390054...
0.8163727
0
Returns the cluster manager for the tenancy.
def cluster_manager(self): # Lazily instantiate the cluster manager the first time it is asked for. if not hasattr(self, '_cluster_manager'): if self._cluster_engine: self._cluster_manager = self._cluster_engine.create_manager( self._username, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetManager(self):\r\n\r\n return self.manager", "def cluster(self):\n return self._cluster", "def cluster(self):\n return self._cluster", "def get_manager(api_version=None):\n from manager import get_keystone_manager\n return get_keystone_manager(get_local_endpoint(), get_admin...
[ "0.66724825", "0.665754", "0.665754", "0.66434646", "0.663374", "0.6481853", "0.6345078", "0.6344062", "0.62795883", "0.6278968", "0.62144953", "0.60009164", "0.59885573", "0.5977996", "0.59189504", "0.5905458", "0.5904256", "0.5867709", "0.5859221", "0.58005214", "0.5737495"...
0.85531485
0
When cache is enabled, records the current request response json content in the cache file.
def set_cached_response(self) -> None: if self.get_caching_duration() > 0: # if caching is enabled for this request json_response = self._request_result.json() with open(self.cache_file_name, 'w') as json_file: json.dump(json_response, json_file, indent=4)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cache():\n if request.method == 'GET':\n cache_info = in_water.cache_info()\n return json.dumps({\n 'hits': cache_info.hits,\n 'misses': cache_info.misses,\n 'maxsize': cache_info.maxsize,\n 'currsize': cache_info.currsize,\n })", "def saveC...
[ "0.7289211", "0.71144605", "0.7006052", "0.68958193", "0.688203", "0.68352675", "0.66610754", "0.6637904", "0.6591506", "0.6493748", "0.64900154", "0.6430256", "0.6393354", "0.62931097", "0.6260045", "0.62439954", "0.62336665", "0.6196039", "0.6179128", "0.615851", "0.6150054...
0.83422124
0
Method processing the json content of a request, and returning a valid RestoRequestResult.
def process_json_result(self, json_result: dict) -> RestoRequestResult: try: resto_response = self.resto_response_cls(self, json_result) except RestoResponseError: msg = 'Response to {} from {} resto server cannot be understood.' # TOOD: move elsewhere ? r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _process(self, request, processor, operation):\n \n params = request.REQUEST.get('json', None)\n if params is None :\n params = ApiFacade._convertMergeDict(request.REQUEST)\n else :\n params=params\n params = json.loads(params)\n \n resp_bo...
[ "0.60520667", "0.5982503", "0.585078", "0.5832222", "0.5702895", "0.5620679", "0.55594456", "0.55570936", "0.555036", "0.547908", "0.54710627", "0.54656655", "0.542057", "0.54201967", "0.54093033", "0.5404972", "0.53861696", "0.534103", "0.534082", "0.5264856", "0.5264153", ...
0.6597384
0
Recommended maximum number of datapoints Returns int
def recommended_max_num_datapoints(self) -> int: # very large number, essentially no limit by default return 1e9
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def graph_data_size_max(self) -> int:\n return int(self.graph_tuple_stats.graph_data_size_max or 0)", "def get_minimum_number_of_data_points(cls):\n return cls._MINIMUM_NUMBER_OF_DATA_POINTS", "def numberOfPoints(self):\n return 20000", "def data_edge_count_max(self) -> int:\n return int(...
[ "0.74292016", "0.74018806", "0.7281152", "0.7237732", "0.7090521", "0.6958116", "0.6913622", "0.68758655", "0.6854837", "0.68302363", "0.67935854", "0.6772748", "0.6769792", "0.67452073", "0.67428017", "0.67161715", "0.66959566", "0.668196", "0.66803277", "0.6658686", "0.6651...
0.87322336
0
Saves an 'allbatteriesincluded' regressor at a given path (folder).
def save(self, path: str): os.makedirs(path, exist_ok=True) frozen = encode_indent(self) lprint(f"Saving regressor to: {path}") with open(join(path, "regressor.json"), "w") as json_file: json_file.write(frozen) for i, model in enumerate(self.models): ch...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save(self, folder):\n self.generator.save_weights('%s/generator.h5'%folder)\n self.critic.save_weights('%s/critic.h5'%folder)", "def save(self, path):\n individual = self.population.fittest_individual()\n order = [int(l) for l in individual.label_order]\n fitness = individu...
[ "0.56438905", "0.5583958", "0.5536748", "0.5505436", "0.5465258", "0.5457156", "0.5457156", "0.5457156", "0.5444318", "0.54246444", "0.54233265", "0.5392205", "0.53767943", "0.53724295", "0.5370799", "0.5340823", "0.5336824", "0.53367984", "0.5329921", "0.5313599", "0.530012"...
0.59676516
0
Returns an 'allbatteriesincluded' regressor from a given path (folder).
def load(path: str): lprint(f"Loading regressor from: {path}") with open(join(path, "regressor.json"), "r") as json_file: frozen = json_file.read() thawed = jsonpickle.decode(frozen) thawed.models = [] for i in range(thawed.num_channels): channel_path = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_drivers(dirpath):\n\n return all_drivers", "def get_all(folder, filter_funs = []) :\n\n def apply_funs(x, funs) :\n \"\"\"Applies the filter functions.\"\"\"\n res = True\n for f in funs :\n res = f(x)\n if not res :\n break\n return res\n \n final = {}\n files = listd...
[ "0.5379837", "0.5044664", "0.49726188", "0.49551898", "0.4940935", "0.4874986", "0.48747087", "0.47927487", "0.47669888", "0.47309345", "0.46937668", "0.46731636", "0.4670935", "0.46418554", "0.46351552", "0.45951054", "0.45918998", "0.45842183", "0.4548384", "0.45425668", "0...
0.5162948
1
loads the next N images from the binary mraw file into a numpy array.
def load_images(mraw, h, w, N, bit=16, roll_axis=True): if int(bit) == 16: images = np.memmap(mraw, dtype=np.uint16, mode='r', shape=(N, h, w)) elif int(bit) == 8: images = np.memmap(mraw, dtype=np.uint8, mode='r', shape=(N, h, w)) elif int(bit) == 12: warnings.warn("12bit images wi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def readData():\n\tN = 800\n\tD = 28*28\n\tX = np.zeros((N, D), dtype=np.uint8)\n\n\tf = open(\"data/a012_images.dat\", 'rb')\n\n\tfor i in range(0, N):\n\t\tX[i, :] = np.fromstring(f.read(D), dtype='uint8')\n\n\tf.close()\n\n\treturn X", "def le_binario_mgbq(filebin,nt,nc):\n return np.fromfile(fileb...
[ "0.6541903", "0.63630474", "0.6321544", "0.63167053", "0.6276605", "0.6192698", "0.6192698", "0.6186343", "0.61686295", "0.61686295", "0.61686295", "0.61686295", "0.61686295", "0.61686295", "0.61289364", "0.61266387", "0.61094004", "0.6033004", "0.60216844", "0.59940916", "0....
0.68674904
0
Utility function to read 12bit packed mraw files into uint16 array Will store entire array in memory!
def _read_uint12_video(data, shape): data = np.memmap(data, dtype=np.uint8, mode="r") fst_uint8, mid_uint8, lst_uint8 = np.reshape(data, (data.shape[0] // 3, 3)).astype(np.uint16).T fst_uint12 = (fst_uint8 << 4) + (mid_uint8 >> 4) snd_uint12 = ((mid_uint8 % 16) << 8) + lst_uint8 return np.reshape(n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unpack_mraw_frame_12bit(file,n_pixels,start_frame=0):\n \n start_byte = start_frame*n_pixels*12/8\n file.seek(start_byte)\n image = []\n \n n_bytes = n_pixels*12/8\n \n int_array = np.fromfile(file,count=n_bytes,dtype=np.uint8)\n \n bytes_1 = int_array[::3]\n bytes_2 = int_arra...
[ "0.68789697", "0.68381524", "0.66513246", "0.6528", "0.6359484", "0.6214181", "0.6206337", "0.6118009", "0.60529387", "0.60003304", "0.5936918", "0.593421", "0.59340906", "0.5930919", "0.58940655", "0.5846712", "0.58181554", "0.5809074", "0.5799255", "0.5763211", "0.5753879",...
0.70496243
0
precompiled function to efficiently covnert from 12bit packed video to 16bit video it splits 3 bytes into two 16 bit words data_chunk is a contigous 1D array of uint8 data, e.g. the 12bit video loaded as 8bit array
def nb_read_uint12(data_chunk): #ensure that the data_chunk has the right length assert np.mod(data_chunk.shape[0],3)==0 out = np.empty(data_chunk.size//3*2, dtype=np.uint16) for i in nb.prange(data_chunk.shape[0]//3): fst_uint8=np.uint16(data_chunk[i*3]) mid_uint8=np.uint16(data_chunk[i*3+1]) l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _read_uint12_video(data, shape):\n data = np.memmap(data, dtype=np.uint8, mode=\"r\")\n fst_uint8, mid_uint8, lst_uint8 = np.reshape(data, (data.shape[0] // 3, 3)).astype(np.uint16).T\n fst_uint12 = (fst_uint8 << 4) + (mid_uint8 >> 4)\n snd_uint12 = ((mid_uint8 % 16) << 8) + lst_uint8\n return ...
[ "0.6967046", "0.61986065", "0.6189992", "0.61811805", "0.6017552", "0.60136306", "0.59860003", "0.5980767", "0.58180374", "0.5771538", "0.5734991", "0.5357844", "0.53522146", "0.53145593", "0.52839905", "0.52355176", "0.5201002", "0.5169548", "0.51465833", "0.5143027", "0.513...
0.6670928
1
compute the 3DRMSE between a predicted 3D face shape and the 3D ground truth scan.
def _report_3d_rmse(self, res_file): pred_vertices, gt_vertices, _ = self._parse_result( res_file, mode='vertice') pred_keypoints3d, gt_keypoints3d, _ = self._parse_result( res_file, mode='keypoint') errors = [] for pred_vertice, gt_vertice, pred_points, gt_points...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def evaluate_3d(self, box_point_3d, instance):\n azimuth_error, polar_error = self.evaluate_viewpoint(box_point_3d, instance)\n iou = self.evaluate_iou(box_point_3d, instance)\n return azimuth_error, polar_error, iou", "def get_3d_points(preds_3d):\n for i,p in enumerate(preds_3d):\n preds_3d[...
[ "0.57921743", "0.5499897", "0.5472451", "0.52560514", "0.5251211", "0.52303135", "0.51892173", "0.518625", "0.5166288", "0.5151563", "0.514771", "0.511312", "0.5067872", "0.50428575", "0.5011078", "0.49873042", "0.49712166", "0.49459213", "0.49200428", "0.4919663", "0.4918488...
0.60341465
0
Print lots of basic information about the given presentation.
def debug_dump(prs:Presentation): print("Presentation has", len(prs.slides), "slides") # Print summary of all slides, plus text n = 0 for slide in prs.slides: n += 1 print("========== slide {} ========== [{}]".format(n, slide.slide_layout.name)) for shape in slide.shapes: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Print(self):\n\n\t\tif self.verbose:\n\n\t\t print (\"\\033[1m[HEADER]\\033[0m\")\n\t\t print (\"code:\\t\\t%s\" % self.kod)\n\t \tprint (\"version:\\t%s\" % self.ver)\n\t\t print (\"date and time:\\t%s\" % self.probid)\n\t\t print (\"dump number:\\t%s\" % self.knod)\n\t ...
[ "0.6639509", "0.6288107", "0.6238363", "0.62220323", "0.6204376", "0.6180137", "0.6151986", "0.61489", "0.6128701", "0.6115834", "0.6007176", "0.59872526", "0.59838665", "0.596641", "0.59656215", "0.59383917", "0.59287095", "0.5924039", "0.590953", "0.5906681", "0.5902103", ...
0.7133029
0
Count the amount of text in each slide.
def get_word_counts(slides) -> List[int]: word_count = [] for slide in slides: # print(f"========== slide {len(text_count)+1} ========== [{slide.slide_layout.name}]") words = 0 # find all text for shape in slide.shapes: if not shape.has_text_frame: con...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_slide_analytics_new(slides) -> List[int]:\n word_count = []\n for slide in slides:\n print(slide)\n words = 0\n for shape in slide.shapes:\n if not shape.has_text_frame:\n continue\n print(shape.name)\n for paragraph in shape.text_f...
[ "0.7645021", "0.699523", "0.6631901", "0.65998024", "0.65277624", "0.65032226", "0.63644123", "0.63634205", "0.6349974", "0.6309825", "0.6171061", "0.6156245", "0.6148901", "0.60785764", "0.60774815", "0.6072669", "0.603562", "0.59676707", "0.59530956", "0.59443533", "0.59265...
0.75697744
1
Calculates a onetofive star ranking for presentations that are not too textheavy.
def calculate_text_stars(word_counts) -> int: if word_counts == []: return 3 words_per_slide = sum(word_counts) / len(word_counts) stars = 5 - abs(words_per_slide - 35) / 8 # print(stars) return max(0, min(5, int(stars + 0.5)))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sentiment(text):\n words = pattern_split.split(text.lower())\n sentiments = map(lambda word: afinn.get(word, 0), words)\n if sentiments:\n # How should you weight the individual word sentiments? \n # You could do N, sqrt(N) or 1 for example. Here I use sqrt(N)\n sentiment = float(...
[ "0.5887334", "0.57918924", "0.57401806", "0.5696041", "0.56602454", "0.56410843", "0.5623116", "0.5621459", "0.55914843", "0.5587887", "0.55824214", "0.55516285", "0.553804", "0.55314225", "0.5495516", "0.54903185", "0.5481853", "0.5480828", "0.54778075", "0.54706895", "0.546...
0.5987914
0
Counts how many times each PPT layout is used. Returns the total number of interactive layouts, plus a dictionary of the layout counts.
def count_layouts(prs:Presentation) -> Tuple[int, Dict[str, int]]: layouts = collections.defaultdict(int) layouts_interactive = 0 for slide in prs.slides: layouts[slide.slide_layout.name] += 1 if slide.slide_layout.name in INTERACTIVE: layouts_interactive += 1 return (layouts...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getNumLayouts(self):\n return _libsbml.LayoutModelPlugin_getNumLayouts(self)", "def pobj_counts(pcode_obj):\n pcode = (pcode_obj.asDict())['pcode'][0] # no multiple pcode blocks - no delimiter\n counts = {'galleries': 0, 'spreads': 0, 'layouts': 0, 'panelgroups': 0}\n # , 'panels': 0, 'skips...
[ "0.6073172", "0.60642576", "0.5786426", "0.57859993", "0.57683474", "0.5574106", "0.54529566", "0.5449059", "0.539238", "0.53353953", "0.5332541", "0.53282636", "0.53045416", "0.52998465", "0.5298258", "0.52905923", "0.5276604", "0.52639884", "0.5256031", "0.52523476", "0.523...
0.8039856
0
Count the amount of text in each slide.
def get_slide_analytics_new(slides) -> List[int]: word_count = [] for slide in slides: print(slide) words = 0 for shape in slide.shapes: if not shape.has_text_frame: continue print(shape.name) for paragraph in shape.text_frame.paragraph...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_word_counts(slides) -> List[int]:\n word_count = []\n for slide in slides:\n # print(f\"========== slide {len(text_count)+1} ========== [{slide.slide_layout.name}]\")\n words = 0\n # find all text\n for shape in slide.shapes:\n if not shape.has_text_frame:\n ...
[ "0.75697744", "0.699523", "0.6631901", "0.65998024", "0.65277624", "0.65032226", "0.63644123", "0.63634205", "0.6349974", "0.6309825", "0.6171061", "0.6156245", "0.6148901", "0.60785764", "0.60774815", "0.6072669", "0.603562", "0.59676707", "0.59530956", "0.59443533", "0.5926...
0.7645021
0
Analyses a presentation and returns a dictionary of starratings, plus extra details. Works best on presentations that use the LIFTS template, with known layout names.
def analyse_presentation(pres_name:str, verbose=False) -> Dict[str, Any]: prs = Presentation(pres_name) if verbose: debug_dump(prs) (layouts_interactive, layouts) = count_layouts(prs) interaction_stars = min(layouts_interactive, 5) topic_stars = ([1,1,3,5,5,4,3,2,1]+[1]*100)[layouts["Section...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def analyze_pptx(template_file):\n prs = Presentation(template_file)\n # Each powerpoint file has multiple layouts\n # Loop through them all and see where the various elements are\n slide_masters = prs.slide_masters\n for index, slide_master in enumerate(prs.slide_masters):\n print('--------...
[ "0.57579595", "0.5754335", "0.55619776", "0.545294", "0.5446325", "0.51942104", "0.51507777", "0.51323617", "0.5105886", "0.5052227", "0.5037823", "0.49726292", "0.4881835", "0.4851375", "0.48495308", "0.48304343", "0.48082933", "0.47642702", "0.4755273", "0.47469255", "0.474...
0.74647856
0
Return information about a particular squences.
def get_study_info(self,std_id): raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getSongTextInfo():\n sids = []\n documents = []\n sFile = open('../txt/two__Lastfm_song_Docs.txt')\n lines = sFile.readlines()\n index = 0\n for line in lines:\n line.strip('\\n')\n line.strip('\\r\\n')\n items = line.split('>>')\n sid = int(items[0])\n text = items[1]\n documents.appen...
[ "0.5863178", "0.5489143", "0.54585916", "0.5428158", "0.536509", "0.53436375", "0.53430116", "0.53390235", "0.532284", "0.529443", "0.52938986", "0.5290507", "0.52477586", "0.5244924", "0.5206089", "0.5205835", "0.5202415", "0.51880074", "0.51695544", "0.513454", "0.51211977"...
0.55018765
1
Export the settings as a DOM node.
def _exportNode(self): node = ZCatalogXMLAdapter._exportNode(self) self._logger.info('Person Catalog settings exported.') return node
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _exportNode(self):\n node = self._extractProperties()\n self._logger.info('settings exported.')\n return node", "def saveToXml(self) -> org.jdom.Element:\n ...", "def to_xml(self):\r\n element = ET.Element(\"node\")\r\n\r\n element.attrib['name'] = self.name\r\n ...
[ "0.7224327", "0.56396407", "0.5610303", "0.55762726", "0.5313067", "0.5309712", "0.5301959", "0.5281795", "0.52664566", "0.5236637", "0.52181643", "0.5208334", "0.51855683", "0.517911", "0.51764274", "0.51666445", "0.5144142", "0.5129619", "0.5117044", "0.51037055", "0.510011...
0.63378537
1
Import the settings from the DOM node.
def _importNode(self, node): ZCatalogXMLAdapter._importNode(self, node) self._logger.info('Person Catalog settings imported.')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _importNode(self, node):\n if self.environ.shouldPurge():\n self._purgeProperties()\n self._initProperties(node)\n self._logger.info('settings imported.')", "def load_settings(self):\n\n self.std = settings.settings", "def __init__(self, settings_xml):\n # The list...
[ "0.6894675", "0.54793346", "0.5375706", "0.5349439", "0.5210967", "0.50370497", "0.4952911", "0.49231037", "0.48926273", "0.48800564", "0.48647884", "0.48480543", "0.4817451", "0.48003417", "0.47981542", "0.4741064", "0.47284755", "0.4716894", "0.46843192", "0.46814933", "0.4...
0.58705205
1
Geocode address of the same county in quarter fashion
def partition_geocode(con: sqlite3.Connection, cur: sqlite3.Cursor, quarter: str, county_cht: str): cur.execute('''SELECT 土地區段位置或建物區門牌 FROM "{0}/TRX" WHERE 縣市 = ? GROUP BY 土地區段位置或建物區門牌;'''.format(quarter), (county_cht,)) for address, in cur.fetchall(): cur.execute('...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def geo_coder(house_number, boro_code, street_name, zip_code): \r\n wa1 = '1B{}{}{}{}{}C{}{}'.format(rightpad(house_number, 16), rightpad('', 38), boro_code, rightpad('', 10), rightpad(street_name, 32), rightpad('', 113), rightpad(zip_code, 5))\r\n wa1 = rightpad(wa1, 1200)\r\n wa2 = rightpad('', 4300...
[ "0.6251422", "0.6227843", "0.60835624", "0.59131515", "0.585577", "0.5806368", "0.57388103", "0.5738554", "0.5722705", "0.5614146", "0.5594229", "0.55850214", "0.5574379", "0.5574237", "0.5490394", "0.54893243", "0.5472008", "0.5418318", "0.5418175", "0.53998554", "0.5397736"...
0.6954527
0
This creates the generator object yielding squares of the number
def generate_square_number(square_limit): for i in range(0,square_limit): yield i**2
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def square_numbers_2(nums):\n for i in nums:\n yield(i*i)", "def perfect_sq_seq_gen(num):\n for i in range(num):\n yield i ** 2", "def gensquares(n):\n for number in my_range.my_range(n): # note that we are NOT calling range(N), we implemented our own my_range() generator\n yiel...
[ "0.76812726", "0.7570587", "0.7127406", "0.7013921", "0.6935942", "0.6566116", "0.65498954", "0.65378404", "0.65034443", "0.6499686", "0.64733166", "0.6452493", "0.6364364", "0.6352053", "0.6324538", "0.63203084", "0.62623084", "0.6218521", "0.6207027", "0.6205454", "0.619938...
0.7852594
0
Returns a 2D Laplacian kernel array.
def get_laplacian_kernel(kernel_size) -> torch.Tensor: kernel: torch.Tensor = get_laplacian_kernel2d(kernel_size) return kernel
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_laplacian_kernel2d(kernel_size: int) -> torch.Tensor:\n if not isinstance(kernel_size, int) or kernel_size % 2 == 0 or \\\n kernel_size <= 0:\n raise TypeError(\"ksize must be an odd positive integer. Got {}\"\n .format(kernel_size))\n\n kernel = torch.ones((k...
[ "0.68943256", "0.5928996", "0.5873876", "0.5794534", "0.5719824", "0.568754", "0.5661878", "0.56419665", "0.5635752", "0.5564691", "0.5545013", "0.553446", "0.54953605", "0.5416252", "0.5343913", "0.53213376", "0.5320362", "0.5318403", "0.5306929", "0.5298269", "0.52873653", ...
0.66206235
1
r"""Function that returns a tensor using a Laplacian filter. The operator smooths the given tensor with a laplacian kernel by convolving it to each channel. It suports batched operation.
def laplacian(src: torch.Tensor, kernel_size: int) -> torch.Tensor: return Laplacian(kernel_size)(src)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _laplacian_to_image(lpyr, filter_vec, coeff):\n im = lpyr[-1]\n filter_vec = filter_vec.reshape(filter_vec.size, 1)\n for i in reversed(range(len(lpyr) - 1)):\n im = _expand(im, filter_vec) + coeff[i] * lpyr[i]\n\n return im", "def lapsharp(image, maskret = False):\n #padded_image =...
[ "0.6398194", "0.6261045", "0.6243763", "0.6211535", "0.6126479", "0.6089628", "0.60353637", "0.59343386", "0.5885602", "0.58751994", "0.5864428", "0.58093095", "0.58002144", "0.5674847", "0.56685555", "0.5641529", "0.55820704", "0.5570494", "0.55570203", "0.5538427", "0.55247...
0.7140893
0
Sort the list first, then take the last two number (biggest) and multiply them
def max_pairwise_product_sort(numbers): sorted_list = sorted(numbers) ans = sorted_list[-1]*sorted_list[-2] return ans
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def greatest_difference(num_list):", "def highest_product_2(arr):\n\n # make a list to store the highest three ints, initializing to first three\n maxes = [arr[0], arr[1], arr[2]]\n\n # find the lowest of the highest three ints\n lowest_max = min(maxes)\n\n # go through the rest of the list to che...
[ "0.6987764", "0.685001", "0.66746044", "0.66537255", "0.6615918", "0.66083395", "0.6553763", "0.64379936", "0.64302796", "0.6412502", "0.6391118", "0.63837785", "0.6367723", "0.6360329", "0.633378", "0.6331884", "0.63131255", "0.6293756", "0.628999", "0.6283172", "0.6250778",...
0.7739796
0
Cancel the execution of an evaluation of a MATLAB statement. Returns bool True if the corresponding MATLAB statement can be cancelled; False otherwise. Raises RejectedExecutionError an error occurs if the engine is terminated.
def cancel(self): self.__validate_engine() return pythonengine.cancelFEval(self._future)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cancelled(self):\n self.__validate_engine()\n return pythonengine.isCancelledFEval(self._future)", "def cancel(self):\n if not self.is_cancelled:\n self.will_change_value_for('is_cancelled')\n self.cancelled = True\n # remove our dependencies so that we're ready, properly beha...
[ "0.63782734", "0.6360038", "0.570138", "0.567854", "0.5647722", "0.5620772", "0.5620772", "0.5620772", "0.5620772", "0.5569046", "0.5432427", "0.53818804", "0.53624535", "0.5357489", "0.5344577", "0.53426117", "0.53072584", "0.5285678", "0.52575773", "0.52286595", "0.5207874"...
0.67627895
0
Obtain the cancellation status of the asynchronous execution of a MATLAB command. Returns bool True if the execution is cancelled; False otherwise. Raises RejectedExecutionError an error occurs if the engine is terminated.
def cancelled(self): self.__validate_engine() return pythonengine.isCancelledFEval(self._future)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cancel(self):\n self.__validate_engine()\n return pythonengine.cancelFEval(self._future)", "def cancelled(self):\n return self._status == Future.STATUS_CANCELED", "async def cancelled(self):\n await self._refresh_and_update()\n return (\n self._operation.HasFie...
[ "0.57483846", "0.5747091", "0.5745746", "0.5590403", "0.55467594", "0.55077934", "0.55016315", "0.5491056", "0.5442433", "0.5399497", "0.5271981", "0.5269121", "0.5266887", "0.5225791", "0.5185286", "0.5151515", "0.51362634", "0.5117819", "0.51172787", "0.50527465", "0.502697...
0.6059455
0
Test POST a start call registry and expect a response from API containing a job_id and the data posted. Test uses start_call_fx fixture
def test_POST_a_call_and_expect_job_id_and_data_posted(client, start_call_fx): url = reverse_lazy('calls:registry-list') response = client.post(url, start_call_fx, content_type='application/json') response_data = response.json() assert response.status_code == status.HTTP_201_CREATED assert 'job_i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_post_a_start_call_and_recover_it_using_a_GET_request(client, start_call_fx):\n\n url = reverse_lazy('calls:registry-list')\n\n post_request = client.post(url,\n start_call_fx,\n content_type='application/json')\n\n assert post_request.st...
[ "0.80795336", "0.7127848", "0.70870763", "0.70252454", "0.690225", "0.682077", "0.6728949", "0.64632064", "0.61601955", "0.61388147", "0.6122343", "0.61069036", "0.598875", "0.5923191", "0.5838878", "0.5811853", "0.581069", "0.5795599", "0.5779675", "0.5745532", "0.5728147", ...
0.8062351
1
Test the job_id URL of a start call registry POST. Test uses start_call_fx fixture
def test_expect_200Ok_response_GETting_a_job_id_URL(client, start_call_fx): url = reverse_lazy('calls:registry-list') response = client.post(url, start_call_fx, content_type='application/json') response_data = response.json() task_url = response_data.get('job_id', None) task_response = client.ge...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_post_a_start_call_and_recover_it_using_a_GET_request(client, start_call_fx):\n\n url = reverse_lazy('calls:registry-list')\n\n post_request = client.post(url,\n start_call_fx,\n content_type='application/json')\n\n assert post_request.st...
[ "0.7932951", "0.7636372", "0.7201175", "0.70154786", "0.69145167", "0.66262203", "0.626443", "0.62300295", "0.61841965", "0.60890883", "0.5921425", "0.58591396", "0.58441097", "0.57225126", "0.57005316", "0.56909", "0.5625876", "0.55742955", "0.5544029", "0.55416805", "0.5526...
0.784503
1
Test if there is a 'status' property in a response about registry process, and if it contains a 'DONE' status about this task. Test uses start_call_fx fixture
def test_expect_status_property_about_registry_process(client, start_call_fx): url = reverse_lazy('calls:registry-list') response = client.post(url, start_call_fx, content_type='application/json') job_id = response.data.get('job_id') job = client.get(job_id) assert job.data.get('status') == 'DO...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_expect_data_posted_return_encapsulated_on_message_property_on_response(client, start_call_fx):\n\n url = reverse_lazy('calls:registry-list')\n\n response = client.post(url, start_call_fx, content_type='application/json')\n\n job_id = response.data.get('job_id')\n\n job = client.get(job_id)\n\n...
[ "0.6107858", "0.6048469", "0.6048469", "0.60329425", "0.5998805", "0.59744084", "0.59617215", "0.59564376", "0.5914125", "0.5885923", "0.5870812", "0.58333784", "0.58272076", "0.5810825", "0.5786063", "0.57617617", "0.57480896", "0.5696804", "0.5684844", "0.5677295", "0.56715...
0.81807953
0
Test POST a start call registry to registry API and expect recover it using a GET request. Test uses start_call_fx fixture
def test_post_a_start_call_and_recover_it_using_a_GET_request(client, start_call_fx): url = reverse_lazy('calls:registry-list') post_request = client.post(url, start_call_fx, content_type='application/json') assert post_request.status_code == ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_post_a_start_and_stop_registry_and_get_a_call(client, start_call_fx,\n stop_call_fx):\n\n post_url = reverse_lazy('calls:registry-list')\n\n post_data = [start_call_fx, stop_call_fx]\n\n for data in post_data:\n response = client.post(p...
[ "0.77212137", "0.7614569", "0.7375702", "0.69436055", "0.68681324", "0.6717918", "0.66508937", "0.63880897", "0.62512255", "0.61260146", "0.58564955", "0.5841628", "0.5779191", "0.57728964", "0.57675964", "0.56549394", "0.55403256", "0.54902625", "0.54620844", "0.5461441", "0...
0.85472727
0
Test a GET request on the Call API Endpoint and expect it return 200 Ok
def test_GET_call_api_and_return_200Ok(client): url = '/api/v1/calls/' response = client.get(url) assert response.status_code == status.HTTP_200_OK
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get(self):\n self.assertEqual(200, self.resp.status_code)", "def test_get(self):\n self.assertEqual(200, self.resp.status_code)", "def test_1():\n\tassert api_call().status_code == 200", "def test_get(self):\n self.assertEqual(200, self.response.status_code)", "def test_get(se...
[ "0.7947968", "0.7947968", "0.7879138", "0.77913356", "0.77913356", "0.77886796", "0.76140255", "0.75884384", "0.7562267", "0.75419384", "0.75371504", "0.75371504", "0.7369333", "0.7351754", "0.7339209", "0.73001033", "0.72693115", "0.7259427", "0.72563964", "0.721277", "0.719...
0.8886346
0
Test if there is a Call API endpoint and if is defined as "calls" namespace and "calllist" as his name
def test_namespace_of_call_api_endpoint(): url = '/api/v1/calls/' resolved = resolve(url) assert resolved.namespace == 'calls'\ and resolved.url_name == 'call-list'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_call_api_return_only_consolidated_calls(client, start_call_fx, stop_call_fx):\n\n post_url = reverse_lazy('calls:registry-list')\n\n start_call_fx_2 = copy(start_call_fx)\n start_call_fx_2['call_id'] = 2\n\n post_data = [start_call_fx, start_call_fx_2, stop_call_fx]\n\n for data in post_dat...
[ "0.62145686", "0.6031098", "0.597374", "0.59650505", "0.5733628", "0.55599207", "0.54912245", "0.54800916", "0.54037213", "0.5337027", "0.531804", "0.523795", "0.5225318", "0.5171135", "0.516988", "0.51654184", "0.5162458", "0.51472855", "0.51333857", "0.5127361", "0.5116722"...
0.77283394
0
Test for documentation on Call API Endpoint view
def test_documentation_for_call_view(): url = reverse_lazy('calls:call-list') view = resolve(url).func assert view.__doc__
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_view_detail_as_method(self):\n url = reverse(\n \"django-admindocs-views-detail\",\n args=[\"django.contrib.admin.sites.AdminSite.index\"],\n )\n response = self.client.get(url)\n self.assertEqual(response.status_code, 200)", "def test_view():\n\treturn ...
[ "0.6804205", "0.65882033", "0.6567295", "0.6547328", "0.6524265", "0.64814574", "0.6474007", "0.6394351", "0.6393633", "0.6392588", "0.6389973", "0.62900865", "0.62861174", "0.62557405", "0.62550545", "0.6218095", "0.61950505", "0.61669517", "0.61537933", "0.6125932", "0.6122...
0.7911585
0
Test POSTing a start and a stop registry and expect get it at Call API Endpoint Test uses start_call_fx fixture Test uses stop_call_fx fixture
def test_post_a_start_and_stop_registry_and_get_a_call(client, start_call_fx, stop_call_fx): post_url = reverse_lazy('calls:registry-list') post_data = [start_call_fx, stop_call_fx] for data in post_data: response = client.post(post_url, data...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_post_a_start_and_stop_registry_and_get_a_call_using_url(client,\n start_call_fx,\n stop_call_fx):\n\n post_url = reverse_lazy('calls:registry-list')\n\n post_data = [start_...
[ "0.8207508", "0.7297929", "0.7013963", "0.6848967", "0.6562138", "0.64560413", "0.6252057", "0.6184207", "0.61758155", "0.6018559", "0.59301925", "0.5880597", "0.5861513", "0.58101547", "0.57913876", "0.57734543", "0.5742188", "0.57399577", "0.57374406", "0.5709208", "0.56703...
0.85035634
0
Test POSTing a start and a stop registry and expect get it at Call API Endpoint using a call_id Test uses start_call_fx fixture Test uses stop_call_fx fixture
def test_post_a_start_and_stop_registry_and_get_a_call_using_url(client, start_call_fx, stop_call_fx): post_url = reverse_lazy('calls:registry-list') post_data = [start_call_fx, st...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_post_a_start_and_stop_registry_and_get_a_call(client, start_call_fx,\n stop_call_fx):\n\n post_url = reverse_lazy('calls:registry-list')\n\n post_data = [start_call_fx, stop_call_fx]\n\n for data in post_data:\n response = client.post(p...
[ "0.8484062", "0.75393564", "0.7322953", "0.722341", "0.6426046", "0.62504566", "0.6230039", "0.6164438", "0.59421086", "0.59283173", "0.5919254", "0.58633626", "0.58341634", "0.58131343", "0.5774062", "0.57502663", "0.56712496", "0.5646838", "0.56402326", "0.5634627", "0.5630...
0.8285663
1
Plot balance between classes
def plot_balance_class(classes): unique, counts = np.unique(classes, return_counts=True) plt.bar(unique, counts) plt.title('Class Frequency') plt.xlabel('Class') plt.ylabel('Frequency') plt.show()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_class_imbalance(df, title='Class Imbalance', PATH=None):\n ax = sns.barplot(x=[\"Normal\", \"Clickbait\"], y=df.groupby(['target']).target.count())\n ax.set_title(title, size=20)\n plt.xticks([0,1],[\"Normal\", \"Clickbait\"], size = 20)\n ax.set_ylabel(\"Document Count\", size=17)\n ax.set...
[ "0.6470689", "0.62615764", "0.618939", "0.5848157", "0.58320725", "0.5751623", "0.5716817", "0.5682445", "0.56821924", "0.56675744", "0.5648744", "0.5599107", "0.5581174", "0.5550323", "0.5517062", "0.5514832", "0.54800415", "0.54709786", "0.5425537", "0.54238087", "0.5382205...
0.7392071
0
Find best parameters for decision tree
def find_best_classifier(x_train, x_test, y_train, y_test): max_depth, _ = find_best_parameters( 'max_depth', list(range(1, 30)), x_train, x_test, y_train, y_test) print("Best max_depth t: ", max_depth) min_samples_split, _ = find_best_parameters( 'min_samples_split', list(range(2, 4...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def select_model():\r\n from sklearn import tree\r\n import graphviz\r\n\r\n ValidationSetAndLabels = AllSets[1]\r\n ValLabels = ValidationSetAndLabels[:, [-1]] # extract labels (last column)\r\n ValSet = np.delete(ValidationSetAndLabels, -1, axis=1) # delete labels\r\n\r\n TrainingSetAndLabels =...
[ "0.73654014", "0.6803678", "0.6700777", "0.669526", "0.6686797", "0.6683199", "0.6660834", "0.6638287", "0.65660405", "0.65332466", "0.65164715", "0.64410394", "0.64108276", "0.64031994", "0.6387443", "0.6330438", "0.62947744", "0.6267406", "0.6226899", "0.62210745", "0.61950...
0.74380594
0
Find overlapping CDS within an exon given a list of CDS starts
def find_overlapping_cds_simple(v_start, v_stop, cds_begins, strand): # cds_start = cds_begin[0] if strand == '+': return list(filter(lambda x: x[0] >= v_start and x[0] < v_stop, cds_begins)) else: return list(filter(lambda x: x[0] > v_start and x[0] <= v_stop, cds_begins))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def overlap(list1,list2):\n \n coord=[]\n for pos1 in list1:\n #print 'pos in list1 is', pos1\n coord.append(('S',int(pos1.split('-')[0]), 'l1'))\n #print 'S is ', pos1.split('-')[0]\n coord.append(('E',int(pos1.split('-')[1]),'l1'))\n #print 'E is ', pos1.split('-')[1]\...
[ "0.6343779", "0.5909693", "0.5851059", "0.57616645", "0.5732729", "0.568256", "0.5675713", "0.56729394", "0.5659118", "0.56387144", "0.5623953", "0.558914", "0.5588006", "0.5570414", "0.55475664", "0.5545426", "0.5528489", "0.5526816", "0.5525146", "0.5520476", "0.5492296", ...
0.7374044
0
Encodes chromosome to same cn
def encode_chromosome(in_num): convert_dict = {23: "X", 24: "Y", 25: "MT"} return convert_dict[in_num] if in_num in convert_dict else str(in_num)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __encode(self):\n\n for i, char in enumerate(self.__chars):\n self.__char2idx[char] = i\n self.__idx2char[i] = char", "def encode(self, C, num_rows):\n x = np.zeros((num_rows, len(self.chars)))\n print(C)\n for i, c in enumerate(C):\n x[i, self.cha...
[ "0.65794533", "0.62438995", "0.6232326", "0.62068266", "0.6048946", "0.5984779", "0.5922863", "0.5862185", "0.5761406", "0.57606995", "0.5690487", "0.56302047", "0.5617058", "0.5587301", "0.5558331", "0.5556066", "0.5555711", "0.55398685", "0.54918736", "0.54819953", "0.54703...
0.7192931
0
Get the mutated dna subsequence according to mutation specified by the variant_comb.
def get_sub_mut_dna(background_seq, coord, variant_comb, somatic_mutation_sub_dict, strand, gene_start): def _get_variant_pos_offset(variant_pos, coord_pair_list, strand): offset = 0 takes_effect = False for p1,p2 in coord_pair_list: if variant_pos >= p1 and variant_pos < p2: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_DNA_seq(mutant_position, all_lines):\n\n dna_lines = []\n for i in range(mutant_position + 2, len(all_lines)):\n line = all_lines[ i ]\n if not line:\n break\n\n line = line.replace(\"Variant sequence: \", \"\")\n dna_lines.append(line)\n return dna_lines", ...
[ "0.5627289", "0.5542037", "0.5341807", "0.5279429", "0.49878958", "0.4956177", "0.49556637", "0.49054444", "0.4834147", "0.48148525", "0.47234476", "0.4720456", "0.4699101", "0.46727768", "0.4651557", "0.46446463", "0.46332493", "0.46132207", "0.46070266", "0.45562443", "0.45...
0.695729
0
Get all combinations of items in the given array Specifically used for generating variant combination
def get_all_comb(array, r=None): if r is None: r = len(array) return [_ for i in range(1, r + 1) for _ in itertools.combinations(array, i)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def combinations(arrays):\n return np.array(np.meshgrid(*arrays)).T.reshape(-1, len(arrays))", "def combos(array,n=2): \n # base case\n if n==0:\n yield frozenset()\n return\n\n # core recursion\n for c in set(combos(array,n-1)):\n for i in array:\n #added this t...
[ "0.73074627", "0.7185561", "0.6950121", "0.67702305", "0.67702305", "0.6750947", "0.6720031", "0.6644649", "0.6399782", "0.63772047", "0.63587743", "0.6318727", "0.62932175", "0.62885773", "0.62456626", "0.6200499", "0.6191303", "0.61892384", "0.61841613", "0.6181527", "0.616...
0.79023576
0
Indicate if a peptide is translated by an isolated cds Currently, it is a simple version. If the exon where the cds is has no connected exon, it is isolated. (the method is not true in some cases)
def is_isolated_cds(gene, gene_info, idx): if len(gene_info.vertex_succ_list[idx]) > 0: return False return np.sum(gene.splicegraph.edges[:, idx]) == 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_isolated(self, d):\n if not self.center.is_isolated(d):\n return False\n\n for i in self.leads:\n if not i.is_isolated(d+1):\n return False\n\n return True", "def is_atomic(self):\n found = True\n if self.ant is not None:\n ...
[ "0.59894097", "0.5898949", "0.5672679", "0.5648508", "0.5560285", "0.5529773", "0.5459054", "0.54222125", "0.541582", "0.5374678", "0.53390956", "0.53365326", "0.53323716", "0.5328659", "0.52947295", "0.5285229", "0.5278996", "0.5277022", "0.5254552", "0.5249883", "0.5224548"...
0.6469092
0
Get the segment expression for one exonpair. Apply 'get_exon_expr' for each exon and concatenate them.
def get_segment_expr(gene, coord, countinfo, Idx, seg_counts, cross_graph_expr): if coord.start_v3 is None: expr_list = np.vstack([get_exon_expr(gene, coord.start_v1, coord.stop_v1, countinfo, Idx, seg_counts ), get_exon_expr(gene, coord.start_v2, coord.stop_v2, countinfo, Idx...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_exon_expr(gene, vstart, vstop, countinfo, Idx, seg_counts):\n out_shape = (seg_counts.shape[1] + 1) if len(seg_counts.shape) > 1 else 2\n # Todo: deal with absense of count file\n if vstart is np.nan or vstop is np.nan: # isolated exon case\n return np.zeros((0, out_shape), dtype='float')\...
[ "0.5563815", "0.5293783", "0.5213351", "0.49248624", "0.49004447", "0.48478526", "0.4781561", "0.47813958", "0.4710072", "0.4675474", "0.4543498", "0.45414433", "0.45138633", "0.44763458", "0.44727144", "0.44690332", "0.4463009", "0.44608518", "0.44598845", "0.44542956", "0.4...
0.56654406
0
Create a aggregated Index with namedtuple idx Combine the gene_idx, sample_idx
def get_idx(countinfo, sample, gene_idx): if not countinfo is None: if not sample in countinfo.sample_idx_dict: sample_idx = None logging.warning("utils.py: The sample {} is not in the count file. Program proceeds without outputting expression data.".format(sample)) else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_gene_indexes(df):\n\tgeneDict = OrderedDict()\n\n\tgeneCount = 0\n\tpreviousGeneIndex = 0\n\n\tcurrent_id=\"\"\n\tcurrent_gene=\"\"\n\n\tfor i in range(len(df)):\n\n\t\tif df.loc[i,'feature'] == 'gene':\n\t\t\ttrdict = parse_entry(df.loc[i,'transcript_id'])\n\n\t\t\tcurGeneID = trdict['gene_id'][0]\n\t\t...
[ "0.6321686", "0.6155408", "0.60595196", "0.6051188", "0.59505635", "0.5836034", "0.5680135", "0.56531954", "0.5625771", "0.55557144", "0.5533098", "0.5517968", "0.5480308", "0.54524577", "0.54428107", "0.5442492", "0.5433063", "0.543244", "0.54272753", "0.54136074", "0.540922...
0.64187765
0
create library_size text file. Calculate the 75% expression and sum of expression for each sample and write into output_fp.
def create_libsize(expr_distr_fp, output_fp, sample, debug=False): sample_expr_distr = pa.parquet.read_table(expr_distr_fp['path']).to_pandas() libsize_count= pd.DataFrame({'sample': sample_expr_distr.columns[1:], 'libsize_75percent': np.percentile(sample_expr_distr.iloc[:, 1:]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_libfile():\n # wfc3_obsmodes_uvis\n wfc3_uvis = [\n \"f218w\",\n \"f225w\",\n \"f275w\",\n \"f336w\",\n \"f390m\",\n \"f390w\",\n \"f410m\",\n \"f438w\",\n \"f467m\",\n \"f475w\",\n \"f547m\",\n \"f555w\",\n \...
[ "0.54608756", "0.5400242", "0.5211215", "0.5197263", "0.5194946", "0.51773113", "0.51361793", "0.51357317", "0.5126693", "0.5125787", "0.5115333", "0.51034206", "0.5085765", "0.50600755", "0.5036529", "0.5036529", "0.5028773", "0.50280166", "0.5021801", "0.50140125", "0.50085...
0.6827684
0
Get the concatenated peptide from possible match peptide.
def get_concat_peptide(front_coord_pair, back_coord_pair, front_peptide, back_peptide, strand, k=None): def get_longest_match_position(front_str,back_str,L=None): if L is None: L = min(len(front_str),len(back_str)) for i in reversed(list(range(1,L+1))): if front_str[-i:] == b...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def concatenate(self):\n if not self.match_count:\n # No concatenating if there are no matches\n return []\n if self.match_count <= 1:\n # Can't combine a single match\n return self.match_list\n # Setup for iterating through\n cont = True\n ...
[ "0.58377457", "0.57520026", "0.55693895", "0.51852643", "0.5118976", "0.5036226", "0.4998545", "0.49705812", "0.49523178", "0.49279532", "0.4873407", "0.4863047", "0.48540068", "0.48335233", "0.4816873", "0.48077628", "0.48022303", "0.48017293", "0.4800456", "0.4780788", "0.4...
0.6651385
0
Print memory diagnostics including the active resident set size
def print_memory_diags(disable_print=False): process = psutil.Process(os.getpid()) memory = process.memory_info().rss/1000000000.0 if not disable_print: logging.info('\tMemory usage: {:.3f} GB'.format(memory)) return memory
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _mem_report(tensors: Iterable, mem_type: str) -> None:\n print(f\"Storage on {mem_type}\")\n print(\"-\" * LEN)\n total_numel = 0\n total_mem = 0\n visited_data: List[Any] = []\n for tensor in tensors:\n if tensor.is_sparse:\n continue\n ...
[ "0.70509243", "0.7048715", "0.684797", "0.6824635", "0.6806491", "0.67121667", "0.6675784", "0.66524774", "0.6635588", "0.66292006", "0.65855217", "0.6583841", "0.6535865", "0.65259236", "0.65087706", "0.6496641", "0.64578336", "0.6444816", "0.64439434", "0.63657725", "0.6365...
0.74818563
0
We use this function to analyze the beam property along s.
def beam_property_along_s(ps, id_slices): prop_s = np.zeros((14, len(id_slices))) for n in range(len(id_slices)): ps_s = np.take(ps, id_slices[n], axis=1) prop_s[0, n] = np.average(ps_s[0,:]) prop_s[1, n] = np.average(ps_s[1,:]) prop_s[2, n] = np.average(ps_s[2,:]) prop_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prt_beam_prms(self):\n print '\\nIon Charge States = ', self.M.conf()['IonChargeStates']\n print 'IonEs [MeV] = ', self.M.conf()['IonEs']/1e6\n print 'IonEk [MeV] = ', self.M.conf()['IonEk']/1e6\n print '\\nBaryCenter 0:\\n', self.M.conf()['BaryCenter0']\n print '...
[ "0.55478334", "0.55464554", "0.5515675", "0.54473466", "0.5417652", "0.5381833", "0.533846", "0.5251011", "0.5237646", "0.5210435", "0.5204704", "0.51945657", "0.5185809", "0.5178469", "0.5154056", "0.5144773", "0.51260614", "0.51221514", "0.51218563", "0.5119552", "0.5115868...
0.63167745
0
We want to use this function to analyze which part is on the axis in each undulator section.
def analyze_on_axis(phase_space, id_begin, id_end, ds_slice, zplot): ps = phase_space[:, (id_begin-1):id_end, :] # print(np.shape(ps)) # ps = ps[numpy.logical_not(numpy.isnan(ps))] x = ps[0, :, :] px = ps[1, :, :] y = ps[2, :, :] py = ps[3, :, :] id_on_axis = np.zeros((4, int(id_end-i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def othersn(ax):", "def _sections(self, axis=None, direction=None, cycle=None,\n concat_direction=False, concat_cycle=False, info=False,\n **kwargs):\n if axis is None:\n axis = ['x', 'y']\n if direction is None:\n direction = ['left', 'right'...
[ "0.5563447", "0.55561185", "0.55355847", "0.5400956", "0.5346773", "0.5164223", "0.51494545", "0.5128714", "0.5126724", "0.50905246", "0.5079524", "0.5058356", "0.5053756", "0.5040289", "0.50352335", "0.50240916", "0.5023575", "0.50167745", "0.50061435", "0.49880677", "0.4979...
0.6365625
0
I want to use this function to directly set up all orbit correctors.
def set_up_orbit_correctors(ps_beg, delay, id_slice1, ds_slice, zplot, id_slices, U_core, lambdaref): SXSS = Chicane(3.2716, 0.362, 0.830399, delay[0]) HXSS = Chicane(3.2, 0.3636, 0.5828, delay[1]) OC2 = [CORR08, D1_SXSS, SXSS, D2_SXSS, QUAD09, CORR09] OC3 = [CORR15, D1_HXSS, HXSS, D2_HXSS, QUAD16, COR...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setUp(self):\n self.precip_cube = setup_precipitation_cube()\n self.oe_cube = setup_orographic_enhancement_cube()\n self.vel_x = set_up_xy_velocity_cube(\"advection_velocity_x\")\n self.vel_y = set_up_xy_velocity_cube(\"advection_velocity_y\")\n for cube in [self.precip_cube,...
[ "0.59741217", "0.59616315", "0.59439087", "0.59116036", "0.58822644", "0.58440155", "0.5834586", "0.57733816", "0.5746145", "0.5736931", "0.57054114", "0.56986", "0.56339926", "0.5609833", "0.5579601", "0.5572102", "0.5556903", "0.55461323", "0.5529173", "0.5519832", "0.55151...
0.64385605
0
Loads the preprocessed celeb_a dataset scaled down to 32x32
def get_celeb_a32(): path = './data/celeb_a32' if not os.path.exists(path): print(path, " does not exits") return None images = utils.get_tensor_images_from_path(path) data = tf.data.Dataset.from_tensor_slices(images) data = data.map(lambda x: tf.cast(x, tf.float32)) data = data...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_celebA():\n channel_mean = [0.50003925, 0.42008925, 0.37377534]\n channel_std = [0.30878809, 0.28794379, 0.28661432]\n\n dataset = CelebA(transform=transforms.Compose([\n transforms.CenterCrop(178),\n transforms.Resize(64),\n transforms.ToTensor(),\n transforms.Normali...
[ "0.7416813", "0.6421557", "0.6321571", "0.60597914", "0.5983696", "0.5967315", "0.5948484", "0.59380203", "0.5907359", "0.5897862", "0.58657163", "0.58646065", "0.5861289", "0.58553", "0.58469105", "0.577485", "0.5769538", "0.5751676", "0.574995", "0.57490104", "0.5744094", ...
0.72671366
1
Set the `order_by_field` on the filterset and ensure that the field name is respected.
def test_ordering_with_overridden_field_name(self): class F(FilterSet): class Meta: model = User fields = ['username', 'status'] order_by = ['status'] order_by_field = 'order' f = F({'order': 'status'}, queryset=self.qs) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_ordering_with_overridden_field_name(self):\n class F(FilterSet):\n class Meta:\n model = User\n fields = ['username', 'status']\n order_by = ['status']\n order_by_field = 'order'\n\n f = F().form\n self.assertNotIn...
[ "0.7114981", "0.6805322", "0.65821075", "0.6384245", "0.6316189", "0.6254384", "0.6160399", "0.60926193", "0.59577346", "0.59503293", "0.59400135", "0.5909272", "0.5759706", "0.57583076", "0.57493776", "0.5726326", "0.5716653", "0.571355", "0.5712792", "0.5647503", "0.5642596...
0.7341014
0
Set the `order_by_field` on the filterset and ensure that the field name is respected.
def test_ordering_with_overridden_field_name(self): class F(FilterSet): class Meta: model = User fields = ['username', 'status'] order_by = ['status'] order_by_field = 'order' f = F().form self.assertNotIn('o', f.fields...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_ordering_with_overridden_field_name(self):\n class F(FilterSet):\n class Meta:\n model = User\n fields = ['username', 'status']\n order_by = ['status']\n order_by_field = 'order'\n\n f = F({'order': 'status'}, queryset=se...
[ "0.7341898", "0.6805477", "0.6581681", "0.6385461", "0.6315338", "0.6252756", "0.6159823", "0.6090766", "0.5956584", "0.5951964", "0.59386057", "0.59089255", "0.5759275", "0.57582235", "0.5749629", "0.57229424", "0.5717913", "0.5713295", "0.5711421", "0.5647316", "0.56422055"...
0.7116057
1
Ensures any object with an analagous dependency relationship to UserProfile > User && UserProfile > Company can filter based on it's related import kvs
def test_dependent_object_import(self): # Initialize Importers up_manager = ImporterManager(importer=UserProfileImporter()) company_manger = ImporterManager(importer=CompanyImporter()) user_manager = ImporterManager(importer=UserImporter()) # Populate leaf models of dependency t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_twice_dependent_object_import(self):\n pass", "def test_partial_twice_dependent_object_import(self):\n pass", "def test_m2m_dependent_object_import_precision(self): #: TODO: Come up with a better name\n other_company = Company.objects.create(name='Other Co', natural_id='oc')\n ...
[ "0.55593485", "0.5515848", "0.548871", "0.53242356", "0.5323796", "0.5270651", "0.52381533", "0.5179091", "0.51565045", "0.5153947", "0.50942135", "0.50636023", "0.4970877", "0.4866266", "0.48630893", "0.48102677", "0.47713712", "0.47691986", "0.47338426", "0.4730474", "0.470...
0.6230097
0
Plot average response for all variables in dataset and save plot in pdf dataset pandas dataset prj_info dictionnary containing projet information (response...)
def plot_average_reponse(data,prj_info,pp=PdfPages("exploration.pdf"),TMP=1234,bins=20): #Copy data data = data.copy() #Slice data data = data.sample(n = min(10000,data.shape[0]),random_state=1234) #Colnames var_to_plot = list(set(data.columns.values)-set(prj_info['PRJ_COLUMN'].values())) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def avg_response_report(df, var_list, y_obs, y_est, file):\n page = PdfPages(file)\n for var in var_list:\n avg_response(df, var, y_obs, y_est, show=False)\n page.savefig()\n page.close()", "def explore_data(data,prj_info,TMP=1234):\r\n print(\" Data file rows and columns are : \", d...
[ "0.7190156", "0.6753629", "0.60996735", "0.6064925", "0.6016448", "0.6008773", "0.60022396", "0.60006684", "0.5999985", "0.59736115", "0.5944627", "0.59434086", "0.5941799", "0.5931249", "0.5897575", "0.5877158", "0.5876371", "0.5840248", "0.58335423", "0.58302295", "0.582852...
0.7230312
0
Applies VRTfunctions to a GDALreadable inputfile, rendering outputfile. Functions must be an iterable of singleparameter functions that take a filename as input.
def pipeline(inputfile, outputfile, functions, **kwargs): if not functions: raise ValueError('Must have at least one function') tmpfiles = [] try: previous = inputfile for name, f in functions: logging.debug(name) vrt = f(previous) current = vrt.g...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main(fn_input, fn_output):\n # read file\n inter = Interpolator()\n inter.read_file(fn_input)\n inter.write_interpolated(fn_output)", "def merge(files: List[str], output_file: str, resample: str = \"average\") -> None:\n\n build_vrt(constants.TEMP_VRT_FILE, files, resample)\n\n gdal.SetConf...
[ "0.5867644", "0.5854852", "0.55360836", "0.52705306", "0.52492493", "0.52203393", "0.50498486", "0.50492585", "0.49810517", "0.49677193", "0.4958387", "0.49372962", "0.4903304", "0.4866099", "0.4855312", "0.4854982", "0.4847482", "0.48274714", "0.48194093", "0.48180053", "0.4...
0.7520964
0
Takes an inputfile (probably a VRT) and generates a singleband VRT.
def extract_color_band(inputfile, band): dataset = Dataset(inputfile) if not 1 <= band <= dataset.RasterCount: raise ValueError( "band must be between 1 and {0}".format(dataset.RasterCount) ) command = [ GDALTRANSLATE, '-q', # Quiet '-of...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_vrt(vrt: str, files: List[str], resample_name: str) -> None:\n\n options = gdal.BuildVRTOptions(srcNodata=0)\n gdal.BuildVRT(destName=vrt, srcDSOrSrcDSTab=files, options=options)\n add_pixel_fn(vrt, resample_name)", "def run_vorpaline(self, input_file, *options):\n\n self._input_file = ...
[ "0.5761271", "0.539191", "0.53234494", "0.5275649", "0.52752906", "0.527388", "0.5264173", "0.5234479", "0.52175415", "0.52002573", "0.51625293", "0.50720745", "0.50369114", "0.50217336", "0.4970289", "0.4957576", "0.4887836", "0.48874044", "0.48784587", "0.48682615", "0.4843...
0.546153
1
Returns gdal.Band.GetNoDataValue() as a NumPy type
def GetNoDataValue(self): result = super(Band, self).GetNoDataValue() if result is not None: return self.NumPyDataType(result)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_band_nodata(self, band_idx=1):\n if band_idx < 1 or band_idx > self.dataset.RasterCount:\n raise IndexError(\"band index is out of range\")\n return self.dataset.GetRasterBand(band_idx).GetNoDataValue()", "def _nodata_value(self):\n try:\n nodata = float(self._i...
[ "0.7544999", "0.7434405", "0.7288697", "0.6567842", "0.6520311", "0.6363698", "0.6319562", "0.62501335", "0.6163293", "0.61502856", "0.61502856", "0.61240387", "0.6110622", "0.60905856", "0.590359", "0.5895869", "0.58876556", "0.58424926", "0.58220965", "0.5796688", "0.577856...
0.86186093
0
Returns the NumPy type associated with gdal.Band.DataType
def NumPyDataType(self): datatype = self.DataType if datatype == gdalconst.GDT_Byte: pixeltype = self.GetMetadataItem('PIXELTYPE', 'IMAGE_STRUCTURE') if pixeltype == 'SIGNEDBYTE': return numpy.int8 return numpy.uint8 elif datatype == gdalconst....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_band_dtype(self, band_idx=1):\n if band_idx < 1 or band_idx > self.dataset.RasterCount:\n raise IndexError(\"band index is out of range\")\n return self.dataset.GetRasterBand(band_idx).DataType", "def type(self):\n # type: () -> type\n return _python_type_map[str(se...
[ "0.7380224", "0.7158212", "0.6904815", "0.68386203", "0.67266405", "0.6708839", "0.66951716", "0.663477", "0.663243", "0.6614309", "0.6602418", "0.6594213", "0.65762633", "0.65756744", "0.65720206", "0.657198", "0.6555877", "0.6555877", "0.6546687", "0.65154874", "0.6515137",...
0.76264346
0
Returns whether the dataset covers the whole world or not.
def IsWholeWorld(self, resolution=None): if resolution is None: resolution = self.GetNativeResolution() spatial_ref = self.GetSpatialReference() world_extents = spatial_ref.GetWorldExtents() extents = self.GetExtents() ll_offset = world_extents.lower_left - extents.l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_full_dimensional(self):\n\n return self.affine_dimension() == self.space_dimension()", "def is_dataset(self):\n return self._dataset is not None", "def ejscreen_areas_of_concern_data_exists(cls):\n return cls.EJSCREEN_AREAS_OF_CONCERN_SOURCE.is_file()", "def is_mainland(self):\n ...
[ "0.6345008", "0.63167757", "0.61752814", "0.60833305", "0.60241663", "0.6015851", "0.5980115", "0.59584624", "0.5937705", "0.5922513", "0.5917669", "0.59084296", "0.5877617", "0.5835224", "0.5827307", "0.5806919", "0.5801645", "0.57821", "0.5778381", "0.57413006", "0.57294166...
0.68909526
0
Returns the (width, height) of pixels in this Dataset's units.
def GetPixelDimensions(self): _, width, _, _, _, height = self.GetGeoTransform() return XY(x=width, y=height)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dimensions (self):\n return (self.width, self.height)", "def get_size(self) -> Tuple2IntType:\n return self.get_width(), self.get_height()", "def size(self):\n return self.width, self.height", "def get_size_inches(self):\n width, height = self.figure.get_size_inches()\n ...
[ "0.7506064", "0.7479907", "0.7441489", "0.74142814", "0.7389819", "0.7367811", "0.73565596", "0.73126996", "0.72868365", "0.7277576", "0.72565204", "0.7253058", "0.72077274", "0.72069263", "0.71481836", "0.7120468", "0.7104735", "0.70551723", "0.7054781", "0.70520395", "0.704...
0.77364904
0
Returns (lowerleft, upperright) extents in transform's destination projection. If transform is None, no reprojection occurs and the dataset's SpatialReference is used.
def GetExtents(self, transform=None): # Prepare GDAL functions to compute extents x_size, y_size = self.RasterXSize, self.RasterYSize # Compute four corners in destination projection upper_left = self.PixelCoordinates(0, 0, transform=transform)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extent(self):\n left = self.transform[0]\n right = left + self.transform[1] * self.shape[1]\n top = self.transform[3]\n bottom = top + self.transform[5] * self.shape[0]\n return left, right, bottom, top", "def extent(self):\n if self.x is not None:\n if se...
[ "0.6707964", "0.62306535", "0.61376554", "0.58643377", "0.58163196", "0.5813695", "0.5760055", "0.5748703", "0.57084984", "0.5700975", "0.56836563", "0.5661239", "0.5635688", "0.5632432", "0.56189066", "0.5601325", "0.55867517", "0.5552704", "0.5544527", "0.5532464", "0.55125...
0.75209373
0
Get the scaling ratios required to upsample an image to `resolution`. If resolution is None, then assume it will be upsampled to the native destination resolution. See Dataset.GetNativeResolution() If places is not None, rounds the ratios to the number of decimal places specified.
def GetScalingRatios(self, resolution=None, places=None): if resolution is None: resolution = self.GetNativeResolution(transform=None) # Get the pixel dimensions in map units. There is no custom transform, # because it makes no sense to compute a pixel ratio for a # reprojec...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetWorldScalingRatios(self, resolution=None, places=None):\n if resolution is None:\n resolution = self.GetNativeResolution()\n\n spatial_ref = self.GetSpatialReference()\n world = spatial_ref.GetWorldExtents().dimensions\n src_pixel_sizes = XY(x=world.x / self.RasterXSiz...
[ "0.66777146", "0.5513569", "0.5297719", "0.5258411", "0.51001024", "0.50386363", "0.50341105", "0.50095075", "0.49838406", "0.49593174", "0.48953298", "0.48382708", "0.47824258", "0.4761503", "0.47418657", "0.47418657", "0.47418657", "0.47353554", "0.46934766", "0.46716377", ...
0.7302088
0
Get the scaling ratios required to upsample for the whole world. If resolution is None, then assume it will be upsampled to the native destination resolution. See Dataset.GetNativeResolution() If places is not None, rounds the ratios to the number of decimal places specified.
def GetWorldScalingRatios(self, resolution=None, places=None): if resolution is None: resolution = self.GetNativeResolution() spatial_ref = self.GetSpatialReference() world = spatial_ref.GetWorldExtents().dimensions src_pixel_sizes = XY(x=world.x / self.RasterXSize, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetScalingRatios(self, resolution=None, places=None):\n if resolution is None:\n resolution = self.GetNativeResolution(transform=None)\n\n # Get the pixel dimensions in map units. There is no custom transform,\n # because it makes no sense to compute a pixel ratio for a\n ...
[ "0.74602205", "0.533336", "0.5087092", "0.50720173", "0.50386196", "0.49780598", "0.49676868", "0.49499795", "0.48785496", "0.48708156", "0.4858904", "0.48400638", "0.48303235", "0.48303235", "0.47874883", "0.47874883", "0.47874883", "0.47721013", "0.4771545", "0.47600517", "...
0.72415364
1
The html content of your footer.
def footer_html(self): return self._footer_html
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self):\n return self.footer_html", "def get_footer(self):\n self.footer = '</div>' \\\n '</div>' \\\n '</div>' \\\n '<div class=\"footer\">' \\\n '<div class=\"container\">' \\\n '<p cla...
[ "0.84020877", "0.83206654", "0.77823853", "0.7600698", "0.7569941", "0.75131357", "0.74960965", "0.7441762", "0.7427407", "0.74167025", "0.7381049", "0.7381049", "0.73269355", "0.73111933", "0.73045343", "0.71055436", "0.7100233", "0.70798254", "0.7018429", "0.69782525", "0.6...
0.8446734
0
Get a JSONready representation of this FooterHtml.
def get(self): return self.footer_html
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def footer_html(self):\n return self._footer_html", "def get_footer(self):\n self.footer = '</div>' \\\n '</div>' \\\n '</div>' \\\n '<div class=\"footer\">' \\\n '<div class=\"container\">' \\\n ...
[ "0.73172146", "0.66936934", "0.6251055", "0.6243386", "0.6088809", "0.60859615", "0.6078452", "0.6061365", "0.6044317", "0.58748573", "0.5841819", "0.58229464", "0.58227277", "0.57736146", "0.5748268", "0.57245976", "0.5719315", "0.5718041", "0.57159793", "0.57119656", "0.569...
0.7223077
1
Returns all the SKU's names which are available in the database.
def get_all_skus(): sku_ids = set() for sku_id in sku_database.find({}, {"_id": 0, "SKU_id": 1}): if sku_id.get("SKU_id"): sku_ids.add(sku_id["SKU_id"]) else: continue return list(sku_ids)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sku_name(self) -> str:\n return pulumi.get(self, \"sku_name\")", "def sku_name(self) -> str:\n return pulumi.get(self, \"sku_name\")", "def sku_name(self) -> str:\n return pulumi.get(self, \"sku_name\")", "def getNames(self) -> List[unicode]:\n ...", "def sku_name(self) -> p...
[ "0.62859315", "0.62859315", "0.62859315", "0.6216947", "0.6172846", "0.59829146", "0.59336996", "0.5914514", "0.5886475", "0.58093053", "0.58093053", "0.5785581", "0.57802486", "0.57603806", "0.5718735", "0.57042855", "0.5676707", "0.56748796", "0.5674839", "0.5670397", "0.56...
0.72144353
0
For given sku_id, status and time span, it queries and returns back the data.
def get_sku_id(sku_id, status, start_time, end_time): all_data = [] if not (sku_id, status, start_time, end_time): return all_data for i in sku_database.find({"SKU_id": sku_id, "Status": status}, {"_id": 0}): if start_time < i["Time_stamp"] < end_time: all_data.append(i) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def timespan(self, timespan=None, timezone=None):\r\n url = '{0}/{1}'.format(self.get_pull_url(), 'timespan')\r\n params = base.get_params(('timespan', 'timezone'), locals())\r\n\r\n return http.Request('GET', url, params), parsers.parse_json", "def query_tas_status(self):\n response ...
[ "0.5370444", "0.53211254", "0.53194", "0.5045779", "0.49320626", "0.48997423", "0.48471904", "0.4833045", "0.48287934", "0.48239887", "0.47896585", "0.47663978", "0.47641006", "0.47459877", "0.4742183", "0.47376695", "0.473765", "0.4669849", "0.46652684", "0.46615025", "0.463...
0.6179882
0
From a given list of SKU id's and status as mentioned, it checks whether the criteria is matching and returns the matching values.
def get_status_skus(sku_list, status): values = [] if not (sku_list, status): return values for sku_id in sku_list: status_query = list(sku_database.find({"SKU_unit": int(sku_id), "Status": status}, {'_id': 0, 'Status': 1})) if status_query: values.append(sku_id) ret...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_sku_id(sku_id, status, start_time, end_time):\n all_data = []\n if not (sku_id, status, start_time, end_time):\n return all_data\n\n for i in sku_database.find({\"SKU_id\": sku_id, \"Status\": status}, {\"_id\": 0}):\n if start_time < i[\"Time_stamp\"] < end_time:\n all_da...
[ "0.56345564", "0.5322471", "0.52859175", "0.52649534", "0.5165805", "0.5100922", "0.5077354", "0.50569147", "0.5036123", "0.50279695", "0.50128347", "0.5012462", "0.4975206", "0.49740142", "0.49417433", "0.493961", "0.48568138", "0.4840273", "0.48359197", "0.48324963", "0.482...
0.7839895
0
Disable an alarm. This will prevent the alarm from executing until reenabled or until the application is restarted.
def disable(self, name: str): self._get_backend().disable_alarm(name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def on_disable(self) -> None:\n self._cancel_notification_cycle()", "def on_disable(self) -> None:\n self._cancel_automation()", "def on_disable(self) -> None:\n self._on_stop_cycle({})", "def stop_alarm(self):\n self.out_power.pulse()", "def disable(self):\n self._enable...
[ "0.7147774", "0.7090431", "0.6920151", "0.6847871", "0.6707151", "0.66669804", "0.66627", "0.66279423", "0.656082", "0.65437007", "0.6541512", "0.6485868", "0.6448139", "0.6370838", "0.6320564", "0.6306733", "0.62469566", "0.62280416", "0.62151366", "0.6210067", "0.6168819", ...
0.80944586
0
Dismiss the alarm that is currently running.
def dismiss(self): self._get_backend().dismiss_alarm()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dismiss_reminder(self):\n qry = ServiceOperationQuery(self, \"dismissReminder\")\n self.context.add_query(qry)\n return self", "def stop_animation(self):\n if self.animate_alarm:\n self.loop.remove_alarm(self.animate_alarm)\n self.animate_alarm = None", "async ...
[ "0.6770825", "0.6504499", "0.6491621", "0.6473124", "0.6453558", "0.6367585", "0.6321344", "0.61386096", "0.60624015", "0.60624015", "0.59958225", "0.5922445", "0.5870512", "0.5868287", "0.5867719", "0.5865545", "0.58586764", "0.58586764", "0.58152795", "0.58013976", "0.57735...
0.8574007
0
Snooze the alarm that is currently running for the specified number of seconds. The alarm will stop and resume again later.
def snooze(self, interval: Optional[float] = 300.0): self._get_backend().snooze_alarm(interval=interval)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sleep(self, seconds):\n\n # We schedule an alarm signal for x=seconds out in the future.\n # noinspection PyUnusedLocal\n def handle_alarm(signal_num, frame):\n pass\n\n signal.signal(signal.SIGALRM, handle_alarm)\n signal.alarm(seconds)\n\n # Wait for eithe...
[ "0.6919186", "0.6612018", "0.6467028", "0.6446055", "0.6190884", "0.6190884", "0.6155103", "0.6068098", "0.60492384", "0.60356086", "0.60265136", "0.601966", "0.6012515", "0.6003812", "0.5942315", "0.59309816", "0.59265506", "0.59265506", "0.5859484", "0.5822939", "0.5798656"...
0.7325651
0
Get the list of configured alarms.
def get_alarms(self) -> List[Dict[str, Any]]: return [alarm.to_dict() for alarm in self._get_backend().get_alarms()]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_alarms() -> List[Dict[str, Any]]:\n return __alarm_info.values()", "def get_alarms(region):\n\n client = boto3.client(\"cloudwatch\", region_name=region)\n\n describe_response = client.describe_alarms()\n\n alarms = describe_response[\"MetricAlarms\"]\n\n return alarms", "def getAlarms(s...
[ "0.78672135", "0.7273389", "0.71997935", "0.7173401", "0.70782715", "0.7007334", "0.6998015", "0.6914195", "0.6863513", "0.61937827", "0.61905473", "0.6153018", "0.6041094", "0.60307056", "0.5874066", "0.5827018", "0.5747757", "0.56293756", "0.5591793", "0.5573276", "0.554210...
0.7816481
1
Sets the person_name of this Organization.
def person_name(self, person_name): self._person_name = person_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_name(self, PersonName):\r\n self.name = PersonName", "def org_name(self, org_name):\n\n self._org_name = org_name", "def org_name(self, org_name):\n\n self._org_name = org_name", "def set_person(self, person):\n if person.upper() == UNKNOWN.upper():\n self.perso...
[ "0.7833753", "0.7134179", "0.7134179", "0.6688187", "0.65317196", "0.65317196", "0.65103024", "0.65103024", "0.65096503", "0.6446856", "0.64192414", "0.6416891", "0.63956535", "0.63956535", "0.63956535", "0.63956535", "0.63956535", "0.63945746", "0.63945746", "0.6344165", "0....
0.8247543
1
Sets the state_province_county of this Organization.
def state_province_county(self, state_province_county): self._state_province_county = state_province_county
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def county(self, county):\n\n self._county = county", "def county(self, county):\n\n self._county = county", "def nationality(self, nationality):\n\n self._nationality = nationality", "def nationality(self, nationality):\n\n self._nationality = nationality", "def set_city_count(...
[ "0.64520186", "0.64520186", "0.51732033", "0.51732033", "0.51432556", "0.4989287", "0.488448", "0.48415154", "0.47505423", "0.46348393", "0.4630611", "0.46284756", "0.45552388", "0.45378423", "0.4523382", "0.45212606", "0.45178837", "0.44777262", "0.4427605", "0.4427605", "0....
0.8909677
0
Sets the phone_number of this Organization.
def phone_number(self, phone_number): self._phone_number = phone_number
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def person_phone_number(self, person_phone_number):\n\n self._person_phone_number = person_phone_number", "def phone(self, new_number):\n self._phone.number = new_number", "def mobile_phone_number(self, mobile_phone_number):\n\n self._mobile_phone_number = mobile_phone_number", "def setP...
[ "0.7575966", "0.7262518", "0.7254966", "0.7023407", "0.69712853", "0.68257356", "0.6815127", "0.67999643", "0.6795196", "0.6795196", "0.6795196", "0.6795196", "0.6795196", "0.6791341", "0.6722033", "0.67016137", "0.6508162", "0.63192666", "0.6278706", "0.62630147", "0.6222011...
0.81304574
1
Sets the address_line1 of this Organization.
def address_line1(self, address_line1): self._address_line1 = address_line1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def address_line1(self, address_line1):\n if address_line1 is None:\n raise ValueError(\n \"Invalid value for `address_line1`, must not be `None`\"\n ) # noqa: E501\n\n self._address_line1 = address_line1", "def principal_address_line1(self, principal_address_l...
[ "0.8497842", "0.7957488", "0.7876892", "0.7850841", "0.77656263", "0.70708996", "0.70708996", "0.70708996", "0.689766", "0.6551664", "0.65369886", "0.64015824", "0.6390496", "0.6295419", "0.6270153", "0.6252031", "0.62348896", "0.6188278", "0.61339515", "0.6105675", "0.608727...
0.8811455
0
Sets the address_line2 of this Organization.
def address_line2(self, address_line2): self._address_line2 = address_line2
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def address_2(self, address_2):\n\n self._address_2 = address_2", "def principal_address_line2(self, principal_address_line2):\n\n self._principal_address_line2 = principal_address_line2", "def street_line_2(self, street_line_2):\n\n self._street_line_2 = street_line_2", "def address2(se...
[ "0.79640037", "0.7917009", "0.7910908", "0.78585726", "0.71762484", "0.71762484", "0.7049437", "0.6794425", "0.6462342", "0.64471567", "0.64098936", "0.6366884", "0.63469005", "0.6327694", "0.62689376", "0.62077683", "0.60219824", "0.60010564", "0.60010564", "0.59956384", "0....
0.88047636
1
Sets the zip_post_code of this Organization.
def zip_post_code(self, zip_post_code): self._zip_post_code = zip_post_code
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def zipcode(self, zipcode):\n self._zipcode = zipcode", "def zip_code(self, zip_code):\n\n self._zip_code = zip_code", "def postal_code(self, postal_code):\n\n self._postal_code = postal_code", "def postal_code(self, postal_code):\n\n self._postal_code = postal_code", "def posta...
[ "0.7381539", "0.7371916", "0.70360076", "0.70360076", "0.70360076", "0.69919515", "0.67918134", "0.67918134", "0.67918134", "0.6679859", "0.65118146", "0.6351724", "0.61154234", "0.6063556", "0.6023592", "0.59138143", "0.58627266", "0.56648487", "0.56164485", "0.55818355", "0...
0.84573597
0
Use in `__init__()` only; assign all args/kwargs to instance attributes. To maintain precedence of args provided to subclasses, call this in the subclass before `super().__init__()` if `save__init__args()` also appears in base class, or use `overwrite=True`. With `subclass_only==True`, only args/kwargs listed in curren...
def save__init__args(values, underscore=False, overwrite=False, subclass_only=False): prefix = "_" if underscore else "" self = values['self'] args = list() Classes = type(self).mro() if subclass_only: Classes = Classes[:1] for Cls in Classes: # class inheritances if '__init__' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init_subclass__(cls, **kwargs):\n super().__init_subclass__(**kwargs)\n cls.__init__ = _wrap_init(cls.__init__, cls.__post_init_check)", "def kwargs_to_parent(cls):\n original_init = cls.__init__\n\n def new_init(self, *args, **kwargs):\n # pass only those kwargs to the dataclass...
[ "0.6435379", "0.6124592", "0.59995186", "0.5889906", "0.5642248", "0.551526", "0.5499164", "0.5485295", "0.54716355", "0.54716355", "0.5430047", "0.5418889", "0.53908145", "0.53908145", "0.53908145", "0.53908145", "0.53908145", "0.53908145", "0.53908145", "0.53908145", "0.539...
0.7307496
0
Check if the OpenLDAP container is up.
def is_ldap_up(host, port): conn = ldap.initialize(f'ldap://{host}:{port}') conn.simple_bind_s(LDAP_BINDDN, LDAP_SECRET) # The OpenLDAP server is pretty quick to start up but it can still be building the indices # or computing the memberOf property. So check and wait until that's done before we let the...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_server_up(self):\n print \"Connecting to Mongo at %s:%s\" % (self.hostname, self.port)\n try:\n # TODO: update this to use new pymongo Client\n self.api = pymongo.Connection(self.hostname, self.port)\n return True\n except (AutoReconnect, ConnectionFa...
[ "0.6554002", "0.646989", "0.642654", "0.64182204", "0.63442534", "0.6322428", "0.6279061", "0.6246154", "0.6180694", "0.6163434", "0.6151141", "0.61259544", "0.6092133", "0.60640645", "0.6042775", "0.60386544", "0.60356444", "0.6010722", "0.59878546", "0.5981053", "0.5968419"...
0.716125
0
The OpenLDAP container to test against.
def openldap(docker_ip, docker_services): host, port = docker_ip, docker_services.port_for('openldap', 389) docker_services.wait_until_responsive( timeout=600, pause=10, check=lambda: is_ldap_up(host, port)) global LDAP_HOST global LDAP_PORT LDAP_HOST = host LDAP_PORT = port ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_container(self):\n pass", "def get_container(self, account, container):\n \n pass", "def test_show_container(self):\n pass", "def app(openldap):\n _app = flask.Flask(__name__)\n _app.config['LDAP_URI'] = f'ldap://{LDAP_HOST}:{LDAP_PORT}'\n _app.config['LDAP_B...
[ "0.61387736", "0.5880962", "0.57707727", "0.55800897", "0.5526084", "0.5511952", "0.54033214", "0.5372437", "0.52986604", "0.5272887", "0.52577835", "0.51881355", "0.51881355", "0.5154575", "0.5133689", "0.5107609", "0.51014864", "0.51009005", "0.51006734", "0.5086614", "0.50...
0.6203799
0
Returns the gr_amount without bill between the party and supplier.
def get_gr(supplier_id: int, party_id: int) -> int: # Open a new connection db, cursor = db_connector.cursor() query = "select gr_amount from supplier_party_account where supplier_id = '{}' AND party_id = '{}'".format( supplier_id, party_id) cursor.execute(query) data = cursor.fetchall() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_usable_gr(supplier_id: int, party_id: int) -> int:\n # Open a new connection\n db, cursor = db_connector.cursor()\n\n query = \"select SUM(settle_amount) from gr_settle where supplier_id = '{}' AND party_id = '{}'\".format(\n supplier_id, party_id)\n cursor.execute(query)\n data = cur...
[ "0.65945584", "0.5881917", "0.5234184", "0.52274364", "0.5213804", "0.5200786", "0.5200704", "0.5107766", "0.501036", "0.49734", "0.49710652", "0.49704546", "0.49508998", "0.4943134", "0.4939742", "0.49362305", "0.4931719", "0.49290752", "0.49084964", "0.4873696", "0.48604906...
0.66093844
0
Get the gr_between dates used to settle the account
def get_gr_between_dates(supplier_id: int, party_id: int, start_date: str, end_date: str) -> int: # Open a new connection db, cursor = db_connector.cursor() start_date = str(datetime.datetime.strptime(start_date, "%d/%m/%Y")) end_date = str(datetime.datetime.strptime(end_date, "%d/%m/%Y")) query =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rate_between(self, from_date, to_date):\n print(\"override the above\")", "def date_range(self):\n start_date = input(\"Enter a start date in the format DD/MM/YYYY> \")\n end_date = input(\"Enter an end date in the format DD/MM/YYYY> \")\n return start_date, end_date", "def date...
[ "0.60416496", "0.5759463", "0.56746733", "0.55839163", "0.5545205", "0.55324453", "0.54982615", "0.54696906", "0.54090685", "0.5405709", "0.54010266", "0.5398621", "0.53888017", "0.5384724", "0.53818357", "0.537875", "0.53136253", "0.53007126", "0.5292468", "0.5280808", "0.52...
0.6374636
0
Split off parameter part from path. Returns tuple (pathwithoutparam, param)
def splitparams(path): if '/' in path: i = path.find(';', path.rfind('/')) else: i = path.find(';') if i < 0: return path, '' return path[:i], path[i + 1:]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _GetPathParamsFromPath(path: str) -> List[str]:\n path_params = []\n\n components = path.split(\"/\")\n for component in components:\n if _IsPathParameter(component):\n normalized_component = _NormalizePathComponent(component)\n normalized_component = normalized_component[1:-1]\n path_para...
[ "0.674751", "0.6523064", "0.6511854", "0.64421445", "0.641207", "0.6401571", "0.6344312", "0.63051647", "0.62601167", "0.6211556", "0.61409175", "0.61268425", "0.61259776", "0.6124089", "0.6106624", "0.6058917", "0.6055915", "0.6025726", "0.6003291", "0.599609", "0.59699416",...
0.8304237
0
Return regular expression pattern with given host for URL testing.
def safe_host_pattern(host): return "(?i)%s://%s%s(#%s)?" % \ (_safe_scheme_pattern, host, _safe_path_pattern, _safe_fragment_pattern)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def url(regex, view):\n return RegexPattern(regex, view)", "def get_hostmask_regex(mask):\n mask = re.escape(mask)\n mask = mask.replace(r'\\*', '.*')\n return re.compile(mask + '$', re.I)", "def _compile_audience_pattern(self, pattern):\n re_pattern = fnmatch.translate(pattern)\n if ...
[ "0.6459515", "0.6248357", "0.5812781", "0.57181805", "0.5674186", "0.56623316", "0.5633071", "0.5583016", "0.55545926", "0.55380994", "0.55205655", "0.5495875", "0.5463588", "0.5458524", "0.5437907", "0.5387938", "0.5373938", "0.5351687", "0.53417546", "0.53417546", "0.534175...
0.7322857
0
Unquote and fix hostname. Returns is_idn.
def url_fix_host(urlparts): # if not urlparts[1]: # urlparts[2] = urllib.unquote(urlparts[2]) # return False userpass, netloc = urllib.splituser(urlparts[1]) if userpass: userpass = urllib.unquote(userpass) netloc, is_idn = idna_encode(urllib.unquote(netloc).lower()) # a lead...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def idna_encode(host):\n if host and isinstance(host, unicode):\n try:\n host.encode('ascii')\n return host, False\n except UnicodeError:\n uhost = host.encode('idna').decode('ascii')\n return uhost, uhost != host\n return host, False", "def test_sa...
[ "0.6449013", "0.6380736", "0.63365686", "0.6324431", "0.61450845", "0.605697", "0.6042931", "0.5928755", "0.589544", "0.58683395", "0.58616215", "0.58118397", "0.5743484", "0.56844443", "0.5675291", "0.56356144", "0.56274545", "0.561817", "0.56118816", "0.5569066", "0.5540591...
0.66974527
0