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 field_type of this GraphicField.
def field_type(self, field_type): if self.local_vars_configuration.client_side_validation and field_type is None: # noqa: E501 raise ValueError("Invalid value for `field_type`, must not be `None`") # noqa: E501 self._field_type = field_type
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_type(self, type):\n self.type = type", "def set_type(self, type):\n self.type = type", "def set_type(self, type):\n self._type = type", "def type(self, type):\n self._type = type", "def type(self, type):\n self._type = type", "def type(self, type):\n\n se...
[ "0.7105642", "0.7105642", "0.7099143", "0.6679787", "0.6679787", "0.6669822", "0.6669822", "0.6669822", "0.6669822", "0.6669822", "0.6669822", "0.6669822", "0.6669822", "0.6669822", "0.6669822", "0.6669822", "0.6669822", "0.6669822", "0.6669822", "0.6669822", "0.6669822", "...
0.7421364
0
Sets the field_rect of this GraphicField.
def field_rect(self, field_rect): self._field_rect = field_rect
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_rect(self, rect):\n pass", "def object_rect(self, object_rect):\n\n self._object_rect = object_rect", "def SetItemRect(self, r):\r\n\r\n self.rect = r", "def setRect(self, p_float, p_float_1, p_float_2, p_float_3): # real signature unknown; restored from __doc__\r\n pass",...
[ "0.72116137", "0.65099055", "0.6233573", "0.5991756", "0.57179886", "0.56843543", "0.5627067", "0.5595156", "0.55048215", "0.5502208", "0.54851997", "0.5450329", "0.5391372", "0.53481513", "0.5343217", "0.5285621", "0.5264674", "0.5253542", "0.52433765", "0.5078867", "0.50620...
0.8737828
0
Sets the rfid_origin_dg of this GraphicField.
def rfid_origin_dg(self, rfid_origin_dg): self._rfid_origin_dg = rfid_origin_dg
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rfid_origin_dg_tag(self, rfid_origin_dg_tag):\n\n self._rfid_origin_dg_tag = rfid_origin_dg_tag", "def rfid_origin_tag_entry(self, rfid_origin_tag_entry):\n\n self._rfid_origin_tag_entry = rfid_origin_tag_entry", "def _set_origin_value(self, origin):\n self.origin_value = origin", "d...
[ "0.81773365", "0.6365345", "0.61074287", "0.60305506", "0.59884965", "0.59392333", "0.59108526", "0.57914007", "0.57282394", "0.57232976", "0.5601517", "0.55449826", "0.5466051", "0.5445407", "0.5442102", "0.51154816", "0.5026315", "0.49935544", "0.49879727", "0.49770606", "0...
0.86437947
0
Sets the rfid_origin_dg_tag of this GraphicField.
def rfid_origin_dg_tag(self, rfid_origin_dg_tag): self._rfid_origin_dg_tag = rfid_origin_dg_tag
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rfid_origin_dg(self, rfid_origin_dg):\n\n self._rfid_origin_dg = rfid_origin_dg", "def rfid_origin_tag_entry(self, rfid_origin_tag_entry):\n\n self._rfid_origin_tag_entry = rfid_origin_tag_entry", "def _set_origin_value(self, origin):\n self.origin_value = origin", "def set_origin(se...
[ "0.83581823", "0.6911633", "0.5851626", "0.5775131", "0.5754717", "0.5704184", "0.56624687", "0.55723506", "0.5414713", "0.534524", "0.521196", "0.51749897", "0.5158636", "0.5109123", "0.5057069", "0.49110323", "0.4860815", "0.48426276", "0.48097798", "0.48019814", "0.4775004...
0.88694096
0
Sets the rfid_origin_tag_entry of this GraphicField.
def rfid_origin_tag_entry(self, rfid_origin_tag_entry): self._rfid_origin_tag_entry = rfid_origin_tag_entry
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rfid_origin_dg_tag(self, rfid_origin_dg_tag):\n\n self._rfid_origin_dg_tag = rfid_origin_dg_tag", "def rfid_origin_entry_view(self, rfid_origin_entry_view):\n\n self._rfid_origin_entry_view = rfid_origin_entry_view", "def rfid_origin_dg(self, rfid_origin_dg):\n\n self._rfid_origin_dg =...
[ "0.76255137", "0.71466357", "0.706539", "0.6475852", "0.62074864", "0.61803263", "0.6047135", "0.5799009", "0.57771003", "0.5749266", "0.5666785", "0.56554973", "0.5563625", "0.54425395", "0.53913844", "0.522926", "0.51818943", "0.5177661", "0.5130794", "0.51260823", "0.50514...
0.8607514
0
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, GraphicField): return False return self.to_dict() == other.to_dict()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False", "def __eq__(self, other):\n if i...
[ "0.8088132", "0.8088132", "0.8054589", "0.7982687", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", ...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): if not isinstance(other, GraphicField): return True return self.to_dict() != other.to_dict()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other) -> bool:\n return not self.__eq__(other)", "def __eq__(self, other):\n ...
[ "0.845611", "0.8391477", "0.8144138", "0.81410587", "0.8132492", "0.8093973", "0.80920255", "0.80920255", "0.80920255", "0.8085325", "0.8085325", "0.8076365", "0.8076365", "0.8065748", "0.8042487", "0.8042487", "0.8042487", "0.8042487", "0.8042487", "0.8042487", "0.8042487", ...
0.0
-1
Compute the meansquarederror between y and y_hat
def mse(y, y_hat): loss = np.mean((y - y_hat) ** 2) return loss
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rmse(y_hat, y):\n\tif type(y) == list:\n\t\tpass\n\telse:\n\t\ty = y.values.tolist()\n\tm = len(y)\n\tsum = 0\n\tfor i in range(m):\n\t\tsum += ((y_hat[i] - y[i]) ** 2 / m)\n\terror = np.sqrt(sum)\n\treturn error", "def calc_rmse(y: np.ndarray, y_hat: np.ndarray) -> float:\n return np.sqrt(np.mean((y - y_...
[ "0.7651194", "0.756922", "0.74281955", "0.74281955", "0.72806376", "0.7251134", "0.7241769", "0.71939355", "0.7151707", "0.69688356", "0.6959828", "0.69475573", "0.69392985", "0.69366056", "0.6894634", "0.6877105", "0.68680245", "0.68516076", "0.68113816", "0.6798353", "0.679...
0.7097955
9
Creates `n_fold` cross validation sets (fixed random seed), and returns the train/validation indices for the selected fold
def get_splits(data, fold, n_folds=10): assert fold < n_folds, f'fold value must be less than n_folds value ({n_folds:d})' from sklearn.model_selection import StratifiedKFold skf = StratifiedKFold(n_splits=n_folds, random_state=0, shuffle=True) all_folds = [{'train_ind': train_ind, 'val_ind': val_ind} f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def n_fold_cross_validation(examples, num_folds=5):\n random.shuffle(examples, random.seed(12345))\n batches = [examples[i::num_folds] for i in range(num_folds)]\n n_fold_sets = [\n (\n [example for flat in (batches[:i] + batches[i + 1 :]) for example in flat],\n batch,\n ...
[ "0.73804903", "0.71895254", "0.7173279", "0.70385706", "0.69920415", "0.69450235", "0.6849928", "0.68243706", "0.682257", "0.6813893", "0.678278", "0.66871685", "0.66705954", "0.6663764", "0.66514486", "0.6610852", "0.6566355", "0.6540863", "0.6537024", "0.65288097", "0.64740...
0.70955926
3
Sets the mass_missing_count of this PartStudiosGetMassPropertiesResponse200BodiesKey.
def mass_missing_count(self, mass_missing_count): self._mass_missing_count = mass_missing_count
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tests_missed(self, num):\n self.missing_tests = num", "def total_mass(self):\n del self._total_mass", "def neutral_minions_k_illed(self, neutral_minions_k_illed):\n\n self._neutral_minions_k_illed = neutral_minions_k_illed", "def setBlockMassParams(self):\n for b in self.getBl...
[ "0.55186284", "0.51253504", "0.49527016", "0.48579326", "0.48152685", "0.4803072", "0.47842973", "0.47449812", "0.47126806", "0.4702872", "0.4702872", "0.4702872", "0.4689451", "0.46392885", "0.46248117", "0.46248117", "0.46184233", "0.45792004", "0.45576096", "0.45345888", "...
0.7782221
0
Sets the volume of this PartStudiosGetMassPropertiesResponse200BodiesKey.
def volume(self, volume): self._volume = volume
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def async_set_volume(self, volume):\n self._volume = volume", "async def set_volume(self, vol: int):\n self.volume = max(min(vol, 150), 0)\n await self._bot.lavalink.ws.send(op='volume', guildId=self.guild_id, volume=self.volume)", "def setVolume(self, *args):\n return _libsbm...
[ "0.62948567", "0.6262997", "0.6262149", "0.6221333", "0.6096943", "0.6026632", "0.6026632", "0.6020797", "0.596405", "0.59560937", "0.59521514", "0.5908571", "0.58899784", "0.58874536", "0.58468866", "0.58351797", "0.5819448", "0.5816195", "0.58006245", "0.57951486", "0.57823...
0.6059533
6
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, PartStudiosGetMassPropertiesResponse200BodiesKey): 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.8456063", "0.83918154", "0.8144437", "0.8140196", "0.8132038", "0.8093834", "0.80918837", "0.80918837", "0.80918837", "0.80852824", "0.80852824", "0.807626", "0.807626", "0.80657643" ]
0.0
-1
Return a feature vector representing the given state and action
def one_hot(x): cart_pos,cart_vel,pole_ang,pole_vel = x # Cart position discrete_cart_pos = int((cart_pos - CART_POSITION_MIN)/(CART_POSITION_MAX-CART_POSITION_MIN)*4) # Pole angle discrete_pol_ang = int((cart_pos - POLE_ANGLE_MIN)/(POLE_ANGLE_MAX-POLE_ANGLE_MIN)*4) # Cart velocity cart_v...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getStateActionFeatures(self,state,action):\n return [state, self.actions[action]]", "def feat_funct(self,state,action):\r\n #get position and velocity from state\r\n pos = state\r\n f = np.zeros((2,len(self.actions)))\r\n #assign position and velocity vectors to the column ...
[ "0.7983285", "0.7934605", "0.7476573", "0.7379132", "0.7209205", "0.7209205", "0.7209205", "0.7145992", "0.7139851", "0.7119404", "0.6916595", "0.68887675", "0.68887675", "0.68887675", "0.68887675", "0.68887675", "0.68643296", "0.6849332", "0.68419194", "0.6831082", "0.682111...
0.0
-1
Creates a new Casting Agency Flask app.
def setUpClass(cls): cls.app = create_app(test_config=True) cls.client = cls.app.test_client cls.database_name = 'casting-agency-test' cls.database_path = 'postgres://{}/{}'.format( 'localhost:5432', cls.database_name) setup_db(cls.app, cls.database_path) cls...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_app(env_name):\n app = Flask(__name__)\n app.config.from_object(configs[env_name])\n api = Api(app)\n\n ga_client = (google.ads.google_ads.client.GoogleAdsClient\n .load_from_storage())\n\n handler.defaultConversion = ga_client.get_type(\n 'ClickConversion', version...
[ "0.7248432", "0.7167935", "0.70351774", "0.70045096", "0.6964949", "0.69473183", "0.68964225", "0.68722737", "0.68708974", "0.6839551", "0.6833723", "0.6822021", "0.67877996", "0.6766476", "0.6748425", "0.6742929", "0.67225367", "0.66808635", "0.66721416", "0.6646652", "0.664...
0.0
-1
Drops the test DB after executing all tests
def tearDownClass(cls): db.session.remove() db.drop_all()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tearDown(self):\n with app.app_context():\n db = app.db.get_db()\n cur = db.cursor()\n with app.open_resource('sql/drop_tests.sql', mode='r') as f:\n cur.execute(f.read())\n db.commit()\n cur.close()\n db.close()", "def t...
[ "0.88551", "0.8712567", "0.86822015", "0.86822015", "0.85486317", "0.85439897", "0.85248816", "0.85045093", "0.8482238", "0.84797984", "0.8443274", "0.8441184", "0.843525", "0.843525", "0.843525", "0.843525", "0.843525", "0.843525", "0.843525", "0.843525", "0.843525", "0.84...
0.0
-1
Verifies the /api/actors endpoint for GET.
def test_get_actors(self): res = self.client().get('/api/actors') self.assertEqual(res.status_code, 200) res_body = json.loads(res.data) self.assertEqual(len(res_body['actors']), 10) self.assertEqual(res_body['totalActors'], len(Actor.query.all()))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_actor_404(self):\n res = self.client().get('/api/actors/9000')\n self.assertEqual(res.status_code, 404)", "def test_get_actors(self):\n # need to insert an actor record to pass the assertion of len(data)\n res = self.client().post('/actors', headers={\n 'Author...
[ "0.72214085", "0.71199036", "0.70977587", "0.6972622", "0.6967719", "0.6845148", "0.6701106", "0.66129535", "0.65708464", "0.65413094", "0.6500453", "0.60872173", "0.59997874", "0.59618455", "0.5914601", "0.57890266", "0.57882226", "0.57707524", "0.5689108", "0.5627985", "0.5...
0.7319808
0
Verifies the /api/actors/ endpoint for GET.
def test_get_actor_detail(self): actor = random.choice(Actor.query.all()) res = self.client().get('/api/actors/' + str(actor.id)) self.assertEqual(res.status_code, 200) res_body = json.loads(res.data) self.assertEqual(res_body['actor']['name'], actor.name) self.assertEq...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_actor_404(self):\n res = self.client().get('/api/actors/9000')\n self.assertEqual(res.status_code, 404)", "def test_get_actors(self):\n res = self.client().get('/api/actors')\n self.assertEqual(res.status_code, 200)\n\n res_body = json.loads(res.data)\n self...
[ "0.7243032", "0.7060604", "0.70455796", "0.6940377", "0.6875819", "0.6834811", "0.663225", "0.6601142", "0.6599761", "0.6447164", "0.64088976", "0.62847495", "0.59729433", "0.5882363", "0.58451146", "0.5800544", "0.57447016", "0.56883013", "0.5659945", "0.5608251", "0.5567658...
0.649088
9
Verifies the /api/movies endpoint for GET.
def test_get_movies(self): res = self.client().get('/api/movies') self.assertEqual(res.status_code, 200) res_body = json.loads(res.data) self.assertEqual(len(res_body['movies']), 10) self.assertEqual(res_body['totalMovies'], len(Movie.query.all()))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_movie_404(self):\n res = self.client().get('/api/movies/9000')\n self.assertEqual(res.status_code, 404)", "def test_get_movies_404(self):\n res = self.client().get('/api/movies?page=9000')\n self.assertEqual(res.status_code, 404)", "def test_movie_detail(self):\n ...
[ "0.7127154", "0.6915155", "0.67978233", "0.67845124", "0.6656971", "0.6614854", "0.66043645", "0.6551341", "0.6498064", "0.64595526", "0.64412385", "0.64191043", "0.6405569", "0.6345771", "0.6319942", "0.6277142", "0.6160371", "0.615471", "0.615471", "0.60397434", "0.60397434...
0.6620894
5
Verifies the /api/movies/ endpoint for GET.
def test_get_movie_detail(self): movie = random.choice(Movie.query.all()) res = self.client().get('/api/movies/' + str(movie.id)) self.assertEqual(res.status_code, 200) res_body = json.loads(res.data) self.assertEqual(res_body['movie']['title'], movie.title) self.assert...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_movie_404(self):\n res = self.client().get('/api/movies/9000')\n self.assertEqual(res.status_code, 404)", "def test_get_movies_404(self):\n res = self.client().get('/api/movies?page=9000')\n self.assertEqual(res.status_code, 404)", "def test_GET(self):\n if not s...
[ "0.70336574", "0.68296605", "0.67577624", "0.6741024", "0.67076015", "0.6544815", "0.6485564", "0.64373803", "0.642188", "0.64167374", "0.63728696", "0.6337332", "0.628469", "0.6279339", "0.6257676", "0.6241393", "0.6241393", "0.6168751", "0.6134067", "0.61219746", "0.6121974...
0.62884724
12
Verifies the /api/movies endpoint for POST.
def test_create_movie(self): res = self.client().post('/api/movies', json=self.movie_request) self.assertEqual(res.status_code, 201) res_body = json.loads(res.data) self.assertTrue(res_body['created']) new_movie_id = res_body['created'] new_movie = Movie.query.get(new_m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_post_movie_without_data(self):\n\n r = self.client.post(reverse('movieapi:movies'))\n self.assertJSONEqual(\n r.content,\n '{\"error\": \"Please provide a movie title\"}'\n )\n self.assertEqual(r.status_code, 400)", "def test_post_movie_exist_in_api(self...
[ "0.7183746", "0.7080511", "0.7073813", "0.6969857", "0.6820751", "0.6709503", "0.65159214", "0.6494194", "0.6493808", "0.64932877", "0.64187735", "0.6414218", "0.6410623", "0.63060164", "0.6252006", "0.62338805", "0.6195942", "0.6186867", "0.6144248", "0.61328226", "0.6062687...
0.63531613
13
Verifies the /api/actors/ endpoint for PATCH.
def test_update_actor(self): actor_id = random.choice(Actor.query.all()).id movie_id = random.choice(Movie.query.all()).id self.actor_update_request['movies'] = [movie_id] res = self.client().patch( '/api/actors/' + str(actor_id), json=self.actor_update_request) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_actors_405(self):\n actor_id = random.choice(Actor.query.all()).id\n\n res = self.client().put(\n '/api/actors/' + str(actor_id),\n json=self.actor_update_request)\n self.assertEqual(res.status_code, 405)", "def test_update_actors_422(self):\n actor_id =...
[ "0.77530986", "0.7070835", "0.69605434", "0.6870376", "0.6719554", "0.6531841", "0.6492705", "0.6419133", "0.6376321", "0.6370106", "0.6266339", "0.621742", "0.62067497", "0.6201754", "0.61207724", "0.60999304", "0.604322", "0.60401046", "0.6038964", "0.6038964", "0.6034577",...
0.62972856
10
Verifies the /api/movies/ endpoint for PATCH.
def test_update_movie(self): actor_id = random.choice(Actor.query.all()).id movie_id = random.choice(Movie.query.all()).id self.movie_update_request['actors'] = [actor_id] res = self.client().patch( '/api/movies/' + str(movie_id), json=self.movie_update_request) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_movies_405(self):\n movie_id = random.choice(Movie.query.all()).id\n\n res = self.client().put(\n '/api/movies/' + str(movie_id),\n json=self.movie_update_request)\n self.assertEqual(res.status_code, 405)", "def test_PATCH(self):\n if not self.url:\n ...
[ "0.7409508", "0.7068738", "0.7001972", "0.6900661", "0.6814445", "0.6758817", "0.6721971", "0.6597245", "0.6579382", "0.6536474", "0.6493584", "0.6355605", "0.626933", "0.62617135", "0.6240826", "0.6194475", "0.6069646", "0.60549694", "0.60242236", "0.5976905", "0.5952229", ...
0.6133761
16
Verifies the /api/actors endpoint for POST with 400 error.
def test_actors_post_400(self): res = self.client().post('/api/actors', json={'name': 'should fail with 400'}) self.assertEqual(res.status_code, 400)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_post_actor_422(self):\r\n res = self.client().post('/actors/create', json=partial_actor, headers=executive_producer)\r\n data = json.loads(res.data)\r\n\r\n self.assertEqual(res.status_code, 422)\r\n self.assertFalse(data[\"success\"])\r\n self.assertEqual(data[\"message...
[ "0.736958", "0.72089803", "0.71662885", "0.6956645", "0.66753465", "0.66561556", "0.6499574", "0.64971244", "0.6478843", "0.6477907", "0.6429148", "0.6382732", "0.635227", "0.6265262", "0.6262835", "0.6261073", "0.6170873", "0.6155908", "0.6135517", "0.6130483", "0.61302185",...
0.8234119
0
Verifies the /api/movies endpoint for POST with 400 error.
def test_movies_post_400(self): res = self.client().post( '/api/movies', json={ 'title': 'should fail with 400', 'releaseDate': 'not a date'}) self.assertEqual(res.status_code, 400)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_post_movie_without_data(self):\n\n r = self.client.post(reverse('movieapi:movies'))\n self.assertJSONEqual(\n r.content,\n '{\"error\": \"Please provide a movie title\"}'\n )\n self.assertEqual(r.status_code, 400)", "def test_post_movie_not_exist_in_api(...
[ "0.7669361", "0.76273066", "0.74475616", "0.7421448", "0.7371071", "0.7336143", "0.73201275", "0.7095828", "0.70068157", "0.6774914", "0.65431494", "0.6531888", "0.64743525", "0.6468835", "0.6462897", "0.64564633", "0.6406737", "0.6398448", "0.63791066", "0.63765025", "0.6373...
0.80540675
0
Verifies the /api/actors endpoint for PUT with 405 error.
def test_actors_405(self): actor_id = random.choice(Actor.query.all()).id res = self.client().put( '/api/actors/' + str(actor_id), json=self.actor_update_request) self.assertEqual(res.status_code, 405)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_movies_405(self):\n movie_id = random.choice(Movie.query.all()).id\n\n res = self.client().put(\n '/api/movies/' + str(movie_id),\n json=self.movie_update_request)\n self.assertEqual(res.status_code, 405)", "def test_PUT(self):\n if not self.url:\n ...
[ "0.7203475", "0.71582186", "0.70643693", "0.6855298", "0.6787217", "0.66657156", "0.66631263", "0.66078407", "0.65251565", "0.6501533", "0.64967006", "0.64873594", "0.6451919", "0.6380069", "0.6286058", "0.6268452", "0.6237185", "0.62064874", "0.6192541", "0.61876786", "0.617...
0.8539134
0
Verifies the /api/movies endpoint for PUT with 405 error.
def test_movies_405(self): movie_id = random.choice(Movie.query.all()).id res = self.client().put( '/api/movies/' + str(movie_id), json=self.movie_update_request) self.assertEqual(res.status_code, 405)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_update_should_not_be_allowed(self):\n response = self.client.put(self.get_url(), {})\n self.assertEqual(response.status_code, status.HTTP_405_METHOD_NOT_ALLOWED)", "def test_method_not_allowed(self):\n resp = self.app.put(\n \"/customers\", \n json={\"not\": \"...
[ "0.73923594", "0.7338249", "0.72608167", "0.719727", "0.7109039", "0.68659365", "0.6825966", "0.6811022", "0.6699959", "0.6654868", "0.66384363", "0.66073483", "0.6588955", "0.6545253", "0.6543278", "0.64945465", "0.64620954", "0.64416254", "0.6430741", "0.6381444", "0.628661...
0.8411562
0
Verifies the /api/actors endpoint for PATCH with 422 error.
def test_update_actors_422(self): actor_id = random.choice(Actor.query.all()).id res = self.client().patch( '/api/actors/' + str(actor_id), json={ 'movies': [9000]}) self.assertEqual(res.status_code, 422)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_patch_actor_400(self):\r\n res = self.client().patch('/actors/1000', json=partial_actor, headers=executive_producer)\r\n data = json.loads(res.data)\r\n\r\n self.assertEqual(res.status_code, 400)\r\n self.assertFalse(data[\"success\"])\r\n self.assertEqual(data[\"message...
[ "0.7737523", "0.77325755", "0.77132004", "0.7350758", "0.72788423", "0.7017891", "0.6864046", "0.6841678", "0.66569704", "0.66148716", "0.6532082", "0.6502491", "0.6493835", "0.6375473", "0.6139848", "0.6117574", "0.60813206", "0.59709334", "0.5964414", "0.5947567", "0.591834...
0.81923956
0
Verifies the /api/movies endpoint for PATCH with 422 error.
def test_update_movies_422(self): movie_id = random.choice(Movie.query.all()).id res = self.client().patch( '/api/movies/' + str(movie_id), json={ 'actors': [9000]}) self.assertEqual(res.status_code, 422)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_patch_movie_400(self):\r\n res = self.client().patch('/movies/8080', json=partial_movie, headers=executive_producer)\r\n data = json.loads(res.data)\r\n\r\n self.assertEqual(res.status_code, 400)\r\n self.assertFalse(data[\"success\"])\r\n self.assertEqual(data[\"message...
[ "0.7915641", "0.7774291", "0.77661866", "0.72901595", "0.72052044", "0.7095691", "0.6802385", "0.674592", "0.66869813", "0.6681508", "0.6635154", "0.65716726", "0.64996624", "0.64835703", "0.6460899", "0.6457916", "0.64054024", "0.6325634", "0.6291981", "0.62652194", "0.61820...
0.81920743
0
Verifies the /api/actors endpoint for GET with 404 error.
def test_get_actors_404(self): res = self.client().get('/api/actors?page=9000') self.assertEqual(res.status_code, 404)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_actor_404(self):\n res = self.client().get('/api/actors/9000')\n self.assertEqual(res.status_code, 404)", "def test_get_actors_404(self):\r\n res = self.client().get('/actors', headers=casting_assistant)\r\n data = json.loads(res.data)\r\n\r\n self.assertEqual(res....
[ "0.8504755", "0.8277479", "0.7690312", "0.70168084", "0.6972596", "0.69111615", "0.689922", "0.6803595", "0.67772114", "0.6749278", "0.66852665", "0.66488963", "0.6626995", "0.6619849", "0.6615818", "0.66025895", "0.6560836", "0.65582794", "0.655726", "0.6554461", "0.65433705...
0.830205
1
Verifies the /api/movies endpoint for GET with 404 error.
def test_get_movies_404(self): res = self.client().get('/api/movies?page=9000') self.assertEqual(res.status_code, 404)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_movie_404(self):\n res = self.client().get('/api/movies/9000')\n self.assertEqual(res.status_code, 404)", "def test_get_movies_404(self):\r\n res = self.client().get('/movies', headers=casting_assistant)\r\n data = json.loads(res.data)\r\n\r\n self.assertEqual(res....
[ "0.8452415", "0.8028694", "0.7770293", "0.74935764", "0.7333787", "0.723407", "0.7193577", "0.71781594", "0.7120322", "0.70819956", "0.7023064", "0.6945717", "0.6908821", "0.68984926", "0.6856866", "0.6846461", "0.67715687", "0.6767381", "0.6757949", "0.6744062", "0.672558", ...
0.8149062
1
Verifies the /api/actors/ endpoint for GET 404 error.
def test_get_actor_404(self): res = self.client().get('/api/actors/9000') self.assertEqual(res.status_code, 404)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_actors_404(self):\n res = self.client().get('/api/actors?page=9000')\n self.assertEqual(res.status_code, 404)", "def test_get_actors_404(self):\r\n res = self.client().get('/actors', headers=casting_assistant)\r\n data = json.loads(res.data)\r\n\r\n self.assertEqua...
[ "0.82339835", "0.8137178", "0.7572984", "0.70532614", "0.7005754", "0.6964063", "0.69488114", "0.6821199", "0.6782973", "0.6778052", "0.6742881", "0.67338127", "0.6728754", "0.6722985", "0.6702879", "0.66939706", "0.6668909", "0.6661744", "0.66469985", "0.6599747", "0.6593212...
0.8477056
0
Verifies the /api/movies/ endpoint for GET 404 error.
def test_get_movie_404(self): res = self.client().get('/api/movies/9000') self.assertEqual(res.status_code, 404)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_movies_404(self):\n res = self.client().get('/api/movies?page=9000')\n self.assertEqual(res.status_code, 404)", "def test_get_movies_404(self):\r\n res = self.client().get('/movies', headers=casting_assistant)\r\n data = json.loads(res.data)\r\n\r\n self.assertEqua...
[ "0.8058679", "0.79001886", "0.7659063", "0.7359638", "0.73295593", "0.7318915", "0.73044896", "0.7300113", "0.7284636", "0.7239822", "0.7076428", "0.7062315", "0.70553154", "0.69092184", "0.6894227", "0.6887245", "0.6886318", "0.686959", "0.6863155", "0.6854459", "0.68272805"...
0.8358935
0
Return the supplied variables as a sorted, unique list.
def variables(self): return sorted(set(self._variables))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unique(my_list):\n return [x for x in my_list if x not in locals()['_[1]']]", "def distinct(x):\n return list(set(x))", "def unique(x):\n\n return list(set(x))", "def sort_variables(variables):\n return tuple(sorted(variables, key=lambda v: (v.rank, v.shift)))", "def get_variables(self):\n ...
[ "0.66947114", "0.6627554", "0.6622112", "0.66006094", "0.647227", "0.63673735", "0.6355857", "0.632033", "0.6274599", "0.62558484", "0.61630744", "0.61561257", "0.60912186", "0.6052287", "0.60480154", "0.60290915", "0.6020137", "0.59673935", "0.59543794", "0.5936444", "0.5901...
0.7234148
0
Initialize a Census API session. Adds an instance of the CensusAPI class to this Query as an internal attribute, then removes it upon completion.
def create_census_api_session(self): self._census_api = CensusAPI(self.census_api_key) yield del self._census_api
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, api_key=None):\n self.session = Session()\n if api_key:\n self.session.headers.update({\n 'X-API-Key': api_key,\n })\n self._load_apis()", "def __init__(self, apikey: Optional[str] = None):\n self._current_request: Dict[str, Dict...
[ "0.63311005", "0.6008655", "0.5974372", "0.59560615", "0.58181155", "0.57948446", "0.5681679", "0.56604266", "0.56468034", "0.5592571", "0.55784166", "0.557527", "0.55635136", "0.5553449", "0.5553449", "0.5517603", "0.55035514", "0.54973626", "0.54932255", "0.5490672", "0.548...
0.76159686
0
Convert Census API variable data to a dataframe.
def convert_variables_to_dataframe(self, variables: Variables): records = [] for (year, variable_name), variable in variables.items(): variable['year'] = year records.append(variable) dataframe = DataFrame.from_records(records) # Drop/rename columns, clean up lab...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_to_df(data):\r\n ans = pd.DataFrame(data)\r\n return ans", "def to_dataframe(self):\n return df_util.to_dataframe(requests.get(self.__url).json())", "def run(self) -> DataFrame:\n with self.create_census_api_session():\n logger.info('Retrieving variables...')\n ...
[ "0.6738913", "0.6644083", "0.644223", "0.6396272", "0.63848734", "0.6286055", "0.6162323", "0.61454207", "0.61383504", "0.60980725", "0.605118", "0.60214764", "0.6002036", "0.5987633", "0.59718853", "0.5952039", "0.59008485", "0.5892687", "0.5883622", "0.5868245", "0.5867599"...
0.5639683
59
Sets the description of this PointOfInterestDetails. A paragraph describing this point of interest
def description(self, description): if description is None: raise ValueError("Invalid value for `description`, must not be `None`") self._description = description
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def description(self, description):\n self._description = description", "def description(self, description):\n self._description = description", "def description(self, description):\n self._description = description", "def description(self, description):\n self._description = desc...
[ "0.71724236", "0.71724236", "0.71724236", "0.71724236", "0.7121859", "0.7085888", "0.70773566", "0.70773566", "0.70773566", "0.70773566", "0.70773566", "0.70773566", "0.70773566", "0.70773566", "0.70773566", "0.70773566", "0.70773566", "0.70773566", "0.70773566", "0.70773566", ...
0.6484499
68
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, PointOfInterestDetails): 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
Gets the id of this BusinessSubCategory.
def id(self) -> str: return self._id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def business_sub_cat_code(self) -> str:\n return self._business_sub_cat_code", "def getId(self):\n return _libsbml.Submodel_getId(self)", "def get_id(self) -> int:\n return self.id", "def get_id(self) -> int:\n return self.id", "def GetId(self):\n return int(self.id)", ...
[ "0.6897894", "0.6636805", "0.64192647", "0.64192647", "0.6346408", "0.6327802", "0.6320828", "0.6320828", "0.6320828", "0.6320828", "0.6320828", "0.6320828", "0.6306391", "0.6306391", "0.63056004", "0.63056004", "0.63056004", "0.63056004", "0.63056004", "0.63056004", "0.63056...
0.0
-1
Sets the id of this BusinessSubCategory.
def id(self, id: str): if id is None: raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 self._id = id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_id(self, id_):\n\n self.id_ = id_", "def set_id(self, id):\n self.__id = id", "def SetId(self, id):\n self.id = int(id)", "def set_id(self, id):\n self.data['id'] = id", "def setID(self, id):\r\n raise NotImplementedError(\"must be implemented in subclass\")", "...
[ "0.68174165", "0.6722747", "0.666562", "0.65748024", "0.6488325", "0.6430983", "0.6430983", "0.6240782", "0.62299764", "0.6188123", "0.6188123", "0.6188123", "0.6188123", "0.6188123", "0.6188123", "0.6185981", "0.6185981", "0.6185981", "0.6185981", "0.6185981", "0.6185981", ...
0.0
-1
Gets the business_sub_cat_code of this BusinessSubCategory.
def business_sub_cat_code(self) -> str: return self._business_sub_cat_code
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def business_sub_cat_code(self, business_sub_cat_code: str):\n if business_sub_cat_code is None:\n raise ValueError(\"Invalid value for `business_sub_cat_code`, must not be `None`\") # noqa: E501\n\n self._business_sub_cat_code = business_sub_cat_code", "def business_sub_cat_desc(self) ...
[ "0.7605344", "0.6765947", "0.6251812", "0.57745695", "0.556649", "0.5545539", "0.5465325", "0.54629284", "0.54003656", "0.53685343", "0.5246548", "0.5246548", "0.519134", "0.51795816", "0.51795816", "0.51795816", "0.51795816", "0.5151316", "0.514392", "0.51423526", "0.5106227...
0.8694409
0
Sets the business_sub_cat_code of this BusinessSubCategory.
def business_sub_cat_code(self, business_sub_cat_code: str): if business_sub_cat_code is None: raise ValueError("Invalid value for `business_sub_cat_code`, must not be `None`") # noqa: E501 self._business_sub_cat_code = business_sub_cat_code
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def business_sub_cat_code(self) -> str:\n return self._business_sub_cat_code", "def subcategory(self, subcategory):\n\n self._subcategory = subcategory", "def business_sub_cat_desc(self, business_sub_cat_desc: str):\n if business_sub_cat_desc is None:\n raise ValueError(\"Invali...
[ "0.6924262", "0.6833727", "0.63858783", "0.62838686", "0.6058496", "0.5876403", "0.58172184", "0.56597304", "0.56597304", "0.5445611", "0.5266416", "0.5239756", "0.5226723", "0.5123117", "0.50378674", "0.50373673", "0.499838", "0.49324727", "0.49234694", "0.49228492", "0.4879...
0.8509109
0
Gets the business_sub_cat_desc of this BusinessSubCategory.
def business_sub_cat_desc(self) -> str: return self._business_sub_cat_desc
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def business_sub_cat_desc(self, business_sub_cat_desc: str):\n if business_sub_cat_desc is None:\n raise ValueError(\"Invalid value for `business_sub_cat_desc`, must not be `None`\") # noqa: E501\n\n self._business_sub_cat_desc = business_sub_cat_desc", "def business_sub_cat_code(self) ...
[ "0.7938573", "0.6761404", "0.63586503", "0.60882676", "0.6067506", "0.58231914", "0.5814094", "0.5791072", "0.576317", "0.5758855", "0.5758855", "0.5743089", "0.5743089", "0.5743089", "0.5743089", "0.571445", "0.57057905", "0.5665772", "0.56429905", "0.5635798", "0.563536", ...
0.87982297
0
Sets the business_sub_cat_desc of this BusinessSubCategory.
def business_sub_cat_desc(self, business_sub_cat_desc: str): if business_sub_cat_desc is None: raise ValueError("Invalid value for `business_sub_cat_desc`, must not be `None`") # noqa: E501 self._business_sub_cat_desc = business_sub_cat_desc
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def business_sub_cat_desc(self) -> str:\n return self._business_sub_cat_desc", "def subcategory(self, subcategory):\n\n self._subcategory = subcategory", "def business_sub_cat_code(self, business_sub_cat_code: str):\n if business_sub_cat_code is None:\n raise ValueError(\"Invali...
[ "0.71058977", "0.67524236", "0.66657126", "0.56141263", "0.5574855", "0.5569374", "0.5514147", "0.5459467", "0.5315659", "0.5277985", "0.52232623", "0.5189859", "0.51417226", "0.51297593", "0.5105276", "0.5077311", "0.5034535", "0.5010001", "0.5006874", "0.4995119", "0.499511...
0.8706907
0
resize images to 50x50 and format to prediction
def resizeImages(img_path,size=(50,50)): image = cv2.imread(img_path) resized = cv2.resize(image, size, interpolation=cv2.INTER_CUBIC) img=np.array([resized.flatten()]) #print('resized image') return img
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transform_images(img, size):\n return tf.image.resize(img, (size, size)) / 255", "def predict(self, images):\n\t\t#testing_dataset = tf.data.Dataset.from_tensor_slices(images)\n\t\ttf.keras.backend.set_learning_phase(0)\n\t\ttesting_dataset = tf.data.Dataset.from_tensor_slices(np.asarray(images)).map(lamb...
[ "0.68604827", "0.6766464", "0.6618284", "0.65858746", "0.6488961", "0.6461775", "0.645167", "0.64168435", "0.6393736", "0.636626", "0.635736", "0.6345443", "0.6338677", "0.6327659", "0.63260883", "0.63120335", "0.6290741", "0.62271947", "0.6219287", "0.6213716", "0.62015384",...
0.6508313
4
Convert a time series to a ``pandas.DataFrame``.
def timeseries_to_dataframe(timeseries, name=None): # Checks assert_pandas_installed() assert isinstance(timeseries, _get_timeseries_class()), ( "timeseries must be an instance of energyquantified.data.Timeseries" ) if not name: name = timeseries.name # Conversion ValueType =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _timeseries_to_dataframe_value(timeseries, name):\n # Column headers\n columns = [\n [name],\n [timeseries.instance_or_contract_dataframe_column_header()],\n ['']\n ]\n # Convert a time series of (date, value)\n df = pd.DataFrame.from_records(\n ((v.value,) for v in t...
[ "0.7264679", "0.7184629", "0.7114292", "0.7014769", "0.6890154", "0.68870705", "0.68756896", "0.68525416", "0.6821507", "0.68122834", "0.6789025", "0.6719501", "0.67024094", "0.6628775", "0.65241706", "0.6522452", "0.6489302", "0.6486745", "0.648211", "0.648211", "0.64294994"...
0.7112368
3
Returns the cacher's representation.
def __repr__(self): result = [ self.__class__.__name__, '(func = ', repr(self.func), ', timeout = ', repr(self.timeout), ] cached = self.cached if (cached is not ...): result.append(' cached = ') ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __repr__(self):\n return \"<Cache(backend={}, cached_items={}, len_items={})\".format(\n self.backend, list(self.items()), len(self)\n )", "def dumpCache(self):\n return \"\\n\".join([\"%s:%s\" % (k,v) for k,v in self._cache.iteritems()])", "def __repr__(self):\n retu...
[ "0.70366895", "0.66057676", "0.652639", "0.64529806", "0.6388808", "0.6388808", "0.6387026", "0.63004243", "0.6295817", "0.62940514", "0.6291049", "0.62738806", "0.61905664", "0.61905664", "0.61905664", "0.61905664", "0.61905664", "0.6153315", "0.61376864", "0.61330104", "0.6...
0.0
-1
Returns the cacher's representation.
def __repr__(self): repr_parts = [ self.__class__.__name__, '(func = ', repr(self.func), ', timeout = ', repr(self.timeout), ] rate_limit_group, rate_limit_limiter = self._rate_limit_proxy_parameters repr_parts...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __repr__(self):\n return \"<Cache(backend={}, cached_items={}, len_items={})\".format(\n self.backend, list(self.items()), len(self)\n )", "def dumpCache(self):\n return \"\\n\".join([\"%s:%s\" % (k,v) for k,v in self._cache.iteritems()])", "def __repr__(self):\n retu...
[ "0.70366895", "0.66057676", "0.652639", "0.64529806", "0.6388808", "0.6388808", "0.6387026", "0.63004243", "0.6295817", "0.62940514", "0.6291049", "0.62738806", "0.61905664", "0.61905664", "0.61905664", "0.61905664", "0.61905664", "0.6153315", "0.61376864", "0.61330104", "0.6...
0.0
-1
Sets value to the cache and marks it as synced.
def set(self, value): self.value = value self.synced = True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_cache(self, val):\n pass", "def cache_set(self, key: str, value: bytes) -> None:\n if self.cache is not None:\n self.cache.set(key, value)", "def set_cache(self, key, value):\n self.r.set(key, value)\n self.r.expire(key, time=1500)", "def set(key, value):\n ...
[ "0.7861418", "0.7596584", "0.7511834", "0.74870884", "0.7327626", "0.7179107", "0.7107291", "0.7083894", "0.70254993", "0.70114094", "0.6947901", "0.6883676", "0.6847639", "0.682887", "0.672705", "0.6683669", "0.6682068", "0.6638803", "0.6613783", "0.6540759", "0.6502809", ...
0.7697959
1
TESTING IF the application gracefully handles an 'unavailable' redis instance by throwing an exception VERIFIED by detecting that the expected response is an empty array
def test_request_redis_unavailable(self): expected_response_as_json = [] response = self.client.get(url_for('filmlocations_auto_complete') + '?term=mar') received_response_as_json = json.loads(response.get_data()) received_response_as_json = [ r_r_as_json.encode('ascii').strip(' \t\n\r')...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _is_redis_available(self) -> None:\n try:\n redis = self._conn_redis()\n redis.ping()\n except ConnectionError as err:\n raise HTTPException(status_code=500,detail=f\"REDIS CONNECTION -> {err}\")", "def test_readiness_endpoint(self):\n url = f'{BASE_URL}/...
[ "0.6352656", "0.62386304", "0.61284566", "0.60502183", "0.6019466", "0.5998941", "0.59740365", "0.59245306", "0.58610326", "0.58450323", "0.5844633", "0.584382", "0.5839906", "0.5836667", "0.58301044", "0.58235556", "0.57938904", "0.57929516", "0.57862866", "0.57752895", "0.5...
0.6677707
0
Evaluates a box in 3D. It computes metrics of view angle and 3D IoU.
def evaluate_3d(self, box_point_3d, instance): azimuth_error, polar_error = self.evaluate_viewpoint(box_point_3d, instance) iou = self.evaluate_iou(box_point_3d, instance) return azimuth_error, polar_error, iou
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def evaluate_iou(self, box, instance):\n # Computes 3D IoU of the two boxes.\n prediction = Box.Box(box)\n annotation = Box.Box(instance)\n iou = IoU3D.IoU(prediction, annotation)\n iou_result = iou.iou()\n self._iou_3d += iou_result\n return iou_result", "def I3_u3(self) -> complex:\n ...
[ "0.6885483", "0.6285064", "0.5806174", "0.57596356", "0.57263684", "0.56738544", "0.56324893", "0.56155187", "0.56037754", "0.5586932", "0.5564757", "0.555859", "0.55435187", "0.5528565", "0.55233914", "0.55190146", "0.54865116", "0.54580194", "0.54546237", "0.5449776", "0.54...
0.7811775
0
Computes a ray from camera to box centroid in box frame. For vertex in camera frame V^c, and object unit frame V^o, we have R Vc + T = S Vo, where S is a 33 diagonal matrix, which scales the unit box to its real size. In fact, the camera coordinates we get have scale ambiguity. That is, we have Vc' = 1/beta Vc, and S' ...
def compute_ray(self, box): if box[0, -1] > 0: warnings.warn('Box should have negative Z values.') size_x = np.linalg.norm(box[5] - box[1]) size_y = np.linalg.norm(box[3] - box[1]) size_z = np.linalg.norm(box[2] - box[1]) size = np.asarray([size_x, size_y, size_z]) box_o = Box.UNIT_BOX * ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def intersectRay(self, ray):\n # Ray Tracing from the Ground Up, pg. 367\n a, b, c, d = self.a[0] - self.b[0], self.a[0] - self.c[0], ray.d[0], self.a[0] - ray.o[0]\n e, f, g, h = self.a[1] - self.b[1], self.a[1] - self.c[1], ray.d[1], self.a[1] - ray.o[1]\n i, j, k, L = self.a[2] - sel...
[ "0.561254", "0.544376", "0.5349627", "0.52605236", "0.5258258", "0.5247248", "0.5238791", "0.5234288", "0.5214221", "0.5193344", "0.51634294", "0.5163062", "0.50828195", "0.5080793", "0.5065623", "0.502802", "0.5023564", "0.5023564", "0.5008342", "0.49731916", "0.49711168", ...
0.70142025
0
Convert the RdKit molecule object to a PNG image.
def draw(rdm): return Draw.MolToImage( rdm, size=(300, 300), kekulize=True, wedgeBonds=True, fitImage=False, options=None, canvas=None)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _repr_png_(self):\n mol = self.owner.mol\n keku = IPythonConsole.kekulizeStructures\n size = IPythonConsole.molSize\n opts = IPythonConsole.drawOptions\n return Draw._moltoimg(\n mol, size, self.aix, \"\", returnPNG=True, drawOptions=opts,\n kekulize=kek...
[ "0.7556578", "0.7556578", "0.67021716", "0.6438445", "0.6419436", "0.62635803", "0.6162048", "0.6137266", "0.6070926", "0.5998691", "0.59447825", "0.59447825", "0.5926023", "0.588482", "0.5881045", "0.58088887", "0.5793453", "0.576393", "0.5763198", "0.5762914", "0.5717163", ...
0.6369118
5
Takes a string or list and returns the properly formatted Photobucket identifier.
def clean_identifier(self, identifier): if isinstance(identifier, list): return '%2F'.join(identifier) else: return identifier
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bucket_name(self) -> str:\n ...", "def get_new_bucket_name():\n name = '{prefix}{num}'.format(\n prefix=prefix,\n num=next(bucket_counter),\n )\n return name", "def bucket(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"bucket\")", "def bucket(self) -> pul...
[ "0.5813181", "0.5798032", "0.57079786", "0.57079786", "0.57079786", "0.57079786", "0.57079786", "0.5698029", "0.56424", "0.5595516", "0.5582968", "0.5582968", "0.5582968", "0.5582968", "0.5582968", "0.55747515", "0.5573314", "0.55569685", "0.55569685", "0.55227685", "0.551303...
0.0
-1
Helper function that removes all keys from a dictionary (d), that have a None value.
def remove_empty(d): for key in d.keys(): if d[key] is None: del d[key] return d
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def del_none(d):\n for key, value in list(d.items()):\n if value is None or value == \"\":\n del d[key]\n elif isinstance(value, dict):\n del_none(value)\n return d", "def del_none(d):\n for key, value in list(d.items()):\n if value is None:\n del d[...
[ "0.8187683", "0.81422937", "0.8137236", "0.8130197", "0.80859447", "0.80317193", "0.79847986", "0.7910518", "0.78652364", "0.7856798", "0.77777606", "0.7624497", "0.7506456", "0.7472617", "0.74555653", "0.7387826", "0.7329381", "0.73156404", "0.7253643", "0.7232875", "0.71908...
0.8234759
0
Determine whether to render the previous item, or just adjust self.render_offset_item.
def select_item_prev(self): loc_diff = self._get_distance_betweenitems(self.page_current.item_selected, self.page_current.item_selected - 1) if loc_diff + self.render_offset_item < self.terminal_height: self.page_current.item_selected -= 1 self.render_offset_item = 0 els...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prev_item(self):\n if self.page - 1 < 0:\n self.page = len(self.result) - 1\n else:\n self.page -= 1\n return self.present_view()", "def has_prev(self):\n return self.page > 1", "def has_prev(self):\n return self.page > 1", "def select_previous_ite...
[ "0.65832585", "0.6125276", "0.6125276", "0.5922323", "0.58801293", "0.586687", "0.58556783", "0.58264995", "0.5795122", "0.5729961", "0.56663185", "0.5557255", "0.54947054", "0.5478901", "0.5463834", "0.5441994", "0.53901106", "0.53634727", "0.5300499", "0.5296394", "0.526935...
0.72054994
0
Turn the switch off.
def turn_off(self): self._state = False if(self._device['type'] == '_DT-PLUG' or self._device['type'] == '_THIMR'): self._send_cmd(self._device, 'cmd=ctrl&devices={[' + self._device["sid"] + ']}&op={"cmd":5,"op":0 }', 5) if(self._device['type'] == '_REALY2' or self._device['type'] ==...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def turn_off(self, **kwargs):\n self.smartplug.turn_off()", "def off_switch(self):\n self._switch_callback = None", "def turn_off(self):\n self.handleCommand(1)\n self._state = STATE_OFF", "def turn_off(self, **kwargs):\n set_sonoff_state(self._host, \"off\")\n self....
[ "0.870139", "0.867637", "0.85906535", "0.8523712", "0.84588856", "0.84180963", "0.8404447", "0.8375364", "0.83491224", "0.83192796", "0.82949907", "0.8277566", "0.81680954", "0.8155346", "0.8112255", "0.8091075", "0.8072859", "0.8058921", "0.8058517", "0.8041678", "0.8036265"...
0.8398465
7
Add routes to app instance.
def add_route(app, *args): for route in args: app.router.add_route(route[0], route[1], route[2])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_routes(self):\n# from server.flask import views as flask_views\n# flask_views_custom_methods = filter(lambda x: x.startswith(\"view_\"), dir(flask_views))\n# for custom_method in flask_views_custom_methods:\n# # Retrieve data needed to add the URL rule to the Flask app\n# ...
[ "0.8077705", "0.8063732", "0.7909525", "0.7509684", "0.72847944", "0.7172015", "0.7030889", "0.70093215", "0.6987507", "0.6976107", "0.6963949", "0.6909287", "0.6901248", "0.68898636", "0.6791074", "0.6744504", "0.67350864", "0.67300874", "0.6725262", "0.6671983", "0.6628391"...
0.70855063
6
Gets the bed_type of this RoomInfo. The type of bed or beds in the room, such as Double, or King.
def bed_type(self): return self._bed_type
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def room_type(self):\n return self._room_type", "def room_type(self):\n return self._room_type", "def bed_type(self, bed_type):\n if bed_type is None:\n raise ValueError(\"Invalid value for `bed_type`, must not be `None`\")\n\n self._bed_type = bed_type", "def get_room_...
[ "0.69424945", "0.69424945", "0.6483079", "0.64119035", "0.5934488", "0.5785011", "0.5666179", "0.55417895", "0.5522779", "0.54863435", "0.5463758", "0.5432547", "0.5432163", "0.5416872", "0.5365245", "0.52952075", "0.52631015", "0.52631015", "0.5257579", "0.5250233", "0.52502...
0.8225724
0
Gets the number_of_beds of this RoomInfo. The number of beds in the room. May be an integer or a freetext dessciption, as provided by the hotel
def number_of_beds(self): return self._number_of_beds
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def num_rooms(self) -> int:\n return self._num_rooms", "def rooms(self):\n count = self.db.query('select count(*) as room_count from rooms')\n return count.all()[0]['room_count']", "def number_of_beds(self, number_of_beds):\n if number_of_beds is None:\n raise ValueError(...
[ "0.6649895", "0.6327696", "0.5931893", "0.581397", "0.5768013", "0.5757121", "0.56020474", "0.5583566", "0.55801636", "0.5483165", "0.5446756", "0.54466957", "0.54181796", "0.5396766", "0.5347478", "0.5341912", "0.53333735", "0.53291655", "0.5323238", "0.530691", "0.53026336"...
0.80072045
0
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, RoomInfo): 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
returns all data from self.data, but removes index from first element
def all_dicoms(self): return [dcm_ctr_pair[1:] for dcm_ctr_pair in self.data]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete(self):\n first = self.data[0]\n self.data.pop(0)\n self.size = self.size - 1\n return first", "def remove(self, index):\n self.data.pop(index)", "def delete(data, index):\n return data[:index] + data[index + 1:]", "def get_data(self):\n idxs = self.get_...
[ "0.706439", "0.67123884", "0.663306", "0.6626242", "0.66005373", "0.6490836", "0.64037836", "0.63730013", "0.6351212", "0.6350621", "0.63192725", "0.6172669", "0.61615044", "0.6156417", "0.6143472", "0.6124767", "0.6124227", "0.61057097", "0.60929596", "0.6079078", "0.607406"...
0.0
-1
A list of commutative (order independed) operators for that instance. >>> p = ExpressionSpace(binary_operators=[ast.Add, ast.Sub, ast.Mult, ast.Div]) >>> p.commutative_operators [, ]
def commutative_operators(self) -> List[Type[ast.operator]]: return [ op for op in self.binary_operators if op in self.cummitative_operator_set ]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def non_commutative_operators(self) -> List[Type[ast.operator]]:\n return [\n op\n for op in self.binary_operators\n if op not in self.cummitative_operator_set\n ]", "def operators(self):\n return self._operators", "def operators(self):\n return self...
[ "0.74694145", "0.68025", "0.66767037", "0.6435156", "0.6291853", "0.60966283", "0.60181224", "0.6001268", "0.5988085", "0.58181995", "0.58028257", "0.576582", "0.57401127", "0.571688", "0.57155156", "0.5682469", "0.5635712", "0.5614318", "0.5576999", "0.5530264", "0.552668", ...
0.83971584
0
Returns the LCM of two integers. Uses the GCD function as a / gcd(a, b) b.
def lcm_for_two(a, b): return a // gcd_for_two(a, b) * b
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculate_lcm(a, b):\n return a * b / calculate_gcd(a, b)", "def lcm(a: int, b: int):\n return (a * b) // euclid(a, b)", "def lcm(a, b):\n\n\treturn (a * b)/gcd(a, b)", "def lcm(a, b):\n\treturn a * b // gcm(a, b)", "def lcm(a: int, b: int) -> int:\n return a * b // gcd(a, b)", "def lcm(a: i...
[ "0.8572639", "0.8488995", "0.8396273", "0.8383108", "0.8380495", "0.8380495", "0.83727425", "0.83710563", "0.83636117", "0.83636117", "0.83636117", "0.83636117", "0.83636117", "0.83636117", "0.83636117", "0.83636117", "0.83636117", "0.83572525", "0.8338785", "0.8336183", "0.8...
0.8313782
22
Checks if an integer is prime.
def is_prime(n): if n < 2: return False if not n % 2: return False for possible_factor in range(3, int(sqrt(n)) + 1, 2): if not n % possible_factor: return False return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_prime(number: int) -> bool:\n\n if number % 2 == 0 and number > 2:\n return False\n return all(number % i for i in range(3, int(math.sqrt(number)) + 1, 2))", "def is_prime(number):\n number = int(number)\n\n if number < 2:\n return False\n if number < 4:\n return True\n...
[ "0.7611812", "0.7596536", "0.7590902", "0.7570633", "0.7568463", "0.75400525", "0.74853486", "0.7477893", "0.7472059", "0.7450135", "0.74407095", "0.7414853", "0.74082446", "0.73740417", "0.7365249", "0.73650455", "0.7362802", "0.73524654", "0.73285514", "0.73270714", "0.7325...
0.69583964
87
This function returns a list of characters in a sentence. This function takes the novel as a list of sentences where each sentence is word_tokenized
def combine_persons(sent_tagged): persons = [] i = 0 while i < len(sent_tagged) - 3: if sent_tagged[i][1] == 'PERSON': if sent_tagged[i+1][1] == 'PERSON': if sent_tagged[i+2][1] == 'PERSON': persons.append(sent_tagged[i][0].lower() + ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_tokens(sent):\n return word_tokenize(sent)", "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_pun...
[ "0.7464299", "0.7337631", "0.72985953", "0.72795457", "0.72779304", "0.72671163", "0.72671163", "0.7238809", "0.7213269", "0.71857816", "0.7163832", "0.71335393", "0.712275", "0.712195", "0.7108907", "0.7100862", "0.70457095", "0.7031791", "0.69704705", "0.6907093", "0.687704...
0.0
-1
Create timestamp at the second level and date
def get_datetime() -> Tuple[str, str]: datetime_obj = datetime.now() return datetime_obj.strftime("%Y-%m-%d %H:%M:%S"), datetime_obj.strftime("%Y-%m-%d")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _make_timestamp(self):\r\n\t\tlogger.debug(\"Get a timestamp\")\r\n\t\treturn time.mktime(datetime.today().timetuple())", "def _create_timestamp():\n return (datetime.utcnow() - datetime(1970,1,1)).total_seconds()", "def create_timestamp(record):\n\n timestamp = datetime.fromtimestamp(record.crea...
[ "0.6543595", "0.62784827", "0.6236969", "0.6175445", "0.61558276", "0.6046647", "0.5893648", "0.5781556", "0.5771672", "0.57648426", "0.5745555", "0.573343", "0.56829256", "0.56492865", "0.5626629", "0.56041116", "0.5599562", "0.5548942", "0.5528563", "0.548113", "0.54794765"...
0.0
-1
Check if segment is within buffer of multilinestring. First check if given linestring completely overlaps any part of multilinestring and if it does, returns True. Next it starts to segmentize the multilinestring to smaller linestrings and consequently checks if these segments are completely within a buffer made of the...
def segment_within_buffer( linestring: LineString, multilinestring: MultiLineString, snap_threshold: float, snap_threshold_error_multiplier: float, overlap_detection_multiplier: float, ) -> bool: # Test for a single segment overlap if linestring.overlaps(multilinestring): return True...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bbox_segment_intersects(bbox, a, b):\n # check whether the line is completely left/right/above/below the bbox\n if ((a[0] < bbox[0] and b[0] < bbox[0]) or\n (a[0] > bbox[2] and b[0] > bbox[2]) or\n (a[1] < bbox[1] and b[1] < bbox[1]) or\n (a[1] > bbox[3] and b[1] > bbox[2])):\n ...
[ "0.59786683", "0.5907512", "0.5906041", "0.58951813", "0.58846414", "0.5660672", "0.56305766", "0.5613471", "0.55979085", "0.5575797", "0.55736905", "0.54944193", "0.5475475", "0.5451903", "0.54461825", "0.54158235", "0.53992814", "0.53659046", "0.53375757", "0.533522", "0.53...
0.76822996
0
Determine the middle segment within a triangle error. The middle segment always intersects the other two.
def determine_middle_in_triangle( segments: List[LineString], snap_threshold: float, snap_threshold_error_multiplier: float, ) -> List[LineString]: candidates = [] for idx, linestring in enumerate(segments): others = segments.copy() others.pop(idx) if ( sum( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def inters_segment(self, s):\r\n if (self.m == s.m) and (self.n == s.n):\r\n # The segment s is over this segment. Return the middle point\r\n x = (self.start[0] + self.end[0]) / 2\r\n y = (self.start[1] + self.end[1]) / 2\r\n elif self.m == s.m:\r\n # The ...
[ "0.6779729", "0.6485369", "0.610233", "0.6084453", "0.6005167", "0.59536135", "0.5812558", "0.58101064", "0.57430744", "0.5740419", "0.5737338", "0.57369435", "0.57258475", "0.5710122", "0.5680671", "0.56766444", "0.5644514", "0.5615491", "0.5588933", "0.5588603", "0.5586218"...
0.6410356
2
Create a pose marker that identifies a position and orientation in space with 3 colored lines.
def load_pose_markers(self, size=0.25): [p.removeBody(i) for i in self.marker_ids] self.marker_ids = [] for color, pos in self.markers: vs_id = p.createVisualShape(p.GEOM_SPHERE, radius=size, rgbaColor=color) self.marker_ids.append(p.createMultiBody(basePosition=pos, bas...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_pose_marker(position=np.array([0, 0, 0]),\n orientation=np.array([0, 0, 0, 1]),\n text='',\n xColor=np.array([1, 0, 0]),\n yColor=np.array([0, 1, 0]),\n zColor=np.array([0, 0, 1]),\n ...
[ "0.7159322", "0.64073616", "0.6176206", "0.61683", "0.60265714", "0.6003479", "0.59611666", "0.576842", "0.5755171", "0.566456", "0.5663631", "0.5622012", "0.5613417", "0.5609228", "0.54876626", "0.5445073", "0.54262155", "0.5379516", "0.5360807", "0.53535366", "0.53455764", ...
0.5091022
43
Id of the endpoint. For Network/Application Load Balancer this value is the ARN. For EIP, this value is the allocation ID. For EC2 instances, this is the EC2 instance ID
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 endpoint_id...
[ "0.77857715", "0.77857715", "0.77857715", "0.76098603", "0.76098603", "0.7293779", "0.6685537", "0.66341674", "0.66168725", "0.660838", "0.660838", "0.6538094", "0.65256697", "0.64971286", "0.6496729", "0.64494956", "0.64470094", "0.64470094", "0.64428145", "0.6247171", "0.61...
0.7794475
0
Reformat a URL with all querystrings stripped
def clean_url(url): return url[:url.find('?')]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _clean_url(self, url):\n return \"\".join(url.split(\"?\")[:1])", "def clean_params(self, url):\n if isinstance(url, unicode):\n url = url.encode(\"utf-8\")\n parts = list(urlparse.urlsplit(url))\n if not parts[3]:\n return url\n query = urlparse.parse...
[ "0.7512065", "0.7292141", "0.7116302", "0.7027133", "0.69887096", "0.6940092", "0.69270927", "0.6912284", "0.6896865", "0.6867878", "0.6850059", "0.6793596", "0.67898434", "0.6648866", "0.6647604", "0.6644823", "0.6616188", "0.65985245", "0.65750414", "0.65685046", "0.6566514...
0.7085079
3
The stimulus response coherence estimated how linearly related stimulus and response are. The coherence varies between 0 (no linear correlation) to 1 (perfect linear correlation). Deviations from 1 are attributed to noise or nonlinearities in the system. To disect these two effects the expected coherence can be estimat...
def stimulus_response_coherence(filename, segment_length): data, stimulus, sampling_interval, time = load_data(filename) nyquist = 1./(sampling_interval * 2.) f_step = 1./(sampling_interval * segment_length) f = np.arange(0, nyquist + f_step, f_step) noOfSamples = data.shape[0] noOfSegments = in...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def coherence(self):\r\n return np.abs(self.coherency) ** 2", "def coherence(self):\r\n coherence = np.abs(self.coherency ** 2)\r\n\r\n return coherence", "def test_coherence_linear_dependence():\r\n t = np.linspace(0, 16 * np.pi, 2 ** 14)\r\n x = np.sin(t) + np.sin(2 * t) + np.sin(3...
[ "0.66904163", "0.6668862", "0.64945793", "0.6083922", "0.60252523", "0.60187006", "0.58837366", "0.58010423", "0.57307696", "0.56871575", "0.5676208", "0.56685543", "0.5657118", "0.56354284", "0.56332225", "0.5594225", "0.55690795", "0.556234", "0.5561283", "0.55571085", "0.5...
0.658829
2
Return the x coordinate (vertical)
def x(self): return self._x
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_x_position(self):\n return self.rect.x", "def get_x(self):\n return self.posX", "def _get_x(self):\n return self.position.x", "def get_x_position(self):\n return self.actual_coordinates[0]", "def Getxcoord(self):\n return self.x_coord", "def get_x(self):\n ...
[ "0.78823817", "0.7851824", "0.7847954", "0.7703079", "0.76690346", "0.76664925", "0.76322305", "0.75903165", "0.755932", "0.7473105", "0.74107146", "0.737932", "0.73631865", "0.73108417", "0.7306643", "0.72478956", "0.72195935", "0.71408445", "0.7121069", "0.70658046", "0.705...
0.0
-1
Return the y coordinate (horizontal)
def y(self): return self._y
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def y(self):\n return self.coords[1]", "def get_y(self):\n return self.coords[1]", "def y(self):\n return self._coords[1]", "def __get_y__(self):\n return self.Direction['y']", "def _get_y(self):\n return self.position.y", "def y(self):\r\n return self.position.y", ...
[ "0.8070764", "0.79848284", "0.7934319", "0.7932412", "0.7884724", "0.7874962", "0.78633183", "0.78532064", "0.78136873", "0.7783962", "0.7783962", "0.7770176", "0.77372783", "0.7736732", "0.772113", "0.7696792", "0.7671294", "0.7662695", "0.7642503", "0.7632229", "0.7591276",...
0.71777797
42
The y componenet of the rectangl top side
def top(self): return self.points['topRight'].y
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def y(self):\n return self.top", "def top_y(self):\r\n return self.position.y + self.size.y + self.bulk", "def get_y_position(self): \n return self.rect.y", "def _rect_top(self):\n\treturn max(self.y, self.y + self.h)", "def __get_y__(self):\n return self.Direction['y']", ...
[ "0.8217148", "0.80936563", "0.80764747", "0.77679944", "0.77603805", "0.7759979", "0.775891", "0.7698703", "0.769433", "0.7688902", "0.768608", "0.7634247", "0.76342314", "0.7579052", "0.7574395", "0.7574395", "0.7556435", "0.75389355", "0.7532752", "0.7532596", "0.7507718", ...
0.7465043
22
The y componenet of the rectangl bottom side
def bottom(self): return self.points['bottomRight'].y
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bottom_y(self):\r\n return self.position.y - self.size.y - self.bulk", "def get_y_position(self): \n return self.rect.y", "def _rect_bottom(self):\n\treturn min(self.y, self.y + self.h)", "def get_y(self):\n\t\treturn self._collision_rect.y + 25", "def y(self):\n return self.t...
[ "0.82220465", "0.8033474", "0.7907037", "0.784876", "0.7817276", "0.77324426", "0.7728424", "0.769889", "0.76759654", "0.76178837", "0.75938785", "0.7576494", "0.7567398", "0.7545145", "0.75163597", "0.74841964", "0.7455933", "0.74463695", "0.7415957", "0.7414551", "0.7412332...
0.7634104
10
The x componenet of the rectangl right side
def right(self): return self.points['topRight'].x
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_x(self):\n\t\treturn self._collision_rect.x + 14", "def _rect_right(self):\n\treturn max(self.x, self.x + self.w)", "def x(self):\n return self._turtle.xcor()", "def x(self):\n return self._turtle.xcor()", "def __get_x__(self):\n return self.Direction['x']", "def x(self):\r\n...
[ "0.7396622", "0.7385052", "0.7382235", "0.7382235", "0.7310512", "0.71910846", "0.71445245", "0.71370685", "0.71019804", "0.70923847", "0.70682836", "0.7034941", "0.6968542", "0.6939304", "0.6933613", "0.6899476", "0.6898211", "0.68823797", "0.6867704", "0.6859698", "0.684733...
0.71790123
7
The x componenet of the rectangl left side
def left(self): return self.points['topLeft'].x
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_x(self):\n\t\treturn self._collision_rect.x + 14", "def get_x(self):\n return self.posX", "def get_x_position(self):\n return self.rect.x", "def _rect_left(self):\n\treturn min(self.x, self.x + self.w)", "def x(self):\r\n return self.position.x", "def _get_x(self):\n retur...
[ "0.789931", "0.7822809", "0.7801544", "0.77655184", "0.7598496", "0.7592991", "0.75727755", "0.75603724", "0.75317", "0.7471298", "0.74543244", "0.74325466", "0.74325466", "0.73788744", "0.7378309", "0.7337791", "0.7290182", "0.72892326", "0.72634065", "0.7236958", "0.7229135...
0.7803244
3
Return True iff point p is inside rec' border (including)
def isPointInside(self, p): x,y = p[0], p[1] A = self.left <= x <= self.right B = self.bottom <= y <= self.top return (A and B)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_inside(self, p):\n s, t = self.get_barycentric_coord(p)\n if 0 <= s <= 1 and 0 <= t <= 1 and s + t <= 1:\n return True\n else:\n return False", "def contains_point(self, p):\n return self.begin <= p < self.end", "def is_inside(self, p) -> bool:\r\n ...
[ "0.7720581", "0.7364794", "0.7355181", "0.725169", "0.7229174", "0.72272635", "0.7075397", "0.7041984", "0.7041984", "0.69827986", "0.6954175", "0.6935675", "0.69228697", "0.6902933", "0.68731254", "0.6860448", "0.6857272", "0.68495905", "0.68150634", "0.6810276", "0.67933154...
0.74969304
2
Exit the program with printing out messages.
def _exit_with_output(content, exit_code=0): (sys.stdout if exit_code == 0 else sys.stderr).write(content + os.linesep) sys.exit(exit_code)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exit_program():\n print(\"Good Bye! Happy Searching...\")", "def exit_program():\n print(\"Good bye\")\n sys.exit()", "def exit_program():\n quit()", "def exit_program(msg):\n print(msg)\n sys.exit(1)", "def do_quit(self, args):\n print('Good Bye!')\n exit()", "def...
[ "0.8194717", "0.80250555", "0.7986243", "0.7979236", "0.7805322", "0.7782327", "0.7715496", "0.7691839", "0.7683995", "0.76835644", "0.7665054", "0.7660826", "0.7660299", "0.7611088", "0.75915784", "0.75684893", "0.7566156", "0.7549936", "0.7547239", "0.7541564", "0.7536362",...
0.0
-1
Initialize an entity object from a dict of attributes.
def initobj(obj, attrs): for a in obj.InstAttr: if a != 'id' and a in attrs: setattr(obj, a, attrs[a])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _from_raw_entity(cls, *args, **kwargs):\n args = list(*args)\n kwargs = dict(kwargs)\n entity = kwargs.pop('entity', None)\n self = Entity.__new__(cls, *args, entity=entity)\n cls.__init__(self, *args, **kwargs)\n return self", "def from_dict(cls: T, source: dict[str...
[ "0.71100855", "0.69657654", "0.69518024", "0.6883657", "0.6878318", "0.67820716", "0.6726382", "0.6705977", "0.65247864", "0.65066653", "0.64853656", "0.64625067", "0.6455933", "0.63990605", "0.63975734", "0.63975734", "0.63975734", "0.63975734", "0.63975734", "0.63975734", "...
0.0
-1
Try to extract video Id from various response types
def get_track_id_from_json(item): fields = ['contentDetails/videoId', 'snippet/resourceId/videoId', 'id/videoId', 'id'] for field in fields: node = item for p in field.split('/'): if node and type(node) is dict: node = node.ge...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_res_id(response):\n pass", "def get_video_id(lookup_value, lookup_type='url'):\n if lookup_type == 'url':\n video_id = lookup_value.split('videos/')[1]\n elif lookup_type == 'content_id' or lookup_type == 'id':\n video_json = core.get_data('contents', lookup_value, return_json=Tr...
[ "0.70764077", "0.69082075", "0.676421", "0.6666163", "0.65228707", "0.64974153", "0.6479818", "0.6465948", "0.64599824", "0.6424421", "0.6418487", "0.62807", "0.6253241", "0.6252796", "0.6249243", "0.62347054", "0.61980134", "0.6151827", "0.61408144", "0.6055615", "0.6013109"...
0.54533976
82
Return up to four digit string representation of a number, eg 2.6m.
def num_repr(num): if num <= 9999: return str(num) def digit_count(x): """ Return number of digits. """ return int(math.floor(math.log10(x)) + 1) digits = digit_count(num) sig = 3 if digits % 3 == 0 else 2 rounded = int(round(num, int(sig - digits))) digits = digit_coun...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compact_number(value: int) -> str:\n value = float('{:.3g}'.format(value))\n magnitude = 0\n while abs(value) >= 1000:\n magnitude += 1\n value /= 1000.0\n return '{}{}'.format(\n '{:f}'.format(value).rstrip('0').rstrip('.'), ['', 'K', 'M', 'B', 'T'][magnitude]\n )", "def ...
[ "0.7182364", "0.70930153", "0.6999289", "0.6799869", "0.67830706", "0.67807144", "0.67794293", "0.66909385", "0.6595511", "0.6581724", "0.65636194", "0.6551377", "0.65173185", "0.6515589", "0.6498033", "0.64951223", "0.647386", "0.6470867", "0.6462151", "0.6450947", "0.640590...
0.69325995
3
Return number of newlines.
def linecount(x): return sum(1 for char in x if char == "\n")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def n_lines(self):\n try: \n return self._n_lines\n except AttributeError:\n self._n_lines = len(self.lines())\n return self._n_lines", "def number_of_lines(filename=\"\"):\n num_lines = 0\n with open(filename, encoding=\"utf-8\") as myFile:\n return my...
[ "0.72889894", "0.7244917", "0.71274596", "0.70724577", "0.69953495", "0.6928446", "0.69219375", "0.68270326", "0.67785716", "0.66905576", "0.6606756", "0.656701", "0.655823", "0.6554754", "0.65417796", "0.6538205", "0.6500217", "0.64965767", "0.6488184", "0.6486436", "0.64699...
0.7973603
0
Open, save or view a playlist by name. Get closest name match.
def open_save_view(action, name): name = name.replace(" ", "-") if action == "open" or action == "view": saved = g.userpl.get(name) if not saved: name = get_near_name(name, g.userpl) saved = g.userpl.get(name) elif action == "open": g.browse_mode = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_playlist(speaker, name):\n playlists = speaker.get_sonos_playlists(complete_result=True)\n # Strict match\n for playlist in playlists:\n if name == playlist.title:\n logging.info(\n \"Found playlist '{}' using strict match\".format(playlist.title)\n )\n ...
[ "0.7148162", "0.67249274", "0.66888404", "0.6517742", "0.6359682", "0.63204956", "0.62916934", "0.6170411", "0.6142352", "0.6123386", "0.6065247", "0.6043721", "0.6038191", "0.59653205", "0.59453523", "0.58826417", "0.58619756", "0.5813649", "0.5715791", "0.5706646", "0.56870...
0.49091545
100
Test that access without a valid token fails
def test_001_unauthorized_access(self): false_token = "12345" self.info("Will use token %s", false_token) client = ComputeClient(self.clients.compute_url, false_token) client.CONNECTION_RETRY_LIMIT = self.clients.retry with self.assertRaises(ClientError) as cl_error: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_fail_token(client, request):\n res = client.get('/token?uid=1')\n\n assert res.status_code == 400\n assert 'User does not exist' in res.data.decode('utf-8')", "def test_get_non_valid_token(self):\r\n\r\n user = UserFactory.create_batch(2)[1]\r\n res = self.app.get('/api/token/non-...
[ "0.7919976", "0.7805629", "0.76920396", "0.7597282", "0.7547781", "0.7541341", "0.75078833", "0.7473591", "0.7462293", "0.7422306", "0.7413425", "0.7402054", "0.7356", "0.73077166", "0.7257573", "0.72561926", "0.7240266", "0.7230891", "0.7221196", "0.72175604", "0.7215458", ...
0.68571234
80
Layer normalisation of a 2D tensor along its 2nd axis
def normalise_layer(tensor, scope=None, epsilon=1e-5): # Check if tensor is 2D assert len(tensor.get_shape()) == 2 # Calculate mean and variance of tensor mean, variance = tf.nn.moments(tensor, axes=[1], keep_dims=True) # Ensure scope is a string if not isinstance(scope, str): scope =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_normalization(self):\n u = np.array([np.array([0.7, 1.2]), np.array([0.5, 1.6])])\n with tf.Session() as sess:\n n = sess.run(AbstractModel.l2_normalization_layer(u, axis=1))\n magnitude = np.linalg.norm(n, axis=1)\n np.testing.assert_allclose(magnitude, np.array([1....
[ "0.7252828", "0.7033841", "0.6765598", "0.67062396", "0.66987556", "0.66792256", "0.6678318", "0.66418", "0.6621726", "0.66066366", "0.6585842", "0.6577714", "0.65673244", "0.65235794", "0.6512941", "0.64598596", "0.6441479", "0.64385897", "0.643329", "0.641323", "0.63893396"...
0.6776293
2
(node>(int, int, int)) Finds the nearest city to the Map
def nearest(node): count = 0 distance = 100000 while count != node_count[0]: city = d_list[node.value - 1] if city != []: if city[0][1] < distance: distance = city[0][1] new_city = city[0][0] closest_city = node.value node =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nearest_neighbor(A, cities):\n return min(cities, key = lambda c: distance(c,A))", "def find_nn(self, city, list):\n start_city = self.get_coordinates_from_city(city)\n return min((euclidean_distance(start_city, self.get_coordinates_from_city(rest)), rest) for rest in\n lis...
[ "0.66006833", "0.6112029", "0.6059416", "0.6053353", "0.6029418", "0.6019159", "0.59859365", "0.5963282", "0.5962909", "0.5952228", "0.5951111", "0.5950018", "0.58574903", "0.58530366", "0.58422196", "0.58116835", "0.580936", "0.5780371", "0.575859", "0.57372963", "0.57258433...
0.7622398
0
((tuple,tuple)>int) returns the distance between two points
def distance_between_points(item1, item2): return math.sqrt((item2[1] - item1[1]) ** 2 + (item2[0] - item1[0]) ** 2)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def distance_between(pt1: tuple, pt2: tuple) -> float:\r\n\r\n return ((pt2[1] - pt1[1])**2 + (pt2[0] - pt1[0])**2)**0.5", "def distance_between_points(a: Point, b: Point) -> float:\n return math.sqrt((a.x - b.x)**2 + (a.y - b.y)**2)", "def distance_between_points(p1,p2):\n return math.sqrt((p2.x-p1.x...
[ "0.79597443", "0.7533975", "0.7453785", "0.74479353", "0.74188846", "0.74168926", "0.7416068", "0.7387221", "0.7330232", "0.7278117", "0.72635305", "0.72585344", "0.7243373", "0.7183359", "0.71617144", "0.71540177", "0.714006", "0.7115389", "0.7108997", "0.7107263", "0.708250...
0.71393114
17
Type of the image.
def type(self) -> str: return pulumi.get(self, "type")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def type(self):\n return _image.image_type(self)", "def imageType(self):\n return self.__imageType", "def image_type(self) -> ImageType:\n return self._image_type", "def pixel_type(self):\n pass", "def native_image_type(self) -> Type[Any]:\n pass", "def pixeltype(self):...
[ "0.89188886", "0.87099224", "0.8516833", "0.7717055", "0.7592416", "0.7355248", "0.71816945", "0.71060514", "0.688872", "0.6882958", "0.68784523", "0.68193454", "0.6731505", "0.6696103", "0.66639495", "0.66160834", "0.6590436", "0.655299", "0.6545401", "0.6544639", "0.654043"...
0.6326293
84
Predict the next up_to_days days using the given model
def predict(model, up_to_days=DEFAULT_UP_TO_DAYS, start_time=None, end_time=None, plot=False): if start_time is None and end_time is None: df_future = model.make_future_dataframe(periods=24 * up_to_days, freq='H') start_future = df_future.iloc[-1, :]['ds'] - datetime.timedelta(days=up_to_days) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fit(self, train):\n model = ARIMA(train, order=(self.p, self.d, self.q))\n model_fit = model.fit(disp=0)\n output = model_fit.forecast()\n nextDaysPred = output[0][0]\n return nextDaysPred", "def predict(self, requested_day):\n\n df = load_data()\n\n # preproc...
[ "0.64374465", "0.6385037", "0.6047735", "0.60320497", "0.596181", "0.5912091", "0.5882558", "0.5877596", "0.57229745", "0.57208973", "0.57030904", "0.56725144", "0.56085193", "0.552718", "0.5518681", "0.55108744", "0.54945636", "0.5491527", "0.54595256", "0.54388624", "0.5435...
0.6601267
0
Returns name first_name + last_name
def get_name(self): user = self.user name = "%s %s" % (user.first_name, user.last_name) name = name.strip() return self.display_name or name or user.email or user.username
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def full_name(first_name, last_name):\n return first_name + \" \" + last_name", "def full_name(first_name, last_name):\n\t\n\treturn first_name + \" \" + last_name", "def get_full_name(self):\n return self.first_name+\" \"+self.last_name", "def get_full_name(self):\n return self.last_name + ...
[ "0.8620432", "0.8512554", "0.84902215", "0.84718835", "0.84186137", "0.8382907", "0.8372901", "0.8331295", "0.8301909", "0.8252183", "0.81714916", "0.81308633", "0.81282544", "0.8109969", "0.80890906", "0.80517876", "0.8041051", "0.8038435", "0.80341864", "0.8022139", "0.8022...
0.0
-1
Check if this user can search users.
def allow_search_users(self): if self.is_superuser: return True # allow anonymous search users if get_setting('module', 'users', 'allowanonymoususersearchuser'): return True # allow user search users if get_setting('module', 'users', 'allowusersearch') \...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_permission(self, request, view):\n return has_permission(request.user, Permissions.CAN_ADVANCE_SEARCH)", "def get_in_users(self, obj):\n try:\n user = self.context.get('request').user\n except Exception:\n # raise serializers.ValidationError('Could not access re...
[ "0.707694", "0.653946", "0.6460712", "0.6356348", "0.6293273", "0.62860835", "0.62821656", "0.6258142", "0.61663073", "0.6163139", "0.61377335", "0.6107108", "0.60979337", "0.6093158", "0.60865873", "0.608035", "0.607354", "0.6055988", "0.60308534", "0.6022369", "0.60123426",...
0.82700914
0
Check if `user2_compare` is allowed to view this user.
def allow_view_by(self, user2_compare): # user2_compare is superuser if user2_compare.is_superuser: return True # this user is user2_compare self if user2_compare == self.user: return True # user2_compare is creator or owner of this user if (self...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allow_edit_by(self, user2_compare):\n if user2_compare.is_superuser:\n return True\n\n if user2_compare == self.user:\n return True\n\n if (self.creator and self.creator == user2_compare) or \\\n (self.owner and self.owner == user2_compare):\n if...
[ "0.77980894", "0.6694717", "0.6681415", "0.6527395", "0.65218633", "0.64288676", "0.6421928", "0.6409994", "0.6373256", "0.63561755", "0.63474673", "0.63087493", "0.62796825", "0.6260136", "0.62566257", "0.62413365", "0.62412196", "0.6186552", "0.6154822", "0.6154583", "0.615...
0.86560255
0
The highest role will be returned.
def highest_role(self): roles = ['superuser', 'staff', 'member', 'user', 'disabled'] for role in roles: if role in self.roles(): return role
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_top_role(self, default = None):\n top_role = default\n \n role_ids = self.role_ids\n if (role_ids is not None):\n role_found = False\n \n for role_id in role_ids:\n try:\n role = ROLES[role_id]\n e...
[ "0.75415945", "0.6322092", "0.6219552", "0.61766744", "0.6168498", "0.61578405", "0.61471087", "0.61068666", "0.6078039", "0.60328096", "0.59467083", "0.5935002", "0.5932097", "0.5926346", "0.58912224", "0.58884865", "0.5844605", "0.5841178", "0.58127373", "0.58127373", "0.58...
0.8630476
0
Get a unique instance name for this client.
def _get_instance(self): #return '_earth_instance_' + rospy.get_name().strip('/') return self.instance
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name(self):\n return \"{} {}\".format(self._clientname, self._name)", "def name(self):\n return self._client.project_name + '/instances/' + self.instance_id", "def getname(self):\n if self.instance is not None:\n return '%s_%s' % (self.name,self.instance)\n else:\n ...
[ "0.77943206", "0.7774999", "0.7622636", "0.7493012", "0.7493012", "0.73529273", "0.7330837", "0.73026055", "0.7301147", "0.726375", "0.719518", "0.7160541", "0.70981705", "0.70912373", "0.70912373", "0.70912373", "0.70912373", "0.70912373", "0.70912373", "0.7057044", "0.70488...
0.0
-1
Get this client's unique temporary path.
def _get_tempdir(self): #return os.path.normpath(systmp() + '/' + self._get_instance()) return self.tmpdir
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def temporary_file_path(self):\n return self.file.name", "def _get_tmp_file_path(self):\n return os.path.join(self.tmp_dir, self.hash)", "def _get_temp_path(self):\n handle, path = tempfile.mkstemp()\n # windows can't write to a file that is already open by another process\n ...
[ "0.72390246", "0.722654", "0.7209207", "0.71536505", "0.69247705", "0.6870341", "0.682534", "0.6824614", "0.68059003", "0.6781155", "0.6767053", "0.66519344", "0.6631688", "0.65443516", "0.6518344", "0.6493648", "0.64033234", "0.6386369", "0.63656497", "0.63167864", "0.628638...
0.6641044
12