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
Returns an int64_list from a bool / enum / int / uint.
def _int64_feature(value): return tf.train.Feature(int64_list=tf.train.Int64List(value=[value]))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _BoolsToInts(arg_list):\n result = []\n for arg in arg_list:\n if isinstance(arg, (list, tuple)):\n result.append(_BoolsToInts(arg))\n elif arg is True:\n result.append(1)\n elif arg is False:\n result.append(0)\n else:\n result.append(arg)\n\n return result", "def convertT...
[ "0.68822104", "0.6595804", "0.6461252", "0.6448161", "0.6367609", "0.62926817", "0.6269916", "0.621823", "0.6104528", "0.59533274", "0.5947467", "0.5901199", "0.5863832", "0.5863832", "0.58563983", "0.5844792", "0.58434534", "0.5829844", "0.5801042", "0.5793561", "0.5793561",...
0.5505743
60
Return a `Organization` instance
def organization(self) -> "Organization": return Organization(connection=self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def organization(self):\r\n return Organization(self)", "def organization(self):\r\n return Organization(self)", "def organization(self):\r\n return Organization(self)", "def organization(self, organization_id_or_name):\r\n return Organization(self, organization_id_or_name)", "d...
[ "0.8315477", "0.8315477", "0.8315477", "0.7976894", "0.7793998", "0.7259227", "0.72516394", "0.71872085", "0.71642673", "0.7161686", "0.69761336", "0.69627666", "0.68899345", "0.68289363", "0.6578442", "0.6572516", "0.65491563", "0.6535535", "0.6459344", "0.64444417", "0.6421...
0.82481
3
Returns all the articles associated with the ticket id
def articles(self, id): response = self._connection.session.get( self._connection.url + "ticket_articles/by_ticket/%s?expand=true" % id ) return self._raise_or_return_json(response)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_articles(db:Session):\n return db.query(ArticleModel).all()", "def articles(id):\n articles = get_articles(id)\n return render_template('article.html', articles = articles)", "def get_articles(self, feed_id: int) -> List[Article]:\n articles = []\n for row in self._sqlite_con...
[ "0.70388067", "0.6946893", "0.6903714", "0.6870287", "0.68168986", "0.6596163", "0.6521517", "0.65166676", "0.6463067", "0.64507776", "0.63501775", "0.63451046", "0.6321786", "0.6286639", "0.6283536", "0.62564003", "0.62186486", "0.6185523", "0.6179265", "0.617552", "0.617073...
0.89543366
0
Returns current user information
def me(self): response = self._connection.session.get(self.url + "/me") return self._raise_or_return_json(response)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def current_user_info():\n\n return current_user", "def user_info(self):\n return self.auth.get_user_by_session()", "def user_info(self):\n response = self.query('user_info')\n return response", "def userinfo(self):\n return self._userinfo", "def user_info(self):\n \n ...
[ "0.9036465", "0.8510387", "0.8367878", "0.8218789", "0.81929076", "0.7955946", "0.79391986", "0.78689206", "0.7847911", "0.77840966", "0.7756478", "0.77308995", "0.7720596", "0.7685502", "0.76371914", "0.75677663", "0.75651944", "0.7551465", "0.7511643", "0.7473358", "0.74562...
0.0
-1
Create the model for the policy network and value network. The policy network and the value network share the model for feature extraction from the raw state, and then the policy network uses a softmax layer to provide the probablity of taking each action, and the value network uses a linear layer to provide a scalar f...
def _create_model(self, input_state, num_actions): with tf.name_scope('shared_layers'): layer = Dense(NN_WIDTH, activation = 'relu')(input_state); layer = Dense(NN_WIDTH, activation = 'relu')(layer); layer = Dense(NN_WIDTH, activation = 'relu')(layer); layer = Den...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_nn(self):\n with tf.name_scope('policy_network'):\n with tf.variable_scope(\"policy_network\"):\n model = tf.keras.Sequential(name='policy_network_model')\n model.add(tf.keras.layers.Dense(self.neurons_in_each_layer[0], activation=tf.nn.relu,\n ...
[ "0.77478456", "0.6956354", "0.6923989", "0.68631375", "0.6855013", "0.6760476", "0.6747145", "0.6708698", "0.66736734", "0.66466445", "0.6641403", "0.6614496", "0.660575", "0.66047925", "0.65901035", "0.6590041", "0.6586383", "0.6568927", "0.6564847", "0.6538908", "0.6529274"...
0.8128955
0
Creates new bullets based on the pose of the ship.
def shoot(self, charge, pose): bullets = [] # Angular velocity pose = pose.getPose(spin_speed=self.spin_speed) # Angle pose.rotate(self.angle) # Position pose.translate(pose.direction*self.barrel_length) # Velocity speed = self.speed*(self.speed_ch...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initiate_bullets(self, player_position_x, player_position_y):\n self.bullets.append(Bullet(player_position_x, player_position_y))", "def fire_bullet(ai_settings, screen, ship, bullets):\n new_bullet = Bullet(ai_settings, screen, ship)\n bullets.add(new_bullet)", "def fire_bullet(si_settings, s...
[ "0.69544816", "0.6707333", "0.66962636", "0.6626725", "0.66187334", "0.6476028", "0.6464248", "0.6459162", "0.63522065", "0.6330833", "0.6230763", "0.6144669", "0.6133946", "0.61095226", "0.61085695", "0.61085695", "0.6093104", "0.6072224", "0.6069212", "0.6066278", "0.593340...
0.64819497
5
Add a line at the end of a textfile.
def write_log(path, string, filename="log.txt"): # Open and Read f = open(os.path.join(path, filename), "r") lines = f.readlines() f.close() # Adding a line lines.append(string) # Write f = open(os.path.join(path, filename), "w") f.writelines(lines) f.close()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def append_new_line(file_name, text_to_append):\n # Open the file in append & read mode ('a+')\n with open(file_name, \"a+\") as file_object:\n # Move read cursor to the start of file.\n file_object.seek(0)\n # If file is not empty then append '\\n'\n data = file_object.read(100)\...
[ "0.75029063", "0.70421165", "0.6854501", "0.6835794", "0.67678285", "0.66688466", "0.6566253", "0.6556242", "0.6532724", "0.65136564", "0.6512686", "0.65104115", "0.6502265", "0.648011", "0.6469001", "0.6461652", "0.6446379", "0.6444167", "0.64315695", "0.6413467", "0.6406933...
0.0
-1
>>> ContentParser.is_operator(Token("Tj")) True >>> ContentParser.is_operator(Token("T")) True >>> ContentParser.is_operator(Token("'")) True >>> ContentParser.is_operator(Token('"')) True >>> ContentParser.is_operator(Token('1rna')) False
def is_operator(obj): return isinstance(obj, Token) and obj[0] not in '/01234567890+-.<[('
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isoperator(token):\n\n # Token is an operator\n return token and token.lower() in Token.OPERATORS", "def is_operator(operator):\n\t\tlist_of_operators = [\"+\", \"-\", \"*\", \"/\"]\n\t\treturn operator in list_of_operators", "def is_operator(t_char):\r\n eax = 1\r\n if ord(t_char) == 4...
[ "0.82157964", "0.7539865", "0.71975183", "0.7141983", "0.7140862", "0.7113701", "0.7052701", "0.69584894", "0.6904501", "0.68237835", "0.67919093", "0.6790943", "0.6534314", "0.65227205", "0.65096015", "0.64667314", "0.6418248", "0.6378003", "0.6355993", "0.6324159", "0.61524...
0.7872963
1
Test retrieving list of ingredients
def test_retrieve_ingredients_list(self): Ingredient.objects.create(user=self.user, name='Kale') Ingredient.objects.create(user=self.user, name='Salt') res = self.client.get(INGREDIENTS_URL) ings = Ingredient.objects.all().order_by('-name') serializer = IngredientSerializer(ings,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_retreive_ingredients_list(self):\n Ingredients.objects.create(user=self.user, name='Kale')\n Ingredients.objects.create(user=self.user, name='Carrot')\n\n res = self.client.get(INGREDIENT_URL)\n\n ingredients = Ingredients.objects.all().order_by('-name')\n serializer = I...
[ "0.82645243", "0.81885314", "0.81541115", "0.81417483", "0.8058961", "0.7925233", "0.78987557", "0.7886171", "0.7787524", "0.766352", "0.7366962", "0.733324", "0.73254704", "0.7295081", "0.7261514", "0.72599757", "0.72444016", "0.72348684", "0.71661913", "0.7162538", "0.71521...
0.7816779
8
Test creating invalid ingredient fails
def test_create_ingredient_invalid(self): payload = {'name':''} res = self.client.post(INGREDIENTS_URL, payload) self.assertEqual(res.status_code, status.HTTP_400_BAD_REQUEST)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_ingredient_invalid(self):\n payload = {'name': ''}\n res = self.client.post(INGREDIENTS_URL, payload)\n\n self.assertEqual(res.status_code, status.HTTP_400_BAD_REQUEST)", "def test_create_ingredient_invalid(self):\n\n payload = {'name': ''}\n\n res = self.client...
[ "0.83497715", "0.83294654", "0.83002603", "0.8057686", "0.7770113", "0.7435664", "0.7303773", "0.72957057", "0.71857834", "0.71669275", "0.706792", "0.7030051", "0.7009353", "0.6994454", "0.6981994", "0.6976951", "0.6852071", "0.677854", "0.6731926", "0.6722685", "0.6707674",...
0.8274991
3
Test filtering ingredients by those assigned to recipes
def test_retrieve_ingredients_assigned_to_recipes(self): ingredient1 = Ingredient.objects.create(user=self.user, name='Apple') ingredient2 = Ingredient.objects.create(user=self.user, name='Turkey') recipe = Recipe.objects.create(user=self.user, title='Apple crumble', time_minutes=5, price=10) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_search_recipes_by_ingredients(self):\n pass", "def test_filter_recipes_by_ingredients(self):\n recipe1 = sample_recipe(self.user, title='Waxy box')\n recipe2 = sample_recipe(self.user, title='Waxy noodle beans')\n ingredient1 = sample_ingredient(self.user, name='box')\n ...
[ "0.8263003", "0.8135737", "0.81171", "0.803867", "0.7916195", "0.7868197", "0.77629185", "0.7703184", "0.752715", "0.73869157", "0.7193408", "0.7087851", "0.70857686", "0.7013098", "0.70052224", "0.69367725", "0.6921367", "0.69058794", "0.68012005", "0.6800537", "0.67892224",...
0.6727914
23
Get a reference database folder.
def get_reference_database(ref_db, temp_folder): assert ref_db.endswith('.dmnd'), "Ref DB must be *.dmnd ({})".format(ref_db) # Get files from AWS S3 if ref_db.startswith('s3://'): logging.info("Getting reference database from S3: " + ref_db) # Save the database to the local temp folder ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_db_path():\n \n return(db_run.db_abs_path)", "def get_database_directory(self):\n pass", "def get_database_path():\n\treturn _paths[_DATABASE_PATH_KEY]", "def __get_db(self, folder):\n db_dir = os.path.join(self.home, self.ibooks_doc_root, folder)\n db_fullname = None\n\n ...
[ "0.71306294", "0.71255016", "0.7014994", "0.68524504", "0.68423957", "0.68068564", "0.6700143", "0.66393566", "0.6377407", "0.63147473", "0.6260071", "0.62549305", "0.6243818", "0.61192405", "0.6108577", "0.60816497", "0.60337764", "0.5973908", "0.596173", "0.5956381", "0.588...
0.6663672
7
Sets the address_id of this Shipper.
def address_id(self, address_id): self._address_id = address_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ship_to_pickup_address(self, address):\n self._set('shipping', 'pickup_address_id', address.id)", "def set_address(self, address):\n pass", "def address(self, address: object):\n\n self._address = address", "def setAddress(self, ip_address):\n # type: (str)->None\n\n se...
[ "0.6885616", "0.68763816", "0.642383", "0.6410101", "0.63712573", "0.6350626", "0.6288974", "0.62302196", "0.62302196", "0.62302196", "0.62302196", "0.62302196", "0.62302196", "0.62302196", "0.62302196", "0.62018466", "0.6198084", "0.619335", "0.6147447", "0.6123823", "0.6116...
0.84413856
1
Sets the shipper_reference of this Shipper.
def shipper_reference(self, shipper_reference): self._shipper_reference = shipper_reference
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def shipper_department(self, shipper_department):\n\n self._shipper_department = shipper_department", "def shipping(self, shipping):\n\n self._shipping = shipping", "def set_ship(self, ship: Ship):\n if self._ship:\n self._ship.stop_listening(self.ship_took_damage)\n\n se...
[ "0.67659587", "0.63978875", "0.6155269", "0.5987751", "0.5987751", "0.5761969", "0.5738174", "0.5719372", "0.5710848", "0.5594228", "0.5593013", "0.55777454", "0.54848814", "0.5474146", "0.5418891", "0.53974855", "0.5387044", "0.52798814", "0.5277894", "0.5220785", "0.5220785...
0.8970073
0
Sets the shipper_department of this Shipper.
def shipper_department(self, shipper_department): self._shipper_department = shipper_department
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def department(self, department):\n\n self._department = department", "def department(self, department):\n\n self._department = department", "def department(self, department: object):\n\n self._department = department", "def shipper_reference(self, shipper_reference):\n\n self._sh...
[ "0.74628335", "0.74628335", "0.73024607", "0.61924636", "0.60652", "0.5597042", "0.55901843", "0.55901843", "0.54664266", "0.536367", "0.5187187", "0.49587166", "0.48493195", "0.4782032", "0.47557163", "0.47466755", "0.4743986", "0.4715979", "0.4679068", "0.46104825", "0.4526...
0.91552335
0
Sets the company_name of this Shipper.
def company_name(self, company_name): self._company_name = company_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_CompanyName(self, value):\n super(AddressValidationInputSet, self)._set_input('CompanyName', value)", "def company(self, company):\n self._company = company", "def company(self, company):\n\n self._company = company", "def company(self, company):\n\n self._company = compan...
[ "0.749121", "0.7237694", "0.71657586", "0.71657586", "0.65922076", "0.64805466", "0.6391986", "0.62962836", "0.62962836", "0.61920357", "0.6003719", "0.59064716", "0.58890927", "0.5783363", "0.5777552", "0.5746954", "0.5735284", "0.57184", "0.57184", "0.5695987", "0.568296", ...
0.8477372
0
Sets the contact_name of this Shipper.
def contact_name(self, contact_name): self._contact_name = contact_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def contact(self, contact):\n\n self.logger.debug(\"In 'contact' setter.\")\n\n self._contact = contact", "def contact(self, contact):\n\n self._contact = contact", "def contact(self, contact):\n\n self._contact = contact", "def contact_name(self) -> str:\n return pulumi.ge...
[ "0.6867439", "0.65974635", "0.65974635", "0.6563238", "0.6503109", "0.6454066", "0.6312135", "0.6288105", "0.6288105", "0.62190604", "0.62092996", "0.62092996", "0.6205595", "0.619387", "0.619387", "0.619387", "0.619387", "0.619387", "0.6180943", "0.6160226", "0.6157045", "...
0.8503755
0
Sets the address_line3 of this Shipper.
def address_line3(self, address_line3): self._address_line3 = address_line3
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def address_line1(self, address_line1):\n\n self._address_line1 = address_line1", "def address_line1(self, address_line1):\n\n self._address_line1 = address_line1", "def address_line2(self, address_line2):\n\n self._address_line2 = address_line2", "def address_line2(self, address_line2):...
[ "0.6290439", "0.6290439", "0.6118142", "0.6118142", "0.6118142", "0.5799908", "0.5746496", "0.56585157", "0.5634919", "0.5628585", "0.5614093", "0.5603477", "0.55808204", "0.55674434", "0.5546276", "0.54826397", "0.54540616", "0.54440105", "0.5419462", "0.53430223", "0.529064...
0.85781455
0
Sets the postcode of this Shipper.
def postcode(self, postcode): self._postcode = postcode
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def post_code(self, post_code):\n\n self._post_code = post_code", "def postal_code(self, postal_code):\n\n self._postal_code = postal_code", "def postal_code(self, postal_code):\n\n self._postal_code = postal_code", "def postal_code(self, postal_code):\n\n self._postal_code = post...
[ "0.767718", "0.7412647", "0.7412647", "0.7412647", "0.72635156", "0.658449", "0.6165669", "0.6165669", "0.6158476", "0.5891153", "0.58003527", "0.57402116", "0.57089835", "0.5612925", "0.5553841", "0.55108565", "0.5421363", "0.54034305", "0.53849626", "0.53849626", "0.5334848...
0.81773925
2
Sets the phone_number of this Shipper.
def phone_number(self, phone_number): self._phone_number = phone_number
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def phone(self, new_number):\n self._phone.number = new_number", "def person_phone_number(self, person_phone_number):\n\n self._person_phone_number = person_phone_number", "def setPhone(self,phone):\r\n self.phone = phone", "def setPhone(self, phone):\n self.phone = phone\n ...
[ "0.77741486", "0.7548591", "0.75392634", "0.7532653", "0.731644", "0.731644", "0.731644", "0.731644", "0.731644", "0.72484684", "0.718488", "0.7148577", "0.7049014", "0.7048473", "0.694723", "0.6947113", "0.6861802", "0.67675704", "0.67421275", "0.664361", "0.6608686", "0.6...
0.8214727
2
Sets the email_address of this Shipper.
def email_address(self, email_address): self._email_address = email_address
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def email_address(self, email_address: \"str\"):\n self._attrs[\"emailAddress\"] = email_address", "def email(self, email):\n\n self._email = email", "def email(self, email):\n\n self._email = email", "def email(self, email):\n\n self._email = email", "def email(self, email):\n\...
[ "0.77891815", "0.7519063", "0.7519063", "0.7519063", "0.7519063", "0.7519063", "0.7519063", "0.7519063", "0.7519063", "0.7519063", "0.7519063", "0.74892384", "0.74364823", "0.7352302", "0.72546875", "0.72546875", "0.7215233", "0.71067286", "0.6858424", "0.68468946", "0.684608...
0.7908744
2
Sets the vat_number of this Shipper.
def vat_number(self, vat_number): self._vat_number = vat_number
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vat(self, vat):\n if vat is None:\n raise ValueError(\"Invalid value for `vat`, must not be `None`\") # noqa: E501\n\n self._vat = vat", "def vat_id(self, vat_id):\n\n self._vat_id = vat_id", "def vat_id(self, vat_id: str):\n\n self._vat_id = vat_id", "def set_vat_...
[ "0.7092333", "0.69663215", "0.68762094", "0.61957026", "0.6166759", "0.612829", "0.6109457", "0.6009419", "0.5986041", "0.5926051", "0.59222883", "0.58299816", "0.57385826", "0.5625372", "0.55887306", "0.555703", "0.5498055", "0.5491585", "0.5450309", "0.5399167", "0.53898364...
0.83798707
1
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, Shipper): 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
Default Colormap for soil moisture in CCI and C3S BrownYellowBlue
def smecv_sm(N: int = 256, set_over_under: bool = True) \ -> colors.LinearSegmentedColormap: steps = np.array([[134, 80, 16], [164, 117, 13], [219, 190, 24], [250, 249, 156], [144, 202, 240], [4, 14...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_cityscapes_label_colormap():\r\n colormap = np.zeros((256, 3), dtype=np.uint8)\r\n colormap[0] = [128, 64, 128]\r\n colormap[1] = [244, 35, 232]\r\n colormap[2] = [70, 70, 70]\r\n colormap[3] = [102, 102, 156]\r\n colormap[4] = [190, 153, 153]\r\n colormap[5] = [153, 153, 153]\r\n colormap[6] = ...
[ "0.69152653", "0.6728773", "0.67108226", "0.6618466", "0.6611814", "0.6601009", "0.653578", "0.6423996", "0.6408452", "0.6370054", "0.63682777", "0.63169456", "0.62204194", "0.6154088", "0.6154088", "0.6154088", "0.6145811", "0.614221", "0.61383456", "0.61383456", "0.6131441"...
0.0
-1
Returns all tfrecord file paths of images that do not need an helper to compute their labels.
def get_replay_source_no_helper_paths(self): paths = [] classes = self.get_replay_classes_no_helper() base_path = self.base_folder_path + "/data/replay_images/" + self.replay_source + "/" for c in classes: full_path = base_path + str(c).zfill(2) + ".tfrecord" ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_labels():\n return [name for name in os.listdir(os.getcwd() + '/assets/images') if name != 'test']", "def _get_filenames():\n src_dir = os.path.join(FLAGS.dataset_dir, FLAGS.src_dir)\n filenames = [os.path.join(src_dir, f) for f in os.listdir(src_dir) if\n f.endswith(\".tfrecord\...
[ "0.67560405", "0.6476112", "0.63445437", "0.6182512", "0.6166062", "0.61402833", "0.6132274", "0.61106193", "0.5950202", "0.5918637", "0.591863", "0.5886411", "0.5881882", "0.5818159", "0.58065534", "0.5749788", "0.57312596", "0.5713824", "0.570538", "0.5683394", "0.5663048",...
0.684677
0
Returns the name (without extension) of the validation file
def get_validation_file_name(self): name = self.test_name + " (T" + str(self.test_index) + "_P" + str(self.parameters_common_index) + "." + \ str(self.parameters_fs_index) + "." + \ str(self.parameters_helper_index) + "." + \ str(self.parameters_incremental_index) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_validation_file_path(self):\n validation_file_name = self.get_validation_file_name()\n if self.helper_decoders_one_class:\n validation_file_name = validation_file_name + \"_1\"\n\n return self.base_folder_path + \"/outputs/\" + validation_file_name + \".txt\"", "def getSBM...
[ "0.7391716", "0.71238303", "0.702272", "0.6980781", "0.68641186", "0.67736787", "0.67539054", "0.67081696", "0.66690964", "0.6668111", "0.6666055", "0.66372037", "0.65999615", "0.659508", "0.6575232", "0.65700597", "0.6565453", "0.6537831", "0.65124893", "0.650942", "0.650942...
0.79006994
0
vertex vertex > float Returns the distance between the two vertices.
def dist(self, other): return math.sqrt((self.x - other.x)**2 + (self.y - other.y)**2 + (self.z - other.z)**2)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vertex_distance(self, v1, v2):\n return utils.real_distance(self.node_locations[v1], self.node_locations[v2])", "def distance_to(self, v: Vector) -> float:\n return math.fabs(self.signed_distance_to(v))", "def distance_to_xyz(self, to_vertex):\n return math.sqrt(math.pow(to_vertex.x - ...
[ "0.7754167", "0.6377777", "0.6374681", "0.6306013", "0.6255264", "0.6241741", "0.6211265", "0.6199141", "0.6163237", "0.61201763", "0.611154", "0.6085634", "0.6071476", "0.6061854", "0.60372734", "0.60167384", "0.6005737", "0.5985937", "0.5974582", "0.59738386", "0.5966455", ...
0.59130067
25
face int > vector Returns the vector normal to the face (normalized).
def normalVect(self, n=2): L = len(self.vertices) normals = [] while len(normals) < n: j = randrange(L) v0 = vector(self.vertices[j].coords()) v1 = vector(self.vertices[int(j + L / 3) % L].coords()) v2 = vector(self.vertices[int(j + 2 * L / 3) % L]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normal_vector(self, facet):\n assert len(facet) == 3\n pos = self.cluster.get_positions()\n v1 = pos[facet[1], :] - pos[facet[0], :]\n v2 = pos[facet[2], :] - pos[facet[0], :]\n n = np.cross(v1, v2)\n length = np.sqrt(np.sum(n**2))\n return n / length", "def n...
[ "0.759327", "0.6925615", "0.6866574", "0.68592674", "0.68325394", "0.68186283", "0.6769369", "0.67102784", "0.6682227", "0.6663213", "0.6640775", "0.65752876", "0.6572164", "0.65561986", "0.6493176", "0.6398592", "0.638766", "0.6379574", "0.6378086", "0.6365555", "0.6344527",...
0.6355691
20
face vertex vertex vertex > None Adds a new vertex in .vertices between the two vertices given.
def addVertexBetween(self, v1, nV, v2): n = len(self.vertices) if nV not in self.vertices: for i in range(n): if self.vertices[i] == v1: if self.vertices[(i + 1) % n] == v2: self.vertices.insert((i + 1) % n, nV) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_vertex(self, vertex):\n if vertex.id not in self.vertices.keys():\n self.vertices[vertex.id] = vertex", "def add_edge(self, v1, v2):\n pass # TODO\n # both vertices have to exist to make connection(e.g. directed edge)\n\n if v1 in self.vertices and v2 in self.vertices:...
[ "0.6984822", "0.6654363", "0.6618703", "0.65404576", "0.6537266", "0.6523339", "0.6485942", "0.64747983", "0.64293957", "0.64255667", "0.6425538", "0.6403592", "0.6396756", "0.63887984", "0.6384248", "0.6382023", "0.63800126", "0.63614243", "0.6360825", "0.635048", "0.635048"...
0.66238374
2
face vertex > bool Returns wether is on the interior side of .
def isOnInteriorSide(self, v): n = self.normalVect() return n.dotProduct(vector(self.vertices[0]) - vector(v)) > 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_vertex(self): \n return False", "def is_vertex(self):\n return True", "def is_vertex(self):\n return True", "def is_vertex(self):\n return False", "def faceIntersection(self, face):\n # Test wether both ends of the edge are in the same half space\n # ...
[ "0.7455846", "0.7176409", "0.7176409", "0.71401477", "0.6894717", "0.6824649", "0.6678366", "0.65515804", "0.63832283", "0.6300655", "0.62983876", "0.6217232", "0.6170218", "0.6163973", "0.61513275", "0.61390305", "0.6106189", "0.60620403", "0.6058401", "0.605294", "0.6051304...
0.7004704
4
None > polyhedron Returns a basic polyhedron with one vertex (at (0,0,0)) and one face with the vertex. This is the most basic polyhedron which satisfies Euler's polyhedral formula. Corresponds to Baumgart's MKBFV function.
def makeBasicPolyhedron(): v = vertex(0, 0, 0) return polyhedron([v], [], [face([v])])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cuboctahedron(self):\n one = Integer(1)\n v = [ [0, -one/2, -one/2], [0, one/2, -one/2], [one/2, -one/2, 0], \n [one/2, one/2, 0], [one/2, 0, one/2], [one/2, 0, -one/2], \n [0, one/2, one/2], [0, -one/2, one/2], [-one/2, 0, one/2],\n [-one/2, one/2, 0], [-on...
[ "0.6392892", "0.63583404", "0.6134595", "0.61278063", "0.61278063", "0.60392237", "0.60319424", "0.58751494", "0.58000183", "0.57050157", "0.57000065", "0.5675616", "0.5659242", "0.5601991", "0.5590414", "0.55898625", "0.55872756", "0.55578804", "0.5554497", "0.5487914", "0.5...
0.73588663
0
polyhedron vertex list > face Returns (if it exists) the face that has as vertices.
def getFace(self, vertices): for f in self.faces: if f.vertices == vertices: return f raise ValueError('No face found')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vertices(self):\n\n if self._faces is None:\n if self._vertices is None:\n return None\n self.triangulate()\n return self._vertices", "def faces(self):\n\n if self._faces is None:\n if self._vertices is None:\n return None\n ...
[ "0.650274", "0.6497608", "0.6457996", "0.63674814", "0.6319706", "0.62773424", "0.6192633", "0.6179862", "0.6143773", "0.6110268", "0.60993874", "0.6097296", "0.60497767", "0.60303193", "0.5984364", "0.5929534", "0.5919999", "0.58351415", "0.5834142", "0.58030945", "0.5803094...
0.6848331
0
polyhedron face vertex vertex > edge face Splits into two faces and creates an edge from and to separate them. Returns the separating edge and the new face. Corresponds to Baumgart's eulerian primitive MKFself.
def faceSplit(self, f, v1, v2): if self.containsEdge(v1, v2): raise ValueError('There is already an edge between' 'the vertices given.' 'Is your polyhedron really one ?') try: i1 = f.vertices.index(v1) i2 = f.v...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def form_face(edge, pivot):\n return tuple(list(edge) + [pivot])", "def halfedgeConstruction(self,facetList):\n\t\tedges = []\n\t\t# the temporary map of the halfedges\n\t\tedgeMap = {}\n\t\tcount = 0\n\t\tfor i in range(0,len(facetList)):\n\t\t\t# \n\t\t\tfor j in range(0,len(facetList[i])):\n\t\t\t\t# j is ...
[ "0.6283501", "0.61778265", "0.6155645", "0.61083865", "0.6044137", "0.59138656", "0.5893302", "0.58224666", "0.5817002", "0.5807773", "0.5798878", "0.57370925", "0.5720855", "0.5684132", "0.5643012", "0.5627617", "0.55658484", "0.55618757", "0.5551616", "0.54623044", "0.54386...
0.6927274
0
polyhedron > () Plots the polyhedron using matplotlib.
def plot(self, plotEdges=False, emphaseEdges=[], col=('b', 'k', 'r'), lims=None, ort=False): ax = a3.Axes3D(plt.figure()) ax.set_xlabel('x') ax.set_ylabel('y') ax.set_zlabel('z') ax.dist = 30 ax.azim = -140 if lims is None: lims = [0, 0, 0] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def DisplayMesh():\r\n \r\n # Load Surface Mesh Data and generate normals\r\n VTKString = OpenData('C:/Users/Tim/Documents/University/Year 4/Final Project/FinalYearProjectCode/TEH_Code/InputFiles','muscle_surface.vtk')\r\n header, Vertices, Triangles = CreateMatrixVTK(VTKString)\r\n \r\n fig = pl...
[ "0.66723454", "0.64295167", "0.6388495", "0.6388495", "0.6387799", "0.6190675", "0.6093156", "0.60881066", "0.60488456", "0.6042494", "0.60121316", "0.6009422", "0.60020155", "0.6000066", "0.59834504", "0.59164107", "0.5914741", "0.5900658", "0.5896283", "0.58683425", "0.5841...
0.5370966
68
polyhedron ((float float float) > (float float float)) > () Applies to all of 's vertices.
def apply(self, f): for v in self.vertices: v.x, v.y, v.z = f(v.coords())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def simplex(v1, v2, v3):\n res = polyhedron([], [], [])\n p0 = res.addVertex(vertex(0, 0, 0))\n p1 = res.addVertex(vertex(v1))\n p2 = res.addVertex(vertex(v2))\n p3 = res.addVertex(vertex(v3))\n p12 = res.addVertex(vertex(v1 + v2))\n p13 = res.addVertex(vertex(v1 + v3))\n p23 = res.addVerte...
[ "0.6455545", "0.64201945", "0.64201945", "0.6092028", "0.6056283", "0.5951551", "0.5945496", "0.5920928", "0.5877675", "0.5744521", "0.5663194", "0.5622109", "0.5606873", "0.56061214", "0.5577277", "0.55740607", "0.5568203", "0.5552662", "0.5547745", "0.55474555", "0.5538046"...
0.0
-1
vector vector > float Returns the dot product of the two vectors.
def dotProduct(self, v): return self.x * v.x + self.y * v.y + self.z * v.z
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dot(vector_1: List, vector_2: List) -> float:\n if len(vector_1) != len(vector_2):\n raise InvalidInput(error_code_messages[\"InvalidLength\"])\n\n return sum(x * y for x, y in zip(vector_1, vector_2))", "def dot(a, b):\n\n if len(a) != len(b):\n raise Exception(\"Input vectors...
[ "0.8475832", "0.8470601", "0.8308196", "0.8216782", "0.8191412", "0.8162204", "0.80001503", "0.79528546", "0.7928741", "0.79224443", "0.78357816", "0.78200436", "0.77608407", "0.77302235", "0.77182835", "0.77128744", "0.76873595", "0.7686355", "0.76718855", "0.7664705", "0.76...
0.7250189
46
vector vector > float Returns the x component of the cross product of self and other.
def xCrossProd(self, other): return other.y * self.z - other.z * self.y
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cross(self, other):\n if isinstance(other, float):\n return Vector(other*self.y, -other*self.x)\n\n if isinstance(other, Vector):\n return self.x*other.y - self.y*other.x", "def cross(self, other: PointOrIterable) -> float:\n try:\n return (self.x * other...
[ "0.8002127", "0.7737465", "0.7595101", "0.74691385", "0.73980606", "0.7349577", "0.733723", "0.71455973", "0.71125937", "0.70875454", "0.7062396", "0.701941", "0.70029145", "0.6987132", "0.68737423", "0.68656135", "0.6861305", "0.68021876", "0.6784891", "0.676297", "0.6750324...
0.7948008
1
silhouette float > polyhedron Returns the cone polyhedron corresponding to the silhouette.
def cone(self, length): X, Y, Z = baseFromAngles(self.angles) result = polyhedron([], [], []) assert result.pnFacesInPoly() f = result.addVertex(self.focalPoint) for s in self.segments: vect0 = (self.focalDist * X + s[0][0] * Z + ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def heights_cone(self, side=None):\n I = self.intersection_matrix()\n C = self.suspension_cone(side)\n\n from sage.geometry.polyhedron.constructor import Polyhedron\n return Polyhedron(rays=[-I*c.vector() for c in C.rays()])", "def small_rhombicuboctahedron(self):\n verts = [ [...
[ "0.6264594", "0.6109996", "0.58095956", "0.57861763", "0.57861763", "0.5774392", "0.5693221", "0.56383073", "0.5603029", "0.5525055", "0.55137384", "0.53679305", "0.53473485", "0.5244624", "0.5216951", "0.5206273", "0.52031106", "0.51792353", "0.5141609", "0.51040125", "0.509...
0.5241718
14
None > vector3 Returns an orthonormal base of R3.
def onBase(): return (vector(1, 0, 0), vector(0, 1, 0), vector(0, 0, 1))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calcular_norma_r3():\n x, y, z = carga_vector()\n norma = math.sqrt(x**2 + y**2 + z**2)\n print('\\nLa norma del vector ({},{},{}) es: {}'.format(x, y, z, norma))", "def I3_u3(self) -> complex:\n return self.I3_u1() * cmath.rect(1, 120 / 180 * cmath.pi)", "def randomSO3():\n\tu1 = random.ra...
[ "0.6531345", "0.5982122", "0.5906623", "0.5883041", "0.58436185", "0.5802756", "0.5780555", "0.5777715", "0.5657134", "0.56404704", "0.5631828", "0.5617347", "0.56106925", "0.5553391", "0.5530876", "0.5517966", "0.5501335", "0.54854417", "0.54731876", "0.54611355", "0.5460641...
0.0
-1
x Valor a ser calculado X Vetor com valores de x Y Vetor com valores de f(x) dY Vetor com valores de f'(x)
def H(x, X, Y, dY): def L(i): #return p[i] * (x ** i) p = [(x - X[i]) / (X[j] - X[i]) for j in range(n) if j != i] return reduce(op.mul, p) def dL(i): #return d[i-1] * (x ** (i-1)) if i < n-1: return (Y[i+1] - Y[i]) / (X[i+1] - X[i]) else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_df(x):\n dfx = np.array([x[1]*np.cos(x[0])+np.cos(x[1]),\n np.sin(x[0])-x[0]*np.sin(x[1])])\n return dfx", "def df(self, x):\n\n return 2*math.exp(x*2) - math.exp(x)", "def _derX(self, x, y):\n if _isscalar(x):\n x_pos = max(min(self.xSearc...
[ "0.7227632", "0.7193496", "0.68446356", "0.67782277", "0.67102814", "0.670847", "0.6660728", "0.6660728", "0.66341174", "0.66181797", "0.6617904", "0.66114414", "0.6604835", "0.6591115", "0.6563416", "0.65542334", "0.6517603", "0.6510425", "0.6494457", "0.64915496", "0.648644...
0.0
-1
Linear and quantile bins are correct
def test_bins(self): for filename in ['%s/population_padang_1.asc' % TESTDATA, '%s/test_grid.asc' % TESTDATA]: R = read_layer(filename) rmin, rmax = R.get_extrema() for N in [2, 3, 5, 7, 10, 16]: linear_intervals = R.get_bins(N=N, q...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def quantile(feature, bins):\n t = feature.sort_values().values\n w = round(len(t)/bins)\n return [t[w*i-1] for i in range(1, bins)]", "def transfo_quantile(xx):\n\n # nn = np.zeros(len(xx))\n # oo = np.argsort(xx)\n # nn[oo] = np.arange(len(xx)) / len(xx) + 1 / (2 * len(xx))\n # ...
[ "0.6817819", "0.67792207", "0.66839904", "0.6609035", "0.6577213", "0.64610934", "0.6448858", "0.6379628", "0.6295525", "0.6285222", "0.62521803", "0.6203517", "0.61321586", "0.6096803", "0.60894614", "0.6084364", "0.6083851", "0.6074455", "0.60225976", "0.6020756", "0.601982...
0.6220743
11
Test to see if internationalisation is working correctly. Make sure to include this file when using xgettext to scan for translatable strings.
def test_i18n(self): # If you want to modify this code, please get acquainted with # Python's locale module. In particular: # http://docs.python.org/library/locale.html#locale.getdefaultlocale # Set the standard C locale. os.environ['LANG'] = 'C' os.environ['LC_ALL'] = '...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_settings(self):\n \n self.assertTrue(settings.USE_I18N, msg=\"setting USE_I18N must be True to have languages working\")", "def test_i18n23(self):\n with translation.override('de'):\n output = self.engine.render_to_string('i18n23')\n self.assertEqual(output, 'nicht...
[ "0.7101887", "0.7042391", "0.6912037", "0.6899667", "0.6838655", "0.68248886", "0.6779982", "0.6777021", "0.67762136", "0.6730435", "0.6628043", "0.66265714", "0.6618531", "0.66065925", "0.6583775", "0.6579655", "0.6549567", "0.6526331", "0.65211123", "0.6466104", "0.64559627...
0.7649081
0
convert 'Part N' into (N)
def episode_title_for_tvdb(self): # strip out the year from the episode title: return re.sub('(Part )(?P<part>\d+)','(\g<part>)',self.episode_title)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def partid2nids(self, partid, ntype=...):\n ...", "def partid2nids(self, partid, ntype=...):\n ...", "def nid2partid(self, nids, ntype=...):\n ...", "def nid2partid(self, nids, ntype=...):\n ...", "def nid2partid(self, nids, ntype): # -> None:\n ...", "def partid2nids(s...
[ "0.634691", "0.634691", "0.6298135", "0.6298135", "0.6232319", "0.61476564", "0.59712017", "0.5857806", "0.57464665", "0.5735004", "0.5713158", "0.5708961", "0.5699932", "0.5666522", "0.5644759", "0.5634299", "0.56224215", "0.56136054", "0.5583183", "0.5582155", "0.551372", ...
0.0
-1
convert 'Part N' into (N)
def episode_title_for_tvdb(self): # strip out the year from the episode title: return "Episode %d"%self.episode_number[1]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def partid2nids(self, partid, ntype=...):\n ...", "def partid2nids(self, partid, ntype=...):\n ...", "def nid2partid(self, nids, ntype=...):\n ...", "def nid2partid(self, nids, ntype=...):\n ...", "def nid2partid(self, nids, ntype): # -> None:\n ...", "def partid2nids(s...
[ "0.634691", "0.634691", "0.6298135", "0.6298135", "0.6232319", "0.61476564", "0.59712017", "0.5857806", "0.57464665", "0.5735004", "0.5713158", "0.5708961", "0.5699932", "0.5666522", "0.5644759", "0.5634299", "0.56224215", "0.56136054", "0.5583183", "0.5582155", "0.551372", ...
0.0
-1
Tests to see that the current request is from a user with administrator privileges.
def test_project_administrator(project): if is_server_administrator(): return True if is_project_administrator(project): return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def assert_requester_is_admin(auth: Auth, request: SynapseRequest) -> None:\n requester = await auth.get_user_by_req(request)\n await assert_user_is_admin(auth, requester)", "def _check_admin_only(self, request):\r\n api_key = request.params.get(self.api_field, None)\r\n\r\n if request....
[ "0.74539584", "0.74130994", "0.73399377", "0.7238531", "0.721977", "0.7186139", "0.7143937", "0.7133418", "0.7133418", "0.710751", "0.7039022", "0.6959957", "0.693229", "0.69273055", "0.6897696", "0.6897696", "0.68879503", "0.6824636", "0.6817539", "0.68120396", "0.68053746",...
0.68308014
17
Tests to see that the current request is from a user with write privileges.
def test_project_writer(project): if is_server_administrator(): return True if is_project_administrator(project): return True if is_project_writer(project): return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_write_permission(request):\n user = request.user\n return user.is_superuser", "def has_write_permission(request):\n # TODO: Stop users from writing other users' pageranks. Why should that be so hard?\n return request.user.is_authenticated", "def _testIdWriteAccess(self):\n ...
[ "0.7736975", "0.7562459", "0.7215515", "0.68424565", "0.6612809", "0.660365", "0.6437522", "0.63838154", "0.6351333", "0.632643", "0.63257027", "0.6270679", "0.6253172", "0.6237377", "0.62059885", "0.6195455", "0.618146", "0.6178083", "0.6147471", "0.61452484", "0.61232287", ...
0.6518801
6
Tests to see that the current request is from a user with read privileges.
def test_project_reader(project): if is_server_administrator(): return True if is_project_administrator(project): return True if is_project_writer(project): return True if is_project_reader(project): return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_read_permission(request):\n return request.user.is_authenticated", "def can_read(self, user):\n raise Return(True)", "def read_allowed(self, ui, req):\n\n user = req.env.get('REMOTE_USER')\n\n deny_read = ui.configlist('web', 'deny_read', untrusted=True)\n if deny_rea...
[ "0.75844544", "0.74595964", "0.72332346", "0.7139597", "0.7068315", "0.67400914", "0.6707806", "0.6683332", "0.66480315", "0.66359395", "0.65355736", "0.63827574", "0.6339389", "0.63161445", "0.6309798", "0.62568843", "0.6242229", "0.6212795", "0.6157258", "0.61382186", "0.61...
0.58834666
53
Tests to see that the current request is from a user with administrator privileges.
def require_project_administrator(project): if not test_project_administrator(project): raise cherrypy.HTTPError(403)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def assert_requester_is_admin(auth: Auth, request: SynapseRequest) -> None:\n requester = await auth.get_user_by_req(request)\n await assert_user_is_admin(auth, requester)", "def _check_admin_only(self, request):\r\n api_key = request.params.get(self.api_field, None)\r\n\r\n if request....
[ "0.74539584", "0.74130994", "0.73399377", "0.7238531", "0.721977", "0.7186139", "0.7143937", "0.7133418", "0.7133418", "0.710751", "0.7039022", "0.6959957", "0.693229", "0.69273055", "0.6897696", "0.6897696", "0.68879503", "0.68308014", "0.6824636", "0.6817539", "0.68120396",...
0.630035
79
Tests to see that the current request is from a user with write privileges.
def require_project_writer(project): if not test_project_writer(project): raise cherrypy.HTTPError(403)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_write_permission(request):\n user = request.user\n return user.is_superuser", "def has_write_permission(request):\n # TODO: Stop users from writing other users' pageranks. Why should that be so hard?\n return request.user.is_authenticated", "def _testIdWriteAccess(self):\n ...
[ "0.7736975", "0.7562459", "0.7215515", "0.68424565", "0.6612809", "0.660365", "0.6518801", "0.6437522", "0.63838154", "0.6351333", "0.632643", "0.63257027", "0.6270679", "0.6253172", "0.6237377", "0.62059885", "0.6195455", "0.618146", "0.6178083", "0.6147471", "0.61452484", ...
0.0
-1
Tests to see that the current request is from a user with read privileges.
def require_project_reader(project): if not test_project_reader(project): raise cherrypy.HTTPError(403)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_read_permission(request):\n return request.user.is_authenticated", "def can_read(self, user):\n raise Return(True)", "def read_allowed(self, ui, req):\n\n user = req.env.get('REMOTE_USER')\n\n deny_read = ui.configlist('web', 'deny_read', untrusted=True)\n if deny_rea...
[ "0.75844544", "0.74595964", "0.72332346", "0.7139597", "0.7068315", "0.67400914", "0.6707806", "0.6683332", "0.66480315", "0.66359395", "0.65355736", "0.63827574", "0.6339389", "0.63161445", "0.6309798", "0.62568843", "0.6242229", "0.6212795", "0.6157258", "0.61382186", "0.61...
0.0
-1
Tests to see that the current request is from the user that created the given worker.
def require_worker_creator(worker): if is_server_administrator(): return if is_worker_creator(worker): return raise cherrypy.HTTPError(403)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def authorizes(self, user):\n return self.owner == user or self.workers.filter(pk=user.id).exists()", "def test_user_is_sender(self):\n sender = self.create_user()\n thread = self.create_thread(sender=sender, status='pending')\n self.assertTrue(thread.first_message.visible_to_user(sen...
[ "0.7078654", "0.6688829", "0.63387334", "0.6306361", "0.6204395", "0.60571516", "0.5994277", "0.59838295", "0.59561306", "0.59561306", "0.5953359", "0.59448534", "0.5933571", "0.5926726", "0.59208316", "0.590949", "0.58848894", "0.5883457", "0.5853283", "0.5846871", "0.582029...
0.65450597
2
Find the indices in a list of LineStrings that touch a given LineString.
def neighbors(lines, of): return [k for k, line in enumerate(lines) if line.touches(of)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def search_string(self, string):\r\n if type(string) != str:\r\n raise TypeError(\"Item given is not of type string\")\r\n line_num = task2.ListADT()\r\n for index in range(len(self.text_lines)):\r\n i = 0\r\n for char in self.text_lines[index]:\r\n ...
[ "0.6813444", "0.6567643", "0.644021", "0.6312185", "0.62870467", "0.62757295", "0.6241628", "0.6234033", "0.6204614", "0.61416864", "0.61223805", "0.600046", "0.5999949", "0.5963494", "0.59579265", "0.59551775", "0.59551555", "0.59262747", "0.59149235", "0.5840067", "0.581548...
0.56643784
27
Get if light in on or off.
def is_on(self): return self._client.get_power()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def light_is_on(self):\r\n return self._light == \"ON\"", "def light_is_on(self):\n return self._light == \"ON\"", "def is_on(self):\n return self._light_on", "def is_on(self):\n return self._sensor_state()", "def is_on(self):\n return self._brightness != 0", "def is_on...
[ "0.82439286", "0.81483865", "0.8046978", "0.7349729", "0.72219056", "0.71996", "0.7173374", "0.71531725", "0.7143898", "0.7141985", "0.7078706", "0.7075011", "0.70531297", "0.70427823", "0.7022951", "0.70172155", "0.7008183", "0.7008183", "0.6980169", "0.6980169", "0.6980169"...
0.70606226
12
Give all values of Skew(DNA) We define skew(DNA) as the difference between the total number of occurrences of G and the total number of occurrences of C in DNA.
def compute_gc_skew(DNA, chart=False): running_skew = [0] G_C = 0 min = 0 min_indexes = [] for i in range(len(DNA)): if DNA[i] == "G": G_C += 1 elif DNA[i] == "C": G_C -= 1 running_skew.append(G_C) # Compute the min. NOTE: We have to sum one t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gc_skew(dna):\n gcount = dna.count('G') + dna.count('g')\n ccount = dna.count('C') + dna.count('c')\n if gcount + ccount == 0:\n return 0.0\n return float(gcount - ccount) / float(gcount + ccount)", "def calculate_skews(genome):\n\n skew = 0\n skew_list = [0]\n\n for base in genom...
[ "0.7620534", "0.7251302", "0.70270246", "0.6922066", "0.66534615", "0.66199076", "0.61173785", "0.6054853", "0.5902729", "0.5898459", "0.58499765", "0.5843475", "0.5835656", "0.5742642", "0.57381797", "0.57263863", "0.5724093", "0.56867915", "0.5681886", "0.56621575", "0.5636...
0.66199297
5
Constructs a new checkbox, forwarding most of the elements to the underlying Checkbox and Text.
def __init__(self, parent=None, x=0, y=0, chb_callback=None, chb_args=None, chb_checked=True, text="", text_size=16, radio=False, text_color=None, expand_width=100, enabled=True): RPObject.__init__(self) if chb_args is None: chb_args = [] if ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def uiNewCheckbox(text):\n\n # Set return type\n clibui.uiNewCheckbox.restype = ctypes.POINTER(uiCheckbox)\n\n return clibui.uiNewCheckbox(bytes(text, 'utf-8'))", "def _add_checkbox(self, text, state_changed, tooltip, checked=True,\n enabled=True, button_label=True):\n cbox = QtWidgets.QCh...
[ "0.7514792", "0.7492587", "0.6925257", "0.6842509", "0.6830381", "0.66930974", "0.6652419", "0.64220405", "0.63115245", "0.6304834", "0.6286391", "0.6174572", "0.6149249", "0.6120229", "0.6061441", "0.6008671", "0.5982424", "0.5975624", "0.5966255", "0.58634454", "0.5833025",...
0.658864
7
Returns the initial action of the episode. The initial action has an intent of request, required init. inform slots and a single request slot.
def _return_init_action(self): return self._default_response()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_initial_actions_before_episode(self):\n pass", "def begin_episode(self, observation):\n self._reset_state()\n self._record_observation(observation)\n\n if not self.eval_mode:\n self._train_step()\n\n self._rng, self.action = select_action(self.network_def,\n ...
[ "0.69279313", "0.6456787", "0.6360084", "0.6162056", "0.6162056", "0.6141457", "0.60358584", "0.5961095", "0.59052217", "0.5874249", "0.5874249", "0.58554894", "0.5850194", "0.5831294", "0.5795817", "0.57878214", "0.5760197", "0.5760197", "0.5760197", "0.57133555", "0.5710202...
0.62246037
3
Override for the save method to save last_updated_by.
def save(self, *args, **kwargs): user = kwargs.pop('user', None) if not user: raise ValueError("User not present in the model") if not hasattr(self, 'owner'): self.owner = user elif not self.can_be_edited(user): raise ValueError("User can't edit the model") self.last_updated_by = u...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def updated_by(self):\n return self._updated_by", "def last_modified_by(self, last_modified_by):\n\n self._last_modified_by = last_modified_by", "def last_modified_by(self, last_modified_by):\n\n self._last_modified_by = last_modified_by", "def last_updated_user(self, last_updated_user):...
[ "0.72228736", "0.71517086", "0.71517086", "0.7073198", "0.70058876", "0.6979467", "0.6979467", "0.6963288", "0.6963288", "0.6957804", "0.6943515", "0.6943515", "0.6943515", "0.693549", "0.6928816", "0.6928816", "0.6928816", "0.6928816", "0.6928816", "0.6928816", "0.6860237", ...
0.72639173
0
Mutator for when subclass constructors don't require cursor.
def _set_cursor(self, cursor): self._cursor = cursor
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, cursor):\n self.__cursor = cursor", "def __init__(self, cursor, mapper):\n super().__init__(cursor)\n self.mapper = mapper", "def __init__(self, cursor):\n\n self.cursor = cursor\n self.number = None", "def __init__(self, cursor, collection):\n # '...
[ "0.74894917", "0.72496176", "0.6938491", "0.68265224", "0.65540683", "0.64049953", "0.6363986", "0.6246955", "0.62277246", "0.62063074", "0.616438", "0.615433", "0.6148705", "0.6144118", "0.6130303", "0.6124155", "0.60981894", "0.60981894", "0.60981894", "0.60981894", "0.6092...
0.0
-1
Returns this C2 objects api key
def get_config(self): return 'c2Key', self.key
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def api_key(self):\n return self.__creds.api_key_v2", "def get_api_key(self):\r\n url = '{0}/{1}'.format(self.get_url(), 'api_key')\r\n\r\n return http.Request('GET', url), parsers.parse_json", "def api_key(self):\n # type () -> str\n return self._api_key", "def api_key(sel...
[ "0.8433575", "0.8266869", "0.821526", "0.8186403", "0.814696", "0.8023356", "0.79617304", "0.7920744", "0.79091537", "0.7908278", "0.78520316", "0.7847541", "0.77555144", "0.77447164", "0.7735256", "0.7735256", "0.7735256", "0.7735256", "0.7720743", "0.7673294", "0.7655956", ...
0.0
-1
Returns The Version Number Of The Specified Package POM query [package] package the name of the package to query
def query(package:str, path:str=None): data = read_package_info(package, path) logging.info("{0} - v{1}".format(data["name"], data['version']))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_latest_version_number(package_name: str) -> str:\n\n r = requests.get(os.path.join(\"https://pypi.org/pypi/\", package_name, \"json\"))\n return r.json().get(\"info\").get(\"version\")", "def _get_package_version(self):\n url = \"{0}/version\".format(self.base_url)\n log.info(\"Lookin...
[ "0.70270133", "0.6997502", "0.6595785", "0.6582613", "0.6560019", "0.6503381", "0.64809316", "0.6478962", "0.647078", "0.64407796", "0.6434716", "0.6428957", "0.6428314", "0.6407508", "0.6405862", "0.637893", "0.637893", "0.637893", "0.637893", "0.637893", "0.637893", "0.63...
0.6359974
24
Compute the solid surface density of a planet or planetary system using a given prescription for the feeding zone width. Wrapper function that calls the appropriate function based on the `prescription` string.
def solid_surface_density_prescription(M, R, a, Mstar=1., n=10., prescription='CL2013'): if prescription == 'CL2013': return solid_surface_density_CL2013(M, a) elif prescription == 'S2014': return solid_surface_density_S2014(M, R, a, Mstar=Mstar) elif prescription == 'nHill': return ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getDustDensity(grid=None, ppar=None):\n mesh = np.meshgrid(grid.x, grid.y, grid.z, indexing='ij')\n if ppar['crd_sys'] == 'sph':\n rr = mesh[0]\n tt = mesh[1]\n pp = mesh[2]\n xx = rr * np.sin(tt) * np.sin(pp)\n yy = rr * np.sin(tt) * np.cos(pp)\n zz = rr * np.co...
[ "0.5307925", "0.5081325", "0.5049184", "0.49861205", "0.49392715", "0.49240175", "0.49195012", "0.48628402", "0.48551458", "0.48538178", "0.4841421", "0.48165292", "0.47777972", "0.47717533", "0.47643062", "0.4756159", "0.47501224", "0.47377303", "0.47330248", "0.46848333", "...
0.6673628
0
Gated recurrent unit (GRU) with nunits cells.
def __call__(self, inputs, state, scope=None): with vs.variable_scope(scope or type(self).__name__): # "GRUCell" with vs.variable_scope("Gates"): # Reset gate and update gate. # We start with bias of 1.0 to not reset and not update. r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_gru_cell(num_units, dropout):\n cell = tf.nn.rnn_cell.GRUCell(num_units)\n if dropout:\n result = tf.nn.rnn_cell.DropoutWrapper(cell,\n output_keep_prob=1-dropout)\n return result", "def _initialize_gru_cell(self, num_units):\n return gru_cell.Laye...
[ "0.7217025", "0.6654688", "0.6297134", "0.62698615", "0.58967686", "0.5840164", "0.570657", "0.56824994", "0.5670167", "0.56192416", "0.56141967", "0.560903", "0.55835325", "0.5581533", "0.55483365", "0.55423665", "0.5536661", "0.55100894", "0.54998815", "0.54421973", "0.5382...
0.0
-1
Calculated value of this creature's Armor Class. By default, this will simply be the Base AC for the creature, which allows us to specify the AC of any creature without worrying about what kind of armor they are wearing. If a creature does wear armor, or you want to specify the type of armor that a creature is wearing,...
def ac(self): if self.armor: return self.armor.ac return 10 + self.dexterity
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def armor(self):\n capacity = self._getAttribute(Attribute.armorCapacity)\n em = self._getAttribute(Attribute.armorEM)\n explosive = self._getAttribute(Attribute.armorExplosive)\n kinetic = self._getAttribute(Attribute.armorKinetic)\n thermal = self._getAttribute(Attribute.armorThermal)\n\n em = ...
[ "0.59381443", "0.5713177", "0.5641947", "0.5638505", "0.5638505", "0.56049937", "0.5477431", "0.5249133", "0.5096839", "0.5020912", "0.5011532", "0.49466097", "0.49433625", "0.49419677", "0.49131262", "0.48908597", "0.48858428", "0.48436353", "0.48379123", "0.47722226", "0.47...
0.6977443
0
Gets distance to another creature.
def distance_to(self, other): x0,y0 = self.x, self.y x1,y1 = other.x, other.y dist = math.sqrt((x1-x0) ** 2 + (y1-y0) ** 2) return int(dist)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def distance(self):\n return round(await self._rpc.distance(), 2)", "def get_distance(self) -> int:\n return self.get_measurement_data().distance", "def distance(self) -> float:\n return self._dist_two_wire() # at this time we only support 2-wire meausre", "def distancia(self, oth...
[ "0.68532616", "0.68238944", "0.6821477", "0.68016034", "0.6793896", "0.6768048", "0.67638505", "0.67339736", "0.67150325", "0.66852754", "0.66578656", "0.6630933", "0.6629661", "0.6611882", "0.66076887", "0.6583222", "0.6565339", "0.6545736", "0.6526474", "0.6525149", "0.6522...
0.6460717
27
Return a copy of this model's fields dict
def get_fields(self): return self.__fields.copy()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fields(self):\n self.update()\n return self.__fields", "def copy_fields(self, model):\n fields = super(HistoricalRecords, self).copy_fields(model)\n for name, field in self.additional_fields.items():\n assert name not in fields\n assert hasattr(self, 'get_%s_...
[ "0.7558283", "0.7336941", "0.7323113", "0.7322853", "0.73118067", "0.72500736", "0.7145941", "0.7096612", "0.7065696", "0.703924", "0.70093334", "0.698942", "0.6987348", "0.6984674", "0.6984674", "0.6967096", "0.69602734", "0.69551945", "0.6936931", "0.6869824", "0.6834468", ...
0.80127245
0
Return a list of comments attached to this model
def get_comments(self): return self._client.get_comments(self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def comments(self):\n return comments.Comments(self)", "def comments(self):\r\n return comments.Comments(self)", "def comments(self):\r\n return c.Comments(self)", "def comments(self):\r\n return c.Comments(self)", "def comments(self):\r\n return c.Comments(self)", "def...
[ "0.80576783", "0.80056524", "0.80052936", "0.80052936", "0.80052936", "0.79382443", "0.79382443", "0.79171765", "0.78347415", "0.76968265", "0.76853406", "0.7678108", "0.7671855", "0.7671855", "0.7671855", "0.755696", "0.75507385", "0.7383259", "0.72944283", "0.7283822", "0.7...
0.81764853
0
set weight data inplace
def init_weight(w): shape = w.shape if len(shape) == 4: i, o, u, v = shape k = np.sqrt(6 / (i * u * v + o * u * v)) w.data.uniform_(-k, k) elif len(shape) == 2: k = np.sqrt(6 / sum(shape)) w.data.uniform_(-k, k) elif len(shape) == 1: w.data.zero_()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_weights(self):\n\t\tpass", "def set_weight(self, weight):\n self.weight = weight # overwrite the existing weight with the input weight value", "def setWeights(self, w):\n raise NotImplementedError", "def change_weight(self, new_weight_arr):\n self.weights = new_weight_arr", ...
[ "0.75657773", "0.754553", "0.7425873", "0.74237925", "0.7361544", "0.7260426", "0.72409207", "0.71960425", "0.7179694", "0.7084656", "0.7084499", "0.7072498", "0.7050161", "0.70361066", "0.70343643", "0.7027935", "0.7006916", "0.7006916", "0.7006916", "0.70027024", "0.6999562...
0.6111451
95
Ensure the insufficient error is not raised when the only available quantity is in a stock from the collection point warehouse without shipping zone assigned.
def test_checkout_lines_update_only_stock_in_cc_warehouse( mocked_update_shipping_method, user_api_client, checkout_with_item, warehouse_for_cc ): # given checkout = checkout_with_item lines, _ = fetch_checkout_lines(checkout) assert checkout.lines.count() == 1 assert calculate_checkout_quantity...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_stock(self):\n if self.quantity > self.item.quantity:\n return \"%s Please adjust your cart.\" % CartItem.get_insufficient_stock_msg(self.item.quantity)\n return None", "def test_excess_quantity(self):\n excess = self._uncertain_demand.excess_stock\n avg_order = s...
[ "0.687709", "0.66952956", "0.66347027", "0.643843", "0.63761526", "0.62379915", "0.61167043", "0.60353667", "0.589825", "0.5877646", "0.5852481", "0.58428013", "0.58387107", "0.5826534", "0.5826123", "0.57833457", "0.5768951", "0.57357526", "0.57158136", "0.5715606", "0.57154...
0.0
-1
Ensure the insufficient error is raised when the only available quantity is in a stock from the collection point warehouse without shipping zone assigned and the checkout has shipping method set.
def test_checkout_lines_update_only_stock_in_cc_warehouse_delivery_method_set( user_api_client, checkout_with_item, warehouse_for_cc, shipping_method ): # given checkout = checkout_with_item line = checkout.lines.first() variant = line.variant variant.stocks.all().delete() # set stock for ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_stock(self):\n if self.quantity > self.item.quantity:\n return \"%s Please adjust your cart.\" % CartItem.get_insufficient_stock_msg(self.item.quantity)\n return None", "def action_confirm(self):\n if any(not l.is_available for l in self.mapped('order_line')):\n ...
[ "0.6648967", "0.659757", "0.643182", "0.6251574", "0.60807776", "0.596315", "0.590114", "0.5886054", "0.58095294", "0.5726763", "0.5680988", "0.5662024", "0.5650994", "0.56398505", "0.56123585", "0.56022024", "0.55952126", "0.5587652", "0.5536761", "0.5526824", "0.55253875", ...
0.5003589
85
Yield (value, old_value) for transitions matching the predicate Transitions that happen during the body of the loop are discarded.
async def transitions(self, value_or_predicate=_ANY_TRANSITION) -> AsyncIterator[Tuple[VT, VT]]: # Note this is not simply `while True: await wait_transition(...)`, # in order to maintain a ref on the predicate throughout the loop. predicate = _ValueWrapper(value_or_predicate) with self...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _iter_transitions_all_(self):\n for state in self.iter_states():\n for t in state.transitions:\n yield t", "def transitions(self, state):\n if len(set(state)) < len(state):\n yield self.STOP_STATE\n return\n for hidx in xrange(self.num_play...
[ "0.63914335", "0.6155595", "0.61059815", "0.5747047", "0.5727003", "0.56923145", "0.56873107", "0.55883396", "0.54256326", "0.54001474", "0.5387422", "0.5338172", "0.53270626", "0.5282172", "0.52739054", "0.5259077", "0.52282995", "0.52177453", "0.52051824", "0.5199539", "0.5...
0.7259284
0
Split a dataset into train, validation and test sets
def train_val_test_split( reframed, n_hours, n_features, target_var="temp", ascending_sampling=False ): n_train_hours = int(reframed.shape[0] * 0.6) n_val_hours = int(reframed.shape[0] * 0.2) if ascending_sampling: print("Sampleamos datasets de pasado a futuro") train = reframed.iloc[:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __split_dataset(self):\n self.train, self.valid, _, _ = train_test_split(self.data, self.data, test_size=0.2)\n self.valid, self.test, _, _ = train_test_split(self.valid, self.valid, test_size=0.5)", "def split_data_into_train_and_test(raw_training_data):\n train_set, test_set = train_test_s...
[ "0.8654461", "0.8391163", "0.81085074", "0.79774284", "0.7956838", "0.795204", "0.78373057", "0.78208876", "0.781591", "0.77969235", "0.7786244", "0.77457815", "0.7740815", "0.77335304", "0.7690326", "0.7671012", "0.7666546", "0.7659906", "0.7630787", "0.7628178", "0.76263815...
0.0
-1
Function to test API can fetch all upcoming meetups
def test_fetch_all_upcoming_meetups(self): meetups_url = '/api/v1/meetups' all_meetups_url = '/api/v1/meetups/upcoming' # Post a second meetup(meetup2) post_response = self.client.post(meetups_url, data=json.dumps(self.meetup2), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_upcoming_meetups(self):\n return self.client.get('api/v2/meetups/upcoming',\n headers={\"Authorization\": \"{}\".format(self.token())})", "def get_meetups(self):\n\n self.post_meetup()\n return self.client.get(\"api/v2/meetups\", headers={\"Authorization...
[ "0.7668502", "0.7384891", "0.727832", "0.7067743", "0.6885968", "0.68669206", "0.68582547", "0.67186373", "0.66466075", "0.66378874", "0.66364574", "0.6597534", "0.65974855", "0.6593673", "0.65598637", "0.6552853", "0.6494315", "0.6456085", "0.64386606", "0.63950986", "0.6316...
0.82867295
0
Get a list of bombs placed on the map.
def bombs(self) -> List[Point]: return self._bombs
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def balls(self):\n return self._balls", "def getBoogies(self):\n return self.boogies", "def getEatenBabies(self, gameState):\n eaten = []\n newFood = self.getFoodYouAreDefending(gameState)\n for pos in self.babies:\n if not newFood[pos[0]][pos[1]]:\n eaten.append(pos)\n re...
[ "0.63407654", "0.62356144", "0.62017345", "0.6169627", "0.6129641", "0.60858697", "0.6035784", "0.6017408", "0.5992683", "0.5932536", "0.5927393", "0.59258556", "0.5883961", "0.5883961", "0.5883961", "0.5883961", "0.5861066", "0.58583623", "0.58210886", "0.58197016", "0.58180...
0.7847332
0
The ID of the Vpc Endpoint.
def endpoint_id(self) -> pulumi.Input[str]: return pulumi.get(self, "endpoint_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def endpoint_id(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"endpoint_id\")", "def endpoint_id(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"endpoint_id\")", "def endpoint_id(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"endpoint_id\")", "def EndpointSet...
[ "0.773587", "0.773587", "0.773587", "0.72390574", "0.715829", "0.715829", "0.7136282", "0.6914552", "0.6914552", "0.6826959", "0.6785585", "0.6785585", "0.66851157", "0.6667838", "0.66392636", "0.65060544", "0.64781326", "0.64507943", "0.63870335", "0.63588077", "0.63217807",...
0.73253644
6
The ID of the Vpc Endpoint.
def endpoint_id(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "endpoint_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def endpoint_id(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"endpoint_id\")", "def endpoint_id(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"endpoint_id\")", "def endpoint_id(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"endpoint_id\")", "def endpoint_id...
[ "0.773587", "0.773587", "0.773587", "0.73253644", "0.73253644", "0.73253644", "0.73253644", "0.72390574", "0.7136282", "0.6914552", "0.6914552", "0.6826959", "0.6785585", "0.6785585", "0.66851157", "0.6667838", "0.66392636", "0.65060544", "0.64781326", "0.64507943", "0.638703...
0.715829
9
The ID of the Vpc Endpoint.
def endpoint_id(self) -> pulumi.Output[str]: return pulumi.get(self, "endpoint_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def endpoint_id(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"endpoint_id\")", "def endpoint_id(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"endpoint_id\")", "def endpoint_id(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"endpoint_id\")", "def endpoint_id(se...
[ "0.73253644", "0.73253644", "0.73253644", "0.73253644", "0.72390574", "0.715829", "0.715829", "0.7136282", "0.6914552", "0.6914552", "0.6826959", "0.6785585", "0.6785585", "0.66851157", "0.6667838", "0.66392636", "0.65060544", "0.64781326", "0.64507943", "0.63870335", "0.6358...
0.773587
2
Returns a dictionary whose keys are the field names used in the `simplsaleform` form in the index document, and whose values are empty strings. Uses all fields if `required` is `False`, or only the required fields if `required` is `True`.
def fields(self, required=False): form = h.simplsale_form(self._index_xml) if required: required = '.required' else: required = '' elements = CSSSelector('input[type!="submit"]%s, select%s' % (required, required))(form) names...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def missing_required_fields(proposal):\n data = flatten(proposal.data[0])\n sections = search_multiple_keys(proposal.schema, primary_search='isRequired', search_list=['label', 'name'])\n\n missing_fields = []\n for flat_key in data.items():\n for item in sections:\n if flat_key[0].end...
[ "0.64026296", "0.62339735", "0.61111134", "0.59816545", "0.5976575", "0.5851171", "0.58145267", "0.5790461", "0.5763283", "0.5663467", "0.5602248", "0.55715513", "0.5508372", "0.550706", "0.5503391", "0.549901", "0.5494368", "0.546902", "0.54296863", "0.53538823", "0.5351472"...
0.70472145
0
Find the lowest positive integer that does not exist in the array
def findLowestPositiveInteger(arr): #Sort the array arr.sort() #Remove any non-positive numbers positive_arr = [] for i in arr: if (i >= 1): positive_arr.append(i) #Initialize the lowest possible value to 1, since it the lowest possible positive integer lowest_valu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def first_missing_positive_int_linear(nums):\n\t\n\t# Here's the trick: the first missing positive number must be \n\t# between 1 and len(array) + 1 \t\n\ts = set(nums)\n\t\n\tfor i in range(1, len(nums) + 1):\n\t\tif i not in s:\n\t\t\treturn i", "def _getMinPos(self, arr):\r\n min = sys.maxint\r\n ...
[ "0.79331464", "0.7643256", "0.7472253", "0.74637127", "0.74608225", "0.73176694", "0.7220217", "0.72103685", "0.7183478", "0.7179758", "0.7147383", "0.7133139", "0.7080835", "0.70492285", "0.7017557", "0.69876224", "0.6985547", "0.69757926", "0.69272476", "0.6891117", "0.6771...
0.7707484
1
First check username key is present in request if not then set name = 'anonymous' Return true if username matches
def post(self, request, *args, **kwargs): name = request.data.get('username', 'anonymous') if User.objects.filter(username=name).exists(): return Response({ 'message': True }) return Response({ 'message': False })
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_username():\n\n users = app.users\n username = request.data.decode('utf-8')\n\n if username in users:\n return Response('true')\n else:\n return Response('false')", "def checkusername():\n username = request.get_json()[\"username\"]\n if is_username_registered(username):...
[ "0.70367914", "0.6733046", "0.67106086", "0.660051", "0.6581935", "0.655372", "0.6491588", "0.64877266", "0.6487482", "0.6452048", "0.637894", "0.6365474", "0.63035846", "0.6278298", "0.62664443", "0.62576634", "0.62446654", "0.62446654", "0.622904", "0.6188523", "0.617552", ...
0.7347999
0
Return the total children in subtree excluding root (recursive)
def n_children(self): ch = self.children return 0 if not ch else len(ch) + sum([c.n_children for c in ch])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetChildrenCount(self, recursively=True):\r\n\r\n count = len(self._children)\r\n \r\n if not recursively:\r\n return count\r\n\r\n total = count\r\n\r\n for n in xrange(count):\r\n total += self._children[n].GetChildrenCount()\r\n \r\n ret...
[ "0.73043585", "0.7156632", "0.7156116", "0.7147877", "0.71018714", "0.7045175", "0.70252013", "0.70043415", "0.6913155", "0.69039863", "0.68612677", "0.6803081", "0.6741313", "0.6733614", "0.6731992", "0.6718477", "0.66994846", "0.6696368", "0.66809255", "0.6673337", "0.66616...
0.7126411
4
Return max nodewidth of entire subtree (recursive)
def n_cols(self): ch = self.children return 1 if not ch else sum([c.n_cols for c in ch])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def widthOfBinaryTree(self, root: Optional[TreeNode]) -> int:\n q = deque([(root, 1)])\n max_width = 1\n\n while len(q) > 0:\n temp_q = deque()\n local_max_width = float('-inf')\n local_min_width = float('+inf')\n\n for (node, position) in q:\n ...
[ "0.7495284", "0.69656545", "0.6704925", "0.66904795", "0.6603112", "0.6563875", "0.654226", "0.6518026", "0.6473751", "0.64729375", "0.6471312", "0.644005", "0.64343053", "0.6385228", "0.63733995", "0.6362077", "0.6343214", "0.63332254", "0.6311296", "0.6300646", "0.6284995",...
0.0
-1
Given the state and action, return the probability of next step and corresponding rewards.
def prob(self, state, action): if state + action == 100: reward = 1 else: reward = 0 return [(state + action, self._p_head, reward), (state - action, 1 - self._p_head, 0)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_transition_prob(self, state, action, next_state):\n return self.get_next_states(state, action).get(next_state, 0.0)", "def step(self, action):\r\n s = self.get_state()\r\n\r\n elements = np.arange(self.S)\r\n # weights = np.squeeze(self.nextStateProbability[s,action])\r\n ...
[ "0.7852668", "0.7634903", "0.76233506", "0.7513694", "0.7425609", "0.73781925", "0.7304631", "0.73019123", "0.71331304", "0.71246684", "0.7115571", "0.703985", "0.7026724", "0.7026561", "0.70207936", "0.7015552", "0.7014987", "0.70135736", "0.69894207", "0.6953274", "0.694764...
0.8235246
0
Convert a vector of variables to a dictionary with factor keys Arguments
def vector_to_factor_dict(self, vector): factor_dict = { "x": vector[:] } return factor_dict
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vector_to_factor_dict(self, vector):\n factor_dict = {\n \"booking_limits\": vector[:]\n }\n return factor_dict", "def get_var_dict(self, **kwargs) -> Dict[Name, Value]:\n #dict(zip(type(self).get_predefined_constant_names(), self.get_predefined_constants()))\n #...
[ "0.6585375", "0.6334172", "0.62881106", "0.6264055", "0.6083083", "0.606713", "0.59793967", "0.5959856", "0.5935993", "0.58753973", "0.5859729", "0.5824503", "0.5803784", "0.58024216", "0.5797153", "0.57637614", "0.5740339", "0.5739034", "0.5715001", "0.57036984", "0.56897676...
0.73009545
0
This function prints and plots the confusion matrix. Normalization can be applied by setting `normalize=True`.
def plot_confusion_matrix(cm, classes, normalize=False, title='Confusion matrix', cmap=plt.cm.Blues): if normalize: cm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis] print("Normalized confusion matrix") else: ...
{ "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.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.7917871", "0.791609...
0.7980955
6
Checks if any of the pixels touching the perimeter of bounding box bb are green. Returns which side has green touching it ('RIGHT', 'BOTTOM', 'LEFT', 'TOP') Returns 'NONE' if no green is touching Returns 'EDGE' if the bounding box is on the edge of the pic
def touching_border(self, bb: list, quickness: int = 1) -> str: # Make the coordinates easier to handle x1, y1, x2, y2 = bb[0], bb[1], bb[2], bb[3] # Check which way the box should be expanded # The first two conditions check if the box should # be expanded diago...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def color_detection(self, img):\n\n # red\n low_red = np.array([0, 0, 160])\n high_red = np.array([130, 130, 255])\n red_threshold = cv2.inRange(img, low_red, high_red)\n\n # green\n low_green = np.array([0, 120, 0])\n high_green = np.array([90, 255, 90])\n g...
[ "0.61984855", "0.6080677", "0.59067667", "0.5896578", "0.5859335", "0.5846071", "0.584375", "0.5814055", "0.5810937", "0.57170284", "0.56967115", "0.56700456", "0.56310785", "0.5627564", "0.56259114", "0.56192946", "0.56024235", "0.55927366", "0.558801", "0.5559658", "0.55572...
0.6111433
1
Converts pixels to inches Returns a float of inches
def pixels_to_inches(self, px: float) -> float: return (px / self.ratio[0]) * self.ratio[1]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def inches(n):\n return n * 25.4", "def cm2inch(size):\n return size / 2.54", "def cm2inch(size):\n return size / 2.54", "def cm2inch(size):\n return size / 2.54", "def mm_to_inches(rainfall_in_mm):\r\n rainfall_in_inches = rainfall_in_mm * 0.0393701\r\n return rai...
[ "0.76526505", "0.7137898", "0.7137898", "0.7137898", "0.71243626", "0.7078315", "0.70218575", "0.6984374", "0.6902329", "0.6757787", "0.65595484", "0.6542591", "0.6418504", "0.6405155", "0.62649655", "0.62368655", "0.61859536", "0.6095458", "0.6062064", "0.597879", "0.5891508...
0.78281313
0
Redirects to __eq__() of dict. This redirection never points to OrderedDict to ensure comparisons are always orderinsensitive, i.e. behaviour doesn't differ between Python versions.
def __eq__(self, other): return dict.__eq__(self, other)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other: object) -> bool:\n # Argument 1 of \"__eq__\" is incompatible with supertype \"object\";\n # supertype defines the argument type as \"object\"\n # So, the type of other shouldn't lower than 'object'. For that intention, add the following two line code.\n if not i...
[ "0.66268706", "0.6567866", "0.65340704", "0.64928705", "0.6467564", "0.6456129", "0.6433696", "0.63999003", "0.63939327", "0.63929594", "0.63836545", "0.63836545", "0.63836545", "0.63836545", "0.63836545", "0.63836545", "0.63836545", "0.63836545", "0.63836545", "0.63836545", ...
0.68895584
0
Returns t_max such that Curve.max_x == Curve(t_max).x.
def max_x_arg(self): return self.T.max_y_arg
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_max_t(self):\n \"\"\"\n if hasattr(self,'k_of_t'):\n return max([ \n self.s_of_t[-1][0],\n self.i_of_t[-1][0],\n self.r_of_t[-1][0],\n self.k_of_t[-1][0],\n ...
[ "0.7077227", "0.7016823", "0.67148685", "0.6648306", "0.6616324", "0.65650964", "0.64899904", "0.64853275", "0.6459124", "0.6455219", "0.63652873", "0.63601995", "0.6333582", "0.6306713", "0.62753797", "0.62158287", "0.618923", "0.61499214", "0.61490244", "0.61484826", "0.613...
0.61832696
17
Tokenizes sentence into list of words.
def _tokenize_fn(sentence: str) -> Sequence[str]: return sentence.split()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def token_to_words(sentence):\n\n regex_of_word = re.findall(SENTENCE_TO_WORDS_REGEX, sentence)\n\n words = [x.lower() for x in regex_of_word if x is not '']\n\n return words", "def tokenize(sentence):\n lower_s = sentence.lower()\n no_punc_s = lower_s.translate(TRANS, string.punctuation)\n\n w...
[ "0.8311132", "0.82815385", "0.8184632", "0.8165114", "0.8102701", "0.8020231", "0.7940098", "0.7853865", "0.77405834", "0.7700952", "0.76840514", "0.76840514", "0.7655818", "0.7613874", "0.75969857", "0.7580177", "0.75762975", "0.7571726", "0.7555356", "0.7545908", "0.7539692...
0.73383605
25
returns a color map of length n
def get_color_map(n): jet = plt.get_cmap('jet') cNorm = colors.Normalize(vmin=0, vmax=n-1) scalarMap = cmx.ScalarMappable(norm=cNorm, cmap=jet) outmap = [] for i in range(n): outmap.append( scalarMap.to_rgba(i) ) return outmap
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def color_map(n=256, normalized=False):\n def bitget(byteval, idx):\n return (byteval & (1 << idx)) != 0\n\n dtype = 'float32' if normalized else 'uint8'\n cmap = np.zeros((n, 3), dtype=dtype)\n for i in range(n):\n r = g = b = 0\n c = i + 1 # skip the first color (black)\n ...
[ "0.7574552", "0.7504988", "0.7497234", "0.7485863", "0.7306275", "0.7213055", "0.7178517", "0.710654", "0.70834017", "0.70565057", "0.70533997", "0.69345397", "0.69345397", "0.69345397", "0.69251037", "0.6922169", "0.69220185", "0.68671066", "0.68671066", "0.68399334", "0.683...
0.82131743
0
Return datetime for start/end/time service fields.
def get_datetime_from_time(value: datetime | time) -> datetime: if isinstance(value, time): value = datetime.combine(dt_util.now().date(), value, dt_util.DEFAULT_TIME_ZONE) if isinstance(value, datetime): value = value.replace(tzinfo=dt_util.DEFAULT_TIME_ZONE) if value > dt_util.now(): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_datetime_start(self):\n return self.get_t_sect()['datetime_start']", "def start_datetime(self):\n date_string = self.data.get('Start date')\n time_string = self.data.get('Start time')\n start_datetime_string = \"{date} {time}\".format(date=date_string, time=time_string)\n ...
[ "0.68790185", "0.6704264", "0.6635803", "0.6548719", "0.6441386", "0.64282316", "0.639078", "0.6204385", "0.61944216", "0.6174786", "0.61369276", "0.6133411", "0.607717", "0.60698336", "0.59959847", "0.5991325", "0.5990207", "0.59490895", "0.5947829", "0.59362286", "0.5931776...
0.0
-1
Inits a new DWGExporter instance.
def __init__(self, setupName): import revitron self.options = revitron.DB.DWGExportOptions().GetPredefinedOptions( revitron.DOC, setupName )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n OWSReport.__init__(self)\n self.stats['type'] = 'OGC:WFS'\n self.stats['operations']['GetFeature'] = {}\n self.stats['operations']['GetFeature']['hits'] = 0\n self.stats['operations']['GetFeature']['resource'] = {}\n self.stats['operations']['GetFeatu...
[ "0.5616383", "0.5598649", "0.55974996", "0.55959857", "0.5565842", "0.5518872", "0.5507509", "0.5499401", "0.5446955", "0.537643", "0.53444606", "0.534076", "0.5331368", "0.53230584", "0.5296864", "0.5295465", "0.52934605", "0.52815557", "0.5277366", "0.5270406", "0.52573514"...
0.5407394
9
Updates the scaling groups min/maxentities to the given and asserts the update was successful
def _update_group_min_max_entities(self, group, maxentities=None, minentities=None): if minentities is None: minentities = group.groupConfiguration.minEntities if maxentities is None: maxentities = group.groupConfiguration.maxEntities ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_scaleup_update_min_max_0_delete_group(self):\n # wait for them to be building or done first\n self.check_for_expected_number_of_building_servers(\n group_id=self.group.id,\n expected_servers=self.group.groupConfiguration.minEntities)\n server_name = self.group.la...
[ "0.7216516", "0.7148849", "0.6465641", "0.63060486", "0.6302682", "0.5967253", "0.59378296", "0.5884351", "0.58251655", "0.5763512", "0.56172466", "0.55780405", "0.5543384", "0.54993975", "0.5467076", "0.5454207", "0.54506445", "0.54493207", "0.54477006", "0.5438962", "0.5428...
0.7196422
1
Individual plot of coastlines and contours.
def individual_plot(z, cf_lvls, cl_lvls, cline_label_format=cline_label_format_default, log_scale=False , extend="neither"): map_plot.drawcoastlines(linewidth=.4) if log_scale: norm = colors.LogNorm(vmin=cf_lvls[0], vmax=cf_lvls[-1]) else: norm = None if extend == '...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_covid():\n\n norway, usa = get_covid()\n _plot_covid(norway[0], norway[1], \"Norway\", \"12 Mar 2020\", \"#636efa\", \"#ef553b\")\n _plot_covid(usa[0], usa[1], \"USA\", \"22 Mar 2020\", \"#ef553b\", \"#636efa\")\n\n plot_relative_covid(norway, usa)", "def plot(self, show_contours=False):\n ...
[ "0.70412666", "0.6614417", "0.65006864", "0.6382925", "0.6193043", "0.6115562", "0.6073851", "0.60166395", "0.6015402", "0.6015367", "0.59662664", "0.5955049", "0.59477544", "0.59382355", "0.5919831", "0.59169775", "0.5913071", "0.5907056", "0.58704096", "0.5864446", "0.58616...
0.5544565
60
This function gets checkpoint file path on disk from config.trainer.params.resume_from_checkpoint. However if it not specified, it gets checkpoint path from config.checkpoint. If config.resume is specified it gets the latest checkpoint from the config's save directory (alternatively it gets the best checkpoint if confi...
def get_checkpoint_data(self) -> Dict[str, Any]: # get ckpt file path from config.trainer.params.resume_from_checkpoint path = self.config.trainer.params.get("resume_from_checkpoint", None) if path is not None: is_zoo = self.is_zoo_path(path) ckpt_filepath = path ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_checkpoint():\n if ((FLAGS.run_dir or FLAGS.checkpoint_file) and\n FLAGS.bundle_file and not should_save_generator_bundle()):\n raise sequence_generator.SequenceGeneratorException(\n 'Cannot specify both bundle_file and run_dir or checkpoint_file')\n if FLAGS.run_dir:\n train_dir = os.p...
[ "0.7520532", "0.7513603", "0.7282059", "0.72586083", "0.7179142", "0.71524364", "0.7124582", "0.70924205", "0.70795774", "0.7073361", "0.7068264", "0.69511074", "0.69251215", "0.6899899", "0.6752437", "0.6714414", "0.6689316", "0.66751736", "0.6667077", "0.6640141", "0.661914...
0.76644295
0
Gets the data of this PageTokenListSerializer.
def data(self): return self._data
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def data(self):\n ret = super(serializers.ListSerializer, self).data\n return ReturnDict(ret, serializer=self)", "def token_data(self) -> TokenData:\n return self._token_data", "def get_token_data(self):\n raise NotImplementedError('Method \"get_token_data\" must be implemented in a...
[ "0.69404435", "0.6879172", "0.6645009", "0.610933", "0.58847433", "0.58847433", "0.58847433", "0.5846899", "0.583798", "0.5817149", "0.5812905", "0.5810701", "0.57794315", "0.57623833", "0.5758387", "0.5758387", "0.5758387", "0.5758387", "0.57482064", "0.57482064", "0.5748206...
0.55509996
63
Sets the data of this PageTokenListSerializer.
def data(self, data): self._data = data
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def token_data(self, token_data: TokenData):\n\n self._token_data = token_data", "def __init__(self, next_page_token=None, data=None): # noqa: E501\n self.openapi_types = {\n 'next_page_token': str,\n 'data': List\n }\n\n self.attribute_map = {\n 'nex...
[ "0.6960413", "0.64091283", "0.6232373", "0.6232373", "0.61686057", "0.61639905", "0.6127503", "0.60071486", "0.60071486", "0.60071486", "0.6000835", "0.5948862", "0.5945747", "0.5945747", "0.58858645", "0.58704966", "0.5861489", "0.5861489", "0.58270806", "0.58145523", "0.577...
0.5952738
16
Create a Python instance from the given DOM node. The node tag must correspond to an element declaration in this module.
def CreateFromDOM (node, default_namespace=None): if default_namespace is None: default_namespace = Namespace.fallbackNamespace() return pyxb.binding.basis.element.AnyCreateFromDOM(node, default_namespace)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def CreateFromDOM (node, default_namespace=None):\n if default_namespace is None:\n default_namespace = Namespace.fallbackNamespace()\n return pyxb.binding.basis.element.AnyCreateFromDOM(node, _fallback_namespace=default_namespace)", "def CreateFromDOM (node, default_namespace=None):\n if default...
[ "0.6949202", "0.6949202", "0.6949202", "0.6946226", "0.6698814", "0.6698814", "0.6698814", "0.66975737", "0.66655135", "0.6650566", "0.6622097", "0.6594007", "0.6585428", "0.6564717", "0.65103894", "0.6489292", "0.64718515", "0.64257324", "0.6323297", "0.6312424", "0.6311245"...
0.70111525
9
Returns a another GeoPoint at the given distance and heading
def point_at_distance(self, distance, heading): distance_rad = distance / R_EARTH heading_rad = math.radians(heading) return self.__spherical_between(math.radians(self.lat), math.radians(self.long), distance_rad, heading_rad)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_point_from_distance_along_great_circle(self, distance, bearing):\n \n # ad is the angular distance (in radians) traveled.\n ad = distance/A_WGS84\n # lat1 is the latitude of the starting point in radians.\n lat1 = math.radians(self.lat)\n # lng1 is the longitude of the...
[ "0.6770629", "0.65110844", "0.61660296", "0.57667196", "0.57314205", "0.5686748", "0.5658151", "0.56048656", "0.5584744", "0.55566764", "0.5549201", "0.5534506", "0.55254775", "0.5428041", "0.5406351", "0.5364232", "0.53545207", "0.5343385", "0.5343158", "0.5327389", "0.53067...
0.7919778
0