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
Set the global trace specification based on the given trace string. Loop through all registered modules and set their trace class trace level based on the given trace string if the module name matches one of the module patterns in the given trace string.
def configureTrace(traceString): setTraceSpec(traceString) registeredModules = Trace.tracedEntities.keys() for module in registeredModules: for spec in Trace.traceSpec: if (spec.compiledRegex.match(module)): trace = Trace.tracedEntities[module] trace.setTraceLevel(spec.level) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setTraceSpec(traceString):\n \n if (not traceString):\n raise Exception(\"The traceString argument must be a non-empty string.\")\n #endIf\n \n Trace.traceSpec = parseTraceString(traceString)\n Trace.traceString = traceString", "def configureTrace(self,traceString):\n configureTrace(traceString)"...
[ "0.7233881", "0.6644756", "0.6296946", "0.60611576", "0.56253296", "0.52577573", "0.51801455", "0.48836422", "0.4874601", "0.48213887", "0.48206002", "0.48105368", "0.4734947", "0.47317776", "0.47311783", "0.47059482", "0.46913573", "0.46432233", "0.4641233", "0.46398026", "0...
0.8441392
0
the freshly created queue has 'rear' value of 0 (the next available pointer in the queue buffer).
def test_queue_rear(self): queue = Queue(shape=(100, 2, 2, 2)) self.assertEqual(queue.rear, 0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dequeue(self):\n pass", "def dequeue(self):\n pass", "def AdvanceQueue(self):\r\n self.data.pop(0)\r\n return", "def dequeue(self):\n if self.isEmpty():\n raise Exception(\"Queue underflow\")\n item = self._q[self._first]\n self._q[self._first] = None # to av...
[ "0.6964394", "0.6964394", "0.695485", "0.69021404", "0.6897588", "0.6881007", "0.6785619", "0.6758882", "0.67280215", "0.67280215", "0.67083055", "0.6669669", "0.6658059", "0.66144186", "0.6604896", "0.65884155", "0.6587446", "0.6578113", "0.65759975", "0.6553688", "0.6553572...
0.730834
0
Convert a BigBird string into a JSON object.
def bbjson(s): return BunchDict(json.loads(unquote(s)))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def string2json(self, string):\n kwargs = {\n 'cls': BytesEncoder, # use the IPython bytes encoder\n 'indent': 1,\n 'sort_keys': True,\n 'separators': (',', ': '),\n }\n return cast_unicode(json.dumps(string, **kwargs), 'utf-8')", "def convert_to_...
[ "0.65743154", "0.6400961", "0.59088975", "0.59016544", "0.5773446", "0.5773138", "0.5771175", "0.5762785", "0.5758166", "0.57323337", "0.5724494", "0.5724494", "0.5724494", "0.5724225", "0.5724225", "0.57240826", "0.56558675", "0.56424606", "0.5609231", "0.5574156", "0.554661...
0.68068093
0
Map a userprovided query expression over a set of JSON objects. The query is executed for every JSON object in the input file. The JSON object is bound to the special variable '_'. In addition, all JSON attributes appear in the global namespace for the query expression.
def map(query, fh, skip_header_row, default_obj={}): # First, try the JsonRecordReader; then attempt the csv record reader reader = MetaRecordReader(default_obj) # Hack: append an 'else []' to queries that lack an else clause if " if " in query and not " else " in query: query = query + " else...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_query(file: TextIO) -> 'NGOMatch':\n query_dict = {}\n query_dict['skills'] = {}\n query_dict['interest'] = []\n line = file.readline().strip()\n \n query_dict['skills']['technical'] = []\n query_dict['skills']['interpersonal'] = []\n \n line = file.readline().strip()\n li...
[ "0.52226245", "0.5208916", "0.51859844", "0.5142399", "0.50332826", "0.50120467", "0.49951917", "0.49664053", "0.4890371", "0.4886911", "0.4872044", "0.4824347", "0.48076558", "0.470443", "0.47026193", "0.46869832", "0.46731216", "0.4665948", "0.46637034", "0.46543258", "0.46...
0.5270592
0
Execute a series of query expressions. 1) Evalue each query over its corresponding input file. 2) If there are two inputs, join the results together. 3) If an aggregate is provided, aggregate the results. 4) If distinct is True, retain one copy of each input. 5) If order_by is provided, sort the results based on the gi...
def run_query(queries, files, default_obj, skip_header, agg, distinct, order_by, limit): its = [map(query, phile, skip_header, default_obj) for (query, phile) in zip(queries, files)] it = its[0] if len(its) == 2: it = join_op(*its) if agg is not None: it = aggregate_op(it, agg) if ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def execute_query(self):\n query_sum = self.initialize_totals()\n data = []\n\n with tenant_context(self.tenant):\n query = self.query_table.objects.filter(self.query_filter)\n query_data = query.annotate(**self.annotations)\n group_by_value = self._get_group_b...
[ "0.58031404", "0.568224", "0.5665828", "0.5647314", "0.5642808", "0.5589907", "0.5557054", "0.5428827", "0.54190207", "0.5345511", "0.5322713", "0.53156805", "0.5276109", "0.52561706", "0.5253461", "0.5250765", "0.52416295", "0.5235962", "0.52301556", "0.52289045", "0.5204500...
0.7461799
0
Tests the entrypoint with data passing with newstyled KFP components. This test case emulates a similar scenario as testMainWithV1Producer, except for that the inputs of this step are all provided by a newstyled KFP component.
def testMainWithV2Producer(self): # Set mocked user function. self._import_func.return_value = main.test_func2 # Set GFile read function self._mock_gcs_read.return_value = _PRODUCER_EXECUTOR_OUTPUT entrypoint.main( executor_metadata_json_file=_OUTPUT_METADATA_JSON_LOCATION, function...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testMainWithV1Producer(self):\n # Set mocked user function.\n self._import_func.return_value = main.test_func\n\n entrypoint.main(\n executor_metadata_json_file=_OUTPUT_METADATA_JSON_LOCATION,\n function_name='test_func',\n test_param_input_argo_param='hello from producer',\n ...
[ "0.6532168", "0.54045933", "0.5387434", "0.538001", "0.5364076", "0.5347625", "0.5322951", "0.53143555", "0.52755845", "0.52549887", "0.52549887", "0.52510643", "0.5237177", "0.5225532", "0.5202899", "0.51837075", "0.51728654", "0.5167905", "0.5163144", "0.5133356", "0.513304...
0.63917965
1
Run colordiff if it can be found, and plain diff otherwise.
def _run_diff(oldfile, newfile): # TODO: It may be nicer to use the internal diff engine for this. # For one, this would use the correct colors set up for hg # diff rather than the colors set up for colordiff. It's not # clear to me how this can be done though, and if it is # ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def diff(src, perm, dest, cmds, comp, verbose=False):\n if comp != Cmp.differ:\n return\n with open(src) as s, open(dest) as d:\n srcl, destl = list(s), list(d)\n out = unified_diff(destl, srcl, dest, src)\n colordiff(out)", "def diff(ctx, input_file):\n if input_file is None...
[ "0.61412245", "0.600993", "0.5725794", "0.53208023", "0.52990735", "0.5269064", "0.5248664", "0.5227579", "0.5193025", "0.5187924", "0.51672775", "0.51550215", "0.51132864", "0.5070487", "0.506192", "0.5020858", "0.5008293", "0.5007024", "0.5005436", "0.5001004", "0.49886513"...
0.7053977
0
Return all files in the working directory that match the patterns and are tracked (clean, modified or added). Ignored or unknown files are only matched when given literally. If patterns is empty, match all tracked files. Supports options['include'] and options['exclude'] which work like the include and exclude options ...
def _get_files(repo, patterns, options): ctx = repo[None] match = match_func(repo, ctx, patterns, options) try: status = ctx.status(listclean=True, listignored=True, listunknown=True) except TypeError: # Compatibility with older Mercurial versions. status = ctx.status(clean=True,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def match_files(patterns, files):\n\tall_files = files if isinstance(files, collections.Container) else list(files)\n\treturn_files = set()\n\tfor pattern in patterns:\n\t\tif pattern.include is not None:\n\t\t\tresult_files = pattern.match(all_files)\n\t\t\tif pattern.include:\n\t\t\t\treturn_files.update(result_...
[ "0.66072595", "0.5907133", "0.57880306", "0.57451385", "0.5728306", "0.5712232", "0.5626746", "0.557874", "0.5535921", "0.5524648", "0.54892516", "0.54789233", "0.5470777", "0.5459771", "0.5456681", "0.54244196", "0.5411096", "0.5399698", "0.5313874", "0.5283738", "0.5249157"...
0.6985878
0
Run uncrustify on the specified files or directories. If no files are specified, operates on the whole working directory.
def uncrustify(ui, repo, *patterns, **options): if options["diff"] and options["modify"]: raise util.Abort("cannot specify --diff and --modify at the same time") if options["diff"]: mode = "diff" elif options["modify"]: mode = "modify" else: mode = "status" no_backu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove(args):\n files = []\n for path in args.files:\n if os.path.isdir(path):\n ft = filetree(path)\n files.extend(ft.filelist())\n else:\n files.append(path)\n for path in files:\n relpath = os.path.normpath(os.path.relpath(path, args.base))\n ...
[ "0.57448184", "0.5654019", "0.5597988", "0.54939944", "0.54929745", "0.54213905", "0.53769475", "0.53547657", "0.53084433", "0.5301621", "0.5282862", "0.52690095", "0.5243867", "0.522146", "0.52008116", "0.51682776", "0.5164985", "0.5161235", "0.5154976", "0.51509416", "0.514...
0.72186744
0
This create the debian source control minimal tree structure based on the current buildout folder. It also copy the buildout DEBIAN folder to the package
def init_structure(self): dest = os.path.join(self.cwd, 'build', 'debian') self.mkdir_p(dest) struct = os.path.join(dest, self.cwd) self.mkdir_p(struct) # copytree_src = os.path.join(self.cwd, 'DEBIAN') # self.copytree(copytree_src, dest, symlinks=False, ignore=None) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_package(cwd):\n args = ['dpkg-buildpackage', '-us', '-uc']\n arch = parse_debian_control(cwd)['Architecture']\n if arch != 'all':\n args += ['--host-arch', arch]\n\n output, returncode = shell(args, cwd=cwd)\n logger.debug(output)\n if returncode:\n logger.error('failed to...
[ "0.6261107", "0.6206168", "0.6162178", "0.6102843", "0.60703856", "0.60544455", "0.602594", "0.60136557", "0.600986", "0.60017514", "0.59842265", "0.5976109", "0.59176093", "0.59169763", "0.5903615", "0.589208", "0.5881746", "0.5874955", "0.5868495", "0.58510756", "0.58366024...
0.7112945
0
Test that parsing a config produces the expected ModuleConfig object.
def test_parse_config(self): user_config = {"weighted_display_name_like": "testabc [SoMeThInG]"} _, _, module_config = create_user_directory_search_module_with_config( user_config ) # Check that the generated config contains what we expect self.assertEqual( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_config_class():\n assert config is not None", "def test_parser():\n\n parser = configparser.RawConfigParser()\n version = '1.2.3'\n string = 'string-value'\n bool = 'False'\n literal = \"['a', 'b', 'c']\"\n literal2 = '1.23'\n section = 'dashboard'\n\n parser.add_section(s...
[ "0.6836559", "0.6791693", "0.6766081", "0.6766081", "0.6679079", "0.6621784", "0.65958804", "0.6574629", "0.6568781", "0.65193504", "0.64859515", "0.64847076", "0.6438674", "0.639707", "0.63916653", "0.63844085", "0.63468117", "0.6346496", "0.6330521", "0.6291646", "0.6280007...
0.7162671
0
Tests UserDirectorySearchModule.get_search_query_ordering return values
def test_get_search_query_ordering(self): user_config = {"weighted_display_name_like": "[Modernisation]"} module, _, _ = create_user_directory_search_module_with_config(user_config) # Check postgres # Check the generated SQL and arguments of the above config when using postgres ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_search_order(self, post):\n return 'website_published desc, %s' % \\\n self.order_by.get(post.get('order', ''), { 'query': 'website_sequence desc' })['query']", "def get_search_query_ordering(\n self, database_engine_type: BaseDatabaseEngine,\n ) -> Tuple[str, Tuple]:\n ...
[ "0.6698615", "0.66707766", "0.6650491", "0.6406054", "0.6366886", "0.6198293", "0.59946716", "0.5983538", "0.59773964", "0.5948387", "0.5940092", "0.5885196", "0.5882724", "0.58709025", "0.58667475", "0.58603793", "0.585851", "0.5854477", "0.5850439", "0.5764674", "0.57599866...
0.8195143
0
Assumes x and epsilon are positve floats & epsilon < 1 Returns a y such that yy is within epsilon of x
def squareRootExhaustive(x, epsilon): step = espilon**2 ans = 0.0 while abs(ans**2 - x) >= epsilon and ans*ans <= x: # The ans*ans <= is there because of floating point arithmetic I think. ans += step if ans*ans > x: raise ValueError ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def finf(lhs, rhs, epsilon=0.00001):\n return rhs-lhs > epsilon", "def epsilon():\n return _EPSILON", "def squareRootBi(x, epsilon):\n low = 0.0\n high = max(1.0, x)\n ans = (high + low)/2.0\n while abs(ans**2 - x) >= epsilon:\n # Where as here the ans*ans <= x isn't required because eve...
[ "0.65840507", "0.6458624", "0.6209346", "0.62057513", "0.6190196", "0.6165473", "0.6135637", "0.6084486", "0.6045431", "0.6017484", "0.59838367", "0.5971854", "0.5954014", "0.5921355", "0.5895756", "0.58770144", "0.58325094", "0.5807985", "0.5804738", "0.580202", "0.5789465",...
0.6803677
0
Test fetching samples to prepare.
def test_samples_to_prepare(sample_store): # GIVEN a store with sample in a mix of states assert len(sample_store._get_query(table=Sample).all()) > 1 assert ( len( [sample for sample in sample_store._get_query(table=Sample).all() if sample.prepared_at] ) >= 1 ) #...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prepare(params, samples):\r\n return", "def test_get(self):\n obs = self.tester.get('1.SKM7.640188')\n exp = PrepSample('1.SKM7.640188', self.tester)\n self.assertEqual(obs, exp)", "def prepareSamples(username, testType):\r\n \r\n #userSamps = DBController().getUserSam...
[ "0.70553994", "0.688015", "0.67418826", "0.6723766", "0.66855913", "0.66855913", "0.66639364", "0.6653668", "0.6629881", "0.6424612", "0.64179444", "0.6364231", "0.6348621", "0.6331313", "0.6270328", "0.6239057", "0.62186223", "0.62135476", "0.62124485", "0.6156397", "0.61346...
0.68960553
1
Test fetching a sample by entry id.
def test_get_sample_by_entry_id(sample_store, entry_id=1): # GIVEN a store with a sample assert len(sample_store._get_query(table=Sample).all()) > 1 # WHEN finding a sample by entry id sample: Sample = sample_store.get_sample_by_entry_id(entry_id=entry_id) # THEN samples should be a list of sample...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_sample_by_id():\n sample_id = demisto.getArg('id')\n r = req('GET', SUB_API + 'samples/' + sample_id)\n sample = sample_to_readable(r.json().get('data'))\n md = tableToMarkdown('ThreatGrid - Sample', [sample], [\n 'ID', 'Filename', 'State', 'Status', 'MD5', 'SHA1', 'SHA256', 'OS', 'Submi...
[ "0.72672176", "0.6994822", "0.6854643", "0.665835", "0.6641262", "0.66313267", "0.6487416", "0.64807725", "0.64807725", "0.64692223", "0.64609057", "0.64068794", "0.636549", "0.6269254", "0.6269249", "0.62489676", "0.6215826", "0.62132645", "0.61510736", "0.6108318", "0.61035...
0.85014653
0
Test fetching a sample by internal id.
def test_get_sample_by_internal_id(sample_store, internal_id="test_internal_id"): # GIVEN a store with a sample assert len(sample_store._get_query(table=Sample).all()) > 1 # WHEN finding a sample by internal id sample: Sample = sample_store.get_sample_by_internal_id(internal_id=internal_id) # THEN...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_sample_by_entry_id(sample_store, entry_id=1):\n # GIVEN a store with a sample\n assert len(sample_store._get_query(table=Sample).all()) > 1\n\n # WHEN finding a sample by entry id\n sample: Sample = sample_store.get_sample_by_entry_id(entry_id=entry_id)\n\n # THEN samples should be a li...
[ "0.7371811", "0.7272965", "0.71735644", "0.696735", "0.69627017", "0.69409776", "0.69409776", "0.68801206", "0.67857003", "0.66956204", "0.6688522", "0.6670793", "0.66263884", "0.6589909", "0.65849036", "0.6567184", "0.6541756", "0.6528299", "0.6515762", "0.6508632", "0.63984...
0.8107025
0
Test fetching samples to deliver.
def test_get_samples_to_deliver(sample_store): # GIVEN a store with a sample assert len(sample_store._get_query(table=Sample).all()) > 1 # WHEN finding samples to deliver samples = sample_store.get_samples_to_deliver() # THEN samples should be a list of samples assert isinstance(samples, list)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _fetch_data(self, samples):\n pass", "def test_get_sample_ids(self):\n obs = self.tester._get_sample_ids(self.conn_handler)\n self.assertEqual(obs, self.exp_sample_ids)", "def test_get_sample_ids(self):\n obs = self.tester._get_sample_ids(self.conn_handler)\n self.assertE...
[ "0.6931996", "0.6794256", "0.6794256", "0.67737925", "0.66999286", "0.6694386", "0.65940934", "0.6582905", "0.65426874", "0.6501551", "0.6394083", "0.63844264", "0.6248509", "0.62174064", "0.61818117", "0.61708593", "0.6162405", "0.6161514", "0.61414313", "0.6137429", "0.6128...
0.7451402
0
Test fetching samples to invoice.
def test_get_samples_to_invoice_query(sample_store): # GIVEN a store with a sample assert len(sample_store._get_query(table=Sample).all()) > 1 # WHEN finding samples to invoice sample = sample_store.get_samples_to_invoice_query().first() # THEN samples should be a list of samples assert isinst...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_all_samples(self):\n self.login()\n\n page_size = 20\n\n # hit the API endpoint for both pages\n for page in range(1, 3):\n\n data = {'page': page,\n 'page_size': page_size}\n response = self.client.get(reverse('searchsamples'), data...
[ "0.71165115", "0.6904219", "0.6904219", "0.67734456", "0.6765537", "0.6668611", "0.6624272", "0.6623599", "0.6583024", "0.65742016", "0.6558656", "0.6528112", "0.64597166", "0.6408933", "0.63449955", "0.63117397", "0.6308055", "0.6302898", "0.62760097", "0.6271004", "0.619597...
0.75329405
0
Test getting samples not invoiced.
def test_get_samples_not_invoiced(sample_store): # GIVEN a store with a sample assert len(sample_store._get_query(table=Sample).all()) > 1 # WHEN finding samples to invoice samples = sample_store.get_samples_not_invoiced() # THEN samples should be a list of samples assert isinstance(samples, l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_samples_not_down_sampled(sample_store: Store, helpers: StoreHelpers, sample_id: int):\n # GIVEN a store with a sample\n assert len(sample_store._get_query(table=Sample).all()) > 1\n\n # WHEN finding samples to invoice\n samples = sample_store.get_samples_not_down_sampled()\n\n # THEN sa...
[ "0.72148484", "0.6882741", "0.6882741", "0.6842651", "0.6788283", "0.6630164", "0.6539232", "0.6498837", "0.6441554", "0.6415748", "0.63511664", "0.624929", "0.623399", "0.623399", "0.6222391", "0.62210715", "0.6196237", "0.6174369", "0.6173602", "0.6164898", "0.6164898", "...
0.801496
0
Test that samples to invoice can be returned for a customer.
def test_get_samples_to_invoice_for_customer( store_with_samples_for_multiple_customers: Store, helpers: StoreHelpers, three_customer_ids: List[str], ): # GIVEN a database with samples for a customer # THEN the one customer can be retrieved customer: Customer = store_with_samples_for_multiple_c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_single_customer(self):\n\n create_invoice = single_customer(\"Susan Wong\", \"invoice.csv\")\n create_invoice(\"test_items.csv\")\n\n # Generate list of rentals\n with open('invoice.csv', 'r') as csvfile:\n rentals = []\n for row in csvfile:\n ...
[ "0.6989047", "0.678077", "0.6628947", "0.6516833", "0.6497587", "0.64812696", "0.6476004", "0.6389455", "0.6330797", "0.63280046", "0.63094914", "0.6273231", "0.6252472", "0.6201348", "0.62011427", "0.6200815", "0.61968875", "0.6181959", "0.6151599", "0.61373514", "0.6132861"...
0.7491114
0
Test that samples can be returned for a customer.
def test_get_samples_by_customer_id_and_pattern_with_collaboration( store_with_samples_for_multiple_customers: Store, helpers: StoreHelpers, three_customer_ids: List[str], ): # GIVEN a database with samples for a customer # THEN the one customer can be retrieved customer: set[Customer] = store_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_samples_to_invoice_for_customer(\n store_with_samples_for_multiple_customers: Store,\n helpers: StoreHelpers,\n three_customer_ids: List[str],\n):\n # GIVEN a database with samples for a customer\n\n # THEN the one customer can be retrieved\n customer: Customer = store_with_samples_f...
[ "0.6761152", "0.64114153", "0.6304436", "0.61961013", "0.6108211", "0.60567933", "0.59976864", "0.59706753", "0.5933909", "0.59289604", "0.59162027", "0.5916126", "0.5911726", "0.5911726", "0.58814156", "0.5880382", "0.5877066", "0.58492786", "0.5835973", "0.57918143", "0.578...
0.6416844
1
Read in `file` and print out the frequency of words in that file.
def print_word_freq(file): text_file = open(file, 'r') contents = text_file.read() words = contents.split() def clean_text(text): text = text.lower() all_letters = "abcdefghijklmnopqrstuvwxyz" text_to_keep = "" for char in text: if char in all_letters:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_word_freq(file):\n with open(file) as one_today:\n text = one_today.readlines()\n d = dict()\n for line in text:\n line = line.strip()\n line = line.lower()\n line = line.translate(line.maketrans(\"\", \"\", string.punctuation))\n words = line.split(\" \")\n ...
[ "0.80829746", "0.7587596", "0.7485543", "0.7430957", "0.73927045", "0.7385063", "0.7344275", "0.7333363", "0.73050195", "0.7280821", "0.72229356", "0.720026", "0.7187416", "0.714256", "0.714226", "0.7084864", "0.7044941", "0.6986009", "0.69144094", "0.687015", "0.68287617", ...
0.7941403
1
Test the `save_one_genome` method. Pass a taxon ID in the parameters.
def test_genbank_to_genome_taxonomy(self): result = self.gfu.genbank_to_genome(self.ctx, { 'workspace_name': self.ws_name, 'generate_ids_if_needed': 'true', # why is this a string 'taxon_id': '3702', 'file': { 'path': f"{_DATA_PATH}/wigglesworthia...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_genbank_to_genome_invalid_taxon_id(self):\n result = self.gfu.genbank_to_genome(self.ctx, {\n 'workspace_name': self.ws_name,\n 'generate_ids_if_needed': 'true', # why is this a string\n 'taxon_id': '9999999999',\n 'file': {\n 'path': f\"{...
[ "0.624403", "0.5778086", "0.56341624", "0.56112194", "0.54687953", "0.5259953", "0.52500635", "0.52462626", "0.51927733", "0.51524097", "0.51524097", "0.512032", "0.512032", "0.5073122", "0.50706995", "0.5041771", "0.49938104", "0.49879703", "0.49636328", "0.49629033", "0.495...
0.6215281
1
Test the `save_one_genome` method. Pass a taxon ID in the parameters.
def test_genbank_to_genome_invalid_taxon_id(self): result = self.gfu.genbank_to_genome(self.ctx, { 'workspace_name': self.ws_name, 'generate_ids_if_needed': 'true', # why is this a string 'taxon_id': '9999999999', 'file': { 'path': f"{_DATA_PATH}/...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_genbank_to_genome_taxonomy(self):\n result = self.gfu.genbank_to_genome(self.ctx, {\n 'workspace_name': self.ws_name,\n 'generate_ids_if_needed': 'true', # why is this a string\n 'taxon_id': '3702',\n 'file': {\n 'path': f\"{_DATA_PATH}/wi...
[ "0.62149376", "0.57781327", "0.5632507", "0.56106865", "0.5468393", "0.5260755", "0.5250465", "0.5245567", "0.519301", "0.51530224", "0.51530224", "0.5118209", "0.5118209", "0.50733745", "0.50697297", "0.50424945", "0.49940592", "0.49871263", "0.4963119", "0.49630195", "0.495...
0.6242467
0
The function at any point in time returns if till the current input the string matches the given regular expression. It does so by comparing the current state with the end state `q3`. It also checks for `stopped` flag which sees that due to bad input the iteration of FSM had to be stopped.
def does_match(self): if self.stopped: return False return self.current_state == self.q3
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def match_regex_3(s, r):\n s_len = len(s)\n r_len = len(r)\n stack = [(0, 0)]\n while stack:\n s_idx, r_idx = stack.pop()\n # Case: string is empty.\n if s_idx == s_len:\n if r_idx == r_len:\n return True\n if r[r_idx] == '*':\n s...
[ "0.57386255", "0.5681869", "0.5660716", "0.5508027", "0.5500045", "0.53777856", "0.53166807", "0.52826416", "0.52527785", "0.5219115", "0.514601", "0.5101096", "0.5100061", "0.5095776", "0.5094811", "0.50932777", "0.5086449", "0.5085676", "0.5085387", "0.5077286", "0.5077286"...
0.65060884
0
BSURFS (7110, 71, 588, 1, 24, 190, 198, 189, 44, 188, 197, 190, 64, 106, 189, 196, 84, 195, 188, 106, 1) BSURFS 1 24 190 198 189+ $ EID2 G1 G2 G3 EID3 G1 G2 G3 + 44 188 197 190 64 106 189 196+ $ EID4 G1 G2 G3 + 84 195 188 106
def _read_bsurfs(self, data: bytes, n: int) -> int: bsurfs
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def avgfst_between(fstfile):\n fstlist = fstopen(fstfile)\n return str(round(sum(fstlist)/len(fstlist), 8))", "def valid_svid(gdf):\n #define all valid satellites\n svid = ('G01', 'G02', 'G03', 'G04', 'G05', 'G06', 'G07', 'G08', 'G09', 'G10', 'G11', 'G12', 'G13', 'G14', 'G15', 'G16', 'G17', 'G18', 'G...
[ "0.52736485", "0.5250206", "0.5216072", "0.52104783", "0.5193983", "0.51933676", "0.51401246", "0.5131391", "0.50727785", "0.50445265", "0.50316125", "0.50303996", "0.5022727", "0.499482", "0.4993226", "0.49653268", "0.4962925", "0.49464917", "0.4935478", "0.49284562", "0.492...
0.54406923
0
Given a TTT board `b`, determine who has won and return. If no one has won, return None
def winner(b): # Row of three for row in b: if row[0] == " ": # First row entry is blank; ignore! continue if row[0]==row[1] and row[1]==row[2]: return row[0] # Column of three for i in range(3): if b[0][i] == " ": # First column en...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def winner(board):\n\t#For X\n\tiswinnerX = winnerForPlayer(board, X)\n\tiswinnerO = winnerForPlayer(board, O)\n\n\tif iswinnerX:\n\t\treturn X\n\tif iswinnerO:\n\t\treturn O\n\n\treturn None", "def winner(board):\n #To determine the winner, I need to know the board's final value. \n token_value = utility(...
[ "0.6610197", "0.6459119", "0.641945", "0.64099497", "0.64009243", "0.63863385", "0.63806957", "0.63735557", "0.6358739", "0.6316436", "0.63094836", "0.6282113", "0.6265861", "0.62483245", "0.6238915", "0.62181", "0.61878645", "0.6153537", "0.6098851", "0.6092213", "0.6091631"...
0.6824795
0
Modify board b (list of lists) to account for move in string `move`. If the move is illegal, raises an exception.
def apply_move(b,player,move): move = move.strip().lower() if len(move)!=2: raise Exception("Valid move is two characters (e.g. A2 or B3)") if move[0] not in COLS: move = move[::-1] if move[0] not in COLS: raise Exception("No column spec found") j = COLS.index(move[0]) i ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def partial_move(B, cur_monkey_pos, cur_num_balloons, move):\n\n assert B[-1][cur_monkey_pos] == \"x\"\n R = len(B)\n C = len(B[0])\n\n new_board = [r for r in B[:-1]]\n new_bottom_row = [0 for _ in range(C)]\n new_monkey_pos = cur_monkey_pos\n new_num_balloons = cu...
[ "0.65394884", "0.6422928", "0.6320928", "0.62613", "0.61935437", "0.616798", "0.61599106", "0.6131119", "0.61113816", "0.60769236", "0.60658014", "0.60647887", "0.60047555", "0.597028", "0.59584993", "0.5950637", "0.59433466", "0.59427494", "0.5942658", "0.5942658", "0.594265...
0.81654453
0
Annotate sequence with kmer repeats.
def repeat_annotation(sequence, kmer_size): max_observed_repeats = [1 for i in range(len(sequence))] for i in range(len(sequence) - (kmer_size - 1)): kmer_count = 0 start_index = i end_index = i + (kmer_size - 1) for j in range(i, len(sequence), kmer_size): if sequenc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def annotate(m, ss_seq): # -> None:\n ...", "def repeat(self, number_of_repeats):\n return \"G\" + str(number_of_repeats)", "def kmer_composition(k, text):\r\n # TODO: your code here\r\n d = {}\r\n for i in range(len(text)-k+1):\r\n print(text[i:k+i])\r\n ''' \r\n if(...
[ "0.57868123", "0.53828126", "0.52845156", "0.51891977", "0.5072232", "0.5051787", "0.49803054", "0.49799493", "0.49720377", "0.49627554", "0.49418154", "0.49380988", "0.4931937", "0.49287304", "0.49239197", "0.4888765", "0.48718172", "0.48550633", "0.48515433", "0.48390466", ...
0.6944195
0
Return a specific BokehJS deployment file
def bokehjs_file(filename): return flask.send_from_directory(bokeh_app.bokehjsdir, filename)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bokehjssrc_file(filename):\n return flask.send_from_directory(bokeh_app.bokehjssrcdir, filename)", "def get_vendor_js():\n return (\"://plotly-load_from_python.js\",)", "def get_bokeh_resources() -> TemplateResourcesData:\n template_resources = TemplateResourcesData()\n template_res...
[ "0.7016131", "0.61770284", "0.6039032", "0.5895731", "0.58782774", "0.58702964", "0.567083", "0.5658906", "0.56109107", "0.5562391", "0.553811", "0.55331784", "0.55214226", "0.5498094", "0.5483374", "0.5479998", "0.54668665", "0.54259694", "0.54118305", "0.5410391", "0.540808...
0.740915
0
Return a specific BokehJS source code file
def bokehjssrc_file(filename): return flask.send_from_directory(bokeh_app.bokehjssrcdir, filename)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bokehjs_file(filename):\n return flask.send_from_directory(bokeh_app.bokehjsdir, filename)", "def source(self):\n return some.dap.source(py.path.local(self.co_filename))", "def getSource():", "def get_js_file(self):\n return 'placeholder'", "def get_vendor_js():\n return (\"://p...
[ "0.7006394", "0.61880594", "0.60094464", "0.5971398", "0.59102297", "0.590078", "0.58968616", "0.5809108", "0.57917756", "0.57526124", "0.5746741", "0.5706897", "0.5677012", "0.5642199", "0.55706066", "0.55467117", "0.5493918", "0.5486592", "0.54426706", "0.5422555", "0.54086...
0.6657942
1
This function should return a list containing the two highest quantity, in descending order, for all fruits.
def sorted_fruit_quantity(f): # skip the header of the file move_cursor(f) # put all the quantities into a list # expected output: [5, 10, 3, 15] # read the file line by line output = [] for line in f: line_list = line.split() # ["Apple","5"] output.append(int(line_list[1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_popular(self, max_items=None):\n data = [(x[1], x[0]) for x in self.iteritems()]\n data.sort(key=lambda x: (sys.maxint - x[0], x[1]))\n if max_items:\n return data[:max_items]\n else:\n return data", "def findSecondLargest(self):\n l = []\n ...
[ "0.62113386", "0.59263444", "0.586248", "0.5803011", "0.5801856", "0.5784802", "0.56722295", "0.5614632", "0.5612991", "0.55954313", "0.5578384", "0.5560552", "0.5556085", "0.5530599", "0.55201465", "0.55028576", "0.549978", "0.54275393", "0.5413033", "0.5404578", "0.5397812"...
0.7458074
0
Parse MBP data with given url
def parse_mbp_data(self, url): body = self.get_content(url) if body is None: return None doc_body = pq(body) content = doc_body('#main-container').html() lines = content.splitlines() record = { 'url': url, 'price': self.get_price(line...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse(self, url):\n pass", "def readData(url, data=[], code='gbk'):\n tmp = urlopen(url).read().decode(code)\n data.append(tmp)\n return tmp", "def parse_url(url):\n url_parts = url.split('/')\n webcam_name = url_parts[-3] + 'CAM' + url_parts[-2]\n file_ext = url[-5:-1]\n last_u...
[ "0.71271515", "0.63445747", "0.6134861", "0.5800437", "0.57923275", "0.5770726", "0.57677466", "0.57582086", "0.57255924", "0.5717655", "0.5700871", "0.5700769", "0.5692097", "0.56919336", "0.5638243", "0.56346065", "0.5613177", "0.5584839", "0.5567151", "0.5546901", "0.55404...
0.78535324
0
Test that reset fixtures endpoint is not available when it is not set up.
def test_reset_fixtures_url_not_found_if_not_setup(settings, caplog): caplog.set_level('WARNING') settings.ALLOW_TEST_FIXTURE_SETUP = None response = _request_reset_fixtures() assert response.status_code == status.HTTP_404_NOT_FOUND assert caplog.messages == [ 'The `reset_fixture` endpoint...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_url_found_if_env_setup():\n response = _request_reset_fixtures()\n assert response.status_code == status.HTTP_201_CREATED", "def testResetFixture(self):\n self.users.TESTAPI_resetFixture()\n self.users.add(\"katie\", \"password\")\n self.assertEqual(len(models.UsersModel.objec...
[ "0.75311947", "0.70474774", "0.6593545", "0.6578229", "0.6540039", "0.6540039", "0.6540039", "0.6540039", "0.64770347", "0.6421178", "0.6362949", "0.6320278", "0.63132834", "0.63124615", "0.62526333", "0.6231132", "0.6146283", "0.6138933", "0.61089426", "0.60708094", "0.60656...
0.8197186
0
Test that reset fixtures endpoint is available when set up.
def test_url_found_if_env_setup(): response = _request_reset_fixtures() assert response.status_code == status.HTTP_201_CREATED
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_reset_fixtures_url_not_found_if_not_setup(settings, caplog):\n caplog.set_level('WARNING')\n\n settings.ALLOW_TEST_FIXTURE_SETUP = None\n response = _request_reset_fixtures()\n assert response.status_code == status.HTTP_404_NOT_FOUND\n\n assert caplog.messages == [\n 'The `reset_fixt...
[ "0.7736993", "0.72713464", "0.6802365", "0.6663078", "0.6663078", "0.6663078", "0.6663078", "0.65864545", "0.6559959", "0.65343267", "0.6504166", "0.6477931", "0.6456893", "0.64509386", "0.64125675", "0.63783133", "0.63711256", "0.63341296", "0.62854946", "0.6279207", "0.6252...
0.7328642
1
Test new adviser is removed by reset fixtures.
def test_new_adviser_removed_by_reset_fixtures(): new_adviser_pk = AdviserFactory().pk _request_reset_fixtures() with pytest.raises(Advisor.DoesNotExist): Advisor.objects.get(pk=new_adviser_pk)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tearDown(self):\n del self.review", "def teardown(self):\n del self.testInst, self.dname\n\n return", "def tearDown(self):\n del self.new", "def tearDown(self):\n self.labGroup.delete()", "def teardown(self):\n del self.testInst, self.dname, self.test_vals, sel...
[ "0.6999229", "0.6923117", "0.68716764", "0.6839896", "0.6822065", "0.6816475", "0.68079275", "0.6801706", "0.6726831", "0.66917264", "0.66471547", "0.66471547", "0.6638085", "0.66222286", "0.66222286", "0.66222286", "0.66038674", "0.6575041", "0.6545409", "0.65337646", "0.651...
0.793325
0
Test that create user endpoint is not available when it is not set up.
def test_create_user_url_not_found_if_not_setup(settings, caplog): caplog.set_level('WARNING') settings.ALLOW_TEST_FIXTURE_SETUP = None response = _request_create_user(SEED_USER_DATA) assert response.status_code == status.HTTP_404_NOT_FOUND with pytest.raises(Advisor.DoesNotExist): Advisor...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_user_with_no_role(setup_client):\n client = setup_client\n payload = {\n 'email': 'test@gmail.com',\n 'password': 'password',\n 'name': 'Test name'\n }\n res = client.post(CREATE_USER_URL, payload)\n assert res.status_code == status.HTTP_400_BAD_REQUEST\n user...
[ "0.7512048", "0.749446", "0.749446", "0.749446", "0.7410163", "0.7287913", "0.7146045", "0.70801765", "0.70597535", "0.70591325", "0.70539397", "0.7052985", "0.7045943", "0.70404804", "0.70168406", "0.69980085", "0.6990669", "0.6990461", "0.6972314", "0.6959509", "0.69546616"...
0.7793711
0
Test that created user has token in the cache.
def test_created_user_has_token_in_cache(): _request_create_user(SEED_USER_DATA) token = SEED_USER_DATA['token'] cache_key = f'access_token:{token}' expected_data = { 'email': SEED_USER_DATA['email'], 'sso_email_user_id': SEED_USER_DATA['sso_email_user_id'], } assert cache.get(c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_created_token(self):\n user = USER_MODEL.objects.get(username='adam')\n self.assertIsInstance(user.auth_token, Token)", "def test_user_cache(self):\n original_token = TestExpirableToken(user=self.user)\n token = TestExpirableToken.from_key(original_token.key)\n\n def t...
[ "0.77992666", "0.7673849", "0.73526937", "0.7254399", "0.72008485", "0.7190135", "0.7173182", "0.7171363", "0.71571124", "0.71343976", "0.7132663", "0.70779663", "0.7049543", "0.70089614", "0.70026636", "0.6930913", "0.6918508", "0.6897834", "0.6893251", "0.68858415", "0.6873...
0.8843756
0
Test that load fixture endpoint is not available when it is not set up.
def test_load_fixture_url_not_found_if_not_setup(settings, caplog): caplog.set_level('WARNING') settings.ALLOW_TEST_FIXTURE_SETUP = None response = _request_load_fixture({'fixture': [ADVISER_FIXTURE]}) assert response.status_code == status.HTTP_404_NOT_FOUND with pytest.raises(Advisor.DoesNotExist...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_reset_fixtures_url_not_found_if_not_setup(settings, caplog):\n caplog.set_level('WARNING')\n\n settings.ALLOW_TEST_FIXTURE_SETUP = None\n response = _request_reset_fixtures()\n assert response.status_code == status.HTTP_404_NOT_FOUND\n\n assert caplog.messages == [\n 'The `reset_fixt...
[ "0.7058743", "0.68539953", "0.6779199", "0.6734878", "0.64859587", "0.6472031", "0.6463761", "0.6420841", "0.64076334", "0.63773966", "0.6344679", "0.63359773", "0.63262814", "0.62421185", "0.62360024", "0.62192965", "0.61953586", "0.61665833", "0.61644936", "0.615883", "0.61...
0.8150852
0
Test load fixture endpoint.
def test_load_fixture(caplog): caplog.set_level('INFO') with pytest.raises(Advisor.DoesNotExist): Advisor.objects.get(pk=ADVISER_FIXTURE['pk']) response = _request_load_fixture({'fixture': [ADVISER_FIXTURE]}) assert response.status_code == status.HTTP_201_CREATED adviser = Advisor.object...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fixture_example_data():\n import_example_data()", "def fixtures():", "def test_load_fixture_url_not_found_if_not_setup(settings, caplog):\n caplog.set_level('WARNING')\n\n settings.ALLOW_TEST_FIXTURE_SETUP = None\n response = _request_load_fixture({'fixture': [ADVISER_FIXTURE]})\n assert res...
[ "0.70628935", "0.6695335", "0.65467155", "0.6361524", "0.6320997", "0.6315157", "0.62557596", "0.61709154", "0.61625296", "0.6125355", "0.6113666", "0.6076544", "0.5988091", "0.59874165", "0.5981768", "0.59442526", "0.59401876", "0.59334683", "0.5930674", "0.5928487", "0.5926...
0.6883868
1
Draw all the objects in the scene
def draw_objects(): # Disable the turtle animation, and erase the scren. turtle.tracer(False) turtle.hideturtle() turtle.clear() # Draw all the parts of the scene. draw_ball() draw_target() draw_bounds() draw_pins() show_status() # Now show the screen, after everything ha...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw(self):\n for obj in self.objects:\n obj.draw()", "def draw_all_objects():\n\tglobal fuel_available\n\n\tbackground_module.draw_bg(win)\n\tbackground_module.draw_snow(win)\n\tobstacles_module.draw_obstacles(win)\n\tcoins_module.draw_coins(win)\n\tforeground_module.draw_fg(win)\n\n\tfor ...
[ "0.8355407", "0.77330977", "0.74636686", "0.74551225", "0.74239063", "0.73782027", "0.73662746", "0.7353718", "0.73440975", "0.7299292", "0.7276649", "0.72509795", "0.7222594", "0.71387583", "0.7134472", "0.69717264", "0.69685745", "0.6954083", "0.6932343", "0.6887796", "0.68...
0.81850326
1
Draw the ball at its current position
def draw_ball(): draw_circle(ball, 'yellow')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_ball(self):\n circle(screen, self.color, (self.x, self.y), self.r)", "def draw(self, ball):\n self.screen.fill(pygame.Color(0,0,0))\n self.screen.blit(ball.surf, (size[0]/2, size[1]/2)) #this puts it in roughly center of screen\n #add code to draw paddles and ball\n #p...
[ "0.86652905", "0.79869777", "0.7910737", "0.78856057", "0.77881765", "0.76972806", "0.76524436", "0.7610093", "0.76025486", "0.75768846", "0.7515461", "0.7492722", "0.7467942", "0.7458139", "0.7410807", "0.7403724", "0.7402274", "0.73503107", "0.7325099", "0.73093575", "0.724...
0.80440485
1
Draw the bounding rectangle.
def draw_bounds(): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_bounding_box(self):\n # Gets the bounding box\n xmin, ymin, xmax, ymax = self.get_bounding_box()\n\n # Gets the actual coordinates\n width = xmax - xmin\n height = ymax - ymin\n center_x = xmin + (width)/2\n center_y = ymin + (height)/2\n\n arcade.dr...
[ "0.83684695", "0.7127851", "0.71239257", "0.7029944", "0.7016083", "0.6983453", "0.6905837", "0.68964565", "0.6860532", "0.6849282", "0.6847225", "0.68461347", "0.6814617", "0.6795457", "0.6784434", "0.677645", "0.6746962", "0.6722924", "0.67197233", "0.66908365", "0.66871804...
0.7149721
1
Draw all the pins.
def draw_pins(): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_pins(self, data):\n # Here we set defaults (with 'or' keyword ...)\n ax = self.ax\n plot_pins = self.plot_pins\n plot_pins_values = self.plot_pins_values\n #plot_pins_method = self.plot_pins_method or \"highlight\"\n plot_pins_colors = self.plot_pins_colors\n\n ...
[ "0.71605074", "0.69108456", "0.67938644", "0.6536287", "0.65061176", "0.6492908", "0.64312756", "0.64153045", "0.64115673", "0.6386151", "0.63729346", "0.6363726", "0.633303", "0.6317614", "0.63137263", "0.6312137", "0.6292693", "0.62355477", "0.623256", "0.6231849", "0.61988...
0.79720926
0
Check if ball reached target. If it did, the game is won.
def check_ball_on_target(): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_hit(self):\n too_close_x = (PADDLE_WIDTH / 2) + BALL_RADIUS\n too_close_y = (PADDLE_HEIGHT / 2) + BALL_RADIUS\n\n if (abs(self.ball.center.x - self.paddle.center.x) < too_close_x and\n abs(self.ball.center.y - self.paddle.center.y) < too_close_y and\n ...
[ "0.71088266", "0.69896346", "0.6877738", "0.6813622", "0.67582506", "0.6734881", "0.67276996", "0.6638412", "0.66322345", "0.6532848", "0.6532257", "0.6510124", "0.6442143", "0.64397997", "0.6393392", "0.6384225", "0.6349237", "0.6344773", "0.6292504", "0.62760764", "0.626741...
0.79406464
0
Add a pin at the current mouse location. Turtle calls this when the user clicks the mouse.
def add_pin(x, y): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def on_mouse_press(self, x, y, button, modifiers):\n self.add_wall()", "def on_mouse_press(self, x, y, button):\n\n pass", "def follow(self):\n\t\tpos = pygame.mouse.get_pos()\n\t\tself.x = pos[0]\n\t\tself.y = pos[1]\n\t\tself.draw()", "def on_mouse_click(self, event: Event):\r\n self.c...
[ "0.663023", "0.6181395", "0.61187136", "0.6113998", "0.596101", "0.5897008", "0.58573025", "0.5833299", "0.5831222", "0.5831222", "0.5831222", "0.58044356", "0.5802026", "0.57402784", "0.5719253", "0.571508", "0.5689365", "0.5653827", "0.56509036", "0.5618501", "0.56167287", ...
0.666243
0
Take an input cubelist containing forecasts from different cycles and merges them into a single cube.
def process(self, cubelist: Union[List[Cube], CubeList]) -> Cube: cubelist = rebadge_forecasts_as_latest_cycle(cubelist) # Take all the realizations from all the input cube and # put in one array all_realizations = [cube.coord("realization").points for cube in cubelist] all_real...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def forecast_dataframe_to_cube(\n df: DataFrame, training_dates: DatetimeIndex, forecast_period: int,\n) -> Cube:\n\n representation_type = get_forecast_representation(df)\n\n fp_point = pd.Timedelta(int(forecast_period), unit=\"seconds\")\n\n cubelist = CubeList()\n\n for adate in training_dates:\n...
[ "0.64421564", "0.6407596", "0.58654726", "0.57194644", "0.5639017", "0.56262916", "0.5592745", "0.5590848", "0.55444646", "0.5433761", "0.53545725", "0.53041834", "0.5269207", "0.5209733", "0.51773715", "0.51301134", "0.5103274", "0.50630826", "0.50591546", "0.5052191", "0.50...
0.7402447
0
renders the `Dockerrun.aws.json` template
def render_template(self): apps = [{ 'name': container.name, 'image': container.image, 'environment': container.environment, 'memory': container.memory, 'portMappings': container.portmappings } for container in self.containers] t = sel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def template():\n\n return s3_rest_controller(rheader = s3db.dc_rheader)", "def render_application_template(self):\n self.pipeline_config['instance_links'] = self.retrieve_instance_links()\n jsondata = get_template(\n template_file='infrastructure/app_data.json.j2', appinfo=self.appin...
[ "0.59908485", "0.5553491", "0.54366165", "0.52986646", "0.5238119", "0.52351195", "0.5205839", "0.51638323", "0.5104337", "0.50358963", "0.50227344", "0.49910554", "0.498", "0.49713457", "0.49624127", "0.49354434", "0.48771748", "0.48728493", "0.48441127", "0.48303962", "0.48...
0.6472083
0
Creates an inmemory tarfile that will be used as the docker context
def create_docker_context(self): self.tarfile = io.BytesIO() with tarfile.open(fileobj=self.tarfile, mode="w|") as tar: for f in self.files: tarinfo = tarfile.TarInfo(f['name']) tarinfo.size = len(f['content']) if 'mode' in f: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _setup_input(self, g):\n tarbytes = io.BytesIO()\n with tempfile.NamedTemporaryFile() as f:\n g.serialize(f.name, format=\"turtle\")\n tar = tarfile.open(name=\"out.tar\", mode=\"w\", fileobj=tarbytes)\n tar.add(f.name, arcname=\"input.ttl\")\n tar.clos...
[ "0.6867456", "0.6238185", "0.62085533", "0.6141972", "0.6079956", "0.6012043", "0.5987858", "0.59485483", "0.5887969", "0.5852579", "0.57223886", "0.57056576", "0.569733", "0.56587726", "0.5656461", "0.5641944", "0.5628549", "0.56112605", "0.55963767", "0.5593278", "0.5589891...
0.8473896
0
runs docker build with the tarfile context
def build(self): docker = Client(version='auto') status = docker.build( fileobj=self.tarfile, custom_context=True, tag=self.tag, pull=True, nocache=True, rm=True, ) for line in status: # This effectively blocks on ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def docker_build(c):\n cli_tasks.docker_build.run(c)", "def prepare():\n sh('docker build --rm -t {image} {dir}', image=IMAGE, dir=os.path.dirname(__file__))", "def main():\n parser = argparse.ArgumentParser(\n epilog=main.__doc__, formatter_class=argparse.RawDescriptionHelpFormatter\n )\n ...
[ "0.73519874", "0.7246165", "0.718203", "0.70525706", "0.6954098", "0.6796647", "0.66760755", "0.66742986", "0.6608287", "0.64849854", "0.6475837", "0.6449171", "0.6399748", "0.6398399", "0.63747525", "0.6352232", "0.6344589", "0.6330966", "0.63261646", "0.62892073", "0.625937...
0.7421357
0
Pull the image and create a container with host_config
def setup(self): exists = [i for i in self.client.images() if self.image in i['RepoTags']] # Only pull the image if we don't have it if not exists or self.pull: self.client.pull(self.image) self.logger.debug("Pulled {}".format(self.image)) self.container = self...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_container(client):\n client.images.build(path=os.path.join(os.path.abspath(\"\"), \"docker\"), tag=\"scrape_light\")", "def pull_image(image):\n\n subprocess.check_call(['docker', 'pull', image])", "def run(self, container_config: ContainerConfig) -> Container:", "def create(dockerfile):\n\n ...
[ "0.73722464", "0.6459526", "0.641473", "0.6365599", "0.6323354", "0.62596554", "0.6234621", "0.6196366", "0.61554444", "0.6126631", "0.611109", "0.60908455", "0.60905975", "0.607649", "0.60459405", "0.6043136", "0.60285693", "0.60256535", "0.6020434", "0.5990217", "0.59659857...
0.70310724
1
Starts the container, and optionally executes a callback that is passed the container's info
def start(self, callback=None): self.logger.debug('Starting container {}'.format(self.image)) response = self.client.start(container=self.container['Id']) if response: self.logger.warning(response) self.logger.debug('Checking if {} service is ready'.format(self.name)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start(self, container: Container):", "def start(self):\n print \"start: starting container on {}\".format(self.daemon.host_name)\n\n if self.details is None:\n return None\n else:\n if not self.details['State']['Running'] is True:\n result = self.dae...
[ "0.71134686", "0.64065075", "0.6205256", "0.62037045", "0.61491776", "0.61437225", "0.6138378", "0.59322", "0.5895821", "0.58885634", "0.58424735", "0.5781214", "0.5735789", "0.57127005", "0.5699765", "0.5662697", "0.5651051", "0.56244475", "0.55596524", "0.55415326", "0.5539...
0.7372831
0
Run the provisioner of this class for a set of services
def provision(self, services, requirements=None): if hasattr(self, 'service_provisioner'): provisioner = self.service_provisioner(services=services, container=self, requirements=requirements) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def provision(self, services, requirements=None):\n try:\n super(SolrDockerRunner, self).provision(services=services, requirements=requirements)\n except UnknownServiceError as error:\n self.logger.warning('Skipping unknown service: {}'.format(error))\n pass", "def ...
[ "0.6875356", "0.6774575", "0.6473266", "0.6383183", "0.6231173", "0.6137074", "0.60712975", "0.6065705", "0.59697276", "0.5928502", "0.58171874", "0.5816484", "0.58089393", "0.58089393", "0.57664543", "0.5763337", "0.57344735", "0.56776404", "0.565801", "0.5621586", "0.561791...
0.7373676
0
Override default provisioning behaviour to skip services that are unknown.
def provision(self, services, requirements=None): try: super(SolrDockerRunner, self).provision(services=services, requirements=requirements) except UnknownServiceError as error: self.logger.warning('Skipping unknown service: {}'.format(error)) pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_no_adapter_opts_ignore_service_type(self):\n self.oslo_config_dict['heat'] = None\n self.assert_service_disabled(\n 'orchestration',\n \"Not in the list of requested service_types.\",\n # 'orchestration' absent from this list\n service_types=['comp...
[ "0.61637455", "0.6001985", "0.59038186", "0.59035575", "0.5794396", "0.5754696", "0.5706223", "0.5533597", "0.54840475", "0.54076886", "0.5395336", "0.5342867", "0.5318276", "0.5301154", "0.52795595", "0.5248005", "0.5178702", "0.5173064", "0.5153804", "0.51238096", "0.512186...
0.6283957
0
Class factory for the docker runner. Returns a specific class for a specific type of service.
def docker_runner_factory(image): mapping = { 'gunicorn': GunicornDockerRunner, 'redis': RedisDockerRunner, 'consul': ConsulDockerRunner, 'postgres': PostgresDockerRunner, 'registrator': RegistratorDockerRunner, 'solr': SolrDockerRunner } for key in mapping:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def instantiateServiceType(self):\n if self.codebase:\n module = self.codebase.instantiate(self.service_module_name)\n\n if self.service_class_name not in module.__dict__:\n raise Exception(\n \"Provided module %s at %s has no class %s. Options are:\\n...
[ "0.5989068", "0.590695", "0.58675516", "0.5845438", "0.57969826", "0.57343787", "0.5721487", "0.5721487", "0.5721487", "0.5721487", "0.5721487", "0.56905794", "0.56888777", "0.56245327", "0.5598864", "0.5569812", "0.5477469", "0.5466489", "0.5464835", "0.5444313", "0.5389793"...
0.7235535
0
Parse Amazon tracking numbers.
def parse_amazon(email): tracking_numbers = [] soup = BeautifulSoup(email[EMAIL_ATTR_BODY], 'html.parser') # see if it's an shipped order email order_number_match = re.search('Your AmazonSmile order #(.*?) has shipped', email[EMAIL_ATTR_SUBJECT]) if not order_number_match: order_n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_amazon_de(email):\n tracking_numbers = []\n \n soup = BeautifulSoup(email[EMAIL_ATTR_BODY], 'html.parser')\n\n # see if it's an shipped order email\n order_number_match = re.search('Order: #(.*?)\\n', email[EMAIL_ATTR_BODY])\n if not order_number_match:\n order_number_match = re.sea...
[ "0.6796474", "0.59640026", "0.59547", "0.55090153", "0.54678917", "0.5286884", "0.5229485", "0.52005845", "0.5179443", "0.5159709", "0.5023201", "0.4963213", "0.49453238", "0.49155068", "0.48985288", "0.48899448", "0.48797825", "0.48751968", "0.48676506", "0.4864119", "0.4863...
0.7204298
0
Initialising of delib64.dll (WIN10) a 64bit driver is expected. Number is the digit when more than one Interface of a Kind is configured..!
def __init__(self, Interface="USB", Number=DRIVER_NUM): self.bib = CDLL("delib64") # this will NOT fail... self.interface = Interface self.number = 0 #Number self.handle = 0 self.version = 0 if self.interface == "USB": self.createModule(self.RO_USB) e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testAbiCompatibility64(self):\n if self._dut.GetCpuAbiList(64):\n self._TestAbiCompatibility(64)\n else:\n logging.info(\"Skip the test as the device doesn't support 64-bit \"\n \"ABI.\")", "def is_64_windows():\n return struct.calcsize('P') ...
[ "0.6060997", "0.5781516", "0.5779918", "0.56639785", "0.5572633", "0.5572633", "0.5465029", "0.546459", "0.5433739", "0.54001945", "0.5360808", "0.53498805", "0.52878857", "0.52732784", "0.5250136", "0.5163056", "0.5147184", "0.51412493", "0.5082714", "0.5015851", "0.49879456...
0.5937619
1
Dieser Befehl dient zum Auslesen des TimeoutStatus. Argumente ([Debug=1])
def analogDaTimeoutStatus(self, Debug=0): self.bib.DapiSpecialCommand.argtypes = \ [c_ulong, c_ulong, c_ulong, c_ulong, c_ulong] self.bib.DapiSpecialCommand.restype = c_ulong timeout_status = self.bib.DapiSpecialCommand(self.handle,\ self.DAPI_SPECIAL_CMD_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def assert_timeout(self) -> None:", "def _timeout(signum, frame):\n # Raise TimeoutException with system default timeout message\n raise TimeoutException()", "def analogDaTimeoutOff(self, Debug=0):\n self.bib.DapiSpecialCommand.argtypes = \\\n [c_ulong, c_ulong, c_ulong,...
[ "0.7077678", "0.6608943", "0.65566635", "0.64567804", "0.6438783", "0.63034415", "0.63034415", "0.62909245", "0.6274172", "0.62536234", "0.6199818", "0.61930203", "0.61180824", "0.6080237", "0.6065386", "0.6058702", "0.6042492", "0.60340345", "0.6030219", "0.602094", "0.60089...
0.7469342
0
Mit diesem Befehl wird die Default Konfiguration eines D/A Wandlers geladen. Der D/A Wandler Kanal wird sofort auf die Ausgabespannung 0V gesetzt. Argumente (Startchannel, [Stopchannel>=Startchannel], [Debug=1])
def analogDaSetZero(self, Startchannel, Stopchannel=None, Debug=0): self.bib.DapiSpecialCommand.argtypes = \ [c_ulong, c_ulong, c_ulong, c_ulong, c_ulong] self.bib.DapiSpecialCommand.restype = None if Stopchannel == None or Stopchannel == Startchannel: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def default_channel(self) -> int:\r\n ...", "def configure_debug_options(self, initial_debug_options, ide_data):\r\n debug_options = copy.deepcopy(initial_debug_options)\r\n if \"cmsis-dap\" in debug_options[\"tool\"]:\r\n debug_options[\"server\"][\"arguments\"].extend( [\r\n ...
[ "0.5998552", "0.54007995", "0.51367766", "0.50856996", "0.50539327", "0.49470997", "0.48775223", "0.48275897", "0.48265904", "0.48177746", "0.48160458", "0.48083013", "0.47990912", "0.47555563", "0.47544914", "0.4741228", "0.4726859", "0.47231343", "0.4722098", "0.4722084", "...
0.6567898
0
Inicia un Equipo con un diccionario de atributos. La lista de pokemones vivos se guardan en una tupla junto a sus movimientos
def __init__(self, diccionario): self.numero = diccionario['numero'] self.nombre = diccionario['equipo_nombre'] self.pokmov = lectores.pokemon_y_movimiento_a_tuplas(diccionario)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self,jogadores):\r\n #Inicia alguns verificadores usados posteriormente na cena\r\n self.jogadores = jogadores\r\n self.teclas = [pygame.K_RETURN] + jogadores[2][4:7] + jogadores[3][4:7]\r\n self.tela = pygame.display.get_surface()\r\n self.area = self.tela.get_rect(...
[ "0.5493299", "0.53785163", "0.5365299", "0.529691", "0.52771807", "0.52318215", "0.5227122", "0.5218565", "0.5150027", "0.5147518", "0.51257867", "0.511523", "0.51093465", "0.5084413", "0.5066921", "0.50494576", "0.5047126", "0.5046697", "0.5029651", "0.5026552", "0.5024618",...
0.6067137
0
Shows add file dialog
def handleActionAdd(self): self.fDialog.show()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def handleAddFileButtonClicked(self):\n # Find the directory of the most recently opened image file\n mostRecentImageFile = PreferencesManager().get( 'DataSelection', 'recent image' )\n if mostRecentImageFile is not None:\n defaultDirectory = os.path.split(mostRecentImageFile)[0]\n ...
[ "0.73031515", "0.696894", "0.689285", "0.6701149", "0.6628294", "0.65997547", "0.6579842", "0.65336597", "0.6524251", "0.6516713", "0.6485592", "0.6429493", "0.6420707", "0.64015096", "0.6400006", "0.63792896", "0.6371303", "0.63395435", "0.633879", "0.6333457", "0.6301128", ...
0.74322236
0
Remove metadata by clicking X
def removeMeta(self, row, column): filePath = self.filesList.selectedItems()[0].text(2) metaHeader = (self.metadataList.item(row, 0)).text() logging.debug("Removing metadata " + metaHeader + " from " + str(filePath)) self.filesList.removeMeta(filePath, metaHeader, row)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def handleCleanMetadataKeep(self):\n logging.debug(\"Removing all metadata found...\")\n filePath = self.filesList.selectedItems()[0].text(2)\n self.filesList.removeAllMeta(filePath)", "def handleRemoveFile(self):\n for w in self.filesList.selectedItems():\n self.filesList....
[ "0.68331033", "0.6547086", "0.6482654", "0.612664", "0.6104849", "0.6095725", "0.6092427", "0.6057032", "0.60220397", "0.60176575", "0.59810984", "0.59810984", "0.59810984", "0.5941894", "0.5923921", "0.5883442", "0.5852436", "0.58467954", "0.58435553", "0.58377486", "0.57839...
0.720556
0
Clean metadata but keep orig file
def handleCleanMetadataKeep(self): logging.debug("Removing all metadata found...") filePath = self.filesList.selectedItems()[0].text(2) self.filesList.removeAllMeta(filePath)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def handleCleanMetadataRecon(self):\n logging.debug(\"Removing compromising personal info and remaking the file...\")\n filePath = self.filesList.selectedItems()[0].text(2)\n fileType = self.filesList.getFileObj(filePath).type\n self.printPdfPersonalData(filePath, \n fileType...
[ "0.68618995", "0.64275825", "0.6352827", "0.6342364", "0.6335688", "0.6319614", "0.6263183", "0.62409323", "0.62234294", "0.6124749", "0.6112678", "0.6087682", "0.60876715", "0.60499", "0.5985976", "0.5985", "0.5943836", "0.59089786", "0.58957404", "0.5872892", "0.5868339", ...
0.7287814
0
When all metadata has been cleared
def handleAllMetaClear(self, path): logging.debug("All Metadata removed, clearing the table...") self.metadataList.clear() self.metadataList.setRowCount(0) self.metadataList.setHorizontalHeaderLabels(["Metadata Header", "Value"]) self.fileNotSupported.hide() self.changeEn...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear(self):\n for tag in self.meta.findall(CN('meta:user-defined')):\n self.meta.remove(tag)", "def _data_reset(self):\n conn = self.get_connection()\n\n elements = {\n **self.domain.registry.aggregates,\n **self.domain.registry.entities,\n **...
[ "0.6969182", "0.67796546", "0.67119086", "0.6706552", "0.6681175", "0.66797686", "0.6666315", "0.66634107", "0.666299", "0.6652054", "0.66436225", "0.6625275", "0.66200304", "0.66101605", "0.6604598", "0.6599554", "0.6599554", "0.6599554", "0.6599554", "0.6599554", "0.6599554...
0.7667401
0
Print whatever is displayed in second tab as pdf to a file
def printPdfPersonalData(self, fileName, fileType, outFile): self.filesList.doBackup(fileName) self.filesList.cleanPdataMarks(fileName) if fileType != 'Pdf': outFile = AddedFile.changeExt(outFile, "pdf") #try: printer = QtGui.QPrinter() printer.set...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_pdf(f,s1,s2='',s3=''):\n # does not need reportlab!\n if s1 == 'White Ballot': s1 = '\"'+'_'*10+'\"'\n cod = zlib.compress('BT /F1 16 Tf ET\\r\\nBT 300 270 Td (%s) Tj ET\\r\\nBT /F1 48 Tf ET\\r\\nBT 5 180 Td (%16s) Tj ET\\r\\nBT /F1 12 Tf ET\\r\\nBT 10 50 Td (%s) Tj ET'%(s3,s1,s2))\n open(f,...
[ "0.63386774", "0.603243", "0.60320944", "0.58658314", "0.5812183", "0.57883507", "0.5786723", "0.578667", "0.5737755", "0.57349306", "0.572005", "0.5702959", "0.5675269", "0.56572753", "0.56041884", "0.5600227", "0.5594943", "0.5593114", "0.5561789", "0.55454755", "0.55392176...
0.6298324
1
Fired to change monitor settings
def handleMonitorSettings(self): winPos = self.mainWindow.pos() popPos = QtCore.QPoint(winPos.x() + (self.mainWindow.width() - self.settingsPopup.width()) / 2, winPos.y() + self.mainWindow.height() / 2) self.monitorPopUp.move(popPos) self.monitorPopUp.show()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def onSettings(self):\n pass", "def on_settings(self):\n\n # Pull the current app state from the relay Observer object\n status, interval, ntfc_status, ntfc_state = settings_state.get_state()\n\n # Pass it to the Observable object in order to render the Settings window\n settin...
[ "0.6998499", "0.69827586", "0.6755782", "0.66924405", "0.66287124", "0.6608246", "0.63384444", "0.62970036", "0.6287617", "0.6161331", "0.61515385", "0.6105742", "0.6073169", "0.6016056", "0.5997793", "0.59133375", "0.5907518", "0.5882294", "0.5860596", "0.58594835", "0.58119...
0.7010722
0
Says that some fields are numbers, and that if we take their sum with the given coefficients, then we get zero.
def sum_is_zero( coefficients: Iterable[float], period_as_delimiter: bool = False, force_dollar_decimal: bool = False) -> Predicate: coefficients = tuple(coefficients) assert isinstance(coefficients, tuple) return sum_is_near_zero( coefficients, tolerance=0, taper=0, period_as_delimi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_array_sum_equals_one(self):\n plugin = NonLinearWeights(0.85)\n result = plugin.process(self.cube, self.coord_name)\n self.assertAlmostEqual(result.data.sum(), 1.0)", "def EvaluateFields(self, *float, **kwargs):\n ...", "def __float__(self) -> float:\n\n if self.isSc...
[ "0.554289", "0.54029125", "0.5320744", "0.52942926", "0.5283152", "0.5266309", "0.5187975", "0.51559705", "0.51484704", "0.512571", "0.5122701", "0.51117337", "0.5079821", "0.5078284", "0.50656897", "0.506009", "0.50569785", "0.5051165", "0.5039959", "0.50171083", "0.50089896...
0.56769276
0
Says that some fields are numbers, and that if we take their sum with the given coefficients, then we get a number greater than (or equal to) the given bound.
def sum_is_at_least( lower_bound: float, coefficients: Iterable[float], strict: bool = True, period_as_delimiter: bool = False, force_dollar_decimal: bool = False) -> Predicate: coefficients = tuple(coefficients) assert isinstance(coefficients, tuple) return SumIsAtLeast( name=f'sum_is_a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lower_bound(self) -> float:\n ...", "def EvaluateFields(self, *float, **kwargs):\n ...", "def compute_bounds(self, weights, add_coeff, dual_vars, lower_bounds, upper_bounds, store_primal=False):\n x0_coeff = -weights[0].backward(dual_vars.mus[0])\n x0 = torch.where(x0_coeff >= 0...
[ "0.5581768", "0.5425924", "0.5421908", "0.53738344", "0.52734053", "0.52379966", "0.5235274", "0.51687074", "0.51636076", "0.515199", "0.51004237", "0.50439686", "0.5040996", "0.5032745", "0.50315386", "0.50006354", "0.4998004", "0.498631", "0.49774936", "0.49712873", "0.4968...
0.5817751
0
Says that a field is equal to the given amount, within a certain tolerance.
def is_nearly_equal_to( amount: float, tolerance: float = 0.5, taper: float = 0.5, period_as_delimiter: bool = False, force_dollar_decimal: bool = False) -> Predicate: return sum_is_approximately( amount, [1], tolerance, taper, period_as_delimiter, force_dollar_decimal)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_equal_to(amount: float) -> Predicate:\n return is_nearly_equal_to(amount, tolerance=0, taper=0)", "def test_amount_in_tons(self):", "def equals_exact(self, other, tolerance): # -> bool:\n ...", "def field_strength_close_enough(field_strength, desired_value):\n\n if field_strength > 100: #...
[ "0.6836401", "0.62156755", "0.607548", "0.5973551", "0.5941763", "0.5798628", "0.56204855", "0.56173027", "0.56075376", "0.5509888", "0.55034184", "0.54373276", "0.54291254", "0.54259545", "0.54057163", "0.5404048", "0.53798753", "0.5368738", "0.5363665", "0.53579444", "0.535...
0.6630341
1
Says that a field is exactly equal to some constant amount.
def is_equal_to(amount: float) -> Predicate: return is_nearly_equal_to(amount, tolerance=0, taper=0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testConsistency(self):\n #self.assertAlmostEqual(self.fxlinkedcashflow.amount(),0)", "def almost_equals(self, other, decimal=...): # -> bool:\n ...", "def test_amount_not_enough(self):\n item, change, _ = give_item_and_change('coke', .50)\n self.assertIsNone(item)\n self...
[ "0.55429107", "0.54905224", "0.5480013", "0.53962016", "0.53881603", "0.5347809", "0.5342059", "0.5293009", "0.52919525", "0.5226928", "0.5202861", "0.51783156", "0.51050514", "0.50568867", "0.50500894", "0.5043599", "0.502004", "0.5019618", "0.50104225", "0.4995071", "0.4995...
0.60709715
0
Says that a field is greater than some constant amount.
def is_greater_than( amount: float, strict: bool = True, period_as_delimiter: bool = False, force_dollar_decimal: bool = False) -> Predicate: return sum_is_at_least( amount, [1], strict, period_as_delimiter, force_dollar_decimal)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gt(value, limit):\n return value > limit", "def set_GreaterThan(self, value):\n super(MoneyReceivedInputSet, self)._set_input('GreaterThan', value)", "def _check_amount_with_priority(self):\n\t\tfor line in self:\n\t\t\tif line.tax_slide_id and (line.amount_from > line.tax_slide_id.max_amount\n\t...
[ "0.6415876", "0.63352454", "0.61581963", "0.6144837", "0.6097271", "0.60745937", "0.6043975", "0.6001427", "0.5897026", "0.58857834", "0.57591", "0.5754323", "0.57372165", "0.5720173", "0.571576", "0.5690224", "0.56693393", "0.5642554", "0.56385976", "0.5630668", "0.56058604"...
0.66399515
0
Says that a field is less than some constant amount.
def is_less_than( amount: float, strict: bool = True, period_as_delimiter: bool = False, force_dollar_decimal: bool = False) -> Predicate: return sum_is_at_least( -amount, [-1], strict, period_as_delimiter, force_dollar_decimal)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _on_order_amount_too_low(self, _msg):\r\n self.debug(\"### Server said: 'Order amount is too low'\")\r\n self.count_submitted -= 1", "def _check_amount_with_priority(self):\n\t\tfor line in self:\n\t\t\tif line.tax_slide_id and (line.amount_from > line.tax_slide_id.max_amount\n\t\t\t ...
[ "0.6527394", "0.60434765", "0.59778047", "0.5974657", "0.590551", "0.58676517", "0.5851458", "0.58318037", "0.5665455", "0.5614151", "0.5609212", "0.55952173", "0.5593226", "0.5548188", "0.5531906", "0.5519", "0.5454931", "0.5441718", "0.54397845", "0.5428812", "0.5411934", ...
0.67949855
0
Returns a 3x3 pixel array representing a superposition of all current probabilities for this block. This function is called every frame for multiple blocks and singlehandedly slows the program down by an enormous amount, but its worth it for the cool animation effect
def superposition(self): superpos_array = [[0,0,0],[0,0,0],[0,0,0]] #check normalised: n = sum(self.block_weights) if n != 1: #normalise here if required self.block_weights = [x/n for x in self.block_weights] o = self.block_opts w = self.bl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_block():\n final_locs = [[1 for x in range(LOC_SIZE)] for y in range(LOC_SIZE)]\n for a in range(int(LOC_SIZE / 2)):\n for b in range(a, int(LOC_SIZE / 2)):\n # creating and ringing each of the fleas individually\n print(a, b)\n locs = [[1 if x == a and y == b...
[ "0.5844929", "0.57490706", "0.5584011", "0.55778044", "0.54837716", "0.5467556", "0.5449255", "0.5446417", "0.542108", "0.54169047", "0.5410056", "0.53835994", "0.53662336", "0.5350493", "0.5349711", "0.5314925", "0.53075755", "0.5303564", "0.5294841", "0.52947766", "0.528507...
0.7223847
0
check for uncollapsed states (inefficient to say the least)
def check_done(grid): for row in grid: for el in row: if not el.collapsed: return False else: return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def states_filter(state):\n if state.count(0) < state.count(1) or state.count(1) < state.count(0) - 1:\n return False\n\n rows = [[i, i+1, i+2] for i in [0, 3, 6]]\n cols = [[i, i+3, i+6] for i in [0, 1, 2]]\n\n winners = set()\n\n for row_indexes in rows:\n row = [state[ind] for ind i...
[ "0.6629532", "0.63425463", "0.61981493", "0.6121164", "0.6120033", "0.60957247", "0.60479707", "0.6040906", "0.59273624", "0.58807003", "0.5855866", "0.58459675", "0.5830927", "0.57972974", "0.5793381", "0.57392114", "0.5736396", "0.5725186", "0.56908005", "0.5680616", "0.567...
0.66285646
1
Initializes the particles with supplied values for charge c, mass m, and position r.
def __init__(self, charge, mass, position): self.c = charge self.m = mass self.r = position
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self,nparticles,initial_condition):\n self.nparticles = nparticles\n self.particles = np.array([Particle(mass,x,y) for x,y,mass in initial_condition])\n self.mass = np.array([self.particles[i].mass for i in range(len(self.particles))])\n self.position = np.array([self.parti...
[ "0.6975022", "0.6936636", "0.683775", "0.6779028", "0.67131174", "0.6454496", "0.64482003", "0.63693637", "0.63533765", "0.63069123", "0.6258959", "0.62416065", "0.6235465", "0.61987317", "0.6110885", "0.60588974", "0.6033223", "0.60294825", "0.60294825", "0.5966522", "0.5964...
0.7580843
0
Create dict for the delete button
def create_delete_buttons_dict(self): btns_dict = dict() for index, _ in enumerate(self.games): btns_dict[index] = { "text": "X", "on_click": self.delete, "on_click_params": [index], } return btns_dict
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_delete(self, *args, **kw):\n return dict(args=args)", "def create_buttons_dict(self):\n btns_dict = dict()\n for index, game in enumerate(self.games):\n name = game.split(\".\")[0]\n btns_dict[name] = {\n \"text\": name,\n \"on_clic...
[ "0.6565306", "0.6262134", "0.61290956", "0.61241233", "0.6069019", "0.59521407", "0.59131736", "0.5907664", "0.59048676", "0.5899396", "0.5856733", "0.58457917", "0.58292425", "0.5824716", "0.5797817", "0.5747458", "0.5742509", "0.5717527", "0.5717527", "0.5717527", "0.569442...
0.80937445
0
Create the dict for all buttons
def create_buttons_dict(self): btns_dict = dict() for index, game in enumerate(self.games): name = game.split(".")[0] btns_dict[name] = { "text": name, "on_click": self.load, "on_click_params": [index], } return ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def createButtons(self):\r\n buttonsPosition = {\r\n \"BROWSE\": (3, 2),\r\n \"CALCULATE\": (13, 2),\r\n \"SAVE\": (14, 0),\r\n \"CLEAR\": (14, 1),\r\n \"DELETE\": (14, 2),\r\n \"PRINT\": (13, 3),\r\n \"GENERATE BILL\": (14, 3)\r\n...
[ "0.7700739", "0.7666546", "0.75279486", "0.7462629", "0.7061244", "0.68338764", "0.67945945", "0.67594445", "0.664118", "0.662812", "0.66155005", "0.6602516", "0.655123", "0.654498", "0.6542364", "0.6532947", "0.6517129", "0.6507127", "0.6499752", "0.64661855", "0.6426109", ...
0.84233403
0
Delete a file using the num
def delete(self, num): file_name = self.games[num] file_path = path.join(self.saved_games, file_name) if path.exists(file_path): os.remove(file_path) logger.info("Remove the file %s", file_path) else: logger.error("The file %s doesn't existe", file_pat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete(self, filename):\n pass", "def delete_file(filename):\n\tprint client.file_delete(filename)", "def _cleanup(self, fnum):\n while os.path.exists('%s.%s' % (self.name, fnum)):\n try:\n fname = '%s.%s' % (self.name, fnum)\n os.unlink(fname)\n ...
[ "0.71110225", "0.6855006", "0.6764861", "0.67404574", "0.65595174", "0.6554298", "0.6536192", "0.65095913", "0.6488798", "0.64819276", "0.6439041", "0.6333991", "0.6290185", "0.62683415", "0.62036484", "0.61600226", "0.61180073", "0.60894287", "0.60656404", "0.60478294", "0.6...
0.72493964
0
Listen for delete btns
def events_delete_btns(self): events = pg.event.get() for btn in self.delete_btns: btn.listen(events)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_IN_DELETE(self, event):", "def delete_callback(self):\n pass", "def process_IN_DELETE_SELF(self, event):", "def on_delete(key):\n pass", "def _notify_delete(self, cuds_object):", "def delete():\n click.echo('delete was called.')", "def link_delete_callback(self):\n p...
[ "0.7130073", "0.689843", "0.6717145", "0.6677733", "0.66146654", "0.6503768", "0.6409408", "0.6375576", "0.6330751", "0.6244449", "0.6194749", "0.6190247", "0.6078673", "0.6068437", "0.6011176", "0.6002316", "0.5930668", "0.58698416", "0.5839492", "0.58290255", "0.58205634", ...
0.7375204
0
Converts image of type torch.tensor to numpy.ndarray for matplotlib display image
def convert_tensor_to_numpy_img(tensor_img): img = tensor_img.to('cpu').clone().detach() img = img.numpy().squeeze(0) img = img.transpose(1, 2, 0) img = img * np.array((0.229, 0.224, 0.225)) + np.array((0.485, 0.456, 0.406)) img = img.clip(0, 1) return img
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tensor2im_raw(input_image, imtype=np.float64):\n if not isinstance(input_image, np.ndarray):\n if isinstance(input_image, torch.Tensor): # get the data from a variable\n image_tensor = input_image.data\n else:\n return input_image\n image_numpy = image_tensor[0].c...
[ "0.7048809", "0.6880173", "0.68093735", "0.6792789", "0.6757762", "0.67456317", "0.67265105", "0.6707813", "0.6678656", "0.665678", "0.6621333", "0.66024065", "0.6597689", "0.6589251", "0.65755355", "0.6522425", "0.6516791", "0.651404", "0.6482893", "0.64826477", "0.64555347"...
0.70222735
1
Displays two images side by side
def display_side_by_side_imgs(left_img, right_img, left_title='Left Image', right_title='Right Image', figsize=(16, 8)): # Convert the images to numpy arrays if they aren't already if isinstance(left_img, torch.Tensor): left_img = convert_tensor_to_numpy_img(left_img) if isinstance(right_img, torch...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_2gr(img1,img2,title1='',title2=''):\n\tf, (ax1,ax2) = plt.subplots(1,2,figsize=(20,10))\n\tax1.imshow(img1, cmap='gray')\n\tax1.set_title(title1)\n\tax2.imshow(img2, cmap='gray')\n\tax2.set_title(title2)\n\tplt.show()", "def AppendImages(im1, im2):\r\n im1cols, im1rows = im1.size\r\n im2cols, im2r...
[ "0.6887343", "0.6828774", "0.67714393", "0.66529375", "0.6530886", "0.6474752", "0.64064336", "0.64017236", "0.6242224", "0.6232678", "0.621642", "0.62152064", "0.61897266", "0.60866994", "0.60815114", "0.60736537", "0.60567325", "0.60536975", "0.6027479", "0.6007779", "0.599...
0.77245486
0
Loads the content and style images and resizes them if appropriate
def load_content_and_style_images(content_dir, style_dir, max_allowable_size=400, resize_shape=None): content_img = Image.open(content_dir).convert('RGB') style_img = Image.open(style_dir).convert('RGB') if max(content_img.size) > max_allowable_size: size = max_allowable_size else: siz...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initImages(self):\n pass", "def initImages(self):\n pass", "def initImages(self):\n pass", "def load(cls):\n\n cls.images[\"Wall\"] = pygame.image.load(\n \"ressources/images/wall.png\").convert()\n cls.images[\"MacGyver\"] = pygame.image.load(\n \...
[ "0.6116834", "0.6116834", "0.6116834", "0.6100597", "0.58552134", "0.5844597", "0.57763934", "0.5733679", "0.5689809", "0.56692624", "0.56571907", "0.5629311", "0.5606127", "0.5604215", "0.54896915", "0.5474187", "0.5467254", "0.5459076", "0.5442688", "0.54306614", "0.5427533...
0.6643331
0
Check if item is a container (list, tuple, dict, set).
def is_container(item): if isinstance(item, str): return False elif hasattr(item, "__iter__"): return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_is_container(self):\n # verify ----------------------\n try:\n 1 in self.collection\n except TypeError:\n msg = \"'Collection' object is not container\"\n self.fail(msg)", "def is_container(value: object) -> TypeGuard[AnyContainer]:\n if isinstanc...
[ "0.7344212", "0.71971273", "0.7153404", "0.6666673", "0.6665677", "0.6573487", "0.6531076", "0.65197587", "0.6327977", "0.6293779", "0.62678146", "0.61821836", "0.61464983", "0.6091407", "0.5965194", "0.5935714", "0.59311116", "0.58759165", "0.58688784", "0.5863264", "0.58010...
0.8535093
0
Copies all "filesets" found within the nested value (e.g. dict, list,...) into the destination directory. If no nested filesets are found then the original value is returned. Note that multiple nested filesets (e.g. a list) will to have unique names names (i.e. not differentiated by parent directories) otherwise there ...
def copy_nested_files( value: ty.Any, dest_dir: os.PathLike, supported_modes: FileSet.CopyMode = FileSet.CopyMode.any, **kwargs, ) -> ty.Any: from ..utils.typing import TypeParser # noqa cache: ty.Dict[FileSet, FileSet] = {} def copy_fileset(fileset: FileSet): try: ret...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_tree(self, src, dst):\n srcset_fmt = self.kw['image_srcset_format']\n srcset_sizes_all = self.kw['image_srcset_sizes']\n base_len = len(src.split(os.sep))\n for root, dirs, files in os.walk(src, followlinks=True):\n root_parts = root.split(os.sep)\n dst...
[ "0.51228863", "0.5028856", "0.5017779", "0.49732214", "0.4929427", "0.48665708", "0.48508525", "0.48083517", "0.4803307", "0.47982416", "0.47842366", "0.4758702", "0.47544804", "0.47480837", "0.46908888", "0.46712145", "0.46549702", "0.46467698", "0.46445325", "0.46301386", "...
0.67138475
0
Update all templates that are present in the input spec. Should be run when all inputs used in the templates are already set.
def template_update(inputs, output_dir, state_ind=None, map_copyfiles=None): inputs_dict_st = attr.asdict(inputs, recurse=False) if map_copyfiles is not None: inputs_dict_st.update(map_copyfiles) if state_ind is not None: for k, v in state_ind.items(): k = k.split(".")[1] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_templates(self):\n\n params = self.chose_param_value(\"--temp\")\n self._check_path_availability([\"get_template_dir\", \"get_template_dir_to\"])\n if self._check_whether_has_params(params):\n self.updater.update_files(\n self.analizer.get_template_dir(),\n...
[ "0.6427744", "0.6378328", "0.6020482", "0.5955375", "0.57841974", "0.56510425", "0.5642654", "0.56077933", "0.5507823", "0.5482123", "0.5453561", "0.54000205", "0.53835785", "0.5374027", "0.5366222", "0.5319401", "0.529433", "0.5287437", "0.52484876", "0.52362716", "0.5217521...
0.66228896
0
Update a single template from the input_spec or output_spec based on the value from inputs_dict (checking the types of the fields, that have "output_file_template)"
def template_update_single( field, inputs, inputs_dict_st=None, output_dir=None, spec_type="input" ): # if input_dict_st with state specific value is not available, # the dictionary will be created from inputs object from ..utils.typing import TypeParser # noqa from pydra.engine.specs import LazyFi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def template_update(inputs, output_dir, state_ind=None, map_copyfiles=None):\n\n inputs_dict_st = attr.asdict(inputs, recurse=False)\n if map_copyfiles is not None:\n inputs_dict_st.update(map_copyfiles)\n\n if state_ind is not None:\n for k, v in state_ind.items():\n k = k.split(...
[ "0.7439741", "0.72382534", "0.60887206", "0.59132934", "0.5788574", "0.56543916", "0.56279784", "0.5626978", "0.56007934", "0.5551346", "0.5531838", "0.54618365", "0.54196817", "0.5366506", "0.5351712", "0.5350561", "0.5340694", "0.5319279", "0.5318077", "0.53120196", "0.5301...
0.7494106
0
Formatting the field template based on the values from inputs. Taking into account that the field with a template can be a MultiOutputFile and the field values needed in the template can be a list returning a list of formatted templates in that case. Allowing for multiple input values used in the template as longs as t...
def _template_formatting(field, inputs, inputs_dict_st): from .specs import MultiInputObj, MultiOutputFile # if a template is a function it has to be run first with the inputs as the only arg template = field.metadata["output_file_template"] if callable(template): template = template(inputs) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _element_formatting(template, values_template_dict, file_template, keep_extension):\n if file_template:\n fld_name_file, fld_value_file = file_template\n # splitting the filename for name and extension,\n # the final value used for formatting depends on the template and keep_extension f...
[ "0.653768", "0.5750648", "0.56986177", "0.53870606", "0.53678", "0.5362524", "0.5332941", "0.52641904", "0.52122486", "0.51070577", "0.50978017", "0.50938904", "0.50394", "0.5031101", "0.5029822", "0.50264037", "0.50131285", "0.49867523", "0.4916825", "0.49085638", "0.4908232...
0.8142701
0
Formatting a single template for a single element (if a list). Taking into account that a file used in the template (file_template) and the template itself could have file extensions (assuming that if template has extension, the field value extension is removed, if field has extension, and no template extension, than i...
def _element_formatting(template, values_template_dict, file_template, keep_extension): if file_template: fld_name_file, fld_value_file = file_template # splitting the filename for name and extension, # the final value used for formatting depends on the template and keep_extension flag ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _template_formatting(field, inputs, inputs_dict_st):\n from .specs import MultiInputObj, MultiOutputFile\n\n # if a template is a function it has to be run first with the inputs as the only arg\n template = field.metadata[\"output_file_template\"]\n if callable(template):\n template = templa...
[ "0.7629409", "0.6301995", "0.605785", "0.58470714", "0.58328855", "0.5744207", "0.56723994", "0.56697905", "0.5642098", "0.5629034", "0.55882555", "0.55636996", "0.537064", "0.53584594", "0.5324042", "0.52790993", "0.5207045", "0.5204724", "0.51992595", "0.5162257", "0.515569...
0.80320483
0
Check whether a file path is on a CIFS filesystem mounted in a POSIX host. POSIX hosts are assumed to have the ``mount`` command. On Windows, Docker mounts host directories into containers through CIFS shares, which has support for Minshall+French symlinks, or text files that the CIFS driver exposes to the OS as symlin...
def on_cifs(cls, path: os.PathLike) -> bool: return cls.get_mount(path)[1] == "cifs"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ismount(path):\n try:\n s1 = os.lstat(path)\n except (OSError, ValueError):\n # It doesn't exist -- so not a mount point. :-)\n return False\n else:\n # A symlink can never be a mount point\n if os.path.stat.S_ISLNK(s1.st_mode):\n return False\n\n if is...
[ "0.6743361", "0.6556107", "0.64604294", "0.62453586", "0.6219545", "0.61390376", "0.60891384", "0.60775924", "0.60729563", "0.5945389", "0.5936177", "0.58674806", "0.5843192", "0.5838682", "0.5829992", "0.58089876", "0.58017236", "0.5783103", "0.575349", "0.5714421", "0.56780...
0.7511037
0
Parse the output of ``mount`` to produce (path, fs_type) pairs. Separated from _generate_cifs_table to enable testing logic with real outputs
def parse_mount_table( cls, exit_code: int, output: str ) -> ty.List[ty.Tuple[str, str]]: # Not POSIX if exit_code != 0: return [] # Linux mount example: sysfs on /sys type sysfs (rw,nosuid,nodev,noexec) # <PATH>^^^^ ^^^^^<FSTYPE> ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_cifs_table(cls) -> ty.List[ty.Tuple[str, str]]:\n exit_code, output = sp.getstatusoutput(\"mount\")\n return cls.parse_mount_table(exit_code, output)", "def parseMountOutput(output):\n\t\n\t# none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)\n\t\n\tparsedOutput = {}\n\tregex = \"...
[ "0.7389289", "0.73763126", "0.63220066", "0.6211202", "0.6031662", "0.58249325", "0.5824795", "0.581613", "0.57998055", "0.57176316", "0.5709025", "0.5650004", "0.56220317", "0.55568707", "0.5532059", "0.5520358", "0.54857093", "0.5449704", "0.54308045", "0.5396903", "0.53783...
0.78553987
0
Patch the mount table with new values. Used in test routines
def patch_table(cls, mount_table: ty.List[ty.Tuple[str, str]]): orig_table = cls._mount_table cls._mount_table = list(mount_table) try: yield finally: cls._mount_table = orig_table
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_patch_creation(self):\n host = synthetic_host(\"myserver\")\n self.create_simple_filesystem(host)\n\n spare_volume_1 = synthetic_volume_full(host)\n spare_volume_2 = synthetic_volume_full(host)\n\n response = self.api_client.patch(\n \"/api/target/\",\n ...
[ "0.5773485", "0.5543964", "0.55399096", "0.55399096", "0.5520308", "0.5501401", "0.5501401", "0.54936635", "0.5452065", "0.5429425", "0.5401314", "0.5326435", "0.52833074", "0.52653056", "0.5258198", "0.524147", "0.5234455", "0.5214115", "0.51976144", "0.5178994", "0.5161263"...
0.7760954
0
Takes OPTAA data streamed to shore from the Cabled Array benthic platforms and cleans up the data set to make it more userfriendly. Primary task is renaming parameters and dropping some that are of limited use. Additionally, recalculate the intermediate products (e.g. absorption and attenuation) and add them to the dat...
def optaa_benthic(ds, cal_file): # check to see if there is more than one deployment in the data set if len(np.unique(ds['deployment'].values)) > 1: raise ValueError('More than one deployment in the data set. Please structure processing request to process ' 'one deployment at a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def optaa_profiler(ds, cal_file):\n # check to see if there is more than one deployment in the data set\n if len(np.unique(ds['deployment'].values)) > 1:\n raise ValueError('More than one deployment in the data set. Please structure processing request to process '\n 'one deplo...
[ "0.65322304", "0.5709489", "0.56655955", "0.5427672", "0.5351284", "0.5349491", "0.53222907", "0.5319463", "0.53075916", "0.53012884", "0.52932554", "0.52810115", "0.5260214", "0.5258429", "0.5253238", "0.5209871", "0.5207418", "0.51765686", "0.5168372", "0.5157539", "0.51569...
0.7241779
0
Takes OPTAA data recorded by the Cabled Shallow Profiler system and cleans up the data set to make it more userfriendly. Primary task is renaming parameters and dropping some that are of limited use. Additionally, recalculate the intermediate products (e.g. absorption and attenuation) and add them to the data set. Fina...
def optaa_profiler(ds, cal_file): # check to see if there is more than one deployment in the data set if len(np.unique(ds['deployment'].values)) > 1: raise ValueError('More than one deployment in the data set. Please structure processing request to process ' 'one deployment at ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def optaa_benthic(ds, cal_file):\n # check to see if there is more than one deployment in the data set\n if len(np.unique(ds['deployment'].values)) > 1:\n raise ValueError('More than one deployment in the data set. Please structure processing request to process '\n 'one deploy...
[ "0.6758269", "0.5737575", "0.5548193", "0.55029297", "0.5438735", "0.5360984", "0.5309265", "0.5304964", "0.52679616", "0.52612615", "0.5233207", "0.5211206", "0.5194293", "0.51810217", "0.51801294", "0.5130102", "0.5125658", "0.51204294", "0.51127857", "0.5099757", "0.507698...
0.6933069
0
Create a new wavelength named name, belonging to XCrystal object crystal, with wavelength and optionally f_pr, f_prpr assigned.
def __init__( self, name, crystal, wavelength, f_pr=0.0, f_prpr=0.0, dmin=0.0, dmax=0.0 ): # set up this object self._name = name self._crystal = crystal self._wavelength = wavelength self._f_pr = f_pr self._f_prpr = f_prpr self._resolution_high = dm...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, crystal, wavelength=1.54184, max2theta=180):\n self.wavelength = wavelength\n self.max2theta = np.radians(max2theta)\n self.name = crystal.name\n self.all_dhkl(crystal)\n self.atom_scatter(crystal)\n self.structure_factor(crystal)\n self.rec_matri...
[ "0.6480484", "0.61226916", "0.5979", "0.554436", "0.54751027", "0.5458804", "0.5410918", "0.53420633", "0.52742976", "0.5226003", "0.5211166", "0.52007395", "0.5154255", "0.5141563", "0.50950485", "0.5072513", "0.5064921", "0.506434", "0.503512", "0.50331575", "0.503013", "...
0.6854536
0
Add a sweep to this wavelength.
def add_sweep( self, name, sample, directory=None, image=None, beam=None, reversephi=False, distance=None, gain=0.0, dmin=0.0, dmax=0.0, polarization=0.0, frames_to_process=None, user_lattice=None, us...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_sweep(self, environment_name, agent_name, agent_params, sweep_dict):\n assert environment_name in self._environment_dict\n assert self._is_sweep is True or self._is_sweep is None\n self._is_sweep = True\n\n for sweep_key, sweep_params in sweep_dict.items():\n sweep_na...
[ "0.5718773", "0.56797856", "0.56797856", "0.5633566", "0.54784757", "0.5438503", "0.52998817", "0.5227742", "0.51928663", "0.5173931", "0.5164654", "0.5148041", "0.51270616", "0.5124847", "0.5116086", "0.5052501", "0.4995556", "0.4933879", "0.48856956", "0.48348308", "0.48040...
0.6326733
0
Remove a sweep object from this wavelength.
def remove_sweep(self, sweep): try: self._sweeps.remove(sweep) except ValueError: pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove(self):\n\n if self.selected_point is None:\n RosProxy().notify(\"No calibration point selected\", STATE.ERROR)\n return\n\n if len(self.poses) == 0:\n RosProxy().notify(\"No calibration point added\", STATE.ERROR)\n return\n\n self.poses.r...
[ "0.6072216", "0.59406203", "0.57992524", "0.5782639", "0.577996", "0.5719137", "0.5677598", "0.5662963", "0.55765265", "0.5548133", "0.54995716", "0.54995716", "0.5497622", "0.5481501", "0.5480912", "0.54672265", "0.54672265", "0.54672265", "0.54426044", "0.54155236", "0.5411...
0.8053079
0
Test HSMCatalog with fourth_order=True
def test_fourth_order(): if __name__ == '__main__': logger = piff.config.setup_logger(verbose=2) else: logger = piff.config.setup_logger(log_file='output/test_hsmcatalog.log') image_file = os.path.join('output','test_stats_image.fits') cat_file = os.path.join('output','test_stats_cat.fi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_catalogd_ha_with_two_catalogd(self):\n # Verify two catalogd instances are created with one as active.\n catalogds = self.cluster.catalogds()\n assert(len(catalogds) == 2)\n catalogd_service_1 = catalogds[0].service\n catalogd_service_2 = catalogds[1].service\n assert(catalogd_service_1....
[ "0.5679821", "0.5636545", "0.563482", "0.55582744", "0.5495829", "0.54825354", "0.542668", "0.5405813", "0.53886825", "0.5386127", "0.5382041", "0.5373458", "0.53299606", "0.5318472", "0.5315026", "0.5302098", "0.5281488", "0.52782816", "0.5272447", "0.5270211", "0.52653223",...
0.65491086
0
Test that extra property_cols get output correctly in the hsm output file.
def test_property_cols(): image_file = 'input/D00572501_z_c01_r3624p01_immasked.fits.fz' cat_file = 'input/D00572501_z_c01_r5473p01_piff.fits' psf_file = os.path.join('output','test_property_cols.piff') hsm_file = os.path.join('output','test_property_cols_hsm.fits') nstars = 25 scale = 0.26 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_overall_report_columns():\n assert (len(overall_data['columns']) == 31)", "def test_columns_property():\n atom = ATOMClassifier(X_bin, y_bin, random_state=1)\n atom.run(\"LR\")\n assert [i == j for i, j in zip(atom.lr.columns, atom.columns)]", "def test_test_inline_additional_properties(se...
[ "0.6619292", "0.6011231", "0.59809303", "0.5905065", "0.585393", "0.57667685", "0.57197595", "0.5662904", "0.5658392", "0.5605069", "0.5597131", "0.55891824", "0.55626684", "0.5546742", "0.5512642", "0.54545933", "0.54532987", "0.5363769", "0.5359847", "0.53222424", "0.531920...
0.69262546
0
Clean realtime ACE data using the status flag. Note Supports 'clean' and 'dirty'. Replaces all fill values with NaN. Clean status flag of zero (nominal data) Dirty status flag < 9 (accepts bad data record, removes no data record)
def clean(self): # Perform the standard ACE cleaning max_status = mm_ace.clean(self) # Replace bad values with NaN and remove times with no valid data self.data = self.data[self.data['status'] <= max_status] return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clean(self):\n # Perform the standard ACE cleaning\n max_status = mm_ace.clean(self)\n\n # Replace bad values with NaN and remove times with no valid data\n ecols = ['eflux_38-53', 'eflux_175-315']\n\n # Evaluate the electron flux data\n self[self.data['status_e'] > max_status, ecols] = np.na...
[ "0.7062222", "0.63833", "0.5580094", "0.54640067", "0.54481626", "0.54345834", "0.53934324", "0.53778213", "0.5357182", "0.5213894", "0.5210961", "0.5201395", "0.51904184", "0.51801556", "0.5167267", "0.51572317", "0.5042241", "0.5039813", "0.5034535", "0.4995818", "0.4974025...
0.7725932
0
Sets the last_modified_by of this JsonJdbcIngestionProperties.
def last_modified_by(self, last_modified_by): self._last_modified_by = last_modified_by
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def last_modified_by(self, last_modified_by):\n if last_modified_by is not None and len(last_modified_by) > 100:\n raise ValueError(\"Invalid value for `last_modified_by`, length must be less than or equal to `100`\")\n\n self._last_modified_by = last_modified_by", "def last_modified_by(...
[ "0.70193124", "0.61000824", "0.6093348", "0.6093348", "0.6093348", "0.6093348", "0.6093348", "0.6093348", "0.6086628", "0.60032386", "0.59836704", "0.59836704", "0.59836704", "0.5972933", "0.5936987", "0.58601046", "0.5848984", "0.54824483", "0.5478924", "0.5438711", "0.53765...
0.73591125
1