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
Load all cells from a GDSII stream file in binary format.
def get_binary_cells(infile): close = True if hasattr(infile, "__fspath__"): infile = open(infile.__fspath__(), "rb") elif isinstance(infile, (basestring, Path)): infile = open(infile, "rb") else: close = False cells = {} name = None cell_data = None for rec_type,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load(datastream):", "def load_rbc( fname, skiprows, nx, ny ):\n C = numpy.loadtxt( fname, skiprows=skiprows ) \n cell_frames = [ C[i].reshape(( nx,ny )) for i in range( 5000-skiprows ) ]\n return cell_frames", "def load_binary_data(self, encoding='utf8'):\n\n # TODO use smart_open again ...
[ "0.59665906", "0.5666531", "0.5652383", "0.56487894", "0.5564757", "0.5411691", "0.53955466", "0.5385155", "0.538372", "0.53774667", "0.52971804", "0.5276019", "0.52390313", "0.52172196", "0.5202131", "0.51881504", "0.5182322", "0.5163801", "0.5156424", "0.5144767", "0.513413...
0.61892736
0
Gets the created_on of this SubscriptionProductRetirement. The date and time when the object was created.
def created_on(self): return self._created_on
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def created_date(self):\n return self._created_date", "def created_date(self):\n return self._created_date", "def date_created(self):\n return self._date_created", "def date_created(self):\n return self._date_created", "def date_created(self):\n return self._date_created"...
[ "0.7168697", "0.7168697", "0.7047112", "0.7047112", "0.7047112", "0.6913553", "0.6905717", "0.672921", "0.66820747", "0.6590892", "0.65313655", "0.64979154", "0.64952743", "0.6466305", "0.6449166", "0.6449166", "0.6449166", "0.64408654", "0.6436507", "0.64327043", "0.64327043...
0.7107456
5
Sets the created_on of this SubscriptionProductRetirement. The date and time when the object was created.
def created_on(self, created_on): self._created_on = created_on
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def created_date(self, created_date):\n self._created_date = created_date", "def created_date(self, created_date):\n\n self._created_date = created_date", "def created_date(self, created_date):\n\n self._created_date = created_date", "def created_date(self, created_date):\n\n self...
[ "0.61930114", "0.61522496", "0.61522496", "0.61522496", "0.61522496", "0.61522496", "0.60280794", "0.60078293", "0.60078293", "0.59660447", "0.59558755", "0.59558755", "0.59558755", "0.58354986", "0.583224", "0.58256143", "0.58256143", "0.5760754", "0.5735765", "0.56967336", ...
0.6739802
6
Gets the id of this SubscriptionProductRetirement. A unique identifier for the object.
def id(self): return self._id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def product_id(self):\n return self._product_id", "def product_id(self):\n return self._product_id", "def product_id(self):\n return self._product_id", "def product_id(self):\n return self._product_id", "def product_id(self) -> pulumi.Output[str]:\n return pulumi.get(self...
[ "0.7453236", "0.7453236", "0.7453236", "0.7453236", "0.70733815", "0.6746917", "0.6697227", "0.6697227", "0.66862226", "0.66862226", "0.66862226", "0.66862226", "0.66862226", "0.66862226", "0.6684057", "0.66782755", "0.66718966", "0.66718966", "0.66718966", "0.66718966", "0.6...
0.0
-1
Sets the id of this SubscriptionProductRetirement. A unique identifier for the object.
def id(self, id): self._id = id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def product_id(self, product_id):\n self._product_id = product_id", "def product_id(self, product_id):\n\n self._product_id = product_id", "def product_id(self, product_id):\n\n self._product_id = product_id", "def set_id(self, id):\n self.__id = id", "def set_id(self, id_):\n\n...
[ "0.6687188", "0.65710616", "0.65710616", "0.65566206", "0.65250146", "0.64017624", "0.64017624", "0.64017624", "0.64017624", "0.64017624", "0.63562167", "0.63235307", "0.63213336", "0.63213336", "0.63213336", "0.63213336", "0.63213336", "0.63213336", "0.63213336", "0.63213336",...
0.0
-1
Gets the linked_space_id of this SubscriptionProductRetirement. The ID of the space this object belongs to.
def linked_space_id(self): return self._linked_space_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_subscription_id(self):\n return self.instance_metadata.subscription_id", "def product_id(self):\n return self._product_id", "def product_id(self):\n return self._product_id", "def product_id(self):\n return self._product_id", "def product_id(self):\n return self._...
[ "0.5639911", "0.5487876", "0.5487876", "0.5487876", "0.5487876", "0.53018355", "0.52775943", "0.52646273", "0.51881564", "0.5121563", "0.5112025", "0.5101079", "0.5073609", "0.5073609", "0.5073609", "0.5073609", "0.5073609", "0.5073609", "0.5060274", "0.5060274", "0.50597024"...
0.7217349
2
Sets the linked_space_id of this SubscriptionProductRetirement. The ID of the space this object belongs to.
def linked_space_id(self, linked_space_id): self._linked_space_id = linked_space_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def link_document_workspace_id(self, link_document_workspace_id):\n\n self._link_document_workspace_id = link_document_workspace_id", "def link_id(self, link_id):\n\n self._link_id = link_id", "def linked_space_id(self):\n return self._linked_space_id", "def linked_space_id(self):\n ...
[ "0.55407226", "0.55088866", "0.5413146", "0.5413146", "0.5413146", "0.5327779", "0.5327779", "0.5327779", "0.51047593", "0.49513242", "0.49150938", "0.49150938", "0.48627087", "0.4772015", "0.47145233", "0.47094992", "0.46938464", "0.46066585", "0.46059442", "0.45948213", "0....
0.72988594
2
Gets the product of this SubscriptionProductRetirement.
def product(self): return self._product
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getProduct(self, *args):\n return _libsbml.Reaction_getProduct(self, *args)", "def get_card_product(self):\n\n return self.card_product", "def product(self, product_id):\r\n return products.Product(self, product_id)", "def get(self, product_id):\n\n return product.get_single_p...
[ "0.71919554", "0.7168041", "0.70292336", "0.6978669", "0.69453955", "0.6790158", "0.65579", "0.6556982", "0.6439483", "0.642651", "0.642651", "0.642651", "0.642651", "0.64097875", "0.6401133", "0.6386566", "0.6296203", "0.629263", "0.62489635", "0.6159131", "0.6152622", "0....
0.73504794
2
Sets the product of this SubscriptionProductRetirement.
def product(self, product): self._product = product
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def product(self, product):\n self._product = product", "def product(self, product):\n if product is None:\n raise ValueError(\"Invalid value for `product`, must not be `None`\") # noqa: E501\n\n self._product = product", "def set_product(self, product):\n self.single_se...
[ "0.77392894", "0.7601882", "0.7119301", "0.7109555", "0.69029176", "0.6886196", "0.6886196", "0.6858822", "0.6649319", "0.64404374", "0.6351997", "0.6307819", "0.62698454", "0.601716", "0.6005919", "0.59450114", "0.59232247", "0.5884955", "0.58693993", "0.5860039", "0.5857742...
0.78371936
0
Gets the respect_terminiation_periods_enabled of this SubscriptionProductRetirement.
def respect_terminiation_periods_enabled(self): return self._respect_terminiation_periods_enabled
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def respect_terminiation_periods_enabled(self, respect_terminiation_periods_enabled):\n\n self._respect_terminiation_periods_enabled = respect_terminiation_periods_enabled", "def evaluation_periods(self) -> Optional[pulumi.Input[int]]:\n return pulumi.get(self, \"evaluation_periods\")", "def eval...
[ "0.74990064", "0.59558636", "0.59558636", "0.59558636", "0.59558636", "0.59558636", "0.59558636", "0.59558636", "0.59558636", "0.59558636", "0.59558636", "0.59558636", "0.59558636", "0.52868", "0.52440816", "0.51808107", "0.51157266", "0.51113236", "0.50006104", "0.49916717", ...
0.7897476
0
Sets the respect_terminiation_periods_enabled of this SubscriptionProductRetirement.
def respect_terminiation_periods_enabled(self, respect_terminiation_periods_enabled): self._respect_terminiation_periods_enabled = respect_terminiation_periods_enabled
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def respect_terminiation_periods_enabled(self):\n return self._respect_terminiation_periods_enabled", "def set_atr_periods(self, periods: int = 100):\n h, l, c_prev = self.data.High, self.data.Low, pd.Series(self.data.Close).shift(1)\n tr = np.max([h - l, (c_prev - h).abs(), (c_prev - l).abs...
[ "0.73718745", "0.45488954", "0.44557628", "0.44557628", "0.44557628", "0.44557628", "0.44557628", "0.44557628", "0.44557628", "0.44557628", "0.44557628", "0.44557628", "0.44557628", "0.44557628", "0.42839718", "0.4270166", "0.40364996", "0.4027975", "0.39874214", "0.39431196", ...
0.8498492
0
Gets the target_product of this SubscriptionProductRetirement.
def target_product(self): return self._target_product
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def target_for_product(self, product):\n for target, products in self._products_by_target.items():\n if product in products:\n return target\n return None", "def getTarget(self):\n return self._target", "def getTarget(self):\n\n return self._target", "def target_resource(self)...
[ "0.679874", "0.65475947", "0.65354234", "0.6525121", "0.6492427", "0.6492427", "0.6492427", "0.638465", "0.6314479", "0.616897", "0.61486644", "0.61486644", "0.61486644", "0.61486644", "0.6129035", "0.60792124", "0.6019437", "0.6019437", "0.6019437", "0.6019437", "0.60076684"...
0.8075166
0
Sets the target_product of this SubscriptionProductRetirement.
def target_product(self, target_product): self._target_product = target_product
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def target_resource(self, target_resource):\n self._target_resource = target_resource", "def product(self, product):\n\n self._product = product", "def product(self, product):\n\n self._product = product", "def target_product(self):\n return self._target_product", "def product(s...
[ "0.6490736", "0.6366156", "0.6366156", "0.633028", "0.62527555", "0.6134227", "0.6102009", "0.59970754", "0.59970754", "0.59861636", "0.5946594", "0.5928907", "0.58098286", "0.57920307", "0.5782366", "0.57533026", "0.57472503", "0.56921405", "0.56693083", "0.56693083", "0.566...
0.84785706
0
Gets the version of this SubscriptionProductRetirement. The version is used for optimistic locking and incremented whenever the object is updated.
def version(self): return self._version
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def product_version(self):\n return self._product_version", "def get_product_version(self):\n\t\treturn call_sdk_function('PrlSrvInfo_GetProductVersion', self.handle)", "def get_product_version(self):\n return self.get_attr('product_version')", "def get_product_version(self):\n\t\treturn call_s...
[ "0.7609071", "0.7556369", "0.7447159", "0.7211711", "0.7078787", "0.7065332", "0.7065332", "0.6965987", "0.6928433", "0.6927428", "0.69248474", "0.68874663", "0.6880073", "0.6839752", "0.68232965", "0.67877114", "0.67861766", "0.67816305", "0.67618465", "0.6750636", "0.673643...
0.67298514
30
Sets the version of this SubscriptionProductRetirement. The version is used for optimistic locking and incremented whenever the object is updated.
def version(self, version): self._version = version
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def product_version(self, product_version):\n\n self._product_version = product_version", "def version(self, version):\n \n self._version = version", "def version(self, version):\n self._version = version", "def version(self, version):\n self._version = version", "def ver...
[ "0.7180803", "0.6708293", "0.6647392", "0.6647392", "0.6574128", "0.6495684", "0.64354223", "0.64354223", "0.6300998", "0.62922347", "0.6192053", "0.6126061", "0.60471845", "0.60471845", "0.60471845", "0.60225743", "0.5944241", "0.59408695", "0.59389913", "0.5929401", "0.5891...
0.6649448
15
Execute each job as a multiprocessing.Process as each one should submit command by command to the global executor class
def run(self, **kwargs): for repl in self.replicas: self.log.info('-'*50) self.log.info("Running %s analysis..."%repl.name) self.__submitReplica(repl, **kwargs) self.log.info('-'*50)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run_commands(self):\n processes = []\n\n i = 0\n ## get list of commands\n commands = self.get_commands()\n cnum = multiprocessing.cpu_count()\n\n while len(commands)>0:\n while len(processes)<cnum-1:\n c = commands.pop()\n i+=1...
[ "0.7240149", "0.72245026", "0.6674598", "0.6623324", "0.6486739", "0.63962394", "0.63046163", "0.63006055", "0.6284784", "0.621504", "0.6210209", "0.62053984", "0.61710286", "0.6170014", "0.61691916", "0.61599463", "0.60844254", "0.6076164", "0.60661584", "0.6051776", "0.6045...
0.0
-1
! Makes recursively all the directory in input path
def safe_mkdirs(path): if not os.path.exists(path): try: os.makedirs(path) except Exception as e: raise IOError( ("Failed to create recursive directories: " " {}".format(path) ) )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_path(self, path):\n path_list = path.split(\"/\")\n done_path = self.parent_folder + \"/\"\n\n for directory in path_list:\n try:\n os.mkdir(done_path + directory + \"/\")\n except FileExistsError:\n done_path += directory + \"/\""...
[ "0.6848508", "0.6776255", "0.6751329", "0.67272055", "0.66558444", "0.66327935", "0.6594902", "0.64868104", "0.64620495", "0.64169073", "0.6391926", "0.63862544", "0.6384313", "0.63800734", "0.6379803", "0.63403", "0.6321055", "0.6309966", "0.63069654", "0.6300319", "0.628608...
0.58037275
67
! Command line parser for Utterance level classification Leave one speaker out schema pipeline
def get_args(): parser = argparse.ArgumentParser( description='Utterance level classification Leave one ' 'speaker out schema pipeline' ) parser.add_argument('-i', '--input_features_paths', nargs='+', help='File paths of the features you want to ' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\n parser = argparse.ArgumentParser()\n subparsers = parser.add_subparsers(dest='mode')\n\n # Add sub-parser for feature extraction\n parser_extract = subparsers.add_parser('extract')\n parser_extract.add_argument('dataset',\n choices=['training', 'validatio...
[ "0.65690255", "0.6566645", "0.6457948", "0.6415648", "0.62353814", "0.62087375", "0.6207265", "0.617082", "0.61693275", "0.609565", "0.60759753", "0.60393417", "0.60188335", "0.5964898", "0.591729", "0.5908559", "0.5883085", "0.5858392", "0.585827", "0.5837335", "0.5829505", ...
0.0
-1
Creates a module for converting to two theta
def pixels_two_theta_module(id=None, datatype=None, action=None, version='0.0', fields=[], xtype=None, **kwargs): icon = { 'URI': config.IMAGES + config.ANDR_FOLDER + "twotheta.png", 'image': config.IMAGES + config.ANDR_FOLDER + "twotheta_image.png", 'terminals': { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def theta():\n pass", "def theta(a, b):\n \n \n def norm_vec(x):\n norm_out = sqrt(dot(x, x))\n return norm_out\n \n theta = acos(dot(a, b) / (norm_vec(a) * norm_vec(b))) * 180 / pi\n \n print theta", "def world_to_tanp(self, ra, dec):\n x, y = ra, dec\n retu...
[ "0.7062045", "0.62151426", "0.61780596", "0.6039193", "0.5918481", "0.58948064", "0.57671696", "0.5749727", "0.5746482", "0.5715399", "0.5696348", "0.56941783", "0.56172824", "0.5604744", "0.5569989", "0.5564663", "0.55641603", "0.5526037", "0.5512258", "0.5491512", "0.549099...
0.6354712
1
Builds and compiles an LSTM model with the provided hyperparameters
def build_lstm_model(num_features, embedding_size=None, kernel_size=None, filters=None, pool_size=None, lstm_output_size=None): # Embedding if embedding_size is None: embedding_size = 64 # Convo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_model():\n model = Sequential()\n\n # declare the sizes of the layers (1d input and output)\n layers = [1, 50, 100, 1]\n\n # first hidden layer, using linear activation (not specified)\n model.add(LSTM(layers[1], input_shape=(None, layers[0]), return_sequences=True))\n model.add(Dropout...
[ "0.7327266", "0.7019922", "0.69401413", "0.6916434", "0.6855566", "0.6760684", "0.6749975", "0.66563517", "0.6652487", "0.6617321", "0.6601682", "0.6585494", "0.6581302", "0.65048313", "0.6483536", "0.64814115", "0.6456501", "0.6426442", "0.63948613", "0.6370045", "0.63666123...
0.70667225
1
Builds and compiles an GRU model with the provided hyperparameters
def build_gru_model(num_features, embedding_size=None, kernel_size=None, filters=None, pool_size=None, gru_output_size=None): # Embedding if embedding_size is None: embedding_size = 64 # Convolu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compile_gru_model(input_dim=101, output_dim=4563, recur_layers=3, nodes=1000,\n conv_context=11, conv_border_mode='valid', conv_stride=2,\n initialization='glorot_uniform', batch_norm=True, num_gpu=1):\n logger.info(\"Building gru model\")\n # Main acoustic input...
[ "0.73912466", "0.66649204", "0.6635141", "0.6230592", "0.6221744", "0.61874807", "0.61704993", "0.61428016", "0.6135985", "0.61158645", "0.6077031", "0.6056821", "0.60392755", "0.60282505", "0.5926871", "0.5913023", "0.5907081", "0.5886617", "0.58645344", "0.58603835", "0.584...
0.7483657
0
Trains model on provided data.
def train_model(model, x_train, y_train, x_test, y_test, epochs=None, batch_size=None): # Training if batch_size is None: batch_size = 128 if epochs is None: epochs = 20 print('x_train shape:', x_train.shape) print('x_test shape:', x_test.shape) print('Train......
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run(self) -> None:\n self.model = self.trainer.train_model(self.model, self.data)", "def train(self, data):\n pass", "def train_model(self, *args, **kwargs):\n self.model.train(self.training, *args, **kwargs)", "def train(self):\n self.emission_model(self.train_data)\n ...
[ "0.7325476", "0.7171853", "0.71036", "0.7054624", "0.7053082", "0.6950429", "0.69431555", "0.6903937", "0.67463744", "0.67463744", "0.67463744", "0.67463744", "0.67463744", "0.6552785", "0.65009505", "0.6491041", "0.64885336", "0.64885336", "0.648785", "0.64862865", "0.648012...
0.0
-1
Evaluated model on provided testing data
def eval_model(model, x_test, y_test, batch_size=None): if batch_size is None: batch_size = 128 loss, acc = model.evaluate(x_test, y_test, batch_size=batch_size) confusion_matrix_model(model, y_test, x_test) return loss, acc
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def evaluate(self, test_data):\n result = self.model.run(test_data)\n self._save_result(result)", "def testModel( self, classTest, classPred):", "def test_model(predictions: np.array, configs: dict, folder_path: str, test_data_index: pd.Index,\n y_test: np.array,\n stu...
[ "0.77105874", "0.73843247", "0.71052754", "0.7091229", "0.7074009", "0.70619357", "0.70250666", "0.69914263", "0.6987785", "0.6940113", "0.6847204", "0.68219995", "0.682195", "0.6812695", "0.68056965", "0.6804291", "0.6798132", "0.6798132", "0.6798132", "0.6785797", "0.675326...
0.0
-1
Executes CLI conversion based on arguments passed through argparse
def main(): p = argparse.ArgumentParser(description='Convert images into unicode') p.add_argument('image', metavar='<path>', type=str, help='path to the file, use - for stdin') p.add_argument('--no-x256', action='store_false', dest='x256', default=True, help='prints wit...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main(args):\n cli = CLI()\n # Check arguments\n cli.parse_arguments(args)", "def cli(args): # noqa; pylint: disable=unused-argument", "def main(args):\n options = parse_cmd_parameters_(args)\n execute_(options)", "def cli_main():\n\n\n if len(sys.argv) > 1 and sys.argv[1].endswith('.xm...
[ "0.746649", "0.7381625", "0.69064456", "0.68905646", "0.68654567", "0.6787291", "0.6781822", "0.66854477", "0.66840136", "0.66840136", "0.66840136", "0.66840136", "0.66840136", "0.66840136", "0.66840136", "0.66840136", "0.66840136", "0.66840136", "0.66840136", "0.66840136", "...
0.0
-1
Calculate the mean squared error between two images.
def mse(image_a, image_b): # Credit Adrian Rosebrock # https://www.pyimagesearch.com/2014/09/15/python-compare-two-images/ err = np.sum((image_a.astype("float") - image_b.astype("float")) ** 2) err /= float(image_a.shape[0] * image_a.shape[1]) return err
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _mean_squared_error(img1, img2):\n err = np.sum((img1.astype(\"float\") - img2.astype(\"float\")) ** 2)\n err /= float(img1.shape[0] * img1.shape[1])\n return err", "def mse(image1: np.ndarray, image2: np.ndarray) -> np.ndarray:\n return np.sqrt(np.power((image1 - image2), 2).mean(axis=(-1, -2)))...
[ "0.8491732", "0.796332", "0.7908834", "0.7711211", "0.7675966", "0.76289874", "0.75710887", "0.73973286", "0.7323558", "0.7070734", "0.70387596", "0.69253063", "0.6891484", "0.6875303", "0.6873738", "0.68721145", "0.6867625", "0.6805113", "0.6760967", "0.6729491", "0.67219573...
0.722647
9
Convert to numpy array as floats for use in comparisons
def standardize_format(image): if isinstance(image, Image.Image): new_file = BytesIO() image.save(new_file, format='PNG') new_file.seek(0) return imageio.imread(new_file).astype(float) elif isinstance(image, IOBase): return imageio.imread(image).astype(float) elif is...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def solution(array):\n array1 = np.array(array)\n array2 = array1.astype(float)\n return array2", "def make_float(array):\n finial_array = []\n\n for number in array:\n finial_array.append(float(number))\n return finial_array", "def convertToFloatArray(booleanArray: typ...
[ "0.7205452", "0.68435144", "0.66298336", "0.64569485", "0.63817096", "0.6317905", "0.6316836", "0.62721807", "0.626991", "0.62662345", "0.6255745", "0.6253336", "0.6210134", "0.6170176", "0.6134217", "0.61017036", "0.60811114", "0.6020606", "0.6014738", "0.6004565", "0.600233...
0.0
-1
Compare two image files, can be given as Image or File objects. Comparison returns a float which indicates the relative similarity. Lower is more similar.
def compare(image_a, image_b): image_a = standardize_format(image_a) grayscale_image_a = to_grayscale(image_a) image_b = standardize_format(image_b) grayscale_image_b = to_grayscale(image_b) err = mse(grayscale_image_a, grayscale_image_b) return err
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def img_compare(file1, file2):\n # read image\n img1 = Image.open(file1)\n img2 = Image.open(file2)\n\n # resize \n size = 128, 128\n img1_res = img_resize(img1, size)\n img2_res = img_resize(img2, size)\n\n img1_res.save(\"img_1.thumbnail\", \"JPEG\")\n img2_res.save(\"img_2.thumbnail\"...
[ "0.7770484", "0.755781", "0.74901986", "0.7209049", "0.7027238", "0.68469214", "0.6797728", "0.67634106", "0.66868806", "0.66799664", "0.6614814", "0.66090757", "0.66017044", "0.65690494", "0.65652287", "0.65169317", "0.64967906", "0.6491164", "0.64799553", "0.64664555", "0.6...
0.6380499
23
Converts the given image to grayscale and returns the converted image.
def to_grayscale(image): # Credit sastanin (https://stackoverflow.com/a/3935002) if len(image.shape) == 3: return np.average(image, -1) # average the last axis (color channels) else: return image
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_to_gray_scale(img):\r\n #reading image\r\n im = Image.open(\"filename\")\r\n\r\n if im.mode != \"L\":\r\n im = im.convert(\"L\")\r\n\r\n return img", "def rgb2grayscale(image):\r\n\r\n assert image.ndim == 3 and image.shape[2] == 3\r\n\r\n gray_image = np.dot(image, [0.2989, ...
[ "0.8205708", "0.8185807", "0.80551726", "0.8024271", "0.7895879", "0.7893156", "0.78000677", "0.7795188", "0.7791997", "0.7762031", "0.7735562", "0.77146196", "0.77146196", "0.76740164", "0.7670393", "0.76592916", "0.75646484", "0.7518474", "0.7518474", "0.7518474", "0.751847...
0.7996766
4
Create bitmap from given unicode character, return image file object.
def create_unicode_image(unicode_character): # Check the cache if unicode_character in unicode_cache.keys(): return unicode_cache[unicode_character] # Initialize canvas and font parameters # Credit: JackNova (until URL) width = 10 height = 20 background_color=(0,0,0) font_size=2...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fromascii(self, *args, **kwargs):\n return _image.image_fromascii(self, *args, **kwargs)", "def get_tile_bitmap(self, char):\n if char == '#':\n return self.tiles[0:32, 0:32, :]\n elif char == 'b':\n return self.tiles[0:32, 128:160, :]\n elif char == 'd':\n ...
[ "0.5853663", "0.58179283", "0.56746536", "0.5479672", "0.5382288", "0.53489006", "0.53442067", "0.53410566", "0.53409886", "0.52899945", "0.52466315", "0.52246463", "0.5191945", "0.5159506", "0.5151667", "0.5137356", "0.51334125", "0.5129038", "0.5070787", "0.50635946", "0.50...
0.777532
0
Ingest a file and slice it into 10x20 bitmaps which are compared with bitmaps of unicode charcters. The most similar character is printed with x256 color which is most like the average color for the 10x20 bitmap slice.
def print_image_as_unicode(image_file, **kwargs): char_set = kwargs['char_set'] x256_mode = kwargs['x256'] height = 20 # height of unicode character width = 10 # width of the unicode characters we are using # Credit ElTero and ABM (https://stackoverflow.com/a/7051075) if image_file == '-': ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, file_path=\"data/\", batch_size=1, img_size=[128, 2048], max_text_len=256):\r\n\r\n # filePath needs to be a folder\r\n assert file_path[-1]=='/'\r\n\r\n self.current_index = 0\r\n self.batch_size = batch_size\r\n self.img_size = img_size\r\n self.sample...
[ "0.5643496", "0.5535181", "0.5525569", "0.54742545", "0.5472219", "0.5442176", "0.53953683", "0.5384109", "0.5324327", "0.53202426", "0.528826", "0.5234474", "0.5232815", "0.5206607", "0.52048206", "0.5201688", "0.5193406", "0.51914054", "0.51873463", "0.5156003", "0.51466596...
0.57994384
0
Returns df with dtype set for structure without any column filter.
def meta_df(self): return NotImplemented
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_df_all_types():\n return pd.DataFrame({\n 'intcol': [1, 2],\n 'strcol': ['three', 'four'],\n 'floatcol': [5.0, 6.0],\n 'boolcol': [True, False],\n 'datetimecol': [\n np.datetime64('2020-01-01'), np.datetime64('2020-01-02')],\n })", "def set_dtypes(df):...
[ "0.6611793", "0.6518844", "0.6439829", "0.620935", "0.61962974", "0.6109263", "0.5990738", "0.5988264", "0.59865373", "0.5986267", "0.5910748", "0.5909542", "0.5873334", "0.58664733", "0.5857477", "0.58217114", "0.5814661", "0.5797066", "0.57949156", "0.57742786", "0.5751437"...
0.0
-1
Fetch molecular properties from database/cache into a dask array.
def fetch_molecular_embedding(self, n_molecules: int, cache_directory: str = None): return NotImplemented
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_dask(self):\n self._load_metadata()\n return self._ds", "def to_dask(self):\n self._load_metadata()\n return self._ds", "def getData(self, local_cache):", "def get_dataset():\n\n return db.store.all()", "def read_DB(self):\n mgdb = mongodata.db\n client =...
[ "0.5862701", "0.5862701", "0.5703025", "0.54499245", "0.54294366", "0.5384057", "0.5363727", "0.53618395", "0.5356752", "0.5353922", "0.53477436", "0.53364336", "0.52967966", "0.523297", "0.5213357", "0.5203905", "0.5146133", "0.5135311", "0.5124653", "0.51239353", "0.5103742...
0.0
-1
Fetch molecular properties from database for the given id. Id depends on the backend databse. For chemble DB it should be molregid.
def fetch_molecular_embedding_by_id(self, molecule_id: List): return NotImplemented
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read(id):\n db = core.connect()\n return db[id]", "def get(id):\n\n result = {}\n status = 404\n print id\n # nodes=Property.query.all()\n obj = Property.query.filter_by(id=id).filter(Property.users.contains(current_user)).first()\n if obj:\n result['prop'] = obj\n statu...
[ "0.6137392", "0.6040892", "0.5930535", "0.58252835", "0.58252835", "0.5805151", "0.5775725", "0.5751588", "0.57094043", "0.56897104", "0.5672773", "0.56270885", "0.55932415", "0.55593854", "0.55126894", "0.5511353", "0.54916537", "0.5467944", "0.54224604", "0.54109854", "0.54...
0.5316095
26
Fetch molecular details for a list of molecules. The values in the list of molecules depends on database/service used. For e.g. it could be ChemblId or molreg_id for Chemble database.
def fetch_id_from_smile(self, new_molecules: List): return NotImplemented
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getMoleculeData(self, moleculeChEMBLIdList):\n oD = {}\n chunkSize = 50\n try:\n for ii in range(0, len(moleculeChEMBLIdList), chunkSize):\n drug = new_client.molecule # pylint: disable=no-member\n drug.set_format(\"json\")\n mDL = d...
[ "0.68206555", "0.60511196", "0.5856835", "0.58565825", "0.5701199", "0.56697226", "0.5620971", "0.5596572", "0.5584915", "0.55798215", "0.54545426", "0.5418826", "0.53591985", "0.5348931", "0.53488845", "0.5341942", "0.5338322", "0.530197", "0.5297963", "0.5284677", "0.527967...
0.5368393
12
Fetch molecular details for a list of molecules. The values in the list of molecules depends on database/service used. For e.g. it could be ChemblId or molreg_id for Chemble database.
def fetch_id_from_chembl(self, id: List): return NotImplemented
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getMoleculeData(self, moleculeChEMBLIdList):\n oD = {}\n chunkSize = 50\n try:\n for ii in range(0, len(moleculeChEMBLIdList), chunkSize):\n drug = new_client.molecule # pylint: disable=no-member\n drug.set_format(\"json\")\n mDL = d...
[ "0.68211865", "0.6050688", "0.58566874", "0.58560246", "0.570075", "0.56694674", "0.56206733", "0.5596092", "0.55844384", "0.5577729", "0.5454434", "0.5418259", "0.5366659", "0.53580934", "0.5348218", "0.53474617", "0.5341979", "0.5338593", "0.5302504", "0.5297541", "0.528347...
0.0
-1
Fit the model using x_train as training data and y_train as target values
def fit(self, x_train: np.ndarray, y_train: np.ndarray) -> None: # Stores training data and targets for use in derived classes self.x_train = x_train self.y_train = y_train
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fit(self, X, y):\n self.X_train = X\n self.y_train = y", "def train(self, X_train, y_train):\n self.model.fit(X_train, y_train)", "def train(self, X, y):\n self.model.fit(X, y)", "def fit_training_data(self):\n self.model.fit(self.X_train)", "def fit(self, X_train, y_...
[ "0.808191", "0.7904677", "0.7882587", "0.78722423", "0.78268933", "0.7770836", "0.7697726", "0.7596521", "0.7596521", "0.7596521", "0.75560147", "0.7509245", "0.74777925", "0.74643713", "0.7451252", "0.7425392", "0.7420984", "0.74162674", "0.74025804", "0.7401003", "0.7377242...
0.73412484
31
Filter a `items` list according to a list of `queries`. Values from `items` are kept if they match at least one query. The original `items` list is untouched but the result list uses the same data (not a deep copy). If `attribute` is None, it is assumed that `items` is a list of strings to be filtered directly. If `att...
def stringfilter(items, queries, attribute=None): result = [] if attribute is not None: key_path = attribute.split('.') else: key_path = None for item in items: if key_path is not None: string = _get_nested_value(item, key_path) if not isinstance(string, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def itemFilterAttr(*args, byName: Union[AnyStr, bool]=\"\", byNameString: Union[AnyStr,\n List[AnyStr], bool]=\"\", byScript: Union[AnyStr, bool]=\"\", classification:\n Union[AnyStr, bool]=\"\", dynamic: bool=True, exists: bool=True, hasCurve:\n bool=True, has...
[ "0.57204485", "0.5617756", "0.548573", "0.54075944", "0.5388926", "0.52190524", "0.5199355", "0.5139567", "0.50037485", "0.48549065", "0.4841358", "0.47993222", "0.47757334", "0.47549915", "0.47255918", "0.47191286", "0.47072586", "0.4689648", "0.46839404", "0.46671137", "0.4...
0.68550235
0
Get value under `key_path` key in `dct` dictionary. `key_path` is a list of keys to be traversed into a potentially nested `dct` dictionary.
def _get_nested_value(dct, key_path): key = key_path[0] if not isinstance(dct, dict): raise errors.AnsibleFilterError( f"stringfilter: looking for key '{key}' " f"but list item is not dict: {pformat(dct)}" ) if key not in dct: raise errors.AnsibleFilterError( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_by_path(data: Dict[str, T], path: Sequence[str]) -> T:\n return reduce(operator.getitem, path, data)", "def _get_by_path(dic, keys):\n assert len(keys) > 0, \"Path key can not be an empty list.\"\n\n d = dic\n for key in keys[:-1]:\n if isinstance(key, int) or key in d:\n d ...
[ "0.6952644", "0.68554395", "0.6719718", "0.64265496", "0.64265496", "0.6403472", "0.63947314", "0.63453716", "0.6322947", "0.6304281", "0.6285504", "0.62721723", "0.6161064", "0.61594445", "0.6127265", "0.61137265", "0.60990524", "0.60921264", "0.6087193", "0.6030112", "0.602...
0.7896383
0
Perform the 2D discrete Fourier transform and extend the data with padding.
def fft_pad_data(data, mode='edge'): n_points=int(2**(np.ceil(np.log(np.max(data.shape))/np.log(2)))) nx, ny = data.shape padx = int((n_points - nx)/2) pady = int((n_points - ny)/2) padded_data = np.pad(data, ((padx, padx), (pady, pady)),mode) mask = np.zeros_like(padded_data,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fourier_transform2d(self):\n\n zerofill = np.zeros(1024 * np.array([1,1])) #so it will always be square\n zerofill[:len(self.windowed), :len(self.windowed)] = self.windowed\n transform = np.fft.fft2(zerofill)\n transform = np.fft.fftshift(transform) # shift center to...
[ "0.65467256", "0.6410407", "0.6086163", "0.59369767", "0.5931539", "0.5929195", "0.5889854", "0.5879024", "0.58667964", "0.58256716", "0.5793475", "0.57264745", "0.5614827", "0.5607132", "0.5590157", "0.5572319", "0.55702704", "0.5560839", "0.5545364", "0.55280906", "0.550855...
0.5950112
3
Designs a lowpass 2D Butterworth filter. Modified from Peirce JW (2009) Generating stimuli for neuroscience using
def butter2d_lp(shape, f, n): rows, cols = shape x = np.linspace(-0.5, 0.5, cols) y = np.linspace(-0.5, 0.5, rows) radius = np.sqrt((x**2)[np.newaxis] + (y**2)[:, np.newaxis]) filt = 1 / (1.0 + (radius / f)**(2*n)) return (filt)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_butterworth_low_pass_filter(shape, cutoff, order):\n \n \n print(\"butterworth_low_pass_filter = \")\n print(\"cutoff: \",cutoff)\n print(\"order: \",order)\n filter = np.zeros(shape)\n for i in range(shape[0]):\n for j in range(shape[1]):\n D = np.sqrt((i - (shape[0]...
[ "0.67872274", "0.66857934", "0.64890873", "0.6436643", "0.63463753", "0.6341585", "0.63169885", "0.63033724", "0.6281029", "0.6272661", "0.62672955", "0.62393", "0.62285304", "0.61405635", "0.6119317", "0.6114302", "0.6098206", "0.6097736", "0.6076158", "0.6067853", "0.604568...
0.6352877
4
Plot the data in DWT domain
def plot_wav(decomp): plt.figure(figsize=(10,10)) gs = GridSpec(4, 4) ax = plt.subplot(gs[0, 0]) plt.imshow(decomp[0]) plt.xticks([]) plt.yticks([]) ax = plt.subplot(gs[1,0]) plt.imshow(decomp[1][0]) plt.xticks([]) plt.yticks([]) ax = plt.subplot(gs[0, 1])...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_data(self):", "def dplot(self):\n\n try:\n import matplotlib.pyplot as plt\n except ImportError:\n from sys import stderr\n print(\"ERROR: matplotlib.pyplot not found, matplotlib must be installed to use this function\", file=stderr)\n raise\n\n ...
[ "0.7187857", "0.6936303", "0.66426486", "0.65928483", "0.6591709", "0.64936006", "0.64238495", "0.63904613", "0.63418317", "0.63384956", "0.630438", "0.6246254", "0.62004626", "0.6199328", "0.618154", "0.61802506", "0.6109246", "0.6105832", "0.61016023", "0.6097523", "0.60812...
0.0
-1
The constructor takes a coarse timestepper and an order of approximation
def __init__(self,diff,boxtimestepper,gaptoothStep,maxDeriv): self.boxts=boxtimestepper self.delta_t=gaptoothStep macro.fd.fd_estimator.FDEstimator.__init__(self,diff,maxDeriv)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self,\n time_step: float,\n acceleration: Callable[[float], float],\n initial_value: float = 0.0,\n initial_velocity: float = 0.0,\n num_steps: int = 50,\n collected_data: Iterable[Dict[str, float]] = [],\n...
[ "0.5920452", "0.57915515", "0.5682523", "0.5663074", "0.56580824", "0.5614911", "0.555747", "0.552551", "0.5491382", "0.5489133", "0.5476062", "0.54720134", "0.546864", "0.54354644", "0.54314643", "0.54314643", "0.53980315", "0.53959155", "0.53954285", "0.5391545", "0.5379088...
0.5623274
5
Tests whether the trace for step methods is exactly the same as on master. Code changes that effect how random numbers are drawn may change this, and require `master_samples` to be updated, but such changes should be noted and justified in the commit. This method may also be used to benchmark step methods across commit...
def check_trace(self, step_method): n_steps = 100 with Model(): x = Normal('x', mu=0, sd=1) if step_method.__name__ == 'SMC': Deterministic('like', - 0.5 * tt.log(2 * np.pi) - 0.5 * x.T.dot(x)) trace = smc.ATMIP_sample(n_steps=n_steps, step=step_me...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def TestOneStep(self):\n pass", "def test_changes(monkeypatch, local):\n monkeypatch.setenv('LANG', 'en_US.UTF-8')\n monkeypatch.setenv('TRAVIS_BUILD_ID', '12345')\n monkeypatch.setenv('TRAVIS_BRANCH', 'master')\n old_sha = pytest.run(local, ['git', 'rev-parse', 'HEAD']).strip()\n local.ens...
[ "0.5406668", "0.5375", "0.53389776", "0.5314626", "0.52967477", "0.5258354", "0.52216065", "0.52073497", "0.51792115", "0.51779264", "0.51701105", "0.5160602", "0.5152976", "0.51241815", "0.50939167", "0.50733656", "0.50511485", "0.5043404", "0.50413126", "0.50389934", "0.503...
0.549506
0
Test that samplers correctly create nonblocked compound steps.
def test_non_blocked(self): _, model = simple_2model() with model: for sampler in self.samplers: assert isinstance(sampler(blocked=False), CompoundStep)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_block_extra_batch(self):\n pass", "def test_block_bad_batch(self):\n pass", "def test_validation_correct_samplers():\n samplers = [\n {'type': 'MultiStateSampler', 'locality': 3},\n {'type': 'ReplicaExchangeSampler'},\n # MCMCMove 'single' is defined in get_templa...
[ "0.66656935", "0.6592942", "0.64613193", "0.64177775", "0.6116642", "0.6095393", "0.6079921", "0.6000796", "0.5993817", "0.59393144", "0.5934992", "0.57287186", "0.5716562", "0.57142526", "0.57003576", "0.56979024", "0.5697373", "0.5691124", "0.567336", "0.5657544", "0.565397...
0.79553413
0
Test bernoulli distribution is assigned binary gibbs metropolis method
def test_bernoulli(self): with Model() as model: Bernoulli('x', 0.5) steps = assign_step_methods(model, []) assert isinstance(steps, BinaryGibbsMetropolis)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bernoulli(p):\n bern = rn.binomial(1,p)\n return bern", "def bernoulli(p):\r\n if np.random.random() < p:\r\n return 0\r\n else:\r\n return 1", "def bernoulli_num(n):\n return mp.bernoulli(n)", "def bernoulli(n):\n\n x, res, s, c = Rat(0), Rat(0), Rat(0), Rat(-1)\n for ...
[ "0.7547345", "0.7430234", "0.737914", "0.7260277", "0.7170436", "0.70253694", "0.6839243", "0.67702055", "0.653989", "0.6529904", "0.6523155", "0.64852256", "0.648092", "0.6472643", "0.6457794", "0.64568967", "0.64539707", "0.6446213", "0.63996285", "0.63980657", "0.6349709",...
0.77244
0
Test normal distribution is assigned NUTS method
def test_normal(self): with Model() as model: Normal('x', 0, 1) steps = assign_step_methods(model, []) assert isinstance(steps, NUTS)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_2_normal(self):\n print(\"test 2: normal distributions\")\n\n mean = self.means[0]\n dispersion = self.dispersions[0]\n\n for i, x in enumerate(self.X):\n print(i+1, normal(x, mean, dispersion), sep=' : ')", "def test_normdistcreation():\n test_array = np.vstack...
[ "0.7466253", "0.69424164", "0.67911315", "0.6775584", "0.67698973", "0.6682361", "0.65429854", "0.6531256", "0.649198", "0.6416713", "0.640294", "0.6401808", "0.6341993", "0.63400614", "0.6283304", "0.6281596", "0.6272235", "0.6225952", "0.6208192", "0.6189331", "0.61540663",...
0.67004794
5
Test categorical distribution is assigned categorical gibbs metropolis method
def test_categorical(self): with Model() as model: Categorical('x', np.array([0.25, 0.75])) steps = assign_step_methods(model, []) assert isinstance(steps, BinaryGibbsMetropolis) with Model() as model: Categorical('y', np.array([0.25, 0.70, 0.05])) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_Bernoulli_NB_estimators():", "def gibbs_sample(self):\n # Initialize the initial state of Markov Chain.\n self.initialize()\n # Gibbs Sampling.\n for iteration_index in range(0, self.iteration_number, 1):\n for m in range(0,self.document_number,1):\n ...
[ "0.6492466", "0.6474214", "0.642306", "0.62708336", "0.6208008", "0.618504", "0.61007977", "0.59815496", "0.59573436", "0.59539115", "0.59391415", "0.5922018", "0.59049296", "0.58518004", "0.58390254", "0.5831838", "0.58220774", "0.5815369", "0.5810455", "0.5798642", "0.57903...
0.6250971
4
Test binomial distribution is assigned metropolis method.
def test_binomial(self): with Model() as model: Binomial('x', 10, 0.5) steps = assign_step_methods(model, []) assert isinstance(steps, Metropolis)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_bernoulli(self):\n with Model() as model:\n Bernoulli('x', 0.5)\n steps = assign_step_methods(model, [])\n assert isinstance(steps, BinaryGibbsMetropolis)", "def test_multinomial(self):\r\n # Check over two calls to see if the random state is correctly updated....
[ "0.69088066", "0.6723618", "0.66573316", "0.6643335", "0.6618572", "0.6482851", "0.6428169", "0.6424013", "0.6345978", "0.62615824", "0.6225464", "0.61995316", "0.61335987", "0.6075258", "0.60746217", "0.6054197", "0.6051179", "0.60234743", "0.60210484", "0.60168356", "0.5997...
0.76352745
0
Ensure that, for the given service, the video_id is valid.
def clean_video_id(self): failed = False d = self.cleaned_data service = d.get('service') # Get the video id and clear whitespace on either side. video_id = d.get('video_id', '').strip() # Validate using YouTube's API: if service == 'youtube': url = (...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allow_video(self, video_id):\n print(\"allow_video needs implementation\")", "def allow_video(self, video_id):\n print(\"allow_video needs implementation\")", "def allow_video(self, video_id):\n print(\"allow_video needs implementation\")", "def allow_video(self, video_id):\n ...
[ "0.60907304", "0.60907304", "0.60907304", "0.60907304", "0.6068158", "0.5851678", "0.57884514", "0.56182677", "0.5566757", "0.55377215", "0.5534833", "0.5517205", "0.5513362", "0.5502711", "0.5484015", "0.54670113", "0.54354274", "0.54342276", "0.53538764", "0.53443223", "0.5...
0.7674897
0
Computes coverage rate for `y_pred`.
def coverage(y_true, y_pred): m = tf.shape(y_pred)[1] - tf.constant(1, dtype=tf.int32) n_samples = tf.cast(tf.shape(y_pred)[0], tf.float32) n_abstain = tf.reduce_sum( tf.where(tf.argmax(y_pred, axis=1, output_type=tf.int32) == m, 1.0, 0.0) ) return tf.constant(1.0) - n_abstain / n_samples
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hit_rate(y_true, y_pred, spu=None):\n mask = y_pred.astype(bool)\n y_true_in_pred = y_true[mask]\n return y_true_in_pred.sum()/y_true.sum()", "def recall_score(y_true, y_pred):\n return ((y_true == 1) * (y_pred == 1)).sum() / (y_true == 1).sum()", "def ari(y_pred, y_true):\n return metrics.a...
[ "0.71039015", "0.70715314", "0.6947408", "0.6926472", "0.68919915", "0.6836527", "0.6757787", "0.6753589", "0.67308986", "0.67180943", "0.66951615", "0.66951615", "0.66951615", "0.66951615", "0.66951615", "0.66951615", "0.66951615", "0.66951615", "0.66951615", "0.66951615", "...
0.75946474
0
Get a User based on email address.
def show(self, email): return User.query.filter_by(email=email).first()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user(email):\r\n return User.objects.get(email=email)", "def get_user_by_email(email):\n\n return User.query.filter(User.email == email).first()", "def get_user_by_email(email):\n\n return User.query.filter(User.email == email).first()", "def get_by_email(self, email):\n user = (\n ...
[ "0.85743433", "0.8544356", "0.8544356", "0.84845865", "0.8470432", "0.8443715", "0.8424075", "0.83887917", "0.8271503", "0.8270463", "0.8237727", "0.82315016", "0.81901556", "0.8184349", "0.81050164", "0.80862194", "0.8068554", "0.8065875", "0.80543447", "0.8032841", "0.80034...
0.73686725
36
Get Product based on name.
def show(self, title): return Product.query.filter_by(title=title).first()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_product(cls, product_id):\n return Product.query.get(product_id)", "def get_products_by_name(name: str = '') -> List[Product]:\n products = []\n for p in get_market().products.values():\n if not name or p.name == name:\n products.append(p)\n return products", "def sear...
[ "0.7238149", "0.7212795", "0.72054875", "0.71924907", "0.71586484", "0.7007384", "0.6974032", "0.68805", "0.6826333", "0.68231606", "0.67831254", "0.6731516", "0.66950774", "0.66819346", "0.66207284", "0.6595219", "0.65523624", "0.65501523", "0.6533631", "0.65288424", "0.6504...
0.5911903
74
View products in Cart.
def index(self, user): cart_products = CartProduct.index(user) CartProductsView.index(cart_products)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def products(request):\n\n if not request.user.is_superuser:\n messages.error(request, 'Sorry, only store owners can do that.')\n return redirect(reverse('home'))\n\n products = Product.objects.all()\n template = \"auctionsmng/products.html\"\n\n context = {\n 'products': products\...
[ "0.7544936", "0.74219257", "0.72852266", "0.7261602", "0.72421676", "0.7014876", "0.70145303", "0.70145303", "0.7007686", "0.6988518", "0.6979214", "0.6970391", "0.69648755", "0.69648755", "0.69648755", "0.69543886", "0.69423074", "0.6799814", "0.6670603", "0.6653604", "0.658...
0.77032435
0
Add Product to Cart.
def create(self, user, product, quantity): cart_product = CartProduct.create(user, product, quantity) CartProductsView.create(cart_product)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add(self, product, product_qty):\n product_id = str(product.id)\n if product_id in self.cart:\n self.cart[product_id][\"qty\"] = product_qty\n else:\n self.cart[product_id] = {'price': str(product.price), 'qty':int(product_qty)}\n self.save()", "def cart_add(...
[ "0.8279945", "0.8130827", "0.8084389", "0.80390966", "0.7810375", "0.7795158", "0.77597386", "0.7748757", "0.7740242", "0.7729689", "0.76999176", "0.766027", "0.7653296", "0.7621587", "0.7587989", "0.7569859", "0.74912816", "0.7433777", "0.7431253", "0.7365529", "0.7344932", ...
0.7053575
29
Delete Product from Cart.
def delete(self, user, product): cart_product = CartProduct.delete(user, product) CartProductsView.delete(cart_product)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete(self, product):\n product_id = str(product)\n if product_id in self.cart:\n del self.cart[product_id]\n self.save()", "def cart_remove(request, product_id):\n cart = Cart(request)\n product = get_object_or_404(Product, id=product_id)\n cart.remove(product)\n ...
[ "0.8534601", "0.8041614", "0.79457", "0.770682", "0.7690166", "0.7668008", "0.76628315", "0.7649517", "0.7617706", "0.7565354", "0.75316346", "0.7501226", "0.7420002", "0.73552704", "0.7347085", "0.7338678", "0.73137146", "0.7273116", "0.7239314", "0.7206781", "0.7196743", ...
0.81086886
1
Update product quantity in cart.
def update(self, user, product, quantity): cart_product = CartProduct.update(user, product, quantity) CartProductsView.update(cart_product)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self, product, qty):\n product_id = str(product)\n if product_id in self.cart:\n self.cart[product_id]['qty'] = qty\n self.save()", "def update(self, product, qty):\n product_id = str(product)\n if product_id in self.basket:\n self.basket[produc...
[ "0.827262", "0.79062", "0.75526017", "0.7427123", "0.7330307", "0.7124662", "0.7097358", "0.7005649", "0.6911449", "0.6864803", "0.6850595", "0.67024165", "0.66930753", "0.6677734", "0.66433424", "0.66109204", "0.65673107", "0.65499806", "0.65499806", "0.65499806", "0.6549980...
0.78177625
2
Get completed orders for a user.
def show_completed(self, user): orders = CartProduct.show_completed(user) CartProductsView.show_completed(orders)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_one_user_orders(self,user_id):\n\n sql = \"SELECT * FROM parcel_orders WHERE user_id='{}'\".format(user_id)\n self.db_object.cursor.execute(sql)\n placed_orders = self.db_object.cursor.fetchall()\n return placed_orders", "def get_completed_user_requests(self):\n user_re...
[ "0.6891886", "0.6568276", "0.64125514", "0.6124557", "0.57911223", "0.56917673", "0.5654518", "0.5521901", "0.5508465", "0.5492167", "0.5467327", "0.54548985", "0.5445846", "0.5410721", "0.5397107", "0.539336", "0.53909403", "0.53864336", "0.5384064", "0.53825545", "0.5372619...
0.6389238
3
Yield the classes in module ``mod`` that inherit from ``cls``
def get_subclasses(mod, cls): for name, obj in inspect.getmembers(mod): if hasattr(obj, "__bases__") and cls in obj.__bases__: yield obj
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _classes_(cls):\n for base_cls in cls.__bases__:\n # Avoid infinite loop\n if base_cls == Sandbox:\n continue\n\n yield base_cls", "def _classesToCheck(self, cls):\r\n yield cls\r\n yield from inspect.getmro(cls)", "def get_all_classes_de...
[ "0.7661169", "0.75540936", "0.74157786", "0.74068946", "0.71664065", "0.7122239", "0.70386964", "0.68738073", "0.6851402", "0.6728931", "0.66658", "0.66300493", "0.6608214", "0.65761477", "0.65552634", "0.65492725", "0.65423816", "0.65163565", "0.647793", "0.64746547", "0.644...
0.80770713
0
Define the class balanced cross entropy loss to train the network
def class_balanced_cross_entropy_loss(output, label, size_average=True, batch_average=True, void_pixels=None): assert(output.size() == label.size()) labels = torch.ge(label, 0.5).float() num_labels_pos = torch.sum(labels) num_labels_neg = torch.sum(1.0 - labels) num_total = num_labels_pos + num...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup_loss(self):\n self.loss = nn.CrossEntropyLoss(weight = self.to_device(self.datasetManager.class_weights))\n #self.loss = nn.CrossEntropyLoss()", "def cross_entropy_loss():\n return nn.CrossEntropyLoss()", "def _classification_loss(self, logits, labels, num_classes):\n labels = tf....
[ "0.7614162", "0.72006047", "0.7150641", "0.71390414", "0.70425236", "0.69947386", "0.6988147", "0.69880617", "0.69836", "0.6958063", "0.69394386", "0.69217324", "0.6917078", "0.69161534", "0.69120765", "0.69120765", "0.6910133", "0.6886472", "0.67843294", "0.67344993", "0.671...
0.61960006
96
A main function to run the simulation
def Main(): numberOfPopulation = 350 numberOfDays = 60 simulation = Simulation(Covid19(), numberOfPopulation, numberOfDays, "Covid 19 Simulation") simulation.run() simulation = Simulation(Ebola(), numberOfPopulation, numberOfDays, "Ebola Simulation") simulation.run()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Main():\n EnigmaSim = simulation() #Creates the simulation object\n EnigmaSim.Run() #Runs the simulation", "def main():\n run_simulation(spectral=False, ml=False, num_procs=1)\n run_simulation(spectral=True, ml=False, num_procs=1)\n run_simulation(spectral=False, ml=True, num_procs=1)\n run...
[ "0.82430094", "0.80094373", "0.770448", "0.7694861", "0.7663943", "0.7658844", "0.7653654", "0.76189035", "0.76126456", "0.74813896", "0.74432015", "0.73796666", "0.73725206", "0.7330815", "0.7320483", "0.73116446", "0.72484505", "0.7242806", "0.7231775", "0.7191046", "0.7118...
0.8399111
0
runs the network to get the reading of the nodes
def update_all_readings(self): # update the reading of all nodes for node_name in self.nodes: # update the readings of all nodes self.nodes[node_name].reading() # once all nodes have updated, they can be stabilized for node_name in self.nodes: self...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run(self):\n\t\tself._run_neural_network()\n\t\tself._run_webots()\n\n\t\t# We first wait for webots inputs\n\t\twebotsTurn = True\n\t\tneuralNetworkTurn = False\n\t\twhile True:\n\t\t\tif webotsTurn:\n\t\t\t\tprint \"reading data from webots:\"\n\t\t\t\twbtData = self._wbt_read_data()\n\t\t\t\tprint \"sending...
[ "0.67898077", "0.63943046", "0.6293423", "0.6178959", "0.61693454", "0.6072311", "0.60665065", "0.59855515", "0.5962578", "0.592378", "0.592378", "0.5919859", "0.59175384", "0.58729637", "0.58661026", "0.58609766", "0.5849859", "0.58277494", "0.5815831", "0.5813402", "0.58080...
0.5388483
76
Uses the readings from all nodes to report the mean and standard deviation of all nodes
def get_network_reading(self): # update the readings for all nodes self.update_all_readings() # get the current readings from all nodes node_readings = [] for node_name in self.nodes: node_readings.append(self.nodes[node_name].stable_reading) node_readings...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_training_stats():\n means, stds = [], []\n data = SUNRGBDTrainDataset(True)\n for i in range(len(data)):\n print(i)\n img, _ = data[i]\n std, mean = t.std_mean(input=img, dim=(1, 2))\n means.append(mean)\n stds.append(std)\n means = t.sum(t.vstack(means), ...
[ "0.6639394", "0.6492293", "0.6476488", "0.6289496", "0.6249173", "0.61678153", "0.61512434", "0.6148738", "0.61152846", "0.6097314", "0.60312355", "0.60029006", "0.5964977", "0.5934712", "0.5916757", "0.59007215", "0.5894467", "0.58875763", "0.5869987", "0.58500725", "0.58438...
0.6637554
1
Generator that returns the names of all nodes in the network
def node_names(self): for node_name in self.nodes.keys(): yield node_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def all_nodes_as_iterable(self, include_metadata: bool = False) -> Generator:\n if include_metadata:\n return [\n (self._names.get_name(i), self._meta.get_node(self._names.get_name(i)))\n for i in self._nk_graph.iterNodes()\n ]\n return [self._names...
[ "0.72962666", "0.71726984", "0.7021836", "0.6995421", "0.6957169", "0.68337035", "0.67822737", "0.6635629", "0.66200304", "0.6613424", "0.66128385", "0.6590175", "0.6584443", "0.6574914", "0.6530787", "0.6516793", "0.6490995", "0.64839625", "0.6473152", "0.6454208", "0.642815...
0.80899006
0
gets average position of all nodes in the network
def get_network_average_position(self): # the total number of nodes in the network num_nodes = self.total_nodes() # get the location of all nodes all_nodes = np.empty((num_nodes, R_space)) for index, item in enumerate(self.nodes.values()): all_nodes[index] = item.ge...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mean_average_position():\n pass", "def streets_per_node_avg(G):\n spn_vals = streets_per_node(G).values()\n return sum(spn_vals) / len(G.nodes)", "def average_distance(self):\r\n total = 0\r\n edges = 0\r\n for code, _list in self.edges.items():\r\n for edge in _lis...
[ "0.71411693", "0.6822021", "0.6471728", "0.6465491", "0.63243866", "0.6256085", "0.62065727", "0.592237", "0.58896816", "0.5823813", "0.5820218", "0.57679445", "0.5765885", "0.57562655", "0.57562655", "0.57562655", "0.57562655", "0.57562655", "0.57481986", "0.5742098", "0.573...
0.84714663
0
Makes an undirected graph from the nodes and their neighbors
def make_graph(self): # update the neighbors in the graph self.update_neighbors() # Go through each node and get their neighbors self.edges = [] for node_name in self.nodes: # get the neighbors node_neighbors = self.nodes[node_name].neighbors ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_undirected_graph(self):\n visited = set() \n G = Graph.Graph()\n \n for node in self.node_set:\n \n if node not in visited:\n visited.add(node)\n for i in self.suffix[node]:\n G.add_edge(node, i)\n ...
[ "0.75638914", "0.7205912", "0.71880054", "0.7131666", "0.71072274", "0.6858183", "0.6852115", "0.68332267", "0.6815476", "0.6774215", "0.67656296", "0.6728196", "0.67220825", "0.6714339", "0.6708744", "0.6696275", "0.66795415", "0.667814", "0.6614417", "0.65941584", "0.657723...
0.6932689
5
checks to make sure that the network is connected
def check_connected(self, update=True): # update if needed if update: self.update_neighbors() # go through each node checking that each degree id greater than 0 for node in self.nodes: # only one node needs to be disconnected to fail if len(self.nod...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isConnected():", "def status_check(self):\n try:\n client = self.connect()\n client.sys.is_initialized() # make an actual network connection\n return True\n except:\n return False", "def __CheckConnectStatus(self):\r\n if not self.tn:\r\n ...
[ "0.81566215", "0.79727143", "0.7940008", "0.78969526", "0.7855953", "0.77820456", "0.7739617", "0.7734968", "0.76910055", "0.7622621", "0.76209754", "0.7618871", "0.75643706", "0.75183284", "0.75183284", "0.7486937", "0.74535733", "0.7438523", "0.74041045", "0.74012107", "0.7...
0.0
-1
get the nodes with the lowest and highest number of neighbors
def get_interest_nodes(self): # go through each node in the network to find the min and max degrees max_value = 0 min_value = len(self.nodes) for name in self.nodes: # check for new max if self.nodes[name].get_degree() >= max_value: max_value = s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_neighbours(self):\n return []", "def neighbours(self):\n return [x.node for x in self.edges]", "def neighbors((min_i, min_j), (max_i, max_j), (i, j)):\n if j + 1 <= max_j:\n yield (i, j + 1)\n if j - 1 >= min_j:\n yield (i, j - 1)\n if i + 1 <= max_i:\n y...
[ "0.7004768", "0.6752797", "0.67516655", "0.6725832", "0.6695274", "0.66674364", "0.66209084", "0.65983164", "0.6586327", "0.6554205", "0.6553236", "0.6543602", "0.6524486", "0.64795715", "0.64779377", "0.6466439", "0.6460438", "0.6440627", "0.6440627", "0.6440627", "0.6440627...
0.6979103
1
Implement the linear part of a layer's forward propagation.
def linear_forward(A, W, b): ### START CODE HERE ### (≈ 1 line of code) Z = np.dot( W, A ) + b ### END CODE HERE ### assert(Z.shape == (W.shape[0], A.shape[1])) cache = (A, W, b) return Z, cache
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def forward(cls, linear_out):\n raise Exception(\"Unimplemented\")", "def linear_activation_forward(A_prev, W, b, activation):\n pass", "def forward(self, x: torch.Tensor):\n x = self.linear1(x)\n x = torch.relu(x)\n x = self.linear2(x)\n x = self.dropout(x)\n retur...
[ "0.7179928", "0.7058336", "0.70316356", "0.7029865", "0.70107585", "0.69642836", "0.6961805", "0.69575894", "0.69349027", "0.6863985", "0.6854632", "0.6827189", "0.68195087", "0.67894167", "0.6750277", "0.6749512", "0.67359066", "0.6712237", "0.67030334", "0.67017424", "0.669...
0.6471803
56
Implement the cost function defined by equation (7).
def compute_cost(AL, Y): m = Y.shape[1] # Compute loss from aL and y. ### START CODE HERE ### (≈ 1 lines of code) cost = - ( np.sum( np.multiply( Y, np.log(AL)) + np.multiply( (1 - Y), np.log(1 - AL))))/Y.shape[1] ### END CODE HERE ### cost = np.squeeze(cost) # To make sure your ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def costFun(self, S, x):", "def cost(self) -> float:", "def compute_cost(AL, Y):\n pass", "def compute_cost(AL, Y):\n pass", "def calcCostFun(self):\n\n self.start()\n F, K = self.model()\n \n return self.costFunction", "def eval_cost(self, params, **kwargs):\n ...
[ "0.73584634", "0.73044", "0.72563547", "0.71911925", "0.7163819", "0.70149416", "0.6912114", "0.6843692", "0.67893624", "0.6733327", "0.6731844", "0.6674887", "0.6673156", "0.6651433", "0.6609615", "0.66076875", "0.660437", "0.6591419", "0.6590477", "0.6567088", "0.65483785",...
0.0
-1
Recibe el numero de segmentos y el valor de W Esta es la funcion de sumatoria para los numeros Impares Regresa el total de la sumatoria
def sumaImpar(self,numSeg,w): total=0 for i in range(1,numSeg,2): total+=4*self.F(i*w) return total
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sumaPar(self,numSeg,w):\n total=0\n for i in range(2,numSeg-1,2):\n total+=2*self.F(i*w)\n return total", "def som(getallenlijst):\r\n total = sum(getallenlijst)\r\n return total", "def patrimony_total(self):\n pass", "def P(self,numSeg):\n w=self.x/num...
[ "0.6964878", "0.6134664", "0.594122", "0.5869036", "0.5832696", "0.58005255", "0.5768656", "0.57542235", "0.57383496", "0.5733486", "0.5723789", "0.5633767", "0.5631011", "0.5616186", "0.5609557", "0.5607594", "0.56038254", "0.5596513", "0.5594047", "0.5584726", "0.55708295",...
0.6899784
1
Recibe el numero de segmentos y el valor de W Esta es la funcion de sumatoria para los numeros Pares Regresa el total de la sumatoria
def sumaPar(self,numSeg,w): total=0 for i in range(2,numSeg-1,2): total+=2*self.F(i*w) return total
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def som(getallenlijst):\r\n total = sum(getallenlijst)\r\n return total", "def patrimony_total(self):\n pass", "def sumaImpar(self,numSeg,w):\n total=0\n for i in range(1,numSeg,2):\n total+=4*self.F(i*w)\n return total", "def n_suma(a1,nr_wyrazu,r):\n return (...
[ "0.63764817", "0.6370845", "0.6358655", "0.6194959", "0.6053004", "0.5966047", "0.59162605", "0.5848194", "0.5827601", "0.57799345", "0.5768629", "0.5754656", "0.5723134", "0.57056737", "0.5684519", "0.56820756", "0.56553745", "0.56527156", "0.5647538", "0.56249356", "0.56219...
0.72560215
0
Recibe el numero de segmentos, utiliza la x de la clase y tambien el dof Evalua la regla de Simpson Regresa el calulo
def P(self,numSeg): w=self.x/numSeg return (w/3)*(self.F(0)+self.sumaImpar(numSeg,w)+self.sumaPar(numSeg,w)+self.F(self.x))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def schaffern1fcn(x: np.ndarray) -> np.ndarray:\n if x.shape[1] != 2:\n raise ValueError(\n \"Schaffer function N. 1 is defined only on a 2D space.\"\n )\n X = x[:, 0]\n Y = x[:, 1]\n\n numeratorcomp = (np.sin((X**2 + Y**2) ** 2) ** 2) - 0.5\n denominatorcomp = (1 + 0.001 * ...
[ "0.603575", "0.59524214", "0.58458906", "0.57840693", "0.57768226", "0.5736538", "0.5676084", "0.562847", "0.5549627", "0.5509658", "0.5484242", "0.5461846", "0.5453628", "0.5446418", "0.53927326", "0.5381252", "0.53637886", "0.53617305", "0.53459823", "0.53459823", "0.534225...
0.5704941
6
Esta funcion rescibe dos valores de P Evalua de forma booleana si el valor de la resta es menor que 0.00001
def checarPs(self,p1,p2): return abs(p1-p2) < 0.00001
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_for_float(check):", "def test_correct_p_values_no_change(self):\r\n exp = [None, 0.008]\r\n obs = self.mc._correct_p_values([None, 0.008])\r\n self.assertEqual(obs, exp)\r\n exp = [0.007]\r\n obs = self.mc._correct_p_values([0.007])\r\n assert_almost_equal(obs,...
[ "0.6126959", "0.6091934", "0.6083219", "0.6069677", "0.60691434", "0.59945536", "0.59785897", "0.595968", "0.59528214", "0.59318626", "0.5901813", "0.5901813", "0.5889509", "0.5824826", "0.5815684", "0.57984555", "0.5797382", "0.57892585", "0.5786633", "0.5771933", "0.5760534...
0.0
-1
Esta funcion es el constructor de la clase
def __init__(self,x,dof): self.x=x self.dof=dof numSeg=10 p1=self.P(numSeg) p2=0 while True: numSeg*=2 p2=self.P(numSeg) if self.checarPs(p1,p2): break else: p1=p2 print(round(p2,5))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, constructor_fn=None):", "def __init__(self, constructor_fn=None):", "def __init__ (self) :", "def __init__(__self__):\n pass", "def __init__(__self__):\n pass", "def __init__(__self__):\n pass", "def __init__(__self__):\n pass", "def __init__(__self__):\...
[ "0.7876094", "0.7876094", "0.76834565", "0.7615697", "0.7615697", "0.7615697", "0.7615697", "0.7615697", "0.7615697", "0.7615697", "0.7615697", "0.7615697", "0.7615697", "0.76075494", "0.75988233", "0.7574014", "0.7574014", "0.754344", "0.75391805", "0.7525598", "0.7525598", ...
0.0
-1
Return a decorator which will parse a gerber file before running the test.
def use_file(filename): def decorator(test_method): """ Add params to decorator function. """ @wraps(test_method) def wrapper(self): """ Parse file then run test. """ parser = Gerber(ignore_unknown=False) self.design = parser.parse(path.join(DIR, filenam...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def decorator(test_method):\n\n @wraps(test_method)\n def wrapper(self):\n \"\"\" Parse file then run test. \"\"\"\n parser = Gerber(ignore_unknown=False)\n self.design = parser.parse(path.join(DIR, filename))\n test_method(self)\n\n return wrapper",...
[ "0.7448634", "0.71167976", "0.59627867", "0.59301746", "0.5918239", "0.59080213", "0.58810973", "0.57334006", "0.56384057", "0.5625038", "0.55969214", "0.55764806", "0.5508951", "0.550502", "0.5491165", "0.5372833", "0.53668374", "0.53651786", "0.53651786", "0.52833706", "0.5...
0.7256232
1
Add params to decorator function.
def decorator(test_method): @wraps(test_method) def wrapper(self): """ Parse file then run test. """ parser = Gerber(ignore_unknown=False) self.design = parser.parse(path.join(DIR, filename)) test_method(self) return wrapper
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def param(*args, **kwargs):\n p = Param(*args, **kwargs)\n\n def decorator(func):\n func.param = p\n return func\n\n return decorator", "def params(funcarglist):\n def wrapper(function):\n function.funcarglist = funcarglist\n return function\n return wrapper", "def _u...
[ "0.6966783", "0.68387944", "0.6661411", "0.65097076", "0.64938056", "0.64089364", "0.637854", "0.635611", "0.6307712", "0.6263976", "0.62250924", "0.61494106", "0.6050514", "0.59442437", "0.59440565", "0.59188884", "0.58860785", "0.58772427", "0.5874225", "0.5865413", "0.5854...
0.0
-1
Parse file then run test.
def wrapper(self): parser = Gerber(ignore_unknown=False) self.design = parser.parse(path.join(DIR, filename)) test_method(self)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_parse(self): \n\n results = self.parser.parse()\n self.assertEqual(results, test_case_data['parse_output'])", "def main():\n parse_file(sys.argv[1])", "def test_parse_file(self, tmpdir):\n filename = tmpdir.join(\"test.xbb\")\n\n with open(filename, \"w\") as f:\n ...
[ "0.72975254", "0.72955656", "0.68624204", "0.6839642", "0.68134034", "0.6797835", "0.6793306", "0.67111844", "0.6621141", "0.66025037", "0.66010785", "0.65545213", "0.6546812", "0.65328765", "0.65042335", "0.6461551", "0.64531183", "0.6451311", "0.64335024", "0.6405252", "0.6...
0.58652794
58
Setup the test case.
def setUp(self): self.design = None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setUp(self):\n MainTests.setUp(self)", "def setUp(self):\n logging.debug('setting up')", "def setUp(self):\n logging.debug('setting up')", "def setUp(self):\n \n pass", "def setUp(self):\n\n self._set_up()", "def setUp(self):\n test_env_setup()", "de...
[ "0.8319253", "0.8303649", "0.8303649", "0.82346183", "0.8222515", "0.8190009", "0.8142373", "0.8142373", "0.81257635", "0.8111714", "0.810949", "0.8089887", "0.8089887", "0.8089887", "0.8089887", "0.8089887", "0.8089887", "0.8089887", "0.8089887", "0.8089887", "0.8089887", ...
0.0
-1
Create an empty gerber parser.
def test_create_new_gerber_parser(self): parser = Gerber() assert parser != None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_parser():\n pass", "def _make_parser(self):\n return DefusedExpatParser()", "def __init__(self, parser=None):", "def __init__(self):\n print \"You asked for a Parser!\"", "def __parser__(self):\n return self", "def __init__(self, parser: Any = None):", "def test_gen_p...
[ "0.70855314", "0.686953", "0.63831055", "0.6263777", "0.61320263", "0.6107546", "0.60626626", "0.6037953", "0.59399813", "0.5923526", "0.5910576", "0.5903135", "0.5893762", "0.58550376", "0.57761353", "0.5761796", "0.5757238", "0.5713794", "0.5700876", "0.56808746", "0.567541...
0.7622803
0
Parse a simple, correct gerber file.
def test_simple(self): image = self.design.layout.layers[0].images[0] assert len(image.traces) == 2
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse(self, infile):\r\n raise NotImplementedError()", "def main():\n parse_file(sys.argv[1])", "def _parse(self, infile):\n raise NotImplementedError()", "def parse_data(fp):\n pass", "def parse(self, filename):\n try:\n if 't' in self.FILE_OPEN_MODE:\n ...
[ "0.6448221", "0.62971914", "0.6292576", "0.6234875", "0.62203777", "0.60354435", "0.5979849", "0.5967455", "0.58838326", "0.58157027", "0.58120286", "0.56847286", "0.56830376", "0.5674723", "0.5657585", "0.561286", "0.55799603", "0.557439", "0.5564147", "0.5547885", "0.554700...
0.0
-1
Parse some connected arcs and lines gerber.
def test_arcs(self): image = self.design.layout.layers[0].images[0] assert len(image.traces) == 2
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_lats(lines):\n class Parser:\n def __init__(self):\n self.state = 'get_utt_id'\n self.utt_id = ''\n self.out = {}\n\n def is_line_utt_id(self, splited_line):\n return len(splited_line) == 1\n\n def new_utt(self, splited_line):\n ...
[ "0.654071", "0.5878847", "0.5738166", "0.57329017", "0.57178354", "0.56650144", "0.563962", "0.56280166", "0.553405", "0.553402", "0.55142915", "0.54828024", "0.5479437", "0.54232544", "0.54089653", "0.5399194", "0.5396662", "0.53636837", "0.53310245", "0.53172666", "0.531521...
0.0
-1
Parse outline fills gerber.
def test_outline_fills(self): image = self.design.layout.layers[0].images[0] assert len(image.fills) == 2
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetLinePostProcess(self):\r\n retline = None\r\n outline = None\r\n try:\r\n retline= str(self.file.readline())\r\n except IOError:\r\n self.tracking.SetError(type(self).__name__, sys._getframe().f_code.co_name, \"cannot read a line from\" )\r\n finally...
[ "0.54550266", "0.53504366", "0.5275898", "0.5209391", "0.5129223", "0.5023708", "0.49978548", "0.49913824", "0.49811244", "0.49447837", "0.49260226", "0.4864756", "0.48543087", "0.48436245", "0.48063695", "0.470252", "0.46995398", "0.4677932", "0.46646264", "0.46302944", "0.4...
0.5327663
2
Parse a smear gerber.
def test_smear(self): image = self.design.layout.layers[0].images[0] assert len(image.smears) == 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse(self):", "def parse(self):\n pass", "def parse(self):\n pass", "def parse(self):\n pass", "def parse(self):\n pass", "def _parse(self):\n pass", "def parse(self) -> None:\n pass", "def parse(cls, s):\n raise NotImplementedError", "def parse...
[ "0.6050831", "0.59192437", "0.59192437", "0.59192437", "0.59192437", "0.58157104", "0.5804667", "0.5667438", "0.56673455", "0.5582821", "0.553624", "0.5477379", "0.5466349", "0.5438679", "0.5426614", "0.5339378", "0.5334901", "0.53278166", "0.52798384", "0.5264409", "0.525246...
0.0
-1
Parse aperture macros gerber.
def test_complex(self): image = self.design.layout.layers[0].images[2] assert len(image.shape_instances) == 3
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __parse_macro(self, buffer):\n\t\t\n\t\t# Parse an optional id\n\t\tspell = self.__read_number(buffer)\n\t\t\n\t\t##\n\t\t# FIXME technically, the effects do not exist, as\n\t\t# WoW parses the identifier alphanumerically\n\t\t# Do we really want that? It's easier to go back.\n\t\t\n\t\t# Parse an alphabetic i...
[ "0.58941257", "0.5843007", "0.5546842", "0.53140604", "0.5287681", "0.5214822", "0.5029532", "0.49508327", "0.49250644", "0.49058402", "0.49010736", "0.4891424", "0.48260668", "0.48217857", "0.48092648", "0.48078823", "0.48026338", "0.48020837", "0.4797323", "0.47908527", "0....
0.0
-1
Parse a batch of gerber files in a zip file.
def test_zip_batch(self): assert self.design.layout.layers[0].name == 'top'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _add_tag_files(\n zip_file, dir_name, payload_info_list, payload_byte_count, payload_file_count\n):\n tag_info_list = []\n _add_tag_file(zip_file, dir_name, tag_info_list, _gen_bagit_text_file_tup())\n _add_tag_file(\n zip_file,\n dir_name,\n tag_info_list,\n _gen_bag_in...
[ "0.635105", "0.62073517", "0.61985546", "0.6158757", "0.59900516", "0.58955044", "0.58135545", "0.58013874", "0.57838947", "0.56704354", "0.5652113", "0.5610305", "0.55248296", "0.551513", "0.5497405", "0.549419", "0.5461678", "0.5454392", "0.5449247", "0.541069", "0.54071915...
0.0
-1
Parse a batch of gerber files in a bz2 tarball.
def test_bz_batch(self): assert self.design.layout.layers[0].name == 'top'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extract_bz2(tar_bz_f, calc_type):\n \n # we give the gaussian calculator a label that includes the directory the\n # log file is contained in, this does not affect the parsing process but\n # generate a warning as it is not an expected form for the label. To avoid\n # the profusion of warning me...
[ "0.62602454", "0.57246566", "0.56907696", "0.56726176", "0.550637", "0.5499982", "0.54376435", "0.542693", "0.54081875", "0.5403217", "0.53807425", "0.5374287", "0.53654516", "0.53579986", "0.53536445", "0.5324675", "0.53113073", "0.5298232", "0.52399564", "0.5238451", "0.522...
0.0
-1
Parse a batch of gerber files in a gz tarball.
def test_gz_batch(self): assert self.design.layout.layers[0].name == 'top'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_gzipped_directory(input_dir, start_date, end_date, infos, backup_stamps):\n try:\n file_names = sorted(os.listdir(input_dir)) \n for file_name in file_names:\n if file_name.endswith(\".manifest.gz\") or file_name.endswith(\".manifest\"):\n ...
[ "0.62771606", "0.5906162", "0.580242", "0.57709885", "0.567405", "0.5659064", "0.56499046", "0.5587792", "0.5565765", "0.55654675", "0.5555699", "0.5538824", "0.5521462", "0.548998", "0.54764485", "0.54678583", "0.54415685", "0.5418712", "0.5413513", "0.54120094", "0.54090226...
0.0
-1
The Modifier can evaluate expressions correctly.
def test_modifier(self): modif = Modifier('1.2') self.assertEqual(modif.evaluate({}), 1.2) modif = Modifier('$1') self.assertEqual(modif.evaluate({1:3.2}), 3.2) modif = Modifier('1+1') self.assertEqual(modif.evaluate({}), 2) modif = Modifier('3-1.5') self....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _should_eval(self):\n return False", "def evaluate(compiled_expression):", "def evaluate(self):\n pass", "def evaluate(self):\n pass", "def eval(self):\n pass", "def eval(self):\n pass", "def eval(self):\n pass", "def evaluate(self) :\n pass", "d...
[ "0.6572281", "0.6568479", "0.65574527", "0.65574527", "0.64303815", "0.64303815", "0.64303815", "0.6407245", "0.6345367", "0.62577146", "0.6183484", "0.61799407", "0.61565596", "0.6149802", "0.61396885", "0.6117585", "0.6077628", "0.60701233", "0.6039489", "0.60292995", "0.60...
0.71497124
0
Trap param outside of gerber param block.
def test_missing_delim(self):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prepost_hook_too_many_parameters(self, param) -> None:\n pass", "def _handleInput(self, paramInput):\n pass", "def paramValueChanged(self, param):\n if self._printSWAP == True:\n print param.name + \" in address \" + str(param.getRegAddress()) + \" changed to \" + param.getValue...
[ "0.6485111", "0.6299571", "0.5991846", "0.590375", "0.58012176", "0.5784556", "0.5730866", "0.5685745", "0.5592114", "0.5574099", "0.5539806", "0.55120116", "0.55019736", "0.54560244", "0.5417562", "0.5411254", "0.5411254", "0.5411254", "0.5406385", "0.537721", "0.53710365", ...
0.0
-1
Trap coord preceding gerber format spec.
def test_coord_preceding_fs(self):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def trace(self, coord01: np.ndarray) -> np.ndarray:\n rect = self.clip_rect()\n return (rect.position + coord01 * rect.size).astype(np.int)", "def frac11(self,lx,ly,lz):\n return str(self.coord[0]/lx*2)+'\\t'+str(self.coord[1]/ly*2)+'\\t'+str(self.coord[2]/lz*2)", "def _format_point(self, ...
[ "0.52641153", "0.5259147", "0.5174216", "0.5166887", "0.5154606", "0.514098", "0.51310825", "0.51202244", "0.51102793", "0.5103446", "0.50844723", "0.5079553", "0.507823", "0.50599504", "0.5053271", "0.5025921", "0.5018617", "0.4984303", "0.49542806", "0.4949716", "0.49197924...
0.61945975
0
Trap coord inside gerber param block.
def test_data_in_param(self):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def xy(self):\n ...", "def paramValueChanged(self, param):\n if self._printSWAP == True:\n print param.name + \" in address \" + str(param.getRegAddress()) + \" changed to \" + param.getValueInAscii()", "def modifyPoint(self, *args, **kwargs):\n ...", "def set_coord(self, l, s...
[ "0.56467545", "0.553417", "0.53961", "0.5391049", "0.5386599", "0.5367348", "0.53164357", "0.5312498", "0.53037393", "0.5255599", "0.5255599", "0.5255599", "0.5255599", "0.5255599", "0.5255599", "0.5255599", "0.5255599", "0.5255599", "0.5255599", "0.5255599", "0.5238645", "...
0.0
-1
Trap coord with 'Y' before 'X' gerber.
def test_y_before_x(self):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _coord(self, x, y):\n gridEdge = 7 # originally 5\n y = gridEdge - y\n cx = 100 * (x - 1) + 50\n cy = 100 * (y - 1) + 50\n r = 20\n return (cx - r, cy - r, cx + r, cy + r)", "def _transform_point(self, x, y):\n return (x, y)", "def set_position(sel...
[ "0.6347154", "0.615938", "0.59551126", "0.594736", "0.5881816", "0.5860635", "0.5815088", "0.57782364", "0.5747512", "0.57448643", "0.57318264", "0.57293063", "0.57039654", "0.5697053", "0.5697053", "0.56909347", "0.5679062", "0.5646204", "0.5643103", "0.5624204", "0.561082",...
0.5459573
44
Trap data following M02 block gerber.
def test_trailing_data(self):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _data_move_out_mc_on_h():\n\n pass", "def onBlock(self, data) :\n pass", "def readBumper(self, msg):\n #\n # if(msg.state==1):#the bumper is pressed\n self.executeTrajectory()", "def _handle_MonitorData (self, event, packet, reverse):\n pass", "def handleModuleMessage(s...
[ "0.56816924", "0.55445737", "0.5298501", "0.52529526", "0.5242817", "0.5230332", "0.52025527", "0.51271504", "0.5111258", "0.50924855", "0.50700384", "0.5046472", "0.5040559", "0.5023257", "0.5019368", "0.49901193", "0.49784297", "0.49663934", "0.49618027", "0.4956633", "0.49...
0.0
-1
Trap file with no M02 block gerber.
def test_no_eof(self):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cleanupV032backup(self):\n doCleanup = False\n if (os.path.isfile(self.MAPSTUDIO + 'm10_00_00_00.msb.bak')):\n self.msbio.open(self.MAPSTUDIO + 'm10_00_00_00.msb.bak')\n if (len(self.msbio.models.rows) >= 373):\n doCleanup = True\n\n if (doCleanup):\n ...
[ "0.5411359", "0.53538233", "0.53510696", "0.5252125", "0.51773673", "0.5137562", "0.5103627", "0.509049", "0.50799817", "0.50792575", "0.5078129", "0.5071632", "0.50331587", "0.5031816", "0.50235265", "0.5013143", "0.50088", "0.50076556", "0.50074273", "0.50043285", "0.499754...
0.0
-1
Trap offspec data in gerber file.
def test_alien_data(self):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_fault_rupture_from_file(self, fault_filename):\n self.fault.add_patches_from_file(fault_filename) \n self.irst = 214", "def test_fake_file(self):\n fits_file = os.path.join(self.datadir, 'monol_test_fake.evt')\n hen.fake.main(['-o', fits_file, '--instrument', 'FPMB'])\n...
[ "0.55719537", "0.5494891", "0.51716053", "0.51296675", "0.5104879", "0.5093885", "0.50897896", "0.50862515", "0.5061046", "0.50539726", "0.5030481", "0.5016976", "0.50007325", "0.4999721", "0.49765038", "0.4970551", "0.4964387", "0.4937533", "0.4932086", "0.49242124", "0.4913...
0.0
-1
Trap long arc in single quadrant mode.
def test_single_quadrant(self):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def place_rebar_long_torsion(as_tl_req, d):\r\n \"\"\"as_tl_req - area of longitudinal reinforcement required for torsion\"\"\"\r\n \"\"\"d - preferred diameter (this is initially the flexural rebar diameter. If not enough, chose one diameter above\"\"\"\r\n \"\"\"returns a list with [n, d] where n is num...
[ "0.51212114", "0.503686", "0.500466", "0.49968642", "0.49456814", "0.4928112", "0.4917071", "0.48972583", "0.48096138", "0.48058507", "0.47610927", "0.4761016", "0.47439614", "0.47282705", "0.47250915", "0.47182012", "0.47141975", "0.47103226", "0.47048694", "0.47028008", "0....
0.46925488
21
Trap unsuccessful outline fill closure.
def test_open_fill(self):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def end_fill():\n turtleTmp.end_fill()", "def test_outline_fills(self):\n image = self.design.layout.layers[0].images[0]\n assert len(image.fills) == 2", "def fillbox(self,event=None):\n \n pass", "def update_fill(self, event):\r\n\r\n if event.type == 'FILL':\r\n ...
[ "0.5995263", "0.5990204", "0.5509914", "0.5184432", "0.51762307", "0.51762307", "0.514419", "0.51174825", "0.50964", "0.50798017", "0.50475687", "0.50426537", "0.5025028", "0.49561536", "0.4947993", "0.49472082", "0.4876335", "0.484599", "0.48382837", "0.48201862", "0.4810579...
0.0
-1
Trap nonlinear smear gerber.
def test_arc_smear(self):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def post_process_trap(): \n #################### 0) assign internal values #################### \n from project_parameters import trapType,debug,trapFile,name,driveAmplitude,driveFrequency,Omega,dcplot,weightElectrodes,coefs,ax,az,phi,save,scale\n #from all_functions import find_saddle,plot_potential,dc_p...
[ "0.54921705", "0.52793443", "0.52202374", "0.521817", "0.5195716", "0.51095015", "0.51095015", "0.50273573", "0.49843332", "0.4955213", "0.4955092", "0.49494436", "0.49199587", "0.4883605", "0.48833477", "0.48775414", "0.48286638", "0.4825539", "0.48209244", "0.48204193", "0....
0.0
-1
Subscibe a set of event keys for a callback.
def subscribe(callback, keys): assert type(keys) in (set, list, tuple) _subscribers[callback] = keys
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _handle_key_event(self, key, modifiers, mapping):\n if key in mapping:\n for callback in mapping[key]:\n callback()", "def make_keyhandler(events):\n def handler(key):\n for k in events:\n if key == simplegui.KEY_MAP[k]:\n events[k]()\n ...
[ "0.68615484", "0.68123263", "0.6174684", "0.58327556", "0.58170974", "0.5806323", "0.5780186", "0.5754679", "0.5689066", "0.567472", "0.56471545", "0.5627545", "0.56092143", "0.55985314", "0.55752456", "0.55332804", "0.5533179", "0.55255973", "0.55047953", "0.5493462", "0.546...
0.65743834
2
Unsubscribe events for a callback.
def unsubscribe(callback): if callback in _subscribers: del _subscribers[callback]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unsubscribe(self, callback: Callable) -> None:\n self.callbacks.discard(callback)", "def unsubscribe(self, event_type: typing.Type[typing.Any], callback: CallbackT[typing.Any]) -> None:", "def unsubscribe_callback(self, callback, sensor):\n if sensor in self._callbacks:\n self._cal...
[ "0.84749424", "0.8190403", "0.79367375", "0.7856983", "0.7775709", "0.7710769", "0.7495644", "0.7495644", "0.7495644", "0.7495644", "0.7495644", "0.74490726", "0.74136734", "0.73761433", "0.72853684", "0.72737384", "0.72261065", "0.72020453", "0.7193984", "0.71859956", "0.718...
0.85581386
0