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
shift in wavelength from compton scatter arguments
def wavelength_compton_shift(angle=0, units=SI): var = sy.var('h m_e c theta') par = units['h'], units['m_e'], units['c'], np.deg2rad(angle) y = h / (m_e * c) * ( 1 - sy.cos(theta) ) return dic_result(var,par,y)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def womyshift(hop):\n import matplotlib.pyplot as plt\n import logging\n from tmath.wombat.inputter import inputter\n from tmath.wombat.wshow import wshow\n plt.cla()\n plt.plot(hop[0].wave,hop[0].flux,drawstyle='steps-mid')\n plt.xlabel('Wavelength')\n plt.ylabel('Flux')\n plt.title(hop...
[ "0.63546014", "0.5527345", "0.5487977", "0.54775894", "0.54309785", "0.539677", "0.5389652", "0.5361659", "0.53366333", "0.52701193", "0.526746", "0.526746", "0.5254211", "0.524399", "0.5225598", "0.5175509", "0.5158167", "0.51561064", "0.51316005", "0.5130602", "0.51262176",...
0.5977342
1
energy of scattered electron from compton scatter arguments
def energy_scattered_electron(photonEnergy=1, units=eV): var = sy.var('m_e c E') par = units['m_e'], units['c'], photonEnergy m0 = m_e * c**2 y = m0 / ( (m0/E) + 2 ) return dic_result(var,par,y)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Eee(h_in, h_out, neutron_spectrum):\n h_out.Scale(0.098)\n neutron_spectrum.Add(h_in, 1)\n neutron_spectrum.Add(h_out, -1)\n neutron_spectrum.Fit('gaus')\n #neutron_spectrum.Draw()\n #input()\n results_fit = neutron_spectrum.GetFunction('gaus')\n mean_energy = results_fit.GetParameter(1...
[ "0.6577861", "0.65441525", "0.647298", "0.6471814", "0.6451212", "0.6439629", "0.6394314", "0.63453925", "0.63195115", "0.6298825", "0.6298426", "0.6292175", "0.62641037", "0.62198347", "0.62016594", "0.61813706", "0.61701965", "0.61628973", "0.6156462", "0.6155262", "0.61493...
0.6929233
0
find orbital energy of bohrlike atom arguments
def energy_bohr_orbital(atomicZ=Z1,mass_n=mn1,num=1,units=eV): var = sy.var('Z me mn R n') par = atomicZ, units['m_e'], mass_n, units['Rydberg'], num y = - Z**2 / (1 + (me/mn)) * (R/n**2) return dic_result(var,par,y)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def energy_atom(atom,layer):\n global r,c,h\n backval= r*((atom**2/layer**2))\n return float('%.2E' % Decimal(str(backval)))", "def energy(self):\n sum_energy = 0.0\n for i in range(0,self.natoms-1):\n for j in range(i+1,self.natoms):\n rij = (self...
[ "0.69223416", "0.65434813", "0.64057946", "0.6360433", "0.62986404", "0.6287054", "0.6253657", "0.61974674", "0.60765296", "0.6060725", "0.6059934", "0.5972318", "0.59204227", "0.59085023", "0.5867596", "0.5846785", "0.58329135", "0.58294487", "0.5824421", "0.5814927", "0.580...
0.668434
1
Delete all relations with specified target_instance_id
def DeleteTarget(self, target_instance_id):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete(self, db: Session) -> Optional[FidesopsBase]:\n _ = [target.delete(db=db) for target in self.targets]\n return super().delete(db=db)", "def delete_rel(source, target, change_list=None):\n print(\"Delete %s =*=> %s\" % (source.id, target.id))\n ss = source\n source.synset_relatio...
[ "0.6379861", "0.6238771", "0.60338104", "0.6024974", "0.60049987", "0.5978857", "0.5915508", "0.58922917", "0.58870524", "0.5876192", "0.5833558", "0.58316064", "0.5821933", "0.58050835", "0.5792647", "0.577758", "0.57772243", "0.57688856", "0.5685711", "0.5642283", "0.561287...
0.7909713
0
Return a regex pattern matching valid email addresses. Uses the same
def get_email_regex(self): validator = self.default_validators[0] user_regex = validator.user_regex.pattern.replace('\Z', '@') domain_patterns = ([re.escape(domain) + '$' for domain in validator.domain_whitelist] + [validator.domain_regex.pa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_regex_email():\n username = r'(?P<username>[a-zA-Z][a-zA-Z0-9_]*)'\n provider = r'(?P<provider>[a-zA-Z][a-zA-Z0-9_]*)'\n domain = r'(?P<domain>com|info|rs|net|org)'\n\n regex = username + r'@' + provider + r'\\.' + domain\n return re.compile(regex, flags=re.DOTALL)", "def is_valid_email...
[ "0.7826402", "0.7100562", "0.707896", "0.68179137", "0.6785911", "0.6781353", "0.6736389", "0.67036635", "0.668576", "0.66497123", "0.66097194", "0.6603927", "0.65264064", "0.64890295", "0.6476217", "0.6472955", "0.64658153", "0.6446705", "0.6408473", "0.6389417", "0.6387446"...
0.7740723
1
Add only the required message, but no 'ngrequired' attribute to the input fields, otherwise all Checkboxes of a MultipleChoiceField would require the property "checked".
def get_multiple_choices_required(self): errors = [] if self.required: for key, msg in self.error_messages.items(): if key == 'required': errors.append(('$error.required', msg)) return errors
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def enforce_required_fields(self, attrs):\n if self.instance is not None:\n return\n # missing_items = {\n # field_name: self.missing_message\n # for field_name in self.fields\n # if field_name not in attrs\n # }\n # if missing_items:\n ...
[ "0.6867341", "0.62420696", "0.62250334", "0.6210014", "0.6206814", "0.6012718", "0.5939608", "0.5922685", "0.5903722", "0.5877853", "0.5796791", "0.5769428", "0.5700604", "0.56926197", "0.5681798", "0.5667909", "0.5642874", "0.5642874", "0.56300485", "0.5623824", "0.55873775"...
0.6908154
0
set workshet's style, indent,border,font,and so on
def set_style(self):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setupStyling(self):\n\n\t\tfaces = {\n\t\t\t'times': 'Times New Roman',\n\t\t\t'mono' : 'Courier New',\n\t\t\t'helv' : 'Arial',\n\t\t\t'other': 'Comic Sans MS',\n\t\t\t'size' : 10,\n\t\t\t'size2': 8,\n\t\t}\n\n\t\tself.edit.StyleSetSpec(stc.STC_STYLE_DEFAULT, \"back:#282828,face:%(mono)s,size:%(size)d\" % face...
[ "0.7267349", "0.6602012", "0.65583104", "0.63423765", "0.6295632", "0.6188844", "0.6172938", "0.6140505", "0.6126728", "0.61162126", "0.6080704", "0.60472167", "0.6044264", "0.6028045", "0.60115784", "0.6004831", "0.60048217", "0.5995166", "0.5991517", "0.5975883", "0.5955818...
0.7522314
0
Inplace addition of a new FORMAT into the vcf_file
def add_format(vcf_file, nid, num, ntype, desc): # pylint: disable=protected-access vcf_file.formats[nid] = vcf.parser._Format(id=nid, num=num, type=ntype, desc=desc)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def AddFormat(self, format):\n self._legacy = False\n if format:\n self._format = format", "def convert_format(self, new_format):\n if new_format not in [0, 1, 2, 3]:\n raise ValueError(\"Unknown format specified\")\n\n inp_format = new_format\n if inp_format == 3:\n ...
[ "0.65807617", "0.613904", "0.60120296", "0.5881608", "0.57945067", "0.566631", "0.5635825", "0.5603917", "0.55776256", "0.5559918", "0.5541857", "0.5540987", "0.5449593", "0.5426349", "0.54091305", "0.5403872", "0.53662044", "0.5364987", "0.5361313", "0.5283563", "0.52776575"...
0.7528824
0
Inplace addition of a new INFO into the vcf_file
def add_info(vcf_file, nid, num, ntype, desc, source=None, version=None): # pylint: disable=protected-access vcf_file.infos[nid] = vcf.parser._Info( id=nid, num=num, type=ntype, desc=desc, source=source, version=version)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Add_in_vcf_SO(infofile,\n vcf_path,\n output_vcf, ):\n ori_format2info = ['AF', 'AD']\n\n if type(vcf_path) == str:\n vcf_readed = vcf.Reader(open(vcf_path, 'r'))\n else:\n try:\n vcf_readed = vcf.Reader(fsock=vcf_path)\n except:\n ...
[ "0.6393064", "0.59018177", "0.5810044", "0.5799919", "0.5798482", "0.57198364", "0.5514363", "0.5488137", "0.54699236", "0.54471403", "0.5418765", "0.541266", "0.53893375", "0.5358017", "0.535173", "0.5343342", "0.5338652", "0.5338366", "0.53055936", "0.5286202", "0.52471966"...
0.6882713
0
Given a sample and FORMAT=value kwargs, edit an entry's information inplace
def edit_format(sample, **kwargs): n_call_data = vcf.model.make_calldata_tuple(sample.data._fields + tuple(kwargs.keys())) n_data = tuple(kwargs.values()) sample.data += n_data sample.data = n_call_data(*sample.data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def adjust_entry(entry):\n if 'address2' not in entry:\n entry['address2'] = ''\n entry['hours_txt'] = ''\n if 'hours' in entry:\n strhours = []\n for elem in entry['hours']:\n strhours.append(elem['days']+' '+(' , '.join(elem['hours'])))\n entry['hours_txt'] = ('\\n...
[ "0.5755343", "0.5615022", "0.56112564", "0.5577378", "0.54586583", "0.5442603", "0.542346", "0.5413711", "0.5394532", "0.53723544", "0.5355508", "0.53346074", "0.528514", "0.5244646", "0.5238006", "0.5226905", "0.522668", "0.52142304", "0.51988703", "0.51929504", "0.5170722",...
0.7338264
0
Add or remove breakpoint for given line lineno line number for the breakpoint
def set_breakpoint(self, lineno, state): found = False for line in self.avr.list: if line['line'] == lineno: found = True break if line['line'] > lineno: break if found: if state == 0: brkpt.remov...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def DeleteBreakpoint(self, line):\n ed_marker.Breakpoint().Set(self, line, delete=True)\n ed_marker.BreakpointDisabled().Set(self, line, delete=True)", "def delete_breakpoint():\n raise NotImplementedError()", "def _SetBreakpoint(self, mobj, line=-1):\n handle = -1\n if line < 0:...
[ "0.6875519", "0.66795987", "0.6600495", "0.65793294", "0.6403228", "0.6189697", "0.6023736", "0.5977085", "0.5844905", "0.5751489", "0.5741264", "0.56522936", "0.559735", "0.55808085", "0.5570576", "0.5553773", "0.55511534", "0.55108696", "0.55064875", "0.5364874", "0.5358267...
0.72919536
0
Sets the cursor and 'current instruction' arrow icon to the given line in the text editor
def set_current_line(self, line): # move the cursor to the beginning of the specified line edit = self.ui.textEditCode.edit cursor = edit.textCursor() cursor.setPosition(edit.document().findBlockByLineNumber(line).position() - 1) cursor.movePosition(QTextCursor.StartOfLine) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def go_to_line(self, lineno):\r\n self.get_current_editor().highlight_line(lineno)", "def render_curr_line(self):\n if self.launcher_curr_pos is None:\n self.launcher_curr_pos = len(vim.current.buffer) - 1\n line = vim.current.buffer[self.launcher_curr_pos]\n vim.current.bu...
[ "0.6708681", "0.6636808", "0.63444597", "0.61505437", "0.60968345", "0.60793996", "0.6068871", "0.6036432", "0.5967749", "0.58883095", "0.5885126", "0.5877674", "0.58591783", "0.58522964", "0.58373547", "0.5802264", "0.5774884", "0.5770204", "0.576798", "0.57639074", "0.57421...
0.84223
0
Copy a memory block to another
def copy_mem_block(memfrom, memto, size): for memblock in memblocks: if memfrom >= memblock['addr'] and memfrom <= memblock['addr'] + len(memblock['mem']): memfrom -= memblock['addr'] # find the destination for memblockdest in memblocks: if memto >= memblo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def copyFromMemory(self):\n self.chip8.execute(0xA200)\n self.chip8.execute(0xF355)\n \n memory = self.chip8.get_memory()\n \n self.assertEquals(0x64, memory[0x200])\n self.assertEquals(0x27, memory[0x201])\n self.assertEquals(0x12, memory[0x202])\n se...
[ "0.66195947", "0.6611367", "0.6356784", "0.6290215", "0.628276", "0.6269379", "0.620234", "0.6092481", "0.60723096", "0.60428494", "0.59690773", "0.5953737", "0.5932066", "0.59035504", "0.5900844", "0.5885834", "0.5872047", "0.58704114", "0.58494973", "0.58022404", "0.5770722...
0.7358049
0
Get the relative paths of all files in the (sub)directories contained in the initial_root directory and return it as a list.
def path_generator(initial_root): for root, dirs, files in os.walk(initial_root): paths = [os.path.join(root, name) for name in files] return paths
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetAllFilepaths(root_directory):\n path_list = []\n for dirpath, _, filenames in os.walk(root_directory):\n for filename in filenames:\n path_list.append(os.path.abspath(os.path.join(dirpath, filename)))\n return path_list", "def files_in_dir(root_dir):\n file_set = set()\n\n ...
[ "0.76143456", "0.7303298", "0.7291078", "0.7216439", "0.70210063", "0.70210063", "0.6836081", "0.6810579", "0.67391074", "0.6678088", "0.66722095", "0.66504705", "0.6635008", "0.66099983", "0.6606953", "0.6575845", "0.6568125", "0.65650135", "0.6551485", "0.6547226", "0.65417...
0.730598
1
Tokenize all the files in a new arborescence.
def tokenize_files(paths, source_root, destination_root): for p, path in enumerate(paths): # CHANGE AND CREATE PATHS if not os.path.exists(destination_root): os.makedirs(destination_root) new_path = path.replace(source_root, destination_root) repertoire = '/'.join(ne...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tokenize(self):\n\n x = [] # input documents\n for file_path in glob.glob(self.train_dir + '*.txt'):\n file_as_string = open(file_path).read()\n x.append(file_as_string)\n\n self.tokenizer.fit_on_texts(x)\n print('input vocabulary size:', len(self.tokenizer.word_index))\n pickle_file =...
[ "0.6346817", "0.6247859", "0.61238366", "0.5941551", "0.5929445", "0.5901885", "0.5821117", "0.5815489", "0.58146226", "0.57762533", "0.5774962", "0.5734293", "0.5722693", "0.5717583", "0.57161117", "0.57014406", "0.5695419", "0.56864774", "0.5683009", "0.5681869", "0.5681869...
0.65120804
0
Marks a client to be traced. All commands and pipelines executed through this client will be traced.
def trace_client(client): _patch_client(client)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_trace_on(trace_on):\n AceQLHttpApi.set_trace_on(trace_on)", "def enableTrace(tracable):\r\n global traceEnabled\r\n traceEnabled = tracable\r\n if tracable:\r\n if not logger.handlers:\r\n logger.addHandler(logging.StreamHandler())\r\n logger.setLevel(logging.DEB...
[ "0.559865", "0.54818654", "0.5405422", "0.5314748", "0.5238988", "0.5217593", "0.51497304", "0.50984013", "0.5049202", "0.48878366", "0.4853335", "0.47838324", "0.47492483", "0.47490087", "0.46808383", "0.4680204", "0.46770978", "0.46493068", "0.46219906", "0.45996046", "0.45...
0.68294615
0
Marks a pipeline to be traced.
def trace_pipeline(pipe): _patch_multi_exec_execute(pipe)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def trace_transform(self, to_trace: bool):\n prev = self.tracing\n self.tracing = to_trace\n yield\n self.tracing = prev", "def markFTraced(self, f):\n try:\n self.fTraced.add(f)\n except AttributeError:\n self.fTraced = set()\n self.fTra...
[ "0.59506917", "0.58769184", "0.54370546", "0.53962845", "0.5289672", "0.52584237", "0.5217762", "0.52173746", "0.52029943", "0.51053375", "0.5102663", "0.5088272", "0.50701606", "0.5065795", "0.5065795", "0.5065584", "0.50510705", "0.5042805", "0.50311834", "0.50156224", "0.4...
0.5897826
1
Pass in a scoreWord tuple, Returns radians of tuple
def scoreAngle(score): #Divide by pi to get a transformatiom of (o, 2pi) -> (0, 2) angle = math.atan2((score[1]/9.0) -.5, (score[0]/9.0) -.5)/math.pi if angle < 0: angle +=2 return angle
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_rotation_point( word_list ):", "def get_score(self):\n return tuple(self.score)", "def wordscore(word):\n return sum(letterscore[l] for l in word)", "def ari(self, doc):\n num_sentences = _get_num_sentences(doc)\n num_words = _get_num_words(doc)\n if num_words <= 0:\n ...
[ "0.59276235", "0.5710406", "0.5682755", "0.5557528", "0.55344594", "0.5464482", "0.53387666", "0.5328133", "0.5285067", "0.52698755", "0.5264412", "0.5259686", "0.525429", "0.5222087", "0.5220643", "0.5204096", "0.5176338", "0.5174817", "0.517245", "0.516548", "0.5158898", ...
0.5787891
1
Creates a new client for the specified Dask cluster. If `ref_id` is not set, cluster connection properties will be read from the ``~/daskcluster.json`` file injected into new SciServer Compute containers automatically when they are created with an attached Dask cluster.
def getClient(ref_id=None): token = SciServer.Authentication.getToken() data = None if (ref_id is None): with open(expanduser('~/dask-cluster.json')) as f: data = json.load(f) else: try: response = requests.get(''.join([SciServer.Config.ComputeUrl.rstrip('/'), '/a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def configure_dask_cluster(\n address: str = \"local\", n_workers: int = 1, worker_memory: Union[str, int] = \"1GB\"\n) -> Optional[Client]:\n global __DASK_CLIENT # pylint: disable=global-statement\n\n if __DASK_CLIENT:\n return __DASK_CLIENT\n\n def create_dask_client(\n dask_cluster: ...
[ "0.61329305", "0.5818624", "0.5629314", "0.5600638", "0.55278134", "0.54456615", "0.5380087", "0.53724587", "0.53292", "0.53117216", "0.52919984", "0.5284845", "0.52639", "0.5230494", "0.52258855", "0.51883495", "0.5165865", "0.51633406", "0.5160414", "0.5101062", "0.5088152"...
0.77712643
0
() > (data) Create random field
def generate_field(): data = [["~" for i in range(10)] for j in range(10)] while not is_valid(data): data = [["~" for i in range(10)] for j in range(10)] for i in range(4): for j in range(i + 1): x, y = random.randint(0,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getRandomInstance(self, cls):\n instance = cls()\n for field in cls.schema.fields:\n setattr(instance, field.name,\n self.getRandomValue(cls, field.name))\n return instance", "def createRandomObject(fluiddb):\n about = 'benchmark test object ' + randomStr...
[ "0.62803465", "0.6199382", "0.6067398", "0.6047513", "0.598423", "0.5942617", "0.5926298", "0.58950454", "0.5879151", "0.58004004", "0.5779538", "0.5770306", "0.5769164", "0.57584953", "0.5744244", "0.56703764", "0.56642777", "0.56596905", "0.5649826", "0.5635953", "0.5627954...
0.6388598
0
Empty graphs should be OK.
def test_empty_networkx(self): g = nx.DiGraph() GraphData.from_networkx(g)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_empty_graph():\n try:\n graph_a = Graph()\n except Exception:\n assert False\n assert True", "def test_build_graph():\r\n assert valid_graph.get_graph() is not None\r\n assert invalid_graph.get_graph() != collections.defaultdict(list)", "def validate_graph(self) -> bool:\n...
[ "0.7650394", "0.7117702", "0.7014311", "0.67903644", "0.6657266", "0.66240364", "0.6623205", "0.66201234", "0.6615315", "0.66123563", "0.66016126", "0.6527737", "0.64544964", "0.6447189", "0.6446407", "0.6395812", "0.6331872", "0.63267136", "0.63233393", "0.6304012", "0.62630...
0.7448546
1
System Bode Plotting Function. A simple function to generate the Bode Plot for magnitude and frequency given a transfer function system.
def bode(system, mn=0.001, mx=1000, npts=100, title="", xlim=False, ylim=False, sv=False, disp3db=False, lowcut=None, magnitude=True, angle=True, freqaxis="rad"): # Condition system input to ensure proper execution system = _sys_condition(system, False) # Condition min and max freq terms degre...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bodePlot(H_s,w_range=(0,8),points=800):\n \n w = logspace(*w_range,points)\n h_s = lambdify(s,H_s,'numpy')\n H_jw = h_s(1j*w)\n \n # find mag and phase\n mag = 20*np.log10(np.abs(H_jw))\n phase = angle(H_jw,deg = True)\n \n eqn = Eq(H,simplify(H_s))\n display(eqn)\n \n fi...
[ "0.69409853", "0.64167047", "0.6364518", "0.611313", "0.6101504", "0.59565616", "0.58237886", "0.5742102", "0.5721084", "0.5671479", "0.5653185", "0.56221503", "0.561571", "0.5592732", "0.554497", "0.54854083", "0.54652196", "0.5451544", "0.5445368", "0.5442066", "0.54370964"...
0.735032
0
Test multiple controllers with one legacy controller.
async def test_multiple_controllers_with_legacy_one( hass: HomeAssistant, vera_component_factory: ComponentFactory, entity_registry: er.EntityRegistry, ) -> None: vera_device1: pv.VeraBinarySensor = MagicMock(spec=pv.VeraBinarySensor) vera_device1.device_id = 1 vera_device1.vera_device_id = vera...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_controller_switches(self):\n for name in self.our_controllers:\n self.start_controller(name)\n self.assertTrue(self.check_state(name, 'running'), \"{} is starting correctly\".format(name))\n time.sleep(1) # process some update() cycles\n self.stop_control...
[ "0.6551894", "0.598108", "0.57728934", "0.5622202", "0.5594967", "0.5454241", "0.5434837", "0.54135394", "0.5408503", "0.54051626", "0.53383607", "0.52957433", "0.5273578", "0.5271177", "0.5266738", "0.5262424", "0.5245568", "0.5238669", "0.52368814", "0.52141964", "0.5213405...
0.6860814
0
Test device exclusion, marking switches as lights and fixing the data type.
async def test_exclude_and_light_ids( hass: HomeAssistant, vera_component_factory: ComponentFactory, options ) -> None: vera_device1: pv.VeraBinarySensor = MagicMock(spec=pv.VeraBinarySensor) vera_device1.device_id = 1 vera_device1.vera_device_id = 1 vera_device1.name = "dev1" vera_device1.is_tr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_change_brightness_of_the_device_false():", "def test_change_color_of_the_device__false():", "def turnLightingSystemOff():\n dislin.light('OFF')", "def test_filter_device(self):\n pass", "def test_change_brightness_of_the_devicetrue():", "def turn_off(self):\n self._state = False...
[ "0.62962836", "0.62655014", "0.6211862", "0.61025053", "0.59396255", "0.58642435", "0.58523285", "0.5741305", "0.56410444", "0.5618483", "0.56062657", "0.5596066", "0.5577307", "0.5547532", "0.5546245", "0.5462217", "0.5452223", "0.5426898", "0.54055464", "0.5401009", "0.5371...
0.64568245
0
two esns with the same randomstate objects should be the same
def test_randomstate_object(self): rstA = np.random.RandomState(1) esnA = ESN(N_in,N_out,random_state=rstA) rstB = np.random.RandomState(1) esnB = ESN(N_in,N_out,random_state=rstB) self._compare(esnA,esnB,should_be="same")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_multiple_rng(self):\r\n rng1 = RandomStreams(1234)\r\n rng2 = RandomStreams(2392)\r\n assert rng1.random_state_variables is not rng2.random_state_variables", "def test_multiple_rng_aliasing(self):\r\n rng1 = RandomStreams(1234)\r\n rng2 = RandomStreams(2392)\r\n ...
[ "0.7710436", "0.7611755", "0.7608085", "0.7420826", "0.70621395", "0.671979", "0.67031866", "0.65594745", "0.6517348", "0.6421167", "0.64071935", "0.63734406", "0.63538635", "0.6099816", "0.6028365", "0.60202414", "0.5982168", "0.595241", "0.59456104", "0.5918877", "0.5916307...
0.82164276
0
input shift factors of different formats should be correctly interpreted or rejected
def test_inputshift(self): esn = ESN(N_in,N_out,input_shift=1) self.assertTrue(np.all(1+self.X == esn._scale_inputs(self.X))) esn.fit(self.X,self.y) esn.predict(self.Xp) esn = ESN(N_in,N_out,input_shift=[1]*N_in) self.assertTrue(np.all(1+self.X == esn._scale_inputs(self....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_input(self, measurements):\n return 0", "def apply_shift(text, shift):\n ### TODO.", "def test_inches_invalid_input(self):\n result = inch_to_cm(\"--\")\n self.assertIsNone(result)", "def test_step_to_midi_04():\n # This should produce 131, above range.\n step = 'C'\...
[ "0.5332189", "0.523653", "0.51219684", "0.5095182", "0.50702596", "0.5030143", "0.5006267", "0.4996576", "0.49754414", "0.4970672", "0.49310166", "0.49205178", "0.48936993", "0.48650134", "0.48490605", "0.48374298", "0.48288813", "0.4826439", "0.48170385", "0.48001713", "0.47...
0.5345903
0
returns the value of a fact (attribute) from an item iterates over the "facts" list looking for a matching attributeId to the paramater attrName returns the "value" property or ""
def getFactValue(item, attrName): # get the value of a specific fact from an item value = None for facts in item["facts"]: if facts.get('attributeId') == attrName: value = facts.get('value') break return value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getSVGItemAttrValue(self, item, attr):\n\n # Find attribute.\n for section in item.split(' '):\n pos = section.find(attr)\n if not pos == -1:\n break\n\n # Get attributes value.\n return section.split('\"')[1]", "def _get_fact(self, fact):\n ...
[ "0.6107537", "0.58490825", "0.58490825", "0.58490825", "0.5747717", "0.55343026", "0.54855174", "0.5441214", "0.5398069", "0.53706765", "0.5362823", "0.5341687", "0.53388464", "0.53186953", "0.52415174", "0.5239587", "0.5218273", "0.5142638", "0.5126581", "0.50860274", "0.506...
0.86912125
0
write a custom lineage line to the csv file assumptions csvFile is already created csv header is Association,From Connection,To Connection, From Object,To Object Association=linkType, From Object=fromObject,To Object=toObject From Connection and To Connection will be empty
def exportLineageLink(fromObject, toObject, linkType, csvFile): # TODO: add error checking row = [linkType, "", "", fromObject, toObject] csvFile.writerow(row) return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __create_csv(self):\n with open(self.__csv_file_name, 'w', newline='', encoding='utf-8') as csv_file:\n writer = csv.DictWriter(csv_file, fieldnames=self.__csv_fields, delimiter=';')\n writer.writeheader()", "def setup_csv(self) -> None:\n csvData = ['Followers', 'Time']\n...
[ "0.679591", "0.67406476", "0.66267467", "0.66069466", "0.6582446", "0.6355739", "0.62984943", "0.6298129", "0.6239687", "0.6196077", "0.6192803", "0.61079746", "0.61005765", "0.6087413", "0.60476893", "0.60422003", "0.60268176", "0.6025489", "0.60125625", "0.60064685", "0.600...
0.7790052
0
get the resource definition given a resource name (and catalog url) catalog url should stop at port (e.g. not have ldmadmin, ldmcatalog etc... or have v2 anywhere since we are using v1 api's returns rc=200 (valid) & other rc's from the get resourceDef (json)
def getResourceDef(url, user, pWd, resourceName): print("getting resource for catalog:-" + url + " resource=" + resourceName + ' user=' + user) apiURL = url + '/access/1/catalog/resources/' + resourceName # print("\turl=" + apiURL) header = {"Accept": "application/json"} tResp = requ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getResource(self, resourceName, default=None, useCache=True, **kwargs):\n logger.debug(\"Requesting resource %r\", resourceName)\n if resourceName in self.__resourcesD:\n return self.__resourcesD[resourceName](self.__cfgOb, self.__configName, self.__cachePath, useCache=useCache, **kwar...
[ "0.5896129", "0.5885464", "0.566786", "0.5587141", "0.55534345", "0.54230845", "0.5379963", "0.5369087", "0.53318334", "0.53267133", "0.5305421", "0.53007436", "0.5264485", "0.52570754", "0.5248616", "0.524706", "0.52166426", "0.5209856", "0.5188791", "0.5164939", "0.51494163...
0.72057575
0
update a setting in an existing resource returns rc=200 (valid) & other rc's from the put resourceDef (json)
def updateResourceDef(url, user, pWd, resourceName, resJson): print("\tupdating resource for catalog:-" + url + " resource=" + resourceName + ' user=' + user) print("\t" + json.dumps(resJson)) apiURL = url + '/access/1/catalog/resources/' + resourceName print("\turl=" + apiURL) heade...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _update(self, **kwargs):\n\n resource_name = self._get_resource_name(**kwargs)\n config = misc_utils.resolve_config(\n kwargs.pop('config', None),\n kwargs.pop('config_file', None)\n )\n\n return self._make_request(\n uri='%s/%s' % (self._metadata['u...
[ "0.67395264", "0.6581143", "0.6414765", "0.63349605", "0.6192349", "0.61368257", "0.61149466", "0.6108858", "0.60758865", "0.6018374", "0.59835696", "0.5959099", "0.5948032", "0.59318537", "0.58893913", "0.5850888", "0.584817", "0.5847479", "0.5832393", "0.5819727", "0.579575...
0.7355822
0
upload a file for the resource e.g. a custom lineage csv file works with either csv for zip files (.csv|.zip) returns rc=200 (valid) & other rc's from the post
def uploadResourceFile(url, user, pWd, resourceName, fileName, fullPath): print("uploading file for resource " + url + " resource=" + resourceName + ' user=' + user) apiURL = url + '/access/1/catalog/resources/' + resourceName + "/files" print("\turl=" + apiURL) # header = {"accept": "*/*", "...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def upload_file(self, file_path, file_name, output_path):", "def upload_file(self):\n request = copy.deepcopy(self.request_template)\n data = json.dumps(request)\n curr_file = {\n 'request': data,\n 'file': open(self.file_path, 'rb')\n }\n print(\"Sending ...
[ "0.7005551", "0.69610083", "0.6799539", "0.6780033", "0.66916335", "0.66748697", "0.6605972", "0.6543987", "0.6526974", "0.6514377", "0.6513589", "0.6493671", "0.6493393", "0.6493223", "0.6482603", "0.6480694", "0.64514816", "0.64237875", "0.6404326", "0.63916373", "0.6340266...
0.76561576
0
start a resource load returns rc=200 (valid) & other rc's from the get json with the job details
def executeResourceLoad(url, user, pWd, resourceName): print("starting scan resource " + url + " resource=" + resourceName + ' user=' + user) apiURL = url + '/access/2/catalog/resources/jobs/loads' print("\turl=" + apiURL) header = {"accept": "application/json", "Content-Type": "applicat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_job(self):\n response = self.client.open(\n '/v1/job/{id}'.format(id='id_example'),\n method='GET',\n content_type='application/json')\n self.assert200(response,\n 'Response body is : ' + response.data.decode('utf-8'))", "def test_...
[ "0.6691903", "0.664236", "0.6188569", "0.6166302", "0.60699373", "0.5891634", "0.5856604", "0.5842898", "0.5838517", "0.5832853", "0.57891685", "0.5764589", "0.57533854", "0.57132834", "0.5686554", "0.5674403", "0.56637776", "0.56452024", "0.56357735", "0.5619601", "0.5615560...
0.71510166
0
Return absolute path to data dir. Use the local data dir if found, otherwise, return the system dir.
def get_data_dir(): if not _datadir: local_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'data')) if os.path.isdir(local_dir): logger.debug("Using local data dir in {}".format(local_dir)) return local_dir if not _datadir: logging.error("No da...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def local_data_dir():\r\n assert sys.argv\r\n prefix_path = os.path.dirname(sys.argv[0])\r\n local_data = os.path.join(prefix_path, \"data\")\r\n return local_data", "def get_data_dir():\n return Path(current_app.config[\"USER_DIR\"]) / \"data\"", "def get_data_path():\n return os.getcwd() + ...
[ "0.811405", "0.81019694", "0.80959576", "0.8002524", "0.7980776", "0.7823071", "0.77971315", "0.7728985", "0.7722332", "0.7665467", "0.7637193", "0.7569919", "0.75658673", "0.75316304", "0.75137234", "0.7454674", "0.7447632", "0.74426234", "0.7441112", "0.743956", "0.743956",...
0.8236648
0
Includes files in the ASSH configuration.
def assh(target="~/.ssh/assh.yml", includes=assh_config, force=False): if not force: toInclude = path.existing(path.expandusers(includes)) else: toInclude = includes toInclude = [path.compactuser(path.abspath(include)) for include in toInclude] if not includes: print("There ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def includeme(config):", "def include_dirs(self):", "def update_includes(self) -> None:\n\n # Find_dir iterates over configuration for Include and IncludeOptional\n # directives to make sure we see the full include tree present in the\n # configuration files\n _ = self.find_dir(\"In...
[ "0.70496184", "0.6655211", "0.66201055", "0.62927043", "0.61733454", "0.60910195", "0.5870516", "0.5855504", "0.5846964", "0.582723", "0.5822472", "0.5810147", "0.573117", "0.570243", "0.5637135", "0.5633267", "0.5566273", "0.55270046", "0.55188024", "0.54831976", "0.54688704...
0.6744247
1
This removes all the amenities which has no names in it with the exception of 'atm'. Because 'atm' sometime has other tag called 'operator' in place of 'name' which is handled later on
def clean_nodes_no_names(tag, data): if not isinstance(tag, tuple): for each in data: if each['k'] != [] and each['v'] != []: if tag in each['k'] and 'name' not in each['k']: each['removed'] = 'true' tagValueData = dict(zip(each['k'], each['v'])) if tagValueData.get('amenity') == 'atm': e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def amenities_no_id(amenity_id=None):", "def cleanup(self):\n for residue in self.debumper.biomolecule.residues:\n if not isinstance(residue, aa.Amino):\n continue\n if residue.name == \"GLH\" or \"GLH\" in residue.patches:\n if residue.has_atom(\"HE1\")...
[ "0.60769904", "0.55574036", "0.55278105", "0.54607695", "0.54345685", "0.53040534", "0.5288114", "0.5282389", "0.52728295", "0.5247874", "0.52330494", "0.52320546", "0.5228705", "0.5160134", "0.5149133", "0.51471585", "0.51419187", "0.50997245", "0.5084213", "0.50696087", "0....
0.6477658
0
This replace the 'tag' with value 'IN' into 'name'. This used to replace the country name in 'data'
def expand_country_name(tag, name, data): for each in data: if tag in each['k'] and each['v'][each['k'].index(tag)] == 'IN': each['v'][each['k'].index(tag)] = name yield each
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def map_postags(treebank_tag):\n\n if treebank_tag.startswith('J'):\n return \"a\"\n elif treebank_tag.startswith('V'):\n return \"v\"\n elif treebank_tag.startswith('N'):\n return \"n\"\n elif treebank_tag.startswith('R'):\n return \"r\"\n else:\n return 'n'", "...
[ "0.54581296", "0.5245349", "0.51915145", "0.51482916", "0.49819973", "0.49654487", "0.4964596", "0.49384195", "0.4921127", "0.49159747", "0.49040973", "0.49040973", "0.49040973", "0.49029756", "0.4872277", "0.48569813", "0.483405", "0.47901288", "0.4727552", "0.47252038", "0....
0.8058584
0
This marks the 'type' in the 'data' from 'way' to 'area' if the first and the last reference value is same.
def detect_area_from_way(data): for each in data: if int(each['refs'][0]) == int(each['refs'][-1]): each['type'] = 'area' yield each
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_type_area_object(): \n RefValues()\n RefValues().add_ref_parameter_from_file('DIN_winter', 'D:/Utveckling/g_EKOSTAT_tool/test_data/din_vinter.txt')\n RefValues().add_ref_parameter_from_file('TOTN_winter', 'D:/Utveckling/g_EKOSTAT_tool/test_data/totn_vinter.txt')", "def add_area(self, name, a...
[ "0.550828", "0.54224616", "0.5390342", "0.5336063", "0.5313573", "0.51434433", "0.5087022", "0.506137", "0.50236565", "0.501581", "0.49715966", "0.4959219", "0.49323955", "0.4910642", "0.48461908", "0.48455316", "0.4833222", "0.4831982", "0.4822775", "0.48136947", "0.4789085"...
0.7626001
0
This fixing the address in 'data'
def fixAddress(data): for each in data: tempK = list() for tag in each['k']: if tag.split(':')[0] == 'addr': tempK.append(tag.split(':')[1]) else: tempK.append(tag) each['k'] = deepcopy(tempK) yield each
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fix_calldata(self) -> None:\n for step in self.steps:\n step.call_data = step.call_data.replace(\n \"deadbeefdeadbeefdeadbeefdeadbeefdeadbeef\", self.sender[2:]\n )", "def setData(self,address):\n self.data = _pack_address(address)", "def datamunge(cls, da...
[ "0.64731747", "0.63351446", "0.5987055", "0.5950395", "0.59443825", "0.59048706", "0.5873236", "0.58333766", "0.57657576", "0.5740342", "0.5740342", "0.5730239", "0.569365", "0.568456", "0.56256956", "0.56200373", "0.5611829", "0.5575224", "0.55503976", "0.5544425", "0.550887...
0.67776203
0
Removing the hindi name that are present
def removeHindiNames(data): hi = r"\w+:hi$" for each in data: k = list(filter(lambda e: re.findall(hi, e) != [], each['k'])) if k: for e in k: index = each['k'].index(e) each['k'].pop(index) each['v'].pop(index) yield each
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _hidden_in_unicode(self, txt):", "def clean(name):\n name = remove_extra(name)\n name = unidecode.unidecode(name) # Remove diacritics\n name = \"\".join(\n list(filter(lambda c: c in (string.ascii_letters + string.digits + \" \"), name))\n )\n name = name.lower().strip()\n return na...
[ "0.6466", "0.6230227", "0.6045568", "0.601729", "0.5998878", "0.5940593", "0.592172", "0.59169686", "0.59149504", "0.5886283", "0.5864861", "0.5830088", "0.5820349", "0.5780123", "0.5772505", "0.5747639", "0.57464623", "0.57053655", "0.56842875", "0.5682038", "0.56534463", ...
0.7355367
0
Schedule editor In addition to the URL parameters, accepts a query string parameter 'type'. If present, only sessions/timeslots with a TimeSlotTypeName with that slug will be included in the editor. More than one type can be enabled by passing multiple type parameters. ?type=regular shows only regular sessions/timeslot...
def edit_meeting_schedule(request, num=None, owner=None, name=None): # Need to coordinate this list with types of session requests # that can be created (see, e.g., SessionQuerySet.requests()) IGNORE_TIMESLOT_TYPES = ('offagenda', 'reserved', 'unavail') meeting = get_meeting(num) if name is None: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def timeEditorPanel(*args, activeClipEditMode: Union[int, bool]=0, activeTabRootClipId:\n bool=True, activeTabTime: bool=True, activeTabView: Union[int, bool]=0,\n autoFit: Union[AnyStr, bool]=\"\", autoFitTime: Union[AnyStr, bool]=\"\",\n control: bool=True...
[ "0.5657749", "0.54885894", "0.5443751", "0.5443751", "0.5189125", "0.51294136", "0.5127422", "0.50125915", "0.49843857", "0.49784467", "0.49403018", "0.49366137", "0.4894989", "0.487107", "0.4768385", "0.4733019", "0.4731144", "0.47309968", "0.47216883", "0.4699058", "0.46990...
0.6133693
0
Prepare timeslot data for template Prepares timeslots for display by sorting into groups in a structure that can be rendered by the template and by adding some data to the timeslot instances. Currently adds a 'layout_width' property to each timeslot instance. The layout_width is the width, in em, that should be used to...
def prepare_timeslots_for_display(timeslots, rooms): # Populate room_data. This collects the timeslots for each room binned by # day, plus data needed for sorting the rooms for display. room_data = dict() all_days = set() # timeslots_qs is already sorted by location, name, and t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _slots_generate(self, first_day, last_day, timezone):\n def append_slot(day, slot):\n local_start = appt_tz.localize(datetime.combine(day, time(hour=int(slot.hour), minute=int(round((slot.hour % 1) * 60)))))\n local_end = appt_tz.localize(\n datetime.combine(day, tim...
[ "0.5790289", "0.56589663", "0.53466666", "0.5327647", "0.5323871", "0.52892125", "0.51982415", "0.5193938", "0.51629907", "0.5140233", "0.50915897", "0.50837904", "0.5030225", "0.49452808", "0.4941841", "0.48638278", "0.4824114", "0.48032415", "0.47980422", "0.47888932", "0.4...
0.766128
0
Parse agenda filter parameters from a request
def parse_agenda_filter_params(querydict): if len(querydict) == 0: return None # Parse group filters from GET parameters. Other params are ignored. filt_params = {'show': set(), 'hide': set(), 'showtypes': set(), 'hidetypes': set()} for key, value in querydict.items(): if key in filt_p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def handle_filters():\n params = {'api_key': API_KEY}\n for k in demisto.args():\n if demisto.getArg(k):\n params[k] = demisto.getArg(k)\n return params", "def test_parse_filter_params_success(self):\n filter_params = {\n \"resolution\": \"daily\",\n \"time...
[ "0.6729289", "0.64264995", "0.63030475", "0.620787", "0.61907786", "0.6134348", "0.6080938", "0.6080418", "0.60079294", "0.6004882", "0.59437937", "0.5940834", "0.58899003", "0.5857779", "0.5826777", "0.5776135", "0.5758693", "0.5754834", "0.5706643", "0.56637925", "0.5662299...
0.745237
0
Decide whether to include an assignment When filtering by wg, uses historic_group if available as an attribute on the session, otherwise falls back to using group.
def should_include_assignment(filter_params, assignment): shown = len(set(filter_params['show']).intersection(assignment.filter_keywords)) > 0 hidden = len(set(filter_params['hide']).intersection(assignment.filter_keywords)) > 0 return shown and not hidden
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def condition_group_options(self):\n if \"no-groups\" in self.options and self.options[\"no-groups\"]:\n self.options[\"groups\"] = []\n if \"exclude-groups\" in self.options:\n del self.options[\"exclude-groups\"]\n\n return\n\n super().condition_group...
[ "0.5052516", "0.5011117", "0.49089313", "0.49089313", "0.48871353", "0.48748487", "0.48593527", "0.4858896", "0.4724503", "0.47126204", "0.46803734", "0.46766663", "0.46503794", "0.46026963", "0.4596253", "0.4580887", "0.4580887", "0.45729813", "0.45329982", "0.45229056", "0....
0.5319202
0
Agenda ical view By default, all agenda items will be shown. A filter can be specified in the querystring. It has the format ?show=...&hide=...&showtypes=...&hidetypes=... where any of the parameters can be omitted. The righthand side of each '=' is a comma separated list, which can be empty. If none of the filter para...
def agenda_ical(request, num=None, name=None, acronym=None, session_id=None): meeting = get_meeting(num, type_in=None) schedule = get_schedule(meeting, name) updated = meeting.updated() if schedule is None and acronym is None and session_id is None: raise Http404 assignments = SchedTimeSes...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def upcoming_ical(request):\n try:\n filter_params = parse_agenda_filter_params(request.GET)\n except ValueError as e:\n return HttpResponseBadRequest(str(e))\n \n today = datetime.date.today()\n\n # get meetings starting 7 days ago -- we'll filter out sessions in the past further ...
[ "0.5614925", "0.55825835", "0.54702145", "0.51724184", "0.50654256", "0.5040854", "0.5000996", "0.49641147", "0.4944191", "0.49019676", "0.48991993", "0.48928195", "0.4876994", "0.4852893", "0.48126802", "0.4802405", "0.47834504", "0.47783196", "0.47645387", "0.47539362", "0....
0.62793714
0
Return Upcoming meetings in iCalendar file Filters by wg name and session type.
def upcoming_ical(request): try: filter_params = parse_agenda_filter_params(request.GET) except ValueError as e: return HttpResponseBadRequest(str(e)) today = datetime.date.today() # get meetings starting 7 days ago -- we'll filter out sessions in the past further down meet...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_upcoming_meetups(self):\n return self.client.get('api/v2/meetups/upcoming',\n headers={\"Authorization\": \"{}\".format(self.token())})", "def _parse_combined_meetings(self, response):\n meetings = self._parse_past_meetings(response)\n meeting_dates = [m...
[ "0.612192", "0.56820923", "0.5678908", "0.5656231", "0.5601117", "0.5595383", "0.5477472", "0.5417653", "0.5361222", "0.5329747", "0.53140503", "0.5273413", "0.5248176", "0.5235368", "0.52339727", "0.52017266", "0.51752657", "0.51718265", "0.5165429", "0.51532614", "0.5147083...
0.6742139
0
Sets up context for flask shell as handy tool for debugging $ flask shell These variables are automatically defined app db User Post
def make_shell_context(): return {'db': db, 'User': User, 'Post': Post}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_shell_context():\n return dict(app=app,\n db=models.db,\n User=models.User,\n Post=models.Post,\n Comment=models.Comment,\n Tag=models.Tag,\n Server=Server)", "def make_shell_context():\n\n return dict(app=ap...
[ "0.7917042", "0.77736956", "0.76795673", "0.7568711", "0.7568711", "0.72117794", "0.7203888", "0.68510574", "0.6850803", "0.6849595", "0.6836894", "0.68138087", "0.6733873", "0.66796535", "0.66293514", "0.6615892", "0.65675265", "0.65331846", "0.65177727", "0.6495164", "0.643...
0.8151232
0
Return the list of root APs and mesh APs satisfy the given model and topology
def generate_ap_lists(self, topology, model): rap_list = [] map_list = [] if model: # If model is given, only the APs of that model are verified model_set = [model] else: # Otherwise, all the APs are verified model_set = self.model_to_mac_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_hyperflex_server_model_list(self):\n pass", "def models():\n return list(alg2module.keys())", "def bfs(model_root):\n\n global recovered_python_objects\n\n layers_ordered = []\n queue = [(\"model\", model_root)]\n while (len(queue)):\n path, node = queue.pop(0)\n ...
[ "0.5311417", "0.49318108", "0.48923975", "0.48923045", "0.48813042", "0.48447102", "0.48319444", "0.48264357", "0.48250076", "0.4787196", "0.4756565", "0.47519165", "0.47417066", "0.47369593", "0.4723463", "0.4708602", "0.46973625", "0.46931058", "0.46782732", "0.46766523", "...
0.779315
0
Obtain the contain of the dhcpd.leases file stored on the Linux DHCP server and parse to get the IP addresses assigned to the AP based on their MAC addresses
def _detect_ap_dynamic_addresses(self, ap_mac_list): lease_data = self.components['LinuxServer'].get_dhcp_leases() map = {} ip = mac = start_time = None for line in lease_data: l = line.split() if l[0] == "lease": ip = l[1] elif l[0] =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _parse_http_leases(dhcp_leases):\n # Remove leading and trailing quotes and spaces\n cleaned_str = dhcp_leases.replace(\n \"\\\"\", \"\").replace(\"\\'\", \"\").replace(\" \", \"\")\n elements = cleaned_str.split(',')\n num_clients = int(len(elements) / 5)\n hostname_cache = {}\n for i...
[ "0.65904623", "0.5927661", "0.58772755", "0.57295626", "0.571602", "0.5710197", "0.57062966", "0.5599383", "0.5392727", "0.53504443", "0.53475916", "0.53015333", "0.5300143", "0.5288843", "0.52493435", "0.5224456", "0.5205908", "0.51977074", "0.5140949", "0.5099482", "0.50973...
0.73815465
0
Configure the connection mode of the AP with given MAC address. This can be done by specifying the IP address of the ZD or moving the AP to/from the VLAN of the ZD
def configure_ap_connection_mode(self, ap_mac, mode, discovery_method = "", undo_reboot = False): if not self.components.has_key("L3Switch"): raise Exception("There was not any managed switch present in the testbed") logging.debug("The AP '%s' VLAN: %s" % (ap_mac, self.mac_to_vlan[ap_mac]))...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setMAC( self, intf, mac ):\n result = self.cmd( 'ifconfig', intf, 'down' )\n result += self.cmd( 'ifconfig', intf, 'hw', 'ether', mac )\n result += self.cmd( 'ifconfig', intf, 'up' )\n return result", "def change_mac(interface, mac):\r\n print(\"Changing MAC-address for \" + in...
[ "0.67119503", "0.61913425", "0.6070988", "0.60346067", "0.5971651", "0.59557456", "0.58717704", "0.5856337", "0.58527225", "0.5835204", "0.5730476", "0.5677088", "0.5671657", "0.5633251", "0.5613428", "0.5608965", "0.5600811", "0.5539186", "0.5538558", "0.55371875", "0.547910...
0.7881009
0
Verify the information shown by apmgrinfo in AP's Linux shell and on ZD's webui The VLAN location of the APs are also considerred
def verify_ap_connection_mode(self, ap_mac, discovery_method = ""): ap_obj = self.mac_to_ap[ap_mac] logging.info("Get apmgrinfo of the AP %s" % ap_mac) start_time = time.time() while True: apmgrinfo = ap_obj.get_ap_mgr_info() apmgrinfo = self._map_apmgrinfo_keys(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_ipam_vlan_groups_read(self):\n pass", "def test_ipam_vlan_groups_list(self):\n pass", "def test_verify_vlan_with_lagg0_parent_interface_using_secondary_failover_group_functions(driver):", "def test_ipam_vlans_read(self):\n pass", "def check_ap(self, targetssid):\n dbg(f...
[ "0.59797126", "0.5916037", "0.59102935", "0.58804244", "0.58197194", "0.57285553", "0.56807363", "0.5672304", "0.54828745", "0.5474314", "0.5473929", "0.5451884", "0.5374259", "0.5353757", "0.5347768", "0.5335554", "0.52931035", "0.52606016", "0.52552015", "0.5235745", "0.523...
0.6019876
0
Upgrade the primary testbed DUT to the specified software build. This relies on the DUT class upgrade function to only return after the upgrade has successfully completed.
def UpgradeDUT(self, build): elapsed = None factory_id = False upgrade_id = True list_of_connected_aps = list() build_stream = build.build_stream.name build_version = str(build_stream.split("_")[1]) bno = build.number zd_model_num = build_stream.split("_")...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def upgrade_test_mixed(self):\n self.upgrade_scenario(mixed_version=True)", "def test_do_upgrade(self):\n with self.with_config_update():\n result = self.runner.invoke(\n cli,\n [\n \"upgrade\",\n *self.LOCAL,\n ...
[ "0.591843", "0.5838044", "0.5703845", "0.5579535", "0.5547612", "0.5527068", "0.5342039", "0.53137255", "0.53120834", "0.529678", "0.52672195", "0.526084", "0.5243804", "0.5237127", "0.52000934", "0.514132", "0.5130483", "0.5110169", "0.5110169", "0.5098148", "0.506815", "0...
0.68072754
0
Get the count of existing Expenses that match the given parameters.
def count(self, updated_at=None, settled_at=None, reimbursed_at=None, approved_at=None, state=None, verified=None, fund_source=None, settlement_id=None): return self._get_request({ 'updated_at': updated_at, 'settled_at': settled_at, 'reimbursed_at': reimbursed_a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def count_explorations():\n return exp_models.ExplorationModel.get_exploration_count()", "def filter_and_count(cls, **kwargs):\n return cls.query.filter_by(**kwargs).count()", "def get_total_expenses(self):\n return sum(self.expenses.values())", "def employees_count(self, obj):\n retu...
[ "0.6209655", "0.6124248", "0.59734464", "0.5964617", "0.5870489", "0.58302784", "0.57917506", "0.5738863", "0.5708824", "0.5708824", "0.5636392", "0.5599815", "0.55475426", "0.55326927", "0.5531186", "0.55162656", "0.5502047", "0.54998", "0.5483021", "0.5481522", "0.54632384"...
0.64225847
0
Get an Expense by Id including the file attachments.
def get_by_id(self, expense_id): return self._get_request({}, Expenses.GET_EXPENSE_BY_ID.format(expense_id))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_attachments(self, expense_id):\n return self._get_request({}, Expenses.GET_EXPENSE_ATTACHMENTS.format(expense_id))", "def get(self, expense_id):\n url = base_url + expense_id\n resp = zoho_http_client.get(url, self.details, self.headers)\n return parser.get_expense(resp)", "...
[ "0.7257534", "0.69819826", "0.6602596", "0.6230637", "0.6055695", "0.56958026", "0.5655677", "0.56548846", "0.55900764", "0.5537572", "0.55257964", "0.5494994", "0.5471183", "0.54495466", "0.5415153", "0.53838104", "0.5374669", "0.5351743", "0.5349956", "0.53443354", "0.53412...
0.739249
0
Get all the file attachments associated with an Expense.
def get_attachments(self, expense_id): return self._get_request({}, Expenses.GET_EXPENSE_ATTACHMENTS.format(expense_id))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def l10n_mx_edi_retrieve_attachments(self):\n self.ensure_one()\n if not self.l10n_mx_edi_cfdi_name:\n return []\n domain = [\n ('res_id', '=', self.id),\n ('res_model', '=', self._name),\n ('name', '=', self.l10n_mx_edi_cfdi_name )]\n return ...
[ "0.66114753", "0.6203438", "0.6137067", "0.6096103", "0.59166133", "0.58720064", "0.5806908", "0.57589906", "0.5749004", "0.5701385", "0.56662697", "0.56234753", "0.55161333", "0.5472742", "0.54719067", "0.54568106", "0.5432536", "0.54055226", "0.54015076", "0.53477234", "0.5...
0.8438148
0
Sound file speaker output
def output_sound(): try: subprocess.call(['ffplay', '-nodisp', '-autoexit', SOUND_FILE]) except: pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_wav_file(self, ):\n\n f_out = open(self.wav_file, 'w')\n u_utt2spk = open(self.utt2spk, 'w')\n for file in glob.glob(self.wav_folder+'/*.wav'):\n base = os.path.basename(file).split('.')[0]\n # write to scp file\n f_out.write(base + '\\t' + file + '\...
[ "0.67410445", "0.6602738", "0.65928304", "0.65887845", "0.6438298", "0.6313423", "0.63023055", "0.62736225", "0.62520814", "0.6245686", "0.6215912", "0.62053645", "0.6201675", "0.61972076", "0.61809206", "0.61777353", "0.6177623", "0.6062136", "0.60609597", "0.6052581", "0.60...
0.7030101
0
Sorts the position data according to player positions. As the final matrix should contain the player according to their position starting from left to right from back to front the indexed ragged array list should be sorted such that the entries match this format.
def sort_position_data(pos,type='A'): ranking_type = __position_ranking[type] return sorted(pos,key=lambda player: ranking_type[player[2]])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sort_data(self):\n\n # zips the game_list and game_Scores, sorts the result by scores, and then puts them back.\n self.game_list, self.game_scores = zip(*sorted(zip(self.game_list, self.game_scores), key=lambda pair: pair[1]))", "def sort(self):\n tmp = list(zip(self.user_points, self.us...
[ "0.657941", "0.61353856", "0.60741204", "0.60449994", "0.59617496", "0.5925557", "0.5886532", "0.58741033", "0.583058", "0.58111835", "0.5800698", "0.5718119", "0.5669669", "0.56516767", "0.5648538", "0.5647723", "0.5645437", "0.5633787", "0.5602134", "0.55749553", "0.5502601...
0.62183696
1
Puts position data into a single array. stitch_position_data does not change the ordering of the data and stitches the position data together as given. Therefore, if the playing position must be controlled sort_position_data must be called first.
def stitch_position_data(pos,ball,NO_PLAYERS=11): # magic numbers _MISSING_ = -2.0**13 _NO_DIM_ = 2 # x- and y-coordinates _POST_LOOK_ = 20 # end magic numbers frames = ball[:,0] min_frame = min(frames) max_frame = max(frames) no_frames = ball.shape[0] if no_frames != (max_f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reshape_pos_data(pos_data, ball, game):\n (no_frames, no_players, no_entries) = pos_data.shape\n second_dim = no_players * no_entries\n game_status = ball[:, 4:6]\n game_half = game.copy()\n game_half.shape = (no_frames, 1)\n frames = np.arange(no_frames)\n frames.shape = (no_frames, 1)\n\...
[ "0.56949174", "0.5450263", "0.5425786", "0.53935355", "0.533686", "0.5319467", "0.5315986", "0.5217156", "0.50769025", "0.50416166", "0.50078243", "0.49776617", "0.49562672", "0.49530634", "0.49505255", "0.49471676", "0.4945072", "0.49227458", "0.4905658", "0.48939222", "0.48...
0.6256651
0
Determines the teams' playing direction. Determines the playing direction using the average position of the goalie.
def determine_playing_direction(goalie): return 'l2r' if np.average(goalie[:,0]) < 0 else 'r2l'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_direction(self):\n\n return -1 if self.curr_player == self.PLAYER1 else 1", "def direction(self):\n if self._is_hit:\n return Direction.NOT_MOVING\n return self._dir", "def attacking_direction_from_frame(frame: Frame) -> AttackingDirection:\n avg_x_home = avg(\n ...
[ "0.6422335", "0.6242589", "0.62159735", "0.61443084", "0.6096936", "0.6068614", "0.5972206", "0.5970645", "0.58291095", "0.5762486", "0.575721", "0.57144386", "0.5679166", "0.5666279", "0.5642274", "0.56348205", "0.55972826", "0.5589583", "0.55895466", "0.5568208", "0.5559705...
0.7275232
0
Switches the position coordinates. Mirrors the position coordinates either from left to right or vice versa. The routine assumes that the origin (0,0) is localized at the width and length midpoints. | | |_ | | | (0,0) |_| | | | | |
def switch_playing_direction(position_coords): # just mirrors the x-coordinate in place position_coords[:,0::2] *= -1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_position(self, x, y):\n self.tx = -x\n self.ty = -y", "def mirror(self):\n \n screen_width = self.game.screen.get_width()\n screen_height = self.game.screen.get_height()\n\n if self.rect.centerx < 0 and self.vx < 0:\n self.rect.centerx = screen_width\n...
[ "0.629159", "0.6199278", "0.6154019", "0.6100227", "0.60859734", "0.60842776", "0.60818744", "0.59753644", "0.5955525", "0.5946891", "0.5882263", "0.5879408", "0.5873591", "0.5869372", "0.5828156", "0.5828156", "0.5828156", "0.5828156", "0.5828156", "0.5828156", "0.5828156", ...
0.63893074
0
Apply a distortion correction to raw test images.
def image_undistort(): # read test images all_test_images = os.listdir('test_images') test_images = [] for name in all_test_images: if name.endswith(".jpg"): test_images.append(name) # apply distortion correction on test images undistort_images(test_images, './camera_calib_di...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __call__(self, img):\n if self.camera_matrix is not None and self.distortion_coef is not None:\n return cv2.undistort(\n img, self.camera_matrix, self.distortion_coef, None, self.camera_matrix)\n else:\n print(\"You should calculate Camera Matrix and Disto...
[ "0.58421665", "0.5784614", "0.57733196", "0.5649219", "0.5565159", "0.5565159", "0.55129373", "0.5483733", "0.54150075", "0.5397959", "0.5377323", "0.5366446", "0.53651845", "0.5323791", "0.53176665", "0.5313091", "0.52958715", "0.5286816", "0.52713114", "0.52593434", "0.5250...
0.6910377
0
Check whether the given event should be saved.
def should_save(event) -> bool: schema = event["$schemaRef"] if schema == "https://eddn.edcd.io/schemas/commodity/3": return True elif schema == "https://eddn.edcd.io/schemas/journal/1": return event["message"]["event"] == "Docked"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_saved(self, event):\n return event in self.saved_events", "def check_is_saved(self):\n raise NotImplementedError()", "def test_was_saved_properly(self):\n event = Event();\n event.user = user;\n user = models.ForeignKey(User, on_delete=models.CASCADE)\n event.e...
[ "0.7841773", "0.7078839", "0.6609369", "0.6519215", "0.6512807", "0.6404006", "0.62846226", "0.6250534", "0.6149094", "0.6122092", "0.6102671", "0.60687923", "0.60637695", "0.6059202", "0.60551834", "0.60547084", "0.60427266", "0.60363096", "0.603262", "0.5970922", "0.5965842...
0.7365392
1
Creates a sizex by sizey matrix filled with zeros.
def make_matrix(sizex, sizey): return [[0] * sizey for i in range(sizex)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def matrix_init(sizex, sizey):\n return [[0]*sizey for i in range(sizex)]", "def make_matrix(sizex, sizey):\n return [[0]*sizey for i in xrange(sizex)]", "def zeroes(height, width):\n g = [[0.0 for _ in range(width)] for __ in range(height)]\n return Matrix(g)", "def zeroMatrix(width, hei...
[ "0.8044378", "0.7826062", "0.7141801", "0.71086985", "0.70619905", "0.7058825", "0.63757265", "0.6285351", "0.6129874", "0.6119288", "0.6119288", "0.6112796", "0.6047175", "0.59919316", "0.5989762", "0.5955519", "0.5932239", "0.5928885", "0.58918095", "0.5875584", "0.5867596"...
0.79192764
1
compress all images in the path
def compress_img(): in_path = 'output/templates/rgb/' out_path = 'output/templates/imgs/' names = os.listdir(in_path) for i, name in enumerate(names): img = cv2.imread(in_path + name, 0) if any(np.array(img.shape) > 1000): img = cv2.resize(img, None, fx=0.5, fy=0.5, interpola...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compress_image(filename,k):", "def compress():\n run_manage_cmd('compress_assets')", "def convert_to_jpg_then_compress(self):\n\t\tself._compressed_file_name = 'c_' + self.file_name\n\t\tself._compressed_save_path = self.full_path.replace(self.file_name, self._compressed_file_name).replace('.png', '.jpg...
[ "0.7360889", "0.7040816", "0.69739324", "0.6898407", "0.6529752", "0.6304087", "0.6229064", "0.6204595", "0.61858433", "0.61810255", "0.61784536", "0.6066155", "0.60521555", "0.5998136", "0.59303814", "0.58843", "0.5858419", "0.58318025", "0.58209074", "0.578213", "0.5779078"...
0.75356996
0
augment images from in_path
def aug_imgs(in_path, out_path): names = os.listdir(in_path) aug = iaa.Sequential([iaa.AdditiveGaussianNoise(scale=0.01*255), iaa.Fliplr(p=0.5), iaa.Affine(shear=-10)], random_order=True) for i, name in enumerate(names): img = cv2.imread(in_path + name, 0) img = cv2....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bulk_augment_images(input_path, output_path, extension, augmentation, label_type, label_threshold=-1):\n for dir_path, dir_names, filenames in os.walk(input_path):\n structure = os.path.join(output_path, dir_path[len(input_path) + 1:])\n for file in filenames:\n if file.endswith(ext...
[ "0.68581957", "0.66561896", "0.65560323", "0.6531635", "0.65306616", "0.63866764", "0.6304583", "0.6127005", "0.6064063", "0.6061795", "0.6061274", "0.6043971", "0.6030818", "0.60276544", "0.59996986", "0.59955424", "0.59943485", "0.5932841", "0.58910215", "0.5878131", "0.584...
0.7284031
0
Given a word stem, unstem() should return the most frequently occurring unstemmed variant in the text.
def test_unstem(): # cat > cats t = Text('cat cat cats') assert t.unstem('cat') == 'cat' # cats > cat t = Text('cat cat cats cats cats') assert t.unstem('cat') == 'cats'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stemword(w):\n if not w in stemmer_cache:\n stemmer_cache[w] = stemmer.stem(w)\n return stemmer_cache[w]", "def stemm_word(word):\n return stem(word)", "def stemWord(self,word):\n if(\"stem\" in self._classes):\n return self._stem.stemmingWord(word)", "def stem(word):\n ...
[ "0.71441925", "0.6959847", "0.6879673", "0.68082815", "0.68082815", "0.67716014", "0.6693607", "0.66812867", "0.6581558", "0.6449021", "0.6414092", "0.63593334", "0.62674236", "0.6257338", "0.6224738", "0.618768", "0.6143428", "0.6138316", "0.6133532", "0.61127144", "0.605942...
0.7035201
1
Receive a path to zip file. Unzip the file, convert .shp files within to GeoJSON data files. Return a list of paths to the GeoJSON files.
def convert_to_geojson(path): outdir = path.rstrip('.zip') basename = outdir.split('/')[-1] if os.path.exists(outdir): # Delete any existing outdir shutil.rmtree(outdir) os.makedirs(outdir, exist_ok=True) unzip(path, '-d', outdir) geojson_files = [] for filename in os.listdir(outd...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_zip_files(zip_path):\n zd = zipfile.ZipFile(zip_path)\n paths = sorted(zd.filelist, key=lambda x: x.date_time)\n for path in paths:\n with zd.open(path, 'r') as fd:\n try:\n data = json.load(fd)\n yield File.Ok(fd.name, data)\n except (js...
[ "0.7014875", "0.6863437", "0.6862726", "0.6818439", "0.6624444", "0.65075654", "0.65038174", "0.6288728", "0.6269238", "0.6242993", "0.6188936", "0.61885947", "0.60866964", "0.60076624", "0.60033303", "0.5993004", "0.5980697", "0.5965034", "0.5905053", "0.5902199", "0.5876609...
0.77229273
0
Autodiscover INSTALLED_APPS translation.py modules and fail silently when not present. This forces an import on them to register. Also import explicit modules.
def autodiscover(): import copy from django.conf import settings from django.utils.importlib import import_module from django.utils.module_loading import module_has_submodule from modeltranslation.translator import translator from modeltranslation.settings import TRANSLATION_FILES for app i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def autodiscover():\n\n from importlib import import_module\n from django.conf import settings\n from django.utils.module_loading import module_has_submodule\n\n for app in settings.INSTALLED_APPS:\n mod = import_module(app)\n # Attempt to import the app's admin module.\n try:\n ...
[ "0.6868129", "0.684934", "0.67330885", "0.6426813", "0.6356248", "0.62274677", "0.6112983", "0.6098976", "0.6093613", "0.5984262", "0.5979969", "0.588824", "0.5817962", "0.5815082", "0.5695698", "0.5687319", "0.56318265", "0.5566117", "0.5551198", "0.5543653", "0.55361027", ...
0.8302976
0
Ensures that any configuration of the TranslationOption(s) are handled when importing modeltranslation. This makes it possible for scripts/management commands that affect models but know nothing of modeltranslation.
def handle_translation_registrations(*args, **kwargs): from modeltranslation.settings import ENABLE_REGISTRATIONS if not ENABLE_REGISTRATIONS: # If the user really wants to disable this, they can, possibly at their # own expense. This is generally only required in cases where other # ap...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def autodiscover():\n import copy\n from django.conf import settings\n from django.utils.importlib import import_module\n from django.utils.module_loading import module_has_submodule\n from modeltranslation.translator import translator\n from modeltranslation.settings import TRANSLATION_FILES\n\n...
[ "0.6104377", "0.53427964", "0.53071404", "0.5255302", "0.5165536", "0.51172906", "0.50387573", "0.50351423", "0.50069445", "0.5002401", "0.49951363", "0.4943385", "0.49410033", "0.49304944", "0.49231973", "0.4907591", "0.4901836", "0.4901015", "0.48980436", "0.48703158", "0.4...
0.64240545
0
Loads a keyvalue dict from the /settingsname.json file. This is for backend and device settings (e.g., symbols path, adb path).
def LoadSettings(self, name): file_path = os.path.join(self._root, Storage._SETTINGS_FILE % name) if not os.path.exists(file_path): return {} with open(file_path) as f: return json.load(f)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _load_settings_json(self) -> Dict[str, Dict[str, str]]:\n file_name = \"DisplaySettings.json\"\n settings_json_file_path = self.folder_path / file_name\n assert settings_json_file_path.exists(), f\"The '{file_name}' file is not found at '{self.folder_path}'.\"\n\n with open(settings...
[ "0.7682075", "0.76436967", "0.74313116", "0.73697716", "0.7361311", "0.7190841", "0.7138415", "0.7036984", "0.70308745", "0.6987696", "0.6978391", "0.69730574", "0.6922404", "0.6921258", "0.6860865", "0.6842287", "0.6831763", "0.6792531", "0.6726487", "0.6723363", "0.66952455...
0.81784654
0
Stores a keyvalue dict into /settingsname.json file.
def StoreSettings(self, name, settings): assert(isinstance(settings, dict)) file_path = os.path.join(self._root, Storage._SETTINGS_FILE % name) if not settings: if os.path.exists(file_path): os.unlink(file_path) return with open(file_path, 'w') as f: return json.dump(settings, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_settings(dic):\n json.dump(dic, open(\"resources/files/settings.txt\", \"w\"))\n\n # LEGACY\n # with open(\"resources/files/settings.txt\", \"w\", newline=\"\\n\") as w:\n # for sett, val in dic.items():\n # w.write(sett + '\\\\' + val + '\\n')", "def save(...
[ "0.7391012", "0.7266963", "0.71199477", "0.70493007", "0.70454943", "0.69322", "0.68625546", "0.6817008", "0.6800389", "0.6796468", "0.67484325", "0.6702263", "0.6700651", "0.6657715", "0.6652475", "0.6641371", "0.6504202", "0.64827096", "0.64824116", "0.6387421", "0.63624173...
0.77765596
0
Lists archives. Each of them is a subfolder inside the |root_path|.
def ListArchives(self): return sorted( [name for name in os.listdir(self._root) if os.path.isdir(os.path.join(self._root, name))])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_folder(self, prefix=\"\", root=\"\", delimiter=\"/\"):\n LOGGER.info(\"listing: (%s, %s)\", root, prefix)\n abspath = self.make_path(prefix)\n LOGGER.info(\"listing abs: %s\", abspath)\n absroot = self.make_path(root)\n starts = len(absroot)\n files = []\n ...
[ "0.65134925", "0.62203544", "0.6212496", "0.61904", "0.61152613", "0.60446006", "0.6038556", "0.5974934", "0.5973115", "0.59725416", "0.5965801", "0.5943776", "0.5915805", "0.5898573", "0.58731675", "0.586664", "0.58436114", "0.5816521", "0.5772589", "0.57725286", "0.57725286...
0.7553724
0
Returns an instance of |Archive|.
def OpenArchive(self, archive_name, create=False): archive_path = os.path.join(self._root, archive_name) if not os.path.exists(archive_path) and create: os.makedirs(archive_path) return Archive(archive_name, archive_path)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getArchive(conf):\n url = conf.get('url')\n maxreq = conf.getint('maxrequests', 10)\n maxq = conf.getint('maxquery')\n \n proxy=Proxy(url, limit=maxreq, qlimit=maxq)\n proxy.connectTimeout=3.0\n\n info = proxy.callRemote('archiver.info').addErrback(_connerror)\n archs= proxy.callRemote(...
[ "0.7062926", "0.70435095", "0.6877655", "0.68583477", "0.6243401", "0.61356866", "0.61159337", "0.59676975", "0.5966458", "0.59620714", "0.5885873", "0.58489996", "0.58287555", "0.58", "0.5774441", "0.5752584", "0.56981736", "0.56744707", "0.5651064", "0.56400913", "0.5570591...
0.73152244
0
Deletes the archive (removing its folder).
def DeleteArchive(self, archive_name): archive_path = os.path.join(self._root, archive_name) for f in os.listdir(archive_path): os.unlink(os.path.join(archive_path, f)) os.rmdir(archive_path)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _remove_archive(self):\n os.remove(self._archive_full_path)\n _logger.debug('Archive has been removed.')", "def delete_archive(self, exp_id):\n archive_name = os.path.join(os.path.dirname(os.path.realpath(__file__)),\n \"backup\", str(exp_id)+\".zip\")\...
[ "0.79224175", "0.74710953", "0.7237584", "0.69744927", "0.687584", "0.68684125", "0.6861021", "0.6765531", "0.6690929", "0.6638991", "0.6565542", "0.6504902", "0.64966756", "0.64847285", "0.64776456", "0.64561737", "0.6454218", "0.64528984", "0.6380202", "0.6350773", "0.63442...
0.7732743
1
Stores the symbol db (one per the overall archive).
def StoreSymbols(self, symbols): assert(isinstance(symbols, symbol.Symbols)) file_path = os.path.join(self._path, Archive._SYM_FILE) with open(file_path, 'w') as f: json.dump(symbols, f, cls=serialization.Encoder)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _save_state(self):\n with open(self.histFile,'wb') as hf:\n hf.write(self.dbFile.Value)", "def save(self):\n # First, just allocate enough memory for the SDAT header.\n data = bytearray(0x40)\n\n # -------------------\n # Make the SYMB block\n\n symbolsStr...
[ "0.6178133", "0.607331", "0.5991811", "0.59608084", "0.5952145", "0.59035206", "0.5892727", "0.5822327", "0.5818352", "0.578718", "0.5727176", "0.57216036", "0.57180005", "0.5653438", "0.5652645", "0.55902255", "0.55772096", "0.5571374", "0.5558236", "0.5552315", "0.5526142",...
0.7271076
0
Returns the bit depth of the python interpreter's architecture as a string ('32bit' or '64bit'). Similar to platform.architecture(), but with fixes for universal binaries on MacOS.
def architecture(): if is_darwin: # Darwin's platform.architecture() is buggy and always # returns "64bit" event for the 32bit version of Python's # universal binary. So we roll out our own (that works # on Darwin). if sys.maxsize > 2 ** 32: return '64bit' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bitness():\n # see https://docs.python.org/2/library/platform.html#platform.architecture\n return '64-bit' if sys.maxsize > 2**32 else '32-bit'", "def architecture(self):\n return self.random.choice([\n 'x86_64', \n 'x86'\n ])", "def mac_gcc_architecture():\n # ...
[ "0.7871925", "0.7280586", "0.7232837", "0.6860348", "0.6686206", "0.6683871", "0.657602", "0.6446138", "0.63484293", "0.63050544", "0.61490804", "0.6137903", "0.6129452", "0.61210793", "0.61102337", "0.6052607", "0.5979627", "0.5971693", "0.5961885", "0.5957045", "0.5932697",...
0.8372004
0
Delete the environment variable 'name'.
def unsetenv(name): # Some platforms (e.g. AIX) do not support `os.unsetenv()` and # thus `del os.environ[name]` has no effect onto the real # environment. For this case we set the value to the empty string. os.environ[name] = "" del os.environ[name]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def del_env(self, envname):\n\n with open(self.envpath, \"r\") as envfile:\n my_vars = {}\n for line in envfile.readlines():\n key, value = self.__kv_pair(line)\n if key is not None:\n my_vars[key] = value\n\n current_value = my_v...
[ "0.7462176", "0.72225994", "0.7119812", "0.7071742", "0.6705431", "0.6693677", "0.65488434", "0.65126544", "0.6498152", "0.645783", "0.6440164", "0.64296126", "0.64047325", "0.63854635", "0.6381086", "0.63378406", "0.62926066", "0.6286527", "0.6283336", "0.6271032", "0.624601...
0.77352726
0
Wrap creating subprocesses Return stdout of the invoked command. On Python 3, the 'encoding' kwarg controls how the output is decoded to 'str'
def exec_command(*cmdargs, **kwargs): encoding = kwargs.pop('encoding', None) out = subprocess.Popen(cmdargs, stdout=subprocess.PIPE, **kwargs).communicate()[0] # Python 3 returns stdout/stderr as a byte array NOT as string. # Thus we need to convert that to proper encoding. if is_py3: if e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def spawn(*args):\n # Adapted from ranger.ext.spawn\n process = Popen(args, stdout=PIPE, shell=True)\n stdout, stderr = process.communicate()\n return stdout.decode('utf-8')", "def _run_cmd(args, cwd):\n p = subprocess.Popen(\n args, stdin=subprocess.PIPE, stdout=subprocess.PIPE,\n s...
[ "0.6709508", "0.6595657", "0.65781486", "0.6477751", "0.6451193", "0.6349287", "0.6294633", "0.6276393", "0.62309206", "0.62197095", "0.6183304", "0.61590946", "0.6109458", "0.60882115", "0.60401547", "0.6038489", "0.60257596", "0.59966165", "0.59897965", "0.59833074", "0.598...
0.7121089
0
Wrap os.getcwd() On Windows return ShortPathName (8.3 filename) that contain only ascii characters.
def getcwd(): cwd = os.getcwd() # os.getcwd works properly with Python 3 on Windows. # We need this workaround only for Python 2 on Windows. if is_win and is_py2: try: unicode(cwd) except UnicodeDecodeError: # Do conversion to ShortPathName really only in case 'cw...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_pathless_raw_file_name_ascii(self):\n\n this_pathless_file_name = probsevere_io._get_pathless_raw_file_name(\n unix_time_sec=VALID_TIME_UNIX_SEC,\n file_extension=probsevere_io.ASCII_FILE_EXTENSION)\n\n self.assertTrue(this_pathless_file_name == PATHLESS_ASCII_FILE_...
[ "0.6624294", "0.654886", "0.620355", "0.61561626", "0.6097424", "0.60164946", "0.6004122", "0.59794486", "0.5974848", "0.5970594", "0.59212124", "0.5917865", "0.5916592", "0.58977824", "0.58801633", "0.58370954", "0.58335143", "0.57987833", "0.56746507", "0.5661794", "0.56557...
0.6757
0
Add the obsolete options to a optionparser instance and print error message when they are present.
def __add_obsolete_options(parser): g = parser.add_option_group('Obsolete options (not used anymore)') g.add_option(*_OLD_OPTIONS, **{'action': 'callback', 'callback': __obsolete_option, 'help': 'These options do not exist anymore.'})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_options(self, parser):\n pass", "def add_options(cls, parser):\n pass", "def replace_unacceptable_options(options, is_request):\n newopts = []\n if is_request:\n valid = lambda _o: _o.valid_in_request()\n valid_multiple = lambda _o: _o.valid_multiple_in_request()\n ...
[ "0.6592348", "0.6442612", "0.6338175", "0.62954456", "0.6212481", "0.6145613", "0.6081843", "0.59633774", "0.59296125", "0.58568496", "0.5856282", "0.58535105", "0.58464015", "0.583018", "0.57983434", "0.57750595", "0.57425666", "0.5735034", "0.57336885", "0.5733274", "0.5733...
0.78130025
0
Verify that all requirements to run PyInstaller are met. Especially PyWin32 is installed on Windows. Fail hard if any requirement is not met.
def check_requirements(): # Fail hard if Python does not have minimum required version if sys.version_info < (3, 3) and sys.version_info[:2] != (2, 7): raise SystemExit('PyInstaller requires at least Python 2.7 or 3.3+.') if is_win: try: from PyInstaller.utils.win32 import winut...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_requirements():\n\n # Which programs are reqired?\n required_programs = ['virtualbox', 'vagrant']\n\n # Make sure the required programs are installed.\n for program in required_programs:\n\n # What's the path to the executable?\n try:\n sub...
[ "0.7275126", "0.68711317", "0.68257946", "0.6712479", "0.6575148", "0.6543909", "0.65365744", "0.65364254", "0.64330614", "0.63722306", "0.63580203", "0.62110317", "0.6207823", "0.6171199", "0.6116241", "0.6109808", "0.60909027", "0.607099", "0.60674465", "0.60652447", "0.601...
0.8446983
0
Test if the algorithm (with a given policy) can learn an identity transformation (i.e. return observation as an action)
def test_identity(model_name): env = DummyVecEnv([lambda: IdentityEnv(10)]) model = LEARN_FUNC_DICT[model_name](env) evaluate_policy(model, env, n_eval_episodes=20, reward_threshold=90) obs = env.reset() print('test') action = env.action_space.sample() del model, env
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_identity(model_name):\n env = DummyVecEnv([lambda: IdentityEnv(10)])\n\n model = LEARN_FUNC_DICT[model_name](env)\n evaluate_policy(model, env, n_eval_episodes=20, reward_threshold=90)\n\n obs = env.reset()\n assert model.action_probability(obs).shape == (1, 10), \"Error: action_probability...
[ "0.6087851", "0.58844614", "0.56768185", "0.5513243", "0.551146", "0.54456586", "0.5423041", "0.5423041", "0.5341965", "0.53152925", "0.5312509", "0.52805567", "0.52779806", "0.5272861", "0.52388614", "0.5166704", "0.514724", "0.51457596", "0.5135512", "0.51226336", "0.512216...
0.59807354
1
Writes the curve data of the given node to the given filepath
def write(node, filepath): data = read(node) if not data: return with open(filepath, 'w') as f: json.dump(data, f, indent=4, sort_keys=True) return data
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_file(self, path, data):\n _url = (\n f\"{self.connector.base_url}/projects/{self.project_id}/nodes/{self.node_id}\"\n f\"/files/{path}\"\n )\n\n self.connector.http_call(\"post\", _url, data=data)", "def save(file_path, nodes=[]):\n\n t = time.time()\n d...
[ "0.6481592", "0.6370312", "0.6369341", "0.635926", "0.62836176", "0.6279674", "0.61604804", "0.6144581", "0.61265695", "0.6117599", "0.6116229", "0.6081739", "0.60495293", "0.60349435", "0.59905624", "0.5979504", "0.594778", "0.5937174", "0.59200865", "0.5902564", "0.58694667...
0.63968676
1
Looks at all the NurbsCurve shape nodes under the given node and attempts to read them
def read(node): shapes = list() # -- If we have a transform, add any nurbs curves # -- from it for shape in node.getShapes(): if isinstance(shape, pm.nt.NurbsCurve): shapes.append(shape) if not shapes: return None # -- Define out output data. Right now we're only s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def explore_shapes(node):\n nodeshape=node.getShape()\n print( \"shape: \",nodeshape)\n for i in range(len(nodeshape)):\n axis=get_mds_axis(node,i,strict=False)\n try:\n print( axis.getNodeName(),axis.getShape())\n except:\n print(\"blank: \",axis.getShape())", ...
[ "0.577756", "0.56607103", "0.5594365", "0.5416614", "0.5342654", "0.53410447", "0.5322744", "0.5322282", "0.53135884", "0.530556", "0.5253492", "0.5218029", "0.5211895", "0.51840514", "0.5158886", "0.5152695", "0.51273555", "0.5122613", "0.51087296", "0.5060016", "0.5014104",...
0.71439224
0
Applies the given shape data to the given node.
def apply(node, data): # -- If the data is a filepath we need to extract it if not isinstance(data, dict): # -- Check for a filepath if not os.path.exists(data): # -- Look for a filename in the shape dir data = find_shape(data) # -- If the path still...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_shape(node, **kwargs):\n return create_basic_op_node('Shape', node, kwargs)", "def ashape(node):\n shp = node.shape\n assert shp is not None\n return shp", "def node_data(self, node_data):\n self.node_data_ = node_data\n self.label = node_data.label\n self.node_type...
[ "0.63853747", "0.57133794", "0.54945236", "0.5468868", "0.5434112", "0.540316", "0.53892034", "0.5335448", "0.53153557", "0.5245886", "0.5213551", "0.5071959", "0.5071409", "0.5069574", "0.50245696", "0.5009621", "0.4999578", "0.49955162", "0.4988459", "0.49450207", "0.493196...
0.70499
0
This will take a position vector, and alter it if the up axis is set to Z. This is because it is assumed that all shapes are drawn within a YUp orientation.
def refine_from_up_axis(position, up_axis='z'): # -- Get the current axis setting current_up_axis = pm.upAxis(q=True, axis=True) # -- If we're working in the same axis space as the stored shape # -- then we can simply return the list as it is if current_up_axis == up_axis: return position ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rotateZUp(self):\n MV = self.MV\n MV[:3, 1] = 0, 0, 1 # 2nd col is up vector, make it point along z axis\n # set bottom left and bottom right z values to zero:\n MV[2, 0] = 0\n MV[2, 2] = 0\n a = MV[0, 0] # grab top left value\n b = np.sqrt(1 - a**2) # calc new ...
[ "0.664977", "0.664977", "0.66416436", "0.64391315", "0.6360007", "0.6178231", "0.61634356", "0.61035806", "0.6098195", "0.6072775", "0.60687613", "0.6044134", "0.5992674", "0.5852305", "0.581726", "0.5774609", "0.5762451", "0.57523394", "0.5717341", "0.5716793", "0.56894803",...
0.71159387
0
Looks for the shape with the given name. This will first look at any locations defined along the CRAB_PLUGIN_PATHS environment variable before inspecting built in shapes.
def find_shape(name): for path in shapes(): shape_name = os.path.basename(path).replace('.json', '') if shape_name == name: return path return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def locate_shape(shape):", "def FindShape(self, *args):\n return _XCAFDoc.XCAFDoc_ShapeTool_FindShape(self, *args)", "def shapes():\n # -- Define a list of locations to search for, starting by\n # -- adding in our builtin shape locations\n paths = [\n os.path.join(\n os.path.d...
[ "0.630736", "0.60361737", "0.5814358", "0.56247157", "0.5582922", "0.5532335", "0.5399036", "0.5338845", "0.53214586", "0.5311244", "0.5284737", "0.52722514", "0.5264087", "0.5207051", "0.5169074", "0.51614684", "0.5143494", "0.50954556", "0.5059808", "0.5057531", "0.5034335"...
0.72748756
0
Get the mod info Mod class has to either override this function or contain class attributes `name`, `version`, `author` and optionally `nsfw`.
def mod_info(self): return (self.name, self.version, self.author, getattr(self.__class__, "nsfw", False))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n \n cls = self.__class__\n \n # check if the class doesn't override mod_info\n if cls.mod_info == Mod.mod_info:\n # check mandatory attributes\n if not hasattr(cls, \"name\"):\n raise Exception(\"Mod must specify the class...
[ "0.6498732", "0.6273727", "0.5971886", "0.5971886", "0.59501064", "0.59122753", "0.5812436", "0.58079046", "0.5802122", "0.57796717", "0.57600003", "0.5746858", "0.5742757", "0.57032865", "0.57032865", "0.56754416", "0.56719494", "0.5668188", "0.5661502", "0.56510174", "0.559...
0.84243166
0
Annotation to add a Mod subclass to the mod list
def loadable_mod(modclass): if not issubclass(modclass, Mod): raise Exception("Class must be a subclass of Mod") mod = modclass() modinfo.add_mod(mod.mod_info()[0], mod)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_class(self, cls):\n self.commands.append(cls)", "def add_mod(self, mod: Modifier):\r\n if self._validate_mod(mod):\r\n self.mods[mod.name] = mod.get_mods()\r\n else:\r\n logger.warning(f\"Modifier: {mod.name} is not valid for this stat\")\r\n return",...
[ "0.6012644", "0.587775", "0.5801156", "0.57784206", "0.5643357", "0.56402594", "0.5623345", "0.5438846", "0.54130954", "0.5363698", "0.53194386", "0.531141", "0.5294607", "0.5271187", "0.5222542", "0.5199225", "0.5163535", "0.5152815", "0.5149408", "0.51418304", "0.5134012", ...
0.6272761
0
Called every time a node is visited, before we've visited its children. Returns ``True`` if children should be visited, and returns ``False`` otherwise.
def on_visit(self, node: "CSTNode") -> bool: visit_func = getattr(self, f"visit_{type(node).__name__}", None) if visit_func is not None: retval = visit_func(node) else: retval = True # Don't visit children IFF the visit function returned False. return Fals...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_children(self) -> bool:\n\n return False", "def has_children(self):\n return False", "def dfs(self):\n\n stack = [self.root]\n\n while stack:\n node = stack[-1]\n\n if node.goal:\n return True\n\n if not node.visited:\n ...
[ "0.6560455", "0.65447307", "0.64887965", "0.647547", "0.6454743", "0.6364152", "0.63212466", "0.62860423", "0.62391603", "0.6182548", "0.6177453", "0.6122329", "0.6111494", "0.61065525", "0.60020304", "0.5991521", "0.5976684", "0.59605664", "0.5952794", "0.58953494", "0.58778...
0.7126912
1
Called every time a node is visited, before we've visited its children. Returns ``True`` if children should be visited, and returns ``False`` otherwise.
def on_visit(self, node: "CSTNode") -> bool: visit_func = getattr(self, f"visit_{type(node).__name__}", None) if visit_func is not None: retval = visit_func(node) else: retval = True # Don't visit children IFF the visit function returned False. return Fals...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_children(self) -> bool:\n\n return False", "def has_children(self):\n return False", "def dfs(self):\n\n stack = [self.root]\n\n while stack:\n node = stack[-1]\n\n if node.goal:\n return True\n\n if not node.visited:\n ...
[ "0.6560455", "0.65447307", "0.64887965", "0.647547", "0.6454743", "0.6364152", "0.63212466", "0.62860423", "0.62391603", "0.6182548", "0.6177453", "0.6122329", "0.6111494", "0.61065525", "0.60020304", "0.5991521", "0.5976684", "0.59605664", "0.5952794", "0.58953494", "0.58778...
0.7126912
0
Called every time we leave a node, after we've visited its children. If
def on_leave(self, original_node: "CSTNode") -> None: leave_func = getattr(self, f"leave_{type(original_node).__name__}", None) if leave_func is not None: leave_func(original_node)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def leave(self):\n self.num_leaves += 1", "def leave(self, fsm):\n pass", "def leaves(self):\n for node in self:\n if not node.outgoing:\n yield node", "def frameLeave(self):\n try:\n self.contentFrame.currFrame.leave()\n except Attribut...
[ "0.7311933", "0.61226296", "0.61013937", "0.60572046", "0.59516746", "0.59128696", "0.5875681", "0.5840756", "0.580242", "0.57907", "0.57707155", "0.57683164", "0.5762598", "0.5749556", "0.5727356", "0.5726897", "0.5717262", "0.57012004", "0.5694858", "0.56330466", "0.5630358...
0.6557366
1
Returns a new bag of goods containing a set of goods that is a multiple (times) of the callee.
def several(self, times: int): return BagOfGoods({g: self[g] * times for g in self.keys()})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gen_all_holds(hand):\n from_hand = [()]\n for item in hand:\n for subset in from_hand:\n from_hand = from_hand + [tuple(subset) + (item, )]\n \n return set(from_hand)", "def MakeDoubleBag(self):\n for i in self.TetrominoTypeList:\n self.bag.update({i : 2...
[ "0.56254107", "0.5582518", "0.54786414", "0.5417831", "0.54087615", "0.53882", "0.5339581", "0.5322852", "0.5314538", "0.53125757", "0.52999264", "0.5295977", "0.52904", "0.52869695", "0.52845174", "0.52727187", "0.5263805", "0.5263805", "0.52483445", "0.5243849", "0.52221733...
0.732118
0
Divides one bag of goods by another. Returns the quotient as an integer. (Whole number quotients, only. "Natural" division, no negatives, floats, etc.)
def divide(self, other: BagOfGoods): if not any(other.elements()): raise ZeroDivisionError() return min((self[g] // other[g] for g in other.keys()))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def quotient(left_object, right_object):\n return int(float(left_object)/right_object)", "def div(a: Decimal, b: Decimal) -> Decimal:\n return a / b", "def div(a, b):\r\n if type(b) in inttypes_set:\r\n if not b:\r\n return Infinity(a)\r\n raise ZeroDivisionError('%r / %r'...
[ "0.7538995", "0.7274606", "0.7153844", "0.71367", "0.71239156", "0.71080875", "0.7059736", "0.7009283", "0.700643", "0.700643", "0.69916874", "0.6956919", "0.6907437", "0.68686163", "0.6866765", "0.6849948", "0.6847761", "0.6834624", "0.6831751", "0.6796422", "0.6789928", "...
0.7537825
1
Like divide(), but returns the quotent and a new bag of goods representing the remainder after division.
def divide_with_remainder(self, other: BagOfGoods): quotient = self.divide(other) remainder = BagOfGoods({g: self[g] - other[g] * quotient for g in self.keys()}) return quotient, remainder
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def divide(self, other: BagOfGoods):\n if not any(other.elements()):\n raise ZeroDivisionError()\n return min((self[g] // other[g] for g in other.keys()))", "def div(self):\n a = self.pop()\n b = self.pop()\n c= b/a\n self.push(c)", "def divide(self, k, endl...
[ "0.65907043", "0.63183475", "0.6003219", "0.5858944", "0.57688993", "0.5765904", "0.5765904", "0.5765904", "0.5752838", "0.57170355", "0.57000947", "0.5685539", "0.56388366", "0.5633001", "0.562385", "0.5620044", "0.553158", "0.5507738", "0.5490497", "0.54899013", "0.5471727"...
0.75736344
0
Determines the amount of goods and labor required for a given amount of output. Basically does a multiplication
def determine_required_goods(self, output_amount: int): required_goods = self.required_goods.several(output_amount) required_labor = self.labor_amount * output_amount return required_goods, required_labor
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def multiplication_total_of(num_list):", "def calc_coins():\n quarters = int(input(\"how many quarters?: \"))\n dimes = int(input(\"how many dimes?: \"))\n nickels = int(input(\"how many nickles?: \"))\n pennies = int(input(\"how many pennies?: \"))\n total = quarters * 0.25 + dimes * 0.1 + nickel...
[ "0.6939066", "0.64338124", "0.63424253", "0.6235187", "0.61525506", "0.6124687", "0.60936224", "0.6050683", "0.6031974", "0.59971094", "0.59647727", "0.59499985", "0.5897002", "0.589657", "0.5843241", "0.58269775", "0.58076733", "0.57676125", "0.57428885", "0.57269907", "0.57...
0.6862122
1
Function that follows simple cycles to control the piston, based on live feedback from the sensors and inputs from the interface.
def piston_control(self): # At the beginning it is necessary to set some variables t_last = 0 # time of the last cycle inhale_end = time.time() - 1 # End of the last inhale self.cd["exhale_duration"] = 1 self.cd["inhale_duration"] = 1 #now = time.time() VCV_stag...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def startup(self):\n # Initializing the cycle data (cd) dictionary\n self.cd[\"started_up\"] = False\n self.cd[\"peak_pressure\"] = 0\n self.cd[\"tidal_volume\"] = 0\n self.cd[\"inhale_duration\"] = 0\n self.cd[\"exhale_duration\"] = 0\n self.cd[\"IE_ratio\"] = 1\n ...
[ "0.6588526", "0.6413322", "0.6231226", "0.6202755", "0.61650777", "0.61587346", "0.6125194", "0.6121304", "0.61167896", "0.60881394", "0.6062735", "0.6062735", "0.6061282", "0.60585046", "0.605058", "0.6036697", "0.5967855", "0.596253", "0.5942139", "0.5928979", "0.59286", ...
0.68496615
0
Creates the arrays and queues that will be used to control the piston and update the graphs
def create_data_structures(self): # Data storage arrays for time and measurement # Create the array of zeros and preallocating start_time = time.time() # The number of data points has to be optimized self.data_points = 5000 # prs_data has three rows, 0 = time, 1 = pressur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setConstruction(self):\n self.graph_construction=[]\n self.graph_display=[]\n self.graph_drawing=self.cleanGraph(self.graph_drawing)\n #self.graph_drawing=self.takeGraphSamples(self.graph_drawing)[:]\n print(self.graph_drawing)\n #self.coefficients=self.discreteComplex...
[ "0.6265409", "0.61282945", "0.61105055", "0.61082757", "0.61031795", "0.6046453", "0.6030993", "0.60195017", "0.6001498", "0.599227", "0.59879255", "0.59798735", "0.59452957", "0.5912932", "0.5908654", "0.5899777", "0.5889155", "0.5889155", "0.5838947", "0.5827695", "0.576540...
0.71621937
0
This function receives data from the sensors via a queue, puts it into arrays for the graphs and also puts it into a LifoQueue for the piston control function.
def process_data(self): # If both queues are empty, just wait if self.prs_q.empty() and self.flw_q.empty(): time.sleep(0.01) return # while the pressure queue is not empty, get the data and append new_prs_data = False while not self.prs_q.empty(): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_data_structures(self):\n # Data storage arrays for time and measurement\n # Create the array of zeros and preallocating\n start_time = time.time()\n # The number of data points has to be optimized\n self.data_points = 5000\n # prs_data has three rows, 0 = time, ...
[ "0.702122", "0.6657732", "0.63449496", "0.62934214", "0.62835515", "0.6226581", "0.6177897", "0.6076255", "0.60468465", "0.6031077", "0.6017125", "0.5966671", "0.59602624", "0.5959211", "0.59570277", "0.5946619", "0.5939673", "0.5937747", "0.587431", "0.58720285", "0.58563", ...
0.78239536
0
Creating the threads that will update the GUI Must use .self so that the garbage collection doesn't kill the threads
def create_threads(self): # Dictionary with the interface items that will be passed to the functions gui_items = {"VCV_frequency_spb":self.VCV_frequency_spb, "VCV_volume_spb":self.VCV_volume_spb, "VCV_pressure_max_spb":self.VCV_pressure_max_spb, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, notify_window,start_date_list,end_date_list,project_to_download):\n Thread.__init__(self)\n self._notify_window = notify_window\n self.start_date_list=start_date_list\n self.end_date_list=end_date_list\n self._want_abort = 0\n self._internet_abort=...
[ "0.6520656", "0.64755505", "0.6406351", "0.64022666", "0.6258396", "0.6249684", "0.6211608", "0.6205115", "0.61781424", "0.6170776", "0.6155765", "0.612685", "0.61258256", "0.6119154", "0.6118721", "0.6102423", "0.6070592", "0.60611016", "0.6058802", "0.6055016", "0.6052005",...
0.7066523
0
This function is used to set the variable "get_tare" that is accessed in "update graphs" to calculate the tare of the pressure and flow. The tare duration corresponds to the time interval used to obtain the mean value and consider it the tare.
def set_tare_var(self, tare_duration): self.tare_duration = tare_duration self.get_tare = True # beep and blink after 100 ms if self.cfg_beep_chkBox.isChecked(): QtCore.QTimer.singleShot(100, lambda: self.worker_buzzer.long_buzz()) if self.cfg_led_chkBox.isChecked(): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_TEMA(self, timeperiod=26,\n type='line', color='secondary', **kwargs):\n\n if not self.has_close:\n raise Exception()\n\n utils.kwargs_check(kwargs, VALID_TA_KWARGS)\n if 'kind' in kwargs:\n type = kwargs['kind']\n\n name = 'TEMA({})'.format(str(timeperiod))\n self....
[ "0.54602486", "0.5391879", "0.51858383", "0.51644003", "0.51422226", "0.5089245", "0.5069505", "0.5026344", "0.5025237", "0.50204265", "0.49990296", "0.49785727", "0.49685106", "0.4967319", "0.4965791", "0.49438494", "0.48916093", "0.48865998", "0.48820776", "0.4876473", "0.4...
0.66238785
0