query
stringlengths
10
2k
document
stringlengths
20
51.2k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Gets the event_id of this Attribution. GUID to uniquely identify each event
def event_id(self): return self._event_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getId(self):\n return _libsbml.Event_getId(self)", "def GetEventIdentifier(self):\n return self._event_identifier", "def getId(self):\n return _libsbml.EventAssignment_getId(self)", "def id(self) -> str:\n return self._event.get('id')", "def cal_guid(self):\n return \"eve...
[ "0.77004075", "0.76828027", "0.7511514", "0.74941957", "0.7071278", "0.6813898", "0.6697985", "0.6444107", "0.64217263", "0.6399615", "0.6384235", "0.6384235", "0.6371262", "0.63559645", "0.6347287", "0.6342093", "0.63406646", "0.6321136", "0.63204116", "0.6229724", "0.622857...
0.8119689
0
Sets the event_id of this Attribution. GUID to uniquely identify each event
def event_id(self, event_id): self._event_id = event_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setId(self, *args):\n return _libsbml.Event_setId(self, *args)", "def SetEventIdentifier(self, event_identifier):\n self._event_identifier = event_identifier", "def event_crf_id(self, event_crf_id):\n\n self._event_crf_id = event_crf_id", "def event_definition_id(self, event_definition_i...
[ "0.7068648", "0.67250323", "0.66972053", "0.6560106", "0.6389217", "0.6336854", "0.61236817", "0.6019163", "0.5936472", "0.59036267", "0.5859706", "0.5856476", "0.5856476", "0.5856476", "0.5842595", "0.5821639", "0.58029324", "0.5765438", "0.57652056", "0.574449", "0.57441795...
0.7941723
1
Gets the event_time of this Attribution. ISO 8601 timestamp when the event occurred
def event_time(self): return self._event_time
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def event_date_time(self) -> EventDateTime:\n return self._event_date_time", "def timestamp(self) -> str:\n return self._event.get('timestamp')", "def last_event_time(self) -> str:\n return pulumi.get(self, \"last_event_time\")", "def adjustedEventTime(self):\n return self.event_t...
[ "0.7529133", "0.72693354", "0.7199172", "0.70013565", "0.6959468", "0.6944804", "0.67671174", "0.67251986", "0.67251986", "0.67251986", "0.66964906", "0.66337264", "0.6510721", "0.6501532", "0.64707214", "0.6462208", "0.64168555", "0.6405904", "0.6405904", "0.6405904", "0.640...
0.8027861
0
Gets the user of this Attribution. The user associated with the event
def user(self): return self._user
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user(self):\n u = self.user_info\n return self.user_model.get_by_id(u['user_id']) if u else None", "def get_user(self):\n return self.user", "def get_user(self):\n return self.user", "def get_user(self) -> User:\n return self.__user", "def actor_user(self):\n i...
[ "0.7216755", "0.7169481", "0.7169481", "0.71501154", "0.7004865", "0.6934103", "0.6867186", "0.6866157", "0.68658614", "0.6829461", "0.68294305", "0.6811171", "0.6770305", "0.6761709", "0.67599905", "0.67593116", "0.6756824", "0.6694954", "0.66812027", "0.66464436", "0.662352...
0.6916587
8
Sets the user of this Attribution. The user associated with the event
def user(self, user): self._user = user
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_user(self, user):\r\n self.user = user", "def set_user(self, user: User):\n self.__user = user", "def set_user(self, user):\n self._user = user", "def user(self, user):\n self.user_id = user.get_id()", "def assigned_user(self, assigned_user):\n self._assigned_user = a...
[ "0.7030192", "0.7005123", "0.6912455", "0.6765181", "0.6620565", "0.6417723", "0.6417723", "0.6417723", "0.6417723", "0.6417723", "0.6417723", "0.6417723", "0.6417723", "0.6417723", "0.6417723", "0.6417723", "0.6417723", "0.6417723", "0.6417723", "0.6294006", "0.6261342", "...
0.6838391
8
Sets the ip_address of this Attribution. The apparent IP address that the request was made from for the given event
def ip_address(self, ip_address): self._ip_address = ip_address
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setAddress(self, ip_address):\n # type: (str)->None\n\n self._validator.validate_one(\n 'address', VALID_OPTS['address'], ip_address)\n self._ifAttributes['address'] = ip_address", "def set_ip(self, party_ip) -> None:\n\n self._ip = party_ip", "def ip(self, ip):\n\n ...
[ "0.7258864", "0.68725204", "0.68331087", "0.68331087", "0.67893726", "0.6680411", "0.66675705", "0.6384599", "0.6258523", "0.62479717", "0.62407273", "0.6240719", "0.621986", "0.62012976", "0.60623646", "0.60530937", "0.59758955", "0.5939559", "0.5916013", "0.59113735", "0.58...
0.74992436
2
Gets the alert_id of this Attribution. Associated Alert ID
def alert_id(self): return self._alert_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getId(self):\n return _libsbml.EventAssignment_getId(self)", "def id(self): # type: () -> str\n return self.inspection['Id']", "def get_id(self):\n return self.email", "def get_id(self):\n return self.email", "def id(self) -> str:\n return self._event.get('id')", "...
[ "0.63383514", "0.63126326", "0.6082412", "0.6082412", "0.60770553", "0.60588175", "0.59976983", "0.5992398", "0.5992398", "0.5992398", "0.5992398", "0.5992398", "0.5992398", "0.59288496", "0.5916768", "0.59153205", "0.5908431", "0.5908431", "0.5908431", "0.5908431", "0.590843...
0.8299062
0
Sets the alert_id of this Attribution. Associated Alert ID
def alert_id(self, alert_id): self._alert_id = alert_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def alert_id(self):\n return self._alert_id", "def attachment_id(self, attachment_id):\n\n self._attachment_id = attachment_id", "def attempt_id(self, attempt_id):\n\n self._attempt_id = attempt_id", "def attempt_id(self, attempt_id):\n\n self._attempt_id = attempt_id", "def ale...
[ "0.6610224", "0.59652615", "0.58800614", "0.58800614", "0.5809505", "0.5676793", "0.5645119", "0.5631877", "0.5626034", "0.559369", "0.55558264", "0.5502545", "0.5462181", "0.5452894", "0.5452894", "0.5452894", "0.5452894", "0.5452894", "0.5452894", "0.5452894", "0.5452894", ...
0.8049972
0
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, Attribution): return False return self.__dict__ == other.__dict__
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False", "def __eq__(self, other):\n if i...
[ "0.8088132", "0.8088132", "0.8054589", "0.7982687", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", ...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): return not self == other
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other) -> bool:\n return not self.__eq__(other)", "def __eq__(self, other):\n ...
[ "0.845611", "0.8391477", "0.8144138", "0.81410587", "0.8132492", "0.8093973", "0.80920255", "0.80920255", "0.80920255", "0.8085325", "0.8085325", "0.8076365", "0.8076365", "0.8065748" ]
0.0
-1
Get the Twitch info for a particular user or channel. Defaults to the stream channel if not otherwise specified.
def get_info_uncached(username=None, use_fallback=True): if username is None: username = config['channel'] userid = get_user(name=username).id headers = { 'Client-ID': config['twitch_clientid'], 'Authorization': f"Bearer {get_token()}", } res = common.http.request("https://api.twitch.tv/helix/users", {"id":...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def info(self, ctx, user : str=None):\n cyphon = discord.utils.get(ctx.message.server.members, id=\"186835826699665409\")\n\n message = []\n message.append(\"```\\n\")\n\n if self.check_channel(ctx):\n if self.check_permission(ctx) or ctx.message.author == cyphon:\n ...
[ "0.64792573", "0.62760013", "0.5989475", "0.59008175", "0.5709102", "0.560341", "0.5509573", "0.54999375", "0.5498269", "0.5495266", "0.54732907", "0.5462964", "0.5427126", "0.54095864", "0.54093236", "0.5400716", "0.53884894", "0.5356492", "0.5354375", "0.5305137", "0.527446...
0.68907434
0
Compose the provided transformation matrices in order, returning a composite transformation.
def compose_transforms(*transforms): from functools import reduce for transform in transforms: vg.shape.check(locals(), "transform", (4, 4)) if len(transforms) == 0: return np.eye(4) return reduce(np.dot, reversed(transforms))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compose(transforms):\n trans_objs = [TRANSFORMS.build(t) for t in transforms]\n return tv_transforms.Compose(trans_objs)", "def compose(transforms):\n assert isinstance(transforms, list)\n for transform in transforms:\n assert callable(transform), \"list of functions expected\"\n\n def ...
[ "0.73806477", "0.71900684", "0.6566757", "0.6342436", "0.61065394", "0.6098832", "0.60898703", "0.6055403", "0.6051105", "0.60494065", "0.604814", "0.60217744", "0.5964446", "0.5948745", "0.5942753", "0.5905177", "0.58977467", "0.5817636", "0.57891387", "0.57806534", "0.57730...
0.73181283
1
Return the localized time, or nothing if invalid
def localized_date(self): date_ = self._post['effective_date'] to_localized = self.context.toLocalizedTime try: local_date = to_localized(date_) except ValueError: # An invalid date; just return nothing local_date = None ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_time(self) -> str:\n return pulumi.get(self, \"validate_time\")", "def toLocalizedTime(self, time, long_format=None, time_only = None):\n util = getToolByName(self.context, 'translation_service')\n try:\n return util.ulocalized_time(time, long_format, time_only, self....
[ "0.69932646", "0.686161", "0.6364891", "0.6304964", "0.6298384", "0.6298384", "0.6298384", "0.6298384", "0.6298384", "0.6298384", "0.626718", "0.621727", "0.6215109", "0.6203647", "0.6118992", "0.61127424", "0.60898465", "0.6072921", "0.60623085", "0.59981835", "0.59967357", ...
0.0
-1
Pass an input through a threebythree convolution filter and test the shape and contents of the output.
def test_on_conv_transpose_2d_three_by_three(self): w_init = lambda s: jn.array([[[[1., 2., 1.], [1., 2., 1.], [1., 1., 1.]]]]).transpose((2, 3, 0, 1)) conv = objax.nn.ConvTranspose2D(1, 1, 3, padding=objax.ConvPadding.VALID, w_init=w_init) x = jn.array([[[[2., 1., 3., 4.], [5., 6., 7., 8.], [9....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_convolution():\n # Default test\n inputs_shape = [3,3,4,5,3]\n filters_shape = [3,1,4,4,3]\n test_convolution_for_parameters(inputs_shape, filters_shape,\n \"Default test\")\n # All dimensions 1\n inputs_shape = [1,1,1,1,1]\n filters_shape = [1,1,1,1,1]\n test_convolution_fo...
[ "0.678101", "0.64619225", "0.6242446", "0.6242446", "0.6181452", "0.61808455", "0.61766505", "0.6173934", "0.61676973", "0.61676973", "0.61676973", "0.61676973", "0.61676973", "0.61676973", "0.61676973", "0.6141687", "0.61410797", "0.6138883", "0.6131771", "0.6126494", "0.612...
0.59722865
76
Extracts words and their lemmas from the corpus.
def parse_corpus(corpus_file): word_lemmas = {} for root in iterate_corpus(corpus_file): for token in root.iter('token'): word, lemma = get_word_and_lemma(token) if word and (not word.isnumeric()): word_lemmas[word] = lemma # with corpus.open(corpus.nameli...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def preprocess_corpus(corpus): \n \n # print 'preprocessing words'\n # remove space\n # text = re.findall(r'\\w+', corpus) # for [a-zA-Z0-9_]\n text = re.findall(r'[a-zA-Z]+', corpus) # for [a-zA-Z] keep words only no numbers and '_' \n words = [w.lower() for w in text]\n # print words \n ...
[ "0.6910894", "0.68065524", "0.6792465", "0.67138964", "0.66734856", "0.66567886", "0.6621307", "0.66190684", "0.6597121", "0.655869", "0.65532476", "0.6508994", "0.6508994", "0.6479011", "0.6464221", "0.6399497", "0.6386498", "0.6382979", "0.63828194", "0.6361518", "0.6361512...
0.6672167
5
Separate a flat dataset of time steps to a list of episodes.
def _flat_data_to_episodes(self, flat_data): data = [] episode_start = 0 for t in range(len(flat_data['observations'])): if flat_data['terminals'][t]: episode = {k: v[episode_start:t + 1] for k, v in flat_data.items()} data.append(episode) episode_start = t + 1 return data
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def episodes(self):\n episodes = []\n for series in self.series:\n episodes.extend(series.episodes)\n return episodes", "def episodes(self):\n episodes = []\n for season in self.seasons:\n episodes.extend(season.episodes)\n return episodes", "def ...
[ "0.657431", "0.64853466", "0.63298506", "0.6071691", "0.59168565", "0.58543926", "0.5831672", "0.5701764", "0.5674798", "0.56689787", "0.5657489", "0.5622203", "0.56060827", "0.5596751", "0.5583964", "0.5571093", "0.5529942", "0.5525338", "0.55217355", "0.5514149", "0.5512705...
0.74146885
0
Returns all terminal nodes.
def leaves(i, node): L = [] if len(node.kids) > 1: for l in node.kids: L.extend(i.leaves(l)) return L elif len(node.kids) == 1: return [node.kids] else: return [node]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all_nodes(self):\n return self._get_all_nodes()", "def terminals(self):\n unique_nodes, unique_counts = np.unique(self.edges, return_counts=True)\n return unique_nodes[ unique_counts == 1 ]", "def terminals(self):\n\n return self._terminals.getSlice(0)", "def terminals(self):\n\n ...
[ "0.75336266", "0.74372244", "0.742549", "0.742549", "0.7239457", "0.72101", "0.71568227", "0.70714515", "0.7042101", "0.69990045", "0.69684607", "0.6923247", "0.6828183", "0.66984993", "0.6691665", "0.66913104", "0.66913104", "0.6690032", "0.66363406", "0.6634267", "0.6627518...
0.0
-1
Set CLI author in the CLI Context. The key of the new field is 'cli_author'.
def set_cli_author(click_context) -> None: config = get_or_create_cli_config() cli_author = config.get(AUTHOR_KEY, None) if cli_author is None: raise click.ClickException( "The AEA configurations are not initialized. Use `aea init` before continuing." ) click_context.obj.set_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def author(self, value):\n self._set_attr('author', value)", "def setAuthor(self,value):\n self.PDFreactorConfiguration.in1[\"author\"] = value", "def set_author(self, author):\n self.author = author\n self.opf.author = author", "def set_author (self, author):\n self.author...
[ "0.712172", "0.7076811", "0.6991613", "0.69884944", "0.68343216", "0.67940974", "0.67659265", "0.6738169", "0.6679922", "0.6679922", "0.62304395", "0.62190485", "0.6212343", "0.61998147", "0.6173643", "0.6171375", "0.611324", "0.60772645", "0.60772645", "0.6057968", "0.592746...
0.85001713
0
Return length of states list
def __len__(self): return len(self.options)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __len__(self):\n i = 0\n for S in self.states():\n i += 1\n return i", "def get_num_states(self):\n return self.n_states", "def get_num_states(self):\n return self.N_STATES", "def numStates(self):\n return len(self._mdp.S)", "def state_count(self):\n...
[ "0.8193628", "0.81141925", "0.80802536", "0.7944157", "0.7864454", "0.7861285", "0.7761785", "0.77465904", "0.74858767", "0.72150254", "0.71209484", "0.6875175", "0.68583554", "0.6808448", "0.6749535", "0.66946477", "0.6686226", "0.6686226", "0.65728915", "0.6552234", "0.6537...
0.0
-1
List of states in pending order, beginning with the current.
def queue(self): rest = self.options[self.idx:] if self.can_recycle(): rest += self.options[:self.idx] return rest
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def state_list(self) -> Sequence[TState]:\n pass", "def next_states(self):\n return self._states[1:]", "def get_list_of_states(self):\n return self.states", "def next_states(self):\n return self.get_next_states()", "def getstate(self):\n return [elem.getstate() for elem i...
[ "0.75240695", "0.71911144", "0.7146012", "0.70548993", "0.7038693", "0.6924317", "0.6877204", "0.6855313", "0.6762768", "0.67319113", "0.6710305", "0.66933197", "0.6685741", "0.66844004", "0.66769594", "0.6664634", "0.66143936", "0.6606134", "0.66033614", "0.657269", "0.65476...
0.0
-1
Tests we can create an AVP with a code and it defaults to the defaults vendor.
def test_integer_identifier(self): self._compare_avp( avp.AVP(1, 'Hello'), avp.UTF8StringAVP( 1, value='Hello', vendor=avp.VendorId.DEFAULT, flags=avp.FLAG_MANDATORY, name='User-Name', ), ) # Unknown AVPs defaul...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_avp_vendor(self):\n # Vendor specific flags means you need a non default vendor ID\n with self.assertRaises(CodecException):\n avp_val = avp.UnknownAVP(\n 0, b'',\n flags=avp.FLAG_VENDOR,\n vendor=avp.VendorId.DEFAULT,\n )\n ...
[ "0.7274774", "0.66196334", "0.6594534", "0.59081936", "0.57923865", "0.56568724", "0.56208634", "0.54114044", "0.54112875", "0.5234036", "0.5216577", "0.5200915", "0.51545334", "0.51375127", "0.5137086", "0.51328814", "0.5118563", "0.5108796", "0.5078042", "0.5071875", "0.505...
0.51701176
12
Tests we can create an AVP with a code and it defaults to the defaults vendor.
def test_string_identifier(self): self._compare_avp( avp.AVP('User-Name', 'Hello'), avp.UTF8StringAVP( 1, value='Hello', vendor=avp.VendorId.DEFAULT, flags=avp.FLAG_MANDATORY, name='User-Name', ), ) # Unknown na...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_avp_vendor(self):\n # Vendor specific flags means you need a non default vendor ID\n with self.assertRaises(CodecException):\n avp_val = avp.UnknownAVP(\n 0, b'',\n flags=avp.FLAG_VENDOR,\n vendor=avp.VendorId.DEFAULT,\n )\n ...
[ "0.7276532", "0.66199905", "0.6594409", "0.59077823", "0.5792158", "0.56572336", "0.56215614", "0.54126716", "0.5410418", "0.52328616", "0.52149737", "0.52010345", "0.5170627", "0.513799", "0.5136871", "0.5132713", "0.51185805", "0.51092434", "0.50762635", "0.5070641", "0.505...
0.51554304
13
Tests we can create an AVP with a code and it defaults to the defaults vendor.
def test_result_code(self): result_avp = avp.AVP('Result-Code', avp.ResultCode.DIAMETER_SUCCESS) self.assertEqual(result_avp.value, avp.ResultCode.DIAMETER_SUCCESS) self._compare_avp( avp.AVP('Result-Code', avp.ResultCode.DIAMETER_SUCCESS), avp.ResultCodeAVP( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_avp_vendor(self):\n # Vendor specific flags means you need a non default vendor ID\n with self.assertRaises(CodecException):\n avp_val = avp.UnknownAVP(\n 0, b'',\n flags=avp.FLAG_VENDOR,\n vendor=avp.VendorId.DEFAULT,\n )\n ...
[ "0.72757536", "0.6619766", "0.65940857", "0.5908258", "0.57922417", "0.5621205", "0.5412011", "0.5410173", "0.5233202", "0.5214631", "0.5200039", "0.5170654", "0.5154851", "0.5137301", "0.5136124", "0.5132803", "0.5119158", "0.5108666", "0.50768244", "0.5071064", "0.50540316"...
0.565635
5
Reads the MOPAC version string from the second line
def read_version(self, fname): version = 'unknown' lines = open(fname).readlines() for line in lines: if " Version" in line: version = line.split()[-2] break return version
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_release_version():\n with open(\"RELEASE-VERSION\", \"r\") as f:\n return f.readline().strip()", "def read_version_message(m_bytes):\n\n if len(m_bytes) != 2:\n raise InvalidProtocolVersionError()\n version_str = m_bytes[0:2]\n return version_str", "def versionRead():\n ...
[ "0.6760917", "0.6625684", "0.6598049", "0.64503145", "0.63550556", "0.6235125", "0.6222216", "0.61286664", "0.60776657", "0.607554", "0.60538125", "0.6048213", "0.6016605", "0.6015268", "0.59854823", "0.5936133", "0.5867915", "0.586289", "0.58473486", "0.5829188", "0.582756",...
0.67716914
0
Return the index of the smallest element in the subarray. This is slower than simple_index_of_min because it is O(n) + O(how long deck.index takes) as opposed to O(n).
def index_of_min(deck, firstIndex): return deck.index(np.min(deck[firstIndex:]))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def simple_index_of_min(deck, firstIndex):\n min_val = deck[firstIndex] \n min_idx = firstIndex\n for i in range(firstIndex + 1, len(deck)):\n if min_val > deck[i]:\n min_val = deck[i]\n min_idx = i\n return min_idx", "def min_search(arr: Sequence) -> int:\n\tprint(arr)\n...
[ "0.7571985", "0.6844863", "0.6593771", "0.65777516", "0.6504302", "0.64333266", "0.6399011", "0.6368425", "0.63648915", "0.62642", "0.62608546", "0.62533414", "0.62530565", "0.621581", "0.6213222", "0.62116987", "0.61197275", "0.60829943", "0.60827935", "0.60639256", "0.60607...
0.79753035
0
Return the index of the smallest element in the subarray.
def simple_index_of_min(deck, firstIndex): min_val = deck[firstIndex] min_idx = firstIndex for i in range(firstIndex + 1, len(deck)): if min_val > deck[i]: min_val = deck[i] min_idx = i return min_idx
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def min_search(arr: Sequence) -> int:\n\tprint(arr)\n\tmin_index = None\n\tmin_elem = arr[0]\n\tfor i in range(1, len(arr)):\n\t\tif min_elem > arr[i]:\n\t\t\tmin_elem = arr[i]\n\t\t\tmin_index = i\n\treturn min_index", "def min(self):\n a = self.array_form\n min = len(a)\n for i in xrange(l...
[ "0.7663508", "0.703998", "0.70295393", "0.69781405", "0.6952867", "0.69331414", "0.6905875", "0.69054496", "0.68542624", "0.68064356", "0.6773403", "0.6716843", "0.66870177", "0.6643967", "0.66367596", "0.6633392", "0.6600657", "0.65984774", "0.6545687", "0.6539135", "0.65072...
0.6523238
20
Return all matched platforms available
def get_matched_platforms(self, platform): raise NotImplemented
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Platforms():\n return platforms", "def get_platforms(self):\n if self.platform == 'All':\n return PLATFORMS\n else:\n return self.platform.split(':')", "def platforms(self) -> Any:\n\n return search_api(\"platforms\")", "def platforms(self):\n logger.d...
[ "0.84017766", "0.8085135", "0.79573643", "0.79467857", "0.76988477", "0.7620065", "0.7570432", "0.7530073", "0.7499143", "0.7158513", "0.7156467", "0.7073225", "0.6983765", "0.69668716", "0.6952299", "0.6806815", "0.6774965", "0.6767344", "0.66853994", "0.66564685", "0.663886...
0.82357883
1
Find all matched platforms available
def _filter_platforms_by_platform_type(self, desired_platform): if desired_platform == constants.ANY: all_platforms = {} for platform in self.platforms.keys(): all_platforms.update(self._filter_platforms_by_platform_type(platform)) return all_platforms ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_matched_platforms(self, platform):\n raise NotImplemented", "def Platforms():\n return platforms", "def get_platforms(self):\n if self.platform == 'All':\n return PLATFORMS\n else:\n return self.platform.split(':')", "def platforms(self) -> Any:\n\n ...
[ "0.80669224", "0.7809959", "0.76512045", "0.73917407", "0.73068094", "0.728991", "0.7185548", "0.7117814", "0.70288604", "0.7024093", "0.6987453", "0.6859193", "0.68563765", "0.6770957", "0.66680574", "0.6592716", "0.6524757", "0.64757717", "0.64398515", "0.63725156", "0.6364...
0.671745
14
This function prints and plots the confusion matrix. Normalization can be applied by setting `normalize=True`.
def plot_confusion_matrix(cm, model_name, classes, normalize=False, title='Confusion matrix', cmap=plt.cm.Blues): plt.imshow(cm, interpolation='nearest', cmap=cmap) plt.title(title) plt.colorbar() tick_marks = np.arange(len(c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_confusion_matrix(cm, classes=[0,1], normalize=False, title='Confusion matrix', print_matrix=False):\n\n if normalize:\n cm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis]\n print(\"Normalized confusion matrix\")\n else:\n print('Confusion matrix, without normalization')\n\n...
[ "0.8192804", "0.8094402", "0.80277497", "0.80176693", "0.7992383", "0.7989708", "0.7979215", "0.79741204", "0.7959607", "0.7955097", "0.79358983", "0.79329205", "0.7932711", "0.79295874", "0.79247147", "0.79228914", "0.792216", "0.79215133", "0.7921201", "0.7920765", "0.79161...
0.0
-1
take a 2D list with the same height and width and make a copy
def copy_list(original_list): list_copy = [] for i in range(len(original_list)): list_copy.append([]) for j in range(len(original_list)): list_copy[i].append(original_list[i][j]) return list_copy
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def copy(a):\n height = len(a)\n width = len(a[0])\n new_a = create_board(width, height)\n\n for row in range(1, height - 1):\n for col in range(1, width - 1):\n new_a[row][col] = a[row][col]\n\n return new_a", "def copy_grid(grid):\r\n new_grid = []\r\n new_grid = create_g...
[ "0.7298503", "0.7204203", "0.71576315", "0.6981399", "0.6934884", "0.67165744", "0.6672918", "0.63205516", "0.6258255", "0.61647195", "0.61642104", "0.6156303", "0.61520624", "0.6085999", "0.6070902", "0.6055528", "0.60272926", "0.6024684", "0.6008955", "0.59906405", "0.59666...
0.6850475
5
Create an list of values from either a single data frame column or a list of data frame columns. Raises a ValueError if an empty column list is given or if the column list references columns that are unknown for the given data frame.
def __new__(cls, df, columns): # If the list of columns is not given, the set of values over all # columns in the data frame schema is used. if columns is None: columns = as_list(df.columns) # Ensure that columns is a list. columns = columns if isinstance(columns, lis...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def column_select(df,returnList = [\"x\",\"y\"]):\n df = df.sort_values(by = 'frame_id')\n return [ list(df[k]) for k in returnList]", "def column_values(table: list[dict[str, str]], column: str) -> list[str]:\n result: list[str] = []\n for row in table:\n item: str = row[column]\n resu...
[ "0.6222368", "0.62052053", "0.62052053", "0.6142802", "0.61373097", "0.61370564", "0.60793316", "0.59654367", "0.5932249", "0.59143555", "0.5908715", "0.5708291", "0.56409043", "0.562518", "0.5624335", "0.5608264", "0.55698436", "0.55175346", "0.5516278", "0.5511064", "0.5490...
0.5228998
37
Iterator over values in multiple columns in a data frame.
def multi_column_iterator(df, colidx): for _, values in df.iterrows(): yield tuple([values.iloc[i] for i in colidx])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def single_column_iterator(df, colidx):\n for _, values in df.iterrows():\n yield values.iloc[colidx]", "def __iter__(self):\r\n for column, value in self.items():\r\n # this uses __getitem__, using the name (rather than the accessor)\r\n # is correct – it's what __getitem_...
[ "0.74873716", "0.7126579", "0.7105958", "0.69085145", "0.68879914", "0.6605069", "0.6603319", "0.6326949", "0.6244653", "0.62291235", "0.62230533", "0.61613953", "0.6157815", "0.6065728", "0.6060572", "0.6030361", "0.59583724", "0.58574396", "0.5802716", "0.5799147", "0.57233...
0.7742081
0
Adds parentheses as needed after functions.
def _implicit_application(tokens: List[tUnion[TOKEN, AppliedFunction]], local_dict: DICT, global_dict: DICT): result: List[tUnion[TOKEN, AppliedFunction]] = [] appendParen = 0 # number of closing parentheses to add skip = 0 # number of tokens to delay before adding a ')' (to # capture **, ^,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_insert_parentheses(self):\n before_b = \"\"\"\\\n first line\n line 1\n line a\n line b\n line c\n last line\n \"\"\"\n after_b = \"\"\"\\\n first() line\n line 1\n line a\n line b\n line c\n last line\n \"\"\"\n self.r...
[ "0.5492504", "0.54609454", "0.53420275", "0.5338748", "0.5325564", "0.53249234", "0.5311519", "0.53034157", "0.52676934", "0.51836956", "0.5182259", "0.5167372", "0.5159088", "0.5140353", "0.5078504", "0.5076138", "0.5073122", "0.5052128", "0.5043448", "0.5042157", "0.5031736...
0.542417
2
Return True if the track has changed since last update.
def is_track_new(self): is_new = self._track_is_new self._track_is_new = False return is_new
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_updated(self):\n return self.timestamp > 0", "def hasChanged(self):\r\n if self.is_updated:\r\n self.is_updated = False\r\n return True\r\n else:\r\n return False\r\n\r\n # if not self.hasBeenUpdatedOnce:\r\n # self.hasBeenUpdatedOnce...
[ "0.7868006", "0.7447631", "0.74329317", "0.738315", "0.7333083", "0.7160828", "0.7158654", "0.7150936", "0.7117528", "0.71104085", "0.7008325", "0.7003016", "0.6993342", "0.69914734", "0.69747025", "0.6966855", "0.6965117", "0.69157386", "0.6907089", "0.68494385", "0.6834722"...
0.7258955
5
Returns the cross product of two edges from input triangles
def cross(triangles): vectors = np.diff(triangles, axis=1) crosses = np.cross(vectors[:, 0], vectors[:, 1]) return crosses
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cross_product(a,b):\n return [a[1]*b[2]-a[2]*b[1], a[2]*b[0]-a[0]*b[2], a[0]*b[1]-a[1]*b[0]]", "def cross_product(p0,p1,p2):\n\treturn (((p1[0]-p0[0])*(p2[1]-p0[1]))-((p2[0]-p0[0])*(p1[1]-p0[1])))", "def cross_product(a, b):\n return (a[1]*b[2] - a[2]*b[0],\n a[2]*b[0] - a[0]*b[2],\n ...
[ "0.6953804", "0.69418573", "0.6908114", "0.685409", "0.6816123", "0.67730004", "0.6656109", "0.66075015", "0.6590151", "0.65791214", "0.6467439", "0.64373755", "0.6423663", "0.6361046", "0.63316554", "0.6330097", "0.63206995", "0.6319148", "0.629461", "0.62701297", "0.6269927...
0.71049696
0
Find the n smallest elements in a dataset.
def nsmallest(n, iterable, key=None): # Short-cut for n==1 is to use min() if n == 1: it = iter(iterable) sentinel = object() if key is None: result = min(it, default=sentinel) else: result = min(it, default=sentinel, key=key) return [] if result ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _nsmallest(\n self,\n n=5,\n columns: Optional[List[str]] = None,\n keep: Literal[\"last\", \"first\"] = \"first\",\n ):\n return self.sort(by=columns, ascending=True).head(n)", "def lowest_x(self, n, x, description):\n before = self.item_count()\n self.fil...
[ "0.7519184", "0.74028593", "0.68230605", "0.6713846", "0.66292036", "0.64777046", "0.6449061", "0.63433176", "0.6314659", "0.62821496", "0.62282646", "0.62188363", "0.6181273", "0.6128707", "0.60722387", "0.6041839", "0.60329", "0.6024026", "0.59280044", "0.59096056", "0.5835...
0.6264568
10
r""" Compute the derivative of the GP posterior mean at the specified input location with respect to the vector embedding of the graph (e.g., if using WLsubtree, this function computes the gradient wrt each subtree pattern) The derivative is given by $ \frac{\partial \mu^}{\partial \phi ^} = \frac{\partial K(\phi, \phi...
def dmu_dphi( self, X_s=None, # compute_grad_var=False, average_across_features=True, average_across_occurrences=False, ): if self.K_i is None or self.logDetK is None: raise ValueError( "Inverse of Gram matrix is not instantiated. Please ca...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def derivative(self, theta):\n diag_gamma = np.dot(theta.T, self.X.T)\n logistic_term = self.logistic_fn(diag_gamma)\n diag_gamma = logistic_term * (1.0 - logistic_term)\n gamma = np.diag(diag_gamma)\n\n # v computation\n diags_v = 1.0 - 2*self.logistic_fn(np.dot(theta.T, ...
[ "0.5653472", "0.5646177", "0.55743986", "0.5564399", "0.5548251", "0.5548149", "0.5504058", "0.5481156", "0.5478227", "0.5437502", "0.54346126", "0.5433907", "0.5432462", "0.5431711", "0.5431711", "0.543036", "0.5426751", "0.5423553", "0.5395775", "0.5387857", "0.53827244", ...
0.58631396
0
This function gets the value of an environment variable.
def get_env_variable(var_name, default_value=None): try: return os.environ[var_name] except KeyError: error_msg = "Set the %s environment variable" % var_name print(error_msg) return default_value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetEnvVariable(name):\n return os.environ.get(name)", "def windows_get_env_value(var_name: str) -> str:\n if var_name in os.environ.keys():\n return os.environ[var_name]", "def _get_env(key: str) -> str:\n value = os.getenv(key)\n assert isinstance(value, str), (\n f\"...
[ "0.8155902", "0.8143186", "0.8135923", "0.8104177", "0.7906808", "0.78122395", "0.77314556", "0.76804584", "0.7676385", "0.76763076", "0.76706797", "0.75282305", "0.74297893", "0.73972905", "0.7381869", "0.7339875", "0.7337856", "0.73339266", "0.73196", "0.7310828", "0.718639...
0.72933626
20
Replace the terraform_source material with a new material. This is used in terraform.reload_template operation.
def update_terraform_source_material(new_source, target=False): ctx.logger.debug('update_terraform_source_material ' 'new_source: {}'.format(new_source)) delete_tmp = True new_source_location = new_source new_source_username = None new_source_password = None node_instance_di...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_terraform_source(new_source=None, new_source_path=None):\n if new_source:\n material = update_terraform_source_material(new_source)\n else:\n # If the plan operation passes NOone, then this would error.\n material = get_terraform_source_material()\n node_instance_dir = get_...
[ "0.6655648", "0.57133335", "0.5688341", "0.5433815", "0.5371916", "0.5370673", "0.52009857", "0.5179576", "0.51118106", "0.5094926", "0.5071477", "0.49414852", "0.4913425", "0.4913305", "0.48959532", "0.48755416", "0.48658475", "0.486263", "0.48105115", "0.47848913", "0.47663...
0.70596457
0
Applies linear warmup of learning rate from 0 and decay to 0.
def linear_warmup_decay(learning_rate, warmup_steps, num_train_steps): with fluid.default_main_program()._lr_schedule_guard(): lr = fluid.layers.tensor.create_global_var( shape=[1], value=0.0, dtype='float32', persistable=True, name="scheduled_lear...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def linear_warmup(base_value, max_warmup_iter, cur_step):\n if max_warmup_iter <= cur_step:\n return base_value\n return base_value * cur_step / max_warmup_iter", "def adjust_learning_rate_warmup(optimizer, epoch, args):\n lr = args.lr * (epoch + 1) / args.warmup_epoch\n global current_lr\n ...
[ "0.65639514", "0.64120924", "0.6368154", "0.6335719", "0.6318807", "0.6259144", "0.62568754", "0.623038", "0.6226886", "0.6204688", "0.61304075", "0.6118824", "0.6041374", "0.6029258", "0.6018297", "0.60096115", "0.60096115", "0.59863126", "0.5964717", "0.5952636", "0.5941927...
0.70584446
0
Gets the image_name of this ImageData.
def image_name(self) -> str: return self._image_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getImageName(self):\r\n return self.imageName", "def image_name(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"image_name\")", "def image_name(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"image_name\")", "def image_name(self) -> Optional[pulum...
[ "0.8321288", "0.8188899", "0.78037", "0.78037", "0.77783084", "0.74824905", "0.7305873", "0.7167769", "0.71449965", "0.7096319", "0.70771646", "0.70329046", "0.702388", "0.7013256", "0.69979", "0.69923127", "0.69827694", "0.69349366", "0.69349366", "0.68416184", "0.68107706",...
0.8708528
0
Sets the image_name of this ImageData.
def image_name(self, image_name: str): self._image_name = image_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def change_image_name(self, name):\n self.image.name = name", "def image_name(self) -> str:\n return self._image_name", "def set_imagefilename(self,imagefilename):\n self.imagefile = open(imagefilename,'r+')", "def set_filename(self, name):\n self.ds_filename = name", "def set_i...
[ "0.826169", "0.6935366", "0.67652696", "0.6646094", "0.6593884", "0.6593407", "0.6577544", "0.6569843", "0.65465504", "0.6523291", "0.6514473", "0.6514473", "0.64898485", "0.6435465", "0.6430254", "0.6430254", "0.6430254", "0.6430254", "0.6430254", "0.6430254", "0.6430254", ...
0.87005484
0
Gets the size of this ImageData.
def size(self) -> int: return self._size
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_size(self):\n return self._data_size", "def size(self):\n return self.__image.size", "def size(self):\n return self._image_size", "def size(self):\n return self.data.size", "def size(self):\n if self._size and not self._pil_image:\n return self._size\n ...
[ "0.8347523", "0.81703216", "0.8153926", "0.79846704", "0.7783651", "0.77197397", "0.77089226", "0.77089226", "0.76672107", "0.7648655", "0.7644404", "0.76354", "0.76290345", "0.76290345", "0.7624711", "0.7599025", "0.7593515", "0.7593515", "0.7593515", "0.7593515", "0.7593515...
0.73780715
63
Gets the image_type of this ImageData.
def image_type(self) -> ImageType: return self._image_type
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def imageType(self):\n return self.__imageType", "def type(self):\n return _image.image_type(self)", "def pixeltype(self):\n return _image.image_pixeltype(self)", "def get_format(self):\n image = Image.open(self.image_data)\n return image.format", "def type(self):\n ...
[ "0.8554245", "0.84645814", "0.7186352", "0.71261305", "0.7077204", "0.70501", "0.6845407", "0.68451476", "0.6739745", "0.67381364", "0.67335033", "0.6672943", "0.6672943", "0.6672943", "0.6672943", "0.6672943", "0.6672943", "0.6672943", "0.6672943", "0.6672943", "0.6672943", ...
0.87484396
0
Sets the image_type of this ImageData.
def image_type(self, image_type: ImageType): self._image_type = image_type
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_type(self, type: int):\r\n self.type = type\r\n self.canvas.itemconfig(self.item, image=self._get_image())", "def image_type(self) -> ImageType:\n return self._image_type", "def setDataSetType(self, type):\n self.__data_set_type__ = type", "def imageType(self):\n re...
[ "0.7035137", "0.69461876", "0.6669106", "0.66679066", "0.6653907", "0.6653907", "0.6602624", "0.63796544", "0.6352169", "0.62813157", "0.62262034", "0.62262034", "0.6204599", "0.6169611", "0.6169611", "0.6169611", "0.6169611", "0.6169611", "0.6169611", "0.6169611", "0.6169611...
0.8539408
0
Input text Output tokenized text
def tokenize(text): #Clean data, remove all character except character and number,such as punctuation etc. text = re.sub(r'[^a-zA-Z0-9]', ' ', text.lower()) tokens = word_tokenize(text) tokens = [WordNetLemmatizer().lemmatize(word) for word in tokens if word not in ST_english] return tokens
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tokenize(text):\n return text.split(' ')", "def tokenize(self, text):\n\n text = convert_to_unicode(text)\n\n output_tokens = []\n for token in whitespace_tokenize(text):\n chars = list(token)\n if len(chars) > self.max_input_chars_per_word:\n output_tokens.append(self.unk_token)\n ...
[ "0.77266514", "0.77034426", "0.765065", "0.7503493", "0.74961126", "0.7466508", "0.7374466", "0.7347171", "0.73422486", "0.732905", "0.72553587", "0.72399044", "0.72279334", "0.7171374", "0.71657616", "0.7122744", "0.71222836", "0.71215016", "0.7114561", "0.7111532", "0.71010...
0.7147765
15
Return package version as listed in `__version__` in `init.py`.
def get_version(package): with open(os.path.join(package, '__init__.py'), 'rb') as init_py: src = init_py.read().decode('utf-8') return re.search("__version__ = ['\"]([^'\"]+)['\"]", src).group(1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_version_from_package() -> str:\n path = join(dirname(__file__), \"__init__.py\")\n path = normpath(abspath(path))\n with open(path) as f:\n for line in f:\n if line.startswith(\"__version__\"):\n token, version = line.split(\" = \", 1)\n version = ve...
[ "0.8489474", "0.83912396", "0.83868575", "0.8380673", "0.83794516", "0.8371276", "0.8371276", "0.8371276", "0.8371276", "0.8371276", "0.8371276", "0.8371276", "0.8369819", "0.8357534", "0.83568484", "0.8077552", "0.7975867", "0.7938166", "0.78923714", "0.78923714", "0.7892371...
0.8358652
13
Set the value of the shared register specified by id
def set_global(self, id, value): self.registers[id] = value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set(self, id, key, val):\n try:\n id_settings = self.id_dict[id]\n except KeyError:\n id_settings = {}\n self.id_dict[id] = id_settings\n id_settings[key] = val", "def reg_id(self, reg_id):\n\n self._reg_id = reg_id", "def set_local(self, id, val...
[ "0.6597757", "0.6357648", "0.6340989", "0.62681997", "0.61998284", "0.60728663", "0.6026996", "0.6004376", "0.594044", "0.5895724", "0.5844993", "0.58236736", "0.577803", "0.5756242", "0.57297534", "0.57175094", "0.571571", "0.57069814", "0.5700176", "0.56964296", "0.5681814"...
0.77932715
0
Set the row of the matrix
def _setMatrixRow(self, row): item = self._item() if item is not None: matrix = item.getMatrix() matrix[self._index, :] = row.x(), row.y(), row.z() item.setMatrix(matrix)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_row( self, row, ):\n self.ix_row = row", "def setRow(self, row): \n self.row = row", "def setRow(self, row_number, row):\n self.data[:,row_number] = row\n return", "def set_matrix_row(matrix, new_vector, row):\n set_matrix_cell(matrix, new_vector.x, row, 0)\n ...
[ "0.8242423", "0.804304", "0.79812926", "0.77985466", "0.7124227", "0.70839894", "0.7044925", "0.67937547", "0.67925847", "0.67401546", "0.66254383", "0.65337515", "0.65147907", "0.6470104", "0.6398404", "0.63827354", "0.6380484", "0.6337928", "0.63346344", "0.62994075", "0.62...
0.858889
0
Returns the range of the colormap for the current data.
def _getColormapRange(self): item = self.item() if item is not None and self._colormap is not None: return self._colormap.getColormapRange(item) else: return 1, 100 # Fallback
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getColorRange(self):\n vmax=self.data_matrix.max()\n vmin=self.data_matrix.min()\n\n if vmax * vmin < 0: # ie number range spans +ve and -ve\n vmax = max([vmax, abs(vmin)])\n vmin = -1*vmax\n\n return vmax,vmin", "def _get_display_range(image): # pragma:...
[ "0.78318775", "0.7401124", "0.70967954", "0.7019722", "0.69327664", "0.67646444", "0.66170365", "0.66013634", "0.6540593", "0.64825255", "0.64442724", "0.6407261", "0.6379997", "0.63684094", "0.62948114", "0.62948114", "0.6288837", "0.62665725", "0.62573814", "0.62027895", "0...
0.84722245
0
Proxy to get raw colormap bound
def _getRawBound(self): if self._colormap is None: return None elif self._index == 0: return self._colormap.getVMin() else: # self._index == 1 return self._colormap.getVMax()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _getBound(self):\n if self._colormap is not None:\n bound = self._getRawBound()\n\n if bound is None:\n bound = self._getColormapRange()[self._index]\n return bound\n else:\n return 1. # Fallback", "def _getColormapRange(self):\n ...
[ "0.66560954", "0.63308734", "0.6303656", "0.62848014", "0.61891127", "0.61891127", "0.6110057", "0.60839653", "0.6028771", "0.5978778", "0.5824225", "0.581273", "0.5775261", "0.57617545", "0.57316095", "0.5725181", "0.5725181", "0.56450224", "0.56450224", "0.56450224", "0.562...
0.6836688
0
Proxy to get the isosurface's transparency
def _opacity(self): item = self.item() return 255 if item is None else item.getColor().alpha()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isosurface(self):\n return self._isosurface()", "def transparent(self):\r\n return not not self.prototype.transparent", "def get_surface(**kwargs):\n icon = _IconBuffer()\n for key, value in kwargs.items():\n icon.__setattr__(key, value)\n return icon.get_surface()", "def Su...
[ "0.6941713", "0.5905076", "0.5887201", "0.5859804", "0.57867056", "0.57492626", "0.57455003", "0.57193583", "0.5700761", "0.56226635", "0.5603784", "0.55479586", "0.55368334", "0.55237794", "0.5511958", "0.5457478", "0.5440486", "0.5437211", "0.54084915", "0.5397053", "0.5394...
0.5864294
3
Remove keys from a dictionary.
def remove_keys(_dict, keys): if not _dict: return None new = dict(_dict) for key in keys: new.pop(key, None) return new
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_keys_from_dict(dictionary, keys):\n\n # Copy dictionary\n dictionary_updated = dictionary.copy()\n try:\n [dictionary_updated.pop(key) for key in keys]\n except:\n print(\"Error: No ratio and sampling strategy parameters\")\n return dictionary_updated", "def keep_in_dictio...
[ "0.80267066", "0.7995287", "0.7878177", "0.78185576", "0.7806963", "0.7792269", "0.75980955", "0.7573445", "0.7501589", "0.7490644", "0.7386149", "0.73702294", "0.7354082", "0.72534496", "0.7247841", "0.72042185", "0.7182112", "0.717825", "0.7164922", "0.705064", "0.70464873"...
0.78998464
2
Return the basename of a filepath.
def basename(file_path): return os.path.basename(file_path)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def basename(path):\r\n return split(path)[1]", "def get_filename(filepath):\n return os.path.basename(filepath)", "def basename(path: str) -> str:\n pass", "def basename(self):\n return os.path.basename(self.filepath)", "def getBaseName(filepath):\n return os.path.basename(filepath)", "...
[ "0.85257316", "0.8508369", "0.85065496", "0.8299894", "0.82706845", "0.8194257", "0.8189768", "0.8185217", "0.8152563", "0.812153", "0.7950063", "0.79432064", "0.7893022", "0.7892346", "0.7858747", "0.77643377", "0.77129203", "0.7682729", "0.76708555", "0.76598155", "0.762425...
0.8841317
0
Get handle for the file. Returns flowserv.model.files.base.FileHandle
def load(self) -> FileHandle: with self.service() as api: return api.runs().get_result_file( run_id=self.run_id, file_id=self.file_id )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _handle(self):\n return self.__handle", "def _handle(self):\n return self.__handle", "def _handle(self):\n return self.__handle", "def get_file(self) -> int:\r\n return self.file", "def _filehandle(self):\n if not self._fh or self._is_closed():\n filename =...
[ "0.6728279", "0.6728279", "0.6728279", "0.66962826", "0.6657412", "0.6650079", "0.66019773", "0.6571665", "0.65594584", "0.65594584", "0.65594584", "0.6547598", "0.6542747", "0.6493023", "0.6468259", "0.645259", "0.64515823", "0.6428655", "0.6421259", "0.64070946", "0.637004"...
0.5722662
60
Sets the temp_staff_speciality of this Specialty.
def temp_staff_speciality(self, temp_staff_speciality): self._temp_staff_speciality = temp_staff_speciality
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, temp_staff_speciality=None, validity=None, notes=None, local_vars_configuration=None): # noqa: E501 # noqa: E501\n if local_vars_configuration is None:\n local_vars_configuration = Configuration()\n self.local_vars_configuration = local_vars_configuration\n\n se...
[ "0.5879414", "0.58567905", "0.58567905", "0.54648113", "0.5373502", "0.5302625", "0.5095059", "0.5080204", "0.5047452", "0.50008994", "0.48750293", "0.48400337", "0.48036706", "0.47380903", "0.47277984", "0.47154027", "0.46658656", "0.46656635", "0.46576545", "0.46576545", "0...
0.90729666
0
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, Specialty): return False return self.to_dict() == other.to_dict()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False", "def __eq__(self, other):\n if i...
[ "0.8088132", "0.8088132", "0.8054589", "0.7982687", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", ...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): if not isinstance(other, Specialty): return True return self.to_dict() != other.to_dict()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other) -> bool:\n return not self.__eq__(other)", "def __eq__(self, other):\n ...
[ "0.845611", "0.8391477", "0.8144138", "0.81410587", "0.8132492", "0.8093973", "0.80920255", "0.80920255", "0.80920255", "0.8085325", "0.8085325", "0.8076365", "0.8076365", "0.8065748", "0.8042487", "0.8042487", "0.8042487", "0.8042487", "0.8042487", "0.8042487", "0.8042487", ...
0.0
-1
returns a timeseries list from in_list data.
def get_timeseries(in_list, duration, kg_to_tons): value = 0 value_timeseries = [] array = np.array(in_list) if len(in_list) > 0: for i in range(0, duration): value = sum(array[array[:, 0] == i][:, 1]) if kg_to_tons: value_timeseries.append(value * 0.001) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_twodim_list(self):\n tsformat = self._timestampFormat\n\n if tsformat is None:\n return self._timeseriesData\n\n datalist = []\n append = datalist.append\n convert = TimeSeries.convert_epoch_to_timestamp\n for entry in self._timeseriesData:\n ...
[ "0.67259496", "0.66716796", "0.6391872", "0.6251219", "0.6127312", "0.60957015", "0.60667855", "0.59559476", "0.59142303", "0.58823854", "0.58671963", "0.586019", "0.58137316", "0.57992566", "0.5792376", "0.57855034", "0.5761222", "0.5738981", "0.5683437", "0.566707", "0.5598...
0.6769592
0
Initializes and returns an object representing a test user with preset hardcoded settings and budgets. This is a helper function designed to speed up development. Uses the global variable dictionary USER_TEST_DATA for generating a new user.
def load_test_user() -> User: new_user = User.generate_new_user(Driver.user_test_data) return new_user
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setUp(self):\n User.users = {}\n self.app = User('demo@email.com', 'admin', 'admin')\n # Set some default user data\n self.user_data = {\n 1: {\n 'email': 'demo@email.com',\n 'username': 'admin',\n 'password': 'admin' \n ...
[ "0.693702", "0.6841277", "0.6841277", "0.6830632", "0.67392606", "0.6670856", "0.6645519", "0.6604569", "0.6583037", "0.6559513", "0.6557608", "0.6556933", "0.6540214", "0.6511389", "0.6510336", "0.6507924", "0.6506847", "0.6502634", "0.6482243", "0.6469562", "0.64657915", ...
0.71584857
0
Create a new population, made of 'POPULATION_COUNT' individual
def get_random_population(): return [ get_random_individual() for _ in range(POPULATION_COUNT) ]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_new_population(self):\n self.check_for_generation_cap()\n pop_container = list()\n for chromosome in self.population:\n partner = bm.select_partner(\n self.fitness_scores, self.population)\n child = bm.mutate(bm.crossover(chromosome, partner))\n ...
[ "0.7537086", "0.6853734", "0.65585643", "0.65395", "0.6517348", "0.6464381", "0.6440397", "0.64366806", "0.64191747", "0.63390553", "0.6320056", "0.6303148", "0.6298649", "0.62776005", "0.6268499", "0.62535465", "0.6210634", "0.6199758", "0.6192454", "0.61482376", "0.6128414"...
0.62307024
16
Return the average fitness of the whole population
def average_population_grade(population): total = 0 for individual in population : total += get_individual_fitness(individual) return total/POPULATION_COUNT
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def average_fitness(self):\n return sum([e.fitness for e in self.population]) / len(self.population)", "def average_fitness(individuals):\n fitness_num = 0\n for individual in individuals:\n fitness = individual.get_fitness()\n fitness_num += fitness\n return fitness_num / len(indiv...
[ "0.8676416", "0.8113571", "0.77746856", "0.74121547", "0.7272244", "0.7198187", "0.71802837", "0.70635396", "0.70343685", "0.7016438", "0.6965455", "0.69341236", "0.68904555", "0.6877716", "0.68654895", "0.6843745", "0.67882663", "0.67592216", "0.6743637", "0.67230684", "0.67...
0.8343167
1
Return a list of tuple (individual, fitness) sorted from most most graded to less graded
def sort_population(population): graded_individual =[] for individual in population : graded_individual.append( (individual, get_individual_fitness(individual)) ) return graded_individual.sort(key=lambda x: x[1], reverse=True)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sorted_herbivores(self):\n fitness_dict = {herb: herb.fitness for herb in self.herbivores}\n sorted_tuples = sorted(fitness_dict.items(), key=lambda x: x[1], reverse=False)\n\n return sorted_tuples", "def sort_by_fitness(pop, fitness):\n data = list(zip(fitness, pop))\n fitness, po...
[ "0.73159945", "0.72906893", "0.6999703", "0.68994135", "0.6865923", "0.6747164", "0.67004937", "0.66845757", "0.6674509", "0.6642251", "0.65800864", "0.652309", "0.64563507", "0.6436714", "0.6413957", "0.6386113", "0.63547003", "0.6350761", "0.63291574", "0.63251805", "0.6323...
0.7683326
0
The name of this hybrid compute machine.
def name(self) -> str: return pulumi.get(self, "name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def machine_name(self) -> str:\n return pulumi.get(self, \"machine_name\")", "def machine_name(self) -> str:\n return pulumi.get(self, \"machine_name\")", "def computer_name(self) -> str:\n return pulumi.get(self, \"computer_name\")", "def name(self):\n return f\"{get_device_name(...
[ "0.78817964", "0.78817964", "0.7659259", "0.74277973", "0.73336273", "0.73149437", "0.72652876", "0.7226466", "0.7181055", "0.7181055", "0.7181055", "0.71317905", "0.7108128", "0.709828", "0.7077523", "0.7077523", "0.7068414", "0.7063462", "0.70512724", "0.7047348", "0.701734...
0.0
-1
Specifies the host OS name of the hybrid machine.
def computer_name(self) -> str: return pulumi.get(self, "computer_name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetOSName():\n return Config.osName_", "def OverridePlatformName(name):\n global override_platform_name\n override_platform_name = name", "def platform():\n return \"micaz\"", "async def osname(self):\n\n await self.bot.say(box(system(), 'Bash'))", "def get_os_name(cls):\n return...
[ "0.6714382", "0.6460827", "0.63393486", "0.63391984", "0.610117", "0.6030685", "0.597316", "0.59021294", "0.5894657", "0.58734244", "0.5865589", "0.5859394", "0.5833286", "0.58314365", "0.5794824", "0.57857734", "0.578508", "0.578508", "0.57829136", "0.57615554", "0.5755917",...
0.5323986
63
The current status of the service.
def status(self) -> str: return pulumi.get(self, "status")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_service_status(self):\n return self.service.status()", "def status(self):\n return self._get(path='status')", "def get_status(self):\n return self.status", "def get_status(self):\n return self.status", "def get_status(self):\n return self.status", "def getStatus...
[ "0.883464", "0.8387259", "0.8312966", "0.8312966", "0.8312966", "0.8312398", "0.8297007", "0.82846177", "0.8283935", "0.82812774", "0.82803196", "0.82649493", "0.82649285", "0.8263274", "0.8237908", "0.8237908", "0.8228103", "0.82210577", "0.82210577", "0.82210577", "0.822105...
0.8309229
28
The current status of the service.
def status(self) -> str: return pulumi.get(self, "status")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_service_status(self):\n return self.service.status()", "def status(self):\n return self._get(path='status')", "def get_status(self):\n return self.status", "def get_status(self):\n return self.status", "def get_status(self):\n return self.status", "def getStatus...
[ "0.883464", "0.8387259", "0.8312966", "0.8312966", "0.8312966", "0.8312398", "0.8297007", "0.82846177", "0.8283935", "0.82812774", "0.82803196", "0.82649493", "0.82649285", "0.8263274", "0.8237908", "0.8237908", "0.8228103", "0.82210577", "0.82210577", "0.82210577", "0.822105...
0.8309229
29
Returns any dispersion priors to be used alongside the targets. The dispersion parameter defines how fussy we want to be about capturing data with the model. If its value is tiny, this means we are using a likelihood function that is very skewed and that will reject any model run that is not fitting the data perfectly ...
def get_dispersion_priors_for_gaussian_targets(targets: List[BaseTarget]): priors = [] for target in targets: if type(target) not in [TruncNormalTarget, NormalTarget]: continue if target.stdev is not None: continue max_val = max(target.data) # sd_ that wo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dispersion(self):\n return self._dispersion", "def get_dispersion_virial(self):\n if self._dispersion_virial is None:\n self._dispersion_virial = self._get_potential(self._system._dispersion)\n return self._dispersion_virial", "def dispersion(self, p):\n return p**2 /...
[ "0.5643515", "0.5582873", "0.5430436", "0.5295613", "0.5198738", "0.51566154", "0.49889556", "0.4767703", "0.4734876", "0.47209024", "0.47156158", "0.47156158", "0.47113124", "0.4708969", "0.47061282", "0.46910712", "0.4686004", "0.468468", "0.4682483", "0.4663882", "0.465936...
0.6571245
0
Return the logpdf of a truncated normal target, with scaling transforms
def truncnormal_logpdf(target_data: np.ndarray, model_output: np.ndarray, trunc_vals: Tuple[float, float], sd: float): a, b = (trunc_vals[0] - model_output) / sd, (trunc_vals[1] - model_output) / sd return stats.truncnorm.logpdf(x=target_data, a=a, b=b, loc=model_output, scale=sd)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def logpdf(self, x, norm=False):\n raise NotImplementedError(\"Normalized logposterior not implemented\")", "def logpdf(self, X) -> np.ndarray:\n return self.dist.logpdf(self.inv_trans(X))", "def logpdf(self, x):\n if self.transform is not None:\n x = self.transform(x) \n ...
[ "0.7152427", "0.68863714", "0.6792632", "0.677283", "0.671924", "0.6698928", "0.6698928", "0.66089755", "0.6493909", "0.64619803", "0.6430027", "0.6384575", "0.63410777", "0.6322924", "0.6315878", "0.6260283", "0.6233927", "0.62109506", "0.61741453", "0.6171708", "0.615615", ...
0.80364054
0
Return False if a part of a path begins with '.'. This excludes '..'. Originally glob.glob('') excluded hidden files, but this is not implemented in Path().glob nor Path().rglob().
def path_is_hidden(path): for p in path.parts: if p != '..' and p[0] == '.': return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _is_ignored(self, full_path):\n for ignor in self._ignored:\n if fnmatch.fnmatch(full_path, \"*/\" + ignor):\n return True\n return False", "def _has_extension(self, path):\r\n if re.match(r'.*\\\\.*\\..*$', path):\r\n return True", "def matches_path(cls, pat...
[ "0.72925305", "0.7179584", "0.6848215", "0.6772919", "0.67525446", "0.6747452", "0.6595828", "0.6591943", "0.65842557", "0.6576131", "0.65617543", "0.65128756", "0.65012974", "0.64936596", "0.6490669", "0.6449925", "0.64492685", "0.64305085", "0.6409612", "0.64061445", "0.640...
0.71373856
2
We need to distinguish if a variable value is a list or a string. Since strings are also iterable in Python, this helper will decide if something is truely iterable
def iterable(arg): return isinstance(arg, collections.Iterable) and not isinstance(arg, six.string_types)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _is_non_string_iterable(value):\n if isinstance(value, str):\n return False\n if hasattr(value, '__iter__'):\n return True\n if isinstance(value, collections.abc.Sequence):\n return True\n return False", "def is_str_or_coll(value):\n return bool(is_str(value)) or bool(is_t...
[ "0.80957097", "0.7853273", "0.7799085", "0.77318245", "0.77239954", "0.7675878", "0.7640689", "0.7540194", "0.752407", "0.73801064", "0.73743284", "0.7362137", "0.73524064", "0.7340069", "0.7337821", "0.7315343", "0.7276965", "0.72492117", "0.7202615", "0.7142509", "0.712903"...
0.69525737
27
Returns the path for the project's personal settings.py file
def project_settings_module(): project_root = git_tools.get_project_root() settings_path = os.path.join(project_root, ".branchdb", "settings.py") if os.path.exists(settings_path) is False: raise errors.ImproperlyConfigured("Unable to find settings module for project") return settings_path
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_project_dir():\n\n return Path(settings.PROJECT_DIR)", "def path(self):\n return os.path.join(self.config.get('path', os.getcwd()))", "def settingsFilePath(self):\n return self._settingsFilePath", "def _GetDjangoProjectDir(self):\r\n \r\n manage_file, settings_file = self._Find...
[ "0.75405306", "0.73080254", "0.7250991", "0.71388364", "0.7102079", "0.703298", "0.6991099", "0.6953136", "0.69487226", "0.6937468", "0.6927678", "0.6756015", "0.67395085", "0.67324567", "0.6695109", "0.6687042", "0.66792583", "0.6622428", "0.66141045", "0.6593675", "0.657748...
0.7467588
1
True if values are updated from the last commit.
def isdirty(self): return not not self._olddata
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_updated(self):\n return self.timestamp > 0", "def hasChanged(self):\r\n if self.is_updated:\r\n self.is_updated = False\r\n return True\r\n else:\r\n return False\r\n\r\n # if not self.hasBeenUpdatedOnce:\r\n # self.hasBeenUpdatedOnce...
[ "0.71335584", "0.7020878", "0.6902419", "0.68551445", "0.6841551", "0.6819969", "0.6811344", "0.6811067", "0.6802319", "0.678215", "0.675881", "0.6746616", "0.6697157", "0.6614278", "0.6579674", "0.65590715", "0.65494764", "0.6548244", "0.65120035", "0.6459622", "0.64361894",...
0.64615005
19
Get raw data value.
def raw(self, dirty=True, store=None, _raws=None): result = None if store is None: result = deepcopy(self._data) if not dirty: result.update(deepcopy(self._olddata)) for name in result.keys(): # convert inner records to raw value =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getvalue(self):\n return str(self.data)", "def get_raw_data(self):\n return self.__data", "def raw(self):\n return self.data", "def value(self):\n return self.data", "def value(self):\n return self._data", "def rawdata(self) -> str:\n return self._data", "d...
[ "0.80224276", "0.80034554", "0.7855756", "0.7830044", "0.770457", "0.76859075", "0.76510423", "0.7610414", "0.7610414", "0.7602802", "0.75899315", "0.7589458", "0.7542597", "0.7536696", "0.7492894", "0.74532044", "0.74181926", "0.74181926", "0.7417145", "0.7401385", "0.738547...
0.0
-1
Yield successive nsized chunks from l.
def chunk(l, n=500): return [l[i:i+n] for i in range(0, len(l), n)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _chunk(self, l, n):\n for i in range(0, len(l) + 1, n):\n yield l[i:i + n]", "def chunks(self, l, n):\n for i in range(0, len(l), n):\n yield l[i:i + n]", "def __chunks(l, n):\n for i in range(0, len(l), n):\n yield l[i:i + n]", "def get_chunks(self, ...
[ "0.8038813", "0.79248375", "0.7923423", "0.7885103", "0.78773195", "0.7815877", "0.77655786", "0.77556044", "0.77441615", "0.7731815", "0.77288336", "0.772473", "0.77028215", "0.76889825", "0.76889825", "0.7664208", "0.76570904", "0.7655856", "0.7655856", "0.76458347", "0.764...
0.0
-1
Create an instrumented HTTPRequest.
def createRequest(test, url, headers=None): request = HTTPRequest(url=url) if headers: request.headers=headers test.record(request, HTTPRequest.getHttpMethodFilter()) return request
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def request_factory(environ):\n request = Request(environ)\n _LOG.debug('trunctated request body: {b}'.format(b=request.body[:1000]))\n return request", "def make_request(self, environ, **kwargs):\n factory = self.get(abcs.ARequest)\n request = factory(environ, self, **kwargs)\n sel...
[ "0.67230546", "0.66555053", "0.6651741", "0.6575961", "0.6562261", "0.65184146", "0.6476093", "0.6465557", "0.64025205", "0.631071", "0.6229605", "0.6197536", "0.61496973", "0.6097831", "0.60914624", "0.60518444", "0.6049532", "0.6039979", "0.6020602", "0.5949816", "0.5934418...
0.7716881
0
Returns a dict of params from the ycsb_run_parameters flag.
def _GetRunParameters() -> dict[str, str]: result = {} for kv in FLAGS.ycsb_run_parameters: param, value = kv.split('=', 1) result[param] = value return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _SetRunParameters(self, params: Mapping[str, Any]) -> None:\n # Ideally YCSB should be refactored to include a function that just takes\n # commands for a run, but that will be a large refactor.\n FLAGS['ycsb_run_parameters'].unparse()\n FLAGS['ycsb_run_parameters'].parse([f'{k}={v}' for k, v in pa...
[ "0.66948956", "0.5923262", "0.58479077", "0.5789917", "0.5765965", "0.5756437", "0.5718607", "0.57155716", "0.56974375", "0.56855994", "0.56721765", "0.5669373", "0.56531686", "0.55967754", "0.55722505", "0.5561609", "0.5554578", "0.5540062", "0.5536931", "0.5535345", "0.5523...
0.87356853
0
The default number of threads to use for prepopulating the DB.
def _default_preload_threads(self): if FLAGS['ycsb_preload_threads'].present: return FLAGS.ycsb_preload_threads return DEFAULT_PRELOAD_THREADS
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setNumThreads(self, num):\r\n self.threads = num", "def setNumThreads(self, num):\r\n # implement ThreadPool interface\r\n assert not self.prepared, \"You can't change number of threads for working server\"\r\n self.threads = num", "def setNumThreads(self, num):\n # implement...
[ "0.7067771", "0.6930396", "0.68709207", "0.67615354", "0.6754983", "0.65983903", "0.64322984", "0.6348108", "0.62967575", "0.62967575", "0.6276028", "0.62652", "0.6182031", "0.6152251", "0.6095681", "0.6083724", "0.6024834", "0.59771067", "0.5969814", "0.5929784", "0.58990264...
0.6221764
12
Updates the learning rate given the learning rate decay. The routine has been implemented according to the original Lua SGD optimizer
def adjust_learning_rate(optimizer): for group in optimizer.param_groups: if 'step' not in group: group['step'] = 0. else: group['step'] += 1. group['lr'] = args.lr * ( 1.0 - float(group['step']) * float(args.batch_size) / (args.n_triplets * float(args.epochs)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_learning_rate(self) -> None:\n self.epsilon = self.initial_epsilon / (1. + self.rate_decay * self.n_it)\n return", "def update_learning_rate(self) -> None:\n self.epsilon = self.initial_epsilon / (1. + self.rate_decay * self.n_it)\n return", "def adjust_learning_rate(epoc...
[ "0.79988384", "0.79988384", "0.79249567", "0.78758794", "0.7809007", "0.7806507", "0.7762988", "0.7748166", "0.772173", "0.7702849", "0.7683031", "0.76521736", "0.7619114", "0.7617891", "0.7549729", "0.7540333", "0.7535086", "0.7533632", "0.7533569", "0.75322956", "0.75260246...
0.0
-1
This function prints and plots the confusion matrix. Normalization can be applied by setting `normalize=True`.
def plot_confusion_matrix(cmatrix, class_names, normalize=False, title='Confusion matrix', cmap=plt.cm.Blues): plt.imshow(cmatrix, interpolation='nearest', cmap=cmap) plt.title(title) plt.colorbar() tick_marks = np.arange(len(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_confusion_matrix(cm, classes=[0,1], normalize=False, title='Confusion matrix', print_matrix=False):\n\n if normalize:\n cm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis]\n print(\"Normalized confusion matrix\")\n else:\n print('Confusion matrix, without normalization')\n\n...
[ "0.8193291", "0.8094472", "0.8027684", "0.80178267", "0.799257", "0.7989883", "0.7979287", "0.7974278", "0.79594076", "0.79549026", "0.79360807", "0.79330444", "0.7932846", "0.7929725", "0.79248244", "0.7923015", "0.7922415", "0.7922163", "0.7921376", "0.79207855", "0.791628"...
0.0
-1
Generator for the color sequence. It is randomly "seeded" and then each rgb goes up or down randomly
def color(step: int=10) -> Tuple[int, int, int]: # Randomly seed the r g b values r, g, b = (random_uniform(0, 255), random_uniform(0, 255), random_uniform(0, 255)) # Randomly determine if each r g and b value is increasing or not r_inc = True g_inc = True b_inc = True r_step...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def random_color_gen():\n r = randint(0, 255)\n g = randint(0, 255)\n b = randint(0, 255)\n return [r, g, b]", "def color_cycle():\n while True:\n for color in colors:\n yield color", "def randcolor():\n return (randint(0,255), randint(0,255), randint(0,255))", "def shuffle_...
[ "0.74278164", "0.71978843", "0.7139568", "0.6939284", "0.6925582", "0.69157034", "0.6897582", "0.68463475", "0.6822519", "0.6778793", "0.6778223", "0.6738795", "0.67335933", "0.66673774", "0.65956414", "0.6593177", "0.6553693", "0.65395474", "0.6532598", "0.65268457", "0.6509...
0.73016506
1
Test getting component empty versions in range from MAJOR.MINORPATCH.
def test__get_component_version_empty(self): self._ucr({'repository/online/component/a/version': ''}) self._uri({ '%d.%d/maintained/%d.%d-%d/' % (MAJOR, MINOR, MAJOR, MINOR, PATCH): '', }) ver = U.UCS_Version((MAJOR, MINOR, 0)) # comonent.erratalevel! comp_ver = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test__get_component_version_full(self):\n self._ucr({'repository/online/component/a/version': '%d.%d-%d' % (MAJOR, MINOR, PATCH)})\n ver = self.u._get_component_versions('a', None, None)\n self.assertEqual(set((U.UCS_Version((MAJOR, MINOR, PATCH)),)), ver)", "def test__get_component_vers...
[ "0.74467665", "0.6859184", "0.65874076", "0.648513", "0.64732474", "0.64317703", "0.6412375", "0.64121705", "0.6403816", "0.6393205", "0.6385913", "0.6382778", "0.63452363", "0.6313942", "0.6247261", "0.61991024", "0.6138728", "0.6116541", "0.6090701", "0.60709894", "0.605947...
0.79130685
0
Returns whether the server is running or not
def is_alive(self): if (self._s.fileno()>0 and self._running and self._listen): return True else: return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _ServerIsRunning( self ):\n return utils.ProcessIsRunning( self._gocode_handle )", "def owserver_running():\n for proc in psutil.process_iter():\n if 'owserver' in proc.name():\n return True\n return False", "def status(self):\n # process running ?\n pid = self.get_...
[ "0.8862922", "0.79929316", "0.7974306", "0.78983366", "0.7892844", "0.7865346", "0.7791096", "0.7775764", "0.7755854", "0.7755854", "0.7755854", "0.77360624", "0.76863444", "0.76863444", "0.76343846", "0.762743", "0.762743", "0.76038724", "0.7581231", "0.75777066", "0.7576585...
0.73237807
43
Barplot of nightly sleep durations. Recommended range marked.
def analyze_sleep(self, save_plot=False, save_data=False): print("\nPlotting sleep data...") df = self.df_event.loc[self.df_event["Event"] == "Sleep"] plt.bar([df["Start"].iloc[i].day_name() for i in range(df.shape[0])], df["Durations"], color='slategrey', alpha=.75, edgecolor...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot(self):\n x = np.arange(5)\n # labels = ['temp', 'humi', 'mais', 'o2', 'co2']\n plt.bar(x - 0.35/2, self.data, 0.35, label='actual')\n plt.bar(x + 0.35/2, self.desired_values, 0.35, label='desired')\n plt.ylim(-5, 80)\n plt.legend()\n\n plt.draw()\n p...
[ "0.5930588", "0.572087", "0.5711313", "0.5601863", "0.5520968", "0.5519898", "0.55038047", "0.54938954", "0.5372862", "0.53438085", "0.5312784", "0.5302064", "0.5295697", "0.5282974", "0.5249401", "0.5238924", "0.5202922", "0.51951", "0.51938933", "0.51909465", "0.5180666", ...
0.5859894
1
write scheduling EndDate to bulk string
def field_to_csv_SchedulingEndDate(entity, id): if entity is None: return None elif entity.EndDate is None: return DELETE_VALUE if id and id > 0 else None # this case is what the suds creates by default. return None instead of a delete value elif entity.EndDate.Day is None and entity.End...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_bulk_add_end_date(self, end_date):\n global bulk_add_begin_date\n if end_date != \"\" and datetime.datetime.strptime(end_date, \"%m/%d/%Y\") > bulk_add_begin_date:\n self.set_value_into_input_field(self.bulk_add_end_date_inputbox_locator, str(end_date))\n elif end_date == \"...
[ "0.61734784", "0.5950122", "0.58844477", "0.57380843", "0.57380843", "0.5677495", "0.5643335", "0.56185144", "0.5611212", "0.5601689", "0.55821306", "0.55783683", "0.5567694", "0.5565518", "0.5539039", "0.55244225", "0.55244225", "0.55244225", "0.55244225", "0.55244225", "0.5...
0.6244539
0
Update the camera position.
def _update_camera(self, render=False): self._renderer.set_camera( # needs fix, distance moves when focal point updates distance=self._renderer.plotter.camera.distance * 0.9, focalpoint=tuple(self._ras), reset_camera=False)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self, cam=None):\n if cam is None:\n # This allows use to dynamicly select cameras\n cam = GetActiveCamera()\n self.orientation = cam.GetOrientation()\n self.position = cam.GetPosition()\n self.focus = cam.GetFocalPoint()\n self.viewup = cam.GetVi...
[ "0.744775", "0.7214561", "0.7158388", "0.71143943", "0.703741", "0.70116735", "0.7000465", "0.69939184", "0.6969257", "0.6928624", "0.6888417", "0.6848921", "0.68303734", "0.6765151", "0.6723604", "0.6699508", "0.66889185", "0.6674749", "0.6665917", "0.6646208", "0.6637829", ...
0.7423676
1
Translate a /separated PATH to the local filename syntax. Components that mean special things to the local file system (e.g. drive or directory names) are ignored. (XXX They should probably be diagnosed.)
def translate_path(self, path): # abandon query parameters path = path.split('?', 1)[0] path = path.split('#', 1)[0] # Don't forget explicit trailing slash when normalizing. Issue17324 trailing_slash = path.rstrip().endswith('/') try: path = urllib.parse.unquo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convertString(path):\n if (\"win\" in sys.platform):\n return path.replace(\"/\",\"\\\\\")\n elif (\"linux\" in sys.platform):\n return path.replace(\"\\\\\",\"/\")", "def mangle_path(path):\n # Remove assigns\n path = servers.get_file_server().manglepath( str(path) )\n # Remove ...
[ "0.69140327", "0.6811669", "0.67799675", "0.66774404", "0.66584295", "0.6638346", "0.6601214", "0.6575706", "0.65646315", "0.65374815", "0.65302485", "0.65176374", "0.65143293", "0.65139204", "0.6498907", "0.64704174", "0.6469495", "0.6452223", "0.64402705", "0.6439241", "0.6...
0.6657851
5
Generate group (e.g. C "enum" type). These are concatenated together with other types. Add the enum type name to the 'enums' dictionary, with the value being an ordered list of the enumerant names. Add each enumerant name to the 'consts' dictionary, with the value being the enum type the enumerant is part of.
def genGroup(self, groupinfo, groupName, alias): OutputGenerator.genGroup(self, groupinfo, groupName, alias) groupElem = groupinfo.elem # Add a typeCategory{} entry for the category of this type. self.addName(self.typeCategory, groupName, 'group') if alias: # Add na...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _build_enum_groups(self):\n for group in self.used_enum_groups:\n if group not in self.group_to_enum_list:\n print(f'Warning: Enum group {group} has no values defined.')\n continue\n\n group_type = 'basic'\n if group in self.bitmask_groups:\...
[ "0.67443454", "0.6126453", "0.6024333", "0.5869336", "0.5850984", "0.5827923", "0.5813711", "0.56191635", "0.5546251", "0.5536986", "0.55277187", "0.5520093", "0.5515278", "0.5471771", "0.54267377", "0.5314525", "0.52616084", "0.5180064", "0.51773727", "0.51655954", "0.515277...
0.6247051
1
Verify the property that xsorted == sorted.
def test_properties_xsorted(things, reverse): assert_property_xsorted_is_the_same_as_sorted(xsorted, things, reverse)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def assert_property_xsorted_is_the_same_as_sorted(_xsorted, things, reverse):\n expected = list(sorted(things, reverse=reverse))\n actual = list(_xsorted(things, reverse=reverse))\n assert actual == expected", "def check_sorted(self):\n last_count = np.inf\n for count in self.Nx:\n ...
[ "0.7629415", "0.70149463", "0.67318696", "0.6549031", "0.64560336", "0.6162829", "0.61335486", "0.59302354", "0.58924294", "0.5860514", "0.5851347", "0.5804417", "0.5681689", "0.56531733", "0.56327933", "0.5630003", "0.56293845", "0.55872023", "0.5585125", "0.55755395", "0.55...
0.76159215
1
Verify the property that xsorted should produce an ordered iterable.
def test_property_xsorted_produces_ordered_iterable(things, reverse): assert_property_xsorted_produces_ordered_iterable(xsorted, things, reverse)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def assert_property_xsorted_produces_ordered_iterable(_xsorted, things, reverse):\n actual = list(_xsorted(things, reverse=reverse))\n actual = reversed(actual) if reverse else actual\n assert all(a <= b for a, b in sliding_window(2, actual))", "def test_property_xsorted_custom_serializer_produces_order...
[ "0.7792605", "0.7388446", "0.70257944", "0.6780707", "0.63109887", "0.62131774", "0.6202232", "0.61454636", "0.61454636", "0.60784477", "0.6048586", "0.5940456", "0.59095055", "0.59035015", "0.5902631", "0.5871712", "0.58603173", "0.58316886", "0.5824965", "0.5819334", "0.580...
0.8188986
0
Get resource IAM Policy.
def get_iam_policy(self, resource, fields=None, verb='getIamPolicy', include_body=True, resource_field='resource', **kwargs): arguments = {resource_field: resource, 'fields': fields} if include_body: arguments['body'] = {} if kwargs: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(resource_name: str,\n id: pulumi.Input[str],\n opts: Optional[pulumi.ResourceOptions] = None,\n policy: Optional[pulumi.Input[str]] = None,\n resource_arn: Optional[pulumi.Input[str]] = None) -> 'Policy':\n opts = pulumi.ResourceOptions.merge(opts, pulumi....
[ "0.737802", "0.72027254", "0.7168323", "0.69987875", "0.6989532", "0.6989532", "0.6985019", "0.6985019", "0.69473743", "0.6858023", "0.68462265", "0.6814277", "0.6814277", "0.6814277", "0.6808341", "0.6799874", "0.6773801", "0.6753809", "0.6753809", "0.6727978", "0.66902864",...
0.6777396
16
Get Effective Org Policy for a constraint on a resource.
def get_effective_org_policy(self, resource, constraint, fields=None, verb='getEffectiveOrgPolicy', **kwargs): arguments = {'resource': resource, 'fields': fields, 'body': {'constraint': constraint}} if kwargs: arguments.update(kwargs) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_org_policy(self, resource, constraint, fields=None,\n verb='getOrgPolicy', **kwargs):\n arguments = {'resource': resource, 'fields': fields,\n 'body': {'constraint': constraint}}\n if kwargs:\n arguments.update(kwargs)\n return self....
[ "0.80968934", "0.55864364", "0.55730957", "0.5420763", "0.5420763", "0.5420763", "0.53861594", "0.53700894", "0.53700894", "0.53700894", "0.53462505", "0.5341753", "0.5341753", "0.53294295", "0.53294295", "0.5326492", "0.53021175", "0.53021175", "0.5291533", "0.5241858", "0.5...
0.8355269
0
Get Org Policy for a constraint on a resource.
def get_org_policy(self, resource, constraint, fields=None, verb='getOrgPolicy', **kwargs): arguments = {'resource': resource, 'fields': fields, 'body': {'constraint': constraint}} if kwargs: arguments.update(kwargs) return self.execute_que...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_effective_org_policy(self, resource, constraint, fields=None,\n verb='getEffectiveOrgPolicy', **kwargs):\n arguments = {'resource': resource, 'fields': fields,\n 'body': {'constraint': constraint}}\n if kwargs:\n arguments.update(...
[ "0.7961799", "0.5886614", "0.5819734", "0.5819734", "0.5779746", "0.5779746", "0.57551897", "0.57020646", "0.57005817", "0.57005817", "0.57005817", "0.5654182", "0.5603372", "0.5498181", "0.5498181", "0.5444847", "0.5444847", "0.5444847", "0.5433712", "0.5433712", "0.5394664"...
0.8525074
0
List Org Policies applied to the resource.
def list_org_policies(self, resource, fields=None, max_results=None, verb='listOrgPolicies', **kwargs): arguments = {'resource': resource, 'fields': fields, 'body': {}} if max_results: arguments['body']['pageSize'] = max_results if kwargs: argum...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_policies(self):\n return self.con.list_policies(\n Scope='Local'\n )", "def list_policies(self):\n client = self.connect(VAULT_TOKEN)\n return client.list_policies()", "def policies(self, request):\n policies = OtterPolicies(self.store, self.tenant_id, sel...
[ "0.71970636", "0.70879877", "0.66128635", "0.65661865", "0.6551817", "0.654684", "0.6342682", "0.6245317", "0.6225215", "0.60776854", "0.60655266", "0.60427415", "0.5977009", "0.5938768", "0.58819604", "0.58642495", "0.58478636", "0.58033216", "0.57905436", "0.56130326", "0.5...
0.6953806
2
Patch an existing resource.
def patch(self, resource, data, target=None, verb='patch', **kwargs): return self._modify_resource(resource, data, target, verb, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def patch(self, patch):\n if not patch:\n raise OperationOutcome('Patch data is required \\\nto patch a resource')\n if not self.id:\n raise OperationOutcome('Resource ID is required \\\nto patch a resource')\n\n self.read()\n self.resource = self.db.update({\n ...
[ "0.7661577", "0.73802227", "0.69220495", "0.6906", "0.6873507", "0.6873213", "0.6850698", "0.6842172", "0.67620045", "0.6717471", "0.6662254", "0.66605353", "0.66089517", "0.66089517", "0.66089517", "0.66027886", "0.6560444", "0.6553121", "0.6546462", "0.6542933", "0.64986235...
0.7844134
0
r"""Encodes raw boxes given centers, pix2pix_delta and anchor_wh.
def encode_boxes(format: str, centers: Tensor, pix2pix_delta: Tensor, anchor_wh: Tensor, r_boxes: Tensor, boxes2centers_mapping: Tensor, var1: float, var2: float): if boxes2centers_mapping is None:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def decode_boxes(raw_boxes, anchors):\n boxes = np.zeros_like(raw_boxes)\n\n x_center = raw_boxes[..., 0] / x_scale * anchors[:, 2] + anchors[:, 0]\n y_center = raw_boxes[..., 1] / y_scale * anchors[:, 3] + anchors[:, 1]\n\n w = raw_boxes[..., 2] / w_scale * anchors[:, 2]\n h = raw_boxes[..., 3] / h...
[ "0.7009174", "0.69290155", "0.6579339", "0.60633", "0.5699406", "0.5688749", "0.56694555", "0.5498821", "0.5497921", "0.5460848", "0.54606533", "0.5374587", "0.53254455", "0.52837175", "0.52718014", "0.52569646", "0.52452517", "0.5234323", "0.52261466", "0.52233034", "0.52230...
0.68190926
2
Get the default engines from all models Returns Dict[str, str] Default engines for all containers. If unspecified, it is not included in the return dictionary.
def get_container_default_engines() -> Dict[str, str]: default_engines = {} for id, all_engines in ALL_ALLOWED_ENGINES.items(): default_engines[id] = all_engines[0] return default_engines
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_engines_details(self):\n if not \"engines\" in self.data:\n raise ValueError(\"This recipe doesn't have engines\")\n return self.data[\"engines\"]", "def envs(self) -> Optional[Sequence['outputs.CSIPowerMaxSpecDriverCommonEnvs']]:\n return pulumi.get(self, \"envs\")", "d...
[ "0.5998883", "0.56760895", "0.56644964", "0.5658955", "0.5629387", "0.5629387", "0.55861753", "0.5564469", "0.5558145", "0.5551069", "0.5544916", "0.55386555", "0.55249786", "0.5501973", "0.5498729", "0.5489851", "0.5487371", "0.5481599", "0.5444088", "0.5371857", "0.53668284...
0.79566383
1
ignores extraneous keys from input dict on new instance creation
def from_dict(self, input): return self( **{k: v for k, v in input.items() if k in signature(self).parameters} )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_dict(cls, inp):\n return cls(**{k: v for k, v in inp.items() if k != '__class__'})", "def from_dict(self, dict_=None):\n for key in dict_:\n if hasattr(self, key):\n setattr(self, key, dict_[key])", "def __init__(self, *args, **kwargs):\n dict.__init__(se...
[ "0.7129486", "0.6526369", "0.6342124", "0.6279176", "0.62700117", "0.62422466", "0.62361705", "0.6193572", "0.61546916", "0.6115071", "0.61140865", "0.61010706", "0.61010706", "0.60888785", "0.6074075", "0.60718274", "0.6054175", "0.60502774", "0.60370326", "0.602564", "0.599...
0.63812256
2
Returns the selling price of a player
def SellingPrice(self): return self.selling_price
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getPlayerSellPrice(self, playerid):\n # Get target players IDs\n txt = open(\"./data/player_list.txt\", \"r\", encoding=\"utf8\")\n for aline in txt:\n values2 = aline.strip(\"\\n\").split(\",\")\n line_id = int(values2[7])\n inputid = int(playerid)\n ...
[ "0.7884559", "0.7532802", "0.7168616", "0.7112445", "0.7012568", "0.6928714", "0.68326706", "0.68130773", "0.68130773", "0.68130773", "0.68049467", "0.6747823", "0.67439103", "0.6719963", "0.6621075", "0.6609548", "0.65836906", "0.656851", "0.652503", "0.6511323", "0.6447306"...
0.71145046
3
Handles enemies escaping (not being killed before moving through the grid
def _handle_escape(self, enemies): for enemy in enemies: self._lives -= enemy.live_damage if self._lives < 0: self._lives = 0 #Task 1.3 (Status Bar): Update lives display here self._status_bar.set_lives(self._lives) #Handle game over if s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def moveEnnemy(self):\n for i,ennemy in enumerate(self.ennemies):\n\n r = random.uniform(0,1)\n if r > 0.2 : \n if (self.ennemyText != None) and (self.PAS !=None) and (self.can!=None):\n ennemy.strategy( self, self.ennemyText[i], self.PAS, self.can)\n ...
[ "0.64112216", "0.63977736", "0.6351522", "0.63048184", "0.62286985", "0.6213931", "0.61666626", "0.6138728", "0.61089534", "0.6095456", "0.6091025", "0.6075746", "0.6035971", "0.5959755", "0.5867931", "0.584102", "0.5802222", "0.57955927", "0.5775505", "0.5756822", "0.5751632...
0.7476436
0