query
stringlengths
9
9.05k
document
stringlengths
10
222k
metadata
dict
negatives
listlengths
30
30
negative_scores
listlengths
30
30
document_score
stringlengths
4
10
document_rank
stringclasses
2 values
Derivative of reproducing kernel on even subspaces of maximum degree N.
def even_kernel_der(mu, N): # Check that -1 <= mu <= 1 mu = np.clip(mu, -1, 1) #Derivatives of Legendre polynomials DlegPolys = legp_der(mu, N) coefs = 2*np.arange(0, N+1) + 1 ker = coefs[0::2]*DlegPolys[0::2] return ker.sum() / (4.0*np.pi)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def even_kernel(mu, N):\n\n # Check that -1 <= mu <= 1\n mu = np.clip(mu, -1, 1)\n\n # Need Legendre polynomials\n legPolys = legp(mu, N)\n \n\n coefs = 2*np.arange(0, N+1) + 1\n \n ker = coefs[0::2]*legPolys[0::2] \n\n return ker.sum() / (4.0*np.pi)", "def compute_gradient_kernel_respect...
[ "0.63502026", "0.60510343", "0.5926386", "0.59101856", "0.5898114", "0.56899774", "0.56315917", "0.5616251", "0.558586", "0.55735755", "0.55652493", "0.55386996", "0.5501476", "0.54612076", "0.54292554", "0.54179746", "0.54039854", "0.5398605", "0.5376709", "0.53656363", "0.5...
0.66818523
0
Returns truncated iterated logarithm y = log( log(x) ) where if x<delta, x = delta and if 1delta < x, x = 1delta.
def ilog(x,delta): if(delta < x and x < 1.0 - delta): return np.log( -np.log(x) ) elif(x < delta): return np.log( -np.log(delta) ) else: return np.log( -np.log(1.0 - delta) )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def logit(x: torch.Tensor, eps=1e-5) -> torch.Tensor:\n x = torch.clamp(x, eps, 1.0 - eps)\n return torch.log(x / (1.0 - x))", "def safelog(x):\n #return np.log(x)\n return np.log(np.clip(x,floor,np.inf))", "def diff_log(x):\n \n return np.diff(np.log(x)),np.log(x)[0]", "def diff_log(x):\n\n ...
[ "0.72744215", "0.7240807", "0.7214393", "0.72042274", "0.716658", "0.711701", "0.6767486", "0.6693635", "0.6662013", "0.6657874", "0.66419184", "0.66316617", "0.66109407", "0.6556733", "0.6541151", "0.65251803", "0.6519674", "0.6498009", "0.645293", "0.6449499", "0.64343315",...
0.8147607
0
Create a 3D rotation matrix for rotation about xaxis. (1 0 0 ) R(theta) = (0 cos(x) sin(x)) (0 sin(x) cos(x))
def rotation3Dx(theta): rmat = np.zeros((3,3)) rmat[0,0], rmat[0,1], rmat[0,2] = 1.0, 0.0, 0.0 rmat[1,0], rmat[1,1], rmat[1,2] = 0.0, np.cos(theta), np.sin(theta) rmat[2,0], rmat[2,1], rmat[2,2] = 0.0, -np.sin(theta), np.cos(theta) return rmat
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def matrix_rotate_3d_x(deg: float) -> np.matrix:\n from numpy import cos, sin, pi\n rad_x = -deg * pi/180\n c_x = cos(rad_x)\n s_x = sin(rad_x)\n return np.matrix([[1, 0, 0], [0, c_x, -s_x], [0, s_x, c_x]])", "def rotation3D_x(angle: float) -> np.array:\n c = np.cos(angle)\n s = np.sin(angle...
[ "0.80429703", "0.77990216", "0.77074045", "0.76701725", "0.7432882", "0.7401681", "0.73251915", "0.7267913", "0.71938413", "0.71556383", "0.70411855", "0.7036028", "0.70312065", "0.7028589", "0.7012928", "0.69417447", "0.692393", "0.68872285", "0.6844814", "0.6838681", "0.680...
0.78315115
1
Create a 3D rotation matrix for rotation about zaxis. ( cos(x) sin(x) 0) R(theta) = (sin(x) cos(x) 0) ( 0 0 1)
def rotation3Dz(theta): rmat = np.zeros((3,3)) rmat[0,0] = rmat[1,1] = np.cos(theta) rmat[0,1] = np.sin(theta) rmat[1,0] = -rmat[0,1] rmat[2,2] = 1 return rmat
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def matrix_rotate_3d_z(deg: float) -> np.matrix:\n from numpy import cos, sin, pi\n rad_z = -deg * pi/180\n c_z = cos(rad_z)\n s_z = sin(rad_z)\n return np.matrix([[c_z, -s_z, 0], [s_z, c_z, 0], [0, 0, 1]])", "def rotation3D_z(angle: float) -> np.array:\n c = np.cos(angle)\n s = np.sin(angle...
[ "0.8186974", "0.802003", "0.7951418", "0.76159006", "0.75433534", "0.74739504", "0.7473712", "0.7445926", "0.7439543", "0.74234265", "0.736115", "0.7298137", "0.7291585", "0.72050965", "0.7194949", "0.7179259", "0.71736616", "0.71396255", "0.71220154", "0.71090776", "0.709833...
0.84704345
0
Compute the geodesic distance on the sphere for two points. The points are assumed to lie on the surface of the same sphere.
def spherical_distances(x, y): # Compute the norms of all points, we do NOT check they actually all lie on # the same sphere (that's the caller's responsibility). xn = np.sqrt((x**2).sum(axis=1)) yn = np.sqrt((y**2).sum(axis=1)) ang_cos = np.dot(x, y.T)/(xn[:, None]*yn[None, :]) # Protect a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def distance_sphere(self, other):\n if not self.crs == getattr(other, \"crs\", \"EPSG:4326\") == \"EPSG:4326\":\n raise ValueError(\"Only can calculate spherical distance with 'EPSG:4326' crs.\")\n return _binary_op(arctern.ST_DistanceSphere, self, other)", "def distance_on_sphere(lat1, ...
[ "0.7638325", "0.70502967", "0.6934199", "0.6927222", "0.6903243", "0.6792316", "0.6787839", "0.6785977", "0.6757207", "0.6749283", "0.6746814", "0.6737798", "0.6729415", "0.6711453", "0.66890496", "0.66774637", "0.664188", "0.6629779", "0.6612115", "0.66114235", "0.66067094",...
0.7146757
1
Compute a similarity matrix for a set of points. The points are assumed to lie on the surface of the same sphere.
def similarity_matrix(points, sigma): distances_squared = spherical_distances(points, points)**2 return np.exp( -distances_squared / (2.0 * sigma) )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def self_similarity_matrix(feature_vectors):\n norm_feature_vectors, mean, std = at.normalize_features([feature_vectors.T])\n norm_feature_vectors = norm_feature_vectors[0].T\n sim_matrix = 1.0 - distance.squareform(\n distance.pdist(norm_feature_vectors.T, 'cosine'))\n return sim_matrix", "de...
[ "0.66129136", "0.63335097", "0.62122184", "0.6183862", "0.60915583", "0.60669845", "0.59568816", "0.5932109", "0.5899266", "0.588513", "0.5874931", "0.5850991", "0.5815165", "0.5814901", "0.58031887", "0.5772447", "0.5766222", "0.5751658", "0.57376456", "0.5730853", "0.571602...
0.7539285
0
Decorator to help verify that a function was actually executed. Annotates a function with an attribute 'didrun', and only sets it to True if the function is actually called.
def checkrun(f): @functools.wraps(f) def wrapper(*args, **kwargs): wrapper.didrun = True return f(*args, **kwargs) wrapper.didrun = False return wrapper
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_called(self, func):\n self.called[func] = False\n def _check(*args, **kwargs):\n self.called[func] = True\n return func(*args, **kwargs)\n return _check", "def run_once(func):\n @wraps(func)\n def wrapper(*args, **kwargs):\n if not wrapper.has_run...
[ "0.65756035", "0.6015735", "0.60046905", "0.5997352", "0.59535944", "0.5899848", "0.5813919", "0.57161885", "0.5611487", "0.55894804", "0.5569097", "0.556421", "0.55513084", "0.55510217", "0.55382", "0.5538129", "0.55316585", "0.5526899", "0.55099505", "0.5504471", "0.5504471...
0.8174126
0
Users can specify environment variables in their config file which will be set in the driver and worker environments. Make sure those variables are set during the workflow, but not after.
def test_workflow_environment(): config = { "workflow-name": "workflow", "cluster-type": CLUSTER_TYPE, "environment-variables": { "FOO": "BAR", "FOO2": "BAR2" } } template_dir = tempfile.mkdtemp(suffix="test-workflow-environment-template") with...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def env_config():\n # setup\n env = {'ELB_GCP_PROJECT': 'expected-gcp-project',\n 'ELB_GCP_REGION': 'expected-gcp-region',\n 'ELB_GCP_ZONE': 'expected-gcp-zone',\n 'ELB_BATCH_LEN': '93',\n 'ELB_CLUSTER_NAME': 'expected-cluster-name',\n 'ELB_RESULTS': 'gs://ex...
[ "0.70271873", "0.7026732", "0.69392926", "0.69331855", "0.68138427", "0.6760369", "0.6758569", "0.6714527", "0.67041445", "0.66552407", "0.65845776", "0.65845776", "0.65845776", "0.65845776", "0.65845776", "0.65845776", "0.6584399", "0.65421516", "0.6530069", "0.6528909", "0....
0.7265635
0
The config can specify a resource manager server address as "driver", which means the workflow should launch the resource manager on the scheduler machine. Make sure it launches, but is also shut down after the workflow exits.
def test_resource_manager_on_driver(): config = { "workflow-name": "workflow", "cluster-type": CLUSTER_TYPE, "resource-manager": { "server": "driver", "port": 4000, "config": { "read_reqs": 123, "read_data": 456, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def launch(config):\n \n launch_with_configs([config])", "def run_xenon_simple(workflow, machine, worker_config):\n scheduler = Scheduler()\n\n return scheduler.run(\n xenon_interactive_worker(machine, worker_config),\n get_workflow(workflow)\n )", "def test_set_power_schedule_for_de...
[ "0.59481937", "0.5393874", "0.5334805", "0.53214973", "0.52877617", "0.5262214", "0.52576655", "0.52325445", "0.51960254", "0.5173219", "0.51681364", "0.5132155", "0.51199645", "0.5117904", "0.5104992", "0.5102506", "0.5085037", "0.5080357", "0.50710267", "0.5063733", "0.5049...
0.67965436
0
The config can specify a script to be run on each worker upon cluster initialization. This test verifies that it is launched and active while the workflow runs, and that it is launched on each worker, or just once per machine, depending on the config.
def test_worker_initialization(setup_worker_initialization_template): template_dir, _config, once_per_machine = setup_worker_initialization_template num_workers = 2 if once_per_machine or CLUSTER_TYPE in ("synchronous", "processes"): expected_script_count = 1 else: expected_script_c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_cluster_jobs_script(self):\r\n\r\n qiime_config = load_qiime_config()\r\n submit_script = qiime_config['cluster_jobs_fp']\r\n\r\n if (submit_script):\r\n full_path = which(submit_script)\r\n if full_path:\r\n submit_script = full_path\r\n ...
[ "0.6706494", "0.6451912", "0.62901366", "0.6208054", "0.6111138", "0.59998226", "0.59990007", "0.59590906", "0.5952131", "0.5922806", "0.5853597", "0.579472", "0.57890517", "0.57299614", "0.5724651", "0.5720135", "0.57154197", "0.57125825", "0.5700395", "0.5678336", "0.567510...
0.70054567
0
You can provide an initialization script for each worker to call before the workflow starts. The most common usecase for such a script is to launch a local dvid server on each worker (for posting in parallel to the cloud). We provide the necessary script for local dvid workers outofthebox, in scripts/workerdvid. This t...
def test_worker_dvid_initialization(): repo_dir = Path(flyemflows.__file__).parent.parent template_dir = tempfile.mkdtemp(suffix="test-worker-dvid") # Copy worker script/config into the template shutil.copy(f'{repo_dir}/scripts/worker-dvid/dvid.toml', f'{template_dir}/dvid.toml') ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_worker_initialization(setup_worker_initialization_template):\n template_dir, _config, once_per_machine = setup_worker_initialization_template\n \n num_workers = 2\n if once_per_machine or CLUSTER_TYPE in (\"synchronous\", \"processes\"):\n expected_script_count = 1\n else:\n e...
[ "0.7326153", "0.70049655", "0.6345922", "0.6308314", "0.6258606", "0.6253948", "0.6138363", "0.6117165", "0.61046404", "0.60405153", "0.6030067", "0.6017148", "0.6017148", "0.60138994", "0.5929832", "0.5922357", "0.5922357", "0.5841495", "0.5836372", "0.5836372", "0.5832595",...
0.7815065
0
Return the next power of 10
def nextpow10(n): if n == 0: return 0 else: return math.ceil(math.log10(abs(n)))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def next_pow_two(n):\n i = 1\n while i < n:\n i = i << 1\n return i", "def _next_power_of_two(self, n):\n if n == 0:\n return 1\n return int(2 ** math.ceil(math.log2(n)))", "def next_power2(num):\n return 2 ** int(np.ceil(np.log2(num)))", "def next_power_2(x: int) -> int:\n r...
[ "0.7424253", "0.73961514", "0.7280163", "0.7175434", "0.713948", "0.71352744", "0.69893503", "0.6905554", "0.68357366", "0.67452294", "0.6701021", "0.6685439", "0.6657409", "0.6649841", "0.66056854", "0.658991", "0.6583599", "0.656067", "0.6541835", "0.6518142", "0.6472119", ...
0.8007733
0
Return a number that looks 'nice', with a maximum error
def magicnr(value, error): magics = [ (10 ** (nextpow10(error))), (10 ** (nextpow10(error))) / 2.0, (10 ** (nextpow10(error))) / 4.0, (10 ** (nextpow10(error))) / 10.0, (10 ** (nextpow10(error))) / 20.0, (10 ** (nextpow10(error))) / 40.0, (10 ** (nextpow10(error))) / 100.0, ] magi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_precision(err):\n return max(0, int(-math.log10(2 * err)) + 1)", "def computeGoodMax(totalTimes, noerrs):\n # Could allow a small amount of space above the top, but it's annnoying for percentages!\n # return None\n factor = 1.00\n maxReading = factor * max(\n [max([v for v in l if ...
[ "0.684441", "0.6396268", "0.620864", "0.6083352", "0.6061179", "0.6019383", "0.601921", "0.5970972", "0.5961703", "0.59382796", "0.5932441", "0.592237", "0.5899084", "0.5895729", "0.58700436", "0.58562726", "0.5854558", "0.58429986", "0.58234286", "0.5815658", "0.58116823", ...
0.66190135
1
Get the path to a CSV by name.
def _get_csv_path(name): return os.path.join(cwd, 'output/app_info', name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def csv_path(name):\n return \"./data/%s\" % name", "def csv_dir(self):\n return op.join(self.root_dir, 'csv')", "def get_cached_csv(self, category: str) -> str:\n csv_path = f\"{self.csv_dir}/{category.lower()}.csv\"\n if path.exists(csv_path):\n return csv_path\n rai...
[ "0.82250005", "0.64448506", "0.6438859", "0.638522", "0.635775", "0.62658775", "0.6196743", "0.60490125", "0.60278124", "0.5936994", "0.59059805", "0.58804125", "0.58804125", "0.58078647", "0.5763088", "0.5756751", "0.5756751", "0.5756751", "0.5755957", "0.57534754", "0.57398...
0.7574934
1
Get the app's name.
def _get_app_name(app): return app[APP_NAME_KEY]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_name():\n return config.APP_NAME", "def app_name(self) -> str:\n return self._app_name", "def app_name(self):\n return self._app_name", "def app_name(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"app_name\")", "def get_app_name(self):\n return get...
[ "0.9113221", "0.88275534", "0.8791967", "0.87901825", "0.8730592", "0.8585392", "0.85836774", "0.84330225", "0.83433735", "0.83433735", "0.8274585", "0.81731343", "0.8169378", "0.8116642", "0.80174756", "0.7825664", "0.7809752", "0.7760691", "0.7760691", "0.7760691", "0.77606...
0.88942343
1
Get the contact's first name.
def _get_contact_first_name(app): name = app.get(CONTACT_NAME_KEY) if name: return ' {}'.format(name.split(' ')[0])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_first_name(self):\n return self._first_name", "def get_first_name(self) -> str:\n return self.first_name", "def first_name(self):\n return self._first_name", "def first_name(self):\n return self._first_name", "def first_name(self):\n return self._first_name", "d...
[ "0.86260074", "0.8617128", "0.8315871", "0.8315871", "0.8315871", "0.8312541", "0.81962097", "0.8183392", "0.8183392", "0.80284345", "0.7993891", "0.7896602", "0.7896602", "0.78449786", "0.7739931", "0.77090037", "0.7706754", "0.7706754", "0.7706754", "0.7706754", "0.7706754"...
0.8650525
0
Get the email template name for the first contact email.
def _get_first_contact_email_template_name(app): return app[FIRST_CONTACT_EMAIL_TEMPLATE_NAME_KEY]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_template_name(self):\n template = None\n if self.template:\n template = self.template\n if not template:\n for p in self.get_ancestors(ascending=True):\n if p.template:\n template = p.template\n break\n ...
[ "0.68836665", "0.6812669", "0.66186845", "0.66120255", "0.6575655", "0.6516548", "0.64882386", "0.64112824", "0.63238996", "0.6301571", "0.6288311", "0.6213783", "0.6116907", "0.60900533", "0.6080471", "0.6079054", "0.60654145", "0.6055386", "0.60473263", "0.60457283", "0.603...
0.87440306
0
Gets the tote store url for this app.
def _get_app_tote_store_url(app): return app[APP_TOTE_STORE_URL]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getNoteStoreUrl(self, authenticationToken):\r\n pass", "def getNoteStoreUrl(self, authenticationToken):\r\n self.send_getNoteStoreUrl(authenticationToken)\r\n return self.recv_getNoteStoreUrl()", "def get_store_path(cls):\n user_data_dir = cls.user_data_dir()\n store_path = os.path.j...
[ "0.6696655", "0.64120066", "0.6146364", "0.5828228", "0.57313335", "0.5705295", "0.56562585", "0.5626252", "0.5613728", "0.5612579", "0.5582851", "0.555923", "0.555923", "0.5541939", "0.5541939", "0.5510885", "0.55108297", "0.5492612", "0.5492612", "0.5468174", "0.54611695", ...
0.84141535
0
Check if we already sent the first contact email.
def _did_send_first_contact_email(app): first_contact = app[FIRST_CONTACT_EMAIL_SENT_KEY] if first_contact and first_contact.lower() == 'y': return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def IsfirstAddContact(self):\n if search_text(contact.get_value('accounts'), isScrollable = 0, searchFlag = TEXT_CONTAINS):\n click_in_list_by_index(0)\n return True\n else:\n return False", "def recent_email_sent(self):\n recent_contact_activity = self.activ...
[ "0.6324304", "0.6179195", "0.610429", "0.59007627", "0.58576906", "0.5768399", "0.5731466", "0.57095504", "0.5704638", "0.56970215", "0.5689795", "0.566889", "0.56208533", "0.5612742", "0.5604829", "0.5577359", "0.55763453", "0.55086017", "0.55008966", "0.5475762", "0.5462582...
0.8393486
0
Sends out emails to the apps in the provided csv.
def send(app_csv='apps.csv', verbose=True, dry_run=True): results = [] app_info = _csv_to_dict(app_csv) for app in app_info: # Get all the app info needed for this request. app_name = _get_app_name(app) contact_first_name = _get_contact_first_name(app) email_address = _get_co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_email_csv(csv_input):\n # Get a pandas dataframe column with all of the relevant duns numbers\n\n df = pd.read_csv(csv_input)\n duns_numbers = df.dunsnumber.tolist()\n\n # Gets the file number for the current file by taking the max of all of the other numbers in the lists directory and add...
[ "0.5723836", "0.556769", "0.5490822", "0.54697037", "0.54161894", "0.5410227", "0.5337697", "0.53324795", "0.5231842", "0.52236265", "0.5195237", "0.5186955", "0.51598907", "0.51523805", "0.5090487", "0.508662", "0.5077356", "0.50331646", "0.50279236", "0.50225353", "0.501493...
0.7534394
0
writes data from instream into additional allocated clusters of given file. Metadata of this file will be stored in Metadata object
def write(self, instream: typ.BinaryIO, filepath: str, filename: str = None) -> None: if filename is not None: filename = path.basename(filename) if self.fs_type == 'FAT': allocator_metadata = self.fs.write(instream, filepath) self.metadata.add_fil...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __write(self, storage):\n\n positions = storage.get_positions()\n if len(positions) == 0: return\n\n X = storage.get_X()\n Y = storage.get_Y()\n\n if Y: assert len(positions) == len(X) == len(Y)\n else: assert len(positions) == len(X)\n\n start, end = positions[...
[ "0.56617075", "0.56513876", "0.561701", "0.55935436", "0.5525497", "0.5482356", "0.54683065", "0.54394776", "0.5432194", "0.5414132", "0.5392", "0.5390164", "0.53824586", "0.53770757", "0.5337196", "0.5310381", "0.5272025", "0.5262886", "0.5257946", "0.52343404", "0.52302665"...
0.60996723
0
clears the slackspace of files. Information of them is stored in metadata.
def clear(self): if self.fs_type == 'FAT': for file_entry in self.metadata.get_files(): file_metadata = file_entry['metadata'] file_metadata = FATAllocatorMeta(file_metadata) self.fs.clear(file_metadata) elif self.fs_type == 'NTFS': ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clean():\n clean_files()", "def clean_files(self):\n self.filenames.clear()", "def clear(self):\n\n Console.info(\"Cleaning sprite files...\")\n Console.indent()\n \n for dirPath, dirNames, fileNames in os.walk(self.base):\n for fileName in fileNames:\n ...
[ "0.74671215", "0.7415675", "0.6979348", "0.6971708", "0.6971565", "0.689763", "0.68770945", "0.6817018", "0.6782567", "0.67809623", "0.6693809", "0.666803", "0.666092", "0.6653605", "0.6635497", "0.66262114", "0.6615348", "0.66098607", "0.6608693", "0.65980065", "0.6585141", ...
0.74563277
1
Sets the namespace_name of this ClairpbVulnerability.
def namespace_name(self, namespace_name): self._namespace_name = namespace_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_namespace(self, namespace: str) -> None:\n self._namespace = namespace", "def namespace(self, namespace: str):\n\n self._namespace = namespace", "def namespace(self, namespace):\n\n self._namespace = namespace", "def namespace(self, namespace):\n\n self._namespace = namesp...
[ "0.7218368", "0.6848428", "0.6652187", "0.6652187", "0.6394273", "0.61235774", "0.60623956", "0.59424466", "0.5783313", "0.57451713", "0.57072073", "0.56936276", "0.56725025", "0.5653841", "0.5579495", "0.55766636", "0.55388397", "0.5538237", "0.5520687", "0.55004734", "0.539...
0.7917395
0
Sets the severity of this ClairpbVulnerability.
def severity(self, severity): self._severity = severity
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def severity(self, severity):\n self._severity = severity", "def severity(self, severity):\n if severity is None:\n raise ValueError(\"Invalid value for `severity`, must not be `None`\") # noqa: E501\n\n self._severity = severity", "def severity(self, severity):\n if sev...
[ "0.77666795", "0.738541", "0.73160356", "0.7266142", "0.62618464", "0.6216128", "0.59445876", "0.59445876", "0.59445876", "0.5885588", "0.5885588", "0.5885588", "0.58778495", "0.58508825", "0.58508825", "0.562879", "0.5625883", "0.55735195", "0.55235606", "0.55169725", "0.550...
0.776778
0
Sets the fixed_by of this ClairpbVulnerability.
def fixed_by(self, fixed_by): self._fixed_by = fixed_by
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fixed_amount(self, fixed_amount):\n\n self._fixed_amount = fixed_amount", "def fixed_amount(self, fixed_amount):\n\n self._fixed_amount = fixed_amount", "def issued_by(self, issued_by):\n\n self._issued_by = issued_by", "def mitigated_by(self, mitigated_by):\n\n self._mitigate...
[ "0.6088768", "0.6088768", "0.60354835", "0.594974", "0.56890184", "0.5542011", "0.5290293", "0.5184325", "0.5179588", "0.51558876", "0.51558876", "0.51558876", "0.51558876", "0.51558876", "0.51558876", "0.5038125", "0.4941069", "0.49050403", "0.479892", "0.47826055", "0.47764...
0.8097117
0
Sets the affected_versions of this ClairpbVulnerability.
def affected_versions(self, affected_versions): self._affected_versions = affected_versions
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vulnerabilities(self, vulnerabilities):\n\n self._vulnerabilities = vulnerabilities", "def vulnerabilities(self, vulnerabilities):\n\n self._vulnerabilities = vulnerabilities", "def versions(self, versions):\n\n self._versions = versions", "def set_versions(self, consumer, versions):...
[ "0.609255", "0.609255", "0.59750617", "0.5626721", "0.54159355", "0.51944435", "0.51533484", "0.5120908", "0.50574327", "0.50420326", "0.50411284", "0.50248915", "0.48979875", "0.4828377", "0.48191965", "0.4787847", "0.46811602", "0.4634885", "0.46162087", "0.4607605", "0.460...
0.8137943
0
Optimizes the distribution of allocations for a set of stock symbols.
def optimize_portfolio(sd=dt.datetime(2008,1,1), ed=dt.datetime(2009,1,1), \ syms=['GOOG','AAPL','GLD','XOM'], gen_plot=False): # Read in adjusted closing prices for given symbols, date range dates = pd.date_range(sd, ed) prices_all = get_data(syms, dates) # automatically adds SPY prices = prices_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_best_allocation():\n\n # symbols = ['BRCM', 'TXN', 'IBM', 'HNZ'] \n symbols = ['AAPL', 'GOOG', 'IBM', 'MSFT']\n # ['GOOG','AAPL','GLD','XOM']\n basic_portfolio = BasicPortfolio(symbols, dt.datetime(2014, 1, 1), dt.datetime(2014, 12, 31))\n\n alloc = range(4)\n\n sharpe_max = 0\n alloc...
[ "0.6063045", "0.53763187", "0.5290051", "0.52126926", "0.5207097", "0.5145416", "0.50932026", "0.50518227", "0.50404334", "0.49763635", "0.49679303", "0.49524197", "0.48846778", "0.48805937", "0.48631468", "0.4856346", "0.4832151", "0.48185173", "0.48169646", "0.48079696", "0...
0.55457914
1
Given a starting value and prices of stocks in portfolio with allocations return the portfolio value over time.
def get_portfolio_value(prices, allocs, start_val): normed = prices/prices.iloc[0] alloced = np.multiply(allocs, normed) pos_vals = alloced * start_val port_val = pos_vals.sum(axis=1) return port_val
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_portvals(start_date, end_date, orders_file, start_val):\n \n #Read order file\n orders = pd.read_csv( orders_file, parse_dates = [0])\n \n #Get symbols making up the portfolio\n stock_symbols = list( set( orders[\"Symbol\"] ) )\n dates = pd.date_range(start_date, end_date)\n \n...
[ "0.7288363", "0.6751513", "0.649566", "0.639736", "0.6342396", "0.58377224", "0.5771629", "0.57363266", "0.5704653", "0.5654795", "0.56540567", "0.564203", "0.5640176", "0.5620506", "0.55888516", "0.55628633", "0.5536075", "0.553035", "0.55150396", "0.55067617", "0.5476467", ...
0.7756678
0
Calculate sharpe ratio for minimizer.
def get_sharpe_ratio(allocs, prices): port_val = get_portfolio_value(prices, allocs, start_val=1.0) sharpe_ratio = get_portfolio_stats(port_val, daily_rf=0.0, samples_per_year=252)[3] return -sharpe_ratio
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sharpe_ratio(self, r_f):\n return (\n self.cumulative_returns().last('1D').iat[0] - r_f\n ) / self.cumulative_returns().std()", "def sharpe_ratio(r1, r2, rf, o1, o2, cov):\n def sr(x):\n w1 = x[0]\n w2 = 1 - w1\n\n Rp = w1 * r1 + w2 * r2\n STDEVp = math...
[ "0.6567362", "0.6437101", "0.63409936", "0.6130169", "0.6042319", "0.60273135", "0.5931197", "0.59244883", "0.5785139", "0.5736135", "0.57228225", "0.5692179", "0.5680298", "0.5669893", "0.5615704", "0.5592618", "0.55892605", "0.55826575", "0.55295515", "0.5504721", "0.549964...
0.67490816
0
Creates a SnowflakeSource from a protobuf representation of a SnowflakeSource.
def from_proto(data_source: DataSourceProto): return SnowflakeSource( field_mapping=dict(data_source.field_mapping), database=data_source.snowflake_options.database, schema=data_source.snowflake_options.schema, table=data_source.snowflake_options.table, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def FromProto(cls, proto_obj):\n source = GameSource()\n source.type = proto_obj.type\n if proto_obj.update_time_utc_str:\n source.update_date_time = datetime.strptime(\n proto_obj.update_time_utc_str, tweets.DATE_PARSE_FMT_STR)\n else:\n source.update_date_time = datetime.now()\n ...
[ "0.69648314", "0.6726757", "0.62188435", "0.6085031", "0.54869676", "0.53810257", "0.5301759", "0.52652085", "0.5256398", "0.52558035", "0.52312374", "0.5175181", "0.51523924", "0.51177007", "0.5046059", "0.5044137", "0.50330454", "0.50251067", "0.5004873", "0.49959263", "0.4...
0.8149464
0
Returns the database of this snowflake source.
def database(self): return self.snowflake_options.database
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_database(self):\n return self.database", "def database(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"database\")", "def database(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"database\")", "def database(self) -> pulumi.Input[str]:\n ...
[ "0.7446689", "0.7409722", "0.7409722", "0.7361835", "0.73268086", "0.70755297", "0.70755297", "0.70755297", "0.70755297", "0.7035698", "0.70008326", "0.70008326", "0.6984017", "0.69791114", "0.6932914", "0.69217163", "0.6915366", "0.6904952", "0.6886391", "0.68326914", "0.683...
0.85056674
0
Returns the schema of this snowflake source.
def schema(self): return self.snowflake_options.schema
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def schema(self):\n return self.table_info.schema", "def get_source_schema(cls) -> dict:\n source_schema = get_base_schema(\n root=True,\n id_=\"source.schema.json\",\n title=\"Source data schema\",\n description=\"Schema for the source data, files and di...
[ "0.7523006", "0.7474272", "0.731446", "0.72799426", "0.7248296", "0.72096664", "0.72077894", "0.7188622", "0.71739715", "0.71583384", "0.7152522", "0.71101445", "0.6935228", "0.68277", "0.6764784", "0.67362326", "0.67253757", "0.6720299", "0.67055655", "0.6627854", "0.6607061...
0.8667721
0
Returns the table of this snowflake source.
def table(self): return self.snowflake_options.table
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getTable(self):\n return self.table", "def _get_table(self):\n\t\treturn self._table", "def get_tablename(self):\n return self.ds_table", "def getTable(self):\n\n raise NotImplementedError", "def table(self):\n if not self.exists:\n return None\n return sel...
[ "0.7333813", "0.72519577", "0.7144599", "0.7141145", "0.6996592", "0.6968488", "0.6951184", "0.6948223", "0.69295055", "0.69295055", "0.68013984", "0.6795885", "0.674512", "0.66221476", "0.65775824", "0.6573351", "0.6545", "0.65317136", "0.6509364", "0.6500206", "0.6481945", ...
0.8042992
0
Converts a SnowflakeSource object to its protobuf representation.
def to_proto(self) -> DataSourceProto: data_source_proto = DataSourceProto( type=DataSourceProto.BATCH_SNOWFLAKE, field_mapping=self.field_mapping, snowflake_options=self.snowflake_options.to_proto(), ) data_source_proto.event_timestamp_column = self.event_ti...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_proto(data_source: DataSourceProto):\n return SnowflakeSource(\n field_mapping=dict(data_source.field_mapping),\n database=data_source.snowflake_options.database,\n schema=data_source.snowflake_options.schema,\n table=data_source.snowflake_options.table,\...
[ "0.71726424", "0.6312265", "0.57572246", "0.56970835", "0.5353327", "0.5324823", "0.52810025", "0.5244373", "0.51959056", "0.51375407", "0.51266086", "0.51017046", "0.50727355", "0.50727355", "0.5006445", "0.5004341", "0.49543244", "0.48841015", "0.48770934", "0.48703986", "0...
0.7205786
0
Returns a string that can directly be used to reference this table in SQL.
def get_table_query_string(self) -> str: if self.database and self.table: return f'"{self.database}"."{self.schema}"."{self.table}"' elif self.table: return f'"{self.table}"' else: return f"({self.query})"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def table_name() -> str:\n pass", "def __repr__(self):\n cls_name = self.__class__.__name__\n conn_name = str(self._connection)\n tbl_name = self._table\n return '{0}({1}, table={2!r})'.format(cls_name, conn_name, tbl_name)", "def __repr__(self):\n cls_name = self.__cl...
[ "0.72242546", "0.7145293", "0.7145293", "0.71200347", "0.70594376", "0.70300525", "0.6961341", "0.6907269", "0.6881874", "0.6875941", "0.68361664", "0.68174165", "0.68159", "0.6803258", "0.67897487", "0.67895746", "0.67832047", "0.6771481", "0.6731299", "0.67075336", "0.66725...
0.76032066
0
Creates a SnowflakeOptions from a protobuf representation of a snowflake option.
def from_proto(cls, snowflake_options_proto: DataSourceProto.SnowflakeOptions): snowflake_options = cls( database=snowflake_options_proto.database, schema=snowflake_options_proto.schema, table=snowflake_options_proto.table, query=snowflake_options_proto.query, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_proto(self) -> DataSourceProto.SnowflakeOptions:\n snowflake_options_proto = DataSourceProto.SnowflakeOptions(\n database=self.database,\n schema=self.schema,\n table=self.table,\n query=self.query,\n )\n\n return snowflake_options_proto", "...
[ "0.72627205", "0.67112297", "0.6254082", "0.5537946", "0.5431298", "0.54273605", "0.5401342", "0.53541476", "0.53435814", "0.5294465", "0.523745", "0.5237094", "0.5193706", "0.5100491", "0.5098164", "0.50886667", "0.50617826", "0.5013392", "0.50065786", "0.49748728", "0.49595...
0.8055073
0
Converts an SnowflakeOptionsProto object to its protobuf representation.
def to_proto(self) -> DataSourceProto.SnowflakeOptions: snowflake_options_proto = DataSourceProto.SnowflakeOptions( database=self.database, schema=self.schema, table=self.table, query=self.query, ) return snowflake_options_proto
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_proto(cls, snowflake_options_proto: DataSourceProto.SnowflakeOptions):\n snowflake_options = cls(\n database=snowflake_options_proto.database,\n schema=snowflake_options_proto.schema,\n table=snowflake_options_proto.table,\n query=snowflake_options_proto....
[ "0.7185293", "0.6591346", "0.63469636", "0.6190279", "0.609588", "0.6037695", "0.59587693", "0.57750213", "0.574301", "0.5736975", "0.5731854", "0.5646835", "0.5621101", "0.55236673", "0.5520179", "0.54465526", "0.53726715", "0.53726715", "0.53726715", "0.53726715", "0.537267...
0.7964391
0
Given a dict of lang>names, return a default one
def primary_name(names): langs = names.keys() if 'en' in langs: return names['en'] return names[langs[0]]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def localizedWithFallback(field, allowEmpty=True):\n for lang in [''] + FallbackLanguages():\n t = field[lang]\n if allowEmpty:\n if isinstance(t, basestring):\n return t\n elif t:\n return t\n return u\"\"", "def fallback_trans(x):\r\n t = _(x)\...
[ "0.60933506", "0.60726446", "0.6008112", "0.5990976", "0.59868455", "0.5985267", "0.5922496", "0.590694", "0.58639705", "0.5810866", "0.5780663", "0.5768472", "0.57512575", "0.5717193", "0.5704346", "0.5672763", "0.5649485", "0.56342536", "0.563318", "0.5624843", "0.5548256",...
0.6597497
0
Initializes an instance of the InstagramBot class.
def __init__(self, username = None, password = None): self.username = config['AUTH']['USERNAME'] self.password = config['AUTH']['PASSWORD'] self.login = config['URL']['LOGIN'] self.nav_url = config['URL']['NAV'] self.tag_url = config['URL']['TAGS'] self.direct_url = confi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start(self):\r\n self._instagram_api = InstagramAPI(mongo_api=self._mongo_api)\r\n self._inst_run()", "def __init__(self, bot=BNBot):\n self.bot = bot", "def __init__(self, client_id=None, access_token=None):\r\n if not client_id and not access_token:\r\n raise TypeErr...
[ "0.7040264", "0.6685926", "0.66698956", "0.6649861", "0.6649861", "0.6602354", "0.6402114", "0.6402114", "0.62316155", "0.614077", "0.6138122", "0.60492367", "0.60134923", "0.5993596", "0.59222096", "0.59110945", "0.5900702", "0.58524567", "0.5842189", "0.5841665", "0.5826000...
0.75979745
0
Method gets a list of users who like a post
def get_likes_list(self, username): api = self.api api.searchUsername(username) result = api.LastJson username_id = result['user']['pk'] #Gets the user ID user_posts = api.getUserFeed(username_id) # gets the user feed result = api.LastJson ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_user_likes(self, data_base):\n cursor = data_base.cursor(dictionary=True)\n cursor.execute(f\"SELECT user_id FROM user_like WHERE post_id = {self.id}\")\n user_likes = tuple(map(lambda x: str(x['user_id']), cursor.fetchall()))\n if not user_likes:\n return []\n ...
[ "0.80609584", "0.7395297", "0.69443375", "0.6895322", "0.68074024", "0.67923427", "0.6753025", "0.6566023", "0.6552493", "0.63974077", "0.639381", "0.6380745", "0.6334056", "0.6326958", "0.6302191", "0.62897587", "0.62885493", "0.62881505", "0.6275099", "0.6275099", "0.623825...
0.76121527
1
Load sample images for image manipulation. Loads both, ``china`` and ``flower``. Returns
def load_sample_images(): # Try to import imread from scipy. We do this lazily here to prevent # this module from depending on PIL. try: try: from scipy.misc import imread except ImportError: from scipy.misc.pilutil import imread except ImportError: raise ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_images(self):\r\n self.standing_frame = [load_image(\"cat1.png\")]\r\n self.walk_frames_r = [load_image(\"cat2.png\"), load_image(\"cat3.png\"),\r\n load_image(\"cat4.png\")]", "def _preload_all_samples(self):\n if self.mode in ['train_noval', 'train_wit...
[ "0.6988628", "0.6685474", "0.66373193", "0.66370726", "0.6426989", "0.6391403", "0.63717645", "0.62725484", "0.62609285", "0.62502795", "0.6230983", "0.62293315", "0.6186863", "0.6182871", "0.61326575", "0.6113", "0.6112325", "0.6069663", "0.6068178", "0.6067434", "0.6062822"...
0.7011758
0
Recreate the (compressed) image from the code book & labels
def recreate_image(codebook, labels, w, h): d = codebook.shape[1] image = np.zeros((w, h, d)) label_idx = 0 for i in range(w): for j in range(h): image[i][j] = codebook[labels[label_idx]] label_idx += 1 return image
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def recreate_image(codebook, labels, w, h):\n d = codebook.shape[1]\n image = np.zeros((w, h, d))\n label_idx = 0\n for i in range(w):\n for j in range(h):\n image[i][j] = codebook[labels[label_idx]]\n label_idx += 1\n return image", "de...
[ "0.79495394", "0.7899799", "0.7884121", "0.7781928", "0.7687692", "0.60020334", "0.5997393", "0.5904447", "0.58416754", "0.5806961", "0.5723574", "0.5705346", "0.56988686", "0.56837463", "0.5680749", "0.5661601", "0.5639231", "0.55816334", "0.55626464", "0.555133", "0.5549232...
0.79031765
1
linearly scale the values of an array in the range [0, 1]
def scale01(arr): walk_arr_01 = numpy.interp(arr, (numpy.amin(arr), numpy.amax(arr)), (-1, +1)) # linear scaling return walk_arr_01 #return the scaled array
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scale0to1(img):\r\n\r\n min = np.min(img)\r\n max = np.max(img)\r\n\r\n if min == max:\r\n img.fill(0.5)\r\n else:\r\n img = (img-min) / (max-min)\r\n\r\n return img.astype(np.float32)", "def scale0to1(img):\r\n\r\n img = img.astype(np.float32)\r\n\r\n min = np.min(img)\r\n...
[ "0.7274082", "0.71151817", "0.7070224", "0.70607144", "0.695351", "0.6909782", "0.6863304", "0.683024", "0.6815376", "0.68095505", "0.6759205", "0.6644985", "0.6604848", "0.65765154", "0.65633816", "0.65503216", "0.6484777", "0.6470204", "0.644784", "0.64431757", "0.64138615"...
0.7821479
0
extends the init_buffer of OffsetColorProgram class by creating the additional carry flag VBO
def _init_buffers(self, v, n, _): super()._init_buffers(v, n, _) self.vbos.append(gl.glGenBuffers(1)) # init VBO 2 - dynamic color data gl.glBindBuffer(gl.GL_ARRAY_BUFFER, self.vbos[3]) loc = self.get_attribute_location("carried") gl.glEnableVertexAttribArray(loc) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_buffer(self):\n \n self.shape.buf = [pi3d.Buffer(self.shape, self.verts, self.texcoords, self.inds, self.norms)]\n self.shape.set_draw_details(self.shader, [self.spritesheet.img])", "def setupVAO(self, gpuShape):\n glBindVertexArray(gpuShape.vao)\n\n glBindBuffer(GL_AR...
[ "0.60485387", "0.5838095", "0.58365405", "0.58271587", "0.58271587", "0.5774059", "0.5710976", "0.5705954", "0.5652349", "0.5554869", "0.5520962", "0.55178773", "0.54938525", "0.53955853", "0.5374403", "0.53721666", "0.5345584", "0.53194004", "0.5283975", "0.5239198", "0.5213...
0.69480604
0
updates the carry flag data (VBO3)
def update_carried(self, data): self.use() gpu_data = np.array(data, dtype=np.float32) gl.glBindBuffer(gl.GL_ARRAY_BUFFER, self.vbos[3]) gl.glBufferData(gl.GL_ARRAY_BUFFER, gpu_data.nbytes, gpu_data, gl.GL_DYNAMIC_DRAW)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bcs(self, arg):\n\n self.pc += arg if self.p & const.FLAG_CARRY else 0\n self.pc = c_uint16(self.pc).value", "def bvc(self, arg):\n\n self.pc += arg if not self.p & const.FLAG_OVERFLOW else 0\n self.pc = c_uint16(self.pc).value", "def update_flags(self):\n # view mode, fi...
[ "0.57576525", "0.55997807", "0.55879223", "0.5496893", "0.54818845", "0.5372455", "0.530587", "0.5240245", "0.51702", "0.5161561", "0.515714", "0.5140299", "0.51236033", "0.5092073", "0.50008583", "0.49901924", "0.49867123", "0.49156582", "0.4907488", "0.4875377", "0.48464125...
0.65785253
0
Sets scale control bitword = 0 x, y frozen scales + 1 x is interactive + 2 y is interactive bit value 0/1 frozen/interactive
def set_scale_control(self, scale_ctl=3): self._scale_ctl = scale_ctl
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _force_rescale(self, setpoint_x, setpoint_y):", "def scale(self,id,x,y,s):\n if id not in self.elements.keys():\n print(\"Id input not registered! Please check your process\")\n return False\n element=self.elements[id]\n state=element.scale(self.h-1-y,x,s,self.w,sel...
[ "0.67285424", "0.6584716", "0.6431193", "0.6370215", "0.6340126", "0.6294655", "0.62531334", "0.6227982", "0.6212142", "0.6209266", "0.6207113", "0.6194933", "0.6148316", "0.61001164", "0.6055724", "0.60446364", "0.60115176", "0.6009035", "0.59821504", "0.59555095", "0.591816...
0.67066544
1
Get versions of EFI, Boot ROM, OS & Mac Device as well as the SysUUID
def gather_system_versions(self): # Get Mac model ID self.hw_version = str( IORegistryEntryCreateCFProperty( IOServiceGetMatchingService( 0, IOServiceMatching("IOPlatformExpertDevice")), "model", None, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_firmware_version():\r\n return utils.run('crossystem fwid').stdout.strip()", "def _get_release_infos():\n \n # support RHEL or CentOS, we don't care about the rest...\n with settings(hide('warnings', 'running', 'stdout', 'stderr'), warn_only=True):\n infos = run('cat /etc/redhat-releas...
[ "0.6673707", "0.6660692", "0.6526378", "0.628747", "0.62810564", "0.62695277", "0.62047887", "0.619877", "0.6136058", "0.613013", "0.61185354", "0.61024153", "0.60582775", "0.6051702", "0.5979974", "0.5965632", "0.59549516", "0.59407663", "0.59400725", "0.5934368", "0.5919144...
0.7456519
0
Given the OS version are you running, what is the highest available build number? Are you running it?
def check_highest_build(self, sys_info, api_results): if not api_results.get("latest_build_number"): self.results[self.current_endpoint]["latest_build_number"] = self.__make_api_get( '/apple/latest_build_number/%s' % (".".join(sys_info.get("os_ver").split(".")[:2]))) self.me...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def version_max():\n return VERSION_MAX", "def get_max_build_version(version: str) -> str:\n return Version(version).bump_minor().get_stable().dumps()", "def get_build_number():\n try:\n return int(os.getenv(*legion.config.BUILD_NUMBER))\n except ValueError:\n raise Exception('Cannot ...
[ "0.74187696", "0.71662873", "0.7020225", "0.70104754", "0.6995423", "0.6940619", "0.67905074", "0.6742232", "0.66234714", "0.6523554", "0.65176624", "0.6482276", "0.6474209", "0.6407805", "0.6395835", "0.63706833", "0.63454497", "0.6344706", "0.6331214", "0.6328722", "0.63287...
0.7350579
1
Preprocess graphs by casting into FloatTensor and setting to cuda if available
def preprocess(dataset, cuda): for g, _ in dataset: for key_g, val_g in g.ndata.items(): processed = g.ndata.pop(key_g) processed = processed.type('torch.FloatTensor') if cuda: processed = processed.cuda() g.ndata[key_g] = processed for...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_cuda(network):\n network.cuda()\n\n network._to_cuda_forward_cache = network.forward\n\n def cuda_forward(x):\n return network._to_cuda_forward_cache(x.cuda(non_blocking=True))\n\n network.forward = cuda_forward", "def cuda_if_gpu(T):\n\n return T.cuda() if use_cuda else T", "def _...
[ "0.5934677", "0.5921635", "0.58703035", "0.581513", "0.5797795", "0.5776158", "0.57602173", "0.57533664", "0.5746811", "0.5742912", "0.5733459", "0.5706499", "0.56763935", "0.56657827", "0.5658226", "0.5653087", "0.5644797", "0.5627843", "0.55857766", "0.55729073", "0.5570853...
0.69795823
0
Plot the languages stored in the dictionaries
def plot_languages(dict_usage_complexities, dict_cognitive_complexity): attested_languages = ( frozenset(['nor', 'and', 'or', 'not']), frozenset(['and', 'or', 'not']), frozenset(['and', 'not']), frozenset(['or', 'not']), ) fig, ax = plt.subplots(figsize=(8.27,4)) for nam...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def visualize_vecDict(vecDict):\n for url in vecDict:\n plt.plot(vecDict[url])\n plt.legend([key for key in vecDict])\n plt.title(f'Vectors for {len(vecDict)} Documents')\n plt.xlabel('Vector Dimensions')\n plt.ylabel('Document Value')\n plt.show()", "def draw_all_plots(self):\n\n ...
[ "0.60507584", "0.5974315", "0.5905134", "0.5861216", "0.58539575", "0.57940316", "0.5775768", "0.5712009", "0.57002044", "0.5681444", "0.56463766", "0.5642815", "0.5637291", "0.5622407", "0.5596009", "0.5593054", "0.5562897", "0.55299807", "0.5506552", "0.5498803", "0.5488566...
0.6960431
0
Merge draft invoices. Work only with same partner. You can merge invoices and refund invoices with echa other. Moves all lines on the first invoice.
def merge_invoice(self, cr, uid, invoices, context=None): order_ids = [] pick_ids = [] if len(invoices) <= 1: return False parent = self.pool.get('account.invoice').browse(cr, uid, context['active_id']) for inv in invoices: if parent.partner_id != inv.part...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def merge_purchase_invoice(self):\r\n active_id = self.env['purchase.order'].browse(self.env['purchase.order']._context.get('active_ids'))\r\n journal_id = self.env['account.journal'].search([('type', '=', 'purchase')]) \r\n active_id_count = 0\r\n active_count = 0\r\n exist_vend...
[ "0.6526457", "0.60499185", "0.6039584", "0.5971947", "0.5949904", "0.5877273", "0.58699375", "0.5868027", "0.5864572", "0.57496387", "0.56165034", "0.5592037", "0.55525774", "0.5516271", "0.5495002", "0.5483541", "0.5412485", "0.5412102", "0.53373694", "0.53041404", "0.529060...
0.7914905
0
r"""Return the standard path to the shared area on the current platform.
def shared_area_path() -> str: try: return os.environ["OITG_SHARED_AREA"] except KeyError: pass if os.name == "nt": # Windows return "Z:\\" if os.name == "unix" or os.name == "posix": # Linux / OSX / ... return os.path.expanduser("~/steaneShared/") raise Exception...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_share_path():\n cwd = os.path.dirname(__file__)\n share = os.path.join(cwd, '../share')\n return os.path.abspath(share)", "def path_share(self) -> Path:\n return self.path_supervisor / SHARE_DATA", "def get_path(self):\n\t\treturn call_sdk_function('PrlShare_GetPath', self.handle)", "...
[ "0.75354296", "0.6952207", "0.67871875", "0.67391086", "0.67256176", "0.6657467", "0.6635167", "0.661767", "0.66105354", "0.6436675", "0.6340287", "0.6331047", "0.63205075", "0.6297639", "0.62504154", "0.6217222", "0.6186836", "0.6157988", "0.61453235", "0.6119978", "0.611485...
0.85109854
0
Return the path to the given users analysis directory on the shared area (``/Users//analysis``).
def analysis_root_path(user: Optional[str] = None) -> str: if user is None: user = _get_user() return os.path.join(shared_area_path(), "Users", user, "analysis")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def todays_analysis_path(day: Optional[str] = None, user: Optional[str] = None) -> str:\n if day is None:\n day = date.today().isoformat()\n if user is None:\n user = _get_user()\n path = os.path.join(analysis_root_path(user=user), day)\n\n if not os.access(path, os.R_OK):\n # If t...
[ "0.6710544", "0.66245717", "0.64282644", "0.61189187", "0.5994886", "0.5977346", "0.5951611", "0.59258217", "0.5919063", "0.5871089", "0.5855553", "0.5822797", "0.5740604", "0.5706992", "0.56850857", "0.5682241", "0.5660873", "0.5612151", "0.5608156", "0.5605027", "0.560351",...
0.84479433
0
Return the path to the analysis directory for the given day, defaulting to today. The analysis directory is intended to be used as working space for analysing data while it is taken, so that the code can easily be found again later if the data or conclusions reached are reexamined. If the directory does not exist, it i...
def todays_analysis_path(day: Optional[str] = None, user: Optional[str] = None) -> str: if day is None: day = date.today().isoformat() if user is None: user = _get_user() path = os.path.join(analysis_root_path(user=user), day) if not os.access(path, os.R_OK): # If the dir does n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_day_data_path(self, days_ago=0):\n home = os.environ.get('USERPROFILE').replace('\\\\', '/')\n self.data_dir= os.path.join(home, 'TimeData')\n if not os.path.isdir(self.data_dir):\n mkdir(self.data_dir)\n today_filename = os.path.join(\n self.data_dir,\n ...
[ "0.62076753", "0.5934615", "0.59194785", "0.58207476", "0.57378083", "0.5428975", "0.54136276", "0.53955543", "0.5333741", "0.5282543", "0.5224942", "0.519696", "0.519696", "0.5180282", "0.5148305", "0.51434815", "0.5098279", "0.5076191", "0.5064754", "0.50544584", "0.5054282...
0.7822021
0
Return the path to an experiment's ARTIQ results directory. The standard results path is ``/artiqResults/``.
def artiq_results_path(experiment: Optional[str] = None) -> str: path = os.path.join(shared_area_path(), "artiqResults") if experiment is None: try: experiment = os.environ["OITG_EXPERIMENT"] except KeyError: raise Exception( "No experiment supplied, and...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def data_abex_results_dir(experiment_name: str) -> Path: # pragma: no cover\n return experiment_dir(experiment_name) / \"Results\"", "def data_abex_results_iteration_dir(experiment_name: str, iteration: int) -> Path: # pragma: no cover\n return data_abex_results_dir(experiment_name) / iteration_name(iter...
[ "0.80512667", "0.7191955", "0.68996114", "0.6845597", "0.68339694", "0.66065645", "0.65667313", "0.65667313", "0.65667313", "0.65351224", "0.63939637", "0.6320295", "0.61587936", "0.6123075", "0.60877836", "0.60146594", "0.5972927", "0.5961885", "0.5882054", "0.58809346", "0....
0.873001
0
estimate an MxF user factor matrix and an FxN item factor matrix from the MxN rating matrix
def factor_mat(all_dat, f_num, iterations, regularization): # get # of users and # of items [u_num, i_num] = all_dat.shape # init user factors and item factors with random values u_fac = np.matrix(np.random.rand(u_num, f_num)) # MxF i_fac = np.matrix(np.random.rand(i_num, f_num)) # NxF # calculate the preferen...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_matrix(self):\n\n self.matrix = np.zeros((len(self.users), len(self.items)))\n\n for user in self.train_set['users']:\n for item in self.train_set['feedback'][user]:\n self.matrix[self.user_to_user_id[user]][self.item_to_item_id[item]] = \\\n se...
[ "0.6282623", "0.62621325", "0.60587424", "0.6045789", "0.6040702", "0.6002245", "0.5951851", "0.59179777", "0.59059614", "0.58943605", "0.589419", "0.587945", "0.5858747", "0.58264637", "0.5798391", "0.57919794", "0.574544", "0.5737683", "0.5693354", "0.5668427", "0.56560904"...
0.72323316
0
Get list of Domains for this API key.
def get_domains() -> List[str]: ret = _call_endpoint("v1/domains") # Example response: # [{'createdAt': '2016-06-25T03:08:44.000Z', # 'domain': 'mydomain.com', # 'domainId': 12345678, # 'expirationProtected': False, # 'expires': '2020-06-25T03:08:44.000Z', # 'holdRegistrar': False, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_domains(self):\n\n response = self.call(method='getDomains')\n domains = []\n for d in response:\n domain = self.domain(domain=d['domain'])\n domains.append(domain)\n return domains", "def listDomains(self):\n reply = self.rpc.getDomains(self.usern...
[ "0.82744664", "0.76725835", "0.7275466", "0.72130734", "0.7188468", "0.7123102", "0.7106527", "0.71019924", "0.7034431", "0.70254606", "0.7023339", "0.69961786", "0.6931258", "0.69296205", "0.6853687", "0.6843187", "0.6822089", "0.6772705", "0.6753809", "0.6742991", "0.669397...
0.78274804
1
Get DNS entries for a specific domain
def get_domain_dns_records(domain): url_suffix = "v1/domains/{}/records".format(domain) ret = _call_endpoint(url_suffix) if isinstance(ret, dict) and ret.get('code', None) == "UNKNOWN_DOMAIN": # e.g. {'code': 'UNKNOWN_DOMAIN', 'message': 'The given domain is not registered, or does not have a zone f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list(self, domain):\n return request(\n API_LIST.DNS_LIST.value,\n {\n 'email': self.email,\n 'token': self.token,\n 'domain': domain\n }\n )", "def print_all_dns_records():\n for domain in sorted(get_domains()):\n...
[ "0.754245", "0.69325036", "0.6888839", "0.6870619", "0.68629503", "0.6824631", "0.67168874", "0.66804457", "0.6670255", "0.6651589", "0.664277", "0.66395545", "0.66219234", "0.6609759", "0.6591403", "0.65406996", "0.6507059", "0.64893925", "0.647041", "0.64417464", "0.6440061...
0.7584279
0
Print each domain and its DNS records (for domains linked to this API key).
def print_all_dns_records(): for domain in sorted(get_domains()): dns_records = get_domain_dns_records(domain) print(domain) pprint(dns_records) print("*" * 50) # TODO: poor man's rate limiter. improve? time.sleep(2)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cb_listdomains(self, cmd):\n for cur in sorted(self.d.listDomains(),\n key=lambda x: _domreverse(x['domain'])):\n print \"%(domain)60s %(expiration_date)15s\" % cur", "def cli(ctx, domain, ip_address, hostname):\n zone = getzone(domain)\n #print('.%s:%s:%s' % ...
[ "0.70802027", "0.6874424", "0.67829025", "0.6670683", "0.6497714", "0.64597666", "0.6447752", "0.6308665", "0.62406534", "0.6203262", "0.619593", "0.6123511", "0.60674375", "0.6036058", "0.6034905", "0.6027634", "0.59853095", "0.5983278", "0.59728104", "0.5970376", "0.5966782...
0.8448762
0
Returns a request handler class that redirects to supplied `url`
def redirect_handler_factory(): class RedirectHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): def do_GET(self): self.send_response(301) domain = self.headers['host'] if ':' in domain: domain = domain.split(':')[0] self.send_header('Locatio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def redirect_handler_factory(url):\n class RedirectHandler(http.server.SimpleHTTPRequestHandler):\n def do_GET(self):\n self.send_response(302)\n self.send_header('Location', url)\n self.end_headers()\n\n return RedirectHandler", "def redirect(url):", "def __call__...
[ "0.8006581", "0.63602716", "0.60251427", "0.5762764", "0.562808", "0.5593964", "0.5454222", "0.5417794", "0.54076666", "0.5355651", "0.5345712", "0.53292465", "0.53158814", "0.53054017", "0.526144", "0.5258285", "0.52532136", "0.5251986", "0.52408147", "0.5233149", "0.5226429...
0.6883462
1
loop and copy console>serial until config.exit_char character is found. when config.menu_char is found, interpret the next key locally.
def writer(self): menu_active = False try: while self.alive: try: char = self.console.getkey() except KeyboardInterrupt: char = '\x03' if menu_active: # Menu character again/exit char...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getKey(self):\n while not rospy.is_shutdown():\n tty.setraw(sys.stdin.fileno())\n select.select([sys.stdin], [], [], 0)\n self.key = sys.stdin.read(1)\n termios.tcsetattr(sys.stdin, termios.TCSADRAIN, self.settings)\n time.sleep(.05)", "def run(se...
[ "0.60768646", "0.5757084", "0.57472295", "0.572881", "0.5679723", "0.5675239", "0.56368023", "0.5612974", "0.560551", "0.5580252", "0.55787677", "0.5541301", "0.55385447", "0.5523714", "0.54723734", "0.5423755", "0.54224914", "0.5421046", "0.54165447", "0.5408846", "0.5373981...
0.66630965
0
Getting mri (most recent influence) Returns 0 if no influence exists
def _get_mri(journal): try: return Influence.objects.filter(journal__issn=journal.issn).order_by('-date_stamp')[0] except IndexError: return 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_reward(self):\n if self.is_game_done:\n return self.price - 1\n else:\n return 0.0", "def get_reward(state, resolution, grid_x, grid_y):\n a,b = single_index_to_index(state, resolution)\n position = index_to_obs(a, b, grid_x, grid_y )[0]\n if position >= 0.5:...
[ "0.575768", "0.5676095", "0.56729364", "0.56670934", "0.559796", "0.55813545", "0.5575672", "0.55736303", "0.55562896", "0.55536056", "0.5553515", "0.5538506", "0.5526368", "0.55253816", "0.5502831", "0.5489734", "0.5470172", "0.5469639", "0.5466303", "0.5466303", "0.54242605...
0.70698816
0
Return True if the node is a "real" endpoint of an edge in the network, \ otherwise False. OSM data includes lots of nodes that exist only as \ points to help streets bend around curves. An end point is a node that \
def is_endpoint(G: nx.Graph, node: int, strict=True): neighbors = set(list(G.predecessors(node)) + list(G.successors(node))) n = len(neighbors) d = G.degree(node) if node in neighbors: # If the node appears in its list of neighbors, it self-loops. this is # always an endpoint. ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def node_is_edge(self, node: MazeCell) -> bool:\n return node.x == 0 or node.x == self._ncols - 1 or node.y == 0 or node.y == self._nrows - 1", "def door_in_edge(self, edge: list) -> bool:\n doors = self.get_interior_doors()\n room1 = self.get_rooms()[edge[0]]\n room2 = self.get_rooms...
[ "0.6984057", "0.62434214", "0.62212586", "0.61637247", "0.6161208", "0.6138825", "0.61363894", "0.6098323", "0.60917765", "0.6071788", "0.60438186", "0.6020851", "0.5994252", "0.5977758", "0.59772736", "0.59747833", "0.5952888", "0.5948707", "0.5904112", "0.58738995", "0.5869...
0.77966064
0
Recursively build a path of nodes until you hit an endpoint node. Please note this method is taken directly from OSMnx, and can be found in \
def build_path( G: nx.Graph, node: int, endpoints: List[int], path: List[int]) -> List[int]: # For each successor in the passed-in node for successor in G.successors(node): if successor not in path: # If successor is already in path, ignore it, otherwise add ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_path(self,first_node,last_node):\n edge_pattern=re.compile('edge_(?P<begin_node>\\w+)_(?P<end_node>\\w+)_(?P<iterator>\\w+)')\n exit_paths=self.get_exiting_edges(first_node)\n next_nodes=self.get_exiting_nodes(first_node)\n #be careful here using the wrong assignment statement b...
[ "0.66372293", "0.5984706", "0.5966498", "0.5830176", "0.58110154", "0.58090067", "0.5781353", "0.577707", "0.5756183", "0.5688646", "0.56742686", "0.5663207", "0.5620114", "0.56037915", "0.5599367", "0.55866355", "0.5558341", "0.5553427", "0.5551647", "0.55495954", "0.5524534...
0.7077985
0
Create a list of all the paths to be simplified between endpoint nodes. \ The path is ordered from the first endpoint, through the interstitial \ nodes, to the second endpoint. Please note this method is taken directly from OSMnx, and can be found in \
def get_paths_to_simplify(G: nx.Graph, strict: bool=True) -> List[List[int]]: # First identify all the nodes that are endpoints endpoints = set([node for node in G.nodes() if is_endpoint(G, node, strict=strict)]) # Initialize the list to be returned; an empty list paths_to_simplif...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_paths(self):\n # convert to node sequences, dropping s'\n self.nodeseq_paths = []\n for path in self.paths:\n node_seq = [] # don't include s'\n for arc in path:\n node_seq.append(self.arc_info[arc]['destin'])\n self.nodeseq_paths.ap...
[ "0.66736597", "0.65876526", "0.64044726", "0.6344763", "0.6287056", "0.6267099", "0.6243408", "0.6209103", "0.61667985", "0.6163704", "0.61539465", "0.6153504", "0.61441976", "0.61239386", "0.6118913", "0.611599", "0.6104713", "0.6080712", "0.60661316", "0.6046239", "0.604591...
0.68498194
0
Archive a GIT project and upload it to Dash.
def deploy_project(name, apikey, changed_files=None, repo=None, branch='master'): zbuff = StringIO() if changed_files is not None: changed_files = list(set(changed_files) | REQUIRED_FILES) _archive_project(name, zbuff, changed_files, repo, branch) zbuff.reset() payload = {...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __gitCreateArchive(self):\n self.vcs.gitCreateArchive(self.project.getProjectPath())", "def upload_tar_from_git():\n require(\"release\", provided_by=[deploy])\n tree = prompt(\"Please enter a branch or SHA1 to deploy\", default=\"master\")\n local(\"git archive --format=tar %s | gzip > %s.ta...
[ "0.75925666", "0.6769014", "0.6449582", "0.6398534", "0.6263004", "0.6191235", "0.6138252", "0.61108285", "0.60195297", "0.60129213", "0.5945884", "0.5934544", "0.59011316", "0.58871365", "0.5878439", "0.586114", "0.58004034", "0.57955575", "0.5776379", "0.5756278", "0.572796...
0.72552186
1
Search existing spider names in a project
def search_spider_names(project, apikey, name=''): payload = {'project': project, 'apikey': apikey, 'spider': name} req = requests.get(DASH_API_URL + 'spiders/list.json', params=payload) if req.status_code == 200: return [s.get('id') for s in req.json().get('spiders', [])] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dorkScanner():\n pysearch.PySearch()\n openfile = open(\"sites.txt\", 'r')\n urls = openfile.read()\n openfile.close()\n return urls", "def _search(self, log, progressbar):\n self._urls = []\n for filename in os.listdir(self._path):\n url = 'file://...
[ "0.56716776", "0.54362226", "0.54334825", "0.53485537", "0.53356576", "0.53022844", "0.52963454", "0.5276801", "0.5274018", "0.5273827", "0.5265692", "0.5207114", "0.51662695", "0.5152858", "0.514631", "0.512449", "0.5115938", "0.5112054", "0.51114047", "0.51075816", "0.50923...
0.7393245
0
Download a zipped project from Dash.
def _download_project(name, apikey): payload = {'apikey': apikey, 'project': name, 'version': 'portia'} r = requests.get(DASH_API_URL + 'as/project-slybot.zip', params=payload) return r.content
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def download_data():\n url = 'https://www.dropbox.com/s/h9ubx22ftdkyvd5/ml-latest-small.zip?dl=1'\n urllib.request.urlretrieve(url, 'ml-latest-small.zip')\n zfile = zipfile.ZipFile('ml-latest-small.zip')\n zfile.extractall()\n zfile.close()", "def x_download():\n\t#_loadconfig()\n\tconf = _get_con...
[ "0.6970031", "0.6887985", "0.68189776", "0.681829", "0.6720921", "0.66710734", "0.65784806", "0.65546376", "0.6551284", "0.6536828", "0.64772105", "0.63660634", "0.63608265", "0.635872", "0.634232", "0.63057834", "0.630051", "0.6292988", "0.6290236", "0.62840354", "0.62497574...
0.7049751
0
Convert to front facing coordinates
def get_front_facing_xz(self): yaw_radian = math.radians(self.cur_rotation) return cam.step * math.sin(yaw_radian) * math.cos(0), cam.step * math.cos( yaw_radian) * math.cos(0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def frontFace(self):\n\n if not self.threedee:\n return gl.GL_CCW\n\n # Only looking at the mesh -> display\n # transform, thus we are assuming that\n # the MVP matrix does not have any\n # negative scales.\n xform = self.opts.getTransform('mesh', 'display')\n\n...
[ "0.6466102", "0.5958782", "0.59478974", "0.59458196", "0.5798166", "0.57393557", "0.5688547", "0.56672025", "0.56672025", "0.56627524", "0.5614368", "0.5602697", "0.5566901", "0.5562923", "0.55597514", "0.5549741", "0.55102384", "0.55058265", "0.54947865", "0.54475546", "0.54...
0.7374416
0
Called by base init, after class change or format text change
def initFormat(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_text(self):\n d = self.declaration\n if d.text:\n self.set_text(d.text)\n if d.text_color:\n self.set_text_color(d.text_color)\n if d.text_alignment:\n self.set_text_alignment(d.text_alignment)\n if d.font_family or d.text_size:\n ...
[ "0.70883477", "0.6957401", "0.6811701", "0.6811701", "0.6811701", "0.6811701", "0.6811701", "0.6811701", "0.6811701", "0.6811701", "0.6811701", "0.6801035", "0.67764556", "0.67764556", "0.6772573", "0.67218834", "0.6665987", "0.6530844", "0.6495981", "0.6494592", "0.6494592",...
0.7095915
0
Change this field's type to newType with default format
def changeType(self, newType): self.__class__ = globals()[newType + 'Format'] self.format = self.defaultFormat self.initFormat()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def field_type_converter(self, old_type):\n\n if old_type == 'String':\n new_type = 'Text'\n elif old_type == 'Integer':\n new_type = 'Short'\n elif old_type == 'Date':\n new_type = 'Date'\n elif old_type == 'GlobalID':\n new_type = 'GUID'\n ...
[ "0.7694419", "0.6731671", "0.6345279", "0.6247612", "0.6140391", "0.6116279", "0.60566497", "0.60437393", "0.6029452", "0.6012749", "0.5938881", "0.589731", "0.58825034", "0.58494186", "0.582059", "0.58018064", "0.57945174", "0.57587177", "0.57267576", "0.5711055", "0.5708371...
0.7249991
1
Returns English name if assigned, o/w name
def englishName(self): if self.enName: return self.enName return self.name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def english_name(self) -> str | None:\n return self.get_display_name(Locale('en'))", "def get_localized_name(name):\n locale = \"{}_{}\".format(\n name[\"preferredLocale\"][\"language\"],\n name[\"preferredLocale\"][\"country\"]\n )\n return name['localized'].get(locale, '')", "de...
[ "0.7934382", "0.73227644", "0.7047755", "0.6930511", "0.68412167", "0.6786411", "0.67855275", "0.6760979", "0.6730141", "0.6662109", "0.6648933", "0.66485107", "0.66408026", "0.6632018", "0.65623486", "0.655018", "0.65476584", "0.6501709", "0.64950544", "0.64857614", "0.64754...
0.80885744
0
Return name used for labels add for required fields
def labelName(self): if self.isRequired: return '%s*' % self.name return self.name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def label_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"label_name\")", "def build_label_text(field_name: str, field: dict):\n\n label = \"\"\n if \"required\" in field:\n label = \" * \" if field.get(\"required\") else \"\"\n\n # If we don't have a label def...
[ "0.7235186", "0.7140648", "0.7047591", "0.7011272", "0.69102323", "0.678387", "0.678387", "0.678387", "0.678387", "0.678387", "0.678387", "0.67811215", "0.67751276", "0.67363954", "0.67283016", "0.6711237", "0.6679455", "0.6657541", "0.66369164", "0.65833545", "0.65801924", ...
0.82659084
0
Return formatted text, properly escaped if not in titleMode
def formatOutput(self, storedText, titleMode, internal=False): prefix = self.prefix suffix = self.suffix if titleMode: if self.html: storedText = self.removeMarkup(storedText) if globalref.docRef.formHtml: prefix = self.removeMarkup(prefix)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def title(text, level=0):\n return '\\n' + text + '\\n' + '=-~_#%^' [level] * len(text) + '\\n\\n'", "def format_title(self, data):\n return data", "def output_plain_sep_title(title):\n print(f\"{plain_sep_mark}\\t{title}{plain_sep_mark}\")", "def formatOutput(self, storedText, titleMode, intern...
[ "0.6623557", "0.64947814", "0.6347113", "0.6307539", "0.621596", "0.6210496", "0.60684896", "0.60674477", "0.60663515", "0.60421175", "0.6019259", "0.59935653", "0.59802073", "0.59790826", "0.595393", "0.5948588", "0.5939195", "0.590317", "0.5872387", "0.58521676", "0.5838757...
0.67517006
0
Return tuple of this field's text in edit format and bool validity, using edit format option
def editText(self, item): storedText = item.data.get(self.name, '') result = self.formatEditText(storedText) if self.isRequired and not result[0]: return (result[0], False) return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def storedText(self, editText):\n if editText in self.formatList:\n return (editText, True)\n return (editText, not editText and not self.isRequired)", "def storedText(self, editText):\n try:\n return (repr(GenBoolean(editText)), True)\n except GenBooleanError:\...
[ "0.7739331", "0.76100457", "0.7482231", "0.7482231", "0.7214738", "0.7091386", "0.702513", "0.7018469", "0.6923507", "0.67845714", "0.67359626", "0.6618689", "0.6553471", "0.6410668", "0.63894486", "0.6138071", "0.56394523", "0.5639128", "0.5639128", "0.5639128", "0.5639128",...
0.76801556
1
Return initial value in edit format, found in edit format option
def getEditInitDefault(self): return self.formatEditText(self.initDefault)[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getEditInitDefault(self):\n if self.initDefault in DateFormat.dateStampStrings:\n return DateFormat.dateStampStrings[1]\n return TextFormat.getEditInitDefault(self)", "def getEditInitDefault(self):\n if self.initDefault in TimeFormat.timeStampStrings:\n return TimeF...
[ "0.69168735", "0.6777391", "0.6163817", "0.5962609", "0.59190995", "0.5825621", "0.5639453", "0.55958575", "0.5588548", "0.55880916", "0.55728984", "0.5547174", "0.55372924", "0.5518307", "0.55125266", "0.54999983", "0.54888153", "0.54888153", "0.54887563", "0.5471209", "0.54...
0.7327655
0
Return a list of choices for setting the init default
def initDefaultChoices(self): return []
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initDefaultChoices(self):\n return [entry[0] for entry in self.getEditChoices()]", "def initDefaultChoices(self):\n return [text for text in self.formatList]", "def initDefaultChoices(self):\n choices = [entry[0] for entry in self.getEditChoices()]\n choices.insert(0, DateFormat...
[ "0.83096915", "0.8089902", "0.7565213", "0.7451019", "0.699929", "0.699929", "0.680488", "0.67091656", "0.66209406", "0.65692645", "0.6532258", "0.6486172", "0.64289325", "0.6406578", "0.63146526", "0.62376446", "0.62375015", "0.62119025", "0.61605716", "0.6160515", "0.608993...
0.8791058
0
Return tuple of stored text from edited text and bool validity, using edit format option
def storedText(self, editText): if editText in self.formatList: return (editText, True) return (editText, not editText and not self.isRequired)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def storedText(self, editText):\n try:\n return (repr(GenBoolean(editText)), True)\n except GenBooleanError:\n if editText in self.formatList:\n return (editText, True)\n return (editText, not editText and not self.isRequired)", "def formatEditText(se...
[ "0.76840067", "0.7569935", "0.7569935", "0.73801994", "0.7312141", "0.7185404", "0.71525943", "0.70902133", "0.69048536", "0.6863909", "0.6808694", "0.67496157", "0.66044503", "0.62728953", "0.6122511", "0.60096884", "0.5692688", "0.5692688", "0.5692688", "0.5692688", "0.5692...
0.787282
0
Return list of choices for combo box, each a tuple of edit text and any annotation text
def getEditChoices(self, currentText=''): return [(text, '') for text in self.formatList]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_choices(self):\n raise NotImplementedError()", "def get_choices(self):\n raise NotImplementedError()", "def choices(cls):\n # return list(map(tuple, cls.__members__.items()))\n return [(int(code), name) for name, code in cls.__members__.items()]", "def getEditChoices(self,...
[ "0.64435107", "0.64435107", "0.6406375", "0.6369448", "0.6282898", "0.61602914", "0.61550856", "0.6096663", "0.6079173", "0.6074226", "0.599768", "0.5979722", "0.5946701", "0.59085536", "0.58665997", "0.5852769", "0.5851758", "0.5840527", "0.58387506", "0.5816007", "0.5803215...
0.6981332
0
Split textStr using editSep, double sep's become char
def splitText(self, textStr): return [text.strip().replace('\0', self.editSep) for text in textStr.replace(self.editSep * 2, '\0'). split(self.editSep)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def split(string, sep='\\t'):\n return text_type.split(string, sep)", "def extended(self, new_char, new_char_index, sep=' '):\n if new_char == sep:\n return TextState(self.text + new_char, '', new_char_index), self.last_word\n if sep == '':\n return TextState(self.text + new_...
[ "0.61333054", "0.5867214", "0.5828028", "0.58185434", "0.5792178", "0.5787775", "0.573595", "0.5613339", "0.5568093", "0.5554935", "0.55341613", "0.5515633", "0.5514492", "0.55078864", "0.5440001", "0.5372514", "0.5367604", "0.53267324", "0.5326295", "0.52897936", "0.52483726...
0.7283009
0
Return tuple of choices from inText sorted like format and True if all splits are valid and included
def sortedChoices(self, inText): choices = self.splitText(inText) sortedChoices = [text for text in self.formatList if text in choices] if len(choices) == len(sortedChoices): return (sortedChoices, True) else: return (sortedChoices, False)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def formatEditText(self, storedText):\n for choice in self.splitText(storedText):\n if choice not in self.formatList:\n return (storedText, not storedText)\n return (storedText, True)", "def complete_opt_allow_select_scan(self, text, *_):\n return [t for t in (\"tru...
[ "0.58024824", "0.5749306", "0.5671507", "0.55511814", "0.5483213", "0.5446786", "0.54443884", "0.54241514", "0.54228777", "0.52902573", "0.52757835", "0.5264248", "0.5196836", "0.5174921", "0.5168787", "0.5146945", "0.51274663", "0.5122783", "0.5096883", "0.509225", "0.507958...
0.7824299
0
Return a list of choices for setting the init default
def initDefaultChoices(self): return [entry[0] for entry in self.getEditChoices()]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initDefaultChoices(self):\n return []", "def initDefaultChoices(self):\n return [text for text in self.formatList]", "def initDefaultChoices(self):\n choices = [entry[0] for entry in self.getEditChoices()]\n choices.insert(0, DateFormat.dateStampStrings[1])\n return choic...
[ "0.8790614", "0.8089398", "0.7564882", "0.74508727", "0.70026475", "0.70026475", "0.680855", "0.67124087", "0.6624441", "0.65727", "0.653437", "0.64892524", "0.6431678", "0.6409585", "0.63181144", "0.6240514", "0.6240365", "0.62128824", "0.6163351", "0.6163266", "0.6090951", ...
0.83091384
1
Sort menu list choices
def sortChoices(self): self.formatList.sort()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SortList(self, key: callable = str.lower):\n temp_list = self.Items\n temp_list.sort(key=key)\n # delete contents of present listbox\n self.delete(0, Tags.End.value)\n # load listbox with sorted data\n for item in temp_list:\n self.insert(Tags.End.value, ite...
[ "0.6233976", "0.6216146", "0.6190673", "0.598364", "0.59764874", "0.5956966", "0.59059286", "0.5865083", "0.58410734", "0.58394575", "0.5783629", "0.5779133", "0.5769487", "0.57629895", "0.5747787", "0.57295066", "0.57123274", "0.5697192", "0.5693883", "0.567952", "0.56586474...
0.77374196
0
Set initial value from editor version using edit format option
def setInitDefault(self, editText): if editText in DateFormat.dateStampStrings: self.initDefault = DateFormat.dateStampStrings[0] else: TextFormat.setInitDefault(self, editText)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getEditInitDefault(self):\n if self.initDefault in DateFormat.dateStampStrings:\n return DateFormat.dateStampStrings[1]\n return TextFormat.getEditInitDefault(self)", "def getEditInitDefault(self):\n return self.formatEditText(self.initDefault)[0]", "def setInitDefault(self,...
[ "0.62732863", "0.62497866", "0.62184155", "0.6095079", "0.6085302", "0.6077205", "0.6007599", "0.57824373", "0.5620094", "0.552909", "0.54974353", "0.5490214", "0.5446925", "0.54123217", "0.53948015", "0.5381172", "0.53762734", "0.53609794", "0.5341126", "0.5302158", "0.52889...
0.6298632
0
Return initial value in edit format, found in edit format option
def getEditInitDefault(self): if self.initDefault in DateFormat.dateStampStrings: return DateFormat.dateStampStrings[1] return TextFormat.getEditInitDefault(self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getEditInitDefault(self):\n return self.formatEditText(self.initDefault)[0]", "def getEditInitDefault(self):\n if self.initDefault in TimeFormat.timeStampStrings:\n return TimeFormat.timeStampStrings[1]\n return TextFormat.getEditInitDefault(self)", "def format(self) -> pulu...
[ "0.7327655", "0.6777391", "0.6163817", "0.5962609", "0.59190995", "0.5825621", "0.5639453", "0.55958575", "0.5588548", "0.55880916", "0.55728984", "0.5547174", "0.55372924", "0.5518307", "0.55125266", "0.54999983", "0.54888153", "0.54888153", "0.54887563", "0.5471209", "0.546...
0.69168735
1
Return conditional comparison value with realtime adjustments, used for date and time types' 'now' value
def adjustedCompareValue(self, value): if value.startswith('now'): return repr(GenDate()) return value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def adjustedCompareValue(self, value):\n if value.startswith('now'):\n return repr(GenTime())\n return value", "def condition(self):\n HH = str(time.localtime().tm_hour)\n MM = str(time.localtime().tm_min)\n return eval(self._cond_str)", "def get_state_by_time(pyth...
[ "0.7139558", "0.61179876", "0.6032351", "0.60296464", "0.5851021", "0.5813862", "0.5813862", "0.58051044", "0.5691663", "0.56752634", "0.563707", "0.55923384", "0.5590049", "0.55772096", "0.5574569", "0.5568509", "0.5496361", "0.54885936", "0.54716676", "0.5465949", "0.544361...
0.689713
1
Return conditional comparison value with realtime adjustments, used for date and time types' 'now' value
def adjustedCompareValue(self, value): if value.startswith('now'): return repr(GenTime()) return value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def adjustedCompareValue(self, value):\n if value.startswith('now'):\n return repr(GenDate())\n return value", "def condition(self):\n HH = str(time.localtime().tm_hour)\n MM = str(time.localtime().tm_min)\n return eval(self._cond_str)", "def get_state_by_time(pyth...
[ "0.68978775", "0.6119225", "0.6032928", "0.6031085", "0.5851345", "0.5813949", "0.5813949", "0.5806566", "0.56923884", "0.5676319", "0.5638131", "0.55917704", "0.55903226", "0.55771613", "0.55758727", "0.5568553", "0.54968023", "0.54886967", "0.54710984", "0.54660606", "0.544...
0.71401125
0
Return tuple of stored text from edited text and bool validity, using edit format option
def storedText(self, editText): try: return (repr(GenBoolean(editText)), True) except GenBooleanError: if editText in self.formatList: return (editText, True) return (editText, not editText and not self.isRequired)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def storedText(self, editText):\n if editText in self.formatList:\n return (editText, True)\n return (editText, not editText and not self.isRequired)", "def formatEditText(self, storedText):\n return (storedText, True)", "def formatEditText(self, storedText):\n return (s...
[ "0.78716373", "0.75691116", "0.75691116", "0.7379154", "0.73117137", "0.7183602", "0.7152062", "0.7089976", "0.6903923", "0.6863199", "0.68065554", "0.6748621", "0.6604557", "0.62711895", "0.61224514", "0.6009547", "0.5690611", "0.5690611", "0.5690611", "0.5690611", "0.569061...
0.76830506
1
Return the next value for a new node, increment format if increment is True
def nextValue(self, increment=True): try: prefix, numText, suffix = UniqueIDFormat.formatRe.\ match(self.format).groups() except AttributeError: self.format = UniqueIDFormat.defaultFormat return self.nextValue(increment) v...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mutate(self, node, _):\n new_node = ast.Num(n=node.n + 1)\n return new_node", "def next(self):\n with self.atomicfile.locked():\n curr = self.atomicfile.read_atomic().decode(\"utf8\")\n curr = self.initial if not curr else int(curr)\n self.atomicfile.writ...
[ "0.66704005", "0.63615674", "0.63538784", "0.6263111", "0.6259454", "0.625471", "0.62121814", "0.6187122", "0.615829", "0.61369663", "0.6088049", "0.60810864", "0.6007773", "0.5959815", "0.59519273", "0.5947382", "0.5939667", "0.58915627", "0.58673847", "0.5866701", "0.583965...
0.6884581
0
Return formatted text, properly escaped and with a link to the picture if not in titleMode
def formatOutput(self, storedText, titleMode, internal=False): if titleMode: return TextFormat.formatOutput(self, storedText, titleMode, internal) paths = storedText.split('\n') results = ['<img src="%s">' % escape(url, treedoc.escDict) for ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def image(self, src, title, text):\n src = escape_link(src)\n text = escape(text, quote=True)\n if title:\n title = escape(title, quote=True)\n html = '<img src=\"%s\" alt=\"%s\" title=\"%s\"' % (src, text, title)\n else:\n html = '<img src=\"%s\" alt=\"...
[ "0.625808", "0.6189183", "0.59681433", "0.59475166", "0.5911793", "0.58762133", "0.5813121", "0.5810856", "0.5802654", "0.58000255", "0.5753115", "0.57340395", "0.572571", "0.5709024", "0.5676528", "0.567329", "0.5668774", "0.5666511", "0.56526905", "0.56396496", "0.56106", ...
0.68930674
0
Interpolates between two vectors that are nonzero and don't both lie on a line going through origin. First normalizes v2 to have the same norm as v1. Then interpolates between the two vectors on the hypersphere.
def interpolate_hypersphere(v1, v2, num_steps): v1_norm = tf.norm(v1) v2_norm = tf.norm(v2) v2_normalized = v2 * (v1_norm / v2_norm) vectors = [] for step in range(num_steps): interpolated = v1 + (v2_normalized - v1) * step / (num_steps - 1) interpolated_norm = tf.norm(interpolated) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def intersectionOfTwoLines(p1, v1, p2, v2):\n # if we transform multiple points in one go\n if len(v1.shape) == 2:\n a1 = np.einsum('ij,ij->i', v1, v1)\n a2 = np.einsum('ij,ij->i', v1, v2)\n b1 = -np.einsum('ij,ij->i', v2, v1)\n b2 = -np.einsum('ij,ij->i', v2, v2)\n c1 = -n...
[ "0.6572107", "0.6260578", "0.60963017", "0.60499376", "0.59216046", "0.588906", "0.584281", "0.58285564", "0.5783416", "0.5775993", "0.57329005", "0.5730922", "0.5719066", "0.57099354", "0.56855845", "0.56546366", "0.565153", "0.56246614", "0.5574889", "0.5566318", "0.5547199...
0.6959037
0
Given a set of images, show an animation.
def animate(images): images = np.array(images) converted_images = np.clip(images * 255, 0, 255).astype(np.uint8) imageio.mimsave('./animation.gif', converted_images) return embed.embed_file('./animation.gif')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_images(images):\n for name, img in images:\n cv2.imshow(name, img)\n\n cv2.waitKey(0)", "def display_images(filenames):\n for filename in filenames:\n display(Image(filename))", "def display_frames_as_gif(frames):\n fig=e.cube.show_layout(frames[0]) \n print(\"Drawn\")\n ...
[ "0.6905455", "0.6872684", "0.68629754", "0.6797282", "0.66781235", "0.6561315", "0.6522247", "0.6522247", "0.6522247", "0.6437156", "0.6422651", "0.6395544", "0.6391225", "0.63497686", "0.63120157", "0.62429947", "0.62429947", "0.62429947", "0.62429947", "0.62429947", "0.6242...
0.76514333
0
Extract the session token from the secret_key field.
def extract_session_from_secret(secret_key, session_token): if secret_key and '@@@' in secret_key and not session_token: return secret_key.split('@@@')[0], secret_key.split('@@@')[1] else: return secret_key, session_token
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_token(self):\n token = self._session.token\n return token", "def _shib_get_token(self): # pragma: no cover\n\n shibCookie = None\n for cookie in self._session.cookies:\n if \"shibsession\" in cookie.name:\n shibCookie = cookie\n break\...
[ "0.6786535", "0.6588912", "0.6564999", "0.6549351", "0.65473354", "0.6426423", "0.64007133", "0.6390965", "0.6321878", "0.63127387", "0.6308861", "0.63074374", "0.62886924", "0.62571794", "0.6218154", "0.6218154", "0.61798644", "0.61466336", "0.61005646", "0.6099376", "0.6099...
0.7777419
0
Testing to do a scrap of consumed material.
def test_manufacturing_scrap(self): # Update demo products (self.product_4 | self.product_2).write({ 'tracking': 'lot', }) # Update Bill Of Material to remove product with phantom bom. self.bom_3.bom_line_ids.filtered(lambda x: x.product_id == self.product_5).unlink...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_extract_recipe_from_website(self):\n pass", "def _scrape(self):", "def test_JCB_VISUAL_MATERIALS( self ):\n driver = self.driver\n driver.get(self.base_url + \"/record=b5660654~S6\")\n driver.find_element_by_link_text(\"Request\").click()\n self.assertTrue( 'aeon' in...
[ "0.64861304", "0.60452384", "0.60298216", "0.6010472", "0.6002515", "0.6002515", "0.5930737", "0.59229994", "0.5865279", "0.5826006", "0.5802774", "0.5802774", "0.56953853", "0.568463", "0.56727046", "0.56668943", "0.56484073", "0.56198096", "0.56014913", "0.5600095", "0.5565...
0.68666345
0
This test checks a tracked manufactured product will go to location defined in putaway strategy when the production is recorded with product.produce wizard.
def test_putaway_after_manufacturing_3(self): self.laptop.tracking = 'serial' mo_laptop = self.new_mo_laptop() serial = self.env['stock.production.lot'].create({'product_id': self.laptop.id, 'company_id': self.env.company.id}) mo_form = Form(mo_laptop) mo_form.qty_producing = 1 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_generate_with_putaway(self):\n nbre_of_lines = 4\n shelf_location = self.env['stock.location'].create({\n 'name': 'shelf1',\n 'usage': 'internal',\n 'location_id': self.location_dest.id,\n })\n\n # Checks a first time without putaway...\n ...
[ "0.68906146", "0.6246047", "0.6090114", "0.6084227", "0.6050358", "0.6022465", "0.5951435", "0.592476", "0.59018815", "0.5867885", "0.58634603", "0.58565384", "0.58413273", "0.58121234", "0.58035403", "0.5710238", "0.5670679", "0.5666164", "0.564475", "0.5602386", "0.5602123"...
0.7612206
0
Make sure a kit is split in the corrects quantity_done by components in case of an immediate transfer.
def test_kit_immediate_transfer(self): picking = self.env['stock.picking'].create({ 'location_id': self.test_supplier.id, 'location_dest_id': self.warehouse_1.wh_input_stock_loc_id.id, 'partner_id': self.test_partner.id, 'picking_type_id': self.env.ref('stock.pick...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_kit_planned_transfer(self):\n picking = self.env['stock.picking'].create({\n 'location_id': self.test_supplier.id,\n 'location_dest_id': self.warehouse_1.wh_input_stock_loc_id.id,\n 'partner_id': self.test_partner.id,\n 'picking_type_id': self.env.ref('st...
[ "0.61881334", "0.60192597", "0.57607996", "0.556063", "0.55559486", "0.553951", "0.5507649", "0.5501214", "0.53878224", "0.5373135", "0.5346838", "0.53159076", "0.53042346", "0.530181", "0.5292941", "0.5262657", "0.5252141", "0.5244603", "0.52374023", "0.5235112", "0.52324265...
0.6650053
0
Make sure a kit is split in the corrects product_qty by components in case of a planned transfer.
def test_kit_planned_transfer(self): picking = self.env['stock.picking'].create({ 'location_id': self.test_supplier.id, 'location_dest_id': self.warehouse_1.wh_input_stock_loc_id.id, 'partner_id': self.test_partner.id, 'picking_type_id': self.env.ref('stock.pickin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _check_overprocessed_subcontract_qty(self):\n overprocessed_moves = self.env['stock.move']\n for move in self:\n if not move.is_subcontract:\n continue\n # Extra quantity is allowed when components do not need to be register\n if not move._has_track...
[ "0.62997496", "0.6127928", "0.6034478", "0.6018836", "0.59107655", "0.5806491", "0.5761691", "0.5730393", "0.5726534", "0.57250893", "0.5659513", "0.56430745", "0.56031597", "0.5599683", "0.55872136", "0.5580281", "0.55272794", "0.55234873", "0.55033195", "0.54832494", "0.546...
0.6308212
0
ability that deals damage to the target
def ability_1(self,target): damage = (self.get_strength()+2) target.receive_damage(damage)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ability_3(self,target):\r\n damage = (self.get_dexterity()+self.get_strength())\r\n target.receive_damage(damage)", "def ability_4(self,target):\r\n damage = (self.get_strength()*3)\r\n target.receive_damage(damage)", "def ability_2(self,target):\r\n damage1 = (self.get_l...
[ "0.7999557", "0.7960427", "0.79067296", "0.7736732", "0.7559663", "0.75042886", "0.73485667", "0.69856614", "0.6954562", "0.68673724", "0.6778077", "0.67357415", "0.66850173", "0.6644636", "0.6638605", "0.662029", "0.6539297", "0.65386426", "0.65321666", "0.65184796", "0.6500...
0.81057763
0
ability that deals damage to the target
def ability_3(self,target): damage = (self.get_dexterity()+self.get_strength()) target.receive_damage(damage)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ability_1(self,target):\r\n damage = (self.get_strength()+2)\r\n target.receive_damage(damage)", "def ability_4(self,target):\r\n damage = (self.get_strength()*3)\r\n target.receive_damage(damage)", "def ability_2(self,target):\r\n damage1 = (self.get_lvl()+self.get_stren...
[ "0.81057763", "0.7960427", "0.79067296", "0.7736732", "0.7559663", "0.75042886", "0.73485667", "0.69856614", "0.6954562", "0.68673724", "0.6778077", "0.67357415", "0.66850173", "0.6644636", "0.6638605", "0.662029", "0.6539297", "0.65386426", "0.65321666", "0.65184796", "0.650...
0.7999557
1
Return the path of the ocamlmerlin binary."
def merlin_bin(): user_settings = sublime.load_settings("Merlin.sublime-settings") merlin_path = user_settings.get('ocamlmerlin_path') if merlin_path: return merlin_path # For Mac OS X, add the path for homebrew if "/usr/local/bin" not in os.environ['PATH'].split(os.pathsep): os.en...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_bin_dir():\n return os.path.abspath(os.path.join(get_root_dir(), 'bin/'))", "def dir_bin():\n return abspath('bin')", "def binary_location(cmd, USE_PATH=False):\n return os.path.join(BIN_PREFIX, cmd)", "def get_golem_path():\r\n return os.path.abspath(os.path.join(os.path.dirname(__file__...
[ "0.682036", "0.6652295", "0.65895194", "0.6584268", "0.6460019", "0.64083457", "0.63974833", "0.6339136", "0.6329058", "0.63127565", "0.6281566", "0.6236012", "0.6232723", "0.62326777", "0.6230347", "0.61885166", "0.6138241", "0.61246544", "0.6089618", "0.6089618", "0.6089160...
0.7753057
0