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
Print out all attributes, with an indentation level.
def printout_all(self, indent_level): indent = " "*indent_level*INDENTATION_MULTIPLIER print(indent, "Cloud Virtual Resource ID:", self.ID, sep='') print(indent, "|-name:", self.name, sep='') print(indent, "|-info:", self.info, sep='') print(indent, "|-IP address:", self.IP_add...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_attrs(self):\n for attribute in self.__dict__.keys():\n print(attribute)", "def print_attribute(attributes):\n for attribute in attributes:\n print ' ',\n change_color_by_tag(attribute)\n if attribute['ExtAttributes']:\n print_extattributes_of_mem...
[ "0.7907038", "0.7637966", "0.7155113", "0.7127499", "0.699982", "0.69641304", "0.6960341", "0.6898987", "0.684572", "0.6805746", "0.67901194", "0.67732644", "0.67293435", "0.6668916", "0.6649524", "0.6606475", "0.65686685", "0.65122306", "0.64923453", "0.6455977", "0.64494777...
0.5749131
70
Function to initialize cloud virtual resource data.
def init_cloud_virtual_resources(): test_cldvirt_resources = [] # add info to list in memory, one by one, following signature values cldvirtres_ID = 1 cldvirtres_name = "nova-compute-1" cldvirtres_info = "nova VM in Arm pod" cldvirtres_IPAddress = "50.60.70.80" cldvirtres_URL = "http://50.6...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(__self__,\n resource_name: str,\n args: VirtualHardDiskArgs,\n opts: Optional[pulumi.ResourceOptions] = None):\n ...", "def pre_virtual_machine_create(self, resource_dict):\n pass", "def __init__(__self__,\n resource_nam...
[ "0.65209603", "0.64640987", "0.63841754", "0.63472927", "0.63000673", "0.62648845", "0.625409", "0.62490654", "0.62399304", "0.6233856", "0.62064767", "0.61925113", "0.61889744", "0.61788136", "0.6159353", "0.6158444", "0.61480516", "0.6146311", "0.6145305", "0.6139789", "0.6...
0.7303633
0
Print out all attributes, with an indentation level.
def printout_all(self, indent_level): indent = " "*indent_level*INDENTATION_MULTIPLIER print(indent, "VNF or e2e Service ID:", self.ID, sep='') print(indent, "|-name:", self.name, sep='') print(indent, "|-info:", self.info, sep='') print(indent, "|-IP address:", self.IP_address...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_attrs(self):\n for attribute in self.__dict__.keys():\n print(attribute)", "def print_attribute(attributes):\n for attribute in attributes:\n print ' ',\n change_color_by_tag(attribute)\n if attribute['ExtAttributes']:\n print_extattributes_of_mem...
[ "0.79098475", "0.76404846", "0.71579635", "0.7130595", "0.7002356", "0.6967273", "0.6959917", "0.68992954", "0.6844863", "0.6809012", "0.6792403", "0.6774788", "0.6733136", "0.6671675", "0.6648593", "0.6605866", "0.6567369", "0.651564", "0.649377", "0.64581263", "0.64466727",...
0.55880797
98
Function to initialize VNFs and e2e Services data.
def init_VNFs_Services(): test_VNFs_Services = [] # add info to list in memory, one by one, following signature values vnf_serv_ID = 1 vnf_serv_name = "vCPE-1" vnf_serv_info = "virtual CPE in Arm pod" vnf_serv_IPAddress = "5.4.3.2" vnf_serv_URL = "http://5.4.3.2:8080" vnf_serv_related_p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(self):\n self.initialize_edges()\n self.initialize_prob()\n self.initialize_total_input_dict()\n\n self.initialize_fpmusigv_dict()", "def _initialize_data(self):\n self.reset_count = 0\n self._idn_no_firmware = \"KEPCO,BOP 50-20,E1234,\"\n self._fir...
[ "0.6000072", "0.5982209", "0.59133905", "0.58482045", "0.5846955", "0.5802692", "0.57983714", "0.57908916", "0.57861805", "0.57234365", "0.5716901", "0.57001555", "0.56514275", "0.5569302", "0.553498", "0.5508897", "0.5441034", "0.54278976", "0.5421931", "0.5419489", "0.54168...
0.6732011
0
Append an object to a list of strings and adds a timestamp.
def append_to_list(self, string_to_append): if type(string_to_append)==str: current_time = datetime.now() self.__string_list.append(string_to_append) self.__timestamp_list.append(current_time) # timestamp will have the same index as string else: print("ap...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add(self, timestamp):\n self.total_count += 1\n self.times.append(timestamp)", "def append(self, object):\r\n raise NotImplementedError()", "def append(self, obj):\r\n raise NotImplementedError", "def append(self, ts: Union[str, datetime.datetime, None], attribute: Any, raise_...
[ "0.63131636", "0.60031503", "0.5990919", "0.5893538", "0.58589745", "0.58204615", "0.5716781", "0.56838316", "0.5644069", "0.56173307", "0.56059915", "0.5589093", "0.5588692", "0.55833554", "0.55797154", "0.5551652", "0.55227566", "0.55158985", "0.5504161", "0.5495428", "0.54...
0.78029543
0
return a list of strings with timestamps as prefixes (not showing microseconds).
def get_timestamped_strings(self): ret_list = [] i = 0 while i < len(self.__string_list): ret_list.append(self.__timestamp_list[i].strftime("%Y-%m-%d %H:%M:%S")+" "+self.__string_list[i]) i += 1 return ret_list
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_time_strs(self):\n\n log(\"Getting time strings starting at {}\".format(self._t0))\n tz = dt.timezone.utc\n mkdt = lambda n: dt.datetime.fromtimestamp(\n self._t0 - (self._delta * n),\n tz=tz\n )\n ns = range(self._frames, 0, -1)\n return [mkd...
[ "0.7256951", "0.6693242", "0.6453684", "0.6298663", "0.62940955", "0.61848104", "0.6147845", "0.6098919", "0.6096851", "0.6066497", "0.6043481", "0.603737", "0.59519106", "0.58646226", "0.5857015", "0.58160734", "0.5814002", "0.5814002", "0.5812247", "0.5737909", "0.57244587"...
0.78146636
0
Generic function to dump all Challenge Execution data in a CSV file.
def write_to_csv(self): dump_list = [] # add rows one by one, each as a list, even if only 1 element dump_list.append(["challenge execution ID",self.ID]) dump_list.append(["challenge execution name",self.name]) dump_list.append(["challenge definition ID",self.challenge_def_ID...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_to_csv(self):\n\n dump_list = []\n\n # add rows one by one, each as a list, even if only 1 element\n\n dump_list.append([\"test execution ID\",self.ID])\n dump_list.append([\"test execution name\",self.name])\n\n dump_list.append([\"test definition ID\",self.test_def_ID...
[ "0.67913586", "0.6477758", "0.6425062", "0.62495226", "0.6236619", "0.6227798", "0.6211598", "0.61715055", "0.6133314", "0.61221945", "0.6114023", "0.6110165", "0.60603863", "0.6050782", "0.6025989", "0.5951282", "0.5934519", "0.5933892", "0.59329176", "0.59259146", "0.591796...
0.75044805
0
Append a metric value (MetricValue) to the list. MetricValue already has a timestamp attribute.
def append_to_list(self, metric_value_to_append): if type(metric_value_to_append)==MetricValue: self.__metric_value_list.append(metric_value_to_append) else: print("appended object must be a MetricValue, metric_value_to_append=",metric_value_to_append) sys.exit() # s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def append(self, value):\n self.values.append(value)\n return value", "def log(self, metric_name: str, value: float) -> None:\n if metric_name in self.metrics:\n self.metrics[metric_name].append(value)\n else:\n self.metrics[metric_name] = [value]", "def append...
[ "0.6807644", "0.67213684", "0.6580341", "0.65766835", "0.6570106", "0.6512985", "0.6349774", "0.62712246", "0.62586963", "0.6248036", "0.6227115", "0.62080497", "0.6151301", "0.6121657", "0.6113878", "0.60947984", "0.6074452", "0.60592484", "0.6024408", "0.6023302", "0.600047...
0.7759538
0
Return a list of strings with metric values and timestamps as prefixes (not showing microseconds). Also show the metric def ID in parentheses.
def get_timestamped_metric_values_as_strings(self): ret_list = [] i = 0 while i < len(self.__metric_value_list): ret_list.append(self.__metric_value_list[i].timestamp.strftime("%Y-%m-%d %H:%M:%S") + " " + str(self.__metric_value_list[i].value) + ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_metric_list(self) -> List[str]:\n ...", "def get_metric(ms):\n\treturn '['+','.join(str(m) for m in ms)+']'", "def __str__(self):\n columns = list(self.metrics.keys())\n columns.sort()\n out = '%s\\n' % ','.join(columns)\n values = [str(self.metrics[c]) for c in columns]\n out += ...
[ "0.7170015", "0.7163434", "0.614878", "0.598899", "0.5964182", "0.5915469", "0.5894196", "0.5894196", "0.5894196", "0.58587414", "0.58564055", "0.5797499", "0.5731772", "0.5715355", "0.57042557", "0.56763", "0.5675049", "0.56671524", "0.565569", "0.5654457", "0.5632019", "0...
0.73370224
0
Generic function to dump all Test Execution data in a CSV file.
def write_to_csv(self): dump_list = [] # add rows one by one, each as a list, even if only 1 element dump_list.append(["test execution ID",self.ID]) dump_list.append(["test execution name",self.name]) dump_list.append(["test definition ID",self.test_def_ID]) test_def_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Dump():\n with open(path.join(MAIN_PATH, INST), \"wb\") as f:\n writer = csv.writer(f, delimiter=\",\")\n\n for inst in instances:\n writer.writerow(inst)\n \n with open(path.join(MAIN_PATH, \"test_instances.csv\"), \"wb\") as f:\n writer = csv.writer(f, delimit...
[ "0.67293197", "0.6513849", "0.6487891", "0.633611", "0.62388986", "0.6189851", "0.61873883", "0.6097543", "0.608892", "0.6053703", "0.60277325", "0.5961769", "0.5952618", "0.5923491", "0.59027004", "0.588059", "0.58773726", "0.5876296", "0.5853088", "0.583685", "0.5753217", ...
0.7351433
0
Get all content from all Definition data binary files, and dump everything in a snapshot CSV file.
def dump_all_binaries_to_CSV(): ## TODO timenow = datetime.now()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main(output_filepath):\n logger = logging.getLogger(__name__)\n logger.info('making final data set from raw data')\n\n baseurl = 'http://codeandbeer.org/virtual/BigData/Labs/'\n files = ['Booking-20151012-1322.csv', 'Booking-20181025-1232.csv']\n for filename in files:\n r = requests.get(...
[ "0.6119058", "0.584404", "0.5760777", "0.5618853", "0.55985814", "0.5554482", "0.5531929", "0.552771", "0.5514406", "0.5481521", "0.5466135", "0.5440491", "0.5430171", "0.54249936", "0.53819466", "0.5378581", "0.53638315", "0.5349894", "0.53484917", "0.5341942", "0.5338703", ...
0.5712153
3
Saves parameters to json file
def save(self, json_path): with open(json_path, 'w') as f: json.dump(self.__dict__, f, indent=4)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_json(self, path=None):\n if path is None:\n path = self.parampath\n\n params = {str(key): str(value) for key, value in self.__dict__.items()}\n # with open(f'{path}/params_{self.mode}.json', 'w') as f:\n with open(os.path.join(path, f'params_{self.mode}.json'), 'w') ...
[ "0.82312053", "0.8181947", "0.8057166", "0.7808885", "0.77812463", "0.775106", "0.7710382", "0.7706769", "0.76148814", "0.75990826", "0.7574917", "0.75643057", "0.7448175", "0.7373087", "0.7341731", "0.7261098", "0.719621", "0.7154501", "0.714766", "0.7143015", "0.71297264", ...
0.6701761
64
Loads parameters from json file
def update(self, json_path): with open(json_path) as f: params = json.load(f) self.__dict__.update(params)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_parameters(self):\n json_data = open(\"param.json\")\n data = json.load(json_data)\n self.items = data[\"items\"]\n self.pollInterval = self.items[0]['poll_interval']", "def load_params_from_file(self, fn):\n f = file(fn, 'r')\n params = json.load(f)\n re...
[ "0.80815786", "0.8032984", "0.77628386", "0.7658748", "0.7499289", "0.7396562", "0.7371273", "0.7343756", "0.7205131", "0.71630406", "0.7145317", "0.71170235", "0.70144874", "0.6910112", "0.6828196", "0.6777038", "0.6745744", "0.670805", "0.6676465", "0.66282165", "0.6626882"...
0.0
-1
Gives dictlike access to Params instance by `params.dict['learning_rate']`
def dict(self): return self.__dict__
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_params(self, learning_rate):\n\t\t#######################################################################\n\t\t# ** START OF YOUR CODE **\n\t\t#######################################################################\n\n\t\tfor layer in self._layers:\n\t\t\tlayer.update_params(learni...
[ "0.67212766", "0.65639395", "0.64237636", "0.63552547", "0.63375807", "0.6335523", "0.6291742", "0.62781876", "0.62616247", "0.6256042", "0.6244642", "0.62040687", "0.61626947", "0.61462617", "0.6137591", "0.6134931", "0.6117105", "0.6034695", "0.6009135", "0.59249216", "0.59...
0.0
-1
Gives dictlike access to Params instance by `params.dict['learning_rate']`
def dict(self): return self.__dict__
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_params(self, learning_rate):\n\t\t#######################################################################\n\t\t# ** START OF YOUR CODE **\n\t\t#######################################################################\n\n\t\tfor layer in self._layers:\n\t\t\tlayer.update_params(learni...
[ "0.6720487", "0.65625185", "0.64225143", "0.63549536", "0.6335197", "0.63333946", "0.6289275", "0.62763816", "0.6261218", "0.6254811", "0.6242165", "0.62025636", "0.61608726", "0.6144572", "0.6134815", "0.61332786", "0.6115073", "0.6032413", "0.6008105", "0.5924919", "0.59114...
0.0
-1
Save the codes and configuration file. During the training, we may modify the codes. It will be problematic when we try to extract embeddings using the old model and the new code. So we save the codes when we train the model and use the saved codes to extract embeddings.
def save_codes_and_config(cont, model, config): if cont: # If we want to continue the model training, we need to check the existence of the checkpoint. if not os.path.isdir(os.path.join(model, "nnet")) or not os.path.isdir(os.path.join(model, "codes")): sys.exit("To continue training the...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def saveOutput(self,code):\r\n\t\tCodeSaver().save(code,self.savePath)", "def save_model(self):\n filename=self.name + '_words'\n file_write(filename, self.words)\n\n filename2=self.name+'_word_lengths'\n file_write(filename2, self.word_lengths)\n\n filename3=self.name+'_stems'...
[ "0.66678596", "0.65298474", "0.65280056", "0.65230376", "0.65037274", "0.64659584", "0.6451233", "0.6426465", "0.6415432", "0.63984126", "0.6397235", "0.6397206", "0.6392341", "0.63780564", "0.63757557", "0.6353628", "0.63431454", "0.62933993", "0.627987", "0.6270623", "0.625...
0.7381167
0
Get the pretrained model and copy to the target model as the initial version.
def get_pretrain_model(pretrain_model, target_model, checkpoint='-1'): if not os.path.isfile(os.path.join(pretrain_model, "checkpoint")): sys.exit("[ERROR] Cannot find checkpoint in %s." % pretrain_model) ckpt = tf.train.get_checkpoint_state(pretrain_model) model_checkpoint_path = ckpt.model_checkp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_pretrained_model(destination):\n url = \"https://storage.googleapis.com/download.magenta.tensorflow.org/models/ \\\n arbitrary_style_transfer.tar.gz\"\n\n os.system(\"curl -o arbitrary_style_transfer.tar.gz {0}\".format(url))\n with tarfile.open(\"arbitrary_style_transfer.tar.gz\") as ta...
[ "0.6822754", "0.6722586", "0.6549904", "0.6507627", "0.6432653", "0.64292246", "0.6409875", "0.6334059", "0.6267043", "0.6259309", "0.6258022", "0.6249631", "0.6218196", "0.6192777", "0.618744", "0.6157598", "0.6148145", "0.6140525", "0.61373776", "0.6136138", "0.6130443", ...
0.69689536
0
Load learning rate from a saved file
def load_lr(filename): learning_rate_array = [] with open(filename, "r") as f: for line in f.readlines(): _, lr = line.strip().split(" ") learning_rate_array.append(float(lr)) return learning_rate_array
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load(self, filename):\n param_dict = pickle.load(open('%s' % filename, 'rb'))\n self.learningrate = param_dict['learningrate']\n self.verbose = param_dict['verbose']\n self._loadsize = param_dict['loadsize']\n self._batchsize = param_dict['batchsize']\n self.momentum =...
[ "0.67811286", "0.6583575", "0.6550467", "0.6278531", "0.62552196", "0.619063", "0.61676574", "0.6159735", "0.61502033", "0.614148", "0.61373883", "0.61225915", "0.61004525", "0.6077979", "0.605477", "0.59805137", "0.59794164", "0.5961897", "0.5954225", "0.5944981", "0.5944981...
0.71505105
0
Load valid loss from a saved file
def load_valid_loss(filename): min_loss = ValidLoss() with open(filename, "r") as f: for line in f.readlines(): epoch, loss = line.strip().split(" ")[:2] epoch = int(epoch) loss = float(loss) if loss < min_loss.min_loss: min_loss.min_loss =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_checkpoint(self, file):\n \"\"\"Load \"\"\"\n chkpnt = torch.load(file)\n self.load_state_dict(chkpnt['model_state_dict'])", "def load_network(self, sess, filename):\n dir_path = os.path.dirname(os.path.realpath(__file__))\n dir_path += '/Models/'\n dir_path += ...
[ "0.6473382", "0.63657707", "0.61991316", "0.6178769", "0.6170918", "0.59643334", "0.5960667", "0.5960353", "0.5944361", "0.59310794", "0.5908972", "0.5874426", "0.58355534", "0.5824624", "0.5812557", "0.5805543", "0.580154", "0.57972693", "0.5791554", "0.57738537", "0.5772561...
0.75367886
0
Set the checkpoint in the model directory and return the name of the checkpoint
def get_checkpoint(model, checkpoint='-1'): if not os.path.isfile(os.path.join(model, "checkpoint")): sys.exit("[ERROR] Cannot find checkpoint in %s." % model) ckpt = tf.train.get_checkpoint_state(model) model_checkpoint_path = ckpt.model_checkpoint_path all_model_checkpoint_paths = ckpt.all_mo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_checkpoint_name(self):\n dataset_basename = Path(self._train_dataset_path).resolve().stem\n filename = \"model_cpt_{}.pkl\".format(dataset_basename)\n return filename", "def test_model_checkpoint_path(tmpdir, logger_version, expected):\n tutils.reset_seed()\n model = EvalModel...
[ "0.74503803", "0.7105686", "0.69459254", "0.6914723", "0.6896195", "0.68212557", "0.68031454", "0.6800865", "0.6794284", "0.67591476", "0.6740254", "0.66765016", "0.6662393", "0.66157246", "0.6609026", "0.66063094", "0.6599918", "0.6598686", "0.65768677", "0.6550074", "0.6542...
0.62566173
44
Compute pairwise EER using cosine similarity. The EER is estimated by interp1d and brentq, so it is not the exact value and may be a little different each time.
def compute_cos_pairwise_eer(embeddings, labels, max_num_embeddings=1000): embeddings /= np.sqrt(np.sum(embeddings ** 2, axis=1, keepdims=True) + 1e-12) num_embeddings = embeddings.shape[0] if num_embeddings > max_num_embeddings: # Downsample the embeddings and labels step = num_embeddings /...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_EER(self, FAR, FRR):\r\n print('Computing EER')\r\n distance = abs(FAR - FRR)\r\n min_distance = min(distance)\r\n idx = np.where(distance == min_distance)\r\n return np.mean((FAR[idx] + FRR[idx]) / 2)", "def similarity(self, e1, e2):\n\t\tpass", "def E(q, r0, x, ...
[ "0.61746013", "0.58410585", "0.56296", "0.55749977", "0.55027765", "0.545726", "0.5402459", "0.5398751", "0.5388317", "0.5339811", "0.533653", "0.5312333", "0.5311478", "0.52783436", "0.5232789", "0.522407", "0.52214503", "0.52191997", "0.5212163", "0.52099633", "0.52089626",...
0.5987465
1
Check whether part of the string s appears in the list.
def substring_in_list(s, varlist): if varlist is None: return False is_sub = False for v in varlist: if v in s: is_sub = True break return is_sub
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_string(s, strings):\n for string in strings:\n if string not in s:\n return False\n return True", "def check(s,l):\n if len(s)==1:\n if s[0] in l:\n return False\n else:\n return True\n else:\n if s[0] in l:\n return Fa...
[ "0.72143257", "0.71113634", "0.7025717", "0.6971482", "0.6968255", "0.6905735", "0.6830441", "0.68250275", "0.6770632", "0.6740407", "0.67399365", "0.66369486", "0.6623817", "0.65804917", "0.657662", "0.6519753", "0.64646107", "0.6462173", "0.6444658", "0.6384393", "0.6381318...
0.72698176
0
Create a summary for activations given the endpoints.
def activation_summaries(endpoints): sum = [] with tf.name_scope('summaries'): for act in endpoints.values(): tensor_name = act.op.name sum.append(tf.summary.histogram(tensor_name + '/activations', act)) # sum.append(tf.summary.scalar(tensor_name + '/sparsity', tf.nn....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _activation_summary(x):\n tensor_name = re.sub('%s_[0-9]*/' % TOWER_NAME, '', x.op.name)\n tf.summary.histogram(tensor_name + '/activations', x)\n tf.summary.scalar(tensor_name + '/sparsity', tf.nn.zero_fraction(x))", "def _activation_summary(x):\n # Remove 'tower_[0-9]/' from the name in case th...
[ "0.59474593", "0.5940539", "0.59343994", "0.59330446", "0.5931891", "0.59268993", "0.5921793", "0.59189427", "0.58822054", "0.56461763", "0.5312166", "0.5241216", "0.51119596", "0.51063263", "0.50800484", "0.50588953", "0.50553143", "0.5045727", "0.5015067", "0.501194", "0.49...
0.7658504
0
Compute the restricted attention using kaldi position encoding.
def compute_kaldi_restricted_attention(endpoints, params): # Use a basic for loop value = endpoints["value"] key = endpoints["key"] query = endpoints["query"] batch_size, length, total_dim = value.shape num_heads = params.sann_num_heads context_size = params.sann_restricted_context_size ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_attention(self, X):\n if self.bn:\n layer = 16\n else:\n layer = 14\n inputs = [K.learning_phase()] + [self.model.inputs[0]]\n _attention_f = K.function(inputs, [\n self.model.layers[layer].output])\n \n return _attention_f([0] + [X...
[ "0.6223233", "0.6138006", "0.6051119", "0.60232174", "0.60205334", "0.5843146", "0.5834027", "0.57716316", "0.57679117", "0.56381214", "0.5616626", "0.5609945", "0.5591088", "0.5589141", "0.5581806", "0.5557133", "0.55491656", "0.553368", "0.5524424", "0.551581", "0.55075306"...
0.5936036
5
Get agents id according to task id for frontend display
def get_common_food(cls): objs = cls.objects return objs
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getAgentID(self):\n\t\treturn self.agentID", "def agent_id(self) -> pulumi.Output[int]:\n return pulumi.get(self, \"agent_id\")", "def get_task_id(self):\n if self.task_id:\n return self.task_id\n return (f'{self.task_type}_{self.get_source_system().lower()}'\n ...
[ "0.6345138", "0.62534577", "0.6244555", "0.621085", "0.61262393", "0.6091852", "0.6032438", "0.5948106", "0.58429515", "0.5799198", "0.5767654", "0.5767654", "0.5767654", "0.5767654", "0.5675799", "0.56328017", "0.56262046", "0.5620824", "0.5587475", "0.55463105", "0.5515732"...
0.0
-1
Get agents id according to task id for frontend display
def search_food(cls, name): obj = cls.objects(name=name).first() return obj
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getAgentID(self):\n\t\treturn self.agentID", "def agent_id(self) -> pulumi.Output[int]:\n return pulumi.get(self, \"agent_id\")", "def get_task_id(self):\n if self.task_id:\n return self.task_id\n return (f'{self.task_type}_{self.get_source_system().lower()}'\n ...
[ "0.6345138", "0.62534577", "0.6244555", "0.621085", "0.61262393", "0.6091852", "0.6032438", "0.5948106", "0.58429515", "0.5799198", "0.5767654", "0.5767654", "0.5767654", "0.5767654", "0.5675799", "0.56328017", "0.56262046", "0.5620824", "0.5587475", "0.55463105", "0.5515732"...
0.0
-1
Get agents id according to task id for frontend display
def get_food_with_id(cls, food_id): obj = cls.objects(food_id=food_id).first() return obj
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getAgentID(self):\n\t\treturn self.agentID", "def agent_id(self) -> pulumi.Output[int]:\n return pulumi.get(self, \"agent_id\")", "def get_task_id(self):\n if self.task_id:\n return self.task_id\n return (f'{self.task_type}_{self.get_source_system().lower()}'\n ...
[ "0.63489664", "0.6257465", "0.62421757", "0.62146336", "0.6130093", "0.60894895", "0.6033828", "0.5952367", "0.5845366", "0.579731", "0.5765397", "0.5765397", "0.5765397", "0.5765397", "0.56785834", "0.5629973", "0.56234723", "0.5619558", "0.55869734", "0.5543945", "0.5513756...
0.0
-1
Executes SSM document for given document name and input parameters.
def execute(self, document_name, input_params): if self._document_exists(document_name): self.logger.info("Executing SSM document [%s] with parameters: [%s]", document_name, input_params) # Executing SSM document execution_id = self.ssm_client.start_automation_execution( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def runQuery(cred, structuredQuery):\n url = cred.base_url + \"documents:runQuery\"\n\n makeRequest(cred, url, 'POST', structuredQuery)", "def _send_command_to_nodes(self, document_name, parameters, node_ids):\n logger.debug(\"Sending SSM command to {} node(s). Document name: {}. \"\n ...
[ "0.5480394", "0.5434591", "0.5376649", "0.52243423", "0.5214718", "0.52023363", "0.5189893", "0.5051979", "0.5050216", "0.49367806", "0.49262178", "0.49162", "0.4915455", "0.48682842", "0.48337287", "0.4806876", "0.48034984", "0.47985923", "0.47829112", "0.47478285", "0.47474...
0.8131812
0
Returns SSM document final execution status, if status is in PROGRESS/PENDING it will wait till SSM document execution will be completed.
def wait_for_execution_completion(self, execution_id, document_name=None): # Fetch ssm execution status status = self._get_execution_status(execution_id, document_name) # Wait for execution to be completed while status == 'InProgress' or status == 'Pending' or status == 'Cancelling' or ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_execution_status(self, execution_id, document_name=None):\n execution = self.ssm_client.get_automation_execution(\n AutomationExecutionId=execution_id\n )\n # TODO(semiond): we can remove document name as parameter, can take it by execution id.\n document_name = docu...
[ "0.68110305", "0.6518064", "0.65054107", "0.6139724", "0.6080517", "0.6051617", "0.59565747", "0.59161776", "0.58984363", "0.586592", "0.5834591", "0.58224225", "0.57734585", "0.57674146", "0.5753716", "0.5740925", "0.5731959", "0.57306814", "0.57306814", "0.5700119", "0.5700...
0.6551534
1
Returns execution step final status or WAITING, if step is in PROGRESS/PENDING status it will wait till step execution will be completed starts waiting for approval.
def wait_for_execution_step_status_is_terminal_or_waiting(self, execution_id, document_name, step_name, time_to_wait): start_time = time.time() step_status = self._get_execution_step_status(execution_id, step_name) elapsed_time = time...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_execution_step_status(self, execution_id, step_name):\n execution = self.ssm_client.get_automation_execution(\n AutomationExecutionId=execution_id\n )\n step_executions = execution['AutomationExecution']['StepExecutions']\n step = self._get_step_by_name(step_executio...
[ "0.7485493", "0.70891434", "0.6701339", "0.66645974", "0.6656338", "0.6454856", "0.6294289", "0.6240593", "0.6126569", "0.59519774", "0.59398484", "0.58865476", "0.5874422", "0.58664155", "0.5823973", "0.5785563", "0.57727575", "0.5757077", "0.5743372", "0.5742786", "0.571064...
0.7079293
2
Returns when execution step is IN PROGRESS
def wait_for_execution_step_status_is_in_progress(self, execution_id, document_name, step_name, time_to_wait): start_time = time.time() step_status = self._get_execution_step_status(execution_id, step_name) elapsed_time = time.time() - start_time # Wait for execution step to resolve in ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def status(self):\n if self.num_steps >= self.timeout:\n return Status.TIMEOUT\n\n return Status.IN_PROGRESS", "def wait_progress(self):\n pass", "def wait_progress(self):\n pass", "def query_job_progress():\n pass", "def progress(self):\n return self.runPro...
[ "0.71910757", "0.68339044", "0.68339044", "0.6804736", "0.6747416", "0.6747416", "0.6707005", "0.6707005", "0.6707005", "0.6707005", "0.6684109", "0.65764314", "0.65122974", "0.65017164", "0.6432889", "0.6429691", "0.64150727", "0.639098", "0.63840777", "0.6276231", "0.616246...
0.5902694
41
Returns SSM document step output for given execution id, step name and output key.
def get_step_output(self, execution_id, step_name, output_key): execution = self.ssm_client.get_automation_execution( AutomationExecutionId=execution_id ) step_executions = execution['AutomationExecution']['StepExecutions'] step = self._get_step_by_name(step_executions, step_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_step_output_uri(self, step):\n # parse in reverse order, in case there are multiple -output args\n args = step.args()\n for i, arg in reversed(list(enumerate(args[:-1]))):\n if arg == '-output':\n return args[i + 1]\n else:\n return None", ...
[ "0.59275943", "0.5889858", "0.58484614", "0.57326436", "0.56344503", "0.55983704", "0.55777663", "0.5569992", "0.5539353", "0.5533122", "0.54646003", "0.54497415", "0.5416543", "0.5371535", "0.53153986", "0.5273433", "0.52668524", "0.522895", "0.5222754", "0.5222012", "0.5202...
0.79215145
0
Cancels SSM document execution in waits till 'TriggerRollback' step triggered SSM execution is completed.
def cancel_execution_with_rollback(self, execution_id: str): execution_url = self.get_execution_url(execution_id) try: self.logger.info("Canceling SSM execution: {}".format(execution_url)) self.ssm_client.stop_automation_execution(AutomationExecutionId=execution_id, Type='Cancel'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cancel(self):\n self.session.rollback()", "def rollback(self) -> None:\n with self.lock:\n self.wait(self._rollback_gen())", "def test_cancel(self) -> None:\n context: Dict[str,ArtifactDescriptor] = dict()\n cmd = pycell.python_cell(\n source='import time\\...
[ "0.60639095", "0.5988455", "0.581982", "0.5772934", "0.5643513", "0.56363535", "0.56363535", "0.56363535", "0.56363535", "0.5620277", "0.56076694", "0.5583796", "0.55767006", "0.5570505", "0.55680966", "0.5564965", "0.5541141", "0.5533509", "0.55272144", "0.54791105", "0.5477...
0.62550855
0
Returns SSM document execution status for given execution id.
def _get_execution_status(self, execution_id, document_name=None): execution = self.ssm_client.get_automation_execution( AutomationExecutionId=execution_id ) # TODO(semiond): we can remove document name as parameter, can take it by execution id. document_name = document_name ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wait_for_execution_completion(self, execution_id, document_name=None):\n # Fetch ssm execution status\n status = self._get_execution_status(execution_id, document_name)\n\n # Wait for execution to be completed\n while status == 'InProgress' or status == 'Pending' or status == 'Cance...
[ "0.6311759", "0.62737817", "0.624106", "0.6151789", "0.61108553", "0.6006403", "0.59510785", "0.5879625", "0.585945", "0.56999177", "0.56882", "0.5642697", "0.5611689", "0.5606932", "0.55757666", "0.5573651", "0.5539164", "0.5529198", "0.5528047", "0.5503078", "0.5492322", ...
0.7906296
0
Returns execution step status for given execution id and step name.
def _get_execution_step_status(self, execution_id, step_name): execution = self.ssm_client.get_automation_execution( AutomationExecutionId=execution_id ) step_executions = execution['AutomationExecution']['StepExecutions'] step = self._get_step_by_name(step_executions, step_n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_successfully_executed_steps_by_order(self, execution_id):\n execution = self.ssm_client.get_automation_execution(\n AutomationExecutionId=execution_id\n )\n step_executions = execution['AutomationExecution']['StepExecutions']\n step_names: List = []\n if step_e...
[ "0.6936771", "0.6909824", "0.6842648", "0.6689437", "0.65554833", "0.6498717", "0.6436358", "0.63689363", "0.62805057", "0.6166205", "0.61314565", "0.5980744", "0.5944853", "0.58768517", "0.5850708", "0.58459425", "0.5805325", "0.57995373", "0.5733456", "0.5710865", "0.569416...
0.85641456
0
Returns successfully executed steps by order of their execution
def get_successfully_executed_steps_by_order(self, execution_id): execution = self.ssm_client.get_automation_execution( AutomationExecutionId=execution_id ) step_executions = execution['AutomationExecution']['StepExecutions'] step_names: List = [] if step_executions: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getSteps():", "def test_by_order(self):\n # addon_executor = AddonExecutor(execute_order, stop_order)\n # self.assertEqual(expected, addon_executor.execute_with_order(addon, execute_order, stop_order))\n self.run_mgr.by_order(self.cli_inst, ['execute', 'start'], ['stop'])\n output...
[ "0.6670046", "0.6322163", "0.6297291", "0.6226086", "0.619969", "0.6090397", "0.6030043", "0.6016758", "0.6015137", "0.59943765", "0.5981895", "0.5952482", "0.5910737", "0.5910737", "0.5741957", "0.57394445", "0.57195204", "0.5695635", "0.5670944", "0.5652498", "0.56230104", ...
0.6954507
0
Returns SSM document step by given status.
def _get_step_by_status(self, steps, status): if steps: for s in steps: if s['StepStatus'] == status: return s
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def select_step_with_status(status, steps):\n for step in steps:\n assert isinstance(step, model.Step), \"TYPE-MISMATCH: \"+\\\n \"step.class={0}\".format(step.__class__.__name__)\n if step.status == status:\n return step\n # -- OTHERWISE: No step with the give...
[ "0.6839485", "0.6071293", "0.55562955", "0.5460878", "0.53241044", "0.5310991", "0.53065586", "0.52873224", "0.5144956", "0.5040669", "0.503265", "0.503265", "0.5010804", "0.49962842", "0.49321508", "0.48371494", "0.4831955", "0.4813281", "0.48044667", "0.47959918", "0.479289...
0.7587236
0
Returns SSM document step by a given name.
def _get_step_by_name(self, steps, step_name): if steps: for s in steps: if s['StepName'] == step_name: return s
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_step_by_name(self, name):\n self._validate_step_name(name)\n name = str(name)\n try:\n return self.all_upstream_steps[name]\n except KeyError as e:\n msg = 'No Step with name \"{}\" found. ' \\\n 'You have following Steps: {}'.format(name, ...
[ "0.69454134", "0.6490663", "0.61872965", "0.6077294", "0.6018053", "0.58520585", "0.57159656", "0.5648309", "0.5618685", "0.5614397", "0.5590065", "0.54544705", "0.5426001", "0.54098606", "0.5397997", "0.5348861", "0.53418255", "0.5339116", "0.5339116", "0.53089184", "0.52940...
0.7589914
0
Returns True if SSM document for given name exist, False otherwise.
def _document_exists(self, document_name): return len(self.ssm_client.list_document_versions(Name=document_name)['DocumentVersions']) >= 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def object_exists(self, name: str):\n file_path = self.__get_file_path(name)\n return os.path.exists(file_path)", "def exists(self) -> bool:\n doc_ref = self.doc_ref\n if isinstance(doc_ref, DocumentReference):\n return doc_ref.get().exists\n return False", "def do...
[ "0.6926537", "0.67250514", "0.6712991", "0.67112947", "0.6679739", "0.6626868", "0.6602372", "0.65388644", "0.6513464", "0.65095633", "0.650585", "0.649972", "0.64888805", "0.6445123", "0.64327896", "0.6388695", "0.6188683", "0.61496204", "0.61428565", "0.6134926", "0.6089026...
0.7727576
0
Returns ssm document execution URL.
def get_execution_url(self, execution_id: str) -> str: return f'https://{self.region}.console.aws.amazon.com/systems-manager/automation/execution/{execution_id}'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prog_url(self):\n # type: () -> string_types\n return self._prog_url", "def invoke_url(self) -> pulumi.Output[str]:\n return self.stage.invoke_url # type: ignore[no-any-return]", "def runbook_url(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"runbook_url\")"...
[ "0.64966375", "0.64278257", "0.63142085", "0.6183461", "0.6183461", "0.6183461", "0.6183461", "0.6183461", "0.6183461", "0.6183461", "0.6118322", "0.6099205", "0.6099205", "0.6086366", "0.6022877", "0.598758", "0.5956474", "0.59558874", "0.59377545", "0.59377545", "0.59377545...
0.6347872
2
Return ssm document execution step URL.
def get_execution_step_url(self, execution_id: str, step_name: str, steps: [] = None) -> str: if not steps or len(steps) < 1: execution = self.ssm_client.get_automation_execution(AutomationExecutionId=execution_id) steps = execution['AutomationExecution']['StepExecutions'] step ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def invoke_url(self) -> pulumi.Output[str]:\n return self.stage.invoke_url # type: ignore[no-any-return]", "def get_redirect_url(self, *args, **kwargs):\n return self.document.file.url", "def runbook_url(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"runbook_url\")", ...
[ "0.6653019", "0.6429969", "0.6305271", "0.6265999", "0.6141591", "0.60876673", "0.60876673", "0.60759395", "0.6074171", "0.597044", "0.5946428", "0.5923328", "0.5830999", "0.5830999", "0.5830999", "0.5830999", "0.5830999", "0.5830999", "0.5830999", "0.5813061", "0.5805103", ...
0.6712275
0
Returns SSM document step execution sequence index
def _get_step_execution_index(self, step_executions: [], step_name): index = 1 for step_execution in step_executions: if step_name == step_execution['StepName']: return index index += 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_sequence_index(self):\n\t\treturn call_sdk_function('PrlBootDev_GetSequenceIndex', self.handle)", "def step_index(self, step):\n return self.steps.index(step)", "def get_step_idx(self, step_id: str) -> int:\n return self.step_id2idx.get(step_id, None)", "def step_id(self) -> pulumi.Outp...
[ "0.68235666", "0.6603684", "0.6303389", "0.63007843", "0.627349", "0.61597484", "0.6039806", "0.60359675", "0.60088104", "0.59596723", "0.595375", "0.5940087", "0.5922751", "0.59192324", "0.5902262", "0.5867469", "0.5863946", "0.58638436", "0.58619946", "0.58510906", "0.58207...
0.7016882
0
Given a sequence of string expression append them to the specified file.
def append_sequence_of_text(self, sequence): file_name = self.file_name with open(file_name, 'a+') as file: file.write('\n\n') for line in sequence: file.write('\t{}\n'.format(line))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def appendToFile(strsToAppend,fileName):\n \n file=open(fileName,mode='r')\n fileText=file.read()\n file.close()\n for strToAppend in strsToAppend:\n fileText+=strToAppend\n file=open(fileName,mode='w')\n file.write(fileText)\n file.close()", "def append_after(filename=\"\", search_string=\"\", new_st...
[ "0.6397394", "0.61963135", "0.5710745", "0.5632932", "0.55954385", "0.5565831", "0.5564826", "0.5506781", "0.5497444", "0.5495759", "0.54679596", "0.5452065", "0.5451475", "0.54342514", "0.5433327", "0.5427626", "0.5420789", "0.54194903", "0.5415856", "0.54111415", "0.5393554...
0.5328022
26
Read C functions from functions_for_c.txt and write it to feature.c
def create_cfile_head(self): head = """#include <stdio.h> #include <stdlib.h> #include <time.h> #include "../init_array_lib/init_dyn_array.h" #include "../pips_lib/define_script.h" int main(int argc, const char* argv[]) { srand(time(NULL)); """ self.append_text_to_file(str(head))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\n import argparse\n parser = argparse.ArgumentParser()\n parser.add_argument('-i', '--input', help='Input .py file', nargs='+')\n args = parser.parse_args()\n\n mod_func = []\n\n for pyfile in args.input:\n tree = ast.parse(open(pyfile).read())\n\n methods = sorted({node...
[ "0.59324694", "0.58911663", "0.58243126", "0.57736236", "0.57395834", "0.56943256", "0.5641427", "0.56040597", "0.5594164", "0.55703723", "0.5558408", "0.5429776", "0.5418675", "0.538488", "0.53502434", "0.5337874", "0.5311122", "0.5278216", "0.5270166", "0.52565664", "0.5244...
0.4812378
68
Append the end to the feature.c
def create_cfile_tail(self): end_c = """ clock_t stop = clock(); double elapsed = ((double)(stop - start)) / CLOCKS_PER_SEC; printf("%f", elapsed); """ self.append_text_to_file(str(end_c))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new_end(self, end): \n self.last_words.append(end)", "def _concatenate_features(features):\n pass", "def _ends_with_op(spec):", "def endow(self, struct):\n pass", "def append_end(self, data):\r\n with open(self.file_name, 'a', encoding='utf-8') as self.file:\r\n ...
[ "0.63034153", "0.58832604", "0.5827753", "0.57650805", "0.5743487", "0.5646226", "0.5572082", "0.55490077", "0.5458949", "0.54464453", "0.5430893", "0.54125154", "0.53740317", "0.5346468", "0.5325698", "0.53060746", "0.530568", "0.5292237", "0.5266684", "0.5266067", "0.525623...
0.54177976
11
Write an array of shape (bands, width, heigth) to file.
def create_test_file(filename, array): array = np.ma.asanyarray(array) crs = rasterio.crs.CRS(init='epsg:4326') transform = from_origin(52, 4, 10, 10) with rasterio.open( filename, mode='w', driver='GTiff', width=array.shape[1], height=array.sh...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def writeArray(fname,arr):\n fh = open(fname,'w')\n fh.write('%d\\n' % arr.shape[0])\n fh.write('%d\\n' % arr.shape[1])\n for x in range(arr.shape[0]):\n for y in range(arr.shape[1]):\n if arr.dtype == np.complex:\n fh.write('%.7e %.7e\\n' % (arr[x,y].real, arr[x,y].ima...
[ "0.71242523", "0.6744671", "0.66219556", "0.63390946", "0.630486", "0.6265362", "0.6262193", "0.6123394", "0.60802317", "0.60766524", "0.60740805", "0.6067983", "0.60587114", "0.60536265", "0.6040121", "0.597492", "0.5973886", "0.5965214", "0.59603775", "0.59558237", "0.59542...
0.6307405
4
Create a test Image instance.
def create_test_image(dirname, array, normalization=None): filename = str(dirname / 'tmp.tif') create_test_file(filename, array) satellite = 'quickbird' image = Image(filename, satellite, normalization_parameters=normalization) return image
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_image(self):\n pass", "def maketestimage(self, *args, **kwargs):\n return _image.image_maketestimage(self, *args, **kwargs)", "def new_test_image():\n warnings.warn(DeprecationWarning(\n \"new_test_image() is deprecated in favour of the get_sample_image() \"\n \"c...
[ "0.83210063", "0.7775136", "0.73910016", "0.7141617", "0.6988279", "0.68101066", "0.6806548", "0.6761812", "0.6656161", "0.66465604", "0.6600724", "0.65849966", "0.65514433", "0.64627105", "0.64578843", "0.63991606", "0.63800454", "0.637194", "0.6369904", "0.6350396", "0.6344...
0.6682606
8
Computes the total evictions filed
def total(evictiondata): total = 0 for index, row in evictiondata.iterrows(): total += row['filings_2020']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __calc_empirical_counts__(self):\n self.empirical_counts = np.zeros(self._features_vector_length, dtype=float)\n for feature, freq in self.features_dict.items():\n for index in feature:\n self.empirical_counts[index] += freq\n assert len(self.empirical_counts) == ...
[ "0.6445968", "0.6362767", "0.60137343", "0.60097814", "0.5861046", "0.5823471", "0.5804749", "0.5785384", "0.5758527", "0.57364535", "0.5653729", "0.563426", "0.56016433", "0.559297", "0.55897456", "0.5586372", "0.5580745", "0.55679435", "0.5510253", "0.5509895", "0.5496174",...
0.59621006
4
Eviction filings broken down into a weekbyweek basis
def weekly(evictiondata): evictions_per_week = {} for index, row in evictiondata.iterrows(): if row['week_date'] not in evictions_per_week.keys(): evictions_per_week[row['week_date']] = row['filings_2020'] else: evictions_per_week[row['week_date']] += row['filings_2...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def weekly():", "def weekly():\n\n response = {}\n\n # 0..6 => Sunday..Saturday\n for i in range(7):\n hours = []\n interactions = 0\n\n for j in range(25):\n try:\n wfile = open(common.stats_path + '/weekly-average/' + str(i) + '/' + str(j))\n ...
[ "0.7323955", "0.62316436", "0.6126304", "0.6112387", "0.6050204", "0.6010439", "0.5954555", "0.59421486", "0.5924618", "0.59082824", "0.5864308", "0.5844851", "0.5800671", "0.57960045", "0.57312167", "0.5713384", "0.5708791", "0.568154", "0.5680631", "0.56350195", "0.56308794...
0.7517364
0
Visualizes the week by week eviction data into a graph
def graphify(evictions_per_week): weeks = [] for week in evictions_per_week.keys(): if '2020' in week: weeks.append(week) evictions_filed = [] for week in weeks: evictions_filed.append(evictions_per_week[week]) plt.figure(figsize=(50, 10)) plt.plot(weeks, evi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def graph_baseline(evictiondata, weeks):\r\n base_evictions_per_week = {}\r\n for index, row in evictiondata.iterrows():\r\n if row['week_date'] not in base_evictions_per_week.keys():\r\n base_evictions_per_week[row['week_date']] = row['filings_avg']\r\n elif row['GEOID'] != 'sealed'...
[ "0.7287062", "0.7240408", "0.7095925", "0.67528796", "0.6648603", "0.6480761", "0.62646145", "0.62237006", "0.6187958", "0.6187809", "0.613508", "0.60985005", "0.60869294", "0.6011801", "0.59913427", "0.59690994", "0.59242606", "0.59085816", "0.5906574", "0.5892883", "0.58743...
0.81232464
0
Graphs the baseline eviction data of 20152016 in the same format
def graph_baseline(evictiondata, weeks): base_evictions_per_week = {} for index, row in evictiondata.iterrows(): if row['week_date'] not in base_evictions_per_week.keys(): base_evictions_per_week[row['week_date']] = row['filings_avg'] elif row['GEOID'] != 'sealed': ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cross_analyze(evictions_filed, base_evictions_filed, weeks):\r\n plt.figure(figsize=(50, 10))\r\n plt.plot(weeks, evictions_filed, label = '2020')\r\n plt.plot(weeks, base_evictions_filed, label = '2015-2016')\r\n plt.xlabel('Date', fontsize = 25)\r\n plt.ylabel('Evictions filed', fontsize = 25)...
[ "0.61644155", "0.6124098", "0.6031411", "0.5979967", "0.59787333", "0.5971069", "0.5943029", "0.59208447", "0.58984315", "0.58976746", "0.5869825", "0.5843553", "0.5836322", "0.5829148", "0.5803515", "0.57898813", "0.5787882", "0.5771819", "0.57714844", "0.57601196", "0.57472...
0.73401976
0
Cross analyzes the baseline with 2020's eviction data. NOTE Requires you to run the above functions
def cross_analyze(evictions_filed, base_evictions_filed, weeks): plt.figure(figsize=(50, 10)) plt.plot(weeks, evictions_filed, label = '2020') plt.plot(weeks, base_evictions_filed, label = '2015-2016') plt.xlabel('Date', fontsize = 25) plt.ylabel('Evictions filed', fontsize = 25) plt.title...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def CrossCheck(dataloader):", "def do_crossval():\n df = read_df()\n # X = df['review'].apply(remove_html_lower)\n\n X = df['review']\n y = df['sentiment']\n X_train, X_holdout, y_train, y_holdout = train_test_split(X, y, test_size=0.3, shuffle=True, stratify=y, random_state=222 )\n\n tfidf = T...
[ "0.5959022", "0.5762439", "0.57529324", "0.5593366", "0.55377454", "0.5520248", "0.5454742", "0.5441111", "0.53812", "0.53765136", "0.5361948", "0.5333665", "0.5293056", "0.5286", "0.52654094", "0.52570784", "0.52462506", "0.523822", "0.5229423", "0.52216583", "0.5211983", ...
0.6554467
0
Return User IP address.
def index(): if request.environ.get('HTTP_X_FORWARDED_FOR') is None: print('here') return request.environ['REMOTE_ADDR'] else: print('there') return request.environ['HTTP_X_FORWARDED_FOR']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_user_ip(request):\n x_forwarded_for = request.META.get(\"HTTP_X_FORWARDED_FOR\")\n if x_forwarded_for:\n ip = x_forwarded_for.split(\",\")[0]\n else:\n ip = request.META.get(\"REMOTE_ADDR\")\n return ip", "def _get_user_ip(request):\n x_forwarded_for ...
[ "0.8345858", "0.82466626", "0.7922481", "0.7832889", "0.7778117", "0.7757266", "0.7738831", "0.7738831", "0.7738804", "0.7711175", "0.7705773", "0.76555246", "0.76353395", "0.7631577", "0.757635", "0.7562413", "0.75591487", "0.75566554", "0.754953", "0.75480884", "0.75266033"...
0.0
-1
prints how many games left
def __str__(self): if self.number == 0: return 'info' elif self.number == 1: return '1 game left!' else: return f'{self.number} games left!'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def count_left_players(definition):\n return int(parse_player_definition(definition)[1]['left_players'])", "def count_games(self) -> int:\n return len(self.rating_history) - 1", "def print_game_stats(games_won=games_won):\n for k,v in games_won.items():\n print(k)\n print(v)\n i...
[ "0.6974114", "0.6791024", "0.6751497", "0.6710043", "0.65938455", "0.6576891", "0.65446955", "0.6521832", "0.6435398", "0.6420975", "0.6311479", "0.630272", "0.6236893", "0.62334865", "0.6208109", "0.6105158", "0.60977644", "0.6067719", "0.60583055", "0.60553783", "0.60514903...
0.6323121
10
prints end of round information
def round_end_screen(self, board, p1, ai): if self.number == 0: if p1.score > ai.score: print(f'Round {self.last_game} {p1.score}:{ai.score}\n{board}\n\nYou Won! ', end='') elif ai.score > p1.score: print(f'Round {self.last_game} {p1.score}:{ai.score}\n{bo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_end_of_round_rankings(self):\n print('\\nFINAL SCORES')\n print('-'*12)\n for k, v in enumerate(self.ranking_dict):\n print(f\"{k+1} {v[0]}: {v[1]}\")\n print('\\n')", "def display_end(self, nsep):\n\n if self.opt['Verbose'] and self.opt['StatusHeader']:\n ...
[ "0.74614024", "0.65657973", "0.6424565", "0.6388435", "0.63060915", "0.62910116", "0.6192829", "0.6159963", "0.61290896", "0.6064716", "0.6061334", "0.6057542", "0.6036575", "0.59916383", "0.5950914", "0.5948961", "0.5936187", "0.5924599", "0.5921035", "0.5875291", "0.5866037...
0.61398834
8
Overwritten setter functions to convert the time_struct into a real timestamp.
def set_startTime(self, startTime): self.startTime = mktime(startTime)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def UpdateStructTime(self, t):\n self.date.UpdateStructTime(t)\n self.time.UpdateStructTime(t)", "def timestamp(self, value):\n value = util.parse_valid_date(value)\n self._set_attr('timestamp', value)", "def UpdateStructTime(self, t):\n if not self.Complete():\n r...
[ "0.66382796", "0.65591556", "0.64815944", "0.6390295", "0.6382825", "0.63617474", "0.6329803", "0.63273144", "0.63211745", "0.63090664", "0.6307001", "0.6288048", "0.62831414", "0.62622255", "0.6251193", "0.62397015", "0.6201132", "0.61923033", "0.618849", "0.61747265", "0.61...
0.0
-1
Overwritten setter functions to convert the time_struct into a real timestamp.
def set_stopTime(self, stopTime): self.stopTime = mktime(stopTime)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def UpdateStructTime(self, t):\n self.date.UpdateStructTime(t)\n self.time.UpdateStructTime(t)", "def timestamp(self, value):\n value = util.parse_valid_date(value)\n self._set_attr('timestamp', value)", "def UpdateStructTime(self, t):\n if not self.Complete():\n r...
[ "0.66382796", "0.65591556", "0.64815944", "0.6390295", "0.6382825", "0.63617474", "0.6329803", "0.63273144", "0.63211745", "0.63090664", "0.6307001", "0.6288048", "0.62831414", "0.62622255", "0.6251193", "0.62397015", "0.6201132", "0.61923033", "0.618849", "0.61747265", "0.61...
0.0
-1
Check if a switch exist for device.
def _switch_exist(lge_device: LGEDevice, switch_desc: ThinQSwitchEntityDescription) -> bool: if switch_desc.value_fn is not None: return True feature = switch_desc.key if feature in lge_device.available_features: return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_switch(self):\n\n svc = \"urn:upnp-org:serviceId:SwitchPower1\"\n if not svc in self.services:\n raise RuntimeError, \"Device doesn't support the service\"\n \n status = self.get_variable(svc, \"Status\")\n return status == 1", "def _verify_switch_created(sel...
[ "0.6747511", "0.6441467", "0.6203834", "0.6106376", "0.60789245", "0.60287935", "0.59896916", "0.58936965", "0.58648187", "0.58274436", "0.5758467", "0.5728313", "0.57069063", "0.5637247", "0.56260467", "0.56259376", "0.56258166", "0.5610697", "0.55567384", "0.55409193", "0.5...
0.7844338
0
Set up the LGE switch.
async def async_setup_entry( hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback ) -> None: entry_config = hass.data[DOMAIN] lge_devices = entry_config.get(LGE_DEVICES) if not lge_devices: return _LOGGER.debug("Starting LGE ThinQ switch setup...") lge_switch...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setupLL_Enhanced(self):\n self.LLE_Selector = slicer.qMRMLNodeComboBox()\n self.LLE_Selector.nodeTypes = ['vtkMRMLMultiVolumeNode']\n self.LLE_Selector.noneEnabled = True\n self.LLE_Selector.setMRMLScene(slicer.mrmlScene)\n self.LLE_Selector.addEnabled = 0\n self.LLE_SelectorLabel = qt.QLabel...
[ "0.5947192", "0.5850148", "0.56737316", "0.5606522", "0.5558895", "0.55538154", "0.5521745", "0.54545707", "0.5443126", "0.54028803", "0.53712314", "0.53409106", "0.53184915", "0.5313045", "0.52870697", "0.52844626", "0.52780974", "0.52673054", "0.5264901", "0.52587765", "0.5...
0.5751763
2
Return True if entity has to be polled for state. We overwrite coordinator property default setting because we need to poll to avoid the effect that after changing switch state it is immediately set to prev state. The async_update method here do nothing because the real update is performed by coordinator.
def should_poll(self) -> bool: return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_on(self):\n if self.is_update_locked():\n return self.graceful_state\n if self._state['action'] == 1 and self._state['state'] == 2:\n return True\n return False", "async def async_update(self) -> None:\n all_states = [self.hass.states.get(x) for x in self....
[ "0.6846774", "0.6731269", "0.66712904", "0.66300744", "0.6437781", "0.6404045", "0.6392167", "0.6353482", "0.63164604", "0.6313499", "0.6303177", "0.6263767", "0.62205803", "0.6157645", "0.61570364", "0.6144633", "0.61069655", "0.61067325", "0.6105299", "0.61030585", "0.60936...
0.60423785
66
Update the entity. This is a fake update, real update is done by coordinator.
async def async_update(self) -> None: return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_otoroshi_controllers_adminapi_tcp_service_api_controller_update_entity_action(self):\n pass", "def update(self) -> None:\n self._api.update()\n if self.available:\n self._attr_native_value = self._api.data[self.entity_description.key]\n else:\n self._att...
[ "0.7222287", "0.70166487", "0.69060814", "0.6806648", "0.6790305", "0.67849994", "0.6726298", "0.6726298", "0.6726298", "0.6689335", "0.6657549", "0.66194993", "0.66159046", "0.6605116", "0.6582124", "0.6562766", "0.6562766", "0.6562766", "0.65472424", "0.6530599", "0.6529737...
0.0
-1
Return the state of the switch.
def is_on(self): ret_val = self._get_switch_state() if ret_val is None: return False if isinstance(ret_val, bool): return ret_val if ret_val == STATE_ON: return True state = STATE_LOOKUP.get(ret_val, STATE_OFF) return state == STATE_ON
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_switch_state(self):\n if self.entity_description.value_fn is not None:\n return self.entity_description.value_fn(self._wrap_device)\n\n if self._api.state:\n feature = self.entity_description.key\n return self._api.state.device_features.get(feature)\n\n ...
[ "0.7842734", "0.78223336", "0.781984", "0.75626874", "0.73419946", "0.73333395", "0.7309488", "0.7309488", "0.7309029", "0.73056537", "0.7300842", "0.7293878", "0.7278227", "0.7278227", "0.7278227", "0.72651184", "0.72400886", "0.7129502", "0.71215", "0.70571035", "0.7047622"...
0.0
-1
Return True if entity is available.
def available(self) -> bool: is_avail = True if self.entity_description.available_fn is not None: is_avail = self.entity_description.available_fn(self._wrap_device) return self._api.available and is_avail
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def available(self) -> bool:\n return super().available and (\n self.coordinator.data.get(self.entity_description.key) is not None\n )", "def available(self) -> bool:\n if self.entity_description.always_available:\n return True\n return self.knx.xknx.connection_m...
[ "0.8291221", "0.8025913", "0.7288025", "0.724847", "0.7247756", "0.7247756", "0.72361225", "0.7186925", "0.7186925", "0.71700346", "0.7118156", "0.7103858", "0.7103858", "0.7103858", "0.71023947", "0.7093814", "0.7093814", "0.7093814", "0.70866835", "0.7074035", "0.70578057",...
0.8099782
1
Turn the entity off.
async def async_turn_off(self, **kwargs): if self.entity_description.turn_off_fn is None: raise NotImplementedError() if self.is_on: await self.entity_description.turn_off_fn(self._wrap_device)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def turn_off(self, **kwargs):\n self._is_on = False", "def turn_off(self, **kwargs):\n setattr(self.resource, self.variable, False)", "def turn_off(self, **kwargs):\n set_sonoff_state(self._host, \"off\")\n self._state = False", "def turn_off(self):\n self.handleCommand(1)\...
[ "0.7907074", "0.78206724", "0.7738741", "0.7726449", "0.7717234", "0.7699036", "0.7569424", "0.7569424", "0.75541544", "0.75168324", "0.75146556", "0.7475353", "0.7410971", "0.74089587", "0.7397875", "0.73854035", "0.737846", "0.7305533", "0.72589344", "0.72304344", "0.723010...
0.69814616
38
Turn the entity on.
async def async_turn_on(self, **kwargs): if self.entity_description.turn_on_fn is None: raise NotImplementedError() if not self.is_on: await self.entity_description.turn_on_fn(self._wrap_device)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def turn_on(self, **kwargs):\n self._is_on = True", "async def async_turn_on(self, **kwargs: Any) -> None:\n await self.entity_description.set_command(self, True)", "def turn_on(self, **kwargs) -> None:\n self.heater.turn_on()", "def turn_on(self, **kwargs):\n self._send_command(\...
[ "0.7749855", "0.76333284", "0.740764", "0.7400453", "0.7380775", "0.7380276", "0.73142236", "0.73142236", "0.7311529", "0.72834134", "0.72247684", "0.72237045", "0.7206476", "0.71866083", "0.7169044", "0.71320957", "0.70755565", "0.7069967", "0.69911647", "0.6968239", "0.6960...
0.68312943
29
Get current switch state
def _get_switch_state(self): if self.entity_description.value_fn is not None: return self.entity_description.value_fn(self._wrap_device) if self._api.state: feature = self.entity_description.key return self._api.state.device_features.get(feature) return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_state(self):\n return self.controller.get_state()", "def get_current_state(self):\n return self._current_state", "def get_current_state(self):\n return self.game.get_current_state()", "def state(self) -> bool:\n return self.get_state(self.entity_ids[\"switch\"])", "def r...
[ "0.74889183", "0.73827314", "0.73482925", "0.7328623", "0.7303987", "0.72895473", "0.72895473", "0.7262649", "0.72144073", "0.72110635", "0.71496564", "0.7141653", "0.71394473", "0.71338475", "0.7104394", "0.7095693", "0.70940304", "0.70775414", "0.7067311", "0.7067311", "0.7...
0.7429907
1
Return the state of the switch.
def is_on(self): return self._wrap_device.device.get_duct_zone(self._zone)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_switch_state(self):\n if self.entity_description.value_fn is not None:\n return self.entity_description.value_fn(self._wrap_device)\n\n if self._api.state:\n feature = self.entity_description.key\n return self._api.state.device_features.get(feature)\n\n ...
[ "0.784124", "0.7822742", "0.78202283", "0.7559278", "0.73421675", "0.7336753", "0.7311331", "0.7311331", "0.7310457", "0.7308101", "0.73031497", "0.7291704", "0.7280747", "0.7280747", "0.7280747", "0.7267481", "0.7242181", "0.71317464", "0.7118259", "0.7058468", "0.704671", ...
0.0
-1
Return True if entity is available.
def available(self) -> bool: return ( self._wrap_device.device.is_duct_zone_enabled(self._zone) and self._wrap_device.is_power_on )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def available(self) -> bool:\n return super().available and (\n self.coordinator.data.get(self.entity_description.key) is not None\n )", "def available(self) -> bool:\n is_avail = True\n if self.entity_description.available_fn is not None:\n is_avail = self.entit...
[ "0.8290694", "0.8096533", "0.80229723", "0.72852284", "0.72475594", "0.7245388", "0.7245388", "0.7233265", "0.7183755", "0.7183755", "0.71663904", "0.7114441", "0.710187", "0.710187", "0.710187", "0.7099363", "0.70918226", "0.70918226", "0.70918226", "0.7083896", "0.7070601",...
0.0
-1
Turn the entity off.
async def async_turn_off(self, **kwargs): self._wrap_device.device.set_duct_zone(self._zone, False)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def turn_off(self, **kwargs):\n self._is_on = False", "def turn_off(self, **kwargs):\n setattr(self.resource, self.variable, False)", "def turn_off(self, **kwargs):\n set_sonoff_state(self._host, \"off\")\n self._state = False", "def turn_off(self):\n self.handleCommand(1)\...
[ "0.7907074", "0.78206724", "0.7738741", "0.7726449", "0.7717234", "0.7699036", "0.7569424", "0.7569424", "0.75541544", "0.75168324", "0.75146556", "0.7475353", "0.7410971", "0.74089587", "0.7397875", "0.73854035", "0.737846", "0.7305533", "0.72589344", "0.72304344", "0.723010...
0.6796552
56
Turn the entity on.
async def async_turn_on(self, **kwargs): self._wrap_device.device.set_duct_zone(self._zone, True)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def turn_on(self, **kwargs):\n self._is_on = True", "async def async_turn_on(self, **kwargs: Any) -> None:\n await self.entity_description.set_command(self, True)", "def turn_on(self, **kwargs) -> None:\n self.heater.turn_on()", "def turn_on(self, **kwargs):\n self._send_command(\...
[ "0.7749855", "0.76333284", "0.740764", "0.7400453", "0.7380775", "0.7380276", "0.73142236", "0.73142236", "0.7311529", "0.72834134", "0.72247684", "0.72237045", "0.7206476", "0.71866083", "0.7169044", "0.71320957", "0.70755565", "0.7069967", "0.69911647", "0.6968239", "0.6960...
0.6249411
68
saves image into src
def save_img(arr): png = BytesIO() io.imsave(png, arr) png_url = blobs.createBlob(date, png.getvalue()) row = Src(data_url = png_url,\ type = 3) session.add(row) session.commit() return row.id # TODO: Save image and data into src table an...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_image(self):\n img = self.driver.find_element_by_xpath(web_map[self.region][img_path]).get_attribute(\"src\")\n img = requests.get(img, stream=True)\n self.search_results.export_image(self.region, img)", "def save_image(self):\n self.save()", "def save_image_action(self):\n ...
[ "0.7691621", "0.7572592", "0.7285594", "0.71995753", "0.69788265", "0.6970801", "0.6932445", "0.691899", "0.6831218", "0.6732805", "0.67123884", "0.66007775", "0.6594967", "0.65921205", "0.6583858", "0.65806913", "0.6570882", "0.6566736", "0.6561037", "0.65172124", "0.6489499...
0.6599078
12
Takes a List of Tensors and returns a List of mask Tensor with 1 if the input was all zeros (on dimension 2) and 0 otherwise. This is used in the Attention layer to mask the padding observations.
def get_zero_entities_mask(entities: List[torch.Tensor]) -> List[torch.Tensor]: with torch.no_grad(): if exporting_to_onnx.is_exporting(): with warnings.catch_warnings(): # We ignore a TracerWarning from PyTorch that warns that doing # shape[n].item() will cause ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_attention_mask(input_ids): \n attention_masks = [] \n\n # 1 for input and 0 for pad\n for seq in input_ids: \n attention_masks.append([float(i>0) for i in seq])\n\n return attention_masks", "def get_padding_mask(inputs, padding_value=0):\n mask = tf.cast(tf.equal(inputs, padding_val...
[ "0.7192867", "0.68340164", "0.6609743", "0.651477", "0.64316094", "0.63892573", "0.62922674", "0.6264108", "0.6230588", "0.62144625", "0.61776084", "0.61677283", "0.61438", "0.6140973", "0.61276275", "0.611358", "0.6040983", "0.6023705", "0.6021974", "0.60033125", "0.59760505...
0.684822
1
Multi Head Attention module. We do not use the regular Torch implementation since Barracuda does not support some operators it uses.
def __init__(self, embedding_size: int, num_heads: int): super().__init__() self.n_heads = num_heads self.head_size: int = embedding_size // self.n_heads self.embedding_size: int = self.head_size * self.n_heads
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, nheads, d_model):\n super(MultiheadAttention, self).__init__()\n assert d_model % nheads == 0\n self.d_head = d_model // nheads\n self.nheads = nheads\n self.Q_fc = nn.Linear(d_model, d_model, bias=False)\n self.K_fc = nn.Linear(d_model, d_model, bias=Fa...
[ "0.70109355", "0.690106", "0.62428415", "0.6242478", "0.6139386", "0.61331534", "0.6070684", "0.5960381", "0.5922543", "0.5858437", "0.57944554", "0.5765642", "0.5750959", "0.5730744", "0.56587964", "0.56468225", "0.56435096", "0.5608189", "0.56068873", "0.5573652", "0.553277...
0.0
-1
Constructs an EntityEmbedding module.
def __init__( self, entity_size: int, entity_num_max_elements: Optional[int], embedding_size: int, ): super().__init__() self.self_size: int = 0 self.entity_size: int = entity_size self.entity_num_max_elements: int = -1 if entity_num_max_elemen...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, heropool_size, embedding_dim):\r\n super().__init__()\r\n self.embedding_dim = embedding_dim\r\n self.embeddings = nn.Embedding(heropool_size, embedding_dim)\r\n self.affine = nn.Linear(embedding_dim, heropool_size)\r\n self.init_emb()", "def __init__(self, i...
[ "0.6292023", "0.60847014", "0.60154206", "0.59721136", "0.59668916", "0.5889968", "0.5888461", "0.58747995", "0.58164847", "0.58022374", "0.57965434", "0.5796521", "0.57831573", "0.5779244", "0.5756787", "0.57168114", "0.57117504", "0.57061046", "0.5703201", "0.5696537", "0.5...
0.57668835
14
Constructs a ResidualSelfAttention module.
def __init__( self, embedding_size: int, entity_num_max_elements: Optional[int] = None, num_heads: int = 4, ): super().__init__() self.max_num_ent: Optional[int] = None if entity_num_max_elements is not None: self.max_num_ent = entity_num_max_eleme...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, pretrained=True, freeze_weights=True):\n super(RaisinNet34, self).__init__()\n # Define the model's name for it's output files\n # Load a pre-trained ResNet-34 model and turn off autograd\n # so its weights won't change.\n architecture = resnet34(pretrained=pre...
[ "0.5621225", "0.544435", "0.53626496", "0.5334829", "0.5327962", "0.5268676", "0.523798", "0.5227105", "0.5201277", "0.5181055", "0.5148044", "0.51474625", "0.5142541", "0.5127878", "0.5121603", "0.51125926", "0.5108721", "0.5103974", "0.50641334", "0.50507617", "0.50487804",...
0.0
-1
Load the configuration file that manage raw data. conf is a dictionary
def load_config_raw_data(conf): path = Path(conf["conf_raw_data"]) with open(path) as f: txt = f.read() conf = json.loads(txt) return conf
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_from_conf(self):\r\n raise NotImplementedError", "def load_from_conf(self):\n raise NotImplementedError", "def loadConf(self):\n\n with open(self.configFile) as f:\n self.config = json.load(f)", "def load_conf(self):\n self._read_uconf()", "def _load_conf(sel...
[ "0.7817127", "0.77862626", "0.7596874", "0.74215615", "0.73315775", "0.7204006", "0.7175266", "0.71260387", "0.6957915", "0.6763186", "0.6753021", "0.6738471", "0.6700064", "0.6662929", "0.6654338", "0.6623613", "0.66206634", "0.66160893", "0.6608538", "0.66063255", "0.655592...
0.80604255
0
Load as a pandas Dataframe the table specified by the name 'table' (string). Must match one of the keys in the \ conf raw data file
def load_raw_table(conf, table): confrd = load_config_raw_data(conf) path_table = Path(confrd[table]["path"]) sep = confrd[table]["sep"] encoding = confrd[table]["encoding"] df = pd.read_csv(path_table, sep=sep, encoding=encoding) return df
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_table(**kargs):\n from transformer import dehyphenate\n sep = LoincMTRT.delimit # kargs.get('sep', ',')\n input_dir = kargs.get('input_dir', 'data')\n dehyphen = kargs.get('dehyphenate', True)\n deq = kargs.get('dequote', True)\n one_to_one = kargs.get('one_to_one...
[ "0.68337256", "0.66754687", "0.6670916", "0.6593603", "0.65836316", "0.65808636", "0.6576015", "0.65135646", "0.64685476", "0.6413054", "0.6406398", "0.6404005", "0.6317207", "0.6181754", "0.6180371", "0.6171104", "0.61608464", "0.615348", "0.6132976", "0.6097652", "0.6096849...
0.8200111
0
Return slice of a, keeping only those values that are furthest away from 0 along axis
def maxabs(a, axis=None): maxa = a.max(axis=axis) mina = a.min(axis=axis) p = abs(maxa) > abs(mina) # bool, or indices where +ve values win n = abs(mina) > abs(maxa) # bool, or indices where -ve values win if axis == None: if p: return maxa else: return mina shape = list(a.shape)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def trim_zeros(array):\n multislice = []\n for i in range(array.ndim):\n sum_axes = tuple(j for j in range(array.ndim) if j is not i)\n edges = np.where(np.sum(array, axis=sum_axes) > 0)\n if edges[0].size == 0:\n return np.array([], dtype=array.dtype)\n low = edges[0][...
[ "0.69114363", "0.6314677", "0.6179363", "0.6159046", "0.6158749", "0.60858554", "0.59848356", "0.591753", "0.5856637", "0.575877", "0.5749622", "0.5729806", "0.57214385", "0.5714138", "0.5689817", "0.5685795", "0.56851953", "0.56598985", "0.56490386", "0.5639668", "0.5613493"...
0.5415767
30
Return cell volume in angstroms^3.
def volume_from_rs(rs,Nel): a0 = 0.5291772 # Bohr radius (angstroms/bohr) volume = (4.0*pi/3.0)*Nel * (rs*a0)**3 return volume
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_unitcell_volume(self):\n \n reduced_volume = sqrt( 1 - (cos(self.alpha))**2 - (cos(self.beta))**2 - (cos(self.gamma))**2 + 2*cos(self.alpha)*cos(self.beta)*cos(self.gamma) )\n volume = reduced_volume*self.lattice_spacing_a*self.lattice_spacing_b*self.lattice_spacing_c\n \n ...
[ "0.77642494", "0.7538697", "0.74564636", "0.7429672", "0.74056345", "0.7332025", "0.7079599", "0.69186044", "0.68799436", "0.68330055", "0.67884755", "0.6783145", "0.6772365", "0.67689323", "0.67625916", "0.6737969", "0.67258954", "0.67070013", "0.670095", "0.67007643", "0.66...
0.6428115
28
initializes the icommands for an irods userzone
def iinit(self): # remove old irods settings if they exist if os.path.exists(self.ienv): os.remove(self.ienv) if os.path.exists(self.iauth): os.remove(self.iauth) self._init_icommands() pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initGui(self):\n\n icon_path = ':/plugins/PluginChoucas/img/loaddata.png'\n self.add_action(\n icon_path,\n text=self.tr(u'Chargement de données de montagne'),\n callback=self.run,\n parent=self.iface.mainWindow())\n \n icon_path = ':/plug...
[ "0.62643325", "0.62293196", "0.6199269", "0.60921407", "0.60914946", "0.6089207", "0.6083126", "0.60564566", "0.60542786", "0.60514116", "0.6041391", "0.5982728", "0.5969388", "0.5960284", "0.59464496", "0.5934442", "0.5928464", "0.59121406", "0.5886387", "0.5881636", "0.5859...
0.54540724
44
lists contents of hydroshare irods userspace
def ils(self): cmd = Popen(['ils'], stdout=PIPE, stderr=STDOUT, shell=True) stdout = cmd.communicate()[0].decode('ascii') if cmd.returncode != 0: print('Failed to fetch irods file list: %s' % stdout) return [] return [s.replace('C-', '').strip() for s in ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list():\n rino.remote.list()", "def list_data(self):\n with self.read():\n keys = self.handle.keys()\n return [i.lstrip('/') for i in keys]", "def list():", "def list():", "def list(self):", "def list():\n data = getInstaData()\n return render_template(\"list.htm...
[ "0.6433237", "0.6131444", "0.6028496", "0.6028496", "0.60075146", "0.5948483", "0.5939381", "0.591174", "0.58719695", "0.5800662", "0.5770601", "0.56504005", "0.5648978", "0.5616612", "0.55690056", "0.5552401", "0.5549238", "0.55253196", "0.54935414", "0.5482844", "0.5472509"...
0.6275398
1
gets a file from the hydroshare irods userspace
def iget(self, filename, destination=None, unzip=True): # build the destination if destination is None: destination = os.environ['DATA'] irods_cmd = 'iget -f -r %s %s' % (filename, destination) cmd = Popen([irods_cmd], stdout=PIPE, stderr=STDOUT, shell=True...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_file(self, sys_id):\n url = \"{}/file\".format(self._target(sys_id))\n r = self._client.session.get(url, stream=True)\n return r", "def get_file():\n fname = get_var(request, \"fname\")\n return open(fname).read()", "def get_file(self, path):\n file = self.get('data_re...
[ "0.6181166", "0.58981305", "0.5823172", "0.56751233", "0.56499076", "0.56092876", "0.5596054", "0.5592535", "0.55464715", "0.5544626", "0.5531637", "0.5511701", "0.54973", "0.5472415", "0.54524964", "0.5451512", "0.54413545", "0.5437654", "0.54289883", "0.5412935", "0.5410079...
0.0
-1
sync files between Jupyter and iRODs
def irsync(self, source, target, source_irods=False, target_irods=True, dryrun=False): liverun = True source = 'i:%s' % source if source_irods else source target = 'i:%s' % target if target_irods else target irods_cmd = 'irsync -r %s %s' % (source, target) if dryr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sync(self, notebook):\n raise NotImplementedError(\"The function sync has not been \"\\\n \"implemented.\")", "def task_sync():\n target = 'analysis.ipynb'\n dep = 'analysis.md'\n return {\n 'file_dep': [dep],\n 'targets': [target],\n 'act...
[ "0.66149557", "0.649017", "0.63795453", "0.5787912", "0.5727001", "0.5634277", "0.55603755", "0.5512296", "0.5494928", "0.548126", "0.54650515", "0.54617155", "0.5455434", "0.5448497", "0.54231524", "0.53581405", "0.53554475", "0.53354084", "0.5319489", "0.5262123", "0.526039...
0.53802687
15
transfers a large file from hydroshare.
def getResourceFromHydroshare(self, resid, destination=None): print('Not Implemented')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transfer(file_obj):", "def peer_server_upload(self, conn, data_received):\n try:\n file_size = os.path.getsize(SHARED_DIR+'/'+data_received['file_name'])\n f = open(SHARED_DIR+'/'+data_received['file_name'], 'rb')\n #print \"Hosting File: %s for download\" % data_recei...
[ "0.71689564", "0.63118", "0.61202866", "0.5992885", "0.5918774", "0.58268136", "0.5826182", "0.5798397", "0.5767912", "0.5700033", "0.56148034", "0.55912936", "0.5553005", "0.5547394", "0.5540036", "0.55270714", "0.5510804", "0.5509437", "0.55006397", "0.5494637", "0.545897",...
0.0
-1
This is the exposed Event keyword to toby/Robot
def run_event(self, event, *args, **kwargs): if not self.events_registered: # get the BuiltIn list of events self.events_registered = self.register_event() iteration = int(kwargs.get('iteration', 1)) device = kwargs.get('device', None) #interface = kwargs.get('i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def on_event(self, event):", "def on_event(self, event):\r\n pass", "def trigger(self, type, event):", "def __call__(self, trigger, type, event):", "def on_event(self, event):\n pass", "def handle_event(self, event):", "def events(self):", "def visit_event(self, event):", "def handleE...
[ "0.74635714", "0.74540436", "0.7425531", "0.7424931", "0.73351365", "0.71755356", "0.7141372", "0.71365786", "0.6942784", "0.69211715", "0.6871382", "0.68416166", "0.6831906", "0.68172306", "0.67804134", "0.6772497", "0.67365015", "0.6691763", "0.66311324", "0.6611874", "0.65...
0.0
-1
Parses help function related command line arguments
def parse_help_command(args): if len(args) < 2: print_generic_help() elif len(args) == 2: print_specific_help(args[1]) else: print 'Error! Found too many arguments for --help! Use --help with ' \ '0 arguments to print generic help or type --help <tool_name> ' \ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def help_args():\n pass", "def cmd_help(args):", "def help():", "def parse_help(func):\n # Grab the raw doc\n doc = func.__doc__\n\n # Check for non-existent documentation and return a 404 message of sorts\n if not doc:\n return 'Woops, there isn\\'t any documentation for this comma...
[ "0.7847874", "0.77260983", "0.70513254", "0.69754887", "0.69650877", "0.6873133", "0.68621254", "0.68289644", "0.68287694", "0.6820131", "0.6775463", "0.6759491", "0.67532665", "0.6748584", "0.6723732", "0.6722001", "0.67210186", "0.67115545", "0.6693269", "0.66598135", "0.65...
0.7642248
2
Prints basic info and help.
def print_generic_help(): print ART_NAME print 'Version {1}\nby {2}'.format(NAME, VERSION, AUTHOR) print DESCRIPTION tools = sorted(AvailableCommands.commands.keys(), key=lambda v: v.upper()) # Do not show CUSTOM command in the help tools.remove('CUSTOM') tools.remove('CUSTOM_NO_OUTPU...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def printhelp():", "def print_help(self):\n print self.get_help()", "def print_help():\n\tprint(\"Help text\")", "def print_help():\n parser = parsersetup()\n parser.print_help()", "def printHelp(self,):\n print man\n return 0", "def print_help(self):\n self.parser.print...
[ "0.8107689", "0.80103046", "0.80062634", "0.79572546", "0.78228676", "0.7787149", "0.77444273", "0.7615102", "0.75675267", "0.75575185", "0.74872893", "0.7475385", "0.745855", "0.7442314", "0.73533386", "0.7345682", "0.73190933", "0.7296384", "0.7265832", "0.7260435", "0.7245...
0.7423533
14
Prints help for a specified tool.
def print_specific_help(tool_name): if tool_name not in AvailableCommands.commands: print 'Command is not supported: {0}'.format(tool_name) return cmd = AvailableCommands.commands[tool_name] print 'Usage of {0}:'.format(cmd.name) print '\nAccepted input types:\n{0}'.format(str(li...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_generic_help():\r\n print ART_NAME\r\n print 'Version {1}\\nby {2}'.format(NAME, VERSION, AUTHOR)\r\n print DESCRIPTION\r\n tools = sorted(AvailableCommands.commands.keys(), key=lambda v: v.upper())\r\n # Do not show CUSTOM command in the help\r\n tools.remove('CUSTOM')\r\n tools.rem...
[ "0.7634922", "0.72920835", "0.72188467", "0.71694416", "0.7161719", "0.71323955", "0.70277065", "0.7019475", "0.7019475", "0.7019475", "0.69998395", "0.69744694", "0.6969143", "0.6901238", "0.6899467", "0.6888493", "0.68664163", "0.6864778", "0.68607914", "0.6853852", "0.6775...
0.83063513
0
Reads through the config.txt file and reports any issues
def validate_config_file(args): # Validate arguments if len(args) > 2: print 'Error! --validate_config does not take any arguments.' return # Check if the config.txt exists if not os.path.exists(utils.CONFIG_FILE_PATH): print 'Config file does not seem to exist. Do you w...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_config(self, config_filename):", "def check_config_file(config_file_name, log_full_filename, log_file_path):\n try:\n if not os.path.isfile(config_file_name):\n # file not exist\n append_log_info(\"Config file not exists\", log_full_filename, log_file_path)\n r...
[ "0.7192984", "0.67477554", "0.6561265", "0.6482356", "0.6377692", "0.63626087", "0.6328165", "0.6240044", "0.62231106", "0.61841595", "0.618097", "0.6171251", "0.61445713", "0.6141632", "0.6137012", "0.6134964", "0.6129961", "0.6128813", "0.6123711", "0.60856384", "0.6077486"...
0.6604901
2
Creates an updated version of current config.txt file If config.txt does not exist, it is created.
def update_config_file(commands_to_add, commands_to_remove): # Parse the config.txt file contents config_file_contents = {} if os.path.exists(utils.CONFIG_FILE_PATH): config_file_string = utils.get_config_file() first_line = True for line in config_file_string.split('\n'): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create():\n config_file = get_config_file()\n if os.path.isfile(config_file):\n logger.info(\"The config file already exists at '%s'\", config_file)\n return\n _create_config()\n logger.info(\"Created config file at '%s'\", config_file)", "def configure_template_file(outName, CONFIG...
[ "0.70750207", "0.7046834", "0.67969155", "0.6767401", "0.6633", "0.66246957", "0.66090316", "0.6598478", "0.6496239", "0.6465777", "0.6396055", "0.63894176", "0.63544285", "0.6312344", "0.6298606", "0.6227171", "0.618552", "0.6169344", "0.6132309", "0.61220276", "0.6090062", ...
0.59558344
32
Parses and validates command line arguments into a named tuple
def parse_command_line(args): # Initial validity check of input command: each argument may be # defined only once for a in args: if a.startswith('--'): if args.count(a) > 1: raise STAPLERerror.STAPLERerror('Each command line parameter can be ' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_arguments(args):", "def parseArgs ():\n independentBaseName = None\n dependentBaseName = None\n independentTSID = None\n dependentTSID = None\n statisticsFile = None\n nEquations = None\n logFile = None\n #\n # Loop through command line arguments\n for arg in sys.argv:\n ...
[ "0.73933643", "0.7161926", "0.71610683", "0.694863", "0.69094247", "0.689724", "0.6781782", "0.67691696", "0.6755849", "0.6726755", "0.67256963", "0.6716309", "0.6707882", "0.6687657", "0.6658016", "0.6648027", "0.6635262", "0.6631878", "0.6613462", "0.6604489", "0.6560422", ...
0.61447746
73
Reads the user provided inputfile.
def parse_input_file(command_line_parameters): try: handle = open(command_line_parameters.staplerfile_path) except IOError: raise STAPLERerror.STAPLERerror( 'Unable to open input file: {0}'.format(command_line_parameters.staplerfile_path)) i = 0 staplefile = [] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _read_input_file(self):\n pass", "def read_input_file(self):\n\n # Check if input file exists in current directory, if not kill process\n if not os.path.isfile('./visualise.inpt'):\n print('Cannot find input file \"visualise.inpt\" in current directory')\n sys.exit(...
[ "0.7806833", "0.7186645", "0.71339846", "0.70758235", "0.7059983", "0.7019565", "0.69860697", "0.69175416", "0.6860928", "0.68346906", "0.68346906", "0.6793393", "0.6735411", "0.66906273", "0.6640738", "0.66247755", "0.659747", "0.65621734", "0.6518654", "0.64859736", "0.6452...
0.0
-1
Deletes the directory tree (except input dir) and all contents.
def remove_workflow(input_file_parameters, dir_stack): dirs_to_del = [] files_to_del = 0 for d in dir_stack[1:]: if not os.path.exists(d.path): continue dirs_to_del.append(d.path) files_to_del += len(os.listdir(d.path)) if os.path.exists(input_file_parameters.output_dir): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def DeleteFolderContents(dir):\n create_dir(dir)\n shutil.rmtree(dir)\n create_dir(dir)", "def delete(self): # DirObj.delete\n self.deleted=True\n for name, d in self.subdirs.iteritems():\n d.delete()\n for name, f in self.files.iteritems...
[ "0.72931165", "0.7170282", "0.71510774", "0.70483434", "0.70209104", "0.6979865", "0.6977318", "0.6941026", "0.6845068", "0.68373054", "0.6833642", "0.6824362", "0.67982185", "0.6728855", "0.67046416", "0.6693369", "0.6665588", "0.66357285", "0.6628462", "0.6615885", "0.66041...
0.0
-1
Generates command line objects to compress/decompress a workflow.
def generate_compression_command_line_objects(dir_stack, command_line_parameters): # Generate command lines threads = [] thread_sizes = [] first_d = True for d in dir_stack: if first_d: first_d = False continue if not os.path.isdir(d.path): continue...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\n import argparse\n\n parser = argparse.ArgumentParser(\n description='Use the machine learning meta library shrynk to compress'\n )\n subparsers = parser.add_subparsers(dest=\"command\")\n compress = subparsers.add_parser('compress')\n compress.add_argument('file', help='file ...
[ "0.636741", "0.61607385", "0.6109988", "0.5978106", "0.5915388", "0.58942014", "0.58697283", "0.58455306", "0.5824884", "0.58116597", "0.5769307", "0.5750805", "0.57481354", "0.5736904", "0.57217336", "0.5676748", "0.5655071", "0.5651055", "0.5635633", "0.5598006", "0.5588914...
0.65829694
0
Initiates the logging. NOTICE! This function has the side effect of changing the value of the class variable Current_log_path.path!
def init_logging(input_file_parameters, dir_stacks): fl_name = '{0}_log_{1}_{2}.txt'.format(NAME, START_TIME, input_file_parameters.job_name) #NOTICE! Current_log_path.path is changed here! CurrentLogPath.path = os.pa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, log_path, on=True):\n self.log_path = log_path\n self.on = on\n\n if self.on:\n while os.path.isfile(self.log_path):\n self.log_path += '+'", "def setPath(logPath):\n GlobalLogger.logger.close()\n GlobalLogger.logger = FileLogger(log...
[ "0.73906374", "0.71995836", "0.71914166", "0.7117808", "0.70605886", "0.6795082", "0.668465", "0.66670847", "0.66334504", "0.66144496", "0.65918565", "0.65881616", "0.65418017", "0.6516116", "0.6497801", "0.64702743", "0.6458893", "0.6458879", "0.64564496", "0.6424611", "0.63...
0.6691878
6
Infers the directory tree structure required for current workflows.
def infer_dir_stack(input_file_parameters, create_dirs, allow_existing_dirs = True): dir_stack = [Directory(input_file_parameters.starting_point_directory, create_dir=create_dirs)] directory_name_index = 1 for i in xrange(len(input_file_parameters.commands)): if input...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tree(self) -> None:\n tree = Tree(self.root.path)\n self.root.walk_dir(tree)", "def walker(self, path=None, base_folder=None):\n path = path or self.path\n base_folder = base_folder or self.base_folder\n # prevent trailing slashes and other inconsistencies on path.\n ...
[ "0.63796633", "0.59604615", "0.5903772", "0.5750373", "0.5714359", "0.5682023", "0.5665029", "0.55971795", "0.55720335", "0.5561951", "0.55350435", "0.552684", "0.5519678", "0.54708374", "0.54263985", "0.5418281", "0.54158896", "0.5394255", "0.53864056", "0.5386263", "0.53758...
0.5606479
7
Generates commands to execute workflow for each input file.
def generate_command_line_objects(input_file_parameters, dir_stack, auto_split_workflows): workflows = [] prev_number_of_ids_per_command = None prev_command_had_output_dir = True first_command = True # Bools for splitting workflow. Separate values for automatically splitting workflow and #...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def execute(self):\n for line in fileinput.input():\n line = line.rstrip()\n self._process_command(line)", "def regenerate_command_line_objects(input_file_parameters, dir_stack,\r\n auto_split_workflows):\r\n workflows = []\r\n prev_number_of_i...
[ "0.65493697", "0.61751366", "0.61644983", "0.6146389", "0.58796287", "0.58742994", "0.5830146", "0.5827008", "0.5818108", "0.5804637", "0.57874596", "0.5779958", "0.5779178", "0.57518756", "0.571343", "0.56952333", "0.5652398", "0.56454384", "0.56206775", "0.5620343", "0.5577...
0.6298623
1
Generates command lines that have not been successfully executed.
def regenerate_command_line_objects(input_file_parameters, dir_stack, auto_split_workflows): workflows = [] prev_number_of_ids_per_command = None prev_command_had_output_dir = True first_command = True # Bools for splitting workflow. Separate values for autom...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testEmptyCommands(self):\n pl = Pipeline(loadInitFile=False)\n repl = REPL(pl)\n\n repl.runCommandLine('4')\n self.assertEqual(4, pl.stdin)\n self.assertEqual(REPL.DEFAULT_PS1, repl.prompt)\n\n repl.runCommandLine('')\n self.assertEqual(4, pl.stdin)\n sel...
[ "0.5933541", "0.58501595", "0.5688975", "0.56812465", "0.55928385", "0.5546314", "0.55284", "0.5519794", "0.55064476", "0.55031", "0.54902095", "0.5478368", "0.547295", "0.5469581", "0.5469581", "0.5469581", "0.5469581", "0.5458891", "0.5446208", "0.54371554", "0.5420579", ...
0.0
-1
Analyzes output out and error files and reports putative errors.
def check_run_logs(input_file_parameters, dir_stack): # Check resource manager produced .out and .err files for assumed error # messages. print 'Checking runtime log files for error messages...' file_names = os.listdir(input_file_parameters.output_dir) newest_fix_index = 0 files_to_check...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def error_analyze(\n self,\n data_dir: Path,\n processed_data_dir: Path,\n result_dir: Path,\n output_report_dir: Path,\n ) -> NoReturn:\n pass", "def report_errors(clazz, output, max_lines):\n if COMPILE_ERR_PATC.search(output):\n # Comp...
[ "0.6987194", "0.6444478", "0.6306633", "0.6203654", "0.6200872", "0.6159186", "0.6075979", "0.60607296", "0.60173655", "0.5971868", "0.5959482", "0.5884925", "0.5875602", "0.587055", "0.5859751", "0.5793299", "0.5790206", "0.5765882", "0.5711678", "0.5709301", "0.57062423", ...
0.54195714
52
Reports which commands have not been successfully run. Commands found in staplefile are compared with files found in directory stack to identify which commands have failed.
def validate_run_results(input_file_parameters, dir_stack): prev_command_had_output_dir = True dir_stack_index = -1 command_index = 0 for current_command in input_file_parameters.commands: # Skip over SPLIT commands if current_command == 'SPLIT': continue co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_run_logs(input_file_parameters, dir_stack):\r\n # Check resource manager produced .out and .err files for assumed error\r\n # messages.\r\n print 'Checking runtime log files for error messages...'\r\n file_names = os.listdir(input_file_parameters.output_dir)\r\n\r\n newest_fix_index = 0\r\...
[ "0.6216581", "0.5714732", "0.56718695", "0.56527007", "0.5601208", "0.55626947", "0.5551729", "0.5527082", "0.5517359", "0.54875124", "0.5445772", "0.5432267", "0.54280514", "0.54172146", "0.5366206", "0.5357607", "0.5353905", "0.5338872", "0.5335011", "0.5333496", "0.5318811...
0.67288995
0