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
Convert the elements of a container to standard Python types. This method converts a container with elements to standard Python types. If the input container is of the type C{dict}, only its values are touched. Those values, as well as all elements of input sequences, must support a C{ToDict} method returning a seriali...
def ContainerToDicts(container): if isinstance(container, dict): ret = dict([(k, v.ToDict()) for k, v in container.items()]) elif isinstance(container, _SEQUENCE_TYPES): ret = [elem.ToDict() for elem in container] else: raise TypeError("Unknown container type '%s'" % type(container)) return ret
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def serialize_dict(container: Dict) -> Dict:\n for key, value in container.items():\n container[key] = serialize_obj(value)\n return container", "def serialize_dict(container: Dict) -> Dict:\n for key, value in container.items():\n container[key] = serialize_obj(value)\n return containe...
[ "0.61161685", "0.61161685", "0.6107625", "0.5863955", "0.5799655", "0.57992005", "0.578522", "0.5781495", "0.5722491", "0.5664061", "0.56154233", "0.5547942", "0.55431443", "0.55431443", "0.55431443", "0.5537256", "0.5404099", "0.5372495", "0.5330275", "0.52827215", "0.527369...
0.72010106
0
user_stream() should ignore Follow objects with stale actor references.
def test_stream_stale_follows(self): self.user2.delete() self.assertNotIn('Two', str(user_stream(self.user1)))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stream_for_user(self, user):\n follows = self.filter(user=user)\n qs = (Action.objects.stream_for_actor(follow.actor) for follow in follows if follow.actor is not None)\n return reduce(or_, qs, Action.objects.none()).order_by('-timestamp')", "def auto_unfollow_nonfollowers():\n\n foll...
[ "0.72431296", "0.613551", "0.60416275", "0.5982041", "0.59290546", "0.5918249", "0.58727956", "0.58393335", "0.58125633", "0.58125633", "0.57773435", "0.5733144", "0.5720436", "0.56932294", "0.5689734", "0.56663066", "0.56498605", "0.5634246", "0.56290513", "0.56242585", "0.5...
0.7202341
1
Extract webcam data from its URL
def parse_url(url): url_parts = url.split('/') webcam_name = url_parts[-3] + 'CAM' + url_parts[-2] file_ext = url[-5:-1] last_update = 0. return { 'url': url[:-1], # Skip end of line 'name': webcam_name, 'imgpath': os.path.join(WEBCAM_DIR, webcam_name, '%d' + file_ext), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_from_webcam(self):\n print \"try fetch from webcam...\"\n stream=urllib.urlopen('http://192.168.0.20/image/jpeg.cgi')\n bytes=''\n bytes+=stream.read(64500)\n a = bytes.find('\\xff\\xd8')\n b = bytes.find('\\xff\\xd9')\n\n if a != -1 and b != -1:\n ...
[ "0.7223624", "0.7047085", "0.64235824", "0.6267462", "0.5997199", "0.58141863", "0.5808723", "0.58079857", "0.5693405", "0.5635531", "0.5551949", "0.5531054", "0.55178297", "0.55173516", "0.5516314", "0.54888344", "0.5441601", "0.5432836", "0.5432544", "0.54296404", "0.541409...
0.7602071
0
Add , and attributes to indicate a 'major semibreve' (as opposed to a 'minor semibreve').
def sb_major_minor(children_of_voiceStaff): indices_BrevesOrTuplets = [-1] for element in children_of_voiceStaff: if (element.name == 'tuplet') or (element.hasAttribute('dur') and (element.getAttribute('dur').value == 'brevis' or element.getAttribute('dur').value == 'longa' or element.getAttribute('dur'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def semver():\n return \".\".join([str(v) for v in VERSION])", "def semantic_version(self) -> str:\n\n version_core = f\"{self.major_version}.{self.minor_version}.{self.patch_version}\"\n sep = \"-\" if self.pre_release != \"\" else \"\"\n\n return f\"{version_core}{sep}{self.pre_release}...
[ "0.534129", "0.5172261", "0.49749923", "0.47594857", "0.4746601", "0.47156894", "0.46635336", "0.46603906", "0.46444976", "0.45895258", "0.45784786", "0.45728213", "0.45512292", "0.44898224", "0.4460569", "0.44557804", "0.44548148", "0.44284213", "0.43896654", "0.43896654", "...
0.5632589
0
Estimate the number of syllables for a word
def estimate(word): parts = re.split(r'[^aeiouy]+', word) valid_parts = [] for part in parts: if part != '': valid_parts.append(part) syllables = 0 for p in re_subsyllables: if p.match(word): syllables -= 1 for p in re_addsyllables: if p.match(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def num_syllables(self, word):\n\n return 1", "def total_syllables(target_text):\n\n splited_text = target_text.split()\n count = 0\n for word in splited_text:\n count = count + word_syllables(word)\n return count", "def num_of_syllables(self, word):\n\n if word.lower() in self...
[ "0.85625124", "0.84106743", "0.83903486", "0.8303203", "0.8157759", "0.8099385", "0.79931957", "0.79399204", "0.7871262", "0.7720224", "0.76509124", "0.76158285", "0.7581889", "0.7564774", "0.7540934", "0.7310568", "0.7064575", "0.7019314", "0.69613206", "0.69463545", "0.6879...
0.85197634
1
takes the list of transcript csv files and adds spoken words associated with task 2 to a txt file
def csv_to_txt(): print('csv to text') input_files = sys.argv[1] i = 0 for filename in os.listdir(input_files): print(i, filename[11:-4]) output_txt_file = '' current_csv_df = pd.read_csv(sys.argv[1] + filename) for index, row in current_csv_df.iterrows(): if ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main(directory, csv_file, task_name):\n csv_data = pd.read_csv(csv_file)\n colnames = csv_data.columns.tolist()\n\n edat_files = glob.glob(directory + \"*.edat*\")\n text_files = glob.glob(directory + \"*-*.txt\")\n all_files = edat_files + text_files\n pairs = []\n paired_texts = []\n\n ...
[ "0.65899956", "0.6246819", "0.6209257", "0.6177756", "0.60997456", "0.60955375", "0.6093305", "0.6085026", "0.5978077", "0.5953307", "0.59093267", "0.58949584", "0.5873323", "0.58294004", "0.58261067", "0.5818217", "0.57632166", "0.5745265", "0.57408845", "0.5730289", "0.5726...
0.6972013
0
This function takes the CSV file with the extracted pause features and the CSV with the extracted syllable features
def combine_pause_syllable(): pause_csv = pd.read_csv(sys.argv[1]) syllable_csv = pd.read_csv(sys.argv[2]) merged = pause_csv.merge(syllable_csv, on=TRANSCRIPT_ID) # adding pause-syllable columns # speech rate merged[COOKIE_SPEECH_RATE] = merged[COOKIE_SYLLABLE_COUNT] / merged[COOKIE_DURATION] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extract_syllable_features_from_txt():\n input_files = sys.argv[1]\n csv_name = sys.argv[2]\n syllable_stats = pd.DataFrame(columns=SYLLABLE_COLUMNS)\n re_word = re.compile(r'[\\w-]+')\n i = 0\n for filename in os.listdir(input_files):\n if filename != '.DS_Store':\n print(fi...
[ "0.6551174", "0.5803363", "0.58026767", "0.5801477", "0.5794281", "0.57716185", "0.5760765", "0.5737755", "0.5737755", "0.5737755", "0.5680732", "0.56744295", "0.56744295", "0.5643753", "0.5616709", "0.5581041", "0.55776185", "0.55607", "0.5560613", "0.55591387", "0.5516825",...
0.6147171
1
The goal of this logistic regression is to classify whether an individual is a healthy control or is a dementia patient. The data is stratified and undergoes 10fold cross validation.
def create_logistic_regression(): pause_data = shuffle(pd.read_csv(sys.argv[1])) pause_data = pause_data.replace([np.inf, -np.inf], np.nan).dropna() # X = pause_data.drop([HAS_DEMENTIA, TRANSCRIPT_ID], axis=1) X = pause_data[MEMORY_FEATURES] y = pause_data[HAS_DEMENTIA] split_tracker = [] r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def logistic_train_metrics(df):\n\n with warnings.catch_warnings():\n warnings.simplefilter(\"ignore\", category=UserWarning)\n model_reg = dill.load(open('maa_conflict_model.dill', 'rb'))\n\n return model_reg", "def run_logistic_regression(training, testing, feature_cols, outcome_col):\n ...
[ "0.6831762", "0.6677965", "0.6661084", "0.66070837", "0.65637374", "0.65123886", "0.6491418", "0.64245576", "0.6359924", "0.6351835", "0.633985", "0.6330328", "0.6271656", "0.62617517", "0.6238637", "0.62014663", "0.6134061", "0.610931", "0.608315", "0.606158", "0.6054889", ...
0.68424803
0
updates state value using update_value_factory if state is in the storage.
def test_add_or_update_state_for_state_in_storage(self): def test_update_value(name, value): return f'{name}-{value}' state_manager = ActorStateManager(self._fake_actor) state_change_tracker = state_manager._get_contextual_state_tracker() val = _run(state_manager.add_or_upda...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def updateValue(self, state):\n return self.getQValue(state, self.policy[state[0], state[1]])", "def update(self):\n self._data.update()\n\n self._state = self._data.get_value(self._type)", "def update(self, key, val):\n state_dict = self.todict()\n assert key in state_dict\n...
[ "0.7151833", "0.665996", "0.6558452", "0.6502737", "0.64651436", "0.63845944", "0.63560015", "0.6289542", "0.6248779", "0.62400794", "0.6227977", "0.61939865", "0.6159757", "0.61569464", "0.61077875", "0.61051774", "0.6100336", "0.6094352", "0.60911036", "0.60332465", "0.5980...
0.6914396
1
Run black and isort
def format(ctx): for cmd in ("black .", "isort ."): ctx.run(cmd, echo=True)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_black(self):\n chdir(REPO_ROOT)\n cmd = [\"black\", \"-v\", \"--check\", *SRC_DIRS]\n print(\"running:\", \" \".join(str(part) for part in cmd))\n proc = run(cmd, capture_output=True)\n assert proc.returncode == 0, f\"black issues:\\n{proc.stderr.decode('utf-8')}\"", "...
[ "0.59754866", "0.59357375", "0.59338224", "0.5830252", "0.5777101", "0.5715761", "0.57027775", "0.5696344", "0.5681235", "0.5680232", "0.5654622", "0.5618479", "0.5586576", "0.55820316", "0.5538225", "0.5526683", "0.5522204", "0.55172414", "0.5488912", "0.546539", "0.54405814...
0.6124772
0
Wait until toy is detected or timeout is reached.
async def toy_detected(self, toy_wait_time): logging.info("Waiting for toy") try: await asyncio.wait_for(self._wait_for_toy(), timeout=toy_wait_time) logging.info("Toy detected") return True except asyncio.TimeoutError: logging.info("No toy detecte...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wait_for_time():\n while rospy.Time().now().to_sec() == 0:\n pass", "def wait_for_time():\n while rospy.Time().now().to_sec() == 0:\n pass", "def wait_for_time():\n while rospy.Time().now().to_sec() == 0:\n pass", "def wait_for_time():\n while rospy.Time().now().to_sec() == 0:\...
[ "0.68167084", "0.6798189", "0.6798189", "0.6798189", "0.6736745", "0.6614005", "0.65733945", "0.64865094", "0.64865094", "0.64865094", "0.64865094", "0.64865094", "0.64865094", "0.64865094", "0.64865094", "0.64865094", "0.64865094", "0.6464942", "0.639782", "0.63566405", "0.6...
0.7551
0
Takes an srm value as an int such as 1 or string such as '1' and returns a hex color code for it.
def srm_to_hex(srm: int | str) -> str: mapping = { 0: '#FFF4D4', 1: '#FFE699', 2: '#FFD878', 3: '#FFCA5A', 4: '#FFBF42', 5: '#FBB123', 6: '#F8A600', 7: '#F39C00', 8: '#EA8F00', 9: '#E58500', 10: '#DE7C00', 11: '#D77200',...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_color(self, value):\n value = min(max(0,value), 1) * 510\n\n if value < 255:\n redValue = 255\n greenValue = math.sqrt(value) * 16\n greenValue = int(greenValue)\n else:\n greenValue = 255\n value = value - 255\n redValu...
[ "0.72110575", "0.69716215", "0.66990834", "0.66990834", "0.66990834", "0.66604406", "0.6657392", "0.6654255", "0.6536384", "0.6468973", "0.64152944", "0.6414161", "0.63517797", "0.633173", "0.63313353", "0.62861365", "0.6267756", "0.625612", "0.62495655", "0.62468195", "0.623...
0.73023427
0
Parse line of text and return lineData where lineData is data, which shall be saved and used for parsing next line This is quicker version of highlighBlock, which doesn't return results, but only parsers the block and produces data, which is necessary for parsing next line. Use it for invisible lines
def parseBlock(self, text, prevLineData): return self.parser.parseBlock(text, prevLineData)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_line(self, line, data):\n return data", "def parse_line(self, line):\n success = self.parser.handle_line(line)\n if success:\n self.data.update()\n else:\n self.bot.log(\"didn't handle line: '{}'\".format(line))", "def parse(self, text: str) -> yasl...
[ "0.65719175", "0.6142653", "0.6092511", "0.60456854", "0.6037642", "0.6006456", "0.58069974", "0.57957816", "0.5785322", "0.5602688", "0.56008947", "0.55998373", "0.5596856", "0.5575851", "0.5551373", "0.5543945", "0.5474812", "0.5460095", "0.5457196", "0.54539376", "0.543152...
0.6324044
1
Check if text at given position is a code
def isCode(self, lineData, column): return self._getTextType(lineData, column) == ' '
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def IsNonCode(self, pos):\n return self.IsComment(pos) or self.IsString(pos)", "def is_text(line, start, end, line_number, code_blocks):\n if any(c[0] <= line_number <= c[1] for c in code_blocks):\n return False\n else:\n n = len(line)\n idx = -1\n last_block_was_text = F...
[ "0.65709645", "0.63682026", "0.63105905", "0.62974036", "0.6263238", "0.62077844", "0.6141499", "0.6112447", "0.6061554", "0.599065", "0.5977286", "0.59511393", "0.5900852", "0.58948094", "0.5852603", "0.5815239", "0.57420677", "0.5670188", "0.5653685", "0.56366485", "0.56263...
0.71405375
0
Check if text at given position is a block comment
def isBlockComment(self, lineData, column): return self._getTextType(lineData, column) == 'b'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ingest_c_block_comments(self, line, position):\n\n pos = position\n while self._in_block_comment and pos < len(line):\n if pos + 1 < len(line) and line[pos] == '*' and line[pos + 1] == '/':\n self._in_block_comment = False\n pos += 2\n pos += ...
[ "0.730411", "0.71887034", "0.68748695", "0.6691965", "0.66720694", "0.6622821", "0.6596969", "0.6570587", "0.64614373", "0.64526194", "0.64248955", "0.63126636", "0.62933534", "0.6258408", "0.61901736", "0.6140033", "0.60635126", "0.60262686", "0.59996486", "0.597242", "0.595...
0.7626524
0
Check if text at given position is a here document
def isHereDoc(self, lineData, column): return self._getTextType(lineData, column) == 'h'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _has_page_jump(text):\n # Determines matches with format strings.\n for format_tuple in _FORMAT_STRINGS:\n jump = _get_jump_with_pattern(text, format_tuple)\n if jump:\n return jump\n\n # Recognizes common OCR for \"From page 1\".\n match = _match_pattern(text, r\"(^Frompag...
[ "0.6312338", "0.6036941", "0.60077053", "0.5858111", "0.57945687", "0.5726796", "0.5709392", "0.56847984", "0.5684184", "0.5651844", "0.56465435", "0.55971897", "0.55845344", "0.5449864", "0.5441029", "0.5401152", "0.53863245", "0.5381123", "0.5379395", "0.53566754", "0.53378...
0.707042
0
Get syntax by its xml file name
def _getSyntaxByXmlFileName(self, xmlFileName, formatConverterFunction): import qutepart.syntax.loader # delayed import for avoid cross-imports problem with self._loadedSyntaxesLock: if not xmlFileName in self._loadedSyntaxes: xmlFilePath = os.path.join(os.path.dirn...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _getSyntaxBySourceFileName(self, name, formatConverterFunction):\n for regExp, xmlFileName in self._extensionToXmlFileName.items():\n if regExp.match(name):\n return self._getSyntaxByXmlFileName(xmlFileName, formatConverterFunction)\n else:\n raise KeyError(\"...
[ "0.73123056", "0.7202096", "0.67029333", "0.6100018", "0.5830935", "0.5712048", "0.5494571", "0.54078346", "0.53664255", "0.52780116", "0.5271664", "0.52548873", "0.52026504", "0.51961845", "0.5129509", "0.51132685", "0.5104656", "0.5078642", "0.5061981", "0.50239456", "0.501...
0.7554375
0
Get syntax by its name. Name is defined in the xml file
def _getSyntaxByLanguageName(self, syntaxName, formatConverterFunction): xmlFileName = self._syntaxNameToXmlFileName[syntaxName] return self._getSyntaxByXmlFileName(xmlFileName, formatConverterFunction)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _getSyntaxBySourceFileName(self, name, formatConverterFunction):\n for regExp, xmlFileName in self._extensionToXmlFileName.items():\n if regExp.match(name):\n return self._getSyntaxByXmlFileName(xmlFileName, formatConverterFunction)\n else:\n raise KeyError(\"...
[ "0.7034269", "0.6904593", "0.680472", "0.5899903", "0.5554824", "0.5539092", "0.54612535", "0.53637296", "0.5326089", "0.5322306", "0.53003645", "0.52864903", "0.5273851", "0.52667606", "0.523834", "0.52281964", "0.522044", "0.51524365", "0.5142065", "0.5142065", "0.5132712",...
0.75593144
0
Get syntax by source name of file, which is going to be highlighted
def _getSyntaxBySourceFileName(self, name, formatConverterFunction): for regExp, xmlFileName in self._extensionToXmlFileName.items(): if regExp.match(name): return self._getSyntaxByXmlFileName(xmlFileName, formatConverterFunction) else: raise KeyError("No syntax f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def highlight_source(source):\n return highlight(source, PythonLexer(), HtmlFormatter())", "def get_highlighter(name):\n\n # Is it already in the path?\n try:\n return import_module('.' + name, 'pycclone.highlighters')\n except ImportError:\n pass\n\n # Import from user folder\n f...
[ "0.69240004", "0.66271734", "0.6512138", "0.6433099", "0.63243836", "0.6319666", "0.6306805", "0.6298004", "0.6259873", "0.62318337", "0.62157995", "0.615547", "0.61453384", "0.596871", "0.5953962", "0.5923246", "0.5921629", "0.5886486", "0.58687", "0.5838372", "0.57989764", ...
0.7074609
0
Get syntax by first line of the file
def _getSyntaxByFirstLine(self, firstLine, formatConverterFunction): for pattern, xmlFileName in self._firstLineToXmlFileName.items(): if fnmatch.fnmatch(firstLine, pattern): return self._getSyntaxByXmlFileName(xmlFileName, formatConverterFunction) else: raise Key...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_first_line(file: str) -> str:\n with open(file) as f:\n return f.readline().split('\\n')[0]", "def first_line(self):\n with open(self.file_path) as file:\n return file.readline()", "def parseStart(fp):\n\n try:\n ln = fp.readline()\n p = re.compile(r'^Inicia...
[ "0.6747421", "0.6670001", "0.64411604", "0.63172", "0.63021094", "0.62843513", "0.6278874", "0.61992455", "0.61644703", "0.6089005", "0.6036392", "0.60151047", "0.59718347", "0.5875066", "0.5856728", "0.58460116", "0.58287245", "0.5772079", "0.57663625", "0.57556015", "0.5725...
0.7575394
0
Get the sequence from 4D image images
def get_subject_sequence(img_itk, img_size, img_spacing, img_origin, mask_direction): n_sequence = img_size[-1] img_array = itk.GetArrayFromImage(img_itk) itk_sequences = [] for item in range(n_sequence): img_sequence = img_array[item] itk_img_sequence = itk.GetImageFromArray(img_se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def split_sequence(image_name, output_name):\n nim = nib.load(image_name)\n T = nim.header['dim'][4]\n affine = nim.affine\n image = nim.get_data()\n\n for t in range(T):\n image_fr = image[:, :, :, t]\n nim2 = nib.Nifti1Image(image_fr, affine)\n nib.save(nim2, '{0}{1:02d}.nii.g...
[ "0.6118404", "0.6090282", "0.6046997", "0.60036993", "0.5947869", "0.5940997", "0.5880866", "0.5857647", "0.57846844", "0.573141", "0.5714751", "0.56980777", "0.56915104", "0.568075", "0.56790113", "0.5626276", "0.55826557", "0.55743223", "0.5574049", "0.55700374", "0.5569572...
0.65374935
0
Add a canned comment
def cli(ctx, comment, metadata=""): return ctx.gi.cannedcomments.add_comment(comment, metadata=metadata)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_comment(self, text, displayed, username, time,\n proposal, node_id, parent_id, moderator):\n raise NotImplementedError()", "def add_comment() -> str:\n if \"markdown\" in request.form:\n if \"file\" in request.form:\n comment = Comment(\n mark...
[ "0.75225097", "0.74341697", "0.7288321", "0.712091", "0.71194667", "0.7118158", "0.71123606", "0.70643234", "0.7063868", "0.70613974", "0.70483786", "0.7039511", "0.7003543", "0.6991932", "0.69380873", "0.6924826", "0.6907805", "0.69008166", "0.68908685", "0.6865075", "0.6847...
0.8707222
0
The main method of the class, reads the csv and returns a pandas DataFrame object.
def run(self) -> pd.DataFrame: with open(self.file_path, 'r') as in_file: headers = in_file.readline() headers = headers.replace("\n", "") if ',' in headers: headers = headers.split(',') else: headers = headers.split() if ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reader(self):\n df = pd.read_csv(self.path)\n return df", "def create_dataframe():\r\n\r\n df = pd.read_csv('data/data.csv', header=0)\r\n return df", "def read_csv(self) -> None:\n\n self._df = pd.read_csv(self._dataset_file)", "def data_from_csv(self, filepath):\n self...
[ "0.7475168", "0.7415073", "0.739241", "0.728174", "0.71605515", "0.7031539", "0.6998462", "0.69451076", "0.69303966", "0.69303966", "0.69205564", "0.6900309", "0.6879413", "0.68781173", "0.6876149", "0.6874884", "0.68676704", "0.6860954", "0.6829186", "0.6784555", "0.67783505...
0.743472
1
Merge any/all output files from subsidiary bcrham processes (used when not doing smc)
def merge_all_hmm_outputs(self, n_procs, cache_naive_seqs): assert self.args.smc_particles == 1 # have to do things more complicatedly for smc if self.args.action == 'partition': # merge partitions from several files if n_procs > 1: self.merge_subprocess_files(self.hmm_cach...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def combineAllGraphFiles(chroms, final_out):\n outfile = open(final_out,'w');\n outfile.close();\n \n for chrom in chroms:\n graph_file = chrom + \".graph\";\n try:\n if os.system('%s %s >> %s' %\n (cat, graph_file, final_out)): raise\n except: sy...
[ "0.62794083", "0.6261093", "0.61784226", "0.61733913", "0.6107145", "0.6077044", "0.60737073", "0.5992166", "0.59356683", "0.58938164", "0.5881873", "0.58431023", "0.5833292", "0.5832355", "0.58270615", "0.58217084", "0.5784522", "0.5717899", "0.5691984", "0.56713927", "0.565...
0.6633998
0
Merge the output from pairs of processes (used when doing smc)
def merge_pairs_of_procs(self, n_procs): assert self.args.action == 'partition' assert self.args.smc_particles > 1 if n_procs > 1: groups_to_merge = [[i, i+1] for i in range(0, n_procs-1, 2)] # e.g. for n_procs = 5, we merge the groups [0, 1], [2, 3, 4] else: gro...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def merge_par_results(res):\n nres = {}\n for r in res:\n nres.update(r)\n return nres", "def merge_all_hmm_outputs(self, n_procs, cache_naive_seqs):\n assert self.args.smc_particles == 1 # have to do things more complicatedly for smc\n if self.args.action == 'partition': # merge ...
[ "0.59400517", "0.5814725", "0.5643951", "0.56101346", "0.5563475", "0.5513338", "0.549535", "0.5480405", "0.5461074", "0.53945047", "0.53856015", "0.53534395", "0.53074926", "0.52948034", "0.5292469", "0.5279101", "0.5227452", "0.5217861", "0.52140594", "0.520097", "0.5175036...
0.6553556
0
Get all unique the pairs of sequences in input_info, skipping where preclustered out
def get_pairs(self, preclusters=None): all_pairs = itertools.combinations(self.input_info.keys(), 2) if preclusters == None: print ' ?? lines (no preclustering)' # % len(list(all_pairs)) NOTE I'm all paranoid the list conversion will be slow (although it doesn't seem to be a.t.m.) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __find_similar_pairs(self):\n size = len(self.__indexclusters)\n candidates = []\n for i in range(size):\n for j in range(i+1, size):\n simi = self.__cluster_simi(i, j)\n #print simi, self.__indexclusters[i],self.__indexclusters[j]\n ...
[ "0.60435754", "0.5448895", "0.5411966", "0.533383", "0.5203005", "0.5178553", "0.513516", "0.5110696", "0.50869215", "0.5070539", "0.5038386", "0.5036675", "0.49660292", "0.49623376", "0.4951787", "0.49416682", "0.49400976", "0.49369627", "0.4934104", "0.493045", "0.48957512"...
0.6535067
0
Write hmm model files to /hmms, using information from
def write_hmms(self, parameter_dir): print ' writing hmms with info from %s' % parameter_dir # start = time.time() from hmmwriter import HmmWriter hmm_dir = parameter_dir + '/hmms' utils.prep_dir(hmm_dir, '*.yaml') # gene_list = self.args.only_genes # if gene_li...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def WriteCcmModelToFile(filename, model):\n #Write the .hpp file\n WriteHeaderFileForCcmModel(filename, model)\n\n #Write the .cpp fil\n WriteSourceFileForCcmModel(filename, model)", "def WriteHeaderFileForCcmModel(filename, model): \n\n ccm_model_name = GetModelName(filename, model) # Get the name ...
[ "0.6306435", "0.62701946", "0.6194146", "0.6162228", "0.60442907", "0.59868413", "0.5865779", "0.5834945", "0.5833884", "0.5833685", "0.5771575", "0.5769922", "0.57470757", "0.572483", "0.5723051", "0.57100296", "0.5691098", "0.5648298", "0.56091905", "0.5607857", "0.5585511"...
0.6623211
0
Check if hmm model file exists, and if not remove gene from
def check_hmm_existence(self, gene_list, skipped_gene_matches, parameter_dir): # first get the list of genes for which we don't have hmm files if len(glob.glob(parameter_dir + '/hmms/*.yaml')) == 0: raise Exception('no yamels in %s' % parameter_dir) genes_to_remove = [] for ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear_model_checkpoints(self):\n if self.file_prefix is None:\n return\n\n with os.scandir() as path_list:\n for entry in path_list:\n if entry.is_file() and entry.name.startswith(self.file_prefix) and entry.name.endswith(\".h5\"):\n print(\...
[ "0.62253946", "0.61339456", "0.61209595", "0.6105428", "0.59902775", "0.5978239", "0.5936864", "0.5926887", "0.5825889", "0.5775082", "0.5756565", "0.5729566", "0.5712733", "0.56921035", "0.56839734", "0.5574046", "0.5529738", "0.55226207", "0.5518598", "0.55043536", "0.54922...
0.62624025
0
Check that we have at least one gene for each region
def all_regions_present(self, gene_list, skipped_gene_matches, query_name, second_query_name=None): for region in utils.regions: if 'IGH' + region.upper() not in ':'.join(gene_list): print ' no %s genes in %s for %s %s' % (region, ':'.join(gene_list), query_name, '' if (second_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gene_exists(ensemble, methylation_type, gene):\n\n\tgene_table_name = 'gene_' + gene.replace(\".\", \"_\")\n\treturn len(db.get_engine(current_app, 'methylation_data').execute(\"SELECT * FROM information_schema.tables WHERE table_name = '%s'\"%gene_table_name).fetchall()) > 0", "def check_has_regions(seq):\n...
[ "0.6536178", "0.6260842", "0.6060093", "0.60499275", "0.5892845", "0.5784357", "0.5690322", "0.56686544", "0.5655738", "0.56486446", "0.564675", "0.5644961", "0.5612827", "0.5574081", "0.55659956", "0.55635387", "0.5556078", "0.55531275", "0.5541258", "0.5540612", "0.55338156...
0.63438827
1
Pad all sequences in to the same length to the left and right of their conserved cysteine positions. Next, pads all sequences further out (if necessary) such as to eliminate all v_5p and j_3p deletions.
def pad_seqs_to_same_length(self, debug=False): maxima = self.get_padding_parameters(debug) for query in self.sw_info['queries']: swfo = self.sw_info[query] if 'padded' in swfo: # already added padded information (we're probably partitioning, and this is not the first step) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pad_sequences(sequences):\n max_len = max(s.shape[0] for s in sequences)\n padded = []\n for seq in sequences:\n zero_pad = np.concatenate(\n [seq, np.zeros((max_len - seq.shape[0], ) + seq.shape[1:])])\n padded.append(zero_pad[np.newaxis, :])\n\n return np.concatenate(padd...
[ "0.70233285", "0.63832694", "0.63405013", "0.630228", "0.62689775", "0.6214276", "0.6211584", "0.6066575", "0.6046993", "0.6031975", "0.6023637", "0.5948999", "0.59289056", "0.59222424", "0.5858899", "0.5857871", "0.584324", "0.5786291", "0.5765228", "0.5753933", "0.5746988",...
0.72471905
0
If any of the queries in was unproductive, return an empty list (which will be skipped entirely), otherwise return the original name list
def remove_sw_failures(self, query_names): unproductive, unknown = False, False for qrn in query_names: if qrn in self.sw_info['skipped_unproductive_queries']: unproductive = True if qrn in self.sw_info['skipped_unknown_queries']: unknown = True ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deduplicate_raw_text_queries(log_queries_iter) -> List[str]:\n return list(set(q for q in log_queries_iter))", "def clean_query_list(queries: List[str]) -> List[str]:\n return [remove_leading_whitespace_and_empty_lines(query) for query in queries]", "def drug_names():\n results = set()\n if...
[ "0.6213024", "0.5977889", "0.59332335", "0.578334", "0.5704371", "0.5704283", "0.5696776", "0.55361503", "0.55334", "0.5487988", "0.5462377", "0.545718", "0.5447865", "0.54456997", "0.5400081", "0.53956217", "0.53954196", "0.5392832", "0.5387499", "0.53780365", "0.53728545", ...
0.6498767
0
Read bcrham annotation output
def read_annotation_output(self, algorithm, count_parameters=False, parameter_out_dir=None): print ' read output' if count_parameters: assert parameter_out_dir is not None pcounter = ParameterCounter(self.germline_seqs) if count_parameters else None true_pcounter = Parame...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_binned(run, bin_scheme):\n\n fname=get_binned_file(run,bin_scheme)\n print(\"reading:\",fname)\n return fitsio.read(fname)", "def read_annotation_yolov5(bbox_path):\n\n # image_paths = get_lists_in_dir(rawImage_dir)\n\n dw = 1./(camera_resolution[0]) # 1 / image width\n dh = 1./(came...
[ "0.5672629", "0.5474085", "0.54246736", "0.5418223", "0.539274", "0.5346803", "0.53454983", "0.52752584", "0.5274368", "0.5263105", "0.51855737", "0.51788867", "0.51730055", "0.5136605", "0.5127657", "0.5109556", "0.5103017", "0.5099789", "0.5080782", "0.5076813", "0.5054723"...
0.5637101
1
method for adding random distortion to dataset images, including random brightness adjust, and a random vertical shift of the horizon position
def data_augmentation(self, img): new_img = img.astype(float) # random brightness - the mask bit keeps values from going beyond (0,255) value = np.random.randint(-28, 28) if value > 0: mask = (new_img[:, :, 0] + value) > 255 if value <= 0: mask = (new_img[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def random_color_distort(src, brightness_delta=32, contrast_low=0.5, contrast_high=1.5,\n saturation_low=0.5, saturation_high=1.5, hue_delta=18):\n\n def brightness(src, delta, p=0.5):\n \"\"\"Brightness distortion.\"\"\"\n if np.random.uniform(0, 1) > p:\n delta = np.random.uni...
[ "0.68516517", "0.630621", "0.6267898", "0.6167012", "0.61349374", "0.6047315", "0.6030819", "0.60097414", "0.59941983", "0.59620386", "0.5956868", "0.5932575", "0.5926298", "0.59043723", "0.5862057", "0.5848643", "0.5839401", "0.5836999", "0.5795006", "0.5790555", "0.5788634"...
0.6651788
1
Print the coordinates of the vertices of Koch Curve. d is the depth of recursion. p1, p2 are coordinates of end point of the initial state.
def koch(d, p1, p2): if d == 0: return sx = (2 * p1[0] + p2[0]) / 3 sy = (2 * p1[1] + p2[1]) / 3 tx = (p1[0] + 2 * p2[0]) / 3 ty = (p1[1] + 2 * p2[1]) / 3 dx = tx - sx dy = ty - sy ux = dx * c60 - dy * s60 + sx uy = dx * s60 + dy * c60 + sy koch(d - 1, p1, (sx, sy)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_path(self, d, parent, s, t):\n idxs = [t]\n while idxs[-1]!=s:\n idxs.append(parent[idxs[-1]])\n idxs.reverse()\n print('[{:g}]'.format(d[t])+' '+'-->'.join([str(self.vertices[i]) for i in idxs]))", "def draw(self):\n # s1 = ShowPoint(self.cnv, self.p1.xpt,...
[ "0.575522", "0.54456514", "0.5345275", "0.5257093", "0.5226664", "0.5217727", "0.5186063", "0.5185967", "0.51700306", "0.5160067", "0.50513047", "0.50492215", "0.5020757", "0.5018144", "0.5006685", "0.49828735", "0.4976104", "0.49749985", "0.4970847", "0.49628836", "0.4962196...
0.6926076
0
Returns the url to access a particular tour instance.
def get_absolute_url(self): return reverse('tour-detail', args=[str(self.id)])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def instance_url(self) -> str:\n easypost_id = self.get(\"id\")\n if not easypost_id:\n raise Error(\"%s instance has invalid ID: %r\" % (type(self).__name__, easypost_id))\n return \"%s/%s\" % (self.class_url(), easypost_id)", "def instance_url(self) -> pulumi.Input[str]:\n ...
[ "0.6904997", "0.665611", "0.665611", "0.665611", "0.665611", "0.665611", "0.665611", "0.665611", "0.665611", "0.66277385", "0.652006", "0.6373929", "0.6353588", "0.6353588", "0.6309502", "0.62769485", "0.6269816", "0.6269816", "0.62662625", "0.6248603", "0.6248603", "0.6231...
0.6999632
0
Returns the url to access a particular review instance.
def get_absolute_url(self): return reverse('tour-review', args=[str(self.id)])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_content_object_url(self):\n return urlresolvers.reverse(\n \"reviews-url-redirect\",\n args=(self.content_type_id, self.object_pk)\n )", "def instance_url(self) -> str:\n easypost_id = self.get(\"id\")\n if not easypost_id:\n raise Error(\"%s i...
[ "0.6614286", "0.63549036", "0.6237856", "0.6237856", "0.6237856", "0.6237856", "0.6237856", "0.6237856", "0.6237856", "0.6237856", "0.6212627", "0.6147254", "0.60942954", "0.5924494", "0.5896306", "0.5863019", "0.575913", "0.574045", "0.574045", "0.5736692", "0.5736692", "0...
0.6492123
1
Generating start vector with random numbers in range [1; 1] with length columns_num. Using division by norm of this vector to scale values.
def generate_start_w0(columns_num): start_w0 = [uniform(-1, 1.) for _ in range(columns_num)] norm_start_w0 = start_w0 / np.linalg.norm(start_w0) return norm_start_w0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initial_vector(self):\n\n return asarray([np.random.uniform(l, u) for l, u in self.bounds])", "def _generate_random_vector(size):\n return np.random.uniform(-0.1, 0.1, size)", "def gen_vector(size):\n solution = []\n for i in range(size):\n rand_num = uniform(-size, size)...
[ "0.6294636", "0.60306394", "0.5967467", "0.5958537", "0.5909196", "0.58106685", "0.5785931", "0.56947416", "0.56108725", "0.55979025", "0.55717945", "0.5541559", "0.5512951", "0.5509296", "0.5499508", "0.5478247", "0.5463694", "0.54308057", "0.5373491", "0.535581", "0.5354147...
0.7427251
0
Calculates component Y value in the current iteration. Multiplies dataframe_row with transposed vector_w to get scalar value y.
def calculate_y(dataframe_row, vector_w): y_val = np.dot(dataframe_row, np.transpose(vector_w)) return y_val
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def subtract_component(dataframe, component_y, vector_w):\n if dataframe.empty:\n raise TypeError('It is impossible to calculate eigen vector W '\n 'and component Y on the empty dataframe.')\n component_df = np.outer(component_y, vector_w)\n result_df = dataframe - component_...
[ "0.6645866", "0.6599684", "0.65895844", "0.6283939", "0.61474097", "0.59581596", "0.59146947", "0.58367455", "0.5569749", "0.5507695", "0.5389976", "0.5309533", "0.5297916", "0.524368", "0.5234031", "0.5189916", "0.51827174", "0.5161803", "0.51593584", "0.51460093", "0.512977...
0.88765943
0
Subtracts main component dataframe from the original one.
def subtract_component(dataframe, component_y, vector_w): if dataframe.empty: raise TypeError('It is impossible to calculate eigen vector W ' 'and component Y on the empty dataframe.') component_df = np.outer(component_y, vector_w) result_df = dataframe - component_df ret...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def subtract(self, other):\n return self.as_dataframe(subtract(self.data, other.data))", "def inverse_transform(self, df):\n return df", "def subtract(self):\n self.parent.copyCurrentWinState(self.pltw)\n self.pltw.blklst[self.blkno][self.ypos] = self.data[1] - self.data[2]\n ...
[ "0.7236939", "0.62537533", "0.5925698", "0.5848495", "0.5840385", "0.58321095", "0.5831804", "0.58191985", "0.58087337", "0.57987154", "0.5797149", "0.5768833", "0.57661474", "0.57661474", "0.57661474", "0.57560253", "0.5725365", "0.5725322", "0.57107365", "0.57061017", "0.56...
0.6353868
1
Function to check whether the latest IERS tables are present. Else downloads it.
def checkIERS(warn_update=14*u.day): try: currentTime = Time.now() table = iers.IERS_Auto.open() index_of_last_observation = ''.join(table['PolPMFlag_A']).index('IP') time_of_last_observation = Time(table['MJD'][index_of_last_observation],format='mjd') time_sinc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _is_downloaded(self):\n return self._system.file_exists(self._tar_name)", "def check_downloaded(self):\n for o in self.order_lst:\n for item in o.get_items():\n mdata = item.get_metadata()\n if 'downloaded' in mdata.keys():\n if str(md...
[ "0.6312253", "0.6298091", "0.5929028", "0.5889317", "0.5832926", "0.56521076", "0.5616137", "0.55603564", "0.5538858", "0.5523581", "0.5517897", "0.5510933", "0.55036175", "0.5465765", "0.5457709", "0.5451811", "0.5449185", "0.54367334", "0.54341847", "0.542871", "0.5426154",...
0.70178634
0
Commands for making your life in AWS easier
def aws(ctx): # pylint: disable=unused-argument pass # pylint: disable=unnecessary-pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def aws():\n pass", "def cli(ctx, region, profile):\n session = boto3.session.Session(profile_name=profile, region_name=region)\n ecs = session.client('ecs')\n ecr = session.client('ecr')\n ctx.obj = {\n 'region': region,\n 'profile': profile,\n 'ecs': ecs,\n 'ecr':...
[ "0.78308004", "0.6709078", "0.6430246", "0.64011174", "0.63430303", "0.63402027", "0.6281673", "0.6235944", "0.6224367", "0.6212776", "0.62037164", "0.6196544", "0.6187916", "0.61663157", "0.6166255", "0.61566585", "0.61485034", "0.61453444", "0.6092449", "0.608155", "0.60815...
0.7529648
1
Given a bucket location for load balancer logs, read and parse the latest logs. Currently only supports application loadbalancers
def lb_logs(ctx, lb, last, search): search_items = check_search_argument(search) from opstools.aws import lb_logs as this_ec2_list this_ec2_list.main(lb, last, search_items)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_bucket_logging(Bucket=None):\n pass", "def load(lb_id, backend='memory'):\n return b_api.fetch(backend).logbook_get(lb_id)", "def collect_k8s_logs(cfg: ElasticBlastConfig):\n dry_run = cfg.cluster.dry_run\n k8s_ctx = cfg.appstate.k8s_ctx\n if not k8s_ctx:\n raise RuntimeError(f'ku...
[ "0.6314314", "0.5689416", "0.5672334", "0.5559864", "0.55531245", "0.54379284", "0.54379284", "0.5270909", "0.5237804", "0.52304417", "0.521594", "0.5178806", "0.51596767", "0.51460856", "0.5141342", "0.51357716", "0.51021546", "0.5082686", "0.5015959", "0.49990225", "0.49807...
0.62359434
1
Print a report of what is using a security group
def sg_report(ctx, security_group_id, all_sgs): from opstools.aws import sg_report as this_sg_report this_sg_report.main(security_group_id, all_sgs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_secgroups(self, name=None):", "def show_security_group(self, security_group, **_params):\r\n return self.get(self.security_group_path % (security_group),\r\n params=_params)", "def show_signatories_for_group(oid):\n signatories = signatories_for_group(oid)\n group =...
[ "0.643156", "0.64158314", "0.6374457", "0.6211249", "0.614532", "0.6136983", "0.61095774", "0.5930601", "0.5903047", "0.5879476", "0.58454436", "0.58454436", "0.57944185", "0.57904917", "0.5784019", "0.5784019", "0.57687044", "0.5731467", "0.57308704", "0.5686011", "0.5684917...
0.66926736
0
Checks [search] against a regex for the correct format
def check_search_argument(search): if search != '' and not re.match(r"^(([\w.:\/\-)+\=([\w.:\/\-])+\s?)+", search): print("The search items must match the format 'field=string'") sys.exit(0) search_items = search.split(' ') return search_items
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_search_regex(self):\n # search via regex emails.\n test = self.data.search(regex='[-\\w\\d.+]+@[-\\w\\d.]+', all_names=True) # noqa\n # taking out the self.assertIn until I figure out the order of the\n # tests. See test_zeditor() for more information.\n\n # self.assertI...
[ "0.69959843", "0.620321", "0.6156715", "0.60446566", "0.6004517", "0.59803575", "0.5927296", "0.5909053", "0.59069043", "0.5873332", "0.58515716", "0.5811227", "0.57970244", "0.57713956", "0.57709163", "0.5760355", "0.5760355", "0.5744164", "0.57201004", "0.57087517", "0.5705...
0.6678549
1
Creates a new thrift client. host host of server. port port of server. service the class the server implements framed should this client be framed? (for nonblocking clients) timeout timeout in ms
def __init__(self, host, port, service, framed=True, timeout=50000): self.host = host self.port = port self.service = service self.framed = framed self.timeout = timeout self.create()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_transport(self, host):\r\n from thrift.transport import TSocket, TTransport\r\n\r\n thrift_socket = TSocket.TSocket(host.name, host.port)\r\n\r\n if self._timeout is not None:\r\n thrift_socket.setTimeout(self._timeout)\r\n\r\n return TTransport.TFramedTransport(t...
[ "0.6973163", "0.5815138", "0.57890433", "0.5741834", "0.55016434", "0.54852235", "0.5437825", "0.5426382", "0.5389692", "0.53569806", "0.5336856", "0.53230494", "0.5321206", "0.5312297", "0.5288609", "0.5285945", "0.52812237", "0.52649456", "0.5262709", "0.52576977", "0.52479...
0.6733042
1
Constructor for a NN used a sthe comparer submodule
def __init__(self, input_size, hidden_sizes, num_labels=10, output_size=1, batchnorm_comparer_bool=False, dropout_comparer_bool=False): super(NeuralNetComparer, self).__init__() sizes = [2 * num_labels] + hidden_sizes + [output_size] self.layers...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, network: Network):\n self.graph = network.graph", "def __init__(self, inputnodes, hiddennodes, outputnodes, learningrate):\n # set number of nodes in each input, hidden, output layer\n self.inodes = inputnodes\n self.hnodes = hiddennodes\n self.onodes = outpu...
[ "0.6710942", "0.67074245", "0.6682953", "0.6604958", "0.64907384", "0.6483975", "0.6477833", "0.64563036", "0.6446919", "0.6438356", "0.64310414", "0.6428357", "0.6427498", "0.63945305", "0.6375418", "0.63718176", "0.6370687", "0.63609296", "0.6339547", "0.63324785", "0.63302...
0.6730846
0
Constructor for a CNN with two sub Module 1. Classifier 2.Comparer
def __init__(self, input_size, hidden_sizes_comparer, batchnorm_comparer_bool=False, dropout_comparer_bool=False): super(CNNCalssifierComparer, self).__init__() self.input_size = input_size self.classifier = CNNClassifier() self.comparer...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n super(SCNN, self).__init__()\n\n # Linear classifier.\n self.inplanes = 128\n self._norm_layer = nn.BatchNorm2d\n self.dilation = 1\n self.groups = 1\n self.base_width = 64\n\n self.num_class = 125\n backbone = torchvision.models....
[ "0.703168", "0.6759595", "0.6644531", "0.66385365", "0.6632358", "0.6617524", "0.65919757", "0.6583789", "0.6558685", "0.65006775", "0.649134", "0.6481717", "0.6467541", "0.6467387", "0.6456215", "0.6450546", "0.64445513", "0.64377886", "0.6429936", "0.6427293", "0.6427293", ...
0.70681906
0
add a dummy client contact
def add_dummy_contact(index, client, user, client_manager = None): if client_manager == None: client_manager = ClientManager(user.user) return client_manager.add_client_contact( client = client, name = 'name_%i' % index, email = 'email%i@email.com' % index )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_contact():\n return 'add contact'", "def create_empty_contact():\n if request.method == 'GET':\n tel = request.args.get('tel')\n try:\n io_client.create_contact(\n urns=[\"tel:+52\" + tel],\n groups=[\"cc9543a2-33ca-43cd-a3b7-4839b694605a\"])\n...
[ "0.66256905", "0.6618168", "0.65759665", "0.6517715", "0.62706566", "0.6233464", "0.6205126", "0.6143171", "0.6122024", "0.6082095", "0.602202", "0.60178286", "0.59804857", "0.5960017", "0.59527576", "0.5950094", "0.5937796", "0.59137475", "0.58988756", "0.58725286", "0.58619...
0.8227372
0
Retrieve an event with a provided event ID.
def retrieve(cls, event_id): return Event(Requester.get(cls.endpoint + '/' + event_id))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_event(self, eventid):\n return self.s.query(Event).get(eventid)", "def get_event_by_id(event_id):\n db = get_db()\n return db.execute((\n 'SELECT id, name, start_time, end_time, location '\n 'FROM event WHERE id=?'),\n (event_id,)).fetchone()", "def get_event(event_id)...
[ "0.8653071", "0.8415355", "0.8306787", "0.8270487", "0.7743675", "0.74382395", "0.7345693", "0.72627985", "0.72339475", "0.7229438", "0.7221798", "0.71465296", "0.7099162", "0.68521637", "0.6657219", "0.66425383", "0.663405", "0.6582111", "0.64599323", "0.6412161", "0.6382435...
0.85686564
1
Multiply a sparse Tensor by a vector along a particular dimension.
def sparse_dim_multiply( A: Tensor, x: Tensor, dim: int ) -> Tensor: idx = A._indices()[dim] vals = A._values() vals *= x[idx] return A
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def matvec(self, x):\n return self * x", "def dot(x, y, sparse=False):\n if sparse:\n res = tf.sparse_tensor_dense_matmul(x, y)\n else:\n res = tf.matmul(x, y)\n return res", "def dot(x,y,sparse=False):\n if sparse:\n res = tf.sparse_tensor_dense_matmul(x, y)\n else:\...
[ "0.60994023", "0.60374564", "0.6016153", "0.60002637", "0.5900316", "0.59003067", "0.59003067", "0.58817714", "0.5870412", "0.5835138", "0.5826516", "0.5803307", "0.57906675", "0.5764829", "0.5762314", "0.57615113", "0.5732349", "0.57092464", "0.57058054", "0.56932294", "0.56...
0.7774255
0
Add identity matrix to a sparse Tensor.
def sparse_add_identity( A: Tensor ) -> Tensor: idx1, idx2 = A._indices() vals = A._values() vals[idx1 == idx2] += 1 return A
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _identity_sparse(d, stype=\"csr\", dtype=complex):\n return sp.eye(d, dtype=dtype, format=stype)", "def simple_sparse_add():\n examples = [\n benchmark.Example(\n inputs=[\n tf.SparseTensor(indices=[[0, 0], [0, 1]],\n values=[12, 34],\n ...
[ "0.6873758", "0.6549222", "0.63008565", "0.62816167", "0.62674975", "0.6254118", "0.6229", "0.6197494", "0.618009", "0.6088036", "0.60854536", "0.60821396", "0.60820395", "0.60820395", "0.60820395", "0.60820395", "0.60820395", "0.60820395", "0.60820395", "0.60820395", "0.6082...
0.760876
0
place l'image du boutton
def boutton(self,img1,x,y): self.button.append(self.creat_image(img1,x,y))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def display_image(self, img, img_pos):\n image = tk.Label(self.top, image=img)\n image.grid(row=img_pos[0], column=img_pos[1],\n columnspan=img_pos[2], rowspan=img_pos[3])", "def placeImage(self, img, x=0, y=0):\n if img.getSize() == self.getSize() and img.getWidth() == self.__wid...
[ "0.66279835", "0.642285", "0.63489205", "0.63303906", "0.6293574", "0.6274839", "0.62658745", "0.62628156", "0.6240533", "0.6208319", "0.6188061", "0.61310315", "0.61250305", "0.61130965", "0.6110246", "0.6009262", "0.59982324", "0.59761536", "0.596173", "0.595518", "0.595293...
0.7225571
0
aligne les hitbox sur la grille du joueur
def aligne_grille(self,x,y,t): [xmin,ymin,xmax,ymax] = self.can.coords(self.hitbox[t]) tx,ty=xmax-xmin,ymax-ymin a,b=23,23 if tx==92 or ty==92 or tx==184 or ty==184: if tx==92 or tx==184:a,b=0,23 if ty==92 or ty==184:a,b=23,0 if 142<y<602 and 66<x<5...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_bounding_box(objects,color):\n\n for i in range(len(objects)):\n x, y, w, h, d = objects[i].get_attributes()\n print(x, y, w, h, d)\n corr = get_correction(d, a, hfov, x)\n cv2.rectangle(color, (x-corr, y), (x+w-corr, y+h), (0, 255, 0), 4)\n\n try:\n real_x...
[ "0.6347145", "0.5834143", "0.5796904", "0.5795583", "0.56838274", "0.56507903", "0.5610431", "0.558297", "0.5550353", "0.5532743", "0.5494045", "0.5491575", "0.54865843", "0.5478262", "0.5457589", "0.5449843", "0.5440341", "0.54399365", "0.543528", "0.5425247", "0.5423976", ...
0.6969691
0
get rank size and rank id
def _get_rank_info(): rank_size = int(os.environ.get("RANK_SIZE", 1)) if rank_size > 1: rank_size = get_group_size() rank_id = get_rank() else: rank_size = 1 rank_id = 0 return rank_size, rank_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_rank(self):\r\n return self.rank", "def get_rank(self) -> int:\r\n return self.rank", "def get_rank(self):\n return self.rank", "def rank():\n return 0", "def getRank(self):\r\n return self.rank", "def _get_local_rank_size(comm):\n this_node = platform.node()\n ...
[ "0.7020067", "0.6835348", "0.68337727", "0.681984", "0.6792252", "0.67085946", "0.668368", "0.6615326", "0.65932256", "0.65334713", "0.65328425", "0.65063375", "0.65063375", "0.65063375", "0.65063375", "0.65063375", "0.64363235", "0.6394922", "0.63880634", "0.63718396", "0.62...
0.79825246
0
Creates model adapter from config
def get_model_adapter(config): if config['task'] == 'joint': return JointModelAdapter() elif config['task'] == 'keypoints': return KeypointsModelAdapter() elif config['task'] == 'headsegmentation': return HeadSegmentationModelAdapter() elif config['task'] == 'detect': ret...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_config(cls, model_config: Union[dict, ModelConfig]) -> Type[AbstractModel]:\n\n if not (model_config and isinstance(model_config, (ModelConfig, dict))):\n msg = f\"Need a valid model config to create a text/tagger model in AutoModel. \" \\\n f\"Found model_config={model_...
[ "0.65065086", "0.6332431", "0.6174222", "0.602394", "0.5932728", "0.5869356", "0.58404166", "0.58404166", "0.5832524", "0.582974", "0.582962", "0.5828994", "0.57814497", "0.5775429", "0.57427996", "0.5738938", "0.5738938", "0.5731172", "0.5715343", "0.569226", "0.5625734", ...
0.74726766
0
saves the vectorizer to disk using json
def save_vectorizer(self, vectorizer_filepath): with open(vectorizer_filepath, "w") as fp: json.dump(self._vectorizer.to_serializable(), fp)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save(self, dirname=None):\n self.genio.save(dirname)\n logging.info(\n f'Saved word vectorizations for {dirname}')", "def pickle_vectorizer(self, path='models/TFIDFVectorizer.pkl'):\n with open(path, 'wb') as f:\n pickle.dump(self.vectorizer, f)\n print(\...
[ "0.6963584", "0.680034", "0.6709311", "0.6637569", "0.6591434", "0.65723944", "0.65660405", "0.6541175", "0.6505122", "0.6481239", "0.6412874", "0.6401869", "0.63947797", "0.63763016", "0.6329883", "0.6322585", "0.6317829", "0.62863415", "0.6257502", "0.6255731", "0.623655", ...
0.821503
0
This function inserts geocode to soybean collection
def insert_geo_to_mongo(collection): if not collection: log_utils.log_msg_error(logger=logger, key='INSERTGEOCODE0001', msg='Collection is None') return None cursor = collection.find() count = 1 for each in cursor: location = each['location_desc'] id = each['_id'] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def upsert_location(self, location):", "def insert_city(self, city_point):\n city = City(city_point)\n self.map.insert(city)", "def geocode(df, col):\r\n pass", "def insert(self, name, address, city, state, zipcode, hour, phone, rating, image):\r\n pass", "def sync_set_geocoding(pro...
[ "0.65075386", "0.5994585", "0.56468296", "0.5555482", "0.5555266", "0.5511169", "0.54705995", "0.5420754", "0.5408374", "0.5395964", "0.5340212", "0.53328806", "0.5276935", "0.52544767", "0.52543485", "0.52541894", "0.5232013", "0.5220423", "0.5204102", "0.5150884", "0.512531...
0.67928666
0
Creates a plot of the correlations of each of the basemodel's predictions on the training set. Specifically, crossvalidation is used and the predictions from each holdoutfold (for each model) are used to build a training set for the stacker. The plot shows the correlations for the predictions of each basemodel. The cor...
def plot_correlation_heatmap(self): if self._model_object is None: raise ModelNotFittedError() OOLearningHelpers.plot_correlations(correlations=self._train_meta_correlations, title='Correlations of Models (based on meta-training set)') plt...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pairplot_cross_val(df=None, features_corr_matrice=None, model=None, figsize=(10,10), save=False, prefix_name_fig=None, folder='Charts', **kwargs):\r\n\r\n corr_matrice = deepcopy(features_corr_matrice)\r\n features_number = len(corr_matrice.columns) \r\n\r\n fig, ax = plt.subplots(features_number, fea...
[ "0.6313132", "0.6275113", "0.61071104", "0.6047933", "0.5924972", "0.5916628", "0.58634686", "0.58615613", "0.58423764", "0.58360696", "0.58246493", "0.5787134", "0.57615566", "0.5745429", "0.5735826", "0.5730945", "0.57147706", "0.5708738", "0.57017416", "0.5699573", "0.5678...
0.68460006
0
Return actual line string length
def len(self): return len(self.line)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def line_length(self, dLine = 0):\n return self.buffer.line_length(self.line + dLine)", "def _getOldCodeLength(self):\n nb_lines = 0\n for line in self.body.splitlines():\n if not line.startswith(\"+\"):\n nb_lines += 1\n return nb_lines", "def __len__(self):\n nlines = self.get_...
[ "0.83488667", "0.7556461", "0.75529397", "0.7546989", "0.7420517", "0.7266771", "0.72320795", "0.7193497", "0.71531826", "0.7086452", "0.7078299", "0.7078299", "0.7030356", "0.7019079", "0.70126826", "0.70002663", "0.6998436", "0.6954156", "0.6948814", "0.6942688", "0.6910902...
0.7881204
1
Return first num characters. Just read, no actual modification on the line string.
def readFirst(self, num): return self.line[:num]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def first_line(self):\n with open(self.file_path) as file:\n return file.readline()", "def get_first_line(file: str) -> str:\n with open(file) as f:\n return f.readline().split('\\n')[0]", "def read(self, n=1):\n return self.string[self.pos:self.pos + n]", "def read_nchars(...
[ "0.655525", "0.6426731", "0.6293631", "0.6194903", "0.6155995", "0.61236703", "0.61074185", "0.6102843", "0.6096315", "0.60518306", "0.60010046", "0.599532", "0.5951977", "0.5920654", "0.5913139", "0.58947694", "0.5872971", "0.58560044", "0.5845062", "0.5841828", "0.5816927",...
0.78747165
0
Remove given string checking for existence Raises CutException if given string was not found
def remove(self, string): val = self.line[:len(string)] if val != string: raise CutException("No match for given string") self.line = self.line[len(string):]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove(self, string=str) -> None:\n try:\n if self.exists(string):\n del self.table[string]\n except Exception as error:\n print(f\"Error: self.remove({string}) -> {error}\")", "def remove(name):", "def str_remove(string: str, index: in...
[ "0.6289555", "0.5905014", "0.58504665", "0.56325716", "0.5621997", "0.5611954", "0.5557018", "0.55479324", "0.55479324", "0.5523663", "0.55215895", "0.5517186", "0.5495908", "0.5477499", "0.5460453", "0.5420246", "0.53903854", "0.5370281", "0.5328302", "0.5328038", "0.5295019...
0.80095285
0
Cut line at given position
def cutAtPos(self, position): val = self.line[:position] self.line = self.line[position:] return val
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cut_line(self):\r\n self.parachute.pop(0)", "def cutAt(self, character):\t\n\t\t\n\t\tif self.line.find(character) < 0:\n\t\t\traise CutException('Character not found')\n\t\t\n\t\tval = self.line[:self.line.find(character)]\n\t\tself.line = self.line[self.line.find(character)+1:]\n\t\treturn val", "...
[ "0.73306286", "0.6732413", "0.6677863", "0.64723504", "0.61549896", "0.6125919", "0.61119336", "0.6012234", "0.5828049", "0.5815221", "0.57717556", "0.56684816", "0.56131065", "0.553599", "0.5533644", "0.55323756", "0.55173707", "0.5457276", "0.5445595", "0.5443708", "0.54428...
0.78466594
0
Creates an Operation that will scan through every item in a table when run.
def scan(table_name: str): build = ab.builder( table_name=table_name) description = shake( TableName=build(args.TableName)) return Operation(description, run)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_scan(self, arg):\n results = self._table.scan()\n for item in results[\"Items\"]:\n self._print(_pretty(item))", "def items(kwargs=None):\n if kwargs is None:\n kwargs = {}\n while True:\n resp = table.scan(**kwargs)\n yield from resp['Items']\n k...
[ "0.6228359", "0.60451776", "0.5848391", "0.5576059", "0.5517535", "0.5460877", "0.5242596", "0.5196265", "0.51867557", "0.51820654", "0.5164621", "0.5130511", "0.5113141", "0.5112561", "0.5091411", "0.5072028", "0.505515", "0.50514007", "0.49664125", "0.4961605", "0.49613667"...
0.65158
0
Manage one display indicator icon. The icon to be displayed at any time is determined by the state_callback funtion. pos is the position (in pixels) on the screen. If blank, the next slot will be allocated from the display. the indicator registers itself with Display. No need to keep a variable for it.
def __init__(self, d, images, state_callback, pos=None): self.d = d #Display self.callback = state_callback self.last_img = None self.img = [] for i in images: img, width, height = display.load_image(i) self.img.append(img) self.x_pos = d.register_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _draw_indicator(\n self, src, center, color=(255, 0, 0), shape=\"circle\", size=4, thickness=1\n ):\n if isinstance(center, tuple):\n center = new_point(*center)\n if shape == \"rect\":\n draw_rectangle(\n src,\n center.x - size / 2.0,...
[ "0.56549734", "0.55769974", "0.5466077", "0.5435122", "0.5259966", "0.52186924", "0.5168424", "0.5134024", "0.5118653", "0.50938314", "0.5083714", "0.5069448", "0.5061544", "0.5054154", "0.50497353", "0.50464547", "0.50030607", "0.49856985", "0.4973985", "0.4902044", "0.48736...
0.60308945
0
Gets the icon file from the resources directory.
def get_icon(): icon = Path(__file__).parent.joinpath("resources", "icon.png") # We just want the string to the path for PySide. return str(icon)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_icon(icon_file): \n img_path = _path.join(\n BASEPATH, _path.join('hallbench', _path.join('resources', 'img')))\n icon_path = _path.join(img_path, icon_file)\n icon = _QIcon()\n icon.addPixmap(\n _QPixmap(icon_path),\n _QIcon.Normal,\n _QIcon.Off)\n return icon"...
[ "0.7267057", "0.7186539", "0.71680295", "0.71423817", "0.7094803", "0.7014663", "0.699875", "0.69923085", "0.6906685", "0.6906226", "0.6885282", "0.68688995", "0.6847708", "0.6815401", "0.6753929", "0.673115", "0.6730291", "0.6727965", "0.6727965", "0.6727965", "0.6727965", ...
0.7683156
0
Gets the style.css file from the resources directory.
def get_css(): css = Path(__file__).parent.joinpath("resources", "style.css") with open(css, "r") as style_file: css_data = style_file.read() return css_data
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_style():\n\n style = os.path.join(os.path.dirname(__file__), \"templates\", \"style.css\")\n with open(style, \"r\") as opencss:\n return opencss.read().strip()", "def load_stylesheet(name):\n with suppress(FileNotFoundError):\n with open(STATIC_PATH / name, 'rt') as stylesheet:\n ...
[ "0.7298122", "0.67225504", "0.63319784", "0.62525135", "0.6076459", "0.59549505", "0.59542996", "0.57827294", "0.577367", "0.5773628", "0.5684894", "0.56523114", "0.56331784", "0.56084", "0.5472248", "0.5466866", "0.54628026", "0.5364383", "0.534764", "0.5338111", "0.5276471"...
0.7843269
0
Retrieve metadata from COG asset
def _load_metadata_from_asset(): with rasterio.Env(AWS_NO_SIGN_REQUEST='YES', GDAL_DISABLE_READDIR_ON_OPEN='EMPTY_DIR'): with rasterio.open(href) as src: # Retrieve metadata stored in COG file metadata = src.profile ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get(self) -> json_api.generic.Metadata:\n api_endpoint = ApiEndpoints.assets.fields\n return api_endpoint.perform_request(http=self.auth.http, asset_type=self.parent.ASSET_TYPE)", "def GetMetadata(self):\n return self.dict['meta']", "def _getAllMeta(self):\n try:\n metad...
[ "0.70809305", "0.68785983", "0.6787916", "0.6582544", "0.65211964", "0.6488768", "0.64880824", "0.6478007", "0.64755267", "0.64237744", "0.6389924", "0.63689715", "0.6299962", "0.6248687", "0.62399286", "0.62228495", "0.6218916", "0.6177658", "0.6171238", "0.6171238", "0.6155...
0.81800365
0
Parse metadata from the SAR cog filename
def _parse_filename(filename, metadata): file_noext = os.path.splitext(filename)[0] fname = file_noext.split("_") metadata["scene_id"] = fname[1] metadata[ "beam_mode"] = sat_properties.radarsat_product_characteristics[ fname[2]] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _load_metadata_from_asset():\n\n with rasterio.Env(AWS_NO_SIGN_REQUEST='YES',\n GDAL_DISABLE_READDIR_ON_OPEN='EMPTY_DIR'):\n with rasterio.open(href) as src:\n # Retrieve metadata stored in COG file\n metadata = src.pr...
[ "0.6328707", "0.61443377", "0.60601145", "0.6055962", "0.6050261", "0.6024006", "0.60018224", "0.5953646", "0.5923734", "0.5902934", "0.58560735", "0.58287627", "0.5821959", "0.5799036", "0.5752124", "0.5747356", "0.57307374", "0.5726997", "0.5683347", "0.56630814", "0.566227...
0.7258536
0
Shits out a simple dockerfile for cakephp projects based upon a .travis.yml
def main(): extensions = os.getenv('EXTENSIONS', DEFAULT_EXTENSIONS).split(',') extensions.sort() docker_contents = [] contents = travis_contents() data = yaml.safe_load(contents) # set the version php_versions = data.get('php', [DEFAULT_VERSION]) php_version = php_versions[0] docke...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check():\n cmake('tests')\n docker('./{build}/tests', build=BUILD)", "def build_docker(c):\n tag = c.run('git describe', hide=True)\n docker_img = f'{docker_repo}:{tag.stdout.strip()}'\n c.run(f'docker build -t {docker_img} .')", "def docker_build(c):\n cli_tasks.docker_build.run(c)", "...
[ "0.66781193", "0.6571562", "0.6565537", "0.6506989", "0.6320813", "0.6300796", "0.6141792", "0.60754395", "0.5996922", "0.5919745", "0.58479375", "0.58338064", "0.57864416", "0.57376957", "0.5730911", "0.57271516", "0.57252514", "0.5641273", "0.5628882", "0.5624112", "0.56032...
0.7650627
0
Calculate MAPs, in regards to K
def calc_maps_k(self, qBX, qBY, rBX, rBY, qLX, qLY, rLX, rLY, k): mapi2t = calc_map_k(qBX, rBY, qLX, rLY, k) mapt2i = calc_map_k(qBY, rBX, qLY, rLX, k) mapi2i = calc_map_k(qBX, rBX, qLX, rLX, k) mapt2t = calc_map_k(qBY, rBY, qLY, rLY, k) avg = (mapi2t.item() + mapt2i.item() + ma...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def k_map(self):\n\t\tt1 = time.time()\n\t\tmapping_matrix = [] \n\t\tfor index in self.mapping:\n\t\t\tvector = np.zeros(len(self.unique_char),dtype=float)\n\t\t\tvector[index] = 1.0\n\t\t\tmapping_matrix.append(vector)\n\t\tprint(\"Time creating k map {:.3f} sec\".format(time.time()-t1))\n\t\tself.mapping_matrix...
[ "0.7097635", "0.6405305", "0.6382673", "0.6310537", "0.6246306", "0.6165255", "0.61539656", "0.6136181", "0.6090143", "0.6069749", "0.6035733", "0.5974822", "0.5948159", "0.5946194", "0.5929079", "0.59160817", "0.58489734", "0.58091116", "0.5785186", "0.57669145", "0.5763431"...
0.6901691
1
Creates an R2 plugin with the given arguments.
def create_r2plugin(self, **kwargs): return self.create_tool(cls=R2Plugin, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_plugin(self, **kwargs):\n return self.plugin_class(**kwargs)", "def do_plugin_create(cc, args):\n\n field_list = ['name', 'code', 'callable', 'public', 'extra']\n\n fields = dict((k, v) for (k, v) in vars(args).items()\n if k in field_list and not (v is None))\n\n fiel...
[ "0.6534158", "0.6163332", "0.5920514", "0.5799215", "0.57468385", "0.56910276", "0.5681927", "0.56453353", "0.56410426", "0.56301457", "0.56010586", "0.5585494", "0.5585222", "0.55543864", "0.55391985", "0.5502906", "0.5500424", "0.54910374", "0.5490024", "0.5473118", "0.5469...
0.8725646
0
The 'set' method for the Stack(dict) It 'sets' the value in it's correct place in the Stack AND applies a 'stack_pos' value depending on WHERE in the stack the value is being placed.
def __setitem__(self, key, val): super(Stack, self).__setitem__(key, val) # The 'meta' portion of the stack is a standar dict (not Stack) try: if isinstance(val, Stack) and val.stack_pos is "stack_root": val.parent = self val.key = key ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __set__(self, stack: \"stack.Stack\", value: Any):\n with self._lock:\n self.assign_value_to_stack(stack, value)", "def assign_value_to_stack(self, stack: \"stack.Stack\", value: Any):\n pass", "def assign_value_to_stack(self, stack: \"stack.Stack\", value: Union[dict, list]):\n ...
[ "0.7720888", "0.7439317", "0.6881211", "0.6826017", "0.6686697", "0.6470291", "0.64564764", "0.63827455", "0.6122969", "0.6057367", "0.593939", "0.5896225", "0.5853789", "0.5846537", "0.58212984", "0.5709334", "0.563116", "0.5625634", "0.5625634", "0.5625634", "0.5625634", ...
0.7885178
0
Sets the data_key into the stack, optionally mapping data sources it.
def add_data(self, data_key, data=None, meta=None, ): self._verify_key_types(name='data', keys=data_key) if data_key in self.keys(): raise UserWarning("You have chosen to overwrite the source data and meta for Stack['%s']") if data is not None: if isinstance(data...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_x_and_y_keys(self, data_key, x, y):\r\n if self.stack_pos == 'stack_root':\r\n self[data_key].__set_x_key(x)\r\n self[data_key].__set_y_key(y)\r\n else:\r\n raise KeyError(\"set_x_keys can only be called from a stack at root level. Current level is '{0}'\".fo...
[ "0.6472338", "0.6135069", "0.61180633", "0.6014003", "0.6006666", "0.58484524", "0.583034", "0.5807248", "0.5780128", "0.57284236", "0.57120955", "0.5705826", "0.5705826", "0.5679936", "0.56008524", "0.5600356", "0.559809", "0.5547312", "0.5539231", "0.5510886", "0.5510886", ...
0.6149559
1
Group variables by data types found in the meta.
def variable_types(self, data_key, only_type=None): if self[data_key].meta['columns'] is None: return 'No meta attached to data_key: %s' %(data_key) else: types = { 'int': [], 'float': [], 'single': [], 'deli...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _all_meta(self):\n\t\treturn {meta.key: self.type_cast(meta.value) for meta in self.meta_set.all()}", "def get_varmeta(self):\n\n if self.ref_ds is not None:\n ref_meta = (self.ref_ds.id, self.ref_ds._names_from_attrs('all'))\n else:\n ref_meta = None\n if self.othe...
[ "0.59063804", "0.58795136", "0.5873593", "0.57685095", "0.5711241", "0.55855113", "0.5570443", "0.5503071", "0.5463241", "0.5416724", "0.5404935", "0.5290731", "0.5261287", "0.52095056", "0.52092326", "0.5185386", "0.50565064", "0.5050169", "0.5047163", "0.5043952", "0.501732...
0.65671605
0
Construct a "chain" shaped subset of Links and their Views from the Stack. A chain is a onetoone or onetomany relation with an orientation that defines from which axis (x or y) it is build.
def get_chain(self, name=None, data_keys=None, filters=None, x=None, y=None, views=None, post_process=True, orient_on=None, select=None): #Make sure all the given keys are in lists data_keys = self._force_key_as_list(data_keys) # filters = self._force_key_as_list(filters)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def chain_graph(self) -> nx.DiGraph:\n edg_lst = [\n (f\"p{idx}\", f\"p{idx+1}\", self.a[f\"p{idx+1}\"]) for idx in range(self.n)\n ]\n chain_graph = nx.DiGraph()\n chain_graph.add_weighted_edges_from(edg_lst)\n return chain_graph", "def chain_graph(self) -> nx.DiGra...
[ "0.5949611", "0.5761146", "0.5523492", "0.5483067", "0.53988105", "0.52840245", "0.51865804", "0.51337653", "0.50848824", "0.50766546", "0.5058167", "0.50423664", "0.50234085", "0.50112087", "0.5005778", "0.49760357", "0.49735498", "0.49703103", "0.49459764", "0.49457243", "0...
0.58844775
1
Save Stack instance to .stack file.
def save(self, path_stack, compression="gzip"): protocol = cPickle.HIGHEST_PROTOCOL if not path_stack.endswith('.stack'): raise ValueError( "To avoid ambiguity, when using Stack.save() you must provide the full path to " "the stack file you want to create...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_stack(stack):\n path = os.path.join(STACK_DIRECTORY, '%s.%s' % (stack.module, stack.caller))\n with open(path, 'w+') as f:\n dill.dump(stack, f)", "def save_game(self, path):\n try:\n file = open(path, \"wb\")\n for i in self.state_stack.states:\n ...
[ "0.83591104", "0.68703425", "0.684626", "0.68171114", "0.6795026", "0.67741024", "0.6737266", "0.65906686", "0.6552278", "0.6511375", "0.6493919", "0.6468704", "0.6422137", "0.638314", "0.63795894", "0.6343323", "0.63281953", "0.62846315", "0.6282582", "0.62518305", "0.623329...
0.7311077
1
Creates a new stack instance from a .sav file.
def from_sav(data_key, filename, name=None, path=None, ioLocale="en_US.UTF-8", ioUtf8=True): if name is None: name = data_key meta, data = parse_sav_file(filename=filename, path=path, name=name, ioLocale=ioLocale, ioUtf8=ioUtf8) return Stack(add_data={name: {'meta': meta, 'data...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_stack(filename):\n data = np.genfromtxt(filename, skip_header=1)\n index_arr = data[:, 2]\n thickness_arr = data[:, 3] / 1e9\n stack = Stack(index_arr, thickness_arr)\n return stack", "def read_spss(self, path_sav, **kwargs):\n if path_sav.endswith('.sav'): path_sav = path_sav.repl...
[ "0.6381975", "0.5992964", "0.57952154", "0.5777234", "0.5610841", "0.56030494", "0.5596717", "0.55868554", "0.5555224", "0.5437524", "0.5419869", "0.5418676", "0.54048544", "0.5385061", "0.53795224", "0.5335637", "0.53254545", "0.5320597", "0.5294863", "0.5294863", "0.5275241...
0.7607764
0
Sets the x_variables and y_variables in the data part of the stack for this data_key, e.g. stack['Jan']. This method can also be used to add to the current lists and it makes sure the list stays unique.
def _set_x_and_y_keys(self, data_key, x, y): if self.stack_pos == 'stack_root': self[data_key].__set_x_key(x) self[data_key].__set_y_key(y) else: raise KeyError("set_x_keys can only be called from a stack at root level. Current level is '{0}'".format(self.stack_p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def push(self, **vars):\n self._variable_stack.append(dict(self._variables))\n self.update(**vars)", "def set_data(self, x = None, y = None):\n self.x_axis = x\n self.y_axis = y", "def set_xList(self, *xList):\n assert len(xList) == self.__nx\n self.__x = xList\n ...
[ "0.58428204", "0.5507232", "0.54659504", "0.5432805", "0.54303056", "0.54111904", "0.5294803", "0.5270163", "0.5206912", "0.52056944", "0.5143031", "0.51415336", "0.51316047", "0.51277274", "0.5122735", "0.5116576", "0.5107302", "0.50981134", "0.50929874", "0.5043019", "0.504...
0.6777685
0
Generate keys from a list (or tuple).
def __generate_key_from_list_of(self, list_of_keys): list_of_keys = list(list_of_keys) list_of_keys.sort() return ",".join(list_of_keys)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gen_decomp_keys(self, decomp_list):\n for key in decomp_list:\n if isinstance(key, tuple) or isinstance(key, list):\n yield key[0]\n else:\n yield key", "def make_key(*values, **kwargs):\n if len(kwargs) == 0:\n key = tuple(v.key fo...
[ "0.7271849", "0.6904", "0.66444695", "0.6273985", "0.6262291", "0.61452633", "0.61233735", "0.5925577", "0.59042096", "0.5861307", "0.5854959", "0.58370656", "0.58244324", "0.58018833", "0.579413", "0.575015", "0.57346183", "0.57298255", "0.57273", "0.5726597", "0.57195264", ...
0.724901
1
Generates all combinations of items from a list
def __get_all_combinations(self, list_of_items): return [itertools.combinations(list_of_items, index+1) for index in range(len(list_of_items))]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_combinations(items):\n\n def inner(items, r):\n \"\"\"\n recursively yields partitioned remainders of original partition lists\n \"\"\"\n items = set(items)\n if not len(items):\n yield ()\n ...
[ "0.73547757", "0.7042136", "0.6938442", "0.6915465", "0.6875703", "0.67848724", "0.6771032", "0.67682385", "0.67648953", "0.67328763", "0.6639714", "0.65762985", "0.6549294", "0.6549017", "0.65443975", "0.64914507", "0.64767146", "0.6452351", "0.63577306", "0.6336958", "0.627...
0.7876408
0
Takes a stack_pos and returns the stack with that location raises an exception IF the stack pointer is not found
def __get_stack_pointer(self, stack_pos): if self.parent.stack_pos == stack_pos: return self.parent else: return self.parent.__get_stack_pointer(stack_pos)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_stack(self, offset):\n self.validate_stack_offset(offset)\n return self.stack[offset]", "def getStackPosition(self):\r\n return self.callstack.getStack()", "def findCaller(self, stack_info=False, stacklevel=2):\n f = currentframe()\n #On some versions of IronPython, ...
[ "0.6661285", "0.64549404", "0.6386795", "0.63797617", "0.62505674", "0.6199616", "0.6169721", "0.6112925", "0.6090924", "0.6016371", "0.5990624", "0.5959264", "0.5959168", "0.59493977", "0.5908766", "0.58735526", "0.5840768", "0.583369", "0.5831592", "0.5808342", "0.5787022",...
0.6940179
0
Verify that the given keys str or unicode or a list or tuple of those.
def _verify_multiple_key_types(self, data_keys=None, filters=None, x=None, y=None, variables=None, views=None): if data_keys is not None: self._verify_key_types(name='data', keys=data_keys) if filters is not None: self._verify_key_types(n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _verify_key_types(self, name, keys):\r\n if isinstance(keys, (list, tuple)):\r\n for key in keys:\r\n self._verify_key_types(name, key)\r\n elif isinstance(keys, (str, unicode)):\r\n pass\r\n else:\r\n raise TypeError(\r\n \"Al...
[ "0.84560245", "0.6857103", "0.680023", "0.6798254", "0.6696846", "0.6648808", "0.6521568", "0.64482117", "0.6443321", "0.638443", "0.63820523", "0.63607854", "0.63559777", "0.6261623", "0.62345", "0.622563", "0.62081283", "0.61760545", "0.61636066", "0.61437494", "0.61348677"...
0.6996826
1
Verify that the given key exists in the stack at the path targeted.
def _verify_key_exists(self, key, stack_path=[]): error_msg = ( "Could not find the {key_type} key '{key}' in: {stack_path}. " "Found {keys_found} instead." ) try: dk = stack_path[0] fk = stack_path[1] xk = stack_path[2] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def assert_key_exists(self, key, caller):\n assert key, (\"key parameter must be specified.\")\n if key not in self:\n raise KeyNotInContextError(\n f\"context['{key}'] doesn't exist. It must exist for {caller}.\")", "def _has(self, key):\n path = self._get_key_path...
[ "0.70001173", "0.6919717", "0.6739363", "0.6700697", "0.6681527", "0.65265507", "0.6524702", "0.6507662", "0.6446694", "0.64168507", "0.6404698", "0.6384552", "0.6377084", "0.63695735", "0.63428736", "0.63240826", "0.63168067", "0.6312734", "0.63050866", "0.63019025", "0.6279...
0.81743956
0
Returns key as [key] if it is str or unicode
def _force_key_as_list(self, key): return [key] if isinstance(key, (str, unicode)) else key
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _tokey(self, keys: Union[str, Iterable]):\n if hasattr(keys, \"encode\"): # str\n return keys.encode(\"utf-8\")\n elif hasattr(keys, \"decode\"): # bytes\n return keys\n return (self.Sep.join(keys).encode(\"utf-8\"))", "def __getitem__(self, key):\n if type(...
[ "0.692036", "0.68628824", "0.667871", "0.65280366", "0.6479335", "0.6431466", "0.64151585", "0.64050287", "0.63881904", "0.62845904", "0.62736076", "0.62168086", "0.62093353", "0.61739796", "0.61739796", "0.6144354", "0.6143355", "0.6131979", "0.6118", "0.6107281", "0.6087214...
0.73133
0
Verify that the given keys str or unicode or a list or tuple of those.
def _verify_key_types(self, name, keys): if isinstance(keys, (list, tuple)): for key in keys: self._verify_key_types(name, key) elif isinstance(keys, (str, unicode)): pass else: raise TypeError( "All %s keys must be one ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _verify_multiple_key_types(self, data_keys=None, filters=None, x=None,\r\n y=None, variables=None, views=None):\r\n if data_keys is not None:\r\n self._verify_key_types(name='data', keys=data_keys)\r\n\r\n if filters is not None:\r\n self._v...
[ "0.6996826", "0.6857103", "0.680023", "0.6798254", "0.6696846", "0.6648808", "0.6521568", "0.64482117", "0.6443321", "0.638443", "0.63820523", "0.63607854", "0.63559777", "0.6261623", "0.62345", "0.622563", "0.62081283", "0.61760545", "0.61636066", "0.61437494", "0.61348677",...
0.84560245
0
Join all running threads
def joinAllThreads(self): if self.fitAsync: with self.threadListLock: for thread in self.threadList: thread.join() else: return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def joiner():\n for th in threads:\n th.join()\n done(process)", "def join_threads(threads):\n for t in threads:\n while t.isAlive():\n t.join(5)", "def join(self):\n while not self._stop:\n time.sleep(0.1)\n for t in reversed(self.tasks):\...
[ "0.8029715", "0.773945", "0.76160085", "0.7336391", "0.72426933", "0.7126829", "0.70607364", "0.6977239", "0.6876884", "0.6726911", "0.66968334", "0.66548884", "0.6609573", "0.6568536", "0.6568536", "0.65668297", "0.656492", "0.6482418", "0.64778936", "0.64752525", "0.6445365...
0.83492696
0
Add role to the Member
async def addrole(self, ctx, member: discord.Member, role: discord.Role): role = discord.utils.get(ctx.guild.roles, id=role.id) muted_role = discord.utils.get(ctx.guild.roles, name="Muted") punished_role = discord.utils.get(ctx.guild.roles, name="Punished") if role > ctx.author.top_rol...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_role(self, role):\n if role.name not in [r.name for r in self.roles]:\n return db[self.colNam].find_and_modify(query=dict(_id=self.id), update={'$push': {'roles': role.to_python()}})", "def addRole(self, role):\n self._client.addRole(role)", "async def addrole(self, ctx, user: ...
[ "0.7570307", "0.7567677", "0.7534781", "0.7433675", "0.7415941", "0.7411809", "0.7370567", "0.72969", "0.72914296", "0.7286169", "0.7281028", "0.72385347", "0.72077465", "0.7204429", "0.71875477", "0.71404094", "0.71215886", "0.71215886", "0.71122515", "0.7056936", "0.7049572...
0.79049414
0
Remove a role from the member
async def removerole(self, ctx, member: discord.Member, role: discord.Role): role = discord.utils.get(ctx.guild.roles, id=role.id) muted_role = discord.utils.get(ctx.guild.roles, name="Muted") punished_role = discord.utils.get(ctx.guild.roles, name="Punished") if role > ctx.author.top_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def remove_role(self, *, reason: str = None):\n await config.member(self.member).set_raw(str(self.role.id), value=None)\n if self.role in self.member.roles:\n try:\n await self.member.remove_roles(self.role, reason=reason)\n except discord.HTTPException:\n ...
[ "0.8187497", "0.7978509", "0.79427636", "0.79377174", "0.78856933", "0.77909815", "0.76512873", "0.7625483", "0.7503555", "0.7469059", "0.74140835", "0.741383", "0.74035096", "0.73808104", "0.73396295", "0.7317423", "0.72812545", "0.7207674", "0.7205083", "0.72049063", "0.715...
0.8088363
1
Add a persisting role to the member
async def persistrole(self, ctx, member: discord.Member, role: discord.Role): role = discord.utils.get(ctx.guild.roles, id=role.id) muted_role = discord.utils.get(ctx.guild.roles, name="Muted") punished_role = discord.utils.get(ctx.guild.roles, name="Punished") if role > ctx.author.top...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def save(self):\n await config.member(self.member).set_raw(str(self.role.id), value=self.as_dict)", "def add_role(self, role):\n if role.name not in [r.name for r in self.roles]:\n return db[self.colNam].find_and_modify(query=dict(_id=self.id), update={'$push': {'roles': role.to_py...
[ "0.75814265", "0.69590753", "0.6944869", "0.6903061", "0.68663025", "0.67569315", "0.67447764", "0.6688437", "0.6578498", "0.6572754", "0.6531272", "0.65293014", "0.6517352", "0.6489404", "0.64842844", "0.64722466", "0.64613277", "0.6391094", "0.6384594", "0.6379459", "0.6369...
0.7995215
0
Remove a persisting role from the member
async def removepersistrole(self, ctx, member: discord.Member, role: discord.Role): role = discord.utils.get(ctx.guild.roles, id=role.id) muted_role = discord.utils.get(ctx.guild.roles, name="Muted") punished_role = discord.utils.get(ctx.guild.roles, name="Punished") if role > ctx.auth...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_role(role):\n fallback = Role.load_cli_user()\n\n def _del(cls, col):\n pq = db.session.query(cls)\n pq = pq.filter(col == role.id)\n\n def _repo(cls, col):\n pq = db.session.query(cls).filter(col == role.id)\n pq.update({col: fallback.id}, synchronize_session=False)...
[ "0.7482419", "0.73443776", "0.7326495", "0.7247932", "0.71359766", "0.7044", "0.7003247", "0.6907898", "0.69022053", "0.68038666", "0.6803843", "0.680215", "0.6796542", "0.67945176", "0.6772586", "0.6704123", "0.66735536", "0.66630554", "0.6656054", "0.66415286", "0.6641259",...
0.810434
0
Add the role to specified members in the guild
async def massadd( self, ctx, role: discord.Role, member: commands.Greedy[discord.Member], ): role = discord.utils.get(ctx.guild.roles, id=role.id) muted_role = discord.utils.get(ctx.guild.roles, name="Muted") punished_role = discord.utils.get(ctx.guild.roles...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def addroleall(self, ctx, role: discord.Role):\n muted_role = discord.utils.get(ctx.guild.roles, name=\"Muted\")\n punished_role = discord.utils.get(ctx.guild.roles, name=\"Punished\")\n\n if role > ctx.author.top_role:\n return await ctx.send(\n embed=discord.E...
[ "0.70327395", "0.6760455", "0.6745772", "0.67203873", "0.66337353", "0.6586981", "0.6503161", "0.6405369", "0.63433355", "0.6337548", "0.6296795", "0.6280821", "0.62756366", "0.62320954", "0.62254107", "0.62130994", "0.62019783", "0.61869454", "0.613318", "0.60818875", "0.607...
0.7289643
0
Remove the role from specified members in the guild
async def massremove( self, ctx, role: discord.Role, member: commands.Greedy[discord.Member], ): role = discord.utils.get(ctx.guild.roles, id=role.id) muted_role = discord.utils.get(ctx.guild.roles, name="Muted") punished_role = discord.utils.get(ctx.guild.r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def remove_from(self, target: discord.Member) -> None:\n role = await self.get_role(target.guild)\n if role:\n await target.remove_roles(role)\n\n if not role.members:\n await role.delete()", "async def unmute(self, ctx: Context, members: commands.Greedy[d...
[ "0.7578296", "0.7440219", "0.72017306", "0.7164568", "0.70579517", "0.7023119", "0.6872467", "0.6871099", "0.67866164", "0.6748588", "0.6680696", "0.6669738", "0.663427", "0.6621332", "0.6523396", "0.6516523", "0.64946425", "0.64583254", "0.6451127", "0.6432923", "0.64100957"...
0.7633059
0
Add a role to all members in the guild
async def addroleall(self, ctx, role: discord.Role): muted_role = discord.utils.get(ctx.guild.roles, name="Muted") punished_role = discord.utils.get(ctx.guild.roles, name="Punished") if role > ctx.author.top_role: return await ctx.send( embed=discord.Embed( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def massadd(\n self,\n ctx,\n role: discord.Role,\n member: commands.Greedy[discord.Member],\n ):\n role = discord.utils.get(ctx.guild.roles, id=role.id)\n\n muted_role = discord.utils.get(ctx.guild.roles, name=\"Muted\")\n punished_role = discord.utils.get...
[ "0.7208946", "0.68566215", "0.6601704", "0.6442673", "0.6392668", "0.6327689", "0.63269323", "0.6314798", "0.6309211", "0.62774974", "0.6272708", "0.62459", "0.62431896", "0.62427074", "0.6148689", "0.61357826", "0.613441", "0.61249214", "0.61176383", "0.6112425", "0.6098608"...
0.7853511
0
Remove the role from all members in the guild
async def removeroleall(self, ctx, role: discord.Role): muted_role = discord.utils.get(ctx.guild.roles, name="Muted") punished_role = discord.utils.get(ctx.guild.roles, name="Punished") if role > ctx.author.top_role: return await ctx.send( embed=discord.Embed( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def remove_roles(guild):\r\n Rules = Query()\r\n db.remove(Rules.guild == guild.id)\r\n del RULES[guild.id]", "async def massremove(\n self,\n ctx,\n role: discord.Role,\n member: commands.Greedy[discord.Member],\n ):\n\n role = discord.utils.get(ctx.guild.rol...
[ "0.77196056", "0.7477624", "0.74612665", "0.74261963", "0.70653266", "0.6954451", "0.69512653", "0.69299954", "0.68825835", "0.67811483", "0.67630804", "0.67576116", "0.6745457", "0.66221887", "0.6603801", "0.6488937", "0.64209276", "0.63899964", "0.6385136", "0.63824064", "0...
0.79392797
0
Load all IJSONDataProvider providers
def json_data(self): json_providers = getAdapters((self.context, self.request, self.view), IJSONDataProvider) results = [] for name, provider in json_providers: results.append({'name': name or None, 'data': json.dumps(provider())}) return results
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _load_providers(self, **kwargs):\n return super()._load_providers(providers=\"TIProviders\", **kwargs)", "def get_providers(self):\n \n r = requests.get(\n self._url('/dataproviders'),\n headers={'Authorization': self.token},\n proxies=self.pr...
[ "0.6913169", "0.64779794", "0.6103122", "0.60407805", "0.6022248", "0.586881", "0.5856722", "0.57174754", "0.56971353", "0.5516536", "0.5515115", "0.5500439", "0.5500439", "0.5500439", "0.5500439", "0.5500439", "0.5500439", "0.5453203", "0.54512775", "0.5449996", "0.54412305"...
0.7103289
0
Load all IDOMDataProvider providers
def dom_data(self): dom_providers = getAdapters((self.context, self.request, self.view), IDOMDataProvider) results = [] for name, provider in dom_providers: results.append({'name': name or None, 'data': provider()}) return results
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _load_providers(self, **kwargs):\n return super()._load_providers(providers=\"TIProviders\", **kwargs)", "def _load_drivers(self):\n self.drivers, self.default_provider = service_base.load_drivers(\n taas_consts.TAAS, self)", "def _load_drivers(self):\n self.drivers, self.de...
[ "0.6451605", "0.62758476", "0.62439394", "0.60339785", "0.5897526", "0.5797458", "0.57533056", "0.55735177", "0.5567528", "0.5532424", "0.5518296", "0.5518296", "0.5508206", "0.5463152", "0.5460798", "0.5414698", "0.53313816", "0.5312492", "0.53124434", "0.5306001", "0.530311...
0.6828622
0
Calculate kinetic energy density using laplacian of orbitals
def calc_ked_WFI(self): #Initialize kinetic energy density self.ked_WFI = np.zeros( (self.grid.Nelem, 1)) #Figure out the number of occupied orbitals if self.m == 0: if self.pol == 1: Nocc = np.floor(self.N/2) nu = self.N / 2 - Nocc else: Nocc = np.f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_energy_density(kT):\n h=u.planck\n c=u.speed_of_light\n pi=np.pi\n return (8*pi/(h*c)**3)*((pi*kT)**4/15)", "def kin_energy (self):\n\n for planet in self.planets:\n planet.kenergy = 0.5*planet.mass*((np.linalg.norm(planet.velocity))**2) # every 'kenergy'...
[ "0.6711679", "0.6050671", "0.5996172", "0.59738076", "0.59571743", "0.5953587", "0.59038174", "0.5898051", "0.5881261", "0.58746827", "0.58423156", "0.583687", "0.5827854", "0.58256716", "0.5778814", "0.57494277", "0.5736355", "0.57223487", "0.5695155", "0.56936395", "0.56817...
0.69676065
0
Create the user agent for IotHub
def get_iothub_user_agent() -> str: return "{iothub_iden}/{version}{common}".format( iothub_iden=IOTHUB_IDENTIFIER, version=VERSION, common=_get_common_user_agent(), )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_user_agent(self):\n user_agent = b\"test-agent\"\n\n def update_expected_user_agent(expected):\n expected[3][\"attributes\"].update(\n {\"http.user_agent\": user_agent.decode(\"utf8\")}\n )\n return expected\n\n self.scope[\"headers\"].a...
[ "0.65058565", "0.6411603", "0.63528496", "0.63170594", "0.62735516", "0.62172145", "0.62084913", "0.6191572", "0.6191572", "0.6155119", "0.61193496", "0.60615385", "0.605927", "0.6007714", "0.5996502", "0.5863477", "0.5844187", "0.57906896", "0.57821304", "0.5745263", "0.5727...
0.6565932
0
Test conversion of html with png data url to pdf
def testConvertHtmlWithPngDataUrlToPdf(self): self._testBase("data/test_with_png_dataurl.html")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_raw_pdf(html_path, pdf_path, width='', height=''):\n debug = False\n if mg.EXPORT_IMAGES_DIAGNOSTIC: debug = True\n try:\n url = html_path.as_uri()\n cmd_make_pdf = 'cmd_make_pdf not successfully generated yet'\n \"\"\"\n Unless Linux, MUST be in report directory otherw...
[ "0.67066187", "0.6701321", "0.65533936", "0.63305837", "0.6099489", "0.6017834", "0.59876275", "0.5946929", "0.5874019", "0.57817435", "0.572556", "0.5722021", "0.5679243", "0.56552047", "0.56141573", "0.5595637", "0.5588724", "0.5588328", "0.5584552", "0.55791056", "0.556577...
0.86471814
0
Test conversion of html with script to pdf
def testConvertHtmlWithScriptToPdf(self): self._testBase("data/test_with_script.html")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testConvertHtmlWithOpacityStyleToPdf(self):\n self._testBase(\"data/test_with_opacity_style.html\")", "def testConvertHtmlWithPngDataUrlToPdf(self):\n self._testBase(\"data/test_with_png_dataurl.html\")", "def generate_pdf(pdf_data):\n\n html = HTML(string=pdf_data)\n f = html.write_pdf()\n\n ...
[ "0.68983364", "0.6657992", "0.65550816", "0.65299934", "0.6401548", "0.6344371", "0.63163656", "0.62249994", "0.620765", "0.6193275", "0.6157627", "0.6150456", "0.61295813", "0.6123848", "0.6107017", "0.61050683", "0.6063744", "0.6042349", "0.6035368", "0.60228574", "0.597639...
0.85146284
0