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
Build a Query object from a set of facets, then call build() on it.
def from_facets(*args, **kwargs): facets = Facets(self._default_library, *args, **kwargs) filter = Filter(facets=facets) qu = MockQuery("query string", filter=filter) built = qu.build(search) # Return the rest to be verified in a test-specific way. ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def apply_filters(self, queryset, applicable_filters=None, applicable_exclusions=None):\n for field, options in applicable_filters[\"field_facets\"].items():\n queryset = queryset.facet(field, **options)\n\n for field, options in applicable_filters[\"date_facets\"].items():\n qu...
[ "0.6496745", "0.6315449", "0.6258068", "0.60086054", "0.5911915", "0.57755864", "0.573584", "0.5670942", "0.56401163", "0.5602675", "0.5568983", "0.5543967", "0.553353", "0.54699177", "0.5458636", "0.54096997", "0.5407078", "0.5323815", "0.53104126", "0.52941847", "0.52759683...
0.7220995
0
Validate the 'easy' part of the sort order the tiebreaker fields. Return the 'difficult' part.
def validate_sort_order(filter, main_field): # The tiebreaker fields are always in the same order, but # if the main sort field is one of the tiebreaker fields, # it's removed from the list -- there's no need to sort on # that field a second time. default_sor...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_admin_sort_by(sort_on):\n try:\n sort_attributes = ['title', 'md_pub_date', 'summary']\n if sort_on in sort_attributes:\n return sort_on\n else:\n return 'title'\n except Exception as e:\n print \"Exception: \" + str(e)", "def sorting_by_criter...
[ "0.5422345", "0.51779574", "0.51326853", "0.51216465", "0.5098696", "0.49896", "0.498799", "0.49557397", "0.49503902", "0.49242207", "0.48612294", "0.48536846", "0.48222044", "0.48191088", "0.48098657", "0.4788777", "0.47594061", "0.47372675", "0.4728122", "0.47202504", "0.47...
0.6764114
0
Verify that `filter` is a boolean filter that matches one of a number of possibilities. Return those possibilities.
def dichotomy(filter): assert "bool" == filter.name assert 1 == filter.minimum_should_match return filter.should
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_filter_mixed_function(self):\n for none_type in (False, True):\n for all_type in (False, True):\n for any_type in (False, True, None):\n result = none_type is False and all_type is True \\\n and (any_type is None or any_type is Tru...
[ "0.6741921", "0.6474875", "0.6376854", "0.6179683", "0.6159572", "0.59450597", "0.5884499", "0.5780944", "0.5735032", "0.5734875", "0.5713773", "0.5666095", "0.56029093", "0.5585088", "0.55647486", "0.55589753", "0.55378103", "0.55280507", "0.55214506", "0.5489386", "0.548355...
0.67647254
0
Verify that a filter only matches when there is no value for the given field.
def assert_matches_nonexistent_field(f, field): assert ( f.to_dict() == {'bool': {'must_not': [{'exists': {'field': field}}]}})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_filterval(filterval):\n if filterval != 'description' and filterval != 'fulldescription' and filterval != 'completed':\n return False\n else:\n return True", "def test_filter_function_none(self):\n self.es.register_filter(lambda x: False, ftype='none')\n ...
[ "0.6997897", "0.65928715", "0.65643317", "0.6421701", "0.64098537", "0.6297924", "0.6291485", "0.62772375", "0.6188193", "0.6145177", "0.6119406", "0.6065322", "0.60579246", "0.6054443", "0.60046804", "0.5999436", "0.59982795", "0.5972854", "0.59515387", "0.59507996", "0.5950...
0.7020142
0
A mock of _chain_filters so we don't have to check test results against supercomplicated Elasticsearch filter objects. Instead, we'll get a list of smaller filter objects.
def _mock_chain(self, filters, new_filter): if filters is None: # There are no active filters. filters = [] if isinstance(filters, elasticsearch_dsl_query): # An initial filter was passed in. Convert it to a list. filters = [filters] filters.append...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_apply_filter(mocker):\n list_of_filter_dict_keys = [\n 'EqualTo',\n 'Contains',\n 'ContainsAll',\n 'ContainsAny',\n 'ContainsIgnoreCase',\n 'DoesNotContain',\n 'GreaterThan',\n 'GreaterThanOrEqualTo',\n 'DoesNotContainIgnoreCase',\n ...
[ "0.65804183", "0.6574269", "0.6492736", "0.63977313", "0.6358299", "0.631415", "0.6254892", "0.6224293", "0.620702", "0.6090167", "0.6076573", "0.6039105", "0.59843934", "0.5979323", "0.59743553", "0.5895422", "0.58411616", "0.5840082", "0.57979", "0.5793634", "0.5764596", ...
0.8190246
0
Clears the model directory and only maintains the latest `checkpoints` number of checkpoints.
def clear_model_dir(self, checkpoints, logger): files = os.listdir(self.model_dir) last_modification = [(os.path.getmtime(os.path.join(self.model_dir, f)), f) for f in files] # Sort the list by last modified. last_modification.sort(key=itemgetter(0)) # Delete everything but the...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear_checkpoints(self):\n if tf.gfile.Exists(str(self.info.checkpoint_path)):\n tf.gfile.DeleteRecursively(str(self.info.checkpoint_path))", "def clear_model_checkpoints(self):\n if self.file_prefix is None:\n return\n\n with os.scandir() as path_list:\n ...
[ "0.7887548", "0.78405684", "0.70502526", "0.7037212", "0.69053566", "0.6885986", "0.64904153", "0.6437186", "0.64033055", "0.6368597", "0.6348156", "0.63442576", "0.6341169", "0.6286433", "0.6260607", "0.62325686", "0.6117156", "0.6105783", "0.60879576", "0.6058965", "0.60501...
0.8535333
0
Rebuilds the surfaces based on the original positions and alpha value. This can be used to reset the states of buttons after returning to a Menu a second time.
def reset(self): self.x = self.x_original self.alpha = self.alpha_original # Button "background" - active self.active_background_surface.set_alpha(self.alpha) # Button "background" - inactive self.inactive_background_surface.set_alpha(self.alpha) # active ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reindex_graphics(self):\n for obj in self.context.static_objects:\n self.canvas.children.remove(obj.widget.canvas)\n # fill _objects_z_index\n _objects_z_index = {}\n for obj in self.context.static_objects:\n y = obj.widget.pos[1]\n if not y in _obje...
[ "0.6098649", "0.5991369", "0.5905092", "0.5815281", "0.5792299", "0.57288677", "0.5722896", "0.5714045", "0.5713487", "0.5713487", "0.57038414", "0.5668134", "0.56377494", "0.5615933", "0.5568823", "0.55665016", "0.5559408", "0.55072635", "0.54790586", "0.54756534", "0.547195...
0.6623888
0
Rendering the inactive button onto the screen surface.
def render_inactive(self): # Rendering button "background" self.screen.blit(self.inactive_background_surface, (self.x, self.y)) # Rendering button text self.screen.blit(self.active_text_surface, self.active_textRect)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def render_active(self):\n # Rendering button \"background\"\n if self.resize_right:\n self.active_background_surface = pygame.Surface((self.w * 1.05, self.h))\n else:\n self.active_background_surface = pygame.Surface((self.w, self.h))\n self.active_background_surf...
[ "0.824468", "0.727387", "0.7242291", "0.69929683", "0.69051856", "0.6741595", "0.6675783", "0.6625641", "0.660019", "0.6552847", "0.65396786", "0.6446757", "0.6421722", "0.64049184", "0.63985157", "0.6314176", "0.6296651", "0.6284545", "0.62568057", "0.6159919", "0.6135134", ...
0.90140796
0
Rendering the active button onto the screen surface.
def render_active(self): # Rendering button "background" if self.resize_right: self.active_background_surface = pygame.Surface((self.w * 1.05, self.h)) else: self.active_background_surface = pygame.Surface((self.w, self.h)) self.active_background_surface.set_alpha...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def render_inactive(self):\n # Rendering button \"background\"\n self.screen.blit(self.inactive_background_surface, (self.x, self.y))\n # Rendering button text\n self.screen.blit(self.active_text_surface, self.active_textRect)", "def draw_button(self):\r\n self.surface.fill(sel...
[ "0.8091009", "0.73016804", "0.7288868", "0.72423387", "0.7085554", "0.6943015", "0.6838501", "0.6808473", "0.67748725", "0.6729412", "0.664229", "0.6615208", "0.6613954", "0.65206283", "0.6385157", "0.63824177", "0.63584137", "0.63529414", "0.62700206", "0.6234393", "0.622167...
0.8646287
0
Checks whether the mouse is on the button and returns a boolean.
def mouse_on_button(self, mouse) -> bool: return self.x + self.w > mouse[0] > self.x and self.y + self.h > mouse[1] > self.y
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __check_if_got_pressed(self):\n mouse_x_pos,mouse_y_pos = pg.mouse.get_pos()\n\n if utilitiez.on_object(self.rect.x, self.rect.y, self.rect.width, self.rect.height, mouse_x_pos, mouse_y_pos,\n MOUSE_WIDTH, MOUSE_HEIGHT):\n self.__on_click()", "def isButt...
[ "0.76346713", "0.75949246", "0.75622696", "0.74238867", "0.73842466", "0.73723227", "0.73164", "0.72117794", "0.71592665", "0.7093802", "0.70712423", "0.70122606", "0.68814075", "0.68803525", "0.685196", "0.68248737", "0.682373", "0.6745367", "0.6737135", "0.6720025", "0.6718...
0.8396938
0
Test that a correct description passes the check and that a dot is added.
def test_description(self): self.assertEqual( "Description.", DescribedModel.parse_obj({"name": "Name", "description": "Description"}).description, )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_description(question):\n assert \"description\" in question[\"instance\"]\n description = question[\"instance\"][\"description\"]\n # there shouldn't be whitespace at the beginning or end\n assert description.strip() == description\n words = description.split()\n # we should have at leas...
[ "0.7467771", "0.7183706", "0.7170313", "0.69735307", "0.69044524", "0.67804605", "0.66104364", "0.65192705", "0.64968574", "0.6449131", "0.6411322", "0.6408082", "0.63846517", "0.63669723", "0.63474953", "0.6342997", "0.6311893", "0.63043153", "0.6295491", "0.6244171", "0.623...
0.71865505
1
Test that a description with punctuation passes the check.
def test_description_with_punctuation(self): self.assertEqual( "Description?", DescribedModel.parse_obj({"name": "Name", "description": "Description?"}).description, )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_description(question):\n assert \"description\" in question[\"instance\"]\n description = question[\"instance\"][\"description\"]\n # there shouldn't be whitespace at the beginning or end\n assert description.strip() == description\n words = description.split()\n # we should have at leas...
[ "0.7259576", "0.70288295", "0.67982197", "0.6772335", "0.66292626", "0.6555726", "0.65338016", "0.65078914", "0.6434341", "0.6406588", "0.6294614", "0.620535", "0.61716986", "0.61261255", "0.6119967", "0.6109077", "0.6107635", "0.61050224", "0.60843354", "0.6074227", "0.60651...
0.794725
0
Test that the description is mandatory.
def test_missing_description(self): self.check_validation_error("description\n field required", name="Name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_empty_description(self):\n self.check_validation_error('description\\n string does not match regex \".+\"', name=\"Name\", description=\"\")", "def testDescription(self):\n project = self.session.create_project()\n\n self.util.stringTypeTest(self, project, \"description\")\n\n ...
[ "0.8143264", "0.7655286", "0.7621963", "0.7548257", "0.7531445", "0.74477756", "0.7441477", "0.7300264", "0.72981095", "0.7288913", "0.7284006", "0.7265562", "0.7217067", "0.7123357", "0.7076178", "0.7076178", "0.7076178", "0.7076178", "0.70645094", "0.7035895", "0.7025577", ...
0.8563048
0
Test that the description has a nonzero length.
def test_empty_description(self): self.check_validation_error('description\n string does not match regex ".+"', name="Name", description="")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_no_description(self):\n context = TestContext(session_context=ducktape_mock.session_context(),\n cls=DummyTestNoDescription, function=DummyTestNoDescription.test_this)\n assert context.description == \"\"", "def test_missing_description(self):\n self.ch...
[ "0.6839186", "0.6832089", "0.6650879", "0.66502285", "0.6583756", "0.65266544", "0.6453843", "0.6399938", "0.63959414", "0.63910407", "0.63910407", "0.63910407", "0.63910407", "0.63842446", "0.63687706", "0.636613", "0.63494056", "0.6325557", "0.6310538", "0.63036925", "0.630...
0.7342262
0
Wait for clone process to finish
def wait_for_clone(repo, wait_for_ready, http_exc): start_time = time.time() while time.time() - start_time < wait_for_ready: repo.wipe_data() try: if repo.is_cloned: return except HTTPRequestError: _mod_log().debug('Failed to get status of the r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def waitUntilFinished():", "def waitUntilFinished():", "def waitUntilFinished():", "def waitUntilFinished():", "def wait(self):\n self.Popen.wait()", "def wait(self):\n pass", "def wait(self):\n pass", "def wait_finish(self):\r\n self.proc.join()", "def wait(self):\n\n ...
[ "0.65956825", "0.65956825", "0.65956825", "0.65956825", "0.6524684", "0.6290063", "0.6290063", "0.6060584", "0.6007381", "0.59562814", "0.59526855", "0.59149146", "0.5834006", "0.5834006", "0.58271825", "0.5822418", "0.57953876", "0.57722795", "0.5770641", "0.5743308", "0.572...
0.6913001
0
Checks out the given branch in the given repository on the give system
def checkout(connection, branch, rid=None, repo=None): if repo is None: repo = Repository(connection, rid) return repo.checkout(branch)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gitCheckoutBranch(self, path, branch):\r\n\r\n with workInDirectory(path):\r\n fetch_cmd = [\"git\", \"fetch\"]\r\n if self.verbose:\r\n print(\"Runing Command : {}\".format(\" \".join(fetch_cmd)))\r\n\r\n SubProcessUtility.runCommand(fetch_cmd)\r\n\r\n ...
[ "0.7553268", "0.72212356", "0.7122081", "0.71060395", "0.7037166", "0.69275075", "0.6837741", "0.6769412", "0.6685118", "0.6674647", "0.6668449", "0.65646195", "0.6517232", "0.6484005", "0.64520335", "0.6417905", "0.6379777", "0.6373071", "0.6324217", "0.6288217", "0.6272058"...
0.728686
1
Pulls the given repository on the give system
def pull(connection, rid=None, repo=None): if repo is None: repo = Repository(connection, rid) return repo.pull()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pull1(repo, **kwargs):\n ret = do_pull(repo, \"topology.virl\")\n if not ret:\n exit(1)", "def pull(self):\n origin = self.git_repo.remotes.origin\n origin.pull()", "def pull(self, remote, branch, *args):\n return self.cmd('pull', remote, branch, *args)", "def pull(refer...
[ "0.73290116", "0.717763", "0.7176306", "0.7152554", "0.7016408", "0.69733423", "0.69663095", "0.69643307", "0.69623786", "0.69125956", "0.6869978", "0.67377836", "0.66976327", "0.6685887", "0.6681624", "0.666945", "0.66548884", "0.6588705", "0.6575877", "0.65757114", "0.65705...
0.7484018
0
Get the statistics for the all builders.
def get_buildbot_stats(time_window : datetime.datetime) -> BuildStats: print('getting list of builders...') stats = BuildStats() for builder in requests.get(BASE_URL).json().keys(): # TODO: maybe filter the builds to the ones we care about stats += get_builder_stats(builder, time_window ) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_builder_stats(builder: str, time_window: datetime.datetime) -> BuildStats:\n print('Gettings builds for {}...'.format(builder))\n # TODO: can we limit the data we're requesting?\n url = '{}/{}/builds/_all'.format(BASE_URL, builder)\n stats = BuildStats()\n for build, results in requests.get(...
[ "0.70549256", "0.6995379", "0.66598487", "0.6448039", "0.6427277", "0.6422584", "0.6358498", "0.63564634", "0.6297995", "0.62931466", "0.62858886", "0.6255862", "0.6241165", "0.6240544", "0.61738175", "0.61579835", "0.61428285", "0.6082591", "0.60764337", "0.60596114", "0.602...
0.7632881
0
Get the statistics for one builder.
def get_builder_stats(builder: str, time_window: datetime.datetime) -> BuildStats: print('Gettings builds for {}...'.format(builder)) # TODO: can we limit the data we're requesting? url = '{}/{}/builds/_all'.format(BASE_URL, builder) stats = BuildStats() for build, results in requests.get(url).json(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_buildbot_stats(time_window : datetime.datetime) -> BuildStats:\n print('getting list of builders...')\n stats = BuildStats()\n for builder in requests.get(BASE_URL).json().keys():\n # TODO: maybe filter the builds to the ones we care about\n stats += get_builder_stats(builder, time_w...
[ "0.7178298", "0.6534593", "0.64914143", "0.6488856", "0.63973767", "0.63478684", "0.6330162", "0.62668484", "0.6216657", "0.61736965", "0.615647", "0.6031543", "0.6031311", "0.6029025", "0.5993337", "0.59911054", "0.5989218", "0.5979158", "0.59560424", "0.5946391", "0.5927121...
0.7503165
0
Create metric descriptors on Stackdriver. Recreating these with every call is fine.
def gcp_create_metric_descriptor(project_id: str): client = monitoring_v3.MetricServiceClient() project_name = client.project_path(project_id) for desc_type, desc_desc in [ ["buildbots_percent_failed", "Percentage of failed builds"], ["buildbots_builds_successful", "Number of successful bui...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def recreate_metrics():\n all = monitor_client.list_metric_descriptors(\n project_path, filter_='metric.type=starts_with(\"custom.\")'\n )\n for a in all:\n if \"accumulator\" in str(a) or \"biquery\" in str(a):\n metric_name = monitor_client.metric_descriptor_path(\n ...
[ "0.70970815", "0.6102869", "0.5952238", "0.5923666", "0.58200157", "0.5791009", "0.5774546", "0.575687", "0.57353896", "0.5720316", "0.5650112", "0.5590122", "0.5529896", "0.54889554", "0.54316115", "0.54202217", "0.5382546", "0.5348047", "0.53211987", "0.5313823", "0.530327"...
0.66897804
1
initialize a receptor library by setting the number of receptors, the number of substrates it can respond to, and optional additional parameters in the parameter dictionary
def __init__(self, num_substrates, num_receptors, parameters=None): # the call to the inherited method also sets the default parameters from # this class super(LibraryBinaryNumeric, self).__init__(num_substrates, num_receptors, parameters) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, num_params):\r\n self.num_params = num_params", "def __init__(self, num_params):\r\n self.num_params = num_params", "def __init__(self, *args, **kwargs):\n self.specGenerator = WMSpecGenerator()\n self.count = 0\n self.maxWmSpec = kwargs.setdefault('numOfSp...
[ "0.624694", "0.624694", "0.59270716", "0.58812773", "0.5859252", "0.5857603", "0.5856646", "0.5854381", "0.5844939", "0.58047056", "0.5773737", "0.57722926", "0.57650805", "0.57243747", "0.5716238", "0.56949776", "0.5688408", "0.56387156", "0.5638388", "0.5597038", "0.5542545...
0.7083537
0
calculate the number of steps to do for `scheme`
def get_steps(self, scheme): if scheme == 'monte_carlo': # calculate the number of steps for a monte-carlo scheme if self.parameters['monte_carlo_steps'] == 'auto': steps_min = self.parameters['monte_carlo_steps_min'] steps_max = self.parameters['monte_car...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_steps_num():\n return 0", "def decode_step_count(self, board=None):\n # TODO decide which one is better.. not crucial\n # steps = 0\n # for key_pow, val_coor in self.read_bits.items():\n # steps += (self.matrix_board[val_coor] * 2) ** key_pow\n # return step...
[ "0.65601104", "0.65067685", "0.6441884", "0.64148223", "0.6364415", "0.62706876", "0.6186873", "0.61510324", "0.6133444", "0.60866106", "0.60067546", "0.60036564", "0.5896404", "0.58475363", "0.58371323", "0.5806053", "0.5803067", "0.58011645", "0.57761735", "0.5773252", "0.5...
0.7198185
0
return the sorted `sensitivity_matrix` or sorts the internal sensitivity_matrix in place. This function rearranges receptors such that receptors reacting to an equal number of substrates and to similar substrates are close together.
def sort_sensitivity_matrix(self, sensitivity_matrix=None): if sensitivity_matrix is None: sens_mat = self.sens_mat else: sens_mat = sensitivity_matrix data = [(sum(item), list(item)) for item in sens_mat] sens_mat = np.array([item[1] for item in sorted(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SortAndFilterSuspects(self, suspects):\n if not suspects or len(suspects) == 1:\n return suspects\n\n suspects.sort(key=lambda suspect: -suspect.confidence)\n max_score = suspects[0].confidence\n min_score = max(suspects[-1].confidence, 0.0)\n if max_score == min_score:\n return []\n\n...
[ "0.54372156", "0.5328664", "0.5222484", "0.4775966", "0.47067013", "0.46552995", "0.46477485", "0.46280968", "0.4625397", "0.46188542", "0.46107998", "0.45985577", "0.45515847", "0.45426014", "0.45174512", "0.45159692", "0.4500111", "0.44911516", "0.44894326", "0.44743133", "...
0.73758173
0
iterate over all mixtures and yield the mixture with probability
def _iterate_mixtures(self): if self._iterate_steps > self.parameters['max_steps']: raise RuntimeError('The iteration would take more than %g steps' % self.parameters['max_steps']) hi = self.commonness Jij = self.correlations ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _sample_binary_mixtures(model, steps, dtype=np.uint):\n mixture_size = model.parameters['fixed_mixture_size']\n \n if not model.is_correlated_mixture and mixture_size is None:\n # use simple monte carlo algorithm\n prob_s = model.substrate_probabilities\n \n for _ i...
[ "0.6160292", "0.6110729", "0.59938663", "0.59472424", "0.58536416", "0.58510166", "0.58116955", "0.5767724", "0.57352465", "0.5675324", "0.5663256", "0.5660493", "0.56528705", "0.55985093", "0.5573837", "0.55732846", "0.5572714", "0.55721015", "0.55552113", "0.55295265", "0.5...
0.73259944
0
calculates mixture statistics using a brute force algorithm
def mixture_statistics_brute_force(self): Z = 0 hist1d = np.zeros(self.Ns) hist2d = np.zeros((self.Ns, self.Ns)) # iterate over all mixtures for c, weight_c in self._iterate_mixtures(): Z += weight_c hist1d += c * weight_c ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculate_mixture_features(args):\n workspace = args.workspace\n speech_dir = args.speech_dir\n noise_dir = args.noise_dir\n data_type = args.data_type\n fs = cfg.sample_rate\n dir_name = args.dir_name\n\n fid_clean = open(speech_dir, 'r')\n lines_clean = fid_clean.readlines()\n fid_...
[ "0.603266", "0.6025553", "0.5984378", "0.59416246", "0.58981115", "0.5829733", "0.5794666", "0.5727615", "0.57198894", "0.5643767", "0.5639376", "0.56325966", "0.5592785", "0.55927706", "0.55848724", "0.5584382", "0.5581739", "0.55519193", "0.5520184", "0.55121636", "0.551020...
0.70597595
0
estimates the mixture statistics
def mixture_statistics_estimate(self): ci_mean = self.substrate_probabilities if self.is_correlated_mixture: J_ij = self.correlations pi_s = ci_mean bar_pi_s = 1 - pi_s ci_mean = pi_s * (1 + 2*bar_pi_s*np.dot(J_ij, pi_s)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mixture_statistics_brute_force(self):\n \n Z = 0\n hist1d = np.zeros(self.Ns)\n hist2d = np.zeros((self.Ns, self.Ns))\n \n # iterate over all mixtures\n for c, weight_c in self._iterate_mixtures():\n Z += weight_c \n hist1d += c * we...
[ "0.7492281", "0.6477891", "0.639532", "0.63856214", "0.62459314", "0.6159641", "0.6154703", "0.6007116", "0.5989447", "0.5913637", "0.58870196", "0.5853389", "0.58513975", "0.5809787", "0.57763517", "0.5753387", "0.57354677", "0.5716687", "0.570656", "0.56891644", "0.56604356...
0.6841529
1
gets the entropy in the mixture distribution using brute force
def mixture_entropy_brute_force(self): Z, sum_wlogw = 0, 0 # Naive implementation of measuring the entropy is # p(c) = w(c) / Z with Z = sum_c w(c) # H_c = -sum_c p(c) * log2(p(c)) # This can be transformed to a more stable implementation: # H_c = log2(Z) - 1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def entropy(temp,pres):\n g_t = liq_g(1,0,temp,pres)\n s = -g_t\n return s", "def calc_entropy(data_set): #calculates total entropy of the dataset\r\n republicans = 0\r\n democrats = 0\r\n total = 0\r\n for data_point in data_set:\r\n party = data_point.dat_party\r\n if party =...
[ "0.69703406", "0.6953341", "0.69284886", "0.69082105", "0.687003", "0.6861443", "0.6851223", "0.6819869", "0.6818582", "0.68088657", "0.677869", "0.67508334", "0.66926396", "0.66545224", "0.6642097", "0.66395456", "0.6627271", "0.6620591", "0.6618552", "0.66109055", "0.658740...
0.7468018
0
estimates the average activity of the receptor as a response to single ligands. `ret_receptor_activity` determines whether the mean receptor activity will also be returned. `approx_prob` determines whether the probabilities of encountering ligands in mixtures are calculated exactly or only approximative, which should w...
def receptor_crosstalk_estimate(self, ret_receptor_activity=False, approx_prob=False, clip=False, ignore_correlations=False): if not ignore_correlations and self.is_correlated_mixture: r_n, r_nm = self.receptor_activity_estimate...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def receptor_activity_estimate(self, ret_correlations=False,\n approx_prob=False, clip=False):\n S_ni = self.sens_mat\n p_i = self.substrate_probabilities\n\n # calculate receptor activity assuming uncorrelated mixtures \n if approx_prob:\n ...
[ "0.64386016", "0.49481305", "0.48385146", "0.4779224", "0.46856108", "0.46765503", "0.4662905", "0.46267968", "0.45856437", "0.45664948", "0.43939775", "0.43856367", "0.43828163", "0.436443", "0.43603247", "0.43355826", "0.43281123", "0.43260527", "0.43019044", "0.42894408", ...
0.5905821
1
calculates the average activity of each receptor `method` can be ['brute_force', 'monte_carlo', 'estimate', 'auto']. If it is 'auto' than the method is chosen automatically based on the problem size.
def receptor_activity(self, method='auto', ret_correlations=False, **kwargs): if method == 'auto': if self.Ns <= self.parameters['brute_force_threshold_Ns']: method = 'brute_force' else: method = 'monte_carlo' if method == 'brute_f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def receptor_score(self, method='auto', multiprocessing=False):\n init_arguments = self.init_arguments\n init_arguments['parameters']['initialize_state']['sensitivity'] = 'exact'\n init_arguments['parameters']['sensitivity_matrix'] = self.sens_mat\n joblist = [(copy.deepcopy(self.init_a...
[ "0.62602246", "0.5744438", "0.531374", "0.5277215", "0.50603354", "0.50047123", "0.49545625", "0.491439", "0.4823283", "0.48020002", "0.47525263", "0.47253197", "0.47229403", "0.46382526", "0.46355662", "0.4616571", "0.45886013", "0.45580858", "0.45328122", "0.45287707", "0.4...
0.6362825
0
estimates the average activity of each receptor. `ret_correlations` determines whether the correlations between receptors are returned in addition to the mean activations. `approx_prob` determines whether the probabilities of encountering substrates in mixtures are calculated exactly or only approximative, which should...
def receptor_activity_estimate(self, ret_correlations=False, approx_prob=False, clip=False): S_ni = self.sens_mat p_i = self.substrate_probabilities # calculate receptor activity assuming uncorrelated mixtures if approx_prob: # app...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def receptor_crosstalk_estimate(self, ret_receptor_activity=False,\n approx_prob=False, clip=False,\n ignore_correlations=False):\n if not ignore_correlations and self.is_correlated_mixture:\n r_n, r_nm = self.receptor_activity...
[ "0.59837115", "0.57311416", "0.5284991", "0.5281454", "0.5232522", "0.5206169", "0.5147281", "0.5128546", "0.50398403", "0.50333416", "0.4890107", "0.4862184", "0.48607644", "0.48548672", "0.4842955", "0.48234457", "0.47857088", "0.47831595", "0.47778708", "0.47652474", "0.47...
0.7158738
0
calculate the mutual information. `excitation_method` can be ['brute_force', 'monte_carlo', 'estimate', 'auto'] If it is 'auto' than the excitation_method is chosen automatically based on the problem size. `ret_prob_activity` determines whether the probabilities of the different outputs are returned or not
def mutual_information(self, excitation_method='auto', **kwargs): if excitation_method == 'auto': if self.Ns <= self.parameters['brute_force_threshold_Ns']: excitation_method = 'brute_force' else: excitation_method = 'monte_carlo' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mutual_information_brute_force(self, ret_prob_activity=False):\n base = 2 ** np.arange(0, self.Nr)\n\n # prob_a contains the probability of finding activity a as an output.\n prob_a = np.zeros(2**self.Nr)\n for c, prob_c in self._iterate_mixtures():\n # get the associated...
[ "0.7677321", "0.6729323", "0.6610971", "0.62965286", "0.5475816", "0.54467", "0.53803253", "0.53383917", "0.5304403", "0.52832675", "0.5273865", "0.52435094", "0.5235883", "0.52353334", "0.51856315", "0.5179638", "0.516652", "0.51329374", "0.5128437", "0.5115408", "0.50964516...
0.78565335
0
calculate the mutual information by constructing all possible mixtures
def mutual_information_brute_force(self, ret_prob_activity=False): base = 2 ** np.arange(0, self.Nr) # prob_a contains the probability of finding activity a as an output. prob_a = np.zeros(2**self.Nr) for c, prob_c in self._iterate_mixtures(): # get the associated output ......
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _build_mixture(self) -> None:\n for mu, sigma in zip(self.mus, self.sigmas):\n self.pdfs.append(norm(mu, sigma))", "def mixture_statistics_brute_force(self):\n \n Z = 0\n hist1d = np.zeros(self.Ns)\n hist2d = np.zeros((self.Ns, self.Ns))\n \n # iter...
[ "0.68045783", "0.6167079", "0.61281043", "0.61196005", "0.60409695", "0.5897231", "0.5874367", "0.5874367", "0.58720165", "0.58610725", "0.5851441", "0.5790839", "0.5739831", "0.57007676", "0.56505895", "0.5636512", "0.56320953", "0.56164134", "0.5601524", "0.5584634", "0.556...
0.6359313
1
returns a simple estimate of the mutual information. `approx_prob` determines whether the probabilities of encountering substrates in mixtures are calculated exactly or only approximative, which should work for small probabilities.
def mutual_information_estimate(self, approx_prob=False): # this might be not the right approach q_n = self.receptor_activity_estimate(approx_prob=approx_prob) q_nm = self.receptor_crosstalk_estimate(approx_prob=approx_prob) # calculate the approximate mutual info...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mutual_information_monte_carlo_extrapolate(self, ret_prob_activity=False):\n if self.is_correlated_mixture:\n raise NotImplementedError('Not implemented for correlated mixtures')\n \n base = 2 ** np.arange(0, self.Nr)\n prob_s = self.substrate_probabilities\n\n ...
[ "0.5583002", "0.5569024", "0.55195194", "0.54732513", "0.5439062", "0.5311237", "0.5172197", "0.5165276", "0.51317364", "0.50231713", "0.48275942", "0.4811054", "0.48098183", "0.48028716", "0.4798505", "0.47701705", "0.47494784", "0.47418514", "0.4734358", "0.47275934", "0.47...
0.75532436
0
calculates the usefulness of each receptor, measured by how much information it adds to the total mutual information. `method` determines which method is used to determine the mutual information. `multiprocessing` determines whether multiprocessing is used for determining the mutual informations of all subsystems.
def receptor_score(self, method='auto', multiprocessing=False): init_arguments = self.init_arguments init_arguments['parameters']['initialize_state']['sensitivity'] = 'exact' init_arguments['parameters']['sensitivity_matrix'] = self.sens_mat joblist = [(copy.deepcopy(self.init_arguments)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mutual_information(self, excitation_method='auto', **kwargs):\n if excitation_method == 'auto':\n if self.Ns <= self.parameters['brute_force_threshold_Ns']:\n excitation_method = 'brute_force'\n else:\n excitation_method = 'monte_carlo'\n ...
[ "0.6172455", "0.5696483", "0.55845743", "0.5454974", "0.5411215", "0.5398892", "0.53274125", "0.5234939", "0.5197039", "0.5172683", "0.51339173", "0.50398976", "0.4996997", "0.4983228", "0.49595007", "0.49515915", "0.49353585", "0.49350932", "0.49265435", "0.49167734", "0.488...
0.72649634
0
optimizes the current library to maximize the result of the target function using gradient descent. By default, the function returns the best value and the associated interaction matrix as result. `direction` is either 'min' or 'max' and determines whether a minimum or a maximum is sought. `steps` determines how many o...
def optimize_library_descent(self, target, direction='max', steps=100, multiprocessing=False, ret_info=False, args=None): # get the target function to call target_function = getattr(self, target) if args is not None: t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def optimize_library_descent_multiple(self, target, direction='max',\n trials=4, multiprocessing=False,\n ret_error=False, **kwargs):\n \n # pass some parameters down to the optimization function to call\n kwargs...
[ "0.651425", "0.60995185", "0.59783125", "0.5357869", "0.5349476", "0.53483707", "0.5300958", "0.5280729", "0.5255571", "0.51577455", "0.51000774", "0.50822264", "0.5080444", "0.50465363", "0.50355375", "0.50104886", "0.4993036", "0.49904832", "0.49328518", "0.49109367", "0.49...
0.77414405
0
optimizes the current library to maximize the result of the target function using simulated annealing. By default, the function returns the best value and the associated interaction matrix as result. `direction` is either 'min' or 'max' and determines whether a minimum or a maximum is sought. `steps` determines how man...
def optimize_library_anneal(self, target, direction='max', steps=100, ret_info=False, args=None): # lazy import from .optimizer import ReceptorOptimizerAnnealer # @UnresolvedImport # prepare the class that manages the simulated annealing annealer...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def optimize_library_descent(self, target, direction='max', steps=100,\n multiprocessing=False, ret_info=False,\n args=None):\n # get the target function to call\n target_function = getattr(self, target)\n if args is not None:\n ...
[ "0.70528316", "0.59501183", "0.5642754", "0.5085643", "0.50599", "0.5013388", "0.5011954", "0.5007961", "0.5003236", "0.49108404", "0.48720664", "0.48720354", "0.48174542", "0.4795054", "0.47906741", "0.47627977", "0.47517008", "0.46950796", "0.46797842", "0.46576664", "0.464...
0.72034293
0
generator function that samples mixtures according to the `model`. `steps` determines how many mixtures are sampled `dtype` determines the dtype of the resulting concentration vector
def _sample_binary_mixtures(model, steps, dtype=np.uint): mixture_size = model.parameters['fixed_mixture_size'] if not model.is_correlated_mixture and mixture_size is None: # use simple monte carlo algorithm prob_s = model.substrate_probabilities for _ in range(int(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _sample_mixtures(self, steps=None, dtype=np.uint):\n if steps is None:\n steps = self._sample_steps\n \n return _sample_binary_mixtures(self, steps, dtype)", "def _iterate_mixtures(self):\n \n if self._iterate_steps > self.parameters['max_steps']:\n ra...
[ "0.7261067", "0.6262869", "0.5684544", "0.56400836", "0.55678874", "0.5419031", "0.5419031", "0.5378836", "0.53703797", "0.5349273", "0.5279914", "0.52595407", "0.5239342", "0.52295643", "0.5188037", "0.51616156", "0.515846", "0.5093254", "0.50914216", "0.5061559", "0.5050774...
0.7653979
0
test the performance of the brute force and the Monte Carlo method
def performance_test(Ns=15, Nr=3): num = 2**Ns hs = np.random.random(Ns) model = LibraryBinaryNumeric(Ns, Nr, hs) start = time.time() model.mutual_information_brute_force() time_brute_force = time.time() - start print('Brute force: %g sec' % time_brute_force) start = time.time(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\n hash_str = '5411ba21c470e12d49f351a2d240e43618032950'\n salt = '0d71906d0f735e6196c80d0a7cb1748e'\n encrypted_code = 'Ul5SR0ISYFxUXl8OOxITFBFWVlIRQVtRXV4bHQs4ExQREhMUERJDRlhcRxwWZltdQhJaRxFTE0BUQUcUXF1XQV1XFB07EhMUE' \\\n 'RITFBFCQV1fRhsTZVdAQBFhRldSV0BHV0dfGhYbOQ=='\n ...
[ "0.6661952", "0.6618818", "0.64001924", "0.63427407", "0.6263836", "0.6232404", "0.6223552", "0.59330684", "0.59220713", "0.59127235", "0.58657014", "0.58575463", "0.5836921", "0.58361584", "0.58269995", "0.5803118", "0.5761818", "0.573099", "0.57286465", "0.57004774", "0.568...
0.6652606
1
Returns Classroom in good representation for user
def __str__(self): return 'Classroom {} has a capacity of {} persons and ' \ 'has the following equipment: {}.'.format( self.number, str(self.capacity), ', '.join(self.equipment))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __repr__(self):\n return \"Classroom('{}', {}, {})\".format(self.number, self.capacity,\n str(self.equipment))", "def __str__(self):\n return self.room_name", "def __str__(self):\n return self.room.name", "def json(self):\n return...
[ "0.6388747", "0.58620846", "0.5832608", "0.55203956", "0.5508624", "0.5427314", "0.54227597", "0.5291813", "0.5283396", "0.52249587", "0.5194744", "0.5179897", "0.51505965", "0.51442033", "0.5131981", "0.5128399", "0.51204616", "0.5106739", "0.5105534", "0.5094171", "0.507423...
0.5878091
1
Classroom, Classroom > bool Returns True if first room have bigger capacity then second room
def is_larger(self, room2): return self.capacity > room2.capacity
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __gt__(self, other: Card) -> bool:\n return not self.__le__(other)", "def pareto_better(self, other: \"EvalItem\") -> bool:\n return self.size <= other.size and other.result <= self.result", "def __gt__(self, other):\n return self.weight() > other.weight()", "def __gt__(self, other):...
[ "0.61225253", "0.5890521", "0.5887941", "0.58851635", "0.5883985", "0.5871", "0.5871", "0.58323383", "0.57970667", "0.57674", "0.57477105", "0.57477105", "0.5667831", "0.5658871", "0.56532055", "0.5647148", "0.56317246", "0.56295174", "0.5624304", "0.55907315", "0.5584328", ...
0.73677325
0
Classroom, Classroom > list Returns the equipment in first room which is missing in second
def equipment_differences(self, room2): return sorted(list(set(self.equipment).difference(room2.equipment)))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_rooms(self, exclude=[]):\n stmt = Session.query(Lesson.room, Lesson.day, Lesson.order,\n Lesson.schedule_id)\n stmt = stmt.group_by(Lesson.room, Lesson.order, Lesson.day, Lesson.schedule_id)\n stmt = stmt.having(func.count(Lesson.room)>1)\n stmt = stmt.filter(not_(L...
[ "0.6358367", "0.6313788", "0.6150663", "0.60647494", "0.5886441", "0.5728688", "0.5633727", "0.5608109", "0.55511093", "0.53285015", "0.5248454", "0.523609", "0.5177248", "0.5149604", "0.51473695", "0.5124947", "0.5094668", "0.50736094", "0.50731784", "0.50704306", "0.5062421...
0.6854201
0
Takes a datetime object and returns POSIX UTC in nanoseconds
def date_to_nano(ts): return calendar.timegm(ts.utctimetuple()) * int(1e3)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unix_time_nanos(dt):\n return timedelta_to_micros(dt - epoch)", "def get_epoch_time(utc_datetime=None):\n if not utc_datetime:\n utc_datetime = datetime.datetime.utcnow()\n return math.ceil((utc_datetime - EPOCH_START).total_seconds())", "def datetime_to_gpstimestamp_nanoseconds(date):\n ...
[ "0.7196696", "0.6794556", "0.67814964", "0.6744819", "0.6744819", "0.67223793", "0.6684839", "0.6624673", "0.65977186", "0.6539144", "0.6514163", "0.65055406", "0.64669174", "0.64562154", "0.63818485", "0.6372414", "0.6349268", "0.62804013", "0.62467533", "0.6239043", "0.6236...
0.6813911
1
crop a square from a random location in image
def crop_square(image, size): width, height = image.size top = random.randint(0, max(0, height-size)) left = random.randint(0, max(0, width-size)) bottom = min(top + size, height) right = min(left + size, width) return image.crop((left, top, right, bottom))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __randomCrop(self, img):\n limit = self.PROCESSING_DIM - self.INPUT_DIM\n # pick 2 random integers less than this limit as the origin of the cropped image\n x_start = np.random.randint(limit)\n y_start = np.random.randint(limit)\n return img.crop((x_start, y_start, x_start + ...
[ "0.7516474", "0.7385669", "0.7284761", "0.72695327", "0.7268751", "0.7198979", "0.71195275", "0.709904", "0.70559186", "0.69418275", "0.6898815", "0.6874871", "0.68389267", "0.6755586", "0.67538106", "0.6685173", "0.66399777", "0.66174954", "0.65900636", "0.65848845", "0.6583...
0.82719237
0
Generates an SGF file with the game provided within the temp directory
def _get_input_filepath(self, game_id: int) -> str: with self._db_connection as connection: with connection.cursor() as cursor: cursor.execute('SELECT sgf_content FROM games WHERE id=%s', (game_id,)) if cursor.rowcount == 0: raise GameNotFoundError...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def instantiate_for_spirv_args(self, testcase):\n shader, self.filename = tempfile.mkstemp(\n dir=testcase.directory, suffix=self.suffix)\n shader_object = os.fdopen(shader, 'w')\n shader_object.write(self.source)\n shader_object.close()\n return self.filename", "def main():\n\n args = p...
[ "0.5956804", "0.59355676", "0.59196234", "0.586338", "0.5857218", "0.58492386", "0.5716386", "0.57071114", "0.5694615", "0.565109", "0.56128067", "0.56030047", "0.55999684", "0.5515769", "0.54997516", "0.54982835", "0.5453069", "0.5453069", "0.54357845", "0.5433838", "0.53828...
0.6236334
0
return a tuple of (isHit, hitResult). isHit is a Boolean with is true in case of hit and false in case of miss. in case of hit hitResult is HPA if request.addr is cached in the tlb, otherwise hitResult is None
def lookup(self, request): if request.addr in self._addressMap: return (True, self._addressMap[request.addr]) else: return (False, None)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _checkHit( self , bp ):\n hit = 0\n if bp.jpyhits != 0 :\n # check hits context\n bp.hitted = bp.hitted + 1\n if bp.hitStyle == HIT_EQUALS_TO and \\\n bp.hitted == bp.jpyhits :\n hit = 1\n elif bp.hitStyle == HIT_...
[ "0.59976083", "0.5989675", "0.5826117", "0.5499163", "0.54839325", "0.5301686", "0.52203494", "0.516528", "0.5153411", "0.5124234", "0.50933915", "0.5003426", "0.4978922", "0.49499053", "0.49425858", "0.4921342", "0.4921074", "0.49039856", "0.48851854", "0.48693472", "0.48693...
0.64621645
0
update the tlb with the translation address from updateObj
def update(self, updateObj): #if we've allocated all free entries in tlb if len(self._allocatedQ) == self._maxSize: #remove the old entries from the tlb (fifo order) oldUpdateObj = self._allocatedQ.popleft() del self._addressMap[oldUpdateObj.requestAddr] reqA...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self, obj):\n self.identity_map[obj._instance_key] = obj\n self.register_dirty(obj)", "def _update_object(self, data_dict):\r\n pass", "def gen_update(self, TL):\r\n pass", "def update(self, obj):\n self._updater.update(obj)", "def rs_edit_upd(obj):\n verts ...
[ "0.57816815", "0.56557685", "0.55526066", "0.5421197", "0.5410602", "0.53786093", "0.5346271", "0.53038764", "0.52939814", "0.5269879", "0.5261274", "0.52505845", "0.52505845", "0.5190733", "0.5168241", "0.51626116", "0.515856", "0.51562643", "0.5152305", "0.51184386", "0.508...
0.68263865
0
Create asset, need correct type, title, label and url
def create(self) -> requests.request: # Check needed values if None in [self.args.type, self.args.title, self.args.label, self.args.url]: raise Exception('Provide all parameters for asset creation') # Check type if self.args.type not in ['photo', 'video']: raise E...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_system_asset(self):\n pass", "def createAsset(assFolder, *args):\n createAssetUI(assFolder)", "def GenerateAssetForCreateRequest(args):\n module = dataplex_api.GetMessageModule()\n resource_spec_field = module.GoogleCloudDataplexV1AssetResourceSpec\n resource_spec = module.GoogleCl...
[ "0.671682", "0.64737254", "0.6421837", "0.62232536", "0.6000631", "0.59809226", "0.5915411", "0.5874975", "0.5862183", "0.583357", "0.580872", "0.57912344", "0.5771107", "0.5771107", "0.57580495", "0.56909776", "0.56909263", "0.5686929", "0.5659839", "0.56492126", "0.56392914...
0.6872285
0
Update asset, needs ID, title, label and url
def update(self) -> requests.request: # Check if id is set if self.args.id is None: raise Exception('Provide id of asset you want to update') # Check URL validity if self.args.url is not None and self.check_url_invalidity(): raise Exception('Provided URL is not v...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_asset(cls, id, asset_data):\n\n return ph_base._update_record('asset', id, asset_data)", "def test_update_asset(self):\n pass", "def test_update(self):\n obj = self.provision_single_asset()\n test_string = \"testing this thing\"\n p = {'id': obj.id, 'description': ...
[ "0.73195666", "0.6679826", "0.6523849", "0.6501261", "0.6478999", "0.6240539", "0.6233769", "0.61489034", "0.6104539", "0.60541105", "0.59750587", "0.58513236", "0.5828668", "0.580936", "0.5783961", "0.5755456", "0.5726288", "0.571024", "0.56786734", "0.5664309", "0.56492716"...
0.73020154
1
Delete asset, needs ID
def delete(self) -> requests.request: # Check if id is set if self.args.id is None: raise Exception('Provide id of asset you want to delete') # Send DELETE request return requests.delete(self.REQUEST_URL + str(self.args.id))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_asset(self, asset_id, asset_type):\n return self.asset(asset_id, asset_type=asset_type, action='DELETE')", "def test_delete_asset(self):\n pass", "def delete(self, _id):", "def delete_url_asset(self, asset_id):\n return self.delete_asset(asset_id, 'URL')", "def test_delete(s...
[ "0.79241407", "0.7676571", "0.7436167", "0.7214911", "0.7157785", "0.7132754", "0.6974048", "0.6962282", "0.69503105", "0.6911497", "0.68340725", "0.6808648", "0.6807498", "0.6734712", "0.6727808", "0.67007345", "0.669589", "0.6653962", "0.6645524", "0.6641693", "0.6624981", ...
0.7802429
1
Returns True if URL is invalid, False if it is not
def check_url_invalidity(self) -> bool: validate = URLValidator() try: validate(self.args.url) return False except ValidationError: return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_url(value):\n\n valid = validators.url(value)\n if valid != True:\n return False", "def is_valid_url(url: str) -> bool:\n try:\n requests.get(url)\n except requests.exceptions.RequestException:\n return False\n return True", "def check_url(value):\n\n valid = va...
[ "0.830075", "0.8289973", "0.82301325", "0.82217", "0.81955594", "0.8174947", "0.8111032", "0.81069154", "0.81027186", "0.80677193", "0.8043112", "0.8043112", "0.80158013", "0.79966223", "0.79324365", "0.78702646", "0.78689444", "0.7865635", "0.7850163", "0.7827034", "0.780993...
0.8617458
0
Decorator that lifts an unary predicate into a Predicate.
def predicate(f): wrapper = Predicate(f) update_wrapper(wrapper, f) return wrapper
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def predicate (self, X, * args, ** kw) :\n self.lhs = self.lhs.predicate (X, * args, ** kw)\n return self", "def visit_unbound_predicate(self, predicate) -> T:", "def _generate_unary_deferer(op_func):\n\n def deferer(self, *args, **kwargs):\n return type(self)._defer_unary_elementwise(\...
[ "0.61001146", "0.59637415", "0.58849007", "0.58419997", "0.5755853", "0.5751772", "0.5665722", "0.5661092", "0.5583315", "0.55070066", "0.5454716", "0.5451329", "0.53772974", "0.5363552", "0.53583723", "0.53360695", "0.5334606", "0.531459", "0.52997607", "0.52853334", "0.5235...
0.6924056
0
Test the transaction_for_doi method
def test_get_transaction_for_doi(self): # Submit a reserve, then use the assigned doi to get the transaction record reserve_kwargs = { "input": join(self.input_dir, "pds4_bundle_with_contributors.xml"), "node": "img", "submitter": "my_user@my_node.gov", "f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_transaction_for_identifier(self):\n # Submit a reserve, then use the PDS identifier to get the transaction record\n reserve_kwargs = {\n \"input\": join(self.input_dir, \"pds4_bundle_with_contributors.xml\"),\n \"node\": \"img\",\n \"submitter\": \"my_use...
[ "0.7132114", "0.59276116", "0.58578324", "0.5844066", "0.5840851", "0.58291525", "0.57940173", "0.57708603", "0.5729419", "0.5708635", "0.569995", "0.5694162", "0.56870985", "0.5622052", "0.5576013", "0.55612105", "0.55599636", "0.5553421", "0.5456069", "0.54547375", "0.53775...
0.8255177
0
Test the transaction_for_identifier method
def test_get_transaction_for_identifier(self): # Submit a reserve, then use the PDS identifier to get the transaction record reserve_kwargs = { "input": join(self.input_dir, "pds4_bundle_with_contributors.xml"), "node": "img", "submitter": "my_user@my_node.gov", ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_transaction_details_request(self):\n self.trans_details.get_transaction_details(\n trans_id = 123456,\n )", "def test_get_uniqueId():\n rep=RentRepository()\n rep.store(\"12\",\"23\",\"1\", \"1\")\n try:\n\n idBook=\"13\"\n idCustomer=\"54\"\n f...
[ "0.61464214", "0.60946786", "0.6051062", "0.5957183", "0.5921026", "0.5911639", "0.589465", "0.586385", "0.5855458", "0.5846576", "0.5818048", "0.5764767", "0.57319367", "0.5727006", "0.57104456", "0.5699692", "0.5688432", "0.5681126", "0.567688", "0.56671363", "0.5657053", ...
0.75881815
0
Test the output_label_for_transaction method
def test_get_output_label_for_transaction(self): # Submit a reserve, then use the PDS identifier to get the transaction record reserve_kwargs = { "input": join(self.input_dir, "pds4_bundle_with_contributors.xml"), "node": "img", "submitter": "my_user@my_node.gov", ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def handle_output(self, workunit, label, s):\r\n pass", "def handle_output(self, workunit, label, s):\r\n pass", "def test_labels(self):\n self.compliance_tester.test_labels(self.oi)", "def test_label(self):\n xs = t.Label(t.Exactly(\"x\"), 'CustomLabel')\n self.assertEqual(writePy...
[ "0.6840131", "0.6840131", "0.6280704", "0.60962415", "0.6002755", "0.5660651", "0.5654368", "0.5635582", "0.5635582", "0.5635582", "0.5634114", "0.562665", "0.55732125", "0.5569116", "0.55691105", "0.5563312", "0.5546234", "0.5544815", "0.55269396", "0.5515246", "0.5514803", ...
0.7726957
0
Returns count of open changes per reviewer per project Fetches all open changes from gerrit, and returns a dictionary containing all projects with open changes, and for each project, all reviewers and the count of changes they are reviewing. e.g. {
def get_open_change_reviewers_per_project(): config = GerritFetchConfig() open_changes = fetch.fetch_open_changes( config.hostname(), config.username(), config.port()) open_change_reviewers_per_project = {} for gerrit_change in open_changes: project = gerrit_change.project review...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_current_reviewers_and_counts(project_name):\n reviewer_change_count_per_project = current_load_fetcher.\\\n get_open_change_reviewers_per_project()\n\n if project_name not in reviewer_change_count_per_project and \\\n project_name != PROJECT_ALL:\n logging.warning(\"Project ...
[ "0.6898937", "0.6401227", "0.62829226", "0.61762327", "0.61221975", "0.6012132", "0.58491695", "0.56204873", "0.5591274", "0.5577237", "0.54595", "0.54480326", "0.54340416", "0.53901017", "0.5334617", "0.52910286", "0.52823967", "0.5252443", "0.5237763", "0.5233384", "0.52304...
0.87611914
0
Return an UTCaware datetime in case of USE_TZ=True.
def tz_aware(value: datetime) -> datetime: if settings.USE_TZ: value = value.replace(tzinfo=timezone.utc) return value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_freeze_with_timezone_aware_datetime_in_utc():\n utc_now = datetime.datetime.utcnow()\n assert utc_now.tzinfo is None", "def test_freeze_with_timezone_aware_datetime_in_non_utc():\n utc_now = datetime.datetime.utcnow()\n assert utc_now.tzinfo is None\n assert utc_now == datetime.datetime(1...
[ "0.7496584", "0.72608817", "0.71937054", "0.71411216", "0.71222836", "0.7066944", "0.7022482", "0.6987124", "0.6978549", "0.696762", "0.6947956", "0.6856145", "0.6847567", "0.68384445", "0.6833825", "0.6821648", "0.6819736", "0.6792303", "0.67815375", "0.6744564", "0.67071795...
0.77953434
0
Adds a step into calculated metrics
def add_step(self): assert self.y_real is not None and self.y_predicted is not None # Calculates some metrics rmse = Metrics.rmse_loss(self.y_real, self.y_predicted) mse = Metrics.mse_loss(self.y_real, self.y_predicted) cm = Metrics.confusion_matrix(self.y_real, self.y_predicted...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_metric(self, metric):\n self.metrics.append(metric)\n self.estimate()", "def add_step(self, step):\n if not step:\n return\n temp = {Result.__STEP: step.get_name(),\n Result.__STATUS: step.get_status(),\n Result.__MESSAGE: step.get_mess...
[ "0.6825129", "0.68105835", "0.6705063", "0.66030556", "0.6589102", "0.64661735", "0.64505416", "0.63579696", "0.63276815", "0.6287285", "0.62792087", "0.62393504", "0.621419", "0.61822873", "0.61751336", "0.6074285", "0.60637534", "0.6020474", "0.59689176", "0.59689176", "0.5...
0.7380234
0
Get all Event by user_id
def get_event_by_user_id(user_id): return Event.query.filter(Event.user_id == user_id).order_by(Event.created_at.desc()).all()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_queryset(self):\n return Event.objects.all().filter(user_id=self.request.user)", "def event_get(tenant_id, user_id=None):", "async def retrieve_user_events(self, user_id: int) -> Dict[int, BaseEvent]:\n user_events: Dict[int, BaseEvent] = {}\n event: BaseEvent\n for event_id...
[ "0.7322746", "0.7310857", "0.72287333", "0.7047232", "0.67568713", "0.6709224", "0.67006856", "0.63310444", "0.62991863", "0.6286739", "0.62130445", "0.62024057", "0.6089561", "0.6088284", "0.6058859", "0.6029098", "0.60218024", "0.6001406", "0.5960545", "0.59485763", "0.5944...
0.8250652
0
Create and return Job Details
def create_job_detail(company_name, job_title, application_deadline, job_listing_url, state, city, application_listed, salary): job_detail = JobDetail(company_name = company_name, job_title = job_title, application_deadline = application_deadline, job_listing_url = job_listing_url, state = state , city = city, app...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def created_job(new_job, bulk_request):\n bulk_request.return_value = '''<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n <jobInfo xmlns=\"http://www.force.com/2009/06/asyncapi/dataload\">\n <id>THEJOBID</id>\n <operation>update</operation>\n <object>Lead</object>\n </...
[ "0.7009168", "0.6943577", "0.66033685", "0.6572269", "0.65686125", "0.6561279", "0.6561279", "0.6559106", "0.64874846", "0.64813113", "0.6469618", "0.6463148", "0.6453288", "0.64453775", "0.64210135", "0.6420657", "0.641971", "0.6398805", "0.6393895", "0.6366971", "0.6274766"...
0.75051147
0
Return all job detail.
def get_job_detail(): return JobDetail.query.all()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_job_list(self):\n return self.job_list", "def get_job_list(self):\n return self.job_list", "def getJobList_impl(self):\n my_infos = TestJob.objects.filter(\n (Q(job_status='Running')|Q(job_status='Submitted')|Q(job_status='Incomplete'))\n &Q(check_or_not=True)...
[ "0.7248316", "0.7248316", "0.7240961", "0.72205126", "0.7180172", "0.7098997", "0.70902854", "0.7087385", "0.7077205", "0.70463014", "0.7011621", "0.7009996", "0.6946961", "0.6840078", "0.68360656", "0.680167", "0.67841136", "0.67203075", "0.6700369", "0.6699724", "0.66963166...
0.8332733
0
Return a job detail by primary key.
def get_job_detail_by_id(job_detail_id): return JobDetail.query.get(job_detail_id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_job(self, identifier: str):\n self._log_operation('Getting job {i}'.format(i=identifier))\n return self._job_queue.get_job_details(identifier)", "def get_job_detail():\n\n return JobDetail.query.all()", "def jobid(self):\n return self.get_db('jobid')", "def get_object(self, pk):\n...
[ "0.72874004", "0.7173427", "0.71372676", "0.6959532", "0.6943279", "0.692583", "0.6852095", "0.6842035", "0.67910886", "0.67829704", "0.6779413", "0.67499465", "0.6748419", "0.6660234", "0.65764666", "0.6566741", "0.656614", "0.6525582", "0.64881426", "0.6479494", "0.647201",...
0.77013654
0
Return all job applied.
def get_job_applied(): return JobCompletedApplication.query.all()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def jobs(self):\n return self.get_jobs()", "def jobs(self):\n return self._jobs", "def get_jobs(self):\n return list(self._jobs.values())", "def get_all_jobs(self):\n all_jobs = self.job_set.all().order_by(\"-time_last_updated\", \"project__name\", \"-id\")\n # for job in a...
[ "0.7738957", "0.73770744", "0.7349059", "0.7263708", "0.71636105", "0.71636105", "0.7105789", "0.7049187", "0.69864005", "0.69775003", "0.6923545", "0.68921167", "0.68604153", "0.6717858", "0.6713856", "0.661173", "0.6611498", "0.65968645", "0.6593661", "0.65781695", "0.65622...
0.76446235
1
Return a job applied by job id.
def get_job_applied_by_job_id(job_id): return JobCompletedApplication.query.filter(JobCompletedApplication.job_id == job_id).first().job_applied_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_job_by_id(self, job_id):\n return self.get_resource(category=SYSTEM, resource_level=JOB,\n resource_level_id=job_id)", "def get_job_applied_by_id(job_applied_id):\n\n return JobCompletedApplication.query.get(job_applied_id)", "def get_job(self, job_id):\n\n ...
[ "0.77378917", "0.7632125", "0.7465325", "0.7188449", "0.715539", "0.7043636", "0.6927355", "0.6892371", "0.68905514", "0.6852687", "0.6848821", "0.6789124", "0.67766374", "0.67155415", "0.66451055", "0.65906435", "0.65832335", "0.6499773", "0.6458737", "0.6456007", "0.6417066...
0.7639219
1
Return all note created.
def get_note(): return Note.query.all()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def listNotes() -> list:\n list_of_notes = []\n for note in Note.objects.all():\n list_of_notes.append({\n 'uuid': note.uuid, 'title': note.title,\n 'author': note.author, 'body': note.body, 'created_at': localtime(note.created_at)\n })\n return list_of_notes", "def n...
[ "0.77602446", "0.7531043", "0.70795774", "0.7064056", "0.70277685", "0.7003691", "0.6970311", "0.69562006", "0.6907323", "0.6907323", "0.6899866", "0.6882427", "0.6856624", "0.6796058", "0.678864", "0.66967875", "0.66869307", "0.66006863", "0.6593107", "0.65787625", "0.653431...
0.7753266
1
Return all notes for job applied id.
def all_note_by_job_applied_id(job_applied_id): return Note.query.filter(Note.job_applied_id == job_applied_id, Note.note_category == 'Note' ).all()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def all_jd_by_job_applied_id(job_applied_id): \n return Note.query.filter(Note.job_applied_id == job_applied_id, Note.note_category == 'Job Description' ).order_by(Note.note_date_created.desc()).first()", "def all_recruiter_by_job_applied_id(job_applied_id): \n return Note.query.filter(Note.job_applied...
[ "0.73608685", "0.70325047", "0.7020432", "0.673755", "0.66720706", "0.65655774", "0.64068127", "0.6329673", "0.63007534", "0.62201124", "0.61646885", "0.61219245", "0.61209005", "0.6072345", "0.6039921", "0.5995878", "0.59537804", "0.5936029", "0.587913", "0.5855434", "0.5827...
0.8214903
0
Return all job description for job applied id.
def all_jd_by_job_applied_id(job_applied_id): return Note.query.filter(Note.job_applied_id == job_applied_id, Note.note_category == 'Job Description' ).order_by(Note.note_date_created.desc()).first()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def describe_job(self):\n # GET /jobs/{job_id}\n pass", "def get_job_description(self, job, context=None):\n return self._client.call_method(\n 'UserAndJobState.get_job_description',\n [job], self._service_ver, context)", "def all_resume_by_job_applied_id(job_applied_...
[ "0.682056", "0.63486063", "0.60984653", "0.6051572", "0.598966", "0.5974383", "0.5968253", "0.5953331", "0.59054095", "0.58386207", "0.58320206", "0.58077645", "0.57883066", "0.57619286", "0.56843454", "0.56843454", "0.55897605", "0.5587414", "0.5582129", "0.5572485", "0.5552...
0.6539759
1
Return all recruiter details for job applied id.
def all_recruiter_by_job_applied_id(job_applied_id): return Note.query.filter(Note.job_applied_id == job_applied_id, Note.note_category == 'Recruiter Contact' ).all()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def all_resume_by_job_applied_id(job_applied_id): \n return Note.query.filter(Note.job_applied_id == job_applied_id, Note.note_category == 'Resume' ).all()", "def scrape_recruitment(self):\n d = self.driver\n recruitment_page = self.guildwork_url + '/recruitment'\n d.get(recruitment_pag...
[ "0.6490853", "0.602824", "0.5831629", "0.57851154", "0.5604668", "0.55976665", "0.55698776", "0.5514874", "0.5397591", "0.5368741", "0.53621614", "0.53491193", "0.5341995", "0.52119046", "0.51713234", "0.5159437", "0.5067528", "0.50574297", "0.50168747", "0.5014782", "0.50143...
0.76523733
0
Return all Resume for job applied id.
def all_resume_by_job_applied_id(job_applied_id): return Note.query.filter(Note.job_applied_id == job_applied_id, Note.note_category == 'Resume' ).all()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def all_recruiter_by_job_applied_id(job_applied_id): \n return Note.query.filter(Note.job_applied_id == job_applied_id, Note.note_category == 'Recruiter Contact' ).all()", "def get_job_applied():\n\n return JobCompletedApplication.query.all()", "def resume(self, job_id):\n job = Job.get_job_by_i...
[ "0.5769213", "0.56241286", "0.55435765", "0.54594284", "0.5418937", "0.53563815", "0.53016", "0.5262021", "0.5253391", "0.5253391", "0.5225734", "0.521197", "0.51903236", "0.5136629", "0.51281595", "0.51190066", "0.5110543", "0.5109377", "0.50861925", "0.5067618", "0.50420934...
0.8092352
0
Return all Follow up Template for job applied id.
def all_followup_by_job_applied_id(job_applied_id): return Note.query.filter(Note.job_applied_id == job_applied_id, Note.note_category == 'Follow-up').all()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def job_templates(self):\n return self._tower.job_templates.filter({'project__exact': self.id})", "def get_templates(self):\n return [{\"id\": tmplt[\"template_id\"], \"name\": tmplt[\"name\"]}\n for tmplt in Template.objects(user_id=self.user_id, active=True)]", "def get_template_...
[ "0.59492767", "0.545359", "0.5385648", "0.52259356", "0.5178491", "0.51286674", "0.5078213", "0.5043155", "0.49889243", "0.4969203", "0.49352974", "0.49056143", "0.48956487", "0.48870766", "0.487659", "0.48737434", "0.48275462", "0.482688", "0.47788817", "0.47703582", "0.4743...
0.64399916
0
Return all Interview question by job applied id.
def all_interview_by_job_applied_id(job_applied_id): return Note.query.filter(Note.job_applied_id == job_applied_id, ((Note.note_category == 'Interview Question Technical') | (Note.note_category == 'Interview Question Informational') | (Note.note_category == 'Interview Question Behavioral'))).order_by(Note.note_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def all_resume_by_job_applied_id(job_applied_id): \n return Note.query.filter(Note.job_applied_id == job_applied_id, Note.note_category == 'Resume' ).all()", "def get_questions(self, obj):\n queryset = Question.objects.filter(sheet=obj)\n questions = []\n for q in queryset:\n ...
[ "0.60519505", "0.60223424", "0.5880214", "0.57323456", "0.5701403", "0.5560641", "0.5559024", "0.5552572", "0.54993796", "0.5482854", "0.5401203", "0.53886664", "0.52820504", "0.5280837", "0.52447784", "0.5219957", "0.5178943", "0.51773167", "0.51404804", "0.5137996", "0.5107...
0.73461443
0
Return all Interview question by job user id.
def all_interview_by_user_id(user_id): return Note.query.filter(Note.user_id == user_id, ((Note.note_category == 'Interview Question Technical') | (Note.note_category == 'Interview Question Informational') | (Note.note_category == 'Interview Question Behavioral'))).order_by(Note.note_date_created.desc()).all()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def all_interview_by_job_applied_id(job_applied_id): \n return Note.query.filter(Note.job_applied_id == job_applied_id, ((Note.note_category == 'Interview Question Technical') | (Note.note_category == 'Interview Question Informational') | (Note.note_category == 'Interview Question Behavioral'))).order_by(Note...
[ "0.64423734", "0.6284777", "0.62319624", "0.59722936", "0.5878626", "0.5869722", "0.5776599", "0.5703998", "0.5643334", "0.55415744", "0.55246925", "0.5491793", "0.54882145", "0.5477339", "0.54560447", "0.5452791", "0.5439329", "0.53813064", "0.5355762", "0.52801436", "0.5280...
0.66224235
0
create and return Application Progress
def create_application_progress(application_state, job_applied_id , created_at): app_progress = ApplicationProgress(application_state = application_state, job_applied_id = job_applied_id, created_at = created_at) db.session.add(app_progress) db.session.commit() return app_progress
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getProgress(self):", "def GetProgress(self):\n return self.new_progress", "def get_progress(self):\n\t\treturn call_sdk_function('PrlJob_GetProgress', self.handle)", "def progress(self, *args, **kwargs):\n kwargs['logger'] = self\n return Progress(*args, **kwargs)", "def reportProgress...
[ "0.6922813", "0.6465331", "0.62213963", "0.6202986", "0.6198377", "0.61496395", "0.6125598", "0.61032665", "0.6076108", "0.5990762", "0.5978565", "0.5978565", "0.59583265", "0.5951946", "0.58782065", "0.58567727", "0.58351296", "0.58163893", "0.58163893", "0.58061016", "0.578...
0.6606787
1
Return all Application Progress created.
def get_application_progress(): return ApplicationProgress.query.all()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getProgress(self):", "def get_progress(self, asc=True):\n\n # block until system is ready\n while not self.ready.isSet():\n self.ready.wait(0.1)\n\n events = self.get_all_events()\n if not asc:\n events = reversed(list(events))\n\n return [(event, self...
[ "0.6268866", "0.6009856", "0.6005044", "0.5949115", "0.591462", "0.58448476", "0.57968134", "0.5741962", "0.57029724", "0.57012784", "0.56873035", "0.56828934", "0.5674864", "0.56605846", "0.55666447", "0.55653167", "0.55082387", "0.55082387", "0.5501211", "0.54991305", "0.54...
0.801629
0
Return a Application Progress by primary key.
def get_application_progress_by_id(app_progress_id): return ApplicationProgress.query.get(app_progress_id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_application_progress():\n\n return ApplicationProgress.query.all()", "def get_result_by_primary_key(self, pk):\n session = self.session_factory()\n result = session.query(PipelineRun).filter_by(id=pk).first()\n session.close()\n return result", "def find(self, primary_key...
[ "0.63571316", "0.584929", "0.5738413", "0.56607336", "0.5591691", "0.5382415", "0.52425617", "0.5224627", "0.519701", "0.5172489", "0.5172489", "0.5164485", "0.5137614", "0.51188457", "0.5116484", "0.51071393", "0.51062864", "0.5100811", "0.50962", "0.50886536", "0.508539", ...
0.7809704
0
Get the last job_id record
def get_last_job_id(): return JobDetail.query.with_entities(JobDetail.job_id).order_by(JobDetail.job_id.desc()).first()[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_last_job_applied_id():\n\n return JobCompletedApplication.query.with_entities(JobCompletedApplication.job_applied_id).order_by(JobCompletedApplication.job_applied_id.desc()).first()[0]", "def jobid(self):\n return self.get_db('jobid')", "def last_job(self): # TOFIX model the job and return an ob...
[ "0.768667", "0.75634575", "0.75450337", "0.7345317", "0.7155515", "0.71417", "0.7064087", "0.69970345", "0.69467616", "0.693553", "0.6832919", "0.68281484", "0.6805035", "0.67877", "0.67750955", "0.67263293", "0.6711748", "0.6658601", "0.6635541", "0.661187", "0.65753484", ...
0.8820396
0
Get the last job applied id record
def get_last_job_applied_id(): return JobCompletedApplication.query.with_entities(JobCompletedApplication.job_applied_id).order_by(JobCompletedApplication.job_applied_id.desc()).first()[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_last_job_id():\n\n return JobDetail.query.with_entities(JobDetail.job_id).order_by(JobDetail.job_id.desc()).first()[0]", "def last_job(self): # TOFIX model the job and return an object instead of dictionary\n return self._data.get('summary_fields', {}).get('last_job')", "def latest_id(self):...
[ "0.7888452", "0.7109309", "0.6963653", "0.68734276", "0.6839119", "0.6704593", "0.6665769", "0.6628784", "0.65945107", "0.65694714", "0.6464214", "0.64519495", "0.644685", "0.64032155", "0.63841957", "0.6373546", "0.6372956", "0.6369404", "0.63560134", "0.63174295", "0.631160...
0.8291623
0
Calculates the cost given the target. This method must be called after `forward` has been called.
def cost(self, cost_object, target): return cost_object.f(self.a[-1], target).mean(axis=0).sum()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cost(self) -> float:", "def __compute_cost(self, x, y):\n\n predictions = self.__compute_prediction(x)\n cost = np.mean(-y * np.log(predictions) - (1 - y) * np.log(1 - predictions))\n\n return cost", "def calculate_total_cost(state):\r\n return state.cost()", "def cost(self):\n\t\...
[ "0.7035611", "0.6710912", "0.67076313", "0.670511", "0.66524404", "0.66274863", "0.6589824", "0.6588693", "0.6582186", "0.6582186", "0.6580311", "0.6567873", "0.6526451", "0.6509514", "0.6483877", "0.6477303", "0.64738995", "0.64710313", "0.6433443", "0.6429381", "0.6400443",...
0.7270355
0
Get Enrollment Dataframe (enrollment_.csv)
def get_enrollment_df(ftype): assert ftype=='train' or ftype=='test' enroll_df = pd.read_csv('data/%s/enrollment_%s.csv' % (ftype, ftype)) return enroll_df
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_education() -> pd.DataFrame:\n\n school_df = pd.read_csv(\"data/Expected years of schooling (years).csv\", header=2, usecols=[1, 32], names=[\"Country\", \"Education\"])\n\n index = school_df[school_df[\"Country\"]==\"Iran (Islamic Republic of)\"].index.values[0]\n school_df.loc[index, \"Country\...
[ "0.62597656", "0.6190843", "0.60569084", "0.60142833", "0.59021455", "0.5870558", "0.58594114", "0.58429956", "0.58184737", "0.5782017", "0.57763255", "0.5766798", "0.57097375", "0.5647704", "0.55870324", "0.5583758", "0.5578448", "0.55618584", "0.55554485", "0.5553673", "0.5...
0.79547787
0
Get Log Dataframe (log_.csv)
def get_log_df(ftype): assert ftype=='train' or ftype=='test' log_df = pd.read_csv('data/%s/log_%s.csv' % (ftype, ftype)) log_df['time'] = pd.to_datetime(log_df['time']) log_df['action_date'] = log_df.time.apply(lambda x: x.date()) log_df['action_dow'] = log_df['time'].apply(lambda x: x.weekday()) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_log(dir_):\n df = pandas.read_csv(os.path.join(dir_, 'log.csv'),\n error_bad_lines=False,\n warn_bad_lines=True)\n if not len(df):\n print(\"empty df at {}\".format(dir_))\n return\n df['model'] = dir_\n return df", "def hoomdlog(...
[ "0.7406182", "0.7205137", "0.7000645", "0.6835169", "0.68185526", "0.67984", "0.66380084", "0.65209377", "0.63542926", "0.6274999", "0.6213813", "0.61862767", "0.61492324", "0.6118362", "0.60789824", "0.6058416", "0.60430205", "0.5994365", "0.59824306", "0.59578943", "0.59532...
0.77047133
0
Get Trainning Labels Dataframe (truth_train.csv)
def get_labels_df(): labels_df = pd.read_csv('data/train/truth_train.csv', header=None) return labels_df
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def df():\n path, _ = os.path.split(os.path.abspath(__file__))\n project_path = os.path.join(path, os.pardir, os.pardir)\n\n values_path = os.path.join(project_path, \"data\", \"raw\", \"pumps_train_values.csv\")\n labels_path = os.path.join(project_path, \"data\", \"raw\", \"pumps_train_labels.csv\")\...
[ "0.6975254", "0.67474806", "0.66706246", "0.655183", "0.64902073", "0.64812607", "0.64470786", "0.64456475", "0.64414805", "0.6425497", "0.6413294", "0.6360745", "0.63333935", "0.6317695", "0.6304125", "0.622412", "0.62197214", "0.6218117", "0.621556", "0.6214037", "0.6212466...
0.875425
0
Get Object Dataframe (object.csv)
def get_obj_df(): obj_df = pd.read_csv('data/object.csv') obj_df = obj_df.drop_duplicates()[['course_id', 'module_id', 'category', 'start']] obj_df['start'] = pd.to_datetime(obj_df[obj_df['start'] != 'null']['start']) return obj_df
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_dataframe():\r\n\r\n df = pd.read_csv('data/data.csv', header=0)\r\n return df", "def get_obj_df(self) -> pd.DataFrame:\n df = pd.DataFrame(self.obj, columns=[\"x\", \"y\", \"m\", \"dx\", \"dy\"])\n df['iter'] = self.current_iteration\n return df", "def cif_df(cif_object) ...
[ "0.6555708", "0.64185214", "0.6270231", "0.62557626", "0.62464267", "0.61960536", "0.6175627", "0.61419046", "0.6131568", "0.6105312", "0.609715", "0.6067034", "0.6055361", "0.5941004", "0.5922465", "0.58321035", "0.5826193", "0.58045596", "0.5778079", "0.57685983", "0.576500...
0.6709269
0
Replaces the given province's tradegood with the new one defined in the tradegoods.bmp map.
def replace_tradegood(prov_num, new_tradegood): directory = os.getcwd()+"\\shatterednippon\\history\\provinces\\" for file in os.listdir(directory): if file.startswith(str(prov_num)): old_tradegood = find_tradegood(directory+file) if old_tradegood is None: print("Province: %s has no \"trade_goods\" variab...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def edit_city(self, code, key, val):\r\n if key == \"code\":\r\n self.vertices[val] = self.vertices.pop(code)\r\n setattr(self.vertices[val], key, val)\r\n else:\r\n setattr(self.vertices[code], key, val)", "def update_province_info(self, data):\n\n prov = {d...
[ "0.49456048", "0.4688628", "0.46635583", "0.465411", "0.4610733", "0.46057832", "0.4569795", "0.4563333", "0.45383635", "0.4537916", "0.45238334", "0.4523624", "0.45051134", "0.4464374", "0.44389847", "0.44224742", "0.44107935", "0.44045115", "0.43949524", "0.438784", "0.4384...
0.67790896
0
Finds the given province file's tradegood and returns it, else returns None.
def find_tradegood(filepath): with open(filepath) as f: for line in f: if "trade_good" in line: return line.replace("trade_goods = ", "").strip() return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_purity_from_filename(fn):\n # type: (str) -> float\n for k in PURITY_DICT.keys():\n if fn.find(k) != -1:\n return PURITY_DICT[k]\n return None", "def replace_tradegood(prov_num, new_tradegood):\n\tdirectory = os.getcwd()+\"\\\\shatterednippon\\\\history\\\\provinces\\\\\"\n\tf...
[ "0.61429954", "0.5806887", "0.5357879", "0.5357617", "0.53102237", "0.52028406", "0.51881367", "0.51809806", "0.49570414", "0.49463305", "0.4909227", "0.4857346", "0.4817479", "0.4806995", "0.47705704", "0.47592556", "0.4758116", "0.47489792", "0.47389686", "0.47359687", "0.4...
0.737722
0
Checks definition.csv if provinces.bmp's corresponding pixel's RBG value is in the definition list. Returns the province number if it finds the pixel in the list, returns None otherwise.
def get_province_number(corr_pixel): corr_pixel = str(corr_pixel).strip("()").replace(", ", ";") #Reformats the pixel to ensure it can be compared. with open(os.getcwd()+"\\shatterednippon\\map\\definition.csv", "r") as definitions: prov_num = 1 for line in definitions: if corr_pixel in line: return prov_n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def region_of_province(province_in: str) -> str:\n region = None\n for r in ITALY_MAP:\n for p in ITALY_MAP[r]:\n if province_in == p:\n region = r\n return region", "def get_layers(filen, flist):\n lay_lim =()\n if (filen in flist[0]) or (filen in flist[1]) or \\\...
[ "0.5004101", "0.48853442", "0.48022938", "0.47766182", "0.4772715", "0.46768475", "0.46313435", "0.4620217", "0.46167162", "0.4558334", "0.45415226", "0.45321065", "0.45184773", "0.4518011", "0.44653592", "0.44647416", "0.44464013", "0.44451034", "0.44309643", "0.44243097", "...
0.6695489
0
Returns the names of the tradegoods and the RGB color values for each defined tradegood in 00_tradegoods.txt as two seperate lists.
def get_defined_tradegoods(): names = [] colors = [] with open(os.getcwd()+"\\shatterednippon\\common\\tradegoods\\00_tradegoods.txt", "r") as f: for line in f: if line[0].isalpha(): names.append(line.strip("={} \n")) elif "color" in line: numbers = tuple(map(int, re.sub("[^\d. ]\s*", "", line).split...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_player_colors() -> List[Tuple[float, float, float]]:\n return PLAYER_COLORS", "def colors(self):\n\t\treturn [(0, 30, 255),(0, 30, 120)]", "def materials_list_from_file(filename):\n color_data = []\n with open(filename, 'r', newline='') as csvfile:\n reader = csv.reader(csvfile)\n ...
[ "0.5856119", "0.57543385", "0.5730062", "0.566281", "0.5610903", "0.5603703", "0.55331224", "0.5490069", "0.5385997", "0.53710496", "0.52969", "0.52936643", "0.5287496", "0.52840865", "0.5262353", "0.5247332", "0.5247332", "0.5245796", "0.5244358", "0.5224747", "0.5222103", ...
0.86052763
0
Load an internal yaml node parsing, defaulting to a scalar value.
def _from_yaml(cls, loader: yaml.Loader, node: yaml.Node) -> "YamlModifier": value = loader.construct_scalar(typing.cast(yaml.ScalarNode, node)) return cls(value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def import_(self, node):\n yamal_name = os.path.join(self._root, self.construct_scalar(node))\n\n with open(yamal_name, 'r') as yamal_file:\n return yaml.load(yamal_file, ImportLoader)", "def _from_yaml(cls, loader: yaml.Loader, node: yaml.Node) -> \"InjectString\":\n raw = loader...
[ "0.73322433", "0.63728184", "0.61908674", "0.61466956", "0.6134764", "0.6104053", "0.6015713", "0.59930307", "0.598406", "0.59112525", "0.5903671", "0.5833151", "0.5768858", "0.5761115", "0.57025176", "0.5649191", "0.5563314", "0.55608124", "0.5558609", "0.5475866", "0.542939...
0.7018517
1
Parse yaml node into this class object for Lobotomy processing.
def parse_yaml(cls, loader: yaml.Loader, node: yaml.Node) -> "YamlModifier": return cls._from_yaml(loader, node)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, node: yaml.Node) -> None:\n self.yaml_node = node", "def from_yaml(cls, y):\n return cls(yaml.load(y, AttrLoader))", "def FromYAML(cls, source):\n\n # Late import to avoid a circular dependency.\n try:\n import bulletml.bulletyaml\n import ya...
[ "0.7190225", "0.68135875", "0.6604197", "0.6597981", "0.65922415", "0.65773606", "0.6518172", "0.65123314", "0.6395062", "0.6377166", "0.6372749", "0.6344428", "0.6335441", "0.6274441", "0.6237253", "0.60822874", "0.60467535", "0.6043854", "0.6027036", "0.5990031", "0.5938824...
0.73717535
0
Register the comparator with the PyYaml loader.
def register(cls): yaml.add_constructor(cls.label(), cls.parse_yaml) yaml.add_representer(cls, cls.dump_yaml)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setComparator(self, comparator: dict):\n self._comparator = comparator", "def set_result_comparator(self, comparator):\n\n self._comparator = comparator", "def register_loader(key, module):\n register(key, module, loader_dict)", "def _yaml_ordering_support():\n _mapping_tag = yaml.resol...
[ "0.58455926", "0.5207403", "0.51714724", "0.5046912", "0.49322683", "0.48709297", "0.47904545", "0.4760413", "0.46908015", "0.46855125", "0.4660275", "0.4592575", "0.45680568", "0.44943762", "0.44933996", "0.44847608", "0.44837308", "0.4481726", "0.4451131", "0.44410124", "0....
0.5855883
0
Returns the closed form of a '_{side}_inline.nii.gz' mask in numpy array and also the clipped array
def close_mask_in(im_slice_2d, side): new_slice = im_slice_2d.copy() x_no_0, y_no_0 = np.nonzero(im_slice_2d) if len(x_no_0) == 0: return new_slice, new_slice #breakpoint() x1 = x_no_0.min() x2 = x_no_0.max() if side == "l": x_mid = x2; x_aux1 = x_mid - 9 + 1; x_aux2 = x2 + 1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _source_mask(self, ilens):\n x_masks = make_non_pad_mask(ilens)\n return x_masks.unsqueeze(-2)", "def crop_to_nonzero(arrayin, mask=None):\r\n\r\n if type(arrayin) == np.ndarray :\r\n array = arrayin\r\n elif type(arrayin) == list :\r\n array = arrayin[0]\r\n\r\n if mask=...
[ "0.5911587", "0.5905847", "0.5815674", "0.5776319", "0.56993324", "0.56690925", "0.5630956", "0.5623893", "0.56130314", "0.55582917", "0.55565006", "0.5489081", "0.548841", "0.5459489", "0.5441693", "0.5441693", "0.54369754", "0.543186", "0.541298", "0.5378559", "0.5376243", ...
0.64788425
0
This method is used for both 'xcworkspace' and 'xcodeproj' classes. It returns a list of schemes that are labeled as 'user' or 'shared'.
def schemes(self): schemes = []; # shared schemes if XCSchemeHasSharedSchemes(self.path.obj_path) == True: shared_path = XCSchemeGetSharedPath(self.path.obj_path); shared_schemes = XCSchemeParseDirectory(shared_path); for scheme in shared_schemes: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_known_schemes_for_multi_store():\n return location.SCHEME_TO_CLS_BACKEND_MAP.keys()", "def getSchemes(clazz):\n return [\"sftp\"]", "def get_uri_schemes(self):\n return list(sorted(self.backends.with_playlists.keys()))", "def get_uri_schemes(self) -> list[backend.UriScheme]:\n ...
[ "0.644051", "0.6145727", "0.60370487", "0.60277617", "0.59321177", "0.5927999", "0.58466095", "0.5695372", "0.55060184", "0.549612", "0.5412193", "0.53077865", "0.52500373", "0.52307934", "0.5067795", "0.50209284", "0.5003262", "0.49941736", "0.49602288", "0.49374494", "0.490...
0.7739919
0
returns x and y derivatives of a 2D gauss kernel array for convolutions
def gauss_derivative_kernels(size, size_y=None): size = int(size) if not size_y: size_y = size else: size_y = int(size_y) y, x = mgrid[-size: size + 1, -size_y: size_y + 1] # x and y derivatives of a 2D gaussian with standard dev half of size # (ignore scale factor) gx = - x...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gauss_derivatives(im, n, ny=None):\n\n gx, gy = gauss_derivative_kernels(n, size_y=ny)\n\n imx = signal.convolve(im, gx, mode='same')\n imy = signal.convolve(im, gy, mode='same')\n\n return imx, imy", "def test_gauss_kernel():\n\n gauss = gauss_kernel(2, 5)\n\n assert gauss.shape == (5, 5)\...
[ "0.6464445", "0.6400031", "0.6292199", "0.62704843", "0.622417", "0.6203519", "0.6186446", "0.6149553", "0.6084668", "0.59506327", "0.5876299", "0.586569", "0.58355033", "0.58145", "0.58079106", "0.5799519", "0.57833916", "0.5765829", "0.57556885", "0.57517755", "0.5751735", ...
0.6867467
0
returns x and y derivatives of an image using gaussian derivative filters of size n. The optional argument ny allows for a different size in the y direction.
def gauss_derivatives(im, n, ny=None): gx, gy = gauss_derivative_kernels(n, size_y=ny) imx = signal.convolve(im, gx, mode='same') imy = signal.convolve(im, gy, mode='same') return imx, imy
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gauss_derivative_kernels(size, size_y=None):\n size = int(size)\n if not size_y:\n size_y = size\n else:\n size_y = int(size_y)\n y, x = mgrid[-size: size + 1, -size_y: size_y + 1]\n\n # x and y derivatives of a 2D gaussian with standard dev half of size\n # (ignore scale factor...
[ "0.61548144", "0.5981589", "0.5959965", "0.58838403", "0.58367634", "0.57715976", "0.5677056", "0.5670111", "0.56048477", "0.56043017", "0.55708915", "0.5549236", "0.5539912", "0.5506071", "0.549919", "0.54970866", "0.53928995", "0.5380421", "0.53599995", "0.5349", "0.5330634...
0.8174752
0
Decorator that can be used to cache ReusableBytesIO objects intended for reading. The decorator makes sure the objects are immutable and reset to position 0. The decorated function can either return pure ReusableBytesIO objects or dicts.
def buffer_object_cacher(key=None, maxsize=None): if not config.enable_caching: return lambda x: x def decorator(fun): # Cache the results. cached_fun = cachetools.cached(cachetools.LRUCache(maxsize=maxsize), key=lambda *x,**y: cachetools.keys.hashkey(ke...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_buffer():\n return BytesIO()", "def cached_load(filepath: str) -> io.BytesIO:\n with open(filepath, 'rb') as f:\n return io.BytesIO(f.read())", "def disk_memoize(path):\n def decorator(f):\n @functools.wraps(f)\n def g(*a, **kw):\n kwargs = to_kwargs(f, *a, **k...
[ "0.6126323", "0.59865415", "0.5825444", "0.58154047", "0.57380855", "0.5698068", "0.5697662", "0.55716634", "0.55687535", "0.55656105", "0.5557927", "0.5528658", "0.54908526", "0.5479148", "0.54592925", "0.54238856", "0.54096276", "0.5385697", "0.53558767", "0.5354645", "0.53...
0.63631254
0
Returns a tuple representing the hardware specs.
def getHardware(self): return (self.vendorId, self.deviceId, self.physicalMemory, self.osInfo, self.cpuSpeed[0])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_hardware_info(self) -> list:\n model = ctypes.create_string_buffer(8)\n model_size = ctypes.c_ulong(8)\n type_num = ctypes.c_ushort()\n channel_num = ctypes.c_ushort()\n notes = ctypes.create_string_buffer(48)\n notes_size = ctypes.c_ulong(48)\n firmware_ve...
[ "0.7078182", "0.6386408", "0.60863703", "0.60038155", "0.5982613", "0.59652555", "0.59633815", "0.594874", "0.59447217", "0.5936363", "0.58740854", "0.5844497", "0.5777375", "0.5739162", "0.5714293", "0.56568074", "0.5644492", "0.56364363", "0.5634876", "0.563088", "0.56237",...
0.7476962
0
Returns true if the other session or sample has the same hardware specs as this one, false otherwise.
def sameHardware(self, other): return (self.vendorId == other.vendorId and \ self.deviceId == other.deviceId and \ self.physicalMemory == other.physicalMemory and \ self.osInfo == other.osInfo and \ self.cpuSpeed[0] == other.cpuSpeed[0])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _on_same_device(self, other: \"PArray\") -> bool:\n this_device = self._current_device_index\n return this_device in other._array", "def match(uspec1, uspec2):\n \n if uspec1.is_power_onoff() and uspec2.is_power_onoff():\n return True\n \n if uspec1.number_windows() != uspec2...
[ "0.6838293", "0.666635", "0.65126216", "0.64928484", "0.63411206", "0.6300568", "0.62982696", "0.61403143", "0.6127172", "0.6109003", "0.6074839", "0.60358554", "0.59964126", "0.59953624", "0.5989709", "0.59614843", "0.59588736", "0.59384286", "0.59161776", "0.5901873", "0.58...
0.7975851
0
Calculates the average FPS for this player, over all of the player's different sessions.
def calcFrameRate(self): tot = 0 count = 0 for session in self.sessions: for sample in session.samples: if not sample.isLoading: tot += sample.fps count += 1 if count: self.avgFps = tot / count s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_fps(self):\n \n return self.fps, self.average_fps", "def get_fps(self):\n return self._num_frames / (datetime.now() - self._start).total_seconds()", "def update_fps(self, fps):\n self.fps_history.append(fps)\n if len(self.fps_history) > FPS_AVERAGES:\n self...
[ "0.635384", "0.6108307", "0.6086766", "0.59754205", "0.59748524", "0.5926207", "0.5866448", "0.5856975", "0.58385223", "0.5776392", "0.57533216", "0.57494795", "0.5631522", "0.55880743", "0.5585366", "0.5568593", "0.5568593", "0.5568593", "0.55296254", "0.5512434", "0.5473437...
0.72921765
0
Reads the clientfps lines from the indicated logfile, and writes card_performance.csv, without building up large tables.
def quickAnalyzeCards(self, filename): assert filename.endswith('.txt') file = open(filename, 'r') quickCards = {} for line in file: line = line.strip() if not line: continue columns = line.split('|') if columns[1] != 'cl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def grep_log_files_put_to_csv_output(path):\n log_process = LogProcess()\n log_process.log_path = path\n log_process.output_path = os.path.join(path, \"temp\")\n obj_file.cleanup_dir(log_process.output_path)\n csv_alarm, no_contact = log_process.altc()\n csv_alarm_history = log_process.lgjc()\n ...
[ "0.55250233", "0.54603183", "0.5450724", "0.5413982", "0.5379444", "0.53514105", "0.52793115", "0.52764195", "0.5269211", "0.5259841", "0.5198763", "0.5174568", "0.5164108", "0.5136736", "0.5116632", "0.5114831", "0.51126087", "0.5108278", "0.5103108", "0.50868624", "0.507331...
0.5976573
0
Write the samples for all players with less than 10 fps average frame rate to the indicated text file. This generates a new log file that may be analyzed independently.
def writeLowPlayers(self, filename): assert filename.endswith('.txt') file = open(filename, 'w') samples = [] for player in self.players: if player.lowFps: for session in player.sessions: for sample in session.samples: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send_logs(self):\n for i in range(30):\n with open('{}-{}.log'.format(self._log_file_path, i), 'a') as log_file:\n for _ in range(self._log_rate):\n log_file.write(self._log_record + '\\n')", "def debug_file(self, pkt_count, attack_count, data_list, ds_calc_time, ds_vals, metric_means...
[ "0.6171279", "0.59173375", "0.5693433", "0.5600852", "0.555415", "0.5504344", "0.54048634", "0.53820014", "0.5346854", "0.53364265", "0.53228056", "0.52732503", "0.52012616", "0.5186444", "0.517446", "0.5160905", "0.51368034", "0.5127677", "0.51274544", "0.5126001", "0.512328...
0.72644055
0
Returns total number of players whose avg fps is less than 10, total number of players whose avg fps is between 10 and 25, and total number of players whose avg fps is more than 25.
def __countPlayers(self, players): numLow = sum(map(lambda p: p.lowFps, players)) numHigh = sum(map(lambda p: p.highFps, players)) numMed = len(players) - numLow - numHigh return '%s, %s, %s' % (numLow, numMed, numHigh)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stats(detections, faces):\n vp, fp, fn, vn = 0, 0, 0, 0\n max_label = np.max(faces[:, 0])\n for i in range(max_label + 1):\n detections_i = get_label_with_index(detections, i)\n faces_i = get_label_with_index(faces, i)\n local_vp = 0\n for face in faces_i:\n foun...
[ "0.60739285", "0.59108806", "0.5869163", "0.5824232", "0.5684692", "0.56706446", "0.56420135", "0.55896056", "0.557531", "0.55514854", "0.5549805", "0.551023", "0.5500134", "0.54782814", "0.5471912", "0.544629", "0.5406683", "0.5397825", "0.5371873", "0.53278965", "0.5309981"...
0.63204354
0
Reads PCIList, which contains a list of the known PCI devices by vendor ID/device ID. See
def readPCIList(self): self.vendors = {} self.devices = {} vendorId = None vendorName = None for line in PCIList.split('\n'): stripped = line.lstrip() if not stripped or stripped[0] == ';': continue if line[0] != '\t': ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_pci_devices(self):\n\n system = self._get_host_details()\n if ('links' in system['Oem']['Hp'] and\n 'PCIDevices' in system['Oem']['Hp']['links']):\n # Get the PCI URI and Settings\n pci_uri = system['Oem']['Hp']['links']['PCIDevices']['href']\n ...
[ "0.6974894", "0.6744383", "0.6441267", "0.59418535", "0.588758", "0.5535207", "0.55204946", "0.5497702", "0.5481925", "0.5473312", "0.54184794", "0.5417257", "0.54155695", "0.5406843", "0.5379454", "0.53526473", "0.5350712", "0.53472716", "0.53472596", "0.53421974", "0.532810...
0.8187731
0