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
Wrap the objective function so that it returns a tuple for compatibility with deap
def myfunc(c, **kwarwgs): return (f(c, **kwargs), )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def objective(self, args: Dict[str, Any]) -> float:\n pass", "def custom_method(*args, **kwargs):\n return objective_return", "def custom_method(*args, **kwargs):\n return objective_return", "def objective(self, x):\n pass", "def objective(self, x):\n pass", "de...
[ "0.6651697", "0.6526861", "0.6526861", "0.64804745", "0.64804745", "0.63947695", "0.6244187", "0.59514946", "0.589431", "0.5892498", "0.58448875", "0.5830852", "0.5799885", "0.5705147", "0.56850517", "0.5649029", "0.56382173", "0.56288266", "0.5623751", "0.5618536", "0.558602...
0.0
-1
Calculates hexadecimal value of userentered base10 integer. As long as the remainder of the userentered base10 value and modulo 16 does not equal 0, the function stores the remainder in a queue and uses a dictionary to assign remainders 1015. Outputs the queue representation of the hex value at the end.
def hex_calc(value): hex_dict = { # Dictionary for hex values over 9 10: "A", 11: "B", 12: "C", 13: "D", 14: "E", 15: "F" } hex_stack = deque() # Queue to hold hexidecimal representation while value > 0: remainder = value % 16 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def decimal_to_hexadecimal(number):\n if number >= 1 and number <= 10: #if the positive integer is less than 10, its binary form is itself\n print(number)\n else:\n \"\"\"\n divide number by 16, take the reminder and start again until the result is 0\n \"\"\"\n new_number =...
[ "0.6767114", "0.62019885", "0.6037745", "0.59984386", "0.5930948", "0.5927391", "0.5909252", "0.5885277", "0.5724089", "0.5716753", "0.56764406", "0.5669568", "0.56636024", "0.56621295", "0.56443244", "0.56175005", "0.56158185", "0.5566997", "0.5562639", "0.5524696", "0.55198...
0.72924364
0
Calculates binary value of userentered base10 integer. As long as the remainder of the userentered base10 value and modulo 2 does not equal 0, the function stores the remainder in a queue. Outputs the queue representation of the binary value at the end.
def binary_calc(value): binary_stack = deque() # Queue to hold binary representation while value > 0: remainder = value % 2 binary_stack.append(remainder) # Add binary digit to queue value = value // 2 print("Binary Value: ", end="") while binary_stack: prin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dec_to_bin(num, base):\n\n # Divide number by base and keep track of remainder in a stack.\n # What is one of the key indicators that a stack should be used?\n # Reversability\n # The reversal property signals that a stack is likely the appropriate\n # data structure for solving the problem.\n\n...
[ "0.6342449", "0.6292792", "0.6045751", "0.59172094", "0.5907794", "0.58624756", "0.5839806", "0.58302724", "0.57647806", "0.57232666", "0.5678209", "0.5669591", "0.5661115", "0.5660052", "0.5625247", "0.5621955", "0.5618219", "0.5616829", "0.5614025", "0.55944234", "0.5593275...
0.7517937
0
Starting point for the program. Asks user for a base10, positive decimal integer and calls the binary_calc and hex_calc functions for computation. The program will loop, asking the user for a new number as long as they do not enter the string "quit".
def setup(): value = input("Enter a positive decimal integer (\"quit\" to stop): ") while value.lower() != "quit": binary_calc(int(value)) # Calls converter function on inputted value print("\n") hex_calc(int(value)) # Calls converter function on inputted value value = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run():\n reset_calc()\n finish = False\n printCurrent()\n while not finish:\n printMenu()\n\n m = input().strip()\n if (m == 'x'):\n finish = True\n elif (m == '+'):\n m = input(\"Give nominator:\")\n n = input(\"Give denominator:\")\n ...
[ "0.65855235", "0.65636045", "0.6491302", "0.64777714", "0.6328509", "0.6162278", "0.6159335", "0.61103714", "0.6071295", "0.59733236", "0.59465903", "0.5880005", "0.57767516", "0.5758527", "0.5752787", "0.5737361", "0.56870824", "0.5684198", "0.5615961", "0.5587042", "0.55698...
0.8094763
0
allows downloading of uploaded files
def download(): return response.download(request, db)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def download_files(self):", "def post_download(self, remote_files):\n pass", "def download_file(self, parsed_event, input_dir_path):", "def download(self,fn):\n\t\treturn False #TODO: implement meme download", "def download(self):\n pass", "def download(self):\n pass", "def pre_dow...
[ "0.7924571", "0.7199257", "0.6978304", "0.6841495", "0.6764734", "0.6764734", "0.66671187", "0.6631285", "0.6588692", "0.6555494", "0.65398693", "0.65012735", "0.6458808", "0.6451737", "0.64442515", "0.6402176", "0.63864595", "0.63758063", "0.63659835", "0.6345104", "0.633138...
0.5870759
97
allows downloading of uploaded files
def download1(): #t=request.vars.arg(0) response.flash=request #print request.wsgi.environ['HTTP_REFERER'] #print 'yghklo=',request.args[0] a=db(db.Project.Project_File==request.args[0]).select(db.Project.ALL) #a=db(db.Project.id==38).select(db.Project.ALL) #if a == None: # print 'silent...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def download_files(self):", "def post_download(self, remote_files):\n pass", "def download_file(self, parsed_event, input_dir_path):", "def download(self,fn):\n\t\treturn False #TODO: implement meme download", "def download(self):\n pass", "def download(self):\n pass", "def pre_dow...
[ "0.7925669", "0.7200179", "0.6978917", "0.68426496", "0.67664343", "0.67664343", "0.66682106", "0.66323435", "0.65895796", "0.65572894", "0.6541814", "0.6501572", "0.64601624", "0.6452852", "0.6445267", "0.64018536", "0.6386292", "0.6376441", "0.6365934", "0.6346462", "0.6332...
0.0
-1
FPA object setup, whatever that is. The only info from the problem is that it is a silicon detector, and we have a graph of quantum efficiency vs wavelength. Based on the graph, it is
def setup_fpa(): # it is a silicon detector. Based on the graph, the quantum efficiency # at 1.06 um is ~50%. fpa = {} fpa["quantum_efficiency"] = 0.5 return fpa
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n\n # self.threshold = 3.\n self.gamma_min = 3\n self.gamma_max = 12\n self.n_samples = 40\n # self.do_plots = False\n # self.do_albedo = True\n # self.verbose = True\n\n self.nbands = 7\n self.bu = np.array([0.004, 0.015, 0.003...
[ "0.65070575", "0.6292009", "0.62877405", "0.60567147", "0.6045674", "0.6028957", "0.60077965", "0.59778076", "0.59438014", "0.5908957", "0.58956885", "0.5890363", "0.5871577", "0.5847138", "0.583425", "0.5827184", "0.5803118", "0.58006674", "0.57921225", "0.5785037", "0.57824...
0.7589595
0
Stop the thread at the next opportunity.
def stop(self): self._stopped = True return self._stopped
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stop(self):\n self._state.transit(sitcpy.THREAD_STOPPING)", "def stop(self):\n self._state.transit(sitcpy.THREAD_STOPPING)", "def stop(self):\n\n self.stop_thread = True", "def stop(self):\n self._Thread__stop()", "def stop_thread(self):\n t, e = self.workers[0]\n ...
[ "0.7869557", "0.7869557", "0.7726774", "0.77168417", "0.7651403", "0.73841757", "0.73667896", "0.73539305", "0.73251146", "0.725089", "0.7246788", "0.7226235", "0.7207327", "0.7205535", "0.71974504", "0.71739626", "0.71739626", "0.71739626", "0.71739626", "0.71739626", "0.717...
0.0
-1
Test creation / restoration / deletion of a backup via the csi snapshotter
def test_csi_volumesnapshot_basic(set_random_backupstore, # NOQA volumesnapshotclass, # NOQA volumesnapshot, # NOQA client, # NOQA core_api, # NOQA vo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_restore_backup():", "def test_backup_only(self):\n # Check that by default a backup is performed and a snapshot is created.\n with TemporaryDirectory() as temporary_directory:\n source = os.path.join(temporary_directory, 'source')\n destination = os.path.join(temporar...
[ "0.75130534", "0.7482683", "0.7389687", "0.71746546", "0.71545166", "0.70082086", "0.6990108", "0.6987986", "0.69760513", "0.6942519", "0.6912148", "0.68778676", "0.6875608", "0.6867557", "0.6852088", "0.6788844", "0.6782454", "0.6765713", "0.6700932", "0.6685788", "0.6674570...
0.74713445
2
Test retention of a backup while deleting the associated `VolumeSnapshot` via the csi snapshotter
def test_csi_volumesnapshot_restore_existing_backup(set_random_backupstore, # NOQA client, # NOQA core_api, # NOQA volume_name, # NOQA ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_aws_service_api_snapshot_delete(self):\n pass", "def test_backup_restore_with_deletes(self):\n gen = BlobGenerator(\"ent-backup\", \"ent-backup-\", self.value_size, end=self.num_items)\n self._load_all_buckets(self.master, gen, \"create\", 0)\n self.backup_create()\n s...
[ "0.6723075", "0.66824317", "0.66567975", "0.66087633", "0.65738505", "0.65661085", "0.6506427", "0.6465853", "0.6354467", "0.6307124", "0.6253928", "0.62148994", "0.62017876", "0.6147514", "0.6068462", "0.60481215", "0.5997585", "0.5995326", "0.59307927", "0.59299403", "0.592...
0.6330533
9
Draws confidence envelope for a multivariate normal distribution The ellipse can be specified by mean and covariance. Use stats_ellipse(level=q) to draw the empirical confidence envelopes for the data.
def geom_ellipse(mean: np.array, cov: np.array, data: np.array=None, q: float=0.95, **kwargs): # Radius that covers q-fraction of white gaussian noise r = np.sqrt(stats.chi2.ppf(q=q, df=2)) # Eigen-directions of a covariance matrix try: L, W = np.linalg.eigh(cov) except: retu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def confidence_ellipse(x, y, ax, n_std=3.0, facecolor='none', **kwargs):\n if x.size != y.size:\n raise ValueError(\"x and y must be the same size\")\n\n cov = np.cov(x, y)\n pearson = cov[0, 1]/np.sqrt(cov[0, 0] * cov[1, 1])\n # Using a special case to obtain the eigenvalues of this\n # two-...
[ "0.6881007", "0.68626964", "0.6812256", "0.6812256", "0.6812256", "0.6261113", "0.6041728", "0.6020823", "0.59574276", "0.5952475", "0.59519756", "0.5951841", "0.58844304", "0.58799803", "0.58613104", "0.5785062", "0.56827694", "0.56631327", "0.56524634", "0.5627426", "0.5622...
0.6335539
5
Converts RGB image to grayscale image preserving perceived luminocity based on Y_601 formula
def convert_to_grayscale(image: np.array) -> np.array: assert len(image.shape) == 3 and image.shape[2] == 3, "Image must be m x n x 3 dimensional RGB array" return 0.2989 * image[:,:,0] + 0.5870 * image[:,:,1] + 0.1140 * image[:,:,2]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_grayscale(img: Image.Image) -> Image.Image:\n orig_mode = img.mode\n\n if orig_mode in [\"RGB\", \"CMYK\", \"YCbCr\", \"LAB\", \"HSV\"]:\n return img.convert(\"L\")\n elif orig_mode == \"RGBA\":\n return img.convert(\"LA\").convert(\"RGBA\")\n elif orig_mode == \"P\":\n # ...
[ "0.7190472", "0.71280396", "0.69965696", "0.6992806", "0.6975413", "0.69699496", "0.69542336", "0.6903083", "0.6797259", "0.6771814", "0.67706394", "0.67490405", "0.6748642", "0.6746511", "0.6744621", "0.67407954", "0.67283195", "0.67158645", "0.6694815", "0.6692519", "0.6692...
0.6712988
18
Computes luminocity for the colorspace vector according to Y_601 formula
def luma(cspace: np.array) -> np.array: assert isinstance(cspace, DataFrame), "Colorspace must be a dataframe" assert all(np.isin(['R', 'G', 'B'], cspace.columns)), "Colorspace must contain RGB columns" return 0.2989 * cspace['R'] + 0.5870 * cspace['G'] + 0.1140 * cspace['B']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_luminosity(red, green, blue):\r\n return (0.299 * red) + (0.587 * green) + (0.114 * blue)", "def luminance(self, color):\n return 0.2426 * color[2] + 0.7152 * color[1] + 0.0722 * color[0]", "def luminance(self):\n \n return (self.r + self.g + self.b) // 3", "def sRGBLumina...
[ "0.722705", "0.7049026", "0.70364183", "0.6859587", "0.66851425", "0.6664808", "0.66166466", "0.6611337", "0.651986", "0.6440314", "0.6394044", "0.6274998", "0.62030494", "0.61515486", "0.60705495", "0.6067759", "0.6057517", "0.60458785", "0.60117924", "0.5979228", "0.5974094...
0.6814634
4
Converts RGB image to a dataframe where each row corresponds to single pixel. If sample_count is set then only random subset of rows is returned.
def image_to_colorspace(image: np.array, sample_count: int = None) -> DataFrame: assert len(image.shape) == 3 and image.shape[2] == 3, "Image must be m x n x 3 dimensional RGB array" if sample_count: return DataFrame({'R':image[:,:,0].flatten(),'G':image[:,:, 1].flatten(),'B':image[:,:, 2].flatten(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_sample_df(self, df, features, r):\n grouped = df.groupby('feature')\n df_sample = pd.DataFrame()\n for feature in features:\n group = grouped.get_group(feature)\n samples = group.sample(n=r)\n df_sample = df_sample.append(samples)\n return df_sa...
[ "0.6141033", "0.603381", "0.60076314", "0.5756627", "0.56922126", "0.5570779", "0.5568138", "0.555071", "0.5497111", "0.546993", "0.5440586", "0.5375774", "0.5369649", "0.53203547", "0.53200895", "0.53108627", "0.52745223", "0.5240417", "0.5232344", "0.5230368", "0.5151618", ...
0.68630415
0
Converts colorspace vector back to RGB image. Colorspace can have extra columns
def colorspace_to_image(cspace: DataFrame, m: int, n: int) -> np.array: assert isinstance(cspace, DataFrame), "Colorspace must be a dataframe" assert len(cspace) == m * n, 'Image dimensions must match' assert all(np.isin(['R', 'G', 'B'], cspace.columns)), "Colorspace must contain RGB columns" ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def features_colorspace(X, colorspace):\n if colorspace == \"BGR\":\n return X\n\n X = np.array(X)\n\n if colorspace == \"HLS\":\n cs = cv2.COLOR_BGR2HLS\n elif colorspace == \"HSV\":\n cs = cv2.COLOR_BGR2HSV\n elif colorspace == \"LUV\":\n cs = cv2.COLOR_BGR2LUV\n el...
[ "0.6144378", "0.60548836", "0.6034356", "0.5993296", "0.5984861", "0.5929783", "0.58545554", "0.58436054", "0.5751462", "0.573934", "0.5706569", "0.5676334", "0.567407", "0.5654705", "0.56331134", "0.5625428", "0.5621792", "0.5558728", "0.5558652", "0.5552761", "0.5528596", ...
0.6287839
0
Visualise colorspace vector as an interactive 3D figure. Colorspace can have extra columns By default RGB channels are clipped to the range [0,1]. Extra arguments can be used to control the appearance of ipyvolume.scatter
def show_colorspace(cspace: np.array, clip=True, size = 0.5, marker='sphere', **kwargs) -> None: assert isinstance(cspace, DataFrame), "Colorspace must be a dataframe" assert all(np.isin(['R', 'G', 'B'], cspace.columns)), "Colorspace must contain RGB columns" fig = ipv.figure() if clip: ipv.sc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def drawColorColumn(x, yseq, zseq):\n dislin.curvy3(x, yseq, zseq, len(yseq))", "def plot3D(x):\n cycol = cycle('bgrcmk')\n fig = plt.figure()\n ax = Axes3D(fig)\n for i in range(5):\n ax.scatter(x[:, i, 0], x[:, i, 1], x[:, i, 2], c=next(cycol),\n marker='.')\n plt.sho...
[ "0.59832585", "0.5860537", "0.58340544", "0.57691926", "0.5764829", "0.5710427", "0.5683266", "0.5635767", "0.5606914", "0.55751276", "0.5560233", "0.5559747", "0.55588275", "0.55202836", "0.5513298", "0.55122715", "0.5509551", "0.5489844", "0.5477256", "0.5471932", "0.544747...
0.69867015
0
Decomposes RGB representation to a naive luma and chroma representation depicted by the formula RGB = luma rRGB.
def luma_decomposition(cspace: DataFrame) -> DataFrame: assert isinstance(cspace, DataFrame), "Colorspace must be a dataframe" assert all(np.isin(['R', 'G', 'B'], cspace.columns)), "Colorspace must contain RGB columns" return (cspace .assign(luma = lambda df: luma(df)) .assign(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unconvert_from_RGB_255(colors):\n un_rgb_color = (colors[0]/(255.0),\n colors[1]/(255.0),\n colors[2]/(255.0))\n\n return un_rgb_color", "def generate_normalized_rgb(self):\n \n r,g,b=(Numeric.zeros(256),Numeric.zeros(256),Numeric.zeros(256))\n ...
[ "0.6625473", "0.6541498", "0.64622194", "0.6461458", "0.6377411", "0.6372886", "0.6326228", "0.62877744", "0.626021", "0.62466156", "0.62466156", "0.6232703", "0.62201065", "0.61821765", "0.6153323", "0.61069566", "0.6098639", "0.60872954", "0.60829175", "0.6041739", "0.60143...
0.5960863
27
Reconstructs RGB representation from the naive luma and chroma representation by the formula RGB = luma rRGB.
def rgb_reconstruction(lumaspace: DataFrame) -> DataFrame: assert isinstance(lumaspace, DataFrame), "Colorspace must be a dataframe" assert all(np.isin(['luma', 'rR', 'rG', 'rB'], lumaspace.columns)), "Lumaspace must contain RGB columns" return (lumaspace .assign(R = lambda df: df['luma...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_normalized_rgb(self):\n \n r,g,b=(Numeric.zeros(256),Numeric.zeros(256),Numeric.zeros(256))\n for i in Numeric.arange(256):\n r_,g_,b_=self.colfct(i/255.0) # these are from [0,1]\n r[i],g[i],b[i]=int(255*r_),int(255*g_),int(255*b_)\n return r/256...
[ "0.70356727", "0.6782001", "0.672594", "0.6722472", "0.66723245", "0.64710706", "0.6347879", "0.63251776", "0.63026893", "0.6233064", "0.62325096", "0.62169987", "0.6204918", "0.6130449", "0.61294127", "0.6101093", "0.60523415", "0.60489076", "0.60436034", "0.60419947", "0.60...
0.63311535
7
Tests that all signals are constructed.
def test_construct_signals_present(self): cbg_df = construct_signals(pd.read_csv('raw_data/sample_raw_data.csv'), SIGNALS) assert 'completely_home_prop' in set(cbg_df.columns) assert 'full_time_work_prop' in set(cbg_df.columns) assert 'part_time_work_pr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_initialize(self):\n SignalHook(self.test_extension, self.signal, self._on_signal_fired)\n\n self.assertEqual(len(self._on_signal_fired.calls), 0)\n self.signal.send(self)\n self.assertEqual(len(self._on_signal_fired.calls), 1)", "def test_allows_signal_notify(self):\n ...
[ "0.7198699", "0.6961123", "0.6867601", "0.68594754", "0.67881685", "0.66899323", "0.66274303", "0.6527756", "0.65197617", "0.6457534", "0.6406589", "0.63431233", "0.6326639", "0.62745726", "0.627386", "0.62715155", "0.62302566", "0.6204464", "0.61189145", "0.60972494", "0.600...
0.627173
15
Tests that constructed signals are actual proportions.
def test_construct_signals_proportions(self): cbg_df = construct_signals(pd.read_csv('raw_data/sample_raw_data.csv'), SIGNALS) assert np.all(cbg_df['completely_home_prop'].values <= 1) assert np.all(cbg_df['full_time_work_prop'].values <= 1) assert np.a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_proportions(self):\r\n\r\n proportions = [\r\n v['proportion'] for k, v in self.composition.items()\r\n ]\r\n\r\n if sum(proportions) < 1.0:\r\n raise ValueError('Sum of proportions between host and pathogen must be 1.0.')\r\n elif sum(proportions) > 1.0:...
[ "0.66484034", "0.6311004", "0.61575395", "0.6049411", "0.5846437", "0.57422686", "0.5709035", "0.5704337", "0.5583857", "0.5583857", "0.5528866", "0.5524776", "0.55001354", "0.54795945", "0.5478572", "0.54679793", "0.54651594", "0.544234", "0.543187", "0.5401828", "0.5401828"...
0.7607326
0
Tests that aggregation at the county level creates nonzerovalued signals.
def test_aggregate_county(self): cbg_df = construct_signals(pd.read_csv('raw_data/sample_raw_data.csv'), SIGNALS) df = aggregate(cbg_df, SIGNALS, 'county') assert np.all(df[f'{SIGNALS[0]}_n'].values > 0) x = df[f'{SIGNALS[0]}_se'].values assert...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_aggregate_nation(self):\n cbg_df = construct_signals(pd.read_csv('raw_data/sample_raw_data.csv'),\n SIGNALS)\n df = aggregate(cbg_df, SIGNALS, 'nation')\n\n assert np.all(df[f'{SIGNALS[0]}_n'].values > 0)\n x = df[f'{SIGNALS[0]}_se'].values\n ...
[ "0.68716997", "0.6666926", "0.61090475", "0.57431424", "0.5742255", "0.5667957", "0.5607133", "0.5604635", "0.55638605", "0.55366623", "0.5536144", "0.55044466", "0.54993826", "0.5419435", "0.5376306", "0.53653294", "0.53649396", "0.5341991", "0.5326681", "0.53014153", "0.529...
0.7612559
0
Tests that aggregation at the state level creates nonzerovalued signals.
def test_aggregate_state(self): cbg_df = construct_signals(pd.read_csv('raw_data/sample_raw_data.csv'), SIGNALS) df = aggregate(cbg_df, SIGNALS, 'state') assert np.all(df[f'{SIGNALS[0]}_n'].values > 0) x = df[f'{SIGNALS[0]}_se'].values assert n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_aggregate_nation(self):\n cbg_df = construct_signals(pd.read_csv('raw_data/sample_raw_data.csv'),\n SIGNALS)\n df = aggregate(cbg_df, SIGNALS, 'nation')\n\n assert np.all(df[f'{SIGNALS[0]}_n'].values > 0)\n x = df[f'{SIGNALS[0]}_se'].values\n ...
[ "0.61210126", "0.5934089", "0.589467", "0.5892433", "0.5861224", "0.5711701", "0.5653383", "0.5630056", "0.5579708", "0.5577906", "0.5550419", "0.5545783", "0.55085456", "0.5499616", "0.5489012", "0.5481875", "0.5469063", "0.5461217", "0.54575956", "0.5446156", "0.5441203", ...
0.748049
0
Tests that aggregation at the state level creates nonzerovalued signals.
def test_aggregate_msa(self): cbg_df = construct_signals(pd.read_csv('raw_data/sample_raw_data.csv'), SIGNALS) df = aggregate(cbg_df, SIGNALS, 'msa') assert np.all(df[f'{SIGNALS[0]}_n'].values > 0) x = df[f'{SIGNALS[0]}_se'].values assert np.al...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_aggregate_state(self):\n cbg_df = construct_signals(pd.read_csv('raw_data/sample_raw_data.csv'),\n SIGNALS)\n df = aggregate(cbg_df, SIGNALS, 'state')\n\n assert np.all(df[f'{SIGNALS[0]}_n'].values > 0)\n x = df[f'{SIGNALS[0]}_se'].values\n ...
[ "0.7479666", "0.6121371", "0.5934786", "0.5891897", "0.5862976", "0.57110685", "0.56545264", "0.5631428", "0.55796295", "0.5577801", "0.55514765", "0.554494", "0.5510593", "0.5500976", "0.54901975", "0.54840297", "0.5469475", "0.54619354", "0.54598", "0.5447684", "0.54426587"...
0.58947563
3
Tests that aggregation at the state level creates nonzerovalued signals.
def test_aggregate_hrr(self): cbg_df = construct_signals(pd.read_csv('raw_data/sample_raw_data.csv'), SIGNALS) df = aggregate(cbg_df, SIGNALS, 'hrr') assert np.all(df[f'{SIGNALS[0]}_n'].values > 0) x = df[f'{SIGNALS[0]}_se'].values assert np.al...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_aggregate_state(self):\n cbg_df = construct_signals(pd.read_csv('raw_data/sample_raw_data.csv'),\n SIGNALS)\n df = aggregate(cbg_df, SIGNALS, 'state')\n\n assert np.all(df[f'{SIGNALS[0]}_n'].values > 0)\n x = df[f'{SIGNALS[0]}_se'].values\n ...
[ "0.74809134", "0.6120178", "0.5934026", "0.58936185", "0.5890962", "0.5861368", "0.5712922", "0.5653689", "0.56298804", "0.55801994", "0.55768", "0.5550667", "0.55458176", "0.55086803", "0.549904", "0.5489132", "0.54822505", "0.5468543", "0.54612315", "0.54581416", "0.5446415...
0.53738433
29
Tests that aggregation at the state level creates nonzerovalued signals.
def test_aggregate_nation(self): cbg_df = construct_signals(pd.read_csv('raw_data/sample_raw_data.csv'), SIGNALS) df = aggregate(cbg_df, SIGNALS, 'nation') assert np.all(df[f'{SIGNALS[0]}_n'].values > 0) x = df[f'{SIGNALS[0]}_se'].values assert...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_aggregate_state(self):\n cbg_df = construct_signals(pd.read_csv('raw_data/sample_raw_data.csv'),\n SIGNALS)\n df = aggregate(cbg_df, SIGNALS, 'state')\n\n assert np.all(df[f'{SIGNALS[0]}_n'].values > 0)\n x = df[f'{SIGNALS[0]}_se'].values\n ...
[ "0.74812746", "0.59329057", "0.5895889", "0.58929867", "0.58616966", "0.5710675", "0.565309", "0.5629537", "0.557881", "0.5575357", "0.5549657", "0.55448717", "0.55095005", "0.54987305", "0.54884887", "0.54829407", "0.5467536", "0.54628205", "0.5458857", "0.5445779", "0.54409...
0.6122557
1
Tests that aggregation at the state level creates nonzerovalued signals.
def test_aggregate_hhs(self): cbg_df = construct_signals(pd.read_csv('raw_data/sample_raw_data.csv'), SIGNALS) df = aggregate(cbg_df, SIGNALS, 'hhs') assert np.all(df[f'{SIGNALS[0]}_n'].values > 0) x = df[f'{SIGNALS[0]}_se'].values assert np.al...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_aggregate_state(self):\n cbg_df = construct_signals(pd.read_csv('raw_data/sample_raw_data.csv'),\n SIGNALS)\n df = aggregate(cbg_df, SIGNALS, 'state')\n\n assert np.all(df[f'{SIGNALS[0]}_n'].values > 0)\n x = df[f'{SIGNALS[0]}_se'].values\n ...
[ "0.748049", "0.61210126", "0.5934089", "0.589467", "0.5892433", "0.5861224", "0.5711701", "0.5653383", "0.5630056", "0.5579708", "0.5577906", "0.5550419", "0.5545783", "0.55085456", "0.5499616", "0.5489012", "0.5481875", "0.5469063", "0.54575956", "0.5446156", "0.5441203", ...
0.5461217
18
Tests that processing over a window correctly aggregates signals.
def test_process_window(self, tmp_path): export_dir = tmp_path / 'export' export_dir.mkdir() df1 = pd.DataFrame(data={ 'date_range_start': ['2020-02-14T00:00:00-05:00:00']*3, 'origin_census_block_group': [10539707003, 10539707003,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_next_window_time_no_sample_passed(self):\n test_window_scheme = WindowingScheme(self.window_test_filter, 3)\n time.sleep(4)\n collected_value = test_window_scheme.filter(self.more_than_upper_bound)\n self.assertEquals(collected_value, self.more_than_upper_bound)", "def test_n...
[ "0.62284684", "0.60323983", "0.59892815", "0.5937085", "0.59230894", "0.59155595", "0.58550054", "0.58464015", "0.58157486", "0.5741738", "0.5680929", "0.56652606", "0.5605725", "0.55671203", "0.5524034", "0.552288", "0.5484974", "0.5478022", "0.5466935", "0.5451512", "0.5450...
0.5814091
9
Tests that processing a list of current and previous file names correctly reads and aggregates signals.
def test_process(self, tmp_path): export_dir = tmp_path / 'export' export_dir.mkdir() process(['raw_data/small_raw_data_0.csv', 'raw_data/small_raw_data_1.csv', # File 2 does not exist. 'raw_data/small_raw_data_2.csv', 'raw_dat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_read_multiple_signals(self):\n cwd = os.path.dirname(os.path.abspath(__file__))\n test_dir = os.path.join(cwd, 'test_files/')\n signals = read_signals(test_dir)\n self.assertEqual(len(signals), 3)\n self.assertTrue(\n any(signal for signal in signals if signal...
[ "0.6583948", "0.65238965", "0.6152226", "0.6060168", "0.592048", "0.58374643", "0.57693136", "0.5765163", "0.56609446", "0.56524676", "0.5637058", "0.5592758", "0.55914736", "0.54783875", "0.5461542", "0.5460745", "0.54571444", "0.5448952", "0.54251266", "0.5403511", "0.54010...
0.0
-1
send a numpy array with metadata
def send_array_and_str(socket, img, string="None", flags=0, copy=True, track=False): md = dict( dtype = str(img.dtype), shape = img.shape, ) socket.send_string(string, flags | zmq.SNDMORE) socket.send_json(md, flags|zmq.SNDMORE) return socket.send(img, flags, copy=copy, track=track)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send_ndarray(sock, data):\n with io.BytesIO() as f:\n np.save(f, data)\n byte_data = f.getvalue()\n\n # Pack message length\n msg = struct.pack('>I', len(byte_data)) + byte_data\n sock.sendall(msg)", "def send_array(self, A, flags=0, copy=True, track=False):\n md = dict(\n ...
[ "0.6501568", "0.63785505", "0.62580985", "0.619946", "0.6193633", "0.6189601", "0.61822146", "0.6154474", "0.6137267", "0.6136131", "0.6128146", "0.61205447", "0.61147827", "0.6091603", "0.60911626", "0.6068108", "0.60643", "0.6058451", "0.60514754", "0.60438716", "0.60382295...
0.5562305
98
Method for reading a nordic file and parsing it to a string array while also checking the integrity of the file(Will give errors when lines are too long). It also wil parse empty space on the file if it is too short.
def readNordicFile(f): nordics = [] emsg = "Nordic Read: The following line is too short: {0}\n{1}" i = 0 nordics.append([]) for line in f: if line.strip() == "" or line is None: if len(nordics[i]) == 0: continue i += 1; nordics.append([])...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def readP(path, encoding='iso-8859-1', n=0):\n with open(path, encoding=encoding) as f:\n raw = [x.strip() for x in f if x]\n if n:\n raw = [x for x in raw if len(x) <= n]\n return raw", "def read(read_file) -> list:\n result = []\n try:\n with open(read_file) as file:...
[ "0.60678965", "0.6035607", "0.6027674", "0.6023274", "0.598013", "0.5867823", "0.586583", "0.58537155", "0.58469784", "0.5815171", "0.5806846", "0.58053046", "0.5800402", "0.5777913", "0.5765686", "0.57436544", "0.57398486", "0.57300663", "0.57231325", "0.57182133", "0.568593...
0.760024
0
Returns control gain matrices for any kite serial number.
def GetControllers(wing_serial): if wing_serial == m.kWingSerial01: airspeed_table = ( [30.0, 60.0, 90.0] ) flap_offsets = ( [-0.209, -0.209, 0.0, 0.0, 0.009, 0.009, -0.005, 0.017] ) longitudinal_gains_min_airspeed = ( [[0.005, 0.034, -0.716, -0.333, 0.311], [-9.23...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_gains(self):\n return tuple([lib.is_SetHWGainFactor(self.hcam,0x8000+i,0)/100 for i in range(4)])", "def get_mod_gain_table(self):\n return self.mod_gain_table", "def get_mod_gain_pwrs(self):\n return self.mod_gain_table.keys()", "def get_mod_gain_table_index(self):\n retu...
[ "0.5722042", "0.5586053", "0.55208635", "0.5421132", "0.5396984", "0.5340974", "0.530424", "0.5249507", "0.5223219", "0.509237", "0.5061447", "0.5046168", "0.50287783", "0.5019659", "0.5003898", "0.5003317", "0.49812856", "0.49769893", "0.49753842", "0.49700093", "0.49687988"...
0.48384264
32
Returns the text in the example's document in the given span.
def get_text_span(example, span): byte_positions = [] # `text` is a byte string since `document_plaintext` is also a byte string. start = span["plaintext_start_byte"] end = span["plaintext_end_byte"] text = byte_slice(example["document_plaintext"], start, end) for i in range(start, end): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_span_text(self, span: Span) -> str:\n return self._text[span.begin: span.end]", "def read_text_from_span_id(html, span_id):\n return html.find('span', {'id': span_id}).text", "def get_span_text(element, name):\n try:\n return (\n element.find_element_by_css_selector(name)...
[ "0.82889014", "0.7150462", "0.6169565", "0.59940624", "0.59328765", "0.5892914", "0.58556867", "0.583677", "0.5791252", "0.5784249", "0.57462", "0.5718208", "0.5718208", "0.5718208", "0.5718208", "0.5718208", "0.5707402", "0.564645", "0.56462574", "0.5600071", "0.5583564", ...
0.77947813
1
Returns a text representation of the candidate at the given index.
def get_candidate_text(json_dict, idx): # No candidate at this index. if idx < 0 or idx >= len(json_dict["passage_answer_candidates"]): raise ValueError("Invalid index for passage candidate: {}".format(idx)) return get_text_span(json_dict, json_dict["passage_answer_candidates"][idx])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetString(self, index):\n \n return self.choices[index].GetLabel()", "def __getitem__(self, index):\n return str(self.cpf[index])", "def _printFromIndex(self, index):\n ret = str(self.arr[index])\n iterator = index + 1\n while iterator != index:\n ret +=...
[ "0.6410651", "0.6363077", "0.6317435", "0.6307074", "0.61769325", "0.6108662", "0.61011386", "0.6054563", "0.6041569", "0.5981198", "0.58085775", "0.576806", "0.57276076", "0.5684942", "0.5660255", "0.5657564", "0.56432194", "0.5622297", "0.56197083", "0.56084627", "0.5603121...
0.7112093
0
Yields the candidates that should not be skipped in an example.
def candidates_iter(json_dict): for idx, cand in enumerate(json_dict["passage_answer_candidates"]): yield idx, cand
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generator_without(container, exclude_these, case_sensitive=True, sort=False):\n if not case_sensitive:\n exclude_these = [e.lower() for e in exclude_these]\n for k in (container if not sort else sorted(container)):\n k_l = k if case_sensitive else k.lower()\n if k_l not in exclude_th...
[ "0.6261642", "0.6188604", "0.6001243", "0.59939164", "0.5880732", "0.57954943", "0.57022405", "0.5697539", "0.5616769", "0.5575259", "0.5568629", "0.5540792", "0.5498979", "0.5467595", "0.54579544", "0.5437834", "0.5433232", "0.5380765", "0.5374475", "0.53457266", "0.53452265...
0.0
-1
Converts a TyDi 'entry' from `create_entry_from_json` to `TyDiExample`.
def to_tydi_example(entry, is_training): if is_training: answer = make_tydi_answer(entry["contexts"], entry["answer"]) start_byte_offset = answer.offset end_byte_offset = answer.offset + byte_len(answer.text) else: answer = None start_byte_offset = None end_byte_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_entry(entry):\n Entry.create(**entry)\n return entry", "def from_dict(cls, dikt) -> \"Todo\":\n return util.deserialize_model(dikt, cls)", "def example_json(example_json_file):\n return json.loads(example_json_file)", "def _json_to_instance(self, json_dict: JsonDict) -> Instance:\n...
[ "0.58346426", "0.5392077", "0.5235372", "0.5232819", "0.52080363", "0.51707566", "0.5161617", "0.5157883", "0.5148814", "0.51232684", "0.51134694", "0.5111602", "0.5105579", "0.51049596", "0.5095554", "0.50900686", "0.5078553", "0.5064115", "0.5054117", "0.50366974", "0.50366...
0.74971884
0
Representacion en cadena de la clase Parroquia.
def __unicode__(self): return self.parroquia
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, nombre, cantidad, precio):\n\n # Atributos privados por convensión\n self._an = 15 # Ancho de columna nombre\n self._ac = 8 # Ancho de columna cantidad\n self._ap = 10 # Ancho de columna precio\n self._ast = 10 # Ancho de columna subtotal\n\n # Se in...
[ "0.62735045", "0.6233848", "0.62092257", "0.6143086", "0.5984596", "0.59630907", "0.59224004", "0.58816874", "0.58564144", "0.5777072", "0.5774827", "0.5763267", "0.57328683", "0.5721564", "0.5687393", "0.5685108", "0.5682803", "0.5677757", "0.56428087", "0.5642351", "0.56404...
0.7457928
0
La Url de vista principal de administracion de Parroquia.
def get_absolute_url(self): return ('listar_parroquia', [self.id, ])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_orion_admin_url(self, obj):\n return obj.orion_admin_url", "def get_admin_url_to_add_run(self, request):\n base_url = reverse(\"admin:courses_courserun_add\")\n return f\"{base_url:s}?direct_course={self.id:d}\"", "def getAdmin():", "def url(self):\n return url_for('/admi...
[ "0.6939429", "0.6376486", "0.62612", "0.6213472", "0.6176542", "0.61681587", "0.6094484", "0.6040345", "0.5983753", "0.5958032", "0.59322804", "0.5912582", "0.584376", "0.58436394", "0.58342546", "0.58238477", "0.58238477", "0.5822934", "0.581415", "0.5813586", "0.58131236", ...
0.66241646
1
Return True if this element is an instance of the given subclass. If a category string is specified, then both subclass and category matches are required.
def _isA(self, elementClass, category = ''): if not isinstance(self, elementClass): return False if category and self.getCategory() != category: return False return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def subclassof(c, b):\n try:\n return issubclass(c, b)\n except TypeError:\n return False", "def is_subclass(parent_class, child_class_name):\n for child_class in parent_class.__subclasses__():\n if child_class.__name__ == child_class_name:\n return True\n return False...
[ "0.6687288", "0.6670129", "0.66446286", "0.6316864", "0.62128353", "0.610718", "0.6080735", "0.60664964", "0.60402757", "0.5992532", "0.59696436", "0.5941159", "0.58874506", "0.58874506", "0.5886609", "0.58573806", "0.58487344", "0.58478147", "0.57916117", "0.57669014", "0.56...
0.7002873
0
Return a list of all child elements that are instances of the given type. The returned list maintains the order in which children were added.
def _getChildrenOfType(self, elementClass): method = getattr(self.__class__, "_getChildrenOfType" + elementClass.__name__) return method(self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def descendants(self, type: str):\n return list(descendants(self.type_tree, type))", "def get_element_by_tag_type(self, tag_type):\n elts = []\n if self is None:\n return elts\n if self.tag_type == tag_type:\n elts.append(self)\n\n for child in self.childr...
[ "0.7072542", "0.6878987", "0.6743088", "0.6691061", "0.6669156", "0.6660059", "0.66244364", "0.6470436", "0.64007956", "0.6340226", "0.62596714", "0.6195003", "0.61464643", "0.6143393", "0.6124976", "0.60636926", "0.6059035", "0.6055325", "0.603803", "0.6019386", "0.60062987"...
0.61959624
11
Return the default value for this element.
def _getDefaultValue(self): value = self._getDefaultValue() return value.getData() if value else None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def default_value(self):\n return self._default_value", "def default_value(self):\n return self._default_value", "def default(self):\n\n return self._get_field(\"value\")", "def get_default_value(self):\n pass", "def default(self):\r\n return self.default_value()", "def...
[ "0.8670316", "0.8670316", "0.86002696", "0.85086143", "0.8489805", "0.84298074", "0.8295959", "0.8295959", "0.8270742", "0.81889516", "0.81854266", "0.8182883", "0.81404835", "0.8121254", "0.8100968", "0.8100968", "0.8015085", "0.80053425", "0.79454553", "0.7945101", "0.79402...
0.80125666
17
Set the typed value of an input by its name, creating a child element to hold the input if needed.
def _setInputValue(self, name, value, typeString = ''): method = getattr(self.__class__, "_setInputValue" + getTypeString(value)) return method(self, name, value, typeString)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def populate_field(self, name, value):\n locator = self._get_input_field_locator(name)\n self._populate_field(locator, value)", "def insert_by_name(name, val):\n try:\n name = driver.find_element_by_name(name)\n except Exception as e:\n raise(e)\n else:\n name.send_key...
[ "0.6696381", "0.60982335", "0.6062318", "0.58775914", "0.58670473", "0.5854426", "0.5842993", "0.583215", "0.57965046", "0.57965046", "0.5707237", "0.56931925", "0.5665919", "0.56397855", "0.56089824", "0.55845267", "0.5571821", "0.5554291", "0.552724", "0.5509192", "0.549337...
0.64479256
1
Return the typed value of an input by its name, taking both the calling element and its declaration into account. If the given input is not found, then None is returned.
def _getInputValue(self, name, target = ''): value = self._getInputValue(name, target) return value.getData() if value else None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_input_by_name(self, name):\n for var in self.inputs:\n if var.get_object().name == name:\n return var\n return None", "def get_input(self, name):\n return self._inputs.get(name)", "def get_input_by_name(self, input_name):\n\n input_found = None\n\n ...
[ "0.73832405", "0.6656208", "0.6541893", "0.64940184", "0.6340151", "0.63254017", "0.6196558", "0.61610734", "0.6141107", "0.61052793", "0.60158974", "0.60151154", "0.5872866", "0.5827187", "0.5776721", "0.57734174", "0.56983644", "0.5693152", "0.56678504", "0.5639554", "0.562...
0.66325825
2
(Deprecated) Add a Parameter to this interface.
def _addParameter(self, name): warnings.warn("This function is deprecated; parameters have been replaced with uniform inputs in 1.38.", DeprecationWarning, stacklevel = 2) return self.addInput(name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_param(self, param):\n self.params.append(param)\n return self", "def add_param(self, param):\n self._params.append(param)\n self.add_decompostion(param)", "def add_parameter(self, parameter):\n self._pkey += 1\n self.parameters[self._pkey] = parameter", "def ...
[ "0.7392754", "0.7226067", "0.71649903", "0.7134397", "0.7021938", "0.6958663", "0.69568723", "0.69460773", "0.6929168", "0.68761325", "0.6839852", "0.6826685", "0.6788067", "0.6752735", "0.67438495", "0.67065644", "0.6700492", "0.6696636", "0.6666486", "0.6627517", "0.6573087...
0.7026675
4
(Deprecated) Return a vector of all Parameter elements.
def _getParameters(self): warnings.warn("This function is deprecated; parameters have been replaced with uniform inputs in 1.38.", DeprecationWarning, stacklevel = 2) return list()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parameters_to_vector(self) -> np.ndarray:\n return nn.utils.parameters_to_vector(self.parameters()).detach().cpu().numpy()", "def parameters_list(self):\n return [getattr(self.parameters, p) for p in self.parameters_names()]", "def parameters(self) -> List[Parameter]:\n return self._pa...
[ "0.70164126", "0.69106805", "0.6909647", "0.6856145", "0.68113655", "0.68113655", "0.67872435", "0.6787241", "0.6785588", "0.6761088", "0.67584455", "0.6725566", "0.67151064", "0.66764146", "0.65993285", "0.6595009", "0.6587269", "0.6568346", "0.6563564", "0.65622544", "0.651...
0.697155
1
(Deprecated) Return a vector of all parameters belonging to this interface, taking inheritance into account.
def _getActiveParameters(self): warnings.warn("This function is deprecated; parameters have been replaced with uniform inputs in 1.38.", DeprecationWarning, stacklevel = 2) return list()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __parameters__(self) -> tuple[TypeVar, ...]:\n return super().__getattribute__(\"_parameters\")", "def parameters(self):\n return [p for _, a in vars(self).items() for p in self._params(a)]", "def _get_derived_parameters(self) -> DerivedParameterCollection:\n return DerivedParameterCol...
[ "0.7319263", "0.7154781", "0.69999355", "0.69999355", "0.6981402", "0.687172", "0.6772755", "0.67693895", "0.67525303", "0.6681054", "0.66798896", "0.666111", "0.6658778", "0.6656797", "0.66556805", "0.6591198", "0.65785074", "0.65544194", "0.6540731", "0.65373325", "0.652525...
0.63398415
34
(Deprecated) Set the typed value of a parameter by its name.
def _setParameterValue(self, name, value, typeString = ''): warnings.warn("This function is deprecated; parameters have been replaced with uniform inputs in 1.38.", DeprecationWarning, stacklevel = 2)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setParameter(self, name, value):", "def set_parameter(self, params, name, val):\n raise NotImplementedError()", "def set(self, name, value=None):\n if isinstance(name, dict):\n for key, value in name.items():\n try:\n param, value = self.coercePara...
[ "0.78295267", "0.7444436", "0.7371338", "0.72122747", "0.7093258", "0.7008957", "0.6888976", "0.681474", "0.67791194", "0.67542565", "0.6716448", "0.65687007", "0.65447736", "0.6534443", "0.65175855", "0.65175855", "0.65048856", "0.6504462", "0.6500714", "0.64990366", "0.6487...
0.71333575
4
(Deprecated) Return the typed value of a parameter by its name.
def _getParameterValue(self, name, target = ''): warnings.warn("This function is deprecated; parameters have been replaced with uniform inputs in 1.38.", DeprecationWarning, stacklevel = 2) return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_parameter_type(self, name):\n raise NotImplementedError()", "def getParam(self, params, name):\n return params.get(name)", "def _name_to_variable(self, name: str) -> Parameter:\n return cast(Parameter, super()._name_to_variable(name))", "def get_param_with_name(self, param_name):...
[ "0.70842284", "0.6901505", "0.66810405", "0.6517848", "0.6480968", "0.6465439", "0.6429352", "0.63265526", "0.6292917", "0.6171034", "0.61690265", "0.6167457", "0.6165231", "0.61486405", "0.6117995", "0.60688585", "0.6037239", "0.60348684", "0.59447", "0.593131", "0.5890477",...
0.57739407
25
(Deprecated) Return the value string of a parameter by its name.
def _getParameterValueString(self, name): warnings.warn("This function is deprecated; parameters have been replaced with uniform inputs in 1.38.", DeprecationWarning, stacklevel = 2) return ""
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getParam(self, params, name):\n return params.get(name)", "def get_param_with_name(self, param_name):\n return self.params[param_name]", "def getParameter(self, name):", "def getSSMParam(name):\n return ssm_client.get_parameter(\n Name=name,\n WithDecryption...
[ "0.70329046", "0.687252", "0.6827756", "0.65972966", "0.65388006", "0.6500877", "0.64673096", "0.6371999", "0.6315599", "0.6314213", "0.62858284", "0.6270459", "0.62613076", "0.6259734", "0.62386006", "0.61926997", "0.6128117", "0.6123776", "0.6123158", "0.6096087", "0.606265...
0.7922667
0
(Deprecated) Add a BindInput to this shader reference.
def _addBindInput(self, name, type = DEFAULT_TYPE_STRING): warnings.warn("This function is deprecated; shader references have been replaced with shader nodes in 1.38.", DeprecationWarning, stacklevel = 2) return self.addInput(name, type)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _addBindParam(self, name, type = DEFAULT_TYPE_STRING):\n warnings.warn(\"This function is deprecated; shader references have been replaced with shader nodes in 1.38.\", DeprecationWarning, stacklevel = 2)\n return self.addInput(name, type)", "def _getBindInputs(self):\n warnings.warn(\"This function...
[ "0.7632342", "0.65786767", "0.573658", "0.5379098", "0.5296212", "0.5178297", "0.5159998", "0.5151385", "0.5066717", "0.49228904", "0.4916024", "0.48976418", "0.48940352", "0.48545158", "0.47804457", "0.47647017", "0.4753692", "0.47506797", "0.4747506", "0.47449464", "0.47333...
0.84288436
0
(Deprecated) Return a vector of all BindInput elements in this shader reference.
def _getBindInputs(self): warnings.warn("This function is deprecated; shader references have been replaced with shader nodes in 1.38.", DeprecationWarning, stacklevel = 2) return self.getInputs()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _getBindParams(self):\n warnings.warn(\"This function is deprecated; shader references have been replaced with shader nodes in 1.38.\", DeprecationWarning, stacklevel = 2)\n return list()", "def _getBindTokens(self):\n warnings.warn(\"This function is deprecated; shader references have been replaced...
[ "0.7248788", "0.68201584", "0.61971897", "0.6057106", "0.6041571", "0.60374856", "0.60374856", "0.60374856", "0.6018457", "0.59155166", "0.5823089", "0.57687944", "0.5762386", "0.5726699", "0.5726699", "0.5726699", "0.5711171", "0.5709276", "0.5706087", "0.5700484", "0.568270...
0.83538413
0
(Deprecated) Add a BindParam to this shader reference.
def _addBindParam(self, name, type = DEFAULT_TYPE_STRING): warnings.warn("This function is deprecated; shader references have been replaced with shader nodes in 1.38.", DeprecationWarning, stacklevel = 2) return self.addInput(name, type)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _addBindInput(self, name, type = DEFAULT_TYPE_STRING):\n warnings.warn(\"This function is deprecated; shader references have been replaced with shader nodes in 1.38.\", DeprecationWarning, stacklevel = 2)\n return self.addInput(name, type)", "def _getBindParams(self):\n warnings.warn(\"This function...
[ "0.7179398", "0.6434004", "0.60884535", "0.6070172", "0.59735316", "0.5896598", "0.5733029", "0.5710626", "0.5708676", "0.5646252", "0.5533429", "0.55079865", "0.5417713", "0.53833014", "0.5378985", "0.5373941", "0.5350034", "0.5324678", "0.5298662", "0.52942353", "0.52673304...
0.8272173
0
(Deprecated) Return a vector of all BindParam elements in this shader reference.
def _getBindParams(self): warnings.warn("This function is deprecated; shader references have been replaced with shader nodes in 1.38.", DeprecationWarning, stacklevel = 2) return list()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _getBindInputs(self):\n warnings.warn(\"This function is deprecated; shader references have been replaced with shader nodes in 1.38.\", DeprecationWarning, stacklevel = 2)\n return self.getInputs()", "def _getBindTokens(self):\n warnings.warn(\"This function is deprecated; shader references have bee...
[ "0.73175657", "0.697158", "0.6510387", "0.6437608", "0.6387305", "0.63770574", "0.63090634", "0.62420833", "0.6186843", "0.61844945", "0.61839473", "0.6061543", "0.60109484", "0.59970754", "0.59630865", "0.5951487", "0.59331584", "0.5922793", "0.58891183", "0.5887415", "0.586...
0.8280635
0
(Deprecated) Return a vector of all BindToken elements in this shader reference.
def _getBindTokens(self): warnings.warn("This function is deprecated; shader references have been replaced with shader nodes in 1.38.", DeprecationWarning, stacklevel = 2) return list()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _getBindParams(self):\n warnings.warn(\"This function is deprecated; shader references have been replaced with shader nodes in 1.38.\", DeprecationWarning, stacklevel = 2)\n return list()", "def _getBindInputs(self):\n warnings.warn(\"This function is deprecated; shader references have been replaced...
[ "0.7346781", "0.71642834", "0.6264189", "0.6206269", "0.5697967", "0.5595624", "0.55848074", "0.5566121", "0.5566121", "0.5566121", "0.55017257", "0.54983807", "0.54983807", "0.5487443", "0.5385787", "0.53534365", "0.53367513", "0.5262191", "0.52297187", "0.5215819", "0.52116...
0.8395629
0
(Deprecated) Return a vector of all shader references in this material element.
def _getShaderRefs(self): warnings.warn("This function is deprecated; shader references have been replaced with shader nodes in 1.38.", DeprecationWarning, stacklevel = 2) return getShaderNodes(self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _getActiveShaderRefs(self):\n warnings.warn(\"This function is deprecated; shader references have been replaced with shader nodes in 1.38.\", DeprecationWarning, stacklevel = 2)\n return getShaderNodes(self)", "def shaders(self):\n\n shaders = []\n shaders.extend(self._verts)\n sha...
[ "0.7740527", "0.6775367", "0.6466401", "0.6452211", "0.6437122", "0.6314355", "0.62679857", "0.62556607", "0.6210403", "0.6105485", "0.596709", "0.5940758", "0.59146404", "0.5878404", "0.5871508", "0.5811813", "0.5789575", "0.57884926", "0.5763394", "0.57063866", "0.566444", ...
0.7934999
0
(Deprecated) Return a vector of all shader references in this material element, taking material inheritance into account.
def _getActiveShaderRefs(self): warnings.warn("This function is deprecated; shader references have been replaced with shader nodes in 1.38.", DeprecationWarning, stacklevel = 2) return getShaderNodes(self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _getShaderRefs(self):\n warnings.warn(\"This function is deprecated; shader references have been replaced with shader nodes in 1.38.\", DeprecationWarning, stacklevel = 2)\n return getShaderNodes(self)", "def shaders(self):\n\n shaders = []\n shaders.extend(self._verts)\n shaders.e...
[ "0.757915", "0.66297746", "0.62730986", "0.61996865", "0.61774623", "0.6176948", "0.60849196", "0.60422945", "0.5975865", "0.5874039", "0.5874017", "0.5842542", "0.58101964", "0.57584727", "0.57190543", "0.56604165", "0.56526685", "0.5576169", "0.5570131", "0.55684435", "0.55...
0.7411408
1
Set the typed value of a property by its name, creating a child element to hold the property if needed.
def _setPropertyValue(self, name, value, typeString = ''): method = getattr(self.__class__, "_setPropertyValue" + getTypeString(value)) return method(self, name, value, typeString)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_property(self, name, value):\n self.properties[name] = value", "def put_prop(self, obj_type, obj_id, prop_name, value):\n ierr = exolib.py_expp(self.exoid, obj_type, obj_id, prop_name, value)\n if ierr:\n raise ExodusIIWriterError(\"Error putting prop value\")", "def set(nod...
[ "0.721912", "0.6700466", "0.66331834", "0.66138595", "0.66018426", "0.6507755", "0.64446765", "0.6388091", "0.6368398", "0.6332222", "0.6309362", "0.6245748", "0.6242877", "0.6225162", "0.6214769", "0.62093395", "0.62029123", "0.61671", "0.61594003", "0.61556596", "0.61158276...
0.63522094
9
Return the typed value of a property by its name. If the given property is not found, then None is returned.
def _getPropertyValue(self, name, target = ''): value = self._getPropertyValue(name) return value.getData() if value else None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def for_property(self, name):\n return self[self.types_map.get(name, 'text')]", "def get_property(self, name):\n if (not name in self.properties):\n raise KeyError(\"Key '\" + name + \"' not found\")\n return self.properties[name]", "def get_dynamic_property(vim, mobj, type, property_name):\n...
[ "0.7251514", "0.6947998", "0.69029963", "0.68013686", "0.66939723", "0.66660714", "0.6600007", "0.649654", "0.64916193", "0.6452159", "0.6415687", "0.6392696", "0.6375681", "0.6374791", "0.6312345", "0.6297999", "0.62391794", "0.62202114", "0.62113297", "0.62047046", "0.61996...
0.57498485
46
Set the value of a geomprop by its name, creating a child element to hold the geomprop if needed.
def _setGeomPropValue(self, name, value, typeString = ''): method = getattr(self.__class__, "_setGeomPropValue" + getTypeString(value)) return method(self, name, value, typeString)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_simple(parent, name, value):\n element = parent.find('./' + name) \n\n if element is None:\n element = ET.SubElement(parent, name)\n element.text = value\n else:\n element.text = value", "def add_geomean_to_product_data(product, prop_name, geomean_val):\n\tfor prop_data_list in product['da...
[ "0.56408846", "0.53583366", "0.5214419", "0.5200524", "0.5169286", "0.5159845", "0.5102088", "0.50392735", "0.50278354", "0.5018636", "0.49757773", "0.49757773", "0.49658227", "0.49325004", "0.48699766", "0.4865401", "0.48650134", "0.4847803", "0.48443377", "0.48255238", "0.4...
0.5464608
1
(Deprecated) Add a material element to the document.
def _addMaterial(self, name): warnings.warn("This function is deprecated; call Document.addMaterialNode() instead.", DeprecationWarning, stacklevel = 2) return self.addMaterialNode(name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def AddMaterial(self, *args):\n return _XCAFDoc.XCAFDoc_MaterialTool_AddMaterial(self, *args)", "def append_material(self, material):\n # First check if asset attribute exists; if not, define the asset attribute\n if not hasattr(self, \"asset\"):\n self.asset = ET.Element(\"asset\...
[ "0.7026196", "0.6792848", "0.667132", "0.59274834", "0.5922771", "0.5812614", "0.57446635", "0.5629134", "0.5546216", "0.55392534", "0.5464084", "0.5419899", "0.53916496", "0.53648096", "0.53525424", "0.53359", "0.53133327", "0.5275986", "0.51976895", "0.51882774", "0.5178728...
0.8210709
0
(Deprecated) Return a vector of all materials in the document.
def _getMaterials(self): warnings.warn("This function is deprecated; call Document.getMaterialNodes() instead.", DeprecationWarning, stacklevel = 2) return self.getMaterialNodes()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def info_materials_polymer_get():\n materials = _material_by_group(974) # 974 == intermediate group\n return materials, 200", "def info_materials_get():\n materials = _material_by_group() # empty means all groups\n return materials, 200", "def info_materials_raw_get():\n materials = _material_by...
[ "0.72720134", "0.7060891", "0.67700535", "0.6652309", "0.6613427", "0.64064366", "0.638908", "0.63752085", "0.63551617", "0.633049", "0.62788475", "0.6175576", "0.6156727", "0.6118103", "0.61163384", "0.601052", "0.59336454", "0.57874507", "0.5771847", "0.57317346", "0.571983...
0.7945748
0
Return the default data search path.
def getDefaultDataSearchPath(): return FileSearchPath(os.path.dirname(__file__))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_default_path(self):\n return os.path.join(cfg.DATA_DIR, 'vehicles_dataset_v{}'.format(self._version))", "def default_data_dir(self):\n return self._default_data_dir", "def _get_default_path(self):\n return os.path.join(cfg.DATA_DIR, 'visual_genome')", "def _get_default_path(self):\n...
[ "0.8129479", "0.8007878", "0.79695016", "0.79296505", "0.7858564", "0.7470226", "0.743667", "0.7417918", "0.74098426", "0.74098426", "0.7362305", "0.7316143", "0.72809714", "0.72342837", "0.72125745", "0.7184736", "0.7136621", "0.70106024", "0.69430655", "0.6912006", "0.68595...
0.8906264
0
Return list of default data library folders
def getDefaultDataLibraryFolders(): return [ 'libraries' ]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_default_paths():\n DATA_ROOT = os.environ.get(\"DATA_ROOT\", \"data\")\n defaults = {\n \"TOKENIZE_DATA_DIR\": DATA_ROOT + \"/tokenize\",\n \"MWT_DATA_DIR\": DATA_ROOT + \"/mwt\",\n \"LEMMA_DATA_DIR\": DATA_ROOT + \"/lemma\",\n \"POS_DATA_DIR\": DATA_ROOT + \"/pos\",\n ...
[ "0.717137", "0.70716625", "0.6955009", "0.6915999", "0.68801606", "0.68446493", "0.6835322", "0.6751219", "0.66922414", "0.6663725", "0.66411805", "0.66054195", "0.6547148", "0.65449494", "0.65448755", "0.6523286", "0.649509", "0.64830816", "0.6471197", "0.6460034", "0.644567...
0.89339906
0
Convert bbox representation from `camera_view_bounds_2d` to a more standard PILfriendly representation.
def convert_bbox(bbox, width, height): min_x, min_y, max_x, max_y = bbox # scale X axis min_x *= width max_x *= width # invert Y axis and scale min_y = (1 - min_y) * height max_y = (1 - max_y) * height return min_x, min_y, max_x, max_y
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _decode_bbox(self, normalized_bbox):\n #apply the inverse of transformation\n y1,x1,y2,x2 = preprocess.apply_transformation(normalized_bbox,\n np.linalg.inv(self.transformation))\n\n w,h = self.image_size\n y1,x1,y2,x2 = y1*h,x1*w,y2*h,x2*w\n return vot.Rectang...
[ "0.67457765", "0.66060835", "0.66052955", "0.6402712", "0.62045026", "0.6073645", "0.5911082", "0.5882305", "0.58592385", "0.5842651", "0.58156204", "0.5749467", "0.57198113", "0.57176834", "0.56508476", "0.56418383", "0.5637036", "0.5637036", "0.56326663", "0.5607498", "0.56...
0.6208672
4
Get a list of objects labeled as potential referents in the current 3D scene. Referents are live candidates or distractors (e.g. walls).
def get_referents(data): fakes_group = data.groups.get("Fakes") return [obj for obj in data.groups["Referents"].objects if not obj.hide_render or fakes_group in obj.users_group]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all_refobjs(self, ):\n return cmds.ls(type=\"jb_reftrack\")", "def references_list( self, theWeaver ):\n return [ (c.name, c.seq) \n for c in theWeaver.reference_style.chunkReferencedBy( self ) ]", "def find_references(self):\n cls = self.__class__\n nodes = []\n ...
[ "0.65498", "0.6435734", "0.64024466", "0.63173234", "0.6215065", "0.6130572", "0.612474", "0.60120547", "0.5975466", "0.58793086", "0.5838874", "0.5825015", "0.580505", "0.5789633", "0.5718369", "0.5663243", "0.56405354", "0.56184405", "0.55993235", "0.559522", "0.55532086", ...
0.6368696
3
Get a list of objects labeled as candidates in the current 3D scene.
def get_candidates(data): return data.groups["Candidates"].objects
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extract_labels_full(scene: \"Scenemaker\") -> List[Tuple[int, np.ndarray]]:\r\n objects = utils.select_collection(scene.target_collection)\r\n boxes_list = []\r\n\r\n for obj in objects:\r\n objclass = obj.name.split(\".\")[0]\r\n dim = obj.dimensions\r\n r...
[ "0.63349587", "0.6314547", "0.6190732", "0.6160445", "0.613559", "0.599086", "0.5865622", "0.5751449", "0.5702605", "0.5679443", "0.56694674", "0.5667982", "0.5636427", "0.5611984", "0.56053656", "0.55495095", "0.55490893", "0.55352527", "0.5530202", "0.5515282", "0.5503529",...
0.62785876
2
Get a list of objects labeled as frame guides in the current 3D scene.
def get_guides(data): return data.groups["Frames"].objects
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _getBrailleRegionsForAnimation(self, obj):\n\n self._debugGenerator(\"_getBrailleRegionsForAnimation\", obj)\n\n text = \"\"\n text = self._script.appendString(\n text, self._script.getDisplayedLabel(obj))\n text = self._script.appendString(\n text, self._scrip...
[ "0.56232345", "0.5550209", "0.5408272", "0.5292358", "0.52791625", "0.5228657", "0.5212502", "0.5169032", "0.5049105", "0.50468457", "0.5031301", "0.50303346", "0.49700224", "0.49568957", "0.49561343", "0.49337798", "0.4922755", "0.49168405", "0.48798805", "0.48694423", "0.48...
0.639492
0
Get the reference frame type corresponding to a particular guide.
def get_guide_type(guide): # Maintained by naming convention in the Blender files. Sub-optimal. try: return guide.name[guide.name.rindex(".") + 1:] except: return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getComponentType(cls):\n\n return 'Guide'", "def getComponentType(cls):\n\n return 'Guide'", "def get_typ(self, refobj):\n enum = cmds.getAttr(\"%s.type\" % refobj)\n try:\n return JB_ReftrackNode.types[enum]\n except IndexError:\n raise ValueError(\...
[ "0.5693369", "0.5693369", "0.5446423", "0.5337169", "0.53119755", "0.529872", "0.52709115", "0.5264755", "0.5190898", "0.5159653", "0.51567864", "0.5133397", "0.50048554", "0.49838355", "0.49712083", "0.49645618", "0.48794225", "0.48541024", "0.48476246", "0.4845618", "0.4842...
0.7534499
0
Randomize the position of an object `obj` along some linear guide path `guide`.
def randomize_position(obj, guide): p1, p2 = get_guide_endpoints(guide) t = random.random() target_point = p1 + t * (p2 - p1) # update X and Y coordinates. obj.location[0] = target_point[0] obj.location[1] = target_point[1] return t
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def randomize_distance(obj, guide, scale_bounds=(-2, 0)):\n p1, p2 = get_guide_endpoints(guide)\n midpoint = p1 / 2 + p2 / 2\n\n # Get vector perpendicular to the guide.\n diff_rot = Matrix.Rotation(math.pi / 2, 3, 'Z') * (p2 - p1)\n\n scale_factor = scale_bounds[0] + random.random() * (scale_bounds...
[ "0.72296953", "0.55692446", "0.5526078", "0.5247486", "0.52031153", "0.51109755", "0.509799", "0.50979686", "0.5030604", "0.49457812", "0.49372828", "0.49313664", "0.49087912", "0.48839825", "0.48837227", "0.48356238", "0.4801894", "0.47983634", "0.47845507", "0.47785735", "0...
0.82932264
0
Center the position of an object `obj` along a linear guide path `guide`, and randomize its distance on the axis perpendicular to that guide.
def randomize_distance(obj, guide, scale_bounds=(-2, 0)): p1, p2 = get_guide_endpoints(guide) midpoint = p1 / 2 + p2 / 2 # Get vector perpendicular to the guide. diff_rot = Matrix.Rotation(math.pi / 2, 3, 'Z') * (p2 - p1) scale_factor = scale_bounds[0] + random.random() * (scale_bounds[1] - scale_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def randomize_position(obj, guide):\n p1, p2 = get_guide_endpoints(guide)\n t = random.random()\n target_point = p1 + t * (p2 - p1)\n\n # update X and Y coordinates.\n obj.location[0] = target_point[0]\n obj.location[1] = target_point[1]\n\n return t", "def center(self, obj):\n mn0 = ...
[ "0.7362369", "0.5656115", "0.5133738", "0.4947574", "0.49140757", "0.4901315", "0.4811237", "0.46052918", "0.4575708", "0.45413876", "0.4496817", "0.44632584", "0.4445101", "0.44152486", "0.44121188", "0.44050354", "0.43854836", "0.43493664", "0.43398598", "0.43357167", "0.43...
0.75807685
0
Move candidate referents to random positions in the given reference frames. `candidate_setting` is of the form `[(person, guide_path), (person2, guide_path), ...]`
def prepare_scene(data, candidate_setting, randomization_mode): manipulations = defaultdict(dict) for person, guide in candidate_setting.items(): if randomization_mode == "none": # Center the candidate along the guide. p1, p2 = get_guide_endpoints(guide) target = p1 /...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def switch_points(mutated_genome,index):\n point_index1 = random.randint(0,max(0,len(mutated_genome[index][2])-1))\n point_index2 = random.randint(0,max(0,len(mutated_genome[index][2])-1))\n temp = mutated_genome[index][2][point_index1]\n mutated_genome[index][2][point_index1] = mutated_genome[index][2][po...
[ "0.6009613", "0.53904885", "0.5373188", "0.5336502", "0.52867323", "0.52322876", "0.51420814", "0.51346767", "0.50901896", "0.5086578", "0.49775714", "0.49687153", "0.4933418", "0.4913252", "0.48939452", "0.48697948", "0.48356456", "0.4826306", "0.4824639", "0.48112273", "0.4...
0.5655333
1
Allows leastsq to take bounds if minimize function is missing.
def myleastsq(errfunc0,x0,args=None,bounds=None,**exkw): from scipy import optimize if hasattr(optimize,'minimize'): def errfunc(x,*iargs): return sum(errfunc0(x,*iargs)**2) if args is not None: exkw['args'] = args res = optimize.minimize(errfunc,x0[:],bounds=bounds,**exkw) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def leastsqbound(func,x0,bounds,args=(),**kw):\n # check for full output\n if \"full_output\" in kw and kw[\"full_output\"]:\n full=True\n else:\n full=False\n\n # convert x0 to internal variables\n i0 = external2internal(x0,bounds)\n\n # perfrom unconstrained optimization using int...
[ "0.7573677", "0.6523712", "0.6448234", "0.6322002", "0.6261192", "0.625652", "0.6225058", "0.62234515", "0.61956996", "0.61218625", "0.6083507", "0.6068286", "0.6016386", "0.60070544", "0.5992043", "0.5962499", "0.5946215", "0.5920246", "0.58964807", "0.58740616", "0.5871715"...
0.71415097
1
Calculates radius from position.
def pos2rad(pos): return np.sqrt(pos[:,0]**2 + pos[:,1]**2 + pos[:,2]**2)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def radius(self):\n if self._radius is None:\n translated_xyz = translate_to_center_of_mass(self.get_xyz())\n _, symbols, x, y, z = get_xyz_matrix(translated_xyz)\n border_elements = list() # a list of the farthest element/s\n r = 0\n for si, xi, yi, z...
[ "0.70792216", "0.69666016", "0.69520116", "0.69332325", "0.6903839", "0.6901474", "0.6901474", "0.6901474", "0.6901474", "0.6901474", "0.6894386", "0.6791088", "0.67536217", "0.670865", "0.67043376", "0.67016387", "0.66416734", "0.66090345", "0.66090345", "0.6583494", "0.6566...
0.63723207
26
Returns spherical volume for provided radii.
def sphvol(r): return (4./3.)*np.pi*(r**3.)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sphere_volume(radius : number) -> number:\n volume = 4/3*(pi*radius*radius*radius)\n return volume", "def sphere_volume(r):\n return (4/3) * 3.14159 * r**3", "def sphere_volume(r):\n\treturn 4/3. * math.pi * r ** 3", "def sphereVolume(radius):\n volume = (4 / 3) * math.pi * radius ** 3\n r...
[ "0.8135021", "0.8046071", "0.79767275", "0.79615855", "0.791515", "0.7734994", "0.74793535", "0.70156354", "0.70105755", "0.68960035", "0.6703716", "0.6640072", "0.65109974", "0.6499378", "0.64409107", "0.6390947", "0.6348823", "0.63122714", "0.63122714", "0.6301664", "0.6257...
0.74382997
7
Returns spherical radii for provided volumes.
def sphrad(vol): return (3.*vol/(4.*np.pi))**(1./3.)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sphere_volume(r):\n return (4/3) * 3.14159 * r**3", "def sphere_volume(r):\n\treturn 4/3. * math.pi * r ** 3", "def sphere_volume(radius : number) -> number:\n volume = 4/3*(pi*radius*radius*radius)\n return volume", "def sphere_volume(sphere_radius):\n return (4 / 3 * np.pi * sphere_radius**...
[ "0.70751446", "0.69737434", "0.69169736", "0.6792967", "0.6701074", "0.66413015", "0.6604082", "0.6572043", "0.63632387", "0.62836486", "0.62836486", "0.62725145", "0.613928", "0.6092999", "0.6058674", "0.5973587", "0.5946293", "0.59038186", "0.5898153", "0.5847563", "0.58467...
0.71128243
0
Returns the circular velocity.
def calc_vcirc(r,menc,G=1.): if G is None: G = 1. return np.sqrt(G*menc/r)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_velocity(self):\n return self.momentum/self.mass", "def get_start_velocity(self):\n # uniform circular motion have a start velocity of omega\n # TODO generate from start position and rotation direction\n return np.array([0, self.wz, 0])", "def circumference(self):\n r...
[ "0.7257846", "0.7252623", "0.69760185", "0.6974948", "0.6948337", "0.6904478", "0.68118125", "0.6809711", "0.679329", "0.679329", "0.67710674", "0.6732156", "0.6705026", "0.66750187", "0.65806377", "0.64651424", "0.64618456", "0.64478517", "0.64435196", "0.6440419", "0.640747...
0.0
-1
Calculates the total mass enclosed by each particle.
def calc_menc(m,sortby=None): # Sort and sum if sortby array provided if sortby is not None: idxsort = np.argsort(sortby) idxsort_rev = np.argsort(idxsort) menc = np.cumsum(m[idxsort])[idxsort_rev] # Otherwise just sum else: menc = np.cumsum(m) # Return return men...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def totalmass_comvelocity(particle_list):\r\n total_momentum = sum([particle.linear_momentum()\r\n for particle in particle_list])\r\n total_mass = sum([particle.mass for particle in particle_list])\r\n\r\n return total_mass, total_momentum / total_mass", "def ad...
[ "0.75831574", "0.73967713", "0.7380214", "0.71559113", "0.71221864", "0.7067972", "0.7059113", "0.7050664", "0.70366937", "0.7007502", "0.6986225", "0.6907047", "0.6829601", "0.6829601", "0.67537653", "0.6751702", "0.670181", "0.6688298", "0.66798764", "0.66797316", "0.658996...
0.0
-1
Returns the density enclosed within rmax.
def calc_rhoenc(mass,r,rmax): idx = (r<rmax) return mass[idx].sum()/sphvol(rmax)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_max_density(self):\n max_density = str(self.density.index(min(self.density)) + 1)\n print(max_density)\n return max_density", "def get_rmax(self):\n return self.rmax", "def _get_max_rupture_projection_radius(self):\n if self.max_radius: # already computed\n ...
[ "0.7466451", "0.68567127", "0.6770987", "0.64775264", "0.64172965", "0.63328725", "0.6259476", "0.6152548", "0.6098544", "0.606421", "0.6053934", "0.60529995", "0.5983414", "0.5938681", "0.5918545", "0.5912345", "0.589474", "0.5892661", "0.5886185", "0.5880672", "0.58720237",...
0.61871815
7
Calculate particle radii from volume information. Volumes are sorted then cummulatively summed to get enclosed volume at each particle. Radii are then calculated by assumming that each enclosed volume is a sphere. Returned radii are in the same particle order as the input volumes.
def vol2rad(vol,sortby=False,outsort=False,weightby=False,weight=0.5): # Sort if isinstance(sortby,np.ndarray): if len(sortby)!=len(vol): raise Exception('The sortby array (len={}) must have the '.format(len(sortby))+ 'same length as the volume array (len={}).'.fo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sphere_volume(r):\n return (4/3) * 3.14159 * r**3", "def sphere_volume(r):\n\treturn 4/3. * math.pi * r ** 3", "def sphere_volume(radius : number) -> number:\n volume = 4/3*(pi*radius*radius*radius)\n return volume", "def get_radii(self) -> np.ndarray:\n return np.array([self._radii[p] fo...
[ "0.68379015", "0.680143", "0.6665896", "0.659714", "0.65940964", "0.64038986", "0.63235945", "0.6316446", "0.6308377", "0.6302009", "0.61612254", "0.60437113", "0.6036599", "0.60151094", "0.58739436", "0.5810771", "0.5796187", "0.5743727", "0.57129395", "0.5707252", "0.568340...
0.52332944
55
Squeezes 3D positions along y and z axes while preserving volume.
def squeeze_constvol(pos,yfact=-1,zfact=-1): squfact = 1.0 if yfact > 0: squfact*=yfact pos[:,1]*=yfact if zfact > 0: squfact*=zfact pos[:,2]*=zfact pos*=(squfact**(-1./3.)) return pos
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def planes_3d(self, quantity, xplane, yplane):\n xplane = int(xplane)\n yplane = int(yplane)\n # Get the scalar values\n # Get the data on the plane with a fixed x value. These means we'll\n # have changing (y, z) points\n xdata = self.get_plane(quantity, 'yz', xplane)\n ...
[ "0.5905184", "0.583379", "0.5720596", "0.5672659", "0.5666331", "0.5634003", "0.5627785", "0.5615881", "0.56032383", "0.5562901", "0.5532643", "0.55280274", "0.5481719", "0.54555655", "0.54548764", "0.54529595", "0.5406398", "0.5384927", "0.53750247", "0.53184706", "0.5297355...
0.57265604
2
Return y and z squeeze factors for given triaxiality and ellipticity.
def triax2squeeze(t,e): a = 1. c = e b = np.sqrt(c**2 - t*(c**2-a**2)) return b
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def squeeze(self, z, mode):\n phi = angle(z)\n r = abs(z)\n self.circuit.squeeze(r, phi, mode)", "def get_curve_3D(eig, alpha=0.25,g23=0.5,g12=0.5): # renumerated according to sato et al: l3 is smallest\n #return sato(eig,alpha,g23, g12)\n return frangi(eig)", "def rewofzs3(x,y):\n\n...
[ "0.52789277", "0.5276468", "0.52199775", "0.5066924", "0.4951103", "0.49427873", "0.48867345", "0.48485625", "0.48359007", "0.48293853", "0.48282418", "0.48027712", "0.47908416", "0.47846416", "0.47615057", "0.47445077", "0.473211", "0.47158596", "0.46936327", "0.4692484", "0...
0.5169719
3
Writes values to a string.
def val2str(val): # Return the input if it's a string if isinstance(val,str ): valstr=val # Handle types where spaces are added elif isinstance(val,tuple): valstr=repr(val).replace(', ',',') elif isinstance(val,list ): valstr=repr(val).replace(', ',',') elif isinstance(val,dict ): valstr=repr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _write_values_to_string(self, values, etype):\n\n values = values.astype(etype)\n string_out = values.tostring()\n return string_out", "def writeString(self, value: str):\n length = len(value)\n\n self._pack('i', length)\n self._pack('{:d}s'.format(length), value)", ...
[ "0.7074559", "0.6887698", "0.66502863", "0.6603683", "0.6545392", "0.65319484", "0.6472395", "0.6416302", "0.64148325", "0.63818043", "0.619167", "0.6181713", "0.6100718", "0.6066478", "0.6060324", "0.60579085", "0.60216725", "0.59473294", "0.5937376", "0.592608", "0.591881",...
0.0
-1
Recovers variables from a string.
def str2val(valstr,dtype=None): valstr_strip=valstr.strip() if isinstance(dtype,type): dtype = str(dtype) # Get data type if not provided if not isinstance(dtype,str): if len(valstr_strip)==0: dtype='str' elif valstr_strip.startswith('"') and valstr_strip.endswith('"'): valst...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_vars_in_str(self, line):\n self.E_str = \"find_vars_in_str\"\n any_vars = [i[1:] for i in re.findall(IN_STR_VAR_REGEX, line)]\n for check_var in any_vars:\n # Check the variable exists\n if check_var not in self.variables:\n self.print_error(f\"Can...
[ "0.6900766", "0.6373661", "0.6054565", "0.5983019", "0.5958039", "0.59292144", "0.5895967", "0.58793455", "0.5832745", "0.5809944", "0.5805092", "0.57732123", "0.5708655", "0.56362337", "0.5634472", "0.56196606", "0.56066906", "0.5551476", "0.5522919", "0.5520223", "0.5505402...
0.0
-1
Convert number to string, replacing punctuation.
def num2str(numval,formstr=None,decrep='p',negrep='n',nsig=3,trimzero=True): import copy from string import maketrans # Set default if formstr is None: formstr='.{}g'.format(nsig) # Round numval if within precision if trimzero and not isinstance(numval,(int,long)): precval=10.**(-(nsig-1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transform(s):\r\n return 'digit ' + str(s)", "def convert(number):\n out = \"\"\n if number % 3 == 0:\n out = \"Pling\"\n if number % 5 == 0:\n out = out + \"Plang\"\n if number % 7 == 0:\n out = out + \"Plong\"\n if out == \"\":\n out = str(number)\n return o...
[ "0.6683302", "0.6635494", "0.6613576", "0.6592942", "0.6592942", "0.6592942", "0.6575372", "0.65695816", "0.64755034", "0.64755034", "0.6431362", "0.6401847", "0.6401584", "0.6375053", "0.63302994", "0.6309738", "0.6306367", "0.6301587", "0.62851566", "0.6232513", "0.6218883"...
0.5528809
76
Change Karma Make sure that the user can make a karma change using rate limiting and return whether or not the karma value was added or changed
def _change_karma(self, name, change): can_change = self._apply_rate_limit() if not can_change: return False res = self.bot.db.execute('SELECT target, karma FROM karma') for target in res.fetchall(): if target[0].lower() == name.lower(): self.bot.db.execute('U...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _change_karma(self, nick, target, mode):\n if nick == target:\n return \"You can't modify your own karma.\"\n if target in self.karma and (datetime.datetime.now() -\n self.karma[target][2]).seconds < 5:\n return 'Karma spamming is prohibited.'\n if not ...
[ "0.69934213", "0.6468223", "0.61024314", "0.6042686", "0.60205877", "0.59011203", "0.5773027", "0.5760536", "0.572008", "0.56760347", "0.56500137", "0.5561731", "0.53875303", "0.5348932", "0.53422016", "0.52225053", "0.5194737", "0.518642", "0.5163019", "0.51595706", "0.51449...
0.7706274
0
Apply Rate Limit Check how frequently the current user has run karma commands and, if they exceed a certain threshold (30 seconds) return False so they don't make any karma changes
def _apply_rate_limit(self): update_time = time() user_name = self.bot.user.full_name if user_name in self.tokens.keys(): last_change = self.tokens[user_name][0] # Add 1 token for every 30 seconds from the last change added_tokens = int((update_time - last_cha...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _safe_limit_check(self):\n if self.rem == 40:\n self.time_start = time.time()\n elif time.time() - self.time_start >= 11:\n self.rem = 40\n self.time_start = time.time()\n elif self.rem <= 0:\n t = 11 - (time.time() - self.time_start)\n\n ...
[ "0.62723166", "0.61897874", "0.6130558", "0.594389", "0.5937632", "0.59163153", "0.5882192", "0.5846787", "0.5845753", "0.57633436", "0.57333547", "0.5716136", "0.57108897", "0.57000345", "0.5694648", "0.5694648", "0.56865287", "0.5670449", "0.56523293", "0.56270933", "0.5619...
0.65764576
0
Compute the total duty percentage for each purchase line. there is an extra duty for some vendors.If the 'extra_duty' field's value is true,then we use a duty perc(0.288 most probably) for each 144 qtys
def compute_total_customs_duty(self): for rec in self: total = 0.0 extra_duty = 0.0 price_total = rec.quantity * rec.unit_price # total = (price_total * duty_percentage)/100 rec.price_total = price_total # for hts in rec.hts_ids: # ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_duty_percentage(self):\n container_line_ids = self\n hbl_customs_obj = self.env['hbl.customs.duty']\n for line in container_line_ids:\n p_line = line.purchase_line\n #Get the supplier from product by using po supplier id.\n product_supplier_id = p_line....
[ "0.7884601", "0.5777692", "0.56619155", "0.5644612", "0.5609361", "0.5539036", "0.54949725", "0.54502136", "0.5393716", "0.5389697", "0.53487086", "0.52970153", "0.5285339", "0.5277346", "0.5261509", "0.5249308", "0.5240147", "0.5224184", "0.52226484", "0.5192483", "0.5178316...
0.78766584
1
Get all Smart Groups within a specified subscription. List all the Smart Groups within a specified subscription. .
def get_all( self, target_resource=None, target_resource_group=None, target_resource_type=None, monitor_service=None, monitor_condition=None, severity=None, smart_group_state=None, time_range=None, page_count=None, sort_by=None, sort_order=None, custom_headers=None, raw=False, **operation_config): d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all(isamAppliance, check_mode=False, force=False):\n return isamAppliance.invoke_get(\"Retrieving groups\", \"/sysaccount/groups/v1\")", "def groups(self):\n #return self.get('{}/groups'.format(ApiVersion.A1.value))\n return self.get('{}/groups'.format(ApiVersion.CM1.value))", "def groups():\n...
[ "0.6464921", "0.63494927", "0.634585", "0.62714005", "0.6237212", "0.62311023", "0.62210655", "0.62132645", "0.621206", "0.61955535", "0.619539", "0.6162228", "0.60869414", "0.6082836", "0.6054139", "0.6025941", "0.60177577", "0.6016271", "0.6009167", "0.59990513", "0.5994978...
0.0
-1
Get information related to a specific Smart Group. Get information related to a specific Smart Group.
def get_by_id( self, smart_group_id, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.get_by_id.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(isamAppliance, id, check_mode=False, force=False):\n return isamAppliance.invoke_get(\"Retrieving group\", \"/sysaccount/groups/{0}/v1\".format(id))", "def show_group(self, group_id):\n\n return Client._get(self, id=group_id)", "def get_group_details(self, group_id):\n url = self.group...
[ "0.6050466", "0.604989", "0.60478085", "0.60230494", "0.60096216", "0.60058165", "0.5988405", "0.59130573", "0.59111917", "0.58686566", "0.5820906", "0.58130544", "0.5768425", "0.575321", "0.57311463", "0.57198733", "0.57059264", "0.56633234", "0.5633848", "0.5626244", "0.561...
0.6301686
0
Change the state of a Smart Group.
def change_state( self, smart_group_id, new_state, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.change_state.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subsc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def async_update_group_state(self) -> None:", "def set_group(self, address, group):\n self.groups[address] = group", "def setGroup(self, group):\n\t\tself.config.GROUP = group", "def async_update_group_state(self) -> None:\n self._state = None\n self._async_update_group_state()", "asyn...
[ "0.6732995", "0.6544362", "0.651041", "0.6308661", "0.62980443", "0.62946486", "0.6293723", "0.62864935", "0.62597525", "0.62437063", "0.6167252", "0.6080003", "0.6071449", "0.60538197", "0.6023371", "0.6023371", "0.6023371", "0.59333366", "0.59219843", "0.5875517", "0.585917...
0.570442
29
Get the history a smart group, which captures any Smart Group state changes (New/Acknowledged/Closed) .
def get_history( self, smart_group_id, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.get_history.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def network_history(request, SPIC_group, SPIC_id):\n SPIC_obj = get_object_or_404(SPIC, group=SPIC_group, local_id=SPIC_id)\n network_list = Network.objects.filter(user_id=request.user.pk, SPIC=SPIC_obj).order_by(\"-local_id\")\n\n return {'SPIC_obj': SPIC_obj, 'network_list': network_list}", "def get_h...
[ "0.59609723", "0.59375453", "0.5827547", "0.5729176", "0.568817", "0.5650969", "0.56454545", "0.563896", "0.5626192", "0.5599211", "0.55906564", "0.5589627", "0.55577046", "0.5528631", "0.55192196", "0.54704773", "0.54695994", "0.5442508", "0.5441003", "0.5439692", "0.5434865...
0.6507963
0
Attenuators in, beamstop out, ROI1 set to direct beam
def alignment_start(sample_name='alignment'): smi = SMI_Beamline() yield from smi.modeAlignment() # Set direct beam ROI yield from smi.setDirectBeamROI() sample_id(user_name='test', sample_name=sample_name) proposal_id('2023_2', '311564_test')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def beam_align():\n\n # do nothing if there is a sample mounted to avoid collisions\n if smart_magnet.sample_detect.get() == 0:\n raise Exception(\"Sample mounted on gonio! Avoided collision\")\n\n # wait for attenuators to finish moving\n yield from bps.abs_set(mxatten, 0.002)\n yield from b...
[ "0.60829043", "0.57773566", "0.5751061", "0.55324805", "0.5464092", "0.54330367", "0.534069", "0.5322202", "0.53134006", "0.5286224", "0.5254157", "0.52369833", "0.5228862", "0.5226033", "0.5207312", "0.5176918", "0.5160592", "0.5144474", "0.5130545", "0.51288116", "0.5115674...
0.0
-1
Attenuators in, beamstop out, ROI1 set to direct beam
def alignment_start_angle(angle=0.10): smi = SMI_Beamline() yield from smi.modeAlignment() # Set reflected beam ROI yield from smi.setReflectedBeamROI(total_angle=angle, technique="gisaxs")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def beam_align():\n\n # do nothing if there is a sample mounted to avoid collisions\n if smart_magnet.sample_detect.get() == 0:\n raise Exception(\"Sample mounted on gonio! Avoided collision\")\n\n # wait for attenuators to finish moving\n yield from bps.abs_set(mxatten, 0.002)\n yield from b...
[ "0.6081809", "0.5777927", "0.57516456", "0.5532476", "0.5465286", "0.5433055", "0.5341489", "0.53219754", "0.53150827", "0.5288024", "0.5256378", "0.5239029", "0.52265924", "0.5226345", "0.5207449", "0.51792234", "0.51619565", "0.51443416", "0.51314235", "0.5128932", "0.51179...
0.0
-1
Attenuators out, beamstop in,
def alignment_stop(): smi = SMI_Beamline() yield from smi.modeMeasurement() proposal_id('2023_2', '311564_Pettersson')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def beam_align():\n\n # do nothing if there is a sample mounted to avoid collisions\n if smart_magnet.sample_detect.get() == 0:\n raise Exception(\"Sample mounted on gonio! Avoided collision\")\n\n # wait for attenuators to finish moving\n yield from bps.abs_set(mxatten, 0.002)\n yield from b...
[ "0.59246117", "0.53664815", "0.5361966", "0.52839315", "0.5274596", "0.5259131", "0.52420837", "0.51933676", "0.51914835", "0.51529115", "0.5128894", "0.5128894", "0.5128894", "0.5128894", "0.50962025", "0.50304735", "0.5025527", "0.49930224", "0.49781093", "0.49603343", "0.4...
0.5679036
1
Align using an original script
def alignment_org(angle=0.1): proposal_id('2023_2', '311564_test') yield from alignement_gisaxs_multisample(angle=angle) RE.md['ai_0'] = piezo.th.user_setpoint.get() proposal_id('2023_2', '311564_Pettersson')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def align(self):\n ...", "def align(): # open EH and fast shutter\n\t#marAuxiliary.closeMarShield()\n\td2in()\n\td3in()\n\tsh('o')", "def align(args) :\n from aligner import align_reads\n align_reads(args)", "def align(filename, prog, outfile):\n ra = RunAlign()\n ra.run_...
[ "0.7794893", "0.6693876", "0.66196114", "0.658792", "0.63913846", "0.60286033", "0.5967192", "0.5963368", "0.59541565", "0.5938182", "0.5919008", "0.5912491", "0.590243", "0.58918756", "0.5821559", "0.57543087", "0.5752975", "0.5727278", "0.57195127", "0.57155657", "0.5712719...
0.0
-1
RE(run_loop_measurement(t=1, name='1bl_PEI_10mM', loops=7, pump_t=210, total_t=720, jump_x=10)) Take measurements in the loop Sample has to be aligned before starting the script and theta angle at 0 deg (flat sample).
def run_loop_measurement(t=0.5, name='test', loops=4, pump_t=180, total_t=600, jump_x=10): incident_angles = [0.1, 0.4] waxs_arc = [20, 0] user = "TP" condition = ( ( -1 < waxs.arc.position ) and ( waxs.arc.position < 1 ) and (waxs_arc[0] == 20) ) if condition: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run_multiobjective(inputs, parameters = None):\n def thickness(x, t, chord):\n y = af.Naca00XX(chord, t, [x], return_dict = 'y')\n thickness_at_x = y['u'] - y['l']\n return thickness_at_x \n\n if parameters != None:\n eng = parameters[0]\n import_matlab = False\n els...
[ "0.5746817", "0.5685441", "0.5681871", "0.5642942", "0.5569622", "0.55403596", "0.5525413", "0.55203384", "0.5511839", "0.545532", "0.5445678", "0.5411594", "0.54065305", "0.54041046", "0.53374296", "0.53127813", "0.52985483", "0.52948815", "0.5291056", "0.52908057", "0.52744...
0.7498953
0
check whether X and Y have the matching sample size.
def __init__(self, x_, batch_size, valid=False, ini_random=True): self.n = len(x_) self.X = x_ self.index = 0 self.batch_size = batch_size self.base_index = np.arange(self.n)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_size_check(self):\n [x1, y1, s1, g1] = self.data.diffusion_data.shape\n [x2, y2, s2, g2] = module_05.run_module(self.data).diffusion_data.shape\n self.assertEqual(x1, x2)\n self.assertEqual(y1, y2)\n self.assertEqual(s1, s2)\n self.assertEqual(g1, g2)", "def che...
[ "0.6701522", "0.6699848", "0.6699655", "0.66728204", "0.64815956", "0.64527076", "0.6423499", "0.6414772", "0.63765645", "0.6297624", "0.6293033", "0.612498", "0.61043894", "0.6100697", "0.6078992", "0.60533476", "0.60430604", "0.6027591", "0.6017969", "0.6015054", "0.6003637...
0.0
-1
Nacte bajty ze vstupniho binarniho souboru a preve je na uint8 a vrati jako list
def read_bytes_to_list(path): vstup = [] index = 0 with open(path, "rb") as f: byte = f.read(1) while byte != '': index = index + 1 vstup.append(struct.unpack('b', byte)[0]) byte = f.read(1) if not byte: break return vstup
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getAllFileBytes(self) -> List[ghidra.program.database.mem.FileBytes]:\n ...", "def getByteArray(self, name: unicode) -> List[int]:\n ...", "def get_list_of_bytes2(self):\n pass", "def network_bytes(self) -> List[bytes]:", "def get_byte(self, *args) -> \"PyObject *\":\n retur...
[ "0.59729344", "0.5932491", "0.55452764", "0.53782064", "0.53719026", "0.53628296", "0.5361053", "0.53410685", "0.5298277", "0.5277501", "0.52300537", "0.5216152", "0.5197471", "0.5186267", "0.51661885", "0.5151425", "0.5142084", "0.5131954", "0.5114525", "0.51049876", "0.5091...
0.57869107
2
LZW komprese dict_of_abc je vstupni slovnik dat na kazdem indexu slovniku je list v prubehu komprese se do nej pridavaji polozky list_of_data je posloupnost cisel ke kompresi
def do_LZW_Compression(dict_of_abc, list_of_data): # rozdil mezi None a [] je v pouziti metody extend na listu result = [] P = [] C = [] # C je vzdy jeden prvek ze vstupu PC = [] #how it works video xplanation https://www.youtube.com/watch?v=MQ4ObKv2L_M for i in range(len...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_LZW_DeCompression(dict_of_abc, list_of_data):\n \n #https://www.youtube.com/watch?v=MQM_DsX-LBI\n \n out = []\n predchozi_out = []\n for i in range(len(list_of_data)):\n new = []\n new.extend(predchozi_out)\n if list_of_data[i] in dict_of_abc:\n o = dict_of_...
[ "0.81415105", "0.5463324", "0.5255911", "0.51981646", "0.51777226", "0.5148649", "0.5143358", "0.51358664", "0.5128433", "0.5083292", "0.5054639", "0.5033062", "0.50319797", "0.5004983", "0.49983892", "0.49932218", "0.49870348", "0.498288", "0.49821144", "0.49720147", "0.4967...
0.785483
1
LZW Dekomprese dict_of_abc je vstupni slovnik dat na kazdem indexu slovniku je list v prubehu komprese se do nej pridavaji polozky list_of_data je posloupnost cisel pro dekompresi
def do_LZW_DeCompression(dict_of_abc, list_of_data): #https://www.youtube.com/watch?v=MQM_DsX-LBI out = [] predchozi_out = [] for i in range(len(list_of_data)): new = [] new.extend(predchozi_out) if list_of_data[i] in dict_of_abc: o = dict_of_abc[list_of_dat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_LZW_Compression(dict_of_abc, list_of_data):\n \n # rozdil mezi None a [] je v pouziti metody extend na listu\n \n result = []\n P = []\n C = [] # C je vzdy jeden prvek ze vstupu\n PC = []\n \n #how it works video xplanation https://www.youtube.com/watch?v=MQ4ObKv2L_M\n \n fo...
[ "0.7625661", "0.5576687", "0.5428306", "0.5259145", "0.52158284", "0.5127516", "0.51260525", "0.51113755", "0.5106959", "0.50973123", "0.507302", "0.5056697", "0.50454503", "0.50228345", "0.5017704", "0.49628225", "0.49544364", "0.4946142", "0.49108753", "0.49073184", "0.4903...
0.81224066
0
dict_of_abc vypada napriklad takto
def dict_cointains_list(dict_of_abc, item_list): values = list(dict_of_abc.values()) #projdu vsecky listy ve slovniku for i in range(len(values)): #predpokladam ze ve slovniku je finded = True for j in range(len(values[i])): if len(item_list) == len(values[i]):...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_cases_for_dict(self):\n pass", "def init_dict() -> None:\n for elem in letters:\n ascii_dict[elem] = []\n for elem in numbers:\n ascii_dict[elem] = []\n for elem in symbols:\n ascii_dict[elem] = []", "def dictogram_dictlist(self):\n for key, value in sel...
[ "0.59698254", "0.5688297", "0.56781894", "0.56143355", "0.5542839", "0.5520396", "0.5489875", "0.5482796", "0.5428855", "0.54169875", "0.5414742", "0.54147077", "0.5387781", "0.5383238", "0.53804624", "0.5378157", "0.53751314", "0.533766", "0.53338116", "0.5317185", "0.530112...
0.61399186
0