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
Initialize your data structure here.
def __init__(self): # list for all numbers self.nums = [] # the index for each number in the list self.inds = {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _init_empty(self):\n self._data = []", "def __init__(self):\n self._data = []", "def __init__(self):\n self._data = []", "def __init__(self):\n self._data = []", "def __init__(self):\n self._data = []", "def __init__(self):\n self._data = []", "def __init__...
[ "0.7765608", "0.7645274", "0.7645274", "0.7645274", "0.7645274", "0.7645274", "0.7645274", "0.7595176", "0.75853467", "0.7558298", "0.7530608", "0.7530608", "0.7530608", "0.7530608", "0.7530608", "0.74971247", "0.74971247", "0.7478105", "0.7477832", "0.7477832", "0.7477832", ...
0.0
-1
Inserts a value to the set. Returns true if the set did not already contain the specified element.
def insert(self, val): # if it already exists return error if val in self.inds: return False # record the index and save the number self.inds[val] = len(self.nums) self.nums.append(val) return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def insert(self, val: int) -> bool:\n if val not in self.set:\n self.set.add(val)\n return True\n return False", "def insert(self, val: int) -> bool:\n if val not in self.value_set:\n self.value_set.add(val)\n self.values.append(val)\n r...
[ "0.7981645", "0.7609813", "0.75033724", "0.7475974", "0.72454274", "0.72146404", "0.7200908", "0.71701366", "0.7164788", "0.7147172", "0.7050728", "0.69496", "0.69478387", "0.6929294", "0.69116586", "0.6902306", "0.6878695", "0.68752456", "0.68752456", "0.68752456", "0.687524...
0.6459848
52
Removes a value from the set. Returns true if the set contained the specified element.
def remove(self, val): # if it doesn't exist return error if val not in self.inds: return False # find the index for the val in list, and take the last element ind, temp = self.inds[val], self.nums.pop() # if the one to delete is not the last number...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove(self, val: int) -> bool:\n if val in self.set:\n self.set.remove(val)\n return True\n return False", "def remove(self, val: int) -> bool:\n if val in self.set:\n self.set.remove(val);\n self.nums.remove(val);\n return True;\n ...
[ "0.77930737", "0.75553113", "0.7472567", "0.7312134", "0.71163213", "0.70876503", "0.69920707", "0.6944722", "0.6899799", "0.68561065", "0.6852177", "0.68362844", "0.6835518", "0.6825324", "0.6823078", "0.6823078", "0.6814828", "0.6778132", "0.67599577", "0.67399085", "0.6726...
0.6174827
53
Get a random element from the set.
def getRandom(self): # pick a random number from the list return random.choice(self.nums)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getRandom(self):\n return self.nums[random.randint(0, len(self.nums) - 1)]\n\n # Your RandomizedSet object will be instantiated and called as such:\n # obj = RandomizedSet()\n # param_1 = obj.insert(val)\n # param_2 = obj.remove(val)\n # param_3 = obj.getRandom()", "...
[ "0.77060276", "0.738916", "0.7296881", "0.72187954", "0.6871744", "0.68453854", "0.68330806", "0.67740154", "0.67226046", "0.6703282", "0.6665089", "0.66356236", "0.66217655", "0.6612035", "0.66000897", "0.6567767", "0.6477719", "0.6462421", "0.64428514", "0.64162946", "0.640...
0.6388269
23
Accumulate observed stars on the same dates.
def accumulate_dates(dates, stars): start = min(dates) stop = max(dates) t_range = (stop - start).days a_dates = [start + timedelta(days = n) for n in range(t_range + 1)] a_stars = [0 for n in range(t_range + 1)] for i in range(len(dates)): idx = (dates[i] - start).days a_stars[i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _update_rating_history(self, rating: float, date: Union[str, float]):\n self.rating_history.append((date, rating))", "def _increment_num_user_stars(user_id, match, now):\n\tassert match.is_streamed\n\n\tmissing = session.query(CalendarEntry)\\\n\t\t\t.filter(\n\t\t\t\tCalendarEntry.user_id == user_id,...
[ "0.5819865", "0.562832", "0.5501563", "0.5379064", "0.52238375", "0.5169488", "0.5166707", "0.5135347", "0.50705355", "0.50331134", "0.50316", "0.50230944", "0.5007228", "0.4953354", "0.49355468", "0.4928901", "0.49267507", "0.49242172", "0.49139744", "0.49059406", "0.4899571...
0.7347785
0
Calculate estimated number of stars observed during VLASS observation Assume 4.2 sec per pointing as estimated by Paul.
def vlass_stars(duration, n_beams): n_pointings = duration//4.2 n_observed = n_pointings*n_beams return n_observed
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ventilation_rate(self):\n # TODO: calculate based on MERV ratings/efficiency/power/etc.\n return (\n sum(v.calculate_ach(self.volume) for v in self.air_quality_measures)\n + self.outdoor_air_ventilation\n )", "def getStarRating(waveHeight, windDir, avgWind, tideHeig...
[ "0.61229646", "0.6093639", "0.59843814", "0.59413254", "0.5775997", "0.5775997", "0.5775997", "0.5775997", "0.57482773", "0.57340753", "0.5731418", "0.57153237", "0.5698593", "0.56730896", "0.5668431", "0.5663986", "0.5649949", "0.5639038", "0.5635766", "0.5622494", "0.561866...
0.73987895
0
Calculation prize based on the points
def which_prize(points): prize = None if 0 <= points <= 50: prize = 'wooden rabbit' elif 51 <= points <= 150: prize = None elif 151 <= points <= 180: prize = 'wafer-thin mint' elif 181 <= points <= 200: prize = 'penguin' else: prize = None if prize: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __call__(self, points):\n denom = sum([self.weights[i]/(points - self.xint[i]) for i in range(self.n)])\n numer = sum([self.yint[i]*self.weights[i]/(points - self.xint[i]) for i in range(self.n)])\n return numer/denom", "def numberOfPoints(self):\n return 20000", "def __evaluate...
[ "0.6893368", "0.6084819", "0.6049355", "0.6028179", "0.59974515", "0.5966032", "0.5889782", "0.58744955", "0.58731395", "0.5870193", "0.5849474", "0.58456403", "0.5832309", "0.58152395", "0.5789245", "0.5786074", "0.578353", "0.577726", "0.5765119", "0.57123584", "0.5707989",...
0.56365174
26
Queries a nearby weather underground station for temp data and rain data
def get_weather_data(weather_station): now = datetime.datetime.now() then = now - datetime.timedelta(days=7) query_date_start = ("%d%02d%02d" % (then.year, then.month, then.day)) query_date_end = ("%d%02d%02d" % (now.year, now.month, now.day)) api_key = '/api/%s' % WUNDERGROUND_KEY history_key...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getTodaysWeather(self, keyword, temp):\n\n\t\t# Variables\n\t\tweather = {} \n\t\tfio = self.helper.getFio(keyword, temp) # Getting fio object\n\t\t\n\t\t# Getting todays weather data and populating the dictionary\n\t\tif fio.has_daily() is True and fio.has_hourly() is True:\n\t\t daily = FIODaily.FIOD...
[ "0.6910243", "0.66520226", "0.6608227", "0.6573686", "0.63866216", "0.6343781", "0.631178", "0.6305189", "0.6281451", "0.62793523", "0.62376016", "0.6201287", "0.6198531", "0.6157297", "0.61510736", "0.6086177", "0.6076465", "0.6055122", "0.60240924", "0.5990383", "0.598555",...
0.71451485
0
Return all zip streams and their positions in file.
def zipstreams(filename): with open(filename, 'rb') as fh: data = fh.read() i = 0 while i < len(data): try: zo = zlib.decompressobj() yield i, zo.decompress(data[i:]) i += len(data[i:]) - len(zo.unused_data) except zlib.error: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_stream_readers_for_zip(fh, tmp_dir):\n fasta_zip = zipfile.ZipFile(fh, 'r')\n rval = []\n for member in fasta_zip.namelist():\n fasta_zip.extract(member, tmp_dir)\n rval.append(open(os.path.join(tmp_dir, member), 'rb'))\n return rval", "def _GetStreamNames(self):\n if self._...
[ "0.7123306", "0.654805", "0.64884543", "0.6211099", "0.6143137", "0.60887825", "0.60620993", "0.6023242", "0.591442", "0.58101535", "0.57589924", "0.5750186", "0.57359564", "0.5727873", "0.57115054", "0.57092226", "0.56497854", "0.5616687", "0.561402", "0.5552648", "0.5543412...
0.6771445
1
erase files that have been renamed but not normalized
def __clean(path, pattern = '.tiff'): for f in os.listdir(path): if re.search(pattern, f): os.remove(os.path.join(path, f)) print("directory cleaned")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clean_files(self):\n self.filenames.clear()", "def space_cleaning():\n for file in os.listdir(\".\"):\n if file.endswith(\".png\"):\n os.remove(file)", "def clean_data():\n for clean_file in clean_files:\n file_list = [f for f in os.listdir(\".\") if f.endswith(clean_f...
[ "0.72445166", "0.70031506", "0.6998387", "0.69157773", "0.69150037", "0.68766177", "0.68629783", "0.68068534", "0.67834073", "0.6767647", "0.6741178", "0.6736381", "0.67008567", "0.662713", "0.66061443", "0.65724576", "0.6555076", "0.65424263", "0.6495746", "0.64890414", "0.6...
0.5960827
67
Returns an enumeration member with a value matching `value`.
def get_member( cls, value: str, ): if not value: return None members = [ (member, member.value) for member in cls.__members__.values() ] for member, member_value in members: if member_value == value: r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Enum(enum, value, default=None):\n if value is None:\n return default\n\n for pair in enum:\n if pair.value == value:\n return pair\n\n raise KeyError(\"Value '{}' not contained in enum type\".format(value))", "def from_value(cls, value: str):\n return cls._value2memb...
[ "0.67772806", "0.66527843", "0.64541763", "0.6362393", "0.611267", "0.6082106", "0.5995382", "0.59891886", "0.5980627", "0.5902926", "0.5802926", "0.57012653", "0.560989", "0.5605811", "0.5560168", "0.55101895", "0.55054975", "0.5468104", "0.5463636", "0.5452052", "0.5404608"...
0.7054582
0
Decorator that can be used to return the first item of a callable's `list` return.
def return_first_item(func): # Define the wrapper function. def wrapper(self, *args, **kwargs): # Execute the decorated method with the provided arguments. result = func(self, *args, **kwargs) # If the function returned a result and that result is a list then # return the firs...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def first(items):\n return next(iter(items or []), None)", "def first(items):\r\n return items[0]", "def first(l):\n return next(iter(l), None)", "def _get_first(details: CallableDetails) -> CallableArg:\n return details.args[0]", "def first(sequence, default=Ellipsis):\n if default is E...
[ "0.65695965", "0.65369004", "0.6376428", "0.6358152", "0.6354889", "0.6343154", "0.6285985", "0.62713856", "0.6234703", "0.6234703", "0.61748505", "0.61029243", "0.6100002", "0.6100002", "0.60022485", "0.5952739", "0.5899202", "0.5892642", "0.58904845", "0.58807445", "0.58740...
0.8338826
0
Decorator that ensures all ``list`` objects in a method's arguments have the same length
def lists_equal_length(func): # Define the wrapper function. def wrapper(self, *args, **kwargs): # Collect all `list` objects from `args`. lists_args = [arg for arg in args if isinstance(arg, list)] # Collecgt all `list` object from `kwargs`. lists_kwargs = [arg for arg in kwarg...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_list_of_equal_len():\n\n @type_checked\n def _run_test(something:[str, int, bool]):\n assert isinstance(something[0], str)\n assert isinstance(something[1], int)\n assert isinstance(something[2], bool)\n\n _run_test(something=[None, \"12\", 1])", "def __size_restriction_cor...
[ "0.6833578", "0.6415181", "0.63303596", "0.61641717", "0.6103861", "0.6006148", "0.59215814", "0.59204984", "0.5868942", "0.57566774", "0.57490146", "0.5735287", "0.572292", "0.5700607", "0.56883466", "0.56657", "0.5599322", "0.5599322", "0.55968153", "0.5568369", "0.5561684"...
0.8060742
0
Clear the screen and draw the alien.
def draw(): screen.fill((0, 0, 0)) alien.draw()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear(self):\n pygame.draw.rect(self.screen,BLACK,(0,0,WINDOWWIDTH,\n WINDOWHEIGHT))\n pygame.display.update()", "def clear(self) -> None:\n\n self.screen.fill(self.bg)", "def draw(self):\n self.screen.fill(BACKGROUND_COLOR)\n se...
[ "0.7505039", "0.7242356", "0.7230753", "0.7131363", "0.7115127", "0.7101928", "0.70682305", "0.70466423", "0.7031619", "0.6995481", "0.6974922", "0.6921669", "0.69176", "0.69122386", "0.6896714", "0.6883864", "0.6875905", "0.6849436", "0.6818272", "0.6815119", "0.6790672", ...
0.8509718
0
Move the alien around using the keyboard.
def update(): if keyboard.left: alien.x -= 2 elif keyboard.right: alien.x += 2 if keyboard.space: alien.y = GROUND - 50 animate(alien, y=GROUND, tween='bounce_end', duration=.5) # If the alien is off the screen, # move it back on screen if alien.right > WIDTH: alien.rig...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def move(event):\r\n\t\tif event.char == \"a\":\r\n\t\t\tcanvas.move(z[a], -10, 0)\r\n\t\telif event.char == \"d\":\r\n\t\t\tcanvas.move(z[a], 10, 0)\r\n\t\telif event.char == \"w\":\r\n\t\t\tcanvas.move(z[a], 0, -10)\r\n\t\telif event.char == \"s\":\r\n\t\t\tcanvas.move(z[a], 0, 10)", "def joystick_move(self, e...
[ "0.70149887", "0.699595", "0.681032", "0.6801341", "0.66253835", "0.65040016", "0.64911735", "0.6442173", "0.6367084", "0.632558", "0.62957025", "0.6282375", "0.62190115", "0.6184205", "0.61793596", "0.6166848", "0.61651015", "0.61622244", "0.6133459", "0.61307865", "0.612061...
0.71201307
0
basic preprocessing on the raw variatons returns a single histogram for each systematic with bin content represting the symmterised uncertainty Preprocessing top mass variations are scaled by 1/3
def processSystematic(observable, xsecType, xsecLevel, systematic, histNominal): varHists = [] linkStr = "" singlePointSystematics = ["ERDON", "ERDONRETUNE", "GLUONMOVETUNE", "BFRAG_PETERSON"] sPS = 0 if any(singlePointSystematic in systematic for singlePointSystematic in singlePointSystematics): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def processSystematic(observable, xsecType, xsecLevel, systematic, histNominal):\n varHists = []\n\n linkStr = \"_\"\n variations = [\"\"]\n\n for variation in variations:\n if xsecType == \"normalised\":\n xsecType = \"normalized\"\n if xsecLevel == \"particle\":\n ...
[ "0.64501214", "0.5601664", "0.5529052", "0.55120814", "0.54677695", "0.5449569", "0.5407651", "0.53764164", "0.5360028", "0.5337787", "0.53310555", "0.5325349", "0.5292115", "0.529134", "0.5287892", "0.5283185", "0.5263711", "0.5261005", "0.5248296", "0.52357006", "0.52268076...
0.59027475
1
takes the preprocessed variation histograms and makes the final summed histograms symmeterises effects in bins
def make_sys_sum(fileName, systematics, variations): file = TFile(fileName) histTotSysUp = file.Get("Nominal").Clone() histTotSysDown = file.Get("Nominal").Clone() histTotSysUp.Reset() histTotSysDown.Reset() histTotSysUp.SetDirectory(0) histTotSysDown.SetDirectory(0) for ibin in range(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compare_histograms(df, df_norm, fignum, fields, binns):\n fig = plt.figure(num=fignum, figsize=(18,18))\n fig.suptitle('Histogram before and after normalization', fontsize=22)\n ax1 = fig.add_subplot(421, axisbg='0.94')\n ax2 = fig.add_subplot(422, axisbg='0.94')\n ax3 = fig.add_subplot(423, axi...
[ "0.63964415", "0.62685835", "0.62414837", "0.62069935", "0.60966927", "0.60651386", "0.60223716", "0.5942936", "0.5920461", "0.5877657", "0.5857634", "0.5831009", "0.5829086", "0.58266604", "0.5823835", "0.5822443", "0.5815776", "0.58128756", "0.57792675", "0.57546276", "0.57...
0.0
-1
setUp is called before each test is run, tearDown is called after
def setUp(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setUp(self):\n MainTests.setUp(self)", "def setUp(self):\n \n \n pass", "def setUp(self):\n \n \n pass", "def setUp(self):\n \n \n pass", "def setUp(self):\n \n \n pass", "def setUp(self):\n \n \n...
[ "0.8581003", "0.8570658", "0.8570658", "0.8570658", "0.8570658", "0.8570658", "0.8570658", "0.8570658", "0.8570658", "0.8570658", "0.8552113", "0.8523558", "0.8523558", "0.851478", "0.85131484", "0.85049874", "0.85049874", "0.8482348", "0.84664434", "0.84575176", "0.84575176"...
0.85146415
37
Test if setting multiple features works.
def test_setter_extended(): group = Group({"a": Numerical(), "b": Numerical(), "c": Group({"d": Numerical(), }), }) group.set_a(10) group.set_b(20) group.set_c_d(30) group.push() group.set_a(11) group.set_b(21) group.set_c(31) group.push() group.set("a", 12) group.set("b"...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_all_features(self):\n to_create = ['looktest1', 'looktest2', 'looktest3']\n for f in to_create:\n Feature(f).activate()\n\n all_features = Feature.all_features()\n self.assertEqual(len(all_features), len(to_create))\n for f in to_create:\n self.asse...
[ "0.74074817", "0.7168108", "0.6827362", "0.6718771", "0.647861", "0.64621735", "0.6363413", "0.63128954", "0.6267152", "0.6253744", "0.6251584", "0.6227782", "0.6165864", "0.613769", "0.61193776", "0.61076474", "0.6096284", "0.60629445", "0.59956205", "0.5987819", "0.59747297...
0.0
-1
Test the Numerical feature class.
def test_numerical_feature(): group = Group({"a": Numerical(), "b": Numerical(), "c": Numerical(dimensions=3), "d": Numerical(dimensions="xyz"), }) group.set_a(100) group.set_b(200) group.set_c(0, 10) group.set_c(1, 20) group.set_c(2, 30...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_predictor():", "def test_basic(self):\n result = NonLinearWeights(0.85).nonlinear_weights(3)\n self.assertIsInstance(result, np.ndarray)", "def test_analytical_vs_numerical():\n pass", "def test_machine_learning():", "def test_n_features_property():\n atom = ATOMClassifier(X_bi...
[ "0.65769154", "0.6479049", "0.64082533", "0.63766325", "0.62874675", "0.6269006", "0.62610215", "0.62139887", "0.617032", "0.61396384", "0.608057", "0.6065621", "0.6053544", "0.60263926", "0.59525865", "0.5915357", "0.590433", "0.58927613", "0.5877672", "0.58714354", "0.58414...
0.5612527
58
Test the Categorical feature class.
def test_categorical_feature(): feature = Categorical("abc") for element in "abc": feature.set(element) feature.set("ignore this") feature.push() for element in "abc": getattr(feature, "set_" + element)() feature.push() array = feature.array() assert array...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_categorical():\n # assert the distribution of the samples is close to the distribution of the data\n # using cstest:\n # - uniform (assert p-value > 0.05)\n # - very skewed / biased? (assert p-value > 0.05)\n # - inversely correlated (assert correlation < 0)", "def test_get_cat_scor...
[ "0.73366314", "0.7113809", "0.71037066", "0.6780652", "0.66445255", "0.66398925", "0.6559521", "0.6554185", "0.6519982", "0.6498263", "0.6448205", "0.64314634", "0.64148504", "0.64140356", "0.63725084", "0.6347099", "0.6345432", "0.62697804", "0.62644917", "0.62623185", "0.62...
0.7951883
0
Test the Hashed feature class.
def test_hashed_feature(): def mock(c): return ord(c) - ord('a') group = Group({"a": Hashed(buckets=3, hash=mock), "b": Hashed(buckets=5, hash=mock), }) for i in range(10): group.set_a("abcde" [i % 3]) group.set_b("abcde" [i % 5]) group.push() array = group.array() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_hashing():\n X = Vectorizer(strategy=\"Hashing\", n_features=10).fit_transform(X_text)\n assert X.shape == (10, 10)\n assert \"hash1\" in X", "def test_all_features_with_data(self):\n feature1 = Feature('looktest1')\n feature1.set_percentage(5)\n\n feature2 = Feature('lookt...
[ "0.65287024", "0.62354875", "0.6188721", "0.60676974", "0.59955835", "0.5943524", "0.59145314", "0.5907544", "0.59006155", "0.5855149", "0.5854101", "0.5758078", "0.5741417", "0.5683079", "0.5673396", "0.5668186", "0.5665878", "0.56312555", "0.5623874", "0.5621978", "0.558776...
0.70252043
0
Test if the default hash function distributes random signs evenly.
def test_hashed_feature_random_sign(): group = Group({"a": Hashed(buckets=100, random_sign=True), }) for i in range(100): for j in range(100): group.set(randstr(), weight=123) group.push() array = group.array() assert array.shape == (100, 100) pos, neg = 0, 0 for ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def randomHash(self):\n modulus = self.filter_size\n a, b = random.randint(1, modulus - 1), random.randint(1, modulus - 1)\n\n def f(x):\n return hash(x) % (a + b) % modulus\n\n return f", "def deterministicrandom(x):\n\n i = hash_value(x)\n\n r = 1.0 * i / MAX_HASH_V...
[ "0.6889566", "0.6818092", "0.6662236", "0.64020073", "0.6377606", "0.6362132", "0.6194805", "0.61882335", "0.6186182", "0.61861044", "0.61729205", "0.615299", "0.6131213", "0.6115176", "0.6083449", "0.6062994", "0.60509396", "0.6027059", "0.59783775", "0.5965881", "0.59652704...
0.624788
6
Test to see if using different classes works.
def test_stress(): group = Group({ "a": Numerical(), "b": Numerical(), "c": Categorical(list(range(5))), "d": Hashed(buckets=5), "e": Hashed(buckets=5, random_sign=True), }) for i in range(100): group.set_a(random()) group.set_b(r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_do_check_class_names(self):\n self.assertTrue(self.a.do_check_class_names(self.a))\n self.assertFalse(self.a.do_check_class_names(self.b))", "def test_all_no_class(self):", "def test_all_no_class(self):", "def test_class_method(self):\n self.assertEqual(pyperry.Base.resolve_name...
[ "0.6858586", "0.67248607", "0.67248607", "0.6477522", "0.64745814", "0.6398199", "0.6391246", "0.63339883", "0.633331", "0.63200086", "0.6300495", "0.6298434", "0.62441707", "0.6239218", "0.6229985", "0.62199354", "0.62179506", "0.62132084", "0.61932254", "0.6172138", "0.6166...
0.0
-1
Test if custom features work.
def test_custom_features(): group = Group({ "a": CustomSized(), "b": CustomNamed(), "c": CustomDynamic(), "d": CustomSlotList(), "e": CustomSlotDict(), }) for _ in range(10): for x in range(4): group.set_a(x) for x in "abcd": ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_supported_features(self):", "def exposes_features(self):\n return self._features_op is not None", "def __call__(self, feature):\n return self.is_enabled(feature)", "def feature(self):\n Feature(run=default_frame, flags=TE)\n Feature(run=load(\"window_functions.tests.rows_frame\"...
[ "0.71229833", "0.6740728", "0.6653905", "0.6572284", "0.65463126", "0.6525058", "0.651423", "0.6466732", "0.6466732", "0.64624584", "0.6455726", "0.63872254", "0.6296405", "0.62341386", "0.6185639", "0.61484396", "0.6127456", "0.61109376", "0.60871255", "0.60606647", "0.60516...
0.0
-1
Test if using undefined keys in features with predefined size or field names causes an exception.
def test_field_name_errors(): group = Group({"test": CustomSized(), }) group.set_test(5) assert_raises(KeyError, group.push) group = Group({"test": CustomNamed(), }) group.set_test("e") assert_raises(KeyError, group.push)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _check_for_unsupported_schema_fields(schema):\n if schema.sparse_feature:\n logging.warning('The input schema has sparse features which'\n ' are currently not supported.')", "def is_zero_dict( dict ):\n has_any_features = False\n for key in dict:\n has_any_features = has_a...
[ "0.69130564", "0.634529", "0.6202998", "0.6143627", "0.6138493", "0.6115828", "0.6083164", "0.594095", "0.594095", "0.5913152", "0.590867", "0.58996445", "0.5898748", "0.589319", "0.5874625", "0.5874482", "0.5858971", "0.58570707", "0.58447146", "0.58440685", "0.5839924", "...
0.554681
50
Test if array can be build from empty features when the field size or the field names are fixed.
def test_custom_empty(): group = Group({ "a": CustomSized(), "b": CustomNamed(), "c": Numerical(dimensions=4), "d": Hashed(buckets=4), "e": Categorical([1, 2, 3, 4]), }) for i in range(10): group.push() array = group.array() assert array.shape == (1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def f_supports(self, data):\n dtype = type(data)\n if dtype is tuple or dtype is list and len(data) == 0:\n return True # ArrayParameter does support empty tuples\n elif dtype is np.ndarray and data.size == 0 and data.ndim == 1:\n return True # ArrayParameter supports...
[ "0.65964544", "0.647808", "0.63849956", "0.6338137", "0.6333534", "0.6268299", "0.62431586", "0.61735314", "0.6156284", "0.6152013", "0.6133537", "0.6133537", "0.61284035", "0.6114361", "0.61137617", "0.6066248", "0.60511184", "0.6048782", "0.6030363", "0.6017818", "0.5988865...
0.0
-1
Test if array concatenation works.
def test_array_concat(): array = Array(columns="abc") for i in range(10): array.append([1, 2, 3]) # Any 2-dimensional array witht the same number of rows should work. other = [[4, 5, 6]] * len(array) array.concat(other) assert array.shape == (10, 6) assert len(array.columns) == 6 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test01(self):\n a = np.arange(1000)\n b = bcolz.carray(a, chunklen=1, rootdir=self.rootdir)\n b.append(a)\n # print \"b->\", `b`\n c = np.concatenate((a, a))\n assert_array_equal(c, b[:], \"Arrays are not equal\")", "def test03(self):\n a = np.arange(1e4)\n ...
[ "0.71296877", "0.7055316", "0.69996417", "0.67035186", "0.6662046", "0.64107263", "0.6404458", "0.6371694", "0.6330895", "0.63107747", "0.6218703", "0.6131409", "0.6072472", "0.60144913", "0.5992456", "0.597871", "0.5963048", "0.5954356", "0.59503627", "0.5942833", "0.5925160...
0.7229425
0
Test if transforming the array works.
def test_pipe_simple(): def transform(array): """Turns the (n,2) array into a (n,4) array.""" assert array.shape == (10, 2) new = Array(columns="abcd") for x, y in array: new.append([x, y, x + y, x * y]) return new group = Pipe(Group({"a": Numerical(), "b": ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_transform(self):\n t = Enumerate([2, \"asfa\", \"ipsi\"])\n assert t.transform(2) == 0\n assert t.transform(\"asfa\") == 1\n assert t.transform(\"ipsi\") == 2\n with pytest.raises(KeyError):\n t.transform(\"aafdasfa\")\n assert numpy.all(\n t...
[ "0.7060562", "0.6684099", "0.65899926", "0.65693116", "0.6499308", "0.6458877", "0.645005", "0.64077723", "0.63759315", "0.62878346", "0.61688924", "0.6164394", "0.6134178", "0.61210686", "0.6116632", "0.6107201", "0.6093356", "0.6074735", "0.60722286", "0.60400724", "0.60369...
0.0
-1
Turns the (n,2) array into a (n,4) array.
def transform(array): assert array.shape == (10, 2) new = Array(columns="abcd") for x, y in array: new.append([x, y, x + y, x * y]) return new
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_nibble_array(arr: ndarray) -> ndarray:\n arr = arr.ravel()\n return (arr[::2] + (arr[1::2] << 4)).astype(\"uint8\")", "def matrix4_to_3x4_array(mat):\r\n return tuple(f for v in mat[0:3] for f in v)", "def create_array( n ):", "def to_array(X, n=2):\n return np.array([np.eye(n)[x] for x in...
[ "0.6299503", "0.62471116", "0.6135411", "0.60306585", "0.59801215", "0.59801215", "0.5971381", "0.5949728", "0.5925237", "0.58508295", "0.5849235", "0.58042186", "0.57584757", "0.5721797", "0.571671", "0.56908566", "0.56908566", "0.56908566", "0.56880254", "0.5633662", "0.561...
0.5201071
73
A Sequence of AWG Cores.
def awgs(self) -> t.Union[t.Sequence[AWG], Node]: if "AWG" not in self.features.options(): logger.error("Missing option: AWG") return Node( self._root, self._tree + ("awgs",), ) return NodeList( [ AWG( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cg(self):\n\n _cg = [0, 0, 0]\n _sumProduct = [0, 0, 0]\n _sumWeight = 0\n\n for fstnr in self:\n # Calculate the sum of the products\n for i, component in enumerate(fstnr.xyz):\n _sumProduct[i] += component * fstnr.wt\n\n # Calculate ...
[ "0.5574133", "0.53772056", "0.53357095", "0.5283083", "0.52788275", "0.5273213", "0.5222399", "0.51976293", "0.51760423", "0.5161018", "0.5147553", "0.5111785", "0.5092093", "0.50634205", "0.5053241", "0.5039575", "0.50389385", "0.501876", "0.50118065", "0.50114757", "0.50087...
0.5017676
18
Read 2dimensional realvalued features with associated class labels
def read_data(path, d=','): arr = numpy.genfromtxt(path, delimiter=d, dtype=None) length = len(arr) x = numpy.zeros(shape=(length, 2)) t = numpy.zeros(length, dtype=int) for i, (x1, x2, tv) in enumerate(arr): x[i, 0] = x1 x[i, 1] = x2 t[i] = int(tv) return x, t
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_data(feature_file, label_file):", "def load_data(class_fnames):\n X = []\n y = []\n for label, fnames in enumerate(class_fnames):\n for fname in fnames:\n X.append(cv2.imread(fname))\n y.append(label)\n X = np.stack(X)\n y = np.stack(y)\n return X, y", "d...
[ "0.6834548", "0.66014194", "0.6516929", "0.64742565", "0.6434231", "0.6379081", "0.63573194", "0.63504636", "0.6342509", "0.62751335", "0.6247352", "0.62230104", "0.62069976", "0.61604685", "0.6158316", "0.6132908", "0.6128687", "0.61250186", "0.61247563", "0.6107242", "0.610...
0.0
-1
Plot the data as a scatter plot
def plot_data(x, t, new_figure=True, save_path=None): # Plot the binary data ma = ['o', 's', 'v'] fc = ['r', 'g', 'b'] # np.array([0, 0, 0]), np.array([1, 1, 1])] tv = numpy.unique(t.flatten()) # an array of the unique class labels if new_figure: plt.figure() for i in range(tv.s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_scatter_points(self):\n self.plot(1)", "def scatter_plot(self):\n\n X = self.reduce_dimension(n_components=2)\n\n plt.figure()\n plt.scatter(X[:,0], X[:,1])\n\n return plt", "def plot_scatter(data):\n minimum = data[data.columns[0]]\n distance = data[data.colum...
[ "0.7719039", "0.767001", "0.7650398", "0.75902605", "0.75371957", "0.75242335", "0.7382766", "0.73495", "0.7263594", "0.72284347", "0.7221781", "0.72211146", "0.7214683", "0.72076035", "0.71131575", "0.7094507", "0.7062563", "0.7052775", "0.70064485", "0.70044965", "0.6990876...
0.6269806
88
KNearest Neighbors classifier. Return the most frequent class among the k nearest points
def knn(p, k, x, t): # Number of instances in data set N = x.shape[0] Euclidean_Distance = numpy.square(x - p) #Euclidean distance dis = numpy.sum(Euclidean_Distance, axis=1) #sum of the euclidean distance inds = numpy.argsort(dis)[:k] #sort the indices of the distance array tgt_cat = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def knn_classify_point(point, data, k, distance_metric):\n k_closest_points = get_k_closest_points(point, data, k, distance_metric)\n classification_counts = {}\n for item in k_closest_points:\n classification_type = item.classification\n if classification_type not in classification_counts:\...
[ "0.7780232", "0.77610284", "0.7689671", "0.7591956", "0.75637233", "0.7306566", "0.7278552", "0.72072935", "0.71550226", "0.71461403", "0.71255", "0.71031046", "0.70180625", "0.69530344", "0.6946558", "0.6925374", "0.6919172", "0.6916706", "0.6903651", "0.6782697", "0.6778249...
0.83432674
0
Given data (observed x and labels t) and choice k of nearest neighbors, plots the decision boundary based on a grid of classifications over the feature space.
def plot_decision_boundary(k, x, t, granularity=100, figures_root='../figures', data_name=None): print(f'KNN for K={k}') # Initialize meshgrid to be used to store the class prediction values # this is used for computing and plotting the decision boundary contour pointsX = numpy.linspace(numpy.mi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_knn_boundaries(knn, h=0.02): # h = Step size in the mesh\n ax = plt.gca()\n [xmin, xmax] = ax.get_xlim()\n [ymin, ymax] = ax.get_ylim()\n # Generate the axis associated to the first feature: \n x_axis = np.arange(xmin, xmax, h)\n # Generate the axis associated to the 2nd feature: \n y...
[ "0.7444855", "0.6746422", "0.66787404", "0.64081985", "0.6387924", "0.63505673", "0.62327814", "0.62229425", "0.61925626", "0.6169651", "0.61491215", "0.61412793", "0.6130474", "0.61028457", "0.60486627", "0.6044063", "0.6039184", "0.60355693", "0.599889", "0.5996375", "0.593...
0.7342933
1
Inits the client manager.
def __init__(self, **auth_kwargs): self.session = None self.neutron = None self.nova = None self.glance = None self.cinder = None self.swift = None self.keystone = None self.auth_kwargs = auth_kwargs
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def client_setup(self):\n self.client = Client()", "def init_client(self, client):\n self.client = client", "def initialize(self):\n self._validate_client_objects()\n for execution_type in self.clients:\n # check for valid connection is done in _validate_client_objects()\...
[ "0.7732741", "0.7679714", "0.71822697", "0.7145595", "0.70865464", "0.7035242", "0.7014164", "0.69719917", "0.6842564", "0.6798126", "0.6751508", "0.67443424", "0.6720339", "0.6716731", "0.67079747", "0.6699051", "0.66531205", "0.6575444", "0.65571284", "0.655429", "0.6543513...
0.6048933
89
Get a keystone auth session.
def get_session(self): if self.session is None: # loader = loading.get_plugin_loader('password') # auth = loader.load_from_options(**self.auth_kwargs) auth = v3.Password(**self.auth_kwargs) self.session = session.Session(auth=auth) return self.session
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_session():\n assert config.AUTH_URL, \"Environment variable OS_AUTH_URL is not defined\"\n\n def _get_session(auth_url=None,\n username=None,\n password=None,\n project_name=None,\n user_domain_name=None,\n ...
[ "0.8036264", "0.7163002", "0.705678", "0.7039849", "0.69910294", "0.69805986", "0.6977348", "0.69680965", "0.68606806", "0.6850855", "0.68429095", "0.6802599", "0.6802599", "0.6759136", "0.6674402", "0.6669936", "0.6636045", "0.6635824", "0.6607306", "0.6601134", "0.65489656"...
0.6903718
8
Get a nova client instance.
def get_nova(self, version='2.1'): if self.nova is None: self.nova = novaclient.Client(version, session=self.get_session()) return self.nova
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_nova_client(self):\n region_name = CONF.region_name\n session = self._get_keystone_session()\n return novaclient.client.Client(2, session=session, region_name=region_name)", "def get_novaclient(self):\n # TODO: We ought to be able to derive this from the keystone client,\n ...
[ "0.8543932", "0.7357674", "0.73333573", "0.72716653", "0.7151151", "0.6966708", "0.69495815", "0.6702617", "0.667086", "0.6567023", "0.6537803", "0.6491878", "0.64906466", "0.64767176", "0.6461029", "0.64514875", "0.63861746", "0.63556963", "0.63503575", "0.63300276", "0.6299...
0.76938033
1
Get a neutron client instance.
def get_neutron(self, version='2'): if self.neutron is None: self.neutron = neutronclient.Client(session=self.get_session()) return self.neutron
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_neutron_client(self):\n session = self._get_keystone_session()\n return neutronclient.v2_0.client.Client(session=session)", "def _get_nova_client(self):\n region_name = CONF.region_name\n session = self._get_keystone_session()\n return novaclient.client.Client(2, sessi...
[ "0.83219314", "0.76559037", "0.7583974", "0.7498433", "0.7013949", "0.70020646", "0.69358927", "0.6753864", "0.6684781", "0.668257", "0.66047627", "0.65611005", "0.65462434", "0.65265024", "0.6525972", "0.6487087", "0.6480219", "0.64514047", "0.6430272", "0.63588655", "0.6354...
0.7441862
4
Get a glance client instance.
def get_glance(self, version='2'): if self.glance is None: self.glance = glanceclient(version, session=self.get_session()) return self.glance
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_glance_client(self):\n session = self._get_keystone_session()\n return glanceclient.client.Client(2, session=session)", "def client(self):\n\n if self._client is None:\n self._client = self._get_client()\n return self._client", "def client():\n\n client = Clie...
[ "0.8825718", "0.7007617", "0.69371164", "0.6927475", "0.6900914", "0.68201137", "0.6812655", "0.6797418", "0.6797418", "0.6663279", "0.6625562", "0.6587854", "0.65376866", "0.6535913", "0.65322053", "0.6514193", "0.64772695", "0.64697844", "0.6460001", "0.64531165", "0.640168...
0.7610261
1
Get a cinder client instance.
def get_cinder(self, version='2'): if self.cinder is None: iface = os.getenv('OS_ENDPOINT_TYPE', "public") self.cinder = cinderclient.Client(version, session=self.get_session(), interface=iface) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def client(self):\n\n if self._client is None:\n self._client = self._get_client()\n return self._client", "def get_client(self):\n return self.client", "def client(self):\r\n if self._client is None:\r\n self._client = self._client_cls(self._server, self._para...
[ "0.73013985", "0.72929657", "0.6969015", "0.6965939", "0.6891236", "0.6887506", "0.6877181", "0.68472075", "0.67757213", "0.6775586", "0.67501026", "0.6738668", "0.6736952", "0.6705865", "0.6692368", "0.6692368", "0.6643166", "0.66352206", "0.66271734", "0.659036", "0.6577383...
0.7038478
2
Get a swift client.Connection instance.
def get_swift(self): if self.swift is None: self.swift = swiftclient.Connection( auth_version='3', authurl=self.auth_kwargs["auth_url"], user=self.auth_kwargs["username"], key=self.auth_kwargs["password"], tenant_name=se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_connection(self):\n c = httplib.HTTPConnection(self.server)\n return c", "def get_swiftclient():\n swift_conn = swiftclient.client.Connection(\n authurl=os.environ.get(\"OS_AUTH_URL\"),\n user=os.environ.get(\"OS_USERNAME\"),\n key=os.environ.get(\"OS_PASSWORD\"),\n ...
[ "0.72027934", "0.7086128", "0.6808257", "0.67928064", "0.6765041", "0.6715244", "0.66940707", "0.66649985", "0.6593805", "0.6565049", "0.65543133", "0.6501697", "0.64977556", "0.64977556", "0.6481265", "0.6448724", "0.6448724", "0.64482147", "0.6444177", "0.643537", "0.642600...
0.7363057
0
Get a keystone client instance.
def get_keystone(self, version='3'): if self.keystone is None: iface = os.getenv('OS_ENDPOINT_TYPE', "public") self.keystone = keystoneclient.Client( version=version, session=self.get_session(), interface=iface) return self.keystone
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_keystoneclient(self):\n try:\n if self.token is None:\n client = keystoneclient.Client(user_name=self.cluster_account.cluster_user_name,\n password=self.cluster_account.cluster_password,\n ...
[ "0.81075597", "0.8094052", "0.7934589", "0.76208735", "0.76208735", "0.74618495", "0.7417962", "0.7401862", "0.73747593", "0.729122", "0.7265158", "0.7255715", "0.7149866", "0.7061689", "0.70608056", "0.704505", "0.70287734", "0.7017763", "0.6964742", "0.6892199", "0.6867459"...
0.7938663
2
'voltage' should be a dict of numpy arrays of floatingpoint numbers. The keys of 'voltage' are integers, 03. Each element of 'voltage' should start and end near zero. 'repetitions' and 'rate' should be integers.
def __init__( self, voltage={0:(0, 0)}, rate=500, repetitions=1, board_name='cDAQ1Mod1', voltage_limits=None, num_channels=7): self.board_name = board_name #Check Measurement and Automation Explorer self._taskHandle = ctypes.c_void_p(0) self.num_channels = num_channels DA...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_voltage_data(self):\n self.voltage_record = {}\n self.threshold_value = {}\n for l in self.network.layers:\n if 'v' in self.network.layers[l].__dict__:\n self.voltage_record[l] = self.network.monitors['{:}_voltages'.format(l)].get('v')\n if 'thresh'...
[ "0.5384202", "0.53538734", "0.5352361", "0.529449", "0.5280764", "0.5153001", "0.51174885", "0.5016881", "0.4978907", "0.494465", "0.49282992", "0.48579437", "0.48414347", "0.48238522", "0.48228803", "0.4811493", "0.48023042", "0.47906768", "0.4784123", "0.47702235", "0.47668...
0.55513275
0
You shouldn't have to call this yourself unless you're trying to optimize performance. This should get called automatically, as needed, by 'scan'.
def write_voltage(self): if self._unplayed_voltages: raise UserWarning( "After you write voltages to the DAQ card, you have to scan\n" + "the voltage at least once before you can set the voltage\n" + "again.") DAQmxErrChk(api.DAQmxWriteAnalogF6...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _scan(self): # pragma: no cover\n raise NotImplementedError()", "def scan(self):\n return", "def scan(self) -> List[int]:", "def scan(self) -> List[int]:", "def scan(self) -> list[int]:", "def scan(self) -> Collection[int]:\n ...", "def test_get_scans(self):\n pass", ...
[ "0.74488825", "0.6680533", "0.6557721", "0.6557721", "0.64835787", "0.6480018", "0.61668414", "0.61504644", "0.60862774", "0.6066822", "0.6051269", "0.604504", "0.60443306", "0.59857833", "0.5771174", "0.5683425", "0.5614547", "0.56018776", "0.55780876", "0.5559289", "0.55592...
0.0
-1
Given rows of normal vectors to line L, return points (rows) that are somewhere on each line Just find intersection with some basis line.
def points_on_lines(hyperplanes): intersections = [] for row in hyperplanes: intersections.append(an_intersection(row[:-1], -row[-1])) return np.array(intersections)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_intersect_points(line1, line2):\n intersect_points = matrix.matrix_sol([line1, line2])\n return intersect_points", "def intersection(line1, line2):\n p0, p1, p2, p3 = map(\n lambda tup : np.array(tup[:2]),\n [line1[0], line1[1], line2[0], line2[1]]\n )\n p1, p2, p3 = map(lamb...
[ "0.68824154", "0.6712293", "0.654148", "0.64509463", "0.64332", "0.6398922", "0.6371681", "0.6350881", "0.6311801", "0.6303512", "0.62909174", "0.6267723", "0.62216777", "0.6182562", "0.61743903", "0.6087039", "0.6078734", "0.6011505", "0.60104203", "0.5943569", "0.5912073", ...
0.6902687
0
Get intersection with some basis line
def an_intersection(v1, b1): try: return intersection(v1, b1, np.array([1,1]), 0) except np.linalg.linalg.LinAlgError: print v1 return intersection(v1, b1, np.array([-1,1]), 0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def intersection(line1, line2):\n p0, p1, p2, p3 = map(\n lambda tup : np.array(tup[:2]),\n [line1[0], line1[1], line2[0], line2[1]]\n )\n p1, p2, p3 = map(lambda x : x - p0, [p1, p2, p3])\n transform = np.zeros((2, 2))\n transform[:,0], transform[:,1] = p1, p2\n if np.linalg.det(tr...
[ "0.79033774", "0.7781142", "0.763585", "0.759173", "0.75264156", "0.7498257", "0.7412484", "0.73506904", "0.7265628", "0.72416824", "0.7208849", "0.72006744", "0.71884364", "0.7114838", "0.7074302", "0.7025444", "0.7015237", "0.70007503", "0.6991902", "0.6991328", "0.69785804...
0.657359
41
Set up the LayZ Spa component.
async def async_setup(hass: HomeAssistant, config: dict): hass.data[DOMAIN] = {} return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup(self, stage: Optional[str] = None) -> None:", "def SetUpLayerManager(self):\n pass", "def setup(self):\n self.ae = None", "def setup_class(self):\n # Blackbody: bb(5000)\n self.bb = SourceSpectrum(BlackBodyNorm1D, temperature=5000)\n\n # Gaussian emission line: em(5...
[ "0.6041124", "0.6023509", "0.5904585", "0.5892326", "0.5793188", "0.5763117", "0.57407904", "0.5732804", "0.5718261", "0.570464", "0.5694896", "0.56861675", "0.5647585", "0.56182", "0.5605254", "0.5602402", "0.55925673", "0.55925673", "0.55925673", "0.55925673", "0.55925673",...
0.0
-1
Set up LayZ Spa from a config entry.
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry): hub = Spa(entry.data[CONF_API], entry.data[CONF_DID]) await hub.update_status() _LOGGER.warning("temp %s", hub.temp_now) hass.data[DOMAIN][entry.entry_id] = {} hass.data[DOMAIN][entry.entry_id][HUB] = hub hass.data[DOMAIN][ent...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, config_entry):\n self.config_entry = config_entry", "def __init__(self, config_entry):\n self.config_entry = config_entry", "def setup_config(self, args=None):\n self.config_parse(args=args)", "def provider_setup(cls, args, config):\n if len(args) < 1:\n ...
[ "0.575565", "0.575565", "0.56301713", "0.55638593", "0.5519828", "0.5385264", "0.5352522", "0.5347906", "0.5321907", "0.528488", "0.5280284", "0.52756244", "0.5265489", "0.52172726", "0.516801", "0.51658285", "0.50733215", "0.50239307", "0.50198895", "0.50092506", "0.4990384"...
0.0
-1
Fetch data from API endpoint. This is the place to preprocess the data to lookup tables so entities can quickly look up their data.
async def async_update_data(): try: # Note: asyncio.TimeoutError and aiohttp.ClientError are already # handled by the data update coordinator. async with async_timeout.timeout(10): return await hub.update_status() except InvalidPasswordOrEmail as err: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _fetch_data(self):\n pass", "def _load_data(self):\n if self._api_response.status_code == 200:\n self._dataset = self._api_response.json()\n self._fill_day_dicts()", "def fetch_entity(endpoint, values):\n values['entity'] = Entity.objects.get_or_404(name=values['entit...
[ "0.64704037", "0.6393368", "0.62753636", "0.61291873", "0.6107467", "0.59635717", "0.5958843", "0.5937075", "0.5928641", "0.58827174", "0.5872337", "0.58669746", "0.58654255", "0.58403516", "0.5829332", "0.58139884", "0.58029085", "0.5763503", "0.56696826", "0.5658464", "0.56...
0.0
-1
Unload a config entry.
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry): unload_ok = all( await asyncio.gather( *[ hass.config_entries.async_forward_entry_unload(entry, component) for component in PLATFORMS ] ) ) if unload_ok: has...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def async_unload_entry(hass, config_entry):\n unload_ok = await hass.config_entries.async_forward_entry_unload(\n config_entry, \"climate\"\n )\n return unload_ok", "async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:\n hass.data.pop(DOMAIN)\n return True", ...
[ "0.697284", "0.6888074", "0.6779855", "0.6747459", "0.6689002", "0.6657831", "0.66162205", "0.6603433", "0.65925974", "0.65595686", "0.65411645", "0.6507643", "0.6507643", "0.6507643", "0.6507643", "0.64977276", "0.64931643", "0.6486601", "0.6486601", "0.6486601", "0.6486601"...
0.6459733
29
Creates a BuienRadar class
def __init__(self): self.buienradar_rpc = {"rain_at": self.rain_at, "rain_max": self.rain_max } multiprocessing.Process.__init__(self) self.name = 'buienradar' self.shutdown = False self._sched = None self._ra...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_radar_chart(num_vars, frame='polygon', **kwargs):\n theta = _theta(num_vars)\n\n def draw_poly_patch(self):\n verts = _unit_poly_verts(theta)\n return plt.Polygon(verts, closed=True, edgecolor='k')\n\n def draw_circle_patch(self):\n # unit circle centered on (0.5, 0.5)\n ...
[ "0.61111647", "0.5954283", "0.591362", "0.5875578", "0.58498406", "0.583478", "0.5827427", "0.57784045", "0.5732358", "0.56992537", "0.56636226", "0.5654638", "0.5638714", "0.5612462", "0.5602551", "0.56001383", "0.5584329", "0.5574126", "0.55410784", "0.55343825", "0.5528675...
0.54834235
24
Initializes the scheduler to poll every five minutes and start it
def _init_scheduler(self): self._sched = BackgroundScheduler() self._sched.add_job(self._check_rain, trigger='cron', minute='*/5') self._sched.start()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize_scheduler(self):\n scheduler = BackgroundScheduler()\n scheduler.add_job(self.do, 'interval', minutes=1)\n scheduler.start()\n self.do()", "def initialize_scheduler(self):\n scheduler = BackgroundScheduler()\n scheduler.add_job(self.do, 'interval', minutes...
[ "0.7595585", "0.7595585", "0.7579649", "0.749416", "0.7138583", "0.7092702", "0.67534935", "0.6750422", "0.67337924", "0.6687412", "0.65673363", "0.65599716", "0.6548511", "0.652253", "0.6520828", "0.64790255", "0.6437538", "0.6316568", "0.631423", "0.6258985", "0.62449056", ...
0.775051
0
Calculate the maximum amount of rain between now and now+minute Remote procedure to be called by the core of Domos
def rain_max(self, key=None, name=None, lat=None, lon=None, minute=0): self.logger.info("added sensor for rain max %s : %s for %s minutes" % (lat, lon, minute)) if key and lat and lon and minute: try: minute = int(minute) except: return False ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def rain_rate(self, value):\n if not value:\n return 0\n return await self.rain(value * 60)", "def max_humidity(self):\n return 60", "def find_tim(self):\n start_max = 0\n finish_max = 0\n op_mode = self.op_number + ',' + self.mode_number\n for ...
[ "0.59764725", "0.5706513", "0.5661375", "0.5645471", "0.5608999", "0.56051016", "0.55437905", "0.55279684", "0.5525821", "0.5406212", "0.53948325", "0.5393251", "0.5372555", "0.5347693", "0.5315714", "0.5262582", "0.5261224", "0.5259729", "0.52450776", "0.524259", "0.52310866...
0.5800529
1
Returns all the session names
def all (self): sparql_results = self.query (""" select distinct ?rs ?session ?name ?number ?pid ?sitename where { ?rs rdf:type austalk:RecordedSession . ?rs olac:speaker ?participant . ?participant austalk:id ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filtered_session_names(self):\n return list(self.stage.filtered_sessions.keys())", "def name_list(qbo_session):\n\n return qbo_session.name_list()", "def sessions(self):\n return utils.listItems(self, '/status/sessions')", "def list(self):\n return {str(k): v for k, v in self.rpc....
[ "0.80101985", "0.70593977", "0.7002973", "0.699865", "0.6964485", "0.6819654", "0.6812653", "0.67430043", "0.67428505", "0.673906", "0.6594309", "0.6576731", "0.6563603", "0.6563603", "0.65445304", "0.653696", "0.65162706", "0.64749575", "0.64749575", "0.6448738", "0.64160097...
0.60177344
48
Returns all the session names for a participant
def filter_by_participant (self, participant): sparql_results = self.query (""" select distinct ?rs ?session ?name ?number ?pid ?sitename where { BIND (<%s> AS ?participant) ?rs rdf:type austalk:RecordedSession . ?rs o...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filtered_session_names(self):\n return list(self.stage.filtered_sessions.keys())", "def search_sessions(name: str, provider: Optional[str] = None) -> List[str]:\n sessions = session_list(provider=provider).sessions\n name = name.lower()\n return [s.id for s in sessions if s.id.lower().startsw...
[ "0.6723869", "0.63031816", "0.62869734", "0.62178284", "0.6213438", "0.6011497", "0.60053223", "0.59663093", "0.5954626", "0.5935582", "0.5870372", "0.5859776", "0.5857662", "0.5844726", "0.57861197", "0.57147163", "0.5673998", "0.56739765", "0.56506336", "0.5621848", "0.5617...
0.67719805
0
Returns all the session names for a site identified by site label
def filter_by_site (self, label): sparql_results = self.query (""" select distinct ?rs ?session ?name ?number ?pid WHERE { ?rs rdf:type austalk:RecordedSession . ?rs olac:speaker ?participant . ?participant austalk...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filtered_session_names(self):\n return list(self.stage.filtered_sessions.keys())", "def search_sessions(name: str, provider: Optional[str] = None) -> List[str]:\n sessions = session_list(provider=provider).sessions\n name = name.lower()\n return [s.id for s in sessions if s.id.lower().startsw...
[ "0.6083844", "0.5573907", "0.5564926", "0.54466736", "0.5325585", "0.53207505", "0.5316571", "0.527415", "0.5223453", "0.5201878", "0.5165152", "0.514091", "0.5095732", "0.50864303", "0.5076436", "0.50540745", "0.50449497", "0.5036865", "0.50282997", "0.50101763", "0.49757937...
0.71040463
0
Simple name representation for a session
def __unicode__ (self): return self.name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_name(self):\n return utils.to_unicode(lib.sp_session_user_name(self._sp_session))", "def name(self) -> str:\n return f\"{self._inst} {self._sid_data['sid']} {self._data[self._sid_data['sid_name']]}\"", "def get_session_name(self, vid):\n return \"ssn-{0}\".format(vid)", "def nam...
[ "0.69617414", "0.6902516", "0.68717957", "0.6436865", "0.642208", "0.63811517", "0.637589", "0.6362622", "0.63417363", "0.6340011", "0.6340011", "0.6340011", "0.6340011", "0.63188624", "0.6313412", "0.6313412", "0.6306013", "0.63002694", "0.63002694", "0.63002694", "0.6300269...
0.0
-1
Delete one or more keys specified by ``keys``
async def delete(self, *keys, **kwargs): def gen_keys(keys): all_keys = [] for key in keys: if isinstance(key, list): all_keys += gen_keys(keys=key) else: all_keys.append(key) return all_keys al...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_many(self, keys):\n raise NotImplementedError()", "def delete_many(self, keys):\n try:\n if keys:\n self._cache.delete(*map(self.prepare_key, keys))\n except Exception as err:\n return self.warn_or_error(err)", "def delete(cls, *keys):\n ...
[ "0.8140219", "0.8091643", "0.80413496", "0.8027012", "0.7771675", "0.7751918", "0.7727257", "0.7682047", "0.7680383", "0.7599218", "0.7451378", "0.7443246", "0.73895985", "0.7378481", "0.7349482", "0.7295384", "0.72044706", "0.7172078", "0.71646804", "0.711923", "0.7093819", ...
0.8353874
0
Return a boolean indicating whether key field exists
async def exists(self, field, **kwargs): return await self._client_conn.hexists(key=self.name, field=field)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_key(self, key):\n return key in self.db", "def has(self, key):", "def has(self, key):\n return False", "def has_key(self, key):\n return self.__dict__.has_key(key)", "def has_key(self, name):\n return self[name] <> None", "def key_in_field(self, key, fields):\n ...
[ "0.77291733", "0.75882906", "0.7558047", "0.75283784", "0.7455858", "0.7444074", "0.7414749", "0.7410323", "0.7327293", "0.7311727", "0.72822326", "0.7263533", "0.72487915", "0.7246976", "0.72341603", "0.71927756", "0.7162223", "0.71532154", "0.7148976", "0.7122543", "0.70960...
0.66703105
51
Return the value at key ``name``, or None if the key doesn't exist
async def get(self, field, default=None, **kwargs): return await self._client_conn.hget(self.name, field=field)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_value(name):\n\n named_value = get_named_value_raw(name)\n if named_value is not None:\n return named_value.value", "def __getitem__(self, name):\n value = self.get(name)\n if value is not None:\n return value\n raise KeyError(name)", "def find_by_name(self,...
[ "0.76976645", "0.76092434", "0.76021016", "0.7348735", "0.7155338", "0.70988375", "0.70493174", "0.69803816", "0.6933706", "0.6867564", "0.68649185", "0.68042666", "0.67748713", "0.672533", "0.67226636", "0.67117316", "0.6637197", "0.6624307", "0.66132957", "0.65803933", "0.6...
0.0
-1
Return a random value
async def get_random(self, default=None, **kwargs): all_dict = await self.get_all() if all_dict: key = random.choice(list(all_dict.keys())) return { key: all_dict[key] } else: return default
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_random_value(self):\r\n return random.randint(1, 10)", "def random():\r\n return R.NextDouble()", "def random():\n return constant(1)", "def get_random_value():\n return randint(0, 255) / 256.0", "def get_random_value():\n return randint(0, 255) / 256.0", "def getR...
[ "0.866445", "0.8307578", "0.826182", "0.8153366", "0.81142724", "0.8095736", "0.8095736", "0.8003371", "0.79239017", "0.783512", "0.7658656", "0.7626082", "0.75570095", "0.7474726", "0.7451215", "0.7407844", "0.7406439", "0.740506", "0.73764557", "0.73764557", "0.73675555", ...
0.0
-1
Lee la base de datos de la carpeta y la carga como un data frame
def lee_base_covid(fecha): zipname = "data/"+fecha+"COVID19MEXICO.zip" filename = fecha+"COVID19MEXICO.csv" try: start_time = time() zipfile = ZipFile(zipname) df = pd.read_csv(zipfile.open(filename), parse_dates=True) end_time = time() total_time = end_time - start_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _setup_dataframe(self, serie, metadata=None):\n header = self.get_data_header(serie, dataset='cnv')\n df = self.get_data_in_frame(serie, header, dataset='cnv')\n df = self.df_handler.map_column_names_of_dataframe(df)\n\n return df", "def __create_data_frame(self, soup):\n s...
[ "0.67799217", "0.6739709", "0.672318", "0.6723062", "0.6696471", "0.6675288", "0.6670434", "0.6617273", "0.65177196", "0.64534414", "0.64362025", "0.6365479", "0.63300186", "0.63290566", "0.6327225", "0.63239545", "0.63196117", "0.63137674", "0.630125", "0.6300652", "0.626449...
0.6087042
31
Tratamiento de la base datos para poder usarla en el algoritmo
def prepare_melody(melody_dframe): S = [] # es la lista en la que queda guardada la melodía en el formato correcto for i in range(len(melody_dframe)): # este if es para contemplar los silencios como una nota de pitch 0 if i > 0 and abs(S[-1][1]-melody_dframe.iloc[i, 0]) > 0.001: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def insert_data(self):\n # Make a connexion with a mock database\n self.generate_data_collection()", "def _database(self):\n ...", "def _importInDjango(self):\n\n with open(settings.DATA_PATH, 'r', encoding='latin-1') as csv_file:\n reader = csv.DictReader(csv_file, delim...
[ "0.6196703", "0.5996628", "0.5992133", "0.5989583", "0.59360296", "0.59161276", "0.5913229", "0.5900204", "0.588538", "0.5868029", "0.58524144", "0.5828052", "0.58185756", "0.5817846", "0.57922584", "0.5788057", "0.5701537", "0.5690327", "0.567897", "0.5660096", "0.5645931", ...
0.0
-1
funcion para visualizar lo que se desplaza Q para cada epsilon
def secuencia(R, Q, q): n = 1 r = [] for qq in q: for qqq in qq.eps: r.append(qqq) r = sorted(r) for l in r: print('la l', l) Qaux = [] for j in range(len(Q)): notaux = [] notaux.append(Q[j][0]+j*l[0]) not...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def epsilon_delta(self):", "def test_q(self):\n assert np.allclose(self.stepper.q, self.ODE.exact(self.stepper.t), rtol=1e-3, atol=1e-5)", "def greedy_eps(self, Q):\r\n s = self.get_state()\r\n s_x, s_y = s[0][0], s[0][1]\r\n s_vx, s_vy = s[1][0], s[1][1]\r\n if np.random.ran...
[ "0.68171436", "0.6283236", "0.61913866", "0.6162494", "0.6137614", "0.61371356", "0.61351055", "0.60722744", "0.5978949", "0.5960126", "0.59534186", "0.59087783", "0.5905014", "0.5886242", "0.5830619", "0.5824134", "0.5795988", "0.57408494", "0.5716115", "0.5714753", "0.57073...
0.6147279
4
Generar y preparar melodia de consulta apartir de un archivo .csv
def create_query(query_path): query = pd.read_csv(query_path, names=["inicio", "duración", "tono", query_path[62:-4]]).drop([0], axis=0) time_where_query_starts = float(query.iloc[0, 0]) # cambiar formato de string a float y desplazar la cancion para forzar...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_csv():", "def procesarFilaCuerpo(fila):\r\n csv = \"\"\r\n columnas = fila.split(\"</td>\")\r\n for col in columnas:\r\n csv += procesarColumnaCuerpo(col)+\";\"\r\n \r\n csv = csv[:-1] #quitar el śltimo ;\r\n print csv\r\n return csv", "def format_porteurs(filepath):\n ...
[ "0.6793251", "0.6274848", "0.62337714", "0.6202803", "0.6107997", "0.60955846", "0.60521036", "0.60283566", "0.5975984", "0.59122914", "0.5902194", "0.5892259", "0.5851414", "0.5821785", "0.58078057", "0.578318", "0.5779465", "0.57591194", "0.57591194", "0.5738218", "0.572883...
0.5444409
46
Get options from vct config file
def get_vct_config(var): vct_root = get_vct_root() context = { 'var': var, 'source': """ if [ -f %(vct_root)s/vct.conf.overrides ]; then . %(vct_root)s/vct.conf.default . %(vct_root)s/vct.conf.overrides elif [ -f %(vct_root)s/vct.conf ]; then...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_options(self,options_file):\n config=ConfigParser.ConfigParser()\n config.read(options_file)\n return config", "def options(self):\n\t\treturn self.config_parser.options(self.section_name)", "def autostart_read_options(self,options_file):\n config=ConfigParser.ConfigParser(...
[ "0.7112448", "0.6667187", "0.66389835", "0.65258443", "0.64888626", "0.64602494", "0.6437445", "0.6428669", "0.6369955", "0.6348633", "0.6293149", "0.6288183", "0.6242046", "0.6238758", "0.62077934", "0.6206483", "0.6179304", "0.61739796", "0.6169169", "0.61607754", "0.608852...
0.6026467
26
Method to read a well at a certain position
def read_well(self, row, col): try: col = int(col) except ValueError: print('Error! COLS have to be integers!') exit(1) w = self._plate_df.iloc[ROW_TO_INDEX[row]][col] return w
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read():\n # TODO", "def readentry(self):\n # because of the complexity of the format, have to parse\n # the whole file at once.\n if self.__blocks is None:\n self.__parse()\n if self.__blocks.has_key('data') and self.__blocks['data'].has_key('matrix'):\n i...
[ "0.587106", "0.57935244", "0.57673585", "0.5558961", "0.5488502", "0.5469904", "0.54450524", "0.5361794", "0.53559667", "0.5308596", "0.52896506", "0.52439475", "0.52334213", "0.52206546", "0.51920587", "0.5184739", "0.5168924", "0.51680005", "0.5153771", "0.51435596", "0.513...
0.5471764
5
It should create color shapes in the given data directory.
def test_create_shapes(data_dir): dataset.create_shapes(10, 10, 1, data_dir=data_dir) img_path = os.path.join(data_dir, "ellipse/0.png") assert os.path.exists(img_path) img = imageio.imread(img_path) assert img.shape == (10, 10, 4)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_shapes_grayscale(data_dir):\n dataset.create_shapes(10, 10, 1, channels=1, data_dir=data_dir)\n img_path = os.path.join(data_dir, \"ellipse/0.png\")\n assert os.path.exists(img_path)\n img = imageio.imread(img_path)\n assert img.shape == (10, 10)", "def load_shapes(self,count,img_f...
[ "0.6856443", "0.618052", "0.60780936", "0.60242367", "0.5808405", "0.57668114", "0.5690427", "0.56130856", "0.5600461", "0.55399936", "0.54958624", "0.5479186", "0.5459529", "0.5456665", "0.5448621", "0.54074323", "0.5362034", "0.53619134", "0.5324682", "0.53203875", "0.53083...
0.70245886
0
It should create grayscale shapes in the given data directory.
def test_create_shapes_grayscale(data_dir): dataset.create_shapes(10, 10, 1, channels=1, data_dir=data_dir) img_path = os.path.join(data_dir, "ellipse/0.png") assert os.path.exists(img_path) img = imageio.imread(img_path) assert img.shape == (10, 10)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_shapes(data_dir):\n dataset.create_shapes(10, 10, 1, data_dir=data_dir)\n img_path = os.path.join(data_dir, \"ellipse/0.png\")\n assert os.path.exists(img_path)\n img = imageio.imread(img_path)\n assert img.shape == (10, 10, 4)", "def makeDataset(numberOfTrials, data_type):\n\n\tda...
[ "0.66889775", "0.6415231", "0.6367699", "0.63560754", "0.6261791", "0.6167243", "0.61289775", "0.60442597", "0.6023371", "0.5907351", "0.5826012", "0.57797915", "0.5760415", "0.57251453", "0.57180756", "0.57146996", "0.57077223", "0.56844974", "0.5684313", "0.56831986", "0.56...
0.78713274
0
Initialize a new FullyConnectedNet.
def __init__( self, hidden_dims, input_dim=3 * 32 * 32, num_classes=10, dropout=1, normalization=None, reg=0.0, weight_scale=1e-2, dtype=np.float32, seed=None, ): self.normalization = normalization self.use_dropout = dro...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialise_network(self):\n raise NotImplementedError", "def initialize_network(self):\n # intermediate layer size\n ils = int((self.specbinnum + self.numfilters) / 2)\n\n network = lasagne.layers.InputLayer((None, 1, self.specbinnum, self.numtimebins), self.input_var)\n\n ...
[ "0.69023705", "0.6850007", "0.6721665", "0.65706", "0.6532473", "0.64673805", "0.64505595", "0.64458954", "0.6434368", "0.64332235", "0.64150655", "0.6372491", "0.636863", "0.6341182", "0.6330495", "0.63025963", "0.6276662", "0.62390316", "0.6235152", "0.61963755", "0.6190024...
0.0
-1
Compute loss and gradient for the fullyconnected net.
def loss(self, X, y=None): X = X.astype(self.dtype) mode = "test" if y is None else "train" # Set train/test mode for batchnorm params and dropout param since they # behave differently during training and testing. if self.use_dropout: self.dropout_param["mode"] = mod...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_loss_and_gradients(self, X, y):\n # Before running forward and backward pass through the model,\n # clear parameter gradients aggregated from the previous pass\n # TODO Set parameter gradient to zeros\n # Hint: using self.params() might be useful!\n self.fulllayer1.W....
[ "0.7155436", "0.6939661", "0.685114", "0.68466926", "0.68327856", "0.67759883", "0.6716115", "0.66500854", "0.662701", "0.66258705", "0.660631", "0.65530854", "0.65456945", "0.6514191", "0.6513278", "0.6499993", "0.6499993", "0.6494454", "0.6474171", "0.6471904", "0.64706767"...
0.0
-1
Initializes a moving window object.
def __init__( self, interp, comm, dt, ptcl, v, p_nz, time, ux_m=0., uy_m=0., uz_m=0., ux_th=0., uy_th=0., uz_th=0., gamma_boost=None ) : # Check that the boundaries are open if ((comm.rank == comm.size-1) and (comm.right_proc is not None)) \ or ((comm.rank =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _positionWindow(self):\n\t\tif sys.platform=='win32':\n\t\t\tself.setGeometry(1050, 30, 375, 220)\n\t\telse:\n\t\t\tself.setGeometry(1050, 0, 375, 220)\n\t\t# self.move( (-screen.width()/2)+200, -screen.height()/2 )", "def __init__(self):\n\n # Window starting position\n x = 200\n y = 30...
[ "0.6633121", "0.65863085", "0.64811075", "0.64477473", "0.64404625", "0.64301646", "0.6363847", "0.629953", "0.6248835", "0.62308514", "0.62160885", "0.6184235", "0.61267334", "0.6118133", "0.61062235", "0.6091172", "0.6067022", "0.60565096", "0.6046603", "0.60445255", "0.603...
0.0
-1
Calculate by how many cells the moving window should be moved. If this is nonzero, shift the fields on the interpolation grid, and add new particles.
def move_grids(self, fld, comm, time): # To avoid discrepancies between processors, only the first proc # decides whether to send the data, and broadcasts the information. dz = comm.dz if comm.rank==0: # Move the continuous position of the moving window object sel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def swipeBase (self) :\n grid = self.grid\n\n #we start by putting every tile up\n for columnNbr in range(4) :\n nbrZeros = 4 - np.count_nonzero(grid[:,columnNbr])\n\n for lineNbr in range(4) :\n counter = 0\n while (grid[lineNbr, columnNbr] ...
[ "0.59834635", "0.5809151", "0.57765406", "0.56846297", "0.55949116", "0.5528766", "0.5480749", "0.54742026", "0.54698974", "0.54524153", "0.54521763", "0.54496145", "0.5448103", "0.5435209", "0.54142", "0.5403219", "0.53876007", "0.5387515", "0.5371499", "0.5368437", "0.53605...
0.67525464
0
Generate new particles at the right end of the plasma (i.e. between z_end_plasma nz_injectdz and z_end_plasma) Return them in the form of a particle buffer of shape (8, Nptcl)
def generate_particles( self, species, dz, time ) : # Shortcut for the number of integer quantities n_int = species.n_integer_quantities n_float = species.n_float_quantities # Create new particle cells if (self.nz_inject > 0) and (species.continuous_injection == True): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_particles(self):\n # xf, yf = create_fluid_with_solid_cube()\n xf, yf = create_fluid()\n uf = np.zeros_like(xf)\n vf = np.zeros_like(xf)\n m = initialize_mass(xf, yf)\n rho = initialize_density_fluid(xf, yf)\n h = np.ones_like(xf) * self.hdx * self.dx\n ...
[ "0.612357", "0.6045421", "0.58844817", "0.5861245", "0.5850004", "0.57011443", "0.5697617", "0.56546646", "0.56274694", "0.5621595", "0.558431", "0.5581051", "0.5563471", "0.55546993", "0.5529091", "0.5474343", "0.5459851", "0.5450769", "0.54444504", "0.5442273", "0.54061013"...
0.69258934
0
Shift the spectral fields by n_move cells (with respect to the spatial grid). Shifting is done either on the CPU or the GPU, if use_cuda is True. (Typically n_move is positive, and the fields are shifted backwards)
def shift_spect_grid( self, grid, n_move, shift_rho=True, shift_currents=True ): if grid.use_cuda: shift = grid.d_field_shift # Get a 2D CUDA grid of the size of the grid tpb, bpg = cuda_tpb_bpg_2d( grid.Ep.shape[0], grid.Ep.shape[1] ) # ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def shift_spect_array_gpu( field_array, shift_factor, n_move ):\n # Get a 2D CUDA grid\n iz, ir = cuda.grid(2)\n\n # Only access values that are actually in the array\n if ir < field_array.shape[1] and iz < field_array.shape[0]:\n power_shift = 1. + 0.j\n # Calcula...
[ "0.68111503", "0.654992", "0.6478761", "0.5682042", "0.55264264", "0.5491822", "0.5434507", "0.54266405", "0.54103285", "0.53249466", "0.52720374", "0.52512574", "0.5243212", "0.51999307", "0.51817954", "0.5173916", "0.5150899", "0.51255804", "0.5119478", "0.51185614", "0.510...
0.7541371
0
Shift the field 'field_array' by n_move cells on CPU. This is done in spectral space and corresponds to multiplying the fields with the factor exp(ikz_truedz)n_move .
def shift_spect_array_cpu( field_array, shift_factor, n_move ): Nz, Nr = field_array.shape # Loop over the 2D array (in parallel over z if threading is enabled) for iz in prange( Nz ): power_shift = 1. + 0.j # Calculate the shift factor (raising to the power n_move ; # for negative ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def shift_spect_array_gpu( field_array, shift_factor, n_move ):\n # Get a 2D CUDA grid\n iz, ir = cuda.grid(2)\n\n # Only access values that are actually in the array\n if ir < field_array.shape[1] and iz < field_array.shape[0]:\n power_shift = 1. + 0.j\n # Calcula...
[ "0.7170832", "0.6100913", "0.5694191", "0.562633", "0.5549602", "0.5426374", "0.54186237", "0.5341644", "0.5283791", "0.5212293", "0.49859214", "0.4963954", "0.49574816", "0.4957023", "0.4904727", "0.4896321", "0.48726845", "0.4868087", "0.48667774", "0.4864888", "0.4824995",...
0.77101654
0
Shift the field 'field_array' by n_move cells on the GPU. This is done in spectral space and corresponds to multiplying the fields with the factor exp(ikz_truedz)n_move .
def shift_spect_array_gpu( field_array, shift_factor, n_move ): # Get a 2D CUDA grid iz, ir = cuda.grid(2) # Only access values that are actually in the array if ir < field_array.shape[1] and iz < field_array.shape[0]: power_shift = 1. + 0.j # Calculate the shift...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def shift_spect_array_cpu( field_array, shift_factor, n_move ):\n Nz, Nr = field_array.shape\n\n # Loop over the 2D array (in parallel over z if threading is enabled)\n for iz in prange( Nz ):\n power_shift = 1. + 0.j\n # Calculate the shift factor (raising to the power n_move ;\n # f...
[ "0.73844004", "0.6082966", "0.58029294", "0.5760416", "0.5458749", "0.5457597", "0.54504377", "0.5396676", "0.5381811", "0.53601795", "0.51622343", "0.508853", "0.50696003", "0.5024297", "0.5003249", "0.49621084", "0.49588436", "0.49356058", "0.4930291", "0.49255875", "0.4920...
0.72734666
1
Capture the query events comming from Grafana. Investigate the query and replace the measurement name with a Retention Policy measurement name if possible. Send out the (modified or unmodified) query to Influx and return the result
def proxy_influx_query(path): params = dict(request.query) try: LOGGER.debug(params.get('q', None)) params['q'] = modify_queries(params) LOGGER.debug(params.get('q', None)) except Exception as e: LOGGER.exception("Error (%s) proxying query: %s", type(e).__class__, e.mess...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def query(self, query, current_time):\n params = {'query': query}\n auth_type = self.authentication.get(constants.METRICS_BACKEND_CONFIG_AUTH_TYPE)\n logger.debug(f\"authentication type is: {auth_type}\")\n try:\n query_result = None\n if auth_type == constants.MET...
[ "0.57339936", "0.56814665", "0.5500225", "0.54920375", "0.5458039", "0.5432182", "0.53636396", "0.5292462", "0.52455795", "0.5230611", "0.5201298", "0.51619875", "0.51121604", "0.5105648", "0.50829905", "0.50792825", "0.5070931", "0.50500315", "0.5038517", "0.5031934", "0.501...
0.5192731
11
Will be used in DataGenerator
def _read(path, desired_size): dcm = pydicom.dcmread(path) slope, intercept = dcm.RescaleSlope, dcm.RescaleIntercept try: img = (dcm.pixel_array * slope + intercept) except: img = np.zeros(desired_size[:2])-1 if img.shape != desired_size[:2]: img = cv2.resize(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate(self):", "def gen_values(self):", "def data(self):", "def prepare_data(self):", "def generate(self):\r\n raise NotImplementedError", "def generate(self):\n pass", "def generate(self):\n pass", "def generate(self):\n pass", "def generate(self):\n pass", "d...
[ "0.71645045", "0.7069964", "0.68903464", "0.68166614", "0.6782682", "0.6600323", "0.6600323", "0.6600323", "0.65556085", "0.6542308", "0.6518862", "0.6419387", "0.63396436", "0.6294505", "0.62797654", "0.6270805", "0.6239118", "0.6204579", "0.61918163", "0.61918163", "0.61851...
0.0
-1
Note the camelcase name and unused variable. Bad bad bad.
def camelCaseFunc(): unused = 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_for_unused_names(self):\n for s in self.unused_names:\n self.warning(\"'%s' is unused.\"%s)\n\n# warns for param that specified with -c (but also if name gets defined in __main__,\n# e.g. by default_density=global_params.default_density in a script file\n## for name in self.para...
[ "0.6454768", "0.63859814", "0.61285913", "0.6127803", "0.5935644", "0.59143764", "0.58966666", "0.58966666", "0.58946407", "0.58621436", "0.5839409", "0.5818854", "0.5737015", "0.5730995", "0.57293755", "0.57293755", "0.57293755", "0.57293755", "0.57196563", "0.57148516", "0....
0.6955739
0
Extract an internal value from a string
def getfield(self, pkt, s): class_id = getattr(pkt, self._entity_class) entity_class = omci_entities.entity_id_to_class_map.get(class_id) data = {} for attribute in entity_class.attributes: if AttributeAccess.SetByCreate not in attribute.access: continue ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def value_from_str(self, s):\n if is_quoted_str(s):\n return s[1:-1]\n return super().value_from_str(s)", "def value_from_str(self, s):\n if is_quoted_str(s):\n return s[1:-1]\n return super().value_from_str(s)", "def get_value_from_str(value_str):\n try...
[ "0.6899292", "0.6899292", "0.6757842", "0.63956285", "0.63543457", "0.6290516", "0.6245474", "0.6231597", "0.6227444", "0.61673063", "0.61501807", "0.60651314", "0.6053713", "0.60217947", "0.598673", "0.59774673", "0.59718746", "0.5971522", "0.5945698", "0.5924044", "0.592351...
0.0
-1
Extract an internal value from a string
def getfield(self, pkt, s): class_id = getattr(pkt, self._entity_class) attribute_mask = getattr(pkt, self._attributes_mask) entity_class = omci_entities.entity_id_to_class_map[class_id] indices = entity_class.attribute_indices_from_mask(attribute_mask) data = {} table_at...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def value_from_str(self, s):\n if is_quoted_str(s):\n return s[1:-1]\n return super().value_from_str(s)", "def value_from_str(self, s):\n if is_quoted_str(s):\n return s[1:-1]\n return super().value_from_str(s)", "def get_value_from_str(value_str):\n try...
[ "0.6899292", "0.6899292", "0.6757842", "0.63956285", "0.63543457", "0.6290516", "0.6245474", "0.6231597", "0.6227444", "0.61673063", "0.61501807", "0.60651314", "0.6053713", "0.60217947", "0.598673", "0.59774673", "0.59718746", "0.5971522", "0.5945698", "0.5924044", "0.592351...
0.0
-1
Sets the size and position of the main window.
def _setup(self, width=turtle._CFG["width"], height=turtle._CFG["height"], startx=turtle._CFG["leftright"], starty=turtle._CFG["topbottom"]): if not hasattr(self._root, "set_geometry"): return sw = self._root.win_width() sh = self._root.win_height() if ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def placeWindow(self):\r\n\t\t# window size\r\n\t\tw = 600\r\n\t\th = 300\r\n\t\t# find the screen size\r\n\t\tsw = self.parent.winfo_screenwidth()\r\n\t\tsh = self.parent.winfo_screenheight()\r\n\t\t# now define the location on the current screen\r\n\t\tx = (sw/2-0.5*w)\r\n\t\ty = (sh/2-0.5*h)\r\n\t\tself.parent....
[ "0.7444846", "0.74311256", "0.74113226", "0.7338753", "0.7217333", "0.7147651", "0.7128095", "0.7085407", "0.7039381", "0.69641066", "0.6941526", "0.6933898", "0.6916558", "0.6905236", "0.68072456", "0.67224926", "0.6704145", "0.666833", "0.66558856", "0.6651923", "0.66315264...
0.6319304
45
Destroys this window and its associated assets
def _destroy(self): root = self._root turtle.Turtle._pen = None turtle.Turtle._screen = None self._root = None self._canvas = None turtle.TurtleScreen._RUNNING = True root.destroy()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy(self):\n for window in self.windows:\n try:\n destroy_window(window)\n except:\n pass", "def destroy_window(self) -> None:\n self.master.destroy()\n self.master.master.create_right_left_containers()", "def destroy(self):\n ...
[ "0.7758888", "0.7666368", "0.76103795", "0.7549023", "0.75396657", "0.749664", "0.74601287", "0.7457397", "0.7421807", "0.7339096", "0.73000395", "0.72744155", "0.7256992", "0.72431695", "0.7238555", "0.7213867", "0.7204563", "0.71423733", "0.7119873", "0.7090933", "0.7061171...
0.6874586
38
The x coordinate for top left corner of window
def x(self): return self._x
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_x_position(self):\n return self.rect.x", "def get_x(self):\n return self.posX", "def get_pos_x(self):\n return self.__pos_x", "def content_box_x(self):\n return self.position_x + self.margin_left + self.padding_left + \\\n self.border_left_width", "def border_...
[ "0.7928865", "0.7497541", "0.74468994", "0.7431216", "0.7420587", "0.7373978", "0.73659885", "0.7315604", "0.73032784", "0.7258727", "0.7226243", "0.72176665", "0.71952814", "0.71450615", "0.7142987", "0.70740926", "0.70560735", "0.705076", "0.7001769", "0.7001769", "0.696133...
0.0
-1
The y coordinate for top left corner of window
def y(self): return self._y
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def y(self):\n return self.top", "def get_y_position(self): \n return self.rect.y", "def top_y(self):\r\n return self.position.y + self.size.y + self.bulk", "def get_y(self):\n return self.posY", "def _get_y(self):\n return self.position.y", "def y(self):\r\n re...
[ "0.8223235", "0.7753512", "0.7607309", "0.75265026", "0.74642813", "0.74340755", "0.74284726", "0.7398167", "0.7398167", "0.73863155", "0.7359533", "0.73249245", "0.73192805", "0.7303369", "0.7265452", "0.71478647", "0.7138041", "0.71298176", "0.7127513", "0.71184486", "0.711...
0.0
-1
The width of the window in pixels
def width(self): return self._width
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_window_width(self):", "def width(self):\n return(self.SCREEN_W)", "def window_width(self):\n return self._window_size()[0]", "def width(self):\n xmin, _, xmax, _ = self.viewport\n return self.parent.window_size[0] * (xmax - xmin)", "def width(self):\n return self...
[ "0.8736872", "0.84118", "0.8364625", "0.830401", "0.80245584", "0.79670316", "0.7860544", "0.779818", "0.7734384", "0.7687281", "0.75625384", "0.7501574", "0.74973494", "0.7429925", "0.7426164", "0.7416717", "0.7414268", "0.7401848", "0.7401848", "0.7401848", "0.73836476", ...
0.7367283
28
The height of the window in pixels
def height(self): return self._height
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def window_height(self):\n return self._window_size()[1]", "def height(self):\n _, ymin, _, ymax = self.viewport\n return self.parent.window_size[1] * (ymax - ymin)", "def height(self):\n return(self.SCREEN_H)", "def height(self) -> int:\n return self.screen.getmaxyx()[0]",...
[ "0.8631184", "0.8542661", "0.84499466", "0.80354226", "0.79522634", "0.78763425", "0.777075", "0.77323276", "0.76520807", "0.76136863", "0.76136863", "0.7605742", "0.75113416", "0.748779", "0.7457209", "0.74447066", "0.74397165", "0.74333185", "0.74333185", "0.74333185", "0.7...
0.72912085
56
The title displayed at top of window bar
def title(self): return self._frame._title
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_window_title(self): # real signature unknown; restored from __doc__\n return \"\"", "def winTitle(self, title):\n winTitle = title\n window = self.window\n window.setWindowTitle(winTitle)", "def set_title( self , winTitle ):\r\n self.rootWin.wm_title( str( winTitle ) ...
[ "0.7741059", "0.75310904", "0.7421483", "0.73852855", "0.7244872", "0.7223689", "0.7173795", "0.71673006", "0.7165312", "0.71467364", "0.71392095", "0.7074522", "0.70630264", "0.7054297", "0.7051213", "0.70490485", "0.70396465", "0.702222", "0.7009707", "0.70010066", "0.69687...
0.6889334
26
Whether or not the Window supports user resizing
def resizable(self): return self._frame._root.resizable() == '1 1'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def IsResizeable(self):\r\n \r\n return self.HasFlag(self.optionResizable)", "def ev_windowsizechanged(self, event: WindowResized) -> None:", "def isSelectionResizing(self):\n return self.resizing", "def ev_windowsizechanged(self, event: tcod.event.WindowResized) -> T | None:", "def ev...
[ "0.7450744", "0.67073464", "0.6607859", "0.65714055", "0.6563378", "0.6560024", "0.64793974", "0.6461006", "0.63823223", "0.63217413", "0.624592", "0.62382627", "0.6228985", "0.61842704", "0.6160696", "0.6158254", "0.61509866", "0.61256456", "0.610373", "0.60751265", "0.60684...
0.7568574
0
How often to refresh the screen when drawing the turtle
def refresh(self): return self._refresh
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _update(self):\n screen = self.screen\n if screen._tracing == 0:\n return\n elif screen._tracing == 1:\n self._update_data()\n self._drawturtle()\n screen._update() # TurtleScreenBase\n screen._delay(screen._delayvalue...
[ "0.69018406", "0.65853024", "0.6480182", "0.6454136", "0.6448314", "0.62953043", "0.62129325", "0.61860746", "0.6181711", "0.6174027", "0.61470187", "0.61320156", "0.6114843", "0.61122423", "0.60956675", "0.6092913", "0.6088006", "0.60669345", "0.6064306", "0.604553", "0.6025...
0.0
-1
The list of all turtles attached to this Window This attribute may not be altered directly
def turtles(self): return self._turtles[:]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def turtles(self):\n return self._turtles", "def turbines(self):\n return self.turbine_map.turbines", "def getturtle(self):\n return self", "def thermostats(self):\n\n return self._thermostats", "def lights(self):\n return list(self.GetLights())", "def get_light_list(se...
[ "0.8411543", "0.6130211", "0.5962633", "0.59047854", "0.5882312", "0.5679309", "0.56639826", "0.5651566", "0.5635582", "0.5587322", "0.5562676", "0.5513544", "0.5510087", "0.5497294", "0.54633754", "0.54598933", "0.5458061", "0.5453143", "0.5407893", "0.53814805", "0.53572404...
0.8240958
1
The list of all pens attached to this Window This attribute may not be altered directly
def pens(self): return self._pencils[:]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def drawables(self):\n\treturn self._Widget__w['drawables']", "def getPixels(self):\n\t\treturn self.strip.ledsColorBuffer", "def swing_list(self):\n return self._swing_list", "def getPixelsBuffer(self):\n\t\treturn self.leds", "def get_list_powers(self):\r\n return self.ps", "def getMenuIt...
[ "0.6194239", "0.5969787", "0.59447014", "0.58146423", "0.58107215", "0.5731491", "0.5615673", "0.557614", "0.5560097", "0.55471444", "0.5541459", "0.5525621", "0.54055196", "0.53989977", "0.5346334", "0.53336155", "0.53113025", "0.5300297", "0.52949387", "0.52927554", "0.5269...
0.7543301
0
The list containing all supported turtle shapes This attribute may not be altered directly
def shapes(self): return self._frame.getshapes()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def shapes(self):\n return [load_node(item) for item in self.get_attribute('shapes')]", "def turtles(self):\n return self._turtles", "def shapes(self):\n return self.container['shapes']", "def turtles(self):\n return self._turtles[:]", "def shapes(self):\n assert self._sh...
[ "0.69762677", "0.6729221", "0.65511197", "0.65308475", "0.6335289", "0.6164756", "0.6140908", "0.6124906", "0.6000171", "0.5989234", "0.5968777", "0.58869016", "0.57155895", "0.5698968", "0.56792194", "0.5672313", "0.5628772", "0.56259376", "0.5622486", "0.5607531", "0.555370...
0.6370586
4
Destroys this window and its associated assets
def __del__(self): try: self._frame._destroy() except: pass self._turtles = [] self._pencils = [] del self._frame
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy(self):\n for window in self.windows:\n try:\n destroy_window(window)\n except:\n pass", "def destroy_window(self) -> None:\n self.master.destroy()\n self.master.master.create_right_left_containers()", "def destroy(self):\n ...
[ "0.7758888", "0.7666368", "0.76103795", "0.7549023", "0.75396657", "0.749664", "0.74601287", "0.7457397", "0.7421807", "0.7339096", "0.73000395", "0.72744155", "0.7256992", "0.72431695", "0.7238555", "0.7213867", "0.7204563", "0.71423733", "0.7119873", "0.7090933", "0.7061171...
0.0
-1
Resize this window to the current set dimensions
def _reshape(self): self._frame._setup(width=self._width,height=self._height, startx=self._x,starty=self._y)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __window_resizeTo(self, iWidth, iHeight):\n pass", "def resize(self, width, height):\n geo = self.geometry\n # Start of menu.\n self.menu_start = self.window.width - (geo.menu_width +\\\n geo.horizontal_margin + geo.scroll_bar_width)\n # Update vertical s...
[ "0.7875411", "0.77100426", "0.765141", "0.7498725", "0.74862427", "0.7299506", "0.7242203", "0.71922106", "0.718488", "0.71594423", "0.7113716", "0.6998481", "0.69652283", "0.6843507", "0.6833935", "0.6828651", "0.6818293", "0.6815363", "0.6738181", "0.669341", "0.6678333", ...
0.0
-1
Add a turtle to this window.
def _addTurtle(self,turt): assert (type(turt) == Turtle), "Parameter %s is not a valid Turtle object" % `turt` self._turtles.append(turt)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_new(event):\n t = turtle.Turtle()\n screen_w, screen_h = t.screen._window_size()\n t.goto(event.x - screen_w//2, screen_h //2 - event.y)", "def add_body(self):\r\n new_turtle = generate_turtle()\r\n new_turtle.goto(self.all_turtles[-1].position())\r\n self.all_turtles.append...
[ "0.68280035", "0.6453635", "0.6225176", "0.6220096", "0.5967827", "0.59463257", "0.5936159", "0.59193295", "0.5886304", "0.58368546", "0.5714807", "0.5633327", "0.5586595", "0.55554694", "0.552829", "0.5502977", "0.5502977", "0.5468977", "0.5448978", "0.5388961", "0.5375666",...
0.7149174
0
Add a pen to this window.
def _addPen(self,pen): assert (type(pen) == Pen), "Parameter %s is not a valid graphics pen" % `turt` self._pencils.append(pen)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pen(self, width=None, rgb=None, alpha=None):\n self.call('pen', width, rgb, alpha)", "def pen(self, pen=None, **pendict):\n _pd = {\"shown\" : self._shown,\n \"pendown\" : self._drawing,\n \"pencolor\" : self._pencolor,\n \"fillco...
[ "0.6879283", "0.6544037", "0.6461168", "0.63628376", "0.629559", "0.62903273", "0.6202111", "0.61660004", "0.61124593", "0.5987985", "0.5954313", "0.59414625", "0.58582664", "0.5821973", "0.57936865", "0.5761476", "0.5666378", "0.55963165", "0.55450845", "0.54638934", "0.5450...
0.7343928
0
Remove a turtle from this window.
def _removeTurtle(self,turt): if turt in self._turtles: self._turtles.remove(turt)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __del__(self):\n self.clear()\n self._screen._removeTurtle(self)\n del self._turtle", "def __del__(self):\n self._screen._removePen(self)\n del self._turtle", "def clear(self):\n self._turtle.clear()", "def clear(self):\n self._turtle.clear()", "def _des...
[ "0.77124417", "0.750477", "0.66874486", "0.66874486", "0.6680987", "0.6195617", "0.6168465", "0.6085901", "0.58742696", "0.5845661", "0.5834183", "0.5833665", "0.58261734", "0.57959485", "0.5791254", "0.5777234", "0.56776667", "0.5611826", "0.5599132", "0.5564557", "0.5559916...
0.7395165
2