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
Download and install libgit2 which is required for pygit2 to successfully install.
def install_libgit2(project, logger): logger.info('Installing libgit2') cmd = """cd {0} export LIBGIT2=$VIRTUAL_ENV wget --no-clobber https://github.com/libgit2/libgit2/archive/v0.27.0.tar.gz tar xzf v0.27.0.tar.gz cd libgit2-0.27.0/ cmake . -DCMAKE_INSTALL_PREFIX=$LIBGIT...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def install_pygit2(project, logger):\n logger.info('Installing pygit2')\n run(project, logger, 'install_pygit2',\n \"\"\"export LDFLAGS=\"-Wl,-rpath=$VIRTUAL_ENV/lib,--enable-new-dtags $LDFLAGS\"\n pip install pygit2\n \"\"\")", "def install_git():\n git_version = sudo(GET_GIT_VERSI...
[ "0.77398574", "0.7249191", "0.69537276", "0.6545011", "0.62069523", "0.5564112", "0.5404411", "0.5327779", "0.524122", "0.5209403", "0.5192777", "0.51571083", "0.5147198", "0.5102415", "0.5097236", "0.5022784", "0.50179553", "0.4982487", "0.493798", "0.49253458", "0.49153286"...
0.84321564
0
Install the pygit2 library using pip and setting installation environment variables.
def install_pygit2(project, logger): logger.info('Installing pygit2') run(project, logger, 'install_pygit2', """export LDFLAGS="-Wl,-rpath=$VIRTUAL_ENV/lib,--enable-new-dtags $LDFLAGS" pip install pygit2 """)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def install_git():\n git_version = sudo(GET_GIT_VERSION)\n if git_version != GIT_VERSION:\n git_file = 'git-%s' % GIT_VERSION\n sudo('apt-get -y -qq install build-essential')\n sudo('apt-get -y -qq install git-core')\n sudo('apt-get -y -qq install libcurl4-gnutls-dev')\n su...
[ "0.7309339", "0.73023087", "0.71874726", "0.7113304", "0.67602336", "0.6557317", "0.6341801", "0.63236785", "0.62802774", "0.6251897", "0.6244256", "0.6194353", "0.610102", "0.6059242", "0.60097504", "0.60044116", "0.59963804", "0.5992849", "0.59630215", "0.59244645", "0.5887...
0.8216769
0
Run a command in a shell during a PyBuilder task saving the stdout and stderr to log files. If the command has a nonzero return code then this method raises an exception.
def run(project, logger, cmd_name, command): dir_logs = project.expand('$dir_logs') pybuilder.utils.mkdir(dir_logs) out_file = os.path.join(dir_logs, '{0}.log'.format(cmd_name)) err_file = os.path.join(dir_logs, '{0}.err'.format(cmd_name)) with open(out_file, 'w') as out: with open(err_file,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def shell_command(context, cmd, err_msg=\"Shell command error\"):\n try:\n\n context.last_cmd = cmd\n output = check_output(cmd, shell=True, cwd=os.getcwd())\n context.output = output\n\n except:\n raise Exception(err_msg)", "def shell_call(cmd):\n try:\n x = subproces...
[ "0.70197976", "0.6820834", "0.66670644", "0.6627578", "0.6611891", "0.6609212", "0.65551454", "0.65467024", "0.6531316", "0.6498462", "0.64806837", "0.6477784", "0.6460485", "0.6441033", "0.64203894", "0.64161766", "0.6415231", "0.6395721", "0.63923085", "0.63921595", "0.6381...
0.6978815
1
Create one hot encording for col with categorical values
def one_hot_encode(df, col): return pd.get_dummies(df, columns=[col], drop_first=True)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def one_hot(df):\r\n # One-hot encode into \r\n cols = ['job', 'marital', 'education', 'month', 'day_of_week', 'poutcome']\r\n for each in cols:\r\n dummies = pd.get_dummies(df[each], prefix=each, drop_first=False)\r\n df = pd.concat([df, dummies], axis=1)\r\n df = df.drop(cols,axis=1)\r\...
[ "0.8213999", "0.7992415", "0.7934065", "0.7920715", "0.7897", "0.78310907", "0.77867526", "0.77250856", "0.7717482", "0.76147443", "0.7604407", "0.7572797", "0.75650924", "0.747969", "0.7457344", "0.7382538", "0.7373748", "0.7361014", "0.7351078", "0.73424554", "0.7333285", ...
0.82377976
0
Testing make_readable function Write a function, which takes a nonnegative integer (seconds) as input and returns the time in a humanreadable
def test_make_readable(self): allure.dynamic.title("Testing make_readable function") allure.dynamic.severity(allure.severity_level.NORMAL) allure.dynamic.description_html('<h3>Codewars badge:</h3>' '<img src="https://www.codewars.com/users/myFirstCode' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_human_readable_duration():\n\n human_readable = common.get_human_readable_duration(-1)\n assert human_readable == '0 seconds'\n\n human_readable = common.get_human_readable_duration(10)\n assert human_readable == '10 seconds'\n\n human_readable = common.get_human_readable_duration(1000)...
[ "0.7019865", "0.6637749", "0.66016406", "0.63338983", "0.6269463", "0.62167966", "0.6178313", "0.61362475", "0.6118505", "0.6079267", "0.60681957", "0.6022838", "0.58842665", "0.58806515", "0.58656436", "0.5829405", "0.5824475", "0.5809686", "0.57852244", "0.578276", "0.57743...
0.72516245
0
Compare two SIAF files and write a difference file. Generate comparison figures showing the apertures if specified.
def compare_siaf(comparison_siaf_input, fractional_tolerance=1e-4, reference_siaf_input=None, report_file=None, report_dir=None, verbose=True, make_figures=False, selected_aperture_name=None, ignore_attributes=None, tags=None): if verbose: print(comparison_siaf_input) c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compare_inspection_figures(comparison_siaf_input,reference_siaf_input=None, report_dir=None,\n selected_aperture_name=None, tags=None, save_plot=True, mark_ref=False,\n xlimits=None, filename_appendix='', label=False):\n comparison_siaf = get_siaf(...
[ "0.6495427", "0.62420374", "0.6132994", "0.6128699", "0.60996085", "0.60784477", "0.60725087", "0.6021504", "0.5965479", "0.59513444", "0.59205085", "0.59193194", "0.5916532", "0.5907526", "0.589175", "0.58668345", "0.58446723", "0.5815307", "0.5789262", "0.5782135", "0.57737...
0.6607743
0
Compare two dictionaries and return keys of the differing items.
def dict_compare(dictionary_1, dictionary_2): d1_keys = set(dictionary_1.keys()) d2_keys = set(dictionary_2.keys()) intersect_keys = d1_keys.intersection(d2_keys) added = d1_keys - d2_keys removed = d2_keys - d1_keys modified = {o: (dictionary_1[o], dictionary_2[o]) for o in intersect_keys ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dictdiff(dict_one, dict_two):\n output = {}\n all_keys = dict_one.keys() | dict_two.keys()\n\n for key in all_keys:\n if dict_one.get(key) != dict_two.get(key):\n output[key] = [dict_one.get(key), dict_two.get(key)]\n\n return output", "def difference_of_dictionaries(a: dict, b:...
[ "0.7863834", "0.75672305", "0.75033027", "0.74819106", "0.740573", "0.7351232", "0.7209886", "0.71785253", "0.7006115", "0.69432664", "0.68215483", "0.6817689", "0.680994", "0.6788562", "0.673978", "0.67011505", "0.66539055", "0.6653185", "0.6637728", "0.66241455", "0.6618693...
0.79273677
0
Configures a new cloud connector and authenticates the cloud user.
def configure_connector(provider): logging.getLogger("root").info("Configuring the cloud connector") if provider['name'] == "~okeanos" or provider['name'] == "okeanos": connector = OkeanosConnector() connector.configure(provider) return connector else: raise NotImplemented("T...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def configure_cloud(self):\n \n # if API check fails, log error output - actually probably not since we have interactivity here\n again = True\n while again:\n # print info\n print(\"Welcome to the cloud configuration center.\\n\")\n print(\"Here you can...
[ "0.6282327", "0.6257809", "0.6213331", "0.610103", "0.59580827", "0.5872653", "0.5869582", "0.585546", "0.5741923", "0.5660864", "0.5631034", "0.56130165", "0.55241275", "0.5518314", "0.54879", "0.54863995", "0.5481196", "0.5470829", "0.54587924", "0.5449331", "0.54402095", ...
0.62857586
0
This method loads the state file and create a deployment object and a cloud connector.
def load_state_file(statefile_path): logging.getLogger("root").info("Loading state file") f = open(statefile_path, 'r') json_content = f.read() f.close() state = json.loads(json_content) cloud_connector = configure_connector(state['provider']) deployment = Deployment() deployment.deseria...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start_deployment(cloud_connector, description):\n logging.getLogger(\"root\").info(\"Preparing the connector\")\n cloud_connector.prepare()\n logging.getLogger(\"root\").info(\"Starting new deployment\")\n deployment = Deployment()\n deployment.cloud_connector = cloud_connector\n deployment.c...
[ "0.61519176", "0.60772365", "0.60110295", "0.59607065", "0.5893163", "0.5756483", "0.57456", "0.56647724", "0.5656144", "0.565489", "0.5613694", "0.56117404", "0.5596531", "0.5502185", "0.54938924", "0.5491294", "0.54579836", "0.5446472", "0.5433196", "0.5419316", "0.53772146...
0.6868152
0
Save the statefile of the deployment to the specified path
def save_state_file(deployment, description, statefile_path, indent=2): logging.getLogger("root").info("Saving state file") dictionary = dict() dictionary['deployment'] = deployment.serialize() dictionary['provider'] = description['provider'] json_content = json.dumps(dictionary, indent=indent) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_state(self):\n state_dir = path.dirname(self.state_filename)\n\n if not path.isdir(state_dir):\n os.makedirs(state_dir)\n\n with open(self.state_filename, 'w') as df:\n log.debug(\"Saving state of program %s to %s\" % (self.name, self.state_filename))\n ...
[ "0.72345686", "0.7041482", "0.6886856", "0.6728281", "0.6728281", "0.6720478", "0.6681547", "0.66656244", "0.6656668", "0.6654687", "0.6633738", "0.6633738", "0.66229594", "0.66079557", "0.6580674", "0.6565834", "0.65359265", "0.65359265", "0.65341693", "0.6499323", "0.645511...
0.75555056
0
HTTP POST request to the specified resource and return the dictionary data. Exit if there is an error.
def post_resource(**kwargs) -> dict: response = requests.post(**kwargs) print(f"HTTP {response.request.method}: {response.url}") print(f'HTTP Status code: {response.status_code}') # Raise an exception if the response is not OK if not response.ok: print(response.text) response.raise...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def post(resource, data, **kwargs):\n\t#print(_endpoint(resource,'POST'))\n\tresp = requests.post(\n\t\t_endpoint(resource, 'POST'),\n\t\tparams=_jsonify_dict_values(kwargs),\n\t\tdata=json.dumps(data),\n\t\theaders=PAYLOAD_HEADERS,\n\t\tverify=SERVER_CERT\n\t)\n\tresp.raise_for_status()\n\treturn resp.json()", ...
[ "0.69994324", "0.6878457", "0.68656725", "0.6825984", "0.67586786", "0.64369595", "0.64234596", "0.636032", "0.63439894", "0.6329023", "0.6218185", "0.6173588", "0.6159562", "0.61452526", "0.61248547", "0.6123872", "0.61067307", "0.6076103", "0.60696906", "0.6067115", "0.6051...
0.7523257
0
check that other subscriber using the same s_tag don't have the same c_tag
def _test_validate_c_tag_on_same_s_tag(self): s = Mock() s.id = 123 s.c_tag = 111 s.s_tag = 222 s.onu_device = "BRCM1234" with self.assertRaises(Exception) as e: self.rcord_subscriber.save() self.assertEqual(e.exception.message, "The c_tag you specif...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_no_duplicate_tag(driver):\n for i,rs in enumerate(driver.find_elements_by_class_name('receipt')):\n l = list(get_tags(rs))\n if len(l) != len(set(l)):\n print(\"There are duplicate tags in the {}-th receipt line\"\\\n .format(i))\n print(\"Found tag:...
[ "0.6051012", "0.58984345", "0.5698662", "0.56263113", "0.5445463", "0.5436575", "0.5412571", "0.53862226", "0.5381143", "0.53334385", "0.5330394", "0.53292364", "0.53282756", "0.52589387", "0.5235825", "0.5202425", "0.519678", "0.51895684", "0.51860785", "0.5174649", "0.51382...
0.6794486
0
Generates a dojo datagrid for a given app's model. i.e. {% simple_datagrid myapp mymodel %}
def simple_datagrid(parser, token): bits = token.split_contents() if len(bits) < 3: raise TemplateSyntaxError("You have to pass app- and model-name to {% simple_datagrid app model %}") return DatagridNode(bits[1],bits[2],None)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def datagrid(parser, token):\n bits = token.split_contents()\n nodelist = parser.parse(('enddatagrid',))\n parser.delete_first_token()\n app, model = None, None\n if len(bits) == 3:\n app = bits[1]\n model = bits[2]\n return DatagridNode(app, model,nodelist)", "def init_dashboard(...
[ "0.5716942", "0.52099144", "0.50563", "0.5052993", "0.5024333", "0.46820152", "0.46228006", "0.46180898", "0.4601967", "0.457963", "0.45636475", "0.45548764", "0.4534291", "0.45111302", "0.45103902", "0.45009223", "0.44842482", "0.44550416", "0.4454846", "0.4450856", "0.44387...
0.71185935
0
Generates a dojo datagrid for a given app's model. renders the contents until {% enddatagrid %} and takes options in the form of option=value per line.
def datagrid(parser, token): bits = token.split_contents() nodelist = parser.parse(('enddatagrid',)) parser.delete_first_token() app, model = None, None if len(bits) == 3: app = bits[1] model = bits[2] return DatagridNode(app, model,nodelist)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def simple_datagrid(parser, token):\n bits = token.split_contents()\n if len(bits) < 3:\n raise TemplateSyntaxError(\"You have to pass app- and model-name to {% simple_datagrid app model %}\")\n return DatagridNode(bits[1],bits[2],None)", "def generate_dataset_jtable(request, option):\n\n obj_...
[ "0.57558525", "0.5318815", "0.5016363", "0.50074434", "0.49265978", "0.48608482", "0.47424617", "0.47209287", "0.46901476", "0.46824324", "0.46507186", "0.45998007", "0.45973757", "0.45943427", "0.45893005", "0.4568654", "0.45604816", "0.45183143", "0.45088342", "0.4506857", ...
0.6152957
0
This will output determine the intersection of a target bed file and the breakpoints of a cell type. Done as part of the Shuffle Permutation Analysis.
def target_intersection(self, runid): def targeting(shuffledict, seg_copy_array, cell_name): bedstring = "" seg_counts_dict = defaultdict(int) breakpoint_counts = 0 sum_counts = 0 for cell in shuffledict: with suppress(IndexError): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def intersection_iteration(selection_space, intersect_space, self, cell):\n\n target_bed_map_array = self.target_bed_map_array\n\n iteration_count = 0\n tmp_intersection_list = []\n\n log = self.log\n\n # Get the number of unique breakpoints.\n self.seg_analyzer.break_poin...
[ "0.6079349", "0.56113595", "0.55231243", "0.528834", "0.52287704", "0.52229637", "0.5204579", "0.51450634", "0.50647086", "0.4963228", "0.49510002", "0.49380392", "0.4924055", "0.49121994", "0.49112943", "0.49063557", "0.4892304", "0.4890931", "0.48865253", "0.48852038", "0.4...
0.6938134
0
Initialize our Segment_Analyzer class to get segment copy array, targeting array, breakpoint counts ect.
def segment_analyzer(self): sa = Segment_Analyzer.SegmentAnalyzer(self.log, self.args) sa.chromosome_ploidy(permutation=True) return sa
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__ ( self ) :\n\n self.m_src = self.configSrc ('source', ':Cspad.')\n self.m_key_in = self.configStr ('key_in', 'peaks_nda')\n self.m_print_bits = self.configInt ('print_bits', 1)\n\n self.counter = 0\n self.count_msg = 0\n\n if self.m_print_bits...
[ "0.60100806", "0.56726533", "0.56278", "0.56184", "0.55899125", "0.55863535", "0.55809623", "0.55809623", "0.5572842", "0.556239", "0.55409104", "0.55339575", "0.54836094", "0.5479961", "0.5471743", "0.5470144", "0.54608977", "0.54533935", "0.5419548", "0.53632003", "0.533903...
0.64426523
0
Do a permutation analysis based on the cells. Uses chromosome ploidy and breakpoint modules in Segment_Analyzer
def cell_permutation(self): self.log.info("Begin Sample Permutation Analysis.") # Initialize some variables. self.seg_analyzer.break_points(permutation=True) permutation_list = self.seg_analyzer.sample_names # cell_permutation_data_dict = defaultdict(lambda: defaultdict(list)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def permute_data(self):\n\n if not eval(self.args.Segment_Permutation_File):\n \"\"\"\n User has selected no permutation outputs and should not be here so kick them out.\n \"\"\"\n self.log.error(\"--Segment_Permutation_File must be set True\")\n return...
[ "0.66059166", "0.5817894", "0.5695593", "0.55273354", "0.54679984", "0.5306232", "0.5278718", "0.5193878", "0.5138355", "0.51232946", "0.50901026", "0.5080543", "0.5065552", "0.5049864", "0.50443894", "0.50090575", "0.4992921", "0.49815065", "0.4962625", "0.4956355", "0.49268...
0.7168242
0
This will rebin the genome space to be consistent with the breakpoint definition or any other bin resampling desired.
def bin_sizing(self): self.log.info("Begin Re-Binning the Genome Space.") new_list = [] seg_num = 0 for chrom in natsort.natsorted(self.seg_analyzer.chrom_list): self.log.debug("Binning Chromosome {0}".format(chrom)) # Some chromosomes have no segments. ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resize_ranges(self, bp: int, chrom_sizes: Optional[Mapping[str, Numeric]] = None):\n table = self.data\n limits = {\"lower\": 0}\n if chrom_sizes:\n limits[\"upper\"] = self.chromosome.replace(chrom_sizes)\n table = table.assign(\n start=(table[\"start\"] - bp)...
[ "0.5563641", "0.5437049", "0.5242597", "0.52385795", "0.51983845", "0.5184712", "0.5170389", "0.51697534", "0.5131774", "0.5116814", "0.5102943", "0.5036559", "0.502204", "0.50111717", "0.50063294", "0.49961177", "0.49830547", "0.49454606", "0.49367464", "0.49319112", "0.4930...
0.6257889
0
This method maps the target coordinates onto the genome space coordinates. Also prints a file of the map coordinates if the user so desires. Returns a numpy array of the map.
def target_mapping(self): map_list = [] self.bin_tracking_array = self.seg_analyzer.bin_tracking_array self.log.info("Spawning {0} jobs to begin building Target_Bed_Map_Array for permutation analysis." .format(self.args.Spawn)) p = pathos.multiprocessing.Pool(int(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_map(self):\n for line in self.map:\n print(\"\".join(line))", "def print_map(self):\n y_max,x_max = map(max, zip(*self.mp.keys()))\n for row in range(0,y_max+1):\n msg = []\n for k in range(0,x_max+1):\n msg.append(chr(self.mp[row,k]))\n print(\"\".join(msg)...
[ "0.5810311", "0.5806018", "0.58028233", "0.5798448", "0.5782474", "0.575715", "0.5684056", "0.5538132", "0.55267125", "0.54796934", "0.5443425", "0.54193914", "0.54150337", "0.53977007", "0.53757983", "0.53699857", "0.5343615", "0.53301626", "0.52589726", "0.524849", "0.52442...
0.6233182
0
Permutations based on random selection of segments. Group_Size is derived from actual number of breakpoints for cell type.
def permute_data(self): if not eval(self.args.Segment_Permutation_File): """ User has selected no permutation outputs and should not be here so kick them out. """ self.log.error("--Segment_Permutation_File must be set True") return cell_list ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cell_permutation(self):\n\n self.log.info(\"Begin Sample Permutation Analysis.\")\n\n # Initialize some variables.\n self.seg_analyzer.break_points(permutation=True)\n permutation_list = self.seg_analyzer.sample_names\n # cell_permutation_data_dict = defaultdict(lambda: defau...
[ "0.6518235", "0.6101971", "0.60761577", "0.58389986", "0.57073253", "0.56417984", "0.5585995", "0.5577014", "0.55318993", "0.54930675", "0.54664403", "0.54604775", "0.5440595", "0.5427858", "0.54145044", "0.54026735", "0.5397376", "0.5383163", "0.538217", "0.53703815", "0.533...
0.6285862
1
Controls the number of iterations and collects the data returned from the intersection function.
def intersection_iteration(selection_space, intersect_space, self, cell): target_bed_map_array = self.target_bed_map_array iteration_count = 0 tmp_intersection_list = [] log = self.log # Get the number of unique breakpoints. self.seg_analyzer.break_points(cell=cell, p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_intersection_report(self, data=None):\n\n if not data:\n data = self.build_dict_of_sets(self.data_dict)\n\n self.intersection_report_data = []\n finished = []\n\n for part in data:\n for union_part in data:\n if part != union_part and unio...
[ "0.6191531", "0.613657", "0.61215943", "0.60457605", "0.6034525", "0.6030752", "0.5992521", "0.59252244", "0.5849533", "0.5845985", "0.5773458", "0.5716242", "0.57068944", "0.5692156", "0.56860334", "0.5684677", "0.55754495", "0.55486435", "0.5524538", "0.5515427", "0.5509670...
0.6288774
0
Initializes this layer for fast inference, if in ``'predict'`` mode.
def init_weights_and_state(self, input_signature): if self._mode == 'predict': cache_signature = input_signature[4:6] self.state = self._fast_inference_init_state(cache_signature)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self) :\n self.prediction_ = None", "def __init__(self) :\n self.prediction_ = None", "def __init__(self) :\n self.prediction_ = None", "def _init_layers(self):\n self._init_predictor()\n if self.use_edge_fusion:\n self._init_edge_module()", "def _...
[ "0.6427284", "0.6427284", "0.6427284", "0.6415559", "0.6269912", "0.62389076", "0.62389076", "0.62145776", "0.6178152", "0.6134249", "0.60649276", "0.60298437", "0.6018519", "0.600655", "0.5989316", "0.5947057", "0.5939439", "0.59282106", "0.5901652", "0.5896351", "0.589418",...
0.6828983
0
Updates state of a causal attention layer for fast inference. The layer state stores arrays with cached values of keys and values, as well as an index. To make shapes static, keys and values in the state are long, and the index indicates where the new keys and values from inputs need to be appended. During update, we a...
def _fast_inference_update_state(self, inputs, state): # Fast inference: run step-by-step, storing the sequence # of keys and values calculated so far in state. new_k, new_v = inputs length = new_k.shape[1] (ks, vs, idx) = state # We cannot generate more than one token because it contradicts ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _update(self, state_pred, covar_pred, sigma_points_pred, weights_c,\n z_pred, z_points_pred, H, z, R):\n # Compute the Kalman gains and the innovation\n K = self._KF_gain(state_pred, covar_pred, sigma_points_pred,\n weights_c, z_pred, z_points_pred, R)\n ...
[ "0.55916685", "0.5372101", "0.5226048", "0.52023077", "0.51802313", "0.51728517", "0.51512665", "0.5143623", "0.51147664", "0.5114671", "0.5110446", "0.5083212", "0.5077372", "0.5032693", "0.5022658", "0.50213313", "0.5010962", "0.4985702", "0.49846277", "0.49814996", "0.4976...
0.6521284
0
Sinusoidal Embeddings. Computes out of 1D integer absolute position vector the sinusoidal embeddings defined like in paper Attention is all you need (2017). Embeddings are shaped (positions, d_feature).
def Sinusoidal_Embeddings(positions, d_feature): inv_freq = 1 / (10000**(jnp.arange(0.0, d_feature, 2.0) / d_feature)) sinusoid_freq = jnp.einsum('i,j->ij', positions, inv_freq) pos_emb = jnp.concatenate( [jnp.sin(sinusoid_freq), jnp.cos(sinusoid_freq)], axis=1) return pos_emb
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_synthetic_embedding(d, components, spherical=True, maximum_variance=None, center=None, noise=None, lam=1.e-2):\n assert d > 1, (\"Dimensionality must be positive and bigger than 1!\", d)\n print(\"Generating embedding of size: \", d)\n\n if maximum_variance is None:\n maximum_variance ...
[ "0.5914416", "0.58824235", "0.5852943", "0.58379173", "0.5830689", "0.5790952", "0.575558", "0.5720211", "0.56869954", "0.5617645", "0.5601036", "0.55981606", "0.55782837", "0.5568676", "0.55653465", "0.5555184", "0.55521905", "0.5532139", "0.54756963", "0.5471064", "0.546305...
0.8331945
0
Initialize Stripe for the provided app. this method conforms to the Flaskstyle standard of initializing modules that depend on the app they are running in.
def init_app(self, app): stripe.api_key = app.config['STRIPE_API_KEY']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_app(self, app):\n self.app = app\n\n self._init_extension()\n\n # Register views\n for view in self._views:\n app.register_blueprint(view.create_blueprint(self))", "def initialize_app(app):\n # configure_app(app)\n # log.info(\"> Starting development server a...
[ "0.66744566", "0.66516733", "0.6613759", "0.65905124", "0.65512234", "0.6309143", "0.6290125", "0.62242705", "0.6217087", "0.6140109", "0.61219484", "0.61179334", "0.6085262", "0.606049", "0.600564", "0.59923434", "0.59923434", "0.59894466", "0.59528315", "0.59274316", "0.589...
0.8117413
0
Cancel a subscription. cancels a customer's current subscription.
def cancel_subscription(self, customer=None, user=None): if not customer and not user: raise UnboundLocalError('customer or user required') if not customer: customer = self.get_customer(user) return customer.cancel_subscription(at_period_end=True)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cancel_subscription(self,\n subscription_id):\n\n return super().new_api_call_builder.request(\n RequestBuilder().server('default')\n .path('/v2/subscriptions/{subscription_id}/cancel')\n .http_method(HttpMethodEnum.POST)\n .template...
[ "0.7344821", "0.7113654", "0.66338396", "0.65077186", "0.649275", "0.62884694", "0.6103219", "0.59542686", "0.594744", "0.5940891", "0.58726764", "0.57782197", "0.57757324", "0.57374483", "0.5735373", "0.5708554", "0.57085365", "0.569669", "0.56614614", "0.5659046", "0.565591...
0.7518451
0
Create a new stripe customer for the given user. saves the customer id to the user instance.
def create_customer(self, user, card_token, plan): customer = stripe.Customer.create( card=card_token, plan=plan, email=user.email, ) user.stripe_customer_id = customer.id user.save() return customer
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def token_for_customer(self, token, user):\n kwargs = dict(card=token,\n description='Poold user: %s' % user.id,\n email=user.email)\n try:\n stripe_user = _Customer.create(api_key=self.api_key, **kwargs)\n msg = 'New Stripe Customer Cre...
[ "0.78248376", "0.75568783", "0.7538097", "0.71797717", "0.7121477", "0.7014776", "0.6932298", "0.6908897", "0.68868935", "0.68820363", "0.6840488", "0.678851", "0.6785595", "0.6751161", "0.66841847", "0.66678995", "0.6654455", "0.664032", "0.66369593", "0.66229874", "0.657939...
0.79567844
0
Return the Stripe customer for the given user.
def get_customer(self, user): if not user.stripe_customer_id: return None return stripe.Customer.retrieve(user.stripe_customer_id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def customer_get_one(user_id):\n return customer_get(user_id)", "def get_customer(self) -> djstripe.models.Customer:\n if self.customer_id:\n return self.customer\n\n name = self.display_name or self.name or \"\"\n email = self.billing_email or self.email or \"\"\n\n if ...
[ "0.73661345", "0.727037", "0.7266163", "0.7108191", "0.67057127", "0.65477747", "0.65477747", "0.6506531", "0.63994485", "0.6278622", "0.6278021", "0.62299377", "0.6219163", "0.62030685", "0.6202813", "0.6192105", "0.6157727", "0.60716575", "0.5943185", "0.59028095", "0.58975...
0.8999123
0
Return all plans available to be subscribed to.
def get_plans(self): return stripe.Plan.all()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plans(self):\r\n return pl.Plans(self)", "def plans(self):\n title = self.context.Title()\n return self.portal_catalog(portal_type='Plan', Subject=title)", "def plans(self):\r\n return Plans(self)", "def list(cls):\n return cls().requests.get('plan')", "def get(self)...
[ "0.73486024", "0.7030958", "0.6885046", "0.68519753", "0.68176794", "0.6776895", "0.67294914", "0.66493237", "0.64917934", "0.64352006", "0.64023966", "0.63862914", "0.6345117", "0.6327804", "0.6317836", "0.62997997", "0.62668866", "0.6224029", "0.6217463", "0.621192", "0.620...
0.76084703
0
Update a subscription. changes a current customer's subscription to a new one.
def update_subscription(self, plan, customer=None, user=None): if not customer and not user: raise UnboundLocalError('customer or user required') if not customer: customer = self.get_customer(user) return customer.update_subscription( plan=plan, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_subscription(self,\n subscription_id,\n body):\n\n return super().new_api_call_builder.request(\n RequestBuilder().server('default')\n .path('/v2/subscriptions/{subscription_id}')\n .http_method(HttpMethodEnum....
[ "0.6978654", "0.6826487", "0.65835285", "0.65324265", "0.64576375", "0.64214903", "0.62487346", "0.615998", "0.615998", "0.615998", "0.613359", "0.6098111", "0.6068169", "0.6045272", "0.59473354", "0.59223354", "0.5920123", "0.5890677", "0.57058716", "0.5699862", "0.5630067",...
0.73689264
0
This method handles all steps of the job pipeline to produce a dataframe, or error if the job fails. From a client's request, this method will start a job, and repeatedly check its status until it finishes, fails, or the maximum wait time expires. If the job completes, this method will download the resulting dataframe ...
def load_df_from_job_pipeline(self, model_id: str, geolevel: Optional[str] = None, response_format: str = 'csv', portfolio_id: Optional[str] = None, m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def download_job_to_dataframe(self) -> pandas.DataFrame:\n self._assert_job_created()\n\n r = requests.post(\n f'https://{cc.ROUTE_PREFIX}.stratodem.com/jobs/download',\n headers=dict(\n Authorization=f'Bearer {get_api_token()}',\n ),\n json=...
[ "0.6362923", "0.5827171", "0.5725487", "0.5580106", "0.5481861", "0.5467667", "0.54527736", "0.53859895", "0.53817284", "0.53633547", "0.5330093", "0.5315691", "0.5302152", "0.52375245", "0.52240497", "0.52178276", "0.52140737", "0.5173888", "0.5165903", "0.51624495", "0.5148...
0.63742787
0
This method will handle the API request to download the job related to an instance of this class, and return the dataframe Returns pandas.DataFrame
def download_job_to_dataframe(self) -> pandas.DataFrame: self._assert_job_created() r = requests.post( f'https://{cc.ROUTE_PREFIX}.stratodem.com/jobs/download', headers=dict( Authorization=f'Bearer {get_api_token()}', ), json=dict(job_id=s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def _fetch_data(self) -> JobInfo:\n return await self.api.get_job()", "def __gen_datatable__(self):\n # | - __generate_data_table\n rows_list = []\n for Job_i in self.Job_list:\n # | - FOR LOOP BODY\n entry_param_dict = {}\n for prop, value in Jo...
[ "0.6763625", "0.6164212", "0.61000276", "0.6021834", "0.5998377", "0.5977122", "0.59643817", "0.5963339", "0.59298694", "0.5883762", "0.5805743", "0.5763077", "0.5714908", "0.5703335", "0.5702318", "0.5699972", "0.5684431", "0.5642405", "0.5638484", "0.5636349", "0.56206685",...
0.80381244
0
Plot Model predictions vs. target and print MSE and R2
def check_model_performances(X,Y, model,show=False): #model.fit(X, Y) predictions = model.predict(X) predictions = predictions#.reshape(-1,1) # ######## Computes MSE ####### MSE = mean_squared_error(Y, predictions) print(f'\nMSE : {MSE}') # ######## Computes R2 ####### ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _plot_rmse(self, val=False):\n _, ax = plt.subplots()\n ax.plot(self.global_rmse, linewidth=3, color='blue', label='Train RMSE')\n ax.set_title('RMSE vs. Number of Iterations')\n if val is not None:\n ax.plot(self.validation_rmse, linewidth=3, color='green', label='Valida...
[ "0.7307994", "0.72000974", "0.70330024", "0.70101166", "0.6936142", "0.6931232", "0.6912004", "0.6874519", "0.68463206", "0.6815816", "0.68064076", "0.6799235", "0.6750171", "0.67103374", "0.66889906", "0.66860276", "0.6677595", "0.66755867", "0.66732335", "0.6576521", "0.650...
0.7462835
0
Test _get_faker when anonymize is a tuple
def test__get_faker_anonymize_tuple(self): # Setup # Run transformer = Mock() transformer.anonymize = ('email',) result = CategoricalTransformer._get_faker(transformer) # Asserts self.assertEqual( result.__name__, 'faker', "E...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test__get_faker_anonymize_not_tuple_or_list(self):\n # Run\n transformer = Mock()\n transformer.anonymize = 'email'\n\n result = CategoricalTransformer._get_faker(transformer)\n\n # Asserts\n self.assertEqual(\n result.__name__,\n 'faker',\n ...
[ "0.765963", "0.71250385", "0.66111517", "0.5842253", "0.5742647", "0.56849957", "0.5658489", "0.5605423", "0.56039524", "0.5506188", "0.5481926", "0.5451333", "0.54133964", "0.5364568", "0.53472215", "0.5318414", "0.526148", "0.52556473", "0.5255357", "0.5250241", "0.5248354"...
0.8129173
0
Test _get_faker when anonymize is a list
def test__get_faker_anonymize_list(self): # Run transformer = Mock() transformer.anonymize = ['email'] result = CategoricalTransformer._get_faker(transformer) # Asserts self.assertEqual( result.__name__, 'faker', "Expected faker funct...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test__get_faker_anonymize_not_tuple_or_list(self):\n # Run\n transformer = Mock()\n transformer.anonymize = 'email'\n\n result = CategoricalTransformer._get_faker(transformer)\n\n # Asserts\n self.assertEqual(\n result.__name__,\n 'faker',\n ...
[ "0.78338355", "0.76713175", "0.72307914", "0.607815", "0.5965786", "0.59393036", "0.56897223", "0.5678519", "0.5571888", "0.5543627", "0.55152786", "0.5459051", "0.5389048", "0.5380505", "0.5365884", "0.53570455", "0.53437346", "0.53158516", "0.5315404", "0.52903295", "0.5287...
0.818619
0
Test _get_faker when anonymize is neither a typle or a list
def test__get_faker_anonymize_not_tuple_or_list(self): # Run transformer = Mock() transformer.anonymize = 'email' result = CategoricalTransformer._get_faker(transformer) # Asserts self.assertEqual( result.__name__, 'faker', "Expected ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test__get_faker_anonymize_list(self):\n # Run\n transformer = Mock()\n transformer.anonymize = ['email']\n\n result = CategoricalTransformer._get_faker(transformer)\n\n # Asserts\n self.assertEqual(\n result.__name__,\n 'faker',\n \"Exp...
[ "0.78329515", "0.73808026", "0.72837365", "0.6439515", "0.60982126", "0.58723223", "0.5865507", "0.5674092", "0.5628661", "0.5475512", "0.54741263", "0.53965104", "0.53685004", "0.5364341", "0.53079236", "0.5296523", "0.52528745", "0.52190584", "0.5192818", "0.51927096", "0.5...
0.80129164
0
Test _get_faker with a category that don't exist
def test__get_faker_anonymize_category_not_exist(self): # Run & assert transformer = Mock() transformer.anonymize = 'SuP3R-P1Th0N-P0w3R' with self.assertRaises(ValueError): CategoricalTransformer._get_faker(transformer)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_dashboard_recipe_created_with_category(self):\n self.signup('Bo', 'Theo', 'Bo_theo5@example.com', 'Bo1995', 'Bo1995')\n self.login('Bo_theo5@example.com', 'Bo1995')\n self.dashboard()\n self.category('JunkFood')\n self.dashboard()\n rv = self.recipe_dashboard()\n ...
[ "0.67407596", "0.6662604", "0.6509663", "0.6416014", "0.635828", "0.63036376", "0.6278413", "0.62211454", "0.62152624", "0.61945945", "0.61438763", "0.6122787", "0.6113773", "0.61023265", "0.60520446", "0.6043084", "0.6006965", "0.59960073", "0.5989137", "0.596436", "0.596436...
0.76513755
0
Test fit with a pandas.Series, don't anonymize
def test_fit_series_no_anonymize(self): # Setup data = pd.Series(['bar', 'foo', 'foo', 'tar']) # Run transformer = Mock() transformer.anonymize = None CategoricalTransformer.fit(transformer, data) # Asserts expect_anonymize_call_count = 0 expect...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ts_fit(series: TimeSeries) -> TimeSeries:\n pass", "def test_fit_series_anonymize(self):\n # Setup\n data = pd.Series(['bar', 'foo', 'foo', 'tar'])\n data_anonymized = pd.Series(['bar', 'foo', 'foo', 'tar'])\n\n # Run\n transformer = Mock()\n transformer.anony...
[ "0.6434097", "0.632576", "0.616898", "0.6142923", "0.6036156", "0.5985129", "0.59121484", "0.5888084", "0.58407813", "0.5772282", "0.57577896", "0.56887525", "0.5664717", "0.5660078", "0.5600984", "0.55987734", "0.55810195", "0.5574407", "0.5566427", "0.5556434", "0.5545011",...
0.663256
0
Test fit with a pandas.Series, anonymize
def test_fit_series_anonymize(self): # Setup data = pd.Series(['bar', 'foo', 'foo', 'tar']) data_anonymized = pd.Series(['bar', 'foo', 'foo', 'tar']) # Run transformer = Mock() transformer.anonymize = 'email' transformer._anonymize.return_value = data_anonymized ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_fit_series_no_anonymize(self):\n # Setup\n data = pd.Series(['bar', 'foo', 'foo', 'tar'])\n\n # Run\n transformer = Mock()\n transformer.anonymize = None\n\n CategoricalTransformer.fit(transformer, data)\n\n # Asserts\n expect_anonymize_call_count = ...
[ "0.66056424", "0.62013125", "0.6131518", "0.6063149", "0.5964109", "0.59628075", "0.5930844", "0.5801731", "0.57709557", "0.57278925", "0.5672713", "0.5648419", "0.54942816", "0.5490601", "0.5479234", "0.5476655", "0.5473471", "0.54717684", "0.54717684", "0.5434423", "0.54329...
0.65866226
1
Test normalize data with clip=True
def test__normalize_clip(self): # Setup data = pd.Series([-0.43, 0.1234, 1.5, -1.31]) transformer = Mock() transformer.clip = True # Run result = CategoricalTransformer._normalize(transformer, data) # Asserts expect = pd.Series([0.0, 0.1234, 1.0, 0.0], ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_normalize_and_clip():\n nc = NormalizeAndClip(normalization=False, clipping=False)\n\n try:\n print(nc.y_shift)\n except AssertionError:\n pass\n\n x = np.reshape(np.array([0.0, 1.0, 2.0]), newshape=(-1, 1))\n y = np.reshape(np.array([0.0, 1.0, 2.0]), newshape=(-1, 1))\n\n ...
[ "0.73302066", "0.67333984", "0.65665466", "0.6560788", "0.655404", "0.64781106", "0.641804", "0.6351455", "0.63467115", "0.63405997", "0.63368034", "0.6315865", "0.6315865", "0.6295703", "0.6281524", "0.6281524", "0.62755364", "0.627188", "0.62513065", "0.62362576", "0.621562...
0.8021305
0
Test reverse_transform a numpy.array
def test_reverse_transform_array(self): # Setup data = np.array([-0.6, 0.2, 0.6, -0.2]) normalized_data = pd.Series([0.4, 0.2, 0.6, 0.8]) intervals = { 'foo': (0, 0.5), 'bar': (0.5, 0.75), 'tar': (0.75, 1), } # Run transformer...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_inverse_transform(self):", "def test_reverse(self):\n t = Linearize()\n assert t.reverse(1) == numpy.e", "def test__inverse_transform_continuous(self):", "def test_transform(self):\n t = Reverse(Quantize())\n assert t.transform(9) == 9.0\n assert t.transform(5) == ...
[ "0.69893396", "0.68312776", "0.6784447", "0.6729141", "0.66916233", "0.6691548", "0.66294897", "0.66294897", "0.66294897", "0.66294897", "0.66294897", "0.66173273", "0.65322196", "0.64849514", "0.6454241", "0.6432495", "0.6397698", "0.63026196", "0.6297132", "0.62480986", "0....
0.7475317
0
Build a virtual filesystem
def virtual(**kwds): # get the virtual filesystem factory from .Filesystem import Filesystem # make one and return it return Filesystem(**kwds)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def rebuild_virtualfs(cls):\n # todo: rebuild the image_virtual_paths table--using existing script\n # can be referenced from program config db_scripts_path\n logger = cls.get_logger()\n async with DbConnectionPool.get().acquire_dict_cursor(db=ProgramConfig.get().pwgo_db_name) as ...
[ "0.6182008", "0.5960655", "0.57590544", "0.57561976", "0.5720794", "0.56003815", "0.55794096", "0.5560368", "0.5532398", "0.55216163", "0.55121934", "0.55106235", "0.54990983", "0.54799944", "0.5430099", "0.53841037", "0.5376351", "0.5374124", "0.5370315", "0.5346035", "0.530...
0.74249333
0
Attempt to build a zip filesystem out of {root}, which is expected to be a zip archive
def zip(root, **kwds): # ensure {root} is an absolute path, just in case the application changes the current # working directory root = primitives.path(root).resolve() # check whether the location exists if not root.exists(): # and if not, complain raise MountPointError(uri=root, err...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _make_archive(file_list, archive, root):\n with zipfile.ZipFile(archive, 'w', zipfile.ZIP_DEFLATED) as zipf:\n for f in file_list:\n zipf.write(f, os.path.relpath(f, root))", "def make_archive(base_name, format, root_dir=None, base_dir=None, verbose=0,\n dry_run=0, owner=...
[ "0.66439134", "0.64925486", "0.6388865", "0.6295177", "0.616945", "0.61610657", "0.6137867", "0.61295664", "0.61121464", "0.61072314", "0.6071974", "0.60236484", "0.6009701", "0.5989513", "0.5978426", "0.5959464", "0.5908596", "0.5891056", "0.58817106", "0.58729124", "0.58338...
0.7382388
0
Support for debugging the filesystem package
def debug(): # print(" ++ debugging 'pyre.filesystem'") # attach {Extent} as the metaclass of Node and Filesystem so we can verify that all # instances of these classes are properly garbage collected from ..patterns.Extent import Extent global _metaclass_Node _metaclass_Node = Extent # all ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def debug():", "def set_fs_verbose(mode: bool = True):\n global _fs_verbose\n _fs_verbose = mode", "def out_for_debug(df_input, fname, modus=''):\n \n print(f\"modus is: {modus}\")\n if modus == 'DEBUG':\n fname = fname+'.pkl'\n print(f\"DEBUG: Writing file {fname} to the debug fol...
[ "0.6444282", "0.60988575", "0.5975432", "0.59650654", "0.59298193", "0.5904421", "0.58948684", "0.5818569", "0.5770508", "0.57582605", "0.57492185", "0.5707014", "0.5666639", "0.5660049", "0.5618318", "0.560886", "0.55983484", "0.5568567", "0.55543584", "0.55323976", "0.55154...
0.6968437
0
The data structure is a list of dictionaries. Each dictionary keys are connectivity check commands and values are the commands' results. max_num_of_rounds_to_retain maximum maintained length of the results list
def __init__(self, max_num_of_rounds_to_retain=100, num_of_last_check_rounds_consider=2): self.data = list() self.max_num_of_rounds_to_retain = max_num_of_rounds_to_retain self.num_of_last_check_rounds_consider = num_of_last_check_rounds_consider
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_datalink_compare(self, test_info, basic_datalink_compare_info_4_test):\n\n test_results = test_info\n list_of_results = []\n\n test_number = test_results['test_id_number'].replace('#', '')\n\n for data_release in self.test_conditions_4_current_env.GAIA_RELEASES:\n\n ...
[ "0.541418", "0.52119577", "0.519089", "0.51693183", "0.5106234", "0.50724524", "0.5039588", "0.5035684", "0.50313365", "0.5021904", "0.5020683", "0.50159186", "0.495572", "0.49163756", "0.4902168", "0.4889571", "0.48817638", "0.4878387", "0.48690483", "0.48604247", "0.4851751...
0.61968046
0
Return True, False based on num_of_last_check_rounds_consider rounds evaluations. All checks (items of dictionaries) have the same weight. All results must be nonzero in order to pronounce offline status. if any results in the considered rounds is 0, the online status is still maintained.
def am_i_offline(self): # -num_of_last_check_rounds_consider won't raise IndexError when len(self.data) is smaller logger.debug("called am_i_offline and data is: %s" % self.data) if not self.data: return False for dict_check_results in self.data[-self.num_of_last_check_rounds...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def checkWinAll(self, model, previousWin):\r\n previous = self.__render\r\n self.__render = Render.NOTHING # avoid rendering anything during execution of the check games\r\n\r\n win = 0\r\n lose = 0\r\n \r\n cellsRanking = {}\r\n sumForProb = 0\r\n for cell ...
[ "0.62502825", "0.5845664", "0.57943153", "0.5778877", "0.5745679", "0.57071424", "0.5669396", "0.5647574", "0.5607584", "0.56058955", "0.5602156", "0.5582184", "0.55455875", "0.55068654", "0.54925454", "0.54548347", "0.54522806", "0.5450234", "0.54389316", "0.5418244", "0.541...
0.671868
0
Loop over all check_cmds commands and acquire results.
def _checker_worker(self): results = {} for cmd in self.check_cmds: res = subprocess.call(cmd.split(), stdout=open('/dev/null', 'w')) self.log("'%s' finished, result: %s" % (cmd, res)) results[cmd] = res if rospy.is_shutdown(): return ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def perform_checks(self):\n retval = []\n retval.extend(self.check_slick_status())\n retval.extend(self.check_java_processes())\n retval.extend(self.check_firefox_processes())\n retval.extend(self.check_disk_space())\n return retval", "def call_in_sequence(self, cmds, sh...
[ "0.6579503", "0.64090145", "0.6318845", "0.63085353", "0.6283145", "0.623298", "0.6182781", "0.61591244", "0.6152137", "0.6118637", "0.60973006", "0.60912484", "0.60743886", "0.6073261", "0.60649085", "0.6058614", "0.59750974", "0.58939457", "0.58635217", "0.58489436", "0.584...
0.70480996
0
bfsSample(G, source=None, k=50) Start a BFS from source node, return nodeinduced subgraph of the first k nodes discovered. DEPRECATED. This function (and the networkit.sampling module) will be removed in future updates.
def bfsSample(G, source=None, k = 50): warn("networkit.sampling.bfsSample is deprecated, will be removed in future updates.") if not source: source = GraphTools.randomNode(G) n = G.numberOfNodes() visited = [False]*n Q = [source] closest = set([source]) global found found = 0 while len(Q) > 0 and found < k: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _bfs_nodes(cls, graph, source, size, **kwargs):\n if size < 1:\n return iter(())\n\n return itertools.chain(\n (source,),\n itertools.islice((v for u, v in nx.bfs_edges(graph, source)), size-1)\n )", "def bfs(graph, source):\n visited = [False] * l...
[ "0.65903306", "0.6135773", "0.60579455", "0.60508853", "0.60508853", "0.602493", "0.5977019", "0.5941503", "0.59406644", "0.5909492", "0.5893723", "0.5813105", "0.5778246", "0.5776106", "0.5760109", "0.5746747", "0.57441235", "0.57178104", "0.5680887", "0.56674623", "0.564740...
0.8925595
0
Preprocess text for BERT embedding
def bert_preprocess(raw_text): nlp = English() nlp.add_pipe(nlp.create_pipe('sentencizer')) # updated doc = nlp(raw_text) sentences = [sent.string.strip() for sent in doc.sents][0:2] new_sentences = [] for i, sentence in enumerate(sentences): if i==0: new_sentences.append("...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def preprocess(text):\n text = remove_space(text)\n text = clean_special_punctuations(text)\n text = handle_emojis(text)\n text = clean_number(text)\n text = spacing_punctuation(text)\n text = clean_repeat_words(text)\n text = remove_space(text)\n #text = stop(text)# if changing this, then ...
[ "0.7358377", "0.73425955", "0.72900075", "0.7132615", "0.7090567", "0.7036849", "0.68761754", "0.6814698", "0.67590696", "0.6715868", "0.664377", "0.6606537", "0.6541035", "0.6537696", "0.6533349", "0.6523946", "0.6490431", "0.64885604", "0.6449483", "0.64059556", "0.639826",...
0.7568543
0
Creates BERT features for one 8K
def create_bert_features(raw_text, tokenizer, model): # Load pre-trained model tokenizer (vocabulary) text_preprocessed = bert_preprocess(raw_text) # tokenize #tokenizer = BertTokenizer.from_pretrained('bert-base-uncased') tokenized_text = tokenizer.tokenize(text_preprocessed)[:512] # ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_enru_custom_ft(self):\n eval_data_file = self.data_dir + '/' + enru_newscomm\n eval_data = tf.data.experimental.CsvDataset(\n [eval_data_file],\n record_defaults=[tf.string, tf.string],\n compression_type='GZIP',\n field_delim='\\t',\n use_quote_delim=False)\n ...
[ "0.6511396", "0.6401686", "0.61846405", "0.6100362", "0.6057321", "0.6043345", "0.6016371", "0.59159476", "0.5913245", "0.5906838", "0.59012294", "0.5855001", "0.58522624", "0.58309114", "0.57961047", "0.57905", "0.5781083", "0.5776697", "0.5775778", "0.5745477", "0.5745049",...
0.6410125
1
Returns a list of all files of an extension in a path. path {str} Initial path to the directory we want to crawl. [ext=".pyc"] {str} what file extensions to look for. This is a literal match and must contain the dot.
def findfiles(path, ext=".pyc"): results = [] regex = re.compile(re.escape(ext)+"$", re.I) tree = os.walk(path) for d in tree: # Each element of a walker represents a directory and its contents. # Diagnostic, if you wish. #print(d) if d[2]: # Are there files ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_files(path: str, extension: str = '.wav') -> List[Path]:\n\n return list(Path(path).expanduser().resolve().rglob(f'*{extension}'))", "def search_extension(path, ext):\n output = []\n for root, dirs, files in os.walk(path, topdown=True):\n for file in files:\n if file.endswith(e...
[ "0.7508504", "0.7498343", "0.73193336", "0.7288225", "0.726082", "0.7209165", "0.72005093", "0.694024", "0.688218", "0.68249804", "0.6744459", "0.67185193", "0.6651676", "0.6639735", "0.66163915", "0.66129637", "0.6558606", "0.6535634", "0.65028435", "0.64953744", "0.6484799"...
0.7750725
0
Calculate the needed history/changelog changes Every history heading looks like '1.0 b4 (19721225)'. Extract them, check if the first one matches the version and whether it has a the current date.
def _grab_history(self): self.data['history_lines'] = [] self.data['history_file'] = None self.data['history_encoding'] = None self.data['headings'] = [] self.data['history_last_release'] = '' self.data['history_insert_line_here'] = 0 default_location = None ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_diffs(history):\n\n # First get all possible representations\n mgr = plugins_get_mgr() \n keys = mgr.search('representation')['representation']\n representations = [mgr.get_by_key('representation', k) for k in keys]\n\n for i in range(len(history)):\n if i+1 > len(history) - 1:\n ...
[ "0.6301658", "0.6264954", "0.6069715", "0.605022", "0.594533", "0.5934417", "0.59105426", "0.5899072", "0.5875778", "0.58744615", "0.58633614", "0.58616674", "0.5821807", "0.578175", "0.5748133", "0.56826127", "0.56775147", "0.5669504", "0.5661977", "0.5651906", "0.5623504", ...
0.63363856
0
Look for 'Nothing changed yet' under the latest header. Not nice if this text ends up in the changelog. Did nothing happen?
def _check_nothing_changed(self): if self.data['history_file'] is None: return nothing_yet = self.data['nothing_changed_yet'] if nothing_yet not in self.data['history_last_release']: return # We want quotes around the text, but also want to avoid # printin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_top_changes(cls, upload_changes):\n result = \"\"\n header_found = False\n for line in upload_changes.get(\"Changes\", \"\").splitlines(True):\n if re.match(r\"^ [a-z0-9]+\", line):\n if header_found:\n break\n ...
[ "0.60125965", "0.5797253", "0.5784568", "0.5705697", "0.5700523", "0.5684445", "0.56726235", "0.5644389", "0.56360024", "0.55797523", "0.557166", "0.55497676", "0.55273134", "0.5499258", "0.548318", "0.5459719", "0.54409367", "0.5426471", "0.54029524", "0.53975636", "0.537987...
0.7120929
0
Write previouslycalculated history lines back to the file
def _write_history(self): if self.data['history_file'] is None: return contents = '\n'.join(self.data['history_lines']) history = self.data['history_file'] write_text_file( history, contents, encoding=self.data['history_encoding']) logger.info("History fil...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_history(histfile):\n readline.write_history_file(histfile)", "def write_history_file(config):\n readline.set_history_length(int(config.get('history', 'length')))\n readline.write_history_file(config.rh_get_data('historyFile'))", "def savehist(self):\n try:\n self.readline.wr...
[ "0.7290406", "0.7019918", "0.68774897", "0.68509644", "0.6712904", "0.6608979", "0.65856427", "0.6469126", "0.6385558", "0.63604814", "0.6141921", "0.61334586", "0.6127434", "0.6123097", "0.6034797", "0.6031579", "0.6019083", "0.59799296", "0.59724486", "0.59710777", "0.59665...
0.7961853
0
Show diff and offer commit. commit_msg is optional. If it is not there, we get the commit_msg from self.data. That is the usual mode and is at least used in prerelease and postrelease. If it is not there either, we ask.
def _diff_and_commit(self, commit_msg=''): if not commit_msg: if 'commit_msg' not in self.data: # Ask until we get a non-empty commit message. while not commit_msg: commit_msg = utils.get_input( "What is the commit message? ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _commit_or_print_changes(\n self, commit: bool, ignore_template_commit: bool\n ) -> bool:\n if not commit:\n diff_text, updated = self.diff(\n ignore_template_commit=ignore_template_commit\n )\n if updated:\n indented = textwrap.in...
[ "0.6221646", "0.61780804", "0.6125096", "0.6081856", "0.5992732", "0.59883314", "0.58675236", "0.5793371", "0.57622653", "0.5714334", "0.5649726", "0.55737936", "0.5559538", "0.5549132", "0.5545727", "0.5541102", "0.55319995", "0.5523623", "0.5519034", "0.5493635", "0.5458234...
0.77060664
0
Toggle whether dots or text are shown in password box
def _toggle_password(self, event): if self.showText.IsChecked(): self.password_txt.Show(True) self.password.Show(False) self.password_txt.SetValue(self.password.GetValue()) else: self.password.Show(True) self.password_txt....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _toggle_password(self, event):\n \n if self.showText.IsChecked():\n self.password_txt.Show(True)\n self.password.Show(False)\n self.password_txt.SetValue(self.password.GetValue())\n self.password2_txt.Show(True)\n self.password2.Show(False)\n...
[ "0.76982826", "0.75808525", "0.7551291", "0.6762203", "0.6360758", "0.63523126", "0.63302046", "0.63250047", "0.6265971", "0.62511015", "0.6244025", "0.62330544", "0.6191691", "0.6135414", "0.61289555", "0.61135787", "0.5928396", "0.5914819", "0.5873538", "0.58714247", "0.585...
0.7777304
0
Update the progress bar showing password strength
def _update_strength(self, event): if self.showText.IsChecked(): password = self.password_txt.Value else: password = self.password.Value nd = calc_password_strength(password) self.strength.UpdateStrength(nd)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _update_strength(self, event=None):\n password = self.password.GetValue()\n nd = calc_password_strength(password, WEB_SPEED)\n self.strength.UpdateStrength(nd)", "async def password_strength(self, ctx, password: str):\n conv = PasswordStats(password)\n converter = conv.stre...
[ "0.7532259", "0.7340428", "0.702136", "0.6129795", "0.6028579", "0.5982886", "0.5980605", "0.59329164", "0.58322465", "0.5777731", "0.57407576", "0.57246554", "0.57182646", "0.57139033", "0.5683199", "0.5649072", "0.5640296", "0.5604876", "0.55739087", "0.55553454", "0.554694...
0.78417635
0
Open the random password generator dialog
def _open_password_gen(self, event): # Generate passwords suitable for resistance to local cracking dlg = PasswordGenerator(self, LOCAL_SPEED) if dlg.ShowModal() == wx.ID_OK: newPass = dlg.password.GetValue() if newPass: # ok...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _open_password_gen(self, event):\n dlg = PasswordGenerator(self, WEB_SPEED)\n \n if dlg.ShowModal() == wx.ID_OK:\n newPass = dlg.password.GetValue()\n \n if newPass:\n # ok to overwrite?\n if self.password.Value:\n ...
[ "0.77184445", "0.7260783", "0.7205026", "0.661467", "0.63853824", "0.6331214", "0.6305005", "0.623747", "0.61583215", "0.61530393", "0.6107992", "0.6084838", "0.60491997", "0.6046377", "0.60382456", "0.6037282", "0.60296005", "0.60139966", "0.60068154", "0.60007185", "0.59862...
0.787987
0
Toggle whether password fields show dots or text
def _toggle_password(self, event): if self.showText.IsChecked(): self.password_txt.Show(True) self.password.Show(False) self.password_txt.SetValue(self.password.GetValue()) self.password2_txt.Show(True) self.password2.Show(False) s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _toggle_password(self, event):\n \n if self.showText.IsChecked():\n self.password_txt.Show(True)\n self.password.Show(False)\n self.password_txt.SetValue(self.password.GetValue())\n \n else:\n self.password.Show(True)\n self...
[ "0.76909745", "0.74616134", "0.7261206", "0.63180757", "0.6223435", "0.61925155", "0.61787647", "0.6176132", "0.6091695", "0.6024992", "0.5904328", "0.5833296", "0.58238405", "0.5812074", "0.5804353", "0.5781363", "0.5754255", "0.5751152", "0.5725077", "0.5707711", "0.570618"...
0.76570284
1
Check that entries are valid before allowing ok button press
def _check_entries(self, event): # First check the password fields passwordEmpty = not self.password.Value passwordMatch = (self.password.Value == self.password2.Value) if not passwordMatch or passwordEmpty: if passwordEmpty: msg = 'Password...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_entries(self):\n message = ''\n if self.class_name.text() == '' or \\\n self.title.text() == '' or \\\n self.description.text() == '' or \\\n self.module_name.text() == '' or \\\n self.plugin_version.text() == '' or \\\n self.qgis_minimum...
[ "0.7052897", "0.6859615", "0.66795284", "0.6650727", "0.6645937", "0.66190004", "0.66069233", "0.656368", "0.6555036", "0.64819497", "0.647504", "0.6381572", "0.6337546", "0.6318211", "0.63162374", "0.62712765", "0.62111586", "0.62039566", "0.6129772", "0.61167747", "0.608629...
0.7147012
0
Select a file to save the password database
def _get_file(self, event): dlg = wx.FileDialog(None, "Select a file", wildcard="Password Files (*.*)|*.*", defaultDir=os.getcwd(), style=wx.FD_SAVE) if dlg.ShowModal() == wx.ID_OK: newpath = dlg.G...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_file(self, event):\n dlg = wx.FileDialog(None, \"Select a file\", \n wildcard=\"Password Files (*.*)|*.*\",\n defaultDir=os.getcwd(), \n style=wx.FD_OPEN|wx.FD_FILE_MUST_EXIST)\n \n if dlg.ShowModal() == ...
[ "0.6279586", "0.60786945", "0.5878356", "0.5769445", "0.57345486", "0.5698939", "0.5668569", "0.5622966", "0.5622914", "0.5547109", "0.5536491", "0.55334437", "0.5514683", "0.5413541", "0.5413541", "0.5413541", "0.5413541", "0.5380102", "0.53741026", "0.53665775", "0.53657305...
0.65577245
0
Update the progress bar showing password strength
def _update_strength(self, event=None): password = self.password.GetValue() nd = calc_password_strength(password, WEB_SPEED) self.strength.UpdateStrength(nd)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _update_strength(self, event):\n if self.showText.IsChecked():\n password = self.password_txt.Value\n else:\n password = self.password.Value\n \n nd = calc_password_strength(password)\n self.strength.UpdateStrength(nd)", "async def password_strength(self, ...
[ "0.78417635", "0.7340428", "0.702136", "0.6129795", "0.6028579", "0.5982886", "0.5980605", "0.59329164", "0.58322465", "0.5777731", "0.57407576", "0.57246554", "0.57182646", "0.57139033", "0.5683199", "0.5649072", "0.5640296", "0.5604876", "0.55739087", "0.55553454", "0.55469...
0.7532259
1
Open the random password generator in 'web' mode
def _open_password_gen(self, event): dlg = PasswordGenerator(self, WEB_SPEED) if dlg.ShowModal() == wx.ID_OK: newPass = dlg.password.GetValue() if newPass: # ok to overwrite? if self.password.Value: dlg2 = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def passwordGen() :\n\treturn __randomString(12)", "def _open_password_gen(self, event):\n \n # Generate passwords suitable for resistance to local cracking\n dlg = PasswordGenerator(self, LOCAL_SPEED)\n \n if dlg.ShowModal() == wx.ID_OK:\n newPass = dlg.password.Get...
[ "0.6305559", "0.61157346", "0.59366876", "0.5825619", "0.58206415", "0.5815584", "0.5724091", "0.5667795", "0.5651259", "0.5632428", "0.56196797", "0.5618873", "0.5618182", "0.5565413", "0.5542811", "0.5531504", "0.5520201", "0.54989064", "0.5481999", "0.5464396", "0.5438672"...
0.6144822
1
Open a file Read the message from the file return that message
def get_message(): # TODO: Daniel my_file = open("C:/Users/Triqk/github/RSAProject1/TestFile.txt", "r") test_message = my_file.readlines() return test_message
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def open_file(self, filename):\n # UnicodeDecodeError: 'utf-8' codec can't decode byte 0x89 in position 0: invalid start byte\n #\n # https://docs.python.org/3/library/functions.html#open\n # 'r'\topen for reading (default)\n # 't'\ttext mode (default)\n # 'b'\tbinary mode...
[ "0.6948813", "0.67927897", "0.67457104", "0.6696488", "0.6677587", "0.66561526", "0.663631", "0.663631", "0.6618766", "0.65870464", "0.6567941", "0.6566948", "0.6524595", "0.6518227", "0.65033203", "0.65004814", "0.64788276", "0.6478085", "0.6475113", "0.64604944", "0.644609"...
0.72611904
0
Take in a chunk of a string and then convert it into a number using UTF8 encoding. return that number
def convert_chunk_into_number(chunk_of_string): # TODO: Daniel my_file = open("C:/Users/Triqk/github/RSAProject1/TestFile.txt", "r") test_message = my_file.readlines() number = int(text_message) return number
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def str2num(size, s):\n\n\ti = 0\n\tn = 0\n\twhile i < size:\n\n\t\tn = n | (ord(s[i]) << (i*8))\n\t\ti = i + 1\n\n\treturn n", "def str2num(s):\n\n i = 0\n l = 0\n try:\n for i in range(len(s)):\n l = l << 8\n l += ord(s[i])\n return l\n except:\n return 0"...
[ "0.68417054", "0.67637944", "0.67074734", "0.6392286", "0.6371596", "0.6280227", "0.62718916", "0.62423867", "0.6240432", "0.6219373", "0.62103844", "0.6204583", "0.61774796", "0.6173259", "0.6141351", "0.60723597", "0.6070758", "0.6057434", "0.60216737", "0.60123545", "0.599...
0.7179198
0
numbers is a list of numbers. Iterate thru them all and encrypt each number Put the result in a list and then return the list
def rsa_encrypt_numbers(numbers, public_key): # TODO: Daniel encrypted_numbers = [1,2,3,4,5] return encrypted_numbers
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cube(numbers):\n\n # Needs only one argument\n newlist = []\n for num in numbers:\n newlist.append(num*num*num)\n return newlist\n\n # return num1 * num1 * num1", "def ecb_encrypt(pt_bin_list, keys, rounds):\n enc_result = \"\"\n\n with multiprocessing.Pool() as p:\n enc_re...
[ "0.60349715", "0.6009271", "0.5914015", "0.5879313", "0.5868694", "0.58534425", "0.58120376", "0.5791023", "0.5786934", "0.57303864", "0.57099146", "0.5629561", "0.56062007", "0.56023186", "0.55876654", "0.55631113", "0.5560366", "0.5546295", "0.5518178", "0.55079085", "0.549...
0.80002004
0
An agent has been bound
def _bind_agent(self, field, service, svc_ref): # Tell it to handle remaining components service.handle(self._remaining) self._remaining.clear()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def onEnd(self, agent):\n\n pass", "def ai(self):\n if not self.alive:\n return\n\n assert hasattr(self, 'net'), \"Bird has ai enabled but does not appear to have any agents\"\n\n self.birth_time += 1\n\n activation = self.net.activate(self.get_inputs())[0]\n\n ...
[ "0.6659364", "0.6077239", "0.6065269", "0.5953378", "0.5935213", "0.58674085", "0.5852806", "0.5812878", "0.5805941", "0.5779509", "0.57439464", "0.5627196", "0.55457604", "0.5532276", "0.55003995", "0.5491227", "0.545867", "0.5457491", "0.5430315", "0.54222643", "0.5401352",...
0.62997425
1
Installs & starts the requested bundles, if necessary
def _install_bundles(self, bundles): # Convert to dictionaries, for easier filtering pre_installed = { bundle.get_symbolic_name(): Version(bundle.get_version()) for bundle in self._context.get_bundles()} to_install = {name: Version(version) for name, version in bundles} ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do(self):\r\n parameters = ParametersParserStr(self.args_parameters).get()\r\n self.core.install(self.product_names, parameters, with_dependencies=True)", "def bootstrap():\n sub_install_packages()\n sub_install_virtualenv()\n sub_create_virtualenv()\n sub_install_python_requirement...
[ "0.6617825", "0.6407158", "0.6393324", "0.634034", "0.6284016", "0.6274205", "0.6265285", "0.6206758", "0.6185635", "0.615684", "0.615684", "0.6133699", "0.60764194", "0.60324806", "0.60158575", "0.5974712", "0.59423393", "0.5897945", "0.5895605", "0.5880054", "0.5872872", ...
0.770309
0
Returns the UID of the isolate hosting this composer
def get_isolate_uid(self): return self._context.get_property(cohorte.PROP_UID)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hydrofabric_uid(self) -> str:\n return self._hydrofabric_uid", "def owner_id(self) -> int:\n return self.proto.owner", "def owner_id(self) -> str:\n return pulumi.get(self, \"owner_id\")", "def daemonId(self):\n return self._did", "def getuid(): # type: ignore\n retu...
[ "0.6619779", "0.62916356", "0.6231266", "0.60783947", "0.6052219", "0.60364056", "0.603114", "0.6015424", "0.6015424", "0.60093695", "0.60093695", "0.59826994", "0.5964267", "0.59541327", "0.5940408", "0.59136015", "0.59080344", "0.5889145", "0.5869613", "0.5842612", "0.58412...
0.6317617
1
Returns an Isolate bean corresponding to this composer
def get_isolate_info(self): # Language if sys.version_info[0] >= 3: language = cohorte.composer.LANGUAGE_PYTHON3 else: language = cohorte.composer.LANGUAGE_PYTHON # Make the bean return beans.Isolate(self._isolate_name, language, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_by_name(cls, context, name):\n # get deployable_obj_list for one device_id\n dep_obj = Deployable.get_by_name(context, name)\n driver_ah_obj_list = DriverAttachHandle.list(context, dep_obj.id)\n # get driver_attr_obj_list fro this dep_obj\n driver_attr_obj_list = DriverAt...
[ "0.52829003", "0.5275891", "0.5241139", "0.5128974", "0.5128974", "0.5083446", "0.5045186", "0.5023117", "0.5013447", "0.49743453", "0.49702957", "0.4949004", "0.4949004", "0.49467328", "0.49467328", "0.48896998", "0.48764035", "0.4866413", "0.4852795", "0.4838943", "0.482208...
0.6966163
0
Instantiates the given components
def instantiate(self, components): with self.__lock: # Store the new components self._status.store(components) # Install required bundles bundles = set((component.bundle_name, component.bundle_version) for component in components) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, *components) -> None:\n self.__components = list(components)", "def create_components():\n reset_uuid()\n # pylint: disable=protected-access\n controllers = []\n for compstr in dir(control):\n comp = getattr(control, compstr)\n if (compstr[0] != '_' and isclass...
[ "0.7371935", "0.70437175", "0.6648931", "0.6545803", "0.6545803", "0.6496303", "0.63938785", "0.6137995", "0.60439426", "0.6033751", "0.60161763", "0.5934014", "0.58821744", "0.5851645", "0.5801389", "0.579752", "0.5795872", "0.5787327", "0.57506543", "0.57467353", "0.5739731...
0.7344572
1
Kills the components with the given names
def kill(self, names): with self.__lock: # Update the status storage self._status.remove(names) if self._agent is not None: # An agent can kill the components for name in names: try: # Kill the compo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def kill_all():\n compose_kill_all()", "def killAll(controller=False):", "def kill(targets, controller=False):", "def killJobs(self, blTaskName, rng):\n return self._genericCommand('kill', blTaskName, rng)", "def kill(self):\n\t\tself.kill_subcomponents()\n\t\tself._subcomponents.clear()\n\t\tsel...
[ "0.6392917", "0.6340875", "0.6295935", "0.59597594", "0.58588135", "0.58073723", "0.57272154", "0.57133394", "0.57048666", "0.5649281", "0.56275314", "0.562631", "0.5609329", "0.56078964", "0.5587965", "0.55591744", "0.554573", "0.5534495", "0.5534495", "0.54747903", "0.54665...
0.7781555
0
Assumes L is a list of integers containing at least 2 elements. Finds the longest run of numbers in L, where the longest run can either be monotonically increasing or monotonically decreasing. In case of a tie for the longest run, choose the longest run that occurs first. Does not modify the list. Returns the sum of th...
def longest_run(L): # save the current longest length for increasing run length_inc = [] # save the current longest length for decreasing run length_dec = [] # set the initial length to 1 length_inc.append(1) length_dec.append(1) # save the result result_sum = 0 # save ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def longest_run(L):\n\tlongest_length = 1\n\tincreasing_length = 1\n\tdecreasing_length = 1\n\tfor i in range(len(L) - 1):\n\t\tif L[i] >= L[i+1]:\n\t\t\tdecreasing_length += 1\n\t\telse:\n\t\t\tdecreasing_length = 1\n\t\tif L[i] <= L[i+1]:\n\t\t\tincreasing_length += 1\n\t\telse:\n\t\t\tincreasing_length = 1\n\t\...
[ "0.86291176", "0.6483", "0.6480351", "0.64787334", "0.6345383", "0.63171285", "0.62693614", "0.62544256", "0.6230766", "0.62241554", "0.6117921", "0.6098478", "0.60184807", "0.5998661", "0.59813017", "0.597621", "0.59522", "0.5944125", "0.5907316", "0.58994997", "0.5882013", ...
0.81759244
1
Initialize a new instance of AxisGyroscope.
def __init__(self, mag, deg_per_sec_factor=None): Gyro.__init__(self) if mag is None: raise ArgumentNullException("'mag' param cannot be None.") if not isinstance(mag, MultiAxisGyro): msg = "'mag' param must be an instance of " msg += "raspy.components.gyros...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def teleopInit(self):\n self.gyro.setSensitivity(\n self.voltsPerDegreePerSecond\n ) # calibrates gyro values to equal degrees", "def gyroscope(self):\n raw = self.read_raw()\n # Compensate values depending on the resolution\n factor = 0\n if self._gyro_range...
[ "0.6188046", "0.5952615", "0.59420395", "0.57948995", "0.57343763", "0.5546791", "0.5525609", "0.5504106", "0.5438468", "0.53965354", "0.53888625", "0.5379123", "0.5357611", "0.5305851", "0.5276961", "0.5269758", "0.52462435", "0.5238451", "0.52235043", "0.52170473", "0.52099...
0.6825311
0
Read and update the angle.
def read_and_update_angle(self): if self.is_disposed: raise ObjectDisposedException("AxisGyroscope") self.__multiAxisGyro.read_gyro() angular_velocity = (((self.__value - self.__offset) / 40) * 40) if self.__factorSet: angular_velocity /= self.__degPerSecondFacto...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def angle(self):\n if self.__trigger == gyro_trigger_mode.GET_ANGLE_TRIGGER_READ:\n self.read_and_update_angle()\n return self.__angle", "def angle(self) -> float:\n ...", "def do_altangle(self):\n nave = 10000\n x, y, z, angle = cbp.phidget.main(nave)\n cur...
[ "0.75172615", "0.70924735", "0.7006428", "0.6900323", "0.68435234", "0.6802038", "0.67801183", "0.67401886", "0.6696387", "0.6696387", "0.6696387", "0.66932976", "0.6655493", "0.66062284", "0.6573741", "0.65669906", "0.65669906", "0.6554409", "0.6532844", "0.6531981", "0.6515...
0.7533893
0
Set the raw value.
def raw_value(self, value): if value is None: value = 0 self.__value = value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def raw(self, raw):\n\n self._raw = raw", "def SetValueRaw(self, row, rawcol, value):\n try:\n self.data[row, rawcol] = value\n except IndexError:\n while self.GetNumberRows()-1<=row:\n self.AppendRows()\n self.data[row, rawcol] = value", "de...
[ "0.7511526", "0.7208147", "0.7092631", "0.7072607", "0.70371974", "0.6830418", "0.67707294", "0.6715438", "0.6708885", "0.6681117", "0.66292995", "0.6626015", "0.6609743", "0.65999687", "0.65999687", "0.65999687", "0.65999687", "0.65999687", "0.65999687", "0.65914345", "0.659...
0.8185176
0
Get the angular velocity.
def angular_velocity(self): trig = gyro_trigger_mode.GET_ANGULAR_VELOCITY_TRIGGER_READ if self.__trigger == trig: self.read_and_update_angle() adjusted = (self.__angle - self.__offset) if self.__factorSet: return adjusted / self.__degPerSecondFactor retur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_angular_velocity(r, T):\n # http://www.hep.fsu.edu/~berg/teach/phy2048/0918.pdf\n # velocity = 2(pi)r/T\n return (2*math.pi*r)/T", "def get_velocity(self):\n return self.momentum/self.mass", "def getVelocity(self):\n return self.v", "def velocity(self):\n return ...
[ "0.8031633", "0.80294454", "0.7932014", "0.7872321", "0.7872321", "0.7819788", "0.7695756", "0.7518039", "0.74284637", "0.7397644", "0.7395855", "0.7310496", "0.7305694", "0.7182281", "0.7174432", "0.71633595", "0.71561223", "0.70999396", "0.7087294", "0.7076143", "0.7056753"...
0.8452335
0
Set the read trigger.
def set_read_trigger(self, trig): if trig is None: trig = gyro_trigger_mode.READ_NOT_TRIGGERED self.__trigger = trig
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read(self, read):\n\n self._read = read", "def setTrigger(self, *args):\n return _libsbml.Event_setTrigger(self, *args)", "def configure_trigger(i, cam, trigger):\n\n\tprint('\\n\\t*** CONFIGURING TRIGGER ***')\n\ttry:\n\t\tresult = True\n\n\t\t# Ensure trigger mode off\n\t\t# The trigger mus...
[ "0.6320584", "0.6082137", "0.5904364", "0.56495816", "0.5643086", "0.5641475", "0.5630643", "0.5464735", "0.5425164", "0.54180956", "0.539206", "0.53760475", "0.5359084", "0.535415", "0.5346307", "0.5260121", "0.52401376", "0.5234268", "0.5219881", "0.5185232", "0.5178884", ...
0.835685
0
Parse the first line of the given view into a SyntaxTestHeader. Returns `None` if the file doesn't contain syntax tests.
def get_syntax_test_tokens(view): line = view.line(0) match = None if line.size() < 1000: # no point checking longer lines as they are unlikely to match first_line = view.substr(line) match = syntax_test_header_regex.match(first_line) if not match: return None else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def on_modified_async(self):\n\n name = self.view.file_name()\n if name and not path.basename(name).startswith('syntax_test'):\n self.header = None\n return\n self.header = get_syntax_test_tokens(self.view)\n # if there is no comment start token, clear the header\n...
[ "0.59412736", "0.5502518", "0.5277679", "0.521587", "0.5214815", "0.5042557", "0.49913257", "0.49809584", "0.49738634", "0.496411", "0.4916069", "0.4915813", "0.48798993", "0.4870954", "0.48217392", "0.4821363", "0.47816378", "0.47476313", "0.47447574", "0.47131908", "0.47077...
0.836457
0
If the view has a filename, and that file name starts with the syntax test file prefix, or the view has no filename yet, read the first line to determine the syntax test header.
def on_modified_async(self): name = self.view.file_name() if name and not path.basename(name).startswith('syntax_test'): self.header = None return self.header = get_syntax_test_tokens(self.view) # if there is no comment start token, clear the header if se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_syntax_test_tokens(view):\n\n line = view.line(0)\n match = None\n if line.size() < 1000: # no point checking longer lines as they are unlikely to match\n first_line = view.substr(line)\n match = syntax_test_header_regex.match(first_line)\n\n if not match:\n return None\n ...
[ "0.7285599", "0.6003226", "0.58109915", "0.5795516", "0.5756348", "0.5699188", "0.56425184", "0.56406444", "0.5615359", "0.56014454", "0.5591054", "0.5520378", "0.5470844", "0.5442853", "0.5440998", "0.54041815", "0.53959715", "0.5371463", "0.5359007", "0.535843", "0.5354913"...
0.61736774
1
Parse details of a test assertion at a given position in the view. Always returns a AssertionLineDetails instance, whose fields may be `None`.
def get_details_of_test_assertion_line(self, pos): tokens = self.header if not tokens: return AssertionLineDetails(None, None, None) line_region = self.view.line(pos) line_text = self.view.substr(line_region) test_start_token = re.match(r'^\s*(' + re.escape(tokens.co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_details_of_line_being_tested(self):\n\n if not self.header:\n return (None, None)\n\n lines = []\n pos = self.view.sel()[0].begin()\n first_line = True\n while pos >= 0:\n details = self.get_details_of_test_assertion_line(pos)\n pos = deta...
[ "0.7045942", "0.5179798", "0.49126238", "0.4816484", "0.48162353", "0.47783992", "0.47359148", "0.47084236", "0.47002512", "0.46936494", "0.46835446", "0.46685958", "0.46666604", "0.4647681", "0.46164283", "0.45836616", "0.4569135", "0.4568072", "0.45583263", "0.44975126", "0...
0.81809545
0
Determine whether the line at the given character position is a syntax test line. It can optionally treat lines with comment markers but no assertion as a syntax test, useful for while the line is being written.
def is_syntax_test_line(self, pos, must_contain_assertion): details = self.get_details_of_test_assertion_line(pos) if details.comment_marker_match: return not must_contain_assertion or details.assertion_colrange is not None return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_line(line):\r\n if not line.strip():\r\n return False # if the last line is blank\r\n if line.startswith(\"#\"):\r\n return False # comment line\r\n if line.startswith(\" #\"):\r\n return False # comment line\r\n return line", "def line_is_comment(line: str) -> boo...
[ "0.64412737", "0.58817124", "0.58335006", "0.57256436", "0.57059705", "0.5685633", "0.5685633", "0.56759757", "0.56629014", "0.56547546", "0.56382746", "0.56126237", "0.5573984", "0.5497276", "0.54892397", "0.548672", "0.5472746", "0.54558164", "0.5425748", "0.54181623", "0.5...
0.8230717
0
Starting from the cursor position, work upwards to find all syntax test lines that occur before the line that is being tested. Return a tuple containing a list of assertion line details, along with the region of the line being tested.
def get_details_of_line_being_tested(self): if not self.header: return (None, None) lines = [] pos = self.view.sel()[0].begin() first_line = True while pos >= 0: details = self.get_details_of_test_assertion_line(pos) pos = details.line_region...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_previous_line(self):\n before_b = \"\"\"\\\n a\n\n b\n \"\"\"\n after_b = \"\"\"\\\n a\n\n b\n \"\"\"\n self.run_test(\n before_b=before_b,\n after_b=after_b,\n before_sel=(\"3.0\", \"3.0\"),\n after_sel=(\"2.0\", \"2.0\"),...
[ "0.67017174", "0.641919", "0.6385244", "0.63659334", "0.6347962", "0.61548704", "0.60973954", "0.6022692", "0.5878993", "0.57758677", "0.57655007", "0.5763165", "0.57577854", "0.57362276", "0.57264626", "0.5718745", "0.5711276", "0.569055", "0.56895673", "0.5677426", "0.56558...
0.70214504
0
Update highlighting of what the current line's test assertions point at.
def on_selection_modified_async(self): if not self.header or len(self.view.sel()) == 0: return lines, line = self.get_details_of_line_being_tested() if not lines or not lines[0].assertion_colrange: self.view.erase_regions('current_syntax_test') return ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def highlight(self, **highlight):\n self._evaluated = False\n self._highlight = highlight\n return self", "def highlight_line(self, line, factor=1.5):\n self._checkfigure()\n ld = self._get_linedict(line)\n ld['highlighted'] = True\n ld['highlight factor'] = factor\n s...
[ "0.61878616", "0.61311847", "0.59621584", "0.5839872", "0.5814303", "0.57899123", "0.56778026", "0.5653758", "0.55681527", "0.5559595", "0.5534814", "0.55347085", "0.55168873", "0.54925203", "0.54800165", "0.54752314", "0.5462166", "0.5461981", "0.54404444", "0.53782094", "0....
0.67565775
0
Find the (partial) scopes that are common for a list of scopes.
def find_common_scopes(scopes, skip_syntax_suffix): # we will use the scopes from index 0 and test against the scopes from the further indexes # as any scopes that doesn't appear in this index aren't worth checking, they can't be common # skip the base scope i.e. `source.python` check_scopes = next(it...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def combineScopes(self, scopes):\n try:\n for scope in scopes:\n requests.get(scope, timeout=3)\n except: # Should be more specific TODO: Check if this hides request.get's errors.\n raise GclassScopeError(\"Scope does not work\")\n\n SCOPES = \" \".join(sc...
[ "0.63435555", "0.5855295", "0.58384466", "0.57256234", "0.56847835", "0.56847835", "0.56598514", "0.56598514", "0.55869526", "0.5542304", "0.55192196", "0.55192196", "0.551305", "0.5482958", "0.5476319", "0.5364725", "0.520505", "0.5137879", "0.5133899", "0.51032203", "0.5093...
0.7378709
0
Determine extend of token(s) to test and return lenght and scope set. To be precise, increase column as long as the selector wouldn't change and collect the scopes.
def determine_test_extends(self, lines, line, start_col): view = self.view col_start, col_end = lines[0].assertion_colrange scopes = { view.scope_name(pos) for pos in range(line.begin() + col_start, line.begin() + col_end) } base_scope = path.commonprefix(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extent(self):\r\n return conf.lib.clang_getTokenExtent(self._tu, self)", "def _get_token_cnts(self, doc, doc_type):\n tokenized_doc = self.nlp(doc)\n self.stat_dict[doc_type][0].append(len([s for s in tokenized_doc.sents]))\n doc_len = len([t for t in tokenized_doc])\n self...
[ "0.5865029", "0.5231486", "0.5157435", "0.51565564", "0.5064249", "0.5055832", "0.4969412", "0.49187157", "0.48551396", "0.48525026", "0.4847629", "0.48247534", "0.4818654", "0.48087958", "0.4799648", "0.47860762", "0.47852033", "0.47704494", "0.47677517", "0.47305927", "0.47...
0.5979706
0
Search for the first node containing data that matches the key Returns the node or 'None' if not found Takes O(n) time
def search(self, key): current = self.head while current: if current.data == key: return current else: current = current.next_node return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find(self, key):\n curr_node = self.head\n\n while curr_node is not None: # a normal traversal and checking first match\n if curr_node.data == key:\n return curr_node\n curr_node = curr_node.next\n\n return None", "def search(self, key):\n i...
[ "0.82970965", "0.8145287", "0.81135595", "0.7781845", "0.7735547", "0.7675964", "0.7642431", "0.76307195", "0.7626093", "0.736896", "0.7353701", "0.72485787", "0.72240174", "0.72240174", "0.72000426", "0.7178694", "0.7155484", "0.715025", "0.7139032", "0.7139032", "0.7088067"...
0.83169615
0
Inserts a new Node containing data at index position Insertion takes O(1) time but finding the node at the insertion point takes O(n) time Takes overall O(n) time
def insert(self, data, index): if index == 0: self.add(data) if index > 0: new = Node(data) position = index # Cada que se llama a current = current.next_node, se decrementa el valor de position en 1, cuando el valor sea cero, se ha llegado al nodo que está actualmen...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def insert(self, data, index):\n if index == 0:\n self.prepend(data)\n return\n\n current_index = 0\n current = self.head\n previous = None\n\n while current or previous:\n if current_index == index:\n new_node = Node(data)\n new_node.next = current\n previous.nex...
[ "0.76036936", "0.7400955", "0.7308287", "0.7289469", "0.7233354", "0.72043854", "0.71814305", "0.70170546", "0.68942094", "0.6893734", "0.6794249", "0.6733147", "0.66646373", "0.6637714", "0.6611129", "0.6609709", "0.65960646", "0.65296155", "0.6526484", "0.65039337", "0.6478...
0.7551532
1
Remove Node at specified index Returns the node or None if the index is greater than the last index in the list Takes O(n) time
def remove_index(self, index): current = self.head position = index if index > (self.size() - 1): return None elif index == 0: self.head = current.next_node else: while position >= 1: previous = current curre...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove(self, index=0):\n # Error case: Index out of acceptable range\n if index < 0 or index >= self._size:\n raise RangeError(\"index out of range.\")\n\n # Edge case: Remove from front of list\n # Behave list pop_front()\n if (index == 0):\n return sel...
[ "0.74912745", "0.7485695", "0.73987645", "0.7318031", "0.72816056", "0.72356904", "0.7201431", "0.71947986", "0.71522266", "0.71425265", "0.7139728", "0.7132196", "0.7072324", "0.70621073", "0.70565325", "0.70323205", "0.6969206", "0.69315535", "0.6893273", "0.6867133", "0.68...
0.8135184
0
Returns the desc_line with the given sample information appended
def getMergeLine(desc_line,CC3_sample,GP2_sample): return desc_line.strip("\n") + "" + CC3_sample + "" + GP2_sample + "\n"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def summary_line_and_description():", "def get_line_desc(self, line):\n return dict(zip(self.header, line))", "def extract_desc(desc_line, desc_filepath, numwavelets, include_mismatch=True, wavelet=None):\n line = desc_line\n model_filename = desc_filepath + line.split(\" \")[0]\n params = line...
[ "0.72364414", "0.6240344", "0.6209357", "0.60951114", "0.59293026", "0.5911374", "0.58279544", "0.5817839", "0.57902235", "0.5688796", "0.56053317", "0.5585769", "0.557845", "0.55634975", "0.5521863", "0.5510575", "0.55037224", "0.5491647", "0.54703176", "0.5469514", "0.54586...
0.7002458
1
start execution trace of the target app, will block indefinitely
def start_trace(self): # receive message from agent within app def on_message(message, data): """ receives messages sent from inside the target process """ if message["type"] != "error": self.q.put(message["payload"]) def on_proce...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start_ltrace(self):\n\t\ttarget_pid = self.info[\"target_pid\"]\n\t\tlog_file = os.path.join(self.cfg.file_log_dir,self.info[\"hash_md5\"]+\".ltrace\")\n\t\tself.info[\"ltrace_log_path\"] = log_file\n\t\tcmd = ['/usr/bin/ltrace','-f','-tt', '-S', '-o'+log_file,\"-p\"+str(self.info[\"target_pid\"])]\n\t\tself.p...
[ "0.6682232", "0.6662044", "0.65134484", "0.6425624", "0.63945645", "0.636947", "0.6287422", "0.62053204", "0.6046414", "0.6046414", "0.6046414", "0.6046414", "0.59560496", "0.5953809", "0.594197", "0.59233797", "0.59141874", "0.59023505", "0.58936524", "0.58463067", "0.582471...
0.7400198
0
generate log when process crashes
def on_process_crashed(crash): print("crash", crash, crash.report)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_crash(self):\n print(\"Crash! Oh noes!\")", "def _log_crash_report():\n # For each crash report we find, dump its contents.\n # In theory we clean up after a crash so there should be only one.\n cwd = os.getcwd()\n for entry in os.listdir('.git'):\n if entry.startswith('fast_im...
[ "0.65604734", "0.5937354", "0.5791048", "0.5782504", "0.5701857", "0.5634942", "0.5595118", "0.55882686", "0.55882686", "0.55356604", "0.54924375", "0.5490182", "0.54670656", "0.5443322", "0.54351556", "0.5434504", "0.543429", "0.5432136", "0.5425166", "0.5423825", "0.5413943...
0.7697669
0
record when process becomes detached
def on_detached(reason, crash): print("on_detached()") print("reason:", reason) print("crash:", crash) sys.exit()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _on_parent_process_kill(self):", "def log_detach(self) -> None:\n self.log_level = LogLevel.DETACHED\n return self", "def watch_process(self):\n psutil.wait_procs([psutil.Process(self._proc.pid)],\n callback=self.start)", "def on_terminate(self, agentName, pr...
[ "0.6703187", "0.60601145", "0.5763504", "0.57595414", "0.56394523", "0.55372745", "0.5444216", "0.54433334", "0.54402465", "0.54397136", "0.542935", "0.54267883", "0.54102004", "0.5407825", "0.534341", "0.5335875", "0.5314652", "0.5248056", "0.52463084", "0.52436596", "0.5243...
0.71197116
0
Get message from df_behavior_trial Locate the row of 'MSG' and return the next content in the next row
def _get_message(df, MSG): index_msg = df['MSG'].str.contains(MSG) if sum(index_msg == True): return df.loc[df.index[df['MSG'].str.contains(MSG)] + 1, 'MSG'] else: return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getfirstmessage(s,refconvdf):\r\n return refconvdf[(refconvdf.convid==s) & (refconvdf.part_type=='initial')].body.iloc[0]", "def bitfinex2_on_message(caller, msg):\n msg = json.loads(msg)\n if caller.subbed_count == 7:\n if msg[1] == \"te\":\n chnl = msg[0]\n body = msg[...
[ "0.6264453", "0.553123", "0.5474714", "0.53704804", "0.5243916", "0.5117876", "0.51169497", "0.50814795", "0.50334775", "0.49806428", "0.48934472", "0.4854796", "0.48419902", "0.48381865", "0.48352674", "0.47970167", "0.4752273", "0.47479907", "0.47438848", "0.47245425", "0.4...
0.66861403
0
Method to detect if a behavior matlab file is for "delayresponse" or "multitargetlicking" task
def detect_task_type(path): # distinguishing "delay-response" task or "multi-target-licking" task mat = spio.loadmat(path.as_posix(), squeeze_me=True, struct_as_record=False) GUI_fields = set(mat['SessionData'].SettingsFile.GUI._fieldnames) if ({'X_center', 'Y_center', 'Z_center'}.issubset(GUI_fields) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def poll(cls, context):\r\n return context.object.animation_data.action is not None", "def _get_target_function():\n return False", "def check_ball_on_target():\n\n pass", "def get_needs_target(self):\n return self.act.get_needs_target()", "def get_needs_target(self):\n retur...
[ "0.5905293", "0.5857114", "0.57626086", "0.566114", "0.56359226", "0.56224334", "0.5603137", "0.5590066", "0.5580493", "0.5555746", "0.5544355", "0.55439067", "0.5479734", "0.54661995", "0.5385962", "0.53749555", "0.5368941", "0.53655005", "0.536089", "0.5328907", "0.5309236"...
0.7051191
0
Loading routine for delayresponse task from .mat behavior data
def load_delay_response_matfile(skey, matlab_filepath): matlab_filepath = pathlib.Path(matlab_filepath) h2o = skey.pop('h2o') SessionData = spio.loadmat(matlab_filepath.as_posix(), squeeze_me=True, struct_as_record=False)['SessionData'] # parse session datetime sessi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def loadMotorResponses(subj,hand='Right'):\n \n hands = {'Left':[0,1],'Right':[2,3]}\n\n x = tgp.loadTaskTiming(subj,'ALL')\n stimIndex = np.asarray(x['stimIndex'])\n ind = np.where(stimIndex=='motorResponse')[0]\n \n datadir = projectdir + 'data/postProcessing/hcpPostProcCiric/'\n h5f = h5...
[ "0.6227116", "0.57821697", "0.54876167", "0.5399673", "0.53854567", "0.53818727", "0.5362583", "0.53424066", "0.53107136", "0.52734476", "0.5266007", "0.5258596", "0.5255786", "0.5245194", "0.52440274", "0.52398443", "0.5234928", "0.52272415", "0.5226756", "0.52076036", "0.52...
0.5853364
1
Find out what items are documented in the given object's docstring. See `get_documented_in_lines`.
def get_documented_in_docstring(name, module=None, filename=None): try: obj, real_name = import_by_name(name) lines = pydoc.getdoc(obj).splitlines() return get_documented_in_lines(lines, module=name, filename=filename) except AttributeError: pass except ImportError, e: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_documented_in_docstring(name, module=None, filename=None):\r\n try:\r\n obj, real_name = import_by_name(name)\r\n lines = pydoc.getdoc(obj).splitlines()\r\n return get_documented_in_lines(lines, module=name, filename=filename)\r\n except AttributeError:\r\n pass\r\n exc...
[ "0.7106049", "0.69295126", "0.69261146", "0.69084525", "0.685638", "0.685638", "0.685638", "0.6704238", "0.66751426", "0.66298217", "0.66017133", "0.64457697", "0.63850904", "0.6339034", "0.6322558", "0.6314982", "0.6273072", "0.6273072", "0.6264936", "0.62516797", "0.6209736...
0.7085826
1
Given a list of poll data rows, returns the most recent row with the specified pollster and state. If no such row exists, returns None.
def most_recent_poll_row(poll_rows, pollster, state): temp_poll = poll_rows[:] i=0 for poll in temp_poll[:]: #removes all polls with pollsters other than input if poll['Pollster'] != pollster: del temp_poll[i] i -=1 i +=1 i=0 for poll in temp_poll[:]: #removes...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def most_recent_poll_row(poll_rows, pollster, state):\n # in order to return None if there is no answer, we initialize res with None.\n most_recent_row = None\n # traverse all rows to find rows with indicated pollster and state\n for row in poll_rows:\n \t# if pollster and state match\n \tif poll...
[ "0.848301", "0.829787", "0.5668728", "0.56420076", "0.55887103", "0.52126855", "0.5148217", "0.5103613", "0.505882", "0.50525606", "0.5017379", "0.49410182", "0.492444", "0.48990378", "0.4897423", "0.48707947", "0.48394945", "0.48272198", "0.48272198", "0.48173082", "0.480656...
0.8387239
1
Tests the the default can be passed as an array for an exact 1 as long as there is only one element in the default array
def test_exactly_explicit_default_array_size_1(): class TestCmdLine(CmdLine): yaml_def = ''' supported_options: - category: options: - name : test_opt long : test-opt opt : param default : [default-value] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_exactly_explicit_default_array_size_2():\n class TestCmdLine(CmdLine):\n yaml_def = '''\n supported_options:\n - category:\n options:\n - name : test_opt\n long : test-opt\n opt : param\n default : [de...
[ "0.6924859", "0.681109", "0.6646935", "0.6526877", "0.6372104", "0.62186414", "0.6186191", "0.61687064", "0.60800254", "0.6011733", "0.59420496", "0.59248763", "0.5894819", "0.5814771", "0.57995754", "0.57926476", "0.57476133", "0.5741131", "0.57276154", "0.5725769", "0.56984...
0.70412314
0
Tests that an attempt to set a default for an exact 1 with a >1 array is disallowed
def test_exactly_explicit_default_array_size_2(): class TestCmdLine(CmdLine): yaml_def = ''' supported_options: - category: options: - name : test_opt long : test-opt opt : param default : [default1, defaul...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_exactly_explicit_default_array_size_1():\n class TestCmdLine(CmdLine):\n yaml_def = '''\n supported_options:\n - category:\n options:\n - name : test_opt\n long : test-opt\n opt : param\n default : [de...
[ "0.6871357", "0.66948617", "0.6574979", "0.6380651", "0.61006606", "0.6032833", "0.596367", "0.5935376", "0.5925342", "0.5905448", "0.5891791", "0.5843164", "0.5833658", "0.5800302", "0.5783285", "0.57698876", "0.5735732", "0.5698705", "0.5695946", "0.5655392", "0.5634948", ...
0.6876854
0