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
r""" Enable or disable specified input image. If enabling input image, optional custom settings can be specified in customArgs.
def enableInputImageByName(self, inputImage, enabled=True, customArgs=None): if inputImage not in getInputImageTypes(): self.logger.warning('Input image type %s is not recognized', inputImage) return if enabled: if customArgs is None: customArgs = {} self.logger.debug('Enablin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def enableInputImages(self, **inputImages):\n self.logger.debug('Updating enabled input images types with %s', inputImages)\n self.inputImages.update(inputImages)\n self.logger.debug('Enabled input images types: %s', self.inputImages)", "def setEnabled(*args):", "def setEnabled(*args):", "def setEna...
[ "0.7061782", "0.62825954", "0.62825954", "0.62825954", "0.62825954", "0.62825954", "0.62825954", "0.62825954", "0.62825954", "0.62825954", "0.62825954", "0.62825954", "0.59351027", "0.581261", "0.581261", "0.581261", "0.581261", "0.581261", "0.581261", "0.581261", "0.581261",...
0.75504714
0
Enable input images, with optionally custom settings, which are applied to the respective input image. Settings specified here override those in kwargs.
def enableInputImages(self, **inputImages): self.logger.debug('Updating enabled input images types with %s', inputImages) self.inputImages.update(inputImages) self.logger.debug('Enabled input images types: %s', self.inputImages)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def enableInputImageByName(self, inputImage, enabled=True, customArgs=None):\n if inputImage not in getInputImageTypes():\n self.logger.warning('Input image type %s is not recognized', inputImage)\n return\n\n if enabled:\n if customArgs is None:\n customArgs = {}\n self.logger.d...
[ "0.75860304", "0.71119815", "0.6290015", "0.59151906", "0.5834432", "0.56261206", "0.560337", "0.5568557", "0.5532304", "0.55164206", "0.55091166", "0.5507203", "0.54913306", "0.53785723", "0.5370891", "0.53520036", "0.53520036", "0.53520036", "0.53520036", "0.53520036", "0.5...
0.8008344
0
Enable all classes and all features.
def enableAllFeatures(self): self.logger.debug('Enabling all features in all feature classes') for featureClassName in self.getFeatureClassNames(): self.enabledFeatures[featureClassName] = [] self.logger.debug('Enabled features: %s', self.enabledFeatures)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def enable(self, *args, **kwargs):\n pass", "def _enable(self):\n self.debug_log(\"Enabling...\")\n self._register_handlers()", "def enable(cls):\r\n cls.disable()\r\n sys.meta_path.insert(0, cls())", "def enable(self):\n pass", "def enable(self):\n self.ena...
[ "0.65616536", "0.64384973", "0.63570607", "0.63292027", "0.627972", "0.62389576", "0.6151444", "0.61159676", "0.60977143", "0.6018554", "0.5983644", "0.5950242", "0.5950242", "0.5927329", "0.58994263", "0.5877411", "0.58279175", "0.5823262", "0.58101696", "0.57101333", "0.570...
0.8068366
0
Enable or disable all features in given class.
def enableFeatureClassByName(self, featureClass, enabled=True): if featureClass not in self.getFeatureClassNames(): self.logger.warning('Feature class %s is not recognized', featureClass) return if enabled: self.logger.debug('Enabling all features in class %s', featureClass) self.enable...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def enableAllFeatures(self):\n self.logger.debug('Enabling all features in all feature classes')\n for featureClassName in self.getFeatureClassNames():\n self.enabledFeatures[featureClassName] = []\n self.logger.debug('Enabled features: %s', self.enabledFeatures)", "def enableFeaturesByName(self, *...
[ "0.7448473", "0.589912", "0.57723415", "0.57723415", "0.57723415", "0.57723415", "0.57723415", "0.57723415", "0.57723415", "0.57723415", "0.57723415", "0.57723415", "0.57723415", "0.547834", "0.544477", "0.53477913", "0.5314227", "0.5266131", "0.5256946", "0.5222854", "0.5169...
0.680213
1
Specify which features to enable. Key is feature class name, value is a list of enabled feature names. To enable all features for a class, provide the class name with an empty list or None as value. Settings for feature classes specified in enabledFeatures.keys are updated, settings for feature classes not yet present ...
def enableFeaturesByName(self, **enabledFeatures): self.logger.debug('Updating enabled features with %s', enabledFeatures) self.enabledFeatures.update(enabledFeatures) self.logger.debug('Enabled features: %s', self.enabledFeatures)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def enableFeatureClassByName(self, featureClass, enabled=True):\n if featureClass not in self.getFeatureClassNames():\n self.logger.warning('Feature class %s is not recognized', featureClass)\n return\n\n if enabled:\n self.logger.debug('Enabling all features in class %s', featureClass)\n ...
[ "0.7588935", "0.7220157", "0.6214421", "0.6084086", "0.59338534", "0.59016854", "0.58781534", "0.5852401", "0.5772626", "0.5720475", "0.5615681", "0.5437084", "0.54323184", "0.5419842", "0.5319318", "0.53126454", "0.5277723", "0.5259413", "0.5245193", "0.5208251", "0.5188673"...
0.7475316
1
Preprocess the image and labelmap. If ImageFilePath is a string, it is loaded as SimpleITK Image and assigned to image, if it already is a SimpleITK Image, it is just assigned to image. All other cases are ignored (nothing calculated). Equal approach is used for assignment of mask using MaskFilePath. If normalizing is ...
def loadImage(self, ImageFilePath, MaskFilePath): self.logger.info('Loading image and mask') if isinstance(ImageFilePath, six.string_types) and os.path.exists(ImageFilePath): image = sitk.ReadImage(ImageFilePath) elif isinstance(ImageFilePath, sitk.SimpleITK.Image): image = ImageFilePath els...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def preprocess(path, path2 , scale):\n image = imread(path)\n label_ = imread(path2)\n\n #label_ = modcrop(label, scale)\n\n # Must be normalized\n input_ = image / 255.\n label_ = label_ / 255.\n\n #input_ = scipy.ndimage.interpolation.zoom(label_, (1./scale), prefilter=False)\n #input_ = scipy.ndimage.in...
[ "0.65085906", "0.61711144", "0.6159926", "0.61240757", "0.6091799", "0.60409606", "0.59914386", "0.5914176", "0.5849112", "0.58378875", "0.580039", "0.5790209", "0.57787704", "0.5715158", "0.5674759", "0.55987114", "0.5583947", "0.55767995", "0.5576684", "0.5569302", "0.55604...
0.6324117
1
Generates provenance information for reproducibility. Takes the original image & mask filepath, as well as the resampled mask which is passed to the feature classes. Returns a dictionary with keynames coded as
def getProvenance(self, imageFilepath, maskFilepath, mask): self.logger.info('Adding additional extraction information') provenanceVector = collections.OrderedDict() generalinfoClass = generalinfo.GeneralInfo(imageFilepath, maskFilepath, mask, self.kwargs, self.inputImages) for k, v in six.iteritems(ge...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def preprocessing(fish_class):\n\n\t# encode fish_class into integer\n\tfish_label = fish_labels[fish_class]\n\t\n\t# return a list of image directories for each image\n\timg_handles = glob.glob(data_dir + fish_class + '/' + '*.jpg')\n\t\n\t# build an empty list to store each img as np.ndarray\n\timgs = []\n\t\...
[ "0.552891", "0.5448059", "0.5411503", "0.5371006", "0.53595996", "0.53296924", "0.53267634", "0.5300106", "0.5253858", "0.51922536", "0.5189962", "0.5188522", "0.511655", "0.51083356", "0.50774795", "0.50622326", "0.5058947", "0.5045965", "0.50381124", "0.50327414", "0.502445...
0.6158426
0
Compute signature using image, mask, \\kwargs settings. This function computes the signature for just the passed image (original or derived), it does not preprocess or apply a filter to the passed image. Features / Classes to use for calculation of signature are defined in
def computeFeatures(self, image, mask, inputImageName, **kwargs): featureVector = collections.OrderedDict() # Calculate feature classes for featureClassName, enabledFeatures in six.iteritems(self.enabledFeatures): # Handle calculation of shape features separately if featureClassName == 'shape':...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_image_signature(self):\n pass", "def generate_signature(self, image: Image) -> np.array:\n # Step 1: Load image as array of grey-levels\n im_array = preprocess_image(image)\n\n # Step 2a: Determine cropping boundaries\n if self.crop_percentiles is not None:...
[ "0.63266903", "0.6138613", "0.5865123", "0.57880235", "0.57880235", "0.57880235", "0.57880235", "0.57880235", "0.57880235", "0.55053073", "0.54949194", "0.54736435", "0.54736435", "0.54573", "0.54460126", "0.5432876", "0.5386486", "0.53640884", "0.5354486", "0.5339103", "0.53...
0.0
-1
Returns a list of all possible feature classes.
def getFeatureClassNames(self): return self.featureClasses.keys()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def classes(self):\n return list(self._classes_generator())", "def all(cls):\n results = []\n for name in FEATURES:\n feat = cls.get_by_name(name)\n if feat is None:\n feat = cls(name=name)\n cls.query.session.add(feat)\n results...
[ "0.7083753", "0.7047303", "0.6986615", "0.693242", "0.6733783", "0.6730487", "0.67188895", "0.6682392", "0.6679798", "0.66244197", "0.65775675", "0.65715474", "0.65669453", "0.65622187", "0.65523064", "0.65395606", "0.65354544", "0.65196466", "0.65172577", "0.65092283", "0.64...
0.76183635
0
Returns a list of all possible features in provided featureClass
def getFeatureNames(self, featureClassName): return self.featureClasses[featureClassName].getFeatureNames()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all_features(self) :\n raise NotImplementedError", "def all(cls):\n results = []\n for name in FEATURES:\n feat = cls.get_by_name(name)\n if feat is None:\n feat = cls(name=name)\n cls.query.session.add(feat)\n results.ap...
[ "0.6993939", "0.68624085", "0.6709082", "0.669176", "0.6688182", "0.6592365", "0.65730655", "0.6553046", "0.64251375", "0.6407249", "0.62570727", "0.62361485", "0.6235838", "0.622333", "0.6219865", "0.61453277", "0.609679", "0.60952693", "0.6093235", "0.60358524", "0.602832",...
0.700178
0
Break each set of measurements into a subset a range of ~30120 seconds Use polyfit to find the best fit second order polynomial Find the inflection point of the best fit polynomial If the polyfit inflection point is very close to the median time point in the record An inflection is found
def find_inflections(study, record, sensor, segment, range): # check if the inflections have already been found path = [study, 'analyzed', 'inflections', 'all_times', str(range), record, segment] pathJoined = os.path.join(*path) file = os.path.join(pathJoined, sensor + ".csv") if os.path.isfile(fi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def findpeakl(data, zp, noise, bottom, top, r):\n length = len(data)\n width = (top - bottom)/(length - 1)\n absdata = []\n peak = []\n for i in range(length):\n absdata.append(abs(data[i] - zp[i]))\n i = 0\n fsnum = 0#fitting section number\n fsec = []#fitting section\n fdata = [...
[ "0.5755418", "0.5700004", "0.56831235", "0.5657567", "0.56494856", "0.5626742", "0.5622285", "0.5621709", "0.5592336", "0.55063874", "0.5498446", "0.5471435", "0.5460565", "0.5431857", "0.54292023", "0.54071164", "0.5399318", "0.5387999", "0.5365317", "0.5360944", "0.53576726...
0.0
-1
constant step to simplify algorithm
def compute_step(X): return MOVING_STEP
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def step_constant(step):\n return step", "def _step(self) -> None:", "def step_linear_double(step):\n return step * 2", "def horde_step(self, observation):", "def step(self, state):", "def step(self, s, a):\n raise NotImplementedError", "def _step(self):\n pass", "def warmup_step(...
[ "0.6762189", "0.66126466", "0.6571635", "0.6309831", "0.61970043", "0.616405", "0.61469406", "0.61422324", "0.61208844", "0.608428", "0.60831004", "0.60501164", "0.60283834", "0.60187936", "0.60081095", "0.60065466", "0.59746146", "0.5946914", "0.59426427", "0.59346056", "0.5...
0.6568499
3
Produce figure 1 of the paper.
def fig_1(): epoch = 3 N = 60000 Nr = N K = 32 n_iter = 256 Nstar = 16 data = 'dr10' factor = 100. features = ['psf_mag', 'model_colors', 'psf_minus_model'] filters = ['r', 'ug gr ri iz', 'ugriz'] message = 'pm_mc_pmm_r_all_all' model = 'xdmodel_%s_%d_%d_%d_%d_%s.pkl' % (...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Figure4Main(self, supplemental1=False):\n if not supplemental1:\n example_cells = [5, 9, 17, 30]\n else:\n example_cells = [2, 6, 10, 11, 13, 18]\n\n start_letter = \"A\"\n parent_figure = None\n\n if not supplemental1:\n sizer = {\n ...
[ "0.6279921", "0.61718154", "0.6133319", "0.5995697", "0.5886824", "0.58511084", "0.5758559", "0.57020164", "0.56793135", "0.5660195", "0.5649378", "0.55890405", "0.5529864", "0.55229014", "0.5513478", "0.55114144", "0.5506495", "0.54989177", "0.5493746", "0.54935914", "0.5489...
0.6285657
0
Produce figure 2 of the paper.
def fig_2(): epoch = 3 N = 60000 Nr = N K = 32 n_iter = 256 Nstar = 16 data = 'dr10' factor = 100. features = ['psf_mag', 'model_colors', 'psf_minus_model'] filters = ['r', 'ug gr ri iz', 'ugriz'] message = 'pm_mc_pmm_r_all_all' model = 'xdmodel_%s_%d_%d_%d_%d_%s.pkl' % (...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def eps2(filename1, filename2, npair, ofname=\"output\",nstart=0, showfig=True):\n\n\tofnametex = ofname+\".tex\"\n\t\t\n\tf = open(ofnametex, 'w')\n\t\n\t\n\tf.write('''\\documentclass {article}\n\t\\usepackage{python}\n\t\\usepackage{graphicx}\n\t\\usepackage[top=1cm, bottom=1cm, left=1cm, right=2cm]{geometry}...
[ "0.6445488", "0.6045485", "0.59777915", "0.59749174", "0.5964026", "0.5928806", "0.5914323", "0.5909216", "0.5863343", "0.58378446", "0.5804495", "0.5793671", "0.577509", "0.5739826", "0.5738572", "0.5731333", "0.5709291", "0.57086104", "0.5707525", "0.5670021", "0.5585405", ...
0.64443517
1
Produce figure 3 of the paper.
def fig_3(): epoch = 3 N = 60000 Nr = N K = 32 n_iter = 256 Nstar = 16 data = 'dr10' factor = 100. features = ['psf_mag', 'model_colors', 'psf_minus_model'] filters = ['r', 'ug gr ri iz', 'ugriz'] message = 'pm_mc_pmm_r_all_all' model = 'xdmodel_%s_%d_%d_%d_%d_%s.pkl' % (...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _figure_3():\n\n dataset_id = 3\n pkl_file = _pkl_file_path(dataset_id)\n with open(pkl_file, 'rb') as f:\n data = pickle.load(f)\n\n cdata = data[:, 33]\n seconds = np.arange(data.shape[0]) * 1. / 250\n\n plt.xlim(right=seconds[-1])\n plt.plot(seconds, cdata, color='black', linesty...
[ "0.6577245", "0.6428742", "0.6147097", "0.6141355", "0.61092234", "0.5974064", "0.59260553", "0.59151864", "0.5909971", "0.5865524", "0.58302325", "0.5776051", "0.5730802", "0.5729746", "0.5728845", "0.5714727", "0.5675011", "0.5672505", "0.5665346", "0.56564784", "0.56522834...
0.6272048
2
Produce figure 4 of the paper.
def fig_4(): epoch = 3 N = 60000 Nr = N K = 32 n_iter = 256 Nstar = 16 data = 'dr10' factor = 100. features = ['psf_mag', 'model_colors', 'psf_minus_model'] filters = ['r', 'ug gr ri iz', 'ugriz'] message = 'pm_mc_pmm_r_all_all' model = 'xdmodel_%s_%d_%d_%d_%d_%s.pkl' % (...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def eps4(filename1, filename2, filename3, filename4, nquad, ofname=\"output\",nstart=0, showfig=True):\n\n\tofnametex = ofname+\".tex\"\n\t\t\n\tf = open(ofnametex, 'w')\n\t\n\t\n\tf.write('''\\documentclass{article}\n\t\\usepackage{python}\n\t\\usepackage{graphicx}\n\t\\usepackage[top=1cm, bottom=1cm, left=1cm, r...
[ "0.6742629", "0.6706074", "0.66961974", "0.63015217", "0.6081837", "0.60569793", "0.58787054", "0.58424", "0.58161134", "0.57563984", "0.56880033", "0.5668921", "0.5633899", "0.56335175", "0.5615796", "0.55709904", "0.5535165", "0.5531884", "0.55115294", "0.5468825", "0.54641...
0.68666595
0
Produce figure 5 of the paper.
def fig_5(): epoch = 3 N = 60000 Nr = N K = 32 n_iter = 256 Nstar = 16 data = 'dr10' factor = 100. features = ['psf_mag', 'model_colors', 'psf_minus_model'] filters = ['r', 'ug gr ri iz', 'ugriz'] message = 'pm_mc_pmm_r_all_all' model = 'xdmodel_%s_%d_%d_%d_%d_%s.pkl' % (...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def eps5(filename1, filename2, filename3, filename4, filename5, nquad, ofname=\"output\",nstart=0, showfig=True):\n\n\tofnametex = ofname+\".tex\"\n\t\t\n\tf = open(ofnametex, 'w')\n\t\n\t\n\tf.write('''\\documentclass{article}\n\t\\usepackage{python}\n\t\\usepackage{graphicx}\n\t\\usepackage[top=1cm, bottom=1cm, ...
[ "0.71369654", "0.6271395", "0.6266325", "0.62185913", "0.6215509", "0.6197117", "0.6187425", "0.6151191", "0.59776217", "0.5976559", "0.5971548", "0.5950157", "0.59359837", "0.59034", "0.58745664", "0.57873493", "0.57561326", "0.5732278", "0.56726986", "0.565986", "0.56571025...
0.709452
1
Produce figure 5 of the paper.
def fig_6(): epoch = 3 N = 60000 Nr = N K = 32 n_iter = 256 Nstar = 16 data = 'dr10' factor = 100. features = ['psf_mag', 'model_colors', 'psf_minus_model'] filters = ['r', 'ug gr ri iz', 'ugriz'] message = 'pm_mc_pmm_r_all_all' model = 'xdmodel_%s_%d_%d_%d_%d_%s.pkl' % (...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def eps5(filename1, filename2, filename3, filename4, filename5, nquad, ofname=\"output\",nstart=0, showfig=True):\n\n\tofnametex = ofname+\".tex\"\n\t\t\n\tf = open(ofnametex, 'w')\n\t\n\t\n\tf.write('''\\documentclass{article}\n\t\\usepackage{python}\n\t\\usepackage{graphicx}\n\t\\usepackage[top=1cm, bottom=1cm, ...
[ "0.71369654", "0.709452", "0.6266325", "0.62185913", "0.6215509", "0.6197117", "0.6187425", "0.6151191", "0.59776217", "0.5976559", "0.5971548", "0.5950157", "0.59359837", "0.59034", "0.58745664", "0.57873493", "0.57561326", "0.5732278", "0.56726986", "0.565986", "0.56571025"...
0.6271395
2
Bin up errors and return medians.
def bininator(magbins, dlt, mags, err): meds = np.zeros_like(magbins) for i in range(len(magbins)): ind = (mags > magbins[i] - dlt) & (mags <= magbins[i] + dlt) ind = ind & (err < 10.) meds[i] = np.median(err[ind]) return meds
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mad(errors):\n med = np.median(errors)\n return np.median(np.abs(errors - med))", "def medianError(root='./', align='align/align_d_rms_t',\n poly='polyfit_d_points/fit', points='points_d/',\n youngOnly=False, adjustPoints=False):\n # Load up our starlist\n s = starse...
[ "0.66861254", "0.6022347", "0.59237236", "0.54876673", "0.546723", "0.54648757", "0.5420873", "0.5376365", "0.5285055", "0.5280651", "0.5267501", "0.52321583", "0.5231567", "0.5227237", "0.5216346", "0.51923925", "0.51872134", "0.51550794", "0.512808", "0.51256", "0.51256", ...
0.56515837
3
Plot the median error rates for single epoch, dr10, coadd, and posteriors.
def error_rates(epoch, model, features, filters, figname, fgal=0.5, idx=-1, N=10000): Xsingle, Xsinglecov = fetch_prepped_s82data(epoch, fgal, features, filters) Xcoadd, Xcoaddcov = fetch_prepped_s82data(epoch, fgal, features, filters, use_single=Fa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_errors(self):\n\n plt.title(\"Prediction Error\")\n plt.plot(self.errors)\n plt.ylabel(\"MSE (Mean Squared Error)\")\n plt.xlabel(\"Iteration\")\n plt.show()", "def plot_train_test_errors(train_errors, test_errors, lambda_str , K , path, rng):\n plt.plot(range(rng),...
[ "0.5919546", "0.5884253", "0.58668184", "0.5824854", "0.5785445", "0.57845217", "0.57657117", "0.575321", "0.5747122", "0.5738861", "0.5735035", "0.5716799", "0.5704525", "0.56938636", "0.5692793", "0.56819844", "0.5668775", "0.5664179", "0.5662615", "0.5659408", "0.5657302",...
0.59027916
1
Plot the data and contours for objects called star/galaxy.
def contours_and_data(epoch, model, features, filters, figname, fgal=0.5, idx=-1, data='s82', N=60000): if data == 's82': # fetch Stripe 82 data X, Xcov = fetch_prepped_s82data(epoch, fgal, features, filters) Xcoadd, Xcoaddcov = fetch_prepped_s82data(epoch, fgal, featur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot(self):\n y = self.projection\n mpl.scatter(y[:, 0], y[:, 1], c=self.data_class)\n mpl.show()", "def plot_star_classes(obj_catalog):\n\n fig = plt.figure(num=None,figsize=(8,8), dpi=100)\n ax = fig.add_subplot(1,1,1)\n\n phot_class = obj_catalog.phot_star_class\n sclass =...
[ "0.6209733", "0.6076914", "0.5989726", "0.5939084", "0.5917941", "0.5910307", "0.59081817", "0.5907614", "0.58976495", "0.5897461", "0.5884078", "0.58648926", "0.58311903", "0.5803733", "0.58007014", "0.57809025", "0.5694475", "0.565386", "0.56447524", "0.5631204", "0.5627771...
0.0
-1
Plot the posterior for a star and a galaxy at r=21.
def posteriors_plot(model, features, filters, figname, fgal=0.5, N=60000, idx=-1, seed=123): # fetch DR10 data X, Xcov = fetch_prepped_dr10data(N, fgal, features, filters) # only data within window dlt = 0.05 ind = (X[:, 0] > 21 - dlt) & (X[:, 0] < 21 + dlt) X = X[ind] X...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_posterior(x_train, y_train, x_test, kernel, params): \n\n\tparams = combine_params(params)\n\tfor p in params:\n\t\ty, mu, sigma_sq = sample_GP_posterior(x_train, y_train, x_test, \n\t\t\t\t\t\t\t\t\t\t\t zero_mean, kernel, p)\n\t\tmake_plot(x_test, y)\n\t\tplt.plot(x_train, y_train, 'ko')\n\t\tplt.gca()...
[ "0.63534963", "0.6190498", "0.5884882", "0.58564085", "0.5829954", "0.58232963", "0.57771003", "0.57724506", "0.57369727", "0.5728631", "0.57180935", "0.5702705", "0.56918395", "0.5669759", "0.5668919", "0.5601508", "0.5599467", "0.55959314", "0.55415785", "0.55062276", "0.54...
0.58094907
6
Plot the single epoch and xd posts versus coadd
def xx_plot(epoch, model, features, filters, figname, fgal=0.5): # fetch Stripe 82 data X, Xcov = fetch_prepped_s82data(epoch, fgal, features, filters) Xcoadd, Xcoaddcov = fetch_prepped_s82data(epoch, fgal, features, filters, use_single=False) N = 20000 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_per_epoch(d, d_label, title):\n\n fig = plt.figure()\n ax = fig.add_subplot(111)\n ax.scatter(range(1,len(d)+1), d, c=\"b\", s=6, marker=\"o\", label=d_label)\n ax.set_xlabel(\"Epoch\")\n ax.set_ylabel(d_label)\n ax.xaxis.set_major_locator(MaxNLocator(integer=True))\n ax.set_title(tit...
[ "0.6697393", "0.6640096", "0.639575", "0.62434304", "0.62414646", "0.60780275", "0.60544884", "0.6052113", "0.60176635", "0.59831333", "0.5908956", "0.58954054", "0.58913213", "0.5875567", "0.5859042", "0.58542186", "0.583645", "0.5824845", "0.5823258", "0.5806909", "0.579064...
0.6113482
5
Plot the CMD for an SDSS cluster, both raw data and XD posteriors.
def glob_cmd(model, globular_name, features, filters, figname, mag=0, color={2:(-4, -3)}, xlim=(-0.5, 2), ylim=(23, 16)): # fetch data for the cluster X, Xcov = fetch_glob_data(globular_name, features, filters) # unpickle the XD model if type(model) == str: f = open(model, 'rb') ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot(self):\n\t\tif (2 <= len(self.X) <= 3):\n\t\t\tvDataFrame(self.name, self.cursor).scatter(columns = self.X, catcol = \"dbscan_cluster\", max_cardinality = 100, max_nb_points = 10000)\n\t\telse:\n\t\t\traise ValueError(\"Clustering Plots are only available in 2D or 3D\")", "def sse_plot(self):\n d...
[ "0.6540148", "0.6198114", "0.6179473", "0.608459", "0.6043866", "0.5790243", "0.5789512", "0.57833713", "0.57762975", "0.57742345", "0.57710123", "0.57588714", "0.5717733", "0.5688315", "0.5664204", "0.56527424", "0.56500745", "0.56235504", "0.5611287", "0.5598483", "0.559178...
0.0
-1
Plot the single epoch and xd posts versus coadd
def misclass_plot(epoch, model, features, filters, figname, fgal=0.5, idx=-1): # fetch Stripe 82 data X, Xcov = fetch_prepped_s82data(epoch, fgal, features, filters) Xcoadd, Xcoaddcov = fetch_prepped_s82data(epoch, fgal, features, filters, use_single=False) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_per_epoch(d, d_label, title):\n\n fig = plt.figure()\n ax = fig.add_subplot(111)\n ax.scatter(range(1,len(d)+1), d, c=\"b\", s=6, marker=\"o\", label=d_label)\n ax.set_xlabel(\"Epoch\")\n ax.set_ylabel(d_label)\n ax.xaxis.set_major_locator(MaxNLocator(integer=True))\n ax.set_title(tit...
[ "0.6697393", "0.6640096", "0.639575", "0.62434304", "0.62414646", "0.6113482", "0.60780275", "0.60544884", "0.6052113", "0.60176635", "0.59831333", "0.5908956", "0.58954054", "0.58913213", "0.5875567", "0.5859042", "0.58542186", "0.583645", "0.5824845", "0.5823258", "0.580690...
0.57604045
25
Plot the single epoch and xd post histograms for psfmodel of stars.
def psfminusmodel_plot(epoch, model, features, filters, figname, fgal=0.5, idx=-1): # fetch Stripe 82 data X, Xcov = fetch_prepped_s82data(epoch, fgal, features, filters) Xcoadd, Xcoaddcov = fetch_prepped_s82data(epoch, fgal, features, fil...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fig_2():\n epoch = 3\n N = 60000\n Nr = N\n K = 32\n n_iter = 256\n Nstar = 16\n data = 'dr10'\n factor = 100.\n features = ['psf_mag', 'model_colors', 'psf_minus_model']\n filters = ['r', 'ug gr ri iz', 'ugriz']\n message = 'pm_mc_pmm_r_all_all'\n model = 'xdmodel_%s_%d_%d_...
[ "0.68504846", "0.68190914", "0.6615435", "0.64206356", "0.63476354", "0.6309046", "0.6266294", "0.6252298", "0.6166132", "0.613872", "0.6133059", "0.6095309", "0.6094693", "0.6094177", "0.6077771", "0.60618454", "0.60509294", "0.60507536", "0.6030458", "0.5987387", "0.5984168...
0.6640184
2
Compare quality of classifcation for a model with the s82 coadd. Should be a model trained on s82 single epoch data.
def s82_star_galaxy_classification(model_parms_file, epoch, Nstar, features, filters, r_pmm, figname, threshold=0., Nthreads=4): # get the data single, singlecov = fetch_matched_s82data(epoch, features=features, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compareAB(model1_name, model2_name, X_test_B, X_test_S, analysis_dir=\"Analysis/\"):\n #Load best weights\n model = tf.keras.models.load_model(\"Models/\"+model1_name)\n bkg_preds1 = model.predict(X_test_B).flatten()\n sig_preds1 = model.predict(X_test_S).flatten()\n\n model = tf.keras.models.lo...
[ "0.62082326", "0.6184853", "0.60857576", "0.60311025", "0.5970569", "0.5959846", "0.5899067", "0.5848085", "0.5829245", "0.5823377", "0.5774531", "0.57647103", "0.5750128", "0.5733305", "0.5724385", "0.56959975", "0.5674769", "0.5669577", "0.56046885", "0.55895644", "0.558356...
0.56420314
18
get the dict of all nodes to their IP in the network
async def get_node_to_ips( self, client: OpenrCtrlCppClient.Async, area: Optional[str] = None ) -> Dict: node_dict = {} keyDumpParams = self.buildKvStoreKeyDumpParams(Consts.PREFIX_DB_MARKER) resp = Publication() if not self.area_feature: resp = await client.getK...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getNodes(self):\n nodes = [{\"address\": \"http://0.0.0.0:100\"}\n ,{\"address\": \"http://0.0.0.0:200\"}\n ,{\"address\": \"http://0.0.0.0:300\"}\n ,{\"address\": \"http://0.0.0.0:400\"}\n ,{\"address\": \"http://0.0.0.0:500\"}]\n retur...
[ "0.72978073", "0.7055782", "0.69536096", "0.6807267", "0.666083", "0.6659717", "0.65648925", "0.6539925", "0.64667284", "0.64580387", "0.64431643", "0.6430201", "0.6353768", "0.63483626", "0.63344246", "0.62853783", "0.62787384", "0.6269251", "0.6256344", "0.6248679", "0.6243...
0.6633458
6
get routable IP address of node from it's prefix database
def get_node_ip(self, prefix_db: openr_types.PrefixDatabase) -> Any: # First look for LOOPBACK prefix for prefix_entry in prefix_db.prefixEntries: if prefix_entry.type == network_types.PrefixType.LOOPBACK: return ipnetwork.sprint_addr(prefix_entry.prefix.prefixAddress.addr) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_rug_address():\n net = netaddr.IPNetwork(ULA_PREFIX)\n return str(netaddr.IPAddress(net.first + 1))", "def get_node_ip(\n self,\n name,\n ):\n pass", "def ip(self, prefix = None):\n ip = self._update_ips()\n if prefix is None:\n return self...
[ "0.67512614", "0.672374", "0.66232747", "0.6416445", "0.6413486", "0.64080024", "0.6393339", "0.63819945", "0.62922806", "0.6266255", "0.61608344", "0.6154852", "0.6154319", "0.61521226", "0.6094634", "0.6090791", "0.6051159", "0.6035991", "0.6009145", "0.59926647", "0.598004...
0.76153773
0
print the Kv Store peers
def print_peers(self, host_id: str, peers_list: Dict[str, Any]) -> None: caption = "{}'s peers".format(host_id) rows = [] column_labels = ["Peer", "State", "Address", "Port", "Area"] for area, peers in peers_list.items(): for (peer, peerspec) in sorted(peers.items(), key=l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def printNode(self):\n print(\"Instance ID :\" + str(self.instanceID))\n print(\"Counter value :\" + str(self.counter))\n print(\"appData :\")\n for i in range(0, len(self.appData)):\n print(self.appData[i])\n print(\"syncDataStructure :\")\n for key, value in s...
[ "0.67486143", "0.6583794", "0.64443433", "0.63070315", "0.597289", "0.5909516", "0.5815585", "0.5787694", "0.57851905", "0.5736432", "0.5707676", "0.5669401", "0.5662586", "0.5660323", "0.56579095", "0.5654499", "0.5636523", "0.56351084", "0.56335396", "0.5626399", "0.5602864...
0.5975985
4
print keys from raw publication from KvStore
def print_kvstore_keys( self, resp: Dict[str, Publication], ttl: bool, json: bool ) -> None: # Export in json format if enabled if json: all_kv = {} for _, kv in resp.items(): all_kv.update(kv.keyVals) # Force set value to None ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_kvstore_values(\n self,\n resp: Publication,\n area: Optional[str] = None,\n ) -> None:\n\n rows = []\n for key, value in sorted(resp.keyVals.items(), key=lambda x: x[0]):\n val = self.deserialize_kvstore_publication(key, value)\n if not val:\n ...
[ "0.65500253", "0.602648", "0.602648", "0.5896136", "0.5843619", "0.5818693", "0.5740994", "0.57164586", "0.5690575", "0.5682321", "0.564288", "0.56066865", "0.5548096", "0.55289364", "0.5522452", "0.5501682", "0.5500842", "0.54946166", "0.5470928", "0.5458189", "0.54509246", ...
0.6805582
0
Fetch the keyval publication for each area specified in areas via thrift call
async def fetch_keyvals( self, client: OpenrCtrlCppClient.Async, areas: Set[Any], keyDumpParams: KeyDumpParams, ) -> Dict[str, Publication]: area_to_publication_dict = {} for area in areas: area_to_publication_dict[area] = await client.getKvStoreKeyValsFi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_kvstore_values(\n self,\n resp: Publication,\n area: Optional[str] = None,\n ) -> None:\n\n rows = []\n for key, value in sorted(resp.keyVals.items(), key=lambda x: x[0]):\n val = self.deserialize_kvstore_publication(key, value)\n if not val:\n ...
[ "0.5258662", "0.50673336", "0.49245554", "0.48266882", "0.48198405", "0.47868848", "0.4764812", "0.47608864", "0.474016", "0.4707932", "0.47043625", "0.47033048", "0.46736437", "0.46550706", "0.46489", "0.46427444", "0.46238628", "0.46221396", "0.46108213", "0.4608701", "0.46...
0.7031373
0
run method that invokes _run with client and arguments
def run(self, *args, **kwargs) -> int: async def _wrapper() -> int: ret_val: Optional[int] = 0 async with get_openr_ctrl_cpp_client( self.host, self.cli_opts, client_type=ClientType.THRIFT_ROCKET_CLIENT_TYPE, ) as client: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _run(self, client: OpenrCtrl.Client, *args, **kwargs) -> None:\n\n raise NotImplementedError", "async def run():\n # Get the arguments from the parser\n args = client.arguments\n\n # If the help argument was used, return\n if hasattr(args, \"help\"):\n return\n # Otherwise, check...
[ "0.79941505", "0.70497537", "0.701971", "0.69282407", "0.6797228", "0.67657524", "0.67541826", "0.6748296", "0.67078376", "0.67068344", "0.66644394", "0.6659236", "0.6595019", "0.6587069", "0.6586537", "0.65689015", "0.6527023", "0.64988273", "0.64684373", "0.6371168", "0.636...
0.6248496
24
classify kvstore prefix and return the corresponding deserialized obj
def deserialize_kvstore_publication(self, key, value): options = { Consts.PREFIX_DB_MARKER: openr_types.PrefixDatabase, Consts.ADJ_DB_MARKER: openr_types.AdjacencyDatabase, } prefix_type = key.split(":")[0] + ":" if prefix_type in options.keys(): ret...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _extract_immediate_prefix(obj_key:str)->str:\n immed_prefix = \"\"\n if len(obj_key.split(\"/\")) > 1:\n immed_prefix = obj_key.split(\"/\")[-2]\n \n return immed_prefix", "def _get_prefix_attributes(self, prefix):\n return filter_dict_by_prefix(self.__dict__, prefix)", "def get_p...
[ "0.5711935", "0.55419487", "0.5494264", "0.54277533", "0.5371517", "0.52974343", "0.52290225", "0.5219558", "0.52009475", "0.5164571", "0.5137503", "0.51101", "0.5093739", "0.5079489", "0.506517", "0.5060772", "0.5027817", "0.50255066", "0.50075495", "0.5004343", "0.49997222"...
0.590767
0
print values from raw publication from KvStore
def print_kvstore_values( self, resp: Publication, area: Optional[str] = None, ) -> None: rows = [] for key, value in sorted(resp.keyVals.items(), key=lambda x: x[0]): val = self.deserialize_kvstore_publication(key, value) if not val: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_contents(self):\n print self.values", "def show_vdcs_detail(self):\n for v in self.vdcs:\n print self.vdcs[v]", "def show_vdcs(self):\n for v in self.vdcs:\n print v", "def printMixData(self):\n\t\tprint \"OPERATED MIXNODE: Name: %s, address: (%d, %s), Pub...
[ "0.63312674", "0.6113396", "0.5822299", "0.5791831", "0.5784153", "0.577308", "0.5701333", "0.56527925", "0.5638593", "0.561655", "0.5576552", "0.5510589", "0.55091405", "0.55068046", "0.55068046", "0.55062485", "0.5444003", "0.54272056", "0.5409797", "0.53990006", "0.5387225...
0.68602514
0
Build graph of adjacencies and return list of connected node from current nodeid
def get_connected_nodes(self, adj_keys: Publication, node_id: str) -> Set[str]: import networkx as nx edges = set() graph = nx.Graph() for adj_value in adj_keys.keyVals.values(): if adj_value.value: adj_db = deserialize(openr_types.AdjacencyDatabase, adj_valu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _graph_connected_component(graph, node_id):\n n_node = graph.shape[0]\n if sparse.issparse(graph):\n # speed up row-wise access to boolean connection mask\n graph = graph.tocsr()\n connected_nodes = np.zeros(n_node, dtype=np.bool)\n nodes_to_explore = np.zeros(n_node, dtype=np.bool)\n...
[ "0.65930283", "0.6570428", "0.648398", "0.6338957", "0.63259256", "0.63064647", "0.6305456", "0.6290016", "0.62735987", "0.6261877", "0.62043774", "0.61851615", "0.61685765", "0.6158463", "0.61408174", "0.613847", "0.6134505", "0.60813373", "0.60753703", "0.60753703", "0.6072...
0.6298708
7
Print kvstore nodes information. Their loopback and reachability information.
def print_kvstore_nodes( self, connected_nodes: Set[str], prefix_keys: Publication, host_id: str, node_area: Optional[Dict[str, str]] = None, ) -> None: def _parse_loopback_addrs(addrs, value): v4_addrs = addrs["v4"] v6_addrs = addrs["v6"] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def printNode(self):\n print(\"Instance ID :\" + str(self.instanceID))\n print(\"Counter value :\" + str(self.counter))\n print(\"appData :\")\n for i in range(0, len(self.appData)):\n print(self.appData[i])\n print(\"syncDataStructure :\")\n for key, value in s...
[ "0.72202766", "0.6942311", "0.66287684", "0.6514881", "0.63812757", "0.6361851", "0.6216663", "0.6204839", "0.62037903", "0.6164678", "0.6160873", "0.6086526", "0.6082106", "0.60566115", "0.6032304", "0.60018545", "0.59969217", "0.59411764", "0.593119", "0.59187895", "0.59098...
0.6914931
2
get the kvs of a set of nodes
def dump_nodes_kvs( self, nodes: set, all_nodes_to_ips: Dict, area: Optional[str] = None ): kv_dict = {} for node in nodes: node_ip = all_nodes_to_ips.get(node, node) kv = utils.dump_node_kvs(self.cli_opts, node_ip, area) if kv is not None: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_partitions(V,k):\n k_subs = k_subset(V,k)\n k_subs = uniq_subsets(k_subs)\n\n return k_subs", "def kruskal(self):\n k = self.cc().max() + 1\n E = 2 * self.V - 2\n V = self.V\n Kedges = np.zeros((E, 2)).astype(np.int_)\n Kweights = np.zeros(E)\n iw = np....
[ "0.59882766", "0.5957845", "0.59310323", "0.5925573", "0.57926774", "0.57625383", "0.57398385", "0.5710748", "0.56699103", "0.56671077", "0.56493664", "0.564675", "0.56295794", "0.56295794", "0.5627649", "0.5616906", "0.5609812", "0.560659", "0.5582245", "0.5545183", "0.55447...
0.5574408
19
Takes StreamSubscriberInfo from thrift and returns list[str] (aka row) representing the subscriber
def get_subscriber_row(self, stream_session_info): uptime = "unknown" last_msg_time = "unknown" if ( stream_session_info.uptime is not None and stream_session_info.last_msg_sent_time is not None ): uptime_str = str( datetime.timedelta(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def subscribers(id):\n return core.query(schema.streamBySubscribers, id)", "def get_subscribers(self) -> Iterator[Any]:\n for subscription in self._subscriptions[self.id]:\n yield subscription.subscriber", "def test_successful_subscriptions_list_subscribers(self) -> None:\n result =...
[ "0.61119455", "0.53708094", "0.51381725", "0.5079605", "0.5024306", "0.49607125", "0.49371487", "0.49270263", "0.4903581", "0.4871267", "0.48365107", "0.48138362", "0.48064584", "0.47757068", "0.4767832", "0.47622314", "0.47521242", "0.47241798", "0.4713322", "0.4707597", "0....
0.7634182
0
Checks if the local node is advertising atleast one adjacency key and one prefix key to the kvstore. Returns a boolean for each key type.
def _validate_local_key_advertisement( self, area_to_publication_dict: Dict[str, Publication] ) -> Tuple[bool, bool]: keys = [] for _, publication in area_to_publication_dict.items(): keys.extend(list(publication.keyVals.keys())) is_adj_advertised = False is_pre...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _print_local_node_advertising_check(\n self, is_advertising_adj: bool, is_advertising_prefix: bool\n ) -> None:\n\n is_pass = is_advertising_adj and is_advertising_prefix\n click.echo(\n self.validation_result_str(\n \"kvStore\",\n \"prefix and a...
[ "0.6733836", "0.6396705", "0.6381344", "0.62376046", "0.57620454", "0.56948906", "0.55602145", "0.55404294", "0.5508798", "0.5494694", "0.5464157", "0.54515123", "0.5451274", "0.54367054", "0.5413227", "0.540365", "0.5388373", "0.53826374", "0.53594834", "0.5344876", "0.53239...
0.667407
1
Checks if all peers are in INITIALIZED state,
def _validate_peer_state( self, area_to_peers: Dict[str, Dict[str, PeerSpec]] ) -> Dict[str, Dict[str, PeerSpec]]: invalid_peers = defaultdict(dict) for (area, peers) in area_to_peers.items(): for (peer_name, peer_spec) in peers.items(): if peer_spec.state != KvS...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_initial_states(self):\n return len(self.initial_states()) > 0", "def is_initialized(self) -> bool:\n return (\n (self._exchange_params_by_currency_id is not None)\n and (self._utility_params_by_good_id is not None)\n and (self._transaction_fees is not None)\...
[ "0.684354", "0.6604674", "0.6497527", "0.6300411", "0.6294015", "0.60291374", "0.60048556", "0.59718686", "0.59673285", "0.5922915", "0.59170294", "0.5847167", "0.5826648", "0.58103687", "0.5803412", "0.5773058", "0.5765966", "0.5762333", "0.57160574", "0.57032996", "0.570051...
0.5603364
34
Checks if the ttl of each key is above 3/4 of the max ttl
def _validate_key_ttl( self, publications: Dict[str, Publication], ttl: int, threshold: float = 0.75, ) -> Dict[str, Publication]: area_to_invalid_keyvals = {} for area, publication in publications.items(): invalid_keyvals = { k: v ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_maxttl_greater_doc_expiry(self):\n for bucket in self.buckets:\n self._load_json(bucket, self.num_items, exp=int(self.maxttl)-100)\n self.sleep(int(self.maxttl-100), \"waiting for all docs to expire per maxTTL rule...\")\n self.expire_pager(self.servers)\n self.sleep...
[ "0.7159066", "0.6974216", "0.68057406", "0.6800872", "0.6693853", "0.66240424", "0.656756", "0.62757313", "0.609933", "0.5843171", "0.57584894", "0.57158446", "0.5664364", "0.5661062", "0.5621551", "0.5562735", "0.54820377", "0.5463845", "0.54153395", "0.5397436", "0.5379184"...
0.6633002
5
Prints result of the ttl check along with information about keys with too low ttl The ttl printed is the ttl of the key right before the check occured
def _print_key_ttl_check( self, area_to_invalid_keys: Dict[str, Publication], ttl: int, threshold: float = 0.75, ) -> None: click.echo( self.validation_result_str( "kvStore", "Key TTL Check", len(area_to_invalid_keys) == 0 ) ) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ttl(self, key):\n return self._command(b'PTTL', key, handler=lambda ms: .001 * ms)", "def get_ttl(self, keyword, key):", "def ttl(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"ttl\")", "def ttl(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"ttl\")", "def ttl(se...
[ "0.66567254", "0.6301414", "0.6223945", "0.6223945", "0.6101219", "0.5965713", "0.5690484", "0.5654071", "0.56501955", "0.56454045", "0.56354886", "0.5547257", "0.5547257", "0.5547257", "0.5527442", "0.55273604", "0.55273604", "0.549073", "0.5475836", "0.5457758", "0.5383536"...
0.7880797
0
Prints the result of the peer state check and a list of peers not in INITIALIZED state if there are any
def _print_peer_state_check( self, invalid_peers: Dict[str, Dict[str, PeerSpec]], host_id: str, ) -> None: click.echo( self.validation_result_str( "kvStore", "peer state check", len(invalid_peers) == 0 ) ) if len(invalid_peers...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_all_peer_status(self):\n statuses = self.pybird.get_peer_status()\n\n self.assertEquals(statuses[0]['name'], \"PS1\")\n self.assertEquals(statuses[0]['state'], \"Passive\")\n self.assertEquals(statuses[1]['name'], \"PS2\")\n self.assertEquals(statuses[1]['state'], \"Esta...
[ "0.6495497", "0.6251295", "0.6225992", "0.6186012", "0.61554384", "0.60008013", "0.57276255", "0.5577009", "0.5554054", "0.55529517", "0.5551861", "0.55037373", "0.5487797", "0.5483634", "0.54702264", "0.54596984", "0.54097784", "0.5396765", "0.5389472", "0.5365949", "0.53658...
0.7865517
0
Prints the result of the validation check and the which keys are not being advertised if the validation check fails
def _print_local_node_advertising_check( self, is_advertising_adj: bool, is_advertising_prefix: bool ) -> None: is_pass = is_advertising_adj and is_advertising_prefix click.echo( self.validation_result_str( "kvStore", "prefix and adjacency key adv...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def checkResultsCorrection(self, result, valid_keys):\n for key in result:\n if key not in valid_keys:\n print(\"[ERROR] Key '%s' does not exist.\" % key)\n return False\n return True", "def run_missing_value_check():\n print(\"\\n### CHECKING FOR MISSING...
[ "0.6539935", "0.6483713", "0.6392351", "0.63436186", "0.6324393", "0.6318017", "0.6257398", "0.62552106", "0.62457097", "0.623596", "0.6196751", "0.6127988", "0.6032944", "0.59989476", "0.5983608", "0.59258735", "0.5917128", "0.5881947", "0.58657074", "0.58457834", "0.5807657...
0.0
-1
returns a generator of degenerated sequences in scrambled order
def degenerate2(s): from lasagna.utils import base_repr n = s.count('N') seed = hash(s) % (2**32 - 1) rng = random.Random(seed) random_base_ix = lambda: base_repr(rng.randint(0, 4**(n + 1) - 1), 4, n + 1)[::-1] while True: bases = ['ACTG'[int(j)] for j in random_base_ix()] s2 = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate(self) -> List[str]:\n\n self._reset()\n\n res = self._get_interactions(\n random.randint(self._min_seq_len, self._max_seq_len))\n\n self._add_guarded_first_named_alloc(res)\n\n if random.randint(0, 1):\n # Add some noise between source and destinat...
[ "0.6526458", "0.6346598", "0.61941546", "0.60155445", "0.5956522", "0.59486526", "0.5940059", "0.5862646", "0.5813078", "0.57996607", "0.5775033", "0.57735795", "0.5773163", "0.5760917", "0.5757377", "0.5739533", "0.57337964", "0.5724858", "0.56738037", "0.5655347", "0.564458...
0.67052954
0
start a new session to start app
def initialize(self, device, platform, version, app, package, activity): desired_caps = dict() desired_caps['platformName'] = platform desired_caps['platformVersion'] = version desired_caps['deviceName'] = device desired_caps['app'] = app desired_caps['appPackage'] = pack...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def start_session(self):\n\t\t...", "def new_session(self):\n self.command(\"new\")", "def start_session(self):\r\n ee.Initialize()", "def startapp():", "def start():\r\n\r\n userName = userLogin.login()\r\n runApp(userName)", "def main():\n\n run_manual_session()\n # run_...
[ "0.7681355", "0.70464206", "0.70276684", "0.6876244", "0.68088776", "0.6754588", "0.6729491", "0.6623179", "0.6590256", "0.65724987", "0.6539288", "0.64773875", "0.6455504", "0.6455504", "0.6455504", "0.6455504", "0.64209837", "0.64031553", "0.64031553", "0.63755596", "0.6355...
0.0
-1
close app and quit session
def quit(self): self.driver.close_app() self.driver.quit()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def quit_app(self):\n self._socket_client.receiver_controller.stop_app()", "def quit_app(self):\n self._socket_client.receiver_controller.stop_app()", "def _endApp(self):\n try:\n self._smApp.close()\n except OSError:\n pass # igore OSErrors like 'No such ...
[ "0.7794985", "0.77792263", "0.75582784", "0.7548624", "0.75133824", "0.7507985", "0.7497864", "0.74760485", "0.7460032", "0.7431441", "0.73626417", "0.72017676", "0.7183301", "0.717902", "0.71531713", "0.71192175", "0.7060073", "0.70542777", "0.70294344", "0.7022385", "0.6983...
0.71123177
16
start a new session to start app
def start(self, device, platform, version, app, package, activity): self.initialize(device, platform, version, app, package, activity)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def start_session(self):\n\t\t...", "def new_session(self):\n self.command(\"new\")", "def start_session(self):\r\n ee.Initialize()", "def startapp():", "def start():\r\n\r\n userName = userLogin.login()\r\n runApp(userName)", "def main():\n\n run_manual_session()\n # run_...
[ "0.7681355", "0.70464206", "0.70276684", "0.6876244", "0.68088776", "0.6754588", "0.6729491", "0.6623179", "0.6590256", "0.65724987", "0.6539288", "0.64773875", "0.6455504", "0.6455504", "0.6455504", "0.6455504", "0.64209837", "0.64031553", "0.64031553", "0.63755596", "0.6355...
0.0
-1
close app and restart session
def restart(self, device, platform, version, app, package, activity): self.quit() self.initialize(device, platform, version, app, package, activity)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stop():\n app = get_vistrails_application()\n app.finishSession()\n app.save_configuration()\n app.destroy()", "def exitApplication(self):\n try:\n self.repository.saveSession()\n print(\"Session saved :).\")\n except IOError:\n print(\"Could not sav...
[ "0.7208908", "0.7080692", "0.69472945", "0.68616325", "0.6811587", "0.6711037", "0.6690465", "0.66641724", "0.6650588", "0.6638569", "0.6549663", "0.64569604", "0.64456123", "0.638764", "0.6374605", "0.6374515", "0.63323486", "0.628264", "0.6239681", "0.61703646", "0.61612785...
0.0
-1
remove app from android device
def remove(self, package): self.driver.remove_app(package)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_app(self):\n \n pass", "def uninstall_app(self, package, keepdata=False):\n return self.adb.uninstall(package, keepdata)", "def app_delete(self, name):\n self.core.api.os.shell.cmd('{0} delete app /app.name:\"{1}\"'.format(self.APP_CMD, name))", "def remove_app(self, a...
[ "0.74033237", "0.72458357", "0.717659", "0.7134077", "0.70731086", "0.70726144", "0.70547813", "0.6990547", "0.6977605", "0.6866595", "0.68093693", "0.6765531", "0.67247427", "0.667689", "0.66132075", "0.6551885", "0.65018636", "0.6441072", "0.6422958", "0.6422323", "0.639456...
0.6690135
13
Determines whether some element of an observable sequence satisfies a condition if present, else if some items are in the sequence.
def some(self, predicate=None): source = self def subscribe(observer): def on_next(_): observer.on_next(True) observer.on_completed() def on_error(): observer.on_next(False) observer.on_completed() return source.subscribe(on_next, observer...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def forall(seq,cond):\n for x in seq:\n if not cond(x): return False\n return True", "def forall(seq,cond):\n for x in seq:\n if not cond(x): return False\n return True", "def any(seq, pred=None):\n for elem in itertools.ifilter(pred, seq):\n return True\n return False", ...
[ "0.6489119", "0.6489119", "0.6322223", "0.62787896", "0.62787896", "0.6172666", "0.6091153", "0.59761876", "0.5815191", "0.5802926", "0.5781212", "0.56770223", "0.56426907", "0.56333035", "0.5621713", "0.5620997", "0.5583275", "0.5533149", "0.5532246", "0.55276513", "0.547698...
0.5921078
8
Compute the losses for a target batch, given a set of potential predictions.
def loss_grid(self, output, target): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_losses(self, predictions, targets):\n smpl_weight = targets['target_smpl_weight']\n\n losses = {}\n if self.loss_beta is not None:\n losses['loss_beta'] = self.loss_beta(\n predictions['pred_shape'] * smpl_weight,\n targets['target_beta'] * ...
[ "0.7635991", "0.723824", "0.723824", "0.66826284", "0.66593707", "0.66399896", "0.65882856", "0.6515454", "0.64670026", "0.6433944", "0.64061284", "0.6397278", "0.63851756", "0.63324416", "0.6295115", "0.62873447", "0.6285234", "0.6284424", "0.62837875", "0.62794286", "0.6277...
0.0
-1
Parse directories holding extracted frames from standard benchmarks
def parse_directory(path, key_func=lambda x: x[-11:], rgb_prefix='img_', flow_x_prefix='flow_x_', flow_y_prefix='flow_y_', level=1): print('parse frames under folder {}'.format(path)) if level == 1: frame_folders = glob.glob...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_directory(path, rgb_prefix='img_', flow_x_prefix='flow_x_', flow_y_prefix='flow_y_'):\n print('parse frames under folder {}'.format(path))\n frame_folders = glob.glob(os.path.join(path, '*'))\n\n def count_files(directory, prefix_list):\n lst = os.listdir(directory)\n cnt_list = [l...
[ "0.6806591", "0.61956006", "0.61574477", "0.60362446", "0.60252094", "0.6013178", "0.6008159", "0.6006396", "0.5959281", "0.59024763", "0.5896736", "0.58548516", "0.58537865", "0.5809266", "0.5792813", "0.57871157", "0.57588553", "0.57568353", "0.5742853", "0.57063025", "0.56...
0.6455126
1
This function identifies the habitat area of a patch in which an individual is.
def identify_habarea(indiv_xy_position, habarea_map): row=int(indiv_xy_position[0]) col=int(indiv_xy_position[1]) habarea=habarea_map[row][col] return habarea
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def patch_areas(patch_ids):\n\n return np.bincount(patch_ids.reshape((-1,)))[1:]", "def area(self):", "def get_area(self):\n raise NotImplementedError()", "def get_area(option_set):\n return option_set & AREA_MASK", "def area(self, tileID):\n pass", "def area(self):\n ...", "...
[ "0.6068956", "0.60643595", "0.59910935", "0.59910876", "0.5972108", "0.59208566", "0.5889996", "0.58316416", "0.5813654", "0.5810717", "0.5796046", "0.5765837", "0.5745804", "0.5711808", "0.57045734", "0.5694406", "0.5686349", "0.567481", "0.56726205", "0.56686926", "0.566484...
0.700036
0
Extract probability distributions obtained for each class of the classifier
def save_prod_dist(model,test_data): y_label = 0 modeldist_probs = [] test = [sentence[0] for sentence in test_data] y_labels = [sentence[1] for sentence in test_data] for pdist in model.prob_classify_many(test): modeldist_probs.append([pdist.prob('AIMX'), pdist.prob('OWNX'), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _class_distribution(y):\n unique, counts = np.unique(y, return_counts = True)\n\n percentages = counts / np.sum(counts)\n\n return unique, counts, percentages", "def classProbs(observation, tree, classes):\n res = classify(observation, tree) #res = results\n total = sum(res.values())\n prob...
[ "0.7313617", "0.7230231", "0.7090465", "0.6929822", "0.6908797", "0.68230456", "0.6800955", "0.66687405", "0.63816804", "0.6374652", "0.631745", "0.6301458", "0.62666416", "0.62589633", "0.62549794", "0.620444", "0.6203373", "0.61895466", "0.6188604", "0.61534476", "0.6131033...
0.58812314
38
Hobday et al. (2016) marine heat wave definition
def detect( t: np.ndarray, temp: np.ndarray, climatologyPeriod=[None, None], pctile=90, windowHalfWidth=5, smoothPercentile=True, smoothPercentileWidth=31, minDuration=5, joinAcrossGaps=True, maxGap=2, maxPadLength=False, coldSpells=False, alternateClimatology: Option...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def manipulate_heat_data(self): \n self.exh.T_array = ( 0.5 * (self.exh.T_inlet_array +\n self.exh.T_outlet_array) + 273.15)\n self.exh.delta_T_array = ( self.exh.T_inlet_array -\n self.exh.T_outlet_array )\n \n self.cool.delta_T_array = ( self.cool.T_inlet_array -...
[ "0.64778084", "0.61752194", "0.6094722", "0.6049435", "0.6026047", "0.598912", "0.5969268", "0.59183013", "0.5851902", "0.5799416", "0.5755162", "0.57525724", "0.57220525", "0.57075334", "0.5683096", "0.56653666", "0.5665189", "0.56563634", "0.5644805", "0.5637388", "0.563225...
0.0
-1
Generate vectors for year, month, dayofmonth, and dayofyear create vectors of length = `len(t)` for DAY, MONTH, YEAR
def generate_time_vectors(t) -> Tuple: T = len(t) year = np.zeros((T)) month = np.zeros((T)) day = np.zeros((T)) doy = np.zeros((T)) for i in range(T): year[i] = date.fromordinal(t[i]).year month[i] = date.fromordinal(t[i]).month day[i] = date.fromordinal(t[i]).day # ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def arrayofyears(month1,day1,year1,month2,day2,year2):\n return (arrayofdaysmonthsyears(month1,day1,year1,month2,day2,year2))[2]", "def generate_months(nmonths, year=2022, month=1, day=1):\n return np.asarray([\n f'{year:04d}-{month+i:02d}-{day:02d}T00:00:00.000000'\n for i in range(nmonths)\...
[ "0.6626277", "0.6265367", "0.62616616", "0.61773056", "0.61604315", "0.6143473", "0.60762256", "0.5977502", "0.5961502", "0.5944625", "0.59250414", "0.5923237", "0.58977413", "0.5889735", "0.5883183", "0.5864521", "0.5854827", "0.5771225", "0.57699937", "0.57558084", "0.57406...
0.7770098
0
Calculate the climatology (mean) for each day and threshold (90pctile)
def calculate_daily_climatology( pctile, windowHalfWidth, lenClimYear, smoothPercentile, smoothPercentileWidth, thresh_climYear, # empty array seas_climYear, # empty array clim, # empty dict feb29, doyClim, clim_start, clim_end, tempClim, temp, ): # Loop ov...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup_percentiles_pediatrics_new():\n df_cdc = pd.read_csv(Path(\"growthviz-data/ext/growthfile_cdc_ext.csv.gz\"))\n df_who = pd.read_csv(Path(\"growthviz-data/ext/growthfile_who.csv.gz\"))\n df = df_cdc.merge(df_who, on=[\"agedays\", \"sex\"], how=\"left\")\n\n # Add weighting columns to support s...
[ "0.5650315", "0.5634501", "0.55678546", "0.55586326", "0.5522147", "0.54622644", "0.53760904", "0.5370891", "0.53564376", "0.5344963", "0.53288364", "0.53195065", "0.5314005", "0.53047764", "0.5268559", "0.52627236", "0.52579826", "0.5235522", "0.5231728", "0.52182317", "0.52...
0.59774745
0
Calculate a smoothed time series. Uses a running average of an input time series using uniform window.
def smooth_climatologies(thresh_climYear, seas_climYear, smoothPercentileWidth): # If the climatology contains NaNs, then assume it is a <365-day year and deal accordingly if np.sum(np.isnan(seas_climYear)) + np.sum(np.isnan(thresh_climYear)): valid = ~np.isnan(thresh_climYear) thresh_climYear[v...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def moving_average(data, temporal_window=100):\n window = np.ones(temporal_window) / temporal_window\n return np.convolve(data, window, 'valid')", "def runavg(ts, w):\n # Original length of ts\n N = len(ts)\n # make ts three-fold periodic\n ts = np.append(ts, np.append(ts, ts))\n # smooth by...
[ "0.6991072", "0.6959405", "0.6856522", "0.68367374", "0.6827277", "0.6805591", "0.6766678", "0.6719291", "0.67090917", "0.67002445", "0.6687949", "0.6687138", "0.6659968", "0.66362816", "0.6632409", "0.6625122", "0.6621746", "0.66188395", "0.66104066", "0.6603746", "0.6579043...
0.0
-1
Set all remaining missing temp values equal to the climatology
def fill_missing_temp_vals_with_climatology(temp: List, clim: Dict): temp[np.isnan(temp)] = clim["seas"][np.isnan(temp)] return temp
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def interpolate_none(self):\n\n # Reset processed data\n self.u_processed_mps = np.copy(self.u_mps)\n self.v_processed_mps = np.copy(self.v_mps)\n self.u_processed_mps[self.valid_data[0, :] == False] = np.nan\n self.v_processed_mps[self.valid_data[0, :] == False] = np.nan", "de...
[ "0.60011417", "0.5966284", "0.58717424", "0.57598615", "0.56755286", "0.5633607", "0.5623653", "0.5571434", "0.5541537", "0.5529372", "0.55014426", "0.54828835", "0.5442271", "0.5440241", "0.54358196", "0.5429773", "0.5426778", "0.54202056", "0.54152465", "0.54128855", "0.540...
0.7074793
0
Calculate a time series of "True" when threshold is exceeded, "False" otherwise
def find_exceedences(temp, clim): exceed_bool = temp - clim["thresh"] exceed_bool[exceed_bool <= 0] = False exceed_bool[exceed_bool > 0] = True # Find contiguous regions of exceed_bool = True events, n_events = ndimage.label(exceed_bool) return events, n_events
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def time_to_threshold(data, threshold, above=True, forecast_length=3600, interval_width=.95):\n # needs other input format: dataframe with two columns, ds and y\n model = Prophet(interval_width=interval_width)\n try:\n data.columns = ['ds', 'y']\n model.fit(data)\n except:\n print(...
[ "0.6474931", "0.62953085", "0.6285641", "0.6216803", "0.6081091", "0.60358685", "0.59739476", "0.59377205", "0.5912156", "0.5896608", "0.5830032", "0.582725", "0.578036", "0.5776547", "0.5772676", "0.5752825", "0.57133037", "0.5700873", "0.5662195", "0.56507903", "0.5636293",...
0.0
-1
Find all MHW events of duration >= minDuration Updates the mhw dictionary object.
def find_consecutive_exceedences_above_threshold( events, n_events, mhw, joinAcrossGaps, maxGap ): for ev in range(1, n_events + 1): # for each event event_duration = (events == ev).sum() if event_duration < minDuration: # is it longer than threshold? continue # extract the...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def duration_filter(ids_and_durations, minute_threshold):\n delta_sec = minute_threshold * 60 # Threshold passed in second to fit 'timedelta'.\n\n short_videos = [video[0] for video in ids_and_durations if video[1] <= timedelta(seconds=delta_sec)]\n long_videos = [video[0] for video in ids_and_durations ...
[ "0.54400396", "0.4907825", "0.4809929", "0.4713698", "0.4688717", "0.46803078", "0.4660191", "0.46311387", "0.46072233", "0.45317474", "0.45250195", "0.44913363", "0.4469598", "0.44641155", "0.44362915", "0.44328907", "0.44158658", "0.4409055", "0.43937212", "0.43847978", "0....
0.51633
1
Link heat waves that occur before and after a short gap (gap must be no longer than maxGap)
def join_events_across_gaps(maxGap, mhw): # Calculate gap length for each consecutive pair of events # from the start of the NEXT EVENT to the end of the PRIOR EVENT gaps = np.array(mhw["time_start"][1:]) - np.array(mhw["time_end"][0:-1]) - 1 if len(gaps) > 0: while gaps.min() <= maxGap: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SplitGap(data,gapsize,medwin,fluxdiff):\n \n # defining new empty lists and stuff\n pcount=0\n istamps=[]\n outData={}\n \n data['x'].mask = data['UnMasked']\n data['y'].mask = data['UnMasked']\n data['yerr'].mask = data['UnMasked']\n \n # median smoothing the lightcurve\n m...
[ "0.64434713", "0.5801542", "0.56155133", "0.56064266", "0.55303115", "0.54668903", "0.54343146", "0.53865033", "0.5327515", "0.53137743", "0.5306543", "0.5272721", "0.5268985", "0.52571553", "0.52498835", "0.52097887", "0.51800275", "0.5167571", "0.5143609", "0.51013005", "0....
0.58150005
1
Calculate marine heat wave properties
def calculate_event_characteristics(mhw, t, clim, temp): mhw["n_events"] = len(mhw["time_start"]) # for each event caclulate the characteristics for ev in range(mhw["n_events"]): mhw["date_start"].append(date.fromordinal(mhw["time_start"][ev])) mhw["date_end"].append(date.fromordinal(mhw["t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def manipulate_heat_data(self): \n self.exh.T_array = ( 0.5 * (self.exh.T_inlet_array +\n self.exh.T_outlet_array) + 273.15)\n self.exh.delta_T_array = ( self.exh.T_inlet_array -\n self.exh.T_outlet_array )\n \n self.cool.delta_T_array = ( self.cool.T_inlet_array -...
[ "0.63388246", "0.59296554", "0.58371013", "0.5741513", "0.5706787", "0.5706253", "0.5702298", "0.559826", "0.5589624", "0.5559046", "0.55509424", "0.5541427", "0.5477874", "0.54478437", "0.54435796", "0.54355675", "0.5431773", "0.54197073", "0.54046607", "0.5366216", "0.53429...
0.0
-1
find the peak time for that event (INTENSITY)
def find_peak(mhw, mhw_relSeas, ev, tt_start): tt_peak = np.argmax(mhw_relSeas) mhw["time_peak"].append(mhw["time_start"][ev] + tt_peak) mhw["date_peak"].append(date.fromordinal(mhw["time_start"][ev] + tt_peak)) mhw["index_peak"].append(tt_start + tt_peak) return mhw, tt_peak
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def peak_time(self):\n return np.array([self.wftime[ch][self.waveform[ch].argmax()] for ch in range(self.nchannels)])", "def peak(self):\n pass", "def find_alert_time(self) -> None:\n \n # Also not clear from the paper how to doe this,\n # use the first 10 data points in the ligh...
[ "0.7247735", "0.6565663", "0.64705825", "0.64565206", "0.6371662", "0.62771463", "0.62676597", "0.61803085", "0.61606777", "0.61517483", "0.6071804", "0.6058603", "0.60551894", "0.6047215", "0.60207856", "0.5992068", "0.5982672", "0.5955427", "0.5916465", "0.59072816", "0.590...
0.6051851
13
Requires getting MHW strength at "start" and "end"
def rates_of_onset_and_decline(mhw, tt_start, tt_end, tt_peak, mhw_relSeas, temp, clim): ## For START of event if tt_start > 0: mhw_relSeas_start = 0.5 * ( mhw_relSeas[0] + temp[tt_start - 1] - clim["seas"][tt_start - 1] ) mhw["rate_onset"].append( (mhw_relSeas[tt...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strength(self) -> float:\n ...", "def test_W_start(self):\t\t\n self.assertAlmostEqual(attempt.W[0], 12)", "def test_sw2():\n B1 = 100\n B2 = 200\n h = 18\n t = 1\n H = h + 2 * t\n E1 = 20000\n E2 = 10000\n sections = ((B1, t, 0, E1), (B2, t, h + t, E2))\n EI, top, ...
[ "0.611811", "0.58543104", "0.54258955", "0.53168124", "0.527644", "0.525759", "0.52391386", "0.5229558", "0.5170525", "0.5161343", "0.5128514", "0.511606", "0.5106863", "0.50794834", "0.50664425", "0.50602925", "0.5058106", "0.5052371", "0.50257456", "0.49980128", "0.49905187...
0.0
-1
Return input array [1D numpy array] with all nan values removed
def nonans(array): return array[~np.isnan(array)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_nans(arr, nan_rows=None):\n # Remove NaNs\n nconfigs, nt = arr.shape\n if nan_rows is None:\n mask = np.isfinite(arr)\n else:\n mask = np.array([n for n in np.arange(nconfigs) if n not in nan_rows])\n return arr[mask].reshape(-1, nt)", "def removeNans(data):\n for i in ...
[ "0.77405065", "0.7408961", "0.7318458", "0.72726125", "0.70151496", "0.6928957", "0.6729866", "0.6716962", "0.65393853", "0.65328234", "0.64841986", "0.6428685", "0.6409222", "0.6259641", "0.6246225", "0.62417316", "0.62114847", "0.62003404", "0.61770093", "0.6146045", "0.614...
0.7642145
1
Linearly interpolate over missing data (NaNs) in a time series.
def pad(data, maxPadLength=False): data_padded = data.copy() bad_indexes = np.isnan(data) good_indexes = np.logical_not(bad_indexes) good_data = data[good_indexes] interpolated = np.interp( bad_indexes.nonzero()[0], good_indexes.nonzero()[0], good_data ) data_padded[bad_indexes] = in...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def interpolate_missing(y):\n if y.isna().any():\n y = y.interpolate(method='linear', limit_direction='both')\n return y", "def fill_missing_data_points(data):\n return data.interpolate()", "def check_and_interpolate_nans(df):\n nan_count = df.isna().sum().sum()\n if nan_count > 0:\n ...
[ "0.7629114", "0.7248559", "0.71787924", "0.7115637", "0.70973015", "0.7010133", "0.69124943", "0.68163675", "0.68025076", "0.67993385", "0.6695243", "0.6660976", "0.66580003", "0.6648088", "0.6600599", "0.6532182", "0.6478971", "0.6434493", "0.63816845", "0.6318016", "0.62516...
0.0
-1
Performs a running average of an input time series using uniform window of width w. This function assumes that the input time series is periodic.
def runavg(ts, w): # Original length of ts N = len(ts) # make ts three-fold periodic ts = np.append(ts, np.append(ts, ts)) # smooth by convolution with a window of equal weights ts_smooth = np.convolve(ts, np.ones(w) / w, mode="same") # Only output central section, of length equal to the ori...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def moving_average(data, temporal_window=100):\n window = np.ones(temporal_window) / temporal_window\n return np.convolve(data, window, 'valid')", "def moving_average(data, window_size):\n window= np.ones(int(window_size))/float(window_size)\n return np.convolve(data, window, 'same')", "def running...
[ "0.72755015", "0.7019223", "0.6980032", "0.69147635", "0.6886311", "0.6849971", "0.67949075", "0.67820406", "0.66995203", "0.66644543", "0.6640706", "0.6443174", "0.6416299", "0.64145225", "0.64019024", "0.6376318", "0.63155216", "0.6246977", "0.6240341", "0.62263185", "0.622...
0.7964289
0
Get all cover devices and setup them via config entry.
async def async_setup_entry( hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback ) -> None: entities = [] for gateway in hass.data[DOMAIN][entry.entry_id]["gateways"]: for device in gateway.multi_level_switch_devices: for multi_level_switch in device.multi_l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_devices():", "async def async_setup_entry(hass, config_entry, async_add_entities):\n entities = []\n gateway = hass.data[DOMAIN][GATEWAYS_KEY][config_entry.entry_id]\n gateway.discover()\n for device in list(gateway.devices.values()): #TODO filter by type cover\n device_type = SELVE_C...
[ "0.65474904", "0.6335435", "0.6185986", "0.60845584", "0.59925437", "0.5884936", "0.5849123", "0.58073187", "0.58024555", "0.5795098", "0.579066", "0.57888335", "0.57872635", "0.578623", "0.578623", "0.57815707", "0.5763278", "0.57449365", "0.57423085", "0.5685192", "0.568451...
0.58917755
5
Initialize a climate entity within devolo Home Control.
def __init__( self, homecontrol: HomeControl, device_instance: Zwave, element_uid: str ) -> None: super().__init__( homecontrol=homecontrol, device_instance=device_instance, element_uid=element_uid, ) self._attr_device_class = CoverDeviceClass.BLI...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n \n self._citydb = CityDB()\n self._depression = 6 # Set default depression in degrees", "def test_init(self, fixture_environment):\n\n # Generate city object\n city_object = cit.City(environment=fixture_environment)\n\n # Check inheritance from c...
[ "0.5964611", "0.5734109", "0.5678026", "0.5661269", "0.56197786", "0.5596879", "0.5563419", "0.5556939", "0.55399334", "0.552751", "0.546134", "0.54588443", "0.5418741", "0.5418111", "0.5384016", "0.53809404", "0.53809404", "0.53710335", "0.53685933", "0.53409564", "0.5339822...
0.0
-1
Return the current position. 0 is closed. 100 is open.
def current_cover_position(self) -> int: return int(self._value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getPos(self):\n return self.__current_pos", "def _get_pos(self):\n return self._pos", "def get_pos(self):\r\n return self.pos", "def tell(self):\n _complain_ifclosed(self._closed)\n return self._position", "def get_pos(self):\n return self.pos", "def getPosit...
[ "0.7595", "0.7341735", "0.72841847", "0.72672564", "0.72579455", "0.7145039", "0.7109477", "0.7088855", "0.7027087", "0.7010361", "0.7010361", "0.69745183", "0.6952913", "0.6940286", "0.69308114", "0.69220424", "0.69075656", "0.69002414", "0.68650085", "0.6839626", "0.6835894...
0.6384917
74
Return if the blind is closed or not.
def is_closed(self) -> bool: return not bool(self._value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _isclose(self):\n return self.dp.state()==PyTango.DevState.CLOSE", "def is_closed(self) -> bool:", "def is_closed(self):\r\n return self.position == SinglePhaseBreaker.CLOSED", "def isClosed(self):\n pass", "def is_closed(self) -> bool:\n lopen = self.left_boundary['open']\n...
[ "0.787848", "0.7705696", "0.770256", "0.7663994", "0.765039", "0.7616886", "0.7553198", "0.7548185", "0.7519958", "0.7517888", "0.7515429", "0.743554", "0.74284077", "0.73875725", "0.7385514", "0.7315057", "0.7315057", "0.7308602", "0.7180794", "0.7131144", "0.7065028", "0....
0.71877086
18
Set the blind to the given position.
def set_cover_position(self, **kwargs: Any) -> None: self._multi_level_switch_property.set(kwargs["position"])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setPosition(position):", "def setPosition(self, *args):\n return _libsbml.BoundingBox_setPosition(self, *args)", "def bias(self, value):\n self.mbmod.bias = value", "def set_position(self, x, y):\n self.tx = -x\n self.ty = -y", "def SetBlindMode(self, agwFlags):\r\n\r\n ...
[ "0.6343822", "0.60181844", "0.5908633", "0.58790344", "0.5868035", "0.58086485", "0.5772332", "0.5769417", "0.5769417", "0.5769417", "0.5769417", "0.5769417", "0.5769417", "0.5769417", "0.5769417", "0.5769417", "0.5769417", "0.5769417", "0.57621205", "0.57330173", "0.5698484"...
0.0
-1
Convert something in [1,1] to [0,1]
def normalize_to_prob(inp): return (inp + 1)/2
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def zero_to_ones(L):\n return [-1 if val == 0 else 1 for val in L]", "def invert_zero_one(sequence):\n return [1 - code for code in sequence]", "def intconv(arg):\n return([arg[0], int(arg[1])] + arg[2:])", "def invert_v(val):\n return [val[0],1-val[1]]", "def binary_converter(probs):\n re...
[ "0.6727341", "0.66507214", "0.6430734", "0.6361047", "0.6328756", "0.6125416", "0.6044102", "0.59924", "0.5975442", "0.5952622", "0.5947834", "0.59292996", "0.58282095", "0.58242655", "0.5808415", "0.5786242", "0.5779058", "0.575488", "0.5746223", "0.57387036", "0.5726756", ...
0.0
-1
Assigns a score to the coursePlan based on the rarity of the course, the number of courses this one makes available in the future, and the users need and preference for a particular type of elective
def heuristics(course, suggestedPlan, user): score = course.score bonus = 0 return score + bonus
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _score_to_decision(self, score):", "def scoring(self):\n pass", "def score(self):\n raise NotImplementedError()", "def _cost_caught_by_police(self):\n if self.fine_frequency != 0:\n if self.number_of_courses % self.fine_frequency == 0 and self.number_of_courses != 0:\n ...
[ "0.60130614", "0.58570117", "0.5749423", "0.5732798", "0.56482965", "0.55836266", "0.55628306", "0.5561281", "0.5544241", "0.54613525", "0.54533947", "0.54433405", "0.54193467", "0.5417941", "0.54135525", "0.54113394", "0.5402817", "0.54014575", "0.53850657", "0.538445", "0.5...
0.7116717
0
Takes a user object and generates the shortest path to graduation.
def automated(user): # Start should be a Plan() and will include any classes the user has already taken to this point. It should have # accurate counts of its course typesTaken before starting the search. Goal is the end state desired by the user. # Usually this will be the gradReqs for the users Curriculu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_pathways(users, job_graph, debug, min_likelihood_thr=0.2):\r\n start_time = time.time()\r\n __print_msg('Computing career pathways...', debug)\r\n user_pathways = {}\r\n tot_users = len(users)\r\n i = 0\r\n for user, user_jobs in users.items():\r\n user_pathway = compute_user_p...
[ "0.584734", "0.5654354", "0.55678916", "0.5486526", "0.54030484", "0.538108", "0.53505796", "0.5349955", "0.53403103", "0.5308392", "0.5268799", "0.5247845", "0.5236312", "0.5192242", "0.5121435", "0.5113122", "0.51009756", "0.5100681", "0.50975037", "0.5097221", "0.50766873"...
0.5956283
0
This function is called to check if a username / password combination is valid.
def check_auth(username, password): return username == 'jeffkoons' and password == 'likesweirdbaloons'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_auth(username, password, expected_user, expected_pw):\n return username == expected_user and password == expected_pw", "def validate_authentication(self, username, password):\n return self.user_table[username]['pwd'] == password", "def check_auth(username, password):\n return usernam...
[ "0.82211864", "0.8146436", "0.7975914", "0.7962432", "0.7885527", "0.78588223", "0.78382313", "0.78288996", "0.7815222", "0.77856815", "0.77700555", "0.7760794", "0.7754975", "0.77548647", "0.7750886", "0.7749223", "0.77322245", "0.7715806", "0.7687129", "0.7685904", "0.76736...
0.7798579
9
Sends a 401 response that enables basic auth
def authenticate(): return Response( 'Could not verify your access level for that URL.\n' 'You have to login with proper credentials', 401, {'WWW-Authenticate': 'Basic realm="Login Required"'})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def authenticate():\n return Response('Not Authorized', 401, {'WWW-Authenticate': 'Basic realm=\"api\"'})", "def authenticate():\n return Response(\n '', 401, {'WWW-Authenticate': 'Basic realm=\"Login Required\"'}\n )", "def authenticate():\n return Response(\n 'You have to login with pro...
[ "0.8095378", "0.80943215", "0.7960329", "0.785324", "0.7844362", "0.78259075", "0.7812201", "0.7812201", "0.7812201", "0.7812201", "0.7812201", "0.7812201", "0.7812201", "0.7812201", "0.7812201", "0.7812201", "0.7812201", "0.7812201", "0.7812201", "0.7812201", "0.7812201", ...
0.7749071
35
graph from the task json with TaskResource named tuples living in nodes
def build_taskgraph(tasks): global taskgraph for task in tasks: if not task['id'] in taskgraph: taskgraph.add_node(task["id"]) data = str(task["DATA"]) tr = TaskResources(ram=int(task['RAM']), cpu=int( task['CPU']), hdd=int(task['HDD'])) taskgraph.node[tas...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def task_relation_json(self) -> List[Dict]:\n if not self.tasks:\n return [self.tasks]\n else:\n self._handle_root_relation()\n return [tr.get_define() for tr in self._task_relations]", "def _subgraph(self):\n return {\n 'type': 'SubgraphTask',\n ...
[ "0.6246238", "0.6081832", "0.6065744", "0.6018206", "0.6018206", "0.58417726", "0.5779049", "0.5658437", "0.5583271", "0.55294436", "0.55002636", "0.5468481", "0.54389864", "0.53757447", "0.5373088", "0.53719306", "0.53705764", "0.5357756", "0.53515995", "0.5348182", "0.53369...
0.71598744
0
receive and build taskgraph
def tasks_recv(): recv_json = request.get_json() build_taskgraph(recv_json) return 'ok'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_taskgraph(tasks):\n global taskgraph\n for task in tasks:\n if not task['id'] in taskgraph:\n taskgraph.add_node(task[\"id\"])\n data = str(task[\"DATA\"])\n tr = TaskResources(ram=int(task['RAM']), cpu=int(\n task['CPU']), hdd=int(task['HDD']))\n t...
[ "0.65182334", "0.63080335", "0.6293795", "0.6204706", "0.6186549", "0.61605525", "0.61220175", "0.61220175", "0.61082584", "0.6104672", "0.59439194", "0.591472", "0.5882329", "0.5751076", "0.5699367", "0.5686174", "0.5679653", "0.56747794", "0.56723875", "0.5661628", "0.56508...
0.72909814
0
Set the edgenode's resources for debugging
def set_resources(): global available_resources global EdgenodeResources recv_json = request.get_json() for resourcename, value in recv_json.items(): available_resources[resourcename] = value # TODO make this better EdgenodeResources = [TaskResources(ram=int(available_resources['RAM']), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resources(self):", "def resources(self, resources):\n self._resources = resources", "def setOptManagerResources(o): # pylint: disable=global-statement\n # pylint: disable=global-statement\n global OPT_MANAGER_RESOURCES_PGAAS\n OPT_MANAGER_RESOURCES_PGAAS = \"{}/pgaas\".format(o)", "def resource...
[ "0.5880429", "0.5852034", "0.57128286", "0.56084967", "0.56084967", "0.56084967", "0.56084967", "0.5529932", "0.5283272", "0.5241133", "0.5212937", "0.5193305", "0.514852", "0.51433814", "0.51408863", "0.5116762", "0.50918823", "0.5086745", "0.5068364", "0.5036334", "0.501060...
0.6285629
0
Loads the textual templates of questions and saves them in a list.
def load_templates(self): self.templates = [] if os.path.exists("question_templates.txt"): for line in open("question_templates.txt", "r"): self.templates.append(line.replace("\n", ""))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_questions(self, verbose=True):\n for question in self.question_list:\n question.load_question(self.data)", "def load_templates(self):\n TemplateHandler.templates = []\n for template in os.listdir(TemplateHandler.templates_path):\n template_config = self.load_te...
[ "0.6505029", "0.5937621", "0.5928935", "0.5910248", "0.5856114", "0.5806971", "0.57281137", "0.5690211", "0.56250936", "0.56000656", "0.5596543", "0.55873555", "0.55826813", "0.55461633", "0.5500507", "0.5485882", "0.54667103", "0.5460839", "0.5444884", "0.5443755", "0.544123...
0.8599687
0
Uses the list of properties to generate a random question using the text file of question templates. If there are no more unknown properties, then the program can be completed.
def generate_language(self, properties): drink_property = self.find_drink_property(properties) if drink_property: return self.generate_sentence(drink_property) else: return ""
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def generate_question(self) -> None:\n topic = choice(list(self._topics.keys()))\n arrayList = await self.session.get(\"https://restcountries.eu/rest/v2\")\n arrayList = await arrayList.json() # get request to the country API\n countries = []\n \n for _ in range(4):\...
[ "0.6108525", "0.58774537", "0.58263105", "0.5780516", "0.5709611", "0.56744903", "0.5644065", "0.5475492", "0.54661214", "0.5441473", "0.5415947", "0.53851706", "0.5381618", "0.53369546", "0.53267866", "0.5318371", "0.5291741", "0.5268244", "0.5259975", "0.5259326", "0.525599...
0.0
-1
Generates two random numbers to get a random property about which there is no knowledge yet, which is indicated by 'None'. If there is knowledge, then this will either be indicated by 'True' or 'False'. If no 'None' is found for 5 times in a row, there is done a check to make sure that there are still 'Nones' in the li...
def find_drink_property(self, properties): split_status = "" tries = 0 while split_status != "None" and tries <= 5: random_drink = randint(0, len(properties) - 1) random_property = randint(1, len(properties[random_drink]) - 1) drink_property = properties[ran...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def random (self, checkfn=None):\n if len(self) == 0:\n return None\n return self.random_pick(checkfn=checkfn)[1]", "def maybe(self):\n return random.getrandbits(1)", "def random (self, checkfn=None):\n if len(self) == 0:\n return None\n if checkfn is No...
[ "0.5694869", "0.5662974", "0.56016517", "0.55177194", "0.544953", "0.5439609", "0.53909516", "0.537335", "0.5364247", "0.5350749", "0.53295314", "0.5328545", "0.52704114", "0.5237583", "0.5216445", "0.5216445", "0.5216065", "0.5210262", "0.5208821", "0.5197762", "0.5170702", ...
0.5758818
0
Finds the first occurrence of 'None' in the list of properties.
def find_first_none(self, properties): for drink in properties: iterate_drink = iter(drink) next(iterate_drink) for drink_property in iterate_drink: split_property = drink_property.split(": ")[1].split(" //")[0] if split_property == "None": ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_property(properties, key):\n matching = [prop.split('=').pop(1) for prop in properties\n if prop.startswith(key + '=')]\n if len(matching) > 1:\n raise ValueError('Property %r should appear only once in %r' %\n (key, properties))\n if '' in matching:\...
[ "0.6420576", "0.6140944", "0.56629044", "0.5504727", "0.5462736", "0.5437577", "0.53297234", "0.52824485", "0.5245571", "0.52292776", "0.5227138", "0.5211976", "0.51856893", "0.5184328", "0.5180561", "0.5177724", "0.516806", "0.5162539", "0.5130421", "0.5128275", "0.51195353"...
0.8134218
0
Uses the found drink property to generate a sentence from one of the templates.
def generate_sentence(self, complete_property): drink_property = complete_property.split(": ")[0] property_type = complete_property.split(": ")[1].split("// ")[1] template = self.get_template(property_type) question = template.replace("{" + property_type + "}", drink_property) r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_sentence(self):", "def generate_language(self, properties):\n\n drink_property = self.find_drink_property(properties)\n\n if drink_property:\n return self.generate_sentence(drink_property)\n else:\n return \"\"", "def linkTemplates(self, sentence):\n templa...
[ "0.6083435", "0.6067856", "0.60557234", "0.58162034", "0.5800545", "0.57799345", "0.57570976", "0.5742893", "0.5580341", "0.5577429", "0.55747986", "0.5573053", "0.55707955", "0.55657536", "0.5488579", "0.5484002", "0.5479624", "0.54288805", "0.538444", "0.5365156", "0.534202...
0.66812485
0
Retrieves the correct template to ask a question with the found drink property and its type.
def get_template(self, property_type): valid_templates = [s for s in self.templates if "{" + property_type + "}" in s] return choice(valid_templates)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def question_generator(self):\n self.status_conv = 'yes_no_question_asked'\n questions = config.questions\n if not self.voyage.get('voyageurs') and 'voyageur_add' not in self.infos_needed:\n self.infos_needed.append('voyageur_add')\n if self.infos_needed:\n if self...
[ "0.55158", "0.54558504", "0.53866625", "0.5272962", "0.5254931", "0.5225667", "0.5201388", "0.51010674", "0.50510913", "0.5043558", "0.4993756", "0.49860686", "0.49789208", "0.497429", "0.49692836", "0.49514955", "0.49476779", "0.4947658", "0.49140137", "0.49097073", "0.49053...
0.5877344
0
Returns the correct form of a question such that e.g. 'a(n) strainer' becomes 'a strainer'.
def get_correct_form(self, template): if "(" in template and ")" in template: index = template.index(")") first_letter = template[index+2] if self.is_vowel(first_letter): template = template.replace("a(n)", "an") else: template = t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normalize_answer(s):\n\n def remove_articles(text):\n return re_art.sub(' ', text)\n\n def white_space_fix(text):\n return ' '.join(text.split())\n\n def remove_punc(text):\n return re_punc.sub(' ', text) # convert punctuation to spaces\n\n def lower(text):\n return tex...
[ "0.6192208", "0.6192208", "0.61774063", "0.615062", "0.6132909", "0.6085301", "0.6085301", "0.6061046", "0.6054664", "0.6050931", "0.60430825", "0.5989373", "0.59198713", "0.5915252", "0.58585846", "0.58305085", "0.57404023", "0.5724126", "0.5723947", "0.5629233", "0.5621194"...
0.6070443
7
Returns a boolean that indicates whether a letter is a boolean.
def is_vowel(self, letter): if letter in ("a", "e", "i", "o", "u", "A", "E", "I", "O", "U"): return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def boolean(s):\r\n ss = str(s).lower()\r\n if ss in TRUTHY_STRINGS:\r\n return True\r\n elif ss in FALSY_STRINGS:\r\n return False\r\n else:\r\n raise ValueError(\"not a valid boolean value: \" + repr(s))", "def __charToBool(self, char):\n\n if char == '1':\n r...
[ "0.7187412", "0.7018804", "0.69296837", "0.68297184", "0.6738983", "0.67321396", "0.66973674", "0.6673456", "0.66617125", "0.6620476", "0.6616839", "0.6589189", "0.65791404", "0.6567738", "0.6567653", "0.6552819", "0.65400046", "0.65357196", "0.6515047", "0.65084463", "0.6489...
0.0
-1
Given a list of list of Results, return a named threetuple with the an item with the name of each function in self.stat_functions. Each of these items is itself a similar threetuple, but each item is, e.g., the maximum of the maximums of the results.
def statistics(self, results): nt = namedtuple("Statistic", [n.__name__ for n in self.stat_functions]) s = [] for f_one in self.stat_functions: inside = [] for f_two in self.stat_functions: inside.append(f_two(f_one(r.results) for r in results)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_func_tuples():\n func_tuples = [\n ('met_gumeJ1_3sopt_tr20', 'Rel-UME J1', 'C1-.'),\n ('met_gumeJ5_3sopt_tr20', 'Rel-UME J5', 'r-^'),\n ('met_gfssdJ1_3sopt_tr20', 'Rel-FSSD J1', 'C4--'),\n ('met_gfssdJ5_3sopt_tr20', 'Rel-FSSD J5', 'b-x'),\n\n ('met_...
[ "0.56247234", "0.5412346", "0.52866143", "0.5263205", "0.5087793", "0.50818396", "0.50043947", "0.50017667", "0.49602503", "0.49288338", "0.49267918", "0.48980197", "0.4889592", "0.488622", "0.48502252", "0.4846984", "0.4838837", "0.4835714", "0.48321322", "0.4820766", "0.481...
0.7310715
0
Displays up to 12 charaters on the hp33401a
def hp34401a_lcd_disp(hp_meter, message): hp_meter.write("DISP:TEXT:CLE") hp_meter.write("DISP:TEXT '" + str(message) + "'")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def banner_ascii():\n print(\"\")\n print(f\"\\n{RED} Steganography Tool{RESET}\")\n print(f\"{RED} Made By {RESET}\")\n print(f\"{RED} Ehthe Samul Islam Laskar USN:1DS16CS712 {RESET}\")\n print(f\"{RED} B Padma USN:1DS19CS420{RESET}\")\n print(...
[ "0.6712049", "0.61855406", "0.6153275", "0.61067873", "0.6099449", "0.6087882", "0.6048082", "0.5993004", "0.5990485", "0.5968788", "0.5943066", "0.5904404", "0.58474976", "0.58384794", "0.58171725", "0.5817065", "0.5815135", "0.57878107", "0.57636875", "0.576346", "0.5755653...
0.0
-1
Measures voltage in auto range and auto resolution returns the voltage in float
def hp34401a_read_voltage(hp_meter): hp_meter.write("MEAS:VOLT:DC? DEF,DEF") return float(hp_meter.read())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ac_voltage(self):\n return float(self.get_ac_voltage())", "def meas_voltage(instrument, v_range=10, resolution=0.003):\n return float(instrument.query('MEAS:VOLTage:DC? %s,%s' % (v_range, resolution)))", "def get_voltage(self):\n summary = \" \".join(self.get_summary().split())\n pa...
[ "0.7460715", "0.72376", "0.7180077", "0.71739894", "0.7143595", "0.69467497", "0.6899874", "0.6868156", "0.6855484", "0.67759335", "0.6678318", "0.6674746", "0.66508025", "0.6561424", "0.6534731", "0.65066266", "0.65000963", "0.6477398", "0.6432846", "0.6412113", "0.6365112",...
0.64051443
20
Measures voltage with specified range and resolution returns the voltage in float
def hp34401a_read_voltage_rng_res(hp_meter , v_range, v_resolution): hp_meter.write("MEAS:VOLT:DC? " + str(v_range) + " , " + str(v_resolution)) return float(hp_meter.read())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def meas_voltage(instrument, v_range=10, resolution=0.003):\n return float(instrument.query('MEAS:VOLTage:DC? %s,%s' % (v_range, resolution)))", "def dmm_measure_voltage(self,range=None,res=None):\n if range is None:\n return self.dmm.measure_voltage()\n elif res is None:\n ...
[ "0.8078823", "0.7291037", "0.67395306", "0.67171156", "0.63865334", "0.63084126", "0.62544125", "0.6248933", "0.62172204", "0.61805737", "0.6111289", "0.6101917", "0.6081985", "0.60785013", "0.60742426", "0.60578114", "0.6011588", "0.59588313", "0.59566176", "0.59343493", "0....
0.7613944
1
Displays up to 16 charaters on the hp2458a
def hp3458a_lcd_disp(hp_meter, message): hp_meter.write("DISP 3") hp_meter.write("DISP 2 '" + str(message) + "'")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def banner_ascii():\n print(\"\")\n print(f\"\\n{RED} Steganography Tool{RESET}\")\n print(f\"{RED} Made By {RESET}\")\n print(f\"{RED} Ehthe Samul Islam Laskar USN:1DS16CS712 {RESET}\")\n print(f\"{RED} B Padma USN:1DS19CS420{RESET}\")\n print(...
[ "0.6711596", "0.6433494", "0.63968563", "0.61818796", "0.6086967", "0.6044831", "0.6038081", "0.60282725", "0.59977597", "0.5977302", "0.59293854", "0.5919693", "0.5907645", "0.5782015", "0.5761691", "0.5756993", "0.57358706", "0.57197696", "0.5708366", "0.5704662", "0.569094...
0.5474368
54
Starts a self test
def hp3458a_self_test(hp_meter): hp_meter.write("TEST")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def startTestRun(self):", "def runTests(self):\n \n pass", "def test_run_started(self):", "def runtest(self):", "def __main() :\n launchTests()", "def startTestHook(self):", "def test_start(self):\n self.fail(\"write a test\")", "def run_test(self):\n raise NotImplementedEr...
[ "0.8505261", "0.79985905", "0.7970492", "0.7886812", "0.7796331", "0.76125836", "0.75867486", "0.7508232", "0.7442587", "0.74282044", "0.7393508", "0.7370026", "0.7354305", "0.7352568", "0.7300997", "0.72973377", "0.72624886", "0.71843565", "0.7175111", "0.7169313", "0.714277...
0.0
-1
Initializes the meter to DC voltage measurment in the 10V range
def hp3458a_init(hp_meter): hp_meter.write("RESET") hp_meter.write("TARM HOLD") hp_meter.write("FUNC DCV") # Set to DC voltage measurment hp_meter.write("RANGE 10") # Set to 10V range hp_meter.write("LFREQ LINE") # Measure line freq and set rejection filter hp_meter.write("NPLC 1") hp_meter....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def configure_vdc(self, rng, res, unit = 'V'):\n self.write_to_serial(':conf:volt:dc ' + str(rng) + ',' + str(res))# + unit)", "def setvoltages(self):\n pass", "def meas_voltage(instrument, v_range=10, resolution=0.003):\n return float(instrument.query('MEAS:VOLTage:DC? %s,%s' % (v_range, reso...
[ "0.6578889", "0.5966041", "0.5959843", "0.58004075", "0.58004075", "0.57944673", "0.5790686", "0.5748484", "0.5745046", "0.5723111", "0.57070476", "0.56898814", "0.5680734", "0.5679567", "0.5679567", "0.56482434", "0.5646847", "0.5607881", "0.56076604", "0.5604224", "0.560302...
0.0
-1
Measures voltage returns the voltage in float
def hp3458a_read_voltage(hp_meter): hp_meter.write("TARM SGL") return float(hp_meter.read())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_voltage(self):\n summary = \" \".join(self.get_summary().split())\n pattern = '\\$.... .. (.*?) .*? .*? .*? .*? . .*? .*? . . . .*?'\n voltage = float(re.findall(pattern,summary).pop())\n return voltage", "def get_voltage(self):\n status = self.get_status_response()\n ...
[ "0.80243504", "0.76661944", "0.75472015", "0.74645776", "0.7437857", "0.73945224", "0.7392207", "0.7350186", "0.73374736", "0.7213724", "0.7169046", "0.7097468", "0.70568234", "0.7049625", "0.7021389", "0.6937337", "0.6860303", "0.68288875", "0.66705036", "0.66682374", "0.665...
0.6485079
29
Connect to the resource manager returns the visa avalable resources
def resource_manager(): return visa.ResourceManager()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resources(self):\n return self.__resources", "def resources(self):", "def resources(self):\n return self._resources", "def resources(self):\n return self._resources", "def resources(self):\n return self._resources", "def resources(self) -> pulumi.Output[Sequence['outputs.Machi...
[ "0.67140317", "0.66184807", "0.6323841", "0.6323841", "0.6323841", "0.6289765", "0.6227922", "0.61894625", "0.6173168", "0.61393124", "0.61299413", "0.6100624", "0.60945547", "0.6082597", "0.60609436", "0.6056553", "0.60070026", "0.60023284", "0.5967622", "0.5967622", "0.5967...
0.6919788
0