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
Helper function to get the value that appears most often in a list
def getmost(val_list): # Problem: In GC datasets is the purpose a string-list if val_list[0][0] == "[": val_list = [elem for val in val_list for elem in eval(val)] # remove unkowns val_list = [elem for elem in val_list if elem != "unknown"] if len(val_list) == 0: return "unknown" ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_most_common(self, lst):\n data = Counter(lst)\n mc = data.most_common(2) \n #if len(mc) == 1 or (mc[0][1] != (mc[1][1])):\n # return mc[0][0]\n #return \"AMB\"\n return data.most_common(1)[0][0]", "def findMode(list):\n # Use Python's Counter function on the list\n values = Count...
[ "0.7752545", "0.76418954", "0.7574627", "0.7467799", "0.73690933", "0.71701205", "0.7152908", "0.69847006", "0.6911599", "0.68987066", "0.67320526", "0.67043674", "0.66537195", "0.66537195", "0.65454876", "0.65383756", "0.6517197", "0.64764464", "0.64379704", "0.6404696", "0....
0.69957846
7
Load mydataset. This is a template for adding a function to load a dataset from MoleculeNet. Adjust the global variable URL strings, default parameters, default featurizers, transformers, and splitters, and variable names as needed. All available featurizers, transformers, and splitters are in the `DEFAULTS_X` global v...
def load_mydataset( featurizer: Featurizer = DEFAULT_FEATURIZERS['CircularFingerprint'], transformers: List[Transformer] = [ DEFAULT_TRANSFORMERS['NormalizationTransformer'] ], splitter: Splitter = DEFAULT_SPLITTERS['RandomSplitter'], reload: bool = True, data...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_dataset(self, split, epoch=1, combine=False, **kwargs):\n paths = utils.split_paths(self.cfg.data)\n assert len(paths) > 0\n data_path = paths[(epoch - 1) % len(paths)]\n\n # infer langcode\n src, tgt = self.cfg.source_lang, self.cfg.target_lang\n\n self.datasets[...
[ "0.6464995", "0.6344406", "0.63009864", "0.62198555", "0.6104486", "0.6049461", "0.57530385", "0.57283473", "0.5718382", "0.5714284", "0.56947726", "0.56910175", "0.56653357", "0.5658124", "0.56215054", "0.55981797", "0.55725634", "0.5554376", "0.5487216", "0.5476791", "0.545...
0.75441635
0
Wraps a batch, ensuring the Begin and appropriate Commit/Rollback messages are sent. The context manager provides a function that can be used to publish mutation events that are part of the batch.
def batch(self, batch_identifier, begin_operation): logger.debug('Starting transaction...') self.publish( batch_operation=BatchOperation( batch_identifier=batch_identifier, begin_operation=begin_operation, ), ) def mutation(mutatio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def flush_batch(self, batch: Sequence[TResult]) -> None:\n pass", "def on_batch_begin(self, batch, logs=None):", "def update_batch(self, *args, **kwargs):\n pass", "def batch(self, batch):\n\n self._batch = batch", "async def __aenter__(self) -> 'Batch':\n return self", "def p...
[ "0.6107172", "0.6058084", "0.59232724", "0.5890671", "0.5817309", "0.56705236", "0.56705236", "0.5649754", "0.5590239", "0.5588603", "0.5561749", "0.55558044", "0.55515575", "0.55392265", "0.55080247", "0.54725164", "0.54669183", "0.5443207", "0.5433236", "0.54260266", "0.539...
0.71501136
0
Setup a subparser and add commands argument.
def setup_subparser(name, description, commands): subparser = SUBPARSER.add_parser( name, help=description ) subparser.add_argument( 'sub_command', metavar='sub_command', type=str, nargs='+', help='Which command to run. Options: %s' % ', '.join(command...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extend_cli(self, subparser):", "def setup_subcommands(argparser):\n\n subparsers = argparser.add_subparsers()\n\n parser_info = subparsers.add_parser('info', help = 'Provide the information about the user')\n parser_info.add_argument('user', help = 'The user to inspect')\n\n parser_ownerships = s...
[ "0.7698085", "0.75867957", "0.73314893", "0.73306316", "0.7281835", "0.7191596", "0.71781605", "0.7178032", "0.7148665", "0.7147075", "0.7076881", "0.70134723", "0.6995097", "0.69701797", "0.69290245", "0.6924605", "0.69063866", "0.69054353", "0.6900211", "0.68858474", "0.684...
0.87016386
0
Provider callback to supply trunk information by parent port.
def trunk_by_port_provider(resource, port_id, context, **kwargs): return trunk_objects.Trunk.get_object(context, port_id=port_id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _add_subports_handler(self, *args, **kwargs):\n payload = kwargs['payload']\n trunk = payload.current_trunk\n subports = payload.subports\n self._add_subports(trunk, subports)", "def create_trunk(self, trunk_id, port_id, port_mac):\n trunk = TrunkParentPort(trunk_id, port_i...
[ "0.5619033", "0.55133367", "0.5189067", "0.50392914", "0.50232095", "0.49888024", "0.49793926", "0.49399418", "0.49195224", "0.48990533", "0.48919058", "0.4873907", "0.4868863", "0.4865824", "0.47533485", "0.46831423", "0.46696264", "0.46676424", "0.4636975", "0.459998", "0.4...
0.64877063
0
Update subport bindings to match trunk host binding.
def update_subport_bindings(self, context, subports): el = context.elevated() ports_by_trunk_id = collections.defaultdict(list) updated_ports = collections.defaultdict(list) for s in subports: ports_by_trunk_id[s['trunk_id']].append(s['port_id']) for trunk_id, subpor...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _process_trunk_subport_bindings(self, context, trunk, port_ids):\n updated_ports = []\n trunk_port_id = trunk.port_id\n trunk_port = self.core_plugin.get_port(context, trunk_port_id)\n trunk_host = trunk_port.get(portbindings.HOST_ID)\n migrating_to_host = trunk_port.get(\n ...
[ "0.72594476", "0.62411875", "0.60699815", "0.6037147", "0.58178145", "0.5778144", "0.5715002", "0.5682961", "0.56433135", "0.5611568", "0.5526104", "0.5511807", "0.5493885", "0.5483759", "0.5401468", "0.5302826", "0.52826065", "0.5278357", "0.5265437", "0.5241553", "0.5210903...
0.73464423
0
Update the trunk status to reflect outcome of data plane wiring.
def update_trunk_status(self, context, trunk_id, status): with db_api.CONTEXT_WRITER.using(context): trunk = trunk_objects.Trunk.get_object(context, id=trunk_id) if trunk: self._safe_update_trunk(trunk, status=status)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def updateStatus(self, status):\n pass", "def setPlayerStates(self, updates):\r\n for upd in updates:\r\n print \"UPD player %s\" % upd['player']\r\n player = self.players[upd['player']]\r\n player.setStatus(upd['status'], upd['jump'], upd['charge'])\r\n\r\n ...
[ "0.59264684", "0.587799", "0.5827756", "0.57601655", "0.57076484", "0.5657012", "0.56370485", "0.5632501", "0.5620142", "0.55872035", "0.55813205", "0.5570724", "0.54910195", "0.54610723", "0.5435151", "0.5413461", "0.5406934", "0.53957736", "0.53900707", "0.53420854", "0.534...
0.66915464
0
Process port bindings for subports on the given trunk.
def _process_trunk_subport_bindings(self, context, trunk, port_ids): updated_ports = [] trunk_port_id = trunk.port_id trunk_port = self.core_plugin.get_port(context, trunk_port_id) trunk_host = trunk_port.get(portbindings.HOST_ID) migrating_to_host = trunk_port.get( p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _add_subports(self, trunk, subports):\n df_parent = self.nb_api.get(l2.LogicalPort(id=trunk.port_id))\n for subport in subports:\n self._add_subport(trunk, subport, df_parent)\n self._update_subport_statuses(trunk.port_id, subports)", "def update_subport_bindings(self, context...
[ "0.709539", "0.7085368", "0.6798057", "0.6746032", "0.6344534", "0.5957856", "0.59459835", "0.5633385", "0.56034285", "0.53181684", "0.5282736", "0.52312386", "0.5199397", "0.5183888", "0.518253", "0.51030344", "0.5098466", "0.50715005", "0.50691193", "0.50661856", "0.5005763...
0.80192614
0
Bind the given port to the given host.
def _handle_port_binding(self, context, port_id, trunk, trunk_host): port = self.core_plugin.update_port( context, port_id, {'port': {portbindings.HOST_ID: trunk_host, 'device_owner': trunk_consts.TRUNK_SUBPORT_OWNER}}) vif_type = port.get(portbindings.VIF_T...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bind(self, server_name: str, port: int) -> None:\n self.socket.bind((server_name, port))", "def bind_port(sock, host=HOST):\n if sock.family == socket.AF_INET and sock.type == socket.SOCK_STREAM:\n if hasattr(socket, 'SO_REUSEADDR'):\n if sock.getsockopt(socket.SOL_SOCKET, socket....
[ "0.75809574", "0.7395225", "0.70032054", "0.6949053", "0.690717", "0.68965316", "0.68517894", "0.68382174", "0.66902375", "0.66521305", "0.65530735", "0.6409748", "0.6393966", "0.6378963", "0.6378431", "0.6301012", "0.6291797", "0.6288253", "0.6283198", "0.6261312", "0.625025...
0.0
-1
Tell the agent about a trunk being created.
def trunk_created(self, context, trunk): self._resource_rpc.push(context, [trunk], events.CREATED)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_trunk(self, trunk_id, port_id, port_mac):\n trunk = TrunkParentPort(trunk_id, port_id, port_mac)\n try:\n if not trunk.bridge.exists():\n raise exc.TrunkBridgeNotFound(bridge=trunk.bridge.br_name)\n trunk.plug(self.br_int)\n except RuntimeError a...
[ "0.636586", "0.56802857", "0.559323", "0.5474232", "0.5465365", "0.54455197", "0.5414655", "0.53447294", "0.5334757", "0.5334757", "0.530312", "0.52899647", "0.5281329", "0.5230191", "0.52272636", "0.52272636", "0.52272636", "0.52031016", "0.517991", "0.51687413", "0.5164937"...
0.8424135
0
Tell the agent about a trunk being deleted.
def trunk_deleted(self, context, trunk): self._resource_rpc.push(context, [trunk], events.DELETED)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ticket_deleted(self, ticket):", "def delete():\n click.echo('delete was called.')", "def ticket_deleted(self, ticket):\n if 'ticket' not in self.sources:\n return\n gnp = GrowlNotificationPacket(notification='ticket',\n title='Ticket #%d dele...
[ "0.6661764", "0.64171475", "0.64160955", "0.6204961", "0.61002207", "0.60787624", "0.6034837", "0.59630114", "0.5942703", "0.5942189", "0.59273684", "0.5918228", "0.58854705", "0.58777356", "0.5877477", "0.58540946", "0.58333445", "0.58311665", "0.58311665", "0.58311665", "0....
0.8402147
0
Tell the agent about new subports to add.
def subports_added(self, context, subports): self._resource_rpc.push(context, subports, events.CREATED)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _add_subports_handler(self, *args, **kwargs):\n payload = kwargs['payload']\n trunk = payload.current_trunk\n subports = payload.subports\n self._add_subports(trunk, subports)", "def _add_subports(self, trunk, subports):\n df_parent = self.nb_api.get(l2.LogicalPort(id=trunk...
[ "0.70927566", "0.7042181", "0.6376136", "0.63531935", "0.56381696", "0.55981827", "0.558805", "0.5571931", "0.5547448", "0.5459118", "0.54546964", "0.5422842", "0.53876525", "0.5361296", "0.5357681", "0.5305928", "0.53015155", "0.52851564", "0.52837807", "0.52406853", "0.5188...
0.78780574
0
Tell the agent about existing subports to remove.
def subports_deleted(self, context, subports): self._resource_rpc.push(context, subports, events.DELETED)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _delete_subports_handler(self, *args, **kwargs):\n payload = kwargs['payload']\n trunk = payload.current_trunk\n subports = payload.subports\n self._delete_subports(trunk, subports)", "def _delete_subports(self, trunk, subports):\n df_parent = self.nb_api.get(l2.LogicalPort...
[ "0.67607665", "0.6679392", "0.6238778", "0.6224345", "0.616057", "0.60194", "0.59349513", "0.5784502", "0.57671446", "0.57442874", "0.57296705", "0.5690951", "0.5671759", "0.5668719", "0.56362563", "0.5633142", "0.55769914", "0.5551251", "0.554487", "0.5493517", "0.54907167",...
0.68250704
0
Preprocessing image for predicting
def preprocessImage(imgPath, imgSize, binary=True): img = cv2.imread(imgPath) # Binary if binary: brightness = 0 contrast = 50 img = np.int16(img) img = img * (contrast/127+1) - contrast + brightness img = np.clip(img, 0, 255) img = np.uint8(img) img ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _preprocess_image(self, input_data):\n image = self.preprocessor.preprocess(input_data.images)\n return InputData(images=image, labels=input_data.labels)", "def preprocess(self, img):\n img_ = image.load_img(img, target_size=(299, 299))\n img_ = image.img_to_array(img_)\n img_ = np...
[ "0.79805964", "0.7949401", "0.77426136", "0.7632862", "0.751916", "0.74418443", "0.7437271", "0.73613673", "0.7351681", "0.7339201", "0.73159295", "0.7299545", "0.72887135", "0.72823143", "0.72487414", "0.7248173", "0.7237607", "0.7229927", "0.7198501", "0.71821004", "0.71753...
0.0
-1
Helper fixture for add fleur schema tests Creates a Schema form the 0.34 schemas by just changing the version number to 0.01 removes the corresponding folder after the tests
def fake_schemas_and_test_files(tmp_path, test_file): import masci_tools from masci_tools.io.parsers.fleur import register_migration from masci_tools.io.parsers.fleur.fleur_outxml_parser import _TaskParser #Create migration to be able to use the outxml_parser @register_migration(base_version='0.34'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_schema():\n return 'test_schema'", "def test_versioned_release_schema():\n path = 'versioned-release-validation-schema.json'\n if os.path.exists(path):\n warn_and_assert([path], '{0} is present, run: rm {0}',\n 'Versioned release schema files are present. See warni...
[ "0.66084665", "0.64975446", "0.62625825", "0.6225974", "0.62073606", "0.61930996", "0.6191072", "0.61177087", "0.6056608", "0.603084", "0.60139173", "0.6012539", "0.5997258", "0.59951305", "0.59671104", "0.5963642", "0.5961408", "0.59456563", "0.5932938", "0.5872717", "0.5869...
0.7063366
0
Helper fixture for fleur inpxml converter tests Moves conversion to a temporary directory and back afterwards
def remove_conversion(tmp_path): import masci_tools #We need to use the __file__ attribute, since we do not know, whether the package was installed with -e package_root = Path(masci_tools.__file__).parent.resolve() conversion_folder = package_root / Path('tools/conversions') shutil.move(os.fspath(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def move_from_temp_directory(self):", "def test_convert(bed_path, zarr_tmp_path): # noqa\n convert(bed_path, zarr_tmp_path)\n assert zarr_tmp_path.is_dir()", "def setUp(self):\n super().setUp()\n self.cur_source = tempfile.mkdtemp()", "def prepare_run(input_path: str, output_path: str, t...
[ "0.6530254", "0.6393826", "0.6349133", "0.62040126", "0.6094501", "0.606132", "0.6034564", "0.5990417", "0.5985298", "0.5938615", "0.5930914", "0.59262675", "0.59262675", "0.5890804", "0.5890804", "0.5890804", "0.5890804", "0.5890804", "0.5890804", "0.5890804", "0.5866501", ...
0.5924341
13
If a QPlainTextEdit instance is passed to this method, it will return the msg to that instance to be displayed in the text window in the GUI. For this to work, all print messages in the rest of the code should use printmsg instead of directly calling print()
def printmsg(log, msg): if log == "": print(msg) else: text_format = QTextCharFormat() error = re.compile(r'ERROR', re.IGNORECASE) warning = re.compile(r'WARNING', re.IGNORECASE) if error.match(msg): text_format.setForeground(QBrush(QColor('red'))) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def on_lineEdit_textChanged(self, p0):\n # str_me = \"我爱我的祖国\"\n # self.lineEdit.setText(str_me) # 设置单行文本内容\n input_text = self.lineEdit.text()\n self.textEdit.setPlainText(input_text)\n # self.textEdit.setHtml(input_text) # 显示Html,如 <font color='red' size='20'>HELLO!</font>\n ...
[ "0.5995235", "0.58621967", "0.5782002", "0.5773683", "0.57614565", "0.5739478", "0.57264394", "0.5695613", "0.56831634", "0.56786966", "0.56589895", "0.56460714", "0.56320524", "0.5555053", "0.55536735", "0.55532205", "0.55410844", "0.54843515", "0.5475796", "0.5475727", "0.5...
0.5746262
5
Constructor of the sampling object
def __init__(self, proportion=1.0, n_neighbors=5, *, nn_params=None, ss_params=None, t=0.5, n_jobs=1, random_state=None, **_kwargs): ss_params_defaul...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, samples):\n self.samples = samples", "def __init__(self):\n\n #call super class's __init__ method\n super(TRiseSampler, self).__init__(name=\"trise\", observed=False)", "def __init__(self):\n Sampler.__init__(self)\n self._registeredIdentifiers = set() # tracks job...
[ "0.7830295", "0.77850425", "0.75485086", "0.7537069", "0.753654", "0.7518447", "0.7460421", "0.737182", "0.7336465", "0.7191074", "0.71595097", "0.70805407", "0.70739776", "0.70568454", "0.70043814", "0.69424504", "0.69412285", "0.68866473", "0.6885828", "0.68780285", "0.6877...
0.0
-1
Generates reasonable parameter combinations.
def parameter_combinations(cls, raw=False): parameter_combinations = {'proportion': [0.1, 0.25, 0.5, 0.75, 1.0, 1.5, 2.0], 'n_neighbors': [5, 7, 9], 't': [0.3, 0.5, 0.8]} return cls....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parameter_combinations(cls, raw=False):\r\n parameter_combinations = {'proportion': [0.1, 0.25, 0.5, 0.75,\r\n 1.0, 1.5, 2.0],\r\n 'n_neighbors': [3, 5, 7]}\r\n return cls.generate_parameter_combinations(parameter_co...
[ "0.76313037", "0.7224867", "0.70344704", "0.67043203", "0.6637404", "0.66145205", "0.66092134", "0.6572072", "0.6570018", "0.65444964", "0.65280664", "0.64884037", "0.64671034", "0.63868093", "0.6379742", "0.6354687", "0.6319228", "0.627921", "0.6229858", "0.6163955", "0.6131...
0.76634777
0
Determining the propensity scores.
def propensity_scores(self, X_trans, # pylint: disable=invalid-name y): # determining propensity scores using logistic regression logreg = LogisticRegression(solver='lbfgs', n_jobs=self.n_jobs, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_scores(self):\n if self.num_classes == 2:\n score_1 = self.competition_metric(\n helmet_threshold=0.5,\n impact_threshold=0.5,\n )[1]\n\n score_2 = self.competition_metric(\n helmet_threshold=0.5,\n impa...
[ "0.6715724", "0.66232336", "0.6617186", "0.6504233", "0.64811575", "0.6464534", "0.64140385", "0.63840854", "0.6364705", "0.6338181", "0.63117325", "0.6294533", "0.62621146", "0.62336594", "0.621356", "0.6210071", "0.6198574", "0.61936706", "0.6188908", "0.6183435", "0.615741...
0.65209883
3
Does the sample generation according to the class parameters.
def sampling_algorithm(self, X, y): n_to_sample = self.det_n_to_sample(self.proportion) if n_to_sample == 0: return self.return_copies(X, y, "Sampling is not needed.") # standardization is needed to make the range of the propensity scores # similar to that of the f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _generate(self, **kwargs):\n N = self.parameter_schema['N']\n parameter_count = len(self._parameter_names)\n common_override_kwargs = {}\n override_kwargs = self._sampler_overrides(common_override_kwargs)\n if kwargs:\n kwargs.update(override_kwargs)\n else:...
[ "0.780347", "0.7075232", "0.70512635", "0.7008629", "0.6872142", "0.6832942", "0.6799032", "0.6752448", "0.6752448", "0.6738638", "0.6699639", "0.6684928", "0.6684928", "0.65911394", "0.6559513", "0.65537953", "0.65311646", "0.6518262", "0.6518262", "0.6518262", "0.6506411", ...
0.0
-1
r"""Computes the Bayesian Information Criterion (BIC) given the log of the likelihood function evaluated at the estimated (or analytically derived) parameters, the number of parameters, and the number of samples. The BIC is usually applied to decide whether increasing the number of free parameters (hence, increasing th...
def bayesian_info_criterion(log_likelihood, n_params, n_samples): return n_params * np.log(n_samples) - 2.0 * log_likelihood
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def BIC(model, logL, nPeople):\n\t\tph, pvh = model\n\t\tnClusters, nQuestions, nAnswers = pvh.shape\n\n\t\tnParams = (nClusters - 1) + nClusters * nQuestions *(nAnswers - 1)\n\t\tbic = -2. * logL + nParams * np.log(nPeople)\n\t\treturn bic", "def bic(self, model, n_components):\n log_l = model.score(self...
[ "0.7472204", "0.73167074", "0.7300476", "0.72387344", "0.71903384", "0.7011313", "0.6528873", "0.6515101", "0.65095675", "0.64515585", "0.6297079", "0.6293874", "0.6259791", "0.624267", "0.6192693", "0.6183356", "0.6136393", "0.6124695", "0.60846364", "0.6014125", "0.6006925"...
0.72990745
3
r""" Computes the Bayesian Information Criterion (BIC) assuming that the observations come from a Gaussian distribution. In this case, BIC is given as
def bayesian_info_criterion_lsq(ssr, n_params, n_samples): return bayesian_info_criterion( -0.5 * n_samples * np.log(ssr / n_samples), n_params, n_samples )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_bic_ms(distribution):\n print(\"TESTING: BIC model selection for %s distribution\" % distribution.upper())\n params = dist.DISTRIBUTIONS[distribution][dist.KEY_TEST_PARAMS]\n print(\" creating sample\")\n test_sample = dist.samples(distribution, params)\n print(\" calculating BIC for all ...
[ "0.66940886", "0.6626143", "0.6501741", "0.64668363", "0.6289817", "0.6274681", "0.6262901", "0.62083215", "0.6194254", "0.6042782", "0.604139", "0.60393995", "0.5999307", "0.5952028", "0.5867411", "0.58671564", "0.58528864", "0.58291817", "0.57890683", "0.57602316", "0.57257...
0.0
-1
r""" Computes the Akaike Information Criterion (AIC). Like the Bayesian Information Criterion, the AIC is a measure of relative fitting quality which is used for fitting evaluation and model selection. The decision is in favor of the model with the lowest AIC. AIC is given as
def akaike_info_criterion(log_likelihood, n_params, n_samples): # Correction in case of small number of observations if n_samples / float(n_params) >= 40.0: aic = 2.0 * (n_params - log_likelihood) else: aic = 2.0 * (n_params - log_likelihood) + 2.0 * n_params * (n_params + 1.0) / ( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_aic_ms(distribution):\n print(\"TESTING: AIC model selection for %s distribution\" % distribution.upper())\n params = dist.DISTRIBUTIONS[distribution][dist.KEY_TEST_PARAMS]\n print(\" creating sample\")\n test_sample = dist.samples(distribution, params)\n print(\" calculating AIC for all ...
[ "0.7125299", "0.7063443", "0.65363806", "0.6478822", "0.6378012", "0.6152728", "0.5831945", "0.5728329", "0.5708109", "0.5639609", "0.5620417", "0.5551246", "0.5461738", "0.54400927", "0.5429435", "0.5417756", "0.5393642", "0.538318", "0.53732306", "0.53196394", "0.5303363", ...
0.6452948
4
r""" Computes the Akaike Information Criterion assuming that the observations are Gaussian distributed. In this case, AIC is given as
def akaike_info_criterion_lsq(ssr, n_params, n_samples): return akaike_info_criterion( -0.5 * n_samples * np.log(ssr / n_samples), n_params, n_samples )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def akaike_info_criterion(log_likelihood, n_params, n_samples):\n # Correction in case of small number of observations\n if n_samples / float(n_params) >= 40.0:\n aic = 2.0 * (n_params - log_likelihood)\n else:\n aic = 2.0 * (n_params - log_likelihood) + 2.0 * n_params * (n_params + 1.0) / (...
[ "0.67851955", "0.6574446", "0.64624596", "0.62729156", "0.62366945", "0.6137202", "0.6034915", "0.6020161", "0.6019123", "0.5926333", "0.58190686", "0.5798761", "0.5785684", "0.56501293", "0.56382704", "0.5636871", "0.5636784", "0.56007886", "0.55877995", "0.5543179", "0.5531...
0.0
-1
Return the list with every other element of the list starting with the first >>>every_other_new([5, "book", "computer", 4]) [5, "computer"]
def every_other_new (list): return list[::2]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def every_other(seq):\n every_other = seq[::2]\n return every_other", "def everyother(l, evenind = True):\n\tx = evenind\n\tresult = []\n\tfor el in l:\n\t\tif x:\n\t\t\tresult.append(el)\n\t\tx = not x\n\treturn result", "def every_other(seq):\n seq = seq[::2]\n return seq", "def every_other(seq...
[ "0.65220475", "0.649866", "0.64737666", "0.6340509", "0.6264626", "0.60266745", "0.55710185", "0.55634767", "0.55586797", "0.5421033", "0.5331364", "0.52655756", "0.5256756", "0.5178552", "0.5163781", "0.51042634", "0.50668144", "0.5015972", "0.5002389", "0.4960613", "0.49420...
0.808119
0
Overrided method allowing for backup
def time_step(self): self.reinitialize_backup_containers() super().time_step() self.make_a_backup_for_t()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __makeBackup(self):\n pass #FIXME!!!", "def __restoreBackup(self):\n pass #FIXME!!!", "def __on_backup_created(self, logger, *args):", "def __removeBackup(self):\n pass #FIXME!!", "def test_restore_backup():", "def save_backup(\n self):\n self.backup = self.data", ...
[ "0.83658415", "0.7829004", "0.706921", "0.69361895", "0.6637125", "0.6586054", "0.636382", "0.6317293", "0.6298336", "0.62739867", "0.61143976", "0.6063198", "0.6055941", "0.6036589", "0.6025266", "0.6001637", "0.59611464", "0.5943243", "0.5936035", "0.58995306", "0.5894625",...
0.62179774
10
Overrided method allowing for backup
def make_encounter(self, i, j): i_agreeing, j_agreeing = self.seek_agreement(i=i, j=j, proportions=None) self.make_stats_about_medium_of_exchange(i=i, j=j, i_agreeing=i_agreeing, j_agreeing=j_agreeing) self.proceed_to_exchange(i=i, j=j, i_agreeing=i_agreeing, j_agreeing=j_agreeing)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __makeBackup(self):\n pass #FIXME!!!", "def __restoreBackup(self):\n pass #FIXME!!!", "def __on_backup_created(self, logger, *args):", "def __removeBackup(self):\n pass #FIXME!!", "def test_restore_backup():", "def save_backup(\n self):\n self.backup = self.data", ...
[ "0.83663976", "0.7829125", "0.70703906", "0.6937234", "0.6638404", "0.65864813", "0.6365705", "0.6318917", "0.62995195", "0.6274283", "0.6219521", "0.6113983", "0.6065169", "0.6055928", "0.60369176", "0.60285425", "0.6003067", "0.5960495", "0.59448475", "0.5938494", "0.590041...
0.0
-1
Construct an instance of RequestValidator class.
def __init__(self, validator: Optional[Dict[str, Any]] = None, required: Optional[List[str]] = None ): self._validator: Optional[Dict[str, Any]] = validator self._required: Optional[List[str]] = required
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self,validator):\n self.validator = validator", "def initialize(self, request, args, kwargs):\n data = request_data.RequestData(request, args, kwargs)\n mutator = access_checker.Mutator(data)\n if data.is_developer:\n check = access_checker.DeveloperAccessChecker(data)\n else...
[ "0.67216057", "0.6340687", "0.6162767", "0.6056963", "0.6044323", "0.60155576", "0.59880096", "0.5962508", "0.5922895", "0.5918532", "0.5915735", "0.5877028", "0.5863092", "0.58363384", "0.5827409", "0.58167696", "0.57591516", "0.5756015", "0.5719287", "0.5698271", "0.5665298...
0.60880554
3
Return the validator dictionary.
def validator(self) -> Optional[Dict[str, Any]]: return self._validator
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_validator_kwargs(self):\n return {\n 'schema': self.get_validation_schema(),\n }", "def get_validate(self) -> dict:\n response = self.rc.execute(\"GET\",\n self._get_uri(GET_VALIDATE_URI),\n headers=self.h...
[ "0.7152374", "0.70878893", "0.6952434", "0.6856572", "0.6742903", "0.67127526", "0.66705245", "0.65641207", "0.6417823", "0.63874716", "0.636434", "0.62552", "0.61715084", "0.6151127", "0.61211085", "0.6085729", "0.6057178", "0.6043076", "0.60317767", "0.60255325", "0.5916598...
0.7766095
0
Set the validator dictionary.
def validator(self, value: Optional[Dict[str, Any]]): self._validator = value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validator_info(self, validator_info):\n\n self._validator_info = validator_info", "def validator(self) -> Optional[Dict[str, Any]]:\n return self._validator", "def validations(self, validations):\n\n self.container['validations'] = validations", "def __init__(self,validator):\n ...
[ "0.63722885", "0.59797984", "0.59709877", "0.5968238", "0.59022975", "0.58239925", "0.5774157", "0.56801814", "0.5592095", "0.5553507", "0.55335283", "0.55131084", "0.5410613", "0.5351317", "0.53378487", "0.53378487", "0.5327392", "0.5327392", "0.5301388", "0.52763367", "0.52...
0.7382766
0
Return the required list.
def required(self) -> Optional[List[str]]: return self._required
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def required(cls):\n return []", "def requires(self):\n return [GetListings()]", "def requirements(self):\n requirements = []\n return requirements", "def requires(self):\n return []", "def required(project):\n required = [{'short_name': 'co2'}, {'short_name': 'ps'...
[ "0.7869733", "0.7412133", "0.7002878", "0.69854146", "0.6639465", "0.66284937", "0.6495768", "0.64212686", "0.64066", "0.64066", "0.63434243", "0.63434243", "0.6334968", "0.63290614", "0.63290614", "0.6285141", "0.6263804", "0.6255326", "0.62376773", "0.6215162", "0.61936504"...
0.7165328
2
Set the required list.
def required(self, value: Optional[List[str]]): self._required = value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_listonly(self, value):\n if not value and self.__listonly:\n self.__listonly = False\n self.clear_preprocessed()", "def setup_lists(self):\n pass", "def set_required(self, val):\n if not contain_in_list_equal(val, PARAM_REQUIRED):\n raise ArgumentE...
[ "0.6505629", "0.6397032", "0.6206235", "0.6055954", "0.5997724", "0.5990036", "0.5935963", "0.59239346", "0.59239346", "0.59239346", "0.59239346", "0.59028673", "0.58956826", "0.58768284", "0.578714", "0.5773013", "0.57687247", "0.57687247", "0.57682145", "0.57617426", "0.573...
0.7008466
0
Implmentation for command line executing. Data for slates are by defaule taken from presets. That requires to enter, `slate_name`. If `slate_data` are entered then they are used. `data_output` should be path to json file where data will be collected.
def create_slates( fill_data, slate_name=None, slate_data=None, data_output_json=None ): if slate_data is None and slate_name is None: raise TypeError( "`create_slates` expects to enter data for slates or name" " of slate preset." ) elif slate_data is None: s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\n parser = specify_parser()\n args = parser.parse_args()\n\n mapping = init_data(args.datafile[0])\n loaded_data = read(args.input)\n\n mount(mapping, loaded_data)", "def main():\n parser = argparse.ArgumentParser()\n parser.add_argument(\"-data_dir\", required=True, help=\"Direc...
[ "0.59716684", "0.57863504", "0.56220686", "0.5616262", "0.5616262", "0.55532867", "0.5512346", "0.54771554", "0.5472725", "0.54657245", "0.54542744", "0.54304427", "0.54218835", "0.5402871", "0.5400456", "0.5400111", "0.5323287", "0.530436", "0.5283623", "0.52831334", "0.5282...
0.6469278
0
Solve min_W L(W; X) s.t. h(W) = 0 using augmented Lagrangian.
def causal_structure_learning(X, lambda1=0.001, loss_type='l2', max_iter=100, h_tol=1e-8, rho_max=1e+16, w_threshold=0.3): def _loss(W): """Evaluate value and gradient of loss.""" M = X @ W if loss_type == 'l2': R = X - M loss = 0.5 / X.shape[0] * (R ** 2).sum...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def localMin0(R, L, W):\n fo = costFunction(R, W)\n vacantL = vacantPoint(L)\n beta = None\n q = None\n\n while True:\n fmin = fo\n\n for alpha in range(0, len(R)):\n for p in range(0, len(vacantL)):\n TxpR = transpositionMatrix(R, vacantL, alpha, p)\n...
[ "0.64152235", "0.6215533", "0.61679626", "0.60417604", "0.5907512", "0.58645296", "0.58207196", "0.58126813", "0.58115166", "0.5771522", "0.57076126", "0.5638341", "0.5606416", "0.5593793", "0.5566008", "0.5544281", "0.5543346", "0.55317545", "0.553014", "0.55181235", "0.5510...
0.0
-1
Evaluate value and gradient of loss.
def _loss(W): M = X @ W if loss_type == 'l2': R = X - M loss = 0.5 / X.shape[0] * (R ** 2).sum() G_loss = - 1.0 / X.shape[0] * X.T @ R elif loss_type == 'logistic': loss = 1.0 / X.shape[0] * (np.logaddexp(0, M) - X * M).sum() G_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def val_func(self, data, label):\r\n self.net.eval()\r\n\r\n with torch.no_grad():\r\n outputs, losses = self.forward(data, label)\r\n\r\n return outputs, losses", "def EvaluateGradient(self, p_float=..., p_float=..., p_float=..., *args, **kwargs):\n ...", "def evaluate()...
[ "0.69768", "0.6937784", "0.6894575", "0.6893799", "0.65975624", "0.6590414", "0.6511201", "0.64940476", "0.6484039", "0.6452647", "0.6452647", "0.6438203", "0.64129823", "0.63836944", "0.638164", "0.636573", "0.634949", "0.6329341", "0.6327528", "0.63222533", "0.6311566", "...
0.0
-1
Evaluate value and gradient of acyclicity constraint.
def _h(W): # E = slin.expm(W * W) # h = np.trace(E) - d M = np.eye(d) + W * W / d E = np.linalg.matrix_power(M, d - 1) h = (E.T * M).sum() - d G_h = E.T * W * 2 return h, G_h
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def grad(self, A, y, x):\n z = y * A.dot(x) # decision value for each observation\n grad_x = -1*A[z < 1].T.dot(y[z < 1])\n # Gradient normalized by the num obs\n return grad_x / y.size", "def _evaluate_gradient(self, **variables):\n pass", "def constraint_gradient(self, inpu...
[ "0.63180304", "0.6304354", "0.61966664", "0.60825413", "0.5943754", "0.59032273", "0.5895369", "0.58493054", "0.5800573", "0.5736273", "0.56998944", "0.5691112", "0.56876165", "0.56867194", "0.56756926", "0.56521916", "0.564778", "0.5643748", "0.5626917", "0.56230366", "0.561...
0.0
-1
Convert doubled variables ([2 d^2] array) back to original variables ([d, d] matrix).
def _adj(w): return (w[:d * d] - w[d * d:]).reshape([d, d])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def double(arr):\n newarr = np.array([(xx,xx) for xx in arr]).ravel()\n return newarr", "def transp(self, x1, x2, d):\n raise NotImplementedError", "def reshape_var(var):\n dims = np.shape(var)\n nx = dims[0]\n ny = dims[1]\n nz = dims[2]\n\n var_2d = var.reshape(nx * ny, nz)\n r...
[ "0.5531017", "0.5504627", "0.5454772", "0.5431098", "0.53895634", "0.5382708", "0.53612345", "0.53478163", "0.5297869", "0.52765995", "0.52309704", "0.52063245", "0.5180334", "0.51354206", "0.5115046", "0.5100866", "0.50802684", "0.5079374", "0.5075493", "0.50642294", "0.5061...
0.0
-1
Evaluate value and gradient of augmented Lagrangian for doubled variables ([2 d^2] array).
def _func(w): W = _adj(w) loss, G_loss = _loss(W) h, G_h = _h(W) obj = loss + 0.5 * rho * h * h + alpha * h + lambda1 * w.sum() G_smooth = G_loss + (rho * h + alpha) * G_h g_obj = np.concatenate((G_smooth + lambda1, - G_smooth + lambda1), axis=None) return ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_grad(beta, lambdat, X, y):\n return -2/len(y)*(np.maximum(0, 1-(\n (y[:, np.newaxis]*X).dot(beta)))).dot(\n y[:, np.newaxis]*X) + 2 * lambdat * beta", "def func_grad(self, X, Y):\n Q = 0\n gradd = np.zeros((N, 2*n+1))\n for x, y in zip(X, Y):\n #pairs ...
[ "0.6397068", "0.6375466", "0.6302144", "0.62677103", "0.61805916", "0.6168278", "0.6148088", "0.61169016", "0.610339", "0.60866505", "0.60267633", "0.6008981", "0.59799474", "0.5943886", "0.5935295", "0.59334946", "0.5917374", "0.59151006", "0.590884", "0.59079236", "0.590679...
0.0
-1
Bulk insert entries data to the database model/table.
def bulk_insert(engine, model, entries): with session_scope(engine) as session: session.bulk_insert_mappings(model, entries) session.commit()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _insert_bulk(self, iterable):\n self.cursor.executemany(self.INSERT, iterable)\n self.conn.commit()", "def bulk_insert(objects, model, session):\n session.bulk_insert_mappings(model, objects)", "def insert_data_bulk(self, table_name, data):\n if len(data) == 0:\n return\n...
[ "0.7436783", "0.74265236", "0.72922033", "0.7262458", "0.7102141", "0.70946467", "0.69618917", "0.6844668", "0.6755042", "0.6731562", "0.6694375", "0.6672867", "0.66262", "0.65884143", "0.65853024", "0.65044075", "0.647805", "0.64497185", "0.6417831", "0.63891107", "0.6336435...
0.7966555
0
the IVOA messenger vocabulary in astropy's cache. Should we clean up after ourselves?
def messenger_vocabulary(mocker): import_file_to_cache( 'http://www.ivoa.net/rdf/messenger', get_pkg_data_filename( 'data/messenger.desise', package=__package__))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_vocab(self):\n\n\t\tself.parse_transcript() \n\t\tself.purge_words()\n\t\tself.analyze_words()\n\t\tself.sort_word_analysis()", "def update_vocab(self, text):\n for char in text:\n if char not in self.vocab:\n self.vocab[char] = len(self.vocab)\n if char not in...
[ "0.61893916", "0.5901378", "0.57867765", "0.5723008", "0.56460667", "0.5620585", "0.5584214", "0.55801475", "0.5509116", "0.54804516", "0.5464186", "0.5447357", "0.54274684", "0.5425342", "0.5407084", "0.53599447", "0.5356806", "0.5317574", "0.5316638", "0.53160644", "0.53119...
0.65306276
0
take a stream of tokens/nodes and split it according to tokens stream = a , c , e , f separator = ','
def split(stream, separator, element): if isinstance(stream, Node): stream = stream.get_inner_body() current = None try: while True: if not current: current = element() token = stream.__next__() # print('scanning ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def split_into_tokens(dataset, delimiter=\"\"):\n pass", "def split_sub_statement(stream, node_types):\n \n if isinstance(stream, Node):\n stream = stream.get_inner_body()\n \n current_node = None\n \n try:\n while True:\n \n token = next(stream)\n ...
[ "0.63907176", "0.61089045", "0.58818567", "0.57984126", "0.5695363", "0.569318", "0.56813574", "0.5672309", "0.5669516", "0.5632018", "0.5601465", "0.55953586", "0.55795026", "0.5567501", "0.5564501", "0.55217683", "0.54989874", "0.54901063", "0.5487813", "0.54479396", "0.543...
0.6474475
0
take a stream of tokens/nodes and split it according to separators constructing elements stream = SELECT ... FROM ... WHERE ... node_types a list of classes inheriting from SubStatement typically used after Parenthesis splitting
def split_sub_statement(stream, node_types): if isinstance(stream, Node): stream = stream.get_inner_body() current_node = None try: while True: token = next(stream) #print('current token ', token) matched = False ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def split(stream, separator, element):\n if isinstance(stream, Node):\n stream = stream.get_inner_body()\n \n current = None\n try:\n \n while True:\n if not current:\n current = element()\n \n token = stream.__next__()\n# ...
[ "0.5636374", "0.55413985", "0.54855776", "0.54737806", "0.5462743", "0.5454955", "0.5390649", "0.53512144", "0.530895", "0.5241497", "0.520279", "0.5183244", "0.51298153", "0.51044255", "0.5070569", "0.5052488", "0.504832", "0.50384504", "0.5021596", "0.5013821", "0.50020903"...
0.72118944
0
parse a select ... eventually complex Sub select are necessarily inside a parenthesis block
def parse_select(text): lexer = create_lexer(SqlLexer) class Select(SubStatement): begin='SELECT' class From(SubStatement): begin='FROM' class Where(SubStatement): begin='WHERE' def split_select(stream): return (element for element in spl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_select(self):\n self.assertEqual(['SELECT',\n ['MAX(*)', 'AS', 'a'], ['(SELECT 1 FROM Q)', 'AS', 'b'], ['c', 'AS', 'c.a'],\n 'FROM', 'T', ''],\n grammar._SELECT_EXPR.parseString(\"SELECT MAX(*) AS a, (SELECT 1 FROM Q) AS b,\"\n...
[ "0.7084201", "0.5947812", "0.5921865", "0.5876474", "0.55781275", "0.5544057", "0.55064434", "0.5500245", "0.5372754", "0.5361309", "0.5359532", "0.5358202", "0.53483516", "0.53483516", "0.5344046", "0.53224427", "0.5290747", "0.52629024", "0.5235372", "0.51850915", "0.517177...
0.7535803
0
This method generates a single sine pulse according to the given parameters.
def generate_singlesine(time = 0, samples_nb = 1000, rep_frequency = 10 , pulse_frequency = 50, amplitude = 1 , edge = 1, phase_offset = 0, noise = 0): if edge not in [0,1]: print(colorama.Back.RED + colorama.Style.BRIGHT + "ERROR: invalid phase (either 0 for a rising or a 1 for a falling edge) , exit."+ coloram...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sine(x, period=10.0, start_phase=0.0, name=''):\n x = x.astype(np.float)\n variables = {\n 'function': sine, 'period': period, 'start_phase': start_phase}\n y = np.sin(2*np.pi*(x / period) + start_phase)\n return packer(x, y, variables, name=name)", "def __generate_sin(self, phase_shif...
[ "0.6940268", "0.6880557", "0.6853573", "0.68185854", "0.65643746", "0.646433", "0.64616054", "0.64028764", "0.63944584", "0.638604", "0.63438696", "0.6322916", "0.6321839", "0.63211584", "0.6289463", "0.6178244", "0.6147117", "0.6147117", "0.61345106", "0.6107279", "0.6093004...
0.71325195
0
AuditEntry a model defined in Swagger
def __init__(self, changed_by=None, id=None, organization_id=None, entity=None, entity_id=None, audit_action=None, field_changes=None, new_entity=None, state=None, created=None): self.swagger_types = { 'changed_by': 'str', 'id': 'str', 'organization_id': 'str', 'e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_audit(self, entity_name, object_name, operation,\n data, auth_ctx, session):", "def getTenantAttributeUpdateAuditTrail(self, request, context):\n context.set_code(grpc.StatusCode.UNIMPLEMENTED)\n context.set_details('Method not implemented!')\n raise NotImplementedEr...
[ "0.5998637", "0.5981558", "0.5935656", "0.584955", "0.5685875", "0.55913717", "0.5541902", "0.54492784", "0.53929555", "0.5268971", "0.52280927", "0.5166402", "0.51386034", "0.5119002", "0.5103748", "0.50912446", "0.5041156", "0.5040203", "0.50098085", "0.49816176", "0.497052...
0.4563859
58
Gets the changed_by of this AuditEntry.
def changed_by(self): return self._changed_by
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def updated_by(self):\n return self._updated_by", "def last_modified_by(self):\n return self._last_modified_by", "def updated_by(self) -> \"str\":\n return self._attrs.get(\"updatedBy\")", "def updated_by(self) -> \"str\":\n return self._attrs.get(\"updatedBy\")", "def updated_b...
[ "0.7249279", "0.69695014", "0.67318934", "0.67318934", "0.67318934", "0.66954154", "0.6461869", "0.6311164", "0.6311164", "0.6311164", "0.6311164", "0.6311164", "0.6311164", "0.62398523", "0.6199881", "0.6086686", "0.6080386", "0.60497826", "0.60042036", "0.5695446", "0.56655...
0.830074
1
Sets the changed_by of this AuditEntry.
def changed_by(self, changed_by): self._changed_by = changed_by
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def changed_by(self):\n return self._changed_by", "def changed_by(self):\n return self._changed_by", "def updated_by(self, updated_by):\n\n self._updated_by = updated_by", "def updated_by(self, updated_by: \"str\"):\n self._attrs[\"updatedBy\"] = updated_by", "def updated_by(sel...
[ "0.70531774", "0.70531774", "0.6982425", "0.67455775", "0.67455775", "0.67455775", "0.65675133", "0.65675133", "0.60424423", "0.5959088", "0.58513176", "0.58513176", "0.58513176", "0.58513176", "0.58513176", "0.58513176", "0.5797555", "0.5767141", "0.5724656", "0.55524004", "...
0.8309313
0
Gets the id of this AuditEntry.
def id(self): return self._id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_id(self):\n return self._id", "def get_id(self):\n return self._id", "def get_id(self):\n return self._id", "def get_id(self):\n return self._id", "def get_id(self):\n return self._id", "def get_id(self):\n return self._id", "def id(self):\n retu...
[ "0.7254302", "0.7254302", "0.7254302", "0.7254302", "0.7254302", "0.7254302", "0.72303677", "0.71647584", "0.71460176", "0.7144614", "0.7144614", "0.7108297", "0.7108297", "0.7108297", "0.7108297", "0.7108297", "0.7108297", "0.7108297", "0.7108297", "0.7108297", "0.7108297", ...
0.0
-1
Sets the id of this AuditEntry.
def id(self, id): self._id = id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SetId(self, id):\n self.id = int(id)", "def set_id(self, id):\n self.__id = id", "def set_id(self, id):\n\n\t\tif id is not None and not isinstance(id, int):\n\t\t\traise SDKException(Constants.DATA_TYPE_ERROR, 'KEY: id EXPECTED TYPE: int', None, None)\n\t\t\n\t\tself.__id = id\n\t\tself.__ke...
[ "0.7630219", "0.7612315", "0.7529485", "0.75225174", "0.7452073", "0.7249684", "0.7249684", "0.7249684", "0.7179838", "0.7179838", "0.7179838", "0.7179838", "0.7179838", "0.7179838", "0.7179838", "0.7179838", "0.7179838", "0.7179838", "0.7179838", "0.7179838", "0.7179838", ...
0.0
-1
Gets the organization_id of this AuditEntry.
def organization_id(self): return self._organization_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def organization_id(self) -> str:\n return pulumi.get(self, \"organization_id\")", "def organization_id(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"organization_id\")", "def organization_id(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"organizatio...
[ "0.80762357", "0.78826576", "0.77492076", "0.77492076", "0.7006984", "0.69951683", "0.6884503", "0.6850317", "0.6845058", "0.6613094", "0.63587046", "0.63540274", "0.6339878", "0.62920094", "0.62616473", "0.62345904", "0.62345904", "0.6231323", "0.61555445", "0.61486125", "0....
0.84393626
0
Sets the organization_id of this AuditEntry.
def organization_id(self, organization_id): self._organization_id = organization_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def organization_id(self, organization_id):\n if organization_id is None:\n raise ValueError(\"Invalid value for `organization_id`, must not be `None`\") # noqa: E501\n\n self._organization_id = organization_id", "def org_id(self, org_id):\n\n self._org_id = org_id", "def organ...
[ "0.75153923", "0.730572", "0.71776944", "0.71776944", "0.71776944", "0.6829373", "0.6627145", "0.65207165", "0.64345294", "0.6204442", "0.60855114", "0.6005726", "0.6005726", "0.6001661", "0.6001661", "0.583284", "0.5821725", "0.582044", "0.56470793", "0.5548742", "0.55099416...
0.832213
1
Gets the entity of this AuditEntry.
def entity(self): return self._entity
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetEntity(self):\n return self.__entity", "def GetEntity(self):\n\t\treturn self.acad.ActiveDocument.Utility.GetEntity()", "async def get_entity(self):\n if not self.entity and await self.get_input_entity():\n try:\n self._entity =\\\n await self._cl...
[ "0.7614187", "0.65055144", "0.6384296", "0.62018824", "0.6095432", "0.60954", "0.60954", "0.6072708", "0.59698826", "0.59698826", "0.59698826", "0.59698826", "0.59698826", "0.59692883", "0.58679736", "0.5863771", "0.5792261", "0.57371694", "0.57202834", "0.56785864", "0.56451...
0.75384194
2
Sets the entity of this AuditEntry.
def entity(self, entity): allowed_values = ["Notification", "Organization", "OrganizationGateway", "Product", "User", "Subscription", "Profile", "ProductRatePlan", "Client", "Invoice", "PricingComponentValue", "Account", "PricingComponentValueChange", "PricingComponentTier", "PricingComponent", "PricingCalculat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def entity(self, entity):\n\n self._entity = entity", "def set_entity(cls, entity):\n # Preparing auto increment\n entity_count = cls.get_entity_count()\n new_key = \"entity:\" + str(entity_count + 1)\n\n # Set key to Entity\n entity.entity_key = new_key\n\n # Exe...
[ "0.77638084", "0.6836489", "0.6435825", "0.6292674", "0.615429", "0.60193974", "0.5944948", "0.5836807", "0.583231", "0.5793845", "0.5793845", "0.5743283", "0.5533288", "0.54508334", "0.54209375", "0.5344583", "0.5337989", "0.5325005", "0.5303377", "0.52966416", "0.5262462", ...
0.0
-1
Gets the entity_id of this AuditEntry.
def entity_id(self): return self._entity_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def entity_id(self) -> str:\n return self._entity_id", "def tracked_entity_id(self):\n return self._tracked_entity_id", "def get_key_by_entity(cls, entity):\n db_key = \"entity:\" + str(entity.entity_id)\n result = cls.db.keys(db_key)\n return (entity.entity_id if result else...
[ "0.7693048", "0.72340983", "0.62899536", "0.61061704", "0.6085583", "0.60490215", "0.60490215", "0.60326046", "0.60326046", "0.60326046", "0.60326046", "0.60326046", "0.60326046", "0.60319936", "0.60069406", "0.5994444", "0.59905154", "0.59829485", "0.5975086", "0.5975086", "...
0.8037113
4
Sets the entity_id of this AuditEntry.
def entity_id(self, entity_id): self._entity_id = entity_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def entity_id(self, entity_id: str):\n\n self._entity_id = entity_id", "def entity_id(self, entity_id):\n if entity_id is None:\n raise ValueError(\"Invalid value for `entity_id`, must not be `None`\")\n\n self._entity_id = entity_id", "def entities_id(self, entities_id):\n\n ...
[ "0.79976314", "0.79222083", "0.66796696", "0.65123117", "0.64531934", "0.6290769", "0.5910044", "0.5910044", "0.5910044", "0.5910044", "0.5910044", "0.5899952", "0.5899952", "0.5899952", "0.57038164", "0.5661641", "0.545111", "0.54498637", "0.5395395", "0.5363157", "0.5341813...
0.8073803
0
Gets the audit_action of this AuditEntry.
def audit_action(self): return self._audit_action
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_action(self):\n return self.__action", "def action(self):\n return self._get_field(\"action\")", "def get_action(self):\n return self.current_action", "def action(self):\n return self._action", "def action(self):\n return self._action", "def action(self):\n ...
[ "0.71937025", "0.6969079", "0.69373006", "0.68369156", "0.68369156", "0.68369156", "0.68369156", "0.68369156", "0.68369156", "0.66419053", "0.6547587", "0.6547587", "0.6547587", "0.65027106", "0.64371264", "0.63478076", "0.63173217", "0.6236077", "0.62267995", "0.62238157", "...
0.8121201
0
Sets the audit_action of this AuditEntry.
def audit_action(self, audit_action): allowed_values = ["Accept", "Active", "AwaitingPayment", "AwaitingRefund", "Cancelled", "Completed", "Created", "Error", "Expiring", "Expired", "Failed", "Migrated", "NeedsAmendments", "Paid", "Pending", "Provisioned", "Refunded", "Reject", "Trial", "Unknown", "Unpaid", "Up...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_action(self, action):\n self.action = action", "def set_action(self, action):\n self.action = action", "def set_action(self, action):\n self._action = action\n return self", "def action(self, action):\n if action is None:\n raise ValueError(\"Invalid valu...
[ "0.66921645", "0.66921645", "0.66859514", "0.66470796", "0.6639677", "0.65499735", "0.6252528", "0.6251429", "0.61876976", "0.61398673", "0.6064159", "0.60461444", "0.59672004", "0.5907352", "0.5907352", "0.5907352", "0.5907352", "0.5907352", "0.5907352", "0.5889515", "0.5769...
0.7367506
0
Gets the field_changes of this AuditEntry.
def field_changes(self): return self._field_changes
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetChanges(self):\n return self._changes", "def get_changed_columns(self):\r\n return [k for k,v in self._values.items() if v.changed]", "def get_instance_changes(self, instance_id=None):\n if instance_id:\n changes = self.instance_changes.get(instance_id)\n if change...
[ "0.68609107", "0.6590611", "0.62377644", "0.621888", "0.6127568", "0.60550255", "0.5940233", "0.5925335", "0.5840356", "0.5840356", "0.5838879", "0.58374155", "0.5817625", "0.5815635", "0.5807362", "0.5798377", "0.5789541", "0.5708215", "0.5708215", "0.5687627", "0.56683177",...
0.8374598
0
Sets the field_changes of this AuditEntry.
def field_changes(self, field_changes): self._field_changes = field_changes
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def field_changes(self):\n return self._field_changes", "def field_values(self, field_values):\n\n self._field_values = field_values", "def fields(self, fields):\n\n self._fields = fields", "def mark_field_changed(self, name):\n self.assert_known_field(name)\n assert not se...
[ "0.61595047", "0.5507908", "0.53668636", "0.5330242", "0.53061247", "0.52194923", "0.50769526", "0.5023602", "0.49466592", "0.4921573", "0.49189287", "0.48740104", "0.4870308", "0.4827835", "0.47986823", "0.47916147", "0.47897416", "0.47836465", "0.4755989", "0.47100684", "0....
0.8000916
0
Gets the new_entity of this AuditEntry.
def new_entity(self): return self._new_entity
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetEntity(self):\n return self.__entity", "def entity(self):\n return self._entity", "def entity(self):\n return self._entity", "def new_entity(self, new_entity):\n\n self._new_entity = new_entity", "def add_new_entry(self, ent):\n ent.inserted = time.strftime(\"%D\")\n...
[ "0.6181463", "0.59021616", "0.59021616", "0.58873767", "0.5741779", "0.5430238", "0.5360991", "0.5357177", "0.53207916", "0.5318232", "0.5270728", "0.5266742", "0.52565885", "0.5232584", "0.5209981", "0.5157979", "0.51241785", "0.51241785", "0.50976807", "0.50870144", "0.5085...
0.8268161
0
Sets the new_entity of this AuditEntry.
def new_entity(self, new_entity): self._new_entity = new_entity
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new_entity(self):\n return self._new_entity", "def new(self, new):\n\n self._new = new", "def entity(self, entity):\n\n self._entity = entity", "def set_entity(cls, entity):\n # Preparing auto increment\n entity_count = cls.get_entity_count()\n new_key = \"entity...
[ "0.68103546", "0.5976102", "0.596852", "0.5584641", "0.547989", "0.5396724", "0.5247832", "0.51539177", "0.49853706", "0.49630386", "0.48778757", "0.48662427", "0.48621497", "0.48537818", "0.4843221", "0.48238978", "0.48095122", "0.47993878", "0.4794472", "0.4772747", "0.4751...
0.8411291
0
Gets the state of this AuditEntry.
def state(self): return self._state
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def state(self):\n return self.get_state()", "def getState(self):\n return self._state", "def getState(self):\n return self._state", "def getState(self):\n return self.state", "def getState(self):\n return self.state", "def getState(self):\n return self.state", ...
[ "0.6980242", "0.68909866", "0.68909866", "0.6888418", "0.6888418", "0.6888418", "0.6842564", "0.6842564", "0.6842564", "0.6842564", "0.6842564", "0.6829437", "0.6829437", "0.6807538", "0.6770623", "0.6770623", "0.67589486", "0.67364025", "0.67311466", "0.6722468", "0.6722468"...
0.6820712
88
Sets the state of this AuditEntry.
def state(self, state): allowed_values = ["New", "Processed"] if state not in allowed_values: raise ValueError( "Invalid value for `state` ({0}), must be one of {1}" .format(state, allowed_values) ) self._state = state
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_state(self, state):\n self.state = state", "def setState(self, state):\n self.state = state", "def set_state(self, state):\n self.history = state", "def set_state(self,state):\n self.__state = state", "def state(self, state):\n\n self._state = state", "def state...
[ "0.66529185", "0.6615321", "0.6607238", "0.6602064", "0.65774506", "0.65774506", "0.65774506", "0.65774506", "0.65774506", "0.65774506", "0.65774506", "0.65774506", "0.65774506", "0.65774506", "0.65774506", "0.65774506", "0.65774506", "0.6543581", "0.6511255", "0.646553", "0....
0.0
-1
Gets the created of this AuditEntry.
def created(self): return self._created
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getCreated(self):\n return self.__created", "def Created(self):\n return self._get_attr('Created')", "def created(self):\n return datetime.utcfromtimestamp(self.create_ts)", "def created(self):\n return self.__created", "def created(self) -> str:\n return pulumi.get(s...
[ "0.7843015", "0.7493674", "0.7401042", "0.73507786", "0.7346627", "0.7346627", "0.7346627", "0.7182299", "0.7095998", "0.7095998", "0.7095998", "0.709257", "0.702105", "0.70156235", "0.70156235", "0.69822514", "0.69760865", "0.69514555", "0.693685", "0.6911589", "0.6911589", ...
0.7374519
7
Sets the created of this AuditEntry.
def created(self, created): self._created = created
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def created(self, created):\n if created is None:\n raise ValueError(\"Invalid value for `created`, must not be `None`\")\n\n self._created = created", "def set_created(self, dt):\n self.created = dt_to_iso(dt)", "def set_Created(self, value):\n super(MoneyReceivedInputSe...
[ "0.7562887", "0.7332002", "0.69526184", "0.6912635", "0.6912635", "0.6849902", "0.68028855", "0.6782158", "0.6782158", "0.6782158", "0.6782158", "0.6782158", "0.6782158", "0.6782158", "0.6760964", "0.6750482", "0.67365575", "0.67365575", "0.67365575", "0.6716858", "0.6693137"...
0.74819726
12
Returns the model properties as a dict
def to_dict(self): result = {} for attr, _ in iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_dict(self):\n return self.properties", "def to_dict(self):\n return self.properties", "def get_properties(self):\n return self.properties", "def asdict(self):\n return self._prop_dict", "def json(self):\n rv = {\n prop: getattr(self, prop)\n f...
[ "0.7751911", "0.7751911", "0.7340249", "0.73334646", "0.7297798", "0.72793365", "0.7160916", "0.71589255", "0.7151728", "0.7151728", "0.71290857", "0.71282333", "0.7123209", "0.7108751", "0.70626193", "0.7043936", "0.70319456", "0.7021481", "0.6967082", "0.6955236", "0.689819...
0.0
-1
Returns the string representation of the model
def to_str(self): return pformat(self.to_dict())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n return super().__str__() + self.model.__str__()", "def __str__(self) -> str:\n # noinspection PyUnresolvedReferences\n opts = self._meta\n if self.name_field:\n result = str(opts.get_field(self.name_field).value_from_object(self))\n else:\n ...
[ "0.85856134", "0.7814518", "0.77898884", "0.7751367", "0.7751367", "0.7712228", "0.76981676", "0.76700574", "0.7651133", "0.7597206", "0.75800353", "0.7568254", "0.7538184", "0.75228703", "0.7515832", "0.7498764", "0.74850684", "0.74850684", "0.7467648", "0.74488163", "0.7442...
0.0
-1
For `print` and `pprint`
def __repr__(self): return self.to_str()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pprint(*args, **kwargs):\n if PRINTING:\n print(*args, **kwargs)", "def print_out():\n pass", "def custom_print(*objects):\n print(*objects, sep=OFS, end=ORS)", "def _print(self, *args):\n return _ida_hexrays.vd_printer_t__print(self, *args)", "def _printable(self):\n ...
[ "0.75577617", "0.73375154", "0.6986672", "0.698475", "0.6944995", "0.692333", "0.6899106", "0.6898902", "0.68146646", "0.6806209", "0.6753795", "0.67497987", "0.6744008", "0.6700308", "0.6691256", "0.6674591", "0.6658083", "0.66091245", "0.6606931", "0.6601862", "0.6563738", ...
0.0
-1
Returns true if both objects are equal
def __eq__(self, other): return self.__dict__ == other.__dict__
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False", "def __eq__(self, other):\n if i...
[ "0.80885184", "0.80885184", "0.805514", "0.7983044", "0.79614645", "0.79614645", "0.7942978", "0.79307914", "0.79270965", "0.78980374", "0.78832436", "0.78832436", "0.78809714", "0.7873277", "0.7868898", "0.78659886", "0.78258073", "0.7820066", "0.7816123", "0.7807926", "0.78...
0.7966715
46
Returns true if both objects are not equal
def __ne__(self, other): return not self == other
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other) -> bool:\n return not self.__eq__(other)", "def __eq__(self, other):\n ...
[ "0.8456063", "0.83918154", "0.8144437", "0.8140196", "0.8132038", "0.8093834", "0.80918837", "0.80918837", "0.80918837", "0.80852824", "0.80852824", "0.807626", "0.807626", "0.80657643" ]
0.0
-1
if isfile, filefullname is full log file name, otherwise, is a message content
def commit_all(path, username, password, filefullname, isfile=True): lines = pysvn.st(path) for line in lines: if line.find('?') == 0: pysvn.py_cmd.command_str = 'svn add "' + line.replace('?','',1).strip() + '"' elif line.find('!') == 0: pysvn.py_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_filename(self, content):\n note_data = str.splitlines(content)\n try:\n line_one = note_data[0]\n except:\n self.log.info(\"Probable Empty note, no first line note content -> %s\", str(content))\n self.log.debug(\"Exception: %s\", sys.exc_info()[1])\n ...
[ "0.5824271", "0.56056905", "0.55256855", "0.5462426", "0.5430245", "0.542454", "0.537766", "0.533708", "0.5321802", "0.52948886", "0.52857125", "0.52817297", "0.52149", "0.52084816", "0.5196999", "0.5168999", "0.5159309", "0.5157626", "0.5124916", "0.5111165", "0.508437", "...
0.0
-1
if isfile, filefullname is full log file name, otherwise, is a message content targets is a file path that contained files and directories which will be commited
def commit_targets(path, targets, username, password, filefullname, isfile=True): #import pdb #pdb.set_trace() os.chdir(path); f = open(targets, 'r') lines = f.readlines() f.close() if len(lines) == 0: print(targets + "内容为空,没有内容需要提交。") retu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _log_fe_file(fe_file):\n mode = ' '\n if 'mode' in fe_file:\n mode = fe_file['mode']\n sha1 = ' '\n if 'sha1' in fe_file:\n sha1 = p4gf_util.abbrev(fe_file['sha1'])\n\n return NTR('{mode} {action} {sha1} {path}') \\\n .format( mode = mode\n ,...
[ "0.52691615", "0.5039596", "0.5001261", "0.49933988", "0.4985368", "0.49669752", "0.49560165", "0.49521917", "0.49425593", "0.49176311", "0.4898986", "0.4898172", "0.48861098", "0.48836476", "0.48686358", "0.4850638", "0.48221838", "0.48219132", "0.48186952", "0.48127997", "0...
0.5567791
0
Initializes a GHOSTpy data object for a vtk data file
def __init__(self, filename=None, vector=None, name="vtkData"): assert isinstance(name, tp.StringType), "Must specify a string Name for the data Mode" self.name = name assert isinstance(filename, tp.StringType), "Filename must be a valid string" self.file = filename self.reader =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, dataset_path):\n super(TorchData, self).__init__()\n self.dataset = h5py.File(dataset_path, 'r')\n self.bg = self.dataset['bg']\n self.vocal = self.dataset['vocal']\n self.mix = self.dataset['mix']\n self.len = self.bg.shape[0]", "def __init__(self):\n...
[ "0.66489905", "0.6566427", "0.64748913", "0.63771063", "0.6344102", "0.6249736", "0.6247884", "0.62272847", "0.6215209", "0.6193867", "0.6170646", "0.6166924", "0.6142293", "0.61410266", "0.6140544", "0.6111556", "0.6065023", "0.6058473", "0.6036024", "0.6024465", "0.6016881"...
0.6299661
5
Generates and returns the vtk reader object for the file associated with the data object
def vtk_xml_reader(self): reader = vtk.vtkXMLStructuredGridReader() reader.SetFileName(self.file) reader.Update() assert isinstance(reader, vtk.vtkObject) return reader
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vtk_poly_data_reader(*args, **kwargs):\n import itk\n instance = itk.VTKPolyDataReader.New(*args, **kwargs)\n return instance.__internal_call__()", "def getReader(self):\n return Tes3Reader(self.inName,cStringIO.StringIO(self.data))", "def New(*args, **kargs):\n obj = itkVTKPolyDataR...
[ "0.6545355", "0.6346199", "0.6157321", "0.6139681", "0.5995363", "0.59510255", "0.59271294", "0.5886643", "0.58603144", "0.58483154", "0.5797087", "0.5774329", "0.5770789", "0.5755884", "0.57461375", "0.5723048", "0.57099384", "0.5707522", "0.5695322", "0.5686459", "0.5674991...
0.6800043
0
responds to list of xyz components and returns the values of data at the components
def get_xyz(self, xyz): if cm.mag(xyz) < self.get_actual_inner_boundary(): val = np.array([np.NaN, np.NaN, np.NaN]) else: points = self.__get_points_object__([xyz]) val = self.__get_data_at_points__(points)[0] # print (val) return val
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getValues(self,x,y):\n\n\t\tassert isinstance(x,np.ndarray) and isinstance(y,np.ndarray)\n\n\t\t#x coordinates\n\t\tif type(x)==u.quantity.Quantity:\n\t\t\t\n\t\t\tassert x.unit.physical_type==self.side_angle.unit.physical_type\n\t\t\tj = np.mod(((x / self.resolution).decompose().value).astype(np.int32),self.d...
[ "0.6473575", "0.6461083", "0.63533175", "0.6340951", "0.6307679", "0.62964714", "0.62887037", "0.62402767", "0.6181006", "0.618094", "0.61498463", "0.6105574", "0.60909164", "0.60865474", "0.60687596", "0.6005669", "0.5960566", "0.5935796", "0.5934359", "0.5930866", "0.592750...
0.60845554
14
responds to list of rlp components and returns the values of data at the components
def get_rlp(self, rlp): xyz = cm.sphere_to_cart(r=rlp[0], lam=rlp[1], phi=rlp[2]) return self.get_xyz(xyz=xyz)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_data(self):\n return [10, 20, 30]", "def _get_values(self) -> ty.List[float]:\r\n ...", "def values():", "def palues(self):\n return self[self.peys()]", "def palues(self):\n return self[self.peys()]", "def GetValues(self):", "def getVals(cdli):\n \n \n swh = calcOut...
[ "0.5593267", "0.5532237", "0.55112827", "0.55068815", "0.55068815", "0.54754645", "0.5474127", "0.5388978", "0.5347106", "0.53426206", "0.53393877", "0.53317666", "0.53205156", "0.5317756", "0.5313413", "0.529197", "0.52899975", "0.527608", "0.52432126", "0.52394253", "0.5239...
0.54171836
7
get the vtk point object for the location (x,y,z)
def __get_points_object__(xyz): # TODO: Need to fix this to handle all points, not just the first source = vtk.vtkPointSource() source.SetCenter(xyz[0]) source.SetRadius(0) source.SetNumberOfPoints(1) source.Update() return source
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def point(self):\n return self.x, self.y, self.z", "def point(x, y, z):\n return point_or_vector(x,y,z,1.0)", "def getPoint(self):\n return Point(*self.position)", "def __getitem__(self, *args):\n return _itkSurfaceSpatialObjectPointPython.vectoritkSurfaceSpatialObjectPoint3___getitem...
[ "0.7138827", "0.6928828", "0.6814521", "0.6653981", "0.6626665", "0.6483561", "0.6447883", "0.6434501", "0.63675106", "0.6335543", "0.632635", "0.62961286", "0.6287827", "0.6256243", "0.6240352", "0.62284607", "0.62024504", "0.6198469", "0.61825156", "0.6178122", "0.6170829",...
0.71322364
1
extract the values at the given points from the dataset
def __get_data_at_points__(self, points): file_data = self.reader.GetOutput() probe = vtk.vtkProbeFilter() probe.SetInputConnection(points.GetOutputPort()) probe.SetSourceData(file_data) probe.Update() b = vnp.vtk_to_numpy(probe.GetOutput().GetPointData().GetArray(self.v...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getPointValues(self, *args, **kwargs):\n ...", "def get_data_on_points(self, varname, record, points):\n res = float('nan')*np.ones((len(points)), dtype=np.float64)\n if len(np.shape(np.array(points))) != 2:\n raise TelemacException('Warning problem with the list of '\\\n ...
[ "0.7277286", "0.70598024", "0.6576054", "0.6518973", "0.64923763", "0.6459009", "0.6390364", "0.6366006", "0.6219205", "0.6143739", "0.6140725", "0.6134579", "0.6126942", "0.6115077", "0.6099375", "0.60878146", "0.60623926", "0.6060969", "0.6037294", "0.60322315", "0.6028742"...
0.72260445
1
Set inputs as attributes
def __init__(self, model_locs=[], feature_indices=[], n_estimators=5, min_samples_split=2, max_features=1.0): self.model_locs = model_locs self.feature_indices = feature_indices self.n_estimators = n_estimators self.min_samples_split = min_samples_split s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_inputs(self, inputs):\n self.attributes[\"inputs\"] = inputs", "def _set_attributes(self):", "def set(self, **inputs):\r\n for property, value in inputs.items():\r\n try:\r\n setattr(self,property,value)\r\n except:\r\n raise Exception(p...
[ "0.77063924", "0.6776342", "0.65697664", "0.64609134", "0.6306918", "0.6277563", "0.6277563", "0.6277563", "0.6209969", "0.6209569", "0.61492646", "0.608721", "0.607984", "0.606062", "0.606062", "0.6050611", "0.59926695", "0.5981237", "0.59343344", "0.59047663", "0.5884226", ...
0.0
-1
Loads model either from local or S3 locations. Will return intput if already a model object
def _load_model(self, loc): # If not a string, return input if not (isinstance(loc, str) or isinstance(loc, unicode)): return loc # If location is in S3, copy to local, then unpickle to_delete = False if "s3" in loc: tmp_loc = "{0}/tmp_file_{1}.obj".for...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_model(self, filename):\n model_object = self.s3_resource.Object(self.bucket_name, self.models_path + str(filename)).get()['Body'].read()\n model = pickle.loads(model_object)\n return model", "def load_model(model_name):\r\n model = joblib.load(model_name)\r\n return model", ...
[ "0.75516003", "0.6837531", "0.68298393", "0.6772153", "0.67715466", "0.67704576", "0.67639816", "0.67479384", "0.67256385", "0.67108077", "0.6706669", "0.6681385", "0.6663933", "0.6650679", "0.6566042", "0.65559953", "0.6542129", "0.6527688", "0.64914966", "0.648556", "0.6479...
0.83705956
0
Runs predictions of input models on input data X and stacks them into a single feature space
def _transform_models(self, X): out = [] for index in range(len(self.models)): arr = np.array([list(np.array(x)[self.feature_indices[index]]) for x in X]) out.append(self.models[index].predict_proba(arr)) return np.hstack(out)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def predict(self, X):\n predictions = []\n for p in X:\n predictions.append(self.feedForward(p))\n return predictions", "def predicts(self,X):\n return [self.predict(x) for x in X]", "def predict(self, x):\n assert isinstance(x, np.ndarray)\n \n outpu...
[ "0.71311057", "0.71158206", "0.69986844", "0.6927444", "0.6925956", "0.69017816", "0.68863237", "0.68795127", "0.6879229", "0.6879229", "0.6879229", "0.68649733", "0.6821715", "0.6821715", "0.67849183", "0.67849183", "0.67849183", "0.67637765", "0.6724041", "0.6702043", "0.66...
0.6931517
3
Fits final random forest on input data
def fit(self, X, y=None): self.models = [ self._load_model(loc) for loc in self.model_locs] self.estimator = Pipeline(steps=[ ("imputer", SimpleImputer()), ("clf", RandomForestClassifier( n_estimators=self.n_estimators, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_random_forest(X_train, y_train):", "def train(self, dataset): \n self.random_forest.fit(dataset[:,:-1], dataset[:,-1])", "def train_random_forest():\n train_model(RandomForestRegressor(max_depth=4, random_state=42),\n dataset_file_name=RANDOM_FOREST_DEFAULT_DATASET,\n ...
[ "0.78119534", "0.71698594", "0.7003747", "0.67885935", "0.67854935", "0.6777884", "0.66770536", "0.6596427", "0.6559462", "0.65318215", "0.6517431", "0.6473543", "0.6457659", "0.6455572", "0.64402", "0.63449943", "0.6314545", "0.6288049", "0.6261099", "0.62489575", "0.6248372...
0.0
-1
Create and return a new object. See help(type) for accurate signature.
def __new__(*args, **kwargs): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_object():\n return object()", "def create(cls, _):\n return cls", "def __newobj__(cls, *args):\n return cls.__new__(cls, *args)", "def create(cls):\n pass\n return cls()", "def __new__(cls):\n return object.__new__(cls)", "def __new__(cls):\n return objec...
[ "0.75213", "0.74258864", "0.7226946", "0.7224665", "0.7096967", "0.7096967", "0.7059375", "0.7007428", "0.6915441", "0.68688554", "0.68153423", "0.6813235", "0.68021035", "0.6691957", "0.66290957", "0.6586394", "0.6571268", "0.655839", "0.65477526", "0.6545693", "0.65405715",...
0.0
-1
Implement setattr(self, name, value).
def __setattr__(self, *args, **kwargs): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __setattr__(self, name, value):\n self.set(**{name: value})", "def set_attr(self, name, value):\n setattr(self, name, value)", "def __setattr__(self, name, value):\n if not hasattr(self, name):\n raise AttributeError(\"'%s' object has no attribute '%s'\" % (type(self).__name...
[ "0.868889", "0.8361373", "0.8290292", "0.8283524", "0.82243794", "0.8204499", "0.8099823", "0.8099823", "0.8071226", "0.80402154", "0.8024459", "0.79978293", "0.79883593", "0.7987577", "0.79493016", "0.7936443", "0.79316676", "0.7890851", "0.78896946", "0.78018266", "0.775468...
0.0
-1
Create a pdf containing histograms for each binary or categorical variable, and one of several types of plots for each continuous variable.
def distributions( data, filename: str, continuous_kind: str = "count", nrows: int = 4, ncols: int = 3, quality: str = "medium", variables: Optional[List[str]] = None, sort: bool = True, ): # Limit variables if variables is not None: data = data[variables] # Check fi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gen_plots(uf_dict, f_dict, min_x, max_x, min_y, max_y, axes, name, histogram, total):\n with PdfPages(name) as pdf:\n total_xuf = []\n total_yuf = []\n total_xf = []\n total_yf = []\n for entry in uf_dict:\n print 'Making plot for ' + entry\n xuf, yuf...
[ "0.6745939", "0.6359941", "0.6313858", "0.62612647", "0.6192836", "0.61120015", "0.61061555", "0.610596", "0.6104878", "0.604542", "0.6015174", "0.6009718", "0.5975193", "0.5929583", "0.5924665", "0.5921028", "0.5911756", "0.5888007", "0.58853716", "0.5867796", "0.5837837", ...
0.62519884
4
Makes matrix based on geeksforgeeks algorithm
def MakeMatrixSCS(matrix,k,l,p,q): # initializes and fills in matrix # rows for p, columns for q matrix = [[0 for _ in range(l+1)] for __ in range(k+1)] matrix[0] = [x for x in range(len(matrix[0]))] i = -1 for row in matrix: i += 1 row[0] = i # Go through matrix row by ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gen_matrix(e):\n\tif e < 1:\n\t\treturn None\n\tm_list = [[[1, 2], [3, 0]]]\n\t_b = m_list[0]\n\tfor n in xrange(1, e):\n\t\tm = m_list[n - 1]\n\t\tm_list.append(\n\t\t\t[\n\t\t\t\t[4 * i + _b[0][0] for i in m[0]] + [4 * i + _b[0][1] for i in m[0]],\n\t\t\t\t[4 * i + _b[0][0] for i in m[1]] + [4 * i + _b[0][1]...
[ "0.7141072", "0.7085696", "0.6904866", "0.6904866", "0.6890652", "0.6837635", "0.6757303", "0.67340225", "0.67102045", "0.6657824", "0.6629249", "0.65826946", "0.656059", "0.65432346", "0.6537575", "0.65295005", "0.6517307", "0.6475387", "0.6474679", "0.6470622", "0.64115626"...
0.6096265
58
Returns shortest common supersequence by interpreting dynamic matrix
def InterpretMatrixSCS(matrix,k,l,p,q): # i = row, j = col, p = row, q = col scs = [] # Start at the bottom-rightmost corner i = k j = l while i > 0 and j > 0: # If characters match... if p[i-1] == q[j-1]: scs.insert(0,p[i-1]) i = i-1 j = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def original_solution():\n matrix = get_data()\n # Construct Graph\n G = nx.DiGraph()\n rows, cols = len(matrix), len(matrix[0])\n for r in xrange(rows):\n for c in xrange(cols):\n if 0 < c:\n G.add_edge(r*cols + c, r*cols + c - 1, weight=matrix[r][c-1])\n ...
[ "0.6333008", "0.6164781", "0.6149122", "0.60351145", "0.59336144", "0.58918333", "0.5833834", "0.5822766", "0.5760534", "0.57252115", "0.5724386", "0.57104063", "0.5684454", "0.5680767", "0.5664603", "0.56622934", "0.56382865", "0.5634048", "0.5630925", "0.55978227", "0.55816...
0.5609969
19
Default units for molar amount being a float/int is nmol (nanomoles).
def parse_nmol(nmoles: float | int | str | Quantity[D]) -> Quantity[D]: if isinstance(nmoles, (float, int)): nmoles = f"{nmoles} nmol" if isinstance(nmoles, str): q = ureg.Quantity(nmoles) if not q.check(ureg.nmol): raise ValueError(f"{nmoles} is not a valid quantity here (s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def default_units(self) -> t.Union[unyt.Unit, None]:\n return self._default_units", "def units(self):\n pass", "def default_units(x, axis):\n return getattr(x, 'units', None)", "def native_unit_of_measurement(self) -> str:\n return f\"{CURRENCY_CENT}/{UnitOfVolume.LITERS}\"", "d...
[ "0.6858042", "0.68269944", "0.67642283", "0.66858286", "0.66278744", "0.6436181", "0.64125", "0.6410191", "0.6327301", "0.63199526", "0.6287602", "0.62458223", "0.6192925", "0.61803764", "0.6169523", "0.61619854", "0.6155139", "0.6149782", "0.61384594", "0.6129135", "0.612402...
0.6041342
26
Calculates concentration of DNA sample given an absorbance reading on a NanoDrop machine.
def measure_conc( absorbance: float | int | Sequence[float | int], ext_coef: float | int ) -> Quantity[D]: if isinstance(absorbance, (float, int)): ave_absorbance = absorbance elif _has_length(absorbance): if len(absorbance) == 0: raise ValueError(f"absorbance cannot be an empty ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def average_concentration():\n x10 = 0 # HCl gas fraction on the droplet surface, [/]\n x30 = pwater / pre # water vapour fraction in the pipe, [/]\n x11 = phcl / pre # HCl gas fraction in the pipe, [/]\n x31 = 12.3e-3 # water vapour fraction on the droplet surface, [/]\n if x30 ...
[ "0.59773076", "0.586348", "0.56886095", "0.5628015", "0.5620107", "0.5573554", "0.5486909", "0.54763275", "0.5437029", "0.5413402", "0.5393984", "0.5359722", "0.5347714", "0.53138226", "0.52629703", "0.5205052", "0.51566654", "0.5143802", "0.5136937", "0.512497", "0.51159346"...
0.511862
20
Tests if `content` is UTF8.
def _is_utf8(filename: str) -> bool: import codecs try: f = codecs.open(filename, encoding="utf-8", errors="strict") for _ in f: pass return True except UnicodeDecodeError: return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_text(content):\n if b\"\\0\" in content:\n return False\n if not content: # Empty files are considered text\n return True\n # Try to decode as UTF-8\n try:\n content.decode(\"utf8\")\n except UnicodeDecodeError:\n return False\n else:\n return True", "...
[ "0.7579349", "0.67203206", "0.65982825", "0.63214815", "0.62996536", "0.62089914", "0.61764824", "0.61721087", "0.6123802", "0.6123237", "0.6099631", "0.60387695", "0.6030514", "0.5989804", "0.597334", "0.5968493", "0.59362227", "0.58833", "0.58812207", "0.5879804", "0.587365...
0.69245964
1
Indicates how much volume to add to a dry DNA sample to reach a particular concentration, given data in an Excel/CSV file in the IDT format, displaying the result in a jupyter notebook.
def display_measure_conc_from_specs( filename: str, absorbances: dict[str, float | int | Sequence[float] | Sequence[int]] ) -> None: from IPython.display import Markdown, display from tabulate import tabulate names_to_concs = measure_conc_from_specs(filename=filename, absorbances=absorbances) head...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main(input_data_path, output_data_path, window):\n # open data info dataframe\n info_df = pd.read_csv(input_data_path + 'hemorrhage_diagnosis_raw_ct.csv')\n # replace No-Hemorrhage to hemorrange\n info_df['Hemorrhage'] = 1 - info_df.No_Hemorrhage\n info_df.drop(columns='No_Hemorrhage', inplace=T...
[ "0.5684228", "0.5403021", "0.511662", "0.5066244", "0.5057828", "0.50575054", "0.50449395", "0.5012537", "0.49656743", "0.4963754", "0.49560496", "0.49244177", "0.48983654", "0.48943153", "0.48501953", "0.48478153", "0.48403314", "0.48340163", "0.48295167", "0.48283863", "0.4...
0.5008113
8
Utility templatetag filter to avoid double translations of application names.
def trans_app(value): return _(value.title())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_template_tags_pgettext(self):\n trans_real._active = Local()\n trans_real._translations = {}\n with translation.override(\"de\"):\n # Nonexistent context\n t = self.get_template(\n '{% load i18n %}{% blocktranslate context \"nonexistent\" %}May'\n ...
[ "0.57928973", "0.56929904", "0.5665104", "0.5644416", "0.559896", "0.5557011", "0.545776", "0.54576653", "0.54251087", "0.5404726", "0.54015297", "0.5391843", "0.53435445", "0.53083515", "0.5285667", "0.5259713", "0.5222787", "0.51800734", "0.5176696", "0.5171347", "0.5166482...
0.6428007
0
Registers a model class
def RegisterModel(model_name): def decorator(f): MODEL_REGISTRY[model_name] = f return f return decorator
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def register(cls, model):\n cls.models[model] = True", "def register_class(obj):\r\n try:\r\n KnownClass.objects.get(module_name=obj.__module__, class_name=obj.__class__.__name__)\r\n except DoesNotExist:\r\n # Create it\r\n KnownClass(module_name = obj.__mod...
[ "0.7717733", "0.74279255", "0.7394402", "0.70879585", "0.7059945", "0.6857427", "0.673685", "0.6717115", "0.6713818", "0.6709794", "0.66329676", "0.6587194", "0.6438931", "0.6266869", "0.62524843", "0.624781", "0.6202028", "0.6178571", "0.61741585", "0.617413", "0.6161039", ...
0.66213584
11
The following is a simple function to implement weighted random selection in Python. Given a list of weights, it returns an index randomly, according to these weights
def weighted_choice(weights): totals = [] running_total = 0 for w in weights: running_total += w totals.append(running_total) rnd = random.random() * running_total for i, total in enumerate(totals): if rnd < total: return i
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def select(weights):\n r = random.random() * sum(weights)\n s = 0.0\n for k,w in enumerate(weights):\n s += w\n if r <= s:\n return k\n raise RuntimeError(\"select WTF from %s\" % weights)", "def sample_from(self, weights):\n total = sum(weights)\n rnd = total *...
[ "0.82606566", "0.8147948", "0.7802385", "0.77919173", "0.77846617", "0.7762445", "0.7742134", "0.76883686", "0.7550791", "0.7534086", "0.75046813", "0.7490498", "0.748244", "0.74608684", "0.7452026", "0.7432589", "0.7383656", "0.73409927", "0.7274987", "0.7147634", "0.7080318...
0.8362862
0
Print a styled error message.
def serror(message, *args, **kwargs): if args or kwargs: message = message.format(*args, **kwargs) return click.secho(message, fg='white', bg='red', bold=True)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def error(message='Ops, there are some error...'):\n print(colorful_text(message, Fore.RED))", "def print_error(message: str):\n print_with_color(message, constant.Color.FAIL)", "def error_message(message='Ops, there are some error...'):\n print(colorful_text(message, Fore.RED))", "def err(msg):\n ...
[ "0.807785", "0.79872817", "0.7983986", "0.7747794", "0.7738565", "0.76601845", "0.7654", "0.75751185", "0.7562811", "0.7536512", "0.7508462", "0.7494146", "0.7458741", "0.7305747", "0.7247944", "0.72314024", "0.721622", "0.71839553", "0.7161282", "0.71566397", "0.69877297", ...
0.7231918
15
Map some aliases to their 'real' names.
def get_command(self, ctx, cmd_name): cmd_name = self.MAP.get(cmd_name, cmd_name) return click.Group.get_command(self, ctx, cmd_name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _rename_aliases(input: dict[str, Any]) -> dict[str, Any]:\n return {_UI_FIELD_ALIASES.get(k, k): v for k, v in input.items()}", "def translate_alias(*alias_names):\n return '__'.join(alias_name.replace('.', '__') for alias_name in alias_names)", "def reverse_aliases():\n result = {}\n aliases =...
[ "0.743735", "0.74046046", "0.6895476", "0.67730415", "0.67107356", "0.6590195", "0.65560895", "0.65387875", "0.65088105", "0.64239204", "0.64032704", "0.6340851", "0.6325501", "0.63177884", "0.62834215", "0.6244385", "0.6232097", "0.61849904", "0.6144075", "0.6122118", "0.603...
0.0
-1
Parses the use's command line argument and returns the appropriate list of files.
def parse_arguments(): if len(sys.argv)==1: # no arguments supplied print ("Not enough arguments have been provided") print ("Usage: python gdp_plots.py <filenames>") print ("Options: -a: plot all gdp data in current directory") sys.exit() if sys.argv[1] == '-a' : fi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _parse_args_files(self, filematch):\n files, start_pos = [], 0\n while True:\n pos_a = self.cmd.find(filematch, start_pos)\n if pos_a > 0:\n pos_b = self.cmd.find(' ', pos_a)\n if pos_b > 0:\n files.append(self.cmd[pos_a:pos_b...
[ "0.72466576", "0.70566356", "0.70298886", "0.6989811", "0.69031173", "0.6775648", "0.6678286", "0.6585601", "0.6568925", "0.6557616", "0.64935684", "0.64906317", "0.6489036", "0.6487588", "0.64503473", "0.64449847", "0.6427273", "0.64082843", "0.63974094", "0.6387201", "0.638...
0.7244765
1
Plot all files in file_list using Pandas and Matp[lotlib. Each data file is its own plot.
def create_plots(file_list): # load data and transpose so that country names are # the columns and their gdp data becomes the rows # read data into a pandas dataframe and transpose for filename in file_list: data = pandas.read_csv(filename, index_col = 'country').T # create a p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_files(n=15):\n lod = read_files(n)\n\n for i in range(len(lod)):\n plt.plot(range(len(lod[i])), lod[i])\n\n plt.show()", "def real_time_plot(files):\n global len_data, first_iter, colors\n\n for i,F in enumerate(files):\n\n # Load data\n data = pylab.loadtxt(F, delimiter=',', ski...
[ "0.71749127", "0.69367737", "0.6857739", "0.6779122", "0.64660704", "0.63999444", "0.6350419", "0.63171303", "0.6292504", "0.62442714", "0.62001306", "0.6139794", "0.6138147", "0.6124569", "0.61201525", "0.5935963", "0.5925208", "0.5872423", "0.5801415", "0.5780353", "0.57756...
0.72236323
0
derive the format string
def getFormat(headings): Indent = 4 DescWid = 20 ColWid = 12 # figure out how wide our columns have to be wid = 0 for s in headings: if len(s) > wid: wid = len(s) if wid >= ColWid: ColWid = wid + 1 # generate the format string f = "" i = 0 while ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def format(self) -> str:", "def formatted(self) -> str:\r\n ...", "def asformat(self, format):", "def format(self, *args, **kwargs) -> String:\n pass", "def __repr__(self) -> str:\r\n\r\n saida = \"Format: \"\r\n x = self.getformat()\r\n for _ in range(len(x)):\r\n ...
[ "0.8339661", "0.76596606", "0.7488738", "0.74169266", "0.7323333", "0.730335", "0.7236924", "0.72104406", "0.7163708", "0.7051208", "0.70259625", "0.70259625", "0.70092046", "0.700394", "0.69904286", "0.6985027", "0.6962108", "0.6933327", "0.6919136", "0.69117975", "0.6844449...
0.65137607
33