query
stringlengths
9
3.4k
document
stringlengths
9
87.4k
metadata
dict
negatives
listlengths
4
101
negative_scores
listlengths
4
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
The ID of the user to add the GPG key to. If this field is omitted, this resource manages a GPG key for the current user. Otherwise, this resource manages a GPG key for the specified user, and an admin token is required.
def user_id(self) -> pulumi.Output[Optional[int]]: return pulumi.get(self, "user_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_id(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"user_id\")", "def user_id(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"user_id\")", "def user_id(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"user_id\")", "def user_id(self) -> Optional[pu...
[ "0.59973806", "0.59973806", "0.59461033", "0.59461033", "0.59461033", "0.58855414", "0.5857102", "0.5794713", "0.5794713", "0.57523966", "0.5672502", "0.56256455", "0.561052", "0.561052", "0.561052", "0.561052", "0.561052", "0.56017846", "0.5598544", "0.55765146", "0.55765146...
0.53703696
36
A simple atmospheric correction user function.
def atmos_worker(srcs, window, ij, args): src = srcs[0] rgb = src.read(window=window) rgb = to_math_type(rgb) atmos = simple_atmo(rgb, args["atmo"], args["contrast"], args["bias"]) # should be scaled 0 to 1, scale to outtype return scale_dtype(atmos, args["out_dtype"])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def photometric_calibration():\n pass", "def correction(self):\r\n \r\n # empirical coefficients:\r\n k3, k2, k1, k0 = 0.0892, 0.0544, 0.2511, -0.0017\r\n \r\n # thrust as a function of the azimuth angle and the loads:\r\n thrust = self.qn*np.sin(Turbine.t) + self...
[ "0.61928207", "0.5973503", "0.5942666", "0.5792738", "0.56472266", "0.55731606", "0.5548008", "0.5524009", "0.5518598", "0.549149", "0.548513", "0.54550296", "0.5454594", "0.54474777", "0.5439883", "0.5401135", "0.5364659", "0.5344781", "0.53409076", "0.5323973", "0.53162694"...
0.0
-1
Called to manually configure the settings.
def configure(self, **options): if self._wrapped != None: raise RuntimeError('Settings already configured.') holder = BaseSettings() for name, value in options.items(): setattr(holder, name, value) self._wrapped = holder
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _configure(self):\n pass", "def configure(self):\r\n pass", "def configure(self):\n\n pass", "def configure(self):\n pass", "def configure(self):\n pass", "def configure(self) -> None:", "def configure(self):", "def configure(self):", "def configure(self):", ...
[ "0.8006963", "0.78778684", "0.78398174", "0.78377604", "0.78377604", "0.76788086", "0.7593549", "0.7593549", "0.7593549", "0.7593549", "0.7307189", "0.72909945", "0.71859413", "0.7179386", "0.7117419", "0.70910853", "0.6952371", "0.69478595", "0.6914445", "0.6912856", "0.6875...
0.6699357
37
Returns True if the settings have already been configured.
def configured(self): return bool(self._wrapped)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isConfigured(self):\n if self.__install and not self.__saved:\n return False\n else:\n return True", "def is_configured(self):\n return True", "def has_configuration_set():\r\n return getattr(settings, \"MICROSITE_CONFIGURATION\", False)", "def ready(self):\n...
[ "0.7863535", "0.73570967", "0.71889997", "0.7188648", "0.70707977", "0.70555437", "0.7038546", "0.70364285", "0.70202684", "0.7011307", "0.6916756", "0.69161123", "0.690429", "0.6882626", "0.6806333", "0.6803242", "0.67524123", "0.6648274", "0.6591806", "0.65610003", "0.65447...
0.69954
10
Receive n bytes from the socket
def recv(client, n): chunk = b'' while n > 0: ch = client.recv(n) if ch == b'': raise EOFError() chunk += ch n -= len(ch) assert(n == 0) return chunk
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def recvn(self, n):\n data = []\n while len(data) != n:\n data.append(self.recv(1))\n\n return b''.join(data)", "def recv(self, n=4096):\n if len(self._buf) < n:\n buf = self._s.recv(65536)\n if not buf and not self._buf:\n raise Disconn...
[ "0.7856013", "0.7693048", "0.76820815", "0.76639897", "0.7482208", "0.7467017", "0.7346952", "0.7327951", "0.7207453", "0.7158722", "0.7143791", "0.71399474", "0.71371573", "0.710497", "0.70604646", "0.7038661", "0.7038661", "0.6986106", "0.69846296", "0.6969628", "0.6925327"...
0.71623373
9
Create python configuration file for the projection script
def createCfg_project(self, jobOptions): last_line = '%s %s %s %s' % (jobOptions['projection_module'], self.era, jobOptions['histName'], jobOptions['outputFile']) if self.projection_module != 'puHist': last_line += ' %.6e' % jobOptions['ref_genWeight'] lines = jobOptions['inputFiles'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_configuration(self, context):\n context.cfg_path = path = os.path.join(context.env_dir, 'pyvenv.cfg')\n with open(path, 'w', encoding='utf-8') as f:\n f.write('home = %s\\n' % context.python_dir)\n if self.system_site_packages:\n incl = 'true'\n ...
[ "0.66401374", "0.66170925", "0.66152537", "0.65990126", "0.656565", "0.656565", "0.64811194", "0.64493716", "0.64300835", "0.6417359", "0.64147276", "0.6409965", "0.6381156", "0.63435024", "0.6338197", "0.6330227", "0.62982994", "0.6296114", "0.6284715", "0.62806594", "0.6273...
0.67666286
0
Adds the commands to Makefile that are necessary for running the PU profile production code
def addToMakefile_project(self, lines_makefile): if self.is_sbatch: lines_makefile.extend([ "%s:" % self.makefile_target, "\t%s %s" % ("python", self.sbatchFile_projection), "", ]) for key_file, output_file in self.outputFiles_tmp.i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup():\n\n with cd(env.homedir):\n\n # clone repository from github\n sudo('git clone https://github.com/collective/demo.plone.de.git', user=env.deploy_user) # noqa: E501\n\n with cd(env.directory):\n\n # requirements\n # sudo('python python-dev build-essential zlib1g-dev l...
[ "0.58019394", "0.56512487", "0.56154317", "0.5504537", "0.5497869", "0.5490134", "0.5453638", "0.54293007", "0.5393862", "0.5369195", "0.5369195", "0.5329574", "0.53238434", "0.52624726", "0.5257164", "0.5226181", "0.521311", "0.51892006", "0.517996", "0.5137804", "0.5126059"...
0.0
-1
Creates Makefile that runs the PU profile production.
def createMakefile(self, lines_makefile): tools_createMakefile( makefileName = self.makefile, targets = self.targets, lines_makefile = lines_makefile, filesToClean = self.filesToClean, isSbatch = self.is_sbatch, phoniesToAd...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate(env):\n\n indent = find_indent()\n\n generator = lambda source, target, env, for_signature: pp_gen(source,\n target,\n env, indent)\n\n # Only handle C for now\n ...
[ "0.5447806", "0.5334655", "0.53087777", "0.5272933", "0.5233033", "0.5232645", "0.5223433", "0.52167517", "0.51575017", "0.51204693", "0.5106351", "0.5089392", "0.5067067", "0.50179625", "0.5016763", "0.5008459", "0.5000109", "0.4993603", "0.49184713", "0.48900786", "0.488370...
0.0
-1
Creates all necessary config files and runs the PU profile production either locally or on the batch system
def create(self): for key in self.dirs.keys(): if type(self.dirs[key]) == dict: for dir_type in self.dirs[key].keys(): create_if_not_exists(self.dirs[key][dir_type]) else: create_if_not_exists(self.dirs[key]) self.inputFileIds...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup_prod():\n setup_general()", "def _create_profile(self, user, profile_dir):\n log.info(\"Writing IPython cluster config files\")\n self._master.ssh.switch_user(user)\n self._master.ssh.execute(\"rm -rf '%s'\" % profile_dir)\n self._master.ssh.execute('ipython profile creat...
[ "0.64221895", "0.63361853", "0.6265294", "0.6218954", "0.62136054", "0.6147979", "0.60554904", "0.5982754", "0.5965599", "0.5902288", "0.58674425", "0.58660775", "0.58589065", "0.57480913", "0.57398623", "0.5737784", "0.5716062", "0.5689755", "0.5683613", "0.5654778", "0.5640...
0.0
-1
Runs all PU profile production jobs either locally or on the batch system.
def run(self): record_software_state(self.sw_ver_file_cfg, self.sw_ver_file_out, DEPENDENCIES) run_cmd( "make -f %s -j %i 2>%s 1>%s" % \ (self.makefile, self.num_parallel_jobs, self.stderr_file_path, self.stdout_file_path), False )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setProfileJobs(self,profile=False):\n self.__profileJobs = profile", "def main():\r\n run_processes('tests.csv', 'labs.csv')", "def uge(jobs, threads, tmp_dir):\n # NOTE: add later for LOCUS cluster \n pass", "def execute_queries():\n fetch_job_listings(engine)\n update_job_listing(engi...
[ "0.56763643", "0.5492459", "0.5365628", "0.5303312", "0.527387", "0.52409613", "0.5233495", "0.5171582", "0.5170588", "0.509297", "0.5087941", "0.506343", "0.50592494", "0.50545895", "0.5050287", "0.5048949", "0.5042769", "0.5041767", "0.5029562", "0.5021479", "0.5016493", ...
0.0
-1
It is using the rockyou.txt wordlist.
def Cracker(): attempts = 0 flag = 0 with open(dictionary_attack, 'r') as attack: print("Cracking password...one sec") print("------------------------------") for line in attack: """ Using a try...exception to keep attempting the different password...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wordLook():\n\tf = open('hangwords.txt', 'r')\n\twordChoice = f.readlines()\n\tword = wordChoice[randint(0, 853)]\n\t# break up word into list format tp serperate the letters \n\twordList = list(word.lower())\n\t# Delete the \\n at end of string\n\twordList.pop()\n\tf.close()\n\treturn wordList", "def readIn...
[ "0.6834276", "0.65550464", "0.63609564", "0.63583994", "0.6347033", "0.6334724", "0.6334724", "0.6334724", "0.6285454", "0.6261804", "0.6253272", "0.6224764", "0.6223897", "0.6214039", "0.62047803", "0.6190961", "0.6157245", "0.6156174", "0.6156174", "0.6156174", "0.6144049",...
0.0
-1
Resets a users money
def main(connection, info, args, world) : money = shelve.open("money-%s.db" % (world.hostnicks[connection.host]), writeback=True) money[info["sender"]] = {"money":100000, "maxmoney":100000, "items":[], "coinchance":[True for x in range(50)] + [False for x in range(50)]} money.sync() connection.ircsend(i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def restock(self):\n self.money = 9999", "def reset(self) -> None:\n self.cash_balance = self.initial_cash_balance()", "def reset(cls):\n GrandChallenge.objects.all().delete()\n GrandChallengeUser.objects.update(lost=0, last_round=0)\n cls.set_current_round(0)", "def resetU...
[ "0.73921984", "0.7201681", "0.6905139", "0.647157", "0.64612216", "0.6437781", "0.64266694", "0.63317424", "0.6175306", "0.6084023", "0.60725236", "0.6004233", "0.5958647", "0.59428465", "0.59289515", "0.5917068", "0.58587295", "0.58580095", "0.5836338", "0.58231485", "0.5819...
0.0
-1
method generate password will random a 10lengthstring with numbers and letters, it will be used in reset_password function.
def generate_password(): chars = string.ascii_letters + string.digits key = random.sample(chars, 10) keys = "".join(key) return keys
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def passwordGen() :\n\treturn __randomString(12)", "def generate_password(cls,password_length):\n alpha = string.ascii_letters + string.digits\n password = ''.join(random.choice(alpha)\n for i in range(password_length))\n return password", "def generate_random():\n characters...
[ "0.8702002", "0.83775306", "0.8356384", "0.83331394", "0.82535976", "0.82404244", "0.8196884", "0.8106833", "0.80893147", "0.8081112", "0.807052", "0.8024292", "0.80168426", "0.7947986", "0.7937298", "0.79362226", "0.7933734", "0.7874081", "0.7840388", "0.78291136", "0.781982...
0.80142766
13
Controller that display the login page.controller that display the imageView page. This controller will assert if user is already logged in or not. If yes, it will redirect to home page. If no, it will show the login page and let user input username and password. Once user submit the username and password, it will go t...
def login(): form = LoginForm() if request.method == "GET": return render_template('login.html', title='Sign In', form=form) if request.method == "POST": if 'loggedin' in session: return redirect(url_for('home')) if form.validate_on_submit(): username = form.u...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def login():\n error = None\n form = Form()\n\n # only support POST\n if request.method == 'POST' :\n username = request.form['username']\n password = request.form['password']\n # if the user is not an administrator\n if username not in app.config['ADMINNAME'] :\n ...
[ "0.72407293", "0.7163812", "0.7079509", "0.6973319", "0.69483155", "0.6907337", "0.68796676", "0.68569803", "0.6856758", "0.6852979", "0.68519974", "0.6842975", "0.6841801", "0.68408155", "0.6840598", "0.6838189", "0.6837958", "0.68257225", "0.68257225", "0.68035054", "0.6783...
0.6956143
4
Controller is allow user to change their password if they have valid username and password. It will generate the new password hash and write into the database. If username not exist, or wrong password, controller will not allow user change password.
def change_my_password(): form = ChangePassword() if request.method == 'GET': return render_template('changemypassword.html', form=form) if request.method == 'POST' and form.validate_on_submit(): username = form.username.data old_password = form.password.data new_password_has...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def changepassword():\n if request.method == \"POST\":\n\n # Ensure password was submitted\n if not request.form.get(\"newpassword\"):\n return apology(\"must provide password\", 400)\n # Ensure passwords match\n elif request.form.get(\"newpassword\") != request.form.get(\...
[ "0.7494749", "0.74338984", "0.7425156", "0.739893", "0.73911446", "0.73620486", "0.73605317", "0.73569167", "0.7258721", "0.72027224", "0.71904075", "0.71764475", "0.7162846", "0.71621287", "0.7122842", "0.71223277", "0.70606965", "0.70595974", "0.70385784", "0.70318645", "0....
0.74420726
1
controller will allow admin user to add new user. It will assert if user want to create a new account. if it is normal user, it will redirect to login page When admin add new user, if same username or email in database, it will refuse to create new user Admin also allow to create another admin by input admin_auth True
def sign_up(): form = RegisterForm() if request.method == "GET": return render_template('adduser.html', title='Add New User', form=form) if request.method == 'POST' and form.validate_on_submit(): username = form.username.data password = form.password1.data email = form.email....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_admin():\n admin_role = Role.query.filter_by(permissions=0xFF).first()\n admin = User.query.filter_by(email=current_app.config['PILI_ADMIN']).first()\n if not admin:\n admin_user = User(\n email=current_app.config['PILI_ADMIN'],\n username=curre...
[ "0.73596287", "0.7236734", "0.71316844", "0.7062781", "0.7057148", "0.7037051", "0.701483", "0.70054984", "0.7004761", "0.69718903", "0.69718903", "0.6883544", "0.68809414", "0.68447465", "0.683513", "0.6813187", "0.6798479", "0.67816705", "0.678062", "0.67375815", "0.6737581...
0.0
-1
Controller that display the reset_password page. Only user_email is needed to be input. Controller will validate the email in database and generate a new password 10lenghtrandom string. Then it will try to send a email with new password to user's mailbox by gmail. Email template is email.txt
def reset_password(): form = ResetPassword() if form.validate_on_submit(): user_email = form.email.data mail_exist = db.check_email(user_email) if mail_exist is not None: new_password = generate_password() new_password_hash = generate_password_hash(new_password) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def password_reset(request):\n\n\tcontext_dict = {}\n\tif request.method == 'POST':\n\t\temail = request.POST.get('email')\n\t\tif email:\n\t\t\tuser = models.Teacher.objects.get(\n\t\t\t\tsoft_delete=False, user__email=email\n\t\t\t)\n\t\t\tif not user:\n\t\t\t\tcontext_dict[\"message\"] = \"Email ID does'nt exis...
[ "0.78898954", "0.7747274", "0.76886064", "0.7638217", "0.7600962", "0.7510319", "0.7439754", "0.7414105", "0.7399373", "0.7390694", "0.73104703", "0.7239809", "0.72272164", "0.71323067", "0.7128626", "0.7115529", "0.7113557", "0.70996207", "0.70738316", "0.70691335", "0.70593...
0.7804686
1
Background Cloud Function to be triggered by Cloud Storage. This generic function logs relevant data when a file is changed.
def hello_gcs_generic(data, context): print('Event ID: {}'.format(context.event_id)) print('Event type: {}'.format(context.event_type)) print('Bucket: {}'.format(data['bucket'])) print('File: {}'.format(data['name'])) print('Metageneration: {}'.format(data['metageneration'])) print('Created: {...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dataprep_job_gcs_trigger(event, context):\n\n head_tail = os.path.split(event['name'])\n newfilename = head_tail[1]\n newfilepath = head_tail[0]\n\n datataprep_auth_token = 'eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbklkIjoiNDZiOWY2YWUtYTg0Zi00ZWQyLTgxNTMtZDA0MjBjNzIyZTk2IiwiaWF0IjoxNjA2MjI1NTU4...
[ "0.60732645", "0.5688646", "0.5619583", "0.551703", "0.53179324", "0.52507126", "0.52309644", "0.5212064", "0.5203661", "0.51629466", "0.5137545", "0.506098", "0.505003", "0.5038273", "0.50262076", "0.5013108", "0.497659", "0.49158835", "0.4913968", "0.487022", "0.485576", ...
0.64327574
0
Test the get_factor_list function and factors generator on a few numbers.
def main(): print("-----------------\n|") print("| codedrome.com |") print("| Factorization |") print("-----------------\n") numbers_to_factorize = [15,19,25,50,77,99] print("factorization.get_factor_list\n-----------------------------") for n in numbers_to_factorize: factors = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_factors():", "def primeFactors(number):\n factorlist=[]\n loop=2\n while loop<=number:\n if number%loop==0:\n number/=loop\n factorlist.append(loop)\n else: \n loop+=1\n return factorlist", "def factor(checknumber):\n if checknumber ...
[ "0.703959", "0.6972541", "0.68969446", "0.6865352", "0.6846568", "0.6835772", "0.679891", "0.67738396", "0.67580175", "0.6727128", "0.6691032", "0.6637499", "0.6631842", "0.6576136", "0.6561167", "0.65292734", "0.6512977", "0.6510949", "0.6502786", "0.64898217", "0.6483006", ...
0.7025335
1
Test the User representation
def test_user(dummy_user_dict): user = User(dummy_user_dict) assert user.username == "dummy" assert user.firstname == "Dummy" assert user.lastname == "User" assert user.name == "Dummy User" assert user.mail == "dummy@example.com" assert user.sshpubkeys == [ 'ssh-rsa AAAAB3NzaC1yc2EAA...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_user_repr(self):\n\n self.assertEqual(repr(\n self.user),\n f\"<User #{self.user.id}: {self.user.username}, {self.user.email}>\")", "def test_repr(self, user_factory):\n user = user_factory.get()\n assert repr(user)", "def test_user_(self):\n obj = Use...
[ "0.79515904", "0.7690611", "0.7423321", "0.7301957", "0.7195864", "0.7107387", "0.7091858", "0.7039989", "0.69948745", "0.6936522", "0.6932685", "0.6869627", "0.6861224", "0.6855034", "0.6830384", "0.68223375", "0.68190086", "0.68132824", "0.68083185", "0.67938954", "0.677384...
0.0
-1
Test that we fallback to gecos if there is no displayname
def test_user_no_displayname(dummy_user_dict): del dummy_user_dict["displayname"] dummy_user_dict["gecos"] = ["GCOS"] user = User(dummy_user_dict) assert user.name == "GCOS"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_user_no_displayname_no_gcos(dummy_user_dict):\n del dummy_user_dict[\"displayname\"]\n del dummy_user_dict[\"gecos\"]\n dummy_user_dict[\"cn\"] = [\"CN\"]\n user = User(dummy_user_dict)\n assert user.name == \"CN\"", "def test_user_no_displayname_no_gcos_no_cn(dummy_user_dict):\n del d...
[ "0.60861444", "0.59474826", "0.5857862", "0.57941484", "0.568906", "0.5602406", "0.5574571", "0.5562333", "0.55328804", "0.5530129", "0.5523503", "0.5471552", "0.5394567", "0.5376542", "0.5328532", "0.5319873", "0.5316677", "0.53014374", "0.52880996", "0.5282158", "0.5272012"...
0.6004263
1
Test that we fallback to cn if there is no displayname nor gcos
def test_user_no_displayname_no_gcos(dummy_user_dict): del dummy_user_dict["displayname"] del dummy_user_dict["gecos"] dummy_user_dict["cn"] = ["CN"] user = User(dummy_user_dict) assert user.name == "CN"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_user_no_displayname_no_gcos_no_cn(dummy_user_dict):\n del dummy_user_dict[\"displayname\"]\n del dummy_user_dict[\"gecos\"]\n del dummy_user_dict[\"cn\"]\n user = User(dummy_user_dict)\n assert user.name is None", "def ValidateDisplayName(display_name):\n if display_name is not None and ...
[ "0.6524058", "0.58852845", "0.5666493", "0.5665791", "0.5654227", "0.54735464", "0.5469024", "0.5469024", "0.5469024", "0.5469024", "0.5469024", "0.54659855", "0.5449569", "0.53934294", "0.5368459", "0.5359428", "0.53472394", "0.533857", "0.533636", "0.5329113", "0.5329113", ...
0.6621293
0
Test that we fallback to cn if there is no displayname nor gcos
def test_user_no_displayname_no_gcos_no_cn(dummy_user_dict): del dummy_user_dict["displayname"] del dummy_user_dict["gecos"] del dummy_user_dict["cn"] user = User(dummy_user_dict) assert user.name is None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_user_no_displayname_no_gcos(dummy_user_dict):\n del dummy_user_dict[\"displayname\"]\n del dummy_user_dict[\"gecos\"]\n dummy_user_dict[\"cn\"] = [\"CN\"]\n user = User(dummy_user_dict)\n assert user.name == \"CN\"", "def ValidateDisplayName(display_name):\n if display_name is not None a...
[ "0.66205984", "0.5885735", "0.5667276", "0.56651855", "0.565568", "0.547335", "0.5470524", "0.5470524", "0.5470524", "0.5470524", "0.5470524", "0.54652536", "0.5450915", "0.5394224", "0.5367775", "0.53575623", "0.5349093", "0.53388125", "0.53359413", "0.53286374", "0.53286374...
0.65224785
1
Returns string rep of cards and points.
def __str__(self): result = ", ".join(map(str, self.hand)) result += "\n " + str(self.get_score()) + " points" return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n result = \", \".join(map(str, self.cards))\n result += \"\\n \" + str(self.getPoints()) + \" points\"\n return result", "def card_format(card):\n pretty_output = '%s pts: %d powers: %s' % (\n card['name'],\n card['points'],\n ', '.join(card['pow...
[ "0.8052197", "0.7843599", "0.75608486", "0.7195491", "0.7145847", "0.6996355", "0.689312", "0.6851904", "0.68335", "0.6830524", "0.68205893", "0.68140316", "0.68140316", "0.6812314", "0.6786759", "0.67648435", "0.67250323", "0.6723363", "0.6705802", "0.6700942", "0.66233397",...
0.71452755
5
Adds a card to the hand
def hit(self, card): self.hand.append(card)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_card(self, card):\r\n self.hand.append(card)", "def add_card(self, card):\n self.hand.append(card)", "def add_card_to_hand(self, card):\n self.hand.append(card)", "def addCardToHand(self, card):\r\n self.hand.append(card)", "def add_card(self, card):\n \n s...
[ "0.92235965", "0.91571176", "0.9029748", "0.9006846", "0.89952105", "0.8847003", "0.87376064", "0.8690727", "0.867158", "0.867158", "0.867158", "0.867158", "0.8659358", "0.8511175", "0.8486982", "0.84682107", "0.84513503", "0.84387046", "0.84120315", "0.84075433", "0.8325754"...
0.8173556
23
Gets the 95th percentile of bleakest_eval from bigtable
def get_95_percentile_bleak(n_back=500): end_game = int(bigtable_input._games_nr.latest_game_number()) start_game = end_game - n_back if end_game >= n_back else 0 moves = bigtable_input._games_nr.bleakest_moves(start_game, end_game) evals = np.array([m[2] for m in moves]) return np.percentile(evals,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ninetieth_percentile(y_test, y_pred) :\n return np.abs(y_test - y_pred).sort_values().iloc[int(len(y_test)*0.90)]/60", "def tenth_percentile(y_test, y_pred) :\n return np.abs(y_test - y_pred).sort_values().iloc[int(len(y_test)*0.10)]/60", "def compute_percentile(value, cutoffs):\n\tif value < cutoffs...
[ "0.66710836", "0.64393985", "0.6213645", "0.61712694", "0.61712694", "0.61691296", "0.6116343", "0.60878766", "0.6070936", "0.6057565", "0.6057565", "0.5990582", "0.5941295", "0.59283644", "0.592614", "0.5912521", "0.5911487", "0.5907796", "0.5905875", "0.5864946", "0.5858764...
0.7476899
0
Updates the flagfile at `flags_path`, changing the value for `resign_threshold` to `new_threshold`
def update_flagfile(flags_path, new_threshold): if abs(new_threshold) > 1: raise ValueError("Invalid new percentile for resign threshold") with tf.gfile.GFile(flags_path) as f: lines = f.read() if new_threshold > 0: new_threshold *= -1 if not RESIGN_FLAG_REGEX.search(lines): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ctrl_update_flags(self, flags, old_dst, old_src, new_val, sub_op):\n of_cond = self.create_overflow_condition(old_dst, old_src, new_val, sub_op)\n cf_cond = self.create_carry_condition(new_val, sub_op)\n\n valid_flags = {'C': cf_cond is True,\n 'Z': new_val & 0xFF == ...
[ "0.5232395", "0.50572014", "0.50224495", "0.5003035", "0.4994549", "0.4984667", "0.4941392", "0.48769605", "0.48551136", "0.48338896", "0.48318133", "0.48245242", "0.4822055", "0.48098576", "0.47942355", "0.47704318", "0.47618973", "0.47563523", "0.46765515", "0.46269655", "0...
0.8416566
0
Computes the ECoG and LogMel features using the node based approach
def process_samples_in_network(eeg_sender, aud_sender): eeg_sender.start_processing() aud_sender.start_processing() eeg_sender.wait_for_completion() aud_sender.wait_for_completion()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_edge_logits(self):", "def oim_node2vec_simple(\n df,\n df_feats,\n num_inf=10,\n sigma=4,\n c=0.1,\n epsilon=0.4,\n num_repeats=15,\n num_nodes_tim=-1,\n oracle=tim,\n):\n logger_tlu.debug(\"Started Online Influence Maximization...\")\n logger_tlu.debug(\"Setting para...
[ "0.69294053", "0.640816", "0.63328874", "0.61410093", "0.59339976", "0.59324694", "0.58759594", "0.56673706", "0.56521505", "0.5586912", "0.5525346", "0.5521616", "0.5515864", "0.54978675", "0.5486891", "0.54676926", "0.5465755", "0.5462669", "0.5453462", "0.5435142", "0.5435...
0.0
-1
Quantize the logMel spectrogram
def quantization(y_train, nb_intervals=8): medians, borders = compute_borders_logistic(y_train, nb_intervals=nb_intervals) q_spectrogram = quantize_spectrogram(y_train, borders) # print if a spec bin does not contain samples for a interval for i in range(q_spectrogram.shape[1]): diff = np.setdi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def logMelSpectrum(input, samplingrate):\n nfft = input.shape[1]\n N = input.shape[0]\n filters = trfbank(samplingrate, nfft)\n\n # plot Mel filters\n # plt.plot(filters)\n # plt.title('Mel filters')\n # plt.show()\n\n output = np.zeros((N, filters.shape[0]))\n for j in range(filters.sha...
[ "0.66098535", "0.6471548", "0.64676857", "0.6452054", "0.6379143", "0.632268", "0.6276635", "0.61318606", "0.6046939", "0.59697205", "0.59609795", "0.5929711", "0.5924377", "0.5875029", "0.58118653", "0.5702972", "0.5665661", "0.5663589", "0.5662051", "0.56480634", "0.5626356...
0.5391006
38
Feature selection using correlation
def feature_selection(x_train, y_train, nb_feats=150): cs = np.zeros(x_train.shape[1]) for f in range(x_train.shape[1]): if np.isclose(np.sum(x_train[:, f]), 0): cs[f] = 0 continue cs[f], p = spearmanr(x_train[:, f], np.mean(y_train, axis=1)) select = np.argsort(np.a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generalization_feature_selection(data1, data2, measure, cutoff):\n cor1 = np.corrcoef(np.transpose(data1))\n cor2 = np.corrcoef(np.transpose(data2))\n num = data1.shape[1]\n cor = []\n if measure == \"pearson\":\n for i in range(num):\n cor.append(\n np.corrcoef(...
[ "0.6930643", "0.6642151", "0.62758756", "0.62408143", "0.6170777", "0.60826904", "0.6075859", "0.59910333", "0.5918928", "0.5788273", "0.57319486", "0.56863666", "0.5685446", "0.56469935", "0.5640251", "0.5636059", "0.5634328", "0.5627078", "0.559742", "0.55720925", "0.555830...
0.6185378
4
Read request json and insert new document to database
def new_task(): req = request.json if 'cmd' in req: id = mongo.db.tasks.insert({ 'cmd' : req['cmd'], 'status' : 'Not started' }) response = {'id' : str(id)} return response
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def insert(self, json_data, batch=None):\n headers = {'Content-type': 'application/json;charset=UTF-8'}\n url = '/'.join([self.url, self.db])\n time.sleep(0.01)\n if batch:\n r = requests.post(url, data=json_data, headers=headers, params={'batch': 'ok'})\n else:\n ...
[ "0.663723", "0.64532554", "0.6417484", "0.6410213", "0.62717915", "0.6270713", "0.60922325", "0.60644907", "0.6027384", "0.6024583", "0.6014512", "0.5956746", "0.59502256", "0.5894841", "0.58940625", "0.5878701", "0.5877066", "0.58714324", "0.5833495", "0.58303416", "0.582287...
0.0
-1
Authenticate with SoundCloud API. Cache access token in the secrets file.
def init_api(): global soundcloud import json SECRETS_VERSION = 1 # Load secrets file if os.path.exists(config.token_cache): with open(config.token_cache, 'r', encoding='utf-8') as f: secrets = json.load(f) else: secrets = {} # Try to reuse the ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def authenticate(self):\n try:\n self._token = self._lookup_token()\n except:\n raise HTTPError(\n \"Unable to get short-lived access token for cyberark storage\"\n )", "def authenticate():\n\n # We are uploading and then downloading so we want Mus...
[ "0.69103223", "0.6770919", "0.65899146", "0.6582983", "0.6582983", "0.6426025", "0.64257234", "0.6412163", "0.63717526", "0.63108236", "0.62029386", "0.61904144", "0.6170871", "0.61696583", "0.6121056", "0.6096839", "0.60418415", "0.60281444", "0.60094726", "0.6006562", "0.59...
0.7882311
0
Download all comments and process them.
def check_comments(): # Get the id of the group track try: group_track = soundcloud.get('/me/tracks')[config.post_track_id] except HTTPError as e: if e.response.status_code == 404: logging.critical('Cannot find a track with id %d. Please, fix post_track_id in config.py', config....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def scrape_comments(self):\n\n subreddit_origin = await self.reddit.subreddit(self.subreddit)\n\n comment_count = 0\n async for comment in subreddit_origin.comments(limit=self.limit):\n if self.memory.contains(comment.id):\n continue\n\n self.memory.a...
[ "0.6779644", "0.66394675", "0.6427598", "0.64182293", "0.6320244", "0.6237442", "0.62035054", "0.61649585", "0.6117603", "0.6090609", "0.6056547", "0.60366106", "0.5942748", "0.5935219", "0.5929784", "0.5907459", "0.5881992", "0.5849938", "0.583109", "0.5825741", "0.58220106"...
0.57731366
24
Process a single comment.
def process_comment(comment): if not comment.body: logging.info('Empty URL detected.') return 'Your comment is empty.' if comment.user_id in banlist['user']: logging.info('Banned user id: %d', comment.user_id) return 'You are banned from this group.' url = comment.body...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def on_comment(self, comment: \"steam.Comment\") -> None:", "def process_comment(request, comment, post):\n\n if request.user.is_authenticated:\n # We already set auth user's name and email in the form's inital vals.\n comment.author = request.user\n\n # Is this a threaded comment?\n ...
[ "0.6974962", "0.66614866", "0.65903527", "0.656829", "0.6512984", "0.64646447", "0.6441458", "0.6408423", "0.6407087", "0.6393681", "0.6383609", "0.6378282", "0.6377732", "0.63763547", "0.63294196", "0.6302664", "0.6253801", "0.6238128", "0.62186253", "0.6209462", "0.6196395"...
0.6097347
28
Return the resource object downloaded from url, or None, if not found.
def resolve_resource(url): try: resource = soundcloud.get('/resolve', url=url) except HTTPError as e: if e.response.status_code == 404: return None else: raise return resource
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getOrDownloadImageObject(self, url):\n \n if \"//\" in url:\n return self.downloadImage(url)\n else:\n return self.getPILFromPath(url)", "def getResource(self, url):\n\n res = self.getRequest(url)\n return self._instantiateResource(res)", "def simple...
[ "0.71216214", "0.7097891", "0.6547342", "0.652132", "0.65123105", "0.649038", "0.6472436", "0.64343745", "0.6421306", "0.6407448", "0.63858765", "0.6357612", "0.6354004", "0.6322385", "0.63123137", "0.631167", "0.63004375", "0.62966675", "0.6294705", "0.6293683", "0.628912", ...
0.67835706
2
Return true if the respost exists, according to soundcloud. Also update the database if a repost is already deleted on soundcloud, but is not marked as deleted in the db.
def check_repost_exists(type, id): try: soundcloud.get('/e1/me/{}_reposts/{}'.format(type, id)) return True except HTTPError as e: if e.response.status_code == 404: db.mark_as_deleted(type, id) return False else: raise
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exists(self):\r\n try:\r\n self.refresh()\r\n except:\r\n return False\r\n return True", "def is_new_post(self, post):\n return self.last_post != post['id']", "def check_repost(post, user):\n if not user.is_authenticated():\n return 'not_auth' # ...
[ "0.6219022", "0.59738153", "0.59722084", "0.59081906", "0.5828247", "0.5757684", "0.5751083", "0.5581836", "0.556682", "0.556317", "0.55112916", "0.5496816", "0.54759526", "0.54759526", "0.54688525", "0.54517484", "0.5447654", "0.54395247", "0.5435582", "0.5389179", "0.536449...
0.7226926
0
Repost a resource into the group and update the database.
def group_repost(user_id, resource_type, resource_id): logging.info('Reposting %s %d...', resource_type, resource_id) soundcloud.put('/e1/me/{}_reposts/{}'.format(resource_type, resource_id)) db.record_repost(user_id, resource_type, resource_id) db.commit()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def on_post_resource(self, req, resp, *args, **params):\n instance = self.get_object(**params)\n self.save_object(req.params, req, resp, instance, **params)", "def post_security_group_update(self, resource_id, resource_dict):\n pass", "def _resubmit(self, *args, **kwargs):\n self.re...
[ "0.6204693", "0.6052708", "0.59446126", "0.59445024", "0.5799984", "0.57475936", "0.57475936", "0.57396287", "0.5733804", "0.5732188", "0.5626466", "0.5625362", "0.5611247", "0.5603161", "0.55945265", "0.55783963", "0.55557644", "0.552884", "0.54994965", "0.5487721", "0.54834...
0.70165044
0
Delete a resource from the group and update the database.
def group_delete(user_id, resource_type, resource_id): logging.info('Deleting %s %d...', resource_type, resource_id) soundcloud.delete('/e1/me/{}_reposts/{}'.format(resource_type, resource_id)) db.record_deletion(user_id, resource_type, resource_id) db.commit()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete(self):\n import labstep.entities.resource.repository as resourceRepository\n\n return resourceRepository.editResource(self, deleted_at=getTime())", "def test_delete_resource_group(self):\n pass", "def delete(openstack_resource):\n openstack_resource.delete()", "def delete()...
[ "0.7100132", "0.7027492", "0.6920822", "0.6880339", "0.6865927", "0.67449135", "0.6699044", "0.6655716", "0.6652711", "0.66081554", "0.6541622", "0.6539928", "0.6534143", "0.65040797", "0.6388483", "0.6388483", "0.6388483", "0.6388483", "0.6381689", "0.6329746", "0.6328542", ...
0.72901237
0
Set a flag to update the description once all comments are processed.
def request_description_update(): global should_update_description should_update_description = True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_description_debounced(self, value):\n self.update_description(value)", "def set_description(desc):\n global last_description\n last_description = desc", "def set_description(self, description):\r\n self.__description = description", "def description(self, new_description):\r\n ...
[ "0.67883927", "0.6781191", "0.6655528", "0.66096985", "0.65891665", "0.65389127", "0.6520836", "0.64286363", "0.6415596", "0.641495", "0.641495", "0.641495", "0.641495", "0.6397862", "0.63956046", "0.63900524", "0.6380967", "0.6380967", "0.6380967", "0.6380967", "0.6380967", ...
0.75725305
0
`dict` group configurations keyed by name
def groups(self): group_config = {} # legacy way of threating any dict as a potential # group config (pre #44 implementation) # supported until vaping 2.0 for k,v in list(self.config.items()): if isinstance(v, collections.Mapping): group_config[k] =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _init_group_dicts(self):\n\n all_groups = set()\n\n for detection in config['detections'].values():\n if 'action' in detection and detection['action'] == 'buy':\n if 'groups' in detection:\n for group in detection['groups']:\n al...
[ "0.64101", "0.6327717", "0.63224345", "0.61177534", "0.61143225", "0.6107522", "0.6007326", "0.58925676", "0.58895403", "0.5835795", "0.582298", "0.580441", "0.5785304", "0.56956583", "0.5687126", "0.5680097", "0.5602832", "0.5600695", "0.55983984", "0.5597506", "0.5594908", ...
0.7403048
0
called after the plugin is initialized, plugin may define this for any other initialization code
def init(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def post_init(self):\n\t\tpass", "def _post_init(self):\n pass", "def _post_init(self) -> None:\n return", "def _afterInit(self):\n pass", "def afterInit(self):", "def onInit(self):\n pass", "def on_initialize(self) -> None:\n pass", "def __post_init__(self):\n ...
[ "0.84909236", "0.84457034", "0.83216816", "0.82965696", "0.8194919", "0.7797776", "0.7785666", "0.7659198", "0.7609315", "0.7564114", "0.7499486", "0.74864465", "0.74864465", "0.74864465", "0.74864465", "0.74272984", "0.7402341", "0.7402341", "0.7402341", "0.740215", "0.74021...
0.73226565
34
called when the daemon is starting
def on_start(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start_daemon(self, *args, **kwargs):\n pass", "def on_startup(self) -> None:\n ...", "def on_start(self):\n self.init()", "def startup(self):\n pass", "def on_start(self):", "def on_start(self):", "def on_start(self):\n self.logger.debug(\"Starting...\")\n ...
[ "0.79909825", "0.7517012", "0.7501388", "0.74953675", "0.74834365", "0.74834365", "0.74735236", "0.74392337", "0.74030036", "0.73678744", "0.7339647", "0.7339647", "0.7339647", "0.7339647", "0.73268515", "0.73186666", "0.7309111", "0.7309111", "0.7270445", "0.7270445", "0.727...
0.7919895
8
called when the daemon is stopping
def on_stop(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def daemonControlStop (self):\n self.stop()", "def stop(self):\n # print \"process shutdown complete\"", "def on_stop(self):\n self.logger.debug(\"Stopping...\")\n pass", "def stop(self):\n self.killed = True", "def post_stop(self):", "def stop(self):\n self.on_s...
[ "0.77847", "0.77806365", "0.77489215", "0.7462249", "0.7445942", "0.72749454", "0.72555697", "0.7228932", "0.72287154", "0.7203728", "0.7196477", "0.71875995", "0.71875995", "0.71875995", "0.71875995", "0.7183767", "0.715388", "0.7148807", "0.7127648", "0.7103715", "0.7103715...
0.7834218
5
creates and returns new message `dict`, setting `type`, `source`, `ts`, `data` `data` is initialized to an empty array Returns message (`dict`)
def new_message(self): msg = {} msg['data'] = [] msg['type'] = self.plugin_type msg['source'] = self.name msg['ts'] = (datetime.datetime.utcnow() - datetime.datetime(1970, 1, 1)).total_seconds() return msg
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, msg: dict):\n\n for key, value in msg.items():\n setattr(self, key, value)\n self.data = msg\n self.dt = datetime.fromisoformat(self.timestamp)", "def transformMessage(self):\n\n message = json.loads(self.message)\n\n call_data = {\n 'ca...
[ "0.657394", "0.64370185", "0.6369165", "0.6215842", "0.6215842", "0.6197032", "0.61927515", "0.6148582", "0.6145553", "0.61364484", "0.60306203", "0.5966783", "0.5927442", "0.58727574", "0.5813844", "0.5785403", "0.57741964", "0.57672644", "0.57665217", "0.57646066", "0.57078...
0.74926597
0
creates a subprocess with passed args Returns Popen instance
def popen(self, args, **kwargs): self.log.debug("popen %s", ' '.join(args)) return vaping.io.subprocess.Popen(args, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_process(self, args=[], *popenargs, **kwargs):\n try:\n startupinfo = subprocess.STARTUPINFO()\n startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW\n kwargs.setdefault('startupinfo', startupinfo)\n except:\n pass\n kwargs.setdefault('un...
[ "0.76723176", "0.7587004", "0.73669636", "0.72725964", "0.72679687", "0.70070004", "0.69992423", "0.69684494", "0.6902572", "0.6820378", "0.67948174", "0.67915964", "0.678975", "0.678923", "0.67641646", "0.66676784", "0.66353923", "0.65361035", "0.65184724", "0.6518346", "0.6...
0.80149055
0
logger instance for plugin type
def log(self): if not self._logger: self._logger = logging.getLogger('vaping.plugins.' + self.plugin_type) return self._logger
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_logger(self):", "def logger(self):\n pass", "def __init__(self):\n self.logger = logger()", "def __init__(self):\n\n self.log = logger.getLogger(name=\"directord\")", "def __init__(self):\n self.logger = logging.getLogger(FeatureEngineeringLogger.__name__)", "def buil...
[ "0.73108566", "0.71119756", "0.68729246", "0.68288493", "0.6814063", "0.6643799", "0.6631724", "0.6627801", "0.66231793", "0.65565336", "0.6532955", "0.6517596", "0.6504724", "0.64651346", "0.6436994", "0.63748336", "0.6320188", "0.6318142", "0.63155955", "0.630599", "0.62634...
0.7757826
0
probe for data, return a list of dicts
def probe(self):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_probe(self, data):\n return data", "def test_filter_data_by_race():\n data = race.filter_data_by_race(random.randint(1, 3))\n assert len(data) == 11\n assert type(data) == list\n for datum in data:\n assert type(datum) == dict", "def get_probes(self):\n # TODO: migh...
[ "0.63994026", "0.5943428", "0.59410197", "0.58673334", "0.58166456", "0.57313424", "0.56774724", "0.5671168", "0.5661481", "0.56516075", "0.563256", "0.5623005", "0.5604365", "0.56027234", "0.55742323", "0.5564951", "0.5555628", "0.55529463", "0.55346656", "0.5527231", "0.552...
0.0
-1
queue an emission of a message for all output plugins Arguments
def queue_emission(self, msg): if not msg: return for _emitter in self._emit: if not hasattr(_emitter, 'emit'): continue def emit(emitter=_emitter): self.log.debug("emit to {}".format(emitter.name)) emitter.emit(msg) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def output_function(**kwargs):\n\n\t\toutput_queue = kwargs['q']\n\t\twhile True:\n\t\t\titem = output_queue.get()\n\t\t\t# expects to get a string or None\n\t\t\tif item is None:\n\t\t\t\tbreak\n\t\t\toutfile.write(item)\n\t\t\t# outfile.write(\"output_function:: {item}\".format(item=item)+\"\\n\")\n\t\t\toutput_...
[ "0.60872614", "0.5945144", "0.59260297", "0.59092003", "0.58465993", "0.5714343", "0.5665754", "0.56151253", "0.5593914", "0.5585872", "0.5585872", "0.5585872", "0.5585872", "0.5585872", "0.5585872", "0.5554473", "0.5533875", "0.549778", "0.54847586", "0.5459334", "0.54484266...
0.62826663
0
emit and remove the first emission in the queue
def send_emission(self): if self._emit_queue.empty(): return emit = self._emit_queue.get() emit()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_first(self):\n self.deque.pop(0)", "def dequeue(self):\r\n return self.queue.pop(0)", "def pop(self):\r\n return self.queue.pop(0)", "def dequeue(self):\n return self.queue.pop(0)", "def queue_emission(self, msg):\n if not msg:\n return\n for ...
[ "0.65136707", "0.61705273", "0.6156415", "0.6083466", "0.60746723", "0.60541797", "0.60505503", "0.59951586", "0.5936325", "0.5912753", "0.5911044", "0.58870256", "0.5882075", "0.5882075", "0.58683664", "0.58458984", "0.5829686", "0.58193946", "0.5809367", "0.5806965", "0.579...
0.6335579
1
emit and remove all emissions in the queue
def emit_all(self): while not self._emit_queue.empty(): self.send_emission()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send_emission(self):\n if self._emit_queue.empty():\n return\n emit = self._emit_queue.get()\n emit()", "def queue_emission(self, msg):\n if not msg:\n return\n for _emitter in self._emit:\n if not hasattr(_emitter, 'emit'):\n ...
[ "0.6907306", "0.6813454", "0.6777606", "0.65254974", "0.6431948", "0.63691956", "0.63535166", "0.63029647", "0.62848836", "0.6125597", "0.6116918", "0.6115065", "0.6113113", "0.60741436", "0.60656524", "0.60627425", "0.60400844", "0.60000175", "0.59864897", "0.5860363", "0.58...
0.7361969
0
Here we validate that our filehandler is pointing to an existing file. If it doesnt, because file has been deleted, we close the filehander and try to reopen
def validate_file_handler(self): if self.fh.closed: try: self.fh = open(self.path, "r") self.fh.seek(0, 2) except OSError as err: logging.error("Could not reopen file: {}".format(err)) return False open_stat = os.fs...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_file_deleted(self):\n try:\n with get_temp_file() as (fd, name):\n os.unlink(name)\n except Exception as err:\n self.fail('Failed with exception \"{}\"'.format(err))", "def close(self) -> None:\n if self.file_handler:\n self.file_handl...
[ "0.6699122", "0.65485364", "0.63995856", "0.6399519", "0.6396869", "0.6383093", "0.6045455", "0.6025384", "0.5983456", "0.59830105", "0.597813", "0.5963656", "0.5961477", "0.5950006", "0.59438777", "0.5907139", "0.5896517", "0.58615994", "0.58526576", "0.5834653", "0.5818726"...
0.7340528
0
Probe the file for new lines
def probe(self): # make sure the filehandler is still valid # (e.g. file stat hasnt changed, file exists etc.) if not self.validate_file_handler(): return [] messages = [] # read any new lines and push them onto the stack for line in self.fh.readlines(self....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _read_new_entries(self, is_first_read: bool) -> bool:\n new_text = self.watched_file.read()\n if new_text:\n for entry_txt in new_text.split(\"\\n\"):\n if entry_txt:\n self._register_entry(entry_txt, is_first_read)\n return len(new_text) > 0", ...
[ "0.6246938", "0.60696304", "0.5876231", "0.58509076", "0.5824451", "0.5823023", "0.5805173", "0.57212514", "0.56540644", "0.56540644", "0.56540644", "0.5620011", "0.55925226", "0.5588565", "0.5586472", "0.5577784", "0.553996", "0.55066544", "0.54869", "0.54790664", "0.5477127...
0.0
-1
override this parse your line in here
def process_line(self, line, data): return data
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_line(self, line):\n raise NotImplementedError", "def parse(cls, line):\r\n raise NotImplementedError", "def GetLine(line):\r\n pass", "def parse_line(self, line):\n success = self.parser.handle_line(line)\n if success:\n self.data.update()\n else:\n ...
[ "0.8493632", "0.8225819", "0.7113465", "0.71066386", "0.7087022", "0.7063323", "0.7063323", "0.7063323", "0.7063323", "0.6899121", "0.6827371", "0.67983323", "0.678903", "0.6783502", "0.6744767", "0.6744097", "0.6684954", "0.66538346", "0.66177577", "0.6616062", "0.6613781", ...
0.667798
17
override this assign your data values here
def process_probe(self, data): return data
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prepare_data(self):", "def set_data(self,pdata):\n self.uid.data=pdata[0]\n self.pid.data=pdata[1]\n self.pName.data=pdata[2]\n self.pAge.data=pdata[3]\n self.dateOfSubmission.data=pdata[4]\n self.bedType.data=pdata[5]\n self.address.data=pdata[6]\n self.city.data=pdat...
[ "0.7238018", "0.7179395", "0.704118", "0.69226533", "0.69226533", "0.69226533", "0.69226533", "0.69226533", "0.69226533", "0.69090044", "0.68552804", "0.6682214", "0.6632668", "0.6588807", "0.6559072", "0.6541175", "0.6524317", "0.6524317", "0.6521918", "0.6521267", "0.651493...
0.0
-1
override this process your messages before they are emitted
def process_messages(self, messages): return messages
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_messages(self):\n pass", "def processMessage(self, *args, **kwargs):\r\n pass", "def process(self, msg):\n raise NotImplemented", "def process_message(self, msg, src):", "def process(self, message: Message, **kwargs: Any) -> None:", "def _process_message(self, obj):\n ...
[ "0.8171031", "0.71616423", "0.68424076", "0.68169177", "0.664427", "0.6618118", "0.63978595", "0.6369468", "0.636946", "0.63653046", "0.63645893", "0.63637257", "0.6348036", "0.6342352", "0.6342352", "0.6342352", "0.6342352", "0.6342352", "0.63387644", "0.63275695", "0.628734...
0.6300006
20
accept message to emit
def emit(self, message):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def emit(data):", "def receive(self, message):", "def receive(self):\n pass", "def receive(self, msg):\n pass", "def handle_accept(self):\r\n pass", "def handle(self, message):", "def accept(self, event):\n raise NotImplementedError()", "def receive():\n pass", "def a...
[ "0.699732", "0.6608894", "0.65500426", "0.65143687", "0.64708894", "0.6423427", "0.63328993", "0.6292642", "0.62430483", "0.62041724", "0.61830676", "0.6182339", "0.61788404", "0.61708754", "0.609756", "0.6090819", "0.60893077", "0.6083992", "0.6030369", "0.60288525", "0.6024...
0.8129066
0
Retrieve data from database for the specified timespan Arguments
def get(self, filename, from_time, to_time): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_data(self, date_time):\n\n query = \"Select * from {table} where START_DATE <= '{datetime}' and END_DATE > '{datetime}'\"\n query = query.format(table=self.table_name, datetime=date_time)\n return pd.read_sql_query(query, con=self.con)", "def fetch(self, daterange=(datetime.now() - t...
[ "0.6213023", "0.60430384", "0.58557695", "0.58457077", "0.58383864", "0.58372915", "0.57556546", "0.5697501", "0.56806695", "0.5676344", "0.5605263", "0.5581504", "0.55401444", "0.5477721", "0.546725", "0.544497", "0.5397564", "0.53795695", "0.5374434", "0.5371448", "0.536751...
0.0
-1
Returns a dict containing the various filename formatter values Values are gotten from the vaping data message as well as the currently processed row in the message Arguments
def filename_formatters(self, data, row): r = { "source" : data.get("source"), "field" : self.field, "type" : data.get("type") } r.update(**row) return r
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filenames(self) -> dict[str, str]:\r\n ...", "def map_file_format_info(file_format_event, file_validation_event):\n event_info = {}\n if not file_format_event:\n return\n try:\n event_info.update(\n {\n \"dct:FileFormat\": file_format_event.event_outcom...
[ "0.5899487", "0.586862", "0.58116794", "0.5770152", "0.575695", "0.55263674", "0.5516201", "0.5448604", "0.5429166", "0.5357836", "0.5328083", "0.53153014", "0.5263745", "0.51659256", "0.50826246", "0.50714976", "0.5064152", "0.5055028", "0.5017024", "0.50022215", "0.49784836...
0.6851664
0
Returns a formatted filename using the template stored in self.filename Arguments
def format_filename(self, data, row): return self.filename.format(**self.filename_formatters(data, row))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_template_filename(self):\n file_name = ReportMeta.reports[self._report_key]['fileName']\n return '{}.html'.format(file_name)", "def get_filename(self, path, params, type_=None):\n phase = self.phase\n\n if type_:\n phase += ('_' + type_)\n\n filename = self....
[ "0.7372324", "0.72205263", "0.7211966", "0.71357596", "0.7116954", "0.70353585", "0.70277053", "0.69741374", "0.69528997", "0.6951184", "0.6936264", "0.6915955", "0.6906335", "0.6891999", "0.68614364", "0.68525696", "0.67716825", "0.67658573", "0.67550075", "0.6733696", "0.67...
0.71709263
3
emit to database Arguments
def emit(self, message): # handle vaping data that arrives in a list if isinstance(message.get("data"), list): for row in message.get("data"): # format filename from data filename = self.format_filename(message, row) # create database file i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def store(self, args):\n pass", "def arguments(self, args=[]):\n if args is None:\n args = []\n\n if not isinstance(args, (list, tuple)):\n args = (args,)\n\n serialize_me = []\n\n for arg in args:\n if isinstance(arg, str):\n ser...
[ "0.6279976", "0.6269384", "0.61981845", "0.6067288", "0.6063195", "0.6063195", "0.60132235", "0.59703344", "0.59321475", "0.5922707", "0.5851861", "0.58408135", "0.58350396", "0.5831378", "0.5798007", "0.5798007", "0.5798007", "0.5798007", "0.5798007", "0.5798007", "0.5798007...
0.50709915
95
Label the provided ICA components with the ICLabel neural network. ICLabel is designed to classify ICs fitted with an extended infomax ICA decomposition algorithm on EEG datasets referenced to a common average and filtered between [1., 100.] Hz. It is possible to run ICLabel on datasets that do not meet those specifica...
def iclabel_label_components( inst: Union[BaseRaw, BaseEpochs], ica: ICA, inplace: bool = True, backend: Optional[str] = None, ): features = get_iclabel_features(inst, ica) labels_pred_proba = run_iclabel(*features, backend=backend) # type: ignore if inplace: from mne_icalabel.conf...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _run_iclabel(images: ArrayLike, psds: ArrayLike, autocorr: ArrayLike) -> NDArray:\n # load weights\n network_file = files(\"mne_icalabel.iclabel.network\") / \"assets\" / \"ICLabelNet.pt\"\n iclabel_net = ICLabelNet()\n iclabel_net.load_state_dict(torch.load(network_file))\n # format inputs and ...
[ "0.62045825", "0.6137364", "0.60607266", "0.5875136", "0.5775551", "0.5774383", "0.5720462", "0.567829", "0.5673847", "0.5587884", "0.55063105", "0.5473702", "0.54581785", "0.5449399", "0.5438388", "0.542551", "0.54028636", "0.53972393", "0.53966945", "0.5395051", "0.53771865...
0.72729254
0
Test if path is correctly recognized as hidden.
def test_is_hidden(self) -> None: path = ".ssh" result = is_hidden(path) self.assertTrue(result)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_hidden(self, path):\n return False", "def _isPathHidden(self, path: Path) -> bool:\n if os.name == 'nt': # on Windows, check Windows flags of the path\n try:\n fileAttrs = win32api.GetFileAttributes(str(path))\n return fileAttrs & (win32con.FILE_ATTR...
[ "0.84205025", "0.82524675", "0.81401277", "0.81144416", "0.8036295", "0.8022735", "0.782395", "0.77693754", "0.7579151", "0.7236301", "0.7209537", "0.7102225", "0.7102225", "0.69383043", "0.69339067", "0.68456364", "0.67016643", "0.66835296", "0.6679522", "0.65641534", "0.636...
0.8092079
4
Test if path is correctly recognized as not hidden.
def test_is_not_hidden(self) -> None: path = "home" result = is_hidden(path) self.assertFalse(result)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_hidden(self, path):\n return False", "def _isPathHidden(self, path: Path) -> bool:\n if os.name == 'nt': # on Windows, check Windows flags of the path\n try:\n fileAttrs = win32api.GetFileAttributes(str(path))\n return fileAttrs & (win32con.FILE_ATTR...
[ "0.82105416", "0.8147075", "0.8074287", "0.79748076", "0.79527706", "0.78247166", "0.7760722", "0.76462585", "0.7565071", "0.70671797", "0.70537364", "0.6908462", "0.6908462", "0.6827894", "0.66952556", "0.6647296", "0.65984875", "0.65974015", "0.6504221", "0.64817345", "0.64...
0.82911503
0
Test getting dataset path.
def test_get_dataset_path(self) -> None: framework = "tensorflow" domain = "image_recognition" result = get_dataset_path(framework, domain) self.assertEqual(result, "examples/test/dataset/imagenet")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_make_dataset_happy_path(self):\n # User story: user runs src.make_dataset() on the current directory\n # and gets a fully functional dataset\n pass", "def test_data_path(self):\n path = self._api.GetDatapath()\n self._api.End()\n self.assertRaises(\n ...
[ "0.75778013", "0.75268173", "0.7313395", "0.70568323", "0.6979461", "0.69666904", "0.69261616", "0.6925592", "0.6921823", "0.69095963", "0.679207", "0.6753882", "0.6716215", "0.67095876", "0.6703324", "0.6695395", "0.6667533", "0.66508496", "0.6650378", "0.66204023", "0.66069...
0.82967913
0
Test getting dataset path failure.
def test_get_dataset_path_unknown_framework(self) -> None: framework = "unknown" domain = "image_recognition" with self.assertRaises(Exception): get_dataset_path(framework, domain)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_data_path(self):\n path = self._api.GetDatapath()\n self._api.End()\n self.assertRaises(\n RuntimeError, self._api.Init, path=(self._test_dir + os.path.sep)\n ) # no tessdata\n if _TESSERACT_VERSION >= 0x3999800:\n new_path = path\n else:\n ...
[ "0.74248797", "0.7332925", "0.71991664", "0.71628946", "0.68198264", "0.6784641", "0.66754675", "0.6576848", "0.6568233", "0.65432364", "0.6533707", "0.6523117", "0.65167046", "0.6403536", "0.63809836", "0.6379454", "0.6332501", "0.6325068", "0.63231117", "0.6315364", "0.6292...
0.7049641
4
Test getting dataset path failure.
def test_get_dataset_path_unknown_domain(self) -> None: framework = "tensorflow" domain = "domain" with self.assertRaises(Exception): get_dataset_path(framework, domain)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_data_path(self):\n path = self._api.GetDatapath()\n self._api.End()\n self.assertRaises(\n RuntimeError, self._api.Init, path=(self._test_dir + os.path.sep)\n ) # no tessdata\n if _TESSERACT_VERSION >= 0x3999800:\n new_path = path\n else:\n ...
[ "0.74248797", "0.71991664", "0.71628946", "0.7049641", "0.68198264", "0.6784641", "0.66754675", "0.6576848", "0.6568233", "0.65432364", "0.6533707", "0.6523117", "0.65167046", "0.6403536", "0.63809836", "0.6379454", "0.6332501", "0.6325068", "0.63231117", "0.6315364", "0.6292...
0.7332925
1
Test getting framework name from path.
def test_get_tensorflow_framework_from_path(self, mocked_get_model_type: MagicMock) -> None: mocked_get_model_type.return_value = "frozen_pb" path = "/home/user/model.pb" result = get_framework_from_path(path) self.assertEqual(result, "tensorflow") mocked_get_model_type.assert_ca...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_onnx_framework_from_path(self) -> None:\n path = \"/home/user/model.onnx\"\n result = get_framework_from_path(path)\n self.assertEqual(result, \"onnxrt\")", "def test_get_unknown_framework_from_path(self) -> None:\n path = \"/home/user/model.some_extension\"\n resu...
[ "0.7172764", "0.7062699", "0.69441956", "0.64345545", "0.64053917", "0.6366199", "0.6274874", "0.6201753", "0.6191427", "0.60973287", "0.6045537", "0.59635186", "0.5961694", "0.5953851", "0.5943369", "0.58846164", "0.58798844", "0.5822605", "0.5822605", "0.5822379", "0.577057...
0.5800866
20
Test getting framework name from path.
def test_get_onnx_framework_from_path(self) -> None: path = "/home/user/model.onnx" result = get_framework_from_path(path) self.assertEqual(result, "onnxrt")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_unknown_framework_from_path(self) -> None:\n path = \"/home/user/model.some_extension\"\n result = get_framework_from_path(path)\n self.assertIsNone(result)", "def infoForFramework(filename):\n global FRAMEWORK_RE\n if FRAMEWORK_RE is None:\n import re\n FRAM...
[ "0.7062699", "0.69441956", "0.64345545", "0.64053917", "0.6366199", "0.6274874", "0.6201753", "0.6191427", "0.60973287", "0.6045537", "0.59635186", "0.5961694", "0.5953851", "0.5943369", "0.58846164", "0.58798844", "0.5822605", "0.5822605", "0.5822379", "0.5800866", "0.577057...
0.7172764
0
Test getting framework name from path.
def test_get_unknown_framework_from_path(self) -> None: path = "/home/user/model.some_extension" result = get_framework_from_path(path) self.assertIsNone(result)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_onnx_framework_from_path(self) -> None:\n path = \"/home/user/model.onnx\"\n result = get_framework_from_path(path)\n self.assertEqual(result, \"onnxrt\")", "def infoForFramework(filename):\n global FRAMEWORK_RE\n if FRAMEWORK_RE is None:\n import re\n FRAMEW...
[ "0.7172764", "0.69441956", "0.64345545", "0.64053917", "0.6366199", "0.6274874", "0.6201753", "0.6191427", "0.60973287", "0.6045537", "0.59635186", "0.5961694", "0.5953851", "0.5943369", "0.58846164", "0.58798844", "0.5822605", "0.5822605", "0.5822379", "0.5800866", "0.577057...
0.7062699
1
Test getting file extension from path.
def test_get_file_extension(self) -> None: path = "/home/user/file.ext" result = get_file_extension(path) self.assertEqual(result, "ext")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_file_with_dots_extension(self) -> None:\n path = \"/home/user/file.name.ext2\"\n result = get_file_extension(path)\n self.assertEqual(result, \"ext2\")", "def extension_from_path(path):\n extension = path.split(\".\")[-1]\n return extension", "def _get_ext(self, ...
[ "0.86800325", "0.81086683", "0.8072279", "0.7949813", "0.79368246", "0.7920298", "0.7789062", "0.76943505", "0.755353", "0.75219536", "0.749016", "0.74370855", "0.7421382", "0.7406953", "0.7355715", "0.73351365", "0.733208", "0.7278737", "0.72730386", "0.71788836", "0.7164469...
0.8825947
0
Test getting file extension from path.
def test_get_file_with_dots_extension(self) -> None: path = "/home/user/file.name.ext2" result = get_file_extension(path) self.assertEqual(result, "ext2")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_file_extension(self) -> None:\n path = \"/home/user/file.ext\"\n result = get_file_extension(path)\n self.assertEqual(result, \"ext\")", "def extension_from_path(path):\n extension = path.split(\".\")[-1]\n return extension", "def _get_ext(self, path):\n r...
[ "0.8825947", "0.81086683", "0.8072279", "0.7949813", "0.79368246", "0.7920298", "0.7789062", "0.76943505", "0.755353", "0.75219536", "0.749016", "0.74370855", "0.7421382", "0.7406953", "0.7355715", "0.73351365", "0.733208", "0.7278737", "0.72730386", "0.71788836", "0.7164469"...
0.86800325
1
Test getting file extension from path.
def test_get_file_without_extension(self) -> None: path = "/home/user/file" result = get_file_extension(path) self.assertEqual(result, "")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_file_extension(self) -> None:\n path = \"/home/user/file.ext\"\n result = get_file_extension(path)\n self.assertEqual(result, \"ext\")", "def test_get_file_with_dots_extension(self) -> None:\n path = \"/home/user/file.name.ext2\"\n result = get_file_extension(path)...
[ "0.8825947", "0.86800325", "0.81086683", "0.8072279", "0.7949813", "0.7920298", "0.7789062", "0.76943505", "0.755353", "0.75219536", "0.749016", "0.74370855", "0.7421382", "0.7406953", "0.7355715", "0.73351365", "0.733208", "0.7278737", "0.72730386", "0.71788836", "0.7164469"...
0.79368246
5
Test if record is a valid dataset file.
def test_record_is_dataset_file(self) -> None: path = "/home/user/dataset.record" result = is_dataset_file(path) self.assertTrue(result)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_valid(self, dataset):\n pass", "def validate_dataset(self, path: str = None) -> bool:\n checked = {} # type: Dict[str, Any]\n # Check path exists\n path = path if path is not None else self.path\n if not os.path.exists(path):\n raise ValueError('The path to t...
[ "0.71040785", "0.6863867", "0.68257785", "0.67931664", "0.67237216", "0.6699486", "0.6648243", "0.65024203", "0.64735746", "0.6458235", "0.6451198", "0.64415586", "0.64020693", "0.6372555", "0.6347536", "0.6343386", "0.6315279", "0.629199", "0.6281639", "0.625653", "0.6246272...
0.80596375
0
Test if record is a valid dataset file.
def test_pbtxt_is_dataset_file(self) -> None: path = "/home/user/dataset.pbtxt" result = is_dataset_file(path) self.assertFalse(result)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_record_is_dataset_file(self) -> None:\n path = \"/home/user/dataset.record\"\n result = is_dataset_file(path)\n self.assertTrue(result)", "def is_valid(self, dataset):\n pass", "def validate_dataset(self, path: str = None) -> bool:\n checked = {} # type: Dict[str, A...
[ "0.80596375", "0.71040785", "0.6863867", "0.68257785", "0.67237216", "0.6699486", "0.6648243", "0.65024203", "0.64735746", "0.6458235", "0.6451198", "0.64415586", "0.64020693", "0.6372555", "0.6347536", "0.6343386", "0.6315279", "0.629199", "0.6281639", "0.625653", "0.6246272...
0.67931664
4
Test getting predefined config path for TF image recognition models.
def test_get_predefined_tf_image_recognition_config_path(self) -> None: self._assert_predefined_config_path( framework="tensorflow", domain="image_recognition", domain_flavour="", expected_filename="image_recognition.yaml", )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_predefined_onnx_image_recognition_config_path(self) -> None:\n self._assert_predefined_config_path(\n framework=\"onnxrt\",\n domain=\"image_recognition\",\n domain_flavour=\"\",\n expected_filename=\"image_recognition.yaml\",\n )", "def test...
[ "0.75592035", "0.7412118", "0.72849274", "0.717529", "0.6809559", "0.6795905", "0.6554628", "0.64774716", "0.64007187", "0.6367952", "0.63568515", "0.62823087", "0.6041288", "0.59696573", "0.59272754", "0.5859404", "0.5838563", "0.58267045", "0.5783078", "0.575788", "0.569827...
0.83963805
0
Test getting predefined config path for TF object detection models.
def test_get_predefined_tf_object_detection_config_path(self) -> None: self._assert_predefined_config_path( framework="tensorflow", domain="object_detection", domain_flavour="", expected_filename="object_detection.yaml", )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_predefined_tf_object_detection_unknown_flavour_config_path(self) -> None:\n self._assert_predefined_config_path(\n framework=\"tensorflow\",\n domain=\"object_detection\",\n domain_flavour=\"foo\",\n expected_filename=\"object_detection.yaml\",\n ...
[ "0.7654645", "0.73946184", "0.72947437", "0.70547116", "0.70378405", "0.67137825", "0.6437595", "0.6437529", "0.6192349", "0.61044425", "0.6100769", "0.6069273", "0.60661966", "0.59318006", "0.59008956", "0.5850615", "0.5848458", "0.5828326", "0.56665957", "0.5662301", "0.563...
0.8449237
0
Test getting predefined config path for TF object detection models.
def test_get_predefined_tf_object_detection_ssd_config_path(self) -> None: self._assert_predefined_config_path( framework="tensorflow", domain="object_detection", domain_flavour="ssd", expected_filename="object_detection_ssd.yaml", )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_predefined_tf_object_detection_config_path(self) -> None:\n self._assert_predefined_config_path(\n framework=\"tensorflow\",\n domain=\"object_detection\",\n domain_flavour=\"\",\n expected_filename=\"object_detection.yaml\",\n )", "def test_...
[ "0.84492755", "0.76546496", "0.7392796", "0.70541734", "0.7037769", "0.67110646", "0.64360476", "0.64352703", "0.61914104", "0.61029863", "0.61006165", "0.6068131", "0.6064642", "0.59318507", "0.59008795", "0.58501637", "0.5847948", "0.5827509", "0.5666658", "0.5661751", "0.5...
0.7295014
3
Test getting predefined config path for TF object detection models.
def test_get_predefined_tf_object_detection_unknown_flavour_config_path(self) -> None: self._assert_predefined_config_path( framework="tensorflow", domain="object_detection", domain_flavour="foo", expected_filename="object_detection.yaml", )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_predefined_tf_object_detection_config_path(self) -> None:\n self._assert_predefined_config_path(\n framework=\"tensorflow\",\n domain=\"object_detection\",\n domain_flavour=\"\",\n expected_filename=\"object_detection.yaml\",\n )", "def test_...
[ "0.84492755", "0.7392796", "0.7295014", "0.70541734", "0.7037769", "0.67110646", "0.64360476", "0.64352703", "0.61914104", "0.61029863", "0.61006165", "0.6068131", "0.6064642", "0.59318507", "0.59008795", "0.58501637", "0.5847948", "0.5827509", "0.5666658", "0.5661751", "0.56...
0.76546496
1
Test getting predefined config path for TF NLP models.
def test_get_predefined_tf_nlp_config_path(self) -> None: self._assert_predefined_config_path( framework="tensorflow", domain="nlp", domain_flavour="", expected_filename="nlp.yaml", )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_predefined_onnx_nlp_config_path(self) -> None:\n self._assert_predefined_config_path(\n framework=\"onnxrt\",\n domain=\"nlp\",\n domain_flavour=\"\",\n expected_filename=\"nlp.yaml\",\n )", "def test_get_predefined_tf_recommendation_config_p...
[ "0.75173897", "0.73409075", "0.69700027", "0.69696283", "0.6721619", "0.63614434", "0.62693655", "0.6259654", "0.62449867", "0.61654174", "0.6153191", "0.612614", "0.60378885", "0.6006346", "0.59780526", "0.587454", "0.5872058", "0.5816616", "0.5811135", "0.5782591", "0.57571...
0.8228239
0
Test getting predefined config path for TF recommendation models.
def test_get_predefined_tf_recommendation_config_path(self) -> None: self._assert_predefined_config_path( framework="tensorflow", domain="recommendation", domain_flavour="", expected_filename="recommendation.yaml", )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_predefined_tf_nlp_config_path(self) -> None:\n self._assert_predefined_config_path(\n framework=\"tensorflow\",\n domain=\"nlp\",\n domain_flavour=\"\",\n expected_filename=\"nlp.yaml\",\n )", "def test_get_predefined_tf_image_recognition_con...
[ "0.7441416", "0.7052898", "0.69839627", "0.66950226", "0.6658153", "0.64765024", "0.6476497", "0.6430937", "0.6410763", "0.6309978", "0.6242159", "0.6237229", "0.61450243", "0.60556775", "0.5982015", "0.59642893", "0.58971345", "0.5868531", "0.5844909", "0.5821499", "0.576090...
0.84726024
0
Test getting predefined config path for onnx image recognition models.
def test_get_predefined_onnx_image_recognition_config_path(self) -> None: self._assert_predefined_config_path( framework="onnxrt", domain="image_recognition", domain_flavour="", expected_filename="image_recognition.yaml", )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_predefined_tf_image_recognition_config_path(self) -> None:\n self._assert_predefined_config_path(\n framework=\"tensorflow\",\n domain=\"image_recognition\",\n domain_flavour=\"\",\n expected_filename=\"image_recognition.yaml\",\n )", "def te...
[ "0.7796619", "0.6986146", "0.68707967", "0.67667747", "0.65804195", "0.6415202", "0.63782686", "0.6302182", "0.6213862", "0.60774255", "0.60295063", "0.59473515", "0.5907198", "0.58103526", "0.5796034", "0.5795795", "0.5795542", "0.5785171", "0.57451344", "0.5743044", "0.5689...
0.84311223
0
Test getting predefined config path for onnx NLP models.
def test_get_predefined_onnx_nlp_config_path(self) -> None: self._assert_predefined_config_path( framework="onnxrt", domain="nlp", domain_flavour="", expected_filename="nlp.yaml", )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_predefined_tf_nlp_config_path(self) -> None:\n self._assert_predefined_config_path(\n framework=\"tensorflow\",\n domain=\"nlp\",\n domain_flavour=\"\",\n expected_filename=\"nlp.yaml\",\n )", "def test_get_predefined_onnx_image_recognition_c...
[ "0.7163459", "0.7056394", "0.6645824", "0.64085156", "0.6328148", "0.62867266", "0.61514914", "0.61138886", "0.61060506", "0.6087492", "0.6009389", "0.59438986", "0.5923466", "0.5904732", "0.58298385", "0.5808922", "0.58066463", "0.5793833", "0.5764205", "0.5678265", "0.56763...
0.7960524
0
Test getting predefined config path for onnx NLP models.
def test_get_predefined_config_path_framework_failure(self) -> None: with self.assertRaises(Exception): get_predefined_config_path( framework="onnx", domain="image_recognition", )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_predefined_onnx_nlp_config_path(self) -> None:\n self._assert_predefined_config_path(\n framework=\"onnxrt\",\n domain=\"nlp\",\n domain_flavour=\"\",\n expected_filename=\"nlp.yaml\",\n )", "def test_get_predefined_tf_nlp_config_path(self) -...
[ "0.7960368", "0.7162531", "0.70569384", "0.6645198", "0.64084315", "0.62873554", "0.6151959", "0.6114022", "0.61061347", "0.6088576", "0.6009785", "0.59441656", "0.59228957", "0.590482", "0.5829864", "0.58104944", "0.5805525", "0.5792481", "0.57646346", "0.5678434", "0.567742...
0.63294023
5
Test getting predefined config path for onnx NLP models.
def test_get_predefined_config_path_domain_failure(self) -> None: with self.assertRaises(Exception): get_predefined_config_path( framework="onnxrt", domain="object_detection", )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_predefined_onnx_nlp_config_path(self) -> None:\n self._assert_predefined_config_path(\n framework=\"onnxrt\",\n domain=\"nlp\",\n domain_flavour=\"\",\n expected_filename=\"nlp.yaml\",\n )", "def test_get_predefined_tf_nlp_config_path(self) -...
[ "0.7960368", "0.7162531", "0.70569384", "0.6645198", "0.64084315", "0.63294023", "0.62873554", "0.6151959", "0.6114022", "0.61061347", "0.6088576", "0.6009785", "0.59441656", "0.59228957", "0.590482", "0.5829864", "0.58104944", "0.5805525", "0.5792481", "0.57646346", "0.56784...
0.5482898
33
Test checking existing module.
def test_check_module(self) -> None: check_module("os")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_module(self):\n pass", "def test_module_exists(self):\n project_path = os.getcwd()\n rango_app_path = os.path.join(project_path, 'rango')\n forms_module_path = os.path.join(rango_app_path, 'forms.py')\n\n self.assertTrue(os.path.exists(forms_module_path), f\"{FAILURE_H...
[ "0.7775068", "0.7622405", "0.75304526", "0.71911955", "0.71885073", "0.7102597", "0.70338994", "0.70180136", "0.6914303", "0.68790066", "0.68734944", "0.68504345", "0.6809024", "0.6796673", "0.6772522", "0.67269987", "0.6687166", "0.667671", "0.6617383", "0.6616602", "0.65916...
0.78205836
0
Test checking non existing module.
def test_check_non_existing_module(self) -> None: with self.assertRaises(ClientErrorException): check_module("non_existing_module")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testNoSuchModule(self):\n self.assertRaises(messages.DefinitionNotFoundError,\n messages.find_definition,\n 'does.not.exist',\n importer=self.Importer)", "def test_check_module(self) -> None:\n check_module(\"os\")", "...
[ "0.76044667", "0.7416591", "0.7399717", "0.72337514", "0.72061455", "0.7133136", "0.7049381", "0.7046301", "0.69785535", "0.6971145", "0.69622946", "0.6960073", "0.6942464", "0.69311404", "0.68618923", "0.68603796", "0.6849098", "0.6828724", "0.6819381", "0.6799914", "0.67798...
0.8172532
0
Test getting models config.
def test_load_model_config(self) -> None: result = load_model_config() self.assertIs(type(result), dict) self.assertIsNot(result, {})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_coupledmodels_get(self):\n pass", "def test_get_model(self) -> None:\n get_model()", "def testGetModelsData(self):\n models = models_logic._getModelsData()\n self.assertTrue(models)", "def get_model_config(self, model_num=0):\n return [], resources.get_file(\n \"config/...
[ "0.7344181", "0.6897746", "0.6867049", "0.65969276", "0.6582802", "0.655109", "0.6541584", "0.65313196", "0.6443056", "0.6425103", "0.642088", "0.63794756", "0.6372846", "0.62939525", "0.6282946", "0.6266822", "0.6264599", "0.62148494", "0.61819917", "0.6163742", "0.6146844",...
0.71640885
1
Test getting dataloaders config.
def test_load_dataloader_config(self) -> None: result = load_dataloader_config() self.assertIs(type(result), list) self.assertIsNot(result, [])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_dataloader(self) -> DataLoader:\n return self._custom_data_loader()", "def test_dataloader(self) -> torch.utils.data.DataLoader: \n return torch.utils.data.DataLoader(self.dataset_test, **self.dl_kwargs)", "def test_dataloader(self) -> data.DataLoader:\n return data.DataLo...
[ "0.6893552", "0.6832417", "0.6727525", "0.67140794", "0.6579673", "0.6515249", "0.642833", "0.63334775", "0.6258725", "0.6231027", "0.6213907", "0.6207928", "0.6139557", "0.60178506", "0.5996533", "0.599519", "0.5989954", "0.59818614", "0.59683573", "0.59597766", "0.5954509",...
0.7478321
0
Test getting transforms config.
def test_load_transforms_config(self) -> None: result = load_transforms_config() self.assertIs(type(result), list) self.assertIsNot(result, [])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_load_full_transform(self):\n self.add_transform(cond_artist=True, cond_album=True, cond_title=True,\n cond_ensemble=True, cond_composer=True, cond_conductor=True,\n change_artist=True, change_album=True, change_title=True,\n change_ensemble=True, change_composer=Tru...
[ "0.6457925", "0.6132974", "0.6045049", "0.591944", "0.5891703", "0.5852024", "0.581294", "0.57519954", "0.5733683", "0.5728028", "0.56447434", "0.56063056", "0.5597566", "0.55973953", "0.5580112", "0.55531615", "0.5521915", "0.54951215", "0.54724187", "0.5457946", "0.54475075...
0.77776486
0
Test getting neural_compressor metrics tooltips.
def test_load_metrics_help_nc_params(self) -> None: result = load_help_nc_params("metrics") self.assertIs(type(result), dict) self.assertIsNot(result, {})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def call_toolTips(self):\n self.choose_fold_button.setToolTip(\"Select folder containing the specific test TCReader log files\")\n self.get_test_presets.setToolTip(\"Select the test set points (temperatures that you want statistics for)\")\n self.selectdata_label.setToolTip(\"In this section s...
[ "0.5641826", "0.55951315", "0.555083", "0.54917693", "0.5450532", "0.5350507", "0.52507436", "0.5191726", "0.5182079", "0.5155762", "0.51438236", "0.5142812", "0.5141236", "0.50950134", "0.50764275", "0.5075751", "0.5055884", "0.50503975", "0.5049242", "0.50485116", "0.503386...
0.48084897
60
Test getting neural_compressor objectives tooltips.
def test_load_objectives_help_nc_params(self) -> None: result = load_help_nc_params("objectives") self.assertIs(type(result), dict) self.assertIsNot(result, {})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def call_toolTips(self):\n self.choose_fold_button.setToolTip(\"Select folder containing the specific test TCReader log files\")\n self.get_test_presets.setToolTip(\"Select the test set points (temperatures that you want statistics for)\")\n self.selectdata_label.setToolTip(\"In this section s...
[ "0.5863986", "0.57583505", "0.5748722", "0.56831956", "0.56389445", "0.5638742", "0.56088185", "0.5544451", "0.5447014", "0.53710204", "0.5327886", "0.5310873", "0.5303225", "0.52744234", "0.52607346", "0.5257799", "0.5235478", "0.52289903", "0.5227101", "0.52132505", "0.5211...
0.0
-1
Test getting neural_compressor strategies tooltips.
def test_load_strategies_help_nc_params(self) -> None: result = load_help_nc_params("strategies") self.assertIs(type(result), dict) self.assertIsNot(result, {})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def call_toolTips(self):\n self.choose_fold_button.setToolTip(\"Select folder containing the specific test TCReader log files\")\n self.get_test_presets.setToolTip(\"Select the test set points (temperatures that you want statistics for)\")\n self.selectdata_label.setToolTip(\"In this section s...
[ "0.58165115", "0.54903305", "0.5449068", "0.54376763", "0.52722114", "0.5230677", "0.51836854", "0.51526064", "0.51348513", "0.5130091", "0.5102855", "0.5101885", "0.5084127", "0.50746053", "0.50649077", "0.5063513", "0.50580853", "0.5042678", "0.5038254", "0.50191104", "0.49...
0.0
-1
Test getting neural_compressor strategies tooltips.
def test_load_non_existing_help_nc_params(self) -> None: with self.assertRaises(FileNotFoundError): load_help_nc_params("unknown_param")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def call_toolTips(self):\n self.choose_fold_button.setToolTip(\"Select folder containing the specific test TCReader log files\")\n self.get_test_presets.setToolTip(\"Select the test set points (temperatures that you want statistics for)\")\n self.selectdata_label.setToolTip(\"In this section s...
[ "0.58165115", "0.54903305", "0.5449068", "0.54376763", "0.52722114", "0.5230677", "0.51836854", "0.51526064", "0.51348513", "0.5130091", "0.5102855", "0.5101885", "0.5084127", "0.50746053", "0.50649077", "0.5063513", "0.50580853", "0.5042678", "0.5038254", "0.50191104", "0.49...
0.0
-1
Check if path can be accessed.
def verify_file_path(self) -> None: path = "/data" verify_file_path(path)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isAccessible(self,path):\n if isdir(path):\n return access(path, R_OK and X_OK and W_OK)\n else:\n return access(path, R_OK)", "def check_path(self, path):\n if path in self.app_path:\n return True\n else:\n return False", "def is_vali...
[ "0.71084756", "0.7049014", "0.6876598", "0.6774049", "0.6754154", "0.64962184", "0.63976777", "0.637947", "0.6365286", "0.6308693", "0.62873393", "0.6249458", "0.62382686", "0.620875", "0.62071157", "0.62015426", "0.61757267", "0.6167634", "0.6148958", "0.614665", "0.612196",...
0.0
-1
Check if path can be accessed.
def verify_root_path(self) -> None: path = "/" with self.assertRaises(AccessDeniedException): verify_file_path(path)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isAccessible(self,path):\n if isdir(path):\n return access(path, R_OK and X_OK and W_OK)\n else:\n return access(path, R_OK)", "def check_path(self, path):\n if path in self.app_path:\n return True\n else:\n return False", "def is_vali...
[ "0.71084756", "0.7049014", "0.6876598", "0.6774049", "0.6754154", "0.64962184", "0.63976777", "0.637947", "0.6365286", "0.6308693", "0.62873393", "0.6249458", "0.62382686", "0.620875", "0.62071157", "0.62015426", "0.61757267", "0.6167634", "0.6148958", "0.614665", "0.612196",...
0.0
-1
Check if path can be accessed.
def verify_hidden_path(self) -> None: path = "/home/user/.ssh/secret_key" with self.assertRaises(AccessDeniedException): verify_file_path(path)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isAccessible(self,path):\n if isdir(path):\n return access(path, R_OK and X_OK and W_OK)\n else:\n return access(path, R_OK)", "def check_path(self, path):\n if path in self.app_path:\n return True\n else:\n return False", "def is_vali...
[ "0.71084756", "0.7049014", "0.6876598", "0.6774049", "0.6754154", "0.64962184", "0.63976777", "0.637947", "0.6365286", "0.6308693", "0.62873393", "0.6249458", "0.62382686", "0.620875", "0.62071157", "0.62015426", "0.61757267", "0.6167634", "0.6148958", "0.614665", "0.612196",...
0.0
-1
Check if path can be accessed.
def verify_non_existing_path(self) -> None: path = "/some/non/existing/path" with self.assertRaises(NotFoundException): verify_file_path(path)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isAccessible(self,path):\n if isdir(path):\n return access(path, R_OK and X_OK and W_OK)\n else:\n return access(path, R_OK)", "def check_path(self, path):\n if path in self.app_path:\n return True\n else:\n return False", "def is_vali...
[ "0.71084756", "0.7049014", "0.6876598", "0.6774049", "0.6754154", "0.64962184", "0.63976777", "0.637947", "0.6365286", "0.6308693", "0.62873393", "0.6249458", "0.62382686", "0.620875", "0.62071157", "0.62015426", "0.61757267", "0.6167634", "0.6148958", "0.614665", "0.612196",...
0.0
-1
Check if path can be accessed.
def verify_restricted_path(self) -> None: path = "/usr" with self.assertRaises(NotFoundException): verify_file_path(path)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isAccessible(self,path):\n if isdir(path):\n return access(path, R_OK and X_OK and W_OK)\n else:\n return access(path, R_OK)", "def check_path(self, path):\n if path in self.app_path:\n return True\n else:\n return False", "def is_vali...
[ "0.71084756", "0.7049014", "0.6876598", "0.6774049", "0.6754154", "0.64962184", "0.63976777", "0.6365286", "0.6308693", "0.62873393", "0.6249458", "0.62382686", "0.620875", "0.62071157", "0.62015426", "0.61757267", "0.6167634", "0.6148958", "0.614665", "0.612196", "0.61173284...
0.637947
7
Assert predefined config path.
def _assert_predefined_config_path( self, framework: str, domain: str, domain_flavour: str, expected_filename: str, ) -> None: result = get_predefined_config_path(framework, domain, domain_flavour) expected = os.path.join( os.path.abspath( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_default_config_file_paths(\n config,\n):\n assert \"~/.config/yessssms.conf\" in CONFIG_FILE_PATHS\n assert \"/etc/yessssms.conf\" in CONFIG_FILE_PATHS", "def test_expected_config(expectedconfig):\n expected = expectedconfig.read_text()\n config = CONFIGSDIR / expectedconfig.name\n\n a...
[ "0.72531724", "0.6966318", "0.687894", "0.68690413", "0.68319833", "0.6828153", "0.68121266", "0.68025386", "0.6744204", "0.66994476", "0.66757023", "0.66216826", "0.65864456", "0.6554743", "0.6550599", "0.6525278", "0.64727885", "0.64717287", "0.6456509", "0.6455779", "0.645...
0.78012013
0
Check if development env is activated.
def test_is_development_env(self) -> None: os.environ.update({"NC_MODE": "development"}) is_develop = is_development_env() self.assertTrue(is_develop)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_development():\n return os.environ.get('SERVER_SOFTWARE', '').startswith('Development')", "def get_site_env(self):\n return self.config['SITE_ENVIRONMENT'] == 'DEV'", "def _global_development_mode() -> bool:\n return (\n not env_util.is_pex()\n and \"site-packages\" not in __fil...
[ "0.8337604", "0.7692659", "0.7504923", "0.74659204", "0.7465296", "0.7377704", "0.7323249", "0.72394073", "0.72125643", "0.71630734", "0.7148706", "0.70545775", "0.70386916", "0.7021576", "0.69120103", "0.68301886", "0.68271375", "0.6818852", "0.67625374", "0.6734069", "0.672...
0.81877184
1