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
Checks if the virtual test is skipped based on the platform config. Returns True if the virtual test is not intend to run on this port, due to the platform config in VirtualTestSuites; returns False otherwise.
def virtual_test_skipped_due_to_platform_config(self, test): suite = self._lookup_virtual_suite(test) if suite is not None: return self.operating_system() not in suite.platforms return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_skip_port(name: str) -> bool:\n return is_axi_port(name) or is_clock_port(name)", "def skipped_due_to_skip_base_tests(self, test):\n # This check doesn't apply to virtual tests\n if self.lookup_virtual_test_base(test):\n return False\n\n # Ensure that this was called at le...
[ "0.62426883", "0.6217027", "0.60163796", "0.598397", "0.5978397", "0.5796075", "0.57687795", "0.56653655", "0.5564411", "0.54664576", "0.5350614", "0.5327974", "0.53247994", "0.53176844", "0.531751", "0.52715033", "0.5261389", "0.5257747", "0.52177614", "0.51682705", "0.51320...
0.79868627
0
Checks if the test should be skipped due to the exclusive_tests rule of any virtual suite. If the test is not a virtual test, it will be skipped if it's in the exclusive_tests list of any virtual suite. If the test is a virtual test, it will be skipped if the base test is in the exclusive_tests list of any virtual suit...
def skipped_due_to_exclusive_virtual_tests(self, test): base_test = self.lookup_virtual_test_base(test) if base_test: # For a virtual test, if the base test is in exclusive_tests of the # test's own virtual suite, then we should not skip the test. virtual_suite = self...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def skipped_due_to_skip_base_tests(self, test):\n # This check doesn't apply to virtual tests\n if self.lookup_virtual_test_base(test):\n return False\n\n # Ensure that this was called at least once, to process all suites\n # information\n vts = self.virtual_test_suite...
[ "0.7289707", "0.69588894", "0.62508446", "0.6027962", "0.59861624", "0.5964671", "0.5823943", "0.5684825", "0.56718427", "0.5614277", "0.5529482", "0.5527522", "0.5501668", "0.5397261", "0.5385988", "0.53746635", "0.5323959", "0.53162664", "0.5249202", "0.524015", "0.5232221"...
0.8495547
0
Returns a name that uniquely identifies this particular type of port. This is the full port name including both base port name and version, and can be passed to PortFactory.get() to instantiate a port.
def name(self): return self._name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_port_name(self):\n\n\t\treturn self.port_name", "def get_port_name(self):\n\n\t\treturn self.port_name", "def PortName(self):\n return self._PortName", "def determine_full_port_name(cls, host, options, port_name):\n # Subclasses will usually override this.\n assert port_name.star...
[ "0.77218074", "0.77218074", "0.73005015", "0.7245122", "0.6901197", "0.6786546", "0.65880024", "0.6580955", "0.64768296", "0.6406346", "0.6373406", "0.636157", "0.6337628", "0.6276115", "0.6264391", "0.6250824", "0.62487453", "0.624234", "0.6234805", "0.6231315", "0.62082905"...
0.0
-1
Returns a string indicating the version of a given platform For example, "win10" or "linux". This is used to help identify the exact port when parsing test expectations, determining search paths, and logging information.
def version(self): return self._version
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def PlatformVersion():\n return ''", "def get_platform(self):\n return platform.version()", "def OSVersion(self):\n return self._core.get_server_attribute('platformVersion', 'Unknown')", "def PlatformName():\n return 'chromium-linux' + PlatformVersion()", "def pyversion(self):\n return s...
[ "0.80136204", "0.7636014", "0.7336736", "0.7235422", "0.7207974", "0.7207917", "0.7202604", "0.7200017", "0.7169244", "0.71667755", "0.7145759", "0.7117252", "0.7094396", "0.70680803", "0.7014846", "0.6979354", "0.6972861", "0.69486123", "0.6902606", "0.6884841", "0.6862613",...
0.0
-1
Returns a Unixstyle path for a filename relative to web_tests. Ports may legitimately return absolute paths here if no relative path makes sense.
def relative_test_filename(self, filename): # Ports that run on windows need to override this method to deal with # filenames with backslashes in them. if filename.startswith(self.web_tests_dir()): return self.host.filesystem.relpath(filename, self.web_tests_dir()) else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetRealPath(filename):\n if '/' == filename[0]: # already absolute\n return filename\n\n if filename.startswith('./') or filename.startswith('../'): # relative\n return os.path.abspath(filename)\n\n path = os.getenv('PATH', '')\n for directory in path.split(':'):\n tryname = os.pat...
[ "0.71745723", "0.70199466", "0.6904059", "0.6861207", "0.679379", "0.67878", "0.67384905", "0.6698345", "0.6673425", "0.6673425", "0.66713756", "0.65745986", "0.6559999", "0.65260357", "0.65254307", "0.6513517", "0.6511448", "0.65007746", "0.6497732", "0.6493365", "0.64856297...
0.83556044
0
Returns the full path to the file for a given test name. This is the inverse of relative_test_filename().
def abspath_for_test(self, test_name): return self._filesystem.join(self.web_tests_dir(), test_name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_test_file_path(test_file: str):\n return os.path.join(TESTS_DIR, test_file)", "def get_test_fname(fname):\n path, name = os.path.split(__file__)\n full_path = os.path.join(path, 'test', fname)\n return full_path", "def get_test_case_path(name: str) -> str:\n return os.path.realpath(os.pa...
[ "0.81098515", "0.8058781", "0.7869571", "0.78300554", "0.7812422", "0.7534759", "0.75133455", "0.74049485", "0.73998386", "0.7281565", "0.72790104", "0.72695106", "0.7208075", "0.7207914", "0.7160179", "0.7020139", "0.7015725", "0.69138396", "0.6875697", "0.6862548", "0.68603...
0.833825
0
Shuts down the websocket server if it is running.
def stop_websocket_server(self): if self._websocket_server: self._websocket_server.stop() self._websocket_server = None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def shutdown(self):\n log.info(\"Disabling run loop\")\n self.keep_running = False\n time.sleep(1)\n log.info(\"Disconnecting from Slack\")\n self.slack_client.server.websocket.shutdown()\n log.info(\"Shutting down\")\n sys.exit(0)", "def stop(self):\r\n se...
[ "0.7534715", "0.7390509", "0.7341467", "0.7335605", "0.73015165", "0.7216118", "0.72087437", "0.7164635", "0.71508193", "0.71316165", "0.70807713", "0.7073741", "0.70541006", "0.7003724", "0.69937515", "0.6963826", "0.6954323", "0.69498086", "0.69431245", "0.69303244", "0.686...
0.81463933
0
Returns the current TestConfiguration for the port.
def test_configuration(self): if not self._test_configuration: self._test_configuration = TestConfiguration( self._version, self._architecture, self._options.configuration.lower()) return self._test_configuration
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_network_tests_config():\n # Wrapped to avoid circular import errors.\n from mycroft.configuration import Configuration\n config = Configuration.get()\n return config.get('network_tests', {})", "def get_port_config(self, **kwargs):\n\n print(\"### show tests config port <port> ###\")\n...
[ "0.68100816", "0.6622924", "0.6601624", "0.645144", "0.63772994", "0.63756686", "0.6365509", "0.6365509", "0.6329448", "0.6317302", "0.6253699", "0.6251062", "0.62116224", "0.6155129", "0.6118706", "0.6095332", "0.6059592", "0.60544217", "0.60402375", "0.6032641", "0.6032613"...
0.723276
0
Returns an OrderedDict of name > expectations strings. The names are expected to be (but not required to be) paths in the filesystem. If the name is a path, the file can be considered updatable for things like rebaselining, so don't use names that are paths if they're not paths. Generally speaking the ordering should b...
def expectations_dict(self): # FIXME: rename this to test_expectations() once all the callers are # updated to know about the ordered dict. expectations = collections.OrderedDict() default_expectations_files = set(self.default_expectations_files()) ignore_default = self.get_opti...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def all_expectations_dict(self):\n expectations = self.expectations_dict()\n\n flag_path = self._filesystem.join(self.web_tests_dir(),\n self.FLAG_EXPECTATIONS_PREFIX)\n if not self._filesystem.exists(flag_path):\n return expectations\n\n ...
[ "0.6739296", "0.6587776", "0.62408876", "0.6010406", "0.5813492", "0.5688252", "0.56834847", "0.54136044", "0.5404298", "0.53987175", "0.53656983", "0.53451633", "0.5320237", "0.52621007", "0.52163994", "0.5101254", "0.5059891", "0.502013", "0.49341866", "0.49106687", "0.4891...
0.7631483
0
Returns the full path to the test driver.
def path_to_driver(self, target=None): return self.build_path(self.driver_name(), target=target)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_device_tests():\n return str(pathlib.Path(__file__).parent.absolute())", "def _get_tests_dir_path():\n \n fmod_path = ctbto.tests.__path__\n \n test_dir = \"%s/conf_tests\"%fmod_path[0]\n \n return test_dir", "def abspath_for_test(self, test_name):\n return self....
[ "0.75940686", "0.6903275", "0.6885369", "0.6811625", "0.6794021", "0.67902535", "0.67030704", "0.66821647", "0.66147333", "0.65809673", "0.64795667", "0.64185566", "0.6381786", "0.6340399", "0.6332772", "0.6325983", "0.6240832", "0.6238149", "0.6223872", "0.61911505", "0.6138...
0.69516826
1
Returns the port's driver implementation.
def _driver_class(self): return driver.Driver
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getImplementation(self):\n return _yarp.DeviceDriver_getImplementation(self)", "def driver(self):\n if self.config and \"driver\" in self.config and \"name\" in self.config[\"driver\"]:\n return self.config[\"driver\"][\"name\"]\n return None", "def interface_driver(self) ->...
[ "0.7250059", "0.71676695", "0.6963997", "0.6782192", "0.6638802", "0.66301227", "0.66301227", "0.6613915", "0.6602566", "0.64957505", "0.6423013", "0.6325211", "0.6164511", "0.6134613", "0.6123873", "0.61208355", "0.61018234", "0.6099746", "0.6092925", "0.60633516", "0.605288...
0.6818399
3
method is used to set the specieName property of the instance
def specieName(self): return (self._specieName + " ") * 2
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def specieName(self, specieName):\n self._specieName = specieName", "def __setName__(self, x):\n\n self.name = x", "def _setName(self, newname):\n self._name = newname", "def setName(self, name):\n self.name = name", "def setname(self, newname):\n self.name = newname", "def set...
[ "0.81531197", "0.7407657", "0.7249016", "0.7085894", "0.7079606", "0.70242083", "0.6966511", "0.6966511", "0.6965592", "0.69598854", "0.69479907", "0.69425565", "0.6903168", "0.6883237", "0.68500113", "0.68199617", "0.6779319", "0.6764995", "0.6764995", "0.6764995", "0.676499...
0.0
-1
Compare this Distributed Paillier scheme with another to determine (in)equality. Does not take the secret key into account as it might not be known and the public key combined with the precision and the session id.
def __eq__(self, other: object) -> bool: # Equality should still hold if the secret key is not available return ( isinstance(other, DistributedPaillier) and self.precision == other.precision and self.public_key == other.public_key and self.session_id == ot...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return (self._strategy == other._strategy and self._structure == other._structure and\n self._bva_valences == other._bva_valences and\n self._coordination_environments == other._coordination_environments and\n self._neighbors == other._...
[ "0.64928615", "0.6423482", "0.636059", "0.6348103", "0.63466096", "0.633685", "0.62598646", "0.6237452", "0.6220392", "0.6211804", "0.6178814", "0.6158783", "0.61476016", "0.6134258", "0.61013716", "0.60983336", "0.60905015", "0.6072372", "0.60657465", "0.60548794", "0.605429...
0.80177945
0
r""" Function that sets initial variables for the process of creating a shared secret key
def setup_input( cls, pool: Pool, key_length: int, prime_threshold: int, corruption_threshold: int, ) -> tuple[int, int, list[int], Shamir, Shares, list[str]]: number_of_players = len(pool.pool_handlers) + 1 # key length of primes p and q prime_length...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def InitForTest(self):\r\n self._need_passphrase = False\r\n self._ReadSecrets()", "def InitSecretsForTest():\r\n GetSharedSecretsManager(can_prompt=False)", "def _fill_credentials(self):\n if self.metadata.credentials.access_key and (\n # if contains secret reference or $generate then...
[ "0.6594836", "0.6260035", "0.62421966", "0.62405616", "0.60578674", "0.6029109", "0.59902245", "0.5989043", "0.5984811", "0.5961532", "0.5934078", "0.5933012", "0.5927496", "0.5914943", "0.59049463", "0.5903447", "0.58841217", "0.58823895", "0.5877273", "0.58380485", "0.58378...
0.0
-1
Function to test $N$ for small prime divisors
def __small_prime_divisors_test(cls, prime_list: list[int], modulus: int) -> bool: for prime in prime_list: if modulus % prime == 0: return True return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def primtest(n):\r\n\tif n % 2 == 0:\r\n\t\treturn False\r\n\tfor i in range(3, int(n**0.5 + 1), 2):\r\n\t\tif n % i == 0:\r\n\t\t\treturn False\r\n\telse:\r\n\t\treturn True", "def prime(n):\n result=0\n divided=3\n if n%2 == 0:\n result+=1\n while result<1 and divided <= (int)(sqrt(n)):\n ...
[ "0.762413", "0.75891376", "0.7477063", "0.74726665", "0.74066126", "0.7403324", "0.74020493", "0.7396105", "0.7384647", "0.7376539", "0.7368767", "0.73598206", "0.7359515", "0.7330891", "0.73247784", "0.7306135", "0.7292736", "0.72818476", "0.7268743", "0.7266292", "0.7261008...
0.75333875
2
Return an array of zero scores.
def _generate_zero_scores(X, y): return np.zeros((1, X.shape[1]))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _convert_to_zero_one_vec(pred_items, true_items):\n scores = []\n for items,ground_truth_items in zip(pred_items,true_items):\n score = np.zeros(len(items))\n for ind in range(len(items)):\n if items[ind] in ground_truth_items:\n score[ind] = 1\n scores.appe...
[ "0.64102846", "0.64051884", "0.63537186", "0.63479966", "0.6260224", "0.61812377", "0.6147273", "0.61416894", "0.60990655", "0.609433", "0.606767", "0.60442114", "0.5960603", "0.5951819", "0.5920167", "0.5919242", "0.58818513", "0.5862364", "0.5841807", "0.5830207", "0.582444...
0.75243884
0
JSON representation of the packet. Returns
def json(self): return { "user": self.user, "duration": self.duration }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def json(self):\r\n jason = {\"SourceAddress\": self._source_address,\r\n \"DestinationAddress\": self._destination_address,\r\n \"PacketType\": MessagePacket.PACKETTYPE_NAMES[self._packet_type],\r\n \"PayloadLength\": len(self._packet_payload),\r\n ...
[ "0.8261013", "0.7164388", "0.7038625", "0.69561183", "0.6873082", "0.6842689", "0.68413883", "0.68176556", "0.68175507", "0.6794222", "0.678476", "0.6773251", "0.6707276", "0.6685013", "0.66637295", "0.66604215", "0.6649528", "0.6649528", "0.6649528", "0.6649528", "0.6649528"...
0.0
-1
Match points on a sphere.
def spherematch(ra1,dec1,ra2,dec2,matchlength,chunksize=None,maxmatch=1): import numpy as np from . import chunks from .. import PydlutilsException from ...goddard.astro import gcirc # # Set default values # if chunksize is None: chunksize = max(4.0*matchlength,0.1) # # C...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calcSphereSimilarity(self):\n # Get the theoretical radius a sphere should have for the hotspot volume\n # Remember the sphere volume formula: V = (4/3)*pi*r^3\n expectedRadius = ((3*self.volume)/(4*npy.pi))**(1/3.)\n expectedDiameter = expectedRadius*2 + self.spacing\n\n ...
[ "0.7011297", "0.68204683", "0.6650814", "0.6446523", "0.63619167", "0.6326041", "0.6320513", "0.63061124", "0.62663466", "0.6197853", "0.6140657", "0.61044073", "0.6102915", "0.608011", "0.60567546", "0.6053813", "0.60393065", "0.60253346", "0.6000245", "0.5997367", "0.599720...
0.5580545
65
Compute laplacian from a vector
def Laplacian(w, p): Lw = np.zeros((p, p)) ind = 0 for i in range(p-1): for j in range(i+1, p): Lw[i, j] = -w[ind] ind += 1 Lw = Lw + Lw.T np.fill_diagonal(Lw, -(Lw.sum(axis = 0) - np.trace(Lw))) return Lw
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def laplacian(self, x):\n r = np.linalg.norm(x, axis=1)\n\n v = self.value(x, r)\n alpha = self.parameters[\"exponent\"]\n return (4 * alpha * alpha * x * x - 2 * alpha) * v[:, np.newaxis]", "def laplacian(self, pos):\n ao_lapls = np.zeros((self.num_aos,), dtype=float)\n ...
[ "0.8282683", "0.71077365", "0.69848984", "0.6766677", "0.6762495", "0.6726249", "0.6666373", "0.6645191", "0.6606227", "0.6484803", "0.6456929", "0.6433588", "0.6274294", "0.62634575", "0.62144965", "0.6130443", "0.6126471", "0.6118856", "0.61002904", "0.6025475", "0.59774363...
0.53830427
82
Compute the dual of L operator
def Laplacian_dual(M, p, n): L_Y = np.zeros(n) for j in range(p): for i in range(j+1, p): k = np.int(i - j + j*(2*p - j - 1)/2) - 1 L_Y[k] = M[i, i] - M[i, j] - M[j, i] + M[j, j] return L_Y
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def opL(x):\n return np.dot(opL_mat(x.size), x)", "def lle(self) -> eq.LLE:\n if self.phase not in ('l', 'L'): self.phase = 'l'\n self.phases = ('L', 'l')\n return self.lle", "def D_l(self, z):\n return D_a(z)*(1.e0 + z)**2.e0", "def l(y: float, o: float) -> float:\n return 1 / ...
[ "0.6891667", "0.6767673", "0.6471563", "0.63675493", "0.63384336", "0.62147564", "0.62052196", "0.62052196", "0.61437", "0.6134602", "0.6108042", "0.6104367", "0.6096671", "0.60924685", "0.60779935", "0.6035334", "0.5998973", "0.5991652", "0.59868795", "0.5918988", "0.5913044...
0.5588255
63
Create an NxN matrix, populating it with the specific value.
def __make_matrix(self, n, val): matrix = [] for i in range(n): matrix += [[val for j in range(n)]] return matrix
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def define_matrix(n):\n\n return [[0 for x in range(n)] for x in range(n)]", "def genMatrix(size=1024, value=1):\r\n\r\n matrix = [[value for col in range(0, size)] for row in range(0, size)]\r\n\r\n return matrix", "def generate_matrix(rand_range,n_value):\n matrix = np.empty([n_value,n_value])\n ...
[ "0.74744594", "0.7277047", "0.7229776", "0.69752157", "0.6839745", "0.68251956", "0.6733135", "0.671186", "0.6699308", "0.64912784", "0.6489039", "0.6476326", "0.64328593", "0.6321192", "0.6317381", "0.62724394", "0.6266711", "0.6255457", "0.6212287", "0.61974967", "0.6187962...
0.78325266
0
Find a noncovered zero and prime it. If there is no starred zero in the row containing this primed zero, Go to Step 5. Otherwise, cover this row and uncover the column containing the starred zero. Continue in this manner until there are no uncovered zeros left. Save the smallest uncovered value and Go to Step 6.
def __step4(self): step = 0 done = False row = -1 col = -1 star_col = -1 while not done: (row, col) = self.__find_a_zero() if row < 0: done = True step = 6 else: self.marked[ro...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _step4(state):\n # We convert to int as numpy operations are faster on int\n C = (state.C == 0).astype(int)\n covered_C = C * state.row_uncovered[:, np.newaxis]\n covered_C *= np.asarray(state.col_uncovered, dtype=int)\n covered_C *= (state.available).astype(int)\n n = state.C.shape[0]\n m...
[ "0.6927635", "0.68341243", "0.6497918", "0.6421103", "0.6373522", "0.6360352", "0.57787865", "0.576566", "0.5762758", "0.5615279", "0.5516049", "0.54680943", "0.5462408", "0.54011834", "0.5394161", "0.538695", "0.5366818", "0.5343623", "0.5304939", "0.5278049", "0.5251061", ...
0.6340702
6
Find the first starred element in the specified row. Returns the column index, or 1 if no starred element was found.
def __find_star_in_row(self, row): col = -1 for j in range(self.n): if self.marked[row][j] == 1: col = j break return col
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __find_star_in_col(self, col):\r\n row = -1\r\n for i in range(self.n):\r\n if self.marked[i][col] == 1:\r\n row = i\r\n break\r\n\r\n return row", "def find_row(table, row):\n for idx in range(len(table)):\n if table[idx][0] == row:\n ...
[ "0.77327883", "0.73641795", "0.7050647", "0.67642796", "0.67344636", "0.66834503", "0.65396476", "0.6445305", "0.6392565", "0.63687116", "0.6322313", "0.62854683", "0.62477803", "0.61869544", "0.61689746", "0.61301595", "0.6073505", "0.6069576", "0.60400677", "0.6011693", "0....
0.8386251
0
Retrieve all clusters up to a specific level threshold. This levelthreshold represents the maximum distance between two clusters. So the lower you set this threshold, the more clusters you will receive and the higher you set it, you will receive less but bigger clusters. PARAMETERS threshold The level threshold NOTE It...
def getlevel(self, threshold): left = self.__items[0] right = self.__items[1] # if this object itself is below the threshold value we only need to # return it's contents as a list if self.level() <= threshold: return [self.fullyflatten()] # if this cluster's le...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getlevel(self, threshold):\r\n\r\n # if it's not worth clustering, just return the data\r\n if len(self._input) <= 1: return self._input\r\n\r\n # initialize the cluster if not yet done\r\n if not self.__clusterCreated: self.cluster()\r\n\r\n return self._data[0].getlevel(threshold)", ...
[ "0.704368", "0.69042367", "0.63809484", "0.60775495", "0.6060966", "0.5509641", "0.54894614", "0.54578686", "0.53653306", "0.5359133", "0.5332252", "0.53257114", "0.5320529", "0.5302355", "0.52831155", "0.52819973", "0.5248203", "0.5214445", "0.5176778", "0.5147579", "0.51344...
0.7113961
0
Warning utility function to check that data type is floating point. Returns True if a warning was raised (i.e. the input is not float) and False otherwise, for easier input validation.
def warn_if_not_float(X: np.ndarray, estimator: str = "This algorithm") -> bool: if not isinstance(estimator, str): estimator = estimator.__class__.__name__ if X.dtype.kind != "f": warnings.warn( "%s assumes floating point values as input, " "got %s" % (estimator, X.dtype...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _validate_float(datum, **kwargs):\n return isinstance(datum, (int, float, numbers.Real)) and not isinstance(datum, bool)", "def isfloat(value): \n try:\n float(value)\n return True\n\n except ValueError:\n return False", "def isfloat(value):\n try:\n float(value)\n ...
[ "0.7820782", "0.7690157", "0.760386", "0.7591289", "0.75334257", "0.7512856", "0.7512856", "0.7512856", "0.7512856", "0.74989486", "0.74751574", "0.7422151", "0.73417556", "0.7322175", "0.73154104", "0.71956474", "0.70990777", "0.7090695", "0.69096863", "0.68632746", "0.68027...
0.73248017
13
Extract the device major number from a raw device number (usually the st_dev or st_rdev field from stat).
def major(self, device: int) -> int: return self.device(device).major
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def major(device):\n return 0", "def minor(device):\n return 0", "def makedev(self, major: int, minor: int) -> int:\n return self.device.from_major_and_minor(major, minor).device", "def os_major_version(node, **kw):\n cmd = r\"cat /etc/os-release | tr -dc '0-9.'| cut -d \\. -f1\"\n version...
[ "0.7374722", "0.6379159", "0.63610804", "0.63375103", "0.6017728", "0.5997743", "0.59911186", "0.59454596", "0.5876061", "0.5780164", "0.57671213", "0.5740737", "0.57006836", "0.5657555", "0.55648774", "0.5432562", "0.5420687", "0.5386618", "0.5386519", "0.53753847", "0.53702...
0.76458305
0
Extract the device minor number from a raw device number (usually the st_dev or st_rdev field from stat).
def minor(self, device: int) -> int: return self.device(device).minor
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def minor(device):\n return 0", "def major(self, device: int) -> int:\n return self.device(device).major", "def makedev(self, major: int, minor: int) -> int:\n return self.device.from_major_and_minor(major, minor).device", "def makedev(major, minor):\n return 0", "def device_get_serial(...
[ "0.7645338", "0.65334696", "0.6508994", "0.6298867", "0.62836903", "0.6274462", "0.6075975", "0.60501504", "0.6045134", "0.6000099", "0.5842958", "0.58385783", "0.5804117", "0.5764712", "0.57396555", "0.5670437", "0.5650476", "0.56230116", "0.559066", "0.55849445", "0.5560057...
0.76718515
0
Return the real group id of the current process.
def getgid(self) -> int: return self.filesystem.user.gid
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def group_id(self) -> str:\n return pulumi.get(self, \"group_id\")", "def group_id(self) -> str:\n return pulumi.get(self, \"group_id\")", "def group_id(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"group_id\")", "def group_id(self):\n return self._group_id", "def gro...
[ "0.8003863", "0.8003863", "0.78206134", "0.77451724", "0.7739301", "0.76787055", "0.76769704", "0.74645954", "0.7460575", "0.7430871", "0.73900265", "0.73900265", "0.73900265", "0.7350881", "0.72090745", "0.7190036", "0.7105509", "0.70453984", "0.69792265", "0.69698423", "0.6...
0.6732383
35
Return the number of CPUs in the system. Returns None if undetermined. This number is not equivalent to the number of CPUs the current process can use. The number of usable CPUs can be obtained with len(os.sched_getaffinity(0))
def cpu_count(self) -> int: return self.operating_system.cpu_count
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def detect_num_cpus():\n # Linux, Unix and MacOS:\n if hasattr(os, \"sysconf\"):\n if os.sysconf_names.has_key(\"SC_NPROCESSORS_ONLN\"):\n # Linux & Unix:\n ncpus = os.sysconf(\"SC_NPROCESSORS_ONLN\")\n if isinstance(ncpus, int) and ncpus > 0:\n return n...
[ "0.81441087", "0.8115398", "0.80961096", "0.8064208", "0.80622363", "0.804591", "0.80405086", "0.79918855", "0.7939137", "0.7933173", "0.7889839", "0.7844869", "0.783822", "0.7811482", "0.7797675", "0.772553", "0.7574506", "0.7572694", "0.7470048", "0.74538124", "0.7404665", ...
0.73853517
21
Loads data for the specified city and filters by month and day if applicable.
def load_data(city, month, day): # 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 from Start Time to create new columns df['month'] = df[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_city_data(city, month, day):\n df = pd.read_csv(CITY_DATA[city])\n #extract month, day, hour from start time\n df['month'] = pd.to_datetime(df['Start Time']).dt.month_name()\n df['day'] = pd.to_datetime(df['Start Time']).dt.weekday\n df['hour'] = pd.to_datetime(df['Start Time']).dt.hour\n\n...
[ "0.83183426", "0.8226356", "0.8151101", "0.8079268", "0.8042597", "0.80175805", "0.8000737", "0.79898304", "0.7979253", "0.79773", "0.7972134", "0.79563093", "0.79561317", "0.79485124", "0.79306835", "0.7918349", "0.79127413", "0.7911505", "0.7904748", "0.7902707", "0.7902555...
0.7712783
75
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() # TO DO: display the most common month print("Most common month is '",df['month'].value_counts().idxmax(),"'") # TO DO: display the most common day of week print("Most common da...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def time_stats(df):\r\n\r\n print('\\nThese are the statistics of the most frequent times of travel:\\n')\r\n start_time = time.time()\r\n\r\n # Display the most common month\r\n common_month = df['month'].mode()[0]\r\n print(\"- That's the most common month based on your selection: \" +\r\n ...
[ "0.7973398", "0.7850281", "0.7799274", "0.7773848", "0.77612406", "0.77519774", "0.7737359", "0.7725197", "0.7717466", "0.768436", "0.7682491", "0.7679881", "0.76786137", "0.76490057", "0.7644009", "0.76428723", "0.76417875", "0.7628779", "0.7623496", "0.76232517", "0.7620308...
0.7781246
3
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() # TO DO: display most commonly used start station print("most commonly used start station is", df['Start Station'].value_counts().idxmax()) # TO DO: display most commonly used en...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def station_stats(df):\n\n print('\\033[1m' + 'Calculating the most popular stations and trip...\\n' + '\\033[0m')\n start_time = time.time()\n\n # display the most commonly used start station\n\n start_stn = df['Start Station'].mode()[0]\n print('Most popular start station is {}.'.format(start_stn)...
[ "0.7809938", "0.76727635", "0.7538624", "0.74982685", "0.7490305", "0.74887866", "0.7436869", "0.7429845", "0.74274427", "0.7425571", "0.74126786", "0.7404592", "0.7379482", "0.73747545", "0.7365935", "0.73561436", "0.7351966", "0.7324152", "0.7304813", "0.72998536", "0.72981...
0.7382532
12
Displays statistics on the total and average trip duration.
def trip_duration_stats(df): print('\nCalculating Trip Duration...\n') start_time = time.time() if 'Trip Duration' in df.columns: # TO DO: display total travel time print("Total travel time is- ", df['Trip Duration'].sum()) # TO DO: display mean travel time print("...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def trip_duration_stats(df):\r\n\r\n print('\\nThese are the statistics related to the trips durations:\\n')\r\n start_time = time.time()\r\n\r\n # Display total travel time\r\n total_travel_time = df['Trip Duration'].sum()\r\n print(\"\\n- The total travel time based on your selection is: \" +\r\n ...
[ "0.82698804", "0.81186754", "0.80481917", "0.80468994", "0.79780424", "0.7962861", "0.7959512", "0.7946294", "0.7936397", "0.7929802", "0.79278564", "0.79269135", "0.79246616", "0.79158986", "0.7915428", "0.7913144", "0.79076344", "0.7903745", "0.79023826", "0.78923696", "0.7...
0.79200053
13
Set the counts to zero.
def reset(self): self.hits = 0 self.misses = 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def zero(self):\n self.counter.set_value(0)", "def reinitialize_counts(self):\n for i, c in enumerate(self.counts):\n self.counts[i] = torch.zeros_like(c)", "def reset_count(self) -> None:\n self.__count = 0", "def clear_counts(self):\n self._count.clear()", "def zero...
[ "0.82557034", "0.7953275", "0.78522766", "0.77871394", "0.75408787", "0.7514962", "0.711504", "0.7073983", "0.70302457", "0.7017387", "0.7014451", "0.7002222", "0.6990102", "0.6989836", "0.6931528", "0.68948966", "0.68948966", "0.68766737", "0.6847329", "0.68344533", "0.68330...
0.7407842
6
Test case to update an vpn_credential.
def test_vpn_credential_update(self): vpn_credential_id = _uuid() cred_data = {'name': 'cred2', 'dh': 'New DH value'} update_data = {'vpn_credential': cred_data} return_value = {'name': 'cred2', 'ca': 'CA certificate string', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_person_credential_update(self):\n sequence_list = SequenceList()\n sequence_string = \"\"\"\n Logout\n RequestCredentialFromWebSite\n Tic\n\n LoginDefaultUser\n SubmitCredentialRequest\n Tic\n CallAcceptSubmittedCredentialsAlarm\n Tic\n Logout\n\n Lo...
[ "0.6831985", "0.63885546", "0.6310723", "0.61546576", "0.61370915", "0.6124448", "0.6079923", "0.60411626", "0.6015681", "0.6008529", "0.5982451", "0.59497225", "0.59260935", "0.5921229", "0.5889073", "0.5841995", "0.58056366", "0.5798024", "0.5772509", "0.5768059", "0.571244...
0.8275943
0
Log Errors caused by Updates.
def error(update, context): logger.warning('Update "%s" caused error "%s"', update, context.error)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def error(update, context):\n\tlogger.warning('Update \"%s\" caused error \"%s\"', update, context.error)", "def error(update, context):\n\tlogger.warning('Update \"%s\" caused error \"%s\"', update, context.error)", "def error(self, update, context):\n self.logger.warning('Update \"%s\" caused error \"...
[ "0.7895998", "0.7895998", "0.78257465", "0.77876204", "0.77470577", "0.77470577", "0.77470577", "0.77470577", "0.77470577", "0.77470577", "0.77470577", "0.77470577", "0.77470577", "0.77470577", "0.77470577", "0.77470577", "0.77470577", "0.77470577", "0.77470577", "0.77470577", ...
0.77857095
5
Computes linear function of the parameters W and b, and previous activation A
def linear_forward(A_prev, W, b): Z = np.dot(W, A_prev) + b cache = (A_prev, W, b) return Z, cache
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def linearForward(A_prev, w, b):\n\n Z = np.dot(w, A_prev) + b\n\n return Z", "def linear_activation_forward(A_prev, W, b, activation):\r\n #print(A_prev.shape)\r\n #print(W.shape)\r\n if activation == \"sigmoid\":\r\n # Inputs: \"A_prev, W, b\". Outputs: \"A\"\r\n ### START CODE HER...
[ "0.78389436", "0.7811696", "0.7779692", "0.7735543", "0.7718614", "0.7708923", "0.7698803", "0.76554763", "0.76222", "0.7576803", "0.75659966", "0.7539659", "0.7498914", "0.7446948", "0.7423666", "0.7384398", "0.73757184", "0.735914", "0.73314816", "0.72930145", "0.72807217",...
0.7585812
9
Draw samples from a standard Normal distribution (mean=0, stdev=1).
def standard_normal(self, size): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generateNormalDraws(mu, sigma, N, seed):\n\n # Set up the RNG\n RNG = np.random.RandomState(seed)\n\n # Set up empty list to populate, then loop and populate list with draws: \n if type(sigma) == float:\n draws = sigma*RNG.randn(N) + mu\n else:\n draws=[]\n for t in range(...
[ "0.7150561", "0.70340735", "0.6934144", "0.6811952", "0.6598774", "0.65428364", "0.6539484", "0.65348893", "0.65213495", "0.6514989", "0.649995", "0.6490195", "0.6486771", "0.646989", "0.6442009", "0.6422361", "0.6407817", "0.63639003", "0.6349538", "0.6308555", "0.6298822", ...
0.6652685
4
Convert ROS transform to dual quaternions
def test_from_ros_transform(self): try: transform_msg = Transform(Vector3(1, 0.5, -1), Quaternion(0.707, 0, 0.707, 0.707)) dq = from_ros(transform_msg) except Exception as e: self.fail(e)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rod2quat(ro):\r\n\r\n \"\"\"Step 1: Rodrigues-Frank vector to axis angle pair.\"\"\"\r\n\r\n ax = torch.where(torch.isfinite(ro[...,3:4]),\r\n torch.cat((ro[...,0:3]*torch.linalg.norm(ro[...,0:3],dim=-1,keepdim=True), 2.*torch.arctan(ro[...,3:4])), dim=-1),\r\n torch.cat((ro[...,0:3], _p...
[ "0.7050941", "0.68490076", "0.68490076", "0.6828139", "0.6781076", "0.6781076", "0.6754772", "0.6676696", "0.6616837", "0.65952617", "0.6522468", "0.6522468", "0.64641434", "0.64641434", "0.6429059", "0.6409924", "0.6392671", "0.6392671", "0.6379458", "0.6371875", "0.63717234...
0.0
-1
Convert dual quaternion to ros transform
def test_to_ros_transform(self): self.assertEqual(to_ros_transform(self.identity_dq), self.identity_transform)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transformFromQuaternion(*args):\n return _almathswig.transformFromQuaternion(*args)", "def transformFromQuaternion(*args):\n return _almathswig.transformFromQuaternion(*args)", "def quaternionFromTransform(*args):\n return _almathswig.quaternionFromTransform(*args)", "def quaternionFromTransform(*args...
[ "0.6942227", "0.6942227", "0.6806023", "0.6806023", "0.6528109", "0.6403034", "0.6403034", "0.63990694", "0.6358004", "0.63264084", "0.6276142", "0.62583226", "0.62574834", "0.625093", "0.62365186", "0.61995554", "0.6169929", "0.6164103", "0.6154379", "0.6152723", "0.6152723"...
0.0
-1
Is true if metronome mark is entirely textual or if metronome mark's units_per_minute is a range.
def is_imprecise(self) -> bool: if self.reference_duration is not None: if self.units_per_minute is not None: if not isinstance(self.units_per_minute, tuple): return False return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_unit( self ):\n return not self.is_zero()", "def is_minute_separator_in(text):\n for separator in text.split(\" \"):\n #print(separator, text)\n if(separator in dict_text_minutes_separator_to_led):\n return True\n\n return False", "def whattimeisit(self):\n ...
[ "0.58811074", "0.58389616", "0.5764563", "0.5756175", "0.56925035", "0.56199753", "0.55945325", "0.5532021", "0.549948", "0.5476679", "0.5424994", "0.5402374", "0.5371484", "0.5357138", "0.535427", "0.5353677", "0.53372335", "0.5334473", "0.53183043", "0.5304466", "0.5296532"...
0.54106253
11
Gets reference duration of metronome mark.
def reference_duration(self) -> typing.Optional[Duration]: return self._reference_duration
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def duration(self):\n\n try:\n return self.end.t - self.start.t\n except:\n LOGGER.warn('no end time found for note')\n return 0", "def get_duration(self):\n return self.audio.get_duration()", "def _get_duration(self):\n return self.__duration", "def g...
[ "0.70203245", "0.6756817", "0.6620228", "0.65439636", "0.6487111", "0.6434793", "0.63730454", "0.6361271", "0.6323126", "0.63177174", "0.6305362", "0.62641877", "0.6263976", "0.62609", "0.625046", "0.62105423", "0.62054175", "0.62050116", "0.62018764", "0.6200183", "0.6199617...
0.70105463
1
Gets units per minute of metronome mark.
def units_per_minute(self) -> typing.Union[int, Fraction, None]: return self._units_per_minute
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def native_unit_of_measurement(self):\n return UnitOfTime.MINUTES", "def native_unit_of_measurement(self):\n return UnitOfTime.MINUTES", "def unit_of_measurement(self) -> str:\n return str(VOLUME_MILLILITERS)", "def unit_of_measurement(self):\n return \"km/h\"", "def get(self):\...
[ "0.66871446", "0.66871446", "0.6589931", "0.6418095", "0.6361589", "0.63458407", "0.63238364", "0.6286104", "0.6286104", "0.6281104", "0.6267823", "0.62643903", "0.62597185", "0.624396", "0.6242377", "0.62089586", "0.6202436", "0.6103464", "0.606003", "0.60500294", "0.6050029...
0.6847055
0
Gets the instancetype of this V1VirtualMachineSpec. InstancetypeMatcher references a instancetype that is used to fill fields in Template
def instancetype(self): return self._instancetype
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _vm_get_instance_type(self, vm_instance):\n pass", "def instance_type(self) -> Optional[pulumi.Input['InstanceInstanceType']]:\n return pulumi.get(self, \"instance_type\")", "def instance_type(self) -> Optional[str]:\n return pulumi.get(self, \"instance_type\")", "def instance_type(s...
[ "0.72623104", "0.7215085", "0.71939903", "0.71457696", "0.71457696", "0.70274794", "0.6914798", "0.6914798", "0.69064635", "0.68412894", "0.6614098", "0.63049626", "0.62162846", "0.59173787", "0.5909453", "0.5747529", "0.5746794", "0.57215226", "0.5670614", "0.5623344", "0.55...
0.676191
10
Sets the instancetype of this V1VirtualMachineSpec. InstancetypeMatcher references a instancetype that is used to fill fields in Template
def instancetype(self, instancetype): self._instancetype = instancetype
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_instance_type(self, instance_type):\n self._instance_type = instance_type", "def _vm_get_instance_type(self, vm_instance):\n pass", "def set_instance_type(self, block, type):\n if not self.db.check_block(block):\n return 'No such block: %s' % block\n elif not self...
[ "0.75184923", "0.60125303", "0.59037167", "0.5890068", "0.57293946", "0.5668257", "0.56578785", "0.56578785", "0.5656597", "0.5637203", "0.5634798", "0.5448071", "0.5430985", "0.5371104", "0.53205305", "0.5313743", "0.5296726", "0.52851135", "0.5229779", "0.52278316", "0.5212...
0.73937416
1
Gets the preference of this V1VirtualMachineSpec. PreferenceMatcher references a set of preference that is used to fill fields in Template
def preference(self): return self._preference
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_preference(self):\n return self.__preference", "def _get_preference(self):\n return self.__preference", "def _get_preference(self):\n return self.__preference", "def _get_preference(self):\n return self.__preference", "def _get_preference(self):\n return self.__preference", "def _...
[ "0.6515953", "0.6515953", "0.6515953", "0.6515953", "0.6515953", "0.6515953", "0.6515953", "0.6515953", "0.6515953", "0.6515953", "0.6515953", "0.6515953", "0.6515953", "0.6515953", "0.6515953", "0.6515953", "0.6515953", "0.6515953", "0.6515953", "0.6515953", "0.6515953", "...
0.6812791
0
Sets the run_strategy of this V1VirtualMachineSpec. Running state indicates the requested running state of the VirtualMachineInstance mutually exclusive with Running
def run_strategy(self, run_strategy): self._run_strategy = run_strategy
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_runMode(self,running):\n if running:\n self.runMode = simV2.VISIT_SIMMODE_RUNNING\n else:\n self.runMode = simV2.VISIT_SIMMODE_STOPPED\n return", "def run_status(self, run_status):\n allowed_values = [\"Running\", \"Stopped\", \"Invalid\", \"Validating\",...
[ "0.584446", "0.51953274", "0.5167168", "0.5046461", "0.5015065", "0.4977478", "0.49580505", "0.4878557", "0.47462344", "0.46744835", "0.46548966", "0.46386224", "0.46210268", "0.46161535", "0.46156558", "0.45566207", "0.45499197", "0.44909352", "0.44733074", "0.44426018", "0....
0.64058656
0
Returns the string representation of the model
def to_str(self): return pformat(self.to_dict())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _repr_model_(self):\n return str(self)", "def __str__(self):\n\n return str(self.model)", "def get_model_string(self):\n raise NotImplementedError()", "def __str__(self):\n return self.model", "def serialize_model(self):\n return dill.dumps(self.model)", "def __str_...
[ "0.8602374", "0.85093755", "0.8237104", "0.8050309", "0.80128866", "0.79348034", "0.78766525", "0.77898884", "0.7786461", "0.7745792", "0.7627315", "0.76055235", "0.757999", "0.7514394", "0.75038797", "0.75035286", "0.74850684", "0.7440529", "0.74325883", "0.74239755", "0.740...
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 return not self == other", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other):\n return self.__dict__ != other.__dict__", "def __eq__(self, other):\n return not self.__ne__(other)", ...
[ "0.8410264", "0.83913255", "0.81718874", "0.8140831", "0.809181", "0.80886894", "0.8067484" ]
0.0
-1
Configure log queue listener to log into file and console.
def configure_handlers(console=LOGGING_CONSOLE, log_path=LOGGING_FILE): global log_qlistener log_qlistener.stop() handlers = [] # rotating file handler if log_path: file_handler = RotatingFileHandler( log_path, maxBytes=10 * 2 ** 20, backupCount=1 # 10 MB # 1 backup ) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup_logging_queue() -> None:\n queue = Queue()\n root = logging.getLogger()\n\n handlers: List[logging.Handler] = []\n\n handler = LocalQueueHandler(queue)\n root.addHandler(handler)\n for h in root.handlers[:]:\n if h is not handler:\n root.removeHandler(h)\n h...
[ "0.7407966", "0.6929798", "0.67627853", "0.6734167", "0.6709939", "0.66734517", "0.66513", "0.6638368", "0.6629239", "0.6391323", "0.63722426", "0.6359333", "0.6356595", "0.63536316", "0.634986", "0.6326223", "0.6289298", "0.627963", "0.62052244", "0.6191678", "0.61846685", ...
0.7751769
0
Apply a masked softmax on the last dimension of a tensor. The input tensor and mask should be of size (batch, , sequence_length).
def masked_softmax(tensor, mask): tensor_shape = tensor.size() reshaped_tensor = tensor.view(-1, tensor_shape[-1]) # Reshape the mask so it matches the size of the input tensor. while mask.dim() < tensor.dim(): mask = mask.unsqueeze(1) mask = mask.expand_as(tensor).contiguous().float() r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def masked_attention_with_softmax(e, masks):\n attn_dist = nn_ops.softmax(e) # take softmax. shape (batch_size, attn_length)\n attn_dist *= masks # apply mask\n masked_sums = tf.reduce_sum(attn_dist, axis=1) # shape (batch_size)\n return attn_dist / tf.reshape(masked_sums, [-1, 1]) # re-normalize",...
[ "0.7276748", "0.7222488", "0.71866333", "0.70539594", "0.70037156", "0.69497067", "0.6839349", "0.68012094", "0.6759646", "0.6744299", "0.6736858", "0.6664875", "0.6648626", "0.6604984", "0.65941125", "0.65421045", "0.64377475", "0.6428738", "0.63854593", "0.63684136", "0.635...
0.7726801
0
Update parameters by AdamWeightDecay op.
def _adam_opt(opt, beta1, beta2, eps, lr, weight_decay, param, m, v, gradient): opt(param, m, v, lr, beta1, beta2, eps, weight_decay, gradient) return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_parameters(self, learning_rate=0.01): \n for i in range(1, len(self.layers)):\n self.weights[i] -= learning_rate * self.weights_grads[i]\n self.biases[i] -= learning_rate * self.biases_grads[i]", "def update_parameters(params: dict, grads: dict, learning_rate: float...
[ "0.7124586", "0.70610476", "0.7050799", "0.70388955", "0.70134604", "0.7000923", "0.6997818", "0.6995201", "0.69906914", "0.6969242", "0.6912167", "0.6903462", "0.68493915", "0.6841783", "0.68379056", "0.68280977", "0.6789716", "0.6789716", "0.6763298", "0.67581546", "0.67515...
0.0
-1
Retreive the etag from aws s3 object.
def __get_s3obj_etag(s3object): return s3object.meta.data['ETag'].replace("\"", "")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def etag(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"etag\")", "def etag(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"etag\")", "def etag(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"etag\")", "def etag(self) -> pulumi.Output[str]:\n return pul...
[ "0.6643385", "0.6643385", "0.6643385", "0.6643385", "0.6643385", "0.6643385", "0.6643385", "0.6643062", "0.6643062", "0.6643062", "0.6643062", "0.6643062", "0.6643062", "0.6643062", "0.6614063", "0.66050446", "0.65973365", "0.65617603", "0.6527289", "0.6527289", "0.6527289", ...
0.8788675
0
Register a user into the database
def users_create(user: UserBaseModel, response: Response, redirect_to: Optional[str] = ''): new_user = User(user.email) response1 = new_user.insert(user.password, redirect_to) if 'error' in response1: response.status_code = 403 return response1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def register_user(self):\n db.session.add(self)\n db.session.commit()", "def db_register_user(form):\n hashed_password = bcrypt.generate_password_hash(form.password.data).decode('utf-8')\n user = User(username=form.username.data, email=form.email.data, password=hashed_password)\n db.sessio...
[ "0.8532667", "0.8317741", "0.7925999", "0.79185045", "0.7828189", "0.7740786", "0.77401865", "0.77331936", "0.7714213", "0.7709093", "0.76972616", "0.768982", "0.7663275", "0.7653748", "0.7650945", "0.7640527", "0.7608079", "0.7605727", "0.7596884", "0.75255823", "0.7506841",...
0.0
-1
Std space, linear interpolation
def eval_linear_interp(source, **_kwargs): from returnn.tf.compat import v1 as tf log1 = source(0) # +log space, external_lm log2 = source(1) # +log space, "internal" LM weighted_log1 = log1 + tf.math.log(_lm_scale) weighted_log2 = log2 + tf.math.log(1-_lm_scale) out = tf.math.reduce_logsumexp([weighted_l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lin_interp(x,x0,x1,y0,y1):\r\n \r\n return y0+(y1-y0)*(x-x0)/(x1-x0)", "def standardize(x: np.ndarray) -> np.ndarray:\n return (x - x.mean()) / x.std()", "def _scale(self, x):\n return torch.tensor([x]).expand_as(std) / std", "def standardize(x):\r\n mean_x = np.mean(x, axis=0)\r\n ...
[ "0.5829107", "0.5761656", "0.5756941", "0.5738855", "0.5738604", "0.57356036", "0.57276297", "0.5707848", "0.5672874", "0.5653288", "0.5638255", "0.5622208", "0.5569285", "0.55581075", "0.55366594", "0.5536397", "0.55304676", "0.5518676", "0.55162203", "0.5513989", "0.5509583...
0.0
-1
Creates a new rendering definition object along with its subobjects.
def createNewRenderingDef_async(self, _cb, pixels, current=None): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_obj_viz(self):\n for marker_name, m in self._markers.items():\n m_T = m.get_current_transform()\n self.viz_ids[marker_name] = self.visualize_position(\n m_T.translation, self.viz_ids[marker_name]\n )\n\n rom = self.get_rigid_object_manager()...
[ "0.5843569", "0.5760903", "0.5748811", "0.57078874", "0.5698705", "0.5532999", "0.5494274", "0.54750067", "0.54507446", "0.54126495", "0.5383608", "0.53640974", "0.53558224", "0.53439605", "0.5331206", "0.53271496", "0.53267264", "0.53196305", "0.53172565", "0.5285443", "0.52...
0.48969805
99
Returns bool for days when average max temperature is above some value.
def temp_above_feature(df, temp_thresh=90): # Find appropriate date range min_date = df.time_created.min().strftime('%Y-%m-%d') max_date = df.time_created.max().strftime('%Y-%m-%d') # Get non-weird weather events within that date range conn = pgw.get_conn() temps = pd.read_sql_query(("select d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_temp_gt_25(self):\r\n return self.temp > 25.0", "def is_temp_lte_25(self):\r\n return self.temp <= 25.0", "def isMax(self):\n\t\treturn True", "def _check_below_average_last_sold(self, item: LockedDict, condition: LockedDict) -> bool:\n last_sold = self.get_sold_history(market_nam...
[ "0.66872305", "0.65228677", "0.61764497", "0.6057062", "0.60123515", "0.60123515", "0.596344", "0.59491694", "0.5903083", "0.58894616", "0.5797022", "0.57957965", "0.5718778", "0.57162166", "0.5712483", "0.5697726", "0.5690974", "0.56819516", "0.56316084", "0.5617692", "0.561...
0.57250553
12
Returns bool for days when average min temperature is below some value.
def temp_below_feature(df, temp_thresh=25): # Find appropriate date range min_date = df.time_created.min().strftime('%Y-%m-%d') max_date = df.time_created.max().strftime('%Y-%m-%d') # Get non-weird weather events within that date range conn = pgw.get_conn() temps = pd.read_sql_query(("select d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_temp_gt_25(self):\r\n return self.temp > 25.0", "def test_daily_min_all_below(ten_days):\n data = pd.Series(1, index=ten_days)\n assert_series_equal(\n pd.Series(False, index=ten_days),\n util.daily_min(data, minimum=2)\n )", "def is_temp_lte_25(self):\r\n return sel...
[ "0.6537306", "0.6526031", "0.6487432", "0.6341113", "0.62753963", "0.6068673", "0.6000751", "0.6000751", "0.59678006", "0.5957272", "0.5934192", "0.5864901", "0.58445734", "0.5840267", "0.5832726", "0.5824484", "0.5821818", "0.5807002", "0.57754695", "0.5769542", "0.57333004"...
0.5742783
20
calculated the duration in minutes of the incident from the time it was created until the time it closed
def incident_duration_feature(df): df["duration"] = df.apply(lambda incident: (incident.time_closed - incident.time_created).total_seconds()/60, axis=1) return (df.duration)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def duration(self):\n return int( (self.end_date - self.start_date).total_seconds()/60.) if self.end_date and self.start_date else ''\n #return (datetime.now(tz=tz) - self.start_date).total_seconds()/60.", "def get_duration(self):\n return self.get_end_time() - self.get_start_time()", "def...
[ "0.6938557", "0.678947", "0.6762039", "0.6748346", "0.6725635", "0.6667273", "0.6601431", "0.6551434", "0.6404805", "0.63609326", "0.63523453", "0.63341457", "0.63234514", "0.6323209", "0.6292528", "0.6280275", "0.6250931", "0.62501746", "0.6178494", "0.6163758", "0.6149901",...
0.70906854
0
checks if an incident was during the weekend
def time_weekend_feature(df): import datetime return df.apply(lambda x: True if datetime.datetime(int(x.time_year), int(x.time_month), int(x.time_day)).weekday() > 4 else False, a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sleep_in(weekday, vacation):\n if not weekday or vacation:\n return True\n else:\n return False", "def is_weekend(input_date):\n return input_date.weekday() in [5, 6]", "def is_workingday(dt):\n return dt.weekday() < 5 and not is_public_holiday(dt)", "def is_weekend(date):\n return date....
[ "0.668519", "0.66713476", "0.6613245", "0.6519674", "0.65028733", "0.641564", "0.6337199", "0.63256526", "0.62637883", "0.62345916", "0.62143195", "0.6210388", "0.618559", "0.61327654", "0.61133707", "0.6072754", "0.6054229", "0.60187775", "0.60170406", "0.60007185", "0.59184...
0.60944116
15
For testing users' names.
def validate_person_name(value): disallowed_names = [ "anon", "anonymous", "admin", "administrator", "guest", "help", "moderator", "owner", "postmaster", "root", "superuser", "support", "sysadmin", "syste...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_name_test(value):\n print('User name: {0}'.format(value))", "def test_models_users_username_special_characters(self):\n user = UserFactory(username=\"dave.bowman-1_1\")\n self.assertEqual(user.username, \"dave.bowman-1_1\")", "def get_user_name(self):\n pass", "def test_user...
[ "0.7942896", "0.75415426", "0.74411196", "0.7432935", "0.7432935", "0.7394738", "0.73714", "0.73670757", "0.73233795", "0.72628653", "0.72476053", "0.7222575", "0.7154364", "0.7097863", "0.7054193", "0.70291704", "0.7015299", "0.6976299", "0.6932931", "0.6908584", "0.69006735...
0.0
-1
Returns the string representation of the model
def to_str(self): import simplejson as json if six.PY2: import sys reload(sys) sys.setdefaultencoding("utf-8") return json.dumps(sanitize_for_serialization(self), ensure_ascii=False)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _repr_model_(self):\n return str(self)", "def __str__(self):\n\n return str(self.model)", "def get_model_string(self):\n raise NotImplementedError()", "def __str__(self):\n return self.model", "def serialize_model(self):\n return dill.dumps(self.model)", "def __str_...
[ "0.8602374", "0.85093755", "0.8237104", "0.8050309", "0.80128866", "0.79348034", "0.78766525", "0.77898884", "0.7786461", "0.7745792", "0.7627315", "0.76055235", "0.757999", "0.7514394", "0.75038797", "0.75035286", "0.74850684", "0.7440529", "0.74325883", "0.74239755", "0.740...
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 return not self == other", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other):\n return self.__dict__ != other.__dict__", "def __eq__(self, other):\n return not self.__ne__(other)", ...
[ "0.8410264", "0.83913255", "0.81718874", "0.8140831", "0.809181", "0.80886894", "0.8067484" ]
0.0
-1
Create start tag of blockquote element.
def start_blockquote(self, cite=None, attrs=None): if attrs is None or not isinstance(attrs, dict): attrs = dict() if cite is not None: attrs['cite'] = cite return self._create_start_tag(u'blockquote', attrs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new_blockquote(self, quote: str):\n return f\"{MARKDOWN_BLOCKQUOTE} {quote}\"", "def end_blockquote(self):\n return self._create_end_tag(u'blockqute')", "def markup_start(self, node: Union[ASTNode, str]) -> str:\n if hasattr(node, \"symbol\"):\n node = node.symbol\n r...
[ "0.6136499", "0.5769213", "0.5655611", "0.5652243", "0.546597", "0.5463515", "0.5377529", "0.5361742", "0.53529364", "0.53523535", "0.53368187", "0.5167478", "0.49973726", "0.49918327", "0.49804056", "0.495762", "0.49539977", "0.49537057", "0.49474096", "0.49088258", "0.48925...
0.7154386
0
Gets all the Books for a given Genre. Defaults to the predictions for the genre, otherwise returns all.
def get_genre_media(self, request): try: genre = models.BookGenre.objects.get(name=request.GET['name']) user = User.objects.get(pk=request.GET['id']) except genre.DoesNotExist or user.DoesNotExist or ValueError: Response(status=status.HTTP_400_BAD_REQUEST) pr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __get_movies_of_genre(self, genre):\n return filter(lambda movie: genre in movie.get_genres(),self.all_movies)", "def browse(cls,genre='none'):\n if genre == 'none':\n return choice(Book.on_shelf)\n else:\n books_in_genre = []\n for num in range(0,len(Boo...
[ "0.63583845", "0.6314794", "0.63070625", "0.62776256", "0.6023107", "0.58864623", "0.58849746", "0.5837", "0.5827059", "0.57138664", "0.5690818", "0.5676181", "0.5661262", "0.5659843", "0.56115294", "0.56079775", "0.55869937", "0.54137653", "0.5329573", "0.52764124", "0.52505...
0.61739254
4
\ autogossip on|off generate random background conversation
def autogossip(*args): mode = 'on' if (args and args[0].lower() == 'on') else 'off' stdout.say('Turning autogossip %s.' % mode) global should_autogossip should_autogossip = bool(mode == 'on')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rand(self):\n pass", "def generate():\n return \"\".join(random.choice(\"TGAC\") for _ in range(100))", "async def dice(ctx):\n await ctx.send(random.randint(1, 6))", "def generate(self, random_state):\n pass", "def dado():\n return rnd.randint(1, 20)", "def getRandom():\n r...
[ "0.5919407", "0.58975995", "0.58392483", "0.58357996", "0.58196115", "0.5810004", "0.5794838", "0.5763047", "0.57434684", "0.57361525", "0.57321155", "0.5707071", "0.5686297", "0.5657117", "0.561857", "0.5586862", "0.5576636", "0.5526563", "0.5506994", "0.550675", "0.5506249"...
0.535904
43
r"""Apply softmax on flattened spatial dimensions and then unflatten again.
def spatial_softmax(features): if not CHANNELS_FIRST: raise NotImplementedError N, C, H, W = shape_as_list(features) probs = F.softmax(features.view(N * C, H * W), dim=-1) probs = probs.view(N, C, H, W) return probs
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def softmax(x, axis=1):\n return Softmax(axis=axis).apply((x,))[0]", "def softmax(input, dim=None):\n return F.softmax(input, dim)", "def softmax1(x):\n x = x.copy()\n N, k = x.shape\n\n for i in prange(N):\n x_max = 0\n for j in range(k):\n if x[i, j] > x_max:\n ...
[ "0.6969209", "0.68009704", "0.6742841", "0.6670887", "0.6620199", "0.66176265", "0.6605752", "0.659408", "0.658198", "0.65726215", "0.65605813", "0.655938", "0.6545726", "0.65016675", "0.64837986", "0.647826", "0.6463433", "0.64397395", "0.6439482", "0.64373916", "0.64192855"...
0.0
-1
fill diagonal of L with elements from diag_L. equivalent to tf.linalg.set_diag(L, diag_L).
def set_diag(L, diag_L): d = shape_as_list(L)[2] M = L M[:, torch.arange(0, d), torch.arange(0, d)] = diag_L return M
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_diag(laplacian, value, norm_laplacian):\n n_nodes = laplacian.shape[0]\n # We need all entries in the diagonal to values\n if not sparse.isspmatrix(laplacian):\n if norm_laplacian:\n laplacian.flat[::n_nodes + 1] = value\n else:\n laplacian = laplacian.tocoo()\n ...
[ "0.61306304", "0.61021084", "0.5820608", "0.57647586", "0.57647586", "0.57647586", "0.57647586", "0.5654932", "0.5604874", "0.55983585", "0.5585153", "0.5530157", "0.5511156", "0.5498573", "0.5498303", "0.547998", "0.5475637", "0.5423643", "0.53517014", "0.5308458", "0.529619...
0.84071845
0
Implements normal Gaussian distribution with diagonal covariance matrix.
def __init__(self, parameters, dim, stochastic=True): self.parameters = parameters self.dim = dim self.stochastic = stochastic ps = shape_as_list(self.parameters) if len(ps) != 2: assert len(ps) == 4 self.expand_dims = True self.parameters = s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _mvd_grad_mean_gaussian_diagonal_covariance(self, dist_samples):\n print(\"----Grad mean\", flush=True)\n\n mean, std = self._distribution.get_mean_and_std()\n diag_std = std\n\n # Replicate the second to last dimension\n # (B, D, D)\n multiples = [1, self._dims, 1]\n ...
[ "0.6932088", "0.6854636", "0.6764121", "0.668178", "0.65966433", "0.65643996", "0.64995545", "0.64710927", "0.6397733", "0.6306048", "0.6268857", "0.62277496", "0.62174416", "0.6212519", "0.61844057", "0.61809605", "0.61532325", "0.6126352", "0.6094615", "0.60930586", "0.6078...
0.0
-1
Creates one_hot representation of x with `n_dims` = `n_classes`.
def to_one_hot(y, n_dims): if y.is_cuda: dtype = torch.cuda.FloatTensor long_dtype = torch.cuda.LongTensor else: dtype = torch.FloatTensor long_dtype = torch.LongTensor scatter_dim = len(y.size()) y_tensor = y.type(long_dtype).view(*y.size(), -1) zeros = torch.zeros(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def one_hot(x, n_classes):\n\n x_oh = np.zeros((len(x), n_classes))\n x_oh[np.arange(len(x)), x] = 1.0\n\n return x_oh", "def make_one_hot(input_tensor, num_classes):\n input_tensor = input_tensor[:, np.newaxis, ::]\n shape = np.array(input_tensor.shape)\n shape[1] = num_classes\n shape = tu...
[ "0.88378274", "0.8346549", "0.8277499", "0.8273541", "0.81815225", "0.8175869", "0.8149579", "0.81226736", "0.81082225", "0.8077446", "0.8015347", "0.7925427", "0.7924388", "0.7861072", "0.7833697", "0.7818287", "0.779831", "0.7787224", "0.7771028", "0.7768209", "0.77084434",...
0.74211025
65
Reverse tensor order aling given dimension. Dropin replacement for tf.reverse(x, axis)
def flip(x, dim): indices = [slice(None)] * x.dim() indices[dim] = torch.arange( x.size(dim) - 1, -1, -1, dtype=torch.long, device=x.device ) return x[tuple(indices)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _reverse(tensor, axis=0):\n indices = torch.arange(tensor.shape[axis]-1, -1, -1, dtype=torch.int64)\n return tensor.index_select(axis, indices)", "def reverse(\n input: oneflow._oneflow_internal.BlobDesc,\n axis: Union[int, Sequence[int]],\n name: Optional[str] = None,\n) -> oneflow._oneflow_i...
[ "0.740734", "0.69015884", "0.6685788", "0.6644339", "0.64880735", "0.64706165", "0.61962974", "0.61209977", "0.6067951", "0.6054175", "0.6038486", "0.59925646", "0.5928614", "0.58584887", "0.5854121", "0.5791452", "0.57762057", "0.57572895", "0.5710197", "0.56693685", "0.5655...
0.67681915
2
View to admit patient to a hospital from a list of patients not in hospitals
def admit_patient(request): employee = UserFactory.get_user(request) hospital = Hospital.objects.get(name="Not in hospital") if (request.method == "GET"): patient_list = Patient.objects.filter(hospital=hospital) context = { 'patient_list': patient_list } retur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def view(request):\n\n # Build the list of patients based on the user\n\n patient_list = []\n\n user = UserFactory.get_user(request)\n\n if UserFactory.isNurse(user):\n patient_list = Patient.objects.filter(hospital=user.hospital)\n elif UserFactory.isDoctor(user):\n patient_list = Pat...
[ "0.70185274", "0.61321294", "0.5834828", "0.55149025", "0.53948224", "0.53469", "0.5344014", "0.5327538", "0.5315497", "0.52526593", "0.52025646", "0.5201464", "0.51893866", "0.51860625", "0.5146505", "0.51078606", "0.5094881", "0.50838906", "0.5064605", "0.5063834", "0.50488...
0.6834563
1
Render the about me page
def about(): return render_template("about.html")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def about():\n user = current_user\n return render_template('home.about.html', user=user)", "def about():\n return render_template(\"about.html\")", "def about():\n\n return render_template('about_page/about.html')", "def about(request):\n\treturn render_to_response('aboutus.html')", "def a...
[ "0.8118194", "0.79594773", "0.7872203", "0.78663605", "0.7734216", "0.77329475", "0.7726991", "0.7700121", "0.7695418", "0.7688191", "0.7688191", "0.7678127", "0.76724976", "0.76724976", "0.76710474", "0.7663806", "0.7656319", "0.7656319", "0.7656319", "0.7656319", "0.7656319...
0.7621128
35
Sets the invoice_no of this InvoiceDetailsM.
def invoice_no(self, invoice_no): self._invoice_no = invoice_no
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def invoice_number(self, invoice_number):\n\n self._invoice_number = invoice_number", "def invoice_id(self, invoice_id):\n\n self._invoice_id = invoice_id", "def invoice_id(self, invoice_id):\n if invoice_id is None:\n raise ValueError(\"Invalid value for `invoice_id`, must not ...
[ "0.7537587", "0.74200875", "0.7104553", "0.6714551", "0.6058776", "0.59817004", "0.5978007", "0.58448064", "0.5820113", "0.576646", "0.5747718", "0.56246763", "0.56140274", "0.5565573", "0.55636233", "0.55209005", "0.5466254", "0.54134786", "0.5381254", "0.5270636", "0.525024...
0.8639859
0
Sets the amount of this InvoiceDetailsM.
def amount(self, amount): self._amount = amount
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_amount(self, amount):\n self._extra_model_amount = amount", "def amount(self, amount: int):\n\n self._amount = amount", "def setAmount(self, Amount):\r\n self.__Amount = Amount", "def set_amount(self, new_amount):\n self._amount = new_amount", "def set(self, treatment_na...
[ "0.74723625", "0.7201728", "0.71803313", "0.7165886", "0.6334574", "0.6334574", "0.632044", "0.6315235", "0.6315235", "0.6315235", "0.6259222", "0.6213717", "0.6182066", "0.61141956", "0.610736", "0.5973717", "0.59728813", "0.5934906", "0.591423", "0.5794762", "0.57860667", ...
0.72654676
3
Sets the bill_date of this InvoiceDetailsM.
def bill_date(self, bill_date): self._bill_date = bill_date
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def billing_reference_date(self, billing_reference_date):\n\n self._billing_reference_date = billing_reference_date", "def _date(self, _date):\n\n self.__date = _date", "def _date(self, _date):\n\n self.__date = _date", "def _date(self, _date):\n\n self.__date = _date", "def aud...
[ "0.6732967", "0.64113265", "0.64113265", "0.64113265", "0.6316693", "0.62647635", "0.625123", "0.625123", "0.625123", "0.62506276", "0.60994864", "0.6091084", "0.6054354", "0.6025893", "0.5989914", "0.59831065", "0.5883037", "0.5799839", "0.5797439", "0.57895774", "0.5760453"...
0.8528608
0
Sets the due_date of this InvoiceDetailsM.
def due_date(self, due_date): self._due_date = due_date
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def due_date(self, due_date):\n self._due_date = due_date", "def date_due(self, date_due):\n\n self._date_due = date_due", "def set_due_date(self, due_date):\n path = self._path + '/due'\n if type(due_date) in [datetime.time, datetime.datetime]:\n due_date = due_date.isof...
[ "0.83473724", "0.8051364", "0.7950609", "0.74594593", "0.7360587", "0.6691394", "0.630787", "0.6098729", "0.5929201", "0.5904933", "0.58617145", "0.580419", "0.5783039", "0.57709116", "0.5754136", "0.570437", "0.5680987", "0.5680987", "0.5680987", "0.5663838", "0.5635407", ...
0.8355582
2
Sets the paid_date of this InvoiceDetailsM.
def paid_date(self, paid_date): self._paid_date = paid_date
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def paid_on(self, paid_on):\n\n self._paid_on = paid_on", "def paid_from(self, paid_from):\n\n self._paid_from = paid_from", "def bill_date(self, bill_date):\n\n self._bill_date = bill_date", "def next_payment_date(self, next_payment_date):\n\n self._next_payment_date = next_payme...
[ "0.68245894", "0.6810538", "0.6313486", "0.62463754", "0.6181701", "0.6146701", "0.6126198", "0.6126198", "0.6126198", "0.61153406", "0.6060011", "0.5959909", "0.59113616", "0.59063715", "0.58068734", "0.577949", "0.57636064", "0.57576704", "0.57535493", "0.57535493", "0.5753...
0.84559536
0
Sets the balance_forward of this InvoiceDetailsM.
def balance_forward(self, balance_forward): self._balance_forward = balance_forward
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def statement_balance_forward(self, statement_balance_forward):\n\n self._statement_balance_forward = statement_balance_forward", "def set_balance(self, balance=0.0):\n self.balance = balance", "def set_balance(self, balance=0.0):\n self.balance = balance", "def set_balance(self, data):\...
[ "0.73178744", "0.65110356", "0.65110356", "0.59094596", "0.5886653", "0.5866029", "0.55825335", "0.54762", "0.54648155", "0.54110587", "0.5375069", "0.53351444", "0.53258497", "0.5109661", "0.5087124", "0.508275", "0.5077173", "0.5073132", "0.5054157", "0.50413686", "0.500763...
0.83835596
0
Sets the total_due of this InvoiceDetailsM.
def total_due(self, total_due): self._total_due = total_due
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def due_amount(self, due_amount):\n\n self._due_amount = due_amount", "def total_paid(self, total_paid):\n\n self._total_paid = total_paid", "def total_amount(self, total_amount):\n\n self._total_amount = total_amount", "def total_repaid(self, total_repaid):\n\n self._total_repaid...
[ "0.676553", "0.64301145", "0.64276934", "0.61605513", "0.6142423", "0.6142423", "0.6142423", "0.6142423", "0.6142423", "0.6142423", "0.6130789", "0.61280704", "0.6094099", "0.58958316", "0.5874815", "0.58561593", "0.5798864", "0.5798864", "0.5798864", "0.5735", "0.5674389", ...
0.8505803
0
Sets the aria_statement_no of this InvoiceDetailsM.
def aria_statement_no(self, aria_statement_no): self._aria_statement_no = aria_statement_no
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def invoice_no(self, invoice_no):\n\n self._invoice_no = invoice_no", "def seq_no(self, seq_no):\n self._seq_no = seq_no", "def account_no(self, account_no):\n self._account_no = account_no", "def acct_no(self, acct_no):\n\n self._acct_no = acct_no", "def nr(self, nr):\n\n ...
[ "0.5663343", "0.5597262", "0.5593537", "0.55227065", "0.5257409", "0.5137116", "0.5073644", "0.49776742", "0.494466", "0.49051124", "0.4870831", "0.48030236", "0.48008206", "0.4788963", "0.4788963", "0.47856474", "0.47809753", "0.47764346", "0.4775974", "0.4755376", "0.471404...
0.8602245
0
Sets the voiding_event_no of this InvoiceDetailsM.
def voiding_event_no(self, voiding_event_no): self._voiding_event_no = voiding_event_no
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def invoice_no(self, invoice_no):\n\n self._invoice_no = invoice_no", "def event_id(self, event_id):\n\n self._event_id = event_id", "def event_id(self, event_id):\n\n self._event_id = event_id", "def inning_number(self, inning_number):\n\n self._inning_number = inning_number", ...
[ "0.6221412", "0.5846247", "0.5846247", "0.5685155", "0.56568444", "0.56139416", "0.54905015", "0.5205971", "0.51046735", "0.51036906", "0.5088318", "0.50524724", "0.5015025", "0.5011692", "0.49956784", "0.49227858", "0.49031895", "0.489145", "0.48607594", "0.48505127", "0.483...
0.8077447
0
Sets the client_notes of this InvoiceDetailsM.
def client_notes(self, client_notes): self._client_notes = client_notes
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setNotes(self, notes):\r\n self.currentCalib['notes']=notes", "def notes(self, notes):\n\n self._notes = notes", "def notes(self, notes):\n\n self._notes = notes", "def notes(self, notes):\n\n self._notes = notes", "def mechanic_notes(self, mechanic_notes):\n\n self._...
[ "0.6593799", "0.64421356", "0.64421356", "0.64421356", "0.6289673", "0.62519765", "0.6243656", "0.60931677", "0.6040888", "0.6032212", "0.5917465", "0.5783725", "0.5775407", "0.57598674", "0.56868964", "0.56868964", "0.5670205", "0.55825496", "0.55825496", "0.55825496", "0.55...
0.86229956
0
Sets the invoice_type_cd of this InvoiceDetailsM.
def invoice_type_cd(self, invoice_type_cd): self._invoice_type_cd = invoice_type_cd
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_invoice_item_type(self, invoice_item_type):\n self.invoice_item_type = invoice_item_type", "def disk_type(self, disk_type: ConfigDetail):\n\n self._disk_type = disk_type", "def discount_type(self, discount_type):\n\n self._discount_type = discount_type", "def mo_type(self, mo_typ...
[ "0.6786311", "0.62320316", "0.61616856", "0.6055725", "0.5912745", "0.5736043", "0.5714174", "0.5714174", "0.5714174", "0.5658788", "0.5598515", "0.55016947", "0.545959", "0.5414891", "0.540923", "0.53535783", "0.5327246", "0.52821517", "0.52721816", "0.5268966", "0.5244015",...
0.8720807
0
Sets the billing_group_no of this InvoiceDetailsM.
def billing_group_no(self, billing_group_no): self._billing_group_no = billing_group_no
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def client_billing_group_id(self, client_billing_group_id):\n\n self._client_billing_group_id = client_billing_group_id", "def group_id(self, group_id):\n \n self._group_id = group_id", "def assign_group(self, group):\n self[\"case group\"] = group", "def invoice_no(self, invoice_...
[ "0.6677835", "0.6345248", "0.5964759", "0.5913586", "0.5894685", "0.57857937", "0.56902283", "0.56747884", "0.567209", "0.567209", "0.567209", "0.567209", "0.5623121", "0.5531901", "0.552724", "0.54770404", "0.5390126", "0.53276753", "0.52788395", "0.52788395", "0.52194035", ...
0.87185323
0
Sets the client_billing_group_id of this InvoiceDetailsM.
def client_billing_group_id(self, client_billing_group_id): self._client_billing_group_id = client_billing_group_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def client_group_id(self, client_group_id):\n\n self._client_group_id = client_group_id", "def billing_group_no(self, billing_group_no):\n\n self._billing_group_no = billing_group_no", "def client_id(self, client_id):\n \n self._client_id = client_id", "def client_id(self, client_...
[ "0.7831994", "0.65249497", "0.6347408", "0.6258596", "0.6258596", "0.6258596", "0.6258596", "0.6258596", "0.6258596", "0.6258596", "0.6258596", "0.6258596", "0.6258596", "0.6138692", "0.6120245", "0.5877583", "0.5815314", "0.5794252", "0.57900935", "0.5785447", "0.57608986", ...
0.8666799
0
Returns the string representation of the model
def to_str(self): return pprint.pformat(self.to_dict())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _repr_model_(self):\n return str(self)", "def __str__(self):\n\n return str(self.model)", "def get_model_string(self):\n raise NotImplementedError()", "def __str__(self):\n return self.model", "def serialize_model(self):\n return dill.dumps(self.model)", "def __str_...
[ "0.8602374", "0.85093755", "0.8237104", "0.8050309", "0.80128866", "0.79348034", "0.78766525", "0.77898884", "0.7786461", "0.7745792", "0.7627315", "0.76055235", "0.757999", "0.7514394", "0.75038797", "0.75035286", "0.74850684", "0.7440529", "0.74325883", "0.74239755", "0.740...
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 return not self == other", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other):\n return self.__dict__ != other.__dict__", "def __eq__(self, other):\n return not self.__ne__(other)", ...
[ "0.8410411", "0.8391477", "0.8172175", "0.81410587", "0.80920255", "0.8088807", "0.80676955" ]
0.0
-1
Load place information from csv to list, return a place list
def load_places(self, file_name): file = open(file_name, "r") content = file.readlines() # read the whole file for i in content: place = i.strip('\n').split(',') if place[3] == 'v': new_place = Place(place[0], place[1], place[2], True) sel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_places():\n places = []\n in_file = open(FILENAME, \"r\")\n for line in in_file:\n line = line.strip()\n parts = line.split(\",\")\n parts[2] = int(parts[2])\n places.append(parts)\n places.sort(key=itemgetter(3, 2))\n in_file.close()\n return places", "def l...
[ "0.66196465", "0.65529513", "0.6430098", "0.63123405", "0.6276407", "0.627628", "0.6270612", "0.6176026", "0.61227214", "0.605119", "0.6008248", "0.60009724", "0.59752804", "0.5930234", "0.5923026", "0.5921161", "0.59033245", "0.5895837", "0.5890487", "0.5883117", "0.5876924"...
0.67137146
0
Assert that login with a wrong credentials fails
def test_user_login_with_wrong_credentials(self): credentials = { 'username': 'test1', 'password': 'testuserpassword' } res = self.login_user(credentials) res_data = json.loads(res.get_data(as_text=True)) msg = 'Your Username or Password is wrong' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_incorrect_login(self):\n # test incorrect username\n self.incorrect_login(\"\", \"password\")\n # test incorrect password\n self.incorrect_login(\"admin\", \"\")", "def testLoginError(self):\n\n\n (password, nick, avatar) = self.users[0]\n\n # try an invalid pas...
[ "0.85769665", "0.85306233", "0.8487194", "0.8459688", "0.84322256", "0.8384551", "0.82938164", "0.82352406", "0.82344073", "0.82279956", "0.81257445", "0.8102335", "0.810166", "0.8101647", "0.80935484", "0.808419", "0.8049492", "0.8048482", "0.80429506", "0.8024394", "0.80042...
0.8102192
12
Return the default mocked config entry.
def mock_config_entry() -> MockConfigEntry: return MockConfigEntry( title="12345", domain=DOMAIN, data={CONF_SENSOR_ID: 12345, CONF_SHOW_ON_MAP: True}, unique_id="12345", )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mock_config_entry() -> MockConfigEntry:\n return MockConfigEntry(\n title=\"Home Sweet Home\",\n domain=DOMAIN,\n data={CONF_LATITUDE: 52.42, CONF_LONGITUDE: 4.44, CONF_API_KEY: \"example\"},\n unique_id=\"unique_thingy\",\n )", "def mock_config_entry() -> MockConfigEntry:\n...
[ "0.75810003", "0.75517344", "0.74951166", "0.7481845", "0.7329042", "0.7218087", "0.71337163", "0.70799017", "0.68593407", "0.67928785", "0.6629185", "0.6627456", "0.6613023", "0.6598651", "0.6593331", "0.6587032", "0.65741074", "0.6532249", "0.65010494", "0.6473143", "0.6463...
0.7397836
4
Return queryset of VMs for current user or all if admin. Also acts as IsVmOwner permission. By using dc_bound=False the current request.dc is ignored and the returned VMs may not reside in the current working DC; This is only used by internal DCunbound APIs, which need to list all VMs defined in the system. DCbound API...
def get_vms(request, where=None, sr=('node', 'slavevm'), order_by=('hostname',), dc_bound=True): if where is None: where = QNodeNullOrLicensed if sr: qs = Vm.objects.select_related(*sr) else: qs = Vm.objects if request.user.is_admin(request): if dc_bound: qs...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_queryset(self, request, is_list=False, *args, **kwargs):\n\n return self.model.objects.filter(owner=request.user)", "def get_virt_objects(request, model, order_by, dc=None, include=(), **kwargs):\n dc = dc or request.dc\n qs = model.objects.filter(dc=dc)\n\n if request.user.is_admin(reque...
[ "0.6403248", "0.6171945", "0.6035333", "0.59851485", "0.5966652", "0.5874747", "0.5849141", "0.5849141", "0.5849141", "0.5790334", "0.5780267", "0.5779001", "0.5734186", "0.5734186", "0.56637096", "0.5629668", "0.5622966", "0.5603918", "0.55917007", "0.5572506", "0.5548554", ...
0.6193093
1
Return queryset of all public Virt.Objects plus private Virt.Objects for current user. Unless you are someone who gets access to all Virt.Objects (staff).
def get_virt_objects(request, model, order_by, dc=None, include=(), **kwargs): dc = dc or request.dc qs = model.objects.filter(dc=dc) if request.user.is_admin(request, dc=dc): # noinspection PyUnresolvedReferences qf = ~Q(access__in=model.INVISIBLE) else: # noinspection PyUnreso...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_queryset(self, **kwargs):\n return super().get_queryset().filter(public=True)", "def get_queryset(self, **kwargs):\n return super().get_queryset().filter(public=True)", "def get_queryset(self):\n user = self.request.user\n if user and not user.is_staff:\n return R...
[ "0.7538931", "0.7538931", "0.73267704", "0.725836", "0.7197682", "0.71776253", "0.71713144", "0.7087341", "0.7069184", "0.70563024", "0.6995047", "0.6981037", "0.6981037", "0.69710815", "0.6967576", "0.6960198", "0.6929277", "0.6924695", "0.6896566", "0.6875093", "0.68494624"...
0.68418944
21
Return a context specific sheet from a native sheet
def get_sheet(self, native_sheet, **keywords): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_sheet(file_name, sheet_name_or_index):\n book = xlrd.open_workbook(file_name)\n sheet = book.sheet_by_index(sheet_name_or_index) if is_number(sheet_name_or_index) else book.sheet_by_name(\n sheet_name_or_index)\n return sheet", "def get_sheet(self, workbook_name, sheet_na...
[ "0.7319163", "0.72668755", "0.6908557", "0.68908256", "0.6876444", "0.67067", "0.6662755", "0.6661605", "0.65296847", "0.6464436", "0.6456556", "0.6383309", "0.6320545", "0.6229717", "0.6226779", "0.61889744", "0.6156642", "0.6145335", "0.609843", "0.59942746", "0.5993776", ...
0.73772043
0
Get a native sheet out
def create_sheet(self, name): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_sheet(self, native_sheet, **keywords):\n pass", "def getSheet():\n\treturn(jsonify(sa.read()))", "def sheet(self):\n self._assert_fetch_conf()\n return self._sheet", "def get_sheet(self,index):\n response = self.get_spreadsheet()\n try:\n return response[...
[ "0.74662566", "0.7388437", "0.66705996", "0.63772553", "0.6328061", "0.63094795", "0.6278438", "0.6237558", "0.62345505", "0.60976535", "0.6086959", "0.6002522", "0.5990351", "0.59455824", "0.59171784", "0.58958066", "0.5890414", "0.5886012", "0.5867869", "0.5824238", "0.5797...
0.5787448
22
Compare the columns from the dataframe with the columns of the table and returns the missing columns
def _get_missing_columns(table, colnames, cursor, geocols=None): cursor.execute( """SELECT column_name FROM information_schema.columns WHERE table_name = '{table_name}';""".format(table_name=table.lower()) ) result = cursor.fetchall() # Obtaining the columns of the table ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def missing_columns(df, df_test):\r\n missing_cols = set(df.columns) - set(df_test.columns)\r\n# Add a missing column in test set with default value equal to 0\r\n for c in missing_cols:\r\n df_test[c] = 0\r\n# Ensure the order of column in the test set is in the same order than in train set\r\n df...
[ "0.7226012", "0.656945", "0.65678155", "0.6520177", "0.6495039", "0.646", "0.6413597", "0.62890303", "0.6288331", "0.627364", "0.62512934", "0.6235093", "0.61859626", "0.616358", "0.6148233", "0.61293364", "0.6035935", "0.59975773", "0.5996962", "0.5982918", "0.59809846", "...
0.7121911
1
Generate toy data with 2D Gaussian mixtures.
def gen_data(scale): dlen = 100000 dset = GaussianMixture(dlen, scale) data = [] for _ in range(dlen): data += dset.__getitem__(0), data = np.array(data) np.save('GM_2d_scale{}.npy'.format(scale), data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_2D_gaussian(mn, variance, cov, n):\n np.random.seed(142)\n return np.random.multivariate_normal(np.array([mn, mn]), np.array([[variance, cov], [cov, variance]]), n)", "def gen_data(m, seed=1, scale=0.7):\n c = 0\n x_train = np.linspace(0,49,m)\n np.random.seed(seed)\n y_ideal...
[ "0.6328892", "0.6078003", "0.6057073", "0.60368806", "0.60030854", "0.5981658", "0.58972555", "0.58792806", "0.586391", "0.58459514", "0.58406526", "0.5832331", "0.57668513", "0.5766725", "0.5764577", "0.5734571", "0.57117283", "0.570744", "0.5704912", "0.5663224", "0.5643096...
0.6456209
0
Emit ``event``, passing ``args`` and ``kwargs`` to each attached function. Returns ``True`` if any functions are attached to ``event``; otherwise returns ``False``. For twisted coroutine event handlers, calling emit is nonblocking. In other words, you do not have to await any results from emit, and the coroutine is sch...
def emit(self, event, *args, **kwargs): return super(TwistedEventEmitter, self).emit(event, *args, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def emit(self, event):\n logger.debug(\"fire event %s\", event)\n for callback in self.__listeners.get(event.type, []):\n try:\n callback(event)\n except FailImmediately as fi:\n logger.debug(\"FailImmediately exception thrown, %s, %s\", event.type,...
[ "0.6129132", "0.568269", "0.5514821", "0.5420216", "0.52679265", "0.52511597", "0.50951064", "0.5038419", "0.5020269", "0.50160086", "0.4946528", "0.49438062", "0.49242714", "0.4897387", "0.4887844", "0.48783007", "0.4870675", "0.4859151", "0.47660547", "0.47476733", "0.47322...
0.5478803
3
mask the PAD when computing loss, before we used weight matrix, but not handy for copymodel, change to ignore_index
def init_optimizer(model, opt): optimizer = Adam(params=filter(lambda p: p.requires_grad, model.parameters()), lr=opt.learning_rate, betas=(0.9, 0.998), eps=1e-09) return optimizer
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prune(self, prune_thresh):\n self.model.input_embeddings.weight.data[torch.abs(self.model.input_embeddings.weight.data) < prune_thresh] = 0", "def masked_word_model_loss():\n loss_fct = CrossEntropyLoss()\n loss = loss_fct(shifted_prediction_scores.view(-1, self.config.vocab_size), labels.view(...
[ "0.615605", "0.6155063", "0.6120855", "0.60985786", "0.5958252", "0.5809941", "0.5795663", "0.5795595", "0.56102264", "0.55539775", "0.5517228", "0.5490461", "0.5465226", "0.5454752", "0.5412692", "0.54050535", "0.5388287", "0.53805715", "0.5359165", "0.5357345", "0.5318516",...
0.0
-1
Clean string from punctuation and capitals.
def cleantext(text): lowers = text.lower() if sys.version_info.major == 2: no_punctuation = lowers.translate(punct_table, string.punctuation) else: no_punctuation = lowers.translate(punct_table) return no_punctuation
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cleanString(self, s):\n s = s.lower()\n import string \n for p in string.punctuation:\n s = s.replace(p, '')\n return s", "def clean_up(s):\n \n punctuation = \"\"\"!\"',;:.-?)([]<>*#\\n\\t\\r\"\"\"\n result = s.lower().strip(punctuation)\n return result", ...
[ "0.8164455", "0.7752831", "0.7518161", "0.737441", "0.72190684", "0.72133034", "0.721267", "0.7208045", "0.71699905", "0.71672606", "0.71632296", "0.71574163", "0.71454525", "0.71370167", "0.7136411", "0.70854473", "0.7073051", "0.7061837", "0.6981547", "0.6976864", "0.697466...
0.6952489
23