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
Returns chunks of an iterable at a time.
def iter_chunks(iterable, size): it = iter(iterable) while True: chunk = tuple(itertools.islice(it, size)) if len(chunk) == 0: break yield chunk
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def chunker(iterable, size):\n for i in range(0, len(iterable), size):\n yield iterable[i:i + size]", "def chunker(iterable, size):\n for i in range(0, len(iterable), size):\n yield iterable[i:i + size]", "def chunker(iterable, size):\n for i in range(0, len(iterable), size):\n yi...
[ "0.75042737", "0.75042737", "0.75042737", "0.74160326", "0.7318999", "0.7310084", "0.7295632", "0.7238026", "0.72255385", "0.7215634", "0.72145677", "0.7185212", "0.7139658", "0.7116562", "0.7091419", "0.7053181", "0.7033942", "0.6988627", "0.69878596", "0.69781035", "0.69754...
0.7122963
13
CrossoverOperator the bodies `body_attr` of two trees `t1` and `t2`. Return True if successful.
def crossover_attr(self, t1, t2, body_attr): assert isinstance(t1, ast.AST) assert isinstance(t2, ast.AST) assert isinstance(body_attr, str) if not getattr(t1, body_attr, None) or not getattr(t2, body_attr, None): return False if self.crossover_branches(t1, t2): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def crossover(self, t1, t2):\n assert isinstance(t1, ast.AST)\n assert isinstance(t2, ast.AST)\n\n for body_attr in ['body', 'orelse', 'finalbody']:\n if self.crossover_attr(t1, t2, body_attr):\n return t1, t2\n\n raise CrossoverError(\"No crossover found\")", ...
[ "0.7265587", "0.5615946", "0.5350632", "0.5110765", "0.5109744", "0.50748146", "0.5071171", "0.50490874", "0.5033519", "0.4986048", "0.48812097", "0.4880675", "0.48803774", "0.4867313", "0.47733247", "0.4769179", "0.4768347", "0.47660184", "0.4753546", "0.47362763", "0.471049...
0.8024304
0
Constructor. Arguments are as with `StatementMutator` constructor.
def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.conditions = all_conditions(self.source) if self.log: print("Found conditions", [astor.to_source(cond).strip() for cond in self.conditions])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __new__(cls, value: object, *pos_args: Any, **kw_args: Any) -> 'Statement':\n stmt = super().__new__(cls, value)\n return stmt", "def __init__(self):\n self.Statement = []", "def from_statement(cls, statement):\r\n return cls('\\n'.join(textwrap.dedent(statement).splitlines()[1:]))"...
[ "0.7211767", "0.6505045", "0.63745576", "0.6348355", "0.61185133", "0.60718924", "0.6047413", "0.59996504", "0.59317374", "0.5832915", "0.58224547", "0.5815079", "0.5802179", "0.5789632", "0.5758655", "0.5741191", "0.5728888", "0.56879854", "0.5678093", "0.56609845", "0.56288...
0.0
-1
Return the number of Hydrogen bond donors in the molecule. A Hydrogen bond donor is a H bonded to an O, or N.
def Hbond_donors(self): if not self.hasBonds: self.buildBondsByDistance() num_donors = 0 for a in self.allAtoms: if a.element == 'H': num_donors += a.bonds[0].neighborAtom(a).element in ('O', 'N') return num_donors
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def NDon(row):\n m = Chem.MolFromSmiles(row.SMILES)\n donors = Descriptors.NumHDonors(m)\n return donors", "def NDon(row):\n m = Chem.MolFromSmiles(row.SMILES)\n donors = Descriptors.NumHDonors(m)\n return donors", "def H_count(mol,idxs):\n mol_H=Chem.AddHs(mol)\n hcount=0\n for num,...
[ "0.6865252", "0.6865252", "0.65677077", "0.65267366", "0.5985927", "0.5985927", "0.59564084", "0.58504856", "0.5735814", "0.5704089", "0.556828", "0.5552182", "0.55492824", "0.54705805", "0.5438462", "0.54074496", "0.54009545", "0.53853995", "0.53842807", "0.538396", "0.53806...
0.8398151
0
Return the number of Hydrogen bond acceptors in the molecule. A Hydrogen bond acceptor is an O or and N.
def Hbond_acceptors(self): num_acceptors = 0 for a in self.allAtoms: num_acceptors += a.element in ('O', 'N') return num_acceptors
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Hbond_donors(self):\n if not self.hasBonds:\n self.buildBondsByDistance()\n num_donors = 0\n for a in self.allAtoms:\n if a.element == 'H':\n num_donors += a.bonds[0].neighborAtom(a).element in ('O', 'N')\n return num_donors", "def NAcc(row):\n...
[ "0.7092994", "0.64413893", "0.6191796", "0.6186009", "0.6186009", "0.56347716", "0.5630681", "0.5540772", "0.5491301", "0.5439708", "0.5434414", "0.54102796", "0.5378954", "0.5368424", "0.52783245", "0.5276656", "0.5270156", "0.52669096", "0.5241736", "0.52093697", "0.5199175...
0.84010375
0
Return the octanol partition coefficient of the molecule.
def logP(self): raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_heat_loss_coefficient_of_partition() -> float:\n return 1 / 0.46", "def calc_cophenetic_coeff(self):\n c, d = cophenet(self.__linkage, self.__distance_matrix)\n return round(c, 3)", "def multinomial_coefficient(partition, n=None):\n tot = 0\n deg = 1\n for p in partition:\n ...
[ "0.62270755", "0.5998368", "0.5968289", "0.5898935", "0.5701933", "0.56940776", "0.5688284", "0.5688123", "0.56872565", "0.56292695", "0.56115204", "0.5580812", "0.5574052", "0.5539158", "0.55318284", "0.5511949", "0.54952514", "0.5473133", "0.54450315", "0.5443963", "0.54321...
0.0
-1
Makes a new unique subject_name for an original subject (originally created in this repository, not cloned from an external repository).
def generate_name(host, subject_type_or_type_name): id = UniqueId.create_id() return '%s/%s.%d' % (host, get_name(subject_type_or_type_name), id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def subject_name(self, subject_name):\r\n\r\n self._subject_name = subject_name", "def change_subject(self, new_subject):\n raise NotImplementedError", "def subject(self, subject: \"str\"):\n self._attrs[\"subject\"] = subject", "def subject(self, subject: \"str\"):\n self._attrs[...
[ "0.72923565", "0.6557637", "0.64840806", "0.64840806", "0.6456563", "0.6382463", "0.63191813", "0.62643915", "0.6213363", "0.61556274", "0.61109585", "0.60629874", "0.59957635", "0.5978133", "0.5968337", "0.5959318", "0.59280187", "0.5899243", "0.58673733", "0.5864138", "0.58...
0.6275544
7
Gets the MinimalSubject entity for the given Subject.
def get_by_subject(subject): return MinimalSubject.all().ancestor(subject).get()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_subject(self):\n return self._subject", "def find_subject(subject_id: SubjectID) -> Optional[Subject]:\n subject = DbSubject.query.get(subject_id)\n\n if subject is None:\n return None\n\n return _db_entity_to_subject(subject)", "def getSubject(self):\n\n return X501DN.fro...
[ "0.64311826", "0.6425734", "0.61142874", "0.61142874", "0.6060248", "0.59992605", "0.59871256", "0.59259456", "0.59200877", "0.5916239", "0.5906356", "0.5894232", "0.5833647", "0.5821658", "0.5821658", "0.5811914", "0.57908106", "0.57899183", "0.5756734", "0.5715578", "0.5705...
0.7738488
0
Gets a Subscription entity by its subject_name and email.
def get(subject_name, user_email): return Subscription.get_by_key_name(subject_name + ':' + user_email)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_by_subject(subject_name):\n return filter_by_prefix(Subscription.all(), subject_name + ':')", "def get_by_natural_key(self, email_subscription_name):\n return self.get(email_subscription_name=email_subscription_name)", "def get_one(cls, sid):\n return Subscription.query.get_or_404(...
[ "0.7094307", "0.6975274", "0.63484716", "0.60371023", "0.6007752", "0.5996732", "0.5946372", "0.5899261", "0.57004863", "0.5653863", "0.5626889", "0.5621962", "0.5595033", "0.5568514", "0.55526584", "0.54953104", "0.54867613", "0.5479473", "0.54357135", "0.53924906", "0.53681...
0.7801574
0
Returns True if the course is ongoing and False if not.
def is_ongoing(self) -> bool: today = datetime.today() return ( False if self.time is None else ( today.weekday() == self.weekday() and self.time.start <= today.hour * 60 + today.minute <= self.time.end ) )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_continued(self):\n return self._recent_goal_continued", "def is_active(self, community, now):\n if community.cid in self._timestamps:\n return now <= self._timestamps[community.cid].last_active + CANDIDATE_INACTIVE\n return False", "def is_active(self):\n now = sel...
[ "0.67648387", "0.6712462", "0.6710088", "0.66984653", "0.6691759", "0.6680325", "0.664772", "0.6620251", "0.6579959", "0.65431714", "0.6514873", "0.6495611", "0.6491855", "0.64872324", "0.64844537", "0.64689606", "0.64653885", "0.6403669", "0.64034885", "0.6400822", "0.635579...
0.64236337
17
Initialize a Course object from the path to its .yaml dictionary.
def from_file(cls, path: str): # descend 2 levels down, getting the name of the course directory # not pretty, but functional root = path for _ in range(3): root = os.path.dirname(root) shortened_path = path[len(root) + 1:] name = shortened_path[: shortened_p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_path(cls, path: str):\n # go down until we find it\n while path != os.path.dirname(path):\n for f in os.listdir(path):\n if f.endswith(\".yaml\"):\n return Course.from_file(os.path.join(path, f))\n else:\n path = os.path....
[ "0.7246551", "0.70464456", "0.643223", "0.64051455", "0.64045334", "0.63376856", "0.6265202", "0.6198536", "0.6167882", "0.6122628", "0.6077643", "0.6076279", "0.6048059", "0.60188985", "0.60183597", "0.6010949", "0.6009848", "0.599325", "0.599325", "0.59819484", "0.5962732",...
0.72107744
1
List the courses in a timeline.
def timeline(self, **kwargs): def rtm(n, multiple=10): """Round to multiple.""" return int(multiple * round(float(n) / multiple)) beginning_minutes = 7 * 60 + 20 # starting time is 7:20 end_minutes = 21 * 60 # ending time is 21:00 interval = 100 # 100 minute...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_course(request, template=\"core/list_course.html\"):\n response = {\n 'morning': Course.objects.at_morning(),\n 'afternoon': Course.objects.at_afternoon(),\n }\n return direct_to_template(request, template, response)", "def course_listing(request):\r\n if GlobalStaff().has_user...
[ "0.7028933", "0.66413516", "0.65793216", "0.64610505", "0.6394742", "0.63356215", "0.6284867", "0.6252264", "0.61700624", "0.61358184", "0.6118361", "0.60674953", "0.6016344", "0.60092545", "0.59679633", "0.58901113", "0.58563423", "0.582817", "0.58200777", "0.58168924", "0.5...
0.58296084
17
Test the sigmoid cross entropy pointiwse loss object
def test_sigmoid_cross_entropy(self): loss_op = pointwise_losses.SigmoidCrossEntropy() y_pred = loss_op.final_activation_op({ "logits": self.logits, "metadata": { "mask": self.mask } }) assert np.isclose(y_pred[0][0].numpy(), 0.5490569...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_activation_sigmoid(self):\r\n senal = 1\r\n result = activation.soft_sigmoid(senal)\r\n self.assertEqual(result, 0.6963549298238342)", "def sigmoid_cross_entropy(y, label):\r\n losses = - np.log(y + g_epsilon) * label - np.log(1.0 - y + g_epsilon) * (1.0 - label)\r\n return lo...
[ "0.7410867", "0.71433216", "0.71346706", "0.7078074", "0.69633836", "0.69633836", "0.69502914", "0.6937943", "0.6937943", "0.68985385", "0.68732935", "0.6871054", "0.6871054", "0.6871054", "0.6871054", "0.6871054", "0.6871054", "0.6861679", "0.68597966", "0.6855672", "0.68529...
0.8148278
0
Test the one hot cross entropy for aux target with ties
def test_aux_one_hot_cross_entropy_with_ties(self): loss_op = listwise_losses.AuxiliaryOneHotCrossEntropy() y_pred = loss_op.final_activation_op({ "logits": self.logits, "metadata": { "mask": self.mask } }) assert np.isclose(y_pred[0]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_aux_one_hot_hot_cross_entropy(self):\n loss_op = listwise_losses.AuxiliaryOneHotCrossEntropy()\n\n y_pred = loss_op.final_activation_op({\n \"logits\": self.logits,\n \"metadata\": {\n \"mask\": self.mask\n }\n })\n\n assert np.is...
[ "0.82314354", "0.7107997", "0.6577458", "0.65271825", "0.65167147", "0.6492352", "0.64810234", "0.6461922", "0.64272654", "0.63998437", "0.63623744", "0.6359017", "0.6355198", "0.63364434", "0.6283812", "0.62769973", "0.62759167", "0.62632394", "0.6259588", "0.61826545", "0.6...
0.8322475
0
Given a student name, generate a unique slug for that student
def generate_student_slug(name: str) -> str: slug = slugify(name) if not Student.objects.filter(slug=slug).exists(): return slug # Duplicate found, add integer to end until it's unique counter = 1 while True: modified_slug = f"{slug}-{counter}" if not Student.objects.filter...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_slug(self):\n return slugify(self.name)", "def generate_slug(name):\n # Slugify the title and check\n slug = secure_filename(name).lower().replace('_', '-')\n slug_n = slug\n n = 1\n\n # Append an increasing number to the slug until we find an available url\n while not slug_...
[ "0.74999523", "0.7204617", "0.6984936", "0.6863214", "0.6719303", "0.6681752", "0.66477704", "0.6633485", "0.6614247", "0.6578231", "0.65479773", "0.6544474", "0.6507287", "0.6506236", "0.64668", "0.64605737", "0.64070547", "0.6382842", "0.6372856", "0.6368093", "0.6341335", ...
0.8879662
0
Return yamlserializable dict representation of this object.
def to_yaml(self): yaml_dict = self.__dict__ # Convert types that are not natively convertable to yaml yaml_dict["cluster_id"] = str(self.cluster_id) yaml_dict["server_id"] = str(self.server_id) return yaml_dict
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_yaml_string(self):\n Params._check_yaml_import()\n import yaml\n\n return yaml.safe_dump(dict(self))", "def to_dict(self):\n return dumpd(self)", "def toYAML(self):\n\t\treturn {\n\t\t\t\"key\": self.getKey(),\n\t\t\t\"spec\": self.getSpec(),\n\t\t\t\"name\": self.getName(),\...
[ "0.8036639", "0.796841", "0.7872443", "0.7869207", "0.7674701", "0.76224375", "0.76077986", "0.7550838", "0.7478528", "0.7442435", "0.7426577", "0.741481", "0.741481", "0.741481", "0.741481", "0.741481", "0.741481", "0.7387087", "0.7342017", "0.73383754", "0.7327165", "0.72...
0.76984185
4
Returns an instance of the MainWindow's status bar, displayed at the bottom of the main window()
def statusBar(): main_window = MainWindow() return main_window.statusBar()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_status_bar(self):\n self.statusbar = self.CreateStatusBar()", "def GetMainWindow(self):\r\n \r\n return self._main_win", "def _createStatusBar(self) -> None:\n self._statusBar = QStatusBar()\n self.setStatusBar(self._statusBar)", "def show_bottom_status(self):\n ...
[ "0.6971956", "0.66381335", "0.66239566", "0.65907454", "0.6582707", "0.63849336", "0.6368836", "0.6361373", "0.6361373", "0.6361373", "0.6318891", "0.6310896", "0.62998414", "0.62734336", "0.6268561", "0.6268561", "0.62496114", "0.6185957", "0.60250777", "0.6015626", "0.59971...
0.837974
0
Get full path to localised version of given file.
def get_localised_file(self, language, filename): return os.path.join( self.get_localised_dir(language), filename )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _localfile(name):\n return os.path.abspath(resource_filename(__name__, name))", "def _LocalDataPath(local_file):\n return data.ResourcePath(local_file)", "def _filepath(self, filename):\n return os.path.join(self.root, self.version, filename)", "def _file_path(self, file: str) -> str:\n ...
[ "0.75364035", "0.7110393", "0.6741334", "0.67233837", "0.6720599", "0.6691851", "0.6619739", "0.6611061", "0.6606329", "0.6581355", "0.65697646", "0.65529674", "0.65393794", "0.6515368", "0.65047157", "0.6487688", "0.64628404", "0.6458152", "0.63440233", "0.6317376", "0.62996...
0.7775177
0
Return full path to the localised content directory of the loader.
def get_localised_dir(self, language): return os.path.join( self.base_path, to_locale(language), self.content_path )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def path(self):\n path = os.path.join(self.base_dir, self.store().replace(' ', '_'), self.package_name())\n return os.path.abspath(path)", "def localPath(self):\n return self.home", "def dir(self) -> str:\n return f'{os.path.dirname(self.path)}/'.lstrip('/')", "def localdir():\n ...
[ "0.71643317", "0.6896528", "0.6821353", "0.6819986", "0.68157864", "0.67826957", "0.6762796", "0.66732806", "0.6602083", "0.65813637", "0.65788406", "0.6556326", "0.65431577", "0.65328294", "0.6507623", "0.6503", "0.64911914", "0.6484893", "0.6467069", "0.6456652", "0.6453728...
0.77603686
0
Load and read given YAML file.
def load_yaml_file(self, yaml_file_path): try: yaml_file = open(yaml_file_path, encoding="UTF-8").read() except FileNotFoundError: raise CouldNotFindYAMLFileError(yaml_file_path) try: yaml_contents = yaml.safe_load(yaml_file) except yaml.YAMLError: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_yaml(file: Text):\n with open(file) as fp:\n return yaml.load(fp, yaml.FullLoader)", "def read_yaml_file(yaml_file):\n with open(yaml_file, 'r') as yfile:\n loaded_file = yaml.safe_load(yfile)\n return loaded_file", "def load_yaml(filepath):\n with open(filepath, 'r')...
[ "0.80314195", "0.79943186", "0.7986928", "0.7972603", "0.79548", "0.79546857", "0.7924562", "0.7907691", "0.78959477", "0.7815696", "0.779105", "0.7752526", "0.76876724", "0.7595392", "0.7581102", "0.7555926", "0.75353", "0.7516288", "0.7502198", "0.74752605", "0.74660486", ...
0.7804813
10
Given a plugin path, return the path to its venv's sitepackages directory.
def get_plugin_site_packages_directory(plugin_path): path = join(plugin_path, 'env', 'lib', 'python{}.{}'.format(*sys.version_info), 'site-packages') assert os.path.exists(path), 'plugin site-packages path "{}" does not exist'.format(path) return path
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_plugin_path_extension(plugin_path):\n venv = get_plugin_site_packages_directory(plugin_path)\n return [plugin_path, venv] + [join(venv, s) for s in os.listdir(venv)\n if not s.endswith('.pth')]", "def user_site_packages() -> str:\n if os.name == 'nt':\n re...
[ "0.7662514", "0.74459743", "0.70638865", "0.69029135", "0.6885322", "0.6847522", "0.68388146", "0.66553307", "0.660575", "0.6506995", "0.6377109", "0.63741213", "0.6269047", "0.61132985", "0.6051365", "0.60466486", "0.60414577", "0.602893", "0.6020737", "0.59876883", "0.59431...
0.86020905
0
Return True iff obj is nested to a consistent depth throughout. >>> consistent_depth(6) True >>> consistent_depth([1, 2, 3, 4]) True >>> consistent_depth([1, 2, [3], 4]) False >>> consistent_depth([[1], [2, 3], [4]]) True >>> consistent_depth([1, [2, 3], 4]) False >>> consistent_depth([[[1]], [[2], [3], [4], []]]) True...
def consistent_depth(obj: Union[int, list]) -> bool: if isinstance(obj, int): return True elif obj == []: return True else: initial_depth = depth(obj[0]) for sublist in obj: consistence = (initial_depth == depth(sublist)) and consistent_depth(sublist) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_depth(self):\n return self._is_depth", "def depth_check(self, depth):\r\n if depth >= self.ply:\r\n return True\r\n return False", "def at_depth_limit(self):\n return self.depth > self.depth_limit", "def check_if_nested(data):\n if isinstance(data, dict):\n ...
[ "0.6085986", "0.58578485", "0.5754885", "0.57215226", "0.570764", "0.5539398", "0.54987484", "0.548311", "0.54732037", "0.53635645", "0.5349064", "0.5299297", "0.52740467", "0.5224822", "0.5151036", "0.51185244", "0.5060194", "0.50521356", "0.505052", "0.5023243", "0.49798256...
0.8277158
0
Converts miles to tenths of a mile `round(mi 100)`
def distance_to_int(mi): return round(change_precision(mi, 2))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def miles_to_kilometers(miles):\n #convert miles to km:\n return miles*1.60934", "def miles_to_kilometers(miles: float) -> float:\n mile = float(miles)\n kilometers = float(float(mile) * 1.60934)\n return round(kilometers, 2)", "def meters_to_miles(meters):\n miles = meters / 1609.344\n re...
[ "0.75017035", "0.74707824", "0.7334726", "0.72808695", "0.7234439", "0.7233604", "0.7206585", "0.7153392", "0.70546776", "0.68228143", "0.64714426", "0.6454524", "0.64334714", "0.6358854", "0.6346669", "0.6315866", "0.6264553", "0.6127926", "0.60482556", "0.6038334", "0.60118...
0.55490005
49
A little bit like numpy.meshgrid, except returns only boundary values and limited to 2d case only.
def polygon_path(x, y=None): if y is None: y = x return np.vstack([ np.vstack([x, np.full_like(x, y[0])]).T, np.vstack([np.full_like(y, x[-1]), y]).T[1:], np.vstack([x, np.full_like(x, y[-1])]).T[::-1][1:], np.vstack([np.full_like(y, x[0]), y]).T[::-1][1:]]).T
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_meshgrid(x_min,x_max,y_min,y_max, h=.02):\n xx, yy = np.meshgrid(np.arange(x_min, x_max, h),\n np.arange(y_min, y_max, h))\n return xx, yy", "def make_meshgrid(x_min,x_max,y_min,y_max, h=.02):\n xx, yy = np.meshgrid(np.arange(x_min, x_max, h),\n n...
[ "0.7514348", "0.7514348", "0.73367953", "0.73367953", "0.730571", "0.7281956", "0.72791684", "0.7249696", "0.7249696", "0.7249696", "0.7249696", "0.7196818", "0.7148425", "0.70763934", "0.69537723", "0.6917682", "0.6878586", "0.6875794", "0.67855096", "0.6763318", "0.6717307"...
0.0
-1
Get boundary points from a 2d roi. roi needs to be in the normalised form, i.e. no openended start/stop, see roi_normalise
def roi_boundary(roi, pts_per_side=2): yy, xx = roi xx = np.linspace(xx.start, xx.stop, pts_per_side, dtype='float32') yy = np.linspace(yy.start, yy.stop, pts_per_side, dtype='float32') return polygon_path(xx, yy).T[:-1]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def real_boundaries(self):\n return (self._points[0][1], self._points[0][3])", "def roi(data):\n return data[data.shape[0] // 2 - args.roi : data.shape[0] // 2 + args.roi, data.shape[1] // 2 - args.roi : data.shape[1] // 2 + args.roi]", "def calc_bounds(roi: np.ndarray) -> Dict[int, BoundInfo]:\n ...
[ "0.68793625", "0.6778617", "0.6636487", "0.6281521", "0.62696445", "0.6265659", "0.62302566", "0.620769", "0.6187315", "0.61726624", "0.6163149", "0.6153046", "0.61523026", "0.614335", "0.6079284", "0.6076044", "0.60754627", "0.6067563", "0.60234904", "0.6008623", "0.59964365...
0.73052937
0
True if Affine transform has scale and translation components only.
def is_affine_st(A, tol=1e-10): (_, wx, _, wy, _, _, *_) = A return abs(wx) < tol and abs(wy) < tol
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_affine(self):\n if self.is_irreducible():\n return self._info['affine']\n else:\n return False", "def is_scale_enabled(self) -> bool:\r\n ...", "def _check_do_transform(df, reference_im, affine_obj):\n try:\n crs = getattr(df, 'crs')\n except Attri...
[ "0.6696801", "0.64322513", "0.6425481", "0.6425481", "0.6134028", "0.6098768", "0.5888766", "0.58767486", "0.58112", "0.5762329", "0.5738124", "0.5684409", "0.5667866", "0.5667866", "0.565228", "0.56511194", "0.5555442", "0.55246395", "0.5506826", "0.53830343", "0.5368443", ...
0.51264995
39
Given a linear transform compute scale change. 1. Y = AX + t 2. Extract scale components of A Returns (sx, sy), where sx > 0, sy > 0
def get_scale_from_linear_transform(A): _, _, S = decompose_rws(A) return abs(S.a), abs(S.e)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scaling(sx,sy,Mat):\r\n # SM is the Scaling Matrix ( 3 X 3 )\r\n SM = [[sx,0,0],[0,sy,0],[0,0,1]]\r\n Scaled = Multiply(SM,Mat)\r\n # Scaled[0][0] is the updated x coordinate\r\n # Scaled[1][0] is the updated y coordinate\r\n return Scaled[0][0],Scaled[1][0],Scaled[2][0]", "def scale(inp, a...
[ "0.6422202", "0.6269182", "0.6238993", "0.6208766", "0.61688095", "0.6148727", "0.61007935", "0.6038922", "0.5997132", "0.59703517", "0.5962059", "0.593938", "0.5927383", "0.5927383", "0.5919295", "0.5886479", "0.58732206", "0.58421904", "0.5803875", "0.57984304", "0.5795001"...
0.7673108
0
this takes in the train and test data combined as a single df, convert columns to appropriate types, and return traintestsplitted data
def groupby_train_test_split(df, selected_features=None, test_ratio=0.2, seed=12345, groupby='user_id'): ############################################################ # Train Test Split ############################################################ grp = df[groupby] n_splits = int(1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def train_test_split(df, test_size=0.3):\r\n # split df here\r\n train_size = int(df.shape[0] * (1 - test_size))\r\n test_size = df.shape[0] - train_size\r\n train = df[:train_size]\r\n test = df[train_size:]\r\n\r\n return train, test # return the train and test datasets\r", "def train_test_s...
[ "0.7672181", "0.7528739", "0.75123996", "0.7473289", "0.74090946", "0.738638", "0.7354851", "0.72998834", "0.7298715", "0.72932434", "0.72687036", "0.72667116", "0.71793866", "0.71753854", "0.7155468", "0.71161556", "0.7079358", "0.70598274", "0.7048194", "0.7045473", "0.7044...
0.0
-1
Write the JSON metadata from get_users() to a JSON file
def write_json(json_data, country_code): # Create file directory if it does not already exist Path(f"{json_path}/{search_term}/country-{country_code}").mkdir(parents=True, exist_ok=True) with open(f"{json_path}/countries/{country_code}.json", 'w') as json_file: # for result in json_data: jso...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _save_users_data_to_json(self):\n with open(self._users_numbers_json_path, 'wb') as f:\n json.dump(dict(self._users_numbers), f)", "def write_json_user(self, response):\n\n name = str(self.get_json_cursor) + \".json\"\n dst_path = os.path.join(self.get_json_folder_path, name)\...
[ "0.7390192", "0.7240876", "0.7094779", "0.7008885", "0.68104386", "0.6700675", "0.66897213", "0.65207154", "0.64599466", "0.64206445", "0.63902336", "0.63899887", "0.634534", "0.6338593", "0.6306479", "0.62960446", "0.62865794", "0.62821805", "0.6243755", "0.62426186", "0.620...
0.0
-1
Test GET request is not implemented.
def test_GET(self): if not self.url: return response = self.client.get(self.url, {}, format='json') self.assertIn(response.status_code, [status.HTTP_405_METHOD_NOT_ALLOWED, status.HTTP_401_UNAUTHORIZED])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_get_request_should_not_work(self):\n response = self.client.get(reverse('user-list'))\n self.assertEqual(response.status_code, status.HTTP_405_METHOD_NOT_ALLOWED)", "def test_bad_method(self):\n\n request = service.get_request('GET', {})\n x = self.start_request_tests(request...
[ "0.7998636", "0.76531637", "0.75185466", "0.7455189", "0.7452455", "0.7386907", "0.7362132", "0.73344904", "0.7311589", "0.7224339", "0.7224339", "0.7211537", "0.7182936", "0.7162648", "0.71366715", "0.71238154", "0.7092529", "0.7092529", "0.7052852", "0.70369816", "0.7036981...
0.78219324
1
Test PUT request is not implemented.
def test_PUT(self): if not self.url: return response = self.client.put(self.url, {}, format='json') self.assertIn(response.status_code, [status.HTTP_405_METHOD_NOT_ALLOWED, status.HTTP_401_UNAUTHORIZED])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_client_can_do_put_request(self):\n response = self.httpbin_4.test_requests_put_method()\n self.assertEqual(response.request.method, 'PUT')\n self.assertEqual(response.status_code, 200)", "def test_update_should_not_be_allowed(self):\n response = self.client.put(self.get_url()...
[ "0.84029436", "0.8001406", "0.7973689", "0.78313136", "0.78185123", "0.77912235", "0.7723371", "0.7614706", "0.73973763", "0.7384767", "0.73763573", "0.7292434", "0.71780896", "0.7174757", "0.713898", "0.713506", "0.70937854", "0.70896125", "0.7060795", "0.70485884", "0.70428...
0.83548087
1
Embedding layer to represent categorical inputs in continuous space. For efficiency, the embeddings of different inputs are summed in this layer instead of stacked. This is equivalent to stacking the embeddings and applying a linear layer, but is more efficient with slightly more parameter cost. Masked inputs are repre...
def __init__(self, num_vars, num_categs, hidden_dim, input_mask, sparse_embeds=False): super().__init__() self.num_vars = num_vars self.hidden_dim = hidden_dim self.input_mask = input_mask self.sparse_embeds = sparse_embeds self.num_categs = num_categs # For each ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def embedding_layer(n_categories, embedding_dim, name=None):\n\n input_tensor = Input(shape=(1,))\n x = Embedding(n_categories, embedding_dim, name=name)(input_tensor)\n x = Reshape(target_shape=(embedding_dim,))(x)\n\n return input_tensor, x", "def one_hot(org_input):\n # Create the embedding...
[ "0.6488728", "0.630097", "0.6194533", "0.5907529", "0.5812553", "0.57938915", "0.5788545", "0.5719766", "0.5688486", "0.56875604", "0.5626743", "0.5625562", "0.5605492", "0.5599106", "0.55863094", "0.55859727", "0.5547062", "0.5533655", "0.5508522", "0.55085105", "0.5508367",...
0.59501344
3
Computes the signed tetrahedral volume Tetrahedron is formed by (p1, p2, p3, and origin)
def signed_tetrahedral_volume(p1, p2, p3): v321 = p3[..., 0] * p2[..., 1] * p1[..., 2] v231 = p2[..., 0] * p3[..., 1] * p1[..., 2] v312 = p3[..., 0] * p1[..., 1] * p2[..., 2] v132 = p1[..., 0] * p3[..., 1] * p2[..., 2] v213 = p2[..., 0] * p1[..., 1] * p3[..., 2] v123 = p1[..., 0] * p2[..., 1] * ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def volume_tetrahedron(xyz, A, B, C, D):\n\n AD = xyz[A, :] - xyz[D, :]\n BD = xyz[B, :] - xyz[D, :]\n CD = xyz[C, :] - xyz[D, :]\n\n V = (\n (BD[:, 0] * CD[:, 1] - BD[:, 1] * CD[:, 0]) * AD[:, 2]\n - (BD[:, 0] * CD[:, 2] - BD[:, 2] * CD[:, 0]) * AD[:, 1]\n + (BD[:, 1] * CD[:, 2] -...
[ "0.6826093", "0.62050015", "0.6134262", "0.5935595", "0.579452", "0.5788353", "0.563794", "0.55815554", "0.55592805", "0.5473699", "0.5409951", "0.53215724", "0.5313585", "0.53102285", "0.5306965", "0.5285401", "0.528305", "0.5272163", "0.5262419", "0.5251276", "0.524785", ...
0.7945285
0
Given a person's name, returns the person's initials (uppercase)
def get_initials(fullname): # TODO your code here names = fullname.split() initial = "" for name in names: initial = initial + name[0] return initial.upper()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_initials(name, force_upper=True):\r\n if force_upper:\r\n return name[0:1].upper()\r\n return name[0:1]", "def initials(full_name):\r\n\r\n if full_name is not None and len(full_name) > 0:\r\n return ''.join([s[0] for s in full_name.split(' ')]).upper()\r\n else:\r\n retu...
[ "0.8512483", "0.83186287", "0.77114457", "0.7597779", "0.75733525", "0.75212145", "0.7251313", "0.7233688", "0.7215348", "0.70606756", "0.701801", "0.6998534", "0.6986747", "0.69570524", "0.6946686", "0.6927703", "0.6927571", "0.6919062", "0.68892944", "0.6880017", "0.6832559...
0.776669
2
Check whether db admin user was provided during interactive setup. If it was use the provided value, if not, use default (basedefs.DB_ADMIN)
def getDbAdminUser(): if "DB_ADMIN" in controller.CONF.keys(): return controller.CONF["DB_ADMIN"] return basedefs.DB_ADMIN
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getDbUser():\n if \"DB_ADMIN\" in controller.CONF.keys():\n return controller.CONF[\"DB_ADMIN\"]\n\n return basedefs.DB_USER", "def is_current_user_admin():\n return (os.environ.get('USER_IS_ADMIN', '0')) == \"1\"", "def admin_user(self) -> pulumi.Input['LabVirtualMachineAdminUserArgs']:\...
[ "0.69233817", "0.6756985", "0.65849304", "0.6293442", "0.6293442", "0.6293442", "0.6284404", "0.61560553", "0.6060023", "0.60282916", "0.60078037", "0.5972259", "0.59705955", "0.5954933", "0.59497756", "0.59173226", "0.5910723", "0.58955634", "0.589458", "0.58933824", "0.5878...
0.7369951
0
Gets the current joint angular velocities of the robot. Gets the value from the internally updated dictionary that subscribes to the ROS topic /joint_states.
def get_jvel(self, joint_name=None): raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def motor_velocities(self):\n return np.asarray(self._robot_state.velocity)", "def angular_velocity(self):\n trig = gyro_trigger_mode.GET_ANGULAR_VELOCITY_TRIGGER_READ\n if self.__trigger == trig:\n self.read_and_update_angle()\n\n adjusted = (self.__angle - self.__offset)\n ...
[ "0.7364877", "0.67233205", "0.6614267", "0.6568352", "0.6533731", "0.63860744", "0.6330669", "0.6309947", "0.62694734", "0.6258062", "0.62368065", "0.61865056", "0.61848485", "0.61453736", "0.6107216", "0.6052122", "0.605022", "0.6045236", "0.6040997", "0.60171926", "0.601376...
0.52961147
78
Return the end effector's velocity.
def get_ee_vel(self): raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getVelocity(self):\n\n return self.vel", "def velocity(self):\n return self._velocity", "def velocity(self):\n return self._velocity", "def getVelocity(self):\n return self.v", "def velocity(self):\n return self.base_platform.velocity", "def exit_velocity(self):\n\n ...
[ "0.7597998", "0.7497102", "0.7497102", "0.7329573", "0.72916055", "0.72712773", "0.72207004", "0.7168993", "0.7125278", "0.70510393", "0.6998284", "0.69010675", "0.68339264", "0.6776172", "0.6735714", "0.67295444", "0.6721916", "0.6720561", "0.6714969", "0.6652692", "0.663663...
0.65433145
24
Split Dataframe into train and test
def TrainTestSplit(self,X, y): X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.33, random_state=42) return X_train, X_test, y_train, y_test
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def train_test_split(df):\n training_size = int(len(df) * .67)\n test_size = int(len(df) - training_size)\n train, test = df[0:training_size], df[training_size:len(df)]\n return train, test", "def train_test_split(df, test_size=0.3):\r\n # split df here\r\n train_size = int(df.shape[0] * (1 - t...
[ "0.87502146", "0.8675172", "0.83429956", "0.82589376", "0.8258646", "0.82561374", "0.8238919", "0.82127345", "0.8169267", "0.81212866", "0.8095547", "0.8059751", "0.8032628", "0.8021801", "0.79904646", "0.7858557", "0.78102297", "0.76439023", "0.76210123", "0.7557369", "0.755...
0.7006921
79
Return True if User is Customer, else False
def is_customer(self): return self.user_type == 'C'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_customer(self):\n return self.rol == ProfileRoles.CUSTOMER", "def is_customer(self) -> bool:\n return self.customer_id is not None", "def get_viewable(self, user):\n if user.get('role') in ('admin', 'manager', 'engineer'):\n return True\n return user['name'] == sel...
[ "0.7973554", "0.78856397", "0.7608238", "0.75453866", "0.74631107", "0.6777626", "0.677082", "0.6737793", "0.6564589", "0.65133387", "0.64878815", "0.6482182", "0.6447222", "0.6370282", "0.63490707", "0.63324475", "0.6329237", "0.63275003", "0.6326429", "0.6304935", "0.629894...
0.8658438
0
Return True if User is Doctor, else False
def is_doctor(self): return self.user_type == 'D'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_user(self):\n try:\n if self.get_customer()[0][0] == self.dni:\n return True\n else:\n return False\n except:\n return False", "def is_expert(self, user):\r\n return user.is_authenticated() and len(self.expert_set.filte...
[ "0.73021674", "0.69229335", "0.6753499", "0.6654294", "0.6609603", "0.6586969", "0.6560494", "0.65598214", "0.6529178", "0.6528746", "0.6468475", "0.646827", "0.6463693", "0.64135003", "0.6396539", "0.63946867", "0.6391401", "0.63876325", "0.6360593", "0.63473797", "0.6344433...
0.88278085
0
Return True if User is Moderator, eld False
def is_moderator(self): return self.user_type == 'M'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_administrator(self):\n return False", "def user_can_edit(self, user):\n return user == self.owner", "def is_admin(self):\n if not self.current_user:\n return False\n else:\n return self.current_user in [\"1\"]", "def is_mutable_by(self, user, perm='site.ch...
[ "0.7635358", "0.75669956", "0.755788", "0.7533217", "0.7342819", "0.72821033", "0.724939", "0.721178", "0.72006327", "0.7152955", "0.7142165", "0.7130123", "0.7128749", "0.70584786", "0.70387614", "0.7028319", "0.7021877", "0.7012709", "0.70039034", "0.6995095", "0.6995095", ...
0.8161933
0
True if this appointment has customer. False if appointment has not customer yet.
def has_customer(self): return self.customer is not None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_customer(self) -> bool:\n return self.customer_id is not None", "def is_customer(self):\n return self.user_type == 'C'", "def getCustomer(self):\n if self.__orderinfo is None:\n return False\n else:\n self.__customer.getCustomer(self.__orderinfo['custome...
[ "0.82619655", "0.73708725", "0.7252048", "0.724486", "0.6949405", "0.62316513", "0.61025953", "0.60775566", "0.6022929", "0.6022929", "0.59537625", "0.583108", "0.5823138", "0.5746951", "0.5651224", "0.56305397", "0.5616468", "0.55702525", "0.5567788", "0.5566021", "0.5565067...
0.8617538
0
True if this appointment is outdated. False if appointment is still fresh.
def is_outdated(self): today = datetime.datetime.today() day = datetime.datetime.combine(self.date, self.start_time) return day <= today
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_updated(self):\n return self.timestamp > 0", "def should_update(self):\n if self.last_updated is None:\n return True\n\n now = dt_util.utcnow()\n update_due_at = self.last_updated.replace(tzinfo=pytz.UTC) + datetime.timedelta(minutes=2)\n return now > update_d...
[ "0.76432335", "0.70905906", "0.70694476", "0.7046173", "0.7020753", "0.69855475", "0.694543", "0.6768369", "0.6729174", "0.6705097", "0.66850454", "0.66742736", "0.6589215", "0.6582298", "0.64762264", "0.64586246", "0.6404015", "0.6395051", "0.6386899", "0.6362679", "0.633018...
0.71214795
1
True if this appointment is in working day. False if appointment is in weekend.
def is_working_day_appointment(self): # function helps hide appointments on weekend return 0 <= self.date.weekday() <= 4
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_workfree(date):\n \n return date.weekday() == 6 or is_holiday(date)", "def sleep_in(weekday, vacation):\r\n if not weekday or vacation:\r\n return True\r\n else:\r\n return False", "def sleep_in(weekday, vacation):\r\n if not weekday or vacation:\r\n return True\r\n re...
[ "0.698782", "0.6900163", "0.6846277", "0.6798671", "0.6693848", "0.6676657", "0.66599643", "0.6500259", "0.6475139", "0.6475139", "0.64525187", "0.63143677", "0.6303531", "0.6260768", "0.6210601", "0.6192151", "0.61773175", "0.61767155", "0.61736727", "0.6172469", "0.61571", ...
0.85724473
0
Setup the GoodWe SEMS API sensor platform.
def setup_platform(hass, config, add_devices, discovery_info=None): # Add devices add_devices([SemsSensor("SEMS Portal", config)], True)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup_platform(\n hass: HomeAssistant,\n config: ConfigType,\n add_entities: AddEntitiesCallback,\n discovery_info: DiscoveryInfoType | None = None,\n) -> None:\n host = config[CONF_HOST]\n monitored_variables = config[CONF_MONITORED_VARIABLES]\n\n charger = openevsewifi.Charger(host)\n\n ...
[ "0.6955693", "0.65546525", "0.6437979", "0.6429075", "0.6421927", "0.6365622", "0.6355993", "0.62571675", "0.6252712", "0.6249104", "0.62105143", "0.62017065", "0.620131", "0.61969954", "0.618325", "0.61798215", "0.6176523", "0.6144862", "0.6140039", "0.6132656", "0.6127323",...
0.65087605
2
Return the name of the sensor.
def name(self): return self._name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name(self):\n return self._sensor.name", "def get_sensor_name(self):\n return self.data[1]", "def name(self):\n return self.device.device_data[self.device_id]['name'] + \\\n f' {self._sensor_type}'", "def name(self):\n return f\"{self._name} {SENSOR_TYPES[self.senso...
[ "0.91896784", "0.9168378", "0.890185", "0.8770976", "0.8511273", "0.8479953", "0.844435", "0.8299758", "0.8186503", "0.8105667", "0.8079737", "0.8066149", "0.8049647", "0.7700968", "0.7612295", "0.7611456", "0.7600605", "0.7600605", "0.7600605", "0.75392073", "0.75166553", ...
0.0
-1
Return the state attributes of the monitored installation.
def device_state_attributes(self): return self._attributes
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def device_state_attributes(self):\r\n return self.attributes", "def device_state_attributes(self):\r\n return self._attributes", "def device_state_attributes(self):\n return self.attr", "def device_state_attributes(self):\n return self.attr", "def state_attributes(self):\n ...
[ "0.81912136", "0.8035251", "0.793577", "0.793577", "0.7878056", "0.78757703", "0.7822081", "0.78151685", "0.78043455", "0.7786795", "0.7786795", "0.77698886", "0.77698886", "0.77695847", "0.77695847", "0.7743862", "0.7723329", "0.766513", "0.76194143", "0.7583132", "0.7570648...
0.7935381
8
x should be a tuple of tensors
def fprop(self, x): return tf.concat(axis=self.axis, values=x)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def encode(self, x: torch.Tensor) -> Tuple[torch.Tensor, torch.Tensor]:\n raise NotImplementedError", "def forward(self, x: Tensor) -> tuple[Tensor, Tensor]:\n h = self.backbone(x) # shape of batch_size x num_features\n z = self.projection_head(h)\n return cast(Tensor, z), cast(Tenso...
[ "0.70373166", "0.68699247", "0.6604791", "0.6534254", "0.64329886", "0.6185035", "0.6121677", "0.6098204", "0.6056931", "0.6054726", "0.6017868", "0.6015697", "0.601405", "0.6012428", "0.59970766", "0.59785795", "0.59769285", "0.594745", "0.59316224", "0.5891381", "0.58696425...
0.0
-1
Get the RGB color with the alpha channel.
def get_rgba(self): return "#%02X%02X%02X%02X" % (self.r, self.g, self.b, self.a)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def alpha(cls, rgb_color, transparency):\n\n if transparency > 1:\n transparency = 1\n elif transparency < 0:\n transparency = 0\n return rgb_color + str(hex(int(254 * transparency)))[2:]", "def Alpha(*args, **kwargs):\n return _gdi_.Colour_Alpha(*args, **kwargs)...
[ "0.7622991", "0.75203717", "0.7484356", "0.74360174", "0.7294883", "0.71680146", "0.71680146", "0.7124989", "0.70624256", "0.69358444", "0.68940717", "0.68303734", "0.6798835", "0.6720147", "0.6715948", "0.670339", "0.65579945", "0.65106136", "0.65091634", "0.6505151", "0.648...
0.6980019
9
Translate the color channel with the alpha channel and background channel color.
def tx_alpha(cf, af, cb, ab): return round_int( abs( cf * (af * RGB_CHANNEL_SCALE) + cb * (ab * RGB_CHANNEL_SCALE) * (1 - (af * RGB_CHANNEL_SCALE)) ) ) & 0xFF
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def apply_alpha(self, background=\"#000000FF\"):\n\n def tx_alpha(cf, af, cb, ab):\n \"\"\"Translate the color channel with the alpha channel and background channel color.\"\"\"\n\n return round_int(\n abs(\n cf * (af * RGB_CHANNEL_SCALE) + cb * (ab * ...
[ "0.77316743", "0.6916266", "0.67346495", "0.66286063", "0.65640885", "0.6502464", "0.64957905", "0.6360734", "0.6316906", "0.62322116", "0.6218829", "0.6211368", "0.6192389", "0.61855185", "0.6022667", "0.59819186", "0.5941799", "0.59331197", "0.5930536", "0.5920913", "0.5920...
0.62030166
12
Convert to HLS color format.
def tohls(self): return rgb_to_hls(self.r * RGB_CHANNEL_SCALE, self.g * RGB_CHANNEL_SCALE, self.b * RGB_CHANNEL_SCALE)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hls(self):\n return colorsys.rgb_to_hls(self.red, self.green, self.blue)", "def rgb2hls(t):\n r,g,b = t\n r /= 255.0\n g /= 255.0\n b /= 255.0\n return rgb_to_hls(r,g,b)", "def rgb2hls(t):\n r,g,b = t\n r /= 255.0\n g /= 255.0\n b /= 255.0\n return rgb_to_hls(r,g,b)", ...
[ "0.7551897", "0.7286495", "0.7286495", "0.7231956", "0.7181494", "0.70109075", "0.66585124", "0.6522602", "0.6514304", "0.64954776", "0.6480351", "0.6445235", "0.6429338", "0.63079816", "0.6296083", "0.6247249", "0.6204065", "0.61921054", "0.61106014", "0.610506", "0.6104434"...
0.7673061
0
Predict the forecast based on RPD Model =========================================== Calculates the production forecast. Parameter
def predict(self, volume:float) -> np.ndarray: self._q_plateau = volume*self._q_plateau_ratio self._q_min = volume*self._q_min_ratio rate_rampup = self._calc_rampup() rate_decline = self._calc_decline() rate_plateau = self._calc_plateau(volume, rate_rampup.sum(), rate_decline.sum...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def predict(self, **kwargs):\n\n logging.debug(\n \"Call predict() with parameters. \"\n \"Forecast 1 step only, kwargs:{kwargs}\".format(kwargs=kwargs)\n )\n\n X_test = self.df[-self.step :][self.feature_names]\n X_test = self.scaler.transform(X_test)\n y_p...
[ "0.68449515", "0.66206133", "0.64681464", "0.64220834", "0.63958466", "0.6373518", "0.63045436", "0.61968005", "0.61382765", "0.61270255", "0.61015016", "0.6090898", "0.60862714", "0.60730755", "0.6063938", "0.605867", "0.6037743", "0.6030531", "0.6018691", "0.5992532", "0.59...
0.0
-1
Boolean if volume is currently muted.
def is_volume_muted(self): return self._muted
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_volume_muted(self):\n return self._isMuted", "def is_volume_muted(self):\n return self._state.get(\"mute\", None)", "def is_volume_muted(self) -> bool:\n return int(self._state.get(\"playback_mute\", 0)) == 1", "def is_volume_muted(self):\n return self._mute", "def muted(...
[ "0.8895486", "0.885142", "0.8814543", "0.8788216", "0.82374", "0.8191111", "0.7936918", "0.7865406", "0.77063185", "0.76781267", "0.6825295", "0.67568815", "0.65654856", "0.65410423", "0.64554507", "0.6447409", "0.64051235", "0.63987285", "0.63623446", "0.636172", "0.63581014...
0.88772947
2
Turn the media player on.
def turn_on(self): self._remote.power(1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def media_play(self):\n self._state = STATE_PLAYING", "def media_play(self):\n self._state = STATE_PLAYING", "def turn_on(self) -> None:\n\n chromecast = self._get_chromecast()\n if not chromecast.is_idle:\n # Already turned on\n return\n\n if chromecast...
[ "0.73505145", "0.73505145", "0.70776236", "0.6949285", "0.6930635", "0.69170445", "0.6682077", "0.66477865", "0.6647714", "0.6576517", "0.6549154", "0.6525269", "0.6470713", "0.64542156", "0.6453492", "0.64412314", "0.6368969", "0.6312649", "0.63083595", "0.63010305", "0.6293...
0.62167567
27
Get the minimum/maximum element in the adjusted row array from a distance matrix. We adjust the row array in order to never get the "previous_indexes" list of indexes.
def get_maxmin_index_from_row( distance_matrix: np.ndarray, row: int, previous_indexes: List, type: str, )-> int: distance_matrix = distance_matrix.copy() arr = distance_matrix[row].astype(float) aux_list = range(arr.shape[0]) aux_list_2 = [] for i in aux_list: if i ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nearest_min(dist_matrix):\n # much faster than np.where\n i, j = np.unravel_index(\n np.argmin(dist_matrix), \n dims=dist_matrix.shape\n )\n return i, j", "def argmin(self, rows: List[Row], column: ComparableColumn) -> List[Row]:\n if not rows:\n return []\n ...
[ "0.65977263", "0.6011877", "0.59146416", "0.581797", "0.5775044", "0.57425076", "0.5738198", "0.56762314", "0.5655995", "0.5608797", "0.556891", "0.5514939", "0.54958385", "0.54396", "0.542927", "0.5413428", "0.53787214", "0.537482", "0.5367942", "0.53448814", "0.5341371", ...
0.7843267
0
Given a log path/name, extract a timestamp from it and return the timestamp as a string. If no timestamp is found, return None.
def extract_time_from_log_path(log_path: str) -> str: match = FILE_PATH_TIMESTAMP_RE.search(log_path) if match is not None: return f"{match.group(1)}:{match.group(2)}:{match.group(3)}" return ""
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extract_timestamp(log_entry):\n pattern = r\"\\[(.+)\\]\\s\"\n match = re.search(pattern, log_entry)\n\n if not match:\n msg = \"The date was not found in the following log entry: {}\".format(log_entry)\n raise DateNotFound(msg)\n\n timestamp_str = match.group().replace('[', '').repla...
[ "0.68200874", "0.66748714", "0.65580183", "0.6237984", "0.6210342", "0.5999979", "0.5971926", "0.59701943", "0.5921127", "0.5867168", "0.5828555", "0.5825881", "0.5820319", "0.5797472", "0.5777524", "0.5777524", "0.5773897", "0.5733049", "0.5730815", "0.57264197", "0.5711539"...
0.78245825
0
Return all unique blocks as a list of Biopython records.
def unique_blocks_records(self, target_file=None): if self.records is None: raise ValueError("") records = [] for seqname, locations in self.compute_unique_blocks().items(): for i, (start, end) in enumerate(locations): record = self.records[seqname][start:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def common_blocks_records(self):\n if self.records is None:\n raise ValueError(\"\")\n records = []\n for block_name, data in self.common_blocks.items():\n cst, (start, end, strand) = data[\"locations\"][0]\n record = self.records[cst][start:end]\n i...
[ "0.69865376", "0.6487969", "0.6340737", "0.61917067", "0.5944176", "0.58563346", "0.57712203", "0.5751668", "0.5696821", "0.5581567", "0.5579159", "0.5570179", "0.55510956", "0.5541462", "0.5530229", "0.55175596", "0.55049676", "0.54624504", "0.54539615", "0.5441693", "0.5439...
0.7105431
0
Sets the total_other of this TargetTemptationGroupOuterResult.
def total_other(self, total_other): self._total_other = total_other
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def total_amount(self, total_amount):\n\n self._total_amount = total_amount", "def combine_with_other(self, other):\n m = np.logical_or(self.mask, other.mask)\n w1 = self.cube_weight * self.weights[m]\n w2 = other.cube_weight * other.weights[m]\n tw = w1 + w2\n self._dat...
[ "0.50896585", "0.50671095", "0.49752986", "0.4951503", "0.4887264", "0.4887264", "0.4887264", "0.4887264", "0.4887264", "0.4887264", "0.4887264", "0.4887264", "0.48622504", "0.4851362", "0.4810839", "0.4800233", "0.479744", "0.47323015", "0.47226766", "0.4672156", "0.4643997"...
0.7787645
0
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, TargetTemptationGroupOuterResult): return False return self.to_dict() == other.to_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): if not isinstance(other, TargetTemptationGroupOuterResult): return True return self.to_dict() != other.to_dict()
{ "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.845611", "0.8391477", "0.8144138", "0.81410587", "0.8132492", "0.8093973", "0.80920255", "0.80920255", "0.80920255", "0.8085325", "0.8085325", "0.8076365", "0.8076365", "0.8065748", "0.8042487", "0.8042487", "0.8042487", "0.8042487", "0.8042487", "0.8042487", "0.8042487", ...
0.0
-1
Return the sum of time.
def sum(self): return sum(self.times)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sum(self):\n\n return time_stat(self, stat=\"sum\")", "def getTotalTime(self):\n with self.lock:\n if self.tend == 0:\n total = -1\n else:\n total = self.tend - self.tstart\n return total", "def total_time(self):\n obs_times = self...
[ "0.771545", "0.7003199", "0.69464904", "0.69291514", "0.68037593", "0.6803497", "0.66858596", "0.6638962", "0.66272086", "0.6532529", "0.64491063", "0.6448546", "0.64167005", "0.6415029", "0.63799405", "0.63728005", "0.6360416", "0.63578796", "0.63459677", "0.6345115", "0.632...
0.7676582
2
Download and extract a zip/tar file.
def download_extract(name, folder=None): #@save fname = download(name) base_dir = os.path.dirname(fname) data_dir, ext = os.path.splitext(fname) if ext == '.zip': fp = zipfile.ZipFile(fname, 'r') elif ext in ('.tar', '.gz'): fp = tarfile.open(fname, 'r') else: assert Fal...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def download_and_unzip(url, extract_to='.'):\n http_response = urlopen(url)\n zipfile = ZipFile(BytesIO(http_response.read()))\n zipfile.extractall(path=extract_to)", "def download():\n response = requests.get(URL, stream=True)\n\n file = open(FILE_NAME, 'wb')\n file.write(response.content)\n\n...
[ "0.77640665", "0.75466156", "0.7488906", "0.74230695", "0.74208057", "0.74110913", "0.7349301", "0.7332468", "0.73241496", "0.73225963", "0.7294297", "0.72637457", "0.7244374", "0.7242405", "0.72403973", "0.7215931", "0.71965367", "0.7105519", "0.7064334", "0.7055785", "0.704...
0.71807736
17
Return max potention from each node in tree.
def maxPotential(node): nonlocal maxsum # Allocate null values to 0 if not node: return 0 # Get the max sum from the left and right subtrees # We only care about possible gains (no negative values) # Iterates all the way to the far...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def max_value(tree):\n max_utility = float(\"-inf\")\n \n if (is_terminal(tree)):\n return tree\n else:\n #options = []\n for node in tree:\n #options.append(max_value(node))\n max_utility = max(max_utility, min_value(node))\n return max_utility", "de...
[ "0.75158167", "0.7124436", "0.71235484", "0.69800425", "0.69623786", "0.6905337", "0.69015247", "0.6823619", "0.6757977", "0.6752295", "0.6730264", "0.6707653", "0.6667124", "0.66581374", "0.6654065", "0.6623254", "0.66178393", "0.66044545", "0.65988404", "0.658934", "0.65516...
0.69382143
5
Perform tokenization and lemmatization on the input text.
def tokenize(text): text = re.sub(r"[^a-zA-Z0-9]+", " ", text.lower()) tokens = word_tokenize(text) lemmatizer = WordNetLemmatizer() clean_tokens = [] for tok in tokens: clean_tok = lemmatizer.lemmatize(tok).lower().strip() clean_tokens.append(clean_tok) return clean_tokens
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tokenize(self, text):\n\n # Normalize text\n text = re.sub(r\"[^a-zA-Z0-9]\", \" \", text.lower())\n\n # Tokenize text\n tokens = word_tokenize(text)\n\n # Remove stop words\n tokens = [t for t in tokens if t not in stopwords.words(\"english\")]\n\n # Lemmatizat...
[ "0.780185", "0.7797477", "0.7762922", "0.77228963", "0.76260823", "0.76051724", "0.7591944", "0.7539776", "0.75269693", "0.7521117", "0.75198567", "0.7510425", "0.75048715", "0.7457191", "0.7415107", "0.74055403", "0.7393646", "0.73630685", "0.73528564", "0.7302958", "0.72870...
0.73123163
19
Sets the default_virtual_machine of this VirtualMachinesResponse. default virtual machines
def default_virtual_machine(self, default_virtual_machine): self._default_virtual_machine = default_virtual_machine
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def default_virtual_machine(self):\n return self._default_virtual_machine", "def __init__(self, virtual_machines=None, default_virtual_machine=None):\n\n self._virtual_machines = None\n self._default_virtual_machine = None\n\n if virtual_machines is not None:\n self.virtual_m...
[ "0.7030837", "0.69299", "0.57935417", "0.5656606", "0.5575497", "0.556814", "0.553324", "0.5483776", "0.53223234", "0.526985", "0.5254059", "0.52210575", "0.5165304", "0.516268", "0.5159859", "0.505536", "0.50553", "0.50553", "0.50553", "0.50522256", "0.50208366", "0.497058...
0.8241787
0
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, VirtualMachinesResponse): 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.845611", "0.8391477", "0.8144138", "0.81410587", "0.8132492", "0.8093973", "0.80920255", "0.80920255", "0.80920255", "0.8085325", "0.8085325", "0.8076365", "0.8076365", "0.8065748" ]
0.0
-1
Get arguments from CLI
def get_args(): parser = argparse.ArgumentParser( description="""Run standard tree inference using raxml-light/examl""" ) parser.add_argument( "--phylip", required=True, type=is_file, action=FullPaths, help="""The phylip file you want to run raxml against.""" ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_cli_arguments(self):\n pass", "def get_args():\n\n parser = get_argument_parser()\n args = parser.parse_args()\n\n return args", "def parse_cli_args():\r\n parser = argparse.ArgumentParser(\r\n description=\"list all installed packages\")\r\n\r\n parser.add_argument(\"-v\",...
[ "0.83995515", "0.7696954", "0.7674078", "0.7656369", "0.75491726", "0.7546294", "0.7523218", "0.7521475", "0.7514517", "0.75119865", "0.74877495", "0.74807847", "0.74693704", "0.7466727", "0.74665916", "0.74520636", "0.74513096", "0.7427955", "0.7422721", "0.74211824", "0.740...
0.0
-1
Return the sum of 1+2+3+.....+n
def sumTo(n): the_sum = 0 #current sum a_number = 1 #where we are while a_number <= n: the_sum += a_number a_number += 1 return the_sum
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sumTotal(n):\n\n sum_total = 0\n\n for i in range(1, n+1):\n sum_total = sum_total + i\n\n return sum_total", "def sumTo(n):\n\n sum_all = (n * (n+1))/2\n\n return sum_all", "def sum_to_n(n):\n total = 0\n for i in range(1,n+1):\n total += i\n return total", "def sum...
[ "0.83504635", "0.826342", "0.82271045", "0.81576425", "0.8117652", "0.8117652", "0.80563927", "0.77709466", "0.7685846", "0.76408327", "0.7540197", "0.7530276", "0.74932694", "0.7489236", "0.74715275", "0.7470144", "0.744207", "0.7440847", "0.74365836", "0.74346936", "0.73998...
0.77662516
8
Gets pip version within a Docker image.
async def _get_pip_version(user_image, pip_binary) -> packaging.version.Version: words = [ "docker", "run", "--rm", user_image, pip_binary, "--version", ] proc = await asyncio.create_subprocess_exec( *words, stdout=subprocess.PIPE, stderr=subprocess.P...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def full_pip_freeze(docker_image, pip):\n\n match = None\n pip_vers = None\n\n try:\n\n cmd = ['sudo', 'docker', 'run', '--env', \"LD_LIBRARY_PATH=''\", '--rm', '-ti',\n '--entrypoint={}'.format(pip), docker_image, 'freeze']\n\n print(' '.join(cmd))\n r = sp.Popen(cmd, s...
[ "0.71303135", "0.69798565", "0.6419079", "0.6277511", "0.6148725", "0.6137875", "0.6120295", "0.59310794", "0.59273475", "0.58319116", "0.5770821", "0.57561857", "0.5715104", "0.57001305", "0.56596607", "0.56104374", "0.5602304", "0.5551372", "0.5549536", "0.5540237", "0.5477...
0.7086153
1
returns 1 if the point is inside any obstacles 0 otherwise
def inside_obstacle(point, obstacle): for obs in obstacle: if point[0] > obs[0][0] and point[0] < obs[0][2] and point[1] > obs[1][0] and point[1] < obs[1][2]: return 1 return 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_in_obstacle(self, x: float, y: float) -> bool:\n for obstacle in self.obstacles:\n if obstacle.contains_point((x, y)):\n return True\n return False", "def through_obstacle(line, obstacles):\r\n noofpoints = 100\r\n for i in range(noofpoints):\r\n if ins...
[ "0.7569299", "0.75461394", "0.75419754", "0.7019176", "0.70144844", "0.69907904", "0.68982977", "0.6818476", "0.6774961", "0.67379445", "0.667127", "0.66310084", "0.6615502", "0.66107047", "0.6606105", "0.6582978", "0.6573739", "0.65736836", "0.6563211", "0.6532585", "0.65290...
0.83202106
0
Dot production of two vectors
def dotproduct(vec1, vec2): return sum((a*b) for a, b in zip(vec1, vec2))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vec_dot(x, y):\r\n return sum(a * b for a, b in zip(x, y))", "def dot(a, b):\n\n if len(a) != len(b):\n raise Exception(\"Input vectors must be of same length, not %d and %d\" % (len(a), len(b)))\n\n return float(sum([a[i] * b[i] for i in range(len(a))]))", "def vector_dot(v1,v2):...
[ "0.8607856", "0.85906243", "0.85007215", "0.8487578", "0.84684265", "0.84267795", "0.8319278", "0.830194", "0.82609415", "0.82507664", "0.8246661", "0.82054085", "0.8204379", "0.8194332", "0.8168117", "0.81613994", "0.8127314", "0.8120469", "0.8117165", "0.80941325", "0.80907...
0.8316592
7
Fixture that deletes the files used by the test methods.
def tearDown(self): try: os.remove(self.filename) except: pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tearDown(self):\n try:\n os.remove(self.fixtureFile)\n except OSError:\n pass", "def teardown():\n for filename in files_to_delete:\n delete_file(filename)", "def tearDown(self):\n try:\n os.remove(self.fixture_file)\n except OS...
[ "0.7972733", "0.79667974", "0.79614806", "0.780152", "0.7784251", "0.7656321", "0.7642764", "0.7576854", "0.75580907", "0.74878705", "0.74443907", "0.7436153", "0.7409162", "0.74073124", "0.7361602", "0.73285383", "0.7311414", "0.7307437", "0.72456264", "0.7238537", "0.723697...
0.7357896
17
Check the proper exception is thrown for a missing file.
def test_no_such_file(self): with self.assertRaises(IOError): analyze_text('foobar')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_not_present_file(self):\n\t\ttry:\n\t\t\tmain.Main(['input/abc.txt']).run()\n\t\texcept:\n\t\t\tself.assertTrue(True)", "def test_file_read_missing_file(self):\n with (self.assertRaises(IOError)):\n FileReader(self.bogus_path).read()", "def verify_non_existing_path(self) -> None:\n ...
[ "0.7753259", "0.74750787", "0.745232", "0.7357429", "0.73413163", "0.7314341", "0.7307572", "0.723684", "0.7222839", "0.72198105", "0.7197289", "0.7188773", "0.7185748", "0.7185748", "0.71592814", "0.711991", "0.71002656", "0.70796204", "0.7060859", "0.705683", "0.7024992", ...
0.7146439
15
Returns the total duration of the instance. Returns
def get_duration(self): return float(self.time.iloc[-1] - self.time.iloc[0])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_duration(self):\n return self.duration", "def total_duration(self):\r\n # XXX: bug in duration after slicing - attr_onread should be reset\r\n # after slicing\r\n #return self.duration.sum()\r\n return (self.stop - self.start).sum()", "def get_duration...
[ "0.8194643", "0.81772685", "0.8084005", "0.80616283", "0.8055348", "0.8046825", "0.80230105", "0.80109435", "0.7984195", "0.7984195", "0.7984195", "0.7984195", "0.7984195", "0.7984195", "0.7984195", "0.7984195", "0.7952412", "0.79474545", "0.7943787", "0.7943787", "0.7891349"...
0.7574005
41
Subtract second time object from the first and return a time object representing the difference.
def subtractTimes(time1, time2): t1 = timedelta(hours=time1.hour, minutes=time1.minute, seconds=time1.second) t2 = timedelta(hours=time2.hour, minutes=time2.minute, seconds=time2.second) t3 = t1 - t2 return (datetime.min + t3).time()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __sub__(self, other):\n return MyTime(0,0,self.to_seconds() - other.to_seconds())", "def _subtract_times(self, a, b):\n td = a - b\n return td.days * 24 * 60 + td.seconds // 60", "def difference_from_time_instance(self, time: __class__):\n\n return self - time", "def subtract(...
[ "0.80212176", "0.7653748", "0.7227378", "0.7046492", "0.70104015", "0.6924141", "0.6838733", "0.67690086", "0.6766118", "0.6696036", "0.6522608", "0.6431476", "0.6417544", "0.6417544", "0.6404271", "0.63776505", "0.63557833", "0.6302589", "0.62871593", "0.628008", "0.625215",...
0.78187025
1
Add two time objects and return a time object representing the sum.
def addTimes(time1, time2): t1 = timedelta(hours=time1.hour, minutes=time1.minute, seconds=time1.second) t2 = timedelta(hours=time2.hour, minutes=time2.minute, seconds=time2.second) t3 = t1 + t2 return (datetime.min + t3).time()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __add__(self, other):\n return MyTime(0,0,self.to_seconds() + other.to_seconds())", "def __add__(self, other):\n if not isinstance(other, real_timedelta):\n return NotImplemented\n delta = timedelta(\n self.toordinal(),\n hours=self._hour,\n mi...
[ "0.81462187", "0.7230257", "0.7161394", "0.71573335", "0.70812637", "0.69428635", "0.67935085", "0.67700005", "0.6760144", "0.635306", "0.6320445", "0.6309278", "0.63046527", "0.629343", "0.6219863", "0.6113378", "0.6110599", "0.60884416", "0.60593337", "0.6053859", "0.602107...
0.8454811
0
Calculates compartment/Section resistance given resistivity, diameter and length of compartment.
def CalcAxialR(comp): L = comp.L * (1e-4) # Convert from um to [cm] diam = comp.diam * (1e-4)/2 # Convert from um to [cm] A = np.pi * (diam ** 2) # in units [cm^2] Ra_T = (comp.Ra * L) / A # units: [ohm-cm] * [cm] / [cm^2] = [ohm] Ra_T = Ra_T * (1e-6) # Convert to M-ohm return Ra_T
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def traffic_concentration(rFile, sheets, x, y, pollutant):\r\n p = Point(x, y)\r\n road, dis = nearest_road(p, rFile)\r\n \r\n # step 1. check whether this location is within the calculation range. If so, go on. Otherwise exit.\r\n if dis > 60: # I think we dont have to consider points that are too ...
[ "0.54942274", "0.5456142", "0.5440829", "0.54138553", "0.5344243", "0.5332298", "0.5332298", "0.53067297", "0.5288052", "0.52183837", "0.52037054", "0.5193114", "0.5170793", "0.5162606", "0.5154348", "0.509866", "0.5092861", "0.5060679", "0.50524783", "0.5045382", "0.5027004"...
0.0
-1
Build an actor (policy) network that maps states > actions.
def build_model(self): # Define input layer (states) states = Input(shape=self.state_size) # Add hidden layers net = Dense(units=self.fc1_units, activation='relu', kernel_initializer='glorot_uniform')(states) net = Dense(units=self.fc2_units, activation='relu', kernel_in...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _make_actor_network(states, num_controls, params, scope_name):\n scope_key = scope_name + '/'\n with tf.variable_scope(scope_name):\n hidden_1 = tf.layers.dense(states,\n units=params.actor_hidden_units[0],\n activation=None,\n ...
[ "0.69356495", "0.636351", "0.6270465", "0.62087923", "0.62009275", "0.6187312", "0.61473614", "0.6146225", "0.6128509", "0.60179603", "0.6002386", "0.5976266", "0.5959938", "0.5952642", "0.594925", "0.59280884", "0.5916518", "0.5898108", "0.58937097", "0.5891148", "0.5880467"...
0.0
-1
Renders the home page.
def home(): return render_template('index.html', title='主页', year=datetime.now().year,)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def render_home():\r\n\treturn render_template(\"index.html\")", "def home():\n\n return render_template('home_page.html')", "def home():\n\n return render_template(\"home.html\")", "def home():\n return render_template('home.html')", "def home():\n return render_template('home.html')", "def ...
[ "0.85574406", "0.853399", "0.8351404", "0.82762724", "0.82762724", "0.82762724", "0.82762724", "0.82762724", "0.82762724", "0.82762724", "0.82762724", "0.82762724", "0.82762724", "0.82762724", "0.82762724", "0.82762724", "0.82762724", "0.82762724", "0.82762724", "0.827363", "...
0.0
-1
Renders the about page.
def about(): return render_template('about.html', title='关于', year=datetime.now().year, message='我想说的一些话')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def about():\n return render_template('about.html', title='About')", "def about():\n\n return render_template('about_page.html', title='About')", "def about():\n\n\treturn render_template(\"about.html\")", "def on_about(self):\n render_about_window()", "def about():\n return render_temp...
[ "0.85650355", "0.85034525", "0.84489655", "0.84044397", "0.8394454", "0.82935613", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82709616", "0.82680845",...
0.7699647
62
checks if a number, n is even
def is_even(n): return n % 2 == 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_even(n):\r\n return n%2==0", "def is_even(n: int) -> bool:\r\n if n % 2 == 0:\r\n return True\r\n else:\r\n return False", "def even(n):\n return n % 2 == 0", "def even_func(n):\n if n % 2 != 0:\n\t return True\n else:\n\t return False", "def is_even(n):\n # Co...
[ "0.91898906", "0.9022679", "0.89082086", "0.8734943", "0.8656514", "0.8605928", "0.8575808", "0.85568637", "0.85088253", "0.8499546", "0.84658456", "0.8421923", "0.8404465", "0.8305044", "0.82267773", "0.81370294", "0.7992796", "0.7987734", "0.7985421", "0.7951134", "0.787072...
0.90823007
1
Given a comment name, find its index in the comment list
def get_comment_index(self, name): idx = self.comments.index(name) if self._has_coords_comment: return idx - 1 else: return idx
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_song_index_by_name(playlist_list, song_name):\n for song in playlist_list:\n if song['title'] == song_name:\n return playlist_list.index(song)\n return None", "def get_level_index(num_comment, pop_level):\n index = 0\n while num_comment > pop_level[index]:\n index +=...
[ "0.6243577", "0.6174611", "0.61493796", "0.61467564", "0.61416817", "0.60780257", "0.60733837", "0.60027975", "0.5990763", "0.58426625", "0.58292496", "0.5791355", "0.5781288", "0.5756617", "0.57145935", "0.5699457", "0.5649102", "0.564907", "0.5629097", "0.5624067", "0.55746...
0.8382336
0
Generate a useful version string for a QGreenland build. It's not always enough to use bumpversion to manage versions. If we want to release a dev build or a prerelease for human validation, it needs a fullyunique name so we know exactly what the user tested. For release builds (tagged with 'vX.Y.Z' release version), j...
def get_build_version(): package_version = __version__ tags = ( subprocess.run( ["/usr/bin/git", "tag", "--points-at", "HEAD"], cwd=os.path.dirname(os.path.realpath(__file__)), stdout=subprocess.PIPE, check=True, ) .stdout.decode("utf-8") ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_version_string():\n major, minor, micro, patch, tag, relnum, is_release = VERSION\n\n version = '%s.%s' % (major, minor)\n\n if micro or patch:\n version += '.%s' % micro\n\n if patch:\n version += '.%s' % patch\n\n if tag != 'final':\n if tag == 'rc':\n ...
[ "0.73010534", "0.7195019", "0.694041", "0.66563505", "0.66375214", "0.6636568", "0.6574271", "0.6548582", "0.6534632", "0.6534632", "0.6522979", "0.6504899", "0.6498889", "0.6392524", "0.6377458", "0.630314", "0.6288387", "0.6274695", "0.6230308", "0.6225115", "0.6223517", ...
0.6885193
3
Test if a file is executable.
def isexe(fpath): return path.exists(fpath) and access(fpath, X_OK)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_executable(fname):\n return os.path.isfile(fname) and os.stat(fname)[0] & MASK_EXEC", "def is_executable(file_path):\n\n return os.path.isfile(file_path) and os.access(file_path, os.X_OK)", "def is_exe(fpath):\n return os.path.isfile(fpath) and os.access(fpath, os.X_OK)", "def is_exe(fpath):\...
[ "0.8741574", "0.87068826", "0.85403335", "0.85316104", "0.8517677", "0.85165524", "0.85165524", "0.84676933", "0.83391577", "0.79545724", "0.77236336", "0.7666597", "0.75183725", "0.7321316", "0.7203699", "0.7170488", "0.7133504", "0.7106513", "0.7094573", "0.6935962", "0.691...
0.0
-1
Load a JSON file.
def load_json_file(json_path): with open(json_path, 'r') as json_file: contents = load(json_file) return contents
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_json(file_name):\n return json.load(open(file_name))", "def loadJsonFromFile(filename):\n with open(filename) as f:\n return json.loads(f.read())", "def load_json(filename):\n with open(filename) as file:\n obj = json.load(file)\n return obj", "def load_from_json(file):\n ...
[ "0.83567303", "0.8338712", "0.82908905", "0.8273313", "0.82556623", "0.8250072", "0.8250072", "0.82385445", "0.822512", "0.8189461", "0.81843656", "0.8172512", "0.8164592", "0.8160596", "0.81485546", "0.8145262", "0.8137295", "0.81274617", "0.81240416", "0.8113374", "0.810766...
0.7527479
79
Generate a random string of letters, digits and special characters
def randPass(length, numbers, aplpha, punctuation): password_characters = "" if numbers: # if numbers is true, add digits to the string password_characters = password_characters + string.digits if aplpha: # if alpha characters is true, add ascii_letters to the string p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_random_alphanumeric_string():\n return get_random_string(char_choice=string.ascii_letters + string.digits)", "def rand_string():\n out = ''\n for _ in range(24):\n out += choice(ascii_letters)\n return out", "def random_string():\n return \"\".join(random.choice(string.ascii_lette...
[ "0.846762", "0.81559694", "0.7920509", "0.7876258", "0.77858824", "0.77266", "0.7724137", "0.7707932", "0.76983076", "0.7659456", "0.76339835", "0.7620218", "0.7609873", "0.75422925", "0.75417304", "0.75369745", "0.7524378", "0.7523902", "0.75107896", "0.7495423", "0.74860233...
0.0
-1
Asks user to specify a city, month, and day to analyze.
def get_filters(): print('Hello! Let\'s explore some US bikeshare data!') # get user input for city (chicago, new york city, washington). HINT: Use a while loop to handle invalid inputs while True:# to ensure that there is no invalid input city = input('Which city do you want to explore Chicago, Ne...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Raw_Data(city,month,day):\n print(\"The city you have entered is: \",city)\n print(\"The month you have entered is: \",month)\n print(\"The day you have entered is: \",day)", "def get_filters():\n city = None\n month = None\n day = None\n while day == None:\n # TO DO: get user input f...
[ "0.66714007", "0.65354675", "0.64593667", "0.6374057", "0.6348314", "0.63097656", "0.62868035", "0.6259136", "0.62316", "0.62130964", "0.62050414", "0.6181105", "0.6171822", "0.61686903", "0.6158568", "0.61582303", "0.61532456", "0.61444426", "0.6131269", "0.610484", "0.61025...
0.57624257
75
Loads data for the specified city and filters by month and day if applicable.
def load_data(city, month, day): # This code is refrenced from the practice problem on the project. # load data file into a dataframe df = pd.read_csv(CITY_DATA[city]) # convert the Start Time column to datetime df['Start Time'] = pd.to_datetime(df['Start Time']) # extract month and day of week an...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_data(city, month, day):\n df = pd.read_csv(CITY_DATA [city])\n \n # convert the Start Time column to datetime\n df['Start Time'] = pd.to_datetime(df['Start Time'])\n \n # extract month and day of week from Start Time to create new columns\n df['month'] = df['Start Time'].dt.month\n ...
[ "0.81320685", "0.8108889", "0.8045821", "0.8042514", "0.80090284", "0.80071104", "0.79991937", "0.7998333", "0.7988789", "0.797905", "0.79737365", "0.79610896", "0.7956163", "0.7947432", "0.79463065", "0.7908287", "0.7908229", "0.7904569", "0.7900715", "0.78930074", "0.788921...
0.7511665
89
Displays statistics on the most frequent times of travel.
def time_stats(df): print('\nCalculating The Most Frequent Times of Travel...\n') start_time = time.time() # display the most common month # this commands were taking from project : understanding the data. most_common_month = df['month'].value_counts().idxmax() print("The most common month is :...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def time_stats(df):\n\n print('\\nDisplaying the statistics on the most frequent times of '\n 'travel...\\n')\n start_time = time.time()\n\n # display the most common month\n most_common_month = df['Month'].mode()[0]\n print('For the selected filter, the month with the most travels is: ' +\...
[ "0.80247396", "0.80233026", "0.7915788", "0.78266186", "0.7822246", "0.78143597", "0.77659196", "0.7740343", "0.773628", "0.77344066", "0.76867086", "0.7668633", "0.7651731", "0.7644636", "0.76399267", "0.76367253", "0.7625196", "0.7623158", "0.7612803", "0.76002145", "0.7583...
0.74917895
33
Displays statistics on the most popular stations and trip.
def station_stats(df): print('\nCalculating The Most Popular Stations and Trip...\n') start_time = time.time() # display most commonly used start station # idxmax() function returns index of first occurrence of maximum over requested axis most_common_start_station = df['Start Station'].value_count...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def station_stats(df):\n\n print('\\nCalculating The Most Popular Stations and Trip...\\n')\n start_time = time.time()\n\n # display most commonly used start station\n print(popular_start_station(df))\n\n # display most commonly used end station\n print(popular_end_station(df))\n\n # display m...
[ "0.7815675", "0.7662213", "0.7553417", "0.74914914", "0.74748665", "0.7446617", "0.7428588", "0.74237514", "0.74177027", "0.7400495", "0.7387161", "0.7385634", "0.73647535", "0.735934", "0.73566747", "0.73548365", "0.7351854", "0.7351274", "0.735057", "0.73421645", "0.7340198...
0.0
-1
Displays statistics on the total and average trip duration.
def trip_duration_stats(df): print('\nCalculating Trip Duration...\n') start_time = time.time() # display total travel time total_travel = df['Trip Duration'].sum() print("the summation of travel time :", total_travel) # display mean travel time mean_travel = df['Trip Duration'].mean() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def trip_duration_stats(data):\n print('\\nCalculating Trip Duration...\\n')\n start_time = time.time()\n # display total travel time\n total_trip_time= data['Trip Duration'].sum()\n print('The Total Travel Time is {} Hours'. format(total_trip_time/3600))\n # display mean travel time\n avg_tri...
[ "0.814274", "0.8025143", "0.80041367", "0.79496753", "0.7937415", "0.79312176", "0.7926815", "0.7915187", "0.79142886", "0.7908032", "0.79055744", "0.7900715", "0.7891682", "0.78894734", "0.7886722", "0.78851086", "0.7884266", "0.7882474", "0.78738385", "0.78686154", "0.78664...
0.76117826
86
Replace all runs of whitespace with one space.
def normalize_space (text): return RE_WS.sub (' ', text.strip ())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def removeMultipleSpaces(self) -> None:\n self.text = re.sub('\\s+', ' ', self.text)", "def normalize_whitespace(text):\n return NORMALIZE_WHITESPACE_REGEX.sub(' ', text)", "def replace_whitespace(s, rep=' '):\n s = re.sub(r'\\s+', rep, s)\n return s", "def removeSingleChars(self) -> None:\n ...
[ "0.7847106", "0.7783066", "0.7513169", "0.7279035", "0.72544503", "0.7153413", "0.71390104", "0.7121684", "0.71083605", "0.71083605", "0.70504385", "0.6981496", "0.6914841", "0.68986374", "0.6852682", "0.6820266", "0.6793349", "0.6788388", "0.67704785", "0.6727777", "0.671134...
0.74346846
3
Branch if Not Equal
def bne(self, arg): self.pc += arg if not self.p & const.FLAG_ZERO else 0 self.pc = c_uint16(self.pc).value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def branch_if_not_equal_val(self):\n register = (self.opcode & 0x0F00) >> 8\n value = self.opcode & 0xFF\n if self.registers[register] != value:\n self.pc += 2\n logger.info(\n \"Didn't skip {} because V{} and {} are not equal\".format(\n ...
[ "0.7856991", "0.74648285", "0.73252594", "0.7262589", "0.72318447", "0.71663684", "0.7074456", "0.6924286", "0.6896564", "0.68738955", "0.6860414", "0.6851288", "0.68099976", "0.67671484", "0.67531556", "0.67516285", "0.6737736", "0.6702436", "0.67017436", "0.6699731", "0.669...
0.0
-1
This method returns a HTML string representing this error case instance.
def get_html(self): html_str = '' # Input input_form = 'Written' if self.mode == constants.TN_MODE else 'Spoken' padding_multiplier = 1 if self.mode == constants.TN_MODE else 2 padding_spaces = ''.join(['&nbsp;'] * padding_multiplier) input_str = f'<b>[Input ({input_form}...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def html_error(string):\n return html_div(string, \"error\")", "def __str__(self):\n return \"ERROR: \" + self.error_message", "def html(self, environ):\n body = self.make_body(environ, self.template, html_quote, no_quote)\n\n error_template = TEMPLATE\n template_file = None\n\n ...
[ "0.69740915", "0.695199", "0.68573153", "0.66614646", "0.66189235", "0.6601159", "0.65861976", "0.6529188", "0.6529188", "0.6529188", "0.6529188", "0.6525147", "0.652326", "0.65131927", "0.64945424", "0.64727384", "0.6456088", "0.6451642", "0.63787514", "0.63775533", "0.63750...
0.0
-1
Load config yaml file.
def load_config(): global config with open('config.yml', 'r') as file: config = yaml.load(file)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_config(path):\n return yaml.load(open('config.yaml', 'r'), Loader=yaml.SafeLoader)", "def load_config():\n proj_dir = os.path.dirname(os.path.abspath(__file__))\n config_path = os.path.join(proj_dir, \"config.yml\")\n conf = yaml.safe_load(open(config_path))\n return conf", "def load_co...
[ "0.8231187", "0.8182419", "0.8127744", "0.809641", "0.80643296", "0.80458236", "0.80431753", "0.8029589", "0.8012232", "0.80042094", "0.7874509", "0.7825412", "0.7797831", "0.77838737", "0.7754888", "0.7736324", "0.7715363", "0.767165", "0.7667236", "0.7583861", "0.7582442", ...
0.8134458
2
Creates a tensorflow graph from saved GraphDef file.
def create_graph(): with tf.gfile.FastGFile(os.path.join( config['inference']['model_dir'], 'output_graph.pb'), 'rb') as f: graph_def = tf.GraphDef() graph_def.ParseFromString(f.read()) _ = tf.import_graph_def(graph_def, name='')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_graph():\n # Creates graph from saved graph_def.pb.\n with tf.gfile.FastGFile(os.path.join(\n FLAGS.model_dir, pbfilename), 'rb') as f:\n graph_def = tf.GraphDef()\n graph_def.ParseFromString(f.read())\n _ = tf.import_graph_def(graph_def, name='')", "def create_graph():\n # Creates ...
[ "0.8520226", "0.8467014", "0.83951885", "0.8363946", "0.82735664", "0.8054931", "0.79590166", "0.7821822", "0.764584", "0.76303625", "0.75955445", "0.7593122", "0.7593122", "0.7587784", "0.7581071", "0.7548656", "0.744795", "0.73854226", "0.73334265", "0.7306117", "0.7275474"...
0.8254384
5
Constructor for the CreateRemoteVaultSearchJobParameters class
def __init__(self, job_uids=None, cluster_id=None, cluster_match_string=None, encryption_keys=None, end_time_usecs=None, job_match_string=None, search_job_name=None, start_time_usecs=N...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(\n self,\n parameters: Dict[str, List[Dict[str, Any]]],\n search_method: SearchMethodEnum = SearchMethodEnum.RANDOM_SEARCH_UNIFORM,\n experiment_name: Optional[str] = None,\n objective_name: Optional[str] = None,\n seed: Optional[int] = None,\n ) -> None:\n...
[ "0.6202517", "0.59419274", "0.57045424", "0.56249213", "0.56042457", "0.5588463", "0.55337", "0.5533403", "0.55328417", "0.55167305", "0.5512177", "0.5469176", "0.54523945", "0.5450014", "0.5423169", "0.5366871", "0.5348521", "0.5347465", "0.53459054", "0.5342717", "0.5340208...
0.6318922
0
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 job_uids = dictionary.get("JobUids") cluster_id = dictionary.get('clusterId') cluster_match_string = dictionary.get('clusterMatchS...
{ "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.8318918", "0.81669754", "0.81669754", "0.81197715", "0.8089109", "0.79791135", "0.795009", "0.7923482", "0.7898976", "0.7892036", "0.7888688", "0.788278", "0.78827596", "0.7876383", "0.7858801", "0.7836289", "0.78016543", "0.78016543", "0.78016543", "0.78016543", "0.780165...
0.0
-1
Gets an artifact object by parsing metadata or creating one from uri.
def get_artifact(self) -> artifact.Artifact: if self.metadata_file and self.output_name: return entrypoint_utils.get_artifact_from_output( self.metadata_file, self.output_name) else: # Provide an empty schema when returning a raw Artifact. result = artifact.Artifact( instan...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_artifact(self) -> artifact.Artifact:\n if self.metadata_file and self.output_name:\n return entrypoint_utils.get_artifact_from_output(\n self.metadata_file, self.output_name)\n else:\n # Provide an empty schema when returning a raw Artifact.\n r...
[ "0.7244576", "0.63287866", "0.6281482", "0.60381526", "0.59055823", "0.58875287", "0.5870152", "0.5822744", "0.5775459", "0.57070494", "0.55334526", "0.5480483", "0.54525334", "0.54401195", "0.5386478", "0.538284", "0.5382396", "0.5366674", "0.5360486", "0.5255901", "0.525375...
0.73309535
0