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
Convenience function to get Euclidean distance between two 2D points.
def euclidDist(x1, y1, x2, y2): c = math.sqrt(((x2-x1)**2) + ((y2-y1)**2)) return c
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def euclidean_distance(point1, point2):\n return np.linalg.norm(np.array(point1) - np.array(point2))", "def euclidean_distance(point1, point2):\n\n return math.sqrt(sum([(x - y) ** 2 for x, y in zip(point1, point2)]))", "def euclidean_distance(point_one, point_two):\n return np.linalg.norm(point_one-p...
[ "0.8460413", "0.8441778", "0.8294402", "0.8286828", "0.82327133", "0.81515205", "0.8142209", "0.8101829", "0.8067088", "0.8032559", "0.8024419", "0.8020042", "0.79888535", "0.79788846", "0.7976541", "0.7933104", "0.7891097", "0.7759116", "0.775127", "0.7750974", "0.7745761", ...
0.76967114
23
Opens a new database connection if there is none yet for the current application context.
def get_db(): if not hasattr(g, 'sqlite_db'): g.sqlite_db = connect_db() return g.sqlite_db
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def db_open():\n if not hasattr(g, 'sqlite_db'):\n g.sqlite_db = db_connect()\n return g.sqlite_db", "def open_database(self):\n if self._conn is None:\n self._conn = sqlite3.connect(self._db_path)", "def open_db(db_name: str = DB_NAME) -> DBConnection:\n return sqlite3.connec...
[ "0.773897", "0.75835025", "0.7318477", "0.7169243", "0.70229524", "0.69677585", "0.6955773", "0.6949434", "0.6898107", "0.6842816", "0.68302435", "0.68196636", "0.6806231", "0.6795786", "0.676963", "0.67621964", "0.67503923", "0.674726", "0.67316467", "0.67005205", "0.6689189...
0.6404172
71
Return YAML from dictionary
def dict_to_yaml(dict_data): return yaml.dump(dict_data, default_flow_style=False)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _dict_to_single_line_yaml(self, *, data):\n result = yaml.dump(data, default_flow_style=True)\n result = result.replace(\"\\n\", \" \").strip()\n result = re.sub(r\" *\", \" \", result)\n return result", "def _load_rendered_yaml(self, rendered: str) -> dict:\n return [d fo...
[ "0.6522145", "0.64733344", "0.64209014", "0.6349866", "0.63155717", "0.6196261", "0.6169453", "0.6161809", "0.61531466", "0.61274767", "0.6119773", "0.60728484", "0.60544103", "0.6044332", "0.6028751", "0.601298", "0.59830356", "0.5955687", "0.59508765", "0.5948505", "0.59473...
0.6766215
0
Return configuration from YAML file
def get_yaml_config(config_file): # Note in its original form get_mojo_config it would do a search pattern # through mojo stage directories. This version assumes the yaml file is in # the pwd. logging.info('Using config %s' % (config_file)) return yaml.load(open(config_file, 'r').read())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _cfg_from_file(filename):\n import yaml\n with open(filename, 'r') as f:\n cfg = yaml.load(f)\n return cfg", "def load_config(config_file):\n with open(config_file) as f:\n return yaml.load(f)", "def load_yaml(yml_file):\n with open(yml_file) as src:\n cfg = yaml.load(sr...
[ "0.8114892", "0.7938967", "0.7896065", "0.78838134", "0.7857094", "0.78416204", "0.7753099", "0.77486134", "0.7730139", "0.7721778", "0.76814544", "0.7678056", "0.76735145", "0.7634091", "0.75899607", "0.75568515", "0.75507677", "0.752775", "0.75211734", "0.75189835", "0.7512...
0.75844085
15
Initialise the filter, which will be a lowpass initially.
def __init__(self, cutoff_frequency, order, filter_type="maximally_flat"): self.cutoff_freq = cutoff_frequency self.order = order self.filter_type = filter_type #TODO: Initialise filter based on maximally flat prototype
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize_filter(self):\n shape = self.filter_size + (self.input_shape[-1], self.channels)\n self.filter = self.filter_initializer(shape)", "def init_lowpass(self, lowpass_cutoff, lowpass_order):\n if lowpass_cutoff > 0 or self._fs_out < self._fs_in:\n nyquist = self._fs_out / 2\n ...
[ "0.8340151", "0.7217733", "0.70526063", "0.6963124", "0.6960907", "0.6917673", "0.67937124", "0.6728488", "0.66667974", "0.66572136", "0.66277003", "0.6610958", "0.65344405", "0.65289265", "0.65041405", "0.6488298", "0.64841235", "0.6449716", "0.64445275", "0.64191556", "0.63...
0.64905727
15
Testing my_object is instance of BaseModel
def test_instance_BaseModel(self): self.assertTrue(isinstance(self.my_object, BaseModel))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_isinstance(self):\n obj = BaseModel()\n self.assertIsInstance(obj, BaseModel)", "def test_instance(self):\n self.assertIsInstance(self.test1, BaseModel)", "def test_instance_Review(self):\n obj = Review()\n self.assertIsInstance(obj, BaseModel)", "def test_inherita...
[ "0.81156033", "0.76331013", "0.7465718", "0.7451834", "0.74414", "0.7396428", "0.7292368", "0.72891337", "0.72486854", "0.72141725", "0.7157884", "0.71443915", "0.71429867", "0.71160567", "0.7091168", "0.7066417", "0.7064973", "0.70428675", "0.70409393", "0.70259124", "0.7022...
0.9186299
0
Returns a logger of the name provided.
def get_logger(name: str, level=None, propagate=False, handlers=DEFAULT_HANDLERS, args=[[DEFAULT_STREAM]]): logger = logging.getLogger(name) if level is None: logger.setLevel(Logging.DEFAULT_LEVEL) else: logger.setLevel(level) for func, arg in zip(handlers, arg...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_logger(name):\n # type: (str) -> Logger\n return logging.getLogger(name)", "def get_logger(name: str) -> logging.Logger:\n \n return logging.getLogger(name)", "def get_logger(name):\n return logging.getLogger(name)", "def get_logger(name: str) -> logging.Logger:\n try:\n...
[ "0.8915613", "0.8826126", "0.88075113", "0.8398616", "0.8318776", "0.82908106", "0.8280683", "0.8220635", "0.82103336", "0.8152166", "0.8057301", "0.8034735", "0.8017938", "0.8009244", "0.79914486", "0.79557", "0.79370373", "0.7930099", "0.79271114", "0.79087555", "0.7906477"...
0.0
-1
If a form is submitted but could not be validated, the routing passes the form and this method returns all form errors (form.errors) as flash messages.
def flash_formerrors(form): for _field, errors in list(form.errors.items()): for e in errors: flash(e, "error")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def flash_errors(form):\n for field, errors in form.errors.items():\n for error in errors:\n flash(\n \"Error in the %s field - %s\" % (getattr(form, field).label.text, error)\n )", "def flash_errors(form):\n for field, errors in form.errors.items():\n for...
[ "0.72498864", "0.72490525", "0.72430354", "0.7194884", "0.6937162", "0.68747157", "0.68747157", "0.651835", "0.65074605", "0.64690834", "0.6459815", "0.6452397", "0.63615555", "0.63413566", "0.6276598", "0.6235229", "0.6235229", "0.623182", "0.61129373", "0.61129373", "0.6015...
0.75451297
0
Returns True if obj is an instance of a class that inherited \ from the specified class; otherwise False
def inherits_from(obj, a_class): return isinstance(obj, a_class) and type(obj) is not a_class
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def inherits_from(obj, a_class):\n if type(obj) is not a_class:\n return(issubclass(type(obj), a_class))\n else:\n return False", "def inherits_from(obj, a_class):\n if issubclass(type(obj), a_class):\n if type(obj) is not a_class:\n return True\n return False", "def...
[ "0.834662", "0.83021367", "0.8262449", "0.8260232", "0.82288206", "0.8222077", "0.82175326", "0.8188189", "0.81595206", "0.8100171", "0.80833143", "0.80833143", "0.806853", "0.8032719", "0.80002767", "0.79462105", "0.79462105", "0.79462105", "0.79462105", "0.79462105", "0.794...
0.78095955
29
Convert a scipy sparse matrix to a torch sparse tensor.
def sparse_mx_to_torch_sparse_tensor(sparse_mx): sparse_mx = sparse_mx.tocoo().astype(np.float32) indices = torch.from_numpy(np.vstack((sparse_mx.row, sparse_mx.col))).long() values = torch.from_numpy(sparse_mx.data) shape = torch.Size(sparse_mx.shape) retur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def csr2tensor(self, matrix: sp.csr_matrix):\n matrix = matrix.tocoo()\n x = torch.sparse.FloatTensor(\n torch.LongTensor(np.array([matrix.row, matrix.col])),\n torch.FloatTensor(matrix.data.astype(np.float32)),\n matrix.shape,\n ).to(self.device)\n retu...
[ "0.8301762", "0.8148899", "0.80461955", "0.80328023", "0.8030319", "0.8030319", "0.8030319", "0.8030319", "0.8030319", "0.8030319", "0.8030319", "0.8030319", "0.8030319", "0.8030319", "0.8030319", "0.8030319", "0.8030319", "0.80137724", "0.79855764", "0.79855764", "0.79855764...
0.79976094
18
Draw the label in the top left of the screen.
def draw_label(self): x, y, z, phi, theta, psi = self.airplane.eta u, v, w, p, q, r = self.airplane.nu u_dot, v_dot, w_dot, p_dot, q_dot, r_dot = self.airplane.nu_dot alpha = np.arctan(w/u) V_a = np.sqrt(u**2+v**2+w**2) beta = np.arcsin(v/V_a) self.labels[0].text...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def DrawLabel(self, screen):\r\n screen.blit(self.label, self.pos)", "def draw(self):\r\n self.scr.fill(SCREEN_COLOR)\r\n self.label.draw()\r\n pygame.display.flip()", "def draw_position_label(self):\n x, y, z = self.player.pos\n x, y, z = math.floor(x), math.floor(y),...
[ "0.7879667", "0.71225935", "0.70314103", "0.6967009", "0.66949373", "0.661061", "0.65646076", "0.650323", "0.6459924", "0.6391669", "0.6334443", "0.63146436", "0.6273895", "0.62307465", "0.6184886", "0.61727214", "0.61546206", "0.6146046", "0.6132769", "0.61099833", "0.609395...
0.65735805
6
Get Max value from field variable (all steps all nodes)
def get_max_values(dbpath,var,fname): odb = openOdb(path=dbpath) if not odb.steps[find_last_step(dbpath)].frames[-1].fieldOutputs.has_key(var): root = Tkinter.Tk().withdraw() tkMessageBox.showerror("PyQus 0.1.0", "Undefined field variable '%s'"%(var)) return False f = open(fname,"w")...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_max(self):\n\t\tif self.right:\n\t\t\treturn self.right.get_max()\n\t\treturn self.value", "def max(self):\n no = self.root\n if no:\n no = self.__search_node_max_esq(no)\n if no:\n return no.valor\n return None", "def find_max(self):\n r...
[ "0.75348693", "0.7325127", "0.7232566", "0.723187", "0.721605", "0.71821034", "0.71821034", "0.71501803", "0.71483964", "0.7101528", "0.7097368", "0.7087865", "0.70843136", "0.70363015", "0.7026658", "0.70010906", "0.6963945", "0.69599605", "0.6858343", "0.6845673", "0.683761...
0.6838637
20
Sets room and start_time for automatic events.
def before_auto_event_save(self, event): #~ logger.info("20131008 before_auto_event_save") assert not settings.SITE.loading_from_dump assert event.owner == self if event.is_user_modified(): return event.room = self.room event.start_time = self.start_time ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_room(self, room):\n self.room = room\n _LOGGER.info(\"Monitoring room: %s\", room)", "async def on_room_init(self, room_obj):\n pass", "def start_time(self, start_time):\n self._start_time = start_time", "def start_time(self, start_time):\n self._start_time = start_...
[ "0.6201317", "0.582458", "0.56296486", "0.56296486", "0.56186163", "0.5589444", "0.5589444", "0.5589444", "0.5589444", "0.5589444", "0.5464654", "0.54389143", "0.543577", "0.54356146", "0.5434296", "0.54264486", "0.5387524", "0.5385569", "0.5379112", "0.5345878", "0.53413", ...
0.6515543
0
Shortcut for getting the Mongo collection.
def collection(self): try: db = getattr(self.mongo_connection, self.DATABASE, None) collection = getattr(db, self.COLLECTION, None) return collection except: self.logger.exception("Could not get Mongo collection %s.%s" %\ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_collection(self):\n db = self._get_db()\n return getattr(db, global_settings.MONGODB_COLLECTION)", "def get_collection(cls):\n return mongo_db[cls.__collection__]", "def get_db_collection():\n\n client = MongoClient(\n app.config['MONGODB_URI'],\n connectTimeoutMS...
[ "0.8537828", "0.832562", "0.79868823", "0.7606626", "0.7588079", "0.74365324", "0.7398832", "0.7267596", "0.7205818", "0.7063383", "0.7050799", "0.68859446", "0.68738574", "0.6808978", "0.6682333", "0.6679174", "0.6590441", "0.6574695", "0.6498871", "0.6482595", "0.64729387",...
0.84590656
1
Returns a list containing the cumulative sums at every element of ls. i.e., cumsum([1,2,3]) = [1,3,6].
def cumsum(ls): acc = 0 r = [0 for v in ls] for i,v in enumerate(ls): acc += v r[i] = acc return r
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cumulative_sum(self, lis):\n new_list = []\n for i in range(len(lis)):\n if i == 0:\n new_list.append(lis[i])\n else:\n new_list.append(new_list[i-1] + lis[i])\n return new_list", "def cumsum(L):\n for i in range(1, len(L)):\n L[i] += L[i-1]\n return L", "def c...
[ "0.80398005", "0.7695083", "0.756382", "0.73498005", "0.7188667", "0.7170845", "0.7161476", "0.70941275", "0.70941275", "0.70941275", "0.65717137", "0.65123504", "0.6429055", "0.64118063", "0.60888875", "0.60683227", "0.5980029", "0.5956611", "0.59425086", "0.58546436", "0.57...
0.8925046
0
Returns a new dict containing elements of d, excepting the key,value pair with key k (if it exists in d). If d is a sequence, returns a new list containing all elements of d not equal to k.
def cut(d, k): if isinstance(d, dict): n = d.copy() if k in n: del n[k] return n return [v for v in d if v != k]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def without_keys(d, keys):\n return {x: d[x] for x in d if x not in keys}", "def exclude(m, keys):\n return {k: v for k, v in m.items() if k not in keys}", "def exclude_keys(dictionary: Mapping, keys: Sequence[Hashable]) -> dict:\n return {k: v for k, v in dictionary.items() if k not in keys}", "def...
[ "0.73714614", "0.69000715", "0.6755805", "0.67494184", "0.66574055", "0.657755", "0.645789", "0.64572686", "0.63366866", "0.6289693", "0.62822014", "0.62418985", "0.62310916", "0.618341", "0.6121809", "0.60877687", "0.60717666", "0.60710275", "0.60603344", "0.6059413", "0.605...
0.7469107
0
return the DiscreteBayesNode associated with the specified name
def get_node_with_name(self, name): return self.variables[name]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ex_get_node_by_name(self, name):\n domain = self._get_domain_for_name(name=name)\n node = self._to_node(domain=domain)\n return node", "def get_node(self, name):\n\n assert name in self.nodes\n return self.nodes[name]", "def node(self, name):\r\n return self.nodes[...
[ "0.6690276", "0.65460217", "0.6419334", "0.62368613", "0.62237495", "0.61515343", "0.59360695", "0.5923207", "0.5851477", "0.5831038", "0.5807891", "0.5805292", "0.58033997", "0.5763235", "0.573063", "0.5703924", "0.5702475", "0.56790113", "0.5640059", "0.5616386", "0.5587959...
0.6655467
1
Compute softmax values of array x. x the input array the softmax array
def _softmax(self, x): return np.exp(x - np.max(x)) / np.sum(np.exp(x - np.max(x)))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def softmax(self, x):\n\n out = np.zeros(x.shape)\n for i in range(x.shape[0]):\n max_x = x[i] - np.max(x[i])\n out[i] = np.exp(max_x) / np.sum(np.exp(max_x), axis=0)\n\n return out", "def softmax(x):\n #pass # TODO: Compute and return softmax(x)\n return np.exp(...
[ "0.8835479", "0.88041574", "0.8789406", "0.8782963", "0.87562025", "0.87368524", "0.8734476", "0.87092113", "0.8696394", "0.86937225", "0.8691565", "0.86874735", "0.8680624", "0.8666654", "0.8660024", "0.8658726", "0.8654287", "0.8654287", "0.8653849", "0.8653849", "0.8653682...
0.8372322
99
Capitalizes first letter of the string. Often used to generate setCapitalCase and other verb methods
def cap_first(word): return word[0].upper() + word[1:]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def capitalize1(s):\n return s[:1].upper() + s[1:]", "def capitalizeFirst(word):\n return word[0].upper() + word[1:]", "def capify(text):\n return text[0].upper() + text[1:]", "def capitalize_first_letter(text):\n chars = list(text.strip())\n chars[0] = chars[0].upper()\n return \"\".join(c...
[ "0.821552", "0.81636703", "0.7850061", "0.7826172", "0.7785153", "0.7767818", "0.7681984", "0.75323766", "0.7499661", "0.74712414", "0.7452754", "0.74443513", "0.7434822", "0.74110967", "0.73345244", "0.7310538", "0.72971606", "0.7265402", "0.7238798", "0.7218253", "0.7215664...
0.80372524
2
Converts under_score separation to underScore camel case
def to_camel(id): return ''.join(cap_first(x) for x in id.split('_'))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def underscore_to_camelcase(text):\n text = text.replace('_', ' ').title()\n return text.replace(' ', '')", "def camelcase(value):\n rest = value.split(\"_\")\n return rest[0] + \"\".join(word.title() for word in rest[1:])", "def convert_underscore_to_camel_case(text):\n words = text.split('_')\...
[ "0.7963811", "0.78870094", "0.78847665", "0.78231514", "0.77870536", "0.773148", "0.7721451", "0.7721451", "0.7673438", "0.76216555", "0.7602183", "0.75763404", "0.75653356", "0.7542307", "0.75314736", "0.75282", "0.75040287", "0.7503828", "0.74855024", "0.74100477", "0.73851...
0.7348432
22
Creates a new aggregator with max perimeter <= k.
def __init__(self, k=2): assert k >= 2 self.k = k
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def maximum(self, k):\n return Cdf(self.xs, self.ps**k)", "def dual_group(k_max: int) -> K:\n k = np.arange(-k_max, k_max + 1)\n return k", "def allocate_candies(A, k):\n lo = 0\n\n # the maximum number of candies we could theoretically allocate\n # to each children (if we ignored piles)\...
[ "0.6331605", "0.58252853", "0.55871147", "0.54912996", "0.5462082", "0.5429556", "0.5403833", "0.53915787", "0.5386797", "0.52348495", "0.5214142", "0.5214142", "0.52098614", "0.5207329", "0.51883435", "0.51783526", "0.51398665", "0.513258", "0.5104497", "0.5100585", "0.50861...
0.4721758
71
Converts value if it is not None, otherwise returns None.
def safe_convert(value_to_convert: str, type_to_convert_to: type) -> Optional[Union[int, float]]: if value_to_convert is None: return None else: return type_to_convert_to(value_to_convert)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_or_none(value, type_):\n try:\n return type_(value)\n except Exception:\n return None", "def process(self, value):\n return six.text_type(value) if value is not None else None", "def value_or_none(converter: Callable[[Any], T]) -> Callable[[Any], Optional[T]]:\n return...
[ "0.75390464", "0.71771777", "0.7169039", "0.7134258", "0.6975397", "0.6883705", "0.6853927", "0.6832798", "0.6815137", "0.6811845", "0.67897415", "0.6744833", "0.6743388", "0.6740211", "0.6708566", "0.6629133", "0.6593644", "0.6556598", "0.6469318", "0.6424278", "0.641935", ...
0.6691978
15
Returns the singular name of the plural name
def get_singular_name(cls, entity_name_plural): if entity_name_plural in Utils.INVARIANT_RESOURCES: return entity_name_plural if entity_name_plural[-3:] == "ies": return entity_name_plural[:-3] + "y" if entity_name_plural[-1] == "s": return entity_name_plur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_singular_from_plural(plural):\n if plural[-3:] in ['oes', 'xes']:\n return plural[:-2]\n elif plural[-3:] == 'ves':\n return plural[:-3] + 'fe'\n elif plural[-3:] == 'ies':\n return plural[:-3] + 'y'\n else:\n return plural[:-1]", "def _plural_to_singular(self, plu...
[ "0.7469329", "0.7303233", "0.72692496", "0.7160686", "0.70618296", "0.69809335", "0.67923826", "0.67267144", "0.6581082", "0.65536386", "0.64865834", "0.6467667", "0.6457611", "0.63654923", "0.6354766", "0.63176304", "0.6313384", "0.6291571", "0.6291202", "0.6262648", "0.6120...
0.77451783
0
Returns the plural name of the singular name
def get_entity_name_plural(cls, singular_name): if singular_name in Utils.INVARIANT_RESOURCES: return singular_name vowels = ["a", "e", "i", "o", "u", "y"] if singular_name[-1:] == "y" and singular_name[-2] not in vowels: return singular_name[:-1] + "ies" if si...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_singular_name(cls, entity_name_plural):\n\n if entity_name_plural in Utils.INVARIANT_RESOURCES:\n return entity_name_plural\n\n if entity_name_plural[-3:] == \"ies\":\n return entity_name_plural[:-3] + \"y\"\n\n if entity_name_plural[-1] == \"s\":\n ret...
[ "0.7687701", "0.7362145", "0.733723", "0.71885085", "0.71381515", "0.7118442", "0.7074017", "0.6844072", "0.66830546", "0.66410124", "0.6620903", "0.6600574", "0.65807676", "0.65216565", "0.64653754", "0.64584994", "0.63695914", "0.63239765", "0.6255601", "0.6240483", "0.6218...
0.7517259
1
Number of unread frames.
def size(self): if self.full(): return self.capacity() else: size = self._read_index - self._write_index if size < 0: return self.capacity() + size # wrap around else: return size
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def count_frames():\n frames = sentence.sem.frames.find_all('frame', {'name' : NEGATION_FRAME_NAME})\n frame_count = []\n for f_r in frames:\n frame_count.append(f_r)\n return len(frame_count)", ...
[ "0.72877717", "0.72759205", "0.7272979", "0.72433877", "0.71263707", "0.6992655", "0.69139344", "0.6875337", "0.67761993", "0.6773152", "0.6773152", "0.6773152", "0.6773152", "0.6771976", "0.67524797", "0.67090875", "0.6700748", "0.6682457", "0.6663712", "0.6646776", "0.66201...
0.0
-1
Returns the value from the event.
def GetValue(self): return self._value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _event_to_val(self, evt):\n return evt.val", "def getEventValue(*args, **kwargs):\n pass", "def value(self):\n return self['input'].value()", "def get_value(self, data):\n value = data['value']\n return value", "def _get_value(self):\n \n return self._value"...
[ "0.7985166", "0.7292858", "0.7034268", "0.70213836", "0.70147574", "0.69983095", "0.6995245", "0.6977663", "0.6949626", "0.69414896", "0.68907326", "0.68798876", "0.6873454", "0.6873454", "0.6854066", "0.6830843", "0.6810735", "0.6809196", "0.6809196", "0.6809196", "0.6802341...
0.6741968
26
Returns the value from the event.
def GetValue(self): return self._value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _event_to_val(self, evt):\n return evt.val", "def getEventValue(*args, **kwargs):\n pass", "def value(self):\n return self['input'].value()", "def get_value(self, data):\n value = data['value']\n return value", "def _get_value(self):\n \n return self._value"...
[ "0.7985166", "0.7292858", "0.7034268", "0.70213836", "0.70147574", "0.69983095", "0.6995245", "0.6977663", "0.6949626", "0.69414896", "0.68907326", "0.68798876", "0.6873454", "0.6873454", "0.6854066", "0.6830843", "0.6810735", "0.6809196", "0.6809196", "0.6809196", "0.6802341...
0.6741968
25
We receive a Tensor x of shape (N,H,W,D1) (e.g. (12,32,32,3)) and produce a Tensor x_out of shape (N,H,W,D2) (e.g. (12,32,32,100)), where each fiber of the x_out tensor describes the predictive distribution for the RGB at that position. 'h' is an optional N x K matrix of values to condition our generative model on
def model_spec(x, h=None, init=False, ema=None, dropout_p=0.5, nr_resnet=5, nr_filters=160, nr_logistic_mix=10, resnet_nonlinearity='concat_elu'): counters = {} with arg_scope([nn.conv2d, nn.deconv2d, nn.gated_resnet, nn.dense, nn.nin], counters=counters, init=init, ema=ema, dropout_p=dropout_p): # pa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def output(self,x=None,h=None,in_features=0,in_features_h=0,reuse=False):\n assert (x is not None or h is not None)\n print('re'*10,reuse , self.name)\n stride=[1, self.cnn_stride, self.cnn_stride, 1]\n with tf.variable_scope(self.name):\n Wxi=self._create_weight([self.cnn_si...
[ "0.6921986", "0.6536957", "0.64371914", "0.63562906", "0.6305824", "0.6222742", "0.61750877", "0.6174537", "0.61491233", "0.6138181", "0.613367", "0.60369533", "0.601945", "0.60106957", "0.5987211", "0.59553665", "0.5931572", "0.592108", "0.5898472", "0.5877079", "0.5869618",...
0.6226606
5
We receive a Tensor x of shape (N,H,W,D1) (e.g. (12,32,32,3)) and produce a Tensor x_out of shape (N,H,W,D2) (e.g. (12,32,32,100)), where each fiber of the x_out tensor describes the predictive distribution for the RGB at that position. 'h' is an optional N x K matrix of values to condition our generative model on
def pxpp_spec(x, h=None, init=False, ema=None, dropout_p=0.5, nr_resnet=5, nr_filters=160, nr_logistic_mix=10, resnet_nonlinearity='concat_elu'): counters = {} with arg_scope([nn.conv2d, nn.deconv2d, nn.gated_resnet, nn.dense], counters=counters, init=init, ema=ema, dropout_p=dropout_p): # parse resne...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def output(self,x=None,h=None,in_features=0,in_features_h=0,reuse=False):\n assert (x is not None or h is not None)\n print('re'*10,reuse , self.name)\n stride=[1, self.cnn_stride, self.cnn_stride, 1]\n with tf.variable_scope(self.name):\n Wxi=self._create_weight([self.cnn_si...
[ "0.6922186", "0.65367335", "0.64366126", "0.63553894", "0.6305167", "0.62257314", "0.622233", "0.61745715", "0.6174415", "0.61491495", "0.6138557", "0.6132458", "0.60373294", "0.6020137", "0.6010909", "0.5987085", "0.59538203", "0.593199", "0.59200877", "0.5896787", "0.587656...
0.5749121
34
We receive a Tensor x of shape (N,H,W,D1) (e.g. (12,32,32,3)) and produce a Tensor x_out of shape (N,H,W,D2) (e.g. (12,32,32,100)), where each fiber of the x_out tensor describes the predictive distribution for the RGB at that position. 'h' is an optional N x K matrix of values to condition our generative model on
def h6_noup_spec(x, h=None, init=False, ema=None, dropout_p=0.5, nr_resnet=5, nr_filters=160, nr_logistic_mix=10, resnet_nonlinearity='concat_elu'): counters = {} with arg_scope([nn.conv2d, nn.deconv2d, nn.gated_resnet, nn.dense, nn.nin], counters=counters, init=init, ema=ema, dropout_p=dropout_p): # ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def output(self,x=None,h=None,in_features=0,in_features_h=0,reuse=False):\n assert (x is not None or h is not None)\n print('re'*10,reuse , self.name)\n stride=[1, self.cnn_stride, self.cnn_stride, 1]\n with tf.variable_scope(self.name):\n Wxi=self._create_weight([self.cnn_si...
[ "0.69230336", "0.6537805", "0.64382416", "0.635525", "0.6306979", "0.6226775", "0.62233824", "0.6175592", "0.61741024", "0.61406094", "0.61339223", "0.6036056", "0.6019836", "0.6010514", "0.5987616", "0.5954986", "0.5931938", "0.5922642", "0.5898325", "0.58798784", "0.5870595...
0.6149367
9
We receive a Tensor x of shape (N,H,W,D1) (e.g. (12,32,32,3)) and produce a Tensor x_out of shape (N,H,W,D2) (e.g. (12,32,32,100)), where each fiber of the x_out tensor describes the predictive distribution for the RGB at that position. 'h' is an optional N x K matrix of values to condition our generative model on
def h6_noup_hier2_spec(x, h=None, init=False, ema=None, dropout_p=0.5, nr_resnet=5, nr_filters=160, nr_logistic_mix=10, resnet_nonlinearity='concat_elu'): counters = {} with arg_scope([nn.conv2d, nn.deconv2d, nn.gated_resnet, nn.dense, nn.nin], counters=counters, init=init, ema=ema, dropout_p=dropout_p): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def output(self,x=None,h=None,in_features=0,in_features_h=0,reuse=False):\n assert (x is not None or h is not None)\n print('re'*10,reuse , self.name)\n stride=[1, self.cnn_stride, self.cnn_stride, 1]\n with tf.variable_scope(self.name):\n Wxi=self._create_weight([self.cnn_si...
[ "0.6921387", "0.65356797", "0.6436781", "0.63546544", "0.6304615", "0.6225783", "0.6222132", "0.61737573", "0.61733156", "0.6148549", "0.61379606", "0.6133266", "0.6036522", "0.60192424", "0.6009342", "0.5986379", "0.5954075", "0.5931313", "0.5920249", "0.5897222", "0.5876518...
0.577347
30
We receive a Tensor x of shape (N,H,W,D1) (e.g. (12,32,32,3)) and produce a Tensor x_out of shape (N,H,W,D2) (e.g. (12,32,32,100)), where each fiber of the x_out tensor describes the predictive distribution for the RGB at that position. 'h' is an optional N x K matrix of values to condition our generative model on
def h6_hier4_spec(x, h=None, init=False, ema=None, dropout_p=0.5, nr_resnet=5, nr_filters=160, nr_logistic_mix=10, resnet_nonlinearity='concat_elu'): counters = {} with arg_scope([nn.conv2d, nn.deconv2d, nn.gated_resnet, nn.dense, nn.nin], counters=counters, init=init, ema=ema, dropout_p=dropout_p): #...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def output(self,x=None,h=None,in_features=0,in_features_h=0,reuse=False):\n assert (x is not None or h is not None)\n print('re'*10,reuse , self.name)\n stride=[1, self.cnn_stride, self.cnn_stride, 1]\n with tf.variable_scope(self.name):\n Wxi=self._create_weight([self.cnn_si...
[ "0.6921986", "0.6536957", "0.64371914", "0.63562906", "0.6305824", "0.6226606", "0.6222742", "0.61750877", "0.61491233", "0.6138181", "0.613367", "0.60369533", "0.601945", "0.60106957", "0.5987211", "0.59553665", "0.5931572", "0.592108", "0.5898472", "0.5877079", "0.5869618",...
0.6174537
8
We receive a Tensor x of shape (N,H,W,D1) (e.g. (12,32,32,3)) and produce a Tensor x_out of shape (N,H,W,D2) (e.g. (12,32,32,100)), where each fiber of the x_out tensor describes the predictive distribution for the RGB at that position. 'h' is an optional N x K matrix of values to condition our generative model on
def h6_1mixhier2_spec(x, h=None, init=False, ema=None, dropout_p=0.5, nr_resnet=5, nr_filters=160, nr_logistic_mix=10, resnet_nonlinearity='concat_elu'): counters = {} with arg_scope([nn.conv2d, nn.deconv2d, nn.gated_resnet, nn.dense, nn.nin], counters=counters, init=init, ema=ema, dropout_p=dropout_p): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def output(self,x=None,h=None,in_features=0,in_features_h=0,reuse=False):\n assert (x is not None or h is not None)\n print('re'*10,reuse , self.name)\n stride=[1, self.cnn_stride, self.cnn_stride, 1]\n with tf.variable_scope(self.name):\n Wxi=self._create_weight([self.cnn_si...
[ "0.6922186", "0.65367335", "0.64366126", "0.63553894", "0.6305167", "0.62257314", "0.622233", "0.61745715", "0.6174415", "0.61491495", "0.6138557", "0.6132458", "0.60373294", "0.6020137", "0.5987085", "0.59538203", "0.593199", "0.59200877", "0.5896787", "0.5876563", "0.586909...
0.6010909
14
We receive a Tensor x of shape (N,H,W,D1) (e.g. (12,32,32,3)) and produce a Tensor x_out of shape (N,H,W,D2) (e.g. (12,32,32,100)), where each fiber of the x_out tensor describes the predictive distribution for the RGB at that position. 'h' is an optional N x K matrix of values to condition our generative model on
def h8_noup_124444mix_spec(x, h=None, init=False, ema=None, dropout_p=0.5, nr_resnet=5, nr_filters=160, nr_logistic_mix=10, resnet_nonlinearity='concat_elu'): counters = {} with arg_scope([nn.conv2d, nn.deconv2d, nn.gated_resnet, nn.dense, nn.nin], counters=counters, init=init, ema=ema, dropout_p=dropout_p): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def output(self,x=None,h=None,in_features=0,in_features_h=0,reuse=False):\n assert (x is not None or h is not None)\n print('re'*10,reuse , self.name)\n stride=[1, self.cnn_stride, self.cnn_stride, 1]\n with tf.variable_scope(self.name):\n Wxi=self._create_weight([self.cnn_si...
[ "0.69230336", "0.6537805", "0.64382416", "0.635525", "0.6306979", "0.6226775", "0.62233824", "0.6175592", "0.61741024", "0.6149367", "0.61406094", "0.61339223", "0.6036056", "0.6019836", "0.6010514", "0.5987616", "0.5954986", "0.5931938", "0.5922642", "0.5898325", "0.58798784...
0.5827068
25
We receive a Tensor x of shape (N,H,W,D1) (e.g. (12,32,32,3)) and produce a Tensor x_out of shape (N,H,W,D2) (e.g. (12,32,32,100)), where each fiber of the x_out tensor describes the predictive distribution for the RGB at that position. 'h' is an optional N x K matrix of values to condition our generative model on
def h16_noup_124444mix_spec(x, h=None, init=False, ema=None, dropout_p=0.5, nr_resnet=5, nr_filters=160, nr_logistic_mix=10, resnet_nonlinearity='concat_elu'): counters = {} with arg_scope([nn.conv2d, nn.deconv2d, nn.gated_resnet, nn.dense, nn.nin], counters=counters, init=init, ema=ema, dropout_p=dropout_p): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def output(self,x=None,h=None,in_features=0,in_features_h=0,reuse=False):\n assert (x is not None or h is not None)\n print('re'*10,reuse , self.name)\n stride=[1, self.cnn_stride, self.cnn_stride, 1]\n with tf.variable_scope(self.name):\n Wxi=self._create_weight([self.cnn_si...
[ "0.6921387", "0.65356797", "0.6436781", "0.63546544", "0.6304615", "0.6225783", "0.6222132", "0.61737573", "0.61733156", "0.6148549", "0.61379606", "0.6133266", "0.6036522", "0.60192424", "0.6009342", "0.5986379", "0.5954075", "0.5931313", "0.5920249", "0.5897222", "0.5876518...
0.5762193
32
We receive a Tensor x of shape (N,H,W,D1) (e.g. (12,32,32,3)) and produce a Tensor x_out of shape (N,H,W,D2) (e.g. (12,32,32,100)), where each fiber of the x_out tensor describes the predictive distribution for the RGB at that position. 'h' is an optional N x K matrix of values to condition our generative model on
def h6_noup_124mix_halfattn_spec(x, h=None, init=False, ema=None, dropout_p=0.5, nr_resnet=5, nr_filters=160, nr_logistic_mix=10, resnet_nonlinearity='concat_elu'): counters = {} with arg_scope([nn.conv2d, nn.deconv2d, nn.gated_resnet, nn.dense, nn.nin], counters=counters, init=init, ema=ema, dropout_p=dropout...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def output(self,x=None,h=None,in_features=0,in_features_h=0,reuse=False):\n assert (x is not None or h is not None)\n print('re'*10,reuse , self.name)\n stride=[1, self.cnn_stride, self.cnn_stride, 1]\n with tf.variable_scope(self.name):\n Wxi=self._create_weight([self.cnn_si...
[ "0.6921986", "0.6536957", "0.64371914", "0.63562906", "0.6305824", "0.6226606", "0.6222742", "0.61750877", "0.6174537", "0.61491233", "0.6138181", "0.613367", "0.60369533", "0.601945", "0.60106957", "0.5987211", "0.59553665", "0.5931572", "0.592108", "0.5898472", "0.5877079",...
0.5720627
38
We receive a Tensor x of shape (N,H,W,D1) (e.g. (12,32,32,3)) and produce a Tensor x_out of shape (N,H,W,D2) (e.g. (12,32,32,100)), where each fiber of the x_out tensor describes the predictive distribution for the RGB at that position. 'h' is an optional N x K matrix of values to condition our generative model on
def h6_noup_1mix_halfattn_spec(x, h=None, init=False, ema=None, dropout_p=0.5, nr_resnet=5, nr_filters=160, nr_logistic_mix=10, resnet_nonlinearity='concat_elu'): counters = {} with arg_scope([nn.conv2d, nn.deconv2d, nn.gated_resnet, nn.dense, nn.nin], counters=counters, init=init, ema=ema, dropout_p=dropout_p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def output(self,x=None,h=None,in_features=0,in_features_h=0,reuse=False):\n assert (x is not None or h is not None)\n print('re'*10,reuse , self.name)\n stride=[1, self.cnn_stride, self.cnn_stride, 1]\n with tf.variable_scope(self.name):\n Wxi=self._create_weight([self.cnn_si...
[ "0.6922186", "0.65367335", "0.64366126", "0.63553894", "0.6305167", "0.62257314", "0.622233", "0.61745715", "0.6174415", "0.61491495", "0.6138557", "0.6132458", "0.60373294", "0.6020137", "0.6010909", "0.5987085", "0.59538203", "0.593199", "0.59200877", "0.5896787", "0.587656...
0.5697789
42
We receive a Tensor x of shape (N,H,W,D1) (e.g. (12,32,32,3)) and produce a Tensor x_out of shape (N,H,W,D2) (e.g. (12,32,32,100)), where each fiber of the x_out tensor describes the predictive distribution for the RGB at that position. 'h' is an optional N x K matrix of values to condition our generative model on
def h8_noup_1mix_halfattn_spec(x, h=None, init=False, ema=None, dropout_p=0.5, nr_resnet=5, nr_filters=160, nr_logistic_mix=10, resnet_nonlinearity='concat_elu'): counters = {} with arg_scope([nn.conv2d, nn.deconv2d, nn.gated_resnet, nn.dense, nn.nin], counters=counters, init=init, ema=ema, dropout_p=dropout_p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def output(self,x=None,h=None,in_features=0,in_features_h=0,reuse=False):\n assert (x is not None or h is not None)\n print('re'*10,reuse , self.name)\n stride=[1, self.cnn_stride, self.cnn_stride, 1]\n with tf.variable_scope(self.name):\n Wxi=self._create_weight([self.cnn_si...
[ "0.69230336", "0.6537805", "0.64382416", "0.635525", "0.6306979", "0.6226775", "0.62233824", "0.6175592", "0.61741024", "0.6149367", "0.61406094", "0.61339223", "0.6036056", "0.6019836", "0.6010514", "0.5987616", "0.5954986", "0.5931938", "0.5922642", "0.5898325", "0.58798784...
0.56309116
57
We receive a Tensor x of shape (N,H,W,D1) (e.g. (12,32,32,3)) and produce a Tensor x_out of shape (N,H,W,D2) (e.g. (12,32,32,100)), where each fiber of the x_out tensor describes the predictive distribution for the RGB at that position. 'h' is an optional N x K matrix of values to condition our generative model on
def h8_noup_1mix_halfattn_spec(x, h=None, init=False, ema=None, dropout_p=0.5, nr_resnet=5, nr_filters=160, nr_logistic_mix=10, resnet_nonlinearity='concat_elu'): counters = {} with arg_scope([nn.conv2d, nn.deconv2d, nn.gated_resnet, nn.dense, nn.nin], counters=counters, init=init, ema=ema, dropout_p=dropout_p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def output(self,x=None,h=None,in_features=0,in_features_h=0,reuse=False):\n assert (x is not None or h is not None)\n print('re'*10,reuse , self.name)\n stride=[1, self.cnn_stride, self.cnn_stride, 1]\n with tf.variable_scope(self.name):\n Wxi=self._create_weight([self.cnn_si...
[ "0.6921387", "0.65356797", "0.6436781", "0.63546544", "0.6304615", "0.6225783", "0.6222132", "0.61737573", "0.61733156", "0.6148549", "0.61379606", "0.6133266", "0.6036522", "0.60192424", "0.6009342", "0.5986379", "0.5954075", "0.5931313", "0.5920249", "0.5897222", "0.5876518...
0.56295264
58
We receive a Tensor x of shape (N,H,W,D1) (e.g. (12,32,32,3)) and produce a Tensor x_out of shape (N,H,W,D2) (e.g. (12,32,32,100)), where each fiber of the x_out tensor describes the predictive distribution for the RGB at that position. 'h' is an optional N x K matrix of values to condition our generative model on
def _base_noup_smallkey_spec(x, h=None, init=False, ema=None, dropout_p=0.5, nr_resnet=5, nr_filters=256, attn_rep=12, nr_logistic_mix=10, att_downsample=1, resnet_nonlinearity='concat_elu'): counters = {} with arg_scope([nn.conv2d, nn.deconv2d, nn.gated_resnet, nn.dense, nn.nin], counters=counters, init=init,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def output(self,x=None,h=None,in_features=0,in_features_h=0,reuse=False):\n assert (x is not None or h is not None)\n print('re'*10,reuse , self.name)\n stride=[1, self.cnn_stride, self.cnn_stride, 1]\n with tf.variable_scope(self.name):\n Wxi=self._create_weight([self.cnn_si...
[ "0.6921986", "0.6536957", "0.64371914", "0.63562906", "0.6305824", "0.6226606", "0.6222742", "0.61750877", "0.6174537", "0.61491233", "0.6138181", "0.613367", "0.60369533", "0.601945", "0.60106957", "0.5987211", "0.59553665", "0.5931572", "0.592108", "0.5898472", "0.5877079",...
0.56841415
44
We receive a Tensor x of shape (N,H,W,D1) (e.g. (12,32,32,3)) and produce a Tensor x_out of shape (N,H,W,D2) (e.g. (12,32,32,100)), where each fiber of the x_out tensor describes the predictive distribution for the RGB at that position. 'h' is an optional N x K matrix of values to condition our generative model on
def h6_shift_spec(x, h=None, init=False, ema=None, dropout_p=0.5, nr_resnet=5, nr_filters=160, nr_logistic_mix=10, resnet_nonlinearity='concat_elu'): counters = {} with arg_scope([nn.conv2d, nn.deconv2d, nn.gated_resnet, nn.dense, nn.nin, nn.mem_saving_causal_shift_nin], counters=counters, init=init, ema=ema, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def output(self,x=None,h=None,in_features=0,in_features_h=0,reuse=False):\n assert (x is not None or h is not None)\n print('re'*10,reuse , self.name)\n stride=[1, self.cnn_stride, self.cnn_stride, 1]\n with tf.variable_scope(self.name):\n Wxi=self._create_weight([self.cnn_si...
[ "0.6922186", "0.65367335", "0.64366126", "0.63553894", "0.6305167", "0.62257314", "0.622233", "0.61745715", "0.6174415", "0.61491495", "0.6138557", "0.6132458", "0.60373294", "0.6020137", "0.6010909", "0.59538203", "0.593199", "0.59200877", "0.5896787", "0.5876563", "0.586909...
0.5987085
15
We receive a Tensor x of shape (N,H,W,D1) (e.g. (12,32,32,3)) and produce a Tensor x_out of shape (N,H,W,D2) (e.g. (12,32,32,100)), where each fiber of the x_out tensor describes the predictive distribution for the RGB at that position. 'h' is an optional N x K matrix of values to condition our generative model on
def h6_shift_small_attn_spec(x, h=None, init=False, ema=None, dropout_p=0.5, nr_resnet=5, nr_filters=160, nr_logistic_mix=10, resnet_nonlinearity='concat_elu'): counters = {} with arg_scope([nn.conv2d, nn.deconv2d, nn.gated_resnet, nn.dense, nn.nin, nn.mem_saving_causal_shift_nin], counters=counters, init=init...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def output(self,x=None,h=None,in_features=0,in_features_h=0,reuse=False):\n assert (x is not None or h is not None)\n print('re'*10,reuse , self.name)\n stride=[1, self.cnn_stride, self.cnn_stride, 1]\n with tf.variable_scope(self.name):\n Wxi=self._create_weight([self.cnn_si...
[ "0.69230336", "0.6537805", "0.64382416", "0.635525", "0.6306979", "0.6226775", "0.62233824", "0.6175592", "0.61741024", "0.6149367", "0.61406094", "0.61339223", "0.6036056", "0.6019836", "0.6010514", "0.5987616", "0.5954986", "0.5931938", "0.5922642", "0.5898325", "0.58798784...
0.56743777
45
Returns the distance (in miles) of a zipcode's lat/long to a given target lat/long. This is basically a conversion of the
def distance_to_latlong(self, latlong): EARTH_RADIUS = 3440.07 # in n.miles NAUTICAL_TO_MILE_CONV = 1.15077945 # convert n.miles back to miles d_lat = GeoEntry.degrees_to_radians(latlong[0] - self.latitude) d_long = GeoEntry.degrees_to_radians(latlong[1] - self.longitude) sou...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delta_lat_miles(self, delta_lat):\n\n return delta_lat.dist_from_radius(EARTH_RADIUS)", "def _getDistance(self, source, dest):\n\n lat1 = source[0]\n lat2 = dest[0]\n lon1 = source[1]\n lon2 = dest[1]\n\n # Formula from https://www.movable-type.co.uk/scripts/latlong.html...
[ "0.6809241", "0.6636733", "0.6562211", "0.6506756", "0.64414644", "0.6331296", "0.62305796", "0.61828846", "0.6137437", "0.60768867", "0.605586", "0.6037802", "0.60268843", "0.59899986", "0.59898055", "0.5977019", "0.5975871", "0.5931436", "0.59037864", "0.58821696", "0.58699...
0.58506674
23
Returns the first GeoEntry for this item
def primary_geocode(self): try: return self.geocodes.all()[0] except IndexError: return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_first_item(cls):\n return cls.query.first()", "def first(self):\n try:\n data = self.get_cursor()[0]\n return self.from_(**self.prepare_data(data))\n except IndexError:\n return None", "def at_first(self):\n return self._collection.at_first()...
[ "0.7068188", "0.67877203", "0.6519542", "0.6321493", "0.6205005", "0.6192691", "0.61886513", "0.61693275", "0.612534", "0.61246055", "0.61092746", "0.6098129", "0.6087568", "0.6085564", "0.6019122", "0.59929174", "0.59899896", "0.5988843", "0.5950368", "0.594486", "0.5940951"...
0.6643275
2
Unload a config entry.
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: unload_ok = await hass.config_entries.async_unload_platforms(entry, PLATFORMS) hass.data[DOMAIN].pop(entry.entry_id) return unload_ok
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def async_unload_entry(hass, config_entry):\n unload_ok = await hass.config_entries.async_forward_entry_unload(\n config_entry, \"climate\"\n )\n return unload_ok", "async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:\n hass.data.pop(DOMAIN)\n return True", ...
[ "0.697284", "0.6888074", "0.6779855", "0.6747459", "0.6689002", "0.6657831", "0.66162205", "0.6603433", "0.65595686", "0.65411645", "0.6507643", "0.6507643", "0.6507643", "0.6507643", "0.64977276", "0.64931643", "0.6486601", "0.6486601", "0.6486601", "0.6486601", "0.6469397",...
0.65925974
8
Return the name of the UPS, if available.
def name(self) -> str | None: return self.status.get("UPSNAME")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name(self):\n return self._fetch_element('uname')", "def get_uname(self):\n return Server.t_usernames.get(threading.get_ident())", "def get_name(self):\n\t\treturn call_sdk_function('PrlUsrInfo_GetName', self.handle)", "def sku_name(self) -> pulumi.Output[Optional[str]]:\n return pul...
[ "0.6798469", "0.6518361", "0.64314795", "0.6362053", "0.6136137", "0.6136137", "0.6136137", "0.6136137", "0.6136137", "0.6136137", "0.6136137", "0.6136137", "0.6136137", "0.6136137", "0.6136137", "0.6136137", "0.6136137", "0.6136137", "0.6136137", "0.6136137", "0.6136137", ...
0.7750854
0
Return the model of the UPS, if available.
def model(self) -> str | None: # Different UPS models may report slightly different keys for model, here we # try them all. for model_key in ("APCMODEL", "MODEL"): if model_key in self.status: return self.status[model_key] return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_model():\n return UNISAL", "def model(self) -> Optional[str]:\n return pulumi.get(self, \"model\")", "def model(self) -> Model:\n return self.software_system.get_model()", "def model(self):\n return self._bulb_device.model or self.capabilities.get(\"model\")", "def get_model...
[ "0.7592443", "0.7111528", "0.7107332", "0.6763479", "0.6738299", "0.6687123", "0.6673305", "0.6564778", "0.6556674", "0.654286", "0.65176576", "0.6483393", "0.6472549", "0.6405694", "0.6331578", "0.6318229", "0.6277226", "0.62239903", "0.62133867", "0.6173781", "0.6173781", ...
0.7180954
1
Return the software version of the APCUPSd, if available.
def sw_version(self) -> str | None: return self.status.get("VERSION")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def firmware_version(self):\n return self._get_system_status()[\"firmware\"]", "def get_software_version(self):\n \n try:\n if self.product_info is None:\n self.product_info = self.connection.System.SystemInfo.\\\n get_product_information()\n return se...
[ "0.68811244", "0.68002486", "0.6754691", "0.6664656", "0.66384155", "0.6621512", "0.65219545", "0.6492687", "0.64615965", "0.6440303", "0.642845", "0.637813", "0.6312773", "0.62922263", "0.6276486", "0.6272043", "0.62645924", "0.6261541", "0.6261541", "0.62605745", "0.6227525...
0.607055
33
This function prints and plots the confusion matrix. Normalization can be applied by setting `normalize=True`.
def plot_confusion_matrix(cm, classes, normalize=False, title='Confusion matrix', cmap=plt.cm.Blues, save_name=None): plt.figure(figsize=(9,7)) plt.imshow(cm, interpolation='nearest', cmap=cmap) plt.title(title) if not normalize: plt.colorbar() tick_marks = n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_confusion_matrix(cm, classes=[0,1], normalize=False, title='Confusion matrix', print_matrix=False):\n\n if normalize:\n cm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis]\n print(\"Normalized confusion matrix\")\n else:\n print('Confusion matrix, without normalization')\n\n...
[ "0.81922984", "0.80933887", "0.80272716", "0.8016492", "0.79913706", "0.79885876", "0.79777396", "0.79729784", "0.7958926", "0.7954523", "0.79347897", "0.7931899", "0.7931772", "0.7928666", "0.7923684", "0.7921764", "0.79213995", "0.7920191", "0.792016", "0.7919876", "0.79153...
0.0
-1
The average match between element e and list l
def average_match(e, l, ignore_self=False): # filter out ourself as this will give us a nice 1.0 value # the problem with this is if we are a list of 1, anything will have a better value! if ignore_self: l = [x for x in l if x != e] if len(l) == 0: return 0 values = [pairwise[e][x] f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _avg(cls, l):\n\n return sum(l) / float(len(l))", "def avg(l):\n return (sum(l)/float(len(l)))", "def average(l):\n return float(sum(l)/len(l))", "def average(l: List[float]) -> float:\n n = len(l)\n if n == 0:\n return 0\n return sum(l) / n", "def mean(l):\n return sum(...
[ "0.7323237", "0.72543067", "0.72338676", "0.6918308", "0.67249024", "0.660596", "0.65775806", "0.6564617", "0.6490873", "0.6459218", "0.64541405", "0.64284426", "0.641007", "0.6399266", "0.63732046", "0.63693213", "0.63317555", "0.6285568", "0.6267318", "0.6220722", "0.620009...
0.86395854
0
extract just english word from list of known words from wordsfromtext
def extract_from_full_text(input_file, output_file): fw = open(output_file, 'w') with open(input_file, 'r') as f: st = f.readline() while st: word = st.split('\t')[0] + "\n" if word.startswith("to ") or word.startswith("an ") or word.startswith("at ") or word.startswith("...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def translationText(language, listOfWords):\n txt = open(language+\".txt\", mode=\"r\").readlines()\n translatedWords = []\n for word in listOfWords:\n for line in txt:\n if line.split()[0] == word:\n translatedWords.append(line.split()[1])\n return translatedWords", ...
[ "0.6835663", "0.67471445", "0.656208", "0.6523616", "0.65070236", "0.640864", "0.6370447", "0.6359342", "0.632768", "0.63201743", "0.6309366", "0.62989146", "0.62721777", "0.62676257", "0.6265496", "0.6265241", "0.625814", "0.6245546", "0.6228016", "0.62129444", "0.62129444",...
0.0
-1
True if Record only updated else False
def _rec_only_updated(cls, rec): return rec.get('uplinked', None) \ and not rec.get('queued', None) \ and not rec.get('announced', None) \ and not rec.get('blocked', None) \ and not rec.get('finished', None) \ and not rec.get('aborted', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _can_update(self):\r\n if not self._is_persisted: return False\r\n pks = self._primary_keys.keys()\r\n return all([not self._values[k].changed for k in self._primary_keys])", "def is_update(self) -> bool:\n return self.statement.is_dml and self.statement.is_update", "def is_upda...
[ "0.7986013", "0.76238704", "0.7371702", "0.72888345", "0.7156675", "0.7072094", "0.69765824", "0.6966177", "0.68576854", "0.68549925", "0.6848655", "0.68164325", "0.6786486", "0.67811877", "0.671708", "0.6713267", "0.6713235", "0.6713235", "0.66752625", "0.6605297", "0.658017...
0.7251112
4
Test expire attribute of keystone trust To check we can create, get and delete a trust with an expiry specified
def test_trust_expire(self): expires_at = timeutils.utcnow() + datetime.timedelta(hours=1) # NOTE(ylobankov) In some cases the expiry time may be rounded up # because of microseconds. In fact, it depends on database and its # version. At least MySQL 5.6.16 does this. # For exampl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_trust_expire_invalid(self):\n # with an expiry specified\n expires_str = 'bad.123Z'\n self.assertRaises(lib_exc.BadRequest,\n self.create_trust,\n expires=expires_str)", "def test_old_expiration(self):\n created = datetime.dat...
[ "0.705438", "0.70393634", "0.6361943", "0.6234782", "0.62211275", "0.6187461", "0.61786264", "0.6124953", "0.61193806", "0.6075685", "0.6060071", "0.6049344", "0.60356283", "0.6032782", "0.6003587", "0.6001274", "0.5968162", "0.5937886", "0.58728033", "0.58564425", "0.5843178...
0.82754344
0
Test invalid expire attribute of a keystone trust To check an invalid expiry time is rejected with the correct error
def test_trust_expire_invalid(self): # with an expiry specified expires_str = 'bad.123Z' self.assertRaises(lib_exc.BadRequest, self.create_trust, expires=expires_str)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_trust_expire(self):\n expires_at = timeutils.utcnow() + datetime.timedelta(hours=1)\n # NOTE(ylobankov) In some cases the expiry time may be rounded up\n # because of microseconds. In fact, it depends on database and its\n # version. At least MySQL 5.6.16 does this.\n # ...
[ "0.76420605", "0.6955193", "0.6892389", "0.6788747", "0.6741118", "0.66600645", "0.6657186", "0.6599759", "0.6581856", "0.65801847", "0.6541665", "0.6508803", "0.64553815", "0.6389159", "0.623922", "0.62222064", "0.62217593", "0.6209053", "0.6202504", "0.6197864", "0.6170854"...
0.8002161
0
comparing raw beta coefficients with converted coefficients
def compare_coefficients1(): directory = "C:\\Users\\Casper\\Projects\\MasterScriptie\\custom_projects\\editing\\PHT_Preprocessing\\out\\{}\\data.csv".format(dataset) X = pd.read_csv(directory)[var_list].to_numpy()[:datapoints_amount] y = np.squeeze(pd.read_csv(directory)[target_list].to_numpy())[:datapoin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _beta(self):\n return _handle_ab(self.solution, self.use_const)[1]", "def beta_inversion(self) -> 'Nparray':\n return numpy.flip(self.coeff, 1)", "def get_beta(self):\n\n return np.matmul(self.rotation_x, self.beta_z)", "def beta_model(r, s0, rc, beta, c):\n return s0 * np.power((...
[ "0.6432651", "0.632984", "0.61856174", "0.6176411", "0.6168079", "0.61566246", "0.6099602", "0.6099602", "0.6065808", "0.6064115", "0.60349864", "0.602172", "0.5998756", "0.5993853", "0.59352183", "0.59051913", "0.5889469", "0.58875835", "0.5876231", "0.5876231", "0.58678025"...
0.5880419
18
Sets the age of this UserAttributeInfo.
def age(self, age): self._age = age
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_age(self, age):\n self.__age = age", "def setAge(self, age):\n self._age = age", "def set_age(self, age):\n self.age = float(age)", "def set_age(self, newage):\n self.age = newage", "def setAge(self, age):\r\n self.age = age", "def set_age (self, PersonAge): \r...
[ "0.8046626", "0.79425937", "0.78135836", "0.75763774", "0.7537269", "0.6990783", "0.6981741", "0.67913485", "0.6778095", "0.66316676", "0.6576603", "0.6442338", "0.62151283", "0.61667544", "0.61616886", "0.61466616", "0.6099867", "0.6098713", "0.6087365", "0.6087365", "0.6087...
0.7825951
2
Sets the gender of this UserAttributeInfo.
def gender(self, gender): self._gender = gender
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gender(self, gender):\n if gender is None:\n raise ValueError(\"Invalid value for `gender`, must not be `None`\") # noqa: E501\n\n self._gender = gender", "def gender(self, gender: str):\n allowed_values = [\"male\", \"female\", \"unknown\"] # noqa: E501\n if gender n...
[ "0.72654545", "0.7138158", "0.7074146", "0.6747392", "0.6733915", "0.6545777", "0.6297324", "0.6181584", "0.6181584", "0.6125998", "0.6005281", "0.6005281", "0.5961013", "0.5916737", "0.58897066", "0.5794975", "0.5779791", "0.5710898", "0.57074", "0.5702526", "0.5688415", "...
0.7550479
0
Sets the kind_of_occupation of this UserAttributeInfo.
def kind_of_occupation(self, kind_of_occupation): self._kind_of_occupation = kind_of_occupation
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def occupation(self, occupation):\n\n self.logger.debug(\"In 'occupation' setter.\")\n\n self._occupation = occupation", "def occupation(self, occupation):\n\n self._occupation = occupation", "def set_occupant(self):\n\t\tself.occupant = 1", "def occupancy(self, occupancy):\n\n se...
[ "0.6668816", "0.61829704", "0.6128028", "0.60236096", "0.5803827", "0.528048", "0.5243633", "0.5243633", "0.5222969", "0.4781997", "0.47334972", "0.45834523", "0.45449778", "0.45285857", "0.4449435", "0.44349867", "0.43956617", "0.43252727", "0.42954662", "0.42841992", "0.427...
0.83874065
0
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, UserAttributeInfo): return False return self.__dict__ == other.__dict__
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False", "def __eq__(self, other):\n if i...
[ "0.8088132", "0.8088132", "0.8054589", "0.7982687", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", ...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): return not self == other
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other) -> bool:\n return not self.__eq__(other)", "def __eq__(self, other):\n ...
[ "0.8457179", "0.8393067", "0.81457263", "0.8140635", "0.8133462", "0.8094992", "0.8093376", "0.8093376", "0.8093376", "0.80863357", "0.80863357", "0.8077303", "0.8077303", "0.8066831" ]
0.0
-1
Retrieves annotations for the dataset, scales them in accordance to how their images would be scaled in prediction, filters out unusually sized annotations, then returns annotations that made it through filtering
def get_filtered_dataset_annotations(config): images_filenames = net.data.get_dataset_filenames( config["voc"]["data_directory"], config["voc"]["validation_set_path"]) annotations_paths = [os.path.join(config["voc"]["data_directory"], "Annotations", image_filename + ".xml") fo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter_data(self):\n if(self.filter_classes == []):\n return\n \n filtered_idx = []\n for id in range(len(self.image_ids)):\n anns = self.load_annotations(id)\n found = False\n for ann in anns:\n if ann['label'] in self.filt...
[ "0.6501151", "0.60717905", "0.6049101", "0.5881259", "0.5833673", "0.5766674", "0.57628673", "0.5735939", "0.57338", "0.57286364", "0.56987554", "0.5685533", "0.5617301", "0.5591656", "0.5579055", "0.5575221", "0.5574671", "0.55325156", "0.5529613", "0.55232006", "0.5514214",...
0.769257
0
Get base64 encoded data as a string for the given image file's full image, for use directly in HTML tags, or a path to the original if image scaling is not supported. This is a fullsized version of _get_thumbnail_src_from_file, for use in image formats which cannot be displayed directly inbrowser, and therefore need pr...
def _get_image_src_from_file(dir_path, image_file, force_no_processing=False): # If we've specified to force no processing, just return the image filename if force_no_processing: if image_file.endswith('tif') or image_file.endswith('tiff'): return UNSUPPORTED_IMAGE_TYPE_DATA return i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_thumbnail_src_from_file(dir_path, image_file, force_no_processing=False):\n # If we've specified to force no processing, just return the image filename\n if force_no_processing:\n if image_file.endswith('tif') or image_file.endswith('tiff'):\n return UNSUPPORTED_IMAGE_TYPE_DATA\n ...
[ "0.68918973", "0.64814484", "0.6027982", "0.5799965", "0.5695037", "0.56150395", "0.55625266", "0.5519719", "0.5267955", "0.5106685", "0.5084914", "0.5075221", "0.5073615", "0.50000197", "0.49826473", "0.4945554", "0.49359715", "0.49057618", "0.48910433", "0.4792614", "0.4785...
0.6665792
1
Prints a confusion matrix, as returned by sklearn.metrics.confusion_matrix, as a heatmap. Arguments
def draw_confusion_matrix(confusion_matrix, class_names=['true', 'false'], figsize = (10,7), fontsize=21): df_cm = pd.DataFrame( confusion_matrix, index=class_names, columns=class_names, ) fig = plt.figure(figsize=figsize) try: heatmap = sns.heatmap(df_cm, annot=True, fmt="d") excep...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def showConfusionMatrix(self): \r\n sn.heatmap(self.conf_matrix, annot=True)\r\n plt.plot( label=\"Accuracy\")\r\n plt.plot( label=\"Error\")\r\n plt.figtext(0,0,'Accuracy: {}\\nError: {}\\nRecall: {}\\nPrecision: {}'.format(self.accuracy,\r\n ...
[ "0.80746675", "0.8072156", "0.79859334", "0.7981922", "0.79757917", "0.79166806", "0.79040253", "0.7781744", "0.7653195", "0.75897807", "0.7548519", "0.74892145", "0.74433804", "0.7427196", "0.7424749", "0.7406628", "0.74035", "0.7401467", "0.73854214", "0.7385104", "0.737896...
0.7602857
9
Return a Unicode string of one character
def ck(value): return chr(value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unicode_char(n):\n try:\n return unichr(n)\n except ValueError:\n # Generate bytes object packed as int.\n bytes_object = struct.pack('i', n)\n # Return decoded w/ utf-32 codec.\n return bytes_object.decode('utf-32')", "def character(m) -> str:\n return m[0]", "d...
[ "0.6981719", "0.6789666", "0.6635078", "0.6498664", "0.6492068", "0.634446", "0.6335999", "0.63319594", "0.63219506", "0.6296408", "0.62885904", "0.6270391", "0.6245329", "0.6245192", "0.6219171", "0.6214642", "0.62140745", "0.62100077", "0.6179904", "0.61599255", "0.6124931"...
0.59720284
31
Copies tensor contents (.data) from src_model.named_parameters to dst_model.named_parameters. Modifies dst_model.
def copy_model(dst_model, src_model, const=0.0): params_dst = dst_model.named_parameters() params_src = src_model.named_parameters() dict_params_dst = dict(params_dst) with torch.no_grad(): for name, param in params_src: if name in dict_params_dst: # NOTE: Must a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def copy_optimizer_params_to_model(named_params_model, named_params_optimizer):\n for (name_opti, param_opti), (name_model, param_model) in zip(named_params_optimizer, named_params_model):\n if name_opti != name_model:\n logger.error(\"name_opti != name_model: {} {}\".format(name_opti, name_mo...
[ "0.6600991", "0.6600991", "0.6446141", "0.64447147", "0.62272596", "0.6140955", "0.6115631", "0.6104872", "0.60341483", "0.60174316", "0.60174316", "0.5976872", "0.5879609", "0.5872968", "0.56935495", "0.56794345", "0.56777185", "0.5673263", "0.56378424", "0.55870456", "0.553...
0.7697214
0
Overloads '==' such that two boardState with the same configuration are equal.
def __eq__(self, other): for row in range( self.n ): if self.board[row] != other.board[row]: return False return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n\n return self.board == other.board", "def __eq__(self, other):\n if self is other:\n return True\n elif type(self) != type(other):\n return False\n else:\n # A node is considered equal if it has the exact same state as\n ...
[ "0.7479057", "0.74159193", "0.7405497", "0.7401591", "0.7083626", "0.6939768", "0.6875645", "0.67916983", "0.6781389", "0.6759406", "0.67023355", "0.6688895", "0.6688895", "0.66887134", "0.66699946", "0.6667692", "0.6656015", "0.664923", "0.66363364", "0.6615392", "0.65582603...
0.69975585
5
Control whether time values are converted to UTC during input.
def PreserveInputTimeZone (value=None): global _PreserveInputTimeZone if value is None: return _PreserveInputTimeZone if not isinstance(value, bool): raise TypeError(value) _PreserveInputTimeZone = value return _PreserveInputTimeZone
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ensure_utc_time(ts: datetime) -> datetime:\n if ts.tzinfo is None:\n return datetime(*ts.timetuple()[:6], tzinfo=UTC_TZ)\n elif str(ts.tzinfo) != str(UTC_TZ):\n return ts.astimezone(UTC_TZ)\n return ts", "def may_the_timezone_be_with_it(self):\n self.timestamp = pytz.utc.localiz...
[ "0.65897787", "0.6476876", "0.6274298", "0.6274298", "0.6262503", "0.6131316", "0.6102213", "0.60947984", "0.60756093", "0.60754275", "0.6054765", "0.60107285", "0.60106236", "0.59857893", "0.59718764", "0.59154785", "0.58872074", "0.5818463", "0.58158404", "0.58127505", "0.5...
0.59783536
14
Initialize a new affine link.
def __init__(self, parent_dim: int, child_dim: int) -> None: super().__init__(parent_dim, child_dim) self._tf_matrix = None self._inverse_tf_matrix = None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, m, g, l):\n\n AffineDynamics.__init__(self)\n SystemDynamics.__init__(self,n=2,m=1)\n self.m, self.g, self.l = m, g, l", "def __init__(self, alphabet, m, b):\n # We're cheating here by not actually having the decryption method use the \"inverse\" argument\n t...
[ "0.59904724", "0.5952085", "0.57559216", "0.57390183", "0.5552762", "0.54764324", "0.5431786", "0.5423989", "0.5357004", "0.534653", "0.5322", "0.5314095", "0.5305309", "0.5291711", "0.52915525", "0.52627045", "0.5253761", "0.52251256", "0.52157235", "0.5196", "0.5188665", ...
0.0
-1
As 1D Numpy arrays are Fcontiguous and Ccontiguous, we should expect this to work on all variants of vector. Arrays containing float32 and int32 should be automatically upcast to float64 and int64.
def test_sum_vec(self): self.init() assert sum_vec(self.i32_1) == np.sum(self.i32_1) assert sum_vec(self.fi32_1) == np.sum(self.i32_1) assert sum_vec(self.i64_1) == np.sum(self.i64_1) assert sum_vec(self.fi64_1) == np.sum(self.i64_1) assert sum_vec(self.f32_1) == np.sum(s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test01(self):\n a = np.array([], dtype='i4')\n ac = bcolz.carray([], dtype='f4')\n self.assertTrue(ac.dtype == np.dtype('f4'))\n a = a.astype('f4')\n self.assertTrue(a.dtype == ac.dtype)\n self.assertTrue(np.all(a == ac))", "def test00(self):\n a = np.arange(1...
[ "0.6368014", "0.6263", "0.6262739", "0.6114204", "0.6090848", "0.6073458", "0.60449344", "0.60305834", "0.60265625", "0.6006793", "0.5996239", "0.59918946", "0.59901917", "0.59753215", "0.59600115", "0.59503555", "0.5905546", "0.58996606", "0.5898873", "0.5857445", "0.5845713...
0.0
-1
Confusuion matrix with plot_confusion_matrix.
def plot_cf_matrix(clf, X, y, label_names, dataset_name, clf_name, fname): _, ax = plt.subplots(figsize=(20,20)) plot_confusion_matrix(clf, X, y, ax=ax, normalize='true', cmap='Blues', display_labels=label_names, values_format='.1%') plt.title('Confusion Matrix - %s - %s'%(dataset_name, clf_name)) p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_confusion_matrix(self):\r\n interp = ClassificationInterpretation.from_learner(self.learn)\r\n interp.plot_confusion_matrix()", "def plot_confusion_matrix(self, canvas):\n\t\tclasses = self.classes_\n\t\tnum_classes = self.num_classes_\n\t\tcm = self.confusion_matrix_\n\n\t\trcParams.updat...
[ "0.82708395", "0.79959375", "0.7901598", "0.78906447", "0.78438455", "0.7828694", "0.7781336", "0.7767762", "0.77563465", "0.77306575", "0.7724769", "0.77233046", "0.77116877", "0.7711209", "0.7695558", "0.7687695", "0.76708513", "0.76426786", "0.76390827", "0.7629686", "0.76...
0.0
-1
Returns the TOTAL unique labels, names and values as dictionary.
def unique_labels(y_test, y_pred_test, class_map): labels = {} labels['label_values'] = np.unique(np.concatenate((y_test, y_pred_test))) # Find the TOTAL number of unique labels. ul_named = [] for i in labels['label_values']: ul_named.append(class_map[i]) labels['label_names'] = ul_n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getClassCounts(column, uniqueVal, decision, yes, no , total):\r\n dataDict = {} # a dictionary of labels\r\n for val in uniqueVal:\r\n label1 = val + '/Y'\r\n label2 = val + '/N'\r\n dataDict[label1] = 0; dataDict[label2] = 0\r\n for dec, at in zip(decision, column):\r\n ...
[ "0.6614229", "0.632657", "0.6153204", "0.61491334", "0.60475945", "0.5961878", "0.59409237", "0.5925841", "0.59219086", "0.5914032", "0.58840346", "0.5880378", "0.5797593", "0.57560533", "0.5736972", "0.5724707", "0.57198054", "0.5695395", "0.56921494", "0.56795925", "0.56795...
0.596564
5
Bar graph of important_features.
def plot_bar_important_features(important_features, title, xlabel, ylabel, fname): plt.figure(figsize=(20, 21)) plt.barh(important_features.index.astype(str).tolist(), important_features.values.tolist()) plt.title(title) plt.xlabel(xlabel) plt.ylabel(ylabel) plt.savefig(fname, bbox_inches=...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fiPlot(rf):\n\tfi = rf.feature_importances_\n\tprint(len(fi))\n\tfi = 100* (fi/fi.max())\n\tsorted_idx = np.argsort(fi)\n\tpos = np.arange(len(fi))\n\tprint(pos)\n\tplt.figure()\n\tplt.barh(pos,fi[sorted_idx],align='center')\n\tplt.savefig('featureImporances.png')", "def plot_feature_importance_tree(model, d...
[ "0.61966157", "0.61267644", "0.6099389", "0.60860246", "0.6058204", "0.60514045", "0.60192865", "0.59646994", "0.5918436", "0.5895576", "0.5854545", "0.5843319", "0.58293533", "0.5828626", "0.58258826", "0.57950276", "0.57308614", "0.56841874", "0.5674917", "0.5626149", "0.56...
0.7246747
0
Returns the trained model for ExtraTreeClassifier. Returns the model object.
def ETC_train(X, y, n_trees): start_time = time.time() print('\n'+ '# '*10+'[Training] ExtraTreeClassifier Model (ETC):'+ ' #'*10) clf = ExtraTreesClassifier(n_estimators=n_trees).fit(X, y) print('> '*2+'Training time: %.4f seconds.'%(time.time()-start_time)) return clf
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_model(cls) -> Classifier:\n if cls.model is None:\n cls.model = Classifier.load(model_path)\n return cls.model", "def get_model(cls):\n if cls.model == None:\n # with open(os.path.join(model_path, 'classify-model'), 'rb') as inp:\n # cls.model = p...
[ "0.6880865", "0.68403023", "0.6522027", "0.6447222", "0.6429064", "0.6376616", "0.63595235", "0.62752265", "0.62680036", "0.6258309", "0.6256516", "0.62408525", "0.6216787", "0.61928344", "0.61928344", "0.61928344", "0.61928344", "0.61928344", "0.61928344", "0.61928344", "0.6...
0.0
-1
Bar plot of attack frequencies.
def plot_bar_label_frequency(af, title, xlabel, ylabel, fname): plt.figure(figsize=(20, 12)) vals, keys = (list(t) for t in zip(*sorted(zip(af.values(), af.keys()), reverse=True))) plt.bar(keys, vals) plt.title(title) plt.xlabel(xlabel) plt.ylabel(ylabel) plt.savefig(fname, bbox_inche...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def barGraph(listOfWord, listOfFrequency):\r\n\r\n\tindex = np.arange(len(listOfWord))\r\n\r\n\tplt.title(\"Frekuensi Kemunculan Kata\")\r\n\tplt.barh(index, listOfFrequency)\r\n\tplt.xlabel('Frekuensi')\r\n\tplt.yticks(index, listOfWord, fontsize=6)\r\n\r\n\tplt.show()", "def compte(df):\n\n df.value_counts(...
[ "0.7295492", "0.7154516", "0.6867921", "0.6851196", "0.66546804", "0.6627767", "0.6623599", "0.65982413", "0.6547437", "0.6418538", "0.63651955", "0.6357675", "0.63128626", "0.62808484", "0.6279252", "0.62267673", "0.61842394", "0.61828065", "0.6168497", "0.61652505", "0.6125...
0.6360588
11
Getter of the heading direction of the mobile node
def direction(self) -> int: return self._direction
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_direction(self):\n return self.direction", "def get_direction(self):\r\n return self.__direction", "def direction(self) -> str:\n return pulumi.get(self, \"direction\")", "def heading(self):\n return float(self._turtle.heading())", "def getDirection(self):\n retur...
[ "0.6913116", "0.6911937", "0.68157023", "0.66711414", "0.6668211", "0.66176206", "0.65407693", "0.65374434", "0.65374434", "0.65320116", "0.6508355", "0.64949626", "0.64949626", "0.6446007", "0.6440035", "0.6393093", "0.63878495", "0.6385621", "0.63719267", "0.6368796", "0.63...
0.6611436
6
Test user can change there password given correct credentials.
def test_user_can_reset_password(self): self.client().post('/api/v1/auth/signup', data=self.user_data) login_response = self.client().post('/api/v1/auth/login', data=self.user_data) #Define header dictionary access_token = json.loads(login_response.data.decode())['access_token'] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def testEditPassword(self):\n self._login_user('eschoppik','secret')\n response = self.client.post('/users/1/edit_password?_method=PATCH',\n data=dict(new_password='newpass', confirm_password='newpass',\n old_password='secret'), follow_redirects=True)\n user = User.query....
[ "0.8387366", "0.8273181", "0.82580954", "0.82573336", "0.8111026", "0.80522466", "0.80512476", "0.8036054", "0.7981904", "0.7967047", "0.79532224", "0.7946084", "0.79417276", "0.79119796", "0.7894856", "0.7874406", "0.78626597", "0.7799793", "0.77886444", "0.7741032", "0.7737...
0.0
-1
Test user cannot change there password given incorrect credentials.
def test_user_cannot_reset_password_with_invalid_credential(self): self.client().post('/api/v1/auth/signup', data=self.user_data_2) login_response = self.client().post('/api/v1/auth/login', data=self.user_data_2) self.assertEqual(login_response.status_code, 200) #Define header dictionary...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_change_password_invalid_input(self):\n role = Role.query.filter_by(name=\"Event Organizer\").first()\n user = TestModelFactory.create_user(password=\"password\")\n user.role = role\n db.session.add(user)\n db.session.commit()\n\n # log the user in\n with se...
[ "0.8344508", "0.8227721", "0.8069029", "0.7859477", "0.77711433", "0.7754527", "0.7754513", "0.77456796", "0.77145076", "0.77042544", "0.76918054", "0.7684554", "0.7639732", "0.76393086", "0.76319546", "0.76255435", "0.75929254", "0.7586937", "0.7572139", "0.7557266", "0.7518...
0.7074642
59
Compute and return second term in equations (1a) and (1b), pages 2981 and 2982, respectively.
def _compute_linear_magnitude_term(self, C, mag): if mag <= self.c1: # this is the second term in eq. (1a), p. 2981 return C['a2'] * (mag - self.c1) else: # this is the second term in eq. (1b), p. 2982 return C['a3'] * (mag - self.c1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def f1(x, a, b):\n #return x**43 - b*x**42 + x**7 - x**6 * a + 84*x - 42 * b - 42 * a\n return (x**42 + 42)/(x-a) + (x**6 + 42)/(x-b)", "def solve_part_two(self):\n return self.outputs[0] * self.outputs[1] * self.outputs[2]", "def get_eqn(p0, p1):\n m = (p0[1] - p1[1]) / (p0[0] - p1[0])\n re...
[ "0.68060184", "0.65656865", "0.63798225", "0.61716384", "0.61596125", "0.6113771", "0.6104993", "0.6048852", "0.5961436", "0.5933066", "0.5931923", "0.5909362", "0.5907451", "0.5894119", "0.588622", "0.58846784", "0.58846784", "0.58785844", "0.587436", "0.58709025", "0.587090...
0.0
-1
Compute and return fifth and sixth terms in equations (1a) and (1b), pages 2981 and 2982, respectively.
def _compute_faulting_style_term(self, C, rake): Fn = float(rake > -135.0 and rake < -45.0) Fr = float(rake > 45.0 and rake < 135.0) return C['a8'] * Fn + C['a9'] * Fr
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def f1(x, a, b):\n #return x**43 - b*x**42 + x**7 - x**6 * a + 84*x - 42 * b - 42 * a\n return (x**42 + 42)/(x-a) + (x**6 + 42)/(x-b)", "def fk4_e_terms(equinox):\n # Constant of aberration at J2000; from Explanatory Supplement to the\n # Astronomical Almanac (Seidelmann, 2005).\n k = 0.0056932 #...
[ "0.62776214", "0.57550514", "0.5710625", "0.5685173", "0.5644006", "0.56377876", "0.5613574", "0.5564507", "0.5563757", "0.5518748", "0.5492842", "0.54648894", "0.5455627", "0.54468983", "0.54450107", "0.54389507", "0.54389507", "0.5408691", "0.54071", "0.54068834", "0.538812...
0.0
-1
Randomly yield batches of X and y
def iterate_minibatches(X_,y_,batchsize_,shuffle_=True): indx = [i for i in range(len(X_))] random.shuffle(indx) indxgenerator = (i for i in indx) del indx while True: batch_indx = list(islice(indxgenerator, batchsize_)) if len(batch_indx)==0: break; else: yield X_[batch_indx,:], y_[batch_indx]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generator_fit(x, y, batch_size=128):\n while True:\n indices = np.random.randint(x.shape[0], size=batch_size)\n yield x[indices], y[indices]", "def data_generator(batch_size, preprocessor, x, y):\n num_examples = len(x)\n examples = zip(x, y)\n examples = sorted(examples, key = lamb...
[ "0.8102598", "0.7497912", "0.7426132", "0.7418483", "0.73041105", "0.729609", "0.726817", "0.72420704", "0.72221965", "0.7191191", "0.7181314", "0.7178134", "0.71672285", "0.7161413", "0.71067333", "0.7098469", "0.70536226", "0.7050799", "0.7034455", "0.6998355", "0.69340634"...
0.73783875
4
Function that load the json file into a DF
def loadDbIntoDf2(content): #Loading data into DF if content == 'trending': file = 'dataVideo.txt' elif content == 'music': file = 'dataVideoChallenge.txt' else: file = 'dataVideo.txt' with open(file,'r') as f: videos_dict = json.load(f) df = pd.DataFrame.from_dic...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_json(json_path):\n\n try:\n # Tries to read .txt file into a dataframe\n json = pd.read_json(json_path, orient='split')\n\n except FileNotFoundError as e:\n # If file is not found, handle the exception and exit\n logger.error(e)\n raise\n\n # Expand features nes...
[ "0.7783085", "0.75122184", "0.75068754", "0.72513676", "0.71889156", "0.7177498", "0.7133485", "0.70301545", "0.6927182", "0.68080705", "0.6770366", "0.6767116", "0.67648065", "0.6737377", "0.67067677", "0.67050356", "0.6703312", "0.66619307", "0.6603169", "0.6596455", "0.655...
0.6146859
46
Takes `config` loaded from a config file and the environment name `env`. If "common" and `env` are keys in `config`, return config['common'].update(config[env]) (i.e. the common config updated with environmet specific config) If one of env or common exists, return that config. Otherwise just return the whole of `config...
def _merge(config, env): if 'common' in config and env in config: c = config['common'].copy() c.update(config[env]) elif env in config.keys(): c = config[env] elif 'common' in config.keys(): c = config['common'] else: c = config return c
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def config_merge(env, config_file=None):\n c = _load_yaml(config_file)\n config = {}\n if c:\n merged = _merge(c, env)\n config.update(merged)\n else:\n config.update({})\n\n return config", "def config_load(env, config_file=None, config_dir=None):\n config = {}\n conf_f...
[ "0.72116333", "0.6707724", "0.6605182", "0.6494771", "0.6290813", "0.6094182", "0.59856087", "0.59761506", "0.596723", "0.58553874", "0.5818631", "0.5818631", "0.57929343", "0.5714224", "0.5639234", "0.5559711", "0.5559711", "0.5541555", "0.5516104", "0.54477394", "0.54300416...
0.83804864
0
Get region name from AWS_CREDENTIALS_FILE Return region name
def get_region_name(profile): if os.path.isfile(AWS_CREDENTIALS_FILE): boto.config.load_credential_file(AWS_CREDENTIALS_FILE) if boto.config.get(profile, 'region'): return boto.config.get(profile, 'region') else: return None return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_region(self):\n return self.creds.get('region_name')", "def load_aws_region_name() -> str:\n session = boto3.session.Session()\n region_name = (\n click.get_current_context().params.get(\"region\") or session.region_name\n )\n return region_name", "def get_default_region_name(...
[ "0.7883975", "0.74577886", "0.69833905", "0.6812064", "0.6812064", "0.6812064", "0.6812064", "0.6812064", "0.6812064", "0.6763036", "0.66353065", "0.66353065", "0.66353065", "0.66353065", "0.6548983", "0.6548983", "0.6548983", "0.6548983", "0.6548983", "0.6548983", "0.6522817...
0.7957335
0
Get default region name from AWS_CONFIG_FILE Return region name
def get_default_region_name(): if os.path.isfile(AWS_CONFIG_FILE): boto.config.load_credential_file(AWS_CONFIG_FILE) if boto.config.get('default', 'region'): return boto.config.get('default', 'region') else: return None return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_aws_region_name() -> str:\n session = boto3.session.Session()\n region_name = (\n click.get_current_context().params.get(\"region\") or session.region_name\n )\n return region_name", "def get_region_name(profile):\n if os.path.isfile(AWS_CREDENTIALS_FILE):\n boto.config.load...
[ "0.75335234", "0.74365026", "0.73091555", "0.70249677", "0.6990575", "0.6990575", "0.6990575", "0.6990575", "0.69506335", "0.6903807", "0.6882814", "0.6789546", "0.6789546", "0.6789546", "0.67568266", "0.6738965", "0.6738965", "0.6738965", "0.6738965", "0.6738965", "0.6738965...
0.85865796
0
Returns a set of words in text
def create_vocab(): cutoff = CUTOFF lines = open(INFNAME_FORMAT.format("train")).readlines() \ + open(INFNAME_FORMAT.format("test")).readlines() raw = [process_line(l) for l in lines] cntx = Counter( [ w for e in raw for w in e ] ) vocab = { x for x, y in cntx.items() if y > cu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def words(self, text):\n return re.findall(r'\\w+', text)", "def get_words(text):\n return re.compile('\\w+').findall(text)", "def getWords(self, text):\n\t\ttextWithoutPunctuation = self.removePunctuation(text)\n\t\treturn [word for word in textWithoutPunctuation.split() if len(word) >= 1]", "def ...
[ "0.8480666", "0.8362471", "0.8237347", "0.7916631", "0.7866578", "0.78540087", "0.7701105", "0.7587534", "0.7495083", "0.7457667", "0.7349655", "0.732301", "0.73110855", "0.7284656", "0.72348416", "0.72251976", "0.7200011", "0.7191169", "0.7182197", "0.71798337", "0.71731615"...
0.0
-1
Returns list of tokens in tweet
def process_line(line): [label, text] = line.split('\t') return text.split()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tokenize(self):\n tknzr = TweetTokenizer()\n tkn = []\n for tweet in self.tweets:\n for word in tknzr.tokenize(tweet):\n tkn.append(word)\n return tkn", "def extract_content(tweets):\n result = []\n for t in tweets:\n text = t.text\n r...
[ "0.81322104", "0.7403063", "0.72792786", "0.71456033", "0.710791", "0.7082351", "0.7082351", "0.6920564", "0.6861611", "0.68576884", "0.6855557", "0.68448097", "0.67710644", "0.66728836", "0.66594124", "0.6644768", "0.66432315", "0.6629306", "0.6613527", "0.6602321", "0.65744...
0.0
-1
The name of the harnessed job.
def getJobName(): return os.environ['LCATR_JOB']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def job_name(self) -> str:\n return self._step_execution_context.job_name", "def name(self):\n return self._job", "def job_name(self) -> str:\n return pulumi.get(self, \"job_name\")", "def get_job_name(self) -> Text:\n return self._job_name", "def jobName(self):\n return f\"{self...
[ "0.83226025", "0.8280865", "0.82409084", "0.7978342", "0.7903301", "0.7872536", "0.7855597", "0.7360369", "0.7360369", "0.73413205", "0.7278596", "0.72147155", "0.7062553", "0.70058864", "0.6950111", "0.6829364", "0.68245375", "0.66794544", "0.6585529", "0.65417814", "0.65115...
0.7076039
12
Full path of the harnessed job scripts.
def getJobDir(jobName=None): if jobName is None: jobName = getJobName() return os.path.join(os.environ['LCATR_INSTALL_AREA'], jobName, os.environ['LCATR_VERSION'])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getScriptPath():\n\treturn os.path.dirname(os.path.realpath(sys.argv[0]))", "def _get_R_script_path(self):\r\n return join(self._get_R_script_dir(), self._R_script)", "def _get_R_script_path(self):\r\n return join(self._get_R_script_dir(), self._r_script)", "def _get_R_script_path(self):\r\...
[ "0.72292536", "0.71944875", "0.71660566", "0.71660566", "0.70947295", "0.7094654", "0.6968933", "0.6959824", "0.6875371", "0.6695478", "0.66933763", "0.6691691", "0.66446805", "0.65666175", "0.65631396", "0.65155375", "0.6510447", "0.6501997", "0.64991677", "0.6473583", "0.64...
0.5729511
82
Prepend the job directory to the script filename, thereby giving the full path to that script.
def jobDirPath(fileName, jobName=None): return os.path.join(getJobDir(jobName), fileName)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def script_path(filename):\n import os\n\n filepath = os.path.join(os.path.dirname(__file__))\n return os.path.join(filepath, filename)", "def path(filename: str) -> str:\n path = os.path.dirname(sys.argv[0])\n if not path:\n path = '.'\n return path + '/' + filename", ...
[ "0.6620909", "0.61521655", "0.6091486", "0.5998464", "0.5862523", "0.5862523", "0.58574694", "0.5853256", "0.58114475", "0.57294047", "0.56935155", "0.5659071", "0.565152", "0.5648528", "0.5634166", "0.5631282", "0.56015354", "0.5596998", "0.5594591", "0.5565787", "0.55321187...
0.5977413
4
Return directory containing the python scripts for this package.
def pythonDir(): return os.path.join(os.environ['HARNESSEDJOBSDIR'], 'python')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_script_directory():\n return os.path.dirname(__file__)", "def getScriptDirectory():\n\n\treturn os.path.dirname(os.path.realpath(__file__))", "def scripts_dir(self):\n\n return os.path.join(self.path, 'Scripts' if sys.platform == 'win32'\n else 'bin')", "def GetPackageDirecto...
[ "0.8367036", "0.8184034", "0.8136323", "0.8009121", "0.781837", "0.72765565", "0.721128", "0.7114369", "0.703379", "0.7011326", "0.6959119", "0.691898", "0.68421715", "0.6829909", "0.6826391", "0.68256855", "0.6804084", "0.67876285", "0.678408", "0.6763302", "0.6751281", "0...
0.6833764
13
Get captured QoS frames count.
def get_qos_frames_count(self, iface, prio): pytest.skip("Method is not supported by Iperf TG")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def FrameCount(self):\r\n\t\treturn self._get_attribute('frameCount')", "def get_num_frames(self):\n return self._frames.shape[0]", "def CapturedPacketCount(self):\n if self.force_auto_sync:\n self.get('CapturedPacketCount')\n return self._CapturedPacketCount", "def size(self):\n ...
[ "0.6617294", "0.65121794", "0.6442677", "0.64097846", "0.6385833", "0.63292485", "0.6323967", "0.62055874", "0.62055874", "0.62055874", "0.62055874", "0.61926365", "0.6179702", "0.60658", "0.6009568", "0.5971275", "0.5968064", "0.5968064", "0.5968064", "0.59614897", "0.593889...
0.6784837
0
Return port receiving rate for specific qos.
def get_port_qos_rxrate(self, iface, qos): pytest.skip("Method is not supported by Iperf TG")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def snmpqosqos_packets_receivedrate(self) :\n\t\ttry :\n\t\t\treturn self._snmpqosqos_packets_receivedrate\n\t\texcept Exception as e:\n\t\t\traise e", "def snmpqosqos_bytes_rxrate(self) :\n\t\ttry :\n\t\t\treturn self._snmpqosqos_bytes_rxrate\n\t\texcept Exception as e:\n\t\t\traise e", "def qos(self) -> int:...
[ "0.7400478", "0.67673326", "0.6565384", "0.65636086", "0.655634", "0.65286344", "0.6484185", "0.64834714", "0.63183933", "0.62684774", "0.6265818", "0.6218028", "0.6191985", "0.614526", "0.61260784", "0.60794526", "0.60735244", "0.60735244", "0.60735244", "0.60562176", "0.602...
0.8132853
0
Indicates whether the page is the home page.
def is_home_page(self): return not self.title and self.category is None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isHomePage(self):\n home = self.getHome(self.url)\n if home == self.url:\n return True\n if home == self.url + '/':\n return True\n return False", "def ishome(self) -> bool:\n pass", "def is_home_page_displayed(self):\n return self", "def is...
[ "0.89558476", "0.8508168", "0.8078934", "0.8056154", "0.79446644", "0.7786996", "0.7492609", "0.7427423", "0.7326582", "0.687873", "0.6853885", "0.68153286", "0.6630799", "0.6585944", "0.65664303", "0.65527886", "0.64945453", "0.645396", "0.6426517", "0.64178526", "0.6384745"...
0.8481587
2
|coro| Create a new thread in this channel.
async def create_thread(self, *content, **kwargs): name = kwargs.get('name') message = kwargs.get('message') if not name: raise TypeError('name is a required argument that is missing.') if not message and not content: raise TypeError('Must include message, an argu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _make_thread(self):\r\n pass", "def _create_thread(self, target=None, **kwargs):\n return PyonThread(target=target, **kwargs)", "def start_thread(self) -> threading.Thread:\n assert self._thread is None, \"Thread has already been created.\"\n\n self._thread = threading.Thread(ta...
[ "0.7148792", "0.63841957", "0.61550903", "0.61426675", "0.59533626", "0.59492314", "0.5924913", "0.58997834", "0.5843887", "0.5834031", "0.58094215", "0.58024997", "0.5770515", "0.5746966", "0.57381505", "0.573489", "0.5729103", "0.5721482", "0.5689433", "0.5683641", "0.56421...
0.64998895
1
Constructor for the SchedulingPolicy class
def __init__(self, continuous_schedule=None, daily_schedule=None, monthly_schedule=None, periodicity=None, rpo_schedule=None, ): # Initialize members of the class self.continuous_schedule = continuous_sched...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, *args, **kwargs):\n BaseScheduler.__init__(self, *args, **kwargs)", "def __init__(self, commcell_obj, schedule_policy_name, schedule_policy_id=None):\n\n self._commcell_object = commcell_obj\n\n self.schedule_policy_name = schedule_policy_name\n\n if schedule_policy...
[ "0.72119725", "0.7009803", "0.6801905", "0.66890097", "0.6619935", "0.6579833", "0.6579833", "0.65508026", "0.6525183", "0.6445381", "0.64380383", "0.6416252", "0.63605034", "0.6360149", "0.63377744", "0.63295203", "0.63000166", "0.6282655", "0.62645996", "0.62414086", "0.623...
0.71841955
1
Creates an instance of this model from a dictionary
def from_dictionary(cls, dictionary): if dictionary is None: return None # Extract variables from the dictionary continuous_schedule = cohesity_management_sdk.models.continuous_schedule.ContinuousSchedule.from_dictionary(dictionary.get('continuousSchedule')) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_dictionary(cls,\n dictionary):\n if dictionary is None:\n return None\n\n # Extract variables from the dictionary\n id = dictionary.get('id')\n name = dictionary.get('name')\n mtype = dictionary.get('type')\n usage_bytes = diction...
[ "0.83181584", "0.8168118", "0.8168118", "0.8118749", "0.8089047", "0.79787344", "0.7949278", "0.79231393", "0.7898951", "0.78923255", "0.788838", "0.7882321", "0.7882212", "0.7876749", "0.78585315", "0.7836853", "0.7801407", "0.7801407", "0.7801407", "0.7801407", "0.7801407",...
0.0
-1
Create a new review allow anonymous reviews
def add_new_review(restaurant_id): # If the user isn't logged in, send to the login page if helper.handle_login(login_session) is False: return redirect('/login') if request.method == 'POST': post = request.get_json() if 'username' not in login_session: new_review = Revi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_review_permitted(self, user):\n if user.is_authenticated or settings.OSCAR_ALLOW_ANON_REVIEWS:\n return not self.has_review_by(user)\n else:\n return False", "def new_review(request):\n user_profile = UserProfile.objects.get(user=request.user)\n\n if request.user....
[ "0.62570983", "0.6243688", "0.6216704", "0.6139156", "0.6019284", "0.60166204", "0.58876014", "0.58285147", "0.58219707", "0.58006114", "0.58002865", "0.5768464", "0.5746094", "0.57012033", "0.56801724", "0.5677521", "0.5667964", "0.56499326", "0.5648192", "0.5600142", "0.559...
0.5970554
6
determine integers less than given n are prime or not using The Sieve of Eratosthenes
def prime_numbers_determination_list(n: int)-> List[bool]: is_prime = [True] * (n + 1) is_prime[0] = is_prime[1] = False for i in range(2, int(math.sqrt(n)+1)): if is_prime[i]: for j in range(i*2, n+1, i): is_prime[j] = False return is_prime
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def primeSieve(n):\n\tsieve = numpy.ones(n/3 + (n%6==2), dtype=numpy.bool)\n\tfor i in xrange(1,int(n**0.5)/3+1):\n\t\tif sieve[i]:\n\t\t\tk=3*i+1|1\n\t\t\tsieve[ k*k/3 ::2*k] = False\n\t\t\tsieve[k*(k-2*(i&1)+4)/3::2*k] = False\n\treturn numpy.r_[2,3,((3*numpy.nonzero(sieve)[0][1:]+1)|1)]", "def prime...
[ "0.8365655", "0.83619857", "0.83381045", "0.83381045", "0.8317274", "0.8311296", "0.8295186", "0.8288669", "0.8262649", "0.82305294", "0.82297194", "0.81531185", "0.8144267", "0.8121198", "0.81163555", "0.8106535", "0.8104429", "0.8079202", "0.8077061", "0.80356914", "0.80323...
0.0
-1
Enables or disables the creation mode. Additionally, if the creation mode is disabled, the new obstacle is added to the list of obstacles and the helper variables are reset
def _toggle_creation_mode_cb(self): if not self.obstacle_creation_mode: self.create_obstacle_button.config(text=self.OBSTACLE_CREATION_ACTIVE_LABEL) else: self.create_obstacle_button.config(text=self.OBSTACLE_CREATION_INACTIVE_LABEL) self.obstacles.append( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create(self, pygame):\n\n white = (255,255,255)\n self.obstacle_img = pygame.image.load(\"./Images/Obstacle.png\").convert()\n self.obstacle_img.set_colorkey(white)\n\n for i in range(8):\n self.random_objects.append(pygame.image.load(\"./Images/Object{}.png\".format(i+1)...
[ "0.5979801", "0.5751201", "0.56939346", "0.5609823", "0.5483122", "0.5475099", "0.543038", "0.543038", "0.53482324", "0.52968204", "0.5213188", "0.5202174", "0.51632845", "0.51582515", "0.5141757", "0.5131271", "0.512601", "0.5107599", "0.509531", "0.50953066", "0.50929123", ...
0.7348674
0
This method parses the given json string and returns comments list.
def get_comments(self, resp): comments = CommentList() for value in resp['comments']: comment = Comment() comment.set_comment_id(value['comment_id']) comment.set_expense_id(value['expense_id']) comment.set_description(value['description']) comm...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def comments(self):\n comments_url = self.data['comments_url']\n return json.load(urllib2.urlopen(comments_url))", "def from_json(cls, j, allow_comments=False):\n if allow_comments:\n lines = j.splitlines()\n newlines = []\n for line in lines:\n ...
[ "0.6876065", "0.637124", "0.63228244", "0.62756234", "0.6258763", "0.62392193", "0.62385434", "0.623803", "0.61224705", "0.6110174", "0.6106828", "0.6066047", "0.60295737", "0.60293716", "0.6011979", "0.6002101", "0.5953518", "0.59394073", "0.59394073", "0.5935494", "0.591496...
0.6184951
8