query
stringlengths
9
3.4k
document
stringlengths
9
87.4k
metadata
dict
negatives
listlengths
4
101
negative_scores
listlengths
4
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
GET sequences from ID3C server with provided lineage and segment
def get_sequences_from_id3c(url, username, password, lineage, segment, output): r = requests.get(url, auth=(username,password), stream=True) r.raise_for_status() with open(output, 'w+') as fasta_file: for line in r.iter_lines(): if line: sequence = json.loads(line) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_genomic_data(lineage, segment, session):\n LOG.debug(f\"Exporting genomic data for lineage <{lineage}> and segment <{segment}>\")\n\n sequences = datastore.fetch_genomic_sequences(session, lineage, segment)\n\n return Response((row[0] + '\\n' for row in sequences), mimetype=\"application/x-ndjson\...
[ "0.6074918", "0.59999114", "0.57448626", "0.5712717", "0.5657642", "0.5515684", "0.5482543", "0.527945", "0.52410114", "0.52103394", "0.5157792", "0.51533157", "0.514769", "0.51354444", "0.51207256", "0.511246", "0.50718766", "0.5018996", "0.5016804", "0.4998077", "0.49922892...
0.75697505
0
Write the unique IDs to a file, but add a self.prefix to each element of the array. For example, if self.unique_ids is ['image_1.jpg', 'image_2.jpg'] then if the self.prfix is './folder/', then out_file would be written as ./folder/image_1.jpg ./folder/image_2.jpg
def write_unique_ids(self, out_file): with open(out_file,'w') as f: f.writelines([self.prefix+x+'\n' for x in self.unique_ids]) return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_ID_files(self):\n for file, IDs in [(self._trn_IDs_file, self._trn_IDs), (self._val_IDs_file,\n self._val_IDs), (self._tst_IDs_file, self._tst_IDs)]:\n with open(file, 'w') as f:\n f.write('\\n'.join('{}###{...
[ "0.69445384", "0.64533186", "0.6405879", "0.6318872", "0.5901129", "0.57555485", "0.57474875", "0.5697831", "0.55670774", "0.5564222", "0.55620843", "0.55135316", "0.54920965", "0.54119766", "0.5354059", "0.5347817", "0.5346361", "0.53412336", "0.53253436", "0.5306415", "0.52...
0.826794
0
Read the unique IDs from in_file, but remove a self.prefix from each element of the array. For example, if the in_file is ./folder/image_1.jpg ./folder/image_2.jpg and the self.prefix is './folder/', then self.unique_ids would be written as ['image_1.jpg', 'image_2.jpg']
def read_unique_ids(self, in_file, prefix=None): if prefix is None: prefix = self.prefix with open(in_file) as f: self.unique_ids = [x.strip().replace(prefix, '') for x in f] return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_unique_ids(self, out_file):\n with open(out_file,'w') as f:\n f.writelines([self.prefix+x+'\\n' for x in self.unique_ids])\n return", "def load_uids_from_file():\n uids = io.load_file(io.UIDS_FILE)\n if not uids:\n save_uids_to_file(DEFAULT_UIDS)\n return lo...
[ "0.6857764", "0.59046537", "0.5876727", "0.5724553", "0.5643143", "0.560151", "0.5585564", "0.55011547", "0.54623485", "0.5456302", "0.5420213", "0.53884214", "0.5385816", "0.5367136", "0.53472537", "0.53333265", "0.5323998", "0.52856857", "0.52816784", "0.5269871", "0.525752...
0.88484704
0
Create the Adience Dataset class.
def __init__(self, metadata_folder='./'): self.metadata = self.load_metadata(metadata_folder) self.prefix = 'data/adience/faces/' return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_dataset(source=''):\n return ExperimentalDataset()", "def datasetcreate(self, dataset_path='datasets', class_name='Demo',\n haarcascade_path='haarcascade/haarcascade_frontalface_default.xml',\n eyecascade_path='haarcascade/haarcascade_eye.xml', eye_det...
[ "0.68890107", "0.67470795", "0.66202754", "0.6563503", "0.6551748", "0.65432465", "0.64777726", "0.63658005", "0.633543", "0.6286271", "0.626821", "0.6258167", "0.6239777", "0.62299514", "0.61367655", "0.6102009", "0.60866", "0.60773563", "0.60701334", "0.6030363", "0.6027373...
0.0
-1
Given an age, what is the age group?
def adience_resolve_class_label(age): if age == '(0, 2)' or age == '2': age_id = 0 elif age == '(4, 6)' or age == '3': age_id = 1 elif age == '(8, 12)' or age == '(8, 23)' or age == '13': age_id = 2 elif age == '(15, 20)' or...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def age_group(self):\n if \"ageGroup\" in self._prop_dict:\n return self._prop_dict[\"ageGroup\"]\n else:\n return None", "def __age_categorize(self, age):\r\n # Baby age category - most at risk, highest categorical denomination\r\n if age <= 4:\r\n se...
[ "0.7400962", "0.6577341", "0.65198344", "0.64193434", "0.6352549", "0.6317757", "0.63024217", "0.61729646", "0.6149663", "0.60753495", "0.60315925", "0.6030247", "0.6030247", "0.60000616", "0.5998982", "0.59764224", "0.59548694", "0.594437", "0.5929544", "0.5929544", "0.59042...
0.60576355
10
Randomly select images from the Adience dataset to be included in the experiments. Make sure that there are at least CAP number of images in each intersection for age and gender groups.
def select_unique_ids(self): adience = self.metadata adi_ids = [] for gg in set(adience['gender']): for ag in set(adience['age_group']): try: idx = np.logical_and(adience['gender'] == gg,adience['age_group'] == ag) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def randomly_select_images():\r\n global images_a, images_b, images_total\r\n images_a = random.sample(images_a, int(number_of_images_a.get()))\r\n if number_of_images_b.get() != \"\": #check if images_b empty\r\n images_b = random.sample(images_b, int(number_of_images_b.get()))\r\n else:\r\n ...
[ "0.6693414", "0.6490106", "0.61181164", "0.6050987", "0.58736163", "0.5851024", "0.58290976", "0.5715605", "0.558692", "0.54810894", "0.5468066", "0.5460927", "0.54552704", "0.54450935", "0.5403223", "0.53799707", "0.53760904", "0.5369954", "0.53452176", "0.5318924", "0.53118...
0.6429686
2
Create the CCD Dataset class.
def __init__(self, metadata_folder='./'): self.metadata = self.load_metadata(metadata_folder) self.prefix = 'data/CCD/frames/' return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_new_dataset(self,\n dataset_dir, \n split,\n description=\"\",\n url=\"\",\n version=\"\",\n year=0,\n contributor=\"\",\n...
[ "0.71772265", "0.6800385", "0.67641604", "0.67442983", "0.6739134", "0.66833997", "0.6660233", "0.66377974", "0.6632657", "0.66210264", "0.6538922", "0.6515394", "0.63803774", "0.63703537", "0.63639367", "0.63564277", "0.6339496", "0.6322804", "0.6306451", "0.62665397", "0.62...
0.0
-1
Randomly select images from the CCD dataset to be included in the experiments. Make sure that there are at least CAP number of images in each intersection for age, gender, lighting condition, and skin groups.
def select_unique_ids(self): ccd = self.metadata ccd_ids = [] for dg in set(ccd['isDark']): for gg in set(ccd['Gender']): for sg in set(ccd['Skin']): for ag in set(ccd['Age']): try: intersection_i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def randomly_select_images():\r\n global images_a, images_b, images_total\r\n images_a = random.sample(images_a, int(number_of_images_a.get()))\r\n if number_of_images_b.get() != \"\": #check if images_b empty\r\n images_b = random.sample(images_b, int(number_of_images_b.get()))\r\n else:\r\n ...
[ "0.6372832", "0.5899854", "0.58285266", "0.58255917", "0.5720729", "0.5693634", "0.5607028", "0.55150485", "0.5467195", "0.5396391", "0.5383312", "0.5382062", "0.53393257", "0.53032136", "0.5301093", "0.5289086", "0.52777845", "0.5268686", "0.52449733", "0.523275", "0.5193581...
0.65822405
0
Create the MAIP Dataset class.
def __init__(self, metadata_folder='./'): self.metadata = self.load_metadata(metadata_folder) self.prefix = 'data/miap/images/' return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def CreateDataset(all_arrays):\n dataset = Dataset()\n\n dataset._addData(all_arrays[0])\n dataset._addData(all_arrays[1])\n dataset._addData(all_arrays[3])\n dataset._addData(all_arrays[5])\n dataset._addData(all_arrays[6])\n dataset._addData(all_arrays[9])\n dataset._addData(all_arrays[8]...
[ "0.6618513", "0.6479319", "0.6405539", "0.63376313", "0.6287821", "0.62840694", "0.6240477", "0.6220959", "0.61934644", "0.6187013", "0.61758745", "0.61485577", "0.61482894", "0.6110025", "0.6081134", "0.6057111", "0.6041586", "0.6039835", "0.60111904", "0.60032386", "0.59831...
0.0
-1
First only select those MIAP images that have 1 object in them. Then randomly select images to be included in the experiments. Make sure that there are at least CAP number of images in each intersection for age and gender groups.
def select_unique_ids(self): miap = self.metadata miap_single = miap[miap.ImageID.isin(list(miap_single[miap_single == 1].index))] miap_ids = [] for gp in set(miap_single['GenderPresentation']): for ap in set(miap_single['AgePresentation']): try: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def select_unique_ids(self):\n ccd = self.metadata\n ccd_ids = []\n for dg in set(ccd['isDark']):\n for gg in set(ccd['Gender']):\n for sg in set(ccd['Skin']):\n for ag in set(ccd['Age']):\n try:\n i...
[ "0.6107763", "0.6104834", "0.60473615", "0.5822715", "0.5687118", "0.5592082", "0.55718535", "0.5563342", "0.5562081", "0.5492943", "0.5483507", "0.54614764", "0.54502845", "0.54063916", "0.5379569", "0.5375134", "0.53729117", "0.53599495", "0.5322199", "0.532211", "0.5309846...
0.6976405
0
Create the UTK Dataset class.
def __init__(self, utkface_filenames = 'utkface_images.txt'): self.metadata = self.load_metadata(utkface_filenames) self.prefix = '' return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, name_dataset, reduce=False):\n dataset = TUDataset(root='data/TUDataset', name=name_dataset)\n if reduce:\n new_dataset = []\n for i in tqdm(range(len(dataset))):\n aux_graph = copy.deepcopy(dataset[i])\n aux_graph.edge_index = TU...
[ "0.7217619", "0.7017165", "0.69850045", "0.6954425", "0.68380755", "0.67937624", "0.6782208", "0.6707376", "0.66942316", "0.66832036", "0.65427226", "0.6434744", "0.64004165", "0.6264023", "0.6217079", "0.6214021", "0.61979926", "0.617337", "0.6130264", "0.6122425", "0.610881...
0.0
-1
The metadata for the UTK dataset are in the file names, so pass a list of utk files
def load_metadata(self, utkface_filenames): def utk_resolve_age_label(file): x = file.split('_') if len(x) != 4: return -1 age = int(file.split('_')[0]) if age in range(18): age_id = 0 elif age in range(18,45): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, utkface_filenames = 'utkface_images.txt'):\n self.metadata = self.load_metadata(utkface_filenames)\n self.prefix = ''\n return", "def load_sotu_data():\n sotu_files = glob.glob(\"sotu-data/*.txt\")\n path_desc = re.compile(r\"sotu-data/([A-Za-z]+)_([0-9]{4})\\.txt\")...
[ "0.6503858", "0.5745298", "0.56453", "0.5499407", "0.531591", "0.5222382", "0.5202782", "0.5201199", "0.51858264", "0.51849985", "0.51831937", "0.5131584", "0.51163554", "0.51074165", "0.50857013", "0.5076598", "0.50594175", "0.5055774", "0.5037375", "0.5024851", "0.50070727"...
0.638878
1
First only select those MIAP images that have 1 object in them. Then randomly select images to be included in the experiments. Make sure that there are at least CAP number of images in each intersection for race, age, and gender groups.
def select_unique_ids(self): utk = self.metadata utk_ids = [] for gg in set(utk['gender']): for rg in set(utk['race']): for ag in set(utk['age']): try: intersection_ids = list(utk[np.logical_and(utk['gender'] == gg, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def select_unique_ids(self):\n miap = self.metadata\n miap_single = miap[miap.ImageID.isin(list(miap_single[miap_single == 1].index))]\n miap_ids = []\n for gp in set(miap_single['GenderPresentation']):\n for ap in set(miap_single['AgePresentation']):\n try:\n ...
[ "0.657865", "0.6044649", "0.58118415", "0.5711096", "0.5692973", "0.56706125", "0.55748194", "0.5559556", "0.5553851", "0.55025446", "0.54721105", "0.5435024", "0.54285127", "0.5404571", "0.5398473", "0.537695", "0.53533375", "0.5331522", "0.5286636", "0.52840805", "0.5269259...
0.572965
3
Return the total receptive field of this model as of frames.
def receptive_field(self): frames = 0 for f in self.pad: frames += f return 1 + 2 * frames
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def receptive_field(self):\n return self.LocalLayer_Torso.receptive_field()", "def total_rewards(self) -> float:\n return self.__total_rewards", "def fields(self):\n return (self._total + self._mean + self._variance\n + self._skew + self._kurtosis)", "def patrimony_total(self)...
[ "0.6807186", "0.6247257", "0.6151634", "0.6062826", "0.60195196", "0.60095304", "0.6005246", "0.5999161", "0.5976631", "0.5976631", "0.5976631", "0.5976631", "0.5954339", "0.5918959", "0.590753", "0.589701", "0.5859162", "0.5844734", "0.5844734", "0.5828635", "0.5827173", "...
0.70493305
0
Return the total receptive field of this model as of frames.
def receptive_field(self): return self.LocalLayer_Torso.receptive_field()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def receptive_field(self):\n frames = 0\n for f in self.pad:\n frames += f\n return 1 + 2 * frames", "def receptive_field(self):\n frames = 0\n for f in self.pad:\n frames += f\n return 1 + 2 * frames", "def total_rewards(self) -> float:\n retu...
[ "0.70506257", "0.70506257", "0.6246167", "0.6150003", "0.60605", "0.6018066", "0.60072565", "0.60025686", "0.5996756", "0.5975303", "0.5975303", "0.5975303", "0.5975303", "0.5954303", "0.5917253", "0.59065473", "0.5893803", "0.58588445", "0.58437896", "0.58437896", "0.5827709...
0.68084574
2
Simple PING call, that echoes back the client's supplied timestamp.
def render_GET(self, request): timestamp = int(self.url_matches["timestamp"]) if request.api_mode == "prod": mode_string = "I'm production baby!" elif request.api_mode == "test": mode_string = "I'm in testing mode. :(" else: mode_string = "I ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ping():\n return ping_response()", "def ping():\n return ping_response()", "def ping():\n return ping_response()", "def ping():\n return ping_response()", "def ping(self):\n self._write(f'PING :{self.server.name}')\n self.awaiting_pong_since = datetime.datetime.now()", "asyn...
[ "0.68646365", "0.68646365", "0.68646365", "0.68646365", "0.6579023", "0.65237105", "0.65003955", "0.64113927", "0.63808227", "0.63411444", "0.63398105", "0.6294198", "0.6286214", "0.6271113", "0.6263955", "0.6251244", "0.62488353", "0.62443316", "0.6235482", "0.6234673", "0.6...
0.0
-1
Calculate the latency of querying example.com.
def render_POST(self, request): # Make sure simple_auth_key is a good key auth_key = request.args["simple_auth_key"][0] if auth_key != "abc": defer.returnValue(str(webapi.ValueError(request, "simple_auth_key", ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dns_latency(self, run_test):\n\n if not run_test:\n return\n\n dig_res = None\n\n target = '8.8.8.8'\n\n if 'target' in self.nma.conf['dns_latency'].keys():\n target = self.nma.conf['dns_latency']['target']\n\n dig_delays = []\n\n for site in self...
[ "0.7273307", "0.63495713", "0.63298446", "0.63092506", "0.6148087", "0.6052674", "0.6040095", "0.5920751", "0.5845061", "0.57926095", "0.5789145", "0.57851326", "0.5769384", "0.5759835", "0.57364786", "0.56917214", "0.56735647", "0.56312096", "0.562476", "0.56229883", "0.5543...
0.0
-1
Process statements until EOF.
def stmts(obj, next, token): while token is not EOF: token = assignlist(obj, next, token)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def statements(self):\n\n while self.token.value not in ('EOF', 'else', 'end'):\n\n with self.resync('\\n', consume=True):\n self.statement()\n\n if not self.match(Tokens.SYMBOL, \";\"):\n self.error(\"expected ';' after statement \", token=self.pr...
[ "0.7390939", "0.5967781", "0.59650815", "0.5910843", "0.5889116", "0.578851", "0.57429326", "0.57251817", "0.571596", "0.56643295", "0.56643295", "0.56643295", "0.56643295", "0.56306165", "0.56264794", "0.56229174", "0.56229174", "0.56229174", "0.5609148", "0.5588672", "0.555...
0.4907568
85
Load configuration data from C{data}.
def loads(data, handler=None): if not isinstance(data, six.text_type): data = six.text_type(data, 'utf-8') return _parse(data, handler)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_data_conf(self):\n data_file = select_file(os.getcwd())\n if data_file is not None:\n self.load_tab(data_file)\n else:\n msg_window('please select valid data config file')", "def load_data_from_config(self):\n\n config_file_name = \"cicada/config/config....
[ "0.72775424", "0.72322017", "0.7209485", "0.70869064", "0.6919826", "0.6901744", "0.68811077", "0.68799865", "0.6804882", "0.67453265", "0.6714074", "0.6681962", "0.65768546", "0.65461123", "0.6525652", "0.6473075", "0.6454654", "0.64352465", "0.6419525", "0.6408635", "0.6405...
0.0
-1
Dump configuration data to a string.
def dumps(data): def _dump(d, indent=0): for key, value in six.iteritems(d): if isinstance(value, dict): yield '%s%s {\n' % (' ' * indent, _escape(key)) for subs in _dump(value, indent + 2): yield subs yield '%s}\n' % (' ' * ind...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __repr__(self) -> str:\n dump_conf = copy.deepcopy(self)\n string = \"\"\n for k in dump_conf:\n v = dump_conf[k]\n if k == \"wpscan_args\":\n v = safe_log_wpscan_args(v)\n if k == \"smtp_pass\" and v != \"\":\n v = \"***\"\n ...
[ "0.716797", "0.713481", "0.6982773", "0.68829584", "0.6849994", "0.6790923", "0.6714286", "0.66820794", "0.66566515", "0.6614549", "0.65312123", "0.6504693", "0.64830256", "0.6414965", "0.6405884", "0.63866013", "0.635405", "0.6308627", "0.6268919", "0.62557393", "0.62393856"...
0.0
-1
Function reads data from location.list file
def get_film_locations(input_year): film_set = set() with open('data/locations.csv', 'r', encoding="utf-8", errors='ignore') as file: line = file.readline() while line: if line.split(',')[1] == input_year and line.split(',')[1] != 'NO DATA': film_set.add(tuple([line.s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_locations():\n r = open(\"resources/files/locations.txt\", \"r\", newline=\"\\n\")\n locations = r.read().split(\"\\n\")\n return locations", "def readLocations():\n locationsRead = []\n\n # Parallel reading from address_file and locations_file\n with open(\"Files/PublicPla...
[ "0.7098393", "0.7052096", "0.67944455", "0.65540445", "0.6394091", "0.61818755", "0.6181858", "0.6131238", "0.61064076", "0.60512066", "0.5995422", "0.5962476", "0.5948266", "0.5945209", "0.5937337", "0.5930992", "0.5921926", "0.59174085", "0.5854811", "0.58521825", "0.584481...
0.0
-1
Function to get coordinates of given films
def get_location_coordinates(films_set, film_number=0): if not film_number: film_number = len(films_set) films_list = sorted(list(films_set)) print(f'List has {len(films_list)} films with specified year. ' f'\nAmount of films to analyze: {film_number} ' f'\n---------------------...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_film_coordinates(film_dict):\n coordinate_dict = dict()\n for location in film_dict.keys():\n try:\n locator = geopy.Nominatim(user_agent=\"filmGeocoder\", timeout=10)\n coordinates = locator.geocode(location)\n\n coordinate_dict[coordinates.latitude, coordinat...
[ "0.6283534", "0.59644246", "0.58434176", "0.5780984", "0.55411386", "0.55378103", "0.55216914", "0.5519904", "0.55140954", "0.5485288", "0.5386026", "0.53777754", "0.53692013", "0.5347572", "0.53261596", "0.5300548", "0.5293786", "0.5275657", "0.52662235", "0.5232054", "0.522...
0.663994
0
Function finds the nearest films near user specified location
def get_nearest_films(films_list, number, input_location): output_list = [] for film_data in films_list: film_dist = int(distance.distance(film_data[1], input_location).km) film_data.append(film_dist) output_list.append(film_data) output_list.sort(key=lambda x: x[-1]) if ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_nearest_films_filming_from_file(path, user_coordinates):\n data = pandas.read_csv(path, sep=';\\t', engine='python')\n locations, films = data['location'], data['films']\n lat, long = data['latitude'], data['longitude']\n\n distance_list = []\n for location, x, y, film in zip(locations, lat,...
[ "0.734112", "0.6164199", "0.60423326", "0.5946243", "0.59105843", "0.57418096", "0.5691708", "0.5665888", "0.5598716", "0.5578369", "0.5567686", "0.5564117", "0.5545929", "0.5539266", "0.55250674", "0.55057204", "0.5500532", "0.54814434", "0.54331714", "0.5421165", "0.5420543...
0.7052365
1
Function generates html file with map
def get_html_file(films_list, input_location): geo_map = folium.Map( location=[48.8589507, 2.2770201], zoom_start=5, tiles='OpenStreetMap' ) for each in films_list: folium.Marker(each[1], popup=f'<i>{each[0]}</i>', tooltip=str(each[2]) + 'km. to user loc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_maps():\n return render_template(\"maps.html\")", "def html_page():\n return render_template('Map_twitter.html')", "def map():\n return render_template('map.html')", "def map():\n\n return render_template(\"map.html\")", "def map_page():\n m = Map() # Create map html\n return re...
[ "0.74449867", "0.7157785", "0.7121677", "0.70885533", "0.70139784", "0.70069844", "0.6663116", "0.6619496", "0.6604096", "0.6565408", "0.654036", "0.64862925", "0.6464023", "0.63523424", "0.6348217", "0.63276356", "0.6314585", "0.6313347", "0.6307724", "0.627087", "0.62367344...
0.71193475
3
Write the value by returning it, instead of storing in a buffer.
def write(self, value): return value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write(value):\n return value", "def write(self, value: int, /) -> None:", "def write_value(self, value):\n raise NotImplementedError", "def write(self, value):\r\n self.__output__.write(value)", "def write(self, field_name, value):\n field = self.mem_map.get_field(field_name)\n ...
[ "0.86511874", "0.73515034", "0.7332207", "0.7121068", "0.6562132", "0.6490733", "0.64764076", "0.6411641", "0.6403048", "0.63422793", "0.63299817", "0.62132967", "0.61852413", "0.61708844", "0.6144003", "0.6127387", "0.607164", "0.60475796", "0.6041398", "0.60228544", "0.6002...
0.8366461
2
This function is to check if a given permutation is identity permuatation or may be not
def ifidentity(x): for idx,val in enumerate(x): if idx+ 1 != val: return False return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def permutation_is_valid(permutation):\n pass", "def is_permutation(A, B):\n return set(A) == set(B)", "def validate_permutation(p):\n if not isinstance(p, list):\n raise ValueError(\"A permutation should be a list of integers\")\n\n for i in p:\n if not isinstance(i, int):\n ...
[ "0.77272666", "0.6628062", "0.65925276", "0.65854067", "0.6547743", "0.64786804", "0.6461117", "0.637291", "0.63406706", "0.6262176", "0.62024885", "0.6191193", "0.6160014", "0.60675293", "0.6036495", "0.5889198", "0.5884222", "0.58837324", "0.5874602", "0.5816839", "0.581347...
0.5540529
34
This function is to create a new permutation from two given permutations also circle of two permutations
def circlfunc(a,b): c = [] for i in range(0,len(a)): c.append(a[b[i]-1]) return c
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def combine_permutations(p1, p2):\n p = tuple(map(p2.__getitem__, p1))\n return p", "def new_permutation(V,m,adj):\r\n\r\n global tent\r\n\r\n perm = V.copy()\r\n \r\n \"\"\" try to select two vertices to swipe wisely. \"\"\"\r\n \r\n #we select 1 vertex among the m first vertices\r\n ...
[ "0.6944243", "0.6762079", "0.6389804", "0.631503", "0.6271421", "0.62315035", "0.6216318", "0.62028956", "0.61455333", "0.61279106", "0.61136264", "0.61104304", "0.61055213", "0.60343754", "0.60343754", "0.600384", "0.5984147", "0.59706295", "0.5946293", "0.59251595", "0.5923...
0.0
-1
This function is to find the order of a given permutation i.e no of times a permutation is multiplied to form identity permuatation
def order(a): order = 2 circ = circlfunc(a,a) while True: if ifidentity(circ): return order else: circ= circlfunc(a,circ) order = order+1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def number_of_permutations(self) -> int:\n perms = math.factorial(len(self._word))\n for v in self._char_counts.values():\n if v > 1:\n perms /= math.factorial(v)\n return perms", "def permutations(k: int) -> int:\n return factorial(k)", "def compute_order(h: l...
[ "0.645377", "0.6389784", "0.63876116", "0.63816816", "0.63555217", "0.63489735", "0.6329525", "0.63098377", "0.6245761", "0.615328", "0.6134167", "0.61255354", "0.6100108", "0.6096791", "0.60842", "0.60609406", "0.6059094", "0.60263896", "0.60253245", "0.6023291", "0.6014294"...
0.5583971
64
This function is to denote a given permutation as circular notation Takes the input permuatation as an array and returns the circular notation as list of tuples
def circnot(a): circnot= [] length=0 z = [1] circle=True i=0 while circle: if a[i] not in z: z.append(a[i]) i=a[i]-1 else : circle=False newlength = len(z) #print("(%s)"%(z[length:newlength])) circnot.append(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def permute(seq, permutation):\n return [seq[i] for i in permutation]", "def cycles(p: List[int]) -> List[Set[int]]:\n validate_permutation(p)\n\n todo = list(range(len(p)))\n cycles = []\n\n while todo:\n start = todo.pop(0)\n\n cycle = (start,)\n position = p[start]\n\n ...
[ "0.6715888", "0.65744966", "0.6511044", "0.64874107", "0.64468795", "0.6301763", "0.61607623", "0.6097101", "0.6089789", "0.607783", "0.6032486", "0.601613", "0.6013413", "0.5980531", "0.59732676", "0.5966468", "0.59390336", "0.5900821", "0.5874906", "0.5829848", "0.5821117",...
0.5459212
67
When you just need it in large, this is the command for you.
async def aesthetic(self, ctx, *, text): out = "" for char in text: out += utils.fullwidth_transform.get(char, char) await ctx.send(out)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cmd_size(args):", "def cli(ctx):\n #TODO", "def cli(ctx):", "def cli(ctx):", "def cmd(self):", "def faster(self):\n self.run_command('faster')", "def memory_limit_script_command():\n command = 'random_string() { ' \\\n ' base64 /dev/urandom | tr -d \\'/+\\' | dd bs=10...
[ "0.634437", "0.6058963", "0.5847017", "0.5847017", "0.57640475", "0.57111555", "0.5711072", "0.56858486", "0.5504347", "0.5504347", "0.54706365", "0.54172194", "0.540516", "0.5320148", "0.5320148", "0.5301359", "0.5301359", "0.5301359", "0.5233623", "0.5194515", "0.5181166", ...
0.0
-1
Returns a random cat picture. Sourced from The Cap API.
async def catpic(self, ctx): data = await self.bot.session.get_cat_pic() file = discord.File(data["img_data"], filename=data["filename"]) await ctx.send(file=file)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def cat(self, ctx):\n async with ctx.session.get('https://api.thecatapi.com/v1/images/search') as resp:\n if resp.status != 200:\n return await ctx.send('No cat found :(')\n js = await resp.json()\n await ctx.send(embed=discord.Embed(title='Random Cat')....
[ "0.74378043", "0.72652745", "0.6868935", "0.6853779", "0.6784023", "0.6727937", "0.67003447", "0.66919136", "0.6684451", "0.66626847", "0.660977", "0.65963507", "0.6562244", "0.64708894", "0.63236225", "0.62991655", "0.6273446", "0.6270777", "0.62048495", "0.6090596", "0.6056...
0.6519804
13
If East is in the same guild, Talos will ask them a favor... Otherwise, Talos isn't doing it
async def favor(self, ctx): east = ctx.guild.get_member(339119069066297355) if not east or east.status != discord.Status.online: await ctx.send(f"I'm afraid I can't do that, {ctx.author.display_name}.") return await ctx.send("&East, could I ask you for a favor? I need som...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def omartrifacta(self, ctx):\n user_member1 = await ctx.guild.fetch_member(\"142084729674399745\")\n user_member2 = await ctx.guild.fetch_member(\"197784087476305921\")\n user_member3 = await ctx.guild.fetch_member(\"219969018369409024\")\n if user_member1 is not None and user_mem...
[ "0.59104276", "0.5812901", "0.5811559", "0.57705164", "0.568164", "0.56639165", "0.5625076", "0.55851394", "0.5549394", "0.5538837", "0.54885685", "0.5444899", "0.54436094", "0.5433115", "0.5410844", "0.54084325", "0.53876704", "0.5387098", "0.53671765", "0.5336776", "0.53303...
0.7293132
0
Talos is friendly, and love to say hello. Some rare people may invoke special responses.
async def hi(self, ctx, *, extra=""): if str(ctx.author) == "East#4048" and extra.startswith("there..."): async with ctx.typing(): await asyncio.sleep(1) await ctx.send("Hello East.") await asyncio.sleep(1) async with ctx.typing(): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def wherearemypants():\n await bot.say('justin is a known pants thief. Not saying he took them but he totally probably took them')", "async def _8ball(self, ctx):\n\n # Define possible responses\n responses = ['It is certain',\n 'It is decidedly so',\n ...
[ "0.6790971", "0.67803055", "0.67130864", "0.6670621", "0.6665805", "0.6524476", "0.6429152", "0.641713", "0.6377516", "0.6370798", "0.63114256", "0.6310131", "0.63077825", "0.629508", "0.629508", "0.62648845", "0.6249591", "0.6238656", "0.62298137", "0.6219736", "0.6216933", ...
0.65074605
6
Gets an XKCD comic with the given number, or the current one if one isn't specified, and displays it.
async def xkcd(self, ctx, comic: int = 0): if comic < 0: await ctx.send("Requested XKCD can't be negative") return data = await self.bot.session.get_xkcd(comic or None) if data is None: await ctx.send(f"No comic for ID `{comic}` found") return ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def get_xkcd(self, ctx, number = \"random\"):\n if not self.module_check(ctx): return\n if number == \"latest\":\n r = requests.get('https://xkcd.com/info.0.json')\n elif number == \"random\":\n r = requests.get('https://xkcd.com/info.0.json')\n r = json.loads(r.text)\n random_xk...
[ "0.68028086", "0.61957276", "0.59368753", "0.5861915", "0.56918675", "0.55075777", "0.53484565", "0.5283768", "0.52726424", "0.51808345", "0.51591676", "0.50742537", "0.50456804", "0.50456804", "0.5033829", "0.5017756", "0.5013748", "0.50132114", "0.49857825", "0.49768993", "...
0.64772284
1
Picks between a couple random message options and posts it. Here because wundr bugged me till I added it
async def roulette(self, ctx): choices = ["This is the end of the world", "And I don't know what to put here"] await ctx.send(random.choice(choices))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def choose(self, ctx: Message, *, message):\n\t\tawait self.send(random.choice(message.replace(\", \", \",\").split(\",\")))", "async def watdo(self, ctx, *args):\n choicelist = []\n for choice in args:\n choicelist.append(choice)\n result = random.choice(choicelist)\n ...
[ "0.6664755", "0.6625814", "0.65506977", "0.6500225", "0.62315995", "0.622285", "0.62065464", "0.6189002", "0.61874545", "0.5998838", "0.59963137", "0.5976436", "0.5970779", "0.5970185", "0.5950523", "0.59486395", "0.5933591", "0.59271836", "0.5926964", "0.59241396", "0.590532...
0.58839965
21
Sets up the JokeCommands extension. Adds the JokeCommands cog to the bot
def setup(bot): bot.add_cog(JokeCommands(bot))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup(bot):\n new_cog = Commands(bot)\n bot.add_cog(new_cog)", "def setup(bot):\n bot.logger.debug(\n 'Registering extension \"Quiz\"'\n )\n bot.add_cog(QuizCog(bot))", "def setup(bot):\n bot.add_cog(AdminCommands(bot))", "def setup(bot):\n @bot.event\n async def on_command...
[ "0.69343936", "0.68088084", "0.66989225", "0.65883654", "0.65673536", "0.65430915", "0.65312517", "0.64955974", "0.64893925", "0.6323563", "0.63162094", "0.6146145", "0.6126287", "0.6121231", "0.6090291", "0.60819864", "0.60638237", "0.60156745", "0.5999061", "0.59527", "0.59...
0.7969974
0
Additional tests to run in the class (the default is nothing)
def _run_local_tests(self, *args, **kwargs): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def runTests(self):\n \n pass", "def spec_tests():\n pass", "def tests():", "def before_run_tests(cls):\n pass", "def run_tests(self):\n raise NotImplementedError", "def _test(self):\n pass", "def _test(self):\n pass", "def _test(self):\n pass", "def ...
[ "0.77671015", "0.77590895", "0.77417624", "0.77082187", "0.76017296", "0.7552883", "0.7552883", "0.7552883", "0.7391758", "0.7339972", "0.7320626", "0.72582245", "0.7214679", "0.72127545", "0.72046536", "0.72046536", "0.72046536", "0.72046536", "0.72046536", "0.7185589", "0.7...
0.0
-1
A method to get interpolated weight spectrumn for a given spw and row id Should be implemented in child class
def _get_interpolated_wtsp(self, *args, **kwargs): raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_weight_row(self, i):\n return self.weights[i]", "def get_spec_weight(self, i, j):\n return self.weights[i][j]", "def update_weight(wij, yj, tj, xi, lr = 0.25):\n\n new_wij = wij - lr * ((yj - tj) * xi)\n new_wij = round(new_wij, 3)\n #print(\"\\t\", wij, \"-\", lr, \"* (\", yj, \...
[ "0.6086211", "0.54288447", "0.5354366", "0.534022", "0.5280534", "0.52703285", "0.52215284", "0.5198095", "0.5197607", "0.5134318", "0.51240146", "0.5096904", "0.50929785", "0.5077011", "0.50710326", "0.501282", "0.49915385", "0.49869552", "0.49808988", "0.49808666", "0.49461...
0.6111145
0
Tests the existance of a file/directory
def _check_file(self, name): self.assertTrue(os.path.exists(name), "Could not find table %s." % name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def file_exist() -> bool:\n pass", "def test_exists(self):\n self.assertTrue(os.path.exists(__file__) == self._system.exists(__file__))", "def exists(self, path):", "def test_ensure_dir_exists(self):\n pass", "def is_file_exists(self):\n pass", "def check_file_exist(self):\n ...
[ "0.78073734", "0.7764341", "0.760513", "0.7560839", "0.7549434", "0.7472514", "0.74553573", "0.7419269", "0.74010074", "0.73742783", "0.73015934", "0.72618705", "0.72407454", "0.72354734", "0.72136164", "0.7187139", "0.7183444", "0.71833634", "0.71738803", "0.71597284", "0.71...
0.0
-1
Returns True if the column exists in the table
def _column_exists(self, tbname, colname): self._check_file(tbname) tb = tbtool() tb.open(tbname) cols = tb.colnames() tb.close() return (colname in cols)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def column_exists(self, column_name):\n return column_name in self.columns", "def tableHasColumn(self, schema, table, column):\r\n res = self.fetchSqlRecords(\r\n \"select count(*) from information_schema.columns c where c.table_schema = '{}' and c.table_name='{}' and c.column_name='{}'\...
[ "0.83644086", "0.8292885", "0.82175887", "0.81018114", "0.81018114", "0.8073049", "0.8035705", "0.7999258", "0.78273046", "0.7082933", "0.70003563", "0.6905545", "0.68490213", "0.6835957", "0.6805615", "0.6759569", "0.67382336", "0.6727789", "0.6726648", "0.6660846", "0.66534...
0.833071
1
Generates a polynomial array of length nchan. The polynomial coefficients should be given in ascending order, i.e., when coeff = [1.0, 2.0, 3.0] elements of the return array will be polyarr[ichan] = 1.0 + 2.0ichan + 3.0ichan2 (ichan=0~nchan1)
def _generate_poly_array(self, nchan, coeff=[]): if nchan < 0: raise ValueError, "nchan should be >=0" if len(coeff)==0: if nchan ==0: return [] else: raise ValueError, "No valid coefficient given." polyarr = numpy.zeros(nchan) for iorder in range(len(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_ploynomial_array(self, coeff, x):\n xarr = numpy.array(x)\n yarr = numpy.zeros(len(xarr))\n for idim in range(len(coeff)):\n ai = coeff[idim]\n yarr += ai*xarr**idim\n return yarr", "def generate_polynomial():\n degree = numpy.random.choice(range(3...
[ "0.68056685", "0.6573853", "0.6233045", "0.6194051", "0.6190378", "0.6133814", "0.61265975", "0.60940784", "0.6003684", "0.59296507", "0.5928541", "0.59085226", "0.5857575", "0.5854614", "0.5853316", "0.58489704", "0.584802", "0.5847538", "0.5844446", "0.58300024", "0.579835"...
0.9005255
0
Compares two arrays and returns True if they are within a tolerance. checks shapes
def _compare_arrays(self, data, reference, atol=1.e-5, rtol=1.e-5): if not (data.shape==reference.shape): return False ret=numpy.allclose(data,reference, atol=atol, rtol=rtol) return ret
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def array_equal(a, b, unit_tol=1e-4, total_tol=1e-4, with_sign=True):\n\n a = to_nparray(a)\n b = to_nparray(b)\n\n if len(a) == 0 and len(b) == 0:\n return True\n\n if not with_sign:\n a, b = np.abs(a), np.abs(b)\n res = (np.sum(np.abs(a - b) > unit_tol)) / a.size < total_tol\n ret...
[ "0.7049362", "0.6753018", "0.6666613", "0.6650952", "0.66391", "0.65610904", "0.6543794", "0.65330875", "0.641461", "0.63840634", "0.63636976", "0.63067174", "0.6305565", "0.62804353", "0.627131", "0.6226086", "0.62086785", "0.620447", "0.6167091", "0.6160811", "0.61569476", ...
0.7189442
0
Convert interpolation string to a list of interpolations in time (should be defined) and frequency (default is 'linear') E.g. 'linear,cspline' > ['linear', 'cpline'] 'nearest' > ['nearest', 'linear' (using the default)]
def interpolation_to_list(self, interpolation): interplist = interpolation.split(',') if len(interplist) == 0: interplist = ['linear', 'linear'] elif len(interplist) == 1: interplist += ['linear'] return interplist[0:2]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def interpolateCubicPeriodic() :\n\n S = []\n\n # for all parameters\n for i in range(11):\n y = []\n # get i-th parameter\n for k in range(len(keyframe)):\n y.append(keyframe[k][i])\n\n interpolants = interpolatePeriodicSpline(keytime, y)\n S.append(interpola...
[ "0.56173795", "0.5576247", "0.55391693", "0.53756726", "0.5346058", "0.50850666", "0.5063842", "0.5045507", "0.49662524", "0.49306107", "0.49246454", "0.49028924", "0.48939764", "0.48712966", "0.48580346", "0.4848678", "0.48370945", "0.48291197", "0.4823621", "0.48156068", "0...
0.74464566
0
Common function to run initweights and test results
def _runTest(self, wtmode, dowtsp, testspw, interpolation="", spwmap=[], atol=1.e-5, rtol=1.e-5): had_wtsp = self._column_exists(self.inputms, "WEIGHT_SPECTRUM") had_sigsp = self._column_exists(self.inputms, "SIGMA_SPECTRUM") initweights(vis=self.inputms,wtmode=wtmode, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_weights(self):\n # Initialize weights\n self.apply(self._init_weights)\n # Tie weights if needed\n self.tie_weights()", "def init_weights(model):\n ...", "def _initialize_weights(self):\n pass", "def init_weights(self):\n # Initialize weights\n ...
[ "0.685703", "0.68274564", "0.67904377", "0.67538697", "0.6717452", "0.65370107", "0.65317935", "0.65030354", "0.6501147", "0.64833224", "0.6458544", "0.6439749", "0.6382342", "0.6381869", "0.63613254", "0.6350999", "0.63366544", "0.63327694", "0.6320623", "0.6305251", "0.6304...
0.0
-1
Array comparison. Duplicate reference for pol if necessary, i.e., If cell.shape==reference.shape, this method compares cell and reference directly if cell.shape!=reference.shape (e.g., cell.shape=[npol, nchan] while reference.shape=[nchan]),
def _testCell(self, cell, reference, atol=1.e-5, rtol=1.e-5): cellarr = numpy.array(cell) refarr = numpy.array(reference) if cellarr.ndim != refarr.ndim: # pol loop for ipol in range(cellarr.shape[0]): testarr = cellarr[ipol] self._testCell...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _compare_arrays(self, data, reference, atol=1.e-5, rtol=1.e-5):\n if not (data.shape==reference.shape): return False\n ret=numpy.allclose(data,reference, atol=atol, rtol=rtol)\n return ret", "def test_reference_to_array(self):\n arr = numpy.arange(0.0, 10.0, 0.1)\n arr = n...
[ "0.65500224", "0.5869078", "0.5757813", "0.53636265", "0.5318079", "0.530859", "0.52684", "0.52240014", "0.5221366", "0.5194449", "0.51814866", "0.51687014", "0.5168295", "0.51641154", "0.515756", "0.51557255", "0.5147352", "0.5133151", "0.51277983", "0.5117408", "0.5087433",...
0.6374898
1
returns an array of 1./in_arr^2 This corresponds to WEIGHT_SPECTRUM by 1./Tsys^2 in case input is Tsys spectrum
def tsysweightsp_from_tsysarr(self, in_arr): return 1./(numpy.array(in_arr)**2)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def weight_from_meantsys(self, in_arr):\n return 1./(numpy.mean(in_arr)**2)", "def comp_output_spectra(self):\n assert(hasattr(self,'r'))\n \n self.nx=int(self.nx)\n \n r_mat=self.r.T.reshape(self.nx,self.nx,self.N)\n\n in_allfreqs = np.fft.fftshift(np.fft.fftfreq(self.nx,d=self.L/self.n...
[ "0.62197316", "0.5731945", "0.561864", "0.55723643", "0.5519251", "0.54838157", "0.5463326", "0.5450829", "0.5421233", "0.5408736", "0.53334206", "0.5332715", "0.52982306", "0.528176", "0.5272986", "0.5269713", "0.5269713", "0.52356917", "0.52283984", "0.5218861", "0.5218008"...
0.65089893
0
returns 1./mean(in_arr)^2 This corresponds to WEIGHT by 1./Tsys^2 in case WEIGH_SPECTRUM does not exists.
def weight_from_meantsys(self, in_arr): return 1./(numpy.mean(in_arr)**2)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tsysweightsp_from_tsysarr(self, in_arr):\n return 1./(numpy.array(in_arr)**2)", "def normalizing_constant(self):\n\t\tdim = self.train_data.shape[1]\n\t\treturn 1 / (2 * np.pi * ((self.bandwidth) ** 2)) ** (dim / 2)", "def wo_mean(arr):\n\n return np.array(arr) - np.mean(arr, axis=0)", "def sig...
[ "0.62368584", "0.5754579", "0.57493305", "0.5643843", "0.56121606", "0.56033355", "0.55805826", "0.5527867", "0.55130255", "0.54666394", "0.54532003", "0.54035026", "0.5393957", "0.53300005", "0.5329847", "0.5320016", "0.53127503", "0.52882606", "0.52683395", "0.52547145", "0...
0.7573409
0
returns median of input array
def weight_from_weightsp(self, in_arr, takeEvenMean=False): return self._median(numpy.array(in_arr), takeEvenMean)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def median(array):\n sorted = [x for x in array]\n sorted.sort()\n middle = len(sorted)/2 #Gets the middle element, if present\n if len(sorted) % 2 == 0: #Even, so need to average together the middle two values\n return float((sorted[middle]+sorted[middle-1]))/2\n else:\n return sorted...
[ "0.8258266", "0.8074363", "0.8006023", "0.80019444", "0.79261017", "0.79195154", "0.7886605", "0.7858238", "0.7829565", "0.7820183", "0.7813478", "0.781215", "0.77871627", "0.7780038", "0.7700533", "0.76993525", "0.7697707", "0.76791984", "0.76580197", "0.7639795", "0.7590380...
0.0
-1
returns a value, 1./sqrt(median(in_array))
def sigma_from_weightsp(self, in_arr, takeEvenMean=False): sigsp = self.sigmasp_from_weightsp(in_arr) return self._median(numpy.array(sigsp), takeEvenMean)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _median(self, in_arr, takeEvenMean):\n if takeEvenMean:\n return numpy.median(in_arr)\n else:\n return numpy.sort(in_arr, axis=None)[(in_arr.size-1)/2]", "def get_median(numlist):\n return np.median(numlist)", "def median(array):\n sorted = [x for x in array]\n ...
[ "0.7936403", "0.7877757", "0.7766255", "0.7706833", "0.7559406", "0.7556805", "0.7545578", "0.75453913", "0.7456753", "0.743678", "0.74096215", "0.7387109", "0.7345126", "0.73166513", "0.7312413", "0.72878706", "0.72827375", "0.72534126", "0.7239744", "0.7231068", "0.72196823...
0.0
-1
returns an array of 1./sqrt(in_array)
def sigmasp_from_weightsp(self, in_arr): return 1./numpy.sqrt(numpy.array(in_arr))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normalise(array,tot=1.0):\r\n tot1 = np.sum(np.abs(array)**2)\r\n if tot1 == 0.0 :\r\n print 'bg.normalise : warning sum array = 0'\r\n arrayout = np.copy(array)\r\n else :\r\n arrayout = array * np.sqrt(tot / tot1)\r\n return arrayout", "def arr_1(A):\n copy = np.copy(A)\...
[ "0.6914975", "0.68743366", "0.656538", "0.65401554", "0.6392298", "0.6377405", "0.6358696", "0.6328434", "0.6322611", "0.6252549", "0.624593", "0.6209224", "0.61933243", "0.61530006", "0.60863847", "0.6081735", "0.6073869", "0.6057589", "0.603018", "0.5988393", "0.597821", ...
0.5430096
82
Returns a median value of an array. if takeEvenMean, middle two values are average if the number of elements in in_array is even. if not sort in_array in ascending order and returns an (n1)/2th element.
def _median(self, in_arr, takeEvenMean): if takeEvenMean: return numpy.median(in_arr) else: return numpy.sort(in_arr, axis=None)[(in_arr.size-1)/2]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def median(array):\n sorted = [x for x in array]\n sorted.sort()\n middle = len(sorted)/2 #Gets the middle element, if present\n if len(sorted) % 2 == 0: #Even, so need to average together the middle two values\n return float((sorted[middle]+sorted[middle-1]))/2\n else:\n return sorted...
[ "0.8438568", "0.78152245", "0.7581761", "0.7321425", "0.72606057", "0.7259399", "0.71910405", "0.71609664", "0.7081089", "0.70748556", "0.70470303", "0.7038986", "0.701688", "0.6998141", "0.69936776", "0.69832367", "0.6974105", "0.6971682", "0.6944141", "0.69430286", "0.69371...
0.8658704
0
Test wtmode='tsys', interp='nearest,nearest', dowtsp=True
def testTsysNNSp(self): self._runTest('tsys', True, self.tsys_funcs.keys(), 'nearest,nearest')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testTinttsysNNSp(self):\n self._runTest('tinttsys', True, self.tsys_funcs.keys(), 'nearest,nearest')", "def testTinttsysLCSp(self):\n self._runTest('tinttsys', True, self.tsys_funcs.keys(), 'nearest,nearest')", "def testTinttsysLLSp(self):\n self._runTest('tinttsys', True, self.tsys_fu...
[ "0.69159997", "0.6296606", "0.6176141", "0.6069002", "0.5954954", "0.5914424", "0.58652925", "0.57686806", "0.5644779", "0.5482096", "0.5315107", "0.5299039", "0.52878356", "0.5247621", "0.5207398", "0.5188795", "0.5156379", "0.5139908", "0.51383054", "0.5126579", "0.51224476...
0.6856138
1
Test wtmode='tsys', interp='linear,linear', dowtsp=True
def testTsysLLSp(self): self._runTest('tsys', True, self.tsys_funcs.keys(), 'linear,linear')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testTinttsysNNSp(self):\n self._runTest('tinttsys', True, self.tsys_funcs.keys(), 'nearest,nearest')", "def testTsysNNSp(self):\n self._runTest('tsys', True, self.tsys_funcs.keys(), 'nearest,nearest')", "def testTinttsysLCSp(self):\n self._runTest('tinttsys', True, self.tsys_funcs.keys...
[ "0.6654495", "0.6596276", "0.6409523", "0.6304734", "0.5774943", "0.5751216", "0.57269305", "0.56322616", "0.5600705", "0.55646116", "0.5527549", "0.54115576", "0.53658104", "0.5338085", "0.5332488", "0.53244245", "0.53188163", "0.53172386", "0.5285957", "0.525401", "0.524319...
0.5993074
4
Test wtmode='tsys', interp='linear,cspline', dowtsp=True
def testTsysLCSp(self): self._runTest('tsys', True, self.tsys_funcs.keys(), 'linear,cspline')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testTinttsysNNSp(self):\n self._runTest('tinttsys', True, self.tsys_funcs.keys(), 'nearest,nearest')", "def testTinttsysLCSp(self):\n self._runTest('tinttsys', True, self.tsys_funcs.keys(), 'nearest,nearest')", "def testTsysNNSp(self):\n self._runTest('tsys', True, self.tsys_funcs.keys...
[ "0.65645564", "0.6482947", "0.6460771", "0.6243487", "0.59232026", "0.5793066", "0.57104397", "0.56807655", "0.5673307", "0.5667716", "0.56532365", "0.55566865", "0.5546549", "0.55308855", "0.547329", "0.5469171", "0.5457366", "0.54230565", "0.52702504", "0.52491003", "0.5248...
0.6121541
4
Test wtmode='tinttsys', interp='nearest,nearest', dowtsp=True
def testTinttsysNNSp(self): self._runTest('tinttsys', True, self.tsys_funcs.keys(), 'nearest,nearest')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testTsysNNSp(self):\n self._runTest('tsys', True, self.tsys_funcs.keys(), 'nearest,nearest')", "def testTinttsysLCSp(self):\n self._runTest('tinttsys', True, self.tsys_funcs.keys(), 'nearest,nearest')", "def testTinttsysLLSp(self):\n self._runTest('tinttsys', True, self.tsys_funcs.keys...
[ "0.64893264", "0.6471385", "0.63866085", "0.6262443", "0.6248298", "0.57996994", "0.5792964", "0.57056886", "0.56932837", "0.55488276", "0.5546918", "0.5420293", "0.5406579", "0.5366721", "0.5271492", "0.52703965", "0.5220601", "0.5171412", "0.5167025", "0.51180923", "0.51011...
0.7156723
0
Test wtmode='tinttsys', interp='linear,linear', dowtsp=True
def testTinttsysLLSp(self): self._runTest('tinttsys', True, self.tsys_funcs.keys(), 'nearest,nearest')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testTinttsysNNSp(self):\n self._runTest('tinttsys', True, self.tsys_funcs.keys(), 'nearest,nearest')", "def testTinttsysLCSp(self):\n self._runTest('tinttsys', True, self.tsys_funcs.keys(), 'nearest,nearest')", "def testTsysNNSp(self):\n self._runTest('tsys', True, self.tsys_funcs.keys...
[ "0.6980626", "0.6693806", "0.62043387", "0.60192597", "0.58798563", "0.5650189", "0.55982214", "0.5554843", "0.55424637", "0.5507396", "0.5479722", "0.5476681", "0.5447639", "0.5416016", "0.53863543", "0.5384502", "0.53844315", "0.5333801", "0.5270544", "0.526048", "0.5244168...
0.6614898
2
Test wtmode='tinttsys', interp='linear,cspline', dowtsp=True
def testTinttsysLCSp(self): self._runTest('tinttsys', True, self.tsys_funcs.keys(), 'nearest,nearest')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testTinttsysNNSp(self):\n self._runTest('tinttsys', True, self.tsys_funcs.keys(), 'nearest,nearest')", "def testTinttsysLLSp(self):\n self._runTest('tinttsys', True, self.tsys_funcs.keys(), 'nearest,nearest')", "def testTinttsysMapLCSp(self):\n self._runTest('tinttsys', True, [1,3,5,7,...
[ "0.6915214", "0.6593633", "0.6186842", "0.6147206", "0.6009761", "0.5953264", "0.5819722", "0.56637067", "0.56173426", "0.560701", "0.558406", "0.54812276", "0.5471691", "0.5468226", "0.5444616", "0.5434842", "0.5378455", "0.5334122", "0.528345", "0.51883113", "0.5174286", ...
0.6803435
1
Test spwmap wtmode='tsys', interp='nearest,nearest'
def testTsysMapNN(self): self._runTest('tsys', False, [1,3,5,7,9,15], 'nearest,nearest',self.spwmap)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testTinttsysMapNNSp(self):\n self._runTest('tinttsys', True, [1,3,5,7,9,15], 'nearest,nearest',self.spwmap)", "def testTsysMapNNSp(self):\n self._runTest('tsys', True, [1,3,5,7,9,15], 'nearest,nearest',self.spwmap)", "def testTinttsysMapNN(self):\n self._runTest('tinttsys', False, [1,3...
[ "0.7175221", "0.7104862", "0.6838983", "0.6826009", "0.65011334", "0.6244206", "0.62083185", "0.5912749", "0.5866245", "0.5767596", "0.57348174", "0.5700608", "0.55910224", "0.5579526", "0.55044204", "0.54781234", "0.5408092", "0.53849024", "0.53820324", "0.53264004", "0.5309...
0.6829687
3
Test spwmap wtmode='tsys', interp='linear,linear'
def testTsysMapLL(self): self._runTest('tsys', False, [1,3,5,7,9,11,15], 'linear,linear',self.spwmap)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testTinttsysMapNNSp(self):\n self._runTest('tinttsys', True, [1,3,5,7,9,15], 'nearest,nearest',self.spwmap)", "def testTsysMapNNSp(self):\n self._runTest('tsys', True, [1,3,5,7,9,15], 'nearest,nearest',self.spwmap)", "def testTinttsysMapLLSp(self):\n self._runTest('tinttsys', True, [1,...
[ "0.6925938", "0.68441355", "0.6605154", "0.65790987", "0.64607143", "0.6457185", "0.6412518", "0.63627815", "0.6361987", "0.6346467", "0.6218772", "0.6213542", "0.6126186", "0.6079863", "0.6057003", "0.58314514", "0.56169957", "0.5558796", "0.5483911", "0.5299567", "0.5262102...
0.59838104
15
Test spwmap wtmode='tsys', interp='linear,cspline'
def testTsysMapLC(self): self._runTest('tsys', False, [1,3,5,7,9,11,13,15], 'linear,cspline',self.spwmap)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testTinttsysMapLCSp(self):\n self._runTest('tinttsys', True, [1,3,5,7,9,11,13,15], 'linear,cspline',self.spwmap)", "def testTinttsysMapNNSp(self):\n self._runTest('tinttsys', True, [1,3,5,7,9,15], 'nearest,nearest',self.spwmap)", "def testTsysMapLCSp(self):\n self._runTest('tsys', True...
[ "0.69007564", "0.6614573", "0.65671456", "0.65161896", "0.6495516", "0.64346814", "0.62798", "0.6266301", "0.61922973", "0.61169386", "0.5982099", "0.5924205", "0.590214", "0.5781886", "0.57695866", "0.5689629", "0.5535863", "0.53609467", "0.5329657", "0.5306497", "0.530301",...
0.6355131
6
Test spwmap wtmode='tinttsys', interp='nearest,nearest'
def testTinttsysMapNN(self): self._runTest('tinttsys', False, [1,3,5,7,15], 'nearest,nearest',self.spwmap)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testTinttsysMapNNSp(self):\n self._runTest('tinttsys', True, [1,3,5,7,9,15], 'nearest,nearest',self.spwmap)", "def testTinttsysNNSp(self):\n self._runTest('tinttsys', True, self.tsys_funcs.keys(), 'nearest,nearest')", "def testTsysMapNNSp(self):\n self._runTest('tsys', True, [1,3,5,7,9...
[ "0.7464721", "0.694387", "0.6688153", "0.6513818", "0.6375435", "0.6351056", "0.62163407", "0.5984313", "0.59639287", "0.59157306", "0.582448", "0.56327325", "0.5543462", "0.54693025", "0.54282254", "0.540566", "0.53477836", "0.53318286", "0.5310574", "0.52897173", "0.5219775...
0.7247381
1
Test spwmap wtmode='tinttsys', interp='linear,linear'
def testTinttsysMapLL(self): self._runTest('tinttsys', False, [1,3,5,7,9,11,15], 'linear,linear',self.spwmap)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testTinttsysMapNNSp(self):\n self._runTest('tinttsys', True, [1,3,5,7,9,15], 'nearest,nearest',self.spwmap)", "def testTinttsysMapLLSp(self):\n self._runTest('tinttsys', True, [1,3,5,7,9,11,15], 'linear,linear',self.spwmap)", "def testTinttsysMapNN(self):\n self._runTest('tinttsys', Fa...
[ "0.72595763", "0.6970981", "0.6915674", "0.67402893", "0.66995513", "0.6693661", "0.65360683", "0.65018404", "0.63944566", "0.6118364", "0.59749365", "0.5850493", "0.5722043", "0.57058847", "0.5550838", "0.5491959", "0.54299575", "0.5397589", "0.52916384", "0.52209437", "0.52...
0.65710306
6
Test spwmap wtmode='tinttsys', interp='linear,cspline'
def testTinttsysMapLC(self): self._runTest('tinttsys', False, [1,3,5,7,9,11,13,15], 'linear,cspline',self.spwmap)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testTinttsysMapLCSp(self):\n self._runTest('tinttsys', True, [1,3,5,7,9,11,13,15], 'linear,cspline',self.spwmap)", "def testTinttsysMapNNSp(self):\n self._runTest('tinttsys', True, [1,3,5,7,9,15], 'nearest,nearest',self.spwmap)", "def testTinttsysMapLLSp(self):\n self._runTest('tinttsy...
[ "0.7193978", "0.68954045", "0.67678285", "0.645622", "0.64222103", "0.6354744", "0.63472885", "0.62745875", "0.6229267", "0.6142785", "0.61396414", "0.5909097", "0.56487125", "0.5501776", "0.54098845", "0.53817445", "0.53567433", "0.52819806", "0.5244804", "0.5152128", "0.515...
0.6927376
1
Test spwmap wtmode='tsys', interp='nearest,nearest', dowtsp=True
def testTsysMapNNSp(self): self._runTest('tsys', True, [1,3,5,7,9,15], 'nearest,nearest',self.spwmap)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testTinttsysMapNNSp(self):\n self._runTest('tinttsys', True, [1,3,5,7,9,15], 'nearest,nearest',self.spwmap)", "def testTsysMapNN(self):\n self._runTest('tsys', False, [1,3,5,7,9,15], 'nearest,nearest',self.spwmap)", "def testTsysNNSp(self):\n self._runTest('tsys', True, self.tsys_funcs...
[ "0.72670513", "0.71550035", "0.6951513", "0.6920037", "0.6804798", "0.64883035", "0.6429448", "0.63238674", "0.62219316", "0.61764634", "0.60540795", "0.60352385", "0.6020373", "0.5842893", "0.5733396", "0.5580416", "0.5545951", "0.5537896", "0.55318445", "0.54686", "0.545312...
0.7532484
0
Test spwmap wtmode='tsys', interp='linear,linear', dowtsp=True
def testTsysMapLLSp(self): self._runTest('tsys', True, [1,3,5,7,9,11,15], 'linear,linear',self.spwmap)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testTsysMapNNSp(self):\n self._runTest('tsys', True, [1,3,5,7,9,15], 'nearest,nearest',self.spwmap)", "def testTinttsysMapNNSp(self):\n self._runTest('tinttsys', True, [1,3,5,7,9,15], 'nearest,nearest',self.spwmap)", "def testTsysMapNN(self):\n self._runTest('tsys', False, [1,3,5,7,9,1...
[ "0.73509806", "0.7067911", "0.68657684", "0.67555046", "0.67106825", "0.66855836", "0.66548103", "0.6605728", "0.65847886", "0.6541287", "0.6503576", "0.64782387", "0.6435846", "0.6255136", "0.61380583", "0.6087196", "0.6078635", "0.57182294", "0.5626807", "0.553576", "0.5414...
0.6919443
2
Test spwmap wtmode='tsys', interp='linear,cspline', dowtsp=True
def testTsysMapLCSp(self): self._runTest('tsys', True, [1,3,5,7,9,11,13,15], 'linear,cspline',self.spwmap)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testTsysMapNNSp(self):\n self._runTest('tsys', True, [1,3,5,7,9,15], 'nearest,nearest',self.spwmap)", "def testTinttsysMapLCSp(self):\n self._runTest('tinttsys', True, [1,3,5,7,9,11,13,15], 'linear,cspline',self.spwmap)", "def testTinttsysMapNNSp(self):\n self._runTest('tinttsys', True...
[ "0.7093751", "0.70905924", "0.6906738", "0.67937833", "0.6790067", "0.6695765", "0.6578871", "0.65263134", "0.6504143", "0.64704347", "0.6446303", "0.63629514", "0.62222284", "0.6191828", "0.61690736", "0.59514916", "0.59136146", "0.5904759", "0.5549332", "0.54062337", "0.537...
0.7075434
2
Test spwmap wtmode='tinttsys', interp='nearest,nearest', dowtsp=True
def testTinttsysMapNNSp(self): self._runTest('tinttsys', True, [1,3,5,7,9,15], 'nearest,nearest',self.spwmap)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testTsysMapNNSp(self):\n self._runTest('tsys', True, [1,3,5,7,9,15], 'nearest,nearest',self.spwmap)", "def testTinttsysMapNN(self):\n self._runTest('tinttsys', False, [1,3,5,7,15], 'nearest,nearest',self.spwmap)", "def testTinttsysNNSp(self):\n self._runTest('tinttsys', True, self.tsys...
[ "0.7297252", "0.726566", "0.71029043", "0.7018207", "0.6625115", "0.6614049", "0.6548781", "0.64842147", "0.62953097", "0.6115125", "0.6074345", "0.6069492", "0.5952319", "0.5844141", "0.57873845", "0.56899405", "0.55286527", "0.55151045", "0.54746234", "0.54596645", "0.54242...
0.76174855
0
Test spwmap wtmode='tinttsys', interp='linear,linear', dowtsp=True
def testTinttsysMapLLSp(self): self._runTest('tinttsys', True, [1,3,5,7,9,11,15], 'linear,linear',self.spwmap)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testTinttsysMapNNSp(self):\n self._runTest('tinttsys', True, [1,3,5,7,9,15], 'nearest,nearest',self.spwmap)", "def testTsysMapNNSp(self):\n self._runTest('tsys', True, [1,3,5,7,9,15], 'nearest,nearest',self.spwmap)", "def testTinttsysMapNN(self):\n self._runTest('tinttsys', False, [1,3...
[ "0.7476452", "0.7114421", "0.69962686", "0.6957557", "0.69043505", "0.6739348", "0.6736017", "0.6734121", "0.67266977", "0.6684998", "0.6584073", "0.64497477", "0.64235175", "0.63057137", "0.62779695", "0.5956183", "0.5637475", "0.5566264", "0.5442669", "0.5413177", "0.535959...
0.71439976
1
Test spwmap wtmode='tinttsys', interp='linear,cspline', dowtsp=True
def testTinttsysMapLCSp(self): self._runTest('tinttsys', True, [1,3,5,7,9,11,13,15], 'linear,cspline',self.spwmap)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testTinttsysMapNNSp(self):\n self._runTest('tinttsys', True, [1,3,5,7,9,15], 'nearest,nearest',self.spwmap)", "def testTinttsysMapLLSp(self):\n self._runTest('tinttsys', True, [1,3,5,7,9,11,15], 'linear,linear',self.spwmap)", "def testTinttsysMapLC(self):\n self._runTest('tinttsys', Fa...
[ "0.7282748", "0.7065426", "0.7024528", "0.6905034", "0.6886287", "0.67218274", "0.6720227", "0.66895956", "0.66394633", "0.66167086", "0.6601417", "0.638492", "0.6343307", "0.6111405", "0.6106252", "0.58812624", "0.57545495", "0.55924857", "0.54666066", "0.5418006", "0.524664...
0.74198663
0
Save and restore stream context when used with the ``with`` keyword.
def stacked(stream): stream.push_state() try: yield finally: stream.pop_state()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __enter__(self):\n self._in_context_block = True\n # TODO: create local backup of file in case we can't upload and have to roll back\n return self", "def restore_context(self, filepath):\n\n raise NotImplementedError()", "def context(n, content):\n file = OpenFile(n, \"w\...
[ "0.6095452", "0.59848", "0.58887625", "0.5866076", "0.57608414", "0.5668968", "0.5576841", "0.5511557", "0.54789937", "0.5438591", "0.54206944", "0.53964925", "0.53685623", "0.5344177", "0.53378046", "0.53175336", "0.53103775", "0.53027433", "0.520619", "0.52038336", "0.51955...
0.4937667
47
Return a darker color.
def darken(color): hue, saturation, value = rgb_to_hsv(color.red, color.green, color.blue) value /= 1.5 saturation /= 1.25 return hsv_to_rgb(hue, saturation, value) + (color.alpha,)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def darken(hex_color: str) -> str:\n amount = 0.2\n hex_color = hex_color.replace(\"#\", \"\")\n red = max(0, int(hex_color[0:2], 16) - int(255 * amount))\n green = max(0, int(hex_color[2:4], 16) - int(255 * amount))\n blue = max(0, int(hex_color[4:6], 16) - int(255 * amount))\n darker_color = (\...
[ "0.7454738", "0.7330892", "0.69382864", "0.68706894", "0.6669197", "0.6634606", "0.64649427", "0.6458235", "0.64072514", "0.6381072", "0.6364707", "0.6326756", "0.6304574", "0.6232114", "0.6199844", "0.6146135", "0.61369884", "0.6134376", "0.6109642", "0.6106515", "0.6088504"...
0.7346637
1
Return a lighter color.
def lighten(color): hue, saturation, value = rgb_to_hsv(color.red, color.green, color.blue) value = 1 - (1 - value) / 1.5 if saturation: saturation = 1 - (1 - saturation) / 1.25 return hsv_to_rgb(hue, saturation, value) + (color.alpha,)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def light_color(self):\n return self._spots[constants.CROSSING_LOCATION - 1].light_color()", "def LightContrastColour(c):\r\n\r\n amount = 120\r\n\r\n # if the colour is especially dark, then\r\n # make the contrast even lighter\r\n if c.Red() < 128 and c.Green() < 128 and c.Blue() < 128:\r\n ...
[ "0.7586909", "0.7246913", "0.720426", "0.69052494", "0.6775031", "0.67253155", "0.6699019", "0.6699019", "0.6699019", "0.6699019", "0.6699019", "0.6699019", "0.66734266", "0.66314477", "0.6627959", "0.6607109", "0.6601264", "0.6423412", "0.6394038", "0.63793963", "0.63299954"...
0.6825535
4
Draw the given PageBox.
def draw_page(page, stream): bleed = { side: page.style[f'bleed_{side}'].value for side in ('top', 'right', 'bottom', 'left')} marks = page.style['marks'] stacking_context = StackingContext.from_page(page) draw_background( stream, stacking_context.box.background, clip_box=False, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _draw(self, frame, boxes, probs, landmarks, name):\n try:\n print('drawing')\n for box, prob, ld, id in zip(boxes, probs, landmarks, name):\n # Draw rectangle on frame\n\n cv2.putText(frame, id, (200, 50), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 0, 255), 2, c...
[ "0.6347439", "0.63203573", "0.62022114", "0.6174339", "0.6136849", "0.6121753", "0.60829866", "0.6076081", "0.594833", "0.5891543", "0.58463913", "0.58332574", "0.574836", "0.5743358", "0.57408214", "0.57265896", "0.57255423", "0.5719865", "0.56654084", "0.5649143", "0.562817...
0.69499445
0
Draw a ``stacking_context`` on ``stream``.
def draw_stacking_context(stream, stacking_context): # See https://www.w3.org/TR/CSS2/zindex.html with stacked(stream): box = stacking_context.box stream.begin_marked_content(box, mcid=True) # apply the viewport_overflow to the html box, see #35 if box.is_for_root_element and (...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stacked(stream):\n stream.push_state()\n try:\n yield\n finally:\n stream.pop_state()", "def stack(self, *args, **kwargs):\n return self._block(*args, container=\"stack\", **kwargs)", "def build_stream(\n self,\n tag,\n manifest,\n synthetic_image_i...
[ "0.617012", "0.5554513", "0.5277841", "0.5274168", "0.5218626", "0.51678014", "0.5144608", "0.5100139", "0.5036429", "0.4926174", "0.4897954", "0.48235258", "0.47874787", "0.47840837", "0.476707", "0.47404984", "0.46945328", "0.46772468", "0.4641723", "0.462906", "0.462906", ...
0.74125075
0
Draw the path of the border radius box. ``widths`` is a tuple of the inner widths (top, right, bottom, left) from the border box. Radii are adjusted from these values. Default is (0, 0, 0, 0).
def rounded_box_path(stream, radii): x, y, w, h, tl, tr, br, bl = radii if all(0 in corner for corner in (tl, tr, br, bl)): # No radius, draw a rectangle stream.rectangle(x, y, w, h) return r = 0.45 stream.move_to(x + tl[0], y) stream.line_to(x + w - tr[0], y) stream.c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_border(self):\n\n scaled_inside = self.inside_border * self.SCALE\n scaled_outside = self.outside_border * self.SCALE\n scaled_width = self.width * self.SCALE\n\n horizontal_line = 'M {x0} {y0} h {length} v {width} h -{length} z'\n vertical_line = 'M {x0} {y0} v {length}...
[ "0.5932557", "0.52870655", "0.5187153", "0.51472515", "0.5135001", "0.50693035", "0.50689316", "0.50074625", "0.4942915", "0.48784637", "0.48378006", "0.47617278", "0.47546327", "0.4732761", "0.46854058", "0.46846285", "0.4670559", "0.46552056", "0.46498325", "0.4627424", "0....
0.5240151
2
Draw the background color and image to a ``document.Stream``. If ``clip_box`` is set to ``False``, the background is not clipped to the border box of the background, but only to the painting area.
def draw_background(stream, bg, clip_box=True, bleed=None, marks=()): if bg is None: return with stacked(stream): if clip_box: for box in bg.layers[-1].clipped_boxes: rounded_box_path(stream, box) stream.clip() stream.end() # Backgrou...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_page(page, stream):\n bleed = {\n side: page.style[f'bleed_{side}'].value\n for side in ('top', 'right', 'bottom', 'left')}\n marks = page.style['marks']\n stacking_context = StackingContext.from_page(page)\n draw_background(\n stream, stacking_context.box.background, clip...
[ "0.50916755", "0.50457513", "0.47716227", "0.46886986", "0.45910823", "0.45242292", "0.45099384", "0.4491094", "0.44542804", "0.4447981", "0.44441408", "0.44344813", "0.43993294", "0.4392615", "0.43871245", "0.43814042", "0.43637508", "0.43514937", "0.4329039", "0.43201867", ...
0.6876859
0
Draw the box border to a ``document.Stream``.
def draw_border(stream, box): # We need a plan to draw beautiful borders, and that's difficult, no need # to lie. Let's try to find the cases that we can handle in a smart way. def get_columns_with_rule(): """Yield columns that have a rule drawn on the left.""" skip_next = True for ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_page(page, stream):\n bleed = {\n side: page.style[f'bleed_{side}'].value\n for side in ('top', 'right', 'bottom', 'left')}\n marks = page.style['marks']\n stacking_context = StackingContext.from_page(page)\n draw_background(\n stream, stacking_context.box.background, clip...
[ "0.5705386", "0.5639399", "0.5570043", "0.556558", "0.55434954", "0.5383438", "0.53265554", "0.53187335", "0.52529013", "0.52422464", "0.5228069", "0.52273524", "0.52140033", "0.52086645", "0.51901776", "0.5178869", "0.5124615", "0.5115901", "0.5094592", "0.50910413", "0.5090...
0.69521314
0
Yield columns that have a rule drawn on the left.
def get_columns_with_rule(): skip_next = True for child in box.children: if child.style['column_span'] == 'all': skip_next = True elif skip_next: skip_next = False else: yield child
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_columnrules(self, index, M):\n return list(itertools.chain.from_iterable(\n [[[self.strip(index[0], index[1], i), self.strip(index[0], x, i)]\n for x in range(1, M+1) if x != index[1]]\n for i in range(1, M+1)]\n ))", "def collect_columns():\n retur...
[ "0.645149", "0.6057414", "0.586089", "0.56928515", "0.5675787", "0.5641196", "0.5573644", "0.55316836", "0.552581", "0.5522299", "0.54805315", "0.5416425", "0.53937966", "0.539047", "0.52966505", "0.52788615", "0.527391", "0.5270788", "0.52541006", "0.52484876", "0.52372336",...
0.7647242
0
Clip one segment of box border. The strategy is to remove the zones not needed because of the style or the side before painting.
def clip_border_segment(stream, style, width, side, border_box, border_widths=None, radii=None): bbx, bby, bbw, bbh = border_box (tlh, tlv), (trh, trv), (brh, brv), (blh, blv) = radii or 4 * ((0, 0),) bt, br, bb, bl = border_widths or 4 * (width,) def transition_point(x1, y1, x2...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clip(self, clipbox):\r\n pmin, pmax = clipbox\r\n ind = []\r\n vlt = []\r\n # Direct elimination of out of bounds edges and vertices\r\n for i in range(len(self.vl)):\r\n if self.vl[i][0] < pmin[0] or self.vl[i][1] < pmin[1] or \\\r\n sel...
[ "0.666384", "0.64300543", "0.63514674", "0.6213578", "0.6185849", "0.6145557", "0.61359304", "0.61040986", "0.6100659", "0.609302", "0.609302", "0.60832506", "0.6042731", "0.60095114", "0.594213", "0.59401774", "0.59401774", "0.59327286", "0.59319544", "0.5875567", "0.5866782...
0.6125435
7
Get the point use for border transition. The extra boolean returned is ``True`` if the point is in the padding box (ie. the padding box is rounded). This point is not specified. We must be sure to be inside the rounded padding box, and in the zone defined in the "transition zone" allowed by the specification. We chose ...
def transition_point(x1, y1, x2, y2): return ( ((x1, y1), True) if abs(x1) > abs(x2) and abs(y1) > abs(y2) else ((x2, y2), False))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_borders_around_pt(self,pt):\n # to evaluate for coliisions, this necessitates not having any border longer then about 2*sqrt(border_detection_radius**2+detection_distance**2)\n\n distance_vectors=self.borders-pt\n distances=np.linalg.norm(distance_vectors, axis=2)\n found=distan...
[ "0.599201", "0.5938537", "0.5671844", "0.56284916", "0.5578357", "0.55782574", "0.55782574", "0.55205935", "0.5498804", "0.54247206", "0.5414012", "0.5390602", "0.5365566", "0.53557116", "0.53465563", "0.5294498", "0.5193402", "0.5147668", "0.51473993", "0.5144549", "0.511144...
0.0
-1
Return the length of the half of one ellipsis corner. Inspired by [Ramanujan, S., "Modular Equations and Approximations to pi" Quart. J. Pure. Appl. Math., vol. 45 (19131914), pp. 350372], wonderfully explained by Dr Rob.
def corner_half_length(a, b): x = (a - b) / (a + b) return pi / 8 * (a + b) * ( 1 + 3 * x ** 2 / (10 + sqrt(4 - 3 * x ** 2)))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sq_footage(length, width):\n return length * width", "def pointlength(x):\n return 0.0", "def len_square(bound):\n\treturn (8 - 2 * bound)", "def dots_left(self):\n return (len(self.top_row) +\n len(self.bottom_row) +\n len(self.left_col) +\n len...
[ "0.57467", "0.57435304", "0.56325287", "0.55781907", "0.54365695", "0.54319966", "0.5429056", "0.5394755", "0.53694063", "0.5361059", "0.53427887", "0.53427887", "0.5335277", "0.5334549", "0.5322909", "0.5317182", "0.53119785", "0.5297855", "0.529538", "0.5269954", "0.5258615...
0.65680283
0
Draw borders of table cells when they collapse.
def draw_collapsed_borders(stream, table): row_heights = [ row.height for row_group in table.children for row in row_group.children] column_widths = table.column_widths if not (row_heights and column_widths): # One of the list is empty: don’t bother with empty tables return ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tile_border(draw, r_s, r_e, c_s, c_e, color, border_size=TILE_BORDER_SIZE):\n for x in range(0, border_size):\n draw.rectangle([(c_s + x, r_s + x), (c_e - 1 - x, r_e - 1 - x)], outline=color)", "def _handle_border(self, i_row, i_col, adj_opp_cells, check_func, loc):\n check_func(i_row, i_col, adj_...
[ "0.61329514", "0.61080414", "0.6092054", "0.6007161", "0.5973623", "0.59045523", "0.5830328", "0.58236414", "0.577159", "0.57643205", "0.5728255", "0.5599663", "0.55689305", "0.5513478", "0.54590344", "0.5346918", "0.53133273", "0.5308185", "0.5281155", "0.5266912", "0.518911...
0.6858842
0
Draw a textbox to a pydyf stream.
def draw_text(stream, textbox, offset_x, text_overflow, block_ellipsis): # Pango crashes with font-size: 0 assert textbox.style['font_size'] if textbox.style['visibility'] != 'visible': return text_decoration_values = textbox.style['text_decoration_line'] text_decoration_color = textbox.st...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def text_draw(self, x, y, text, style={}):", "def on_text_box(self, event):\n text_box_value = self.text_box.GetValue()\n text = \"\".join([_(u\"New text box value: \"), text_box_value])\n if self.state == 0:\n self.canvas_2d.render(text)\n else:\n self.canvas_3d...
[ "0.6275481", "0.6240082", "0.6094606", "0.60169435", "0.59415543", "0.59237957", "0.58465", "0.5831097", "0.5807936", "0.5794802", "0.5764827", "0.57426435", "0.57012635", "0.56952345", "0.56546223", "0.5608419", "0.56050986", "0.55397826", "0.5537614", "0.55170614", "0.55074...
0.5985579
4
Draw the given ``textbox`` line to the document ``stream``.
def draw_first_line(stream, textbox, text_overflow, block_ellipsis, x, y, angle=0): # Don’t draw lines with only invisible characters if not textbox.text.strip(): return [] font_size = textbox.style['font_size'] if font_size < 1e-6: # Default float precision used by pydyf ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_text_decoration(stream, textbox, offset_x, offset_y, thickness,\n color):\n draw_line(\n stream, textbox.position_x, textbox.position_y + offset_y,\n textbox.position_x + textbox.width, textbox.position_y + offset_y,\n thickness, textbox.style['text_decorati...
[ "0.6834053", "0.65447557", "0.6472778", "0.60522676", "0.5848882", "0.5756315", "0.5709132", "0.56857044", "0.568206", "0.5629466", "0.55395603", "0.5518139", "0.55156267", "0.5495088", "0.5490895", "0.5466368", "0.5441387", "0.5418662", "0.5355139", "0.5311063", "0.5291632",...
0.5742716
6
Draw textdecoration of ``textbox`` to a ``document.Stream``.
def draw_text_decoration(stream, textbox, offset_x, offset_y, thickness, color): draw_line( stream, textbox.position_x, textbox.position_y + offset_y, textbox.position_x + textbox.width, textbox.position_y + offset_y, thickness, textbox.style['text_decoration_style']...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_text(stream, textbox, offset_x, text_overflow, block_ellipsis):\n # Pango crashes with font-size: 0\n assert textbox.style['font_size']\n\n if textbox.style['visibility'] != 'visible':\n return\n\n text_decoration_values = textbox.style['text_decoration_line']\n text_decoration_color...
[ "0.71900946", "0.61658967", "0.56317216", "0.56239617", "0.5589885", "0.5569843", "0.54945374", "0.53644043", "0.53160083", "0.52535385", "0.524488", "0.5234661", "0.52239835", "0.5214129", "0.5204475", "0.5171991", "0.51597446", "0.5150328", "0.51423484", "0.5134784", "0.513...
0.8075535
0
Return the api client.
def client(self): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def api_client() -> APIClient:\n return APIClient()", "def api_client() -> APIClient:\n\n return APIClient()", "def get_api_client():\n\n global _API_CLIENT_HANDLE\n\n if not _API_CLIENT_HANDLE:\n context = get_context()\n server_config = context.get_server_config()\n\n pc_ip =...
[ "0.85623187", "0.8511177", "0.81160563", "0.77931225", "0.7661331", "0.76611006", "0.7532638", "0.7427367", "0.73647344", "0.73252916", "0.73049146", "0.73049146", "0.73049146", "0.73049146", "0.72830397", "0.7251069", "0.72094214", "0.7206833", "0.7175392", "0.7170565", "0.7...
0.0
-1
Return the config data.
def config(self): return CurrentProject().config.config[self.key]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_details(self):\n return self.__config_data", "def get_config(self):\n return self.config", "def get_config(self):\n return {}", "def config(self):\r\n return self._config", "def get(self) -> dict:\n return Config.get()", "def get_config(self) -> Dict[str, Any]:\n ...
[ "0.78114504", "0.7802209", "0.7751879", "0.7735845", "0.7734903", "0.76992923", "0.76992923", "0.7668139", "0.76432544", "0.76193845", "0.759784", "0.7583172", "0.7583172", "0.7583172", "0.75687534", "0.75687534", "0.75563705", "0.75419843", "0.752904", "0.7528834", "0.752778...
0.0
-1
Return the credentials data.
def credentials(self): return CurrentProject().config.credentials[self.key]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_credentials(self):\n return self.credentials", "def credentials(self):\n return self._credentials", "def credentials(self) -> Mapping:", "def GetCredentials(self):\n return self._session.get(_CREDENTIAL_KEY, credentials.MapdCredentials())", "def get_creds(self):\n return sel...
[ "0.81657696", "0.7834035", "0.76815844", "0.7680422", "0.76254576", "0.7548677", "0.75253165", "0.7507348", "0.74679935", "0.7440803", "0.74396557", "0.731908", "0.7310226", "0.72606987", "0.72594994", "0.7207075", "0.7180444", "0.7155929", "0.7128947", "0.7113179", "0.710337...
0.74120003
11
Instantiate the scope by keys. e.g. PullRequest.init_by_keys(organization='octocat', repository='HelloWorld', number=1) > PullRequest(organization='octocat', repository='HelloWorld', number=1)
def init_by_keys(cls, **query): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(self, keys: List[str]):", "def build(keys: List[str]):\n api = API()\n api.build(*keys)", "def __init__(self, keys_to_track):\r\n self.keys_to_track = keys_to_track\r\n self.tracker = {}\r\n for key_to_track in self.keys_to_track:\r\n self.tracker[key_to_tra...
[ "0.6308261", "0.60055834", "0.55877304", "0.55266637", "0.54057276", "0.5345015", "0.52308273", "0.5219602", "0.5178745", "0.5178331", "0.51643896", "0.51558304", "0.51527977", "0.5145405", "0.5113519", "0.50983435", "0.5097046", "0.50778776", "0.50524044", "0.50505924", "0.5...
0.6373544
0
Return the query according to the primary keys
def query(self) -> dict: raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def query(self, table, primaryKeyName, primaryKeyValue, options):\r\n \r\n \"\"\" Test if the value passed in options is of several values \"\"\"\r\n if hasattr(options, \"__len__\"):\r\n query = \"SELECT \" + \",\".join( map(lambda x: str(x).replace(\"'\", \"''\"), options)) + \" F...
[ "0.6403962", "0.63123155", "0.6271304", "0.61002785", "0.60656977", "0.60053146", "0.5975429", "0.595503", "0.5923981", "0.5923075", "0.5891887", "0.587845", "0.5868585", "0.5868196", "0.58406204", "0.58191895", "0.5747309", "0.5746019", "0.5743802", "0.57170737", "0.56874263...
0.0
-1
Return the parent endpoint scope.
def parent(self): return # Optional to overwrite
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scope(self):\n return 'global' if self.parent is None else 'local'", "def getScope(self):\n return self.graph.get(\"__scope\", '')", "def get_scope(self):\n raise NotImplementedError()", "def scope(self):\n return self._scope", "def scope(self):\n return self._scope",...
[ "0.73931044", "0.69746417", "0.6875149", "0.681471", "0.681471", "0.66869026", "0.6438213", "0.6420328", "0.6420328", "0.6420328", "0.6420328", "0.6420328", "0.64110816", "0.6410165", "0.6371953", "0.63694674", "0.63608634", "0.63454264", "0.63100046", "0.6290019", "0.6290019...
0.5899172
72
Return all the classes in the hierarchy to the top
def get_static_hierarchy(cls, include_me=True): hierarchy = set() if include_me: hierarchy.add(cls) parents = cls.Parents for parent in parents: hierarchy.update(parent.get_static_hierarchy()) return hierarchy
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def return_classes(self):\n\n\t\t \n\t\t \n\t\treturn self.classes", "def get_class_list(self):\n t = []\n for cls in self.classes:\n if not self.is_opaque(cls.classobj):\n t.append(cls)\n elif cls.parents or cls.childs:\n t.append(cls)\n ...
[ "0.7040076", "0.69923663", "0.6922267", "0.6916718", "0.680795", "0.67548066", "0.67497045", "0.67134833", "0.6697276", "0.6673896", "0.66624254", "0.66590905", "0.6649909", "0.6614607", "0.6603962", "0.6595031", "0.65632945", "0.65417117", "0.65115494", "0.65086377", "0.6488...
0.0
-1
Instantiate the scope by event. e.g. PullRequest.init_by_event(PullRequestEvent()) > PullRequest()
def init_by_event(cls, event): assert isinstance(event, Event), 'event should be an instance of `Event`, not `{}`'.format(type(event)) assert all(k in event.data for k in cls.primary_keys), \ f'Missing keys in event data, event data keys: {event.data.keys()}; required keys: {cls.primary_keys...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, *args, **kwargs):\n self.events = {}", "def __init__(self, events):\n self.events = events", "def event(self, event_name):\r\n return Event(self, event_name)", "def Event(name):\n c = new_class(name, bases=(_Event,))(name)\n return c", "def __init__(self, *args...
[ "0.57905316", "0.57330126", "0.5716001", "0.55669534", "0.5516003", "0.5464746", "0.5435075", "0.5431385", "0.5409472", "0.54081297", "0.5403132", "0.53969", "0.53702015", "0.5368345", "0.53547823", "0.5283666", "0.5265234", "0.5227268", "0.5225845", "0.51549", "0.5137286", ...
0.54648465
5
Return whether this endpoint scope is a singleton or not.
def is_singleton_scope(cls): return not cls.primary_keys
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_Singleton(self):\n return self.size == 1", "def valid_endpoint(cls):\n\t\treturn cls.__subclasses__() == []", "def has_request_scope(self):\n return self.request_scope", "def private_instance(self) -> bool:\n return pulumi.get(self, \"private_instance\")", "def is_shared(self):\...
[ "0.7000542", "0.64485866", "0.6180424", "0.61669946", "0.6114246", "0.60283005", "0.60228246", "0.5933381", "0.5918585", "0.5906537", "0.5830943", "0.58295834", "0.58278096", "0.5807388", "0.57512015", "0.5715974", "0.5711425", "0.56972426", "0.5690803", "0.5667977", "0.56553...
0.77170163
0
Return the unique id of the event.
def id(self): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def id(self) -> str:\n return self._event.get('id')", "def event_id(self):\n return self._event_id", "def getId(self):\n return _libsbml.Event_getId(self)", "def GetEventIdentifier(self):\n return self._event_identifier", "def getUniqueID(event):\n\tmatch = reUniqueID.search(event)\...
[ "0.84729093", "0.8444983", "0.82483697", "0.8157108", "0.77766025", "0.7458073", "0.7458073", "0.7351588", "0.7328253", "0.7322438", "0.7322438", "0.7322438", "0.7322438", "0.7322438", "0.7322438", "0.7322438", "0.7322438", "0.7313246", "0.729245", "0.729245", "0.729245", "...
0.0
-1
Return the data of the event. this data will use to instantiate the EndpointScope.
def data(self) -> dict: raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def data(self) -> dict:\n return self._event.get('data')", "def data(self):\n if not self._data:\n body = self.event.get('body', None)\n try:\n self._data = json.loads(body) if body else dict()\n except JSONDecodeError as e:\n self.logg...
[ "0.75221866", "0.66721517", "0.65946", "0.64923364", "0.6421612", "0.64072734", "0.64072734", "0.64059347", "0.6389085", "0.63598835", "0.6333141", "0.6333141", "0.6333141", "0.6326874", "0.6326874", "0.6290347", "0.62691826", "0.6259007", "0.62457156", "0.6227651", "0.618130...
0.6467665
4
Returns the event artifacts.
def artifacts(self) -> dict: return {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_artifacts(self): # noqa\n return []", "def events(self) -> Sequence[Tuple[str, Sequence[Union[np.ndarray, bytes]]]]:\n return self._env.events()", "def build_artifacts(self):\n return self._build_artifacts", "def artifacts(self) -> dict:\n data = self.raw_data\n artifa...
[ "0.7204048", "0.68177265", "0.6610897", "0.64592767", "0.6256424", "0.6254981", "0.6251064", "0.609566", "0.6068671", "0.6066551", "0.60607046", "0.60479414", "0.6030839", "0.6025715", "0.6025715", "0.60163736", "0.59888047", "0.5984341", "0.5980962", "0.59622055", "0.5961597...
0.6235632
7
Return the endpoint of the event.
def endpoint(self): return self.Endpoint
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_endpoint(self):\r\n return self._endpoint", "def endpoint(self):\r\n return self._endpoint", "def __get_endpoint(self):\n return self._endpoint", "def endpoint(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"endpoint\")", "def endpoint(self) -> pulumi.Output[str...
[ "0.77665454", "0.77334213", "0.7699824", "0.73889214", "0.73889214", "0.73567677", "0.73567677", "0.734298", "0.734298", "0.7310963", "0.7298057", "0.72684276", "0.72229856", "0.72229856", "0.7137985", "0.70864326", "0.70864326", "0.69667065", "0.6964155", "0.6964155", "0.687...
0.7661089
3
Return the hash for the event using ID only
def hash_by_id(cls, event_id): return '{}::{}'.format(cls.Endpoint.key, event_id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def existing_hash(self, id):\r\n return self._read_sha_by_id(id)", "def _calculate_hash(self, entry):\n entry.pop('id', None)\n return hashlib.sha224(json.dumps(\n entry, cls=DjangoJSONEncoder).encode('utf-8')).hexdigest()", "def id_to_hash(self, id):\n mm = hashlib.sha256(st...
[ "0.7319287", "0.707525", "0.70566404", "0.6818503", "0.67281663", "0.6721193", "0.6599954", "0.65424097", "0.64546216", "0.64048505", "0.6393958", "0.6373491", "0.63731545", "0.63528925", "0.6342936", "0.6342936", "0.6342936", "0.6342936", "0.6318093", "0.63149315", "0.630519...
0.82204044
0
Return the unique hash for of the event.
def hash(self): return self.hash_by_id(self.id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_hash(self) -> str:\n return self.__hash.hexdigest()", "def get_hash(self):\r\n block_data = self.prev_hash\r\n block_data += bytearray(struct.pack(\"!f\", self.time))\r\n block_data += self.user_id.encode()\r\n block_data += self.signature.encode()\r\n block_data...
[ "0.77308625", "0.7479923", "0.74733794", "0.7466649", "0.74565727", "0.7391856", "0.73630625", "0.7342862", "0.7339368", "0.7328602", "0.7319341", "0.7314506", "0.72994226", "0.7286341", "0.72203314", "0.7170063", "0.7162196", "0.7161566", "0.71487325", "0.7120408", "0.711767...
0.69664377
38