query
stringlengths
10
2k
document
stringlengths
20
51.2k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Sets the evaluators of this ModelsArray.
def evaluators(self, evaluators: List[Evaluator]): if evaluators is None: raise ValueError("Invalid value for `evaluators`, must not be `None`") # noqa: E501 self._evaluators = evaluators
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_eval(self):\n for m in self.models.values():\n m.eval()", "def set_models_eval(self):\n raise NotImplementedError", "def evaluators(self) -> List[Evaluator]:\n return self._evaluators", "def evaluator(self, evaluator):\n self.__evaluator = evaluator", "def set...
[ "0.6463916", "0.6458273", "0.6396392", "0.62021065", "0.5875876", "0.5742482", "0.57301223", "0.5729821", "0.5725775", "0.5593575", "0.5475925", "0.5475925", "0.54474145", "0.54269457", "0.54049397", "0.534519", "0.52953035", "0.5268137", "0.5268137", "0.5268137", "0.5268137"...
0.70705765
0
Create a new Finder instance for rootPath. If omitted, then used the current directory.
def __init__(self, rootPath=None): self.rootPath = rootPath or '.'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rootfs(self) -> \"Directory\":\n _args: list[Arg] = []\n _ctx = self._select(\"rootfs\", _args)\n return Directory(_ctx)", "def __init__(self, root_path):\n self._root = root_path\n if not os.path.exists(self._root):\n os.makedirs(self._root)", "def __init__(self, root_path)...
[ "0.65532523", "0.5766891", "0.5749619", "0.54951334", "0.54062235", "0.5376958", "0.5328739", "0.5224455", "0.5207491", "0.5204426", "0.51739526", "0.5159416", "0.5148969", "0.51332295", "0.512912", "0.509754", "0.50887555", "0.5073399", "0.50546134", "0.50411695", "0.5011857...
0.64325523
1
return the embedding of the word in the sentence
def bert_embedding(sentence, word, use_gpu=False): # since downloading bert is slow: only do it once and cache it as a global variable global BERT_MODEL, BERT_TOKENIZER if BERT_MODEL is None or BERT_TOKENIZER is None: print("one-time downloading of bert") BERT_TOKENIZER = BertTokenizer.from_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def embed_word(self):\n return self.emb.get_keras_embedding(dropout = self.emb_dropout,\n trainable = self.trainable_emb,\n input_length = self.sent_maxlen)", "def embed_word(self):\n return self.emb.get_keras_emb...
[ "0.8203342", "0.815841", "0.720479", "0.71091723", "0.7059577", "0.70217305", "0.69782954", "0.6919344", "0.6912848", "0.6909203", "0.6853779", "0.6803102", "0.6760258", "0.67344797", "0.6645827", "0.6616806", "0.65990925", "0.65817505", "0.6579353", "0.65467066", "0.65444297...
0.64342785
31
Create the SplitUnderscoreTokens block instance.
def __init__(self, deprel=None, default_deprel='flat', **kwargs): super().__init__(**kwargs) self.deprel = deprel self.default_deprel = default_deprel
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_split(self) -> NoReturn:\n raise NotImplementedError", "def __init__(self):\n self.tokens = []", "def create_splitword_tags(wordpart_1, wordpart_2):\n\n # Create new <splitwords> tag\n if not sentence.sem.find('splitwords'):\n ...
[ "0.5870139", "0.53850096", "0.5313972", "0.530353", "0.5257954", "0.52241683", "0.51720566", "0.516009", "0.51414496", "0.51163507", "0.50601035", "0.5058372", "0.5025301", "0.4989237", "0.4934088", "0.48999885", "0.4885673", "0.4860355", "0.48149368", "0.4804092", "0.4784760...
0.0
-1
Given a frequency in the Mel scale, returns the corresponding frequency in the linear scale.
def mel_to_linear(frequency): return 700.0 * (np.exp(frequency / 1127.01048) - 1.0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def linear_to_mel(frequency):\n return 1127.01048 * np.log(1.0 + frequency / 700.0)", "def _hz_to_mel(freq: float, mel_scale: str = \"htk\") -> float:\n if mel_scale not in ['slaney', 'htk']:\n raise ValueError('mel_scale should be one of \"htk\" or \"slaney\".')\n\n if mel_scale == \"htk\":\n ...
[ "0.736643", "0.7044521", "0.6750638", "0.6620888", "0.65850633", "0.6447089", "0.6398663", "0.62952095", "0.6242542", "0.6189203", "0.6137669", "0.6122837", "0.6074841", "0.60747015", "0.60728496", "0.60702187", "0.6067527", "0.6015159", "0.59484047", "0.5946602", "0.59217924...
0.79904306
0
Set to defaults the non mandatory fields
def reset(self): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def default_input_fields(fields):\n set_defaults(fields, INPUTSPEC_DEFAULTS)", "def _populate_always_present_fields(self, field):\n defaults = [\n (\"label\", \"\"),\n (\"instructions\", \"\"),\n (\"placeholder\", \"\"),\n (\"defaultValue\", \"\"),\n ...
[ "0.75056213", "0.73625386", "0.73207474", "0.72703975", "0.70498836", "0.699255", "0.6949345", "0.6690572", "0.66700906", "0.66542804", "0.65652484", "0.6464567", "0.6464268", "0.6355394", "0.63546616", "0.6350199", "0.630713", "0.6304371", "0.62777215", "0.6265332", "0.62474...
0.0
-1
Set to defaults the non mandatory fields
def reset(self): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def default_input_fields(fields):\n set_defaults(fields, INPUTSPEC_DEFAULTS)", "def _populate_always_present_fields(self, field):\n defaults = [\n (\"label\", \"\"),\n (\"instructions\", \"\"),\n (\"placeholder\", \"\"),\n (\"defaultValue\", \"\"),\n ...
[ "0.7504357", "0.7362061", "0.73197156", "0.726924", "0.7050304", "0.6994124", "0.6948102", "0.6689753", "0.6671519", "0.66526955", "0.6565641", "0.64660454", "0.6464509", "0.6354531", "0.6353541", "0.634931", "0.6307732", "0.63034064", "0.6277313", "0.6265635", "0.6247693", ...
0.0
-1
Set to defaults the non mandatory fields
def reset(self): # first we need to stop syncing as we will reset the fields self.internal.start_syncing = False # Set non mandatory fields to default values. # Note that list self.dataclass_field_names already skips mandatory # fields for f_name in self.dataclass_field_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def default_input_fields(fields):\n set_defaults(fields, INPUTSPEC_DEFAULTS)", "def _populate_always_present_fields(self, field):\n defaults = [\n (\"label\", \"\"),\n (\"instructions\", \"\"),\n (\"placeholder\", \"\"),\n (\"defaultValue\", \"\"),\n ...
[ "0.75056213", "0.73625386", "0.73207474", "0.72703975", "0.70498836", "0.699255", "0.6949345", "0.6690572", "0.66700906", "0.66542804", "0.65652484", "0.6464567", "0.6464268", "0.6355394", "0.63546616", "0.6350199", "0.630713", "0.6304371", "0.62777215", "0.62474835", "0.6228...
0.6265332
19
Visualize conv. features as an image (mostly for the 1st layer). Place kernel into a grid, with some paddings between adjacent filters.
def __put_activations_on_grid(self, activations, grid, pad=1): grid_Y, grid_X = grid # get first image in batch to make things simpler activ = activations[0, :] # scale to [0, 255.0] mean, var = tf.nn.moments(activ,axes=[0, 1]) activ = (activ - mean) / tf.maximum(var, 1....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_filters(self):\n w_mat = np.transpose(self.sess.run(self.W_fc1))\n\n plt.figure(figsize=(10,10), facecolor='w', edgecolor='w')\n plot_positions = [(0,0),(0,1),(1,0),(1,1)]\n for ch in range(self.n_input_channels):\n grid,_ = ia.image_grid_RGB( w_mat,\n ...
[ "0.7123759", "0.68541694", "0.67523426", "0.6337414", "0.60900193", "0.6079593", "0.60046905", "0.5944209", "0.59106284", "0.5902847", "0.58713514", "0.5859463", "0.5855875", "0.5848536", "0.5840786", "0.58324033", "0.57977355", "0.5795225", "0.5771769", "0.5763907", "0.57230...
0.54915476
52
Returns the size of this Directory (in bytes)
def get_size(self) -> int: total_size = 0 for entry in self.__entries: total_size += entry.get_size() return total_size
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getsize(self):\n return os.path.getsize(self.path)", "def get_size(self):\n return get_dir_size(self.run_dir)", "def dirsize(self):\n total = 0\n for p in self.select_file(recursive=True):\n try:\n total += p.size\n except: # pragma: no cove...
[ "0.8108387", "0.80629957", "0.80201715", "0.7703331", "0.76680636", "0.76095545", "0.75837773", "0.75685555", "0.7545489", "0.75350696", "0.7511537", "0.74948895", "0.74948895", "0.74822843", "0.74822843", "0.7479199", "0.7458907", "0.745731", "0.74552214", "0.74552214", "0.7...
0.71150374
83
This module is responsible for converting a document into a cleaned version using nltk 1. Tokenize using whitespace splitting 2. Remove punctuation 3. Remove words that are 13 characters long 5. Join back together
def clean_line(line: str) -> str: tokens = re.sub('[^a-z0-9 ]+', ' ', line.lower()).split(' ') stemmed_tokens = [w for w in tokens if len(w) > 2] return ' '.join(stemmed_tokens)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def text_to_corpus(text, accented_chars=True,\n convert_num=True, extra_whitespace=True, \n lemmatization=True, lowercase=True, punctuations=True,\n remove_html=True, remove_num=True, special_chars=True, \n stop_words=True): \n \n\n \"...
[ "0.72928315", "0.72249854", "0.70844024", "0.7003068", "0.69943017", "0.6953713", "0.69477946", "0.6894806", "0.68695956", "0.6788372", "0.67735374", "0.6770453", "0.67692745", "0.6752562", "0.67228603", "0.66665894", "0.66464186", "0.6636485", "0.65831125", "0.6576929", "0.6...
0.0
-1
Returns a sorted list of all the nodes in the graph.
def getNodes(self): return [ node for node in sorted(self._nodes.values()) ]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sorted_nodes_list(self):\r\n full_sorted_node_list = map(lambda k: k[0], sorted(self.graph.degree(),\r\n key=lambda k: k[1], reverse=True))\r\n return full_sorted_node_list", "def nodes(self):\n data = list(self._nodes.values())\n...
[ "0.83661425", "0.8150958", "0.81430566", "0.80271924", "0.7834774", "0.78342414", "0.7811343", "0.7765387", "0.76849276", "0.7672269", "0.7644578", "0.75486195", "0.746901", "0.7455782", "0.74385524", "0.7428508", "0.74063116", "0.74063116", "0.7266067", "0.7220782", "0.72182...
0.830264
1
Returns a sorted list of all the arcs in the graph.
def getArcs(self): return [ arc for arc in sorted(self._arcs) ]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getArcsFrom(self):\n return [ arc for arc in sorted(self._arcsFrom) ]", "def getArcsTo(self):\n return [ arc for arc in sorted(self._arcsTo) ]", "def get_arcs(self):\n arcs = []\n for arcs_set in self._inc.values():\n for arc in arcs_set: arcs.append(arc)\n ret...
[ "0.7353115", "0.7163079", "0.69804496", "0.69307196", "0.68843204", "0.6621363", "0.6538456", "0.6484678", "0.6278923", "0.62781584", "0.6221568", "0.6210172", "0.6073974", "0.6049425", "0.60261214", "0.59455025", "0.5938392", "0.5938392", "0.593732", "0.5919215", "0.58982337...
0.7594932
0
Returns the name of this node.
def getName(self): return self._name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def node_name(self):\n return self._node_name", "def get_node_name(self):\n return util.join_names_underscore(self.name, str(self.as_pointer()))", "def get_node_name(self, node):\n return node.name", "def get_name(self):\n return self.tagnode", "def node_name(self) -> str:\n ...
[ "0.9099379", "0.88863266", "0.8822407", "0.8704277", "0.8679075", "0.8606463", "0.8606463", "0.8606463", "0.8606463", "0.83902556", "0.813213", "0.8081044", "0.807949", "0.8060237", "0.8060237", "0.80519634", "0.8041921", "0.8021145", "0.80186236", "0.8017775", "0.8017775", ...
0.0
-1
Returns a list of all the arcs leaving this node.
def getArcsFrom(self): return [ arc for arc in sorted(self._arcsFrom) ]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getArcs(self):\n return self.getArcsFrom()", "def getArcs(self):\n return [ arc for arc in sorted(self._arcs) ]", "def getArcsTo(self):\n return [ arc for arc in sorted(self._arcsTo) ]", "def get_arcs(self):\n arcs = []\n for arcs_set in self._inc.values():\n ...
[ "0.67460525", "0.6428261", "0.63959223", "0.6391018", "0.6359991", "0.63250184", "0.6289035", "0.62246275", "0.61484927", "0.5980624", "0.5913321", "0.5879266", "0.56970537", "0.5670803", "0.5587407", "0.5579812", "0.5578958", "0.55465895", "0.55333656", "0.55295175", "0.5515...
0.6346407
5
Returns a list of all the arcs ending at this node.
def getArcsTo(self): return [ arc for arc in sorted(self._arcsTo) ]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def outgoing_arcs(self, tail_node):\n connections = []\n for arc in self.adj_list[tail_node]:\n connections.append(Arc(tail_node,arc[0],action = f\"{tail_node}->{arc[0]}\", cost = arc[1]))\n connections.sort(key = lambda x: x[1])\n return connections", "def get_arcs(self):\...
[ "0.6645371", "0.66353226", "0.65909207", "0.6531747", "0.6492937", "0.64009243", "0.6342159", "0.6265887", "0.6166436", "0.61544704", "0.608694", "0.594135", "0.59299", "0.5803615", "0.5663937", "0.5562664", "0.55158156", "0.54851633", "0.5480723", "0.54714334", "0.5463264", ...
0.606464
11
Returns a list of the nodes to which arcs exist.
def getNeighbors(self): targets = set() for arc in self._arcsFrom: targets.add(arc.getFinish()) return [ node for node in sorted(targets) ]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all_arcs(self):\n return [ (i, j) for i in self.constraints for j in self.constraints[i] ]", "def get_path_nodes(self, path):\n nodes = []\n for arc in path:\n start = self.arc_info[arc][\"start\"]\n destin = self.arc_info[arc][\"destin\"]\n nodes.app...
[ "0.67721367", "0.6736673", "0.661276", "0.6598873", "0.6526347", "0.65134615", "0.64985174", "0.6440924", "0.6394525", "0.6366482", "0.6332671", "0.6332671", "0.6324143", "0.6272511", "0.6255488", "0.6254109", "0.6238895", "0.6236566", "0.6233477", "0.6204647", "0.61798763", ...
0.67067516
2
Get item from cache and raise `CacheMissException` if not available.
def __getitem__(self, key): if self.contains(key): return self._cache[key][0] raise CacheMissException(key)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cache_get(item: str) -> object:\n\titem = str(item)\n\tcache = cache_find(item)\n\n\t# cache_find() will return none if the cache does not exist\n\t# the returned location is guaranteed to exist, so no point checking again.\n\n\tif cache is not None:\n\t\ttry:\n\t\t\tcached = pickle.load(open(cache, \"rb\"))\n...
[ "0.7485571", "0.73178744", "0.7036452", "0.68913704", "0.6881154", "0.6762452", "0.67308885", "0.6727461", "0.67231387", "0.6688476", "0.6688476", "0.6662746", "0.6660055", "0.6618925", "0.6536552", "0.65319014", "0.6515573", "0.650008", "0.6487618", "0.6486013", "0.63988024"...
0.80200624
0
Helper to merge dictionaries. Creates new dictionary, input dictionary are left untouched. Priority of items increases to the right (with highest priority for keyword arguments).
def dict_merge(*args, **kwargs) -> dict: # TODO: move this to upstream dependency (openeo package)? result = {} for d in args + (kwargs,): result.update(d) return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def merge(a: dict, b: dict) -> dict:\n return __merge(a, b)", "def mergedict(x, y):\n z = x.copy()\n z.update(y)\n return z", "def dict_merge(dict1, dict2):\n combined = dict(dict1)\n combined.update(dict2)\n return combined", "def dict_merge(dict1, dict2):\n combined = dict(dict1)\n ...
[ "0.75418717", "0.7403706", "0.73690224", "0.73690224", "0.7350922", "0.72236365", "0.7220859", "0.7207746", "0.72011614", "0.7157285", "0.7157285", "0.7157285", "0.712428", "0.7124155", "0.7107147", "0.70921755", "0.7087035", "0.7071935", "0.70612115", "0.7051908", "0.7051908...
0.76085716
0
Returns an argparse.ArgumentParser that applies each func in funcs to the parser. funcs None or a list of funcs that accept an argparse.ArgumentParser, parser None or an instance of an argparse.ArgumentParser. If not given, create our own. If funcs is not None, return a closure.
def build_arg_parser(funcs=None, parser=None, **argument_parser_kwargs): if funcs is None: _closure = False funcs = [] else: _closure = True if not parser: parser = argparse.ArgumentParser( formatter_class=argparse.ArgumentDefaultsHelpFormatter, **argu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run(funcs, *args, **kwargs):\n argv = kwargs.pop('argv', None)\n if argv is None:\n argv = sys.argv[1:]\n parser = _create_parser(funcs, *args, **kwargs)\n with _colorama_text():\n args = parser.parse_args(argv)\n # Workaround for http://bugs.python.org/issue9253#msg186387\n if ...
[ "0.5900534", "0.5789343", "0.55951285", "0.55753195", "0.5538998", "0.55103374", "0.53950083", "0.5344319", "0.53153604", "0.52933526", "0.5204244", "0.5186681", "0.510859", "0.5066353", "0.5050011", "0.5035792", "0.5032273", "0.5014846", "0.50109136", "0.4990684", "0.4990305...
0.8030992
0
Generate single sample from posterior predictive distribution.
def sample_prediction(sample_point, x_new, theta_dim, noise = True): # Sample point for theta theta_sample_point = sample_point["theta"] # Exception handling for ValueError try: with gp_toy_model: input_new = np.concatenate([x_new, np.tile(theta_sample_point, (len(x...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def posterior_sample(self):\n pass", "def get_posterior_sample(self):\n total_tries = self.prior_success + self.prior_failure\n prob_success = self.prior_success / total_tries\n # np.random.binomial采样出来的是二项分布的均值, 即正面朝上的次数,所以要除以N\n boot_sample = np.random.binomial(total_tries, prob_success) / t...
[ "0.7371589", "0.7347857", "0.7104296", "0.7044795", "0.70242053", "0.7002605", "0.6928911", "0.68354756", "0.67088443", "0.66815615", "0.66371804", "0.66371804", "0.66371804", "0.6628726", "0.65129155", "0.6503298", "0.6466275", "0.6433378", "0.6428346", "0.6418253", "0.64143...
0.5977884
65
Basic CRUD test for customization templates.
def test_customization_template_crud(): template_crud = pxe.CustomizationTemplate( name=generate_random_string(size=8), description=generate_random_string(size=16), image_type='RHEL-6', script_type='Kickstart', script_data='Testing the script') template_crud.create() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_template_subsciption(self):\n pass", "def test_otoroshi_controllers_adminapi_templates_controller_template_spec(self):\n pass", "def test_custom_templates_and_themes(self):\n new_templates_dir = os.path.join(self.temp_usable_dir, 'templates')\n manage_tmpl_file = os....
[ "0.7407133", "0.72310233", "0.7001032", "0.6997639", "0.68266696", "0.6733864", "0.66688555", "0.6545972", "0.6540119", "0.653132", "0.6530678", "0.6510409", "0.6483457", "0.6456371", "0.64347017", "0.6415115", "0.6361497", "0.6323861", "0.6322545", "0.62937975", "0.6239249",...
0.82386756
1
Check if the image passed is blurry or not
def is_blurry_colorful(image): b, _, _ = cv2.split(image) a = variance_of_laplacian(b) return (variance_of_laplacian(b) < 100)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Blur(image):\n\n return cv2.GaussianBlur(image,(7,7),0)", "def is_blurry(image, threshold=100):\n\n laplacian_var = cv2.Laplacian(image, cv2.CV_64F).var()\n return laplacian_var < threshold, laplacian_var", "def image_preprocessing(image):\n\treturn cv2.GaussianBlur(cv2.cvtColor(image, cv2.COLOR_B...
[ "0.71711", "0.6852913", "0.66571003", "0.6647143", "0.6547435", "0.6511232", "0.6480146", "0.64472395", "0.64052546", "0.6396507", "0.63959104", "0.6361597", "0.6361597", "0.6309478", "0.6257261", "0.62425804", "0.62061155", "0.62042844", "0.6186105", "0.61820495", "0.6168474...
0.7605146
0
Instantiates a Game object and takes in a list of strings
def __init__(self, phrases=PHRASES): self.phrases = [Phrase(phrase) for phrase in phrases] self.active_phrase = choice(self.phrases) self.lives = 5 self.playing = True self.already_guessed = []
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, players=None):\n self.game = Game()\n if players:\n self.player1 = players[0]\n self.player2 = players[1]\n else:\n self.player1 = Player('X')\n self.player2 = Player('O')\n self.record = Record()\n self.winning_moves...
[ "0.6376574", "0.62570804", "0.6233107", "0.62081665", "0.61806303", "0.61708856", "0.61674863", "0.61403465", "0.6100907", "0.6094847", "0.6044706", "0.603718", "0.59274703", "0.5898092", "0.5827587", "0.58157164", "0.58079094", "0.5758462", "0.5739364", "0.57135355", "0.5712...
0.55849326
36
Create dataframe for the results. Achieved by reading the .csv file and retrieving the results using pandas.
def cur_quotes_create_dataframe(self): self.cur_quotes_df = pandas.read_csv(self.cur_quotes_csvfile,header =None) self.cur_quotes_df.rename(columns={org: change.upper() for org, change\ in zip(self.cur_quotes_df.columns,self.cur_quotes_parm_headers)},\ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_dataframe():\r\n\r\n df = pd.read_csv('data/data.csv', header=0)\r\n return df", "def get_df_all_results(self, file):\n # read csv into dataframe\n df = pd.read_csv(file)\n # rename columns\n names = [\"index\", \"samp1\", \"samp2\", \"es\", \"sd1\", \"sd2\", \"k\", \...
[ "0.78141254", "0.72377795", "0.71052223", "0.678863", "0.659534", "0.65909404", "0.6584606", "0.653568", "0.6528905", "0.6517393", "0.6503574", "0.64934164", "0.6416347", "0.63922113", "0.637684", "0.6367102", "0.6354659", "0.6343067", "0.6341975", "0.6338528", "0.6330795", ...
0.0
-1
Break list into smaller equal chunks specified by chunk_size.
def break_list_to_sub_list(self, full_list, chunk_size = 45): if chunk_size < 1: chunk_size = 1 return [full_list[i:i + chunk_size] for i in range(0, len(full_list), chunk_size)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def split_chunk(list, chunk_size):\n for i in range(0, len(list), chunk_size):\n yield list[i:i + chunk_size]", "def chunks(self, list_to_chunk, size):\n for i in range(0, len(list_to_chunk), size):\n yield list_to_chunk[i:i + size]", "def split_to_chunks(of_list, chunk_size...
[ "0.8387335", "0.81280035", "0.8014335", "0.7874568", "0.7822331", "0.7711378", "0.77051705", "0.7692189", "0.7652359", "0.7640315", "0.763597", "0.75599116", "0.75538194", "0.7539541", "0.7459169", "0.737743", "0.73653746", "0.7333878", "0.7322242", "0.7320301", "0.73117113",...
0.69649094
41
load_from_json_file creates an object from a JSON file
def load_from_json_file(filename): with open(filename, 'r') as jFile: fString = jFile.read() fObj = json.loads(fString) return fObj
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_from_json_file(filename):\n with open(filename, 'r') as f:\n obj = json.loads(f.read())\n return obj", "def from_json_file(cls, json_file):\n with open(json_file, \"r\") as reader:\n return cls.from_dict(json.load(reader))", "def from_JSON(cls, filename):\n wi...
[ "0.865967", "0.85874206", "0.8462236", "0.8439559", "0.8407735", "0.8406404", "0.8406404", "0.8406404", "0.84028095", "0.8398896", "0.8314029", "0.83053803", "0.8290504", "0.828052", "0.8230285", "0.822139", "0.81900096", "0.8166696", "0.808424", "0.8056764", "0.8044521", "...
0.8315857
10
Store acceleration data in CSV file
def store_csv(self): with open(self.filepath.with_suffix(".csv"), 'w', newline='') as csvfile: fieldnames = ['counter', 'timestamp', 'acceleration'] writer = DictWriter(csvfile, fieldnames=fieldnames) writer.writeheader() writer.writerows(self....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_csv(self, filename): # DONE\n self.data.to_csv(filename)", "def export_data(self):\r\n \r\n \r\n output_file = 'export.csv'\r\n data = self.get_raw_data()\r\n \r\n if data != []:\r\n print('Writing to file', output_file)\r\n with ope...
[ "0.6663332", "0.66605026", "0.65945876", "0.65244937", "0.64708185", "0.6421987", "0.63620657", "0.63320416", "0.63202757", "0.63181925", "0.63011974", "0.6253276", "0.6175509", "0.6175439", "0.6163822", "0.61474824", "0.61271316", "0.6082128", "0.6053914", "0.6039739", "0.60...
0.7647752
0
Is this a review request that was pushed to MozReview.
def is_pushed(review_request, commit_data=None): commit_data = fetch_commit_data(review_request, commit_data=commit_data) is_draft = isinstance(review_request, ReviewRequestDraft) return ((not is_draft and IDENTIFIER_KEY in commit_data.extra_data) or (is_draft and IDENTIFIER_KEY in commit_data....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def identify_request(request: RequestType):\n # Private encrypted JSON payload\n try:\n data = json.loads(decode_if_bytes(request.body))\n if \"encrypted_magic_envelope\" in data:\n return True\n except Exception:\n pass\n # Public XML payload\n try:\n xml = et...
[ "0.6368909", "0.62218183", "0.620255", "0.6195", "0.6155957", "0.61356777", "0.611294", "0.60403675", "0.6022407", "0.6003791", "0.6001119", "0.5918765", "0.5896586", "0.58755916", "0.5874088", "0.581336", "0.5742899", "0.56956965", "0.56956965", "0.56444997", "0.5632012", ...
0.6984002
0
Turn a 4vector quaternion into a real matrix
def quatreal(q): a = q[0,0] b = q[0,1] c = q[0,2] d = q[0,3] amat = a*np.identity(4) bmat = b*np.array([[0,1,0,0],[-1,0,0,0],[0,0,0,-1],[0,0,1,0]]) cmat = c*np.array([[0,0,1,0],[0,0,0,1],[-1,0,0,0],[0,-1,0,0]]) dmat = d*np.array([[0,0,0,1],[0,0,-1,0],[0,1,0,0],[-1,0,0,0]]) return ama...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def quaternion_matrix(quaternion):\r\n q = numpy.array(quaternion, dtype=numpy.float64, copy=True)\r\n n = numpy.dot(q, q)\r\n if n < _EPS:\r\n return numpy.identity(4)\r\n q *= math.sqrt(2.0 / n)\r\n q = numpy.outer(q, q)\r\n return numpy.array([\r\n [1.0-q[2, 2]-q[3, 3], q[1, ...
[ "0.7477269", "0.7464612", "0.700901", "0.69893575", "0.69198847", "0.6906389", "0.6890274", "0.68590355", "0.68523806", "0.6822765", "0.6805527", "0.6758588", "0.66997665", "0.66734576", "0.66722494", "0.6651111", "0.6629296", "0.6628843", "0.660286", "0.65409404", "0.6536965...
0.7337727
2
Takes a 4x4 quaternion vector and normalizes it
def normalize(q): quaternion = q[0] norm = 1/np.sqrt((q[0,0]**2)+(q[0,1]**2)+(q[0,2]**2)+(q[0,3]**2)) #q = norm*q #print('norm =', norm) '''q[0,0] = norm*q[0,0] q[0,1] = norm*q[0,1] q[0,2] = norm*q[0,2] q[0,3] = norm*q[0,3]''' normalizedq = norm*q return normalizedq
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def QuatNormalize(wxyz):\n return wxyz/rigmech.QuatMag(wxyz)", "def normalize(self):\n mag = np.linalg.norm(self.array)\n if mag > 0:\n arr_norm = self.array/mag\n self.__scalar = arr_norm[0]\n self.__vector = arr_norm[1:]\n else:\n raise Va...
[ "0.7084603", "0.7023622", "0.69014084", "0.6860226", "0.6823297", "0.6708448", "0.67015684", "0.67007923", "0.66758364", "0.6661463", "0.66517484", "0.6618062", "0.65977025", "0.65505105", "0.65297663", "0.6520351", "0.6483272", "0.64017683", "0.63660556", "0.63580585", "0.63...
0.7437235
0
dot product of 2 quaternions
def quatdot(q_1,q_2): dot = np.zeros((1,4)) dot = q_1[0,0]*q_2[0,0] + q_1[0,1]*q_2[0,1] + q_1[0,2]*q_2[0,2] + q_1[0,3]*q_2[0,3] return dot
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def multiply_quaternions(quats1,quats2):\n w1 = quats1[:,0]\n x1 = quats1[:,1]\n y1 = quats1[:,2]\n z1 = quats1[:,3]\n\n w2 = quats2[:,0]\n x2 = quats2[:,1]\n y2 = quats2[:,2]\n z2 = quats2[:,3]\n\n res = np.zeros((quats1.shape[0],4))\n \n res[:,0] = w1 * w2 - x1 * x2 - y1 * y2 - z...
[ "0.73311985", "0.7159988", "0.6984947", "0.6923561", "0.6729003", "0.67016923", "0.6640694", "0.66125625", "0.6551375", "0.6528743", "0.64831483", "0.6455822", "0.64309156", "0.64281535", "0.6395493", "0.6337586", "0.6332918", "0.6298791", "0.6267262", "0.6235941", "0.6232762...
0.77299416
0
Compute softmax values for each sets of scores in x.
def softmax(x): e_x = np.exp(x - np.max(x)) return e_x / e_x.sum()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def softmax(self, scores):\n\n\n # for each sample, for each class ,caclulate\n # np.exp(scores) : still (n_samples, n_classes)\n\n # axis = 1\n # a00, a01, a02 as a sinlge one to perfrom np_sum\n # which is the same sample \n # sum_exp : still (n_samples, 1)\n\n # ...
[ "0.7796294", "0.7760558", "0.7759004", "0.77567077", "0.76577055", "0.76577055", "0.76577055", "0.76577055", "0.7585655", "0.743143", "0.7407772", "0.73941606", "0.7358175", "0.73174125", "0.72689486", "0.72623265", "0.72614294", "0.7256868", "0.723019", "0.7214918", "0.72017...
0.70900273
56
Load both the article dataframe and the user article likes numpy array.
def load_articles_and_user_article_likes( data_folder: str, ) -> Tuple[pd.DataFrame, np.ndarray]: articles_df = load_articles(data_folder) user_article_likes = load_user_article_likes(data_folder) return (articles_df, user_article_likes)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_user_article_likes(\n data_folder: str, num_users: int = 5551, num_articles: int = 13584\n) -> np.ndarray:\n user_items = np.zeros([num_users, num_articles])\n with open(os.path.join(data_folder, \"train_data.dat\")) as users_file:\n for i, line in enumerate(users_file.readlines()):\n ...
[ "0.72824967", "0.565986", "0.5425592", "0.52870417", "0.52196264", "0.5116236", "0.5104623", "0.50780976", "0.503978", "0.50322115", "0.50001466", "0.49484774", "0.49415538", "0.49352685", "0.49318472", "0.49289596", "0.48984078", "0.4883312", "0.48808378", "0.4851997", "0.48...
0.64975786
1
Number of graphs in this batch. Returns int Number of graphs in this batch.
def batch_size(self): return self._batch_size
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ngraphs(self):\n return len(self.__graph_list)", "def graph_count(self) -> int:\n return int(self.graph_tuple_stats.graph_count)", "def num_of_subgraphs(self):\n \n G = self.to_undirected_graph()\n \n count = G.num_subgraph()\n \n print('The number of dis...
[ "0.83084244", "0.7940165", "0.7406009", "0.731238", "0.7151066", "0.71414536", "0.7130866", "0.7094109", "0.70806557", "0.7055045", "0.70280355", "0.70254004", "0.701155", "0.6955989", "0.6940301", "0.69165385", "0.6876375", "0.6837294", "0.6835723", "0.68168265", "0.6813649"...
0.0
-1
Creates, configures, and returns a Logger object.
def __init_board_logger(self): # Create a Logger object and set log level board_logger = logging.getLogger(__name__) board_logger.setLevel(logging.DEBUG) # Create a handler to console and set level console_handler = logging.StreamHandler() console_handler.setLev...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_logger() -> logging.Logger:\n pass # TODO: Replace with implementation!", "def logger(self) -> logging.Logger:\n logging.basicConfig(\n level=logging.DEBUG,\n format=\"%(asctime)s - %(name)-15s - [%(levelname)-10s] %(message)s\"\n )\n return logging.getLo...
[ "0.75688714", "0.75143695", "0.7464721", "0.74478585", "0.73994595", "0.729699", "0.72812927", "0.72616786", "0.7176134", "0.7106681", "0.71056294", "0.7095573", "0.7092039", "0.7090215", "0.7043382", "0.699748", "0.6982689", "0.692753", "0.69239056", "0.6915774", "0.69004947...
0.0
-1
Plots a FitResult object.
def plot_fit(fit_res: FitResult, fig=None, log_loss=False, legend=None): if fig is None: fig, axes = plt.subplots(nrows=2, ncols=2, figsize=(16, 10), sharex='col', sharey=False) axes = axes.reshape(-1) else: axes = fig.axes for ax in axes: fo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plotFittingResults(self):\n _listFitQ = [tmp.getValue() for tmp in self.getDataOutput().getScatteringFitQ()]\n _listFitValues = [tmp.getValue() for tmp in self.getDataOutput().getScatteringFitValues()]\n _listExpQ = [tmp.getValue() for tmp in self.getDataInput().getExperimentalDataQ()]\n ...
[ "0.7340492", "0.72439927", "0.7044545", "0.6564804", "0.65384156", "0.6363583", "0.631239", "0.62682813", "0.6246516", "0.61554533", "0.61114246", "0.6100811", "0.60945916", "0.60833776", "0.60734147", "0.6057767", "0.6025645", "0.60229796", "0.60138655", "0.6007838", "0.6005...
0.634042
6
Add a tensorflow summary.
def add_summary(self, collections=None): name = self.group + '/' + self.name print("Add summary for "+name) if self.stype == 0: self._placeholder = tf.placeholder(tf.float32, name=name) tf.summary.scalar(name, self._placeholder, collections=[collections]) elif ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_summary(self):\n for k, v in self.metrics.items():\n tf.summary.scalar(k, v)\n \n self.summary_op = tf.summary.merge_all()", "def add_summary(self, summary):\n if isinstance(summary, six.binary_type):\n summary = tf.Summary.FromString(summary)\n assert isinstance(...
[ "0.7598649", "0.75105673", "0.7461438", "0.744444", "0.74216485", "0.7414914", "0.74041086", "0.7376607", "0.7346772", "0.73047036", "0.7297215", "0.72554314", "0.7193086", "0.71923363", "0.7135312", "0.71085155", "0.70693934", "0.70329684", "0.69941026", "0.69941026", "0.699...
0.7637887
0
check phone is valid or not
def validate_phone(self, data): value = data.strip() if re.match(constant.NUMBER_ONLY, value): if User.objects.filter(phone=value).exists(): raise serializers.ValidationError('phone number already registered') return value raise serializers.ValidationError...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_valid_phone(phone):\n assert phone is not None\n phone = str(phone)\n return len(phone) == 10 and is_valid_integer(phone)", "def check_format_user_phone(phone):\n match = re.match(r'^\\+[0-9]{10,}$', phone)\n if not match:\n raise exceptions.ValidationError('phone is not ...
[ "0.8100093", "0.8082754", "0.80497855", "0.7958857", "0.79569274", "0.78455836", "0.7768723", "0.7648531", "0.7631273", "0.75426584", "0.7530089", "0.7529323", "0.750248", "0.7487692", "0.74486786", "0.74442536", "0.7391738", "0.7390023", "0.7388239", "0.73663217", "0.7363975...
0.7837594
6
check telephone is valid or not
def validate_telephone(self, data): value = data.strip() if re.match(constant.NUMBER_ONLY, value): if User.objects.filter(telephone=value).exists(): raise serializers.ValidationError('telephone number already registered') return value raise serializers.Val...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def valid_phone(phone_number):\n return bool(re.match(r\"^\\+?\\d{10,15}$\", phone_number))", "def check_format_user_phone(phone):\n match = re.match(r'^\\+[0-9]{10,}$', phone)\n if not match:\n raise exceptions.ValidationError('phone is not valid!')\n return phone", "def is_...
[ "0.7802378", "0.7714708", "0.77041644", "0.7649386", "0.7628672", "0.76085657", "0.75387496", "0.75222975", "0.7489788", "0.74501514", "0.7409592", "0.7376535", "0.72549075", "0.72413313", "0.7235819", "0.715957", "0.7142563", "0.7091627", "0.7087557", "0.708183", "0.7073095"...
0.7624902
5
Return a random direction (unit length vector).
def _rand_direction(dim, rand): direction = rand.normal(size=dim) return direction / la.norm(direction)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def random_direction():\n\n if randrange(2):\n return Direction.RIGHT\n else:\n return Direction.DOWN", "def generate_direction(self):\n random_enum = random.randint(1, 4)\n random_direction = flow_processing_input.Direction(random_enum)\n assert isinstanc...
[ "0.8194368", "0.74589944", "0.74589944", "0.74145025", "0.7235311", "0.7194569", "0.7091364", "0.7082987", "0.70247465", "0.6904147", "0.6745036", "0.6714411", "0.6709243", "0.66760325", "0.66721755", "0.6613038", "0.6476767", "0.64575696", "0.63490254", "0.62944573", "0.6289...
0.79975736
1
Return 1D array as a column vector.
def _colvec(x): x = np.atleast_1d(x) return x[:, None]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_col_vec(x):\n assert x.ndim == 1\n return jnp.expand_dims(x, 1)", "def make_col_vector(array):\n return array.reshape(-1, 1)", "def as_column_vector(array):\n if array.ndim != 1:\n raise ValueError(\"Array must be 1D\")\n\n idx = _new_attribute_label('idx', array)\n ds = array.d...
[ "0.80935556", "0.80912775", "0.7456082", "0.7242685", "0.722817", "0.71682465", "0.7023685", "0.68678135", "0.685729", "0.681363", "0.672559", "0.6654309", "0.65105534", "0.6501895", "0.64484346", "0.6427316", "0.6335983", "0.6330743", "0.6296404", "0.62485206", "0.624144", ...
0.8086285
2
tests is a number n is prime or not. very naive implementation.
def isPrime(n): for i in range (2, n/2+1): if n % i == 0: return False return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isprime(n):\r\n\treturn is_prime(n)", "def isprime(n):\n\treturn is_prime(n)", "def is_prime(n):\n if n <= 1:\n return False\n elif n <= 2:\n return True\n elif n % 2 == 0:\n return False\n else:\n for i in range(3, int(n**.5) + 1, 2):\n if n % i == 0:\n ...
[ "0.8716225", "0.86839396", "0.8585241", "0.8560579", "0.8548485", "0.85481006", "0.85479414", "0.85437405", "0.8541546", "0.85305053", "0.85285884", "0.8525185", "0.8517493", "0.85038257", "0.8501493", "0.84881884", "0.8480911", "0.8480618", "0.84752995", "0.8460237", "0.8447...
0.85608643
3
returns a list with the first n prime numbers. very naive implementation
def primes(n): result = [] i = 2 while n > 0: if isPrime(i): result += [i] n -= 1 i += 1 return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def primes(n):\n return [i for i in xrange(1, n + 1) if mr_prime(i)]", "def first_n_primes(n): \n\tlist_of_primes = []\n\t# the current number that we're checking the primality of\n\tcandidate = 2\n\n\t# keep on finding primes until our list has enough elements\n\twhile len(list_of_primes) < n:\n\t\t# assume ...
[ "0.85214305", "0.83874935", "0.8352098", "0.83435744", "0.8226115", "0.822402", "0.81849754", "0.8145684", "0.8130155", "0.81210786", "0.8052389", "0.8031714", "0.8028448", "0.80098", "0.80056435", "0.7987774", "0.7921651", "0.7875455", "0.78645295", "0.7837824", "0.7835761",...
0.7967056
16
initializeWeights return the random weights for Neural Network given the number of node in the input layer and output layer
def initializeWeights(n_in,n_out): epsilon = sqrt(6) / sqrt(n_in + n_out + 1); W = (np.random.rand(n_out, n_in + 1)*2* epsilon) - epsilon; return W
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_weights(no_input, no_hidden, no_output):\r\n weight_lst = []\r\n no_of_weights = (no_input * no_hidden) + (no_hidden * no_output)\r\n\r\n for weight in range(no_of_weights):\r\n weight = 0.01 * random.random()\r\n weight_lst.append(weight)\r\n\r\n return weight_lst", "def init_...
[ "0.7995148", "0.7986416", "0.79747236", "0.7786943", "0.77798337", "0.7771077", "0.77355367", "0.7684489", "0.7662752", "0.76529443", "0.76379985", "0.763412", "0.7633403", "0.759725", "0.75966203", "0.75822115", "0.7563477", "0.7498244", "0.74935126", "0.74840426", "0.746946...
0.74672943
21
Notice that z can be a scalar, a vector or a matrix return the sigmoid of input z
def sigmoid(z): return 1.0 / (1.0+np.exp(-z))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sigmoid(z):\r\n \r\n return vSigmoid(z);", "def sigmoid(z): \n return 1/(1 + np.e**(-z))", "def sigmoid(z):\n return 1 / (1 + np.exp(-1 * z))", "def sigmoid(z):\n\treturn 1.0/(1.0+np.exp(-z))", "def sigmoid(z):\n return 1 / (1 + np.exp(-z))", "def sigmoid(z):\n return 1.0 / (1 + np...
[ "0.8940874", "0.892862", "0.87671816", "0.8723294", "0.87213147", "0.8717033", "0.8681541", "0.86776143", "0.86583304", "0.86463404", "0.86346865", "0.86199236", "0.86045486", "0.85856503", "0.8568568", "0.85570747", "0.8535349", "0.8526672", "0.8523408", "0.85114723", "0.850...
0.8770222
2
Given a track, apply a transformation which will never match on anything.
def test_transform_track_empty_transform(self): track = Track(artist='Artist', album='Album', title='Title', ensemble='Ensemble', conductor='Conductor', composer='Composer', tracknum=1, seconds=60) transform = Transform(1, change_artist=True, pattern_artist='Artist', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_transform_track_no_changes(self):\n track = Track(artist='Artist', album='Album', title='Title',\n ensemble='Ensemble', conductor='Conductor', composer='Composer',\n tracknum=1, seconds=60)\n transform = Transform(1, cond_artist=True, change_artist=True,\n pa...
[ "0.7035513", "0.69294035", "0.68854487", "0.6625622", "0.65487385", "0.6171622", "0.6145519", "0.6044389", "0.6035826", "0.6029588", "0.60271394", "0.6011648", "0.60097784", "0.59898996", "0.5959064", "0.59389335", "0.5902322", "0.5890861", "0.5889085", "0.58641154", "0.58578...
0.6828354
3
Given a track, transform its album based on matching both the artist and album. Will NOT match the tested track, based on an incorrect artist.
def test_transform_track_album_based_on_artist_album_no_match_artist(self): track = Track(artist='Artist 2', album='Album', title='Title', tracknum=1, seconds=60) transform = Transform(1, cond_artist=True, pattern_artist='Artist', cond_album=True, change_album=True, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_transform_track_album_based_on_artist_album_no_match_album(self):\n track = Track(artist='Artist', album='Album 3', title='Title',\n tracknum=1, seconds=60)\n transform = Transform(1,\n cond_artist=True, pattern_artist='Artist',\n cond_album=True, change_albu...
[ "0.83646023", "0.8320654", "0.81495476", "0.80659443", "0.80173683", "0.7996991", "0.7949714", "0.789466", "0.7831923", "0.7815904", "0.7794423", "0.77854294", "0.77661043", "0.77430075", "0.7710063", "0.7698609", "0.76686907", "0.75543374", "0.75179434", "0.73803395", "0.720...
0.82476854
2
Given a track, transform its title based on matching both the artist and title. Will match the tested track.
def test_transform_track_title_based_on_artist_title_match(self): track = Track(artist='Artist', album='Album', title='Title', tracknum=1, seconds=60) transform = Transform(1, cond_artist=True, pattern_artist = 'Artist', cond_title=True, pattern_title='Title', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_transform_track_title_based_on_artist_title_no_match_title(self):\n track = Track(artist='Artist', album='Album', title='Title 3',\n tracknum=1, seconds=60)\n transform = Transform(1,\n cond_artist=True, pattern_artist = 'Artist',\n cond_title=True, pattern_t...
[ "0.81675243", "0.80686027", "0.80347294", "0.8031304", "0.7889621", "0.7877057", "0.786244", "0.7773556", "0.76870024", "0.7636168", "0.7623288", "0.7492367", "0.7454578", "0.728416", "0.71109843", "0.68371695", "0.68040997", "0.6537702", "0.6534212", "0.64936864", "0.6476561...
0.8304102
0
Given a track, transform its title based on matching both the artist and title. Will NOT match the tested track, based on an incorrect artist.
def test_transform_track_title_based_on_artist_title_no_match_artist(self): track = Track(artist='Artist 2', album='Album', title='Title', tracknum=1, seconds=60) transform = Transform(1, cond_artist=True, pattern_artist = 'Artist', cond_title=True, pattern_title='Tit...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_transform_track_title_based_on_artist_title_no_match_title(self):\n track = Track(artist='Artist', album='Album', title='Title 3',\n tracknum=1, seconds=60)\n transform = Transform(1,\n cond_artist=True, pattern_artist = 'Artist',\n cond_title=True, pattern_t...
[ "0.8416423", "0.83755195", "0.81544966", "0.8143599", "0.8100191", "0.80749035", "0.80529976", "0.79918367", "0.79857814", "0.79352957", "0.78915393", "0.7714467", "0.75304514", "0.73955476", "0.7282318", "0.6977991", "0.69355667", "0.68994975", "0.6887923", "0.6831447", "0.6...
0.8320259
2
Given a track, transform its artist based on matching both the artist and title. Will NOT match the tested track, based on an incorrect title.
def test_transform_track_artist_based_on_artist_title_no_match_title(self): track = Track(artist='Artist', album='Album', title='Title 2', tracknum=1, seconds=60) transform = Transform(1, cond_artist=True, pattern_artist = 'Artist', cond_title=True, pattern_title='Tit...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_transform_track_title_based_on_artist_title_no_match_artist(self):\n track = Track(artist='Artist 2', album='Album', title='Title',\n tracknum=1, seconds=60)\n transform = Transform(1,\n cond_artist=True, pattern_artist = 'Artist',\n cond_title=True, pattern_...
[ "0.8363574", "0.83394116", "0.83264583", "0.8314644", "0.8296475", "0.8267167", "0.82201725", "0.8104553", "0.77983457", "0.7783872", "0.77045405", "0.76913595", "0.7667198", "0.7662743", "0.7591863", "0.7563828", "0.7554276", "0.7529985", "0.74931276", "0.7425116", "0.702168...
0.8359972
1
Given a track, transform its album based on matching both the album and title. Will match the tested track.
def test_transform_track_album_based_on_album_title_match(self): track = Track(artist='Artist', album='Album', title='Title', tracknum=1, seconds=60) transform = Transform(1, cond_album=True, pattern_album = 'Album', cond_title=True, pattern_title='Title', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_transform_track_album_based_on_album_title_no_match_album(self):\n track = Track(artist='Artist', album='Album 3', title='Title',\n tracknum=1, seconds=60)\n transform = Transform(1,\n cond_album=True, pattern_album = 'Album',\n cond_title=True, pattern_title...
[ "0.80832946", "0.80552536", "0.8021955", "0.7913063", "0.7903549", "0.77515465", "0.7744322", "0.7700177", "0.75510013", "0.7483508", "0.7328856", "0.7251661", "0.7192835", "0.7180424", "0.7059049", "0.69416255", "0.6915307", "0.68675774", "0.6829673", "0.68138427", "0.672687...
0.8338891
0
Given a track, transform its album based on matching both the album and title. Will NOT match the tested track, based on an incorrect title.
def test_transform_track_album_based_on_album_title_no_match_title(self): track = Track(artist='Artist', album='Album', title='Title 2', tracknum=1, seconds=60) transform = Transform(1, cond_album=True, pattern_album = 'Album', cond_title=True, pattern_title='Title', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_transform_track_album_based_on_album_title_no_match_album(self):\n track = Track(artist='Artist', album='Album 3', title='Title',\n tracknum=1, seconds=60)\n transform = Transform(1,\n cond_album=True, pattern_album = 'Album',\n cond_title=True, pattern_title...
[ "0.84169525", "0.8373619", "0.8285161", "0.81712854", "0.8154164", "0.80348", "0.7955456", "0.7818741", "0.76682276", "0.76018816", "0.7421177", "0.733912", "0.7219952", "0.7146387", "0.7123611", "0.7111833", "0.7077727", "0.7039881", "0.70169795", "0.6994229", "0.69826823", ...
0.8394647
1
Given a track, transform its album based on matching both the album and title. Will NOT match the tested track, based on an incorrect album.
def test_transform_track_album_based_on_album_title_no_match_album(self): track = Track(artist='Artist', album='Album 3', title='Title', tracknum=1, seconds=60) transform = Transform(1, cond_album=True, pattern_album = 'Album', cond_title=True, pattern_title='Title', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_transform_track_album_based_on_album_title_match(self):\n track = Track(artist='Artist', album='Album', title='Title',\n tracknum=1, seconds=60)\n transform = Transform(1,\n cond_album=True, pattern_album = 'Album',\n cond_title=True, pattern_title='Title',\n...
[ "0.8347559", "0.8260332", "0.81373256", "0.8030886", "0.7954701", "0.7937508", "0.7882569", "0.77825385", "0.7738724", "0.7732422", "0.7522514", "0.74416345", "0.7337837", "0.726828", "0.72309685", "0.71881616", "0.7168599", "0.7090275", "0.7014619", "0.6995858", "0.69817007"...
0.8365124
0
Given a track, transform its title based on matching both the album and title. Will match the tested track.
def test_transform_track_title_based_on_album_title_match(self): track = Track(artist='Artist', album='Album', title='Title', tracknum=1, seconds=60) transform = Transform(1, cond_album=True, pattern_album = 'Album', cond_title=True, pattern_title='Title', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_transform_track_title_based_on_album_title_no_match_title(self):\n track = Track(artist='Artist', album='Album', title='Title 3',\n tracknum=1, seconds=60)\n transform = Transform(1,\n cond_album=True, pattern_album = 'Album',\n cond_title=True, pattern_title...
[ "0.8185949", "0.80801845", "0.80572015", "0.8050694", "0.79744196", "0.7774997", "0.7734529", "0.7656137", "0.75992495", "0.75004154", "0.72952425", "0.71447635", "0.71192956", "0.6947893", "0.6940983", "0.68372893", "0.6836976", "0.6836043", "0.6712222", "0.6689333", "0.6552...
0.8364777
0
Given a track, transform its title based on matching both the artist and album. Will match the tested track.
def test_transform_track_title_based_on_artist_album_match(self): track = Track(artist='Artist', album='Album', title='Title', tracknum=1, seconds=60) transform = Transform(1, cond_artist=True, pattern_artist='Artist', cond_album=True, pattern_album = 'Album', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_transform_track_title_based_on_album_title_match(self):\n track = Track(artist='Artist', album='Album', title='Title',\n tracknum=1, seconds=60)\n transform = Transform(1,\n cond_album=True, pattern_album = 'Album',\n cond_title=True, pattern_title='Title',\n...
[ "0.83420134", "0.81407046", "0.8076032", "0.8073929", "0.8035325", "0.7980897", "0.7954696", "0.7847348", "0.7759225", "0.7706985", "0.7598733", "0.74753416", "0.74331677", "0.73123074", "0.722209", "0.7163785", "0.70454246", "0.69794273", "0.6931302", "0.6902763", "0.6839196...
0.8299337
1
Given a track, transform its title based on matching both the artist and album. Will NOT match the tested track, based on an incorrect artist.
def test_transform_track_title_based_on_artist_album_no_match_artist(self): track = Track(artist='Artist 2', album='Album', title='Title', tracknum=1, seconds=60) transform = Transform(1, cond_artist=True, pattern_artist='Artist', cond_album=True, pattern_album = 'Alb...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_transform_track_title_based_on_artist_album_match(self):\n track = Track(artist='Artist', album='Album', title='Title',\n tracknum=1, seconds=60)\n transform = Transform(1,\n cond_artist=True, pattern_artist='Artist',\n cond_album=True, pattern_album = 'Album...
[ "0.8358135", "0.8352614", "0.8321582", "0.8319635", "0.8301156", "0.8170534", "0.8031711", "0.8017173", "0.798336", "0.79554737", "0.79417753", "0.77582127", "0.75946134", "0.75735396", "0.737332", "0.7350048", "0.730635", "0.7251508", "0.72464615", "0.7162701", "0.7006522", ...
0.8280453
5
Given an album, transform its album based on matching both the artist and album. Will match the tested album.
def test_transform_album_album_based_on_artist_album_match(self): album = Album(artist='Artist', album='Album', totaltracks=1, totalseconds=60) transform = Transform(1, cond_artist=True, pattern_artist='Artist', cond_album=True, change_album=True, pattern_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_transform_album_artist_based_on_artist_album_match(self):\n album = Album(artist='Artist', album='Album',\n totaltracks=1, totalseconds=60)\n transform = Transform(1,\n cond_artist=True, pattern_artist = 'Artist',\n cond_album=True, pattern_album='Album',\n ...
[ "0.7915869", "0.7911527", "0.7809784", "0.7746471", "0.7735675", "0.76299596", "0.76211375", "0.7507363", "0.74580127", "0.7435726", "0.7407983", "0.7392961", "0.72905415", "0.7175665", "0.7133191", "0.710222", "0.70160675", "0.69496113", "0.69250876", "0.6924938", "0.6919163...
0.80776507
0
Given an album, transform its album based on matching both the artist and album. Will NOT match the tested track, based on an incorrect album.
def test_transform_album_album_based_on_artist_album_no_match_album(self): album = Album(artist='Artist', album='Album 3', totaltracks=1, totalseconds=60) transform = Transform(1, cond_artist=True, pattern_artist='Artist', cond_album=True, change_album=True, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_transform_track_album_based_on_artist_album_no_match_album(self):\n track = Track(artist='Artist', album='Album 3', title='Title',\n tracknum=1, seconds=60)\n transform = Transform(1,\n cond_artist=True, pattern_artist='Artist',\n cond_album=True, change_albu...
[ "0.81318885", "0.80147886", "0.80077285", "0.7992689", "0.79419357", "0.79318875", "0.79031134", "0.7862118", "0.7836904", "0.77992755", "0.7789212", "0.76657844", "0.7594038", "0.75674844", "0.7551246", "0.737967", "0.73789024", "0.73689204", "0.7317722", "0.72787935", "0.71...
0.8134956
0
Given an album, transform its album based on matching both the artist and album. Will NOT match the tested track, based on an incorrect artist.
def test_transform_album_album_based_on_artist_album_no_match_artist(self): album = Album(artist='Artist 2', album='Album', totaltracks=1, totalseconds=60) transform = Transform(1, cond_artist=True, pattern_artist='Artist', cond_album=True, change_album=True, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_transform_track_album_based_on_artist_album_no_match_album(self):\n track = Track(artist='Artist', album='Album 3', title='Title',\n tracknum=1, seconds=60)\n transform = Transform(1,\n cond_artist=True, pattern_artist='Artist',\n cond_album=True, change_albu...
[ "0.8220491", "0.8218129", "0.8116238", "0.8095518", "0.80792624", "0.8029185", "0.798452", "0.7962903", "0.79475725", "0.7931359", "0.78064615", "0.7792287", "0.77465844", "0.76749223", "0.7588157", "0.7519256", "0.7474188", "0.7419949", "0.72906613", "0.72851086", "0.7133497...
0.8053943
5
Given an album, transform its artist based on matching both the artist and album. Will match the tested album.
def test_transform_album_artist_based_on_artist_album_match(self): album = Album(artist='Artist', album='Album', totaltracks=1, totalseconds=60) transform = Transform(1, cond_artist=True, pattern_artist = 'Artist', cond_album=True, pattern_album='Album', c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_transform_album_album_based_on_artist_album_match(self):\n album = Album(artist='Artist', album='Album',\n totaltracks=1, totalseconds=60)\n transform = Transform(1,\n cond_artist=True, pattern_artist='Artist',\n cond_album=True, change_album=True,\n ...
[ "0.8216711", "0.8036707", "0.80082494", "0.79887414", "0.798689", "0.79233867", "0.7831455", "0.7764223", "0.77208936", "0.77105784", "0.76051056", "0.73662275", "0.7342412", "0.7316018", "0.7285938", "0.72714096", "0.7208175", "0.7037988", "0.6876283", "0.6869982", "0.684172...
0.8202596
1
Given an album, transform its artist based on matching both the artist and album. Will NOT match the tested track, based on an incorrect album.
def test_transform_album_artist_based_on_artist_album_no_match_album(self): album = Album(artist='Artist', album='Album 2', totaltracks=1, totalseconds=60) transform = Transform(1, cond_artist=True, pattern_artist = 'Artist', cond_album=True, pattern_album='Album', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_transform_track_album_based_on_artist_album_no_match_album(self):\n track = Track(artist='Artist', album='Album 3', title='Title',\n tracknum=1, seconds=60)\n transform = Transform(1,\n cond_artist=True, pattern_artist='Artist',\n cond_album=True, change_albu...
[ "0.8293489", "0.8265774", "0.8227279", "0.82257944", "0.82174313", "0.8211072", "0.8209395", "0.8209081", "0.81877774", "0.81057966", "0.807739", "0.7802314", "0.77698004", "0.7759752", "0.76707685", "0.76705533", "0.7423443", "0.7340916", "0.7305368", "0.7161824", "0.7101123...
0.8276885
1
Given an album, transform its artist based on matching both the artist and album. Will NOT match the tested track, based on an incorrect artist.
def test_transform_album_artist_based_on_artist_album_no_match_artist(self): album = Album(artist='Artist 3', album='Album', totaltracks=1, totalseconds=60) transform = Transform(1, cond_artist=True, pattern_artist = 'Artist', cond_album=True, pattern_album='Album', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_transform_track_album_based_on_artist_album_no_match_album(self):\n track = Track(artist='Artist', album='Album 3', title='Title',\n tracknum=1, seconds=60)\n transform = Transform(1,\n cond_artist=True, pattern_artist='Artist',\n cond_album=True, change_albu...
[ "0.83361375", "0.83181345", "0.8293652", "0.8292531", "0.8280168", "0.82695526", "0.8254541", "0.8230457", "0.82272357", "0.81645375", "0.8157236", "0.78620887", "0.784139", "0.777345", "0.77269214", "0.76615775", "0.7439442", "0.741444", "0.7322195", "0.7165662", "0.70843506...
0.827458
5
Sets up an album to have already been processed by a transform. Ensure that it is not processed again. (Note that the actual data in the track would indicate that the transform hasn't been applied, but that's just to make testing easier.)
def test_no_transform_album_with_already_applied_transform(self): album = Album(artist='Artist', album='Album', last_transform=1) tflist = TransformList() tflist.add_transform(Transform(1, cond_artist=True, pattern_artist='Artist', change_artist=True, to_artist='Artist 2'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_transform_album_change_album(self):\n album = Album(artist='Artist', album='Album',\n totaltracks=1, totalseconds=60)\n transform = Transform(1, cond_album=True, change_album=True,\n pattern_album='Album', to_album='Album 2')\n\n self.assertEqual(album.last_trans...
[ "0.72530997", "0.7205842", "0.7177824", "0.70423186", "0.7030783", "0.7008211", "0.6999659", "0.691213", "0.69106495", "0.68936306", "0.68622375", "0.6845399", "0.6734311", "0.6682037", "0.6646184", "0.6616402", "0.659324", "0.65792567", "0.656917", "0.6565238", "0.6552961", ...
0.63183767
27
Tests a minimal album insert
def test_insert_minimal(self): album = Album(artist='Artist', album='Album', totalseconds=120, totaltracks=2) pk = album.insert(self.app.db, self.app.curs) self.assertNotEqual(pk, None) self.assertNotEqual(pk, 0) self.assertEqual(self.get_album_count(), 1) al...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_insert_simple(self):\n album = Album(artist='Artist', album='Album', album_type='ep',\n totaltracks=5, totalseconds=42, last_transform=3)\n pk = album.insert(self.app.db, self.app.curs)\n\n self.assertNotEqual(pk, None)\n self.assertNotEqual(pk, 0)\n self.asse...
[ "0.7874954", "0.75364023", "0.746188", "0.7420495", "0.7408719", "0.7377768", "0.7372759", "0.7364743", "0.7344233", "0.7260143", "0.72274387", "0.71518594", "0.714548", "0.7141838", "0.71274877", "0.7062105", "0.7031079", "0.69929165", "0.68878025", "0.6845671", "0.68300027"...
0.829352
0
Tests an album insert with an invalid type.
def test_insert_invalid_type(self): album = Album(artist='Artist', album='Album', album_type='xyzzy', totalseconds=120, totaltracks=2) with self.assertRaises(Exception): pk = album.insert(self.app.db, self.app.curs) self.assertEqual(self.get_album_count(), 0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_insert_duplicate(self):\n album = Album(artist='Artist', album='Album',\n totalseconds=120, totaltracks=2)\n album.insert(self.app.db, self.app.curs)\n self.assertEqual(self.get_album_count(), 1)\n\n with self.assertRaises(Exception):\n album.insert(self.a...
[ "0.69025785", "0.68398464", "0.68340486", "0.67571396", "0.67026925", "0.6685699", "0.65691376", "0.642939", "0.6416923", "0.6392356", "0.6372262", "0.6270539", "0.62510216", "0.623134", "0.61525834", "0.6049071", "0.6004531", "0.60007906", "0.5998037", "0.59961694", "0.59659...
0.8586681
0
Tests an insert where we do not commit the transaction.
def test_insert_no_commit(self): album = Album(artist='Artist', album='Album', totalseconds=120, totaltracks=1) pk = album.insert(self.app.db, self.app.curs, commit=False) self.assertNotEqual(pk, None) self.assertNotEqual(pk, 0) album_row = self.get_album_by_id(pk) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_verify_insert(self):\n self._verify([self.applied_commands['insert']])", "def test_insert_no_commit(self):\n track = Track(artist='Artist', title='Title')\n pk = track.insert(self.app.db,\n self.app.curs,\n 'xmms',\n datetime.datetime.now(),\n ...
[ "0.77665657", "0.7675891", "0.7372534", "0.72463775", "0.6987058", "0.6895767", "0.68841237", "0.6836656", "0.681182", "0.67978513", "0.6788227", "0.67868835", "0.67749035", "0.67658925", "0.6726501", "0.6717131", "0.67143846", "0.6714176", "0.6711254", "0.6666203", "0.666422...
0.7723068
1
Tests an update of ourselves.
def test_update(self): album = Album(artist='Artist', album='Album', album_type='ep', totaltracks=1, totalseconds=120) pk = album.insert(self.app.db, self.app.curs) self.assertNotEqual(pk, None) self.assertNotEqual(pk, 0) self.assertEqual(self.get_album_count(), 1) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_update(self):\n pass", "def test_update(self):\n pass", "def test_update(self):\n pass", "def test_update(self):\n # this is tested graphically, as it is UI\n pass", "def test_update_case(self):\n pass", "def test_update9(self):\n pass", "def te...
[ "0.85917383", "0.85917383", "0.85917383", "0.85790306", "0.837259", "0.81114787", "0.8028726", "0.78867555", "0.78808016", "0.7878626", "0.7483957", "0.743192", "0.73932606", "0.7387566", "0.73755133", "0.7336566", "0.7324349", "0.732061", "0.72915375", "0.72814566", "0.72738...
0.0
-1
Tests an update when the Album object has no PK (should raise an Exception)
def test_update_no_pk(self): album = Album(artist='Artist', album='Album', totaltracks=1, totalseconds=120) with self.assertRaises(Exception): album.update(self.app.db, self.app.curs) self.assertEqual(self.get_album_count(), 0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_update_no_pk(self):\n track = Track(artist='Artist', album='Album', title='Title')\n with self.assertRaises(Exception):\n track.update(self.app.db, self.app.curs)\n self.assertEqual(self.get_track_count(), 0)", "def test_update_no_commit(self):\n album = Album(arti...
[ "0.80257744", "0.7751093", "0.7603995", "0.729542", "0.68678206", "0.68267184", "0.67468077", "0.6698978", "0.6669811", "0.66347194", "0.6628059", "0.66269255", "0.65816873", "0.65629625", "0.6559829", "0.65555173", "0.6551829", "0.6469152", "0.64322746", "0.64231926", "0.638...
0.875466
0
Tests creation of an Album object from a database row.
def test_from_database_row(self): orig_album = Album(artist='Artist', album='Album', album_type='ep', totaltracks=1, totalseconds=120, last_transform=5) pk = orig_album.insert(self.app.db, self.app.curs) self.assertEqual(self.get_album_count(), 1) album = Album.from_database...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_from_database_row(self):\n orig_track = Track(artist='Artist', album='Album', title='Title',\n ensemble='Ensemble', conductor='Conductor', composer='Composer',\n tracknum=1, seconds=10, album_id=42, last_transform=5)\n pk = orig_track.insert(self.app.db,\n se...
[ "0.7301636", "0.70971036", "0.6826303", "0.67286813", "0.6567444", "0.6378835", "0.6131885", "0.61316895", "0.6106988", "0.6083797", "0.608156", "0.60660654", "0.60606515", "0.6047378", "0.5956633", "0.59235394", "0.59171367", "0.58965784", "0.5857454", "0.58477396", "0.58375...
0.85205853
0
Test for when there is one album returned when there's also another album which has already had the transform applied.
def test_get_all_need_transform_one_album_another_already_applied(self): album = Album(artist='Artist', album='Album', totaltracks=1, totalseconds=120, last_transform=1) pk = album.insert(self.app.db, self.app.curs) album = Album(artist='Artist', album='Album 2', totaltra...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_apply_transform_two_albums_one_matches(self):\n tf_pk = self.add_transform(cond_artist=True, pattern_artist='Artist',\n change_artist=True, to_artist='Artist 2')\n self.assertNotEqual(tf_pk, 0)\n\n self.app.load_data()\n album = Album(artist='Artist', album='Album',\...
[ "0.71222657", "0.7097127", "0.70676625", "0.7007189", "0.6936311", "0.68607527", "0.682477", "0.68082935", "0.6800534", "0.6733924", "0.6643541", "0.6622371", "0.66011125", "0.6567496", "0.65664136", "0.6563026", "0.65431917", "0.654174", "0.65160894", "0.65107197", "0.646255...
0.7225204
0
Test for when there are two albums returned.
def test_get_all_need_transform_two_albums(self): album = Album(artist='Artist', album='Album', totaltracks=1, totalseconds=120) pk = album.insert(self.app.db, self.app.curs) album = Album(artist='Artist', album='Album 2', totaltracks=1, totalseconds=120) pk = alb...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_two_tracks_same_album(self):\n self.add_mp3(filename='1.mp3')\n self.add_mp3(filename='2.mp3')\n (added, status) = self.app.add_album(self.filenames)\n self.assertEqual(added, True)\n self.assertEqual(self.get_album_count(), 1)\n album = Album.get_by_artist_album(...
[ "0.6915537", "0.67704374", "0.67224896", "0.6704315", "0.6567586", "0.6419161", "0.6319639", "0.6318473", "0.6311727", "0.6160839", "0.61434394", "0.6119437", "0.610692", "0.6105958", "0.5969987", "0.59223926", "0.5919559", "0.5897532", "0.58850485", "0.5875594", "0.58580565"...
0.7030126
0
Tests an insert where we do not commit the transaction.
def test_insert_no_commit(self): track = Track(artist='Artist', title='Title') pk = track.insert(self.app.db, self.app.curs, 'xmms', datetime.datetime.now(), commit=False) self.assertNotEqual(pk, None) self.assertNotEqual(pk, 0) tra...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_verify_insert(self):\n self._verify([self.applied_commands['insert']])", "def test_insert_no_commit(self):\n album = Album(artist='Artist', album='Album',\n totalseconds=120, totaltracks=1)\n pk = album.insert(self.app.db, self.app.curs, commit=False)\n self.assert...
[ "0.77665657", "0.7723068", "0.7372534", "0.72463775", "0.6987058", "0.6895767", "0.68841237", "0.6836656", "0.681182", "0.67978513", "0.6788227", "0.67868835", "0.67749035", "0.67658925", "0.6726501", "0.6717131", "0.67143846", "0.6714176", "0.6711254", "0.6666203", "0.666422...
0.7675891
2
Tests an update of ourselves.
def test_update(self): track = Track(artist='Artist', album='Album', title='Title', ensemble='Ensemble', conductor='Conductor', composer='Composer') pk = track.insert(self.app.db, self.app.curs, 'xmms', datetime.datetime.now()) self.assertNotEqual(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_update(self):\n pass", "def test_update(self):\n pass", "def test_update(self):\n pass", "def test_update(self):\n # this is tested graphically, as it is UI\n pass", "def test_update_case(self):\n pass", "def test_update9(self):\n pass", "def te...
[ "0.85917383", "0.85917383", "0.85917383", "0.85790306", "0.837259", "0.81114787", "0.8028726", "0.78867555", "0.78808016", "0.7878626", "0.7483957", "0.743192", "0.73932606", "0.7387566", "0.73755133", "0.7336566", "0.7324349", "0.732061", "0.72915375", "0.72814566", "0.72738...
0.0
-1
Test for when there is one track returned.
def test_get_all_need_transform_one_track(self): track = Track(artist='Artist', album='Album', title='Title') pk = track.insert(self.app.db, self.app.curs, 'xmms', datetime.datetime.now()) self.assertEqual(self.get_track_count(), 1) tracks = Track.get...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_all_unassociated_single_track_already_associated(self):\n track = Track(artist='Artist', album='Album',\n title='Title', album_id=1)\n track.insert(self.app.db, self.app.curs,\n 'xmms', datetime.datetime.now())\n self.assertEqual(self.get_track_count(), 1)\n ...
[ "0.6654473", "0.64409405", "0.6324737", "0.61939204", "0.6159373", "0.6129032", "0.61187494", "0.60609734", "0.5919783", "0.59167004", "0.5881368", "0.5860651", "0.58497214", "0.58364904", "0.5813176", "0.57798076", "0.5723867", "0.5710588", "0.56992245", "0.56891537", "0.568...
0.58022994
15
Test for when there is one track returned when there's also another track which has already had the transform applied.
def test_get_all_need_transform_one_track_another_already_applied(self): track = Track(artist='Artist', album='Album', title='Title', last_transform=1) pk = track.insert(self.app.db, self.app.curs, 'xmms', datetime.datetime.now()) track = Track(artist='Artist'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_apply_transform_single_track_no_match(self):\n track = Track(artist='Artist', title='Title')\n pk = track.insert(self.app.db,\n self.app.curs,\n 'xmms',\n datetime.datetime.now())\n tf_pk = self.add_transform(cond_artist=True, pattern_artist='Foo',\n ...
[ "0.7089257", "0.696782", "0.6923728", "0.68851537", "0.6878997", "0.6662722", "0.6642615", "0.65183944", "0.64564353", "0.64116657", "0.6349152", "0.63076943", "0.6258361", "0.6254972", "0.62391096", "0.622523", "0.61347675", "0.6129224", "0.6062266", "0.6004731", "0.5992424"...
0.69873106
1
Test for when there are two tracks returned.
def test_get_all_need_transform_two_tracks(self): track = Track(artist='Artist', album='Album', title='Title') pk = track.insert(self.app.db, self.app.curs, 'xmms', datetime.datetime.now()) pk = track.insert(self.app.db, self.app.curs, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def checkTracks(track1,track2):\n\tmatched=True if abs(track1-track2) <= TRACKS_DIFFERENCE else False\n\treturn matched", "def test_get_all_unassociated_two_tracks_one_unassociated(self):\n track = Track(artist='Artist', album='Album',\n title='Title', album_id=1)\n track.insert(self.app...
[ "0.6935834", "0.6837465", "0.6630446", "0.6352295", "0.62789935", "0.6240307", "0.62116903", "0.61788815", "0.61603844", "0.6054783", "0.6047687", "0.6017445", "0.599861", "0.5974061", "0.59447706", "0.5942757", "0.59168756", "0.5914492", "0.5852646", "0.58349514", "0.5772142...
0.68283087
2
No tracks in the database, should return an empty list
def test_get_all_unassociated_no_tracks(self): self.assertEqual(self.get_track_count(), 0) tracks = Track.get_all_unassociated(self.app.curs) self.assertEqual(tracks, [])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tracks(self):\r\n return None", "def test_get_all_unassociated_single_track_without_album(self):\n track = Track(artist='Artist', title='Title')\n track.insert(self.app.db, self.app.curs,\n 'xmms', datetime.datetime.now())\n self.assertEqual(self.get_track_count(), 1)\n...
[ "0.758924", "0.75270736", "0.7147655", "0.70655125", "0.6828579", "0.6745055", "0.67350954", "0.6728946", "0.6634649", "0.65583396", "0.65038204", "0.63801515", "0.6348664", "0.63116133", "0.6278503", "0.62777394", "0.62344724", "0.619012", "0.6166821", "0.6146771", "0.611085...
0.8038091
0
Look up an album ID when we have both a regular and Various Artists album match. We should default to the regular one.
def test_get_album_id_regular_and_various_album(self): var_album_id = self.add_album(artist='Various', album='Album') self.assertNotEqual(var_album_id, 0) reg_album_id = self.add_album(artist='Artist', album='Album') self.assertNotEqual(reg_album_id, 0) track = Track(artist='Arti...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_album_id_various_album(self):\n album_id = self.add_album(artist='Various', album='Album')\n self.assertNotEqual(album_id, 0)\n track = Track(artist='Artist', album='Album', title='Title')\n track_album_id = self.app.set_album_id(track)\n self.assertEqual(track_album...
[ "0.70975345", "0.6854794", "0.67647254", "0.66254926", "0.65622914", "0.6527084", "0.6506294", "0.62662935", "0.6246733", "0.602892", "0.6011976", "0.59912306", "0.5978833", "0.59427273", "0.5930123", "0.5899079", "0.5897965", "0.5883063", "0.583878", "0.58241075", "0.5812795...
0.71956176
0
Tests logging a track with an album association.
def test_log_track_with_album_association(self): album_id = self.add_album(artist='Artist', album='Album') self.assertNotEqual(album_id, 0) track = self.app.log_track(self.track_obj('silence.mp3')) self.assertEqual(self.get_track_count(), 1) track_row = self.get_track_by_id(trac...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_track_with_association(self):\n album_pk = self.add_album(artist='Artist', album='Album',\n totaltracks=1, totalseconds=2)\n track = Track(artist='Artist', album='Album')\n pk = track.insert(self.app.db, self.app.curs,\n 'xmms',\n datetime.datetime.now...
[ "0.7610868", "0.73599017", "0.71778214", "0.7143459", "0.7120667", "0.70118874", "0.69516945", "0.6908207", "0.68896925", "0.67944616", "0.67835206", "0.67257226", "0.6706928", "0.6651592", "0.64776623", "0.64346457", "0.64058363", "0.63975424", "0.6391494", "0.6368075", "0.6...
0.89470124
0
Tests logging a track when we have a transform in the DB, and also an album which we'll get associated with, posttransform.
def test_log_track_with_transform_and_album(self): album_id = self.add_album(artist='Artist 2', album='Album') self.assertNotEqual(album_id, 0) tf_id = self.add_transform(cond_artist=True, pattern_artist='Artist', change_artist=True, to_artist='Artist 2') self.assertNotEqua...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_log_track_with_transform_and_nonmatching_album(self):\n\n album_id = self.add_album(artist='Artist', album='Album')\n self.assertNotEqual(album_id, 0)\n\n tf_id = self.add_transform(cond_artist=True, pattern_artist='Artist',\n change_artist=True, to_artist='Artist 2')\n ...
[ "0.85024387", "0.79327434", "0.7852414", "0.74346083", "0.6675654", "0.6674248", "0.66330826", "0.66317886", "0.66268957", "0.65254134", "0.6517433", "0.65012044", "0.64884764", "0.6466346", "0.64632815", "0.64544785", "0.6451919", "0.64405674", "0.64298874", "0.63987684", "0...
0.8612888
0
Tests logging a track when we have a transform in the DB, and also an album, though the album would only match if the transforms weren't done. So the track should remain albumless.
def test_log_track_with_transform_and_nonmatching_album(self): album_id = self.add_album(artist='Artist', album='Album') self.assertNotEqual(album_id, 0) tf_id = self.add_transform(cond_artist=True, pattern_artist='Artist', change_artist=True, to_artist='Artist 2') self.ass...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_log_track_with_transform_and_album(self):\n\n album_id = self.add_album(artist='Artist 2', album='Album')\n self.assertNotEqual(album_id, 0)\n\n tf_id = self.add_transform(cond_artist=True, pattern_artist='Artist',\n change_artist=True, to_artist='Artist 2')\n self.a...
[ "0.8514355", "0.78532326", "0.761757", "0.75992846", "0.7590075", "0.748399", "0.73686594", "0.73031753", "0.72851574", "0.72583246", "0.72403556", "0.7232053", "0.72276837", "0.72007716", "0.71380496", "0.7122474", "0.71190715", "0.7004657", "0.7000489", "0.69437546", "0.689...
0.8714382
0
A single album in the database needs an update, where the album does not match the transform. (Should still update the last_transform ID.)
def test_apply_transform_single_album_no_match(self): album = Album(artist='Artist', album='Album', totaltracks=1, totalseconds=120) pk = album.insert(self.app.db, self.app.curs) tf_pk = self.add_transform(cond_artist=True, pattern_artist='Foo', change_artist=True, to_art...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_apply_transform_single_album_match(self):\n album = Album(artist='Artist', album='Album',\n totaltracks=1, totalseconds=120)\n pk = album.insert(self.app.db, self.app.curs)\n tf_pk = self.add_transform(cond_artist=True, pattern_artist='Artist',\n change_artist=Tr...
[ "0.7170836", "0.7093071", "0.7036738", "0.69025433", "0.68794364", "0.67881304", "0.6764547", "0.67257917", "0.66920286", "0.6683573", "0.6675146", "0.66168016", "0.66015816", "0.65859526", "0.6550071", "0.6548779", "0.6511441", "0.6492206", "0.6484115", "0.6433301", "0.63417...
0.76814955
0
A single album in the database needs an update, where the album matches the transform.
def test_apply_transform_single_album_match(self): album = Album(artist='Artist', album='Album', totaltracks=1, totalseconds=120) pk = album.insert(self.app.db, self.app.curs) tf_pk = self.add_transform(cond_artist=True, pattern_artist='Artist', change_artist=True, to_art...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_transform_album_change_album(self):\n album = Album(artist='Artist', album='Album',\n totaltracks=1, totalseconds=60)\n transform = Transform(1, cond_album=True, change_album=True,\n pattern_album='Album', to_album='Album 2')\n\n self.assertEqual(album.last_trans...
[ "0.7242384", "0.6968503", "0.68150514", "0.6784697", "0.66346836", "0.66276807", "0.66234165", "0.6596619", "0.65819573", "0.6513053", "0.6509266", "0.6426054", "0.639073", "0.6369199", "0.63599443", "0.6356305", "0.63424665", "0.6298131", "0.62806195", "0.6271178", "0.626873...
0.72746783
0
Tests adding when there are no tracks.
def test_no_tracks(self): (added, status) = self.app.add_album([]) self.assertEqual(added, False) self.assertIn('No files', status) self.assertEqual(self.get_album_count(), 0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_all_unassociated_no_tracks(self):\n self.assertEqual(self.get_track_count(), 0)\n tracks = Track.get_all_unassociated(self.app.curs)\n self.assertEqual(tracks, [])", "def test_single_track_no_album(self):\n self.add_mp3(set_album=True)\n (added, status) = self.app....
[ "0.73658025", "0.7339489", "0.7268404", "0.7196265", "0.71323395", "0.7064418", "0.7001076", "0.6949585", "0.6894559", "0.6870072", "0.67724997", "0.6679683", "0.6598101", "0.65894216", "0.64896923", "0.64834064", "0.6457528", "0.632992", "0.63289547", "0.6309879", "0.6299867...
0.8215326
0
Tests adding a singletrack album
def test_single_track(self): self.add_mp3() (added, status) = self.app.add_album(self.filenames) self.assertEqual(added, True) self.assertEqual(self.get_album_count(), 1) album = Album.get_by_artist_album(self.app.curs, 'Artist', 'Album') self.assertNotEqual(album, None) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_single_track_no_album(self):\n self.add_mp3(set_album=True)\n (added, status) = self.app.add_album(self.filenames)\n self.assertEqual(added, False)\n self.assertIn('has no album tag', status)\n self.assertEqual(self.get_album_count(), 0)", "def test_single_track_blank_...
[ "0.8426997", "0.83524626", "0.7959679", "0.792847", "0.79258084", "0.78163826", "0.774063", "0.77258843", "0.7723732", "0.76072806", "0.76011235", "0.75218207", "0.7433748", "0.73100126", "0.72615707", "0.7193796", "0.71629274", "0.7125294", "0.7075112", "0.69813687", "0.6976...
0.87772244
0
Tests adding a singletrack album as an EP
def test_single_track_ep(self): self.add_mp3() (added, status) = self.app.add_album(self.filenames, 'ep') self.assertEqual(added, True) self.assertEqual(self.get_album_count(), 1) album = Album.get_by_artist_album(self.app.curs, 'Artist', 'Album') self.assertNotEqual(albu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_single_track(self):\n self.add_mp3()\n (added, status) = self.app.add_album(self.filenames)\n self.assertEqual(added, True)\n self.assertEqual(self.get_album_count(), 1)\n album = Album.get_by_artist_album(self.app.curs, 'Artist', 'Album')\n self.assertNotEqual(al...
[ "0.8261948", "0.7846717", "0.7730771", "0.7715311", "0.74906176", "0.73981076", "0.7348272", "0.72160184", "0.7141139", "0.7114521", "0.71031344", "0.7049806", "0.70374817", "0.7025939", "0.6973802", "0.69700974", "0.6938921", "0.6930416", "0.6883827", "0.68818855", "0.683817...
0.86859405
0
Tests adding a singletrack album but without an artist tag (should fail)
def test_single_track_no_artist(self): self.add_mp3(set_artist=True) (added, status) = self.app.add_album(self.filenames) self.assertEqual(added, False) self.assertIn('has no artist tag', status) self.assertEqual(self.get_album_count(), 0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_single_track_blank_artist(self):\n self.add_mp3(set_artist=True, artist='')\n (added, status) = self.app.add_album(self.filenames)\n self.assertEqual(added, False)\n self.assertIn('has no artist tag', status)\n self.assertEqual(self.get_album_count(), 0)", "def test_si...
[ "0.87628245", "0.8758931", "0.86813", "0.8284579", "0.7953755", "0.78515226", "0.77891296", "0.77029324", "0.76161736", "0.7600973", "0.7525243", "0.7521056", "0.74833417", "0.74420047", "0.7390794", "0.7319073", "0.7294209", "0.72843045", "0.72787434", "0.72002524", "0.71399...
0.888179
0
Tests adding a twotrack album
def test_two_tracks_same_album(self): self.add_mp3(filename='1.mp3') self.add_mp3(filename='2.mp3') (added, status) = self.app.add_album(self.filenames) self.assertEqual(added, True) self.assertEqual(self.get_album_count(), 1) album = Album.get_by_artist_album(self.app.cu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_adding_album_twice(self):\n self.add_mp3(filename='1.mp3')\n (added, status) = self.app.add_album(self.filenames)\n self.assertEqual(added, True)\n self.assertEqual(self.get_album_count(), 1)\n\n self.add_mp3(filename='2.mp3')\n (added, status) = self.app.add_albu...
[ "0.78426236", "0.7805402", "0.7797424", "0.77850235", "0.7490419", "0.74535", "0.73824483", "0.7379444", "0.7247655", "0.7246687", "0.72071993", "0.71592957", "0.7116813", "0.7094143", "0.70567465", "0.69892615", "0.6946742", "0.6941545", "0.6889998", "0.6656151", "0.6644807"...
0.83555907
0
Tests trying to add two tracks which don't share an album name. Should fail.
def test_two_tracks_mismatched_album(self): self.add_mp3(filename='1.mp3') self.add_mp3(filename='2.mp3', set_album=True, album='Album 2') (added, status) = self.app.add_album(self.filenames) self.assertEqual(added, False) self.assertIn('changed to', status) self.assertEq...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_two_tracks_same_album(self):\n self.add_mp3(filename='1.mp3')\n self.add_mp3(filename='2.mp3')\n (added, status) = self.app.add_album(self.filenames)\n self.assertEqual(added, True)\n self.assertEqual(self.get_album_count(), 1)\n album = Album.get_by_artist_album(...
[ "0.7789425", "0.7471445", "0.7309341", "0.7306946", "0.7156688", "0.715474", "0.71386695", "0.71159077", "0.7030235", "0.701861", "0.67959344", "0.6789164", "0.6733345", "0.66853017", "0.66372097", "0.66346925", "0.65108454", "0.65012765", "0.64418644", "0.6412551", "0.640126...
0.82471305
0
Tests adding a file with an artist name that's too long.
def test_single_track_artist_too_long(self): self.add_mp3(set_artist=True, artist='z'*(App.max_artist_album_length+10)) (added, status) = self.app.add_album(self.filenames) self.assertEqual(added, False) self.assertIn('is longer than', status) self.assertEqual(self.get_album_coun...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_single_track_album_too_long(self):\n self.add_mp3(set_album=True, album='z'*(App.max_artist_album_length+10))\n (added, status) = self.app.add_album(self.filenames)\n self.assertEqual(added, False)\n self.assertIn('is longer than', status)\n self.assertEqual(self.get_alb...
[ "0.721069", "0.6896181", "0.6506665", "0.6447", "0.64217573", "0.6195491", "0.61674", "0.6117693", "0.60968906", "0.6013237", "0.59565973", "0.5936737", "0.58365554", "0.58020955", "0.57910687", "0.5773809", "0.5714396", "0.57047", "0.56817263", "0.56702715", "0.5665934", "...
0.77672
0
Tests adding a file with an album name that's too long.
def test_single_track_album_too_long(self): self.add_mp3(set_album=True, album='z'*(App.max_artist_album_length+10)) (added, status) = self.app.add_album(self.filenames) self.assertEqual(added, False) self.assertIn('is longer than', status) self.assertEqual(self.get_album_count()...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_single_track_artist_too_long(self):\n self.add_mp3(set_artist=True, artist='z'*(App.max_artist_album_length+10))\n (added, status) = self.app.add_album(self.filenames)\n self.assertEqual(added, False)\n self.assertIn('is longer than', status)\n self.assertEqual(self.get_...
[ "0.7551915", "0.74915075", "0.67425096", "0.67402333", "0.6691039", "0.66215557", "0.6417951", "0.621872", "0.6173248", "0.6172702", "0.611583", "0.611272", "0.6007829", "0.5962165", "0.5869577", "0.58237994", "0.57390076", "0.57306856", "0.5678414", "0.5674958", "0.5669362",...
0.79627424
0
Tests adding the same album twice, forcing the update. Will add a second track so that we can check for updated variables.
def test_adding_album_twice_forced(self): self.add_mp3(filename='1.mp3') (added, status) = self.app.add_album(self.filenames) self.assertEqual(added, True) self.assertEqual(self.get_album_count(), 1) self.add_mp3(filename='2.mp3') (added, status) = self.app.add_album(sel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_adding_album_twice(self):\n self.add_mp3(filename='1.mp3')\n (added, status) = self.app.add_album(self.filenames)\n self.assertEqual(added, True)\n self.assertEqual(self.get_album_count(), 1)\n\n self.add_mp3(filename='2.mp3')\n (added, status) = self.app.add_albu...
[ "0.8434736", "0.8328903", "0.8209705", "0.7662132", "0.7512636", "0.73895454", "0.7321557", "0.7280797", "0.7230936", "0.7164089", "0.709322", "0.70863926", "0.70763177", "0.70213395", "0.69851583", "0.6945343", "0.6927779", "0.6913416", "0.69091415", "0.68480235", "0.6678317...
0.8459756
0
Tests adding a singletrack album, when a transform is in place.
def test_single_track_with_transform(self): tf_pk = self.add_transform(cond_artist=True, pattern_artist='Artist', change_artist=True, to_artist='Artist 2') self.app.load_data() self.add_mp3() (added, status) = self.app.add_album(self.filenames) self.assertEqual(added...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_single_track_no_album(self):\n self.add_mp3(set_album=True)\n (added, status) = self.app.add_album(self.filenames)\n self.assertEqual(added, False)\n self.assertIn('has no album tag', status)\n self.assertEqual(self.get_album_count(), 0)", "def test_adding_existing_alb...
[ "0.79019046", "0.78894967", "0.785211", "0.7790738", "0.75655943", "0.74529445", "0.7447172", "0.739831", "0.73894083", "0.7352263", "0.73343515", "0.7329509", "0.73271173", "0.7316945", "0.7256467", "0.72537506", "0.71862954", "0.7113336", "0.7105183", "0.7052806", "0.705228...
0.8373542
0
Tests adding an album when we already have the same album in the database, though the matching album will ONLY be matched if transforms are applied at the correct spot.
def test_adding_existing_album_with_dependant_transform(self): tf_pk = self.add_transform(cond_artist=True, pattern_artist='Artist', change_artist=True, to_artist='Artist 2') album_id = self.add_album(artist='Artist 2', album='Album') self.app.load_data() self.assertEqual(sel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_two_tracks_mismatched_album(self):\n self.add_mp3(filename='1.mp3')\n self.add_mp3(filename='2.mp3', set_album=True, album='Album 2')\n (added, status) = self.app.add_album(self.filenames)\n self.assertEqual(added, False)\n self.assertIn('changed to', status)\n se...
[ "0.7772727", "0.7656604", "0.75255185", "0.7484096", "0.7410847", "0.719486", "0.7164526", "0.7151377", "0.71416116", "0.7118364", "0.71147084", "0.710689", "0.6990384", "0.69863564", "0.6941947", "0.69344443", "0.69009244", "0.68867546", "0.6885166", "0.68813825", "0.6811663...
0.7984607
0
Extract EPSG number from file name.
def get_proj(fname): fname = fname.split('_') # fname -> list i = fname.index('epsg') return fname[i+1]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_proj(fname):\r\n fname = fname.split('_') # fname -> list\r\n i = fname.index('epsg')\r\n return fname[i+1]", "def get_proj(fname):\r\n fname = fname.split('_') # fname -> list\r\n i = fname.index('epsg')\r\n return fname[i+1]", "def _epsg(self):\n info = self._info['coordina...
[ "0.6381265", "0.6381265", "0.62062746", "0.6061637", "0.58868164", "0.5818382", "0.5740342", "0.5669474", "0.5658069", "0.5641101", "0.5620341", "0.5620254", "0.56191593", "0.56164837", "0.56108224", "0.5606117", "0.55956405", "0.5589816", "0.558568", "0.557769", "0.5521931",...
0.63735604
2
Learning Rate Schedule Learning rate is scheduled to be reduced after 80, 120, 160, 180 epochs. Called automatically every epoch as part of callbacks during training. Arguments
def lr_schedule(epoch): lr = 1e-3 if epoch > 180: lr *= 0.5e-3 elif epoch > 160: lr *= 1e-3 elif epoch > 120: lr *= 1e-2 elif epoch > 80: lr *= 1e-1 print('Learning rate: ', lr) return lr
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rnn_learning_rate_schedule(dataset):\n model, prefix = make_rnn(non_negative=True)\n # model.set_params(**{prefix + \"val\": 0.1})\n\n # base = no schedule\n print(\"Baseline RNN\")\n # model.set_params(**{prefix + \"history_file\": \"nn_default.csv\"})\n cross_validate(dataset, model)\n #...
[ "0.7523955", "0.74989784", "0.74867773", "0.7482567", "0.7409074", "0.73667264", "0.7354723", "0.7348825", "0.733592", "0.72683275", "0.7265332", "0.722889", "0.72243", "0.71980274", "0.7191705", "0.70994437", "0.70869744", "0.7079", "0.7046937", "0.7026795", "0.70213264", ...
0.74704826
7
Generate a random token
def __generate_session_token(self): return get_random_string(length=32)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_token(self):\n token = randint(100000000000000000, 999999999999999999)\n return str(token)", "def generate_token():\n return uuid4()", "def generateToken():\n token_length = random.randint(MIN_TOKEN_LEN, MAX_TOKEN_LEN)\n token = ''.join(random.choice(POSS_TOKEN_C...
[ "0.8648414", "0.8349534", "0.8339021", "0.8271479", "0.82595354", "0.76957136", "0.76957136", "0.7648065", "0.7530848", "0.7461588", "0.74045205", "0.7367319", "0.7302457", "0.7295595", "0.729334", "0.72796106", "0.72699726", "0.7238146", "0.7216239", "0.7200132", "0.719412",...
0.7509155
9
Test case for attempting to construct an object with a bad data_type.
def testConstructorValueError(self): test_cases = [ 'these', 'are', 'bad', 'data', 'types', 'FILE', 'STRING', 'JSON', ] for bad_data_type in test_cases: with self.assertRaises(ValueError):...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_from_object_fail(self):\n class InvalidClass(object):\n pass\n Invalid_object = InvalidClass()\n with self.assertRaises(TypeError):\n BaseDataClass.from_object(Invalid_object)", "def test_validate_on_invalid_data_type(self):\n args = (self.bytes_a, 'inva...
[ "0.786114", "0.7583709", "0.7478926", "0.73357713", "0.7105237", "0.6925544", "0.68950695", "0.6853811", "0.68478805", "0.68383276", "0.6816325", "0.68021005", "0.678678", "0.6786026", "0.6767078", "0.6726061", "0.6719139", "0.6712887", "0.67126364", "0.67121595", "0.6676463"...
0.7482894
2
Getter method for mtu, mapped from YANG variable /pw_profile/mtu (container)
def _get_mtu(self): return self.__mtu
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mtu_size(self) -> int:\n return self._backend.mtu_size", "def _set_mtu(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=mtu.mtu, is_container='container', presence=False, yang_name=\"mtu\", rest_name=\"mtu\", parent=self, path_helper...
[ "0.7047462", "0.7046006", "0.6127896", "0.59223175", "0.58491415", "0.5773584", "0.5016407", "0.5013141", "0.5001411", "0.5001411", "0.5001411", "0.5001411", "0.5001411", "0.5001411", "0.5001411", "0.4963042", "0.49021015", "0.49014223", "0.48863196", "0.4866205", "0.47773373...
0.6666578
2