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
Check if hashed password matches actual password
def verify_password(self, password): return check_password_hash(self.password_hash, password)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_encrypted_password(password: str, hashed: str) -> bool:\n return pwd_context.verify(password, hashed)", "def check_hashed_password(password, hashed_password):\n\n\n return sha256_crypt.verify(password,hashed_password)", "def verify_password(self, password):\n return check_password_hash(s...
[ "0.81750333", "0.81654465", "0.81029165", "0.8091229", "0.80758476", "0.8071933", "0.8042396", "0.8026053", "0.79251105", "0.7912885", "0.79124117", "0.79056114", "0.7889633", "0.78833985", "0.7860269", "0.7850504", "0.78410155", "0.7839047", "0.7839047", "0.78045964", "0.779...
0.76697767
47
Returns the Channels Group name that sockets should subscribe to to get sent messages as they are generated.
def group_name(self): return "room-%s" % self.pk
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def group_name(self):\n\t\treturn \"DocumentChat-%s\" % self.id", "def _get_peer_group_name(self):\n return self.__peer_group_name", "def _get_peer_group_name(self):\n return self.__peer_group_name", "def get_group_name(self):\n return self.groupname", "def websocket_group(self):\n ...
[ "0.670286", "0.64731055", "0.64731055", "0.6465609", "0.6432694", "0.6427493", "0.64241916", "0.636664", "0.63124985", "0.6228399", "0.6200603", "0.6188457", "0.61687344", "0.61072105", "0.6095847", "0.6086761", "0.6079826", "0.60528266", "0.6047977", "0.6019547", "0.60041517...
0.5805881
38
Calculates b_hat dot n_hat dot product between B field and pfc normal
def HFincidentAngle(self,PFC, MHD): xyz = PFC.centers r,z,phi = tools.xyz2cyl(xyz[:,0],xyz[:,1],xyz[:,2]) BNorms = MHD.Bfield_pointcloud(PFC.ep, r, z, phi, PFC.powerDir, normal=True) PFC.bdotn = np.multiply(PFC.norms, BNorms).sum(1) return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _fv(self):\n return self.beta * (self.x ** self.c)", "def binom_post_2D_alt(p1,p2, k1,n1, k2,n2, B1, B2, alpha1,beta1, alpha2,beta2):\n f = binom_post_alt(p=p1, k=k1,n=n1, B=B1, alpha=alpha1,beta=beta1) * \\\n binom_post_alt(p=p2, k=k2,n=n2, B=B2, alpha=alpha2,beta=beta2)\n return f", "def ...
[ "0.5910099", "0.5830607", "0.58211243", "0.575009", "0.5716603", "0.56439203", "0.56284285", "0.5603887", "0.55969495", "0.5589043", "0.5577099", "0.5535115", "0.5503791", "0.5501613", "0.5489522", "0.54750264", "0.54727536", "0.54674894", "0.5466516", "0.54418075", "0.543410...
0.0
-1
Initialize layers in the model.
def init_layers(self): self.user_emb = nn.Embedding(self.n_users, self.emb_dim) self.item_emb = nn.Embedding(self.n_items, self.emb_dim) init_range = 0.1 * (self.emb_dim) ** (-1 / 2) self.item_emb.weight.data.uniform_(-init_range, init_range) self.fc_u_1_mu = nn.Linear(self.user_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _init_layers(self):\n self._init_predictor()\n if self.use_edge_fusion:\n self._init_edge_module()", "def _init_layers(self) -> None:\n weight_nums, bias_nums = [], []\n for i in range(self.num_layers):\n if i == 0:\n weight_nums.append((self.i...
[ "0.8239891", "0.77453595", "0.76929635", "0.7691856", "0.74083835", "0.73160684", "0.7300794", "0.7298106", "0.7215758", "0.7089972", "0.7072843", "0.7029556", "0.701253", "0.69899577", "0.6969085", "0.6950599", "0.6931002", "0.6918065", "0.6856529", "0.6839336", "0.6790947",...
0.6933287
16
Extract some coefficients at specified time_steps, then reshape to [batch_size, 1, 1, 1, 1, ...] for broadcasting purposes.
def _extract(self, a, t, x_shape): batch_size = x_shape[0] out = tf.gather(a, t) return tf.reshape(out, [batch_size, 1, 1, 1])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reshape_d(sequence, batch_size, num_steps):\n batch_length = batch_size * num_steps\n num_batches = sequence // batch_size\n if num_batches * batch_length > (len(sequence) - 1):\n num_batches -= 1\n # Round up batch\n X = sequence[: num_batches * batch_length]\n y = sequence[1: num_bat...
[ "0.5775115", "0.5767712", "0.574617", "0.5652286", "0.56421196", "0.5548883", "0.54388255", "0.53910106", "0.5365416", "0.5365416", "0.5360326", "0.53039104", "0.5275587", "0.52648115", "0.5253503", "0.51831996", "0.51735085", "0.51520014", "0.51246846", "0.5121504", "0.51215...
0.53687954
8
Compute the mean and variance of the diffusion posterior q(x_{t1} | x_t, x_0).
def q_posterior(self, x_start, x_t, t): x_t_shape = tf.shape(x_t) posterior_mean = ( self._extract(self.posterior_mean_coef1, t, x_t_shape) * x_start + self._extract(self.posterior_mean_coef2, t, x_t_shape) * x_t) posterior_variance = self._extract(self.posterior_varianc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def q_posterior_mean_variance(diffusion, x_start, x_t, t):\n assert x_start.shape == x_t.shape\n mean_coef1 = extract_into_tensor(diffusion.posterior_mean_coef1_th, t,\n x_t.shape)\n mean_coef2 = extract_into_tensor(diffusion.posterior_mean_coef2_th, t,\n ...
[ "0.76033735", "0.6797277", "0.5624449", "0.5620169", "0.5478254", "0.5458796", "0.5441514", "0.54413897", "0.5436421", "0.5413955", "0.54109997", "0.5375231", "0.5362174", "0.53556436", "0.53188056", "0.53144085", "0.5309384", "0.5283485", "0.5281063", "0.52737135", "0.527350...
0.65202147
2
Tests for ValueError when calling train split for mismatched data.
def testTrainSplitError(self): with self.assertRaises(Exception): mnli.MnliDataset( mode='mismatched', split=tfds.Split.TRAIN, shuffle_buffer_size=20)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_data_split_bad():\n\tdf = pd.read_csv(\"test/sample_data.csv\")\n\tsplit_data = {'test_size': 0.4, 'random_state': 0}\n\n\twith pytest.raises(KeyError) as e:\n\t\tX_train, X_test, y_train, y_test = data_split(df, 'orange', split_data)\n\n\tassert str(e.value) == \"'Target column does not exist!'\"", "de...
[ "0.7742193", "0.6907711", "0.68839496", "0.68365985", "0.6836478", "0.6819402", "0.681931", "0.6620565", "0.6505697", "0.6493751", "0.64889", "0.64823854", "0.6431342", "0.6420219", "0.63754815", "0.6370261", "0.63491505", "0.63464534", "0.63374984", "0.6333485", "0.6282616",...
0.83453494
0
Find the last index of the element in y satistying y[index] <= value
def get_index(y, value): for i in range(len(y)): if y[i] <= value: continue return i
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index(x, t):\n if x < t[0]:\n return 0\n\n for i in range(len(t) - 1):\n if t[i] <= x < t[i + 1]:\n return i\n\n return len(t) - 2", "def last2(x, y):\n y = np.asarray(y)\n return y[np.argsort(x)][-1]", "def last_index_of(my_list, my_value):\n return len(my_li...
[ "0.67937493", "0.67068404", "0.63586396", "0.63417095", "0.61478585", "0.6099739", "0.60389847", "0.6016621", "0.5953189", "0.59228003", "0.5883447", "0.58819", "0.58767533", "0.5837053", "0.58146304", "0.57767785", "0.5767922", "0.5746239", "0.57416105", "0.57359403", "0.572...
0.78535086
1
Ensure fuel used for electricity is less than or equal to all fuel.
def test_fuel_for_electricity(pudl_out_eia, live_dbs): if not live_dbs: pytest.skip("Data validation only works with a live PUDL DB.") gf_eia923 = pudl_out_eia.gf_eia923() excess_fuel = ( gf_eia923.fuel_consumed_for_electricity_mmbtu > gf_eia923.fuel_consumed_mmbtu ) if excess_fue...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def checkFuel(self):\n return self.maze.checkFuelCost(self.checkpoint,currentLap = self.laps) - self.timeDriving", "def convergence_check(self):\n air = self.air_alias.val\n flue_gas = self.fuel_alias.val + '_fg'\n fuel = self.fuel_alias.val\n\n for c in self.outl:\n ...
[ "0.6444219", "0.6441627", "0.61490303", "0.5986662", "0.5970327", "0.5928403", "0.5771021", "0.5761275", "0.57404774", "0.57086694", "0.56762975", "0.566221", "0.56350017", "0.5601375", "0.55791706", "0.55766493", "0.5532778", "0.5507706", "0.55066735", "0.55004376", "0.54994...
0.6567983
0
allowed_file just checks the acceptable extensions it could be extended to check the fileheader/mimetype
def allowed_file(filename): return '.' in filename and \ filename.rsplit('.', 1)[1].lower() in ALLOWED_EXTENSIONS
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def file_allowed(self):\n if self._allowed_ext:\n if self.get_ext() not in self._allowed_ext:\n return False\n \n return True", "def test_allowed_file(self):\r\n u = Uploader()\r\n for ext in u.allowed_extensions:\r\n # Change extension to up...
[ "0.8331384", "0.8038907", "0.7752258", "0.77441853", "0.7700958", "0.7557096", "0.7556407", "0.75495946", "0.75495946", "0.75394976", "0.7538373", "0.7509076", "0.7509076", "0.7509076", "0.7509076", "0.7509076", "0.7509076", "0.7509076", "0.7509076", "0.7509076", "0.7509076",...
0.74986845
30
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, SharedContainerPort): 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.808826", "0.808826", "0.8054592", "0.79827315", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "0.79666996", "...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): if not isinstance(other, SharedContainerPort): 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
Convert Unicode to ISO885915
def _convertUnicodeForCPS(self, value): try: value = str(value) except UnicodeEncodeError: try: value = str(value.encode('ISO-8859-15')) except UnicodeEncodeError: value = repr(value) return value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def decode_to_unicode(content):\n if content:\n try:\n # Try to decode ISO-8859-1 to unicode\n return content.decode(\"ISO-8859-1\")\n except UnicodeEncodeError:\n # Assume content is unicode already\n return content", "def latin1_to_ascii(self, unicra...
[ "0.64690053", "0.63312465", "0.63077825", "0.6245502", "0.6244205", "0.6207816", "0.6176179", "0.617551", "0.61568916", "0.61303437", "0.61229503", "0.61117387", "0.61116296", "0.59785455", "0.58468467", "0.58362985", "0.58153814", "0.5777187", "0.57692367", "0.574548", "0.57...
0.6503412
0
test if max int is at the end
def test_max_end(self): self.assertEqual(max_integer([5, 3, 4, 8]), 8)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def max():\n return KeeperOfMinOrMax(int.__lt__)", "def exceeded_max(self):\n return self.total_max is not None and self.counter > self.total_max", "def _max_in_bounds(self, max):\n if max >= self.valmax:\n if not self.closedmax:\n return self.val[1]\n ...
[ "0.7111778", "0.7098122", "0.6908275", "0.6865015", "0.68268317", "0.6776732", "0.6682427", "0.6636053", "0.65673196", "0.6526603", "0.6513317", "0.6496788", "0.6392386", "0.6344829", "0.63330215", "0.6320136", "0.629762", "0.6280292", "0.6280074", "0.62137455", "0.6206469", ...
0.7391266
0
Tests retrieval of book number from a verse quotation string.
def test_get_book_number(self): self.assertTrue(data.get_book_number('[1 corinthians 1:1]') == 46)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_book_id_from_input_url(self):\n\t #(https:\\/\\/www.goodreads.com\\/book\\/show\\/|http:\\/\\/www.goodreads.com\\/book\\/show\\/)\n # http://www.goodreads.com/book/show/12177850-a-song-of-ice-and-fire\n\n n = 0\n if self.input_url[0:36] == \"https://www.goodreads.com/book/show/\":\n...
[ "0.60786885", "0.5984838", "0.596947", "0.58650225", "0.5770612", "0.56993467", "0.56571424", "0.5656231", "0.56519765", "0.5628832", "0.55673116", "0.55636305", "0.55526054", "0.54610115", "0.5377127", "0.53595996", "0.5334091", "0.5327755", "0.5317583", "0.52974564", "0.528...
0.74326754
0
Returns the URL for the page that has the given slug. First tries to find a page on the current site. If that fails or a request is not available in the context, then returns the URL for the first page that matches the slug on any site.
def clerk_slugurl(context, slug): page = None try: site = Site.find_for_request(context["request"]) current_site = site except KeyError: # No site object found - allow the fallback below to take place. pass else: if current_site is not None: page = ( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def page_by_slug(slug):\n try:\n page = Page.objects.get(slug=slug)\n if page.__class__ == 'Page':\n page = page.get_content_model()\n return page\n except Page.DoesNotExist:\n return None", "def get(self, request, slug):\n page = self.get_queryset().get(slug__...
[ "0.6453893", "0.6332974", "0.6332974", "0.60834086", "0.576487", "0.56353855", "0.5359755", "0.53109944", "0.5216394", "0.52059174", "0.5201767", "0.51793283", "0.5172991", "0.5155636", "0.51378375", "0.5098398", "0.50881994", "0.50880635", "0.50581986", "0.50570333", "0.5055...
0.85473657
0
Add a new department.
def add_department(): details = request.get_json() errors = check_department_keys(request) if errors: return raise_error(400, "Invalid {} key".format(', '.join(errors))) department_name = details['department_name'] if DepartmentsModel().get_department_name(department_name): return ra...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_department():\n\tcheck_admin()\n\n\tadd_department = True\n\n\tform = DepartmentForm()\n\tif form.validate_on_submit():\n\t\tdepartment = Department(name=form.name.data,description=form.description.data)\n\n\t\ttry:\n\t\t\t#add department to the database\n\t\t\tdb.session.add(department)\n\t\t\tdb.session....
[ "0.8442439", "0.84389937", "0.83755225", "0.80263793", "0.77682704", "0.7531482", "0.6917143", "0.6597872", "0.64193815", "0.64193815", "0.61667436", "0.61163116", "0.60886574", "0.59767485", "0.5870337", "0.5868529", "0.586335", "0.58443815", "0.58430845", "0.58098835", "0.5...
0.84226304
2
Lists the models in a project. Each project can contain multiple models, and each model can have multiple versions.
def ListModels(self, request, context): context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def models_list(request):\n projects = Project.objects.filter(models=1)\n return render(request, 'screenshower/app/models_list.html', {'projects': projects})", "def list(self, project_id):\n endpoint = \"/project/{}/model\".format(project_id)\n return self._get(endpoint, _ModelSchema(many=Tru...
[ "0.7519762", "0.71476173", "0.71187836", "0.70026606", "0.68067753", "0.6618267", "0.6570434", "0.65086704", "0.6296413", "0.62556523", "0.6193407", "0.6188368", "0.60968745", "0.6094005", "0.6039231", "0.6020384", "0.60106605", "0.5959711", "0.59574103", "0.59380674", "0.593...
0.598522
17
Creates a new version of a model from a trained TensorFlow model. If the version created in the cloud by this call is the first deployed version of the specified model, it will be made the default version of the model. When you add a version to a model that already has one or more versions, the default version does not...
def CreateVersion(self, request, context): context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_create_version(**kwargs):\n version_params = {\n \"name\": kwargs['dag_run'].conf.get('model_version'),\n \"description\": 'Version 1',\n \"runtimeVersion\": kwargs['dag_run'].conf.get('tf_version'),\n \"deploymentUri\": 'gs://{}/{}'.format(COMPOSER_BUCKET_NAME, PREFIX_FINAL_MODEL)\n ...
[ "0.7152265", "0.6172233", "0.60495305", "0.6042031", "0.59646994", "0.5947145", "0.59273994", "0.59142184", "0.5873052", "0.58717537", "0.58502567", "0.5841808", "0.583808", "0.58076006", "0.58050454", "0.5780362", "0.5764824", "0.57565856", "0.57472306", "0.57299185", "0.571...
0.0
-1
Lists the models in a project. Each project can contain multiple models, and each model can have multiple versions.
def ListModels(self, request, context): context.code(beta_interfaces.StatusCode.UNIMPLEMENTED)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def models_list(request):\n projects = Project.objects.filter(models=1)\n return render(request, 'screenshower/app/models_list.html', {'projects': projects})", "def list(self, project_id):\n endpoint = \"/project/{}/model\".format(project_id)\n return self._get(endpoint, _ModelSchema(many=Tru...
[ "0.75202304", "0.71476585", "0.7004705", "0.6806442", "0.6618428", "0.6571297", "0.65108585", "0.6295878", "0.62580526", "0.6195981", "0.61889285", "0.61001927", "0.6094396", "0.6040078", "0.6021136", "0.60127693", "0.5986853", "0.5961412", "0.5958025", "0.59400886", "0.59386...
0.7120121
2
Creates a new version of a model from a trained TensorFlow model. If the version created in the cloud by this call is the first deployed version of the specified model, it will be made the default version of the model. When you add a version to a model that already has one or more versions, the default version does not...
def CreateVersion(self, request, context): context.code(beta_interfaces.StatusCode.UNIMPLEMENTED)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_create_version(**kwargs):\n version_params = {\n \"name\": kwargs['dag_run'].conf.get('model_version'),\n \"description\": 'Version 1',\n \"runtimeVersion\": kwargs['dag_run'].conf.get('tf_version'),\n \"deploymentUri\": 'gs://{}/{}'.format(COMPOSER_BUCKET_NAME, PREFIX_FINAL_MODEL)\n ...
[ "0.7152301", "0.61733466", "0.60498506", "0.6042539", "0.59660697", "0.5948034", "0.5927966", "0.591429", "0.5873354", "0.58723736", "0.58513075", "0.5843086", "0.5838488", "0.5808301", "0.5804945", "0.5781222", "0.5765405", "0.5755975", "0.5749772", "0.57305455", "0.57142377...
0.52722883
59
Lists the models in a project. Each project can contain multiple models, and each model can have multiple versions.
def ListModels(self, request, timeout, metadata=None, with_call=False, protocol_options=None): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def models_list(request):\n projects = Project.objects.filter(models=1)\n return render(request, 'screenshower/app/models_list.html', {'projects': projects})", "def list(self, project_id):\n endpoint = \"/project/{}/model\".format(project_id)\n return self._get(endpoint, _ModelSchema(many=Tru...
[ "0.75189304", "0.7147621", "0.711825", "0.70025754", "0.68075323", "0.66169643", "0.6570175", "0.65082455", "0.62963736", "0.6254942", "0.61934686", "0.6189197", "0.609744", "0.60951823", "0.6038184", "0.60202694", "0.6011324", "0.5984466", "0.5959808", "0.5958112", "0.593884...
0.5718758
38
Creates a new version of a model from a trained TensorFlow model. If the version created in the cloud by this call is the first deployed version of the specified model, it will be made the default version of the model. When you add a version to a model that already has one or more versions, the default version does not...
def CreateVersion(self, request, timeout, metadata=None, with_call=False, protocol_options=None): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_create_version(**kwargs):\n version_params = {\n \"name\": kwargs['dag_run'].conf.get('model_version'),\n \"description\": 'Version 1',\n \"runtimeVersion\": kwargs['dag_run'].conf.get('tf_version'),\n \"deploymentUri\": 'gs://{}/{}'.format(COMPOSER_BUCKET_NAME, PREFIX_FINAL_MODEL)\n ...
[ "0.71513593", "0.6172707", "0.604947", "0.6041613", "0.5964844", "0.5947694", "0.5928091", "0.59142816", "0.5873486", "0.5871111", "0.5851061", "0.58425707", "0.5838233", "0.5807074", "0.5804636", "0.5781103", "0.5765102", "0.5756095", "0.57490045", "0.5730249", "0.5714058", ...
0.0
-1
Retrieves the path associated with the request, this value should be interpreted from the HTTP status line. In case the normalize flag is set a possible absolute URL value should be normalized into an absolute path. This may be required under some proxy related scenarios.
def get_path(self, normalize = False): split = self.path_s.split("?", 1) path = split[0] if not normalize: return path if not path.startswith(("http://", "https://")): return path return netius.legacy.urlparse(path).path
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def path_info(self):\r\n return urllib.unquote(self._environ.get('PATH_INFO', ''))", "def path_info(self):\n return urllib.unquote(self._environ.get('PATH_INFO', ''))", "def _get_full_path(self, path, environ):\n if path.startswith('//'):\n path = path[1:]\n elif path.sta...
[ "0.6352182", "0.6332861", "0.62579083", "0.62098044", "0.60933477", "0.58995795", "0.5882821", "0.5780844", "0.576928", "0.5764596", "0.57186264", "0.56799084", "0.56780154", "0.5670278", "0.5668836", "0.5668836", "0.5668836", "0.5668836", "0.5668836", "0.56070846", "0.560101...
0.72945136
0
Retrieves the (GET) query part of the path, this is considered to be the part of the path after the first question mark. This query string may be used to parse any possible (GET) arguments.
def get_query(self): split = self.path_s.split("?", 1) if len(split) == 1: return "" else: return split[1]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def query_string(self):\n return self.environ.get('QUERY_STRING') or ''", "def getParsedQueryString(self):\n return cgi.parse_qs(self.query_string)", "def query_string(self):\n return self._environ.get('QUERY_STRING', '')", "def query_string(self):\r\n return self._environ.get('QUER...
[ "0.69051117", "0.6892309", "0.68822426", "0.6866961", "0.66926265", "0.66888833", "0.6530996", "0.6109797", "0.6061842", "0.60041565", "0.59192395", "0.5823964", "0.5750093", "0.572246", "0.57146496", "0.5692884", "0.5640164", "0.5621033", "0.56112903", "0.55927783", "0.55840...
0.7912156
0
Retrieves a new buffer associated with the currently loaded message. In case the current parsing operation is using a file like object for the handling this object it is returned instead. The call of this method is only considered to be safe after the complete message has been received and processed, otherwise and inva...
def get_message_b(self, copy = False, size = 40960): # restores the message file to the original/initial position and # then in case there's no copy required returns it immediately self._data_b.seek(0) if not copy: return self._data_b # determines if the file limit for a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_buffer(self):\n message=self._message\n return message", "def getBuffer(self):\n return self.buffer", "def receive_message(self):\n\n # Calculate the size of the buffer\n self.buffer.seek(0, os.SEEK_END)\n buffer_size = self.buffer.tell()\n\n # Check if...
[ "0.69138366", "0.6224471", "0.621904", "0.6160806", "0.6102108", "0.6100464", "0.60426503", "0.603292", "0.58393306", "0.58227175", "0.57229745", "0.57031786", "0.56567866", "0.56485057", "0.56435806", "0.56320405", "0.5623956", "0.56170607", "0.5616117", "0.5600626", "0.5593...
0.58454865
8
Compute softmax values for each sets of scores in x.
def softmax(x): output = [] denomSum = 0 for i in range(0, len(x)): denomSum += np.exp(x[i]) for j in range(0, len(x)): output.append(np.exp(x[j]) / denomSum) return np.asarray(output)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def softmax(self, scores):\n\n\n # for each sample, for each class ,caclulate\n # np.exp(scores) : still (n_samples, n_classes)\n\n # axis = 1\n # a00, a01, a02 as a sinlge one to perfrom np_sum\n # which is the same sample \n # sum_exp : still (n_samples, 1)\n\n # ...
[ "0.7796294", "0.7760558", "0.7759004", "0.77567077", "0.76577055", "0.76577055", "0.76577055", "0.76577055", "0.7585655", "0.743143", "0.7407772", "0.73941606", "0.7358175", "0.73174125", "0.72689486", "0.72623265", "0.72614294", "0.7256868", "0.723019", "0.7201743", "0.72012...
0.7214918
19
Checks if a table needs migrations.
def _needs_migrations(self, table: str, current_level: int) -> bool: sql_dir = self.migrations / table if not sql_dir.exists(): if current_level > 0: # Where did the previous migrations go? raise MigrationException(f"{table} already has {current_level}, but directory is miss...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def needs_migrations(self):\n # TODO(majklk): also check models etc.\n if len(self.widgets) > 0:\n return True\n return False", "def check_migration(self, migration: str) -> bool:\n pass", "def check_db_schema(self):\n if not self.db.get_tables():\n self...
[ "0.75188255", "0.70046073", "0.69347155", "0.6870886", "0.6863478", "0.67513406", "0.6719827", "0.66876537", "0.64592063", "0.64373934", "0.6433889", "0.6373843", "0.6346028", "0.630736", "0.6303249", "0.6286018", "0.62658185", "0.62607634", "0.6239242", "0.62381816", "0.6233...
0.7818098
0
Getter for property 'x', the current estimated state. Example state = observer.x
def x(self): return UnweightedSamples(self.particles)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def measurement_of_state(self, x):\n raise \"Not implemented yet\"\n return dot(self._H, x)", "def x(self): # same as 'doc' argument of property function\n print(\"getter of x called\")\n return self._x", "def x(self):\n return self.x", "def x(self):\n return self._...
[ "0.7437871", "0.69751173", "0.6974672", "0.68929327", "0.68929327", "0.68929327", "0.68929327", "0.68929327", "0.68929327", "0.68929327", "0.68929327", "0.68929327", "0.68929327", "0.68929327", "0.68597376", "0.6811244", "0.678111", "0.678111", "0.678111", "0.678111", "0.6781...
0.0
-1
Constructs a ResNet50 model.
def resnet50(pretrained=False, **kwargs): model = ResNet(Bottleneck, [3, 4, 6, 3], **kwargs) if pretrained: model.load_state_dict(model_zoo.load_url(model_urls['resnet50'])) return model
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resnet50(pretrained=False, **kwargs):\n model = ResNet(Bottleneck, [3, 4, 6, 3], **kwargs)\n if pretrained:\n model.load_state_dict(model_zoo.load_url(model_urls['resnet50']))\n fc = transfer_fc(model.fc)\n model.fc = fc\n return model", "def resnet50(**kwargs):\n model = ResNet(...
[ "0.7557751", "0.75548905", "0.74557495", "0.7386862", "0.7386862", "0.73601955", "0.7355623", "0.724254", "0.724254", "0.7191571", "0.7158499", "0.7101107", "0.70165247", "0.69687796", "0.68687624", "0.6822836", "0.6801022", "0.67330164", "0.6718147", "0.67159295", "0.657444"...
0.74759895
5
Returns a nontrainable variable to shadow the given volatile tensor.
def materialise(value): return tf.get_variable(value.name.replace(':', '__') + '_materialised', shape=value.shape, dtype=value.dtype, trainable=False)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_variable(tensor, volatile=False):\n if torch.cuda.is_available():\n tensor = tensor.cuda()\n with torch.no_grad():\n return Variable(tensor)", "def get_variable(x, volatile=False):\n tensor = torch.cuda.LongTensor(x) if CUDA else torch.LongTensor(x)\n return autograd.Variable(t...
[ "0.7627308", "0.7106574", "0.64145434", "0.60816234", "0.5804701", "0.54715586", "0.5418249", "0.539004", "0.5309155", "0.5309155", "0.5290877", "0.52618587", "0.52462196", "0.5239365", "0.5218282", "0.5216105", "0.52156144", "0.5200996", "0.5168178", "0.5121673", "0.5104594"...
0.52216184
14
Applies an ND transposeconvolution, respecting two batch dimensions.
def conv_transpose(y, kernel, result_shape, padding, strides): # Temporarily combine the (num_classes, batch_size) dimensions # while applying the transpose convolution. batch_size = tf.shape(y)[1] y_squeezed = tf.reshape(y, shape=([y.shape[0].value * batch_size] + ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def declaration_conv2d_transpose_impl(data, kernel, strides, padding, out_dtype):\n data_pad, kernel_transform = \\\n conv2d_transpose_nchw_preprocess(data, kernel, strides, padding, out_dtype)\n batch, in_c, in_h, in_w = data_pad.shape\n out_c, _, filter_h, filter_w = kernel_transform.shape\n s...
[ "0.72172135", "0.70820665", "0.7074432", "0.69642484", "0.696414", "0.68830997", "0.68635535", "0.678924", "0.67143196", "0.664616", "0.6642601", "0.6629471", "0.6604043", "0.65688795", "0.6532393", "0.6496391", "0.6460851", "0.6424462", "0.64231765", "0.63720965", "0.6357736...
0.66451615
10
Applies an ND 'transposed average pool', respecting two batch dimensions.
def avgpool_transpose(y, result_shape, kernel_shape, strides): if kernel_shape is None: # We know that output_height=1 and output_width=1. return tf.tile(y, [1, 1] + list(result_shape[:-1]) + [1]) / ( _prod(result_shape[:-1])) else: # Treat the average pool as a convolution with uniform weights...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def avg_pool_nd(dims, *args, **kwargs):\n if dims == 1:\n return nn.AvgPool1D(*args, **kwargs)\n elif dims == 2:\n return nn.AvgPool2D(*args, **kwargs)\n elif dims == 3:\n return nn.AvgPool3D(*args, **kwargs)\n raise ValueError(f\"unsupported dimensions: {dims}\")", "def tensor_s...
[ "0.6734334", "0.6061922", "0.60054636", "0.597525", "0.5967761", "0.5946296", "0.5886707", "0.588347", "0.5838529", "0.5833158", "0.57395303", "0.57260096", "0.56989986", "0.56856704", "0.5683967", "0.56553984", "0.5620367", "0.55981886", "0.5595604", "0.55709285", "0.5555832...
0.61943954
1
Performs an ND convolutional broadcast. Inserts dimensions into `x`, by duplicating elements with respect to the specified convolution. For example, with a kernel size of 3, padding=`VALID`, and stride of 1, then with respect to each spatial dimension of the convolution (and disregarding batch and channel dimensions fo...
def conv_broadcast(x, kernel_shape, padding, strides): if len(kernel_shape) == 2: return conv2d_broadcast(x, kernel_shape[0], kernel_shape[1], padding, strides) elif len(kernel_shape) == 1: return conv1d_broadcast(x, kernel_shape[0], padding, strides[0]) else: raise ValueEr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def conv1d_broadcast(x, kernel_length, padding, stride):\n batch_size = tf.shape(x)[0]\n input_channels = x.shape[2].value\n\n # Temporarily combine the (batch_size, input_channels) dims while\n # applying the convolution. Introduce a dummy channels dimension instead.\n squeezed = tf.transpose(x, perm=[0, 2, ...
[ "0.739617", "0.7378831", "0.67849535", "0.64083165", "0.6364226", "0.63468814", "0.6322005", "0.6281084", "0.6215504", "0.6207447", "0.62003803", "0.6198297", "0.6194872", "0.61933964", "0.6162188", "0.6125682", "0.6112873", "0.6110303", "0.6095124", "0.6095097", "0.6076826",...
0.741916
0
Performs a convolutional broadcast. Inserts dimensions into `x`, by duplicating elements with respect to the specified convolution. For example, with a kernel size of 3, padding=`VALID`, and stride of 1, then with respect to the sequence dimension of the convolution (and disregarding batch and channel dimensions for th...
def conv1d_broadcast(x, kernel_length, padding, stride): batch_size = tf.shape(x)[0] input_channels = x.shape[2].value # Temporarily combine the (batch_size, input_channels) dims while # applying the convolution. Introduce a dummy channels dimension instead. squeezed = tf.transpose(x, perm=[0, 2, 1]) squee...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def conv_broadcast(x, kernel_shape, padding, strides):\n if len(kernel_shape) == 2:\n return conv2d_broadcast(x, kernel_shape[0], kernel_shape[1],\n padding, strides)\n elif len(kernel_shape) == 1:\n return conv1d_broadcast(x, kernel_shape[0], padding, strides[0])\n else:\n r...
[ "0.75739837", "0.7477172", "0.6826824", "0.63387406", "0.628475", "0.6273837", "0.62682885", "0.61950314", "0.61941046", "0.6162736", "0.61483854", "0.61397773", "0.612571", "0.6113731", "0.6099007", "0.60912323", "0.60889995", "0.6087291", "0.6075883", "0.6064261", "0.603419...
0.74552524
2
Call the global process tokenizer on the input text.
def tokenize(text): global TOK tokens = TOK.tokenize(text) output = { 'words': tokens.words(), 'offsets': tokens.offsets(), 'pos': tokens.pos(), 'lemma': tokens.lemmas(), 'ner': tokens.entities(), } return output
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tokenization(text):\n\n global tokenizer_tree\n tokenised_document = tokenizer_tree.tokenize(text)\n return tokenised_document", "def _tokenize(self, text: str) -> List[str]:\n return self.bert_model.tokenize(text.strip())", "def sentence_tokenizer(text):\n return sent_tokenize(text)", ...
[ "0.6961957", "0.6923934", "0.6852253", "0.6836547", "0.680641", "0.6799015", "0.6764396", "0.67482084", "0.6709405", "0.665781", "0.6634891", "0.66287875", "0.6598979", "0.65882605", "0.65812737", "0.65644735", "0.6561968", "0.6557754", "0.6539269", "0.6502904", "0.64861816",...
0.62829274
35
Total number of elements in this embeddings index.
def count(self): if self.cluster: return self.cluster.count() return super().count()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def num_embeddings(self):\n return self[\"main\"].num_embeddings", "def elements_count(self):\n return self.__elements_count", "def size(self):\n return sum(elem.size for elem in self)", "def __len__(self):\n return len(self.indexes) // self.batch_size", "def __len__(self):\n ...
[ "0.77023834", "0.7690076", "0.74834734", "0.74627614", "0.74627614", "0.742457", "0.74203575", "0.7398445", "0.73847127", "0.73847127", "0.73847127", "0.73595256", "0.7356948", "0.7351534", "0.73045546", "0.72687185", "0.72465086", "0.72355795", "0.7231173", "0.72201246", "0....
0.0
-1
Get center and scale for bounding box from openpose detections.
def bbox_from_openpose(openpose_file, rescale=1.2, detection_thresh=0.2): with open(openpose_file, 'r') as f: keypoints = json.load(f)['people'][0]['pose_keypoints_2d'] keypoints = np.reshape(np.array(keypoints), (-1,3)) valid = keypoints[:,-1] > detection_thresh valid_keypoints = keypoints[vali...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_center_coordinates_and_sizes_vector(box_data):\n ymin, xmin, ymax, xmax = [np.squeeze(i) for i in np.split(box_data, 4, 0)]\n width = np.subtract(xmax, xmin)\n height = np.subtract(ymax, ymin)\n ycenter = np.add(ymin, np.multiply(height, 0.5))\n xcenter = np.add(xmin, np...
[ "0.73236746", "0.6753173", "0.66572845", "0.6613024", "0.6600221", "0.65987784", "0.65518796", "0.654011", "0.64218354", "0.64218354", "0.6413975", "0.6408511", "0.6398193", "0.6388485", "0.6388485", "0.63749236", "0.6360393", "0.63589513", "0.6344789", "0.6300731", "0.629925...
0.70432717
2
Set fake env to make sure we don't hit AWS services.
def testing_env_var(monkeypatch): monkeypatch.setenv("AWS_ACCESS_KEY_ID", "jqt") monkeypatch.setenv("AWS_SECRET_ACCESS_KEY", "rde") monkeypatch.delenv("AWS_PROFILE", raising=False) monkeypatch.setenv("AWS_CONFIG_FILE", "/tmp/noconfigheere") monkeypatch.setenv("AWS_SHARED_CREDENTIALS_FILE", "/tmp/noc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setUp(self) -> None:\n self.s3 = boto3.client('s3')\n\n try:\n self.prod_env = os.environ['TEST_ENV'] == \"prod\"\n except KeyError:\n self.prod_env = True", "def test_setenv(self, env: yaenv.Env):\n from os import environ\n assert 'EMAIL' not in envir...
[ "0.7332453", "0.6815627", "0.6796376", "0.66834646", "0.6626177", "0.6564563", "0.65522265", "0.64684373", "0.64286023", "0.6426695", "0.6397237", "0.6397237", "0.6397237", "0.6392945", "0.63777405", "0.63777405", "0.63760763", "0.6359781", "0.63567847", "0.6331096", "0.63063...
0.79133147
0
Should raise an error on invalid resampling method name.
def test_tile_read_invalidResampling(): bounds = [ -6574807.42497772, 12210356.646387195, -6261721.357121638, 12523442.714243278, ] with pytest.raises(KeyError): with rasterio.open(COG) as src_dst: reader.part(src_dst, bounds, 16, 16, resampling_method="ja...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_resample_methods():\n with xr.open_rasterio(TEST_RASTER_PATH) as src:\n try:\n cvs.raster(src, upsample_method='santaclaus', downsample_method='toothfairy')\n except ValueError:\n pass\n else:\n assert False\n\n try:\n cvs.raster(s...
[ "0.62315965", "0.61740196", "0.60384303", "0.5932689", "0.5796109", "0.5737994", "0.5676407", "0.55802625", "0.5508727", "0.54694855", "0.54640245", "0.541562", "0.5394609", "0.5378731", "0.53738093", "0.53629243", "0.5358838", "0.53530455", "0.53521466", "0.53516126", "0.534...
0.52948326
25
make tensor and pad 0 encoded = [split, batch, input_len, dim]
def tensorize_encoded(cls, encoded, l_toks, lmax_toks): # lmax_toks = max(l_toks) new_encoded = [] n_sep = len(encoded) batch_size = len(encoded[0]) for b in range(batch_size): new_encoded1 = [] for i_sep in range(n_sep): new_encoded1.appen...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wrap_pad(input, size):\n M1 = tf.concat([input[:, :, -size[1]:, :], input, input[:, :, 0:size[1], :]], 2)\n M1 = tf.concat([M1[:, -size[0]:, :, :], M1, M1[:, 0:size[0], :, :]], 1)\n return M1", "def create_padding_mask(seq):\r\n seq = tf.cast(tf.math.equal(seq, 0), tf.float32)\r\n return seq[:...
[ "0.7168431", "0.6933274", "0.69023794", "0.677489", "0.66929907", "0.6685743", "0.6667171", "0.66134125", "0.6586869", "0.65386343", "0.6515577", "0.65124947", "0.65121406", "0.6496977", "0.6455757", "0.64378685", "0.64378685", "0.6421731", "0.6298301", "0.62605935", "0.62471...
0.61118
30
Transform Matplotlib colormap into Plotly colormap
def matplotlib_to_plotly(color_map: Optional[Union[str, matplotlib.colors.ListedColormap]] = "tab10", pl_entries: Optional[int] = 10): if isinstance(color_map, str): color_map = matplotlib.cm.get_cmap(color_map) h = 1.0 / (pl_entries - 1) pl_colorscale = [] for k in ran...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def map_face2color(face, colormap, scale, vmin, vmax):\n if vmin >= vmax:\n raise exceptions.PlotlyError(\n \"Incorrect relation between vmin \"\n \"and vmax. The vmin value cannot be \"\n \"bigger than or equal to the value \"\n \"of vmax.\"\n )\n if...
[ "0.65724", "0.65332764", "0.6447294", "0.64290255", "0.6391634", "0.62451035", "0.61824507", "0.6154128", "0.6138293", "0.60796845", "0.60360837", "0.60360837", "0.6029238", "0.60185945", "0.60093755", "0.6007284", "0.6004354", "0.59903765", "0.59872556", "0.59872556", "0.597...
0.68485594
0
Construct maps from the given keys to the colors/markers. Used for deterministic behaviour of visualisation.
def getColors_Markers(keys: List[Union[str, int]], cm: Optional[str] = "tab10", n_colors: Optional[int] = 10, markers: Optional[List[str]] = ("circle", "diamond", "square")): keys = sorted(keys) color_map = dict(zip(keys, sns.color_palette(cm, n_colors) * (len(keys) // n_colors + 1))) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_color_map(self):\n unique_labels = np.unique(self.out_labels)\n color_map = {}\n for unique_label in unique_labels:\n color_map[unique_label] = self._random_color()\n\n return color_map", "def _create_mapper(adata, key):\n # TODO:\n # plate colors return f...
[ "0.69599205", "0.640423", "0.6117686", "0.59936094", "0.59536654", "0.5833786", "0.5821252", "0.5815777", "0.5723985", "0.56918645", "0.5681657", "0.56408405", "0.563965", "0.56388086", "0.5632547", "0.56303847", "0.5629933", "0.56217057", "0.5581909", "0.5577788", "0.5553031...
0.7205978
0
Applies function given by f to each element in L
def apply(L, f): result = [] for i in L: result.append(f(i)) return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def applyToEach(L,f):\n for i in range(len(L)):\n L[i] = f(L[i])", "def simple_map(f, l):\n # Again, my first take is a list comprehension.\n return [ f(item) for item in l ]", "def map(self, f):\n if self.is_empty():\n pass\n else:\n items = []\n ...
[ "0.85692227", "0.74327064", "0.70718676", "0.68481755", "0.6778735", "0.6759941", "0.66112095", "0.66100043", "0.6410875", "0.63832694", "0.63762385", "0.63760364", "0.63733613", "0.63573843", "0.6321588", "0.62920886", "0.6284133", "0.62467164", "0.62180007", "0.62067175", "...
0.8319075
1
Turn LEDs on or off.
def leds(self, state): if state: state = b'\x01' else: state = b'\x00' msg = b'\x0D' + state self.__bt.write(msg)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setLED(self):\n newValue = 0\n while newValue != '':\n newValue = input('Enter 0 or 1 to turn LED on or off or enter to exit.\\n')\n \n if newValue == '0':\n self.board.write(b'0')\n time.sleep(1)\n elif newValue == '1':\n ...
[ "0.7898586", "0.77198344", "0.7686523", "0.76681954", "0.7450158", "0.74132526", "0.7342205", "0.7300674", "0.722577", "0.7191344", "0.71418", "0.7124784", "0.7112155", "0.7111464", "0.70933473", "0.7068067", "0.7063544", "0.70405066", "0.70400655", "0.7024834", "0.6937135", ...
0.6688635
40
Filters a DataFrame for columns that contain the given strings.
def _screen(self, include=True, **kwargs): df = self.copy() for k, v in list(kwargs.items()): v = [v] if type(v) != list else v if include: df = df[df[k].str.contains('|'.join(v), flags=re.IGNORECASE).fillna(False)] else: df = df[df[k].str.contains('|'.join(v), fl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter(self, filter_strings):\n if filter_strings is None:\n filter_strings = []\n\n result = RowSet()\n for row in self.rows:\n match = True\n for s in filter_strings:\n if not row.filter(s):\n match = False\n ...
[ "0.61328924", "0.6131588", "0.60926986", "0.603086", "0.5966695", "0.58889735", "0.5872369", "0.58189064", "0.5778242", "0.57670844", "0.5731103", "0.5667375", "0.56571996", "0.5652029", "0.56039464", "0.55994296", "0.55754715", "0.5506112", "0.54598683", "0.5448714", "0.5423...
0.49854007
50
Sets the primary_economic_activity of this JobDescriptionContextRequestAllOf.
def primary_economic_activity(self, primary_economic_activity): if primary_economic_activity is not None and len(primary_economic_activity) > 1024: raise ValueError("Invalid value for `primary_economic_activity`, length must be less than or equal to `1024`") # noqa: E501 self._primary_econ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def primary_election(self, primary_election):\n\n self._primary_election = primary_election", "def primary_lead_source(self, primary_lead_source):\n\n self._primary_lead_source = primary_lead_source", "def primary_contact_phone(self, primary_contact_phone):\n\n self._primary_contact_phone ...
[ "0.52004", "0.49111032", "0.48710233", "0.48625687", "0.47675797", "0.47590855", "0.47525674", "0.4524723", "0.4519451", "0.44715852", "0.4390619", "0.4367265", "0.42634842", "0.42423007", "0.4221072", "0.41900137", "0.4180859", "0.41716406", "0.41714182", "0.4157513", "0.414...
0.7756644
0
Sets the assessment of this JobDescriptionContextRequestAllOf.
def assessment(self, assessment): if assessment is not None and len(assessment) > 1024: raise ValueError("Invalid value for `assessment`, length must be less than or equal to `1024`") # noqa: E501 self._assessment = assessment
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_assessment(self):\n if not self.has_assessment:\n raise IllegalState()\n else:\n raise Unimplemented()", "def vulnerability_assessment(self) -> Optional[pulumi.Input['VulnerabilityAssessmentNoteArgs']]:\n return pulumi.get(self, \"vulnerability_assessment\")", ...
[ "0.4775016", "0.47305885", "0.46765465", "0.4601337", "0.45842037", "0.45837104", "0.45837104", "0.45413208", "0.45093307", "0.4468123", "0.4346532", "0.43303007", "0.43201378", "0.43128625", "0.43118367", "0.4302758", "0.42991123", "0.42991123", "0.428888", "0.42660096", "0....
0.5692812
0
Sets the citizenship_requirement of this JobDescriptionContextRequestAllOf.
def citizenship_requirement(self, citizenship_requirement): if citizenship_requirement is not None and len(citizenship_requirement) > 1024: raise ValueError("Invalid value for `citizenship_requirement`, length must be less than or equal to `1024`") # noqa: E501 self._citizenship_requiremen...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def defect_review_requested_by(self, defect_review_requested_by):\n\n self._defect_review_requested_by = defect_review_requested_by", "def agent_requirement(self, agent_requirement):\n\n self._agent_requirement = agent_requirement", "def review_requested_by(self, review_requested_by):\n\n ...
[ "0.54451734", "0.4874467", "0.48638797", "0.4711454", "0.44914392", "0.44771138", "0.43549186", "0.4337436", "0.42783397", "0.42590123", "0.42405516", "0.42314374", "0.42004254", "0.4178589", "0.41570076", "0.41505945", "0.41490912", "0.41424403", "0.41424403", "0.41424403", ...
0.71819764
0
Sets the physical_requirement of this JobDescriptionContextRequestAllOf.
def physical_requirement(self, physical_requirement): if physical_requirement is not None and len(physical_requirement) > 1024: raise ValueError("Invalid value for `physical_requirement`, length must be less than or equal to `1024`") # noqa: E501 self._physical_requirement = physical_requi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def physical_capacity(self, physical_capacity):\n\n self._physical_capacity = physical_capacity", "def agent_requirement(self, agent_requirement):\n\n self._agent_requirement = agent_requirement", "def physical(self):\n\n for attr in self.parm_list:\n attr.physical(attr)", "de...
[ "0.5401404", "0.5027166", "0.48533106", "0.47448742", "0.47442624", "0.47410616", "0.4720671", "0.4521448", "0.45031726", "0.44827726", "0.4472766", "0.44715753", "0.4449486", "0.4449486", "0.4449486", "0.4449486", "0.44318417", "0.44022742", "0.44022742", "0.43669388", "0.43...
0.72584295
0
Sets the sensory_requirement of this JobDescriptionContextRequestAllOf.
def sensory_requirement(self, sensory_requirement): if sensory_requirement is not None and len(sensory_requirement) > 1024: raise ValueError("Invalid value for `sensory_requirement`, length must be less than or equal to `1024`") # noqa: E501 self._sensory_requirement = sensory_requirement
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def security_clearance_requirement(self, security_clearance_requirement):\n if security_clearance_requirement is not None and len(security_clearance_requirement) > 1024:\n raise ValueError(\"Invalid value for `security_clearance_requirement`, length must be less than or equal to `1024`\") # noqa...
[ "0.49938238", "0.48687464", "0.46444365", "0.4167156", "0.4165337", "0.41506544", "0.4145323", "0.40677294", "0.40638238", "0.40523595", "0.40035492", "0.3987891", "0.3944958", "0.393707", "0.39341837", "0.39286506", "0.3924443", "0.38970298", "0.38757434", "0.38683814", "0.3...
0.70855945
0
Sets the employer_identifier of this JobDescriptionContextRequestAllOf.
def employer_identifier(self, employer_identifier): if employer_identifier is not None and len(employer_identifier) > 1024: raise ValueError("Invalid value for `employer_identifier`, length must be less than or equal to `1024`") # noqa: E501 self._employer_identifier = employer_identifier
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def employer_email(self, employer_email):\n if employer_email is not None and len(employer_email) > 1024:\n raise ValueError(\"Invalid value for `employer_email`, length must be less than or equal to `1024`\") # noqa: E501\n\n self._employer_email = employer_email", "def employer_addres...
[ "0.56043965", "0.53781736", "0.5303008", "0.52336293", "0.5184128", "0.47257355", "0.46922922", "0.46826544", "0.4611696", "0.45970237", "0.45706165", "0.4510113", "0.4491151", "0.44650126", "0.4457986", "0.44269034", "0.44114015", "0.43897554", "0.43610942", "0.43546396", "0...
0.65725017
0
Sets the salary_currency of this JobDescriptionContextRequestAllOf.
def salary_currency(self, salary_currency): if salary_currency is not None and len(salary_currency) > 1024: raise ValueError("Invalid value for `salary_currency`, length must be less than or equal to `1024`") # noqa: E501 self._salary_currency = salary_currency
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def currency(self, currency):\n if (self.local_vars_configuration.client_side_validation and\n currency is not None and len(currency) > 6000):\n raise ValueError(\"Invalid value for `currency`, length must be less than or equal to `6000`\") # noqa: E501\n if (self.local_var...
[ "0.52866304", "0.5194331", "0.510493", "0.5103563", "0.5103563", "0.5103563", "0.5103563", "0.49985954", "0.49877104", "0.49812013", "0.49699584", "0.49583578", "0.4922342", "0.4811435", "0.47699925", "0.4745807", "0.47293848", "0.46842438", "0.46046713", "0.45230016", "0.451...
0.6529121
0
Sets the salary_maximum of this JobDescriptionContextRequestAllOf.
def salary_maximum(self, salary_maximum): if salary_maximum is not None and len(salary_maximum) > 1024: raise ValueError("Invalid value for `salary_maximum`, length must be less than or equal to `1024`") # noqa: E501 self._salary_maximum = salary_maximum
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_max_empirical_loss(self, max_empirical_loss):\n\n if max_empirical_loss <= 0:\n raise ValueError('Argument: max_empirical_loss must be greater than 0')\n\n self.__max_empirical_loss = max_empirical_loss", "def max_sale_qty(self, max_sale_qty):\n if max_sale_qty is None:\n ...
[ "0.61574924", "0.5879562", "0.5703928", "0.5677748", "0.5623907", "0.5497425", "0.54710513", "0.54564434", "0.5405305", "0.5383752", "0.53431404", "0.5313358", "0.52686906", "0.52686906", "0.52686906", "0.5264547", "0.5256481", "0.5256481", "0.5236207", "0.52206206", "0.51594...
0.7337637
0
Sets the job_benefits of this JobDescriptionContextRequestAllOf.
def job_benefits(self, job_benefits): self._job_benefits = job_benefits
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def beneficiaries(self, beneficiaries):\n\n self._beneficiaries = beneficiaries", "def MutateCampaignBudgets(self, request, context):\n context.set_code(grpc.StatusCode.UNIMPLEMENTED)\n context.set_details('Method not implemented!')\n raise NotImplementedError('Method not implemented!...
[ "0.50720155", "0.45322216", "0.42959034", "0.4230474", "0.4206136", "0.41496986", "0.41391128", "0.4093048", "0.4042067", "0.40382499", "0.40351143", "0.4027916", "0.39981654", "0.39585888", "0.39580917", "0.39528805", "0.39185694", "0.38774627", "0.38695496", "0.38427112", "...
0.7750126
0
Sets the employment_agreement of this JobDescriptionContextRequestAllOf.
def employment_agreement(self, employment_agreement): if employment_agreement is not None and len(employment_agreement) > 1024: raise ValueError("Invalid value for `employment_agreement`, length must be less than or equal to `1024`") # noqa: E501 self._employment_agreement = employment_agr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def acquirer_industry(self, acquirer_industry):\n\n self._acquirer_industry = acquirer_industry", "def regulatory_body_approved_by(self, regulatory_body_approved_by):\n\n self._regulatory_body_approved_by = regulatory_body_approved_by", "def employer_contribution_initialization(self, salary, empl...
[ "0.47415894", "0.47089148", "0.47043687", "0.46605262", "0.46447036", "0.4637339", "0.4449199", "0.44440517", "0.4437061", "0.4372287", "0.43295565", "0.4282805", "0.4271226", "0.4249579", "0.42450115", "0.42335752", "0.42131394", "0.41512477", "0.4144001", "0.40996376", "0.4...
0.739457
0
Sets the employer_name of this JobDescriptionContextRequestAllOf.
def employer_name(self, employer_name): if employer_name is not None and len(employer_name) > 1024: raise ValueError("Invalid value for `employer_name`, length must be less than or equal to `1024`") # noqa: E501 self._employer_name = employer_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def employer_email(self, employer_email):\n if employer_email is not None and len(employer_email) > 1024:\n raise ValueError(\"Invalid value for `employer_email`, length must be less than or equal to `1024`\") # noqa: E501\n\n self._employer_email = employer_email", "def employer_identi...
[ "0.6017268", "0.59969676", "0.55913675", "0.55032134", "0.53288186", "0.52741915", "0.504336", "0.502656", "0.4876537", "0.48456147", "0.4816574", "0.4805142", "0.47734928", "0.47541755", "0.47472158", "0.46661016", "0.46568576", "0.46115133", "0.4565898", "0.45384514", "0.45...
0.6638817
0
Sets the employer_overview of this JobDescriptionContextRequestAllOf.
def employer_overview(self, employer_overview): if employer_overview is not None and len(employer_overview) > 1024: raise ValueError("Invalid value for `employer_overview`, length must be less than or equal to `1024`") # noqa: E501 self._employer_overview = employer_overview
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def employer_email(self, employer_email):\n if employer_email is not None and len(employer_email) > 1024:\n raise ValueError(\"Invalid value for `employer_email`, length must be less than or equal to `1024`\") # noqa: E501\n\n self._employer_email = employer_email", "def show_overview_o...
[ "0.49275213", "0.46682078", "0.46544766", "0.45172006", "0.4482902", "0.44720706", "0.44555733", "0.44163364", "0.44030878", "0.4249515", "0.41948298", "0.41350654", "0.4097332", "0.40421313", "0.4035888", "0.39962363", "0.39602488", "0.3956499", "0.39518207", "0.39419496", "...
0.7427993
0
Sets the employer_phone of this JobDescriptionContextRequestAllOf.
def employer_phone(self, employer_phone): if employer_phone is not None and len(employer_phone) > 1024: raise ValueError("Invalid value for `employer_phone`, length must be less than or equal to `1024`") # noqa: E501 self._employer_phone = employer_phone
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def phone(self, phone):\n if self.local_vars_configuration.client_side_validation and phone is None: # noqa: E501\n raise ValueError(\"Invalid value for `phone`, must not be `None`\") # noqa: E501\n\n self._phone = phone", "def personal_phone(self, personal_phone):\n\n self._per...
[ "0.5575617", "0.5452", "0.5418663", "0.54066914", "0.5392402", "0.5316977", "0.5316977", "0.5316977", "0.5316977", "0.5316977", "0.5306605", "0.5219177", "0.5205081", "0.5156381", "0.51536536", "0.49455485", "0.49455485", "0.49455485", "0.49455485", "0.49125618", "0.48797572"...
0.71209013
0
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, JobDescriptionContextRequestAllOf): 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 the first time larger or equal to the given start time where the level is at least the specified value.
def find_above(self, time, level): if self.get(time) >= level: return time ix = self._trace.bisect_right(time) for t, lvl in self._trace.items()[ix:]: if lvl >= level: return t return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_below(self, time, level):\n\n if self.get(time) <= level:\n return time\n ix = self._trace.bisect_right(time)\n for t, lvl in self._trace.items()[ix:]:\n if lvl <= level:\n return t\n return None", "def binary_search_time(values: list[any]...
[ "0.6188587", "0.5776933", "0.5651355", "0.5577277", "0.55742955", "0.55452776", "0.54344946", "0.5434114", "0.5393916", "0.53711313", "0.5356693", "0.53378373", "0.5319394", "0.53176427", "0.5288028", "0.52819675", "0.5280428", "0.5277755", "0.5275217", "0.52566934", "0.52445...
0.6784723
0
Initialize the neural network base object.
def __init__(self): self.tag = None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialise_network(self):\n raise NotImplementedError", "def __init__(self, layerNeurons, initialWeights = None, layerTypes=None, **kwargs):\r\n \r\n # Ensure that there is at-least one input and one output layer in the network\r\n assert len(layerNeurons)>1, \"At least one input ...
[ "0.74598694", "0.73657024", "0.7321491", "0.7273744", "0.7228517", "0.72096306", "0.7152376", "0.7128686", "0.7100651", "0.70793223", "0.7075344", "0.7063281", "0.7029389", "0.70210046", "0.7015082", "0.69983226", "0.6995061", "0.6986615", "0.69840974", "0.69425136", "0.69419...
0.0
-1
return independent parameters the shared tensor variables in output {y}'s expression.
def p(self): return hlp.parms(self.y(0))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def independent_variables(self):\n return self._independent_variables", "def independent(self):\n return self.x", "def independent_variable(self):\n return self._independent_variable", "def dotps(y):\n def isdot(e):\n return type(e) is T.TensorVariable and str(e).startswith('do...
[ "0.6522822", "0.61015815", "0.58786994", "0.5769992", "0.5636943", "0.559653", "0.5422493", "0.540948", "0.5399706", "0.5384896", "0.53472024", "0.53472024", "0.5332073", "0.53269994", "0.53194153", "0.52976894", "0.52823526", "0.5266379", "0.5264958", "0.52520144", "0.523183...
0.52563226
19
Make left side empty
def make_empty_left(self, e=0): self.make_empty_side(u'left')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_empty_side(self, side):\n if side == u'right':\n for k,v in self.d.items():\n item = v[0]\n mnemo = ''\n self.d[k] = [item, mnemo]\n\n if side == u'left':\n for k,v in self.d.items():\n item = ''\n ...
[ "0.7694751", "0.70511174", "0.65827656", "0.64382553", "0.63246334", "0.6298448", "0.6247285", "0.6245814", "0.6232546", "0.62268543", "0.62219054", "0.62108165", "0.61787665", "0.6159617", "0.61470133", "0.6133733", "0.61227196", "0.6113509", "0.61130035", "0.61130035", "0.6...
0.8324015
0
Wraps hidden states in new Tensors, to detach them from their history.
def repackage_hidden(h): if isinstance(h, torch.Tensor): return h.detach() else: return tuple(repackage_hidden(v) for v in h)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def detach_hidden(hidden: Any) -> Any:\n return apply_to_tensor(hidden, Tensor.detach)", "def reset_hidden(self, hidden, reset_flags):\n # detach it from history (pytorch mechanics)\n if self.rnn_type in ['lstm', 'mylstm']:\n h = Variable(hidden[0].data)\n c = Variable(hidd...
[ "0.6896774", "0.6564761", "0.6440056", "0.63181335", "0.62956357", "0.61828166", "0.61425817", "0.61264986", "0.61264986", "0.6120289", "0.6029193", "0.60253143", "0.6020807", "0.5987143", "0.5969475", "0.5969475", "0.5932672", "0.5932672", "0.591887", "0.5889544", "0.5871412...
0.56539345
31
Sets the attribute_name of this ProductVariantAddAttributes.
def attribute_name(self, attribute_name): self._attribute_name = attribute_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_attribute(self, attribute_name, attribute_value):\n self.attributes[attribute_name] = attribute_value", "def set_attribute(self, name, value):\n\n pass", "def add_attribute(self, name, value):\n\n self._attributes[name] = value", "def add_attribute(self, name, value):\n\n ...
[ "0.6554329", "0.63863724", "0.6242784", "0.6242784", "0.6242784", "0.61310774", "0.5988886", "0.5852113", "0.58285695", "0.58009183", "0.58007014", "0.5743104", "0.57368594", "0.57368594", "0.57368594", "0.5660004", "0.5641808", "0.56358856", "0.56340396", "0.5512168", "0.545...
0.7548313
0
Sets the attribute_price of this ProductVariantAddAttributes.
def attribute_price(self, attribute_price): self._attribute_price = attribute_price
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_price(self, price):\n assert isinstance(price, float), 'Price must be a float'\n self._price = price", "def set_price(self, _price):\n self.price = _price\n return self.price", "def price(self, price: float):\n\n self._price = price", "def price(self, price):\n\n ...
[ "0.66838056", "0.6545381", "0.64281565", "0.64245766", "0.64245766", "0.64245766", "0.64245766", "0.621196", "0.6100202", "0.5871679", "0.5835917", "0.5708427", "0.5625042", "0.5540541", "0.55138475", "0.5491936", "0.54434365", "0.5422819", "0.53630555", "0.5349353", "0.53472...
0.8138506
0
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, ProductVariantAddAttributes): 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.8089204", "0.8089204", "0.8055265", "0.7983358", "0.7967577", "0.7967577", "0.7967577", "0.7967577", "0.7967577", "0.7967577", "0.7967577", "0.7967577", "0.7967577", "0.7967577", "0.7967577", "0.7967577", "0.7967577", "0.7967577", "0.7967577", "0.7967577", "0.7967577", "...
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
Return data as str (UTF8)
def as_str(self) -> str: if isinstance(self.data, str): return self.data elif isinstance(self.data, bytes): return self.data.decode() else: return bytes(self.data).decode()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_string(data):\n if isinstance(data, bytes):\n return data.decode('utf-8')\n else:\n return data", "def toString(data):\n\tif isString(data):\n\t\treturn data\n\telse:\n\t\treturn data.decode(\"latin-1\")", "def bytes_to_str(self, data):\n if isinstance(data, st...
[ "0.80612487", "0.80567765", "0.8021337", "0.7986732", "0.7596255", "0.7505028", "0.727382", "0.7140331", "0.7061687", "0.7058527", "0.6916224", "0.68987966", "0.6886006", "0.682081", "0.6813797", "0.68040353", "0.68040353", "0.68040353", "0.68040353", "0.68040353", "0.6797292...
0.7683728
4
Method that returns the approximated values for u(x) in a specified element.
def u(self,x,i,temp): return self.coeffs[i]*self.psi_funcs[i+temp](x) + self.coeffs[i+1]*self.psi_funcs[i+temp+1](x) + self.coeffs[i+2]*self.psi_funcs[i+temp+2](x)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getElementFunction(element):\n energies, fluxes = getElementData(element)\n fluxes = energies*fluxes\n logEnergies = np.log10(energies)\n logFluxes = np.log10(fluxes)\n bins, samples = binnedAverage(logEnergies, logFluxes, bins=10)\n f = scipy.interpolate.interp1d(bins, samples, kind='cubic')...
[ "0.64596003", "0.6250087", "0.6195584", "0.6172564", "0.6064059", "0.60595405", "0.6051387", "0.6044437", "0.6039406", "0.6039406", "0.60246885", "0.59806204", "0.5962265", "0.5961685", "0.594939", "0.5948445", "0.5919442", "0.5914849", "0.5867071", "0.58641154", "0.58602047"...
0.6170534
4
Determines the interval of the cron configuration. Can only be daily or weekly.
def compute_days_between_runs(cron_config): base_dttm = datetime(2017, 11, 1, 0, 0) dttm_iter = croniter(cron_config, base_dttm) dttm1 = dttm_iter.get_next(datetime) dttm2 = dttm_iter.get_next(datetime) num_days_between_scheduled_runs = ( (dttm2 - dttm1).total_seconds() / (24.0 * 60.0 * 60....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def interval(self) -> int:\n return pulumi.get(self, \"interval\")", "def get_interval_of_checking(self):\n return int(self.config['interval_of_checking'])", "def interval(self) -> Optional[str]:\n return pulumi.get(self, \"interval\")", "def get_period_of_monitoring(self):\n retu...
[ "0.67639196", "0.6640107", "0.65276986", "0.64806736", "0.6419283", "0.63771355", "0.62678117", "0.6210845", "0.6188529", "0.6170977", "0.6170977", "0.6158478", "0.6143813", "0.6111292", "0.6111292", "0.60955995", "0.6067862", "0.602062", "0.60109764", "0.59799033", "0.594735...
0.58950603
25
Sends a 401 response that enables basic auth
def authenticate(): resp = {"status": 401, "message": "Could not verify your access level for that URL"} return Response(dumps(resp), status=404, mimetype='application/json')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def authenticate():\n return Response('Not Authorized', 401, {'WWW-Authenticate': 'Basic realm=\"api\"'})", "def authenticate():\n return Response(\n '', 401, {'WWW-Authenticate': 'Basic realm=\"Login Required\"'}\n )", "def authenticate():\n return Response(\n 'You have to login with pro...
[ "0.8095378", "0.80943215", "0.7960329", "0.785324", "0.7844362", "0.78259075", "0.7812201", "0.7812201", "0.7812201", "0.7812201", "0.7812201", "0.7812201", "0.7812201", "0.7812201", "0.7812201", "0.7812201", "0.7812201", "0.7812201", "0.7812201", "0.7812201", "0.7812201", ...
0.67640007
58
Check Numpy's dtype specification.
def test_basic_numpy_dtypes(): assert np.int != np.int8 assert np.int != np.int16 assert np.int != np.int32 assert np.int != np.int64 assert np.int == int assert np.int8 != int assert np.int16 != int assert np.int32 != int assert np.int64 != int assert np.dtype(np.int) == np.dt...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _check_dtype_array(array, dtype):\n # enlist the dtype expected\n if isinstance(dtype, type):\n dtype = [dtype]\n\n # check the dtype of the array\n for dtype_expected in dtype:\n if array.dtype == dtype_expected:\n return\n raise TypeError(\"{0} is not supported yet. Us...
[ "0.80209255", "0.75240415", "0.7309242", "0.7288298", "0.72696006", "0.7206381", "0.7136982", "0.7002746", "0.6983395", "0.69728905", "0.6894997", "0.6886951", "0.67726207", "0.6704868", "0.6702612", "0.6693353", "0.66837984", "0.66777325", "0.6675613", "0.66503984", "0.66456...
0.74419814
2
Initialize the GAN's Discriminator Loss class.
def __init__(self, loss_mode, which_net, which_D, target_real_label=1.0, target_fake_label=0.0, CUDA=False): super(GANLoss, self).__init__() self.register_buffer('real_label', torch.tensor(target_real_label)) self.register_buffer('fake_label', torch.tensor(target_fake_label)) self.loss_m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n super(Discriminator, self).__init__()\n\n # Use stride in convolutions to downsample image to size 1\n\n # Using BatchNorm2d 0.8 for stability based on reading of https://github.com/eriklindernoren/PyTorch-GAN code\n layers = [nn.Conv2d(512, 1, kernel_size=4, strid...
[ "0.67797595", "0.67116225", "0.6704989", "0.6666946", "0.6632852", "0.66256756", "0.66242015", "0.644879", "0.63792324", "0.63298756", "0.6298595", "0.6296737", "0.6256949", "0.6256949", "0.62487686", "0.6214453", "0.61664593", "0.615347", "0.61525446", "0.6135395", "0.613316...
0.6804764
0
Create label tensors with the same size as the input.
def get_target_tensor(self, prediction, target_is_real): if target_is_real: target_tensor = self.real_label else: target_tensor = self.fake_label if self.gpu: target_tensor = target_tensor.cuda() return target_tensor.expand_as(prediction)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_labels(n_samples):\n return np.ones([n_samples, 1]), np.zeros([n_samples, 1])", "def prepare_label(input_batch, new_size, num_classes, one_hot=True, task='seg'):\n with tf.name_scope('label_encode'):\n input_batch = tf.image.resize_nearest_neighbor(input_batch, new_size) # as labels are...
[ "0.73354965", "0.71426696", "0.7118502", "0.70904386", "0.70179224", "0.6934518", "0.6848578", "0.68442786", "0.6792239", "0.6772455", "0.67472833", "0.67066187", "0.66958326", "0.66799647", "0.65043724", "0.6463637", "0.6436753", "0.64249974", "0.6408662", "0.63744015", "0.6...
0.0
-1
Pulls contents of file and joins, then strips, the lines.
def get_fingerprint(filepath): ssh_file = open(filepath, 'r') ssh_file_contents = ssh_file.readlines() ssh_fingerprint = ''.join(ssh_file_contents).strip() return ssh_fingerprint
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def readFile(filePath):\n with open(filePath, 'r') as f:\n return [l.strip() for l in f.readlines()]", "def read_file(self, file):\n buffer = ''\n for line in file.readlines():\n line = line.strip()\n if not line.startswith('#'):\n buffer += ' ' + line...
[ "0.62805605", "0.6259892", "0.62061757", "0.6157563", "0.609395", "0.60830486", "0.6071367", "0.60593766", "0.6008452", "0.600285", "0.59665203", "0.59576106", "0.59190077", "0.5887321", "0.588537", "0.5857178", "0.5853695", "0.58291125", "0.58257604", "0.5820976", "0.5744172...
0.0
-1
Takes an iterator and batches the individual instances into lists of the specified size. The last list may be smaller if there are instances left over.
def lazy_groups_of(iterator: Iterator[A], group_size: int) -> Iterator[List[A]]: return iter(lambda: list(islice(iterator, 0, group_size)), [])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def split_into_batches_of_size(self, batch_size: int) -> Iterator[List]:\n if batch_size >= len(self):\n yield type(self)(self)\n else:\n for run in range(0, len(self), batch_size):\n yield self[run:run + batch_size]", "def batches(iterable, size):\n sourceit...
[ "0.7534931", "0.74928457", "0.74799687", "0.7475956", "0.7442233", "0.72422206", "0.71974444", "0.7171998", "0.7138168", "0.70255065", "0.6940768", "0.6917977", "0.68965507", "0.6894869", "0.68689764", "0.6846113", "0.6845332", "0.68357426", "0.68343765", "0.67655605", "0.671...
0.6816624
19
Take a list of objects and pads it to the desired length, returning the padded list. The original list is not modified.
def pad_sequence_to_length(sequence: List, desired_length: int, default_value: Callable[[], Any] = lambda: 0, padding_on_right: bool = True) -> List: # Truncates the sequence to the desired length. if padding_on_right: padd...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pad_list(xs, pad_value=0.0, pad_left=False):\n bs = len(xs)\n max_time = max(x.size(0) for x in xs)\n xs_pad = xs[0].new_zeros(bs, max_time, * xs[0].size()[1:]).fill_(pad_value)\n for b in range(bs):\n if len(xs[b]) == 0:\n continue\n if pad_left:\n xs_pad[b, -xs...
[ "0.8083376", "0.80798286", "0.8012966", "0.76393193", "0.75675017", "0.7550922", "0.7292382", "0.7221303", "0.7165454", "0.71060973", "0.70060015", "0.6995543", "0.6955529", "0.6821806", "0.6781657", "0.6769481", "0.67138743", "0.67048293", "0.66886055", "0.666484", "0.659257...
0.6768601
17
Matches a namespace pattern against a namespace string. For example, ``tags`` matches ``passage_tags`` and ``question_tags`` and ``tokens`` matches ``tokens`` but not ``stemmed_tokens``.
def namespace_match(pattern: str, namespace: str): if pattern[0] == '*' and namespace.endswith(pattern[1:]): return True elif pattern == namespace: return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def matchesSBMLNamespaces(self, *args):\n return _libsbml.SBase_matchesSBMLNamespaces(self, *args)", "def matchNamespace(self, namespace, *, ignore_predicates=tuple()):\n # FIXME can't we hit the cache for these?\n sns = str(namespace)\n for s, p, o in self:\n if p not in i...
[ "0.57698274", "0.5548462", "0.5115196", "0.49333885", "0.49240884", "0.489933", "0.48974413", "0.47916314", "0.47487885", "0.47404027", "0.47176668", "0.47159165", "0.47115383", "0.4706423", "0.46930453", "0.46929076", "0.46851048", "0.46770602", "0.46671414", "0.4570723", "0...
0.7085755
1
Checks if the given iterable is lazy, which here just means it's not a list.
def is_lazy(iterable: Iterable[A]) -> bool: return not isinstance(iterable, list)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_iterable(obj):\n return isinstance(obj, (list, tuple, types.GeneratorType)) or \\\n (not isinstance(obj, (int, str, dict)) and\n bool(getattr(obj, \"next\", False)))", "def is_iterable_object(maybe_iterable: Any) -> TypeGuard[Iterable[Any]]:\n\n return isinstance(maybe_iterable, Itera...
[ "0.69014686", "0.679608", "0.6786204", "0.6786179", "0.6756888", "0.67494446", "0.67343", "0.67248106", "0.67139125", "0.66544956", "0.66496515", "0.6642773", "0.6642136", "0.66382277", "0.6627492", "0.6600342", "0.6590524", "0.65509105", "0.6537714", "0.64909416", "0.6343363...
0.8851489
0
an alternative method for assigning values to nested DotDict instances. It accepts keys in the form of X.Y.Z. If any nested DotDict instances don't yet exist, they will be created.
def assign(self, key, value): key_split = key.split('.') cur_dict = self for k in key_split[:-1]: try: cur_dict = cur_dict[k] except KeyError: cur_dict[k] = self.__class__() # so that derived classes ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_recursive_dot_dict(data: Dict[str, Any], cls=DotDict) -> Union[DotDict, DotDefaultDict]:\n res = cls()\n for k, v in data.items():\n k = k.split(\".\")\n target = res\n for i in range(0, len(k)-1):\n t2 = target.get(k[i])\n if t2 is None:\n ...
[ "0.7277922", "0.6991614", "0.68272036", "0.6824957", "0.67607063", "0.66461694", "0.6632022", "0.6576774", "0.6466282", "0.6423795", "0.6412482", "0.6401508", "0.63756794", "0.6368839", "0.63389575", "0.62703156", "0.6164554", "0.6109804", "0.6067059", "0.6060633", "0.5939684...
0.6988299
2
Format a JWT and MAC it.
def format_jwt(user, active_customer, renewable): now = int(time.time()) claims = { # reserved: https://tools.ietf.org/html/rfc7519#section-4.1 'exp': now + app.config['AUTH_TOKEN_LIFETIME'], 'nbf': now, # not before 'iss': app.config['AUTH_TOKEN_ISSUER'], 'iat': now, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_token(self):\n\n try:\n # set up a payload with an expiration time\n payload = {\n 'exp': datetime.utcnow() + timedelta(minutes=45),\n 'iat': datetime.utcnow(),\n 'sub': self.id\n }\n # create the byte stri...
[ "0.6447905", "0.6440085", "0.64155", "0.6351243", "0.6283913", "0.6233386", "0.62208927", "0.6184606", "0.6169921", "0.61670977", "0.61415356", "0.6129908", "0.6094664", "0.60862076", "0.60798407", "0.6074592", "0.6072056", "0.60672873", "0.60655326", "0.60428965", "0.6017173...
0.6248964
5
Return a range of time spans from `start` to `end` in steps of time frame, `frame`.
def span_range(cls, frame, start, end): if not isinstance(start, cls): start = cls.parse(start) if not isinstance(end, cls): end = cls.parse(end) if start > end: # Return empty items when start is greater than end. return # The next star...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def frames_to_indices(self, start_frame: Union[int, None] = None, end_frame: Union[int, None] = None):\n # must be implemented in subclass\n if start_frame is None:\n init = 0\n else:\n init = np.searchsorted(self._spikestimes, start_frame, side=\"left\")\n if end_...
[ "0.62072766", "0.60052043", "0.58614254", "0.5799564", "0.579601", "0.5762472", "0.57569575", "0.5690625", "0.568266", "0.56673396", "0.56568944", "0.5643149", "0.5636874", "0.56304073", "0.5625108", "0.5589972", "0.55755454", "0.557399", "0.5566977", "0.5545499", "0.54953414...
0.76008034
0
The datetime object as a naive datetime (tzinfo=None).
def naive(self): return self.datetime.replace(tzinfo=None)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def asdatetime(self):\n tznaive = self.timezoneNaive()\n if tznaive:\n tzinfo = None\n else:\n tzinfo = _TZINFO[self._tz].tzinfo\n second = int(self._second)\n microsec = self.micros() % 1000000\n dt = datetime(self._year, self._month, self._day, self...
[ "0.7477166", "0.7108129", "0.7086402", "0.696775", "0.6886396", "0.6873263", "0.6832162", "0.68022215", "0.67993337", "0.6652748", "0.66525924", "0.6597021", "0.65665424", "0.65517044", "0.6525693", "0.6500779", "0.6484687", "0.6456791", "0.6415813", "0.63709956", "0.63570005...
0.8432918
0
The Zulu object as a native datetime.
def datetime(self): return datetime(*tuple(self))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_pydatetime(self) -> npt.NDArray[np.object_]:\n return ints_to_pydatetime(self.asi8, tz=self.tz, reso=self._creso)", "def asdatetime(self):\n tznaive = self.timezoneNaive()\n if tznaive:\n tzinfo = None\n else:\n tzinfo = _TZINFO[self._tz].tzinfo\n s...
[ "0.72367114", "0.65131986", "0.64649236", "0.6404073", "0.6299546", "0.6244589", "0.61628586", "0.59880316", "0.5977289", "0.59668785", "0.5933538", "0.5845924", "0.5834955", "0.5833196", "0.58298665", "0.58056533", "0.5800252", "0.57888216", "0.5762198", "0.5749372", "0.5741...
0.57910794
17
Return the POSIX timestamp.
def timestamp(self): return parser.get_timestamp(self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_timestamp():\n return int(time.time())", "def timestamp():\n return int(time.time())", "def _get_timestamp():\n return str(int(time.time()))", "def timestamp():\n return time.time()", "def timestamp():\n return datetime.now().strftime(\"%Y%m%dT%H%M%S\")", "def get_timestamp...
[ "0.8048978", "0.8031998", "0.7937697", "0.79355794", "0.78981155", "0.7851476", "0.7846043", "0.7844424", "0.78056884", "0.7801285", "0.78012484", "0.7716901", "0.7679595", "0.7533372", "0.7491754", "0.74713874", "0.7461564", "0.74609786", "0.7459317", "0.7446804", "0.7377271...
0.7108465
43
Return the number of days in the month.
def days_in_month(self): return calendar.monthrange(self.year, self.month)[1]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def days_in_month(year, month):\n num_days = monthrange(year, month)[1]\n return num_days", "def days_of_month(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['DayArgs']]]]:\n return pulumi.get(self, \"days_of_month\")", "def number_of_days_in_month(year=2019, month=1):\n return monthrange...
[ "0.8082928", "0.7921937", "0.79061", "0.7862105", "0.78611064", "0.7812619", "0.7787043", "0.77042764", "0.7647082", "0.7639124", "0.73869294", "0.7376316", "0.7336787", "0.7318822", "0.7318822", "0.7265743", "0.72647274", "0.7240037", "0.723006", "0.7201202", "0.7191896", ...
0.8493492
0
Return datetime as a string using the format string `format` while optionally converting to timezone `tz` first.
def format(self, format=None, tz=None, locale=LC_TIME): return parser.format_datetime(self, format, tz=tz, locale=locale)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_date_str(datetime, str_format=\"datetime\", locale=\"en_US\", tz=\"America/New_York\"):\n\ttimezone = pytz.timezone(tz)\n\tdatetime = datetime.astimezone(timezone)\n\n\tif str_format == \"date\":\n\t\treturn dates.format_date(datetime, locale=locale)\n\telif str_format == \"time\":\n\t\treturn dates.format...
[ "0.67109597", "0.65509486", "0.64781344", "0.6352808", "0.6200346", "0.61938655", "0.61103517", "0.6106005", "0.60977626", "0.60743237", "0.6073979", "0.6064176", "0.60132784", "0.6008595", "0.5984102", "0.59778804", "0.59718066", "0.59707147", "0.5966404", "0.5957809", "0.59...
0.737673
0
Return "time ago" difference between this datetime and another as a humanized string.
def time_from(self, dt, **options): return self._format_delta(self - dt)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ago(self):\n return human(self.timestamp/1000.0, precision=1, abbreviate=True)", "def timeago(time=False):\n\n return arrow.get(time).humanize()", "def relative_datetime(self):\n now = datetime.now(timezone.utc)\n created_at = self.created_at.astimezone(timezone.utc)\n\n delt...
[ "0.781861", "0.7384555", "0.7343685", "0.6777465", "0.67310333", "0.6669965", "0.6630989", "0.6608926", "0.64960796", "0.64837414", "0.64475816", "0.63958305", "0.6372787", "0.63440454", "0.6310405", "0.62401813", "0.6160443", "0.612552", "0.6082144", "0.6075397", "0.6064692"...
0.61512154
17
Return "time ago" difference between this datetime and now as a humanized string.
def time_from_now(self, **options): return self.time_from(self.now())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ago(self):\n return human(self.timestamp/1000.0, precision=1, abbreviate=True)", "def relative_datetime(self):\n now = datetime.now(timezone.utc)\n created_at = self.created_at.astimezone(timezone.utc)\n\n delta = humanize.naturaldelta(abs(created_at - now))\n tense = \"fro...
[ "0.8234057", "0.7727537", "0.76167774", "0.7166003", "0.70691097", "0.7066027", "0.6975064", "0.68947387", "0.6778661", "0.67713696", "0.675043", "0.67356765", "0.6661343", "0.6647018", "0.6634687", "0.6627662", "0.6621627", "0.66180503", "0.6554676", "0.65395033", "0.6440254...
0.0
-1
Return a humanized "time ago"/"time to" string from a timedelta.
def _format_delta(self, delta, **options): options.setdefault('add_direction', True) delta = Delta(days=delta.days, seconds=delta.seconds, microseconds=delta.microseconds) return delta.format(**options)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def human_timedelta(delta):\n seconds = delta.seconds % 60 if delta.seconds else 0\n minutes = delta.seconds // 60 % 60 if delta.seconds else 0\n hours = delta.seconds // 3600 % 24 if delta.seconds else 0\n days = abs(delta.days) % 7 if delta.days else 0\n weeks = abs(delta.days) // 7 if delta.days ...
[ "0.7524893", "0.70354563", "0.682522", "0.6758923", "0.6715483", "0.6629275", "0.65662146", "0.65298253", "0.6517038", "0.6509543", "0.64797556", "0.64379126", "0.64304805", "0.6423081", "0.6407952", "0.63338107", "0.6299713", "0.628563", "0.62838566", "0.6230697", "0.6145487...
0.0
-1
Return datetime shifted to timezone `tz`.
def astimezone(self, tz=LOCAL): if tz is None: tz = LOCAL tz = parser.get_timezone(tz) return super(self.__class__, self).astimezone(tz)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def as_timezone(self, tz):\n offset = tz_to_offset(tz)\n if TIMEZONES.get(tz, {}).get('dst') and is_dst(self):\n offset += 1\n offset_secs = offset * 3600\n return DateTime(*time.gmtime(self.unixtime() + offset_secs))", "def tz(self, tz):\n return timezones.maybe_get...
[ "0.7234505", "0.6579325", "0.6500982", "0.63452166", "0.61673373", "0.61512804", "0.61206585", "0.6055227", "0.6027977", "0.5917318", "0.5896946", "0.5814985", "0.57673776", "0.576697", "0.5750634", "0.57281446", "0.57252437", "0.5725029", "0.5712849", "0.57041013", "0.568424...
0.6273529
4
Add time using a timedelta created from the supplied arguments and
def add(self, other=None, **units): if isinstance(other, (timedelta, relativedelta)): return self + other units = {unit: units.get(unit, 0) for unit in SHIFT_UNITS} return self.shift(**units)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_timedelta_to_time():\n dt = datetime.datetime.combine(datetime.date.today(), datetime.time(12, 30, 5)) + datetime.timedelta(hours=1)\n t = dt.time()\n print(t) # 13:30:05", "def addTimes(time1, time2):\n t1 = timedelta(hours=time1.hour, minutes=time1.minute, seconds=time1.second)\n t2 = ti...
[ "0.7212288", "0.7049411", "0.6976796", "0.6904464", "0.68789023", "0.68632466", "0.6835722", "0.6747242", "0.6549814", "0.6502366", "0.6458669", "0.63663024", "0.6321636", "0.6250103", "0.6224088", "0.61866504", "0.618428", "0.6156903", "0.6121585", "0.6100182", "0.60470253",...
0.61540765
18
Return the start of the given time frame for this datetime.
def start_of(self, frame): validate_frame(frame) return getattr(self, 'start_of_{0}'.format(frame))()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start_time(self):\n # TODO: use pd.Timestamp instead\n return self.time[0].to_pydatetime()", "def get_datetime_start(self):\n return self.get_t_sect()['datetime_start']", "def start(self) -> datetime:\n return self._start", "def start(self):\n moment = self.tz_match(sel...
[ "0.7254739", "0.71977925", "0.7195644", "0.7090988", "0.70345175", "0.70110923", "0.6981144", "0.68627393", "0.681773", "0.67688996", "0.67461246", "0.669792", "0.6614993", "0.65968424", "0.6582339", "0.65661174", "0.65324444", "0.6518252", "0.6475883", "0.6459097", "0.645757...
0.68785655
7
Return the end of a given time frame for this datetime.
def end_of(self, frame, count=1): validate_frame(frame) return getattr(self, 'end_of_{0}'.format(frame))(count)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def end_time(self):\n # TODO: use pd.Timestamp instead\n return self.time[-1].to_pydatetime()", "def end(self) -> datetime:\n return self._end", "def end(self):\r\n hours = self.length // 60\r\n minutes = self.length % 60\r\n return time(self.start.hour + hours, self.s...
[ "0.74428254", "0.73248214", "0.7163974", "0.7123313", "0.69753915", "0.6918007", "0.68740493", "0.68424815", "0.6837745", "0.6808145", "0.6771451", "0.6771451", "0.6771451", "0.6771451", "0.6771451", "0.6771451", "0.6708896", "0.6693407", "0.6657653", "0.6642689", "0.66188055...
0.6111762
53
Get first unmasked value of an array along an axis.
def _get_first_unmasked_data(array, axis): mask = da.ma.getmaskarray(array) numerical_mask = da.where(mask, -1.0, 1.0) indices_first_positive = da.argmax(numerical_mask, axis=axis) indices = da.meshgrid( *[da.arange(array.shape[i]) for i in range(array.ndim) if i != axis], indexing='ij')...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nonzero_first(arr, *, axis):\n def nonzero_first_1d(arr):\n try:\n return np.nonzero(arr)[0][0]\n except IndexError:\n return -1\n return np.apply_along_axis(nonzero_first_1d, axis, arr)", "def _mask_array(mask, *args):\n invalid = ~mask # True if invalid\n ar...
[ "0.7064826", "0.62727624", "0.6099543", "0.6087248", "0.6032662", "0.59447646", "0.59035784", "0.5872711", "0.5819477", "0.58154905", "0.58139175", "0.57594526", "0.57439363", "0.5735857", "0.5690035", "0.56682724", "0.5655416", "0.5648125", "0.5615359", "0.56074893", "0.5604...
0.84379154
0
Compute mole fraction of CO2 at surface.
def calculate(cubes): co2_cube = cubes.extract_cube( iris.Constraint(name='mole_fraction_of_carbon_dioxide_in_air')) ps_cube = cubes.extract_cube( iris.Constraint(name='surface_air_pressure')) # Fill masked data if necessary (interpolation fails with masked data) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _calculate_mole_fraction(mol1, mol2):\n return mol1/(mol1+mol2)", "def moleFraction(self, species):\n k = self.speciesIndex(species)\n return _cantera.phase_molefraction(self._phase_id,k)", "def narcotic_fraction(o2, he):\n fraction_o2 = percentage_to_fraction(o2)\n fraction_he = per...
[ "0.74062234", "0.6469451", "0.6411467", "0.5952915", "0.59414726", "0.59317875", "0.5914392", "0.58494836", "0.5822355", "0.5717526", "0.569269", "0.5678385", "0.5673166", "0.5656904", "0.5652714", "0.5652249", "0.5646495", "0.56245005", "0.561397", "0.5601228", "0.5560468", ...
0.0
-1
Return a GraphicsState config from the appearance's graphicsstate applicable params.
def get_graphics_state(self): return GraphicsState( dash_array=self.dash_array, line_cap=self.line_cap, line_join=self.line_join, miter_limit=self.miter_limit, stroke_transparency=self._get_stroke_transparency(), fill_transparency=self._get...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_opt(self, widget):\r\n opt = dict()\r\n opt[\"state\"] = widget[\"state\"]\r\n opt[\"fg\"] = widget[\"fg\"]\r\n opt[\"bg\"] = widget[\"bg\"]\r\n return opt", "def cg_config():\n return {}", "def active_figure_format_config(self):\n if self.ui.active_figure_f...
[ "0.60739756", "0.5775519", "0.5381388", "0.5221672", "0.5205873", "0.52011937", "0.5115062", "0.5104205", "0.5101544", "0.5076273", "0.50660497", "0.5060692", "0.50441897", "0.5000844", "0.49889576", "0.49738145", "0.49704042", "0.4952311", "0.49382132", "0.4927522", "0.49242...
0.5370084
3