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
Sets the checked/unchecked state of the children of a tree item.
def SetCheckedStateOfChildren(self, listOfCheckedItems, item): for child in self.GetItemChildren(item): self.SetCheckedStateOfItem(listOfCheckedItems, child)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SetSelectedStateOfChildren(self, listOfSelectedItems, item):\n \n for child in self.GetItemChildren(item):\n self.SetSelectedStateOfItem(listOfSelectedItems, child)", "def CheckChilds(self, item, checked=True):\r\n \r\n if checked == None:\r\n self.AutoToggle...
[ "0.73173887", "0.72169894", "0.6836318", "0.66166", "0.6586724", "0.65155035", "0.6477054", "0.64115", "0.63327813", "0.63307124", "0.60148406", "0.594206", "0.59199715", "0.58798754", "0.5870558", "0.5833745", "0.58151853", "0.5798902", "0.57454646", "0.56009513", "0.5600951...
0.81554604
0
Set the Ship Owner of this Quad
def setMyParent(self, parentObject): self.myParent = parentObject self.myParent.quads[self.position] = self self.componentdata = parentObject.componentdata self.weapondata = parentObject.weapondata
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_owner(self, owner):\n self.__owner = owner", "def owner(self, owner):\n self._owner = owner", "def owner(self, owner):\n self._owner = owner", "def owner(self, owner):\n self._owner = owner", "def owner(self, owner):\n self._owner = owner", "def owner(self, owne...
[ "0.6835452", "0.67651963", "0.67651963", "0.67651963", "0.67651963", "0.66914684", "0.66914684", "0.66914684", "0.66914684", "0.6640752", "0.6418523", "0.6321477", "0.6234106", "0.61024404", "0.6061449", "0.5995614", "0.5858056", "0.5851031", "0.5741675", "0.5733803", "0.5647...
0.519085
38
The name of the configuration set.
def configuration_set_name(self) -> pulumi.Input[str]: return pulumi.get(self, "configuration_set_name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def configuration_set_name(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"configuration_set_name\")", "def configuration_set_name(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"configuration_set_name\")", "def name(self):\n return self._config_name", "def get...
[ "0.8910209", "0.85829633", "0.7802888", "0.7365852", "0.73557913", "0.7333008", "0.7228877", "0.72088414", "0.7096429", "0.6935156", "0.69316447", "0.69316447", "0.6804298", "0.6754559", "0.67136407", "0.66942495", "0.6688351", "0.6658619", "0.6658619", "0.6658619", "0.665105...
0.880789
1
A name that identifies the event destination within the configuration set.
def event_destination(self) -> pulumi.Input['ConfigurationSetEventDestinationEventDestinationArgs']: return pulumi.get(self, "event_destination")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def event_destination_name(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"event_destination_name\")", "def event_destination_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"event_destination_name\")", "def event_destination_name(self) -> Optional[pulumi.Input[str]]:\n ...
[ "0.8263369", "0.82504237", "0.8039402", "0.76257306", "0.74403447", "0.7154166", "0.69462", "0.6930064", "0.66381353", "0.6472814", "0.63445413", "0.630597", "0.62732506", "0.6145758", "0.611841", "0.61132693", "0.6087415", "0.6078008", "0.6078008", "0.60750127", "0.6074293",...
0.7469099
4
The name of the configuration set.
def configuration_set_name(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "configuration_set_name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def configuration_set_name(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"configuration_set_name\")", "def configuration_set_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"configuration_set_name\")", "def name(self):\n return self._config_name", "def get_config_na...
[ "0.8910209", "0.880789", "0.7802888", "0.7365852", "0.73557913", "0.7333008", "0.7228877", "0.72088414", "0.7096429", "0.6935156", "0.69316447", "0.69316447", "0.6804298", "0.6754559", "0.67136407", "0.66942495", "0.6688351", "0.6658619", "0.6658619", "0.6658619", "0.6651058"...
0.85829633
2
A name that identifies the event destination within the configuration set.
def event_destination(self) -> Optional[pulumi.Input['ConfigurationSetEventDestinationEventDestinationArgs']]: return pulumi.get(self, "event_destination")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def event_destination_name(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"event_destination_name\")", "def event_destination_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"event_destination_name\")", "def event_destination_name(self) -> Optional[pulumi.Input[str]]:\n ...
[ "0.8263369", "0.82504237", "0.8039402", "0.76257306", "0.7469099", "0.74403447", "0.69462", "0.6930064", "0.66381353", "0.6472814", "0.63445413", "0.630597", "0.62732506", "0.6145758", "0.611841", "0.61132693", "0.6087415", "0.6078008", "0.6078008", "0.60750127", "0.6074293",...
0.7154166
6
The name of the configuration set.
def configuration_set_name(self) -> pulumi.Output[str]: return pulumi.get(self, "configuration_set_name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def configuration_set_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"configuration_set_name\")", "def configuration_set_name(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"configuration_set_name\")", "def name(self):\n return self._config_name", "def get_...
[ "0.880789", "0.85829633", "0.7802888", "0.7365852", "0.73557913", "0.7333008", "0.7228877", "0.72088414", "0.7096429", "0.6935156", "0.69316447", "0.69316447", "0.6804298", "0.6754559", "0.67136407", "0.66942495", "0.6688351", "0.6658619", "0.6658619", "0.6658619", "0.6651058...
0.8910209
0
A name that identifies the event destination within the configuration set.
def event_destination(self) -> pulumi.Output['outputs.ConfigurationSetEventDestinationEventDestination']: return pulumi.get(self, "event_destination")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def event_destination_name(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"event_destination_name\")", "def event_destination_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"event_destination_name\")", "def event_destination_name(self) -> Optional[pulumi.Input[str]]:\n ...
[ "0.8263369", "0.82504237", "0.8039402", "0.7469099", "0.74403447", "0.7154166", "0.69462", "0.6930064", "0.66381353", "0.6472814", "0.63445413", "0.630597", "0.62732506", "0.6145758", "0.611841", "0.61132693", "0.6087415", "0.6078008", "0.6078008", "0.60750127", "0.6074293", ...
0.76257306
3
(Computed) The etag of the IAM policy.
def etag(self) -> str: return pulumi.get(self, "etag")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def etag(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"etag\")", "def etag(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"etag\")", "def etag(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"etag\")", "def etag(self) -> pulumi.Output[str]:\n return pul...
[ "0.70685273", "0.70685273", "0.70685273", "0.70685273", "0.70685273", "0.70685273", "0.70685273", "0.6968657", "0.69270116", "0.69270116", "0.69270116", "0.69270116", "0.69270116", "0.69270116", "0.69270116", "0.69270116", "0.69270116", "0.69270116", "0.69270116", "0.69270116",...
0.7101842
8
String for representing the Model object.
def __str__(self): return self.title
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n return super().__str__() + self.model.__str__()", "def __str__(self):\n return \"DataModel(name={},attributes={},description={})\".format(\n self.name, {a.name: str(a) for a in self.attributes}, self.description\n )", "def __str__(self):\n \n res =...
[ "0.82368803", "0.79901737", "0.7849152", "0.78468513", "0.77520275", "0.7625378", "0.7625378", "0.76225406", "0.76225406", "0.75483394", "0.7522958", "0.7470355", "0.7469358", "0.7447144", "0.7447144", "0.74314755", "0.7427648", "0.7389925", "0.7351721", "0.73424315", "0.7322...
0.0
-1
String for representing the Model object.
def __str__(self): return self.name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n return super().__str__() + self.model.__str__()", "def __str__(self):\n return \"DataModel(name={},attributes={},description={})\".format(\n self.name, {a.name: str(a) for a in self.attributes}, self.description\n )", "def __str__(self):\n \n res =...
[ "0.82368803", "0.79901737", "0.7849152", "0.78468513", "0.77520275", "0.7625378", "0.7625378", "0.76225406", "0.76225406", "0.75483394", "0.7522958", "0.7470355", "0.7469358", "0.7447144", "0.7447144", "0.74314755", "0.7427648", "0.7389925", "0.7351721", "0.73424315", "0.7322...
0.0
-1
Tests that simple access requires a token.
def testUnauthorizedAccessToFileOnClientIsForbidden(self): self.InitDefaultRouter() client_id = self.SetupClient(0) gui_test_lib.CreateFileVersion(client_id, "fs/os/foo") with self.assertRaises(grr_api_errors.AccessForbiddenError): self.api.Client(client_id).File("fs/os/foo").Get()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_read_o_auth_access_token(self):\n pass", "def testGetToken(self):\n # Token is base64 for a json object so always starts with '{\"'\n self.assertTrue(self.dl_object._access_token.startswith('eyJ'))\n self.assertTrue(len(self.dl_object._access_token) > 100)", "def test_access_methods_wi...
[ "0.7931275", "0.7710786", "0.77031296", "0.7615416", "0.7523442", "0.751906", "0.7434372", "0.7433878", "0.7424138", "0.7410044", "0.7332715", "0.7289276", "0.72307616", "0.71959084", "0.71902514", "0.7182109", "0.71210825", "0.71069574", "0.70853394", "0.7048243", "0.7031311...
0.0
-1
Tests that approvals expire after the correct time.
def testExpiredClientApprovalIsNoLongerValid(self): self.InitDefaultRouter() client_id = self.SetupClient(0) gui_test_lib.CreateFileVersion(client_id, "fs/os/foo") with self.assertRaises(grr_api_errors.AccessForbiddenError): self.api.Client(client_id).File("fs/os/foo").Get() with test_lib.F...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_expires_soon(self):\n now = timezone.now()\n window = SparkSettings().RENEW_TOKEN_WINDOW\n cur = self.factory.build(access_token='good',\n expires_at=now + timedelta(seconds=window*2))\n exp = self.factory.build(access_token='expired',\n expires_at=now + t...
[ "0.7203524", "0.7159588", "0.70902795", "0.7089715", "0.69811314", "0.68542427", "0.6820232", "0.6708429", "0.6702992", "0.66801137", "0.66715074", "0.6653379", "0.6466156", "0.6451609", "0.6439351", "0.6437387", "0.64192605", "0.63950616", "0.6382209", "0.6356465", "0.635484...
0.71320534
2
return a string representing this object
def __repr__(self): # this is a good default __repr__ # Q: using the docs, can you figure out what this is doing? return f"<{type(self).__name__} {self.__dict__}>"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__ (self) :\n\n return self.as_string()", "def __repr__(self):\n return str(self)", "def __repr__(self):\n return str(self)", "def __repr__(self):\n return str(self)", "def __repr__(self):\n return str(self)", "def __repr__(self):\n return str(self)", ...
[ "0.8510828", "0.84726125", "0.84726125", "0.84726125", "0.84726125", "0.84726125", "0.84726125", "0.84726125", "0.84726125", "0.84726125", "0.84726125", "0.84726125", "0.84726125", "0.84726125", "0.8464401", "0.84606725", "0.84316343", "0.84300405", "0.8419478", "0.8419478", ...
0.0
-1
hash the provided password and set self.password_hash
def set_password_hash(self, password): salt = bcrypt.gensalt() self.password_hash = bcrypt.hashpw(password.encode(), salt)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hash_password(self):\n self.__password = self.str_to_hash(self.__password)", "def hash_password(self, password):\n self.password_hash = generate_password_hash(password)", "def set_password(self, password):\n self.password = self.hash_password(password)", "def hash_password(self, pass...
[ "0.8723812", "0.86521083", "0.86092335", "0.85274905", "0.84198093", "0.82918906", "0.82479346", "0.82479346", "0.82479346", "0.82479346", "0.8236781", "0.82104796", "0.82104796", "0.81923914", "0.81917083", "0.81225497", "0.8080998", "0.8021112", "0.793211", "0.79010475", "0...
0.853884
3
return all Position objects for this account with more than 0 shares
def get_positions(self): return position.Position.all_from_account_id(self.id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_correct_num_of_shares(shares):\n threshold = shares[0].threshold\n if len(shares) < threshold:\n raise('Not enough shares for decryption.')\n used_shares = [sk_share for sk_share in shares]\n # remove unnecessary shares\n while len(used_shares) > threshold:\n # remove share at ...
[ "0.59139705", "0.5637877", "0.5280492", "0.5276354", "0.51688695", "0.5093513", "0.5040374", "0.5031822", "0.50188726", "0.5008782", "0.49739394", "0.49165553", "0.4871361", "0.48378354", "0.48261538", "0.48054984", "0.47926098", "0.4760593", "0.47586232", "0.4732225", "0.469...
0.46772397
23
initialize the battery's attributes
def __init__(self, battery_size=70): self.battery_size = battery_size
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, battery_size=40):\n self.battery_size = battery_size", "def __init__(self, battery_size=70):\n self.battery_size = battery_size", "def __init__(self, battery_size=70):\n self.battery_size = battery_size", "def __init__(self, battery_size=70):\n self.battery_size...
[ "0.76310897", "0.76158583", "0.76158583", "0.76158583", "0.7584304", "0.7584304", "0.75580996", "0.7540261", "0.7479749", "0.7460258", "0.735473", "0.73212236", "0.7293355", "0.7260459", "0.72088206", "0.71193594", "0.71193594", "0.71193594", "0.71193594", "0.71193594", "0.71...
0.7669085
0
__init__(tile_type, game_type, game_space, Agent) > Reflex Initialises a new Reflex agent, inheriting from a generic Agent.
def __init__(self, affinity, game_type, game_space, opponent=None): super().__init__(affinity, game_type, game_space, opponent)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, base_platform, initial_position=None, name=None, allow_overlapping=True, noise_params=None):\n\n if name is None:\n self.name = 'agent_' + str(Agent.index_agent)\n else:\n self.name = name\n Agent.index_agent += 1\n\n # List of sensors\n s...
[ "0.68921715", "0.6879977", "0.68383086", "0.6796828", "0.6792382", "0.67592674", "0.67589533", "0.6745503", "0.6706992", "0.66781443", "0.66418463", "0.6604935", "0.65024406", "0.6384273", "0.63555324", "0.6350442", "0.6335785", "0.63009346", "0.6290726", "0.6258549", "0.6251...
0.68385494
2
Resolve left operand in subexpression.
def _lval(self, s): if s.lower() in self.parent.outputs: return self.parent.outputs[s.lower()] else: # expression return s.lower()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def left(self) -> Optional[\"ExpressionNode\"]:\n return self.__left", "def addExpr( ):\n\n\ttok = tokens.peek( )\n\tif debug: print (\"addExpr: \", tok)\n\tleft = term( )\n\ttok = tokens.peek( )\n\twhile tok == \"+\" or tok == \"-\":\n\t\ttokens.next()\n\t\tright = term( )\n\t\tleft = BinaryExpr( tok, le...
[ "0.62021726", "0.6197385", "0.60339504", "0.60174084", "0.59202105", "0.5869374", "0.57857025", "0.57029897", "0.5678913", "0.5641529", "0.563485", "0.5630309", "0.56296515", "0.56226456", "0.56117874", "0.5588001", "0.55770975", "0.5566259", "0.5561129", "0.5545932", "0.5533...
0.5594608
15
Returns dict (keyed on development type key, values are lists of operable ages).
def operable_dtypes(self, acode, period, mask=None): result = {} dtype_keys = self.unmask(mask) if mask else list(self.dtypes.keys()) for dtk in dtype_keys: dt = self.dtypes[dtk] operable_ages = dt.operable_ages(acode, period) if operable_ages: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_age_fields():\n under_18_fields = CensusFields.get_under_18_fields()\n\n age_18_to_29_fields = [ \n 'B01001_007E', # Male:!!18 and 19 years\n 'B01001_008E', # Male:!!20 years\n 'B01001_009E', # Male:!!21 years\n 'B010...
[ "0.55362785", "0.5372546", "0.51961905", "0.5175087", "0.5160347", "0.51452124", "0.5137768", "0.51104254", "0.51014876", "0.50635105", "0.50098515", "0.49963596", "0.49943766", "0.49836385", "0.4972278", "0.49589777", "0.495749", "0.49408603", "0.4924057", "0.49073407", "0.4...
0.5507808
1
get_terminating_ray returns the origin of any ray terminating at the square
def get_terminating_ray(self): return self._terminating_ray
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_originating_ray(self):\n return self._originating_ray", "def ray(self):\n return self._ray", "def shoot_ray(self, origin_row, origin_column):\n\n # get the the square object at row x column\n origin = self._board.get_board_square((origin_row, origin_column))\n\n # check t...
[ "0.7080093", "0.6689031", "0.60737425", "0.60132277", "0.59275526", "0.5894822", "0.58169794", "0.57478637", "0.5603203", "0.5527192", "0.5496069", "0.5477859", "0.5449312", "0.5435432", "0.5428692", "0.54256403", "0.5361024", "0.5361024", "0.5336261", "0.53320104", "0.526836...
0.8000595
0
Representation of this atom
def __repr__(self): x, y, z = self.coord return f'Atom({self.label}, {x:.4f}, {y:.4f}, {z:.4f})'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __repr__(self):\n return (\n f\"<Element: {self.name}, symbol: {self.symbol}, \"\n f\"atomic number: {self.atomic_number}, mass: {self.mass.to('amu')}>\"\n )", "def __repr__(self):\r\n return self.value", "def Atom(self):\n return \" \".join(\n m...
[ "0.71923965", "0.67156804", "0.6698402", "0.6670874", "0.65765846", "0.6566061", "0.6566061", "0.6562762", "0.65519303", "0.65519303", "0.65503716", "0.6529385", "0.6522417", "0.64952725", "0.64952725", "0.64952725", "0.64952725", "0.64952725", "0.64952725", "0.64952725", "0....
0.7215674
0
The maximum/maximal valance that this atom supports in any charge state (most commonly). i.e. for H the maximal_valance=1. Useful for generating molecular graphs
def maximal_valance(self) -> int: max_valances = {'H': 1, 'B': 4, 'C': 4, 'N': 4, 'O': 3, 'F': 1, 'Si': 4, 'P': 6, 'S': 6, 'Cl': 4, 'Br': 4, 'I': 6} if self.label in max_valances: return max_valances[self.label] else: logger.warning(f'Could not f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _maximum(self) -> float:\n if self._type == \"power\":\n return 5.0\n elif self._type == \"setpoint\":\n return self._product.get_data_config_json()[\"_value_setpoint_max\"]\n elif self._type == \"fan1\":\n fan = 1\n return self._product.get_data...
[ "0.7010324", "0.69215894", "0.6906343", "0.6823443", "0.6792038", "0.6761789", "0.6748865", "0.674552", "0.6688681", "0.6652332", "0.6634773", "0.65999526", "0.65732384", "0.65634406", "0.65634406", "0.65627587", "0.6547573", "0.6527057", "0.65153474", "0.64900184", "0.648273...
0.7687195
0
Normalised vector from atom i to atom j
def nvector(self, i: int, j: int) -> np.ndarray: vec = self.vector(i, j) return vec / np.linalg.norm(vec)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vector(self,\n i: int,\n j: int) -> np.ndarray:\n return self[j].coord - self[i].coord", "def unit_vectors(x):\n xnew = x.copy()\n for v in range(x.shape[-1]):\n xnew[:, v] = x[:, v] / np.linalg.norm(x[:, v])\n return xnew", "def vectorize(self):\n ...
[ "0.676285", "0.6376572", "0.63570833", "0.618427", "0.61584485", "0.6132474", "0.5991627", "0.5951488", "0.59386784", "0.5891915", "0.5863619", "0.58608013", "0.5859907", "0.58586115", "0.58493614", "0.5848583", "0.5836466", "0.58242536", "0.58045954", "0.5796056", "0.5793173...
0.7287087
0
Collection of atoms, used as a a base class for a species, complex or transition state.
def __init__(self, atoms: Union[List[Atom], Atoms, None] = None): self._atoms = Atoms(atoms) if atoms is not None else None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def atoms(self):\n return self._atoms", "def iter_atoms(self):\n return iter(self.atom_list)", "def _get_atoms(self):\n atoms = []\n invarioms = []\n\n for molecule in self.values():\n atoms += [atom for atom in molecule.atoms]\n invarioms += [atom for a...
[ "0.7527363", "0.7064351", "0.702624", "0.69916254", "0.68965644", "0.6874297", "0.68078953", "0.67688465", "0.6758558", "0.66827804", "0.66418207", "0.65138113", "0.6501275", "0.64921", "0.64894027", "0.6449227", "0.6405515", "0.6311899", "0.62970304", "0.62578714", "0.615497...
0.6684028
9
Collection of transition metals (TMs) of a defined row. e.g. row = 1 > [Sc, Ti .. Zn]
def transition_metals(cls, row: int): if row < 1 or row > 3: raise ValueError('Not a valid row of TMs. Must be 1-3') tms = [elem for elem in cls.period(row+3) if elem in metals] return np.array(tms, dtype=str)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_transitions(self):\n transitions = []\n for row in self.states:\n t_row = []\n for column in self.states:\n t_row.append([row, column])\n transitions.append(t_row)\n return sorted(transitions)", "def get_LT_TM_trafo(self, row):\r\n ...
[ "0.5867413", "0.5703003", "0.5661736", "0.5545012", "0.5463264", "0.5419989", "0.5371257", "0.5360374", "0.5352698", "0.5328747", "0.5320186", "0.52640486", "0.52626085", "0.52588475", "0.52345514", "0.51489663", "0.5132497", "0.51284224", "0.51244444", "0.5119824", "0.511689...
0.816652
0
This function prints and plots the confusion matrix. Normalization can be applied by setting `normalize=True`.
def ImagePlotConfusionMatrix(cm, classes, title, normalize=False, cmap=plt.cm.Blues): plt.imshow(cm, interpolation='nearest', cmap=cmap) plt.title(title); plt.colorbar(); tick_marks = np.arange(len(classes)) plt.xticks(tick_marks, classes, rotation=45); plt.yticks(tick_marks, classes) fmt = '.2f' if no...
{ "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.8194862", "0.80949175", "0.8029915", "0.8019153", "0.79941195", "0.7991258", "0.7980955", "0.7976606", "0.79610753", "0.79590565", "0.79378676", "0.7934962", "0.7934504", "0.79313844", "0.7926313", "0.7924577", "0.79241234", "0.7923211", "0.7923023", "0.7921931", "0.791787...
0.0
-1
concatenate the string's in the given list, and returns the outcome.
def concat_list(str_lst): concatenation = '' if len(str_lst) != 0: for string in str_lst: concatenation = concatenation + string return concatenation
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def concat_strings(l_strings):\n if l_strings == []:\n return \"\"\n else: \n return l_strings[0] + \" \" + concat_strings(l_strings[1:])", "def brcadd(*args):\n \n #Find the list use a mask list.\n bargs=[isinstance(i,list) for i in args]\n \n #If all the elements are strings, ju...
[ "0.7216159", "0.6816362", "0.67876273", "0.67103904", "0.66851467", "0.6569269", "0.65227413", "0.6456808", "0.64212155", "0.6402938", "0.6359079", "0.6316838", "0.6306734", "0.61430025", "0.61308765", "0.611649", "0.60747725", "0.60667586", "0.6051911", "0.5993869", "0.59896...
0.7505594
0
sums all nums in the given list and returns their average in floating point (automatic on python 3), or None if the list is empty.
def average(num_list): nums_average = None nums_sum = 0 if len(num_list) != 0: for num in num_list: nums_sum = nums_sum + num nums_average = nums_sum / len(num_list) # average formula return nums_average
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_mean(lst):\n if len(lst) == 0:\n return None\n else:\n return float(sum(lst)) / len(lst)", "def average(l: List[float]) -> float:\n n = len(l)\n if n == 0:\n return 0\n return sum(l) / n", "def avg(lst: list):\n return sum(lst) / len(lst)", "def avg(list):\n ...
[ "0.8146937", "0.7942896", "0.773932", "0.77236325", "0.7709891", "0.76922756", "0.76788384", "0.76459634", "0.76405627", "0.75916183", "0.75477797", "0.7547326", "0.7471042", "0.7460745", "0.7456209", "0.7401513", "0.7401358", "0.7380244", "0.7363007", "0.73581374", "0.734070...
0.82661366
0
This is the crawlera session id which is returned by XCrawleraSession. Reusing the same crawlera session during the lifetime of this object may be useful, depending on your need.
def session_id(self): return self.browser.crawlera_session
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def session_id(self) -> str:\n return self._session_id", "def getSessionId(self):\n return self.sessionid", "def get_session_id(self):\n raise NotImplementedError()", "def get_session_id(self):\n return self.request_data['id']", "def getSessionId(self) -> int:\n return se...
[ "0.782119", "0.7630992", "0.7615945", "0.75861216", "0.72639245", "0.7248221", "0.6786882", "0.678265", "0.6763565", "0.672225", "0.6709095", "0.6673809", "0.6530494", "0.6527707", "0.6376892", "0.6314992", "0.62261325", "0.62242943", "0.62242943", "0.62242943", "0.62242943",...
0.8870526
0
Return the data underlying this trace
def image(self): return self.__getattr__("image", _returnType="value", _location="remote")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def data(self):\n return self.d", "def data(self):\n return self.__data", "def data(self):\n return self.__data", "def data(self):\n return self.__data", "def data(self):\n return self.__data", "def data(self):\n return self.__data", "def data(self):\n r...
[ "0.7650205", "0.75070775", "0.75070775", "0.75070775", "0.75070775", "0.75070775", "0.75070775", "0.75070775", "0.75070775", "0.75070775", "0.74896777", "0.74407494", "0.74407494", "0.74407494", "0.7408972", "0.7408972", "0.7408972", "0.7408972", "0.7408972", "0.7408972", "0....
0.0
-1
Return the data underlying this trace
def data(self): return self.image
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def data(self):\n return self.d", "def data(self):\n return self.__data", "def data(self):\n return self.__data", "def data(self):\n return self.__data", "def data(self):\n return self.__data", "def data(self):\n return self.__data", "def data(self):\n r...
[ "0.7650205", "0.75070775", "0.75070775", "0.75070775", "0.75070775", "0.75070775", "0.75070775", "0.75070775", "0.75070775", "0.75070775", "0.74896777", "0.74407494", "0.74407494", "0.74407494", "0.7408972", "0.7408972", "0.7408972", "0.7408972", "0.7408972", "0.7408972", "0....
0.0
-1
Initialises Softmax classifier with initializing weights, alpha(learning rate), number of epochs and regularization constant.
def __init__(self, x): self.W = np.zeros((x+1,10)) self.alpha = 0.00000001 self.epochs = 100 self.reg_const = 0.01
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, num_units, is_training_tensor, max_bn_steps, initial_scale=0.1, activation=tf.tanh, decay=0.95):\n self._num_units = num_units\n self._training = is_training_tensor\n self._max_bn_steps = max_bn_steps\n self._activation = activation\n self._decay = decay\n ...
[ "0.6644851", "0.6414828", "0.63587457", "0.6337567", "0.63242733", "0.6252566", "0.6241615", "0.61823297", "0.61708033", "0.614216", "0.61133695", "0.60957694", "0.6094254", "0.605736", "0.6056336", "0.60473716", "0.60377324", "0.602702", "0.6023805", "0.6007582", "0.60056305...
0.0
-1
Transform a Game object into JSON.
def game_to_json(game): return json.dumps(encode(game), sort_keys=True, indent=None)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_json(self):\r\n\r\n object_json = dict()\r\n object_json[\"Type\"] = self.__class__.__name__\r\n game_json = dict()\r\n game_json[\"x_dist\"] = self.x_dist\r\n game_json[\"y_dist\"] = self.y_dist\r\n game_json[\"turn_number\"] = self.turn_number\r\n game_json[\"max_turns\"] = self.max_t...
[ "0.8218906", "0.689022", "0.67576677", "0.66327727", "0.659543", "0.651706", "0.651706", "0.63629264", "0.6226575", "0.62217385", "0.61337006", "0.6129566", "0.6126686", "0.61172396", "0.61062807", "0.6105073", "0.60903734", "0.60819376", "0.60679865", "0.6067136", "0.6053544...
0.81920624
1
Tests for successful fetch of user details
def test_fetch_user(self): self.register_user() self.assertEqual(self.fetch_user_details().status_code, 200) self.assertTrue(self.fetch_user_details( ).json["data"][0]["username"] == 'Bjorn')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_retrive_user(self):\n res = self.client.get(ME_URL)\n\n self.assertEqual(res.status_code, status.HTTP_200_OK)\n self.assertEqual(res.data['email'], self.user.email)\n self.assertEqual(res.data['name'], self.user.name)\n self.assertNotIn('password', res.data)", "def tes...
[ "0.7265743", "0.7263957", "0.7238713", "0.72018176", "0.7172804", "0.7141861", "0.7141622", "0.71234095", "0.70722234", "0.6969097", "0.6912244", "0.689363", "0.6856903", "0.68492436", "0.68488216", "0.67698485", "0.6769589", "0.67637604", "0.6760221", "0.6758316", "0.6752664...
0.82008743
0
function to write data frame to output path in csv format
def write_df_to_csv(output_df,file_path): output_df\ .coalesce(1)\ .write\ .format("csv")\ .option("header","true")\ .mode("overwrite")\ .save(file_path)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def export_csv(self, outpath):\n\n\t\tself.df.to_csv(outpath)", "def write_tocsv(file_name, dataframe) :\n print(\"\\nSaved result to {}\\n\".format(file_name))\n dataframe.to_csv(file_name, mode='a', header=False,index=False)", "def write_csv(df: pd.DataFrame, outpath) -> None:\n logging.info('Writin...
[ "0.7855553", "0.78537613", "0.7837353", "0.7741046", "0.75917834", "0.75553155", "0.7541798", "0.74970007", "0.74893373", "0.7447898", "0.74433726", "0.74422675", "0.7428777", "0.73904103", "0.7386684", "0.7379027", "0.73772454", "0.73599726", "0.7357234", "0.7354454", "0.732...
0.8036679
0
Set the xmax for the mapping.
def set_xmax(self, xmax): self.__xmax = xmax
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def xmax(self, xmax):\n\n self._xmax = xmax", "def xmax(self):\n return self.bbox[1][0]", "def xmax(self, destination):\n self.move(destination=(destination, 0), origin=self.bbox[1], axis=\"x\")", "def xmax(self):\n return asarray([b[1] for b in self.bounds])", "def _setBound(se...
[ "0.84297174", "0.7287082", "0.7274528", "0.68572927", "0.6426226", "0.62207067", "0.62118715", "0.61695695", "0.61545426", "0.6103323", "0.60710305", "0.60276586", "0.59652644", "0.5898234", "0.58467394", "0.5786875", "0.576071", "0.5755433", "0.57478565", "0.5699613", "0.566...
0.8266433
1
Get the xmin of the mapping.
def get_xmin(self): return self.__xmin
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def xmin(self):\n return self.bbox[0][0]", "def xmin(self):\n return asarray([b[0] for b in self.bounds])", "def minX(self):\n self._updateExtents()\n return self._mMinX", "def minX(self):\n return min(self.getx())", "def min(self):\n return self._min_coords", "d...
[ "0.83678037", "0.7899679", "0.7388378", "0.73382795", "0.73255056", "0.7257165", "0.71720254", "0.7110704", "0.708758", "0.6859429", "0.67958695", "0.6657579", "0.6656625", "0.66109127", "0.65634185", "0.64638853", "0.643652", "0.64289904", "0.6412782", "0.63891435", "0.63891...
0.8122791
1
Get the xmax of the mapping.
def get_xmax(self): return self.__xmax
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def xmax(self):\n return self.bbox[1][0]", "def xmax(self):\n return asarray([b[1] for b in self.bounds])", "def ymax(self):\n return self.bbox[1][1]", "def xmax(self, xmax):\n\n self._xmax = xmax", "def xmax(self, destination):\n self.move(destination=(destination, 0), o...
[ "0.8722712", "0.8309856", "0.6940286", "0.67277294", "0.65531194", "0.6509462", "0.64930844", "0.63631415", "0.6342316", "0.63335687", "0.6330213", "0.6296123", "0.6273828", "0.6262961", "0.6262591", "0.625957", "0.62308747", "0.6230092", "0.621522", "0.6195921", "0.6179624",...
0.7632487
2
Get the ymin of the mapping.
def get_ymin(self): return self.__ymin
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ymin(self):\n return self.bbox[0][1]", "def ymax(self):\n return self.bbox[1][1]", "def xmax(self):\n return self.bbox[1][0]", "def ymin(self, ymin):\n\n self._ymin = ymin", "def ymin(self, destination):\n self.move(destination=(0, destination), origin=self.bbox[0], a...
[ "0.8741283", "0.71017414", "0.6655721", "0.66541207", "0.66170704", "0.65841466", "0.62649477", "0.62310493", "0.6072929", "0.6013632", "0.60135776", "0.59821725", "0.59467", "0.59035945", "0.58949155", "0.58858633", "0.5879028", "0.58733577", "0.5852738", "0.58307093", "0.58...
0.8153747
1
Get the ymax of the mapping.
def get_ymax(self): return self.__ymax
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ymax(self):\n return self.bbox[1][1]", "def ymax(self, ymax):\n\n self._ymax = ymax", "def get_ymin(self):\n return self.__ymin", "def maxY(self):\n return max(self.gety())", "def get_y_max(self):\n if len(self._statDict) == 0:\n return -1E10\n\n lin...
[ "0.86830366", "0.69359404", "0.68736345", "0.68600047", "0.6859924", "0.6851752", "0.6827102", "0.6717167", "0.66788393", "0.65750885", "0.65327144", "0.64925885", "0.6480698", "0.6446625", "0.64244026", "0.64226824", "0.6334915", "0.6293351", "0.62724763", "0.6239155", "0.61...
0.81109774
1
Map a tkinter j coordinate to a y coordinate in math scale.
def get_y(self, j): scale = (self.__ymin - self.__ymax) / (self.__height - 1) return scale * j + self.__ymax
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def toTk(self,y):\r\n if y == maxValue: return 0\r\n tk_y = Size\r\n if y != minValue:\r\n tk_y -= y\r\n return tk_y", "def _scale_coordinate(self, x, y, scale_factor):\n\n return (x * scale_factor, y * scale_factor)", "def yscale(value):\n impl.yscale(**locals(...
[ "0.6494457", "0.61208355", "0.6013286", "0.5936811", "0.5932429", "0.5888345", "0.57732797", "0.577191", "0.5771299", "0.57565564", "0.5745768", "0.57041335", "0.5702418", "0.5664975", "0.56192434", "0.5598867", "0.55813575", "0.556827", "0.55515087", "0.55374634", "0.5533767...
0.6374429
1
Map a math scale y coordinate to tkinter j coordinate.
def get_j(self, y): return (y - self.__ymax) * (self.__height - 1) // (self.__ymin - self.__ymax)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_y(self, j):\n scale = (self.__ymin - self.__ymax) / (self.__height - 1)\n return scale * j + self.__ymax", "def yscale(value):\n impl.yscale(**locals())", "def toTk(self,y):\r\n if y == maxValue: return 0\r\n tk_y = Size\r\n if y != minValue:\r\n tk_y -=...
[ "0.65687793", "0.6483673", "0.6181863", "0.6141863", "0.5983791", "0.5888928", "0.58153594", "0.58034164", "0.5784685", "0.5649464", "0.56263924", "0.55964434", "0.55508566", "0.55260444", "0.55256146", "0.55256146", "0.55248684", "0.55221975", "0.5509889", "0.5509817", "0.54...
0.57989603
8
Creates particles of type 'type' (1,2, ...) using style 'style' (box or region or single or random)
def createParticles(self, type, style, *args): if not self.rank: logging.info('Creating particles {} with args'.format(type) + (' {}' * len(args)).format(*args)) self.lmp.command('create_atoms {} {}'.format(type, style) + (' {}' * len(args)).format(*args))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def addParticles( screen, number, color ):\n\t\n\tparticles = []\n\t\n\tfor i in range( number ):\n\t\n\t\tradius = 5\n\t\tmass = 1\n\t\t\n\t\t#random position and velocity\n\t\tx, y = randint(-WINDOW_X + radius, 1), randint(-WINDOW_Y + radius, WINDOW_Y - radius)\n\t\tvx, vy = randrange(-1, 2, 2) * 100, randrange(...
[ "0.6079593", "0.56353205", "0.56245106", "0.54297006", "0.5420395", "0.53964645", "0.53846157", "0.5324577", "0.5313518", "0.5307059", "0.5296735", "0.52721125", "0.52652985", "0.5231309", "0.5216166", "0.5180959", "0.5177343", "0.5174028", "0.51480824", "0.5126019", "0.50871...
0.77557886
0
Test set of protocol ids updated.
def test_protocols_updated(self): assert self.agent_config.protocols == {self.new_protocol_id}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_protocols_updated(self):\n assert self.skill_config.protocols == {self.new_protocol_id}", "def test_protocols_updated(self):\n assert self.connection_config.protocols == {self.new_protocol_id}", "def test_restricted_to_protocols_updated(self):\n assert self.connection_config.restr...
[ "0.7437529", "0.7357184", "0.68993795", "0.67584455", "0.61692876", "0.59563965", "0.5929382", "0.5882808", "0.5868374", "0.5865916", "0.5815501", "0.58100575", "0.577241", "0.5757336", "0.5750769", "0.5720688", "0.5719784", "0.5719736", "0.5719736", "0.5719736", "0.5685316",...
0.74834657
0
Test set of contract ids updated.
def test_contracts_updated(self): assert self.agent_config.contracts == {self.new_contract_id}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_contracts_updated(self):\n assert self.skill_config.contracts == {self.new_contract_id}", "def test_contracts(self):\n correct_contracts = [factories.ProjectContract(projects=self.projects,\n status=ProjectContract.STATUS_CURRENT) for i in range(3)]\n res...
[ "0.77372605", "0.6632399", "0.6293191", "0.59031224", "0.5869236", "0.58332425", "0.5806536", "0.5756309", "0.5726403", "0.5703236", "0.5690074", "0.5660192", "0.56283087", "0.5626664", "0.56259495", "0.5623313", "0.56025594", "0.558459", "0.5583168", "0.55798614", "0.5564105...
0.7739634
0
Test set of skill ids updated.
def test_skills_updated(self): assert self.agent_config.skills == {self.new_skill_id}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_skills_updated(self):\n assert self.skill_config.skills == {self.new_skill_id}", "def test_update_skills_to_completed(self):\n self._build_sample_graph()\n self._create_lessons() # 3 lessons in unit 1\n self._add_student_and_progress() # sa completed, sb in progress\n ...
[ "0.83605313", "0.6229875", "0.60261554", "0.5851457", "0.5804405", "0.571166", "0.56754595", "0.5666196", "0.56077766", "0.5587807", "0.5581246", "0.5541418", "0.55349255", "0.54972684", "0.5493252", "0.54751647", "0.5472471", "0.5440563", "0.54370815", "0.5427395", "0.542275...
0.8231693
1
Test default routing updated.
def test_default_routing_updated(self): assert self.agent_config.default_routing == { self.new_protocol_id: self.new_connection_id }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_default_routing_updated_correctly(self):\n result = self.run_cli_command(\n \"--skip-consistency-check\",\n \"config\",\n \"get\",\n \"agent.default_routing\",\n cwd=self._get_cwd(),\n )\n assert (\n result.stdout\n ...
[ "0.74396104", "0.7185289", "0.7095077", "0.70630145", "0.6892813", "0.68763053", "0.6704222", "0.66979414", "0.65297955", "0.6512689", "0.64154744", "0.619981", "0.6185665", "0.61728835", "0.6143343", "0.61333907", "0.6123227", "0.6076429", "0.60449207", "0.60284096", "0.6026...
0.7994095
0
Test default routing updated.
def test_custom_configuration_updated(self): component_protocol_id = ComponentId( ComponentType.PROTOCOL, self.new_protocol_id ) component_contract_id = ComponentId( ComponentType.CONTRACT, self.new_contract_id ) component_connection_id = ComponentId( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_default_routing_updated(self):\n assert self.agent_config.default_routing == {\n self.new_protocol_id: self.new_connection_id\n }", "def test_default_routing_updated_correctly(self):\n result = self.run_cli_command(\n \"--skip-consistency-check\",\n ...
[ "0.7994095", "0.74396104", "0.7185289", "0.7095077", "0.70630145", "0.6892813", "0.68763053", "0.6704222", "0.66979414", "0.65297955", "0.6512689", "0.64154744", "0.619981", "0.6185665", "0.61728835", "0.6143343", "0.61333907", "0.6123227", "0.6076429", "0.60449207", "0.60284...
0.0
-1
Test set of protocol ids updated.
def test_protocols_updated(self): assert self.connection_config.protocols == {self.new_protocol_id}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_protocols_updated(self):\n assert self.agent_config.protocols == {self.new_protocol_id}", "def test_protocols_updated(self):\n assert self.skill_config.protocols == {self.new_protocol_id}", "def test_restricted_to_protocols_updated(self):\n assert self.connection_config.restricted...
[ "0.74834657", "0.7437529", "0.68993795", "0.67584455", "0.61692876", "0.59563965", "0.5929382", "0.5882808", "0.5868374", "0.5865916", "0.5815501", "0.58100575", "0.577241", "0.5757336", "0.5750769", "0.5720688", "0.5719784", "0.5719736", "0.5719736", "0.5719736", "0.5685316"...
0.7357184
2
Test set of protocol ids updated.
def test_protocols_updated(self): assert self.skill_config.protocols == {self.new_protocol_id}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_protocols_updated(self):\n assert self.agent_config.protocols == {self.new_protocol_id}", "def test_protocols_updated(self):\n assert self.connection_config.protocols == {self.new_protocol_id}", "def test_restricted_to_protocols_updated(self):\n assert self.connection_config.restr...
[ "0.74834657", "0.7357184", "0.68993795", "0.67584455", "0.61692876", "0.59563965", "0.5929382", "0.5882808", "0.5868374", "0.5865916", "0.5815501", "0.58100575", "0.577241", "0.5757336", "0.5750769", "0.5720688", "0.5719784", "0.5719736", "0.5719736", "0.5719736", "0.5685316"...
0.7437529
1
Test set of contract ids updated.
def test_contracts_updated(self): assert self.skill_config.contracts == {self.new_contract_id}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_contracts_updated(self):\n assert self.agent_config.contracts == {self.new_contract_id}", "def test_contracts(self):\n correct_contracts = [factories.ProjectContract(projects=self.projects,\n status=ProjectContract.STATUS_CURRENT) for i in range(3)]\n res...
[ "0.7739634", "0.6632399", "0.6293191", "0.59031224", "0.5869236", "0.58332425", "0.5806536", "0.5756309", "0.5726403", "0.5703236", "0.5690074", "0.5660192", "0.56283087", "0.5626664", "0.56259495", "0.5623313", "0.56025594", "0.558459", "0.5583168", "0.55798614", "0.55641055...
0.77372605
1
Test set of skill ids updated.
def test_skills_updated(self): assert self.skill_config.skills == {self.new_skill_id}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_skills_updated(self):\n assert self.agent_config.skills == {self.new_skill_id}", "def test_update_skills_to_completed(self):\n self._build_sample_graph()\n self._create_lessons() # 3 lessons in unit 1\n self._add_student_and_progress() # sa completed, sb in progress\n ...
[ "0.8231693", "0.6229875", "0.60261554", "0.5851457", "0.5804405", "0.571166", "0.56754595", "0.5666196", "0.56077766", "0.5587807", "0.5581246", "0.5541418", "0.55349255", "0.54972684", "0.5493252", "0.54751647", "0.5472471", "0.5440563", "0.54370815", "0.5427395", "0.5422755...
0.83605313
0
This function prints and plots the confusion matrix.
def plot_confusion_matrix(cm, classes,title='Confusion matrix',cmap=plt.cm.jet): cm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis] plt.imshow(cm, interpolation='nearest', cmap=cmap) plt.title(title) plt.colorbar() tick_marks = np.arange(len(classes)) plt.xticks(tick_marks, classes, rotatio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_confusion_matrix(self):\r\n interp = ClassificationInterpretation.from_learner(self.learn)\r\n interp.plot_confusion_matrix()", "def showConfusionMatrix(self): \r\n sn.heatmap(self.conf_matrix, annot=True)\r\n plt.plot( label=\"Accuracy\")\r\n plt.plot( label=\"Error\"...
[ "0.80894613", "0.80770946", "0.79976976", "0.7946727", "0.7921785", "0.78448296", "0.7833224", "0.7781221", "0.7775631", "0.77574563", "0.77061635", "0.77016985", "0.7692213", "0.76785815", "0.76588994", "0.7641414", "0.7622791", "0.7611233", "0.7610989", "0.7598244", "0.7587...
0.7405432
97
Self attention layer, give a sequence as input and apply bidirectional selfattention mechanism
def __init__(self, units, initializer=None, trainable=True, name=None): # general init if name is None: name = "self_attention" self.name = str(name) self.variable_scope = tf.variable_scope(self.name) self.layers = [] self._variables = [] self._trainab...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def self_attention_model(self):\n inputs = self.prepare_inputs()\n \n features = self.prepare_features(inputs)\n support_history_context_concat_emb = features['support_history_context_concat_emb']\n support_link_info_concat_emb = features['support_link_info_concat_emb']\n ...
[ "0.67889464", "0.6680083", "0.65487057", "0.6420023", "0.6410898", "0.6378069", "0.63661194", "0.61637723", "0.6146238", "0.6071968", "0.5991793", "0.5953462", "0.59385717", "0.5921296", "0.5905648", "0.5902684", "0.59026766", "0.5894507", "0.58758587", "0.58568394", "0.58464...
0.0
-1
Return the value of the current state.
def get_value(self) -> CartState: return self._state
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def state(self):\n return self._current_value", "def getValue(self, state):\r\n return self.values[state]", "def get_current_value(self):\n assert(self.is_started())\n return self.currValue", "def getValue(self, state):\n return self.values[state]", "def getValue(self, state)...
[ "0.8929101", "0.8202963", "0.81946796", "0.81887406", "0.81364614", "0.81364614", "0.81014645", "0.81014645", "0.81014645", "0.81014645", "0.81014645", "0.81014645", "0.81014645", "0.81014645", "0.81014645", "0.81014645", "0.81014645", "0.81014645", "0.80120087", "0.80120087", ...
0.81149095
6
Instanties the appropriate GNN message passing model from the provided configuration.
def gnn_model_construct(cfg, model_name='gnn_model', **kwargs): models = gnn_model_dict() model_cfg = cfg[model_name] name = model_cfg.get('name', 'meta') if not name in models: raise Exception("Unknown GNN message passing model name provided:", name) return models[name](model_cfg, **kwargs...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_config(cls,config):\n ## find labels in list\n label_list = load_label_list(config.label_list)\n use_cuda = True if torch.cuda.is_available() else False\n\n global_args = {\n \"fp16\" : False,\n \"classification_report\" : True,\n \"tensorboard_...
[ "0.67296934", "0.6261608", "0.62435234", "0.60592365", "0.60236555", "0.59820974", "0.5933083", "0.5919707", "0.59194344", "0.58706003", "0.5859018", "0.5856421", "0.5841997", "0.58010566", "0.5800078", "0.5797704", "0.57974833", "0.5797201", "0.576441", "0.5757969", "0.57513...
0.745079
0
Instanties the appropriate node encoder from the provided configuration.
def node_encoder_construct(cfg, model_name='node_encoder', **kwargs): encoders = node_encoder_dict() encoder_cfg = cfg[model_name] name = encoder_cfg.get('name', 'geo') if not name in encoders: raise Exception("Unknown node encoder name provided:", name) return encoders[name](encoder_cfg, *...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def register_node_encoder(key, module):\n register(key, module, node_encoder_dict)", "def registerEncoder (encoder):\n assert False, \"TODO:\"", "def register_edge_encoder(key, module):\n register(key, module, edge_encoder_dict)", "def node_encoder_dict():\n\n from .encoders import geometric, mix...
[ "0.6464376", "0.5879688", "0.5607723", "0.55974233", "0.5569245", "0.5477778", "0.5472452", "0.53909737", "0.53809834", "0.52404594", "0.52369714", "0.5182294", "0.5161166", "0.512532", "0.5101028", "0.50982064", "0.5080763", "0.5073675", "0.50220376", "0.5020984", "0.5017529...
0.7300629
0
Computes new activations via masked attentionweighted sum of values.
def DotProductAttention(queries, keys, values, pos_emb, context_bias, location_bias, mask, dropout, mode, rng, chunk_len, chunk_offset): batch_size, n_heads, original_l, d_feature = queries.shape def _calc_attn_scores(q, k): ac = jnp.einsum('bnid,bnjd->bnij', q +...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def activation(self, weighted_sum):\n return 0 if (weighted_sum + self.biases) < 0 else 1", "def mask_weights(self, mask, weights):\n new_weights = list()\n for idx, layer in enumerate(self.model.layers):\n if len(layer.get_weights())>0:\n new_weights.append(weights...
[ "0.63514805", "0.6248108", "0.6159822", "0.61452276", "0.6118611", "0.6048381", "0.6036244", "0.6034458", "0.59306335", "0.5901366", "0.58883923", "0.5859445", "0.5851565", "0.58426714", "0.5842238", "0.5836485", "0.57865304", "0.5777293", "0.5775965", "0.5774572", "0.5773097...
0.0
-1
This method will request the status of the job related to an instance of this class and return the status string. Returns str
def _check_job_status(self) -> str: self._assert_job_created() r = requests.post( f'https://{cc.ROUTE_PREFIX}.stratodem.com/jobs/status', headers=dict( Authorization=f'Bearer {get_api_token()}', ), json=dict(job_id=self._job_id) ) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def status(self) -> str:\n return self._check_job_status()", "def get_status(self):\n url = \"data_request?id=jobstatus&job=%d&plugin=zwave\" % self.id\n return self.vera.get(url)", "def get_status(self):\n\t\treturn call_sdk_function('PrlJob_GetStatus', self.handle)", "def status(self):...
[ "0.80725014", "0.794659", "0.78770465", "0.7819105", "0.75560576", "0.75410444", "0.75249773", "0.7486007", "0.74820155", "0.73967725", "0.73967725", "0.73967725", "0.73967725", "0.73967725", "0.73967725", "0.7336831", "0.7336831", "0.7336831", "0.7336831", "0.7336831", "0.73...
0.79354143
2
Test _get_faker with a category that don't exist
def test__get_faker_anonymize_category_not_exist(self): # Run & assert transformer = Mock() transformer.anonymize = 'SuP3R-P1Th0N-P0w3R' with self.assertRaises(ValueError): CategoricalTransformer._get_faker(transformer)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_dashboard_recipe_created_with_category(self):\n self.signup('Bo', 'Theo', 'Bo_theo5@example.com', 'Bo1995', 'Bo1995')\n self.login('Bo_theo5@example.com', 'Bo1995')\n self.dashboard()\n self.category('JunkFood')\n self.dashboard()\n rv = self.recipe_dashboard()\n ...
[ "0.67407596", "0.6662604", "0.6509663", "0.6416014", "0.635828", "0.63036376", "0.6278413", "0.62211454", "0.62152624", "0.61945945", "0.61438763", "0.6122787", "0.6113773", "0.61023265", "0.60520446", "0.6043084", "0.6006965", "0.59960073", "0.5989137", "0.596436", "0.596436...
0.76513755
0
Return True, False based on num_of_last_check_rounds_consider rounds evaluations. All checks (items of dictionaries) have the same weight. All results must be nonzero in order to pronounce offline status. if any results in the considered rounds is 0, the online status is still maintained.
def am_i_offline(self): # -num_of_last_check_rounds_consider won't raise IndexError when len(self.data) is smaller logger.debug("called am_i_offline and data is: %s" % self.data) if not self.data: return False for dict_check_results in self.data[-self.num_of_last_check_rounds...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def checkWinAll(self, model, previousWin):\r\n previous = self.__render\r\n self.__render = Render.NOTHING # avoid rendering anything during execution of the check games\r\n\r\n win = 0\r\n lose = 0\r\n \r\n cellsRanking = {}\r\n sumForProb = 0\r\n for cell ...
[ "0.62502825", "0.5845664", "0.57943153", "0.5778877", "0.5745679", "0.57071424", "0.5669396", "0.5647574", "0.5607584", "0.56058955", "0.5602156", "0.5582184", "0.55455875", "0.55068654", "0.54925454", "0.54548347", "0.54522806", "0.5450234", "0.54389316", "0.5418244", "0.541...
0.671868
0
Diagonal matrix for \\(\\sigma\\).
def MccSigma(self): if getattr(self, '_MccSigma', None) is None: self._MccSigma = Utils.sdiag(self.sigma) return self._MccSigma
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Dmat(numpts, delta=1):\n a = 0.5 / delta * ones(numpts)\n a[0] = 0\n a[-2] = 0\n #b=-2./delta**2*ones(numpts); b[0]=0;b[-1]=0\n c = -0.5 / delta * ones(numpts)\n c[1] = 0\n c[-1] = 0\n return sparse.spdiags([a, c], [-1, 1], numpts, numpts)", "def create...
[ "0.6556458", "0.6473053", "0.60842884", "0.605742", "0.596978", "0.5964484", "0.5892954", "0.5817073", "0.5781084", "0.5766929", "0.57553613", "0.57219595", "0.57005966", "0.563589", "0.55951315", "0.55933046", "0.5584733", "0.55497956", "0.55497956", "0.55497956", "0.5532623...
0.59836084
4
Computes the accuracy over the k top predictions for the specified values of k
def accuracy(output, target, topk=(1,)): maxk = max(topk) batch_size = target.size(0) _, pred = output.topk(maxk, 1, True, True) pred = pred.t() correct = pred.eq(target.reshape(1, -1).expand_as(pred)) return [correct[:k].reshape(-1).float().sum(0) * 100. / batch_size for k in topk]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def topk_accuracy(y, y_pred, k=2):\n pred = []\n for i in range(len(y)):\n if y[i] in y_pred[i][:k]:\n pred.append(1)\n else:\n pred.append(0)\n return sum(pred) / len(pred)", "def accuracy(y_pred, y_actual, topk=(1, )):\n maxk = max(topk)\n batch_size = y_actua...
[ "0.8331214", "0.8284662", "0.82381004", "0.8229767", "0.82202226", "0.81864446", "0.81847763", "0.8175173", "0.8171541", "0.81699467", "0.81664646", "0.81645083", "0.81637454", "0.81622064", "0.81622064", "0.81622064", "0.81622064", "0.81622064", "0.81622064", "0.81622064", "...
0.7890316
61
Get the raw value.
def raw_value(self): if self.__trigger == gyro_trigger_mode.GET_RAW_VALUE_TRIGGER_READ: self.read_and_update_angle() return self.__value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_raw_value(self, name):\n return self.get_field_value(name, raw=True)", "def raw(self):\n return float(self.uw.send(self.name + '.val')[0])", "def raw(self, value):\n return self._connection.raw(value)", "def value(self):\n return self.raw.get_attribute(\"value\")", "def valu...
[ "0.80779606", "0.80125767", "0.80061805", "0.7980116", "0.777993", "0.77499765", "0.7675945", "0.75547624", "0.7549521", "0.7517385", "0.7517385", "0.7454824", "0.7453014", "0.74360514", "0.73877054", "0.7344939", "0.73296165", "0.73090214", "0.7305004", "0.72980183", "0.7272...
0.7503957
11
Get the angular position.
def angle(self): if self.__trigger == gyro_trigger_mode.GET_ANGLE_TRIGGER_READ: self.read_and_update_angle() return self.__angle
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def angular_momentum(self):\n cart = self.represent_as(coord.CartesianRepresentation)\n return cart.pos.cross(cart.vel).xyz", "def get_position(self):\n return self.position", "def get_position(self):\n return self.position", "def get_position(self):\n return self._pos", ...
[ "0.7345091", "0.6846373", "0.6846373", "0.68252623", "0.68252623", "0.67772895", "0.6777273", "0.6777273", "0.67752784", "0.67716336", "0.6762128", "0.67593557", "0.6758765", "0.6757279", "0.6719064", "0.6704345", "0.6665486", "0.6646903", "0.6605516", "0.65952194", "0.655660...
0.0
-1
Get the angular velocity.
def angular_velocity(self): trig = gyro_trigger_mode.GET_ANGULAR_VELOCITY_TRIGGER_READ if self.__trigger == trig: self.read_and_update_angle() adjusted = (self.__angle - self.__offset) if self.__factorSet: return adjusted / self.__degPerSecondFactor retur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_angular_velocity(r, T):\n # http://www.hep.fsu.edu/~berg/teach/phy2048/0918.pdf\n # velocity = 2(pi)r/T\n return (2*math.pi*r)/T", "def get_velocity(self):\n return self.momentum/self.mass", "def getVelocity(self):\n return self.v", "def velocity(self):\n return ...
[ "0.8031633", "0.80294454", "0.7932014", "0.7872321", "0.7872321", "0.7819788", "0.7695756", "0.7518039", "0.74284637", "0.7397644", "0.7395855", "0.7310496", "0.7305694", "0.7182281", "0.7174432", "0.71633595", "0.71561223", "0.70999396", "0.7087294", "0.7076143", "0.7056753"...
0.8452335
0
Determine whether the line at the given character position is a syntax test line. It can optionally treat lines with comment markers but no assertion as a syntax test, useful for while the line is being written.
def is_syntax_test_line(self, pos, must_contain_assertion): details = self.get_details_of_test_assertion_line(pos) if details.comment_marker_match: return not must_contain_assertion or details.assertion_colrange is not None return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_line(line):\r\n if not line.strip():\r\n return False # if the last line is blank\r\n if line.startswith(\"#\"):\r\n return False # comment line\r\n if line.startswith(\" #\"):\r\n return False # comment line\r\n return line", "def line_is_comment(line: str) -> boo...
[ "0.64412737", "0.58817124", "0.58335006", "0.57256436", "0.57059705", "0.5685633", "0.5685633", "0.56759757", "0.56629014", "0.56547546", "0.56382746", "0.56126237", "0.5573984", "0.5497276", "0.54892397", "0.548672", "0.5472746", "0.54558164", "0.5425748", "0.54181623", "0.5...
0.8230717
0
Inserts a new Node containing data at index position Insertion takes O(1) time but finding the node at the insertion point takes O(n) time Takes overall O(n) time
def insert(self, data, index): if index == 0: self.add(data) if index > 0: new = Node(data) position = index # Cada que se llama a current = current.next_node, se decrementa el valor de position en 1, cuando el valor sea cero, se ha llegado al nodo que está actualmen...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def insert(self, data, index):\n if index == 0:\n self.prepend(data)\n return\n\n current_index = 0\n current = self.head\n previous = None\n\n while current or previous:\n if current_index == index:\n new_node = Node(data)\n new_node.next = current\n previous.nex...
[ "0.76036936", "0.7400955", "0.7308287", "0.7289469", "0.7233354", "0.72043854", "0.71814305", "0.70170546", "0.68942094", "0.6893734", "0.6794249", "0.6733147", "0.66646373", "0.6637714", "0.6611129", "0.6609709", "0.65960646", "0.65296155", "0.6526484", "0.65039337", "0.6478...
0.7551532
1
Return the data stored at the specified index of the list Takes O(n) time, porque en el peor de los casos recorre toda la lista elemento por elemento
def read_index(self, index): current = self.head if index == 0: return current.data elif index >= self.size() : return None else: position = 0 while position < index: current = current.next_node position += 1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_from_list(self,list_,index):\r\n\r\n\r\n try:\r\n return list_[self._index_to_int(index)]\r\n except IndexError:\r\n self._index_error(list_,index)", "def reader(list, index_list):\r\n\tnewlist = []\r\n\tfor i in index_list:\r\n\t\tnewlist.append(list[i])\r\n\treturn n...
[ "0.6765566", "0.66210765", "0.65985394", "0.6549164", "0.6520917", "0.64404386", "0.6389491", "0.6355572", "0.6350486", "0.62956595", "0.62822723", "0.62698674", "0.62698674", "0.6219662", "0.61954945", "0.616265", "0.6129846", "0.6129082", "0.61201406", "0.6114262", "0.61142...
0.5982834
29
Tests the the default can be passed as an array for an exact 1 as long as there is only one element in the default array
def test_exactly_explicit_default_array_size_1(): class TestCmdLine(CmdLine): yaml_def = ''' supported_options: - category: options: - name : test_opt long : test-opt opt : param default : [default-value] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_exactly_explicit_default_array_size_2():\n class TestCmdLine(CmdLine):\n yaml_def = '''\n supported_options:\n - category:\n options:\n - name : test_opt\n long : test-opt\n opt : param\n default : [de...
[ "0.6924859", "0.681109", "0.6646935", "0.6526877", "0.6372104", "0.62186414", "0.6186191", "0.61687064", "0.60800254", "0.6011733", "0.59420496", "0.59248763", "0.5894819", "0.5814771", "0.57995754", "0.57926476", "0.57476133", "0.5741131", "0.57276154", "0.5725769", "0.56984...
0.70412314
0
Get the mask scores. mask_score = bbox_score mask_iou
def get_mask_scores(self, mask_iou_pred, det_bboxes, det_labels): inds = range(det_labels.size(0)) mask_scores = 0.3*mask_iou_pred[inds, det_labels + 1] +det_bboxes[inds, -1] mask_scores = mask_scores.cpu().numpy() det_labels = det_labels.cpu().numpy()...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_mask_bbox_and_score(yolact_net: Yolact, img, threshold=0.0, max_predictions=1):\n with torch.no_grad():\n frame = torch.from_numpy(img).cuda().float()\n batch = FastBaseTransform()(frame.unsqueeze(0))\n preds = yolact_net(batch)\n\n h, w, _ = img.shape\n\n save = cfg.r...
[ "0.65144867", "0.6466221", "0.6315222", "0.62637913", "0.62122744", "0.6192767", "0.6178452", "0.6105629", "0.6087383", "0.6032142", "0.60265553", "0.5911425", "0.590602", "0.5874414", "0.58339673", "0.5812719", "0.58085567", "0.5778155", "0.5765579", "0.5738613", "0.5735049"...
0.7327434
0
return the index of the first 'x' character
def index_of_x(word: str, position=0): if word[position] == 'x': return position else: return index_of_x(word, position + 1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_charindex(self, x, y):\r\n verts = self.shapes[0].buf[0].vertices\r\n x = x - self.x + verts[2][0]\r\n y = y - self.y + verts[0][1]\r\n nv = len(verts)\r\n for i in range(0, nv, 4):\r\n vtr = verts[i] # top right\r\n vbl = verts[i + 2] # bottom left\r\n if x >= vbl[0] and x <...
[ "0.71218747", "0.6918496", "0.6851387", "0.66528195", "0.6589345", "0.6521937", "0.6521937", "0.6521937", "0.6400876", "0.6359979", "0.63255304", "0.63255304", "0.63255304", "0.62182313", "0.6203542", "0.61581415", "0.61581415", "0.61581415", "0.61581415", "0.6097176", "0.609...
0.8036832
0
Creates a new instance of ApiController.
def __init__(self, router): self._router = router
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_controller() -> Controller:\n _controller = Controller()\n return _controller", "def api(self):\n if self._api is None:\n self._api = Api(self)\n return self._api", "def create_api(self):\n return DJinnAPI(djenkins=self.dj, pipeline_results=self.db)", "def __c...
[ "0.7101719", "0.63651824", "0.62060696", "0.60446644", "0.5977766", "0.59361684", "0.5887744", "0.57610554", "0.5739069", "0.5738209", "0.5733282", "0.57280785", "0.5726632", "0.5701272", "0.569508", "0.5690178", "0.56673205", "0.566405", "0.5596931", "0.5582079", "0.5574749"...
0.0
-1
Gets the paraphrase word indices and returns the text
def get_paraphrase_text(words, par_indices): paraphrase_words = [words[i] for i in par_indices] paraphrase = ' '.join(paraphrase_words) yield paraphrase
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_paraphrase_vector(w1, w2, paraphrase, model, word2index, UNK):\n paraphrase = paraphrase.replace(w1, '[w1]').replace(w2, '[w2]')\n par_indices = tuple([word2index.get(w, UNK) for w in paraphrase.split()])\n return model.__compute_state__(par_indices, -1).npvalue()", "def __getitem__(self, in...
[ "0.6314425", "0.6210464", "0.6197732", "0.6069608", "0.59872603", "0.59198254", "0.58468634", "0.5836494", "0.58288574", "0.58069897", "0.5805492", "0.5784904", "0.5778147", "0.5773557", "0.57684636", "0.5756537", "0.57161903", "0.5708709", "0.5705941", "0.5698667", "0.569617...
0.76571596
0
Creates the maze without the Points and Power Pellet. It's saved in self.maze as a pygame.Surface Obeject. self.maze will be constant and created just one time. Function needs to be called before call draw function.
def init(self, windowsize:tuple): y_count, x_count = 3, 0 #< Set the starting counter for the look_up_table. y starts with three because the first three lines are just Nones # Creating the constant maze maze_size = windowsize[0], windowsize[1] - 2 * self.grid_size self.maze = pg.Sur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _draw(self):\n display.draw_maze(self._screen, self._maze, self._settings)\n pygame.display.flip()", "def _maze(self):\n try:\n return self.__maze\n except AttributeError:\n pass\n # create and store the maze object\n supershape_name, supershape...
[ "0.6902336", "0.67456156", "0.6694301", "0.6541506", "0.6379714", "0.6343732", "0.6341993", "0.62822527", "0.61848706", "0.61713815", "0.61515594", "0.61441624", "0.60709506", "0.59715253", "0.5937162", "0.5934562", "0.59340256", "0.5884481", "0.5871381", "0.5867148", "0.5856...
0.652472
4
Draws a blackline (if pink is False otherwise the line will be pink) on the position (indizes[0] grid_size, indizes[1] grid_size). Side indicates whether the line should be drawn horizontally or vertically. Possible values {'u', 'l'} 'u' > Up ; 'l' > Left
def draw_line(self, DISP, side:str, indizes:tuple, pink = False): offset = 1 #< Just to draw the line nicely pos = (indizes[0] - 1) * self.grid_size, indizes[1] * self.grid_size # Check if it's a pink line if pink: start_pos = pos[0], pos[1] + self.grid_size // 2 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_gray_grid(self):\n gray = \"#D3D3D3\"\n # Draw the vertical lines\n for x in range(0, self.width, self.scale):\n self.canvas.create_line(x, 0, x, self.height, fill=gray)\n\n # Draw the horizontal lines\n for y in range(0, self.height, self.scale):\n ...
[ "0.60905635", "0.60611", "0.5898274", "0.577904", "0.57544893", "0.5718297", "0.5708298", "0.57033575", "0.56043583", "0.5601031", "0.5553713", "0.5548981", "0.5547163", "0.55251795", "0.55206865", "0.5516502", "0.5490055", "0.54690945", "0.5459518", "0.5452845", "0.5427957",...
0.78228533
0
Optionally restricts the returned purchases to a given user, by filtering against a `username` query parameter in the URL.
def get_queryset(self): queryset = Article.objects.all().order_by('-id') title = self.request.query_params.get('title', None) limit = self.request.query_params.get('limit', None) random = self.request.query_params.get('random', None) if title is not None: queryset = q...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_queryset(self):\n username = self.kwargs.get('username', None)\n filters = {}\n if username:\n filters['user__username'] = username\n return super(PhotosListView, self).get_queryset().filter(**filters)", "def filter_queryset(self, request, queryset, view):\n ...
[ "0.59682834", "0.59662503", "0.59339905", "0.59121907", "0.59062797", "0.56636876", "0.5653978", "0.5544974", "0.5541318", "0.55099636", "0.5504582", "0.5494414", "0.5487761", "0.5483002", "0.5471986", "0.5471543", "0.5451524", "0.54157865", "0.54070425", "0.53802735", "0.537...
0.0
-1
Optionally restricts the returned purchases to a given user, by filtering against a `username` query parameter in the URL.
def get_queryset(self): queryset = ArticleImage.objects.all() id = self.request.query_params.get('artile_id', None) if id is not None: queryset = queryset.filter(artile_id=id) return queryset
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_queryset(self):\n username = self.kwargs.get('username', None)\n filters = {}\n if username:\n filters['user__username'] = username\n return super(PhotosListView, self).get_queryset().filter(**filters)", "def filter_queryset(self, request, queryset, view):\n ...
[ "0.59691316", "0.59666115", "0.5933636", "0.5911969", "0.59060764", "0.5664847", "0.5654243", "0.5545357", "0.55417883", "0.55104214", "0.55045646", "0.5494846", "0.54883754", "0.5484133", "0.547296", "0.54719406", "0.54517895", "0.54165924", "0.54078025", "0.53811634", "0.53...
0.0
-1
Function to show custom page to handle 404
def handler404(request): #Setting the variable and template page for the 500 error response = render_to_response('404.html', {}, context_instance=RequestContext(request)) response.status_code = 404 return response
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def page_not_found(e):\n return render_template('404.html')", "def page_not_found(e):\n return render_template(\"404.html\"), 404", "def page_not_found(e):\n return render_template('404.html'), 404", "def page_not_found(e):\n return render_template('404.html'), 404", "def page_not_found(e):\n ...
[ "0.83293515", "0.8320573", "0.8313", "0.8313", "0.82944036", "0.8280824", "0.81907314", "0.81577927", "0.80910975", "0.80592424", "0.80542487", "0.80542487", "0.80542487", "0.80542487", "0.80542487", "0.80542487", "0.80542487", "0.80509984", "0.80509984", "0.80509984", "0.805...
0.7598527
58
Update a configuration file to V3.0
def update_to_v30(config_dict): old_database = None v3_additions = """[DataBindings] # This section binds a data store to a database [[wx_binding]] # The database must match one of the sections in [Databases] database = archive_sqlite # The name of the table within the databas...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def upgrade_config_format(self):\n # migrate older config files\n if self.version == 1:\n # capture_init()\n self.version = 3\n\n # If token exists check still valid and can login\n if self.token and self.token != DEFAULT_TOKEN:\n from .api i...
[ "0.6443746", "0.62608343", "0.6216244", "0.61330986", "0.60443616", "0.585735", "0.5845343", "0.58440197", "0.58051085", "0.57895774", "0.57889515", "0.5731226", "0.5694686", "0.5657856", "0.56325144", "0.5610123", "0.5603531", "0.55715686", "0.55541146", "0.55401134", "0.546...
0.5537079
20
Update a configuration file to V3.6
def update_to_v36(config_dict): # Perform the following only if the dictionary has a StdWXCalculate section if config_dict.get('StdWXCalculate'): # No need to update if it already has a 'Calculations' section: if not config_dict['StdWXCalculate'].get('Calculations'): # Save the ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def upgrade_config_format(self):\n # migrate older config files\n if self.version == 1:\n # capture_init()\n self.version = 3\n\n # If token exists check still valid and can login\n if self.token and self.token != DEFAULT_TOKEN:\n from .api i...
[ "0.6855991", "0.652933", "0.65168273", "0.64332783", "0.6396743", "0.62085897", "0.61918867", "0.6051218", "0.6049843", "0.59921736", "0.59703094", "0.5902615", "0.5899468", "0.5870339", "0.5866114", "0.5794391", "0.57775265", "0.57736266", "0.57609314", "0.5741383", "0.57236...
0.5507448
36
%SIGMOID Compute sigmoid function g = SIGMOID(z) computes the sigmoid of z.
def sigmoid(z): return 1.0 / (1 + np.exp(-z))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sigmoid(z):\r\n \r\n return vSigmoid(z);", "def sigmoid(z):\n\n\ts = 1 / (1 + np.exp(-z)) #definition of the sigmoid function\n\treturn s", "def sigmoid(z):\n g = (1 + np.exp(-z))**-1\n return g", "def sigmoid_function(z):\n\n return 1 / (1 + math.exp(-z))", "def sigmoid(z):\n g = 1/...
[ "0.8026403", "0.77280444", "0.76285315", "0.75957566", "0.7572142", "0.75677526", "0.7542004", "0.75243586", "0.75156057", "0.75135624", "0.74921745", "0.7490193", "0.74887985", "0.74878234", "0.74790835", "0.74670964", "0.74613214", "0.74529666", "0.7447754", "0.7430382", "0...
0.743404
19
Get all currently running threads as thread collection
def get_currently_running(cls, include_main_thread: bool = True) -> 'ThreadCollection': result = [] for thread in threading.enumerate(): # noinspection PyProtectedMember if not include_main_thread and isinstance(thread, threading._MainThread): continue ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def threads(self):\n return self.rpc.call(MsfRpcMethod.CoreThreadList)", "def threads(self, **kwargs):\n return stats.threads(self._host, self._session, **kwargs)", "def message_threads(self):\r\n return resource.MessageThreads(self)", "def getThreads():\r\n return multiprocessing.cpu...
[ "0.75837064", "0.70621043", "0.69586414", "0.6720364", "0.6488229", "0.6472203", "0.63923824", "0.6276579", "0.6254887", "0.6225861", "0.61866957", "0.61829114", "0.6157111", "0.61470133", "0.59425855", "0.5896691", "0.5887221", "0.5858366", "0.58357793", "0.5832114", "0.5819...
0.7452421
1
Add a thread collection or a thread to this collection and return a new collection
def __add__(self, other: tp.Union['ThreadCollection', Thread, tp.Iterable[Thread]]): if isinstance(other, Thread): other = [other] elif isinstance(other, ThreadCollection): other = other.threads else: other = list(other) return ThreadCollection(self.th...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add(self, thread: Thread) -> 'ThreadCollection':\n self.threads.append(thread)\n return self", "def __iadd__(self, other: tp.Union['ThreadCollection', Thread, tp.Iterable[Thread]]):\n if isinstance(other, Thread):\n other = [other]\n elif isinstance(other, ThreadCollect...
[ "0.741004", "0.7373582", "0.555869", "0.54820925", "0.5466185", "0.5417148", "0.53353214", "0.5322943", "0.53202814", "0.53149694", "0.5253452", "0.5218059", "0.51454335", "0.5134045", "0.5118661", "0.5117001", "0.51031727", "0.5098868", "0.5087811", "0.50637823", "0.49973348...
0.78848195
0
Load a dictionary from a JSON's filepath.
def _localloadjson(path: str) -> JSONType: with open(path, encoding="utf-8") as fh: return json.load(fh)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def json_load(path):\n with open(path) as f:\n dictionary = json.load(f)\n return dictionary", "def load_json(file_path):\n\n \n with open(file_path, 'r') as json_file:\n # print(file_path)\n dictionary = json.loads(json_file.read())\n\n return dictionary", "def json_dict(pa...
[ "0.8161961", "0.81116074", "0.80024266", "0.78739786", "0.77795357", "0.7731543", "0.7678685", "0.76616204", "0.76319414", "0.75913036", "0.7570242", "0.7562341", "0.7561274", "0.7542757", "0.7540125", "0.7526019", "0.7524636", "0.7520727", "0.7506613", "0.7500385", "0.749486...
0.7183209
54
Returns the defined projects settings
def projects_settings(): return map_settings(settings_repository.settings)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_projects(self):\n return conf.projects", "def settings():\n return _get_settings()[1]", "def getSettings(self):\n return self.cfg", "def get_settings():\n return SettingCollection.build()", "def get_projects(self):\n if not self.validate():\n raise SettingCustomV...
[ "0.7944305", "0.73158234", "0.7182883", "0.7087642", "0.70306367", "0.7016714", "0.692769", "0.6903739", "0.68574196", "0.68574196", "0.67924243", "0.67372715", "0.6725301", "0.66855377", "0.66544014", "0.66251636", "0.66251636", "0.66042525", "0.6602571", "0.6597946", "0.658...
0.8683347
0
Is an energy equal to another? Compares only the value, with implicit unit conversion
def __eq__(self, other: Any) -> bool: tol_ha = 0.0000159 # 0.01 kcal mol-1 # A PotentialEnergy is not equal to a FreeEnergy, for example if isinstance(other, Value) and not isinstance(other, self.__class__): return False if isinstance(other, Value): other = oth...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n if set(self.comp) != set(other.comp):\n return False\n if abs(self.energy - other.energy) > 1e-6:\n return False\n for key in self.comp:\n if abs(self.unit_comp[key] - other.unit_comp[key]) > 1e-6:\n return False\n ...
[ "0.7066215", "0.69051033", "0.65359586", "0.6492319", "0.64670944", "0.6329468", "0.63137656", "0.63081795", "0.62765265", "0.62765265", "0.62765265", "0.62765265", "0.62645483", "0.6250249", "0.62463707", "0.62171537", "0.62097025", "0.6207712", "0.61770636", "0.6160313", "0...
0.7190593
0
Test retriving the delete notification schedule form.
def test_get_delete_page(self): data = self.get_valid_data() notification = reminders.Notification.objects.create(**data) url = reverse('delete-notification', args=[notification.pk]) response = self.client.get(url) self.assertEqual(response.status_code, 200)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_delete_schedule(self):\n response = self.client.open('/v1/schedule/{id}'.format(id=56),\n method='DELETE',\n content_type='application/json')\n self.assert200(response, \"Response body is : \" + response.data.decode('utf-8...
[ "0.7377989", "0.7307511", "0.7120723", "0.69862735", "0.69808066", "0.6941616", "0.68841267", "0.68841267", "0.6727669", "0.6714243", "0.67076236", "0.6706653", "0.6653221", "0.6653221", "0.6545335", "0.6538275", "0.6533982", "0.6521764", "0.6517957", "0.650611", "0.6498307",...
0.75008494
1
test the response from an unregistered user
def test_unregistered(self): msg = self._send(self.unreg_conn, '1') self.assertEqual(len(msg.responses), 1) self.assertEqual(msg.responses[0].text, self.app.not_registered)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_retrieve_user_unautherized(self):\n res = self.client.get(ME_URL)\n self.assertEqual(res.status_code, status.HTTP_401_UNAUTHORIZED)", "def test_unauthorized_user(self):\n response_decoded_json = requests.post(URL_AUTH['url_login'], \n data=...
[ "0.7512495", "0.74326134", "0.7367301", "0.73364866", "0.7277002", "0.72549385", "0.72140896", "0.7136618", "0.7045811", "0.70387805", "0.7037496", "0.7037496", "0.7012697", "0.6998005", "0.69083714", "0.6896652", "0.6863195", "0.68309265", "0.6807837", "0.67952216", "0.67811...
0.7153642
8
Confirmed patients returned should be distinct.
def test_multiple_notifications_confirmed(self): appt_date = datetime.date.today() self.create_confirmed_notification(self.test_patient, appt_date) self.create_confirmed_notification(self.test_patient, appt_date) qs = Patient.objects.confirmed_for_date(appt_date) self.assertTrue(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_patients(self):\n return", "def results(self):\n q = self.cleaned_data['q'].strip()\n patients = PatientInformation.objects.filter(Q(operator__username__contains=q) | \\\n Q(patient_id__contains=q) | Q(first_name__contains=q) | Q(last_name__contains=q) | \\\n Q(...
[ "0.6407887", "0.6217862", "0.6146277", "0.61339456", "0.59357697", "0.58914775", "0.5747081", "0.57172066", "0.5699884", "0.56090033", "0.556264", "0.55349666", "0.5509161", "0.55008954", "0.5462992", "0.54152906", "0.5399285", "0.53963536", "0.53569466", "0.5355757", "0.5336...
0.5689818
9
Test handling contacts with blank email addresses.
def test_skip_blank_emails(self): appt_date = datetime.date.today() + datetime.timedelta(days=7) # Default for email confirmed = self.create_confirmed_notification(self.test_patient, appt_date) blank_contact = self.create_contact(data={'email': ''}) self.group.contacts.add(blank_contact...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_clean_email_empty(self):\n\n raw_email = 'from=<>'\n result = clean_email(raw_email)\n self.assertEqual(result, '')", "def test_empty_email():\n expect_error(register, InputError, \"a\", \"abdkjjd\", \"a\", \"A\", \"\")", "def test_blank_email(self):\n rv = self.signup('...
[ "0.7482964", "0.7275253", "0.69421434", "0.6930028", "0.67643726", "0.67627615", "0.6754761", "0.6718976", "0.67137337", "0.66844887", "0.66387", "0.6603153", "0.65530217", "0.64842224", "0.64703244", "0.6454758", "0.644754", "0.6434412", "0.64338964", "0.6426903", "0.6386227...
0.7110963
2
Test manually confirming a patient reminder.
def test_manually_confirm(self): data = {} response = self.client.post(self.url, data) self.assertRedirects(response, reverse('reminders_dashboard')) reminder = reminders.SentNotification.objects.get(pk=self.unconfirmed.pk) self.assertEqual(reminder.status, 'manual') sel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_simple_confirmed(self):\n appt_date = datetime.date.today()\n reminders.Patient.objects.filter(\n pk__in=[self.test_patient.pk, self.other_patient.pk]\n ).update(next_visit=appt_date)\n confirmed = self.create_confirmed_notification(self.test_patient, appt_date)\n ...
[ "0.7132489", "0.71205854", "0.7068401", "0.69571435", "0.6854439", "0.6818445", "0.6656326", "0.6613488", "0.65836877", "0.65734375", "0.65642715", "0.6516952", "0.6467731", "0.6428601", "0.63626695", "0.6263337", "0.6243778", "0.61735356", "0.6168098", "0.61207914", "0.61087...
0.7576037
1
Update learning rate by the specified learning rate policy. For 'cosine' and 'poly' policies, the learning rate is updated by steps. For other policies, the learning rate is updated by epochs.
def step_lr(self, epoch_end=False): if (not epoch_end and self.do_step_lr) \ or (epoch_end and not self.do_step_lr): # forward per step or per epoch for sche in self.schedulers: sche.step()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _update_learning_rate(self):\r\n\r\n self.n_steps += 1\r\n lr = self.factor * self._get_lr_scale()\r\n for param_group in self._optimizer.param_groups:\r\n param_group['lr'] = lr", "def assign_learning_rate(session, lr_update, lr_placeholder, new_lr):\n session.run(lr_update,...
[ "0.7409927", "0.7212502", "0.72077066", "0.7159026", "0.711967", "0.7064366", "0.7045797", "0.7044591", "0.7035552", "0.70129627", "0.69852775", "0.69664645", "0.69564915", "0.6952231", "0.6925218", "0.6909553", "0.690336", "0.6902999", "0.68841535", "0.68675363", "0.68633574...
0.0
-1
Make a single gradient update. This is called by train() and should not be called manually.
def _step(self): # Make a minibatch of training data num_train = self.X_train.shape[0] # random choose the samples batch_mask = np.random.choice(num_train, self.batch_size) X_batch = self.X_train[batch_mask] y_batch = self.y_train[batch_mask] # Compute loss and g...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def perform_update(self, gradient):\n w = sys.modules[self.shared_mem_name].__dict__[\"w\"]\n w -= self.learning_rate * gradient", "def handle_gradient(self):\n self._optimizer.sync_grad()", "def update(self, gradient, optimizer=None, relink=None):\n # Recover the defaults, if missing\n...
[ "0.7505278", "0.71916544", "0.71801317", "0.7174867", "0.70683587", "0.691611", "0.6868984", "0.6849772", "0.6745127", "0.67012", "0.66904706", "0.6665345", "0.66300756", "0.65902466", "0.65838253", "0.6583645", "0.6573401", "0.65451306", "0.65233225", "0.6520716", "0.6519878...
0.6397833
25
Initialize the class and populate labels according to show_cmd.
def __init__(self, mode, name, node_labels, aio_node_prefix, node_label_helper, max_no_update_count, full_comms_message_type, tether_attribute, show_cmd, **widget_kwargs): self._show_cmd = show_cmd self._limits = {} if show_cmd: labels = [] for node ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, display):\n self.display = display\n self.labels = dict()", "def __init__(self, label):\n self.label = label", "def _init_display(self):\n raise NotImplementedError", "def __init__(self):\n self.label = \"! Numbering\"\n self.description = \"Check ...
[ "0.7286438", "0.6764917", "0.6660708", "0.6481526", "0.64483285", "0.6432519", "0.64005417", "0.63776034", "0.6353082", "0.6352359", "0.6338452", "0.633712", "0.63184005", "0.6314594", "0.6309029", "0.63089395", "0.6306647", "0.62955153", "0.62836355", "0.6271291", "0.6248567...
0.654835
3
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, ListAppsRequest): 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
Initialize a new node storing , with no next node.
def __init__(self, item): self.item = item self.next = None # Initially pointing to nothing
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n\n self.head = None\n self.node_count = 0", "def __init__(self):\n self.node = None\n self.data = None", "def __init__(self):\n self.size = 0\n self.head = Node(0)", "def __init__(self):\n self.root = Node(None)", "def __init__(self):\n ...
[ "0.7545726", "0.74467736", "0.7408655", "0.7407762", "0.7334426", "0.7300561", "0.72959715", "0.7290795", "0.7283581", "0.72739995", "0.71681565", "0.7158743", "0.7158743", "0.7156333", "0.7148674", "0.7141489", "0.71263534", "0.70405436", "0.7034229", "0.7034229", "0.7023306...
0.0
-1
Initialize a new linked list containing the given items. The first node in the linked list contains the first item in .
def __init__(self, items): if len(items) == 0: # No items, and an empty list! self._first = None else: self._first = _Node(items[0]) curr = self._first for item in items[1:]: curr.next = _Node(item) curr = curr.next
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, items):\n if len(items) == 0:\n self._first = None\n self._rest = None\n else:\n self._first = items[0]\n self._rest = LinkedListRec(items[1:])", "def __init__(self, items: list) -> None:\n if items == []:\n self._firs...
[ "0.77780277", "0.7514045", "0.74844074", "0.7438117", "0.70560646", "0.6919856", "0.67227983", "0.6710322", "0.6697007", "0.66781634", "0.6622026", "0.65524465", "0.65173554", "0.6469273", "0.6463215", "0.64528155", "0.64364386", "0.64092153", "0.6385144", "0.63465625", "0.63...
0.83739454
0