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 true if both objects are equal
def __eq__(self, other): if not isinstance(other, Room): 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
Add a contributor to an album, both must previously exist
def post(request, slug, username): add_contributor_album(slug, username) response = redirect(reverse("resource_contributoralbum", args=[slug, username])) response['Cache-Control'] = 'no-cache' return response
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_contributor_album(slug, username):\n contrib = Contributor.get(username)\n album = Album.get(slug)\n ContributorAlbum(slug=album.slug, username=contrib.username).save()", "def add_album_with_contributor(title, username):\n album = Album(title=title) \n album.save()\n ContributorAlbum...
[ "0.8172555", "0.8138832", "0.67775625", "0.6776667", "0.6776667", "0.67488265", "0.6616014", "0.6616014", "0.6514214", "0.63199896", "0.6246017", "0.62146765", "0.61647505", "0.6102046", "0.6065137", "0.59808433", "0.597001", "0.59188163", "0.58729935", "0.5787753", "0.578684...
0.6852508
2
Join threads in interruptable fashion.
def join_threads(threads): for t in threads: while t.isAlive(): t.join(5)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def interruptableJoin(self, timeout=3):\n try:\n while self.isAlive():\n self.join(timeout) # seconds\n # this area and the while check is interruptable.\n # end while\n except KeyboardInterrupt as e:\n logger.debug(\"=> Thread interrupt...
[ "0.74295706", "0.7147859", "0.68788135", "0.67604584", "0.6711964", "0.656749", "0.656749", "0.65602636", "0.64986634", "0.64871615", "0.6447385", "0.6379806", "0.6364601", "0.62655425", "0.623982", "0.6198028", "0.6190508", "0.60971475", "0.6081155", "0.60443103", "0.6017898...
0.6978895
2
Opens a file in a web browser. Currently, this is Firefox.
def open_in_browser(filename): subprocess.call(["firefox", filename])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def open(url):\r\n webbrowser.open(url)", "def open_in_explorer(file):\n webbrowser.open(os.path.dirname(p['paths'][file]))", "def open_browser(url):\n import webbrowser\n webbrowser.open_new(url)", "def open_file_browser(path):\n if sys.platform == 'win32':\n #subprocess.Popen(['start'...
[ "0.7933018", "0.7920494", "0.763089", "0.7540221", "0.7540151", "0.745722", "0.74352425", "0.7400123", "0.7163637", "0.70732987", "0.7035451", "0.7004443", "0.695253", "0.6929847", "0.6912077", "0.6894626", "0.6887249", "0.68537515", "0.685038", "0.6838351", "0.6802436", "0...
0.83123845
0
Return memory usage in megabytes
def get_memory_usage(): memory_usage = {'total' : 0, 'used' : 0} meminfo = subprocess.Popen(['free', '-m'], shell=False, stdout=subprocess.PIPE) meminfo.stdout.readline() total_used = meminfo.stdout.readline() memory_usage['total'] = total_used.split()[1] memory_usage['used'] = total_used.split...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_mem_usage():\n return process.memory_info().rss / 1024.**2", "def memsize(self):\n return self.xlist(\"get-memsize\")[1][0] * 1024", "def memory(self):\n # Run 'free -m' command and make a list from output.\n mem_data = self.execCMD('free', '-m').split()\n total_mem = int...
[ "0.84867066", "0.8125943", "0.7982074", "0.7938811", "0.78391254", "0.78346366", "0.77809685", "0.7665587", "0.7592064", "0.755568", "0.7549222", "0.75286084", "0.7523369", "0.75167245", "0.7510788", "0.74807173", "0.7373739", "0.7359147", "0.73572904", "0.7353789", "0.734189...
0.7699577
7
This function computes the sum of all columns of S in the subbands enumerated in bands
def binning(S, bands): B = np.zeros((S.shape[0], len(bands)), dtype=S.dtype) for i, b in enumerate(bands): B[:, i] = np.mean(S[:, b[0] : b[1]], axis=1) return B
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def column_sums(square):\n total = 0", "def row_col_sums(i, b_j, bins, C, n_u):\n s= C[i][i]*n_u[i]*n_u[i]\n for j in range(bins[b_j], bins[b_j+1]):\n if i != j:\n s+= (C[i][j] + C[j][i])*n_u[i]*n_u[j]\n return s", "def bin_reduce(data, axes_s):\n d1 = data\n \n # sor...
[ "0.61286545", "0.5809742", "0.57421285", "0.56989276", "0.55572236", "0.527795", "0.5246478", "0.52304775", "0.5209987", "0.5185994", "0.5155802", "0.5142566", "0.51219296", "0.5107681", "0.5098784", "0.5075655", "0.5073462", "0.5043631", "0.50435644", "0.50363743", "0.499349...
0.6641858
0
Returns the internal database ID for the specified account, or raises a method error if the account does not exist. By default the error raised is accountNotFound, but for example fromAccountNotFound can be specified instead. The result is cached within this Context object, so subsequent methods within the same request...
def use_account( self, account_id: Id, error: Type[exceptions.MethodError] = method.AccountNotFound, ) -> int: try: result = self.account_cache[account_id] except KeyError: result = self.connection.scalar( select(models.accounts.c.id).w...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def account_id(self):\n return self._account_id", "def account_id(self):\n\n return self._account_id", "def account_id(self) -> Optional[str]:\n return pulumi.get(self, \"account_id\")", "def account_id(self) -> Optional[str]:\n return pulumi.get(self, \"account_id\")", "def acc...
[ "0.6896955", "0.6856955", "0.6846792", "0.6846792", "0.6846792", "0.6846792", "0.6846792", "0.67648095", "0.6755262", "0.6755262", "0.6755262", "0.6755262", "0.6755262", "0.6755262", "0.6755262", "0.6755262", "0.6750158", "0.6750158", "0.6750158", "0.6750158", "0.6750158", ...
0.71925914
0
This method is deprecated. Please switch to AddFontSize.
def TextFieldOptionsAddFontSize(builder, fontSize): return AddFontSize(builder, fontSize)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __exit__(self, type, value, traceback):\n plt.rcParams[\"font.size\"] = self.old_size", "def font_size(self, font_size):\n\n self._font_size = font_size", "def set_font_size(self, fontsize):\n self.parent.setFontPointSize(fontsize)", "def __enter__(self):\n self.old_size = plt...
[ "0.6722253", "0.66976494", "0.66833395", "0.65427226", "0.65307313", "0.65054584", "0.64322954", "0.640547", "0.6400757", "0.6348494", "0.63293123", "0.63181716", "0.6294438", "0.6252248", "0.6155835", "0.6110308", "0.6086611", "0.6048916", "0.60382533", "0.6015081", "0.60045...
0.71120906
0
Find a cluster by id.
def find_cluster(self, id): raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_cluster(self, id: str) -> dto.Cluster:\n raise errors.UnsupportedOperationError(\n \"Operation not supported for provider '{}'\".format(self.provider_name)\n )", "def find_kubernetes_cluster(self, id: str) -> dto.KubernetesCluster:\n raise errors.UnsupportedOperationError...
[ "0.8516475", "0.80049926", "0.7087015", "0.6964663", "0.6952615", "0.67677695", "0.6584001", "0.6523775", "0.6490518", "0.64823717", "0.6398891", "0.6380067", "0.6297336", "0.6271734", "0.6266025", "0.623782", "0.6237797", "0.6187373", "0.6111801", "0.60111856", "0.59842736",...
0.89340335
0
Patches the given existing cluster.
def patch_cluster(self, cluster, *args, **kwargs): raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_cluster(self, cluster, params, *args, **kwargs):\n raise NotImplementedError", "def patch_cluster(self, cluster: Union[dto.Cluster, str]) -> dto.Cluster:\n raise errors.UnsupportedOperationError(\n \"Operation not supported for provider '{}'\".format(self.provider_name)\n ...
[ "0.7301261", "0.72424144", "0.7034603", "0.67850757", "0.66086674", "0.65262", "0.6367799", "0.62241375", "0.61246735", "0.61168444", "0.61165214", "0.61026627", "0.6070133", "0.60488486", "0.6036106", "0.60135067", "0.5999134", "0.5995779", "0.5993081", "0.59780777", "0.5942...
0.80573153
0
Get a form object to edit existing comment.
def get_comment_edit_form(parser, token): return CommentEditFormNode.handle_token(parser, token)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_comment_form_for_update(self, comment_id):\n # Implemented from template for\n # osid.resource.ResourceAdminSession.get_resource_form_for_update_template\n collection = JSONClientValidated('commenting',\n collection='Comment',\n ...
[ "0.7332379", "0.7186614", "0.6487639", "0.6487639", "0.64237857", "0.6326282", "0.6266579", "0.6222158", "0.61974275", "0.61603373", "0.61504745", "0.6051601", "0.6019779", "0.60176647", "0.6005648", "0.6003206", "0.59885937", "0.5967026", "0.596454", "0.5959088", "0.5917037"...
0.72351706
1
If we notice carefully the magic numbers can be represented as 001, 010, 011, 100, 101, 110 etc, where 001 is 0pow(5,3) + 0pow(5,2) + 1pow(5,1). So basically we need to add powers of 5 for each bit set in given integer n.
def sol(n): p = 1 res = 0 while n: p*=5 if n&1: res+=p n=n>>1 return res%1000000007
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bits(n):\n\n # Create a list of the first 1,000 binary numbers\n binary_list = reverse_binary_list()\n\n # Start by calculating number of 1's for n\n n_ones = num_of_ones(n, binary_list)\n\n # Calculate number of 1's for next value\n next_ones = 0\n while n_ones != next_ones:\n n = ...
[ "0.70239437", "0.6873572", "0.6541305", "0.653378", "0.6499156", "0.6464163", "0.6437673", "0.6429246", "0.6392333", "0.6372429", "0.6359519", "0.6351279", "0.63073283", "0.6264014", "0.62581307", "0.6224274", "0.62193483", "0.6218898", "0.61820805", "0.61669207", "0.61329836...
0.6416178
8
shows the about page
def about(): return render_template('about.html')
{ "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 about():\n return render_template(\n 'about.html',\n title='About',\n ...
[ "0.8322724", "0.8294785", "0.8253106", "0.8185688", "0.8175839", "0.8153685", "0.8147681", "0.81414753", "0.8137258", "0.8137258", "0.8137258", "0.8137258", "0.8137258", "0.8137258", "0.8137258", "0.8137258", "0.8137258", "0.8137258", "0.8137258", "0.8137258", "0.8137258", ...
0.78371966
42
Creates onject from JSON file
def load_from_json_file(filename): with open(filename, "r", encoding="utf-8") as f: return(json.loads(f.read()))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_JSON(cls, filename):\n with open(os.path.expanduser(filename), encoding='utf-8') as f:\n return json.load(f, object_hook=class_hook)", "def JSONtoObject(fileName):\n # TODO: ensure file exists first!!\n \n with open(fileName) as json_data:\n d = json.load(json_data)\n ...
[ "0.68468267", "0.6835662", "0.6812941", "0.6794619", "0.67676336", "0.6761564", "0.674035", "0.6710905", "0.6704534", "0.6701569", "0.6692738", "0.66891265", "0.66891265", "0.66891265", "0.66715974", "0.6663714", "0.66381836", "0.6624826", "0.6588225", "0.6547052", "0.6542955...
0.0
-1
Convert the batch into `~numpy.ndarray`.
def to_array( self, pad_with: Union[int, float, bool, Mapping[FieldName, Union[int, float, bool]]] = 0, ) -> Dict[FieldName, np.ndarray]: if not self: return {} field_names = self[0].keys() if isinstance(pad_with, int): pad_dict = {name: pad_with for...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _to_numpy_ndarray(cls, data):\n if isinstance(data, np.ndarray):\n return data\n arr = np.array(data, dtype=np.float)\n if len(arr.shape) == 1:\n arr = np.reshape(arr, newshape=(1, arr.shape[0]))\n return arr", "def to_ndarray(self):\n invalidInputErro...
[ "0.70865816", "0.7072646", "0.70234174", "0.68471557", "0.6727446", "0.66903114", "0.66394794", "0.6599462", "0.6580095", "0.6571478", "0.6571478", "0.6537813", "0.64891195", "0.64687043", "0.6435728", "0.64313966", "0.64217615", "0.6415939", "0.6415014", "0.6385731", "0.6322...
0.0
-1
Sets the name of this LookmlModel.
def name(self, name): self._name = name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_name(self, name):\n self.name = name", "def set_name(self, name):\n self.name = name", "def set_name(self, name):\n self.name = name", "def set_name(self, name):\n self.name = name", "def set_name(self, name):\n self.name = name", "def set_name(self, name):\n ...
[ "0.81434894", "0.81434894", "0.81434894", "0.81434894", "0.81434894", "0.8094832", "0.80865467", "0.80865467", "0.80741245", "0.8072738", "0.803953", "0.80141085", "0.79969496", "0.79477805", "0.78579646", "0.7815431", "0.7815431", "0.7779094", "0.777016", "0.77624816", "0.77...
0.0
-1
Sets the project_name of this LookmlModel.
def project_name(self, project_name): self._project_name = project_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def project_name(self):\n pass", "def set_project(\n name\n):\n if not is_alive():\n err_msg = \"Cannot connect to getML engine. Make sure the engine is running and you are logged in.\"\n raise ConnectionRefusedError(err_msg)\n\n cmd = dict()\n cmd[\"type_\"] = \"set_project\...
[ "0.6740167", "0.6665795", "0.6563864", "0.6535425", "0.6535425", "0.6446483", "0.6409307", "0.639926", "0.639926", "0.639926", "0.639926", "0.6360172", "0.6351864", "0.6311037", "0.6311037", "0.6311037", "0.6311037", "0.6311037", "0.6311037", "0.6294101", "0.6294101", "0.62...
0.8332016
0
Sets the allowed_db_connection_names of this LookmlModel.
def allowed_db_connection_names(self, allowed_db_connection_names): self._allowed_db_connection_names = allowed_db_connection_names
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unlimited_db_connections(self, unlimited_db_connections):\n\n self._unlimited_db_connections = unlimited_db_connections", "def set_connections(self, connections: dict):\n self._connections = connections", "def db_name(self, db_name):\n\n self._db_name = db_name", "def change_db(cls, ...
[ "0.54186165", "0.5402302", "0.52775025", "0.51868385", "0.5151055", "0.50407755", "0.5038318", "0.5038318", "0.4973511", "0.4841383", "0.48298216", "0.48288167", "0.48280817", "0.4807928", "0.47997272", "0.47955686", "0.47760764", "0.47637665", "0.47470066", "0.47418824", "0....
0.84809905
0
Sets the unlimited_db_connections of this LookmlModel.
def unlimited_db_connections(self, unlimited_db_connections): self._unlimited_db_connections = unlimited_db_connections
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_connections(self, connections: dict):\n self._connections = connections", "def connections(self, connections):\n\n self._connections = connections", "def update_connection_pool(maxsize=1):\n get_pool().connection_pool_kw.update(maxsize=maxsize)", "def set_many(self, value: bool) -> N...
[ "0.6391495", "0.5845692", "0.57141256", "0.5335108", "0.53160673", "0.52661455", "0.50776064", "0.50737864", "0.5059958", "0.5051414", "0.49745542", "0.4950429", "0.4940998", "0.48531646", "0.48491666", "0.48464432", "0.4789518", "0.47782186", "0.47698888", "0.4757832", "0.47...
0.82052946
0
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, LookmlModel): 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
A function that grabs the product price from the HTML
def get_product_price(container) -> str: try: price_container = container.findAll("li", {"class": "price-current"}) price: str = price_container[0].strong.text + price_container[0].sup.text return price except AttributeError: return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getPrice(self):\n headers = {\n \"User-Agent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.113 Safari/537.36\"}\n response = requests.get(self.__product_URL, headers=headers)\n #print(response.status_code)\n soup = ...
[ "0.80328465", "0.7914236", "0.78290606", "0.7805007", "0.77693367", "0.7537709", "0.7530839", "0.7429701", "0.73702073", "0.7243046", "0.7133091", "0.7103641", "0.70387614", "0.70285374", "0.6943825", "0.69385177", "0.69286025", "0.69224656", "0.6834719", "0.68012935", "0.679...
0.77309954
5
Obtain CORE tokens representation of SHARES.
def shares_to_core(self, shares): return shares * self.core_per_share()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tokens(self):\n return self.rpc.call(MsfRpcMethod.AuthTokenList)['tokens']", "def get_tokens(self):\r\n return self.token_set", "def access_token(self):\n social_auth = self.social_auth.get()\n return social_auth.tokens", "def getTokens(self):\n return self.__token", ...
[ "0.5871609", "0.580688", "0.5800231", "0.57588893", "0.5749709", "0.5738398", "0.5613109", "0.5604132", "0.5604132", "0.5604132", "0.5550682", "0.54511863", "0.5448596", "0.5442768", "0.5413982", "0.54054683", "0.53965515", "0.5390883", "0.5379497", "0.5378322", "0.5340042", ...
0.5674259
6
Returns the `Tesseract` data directory.
def data_dir(): return _config.datadir
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def data_dir():\n return os.path.join(os.path.dirname(_here), 'test', 'data')", "def get_data_dir():\n return Path(current_app.config[\"USER_DIR\"]) / \"data\"", "def data_dir():\n return os.path.join(os.path.dirname(os.path.abspath(__file__)), 'data')", "def get_data_dir() -> str:\n os.makedirs(...
[ "0.76448804", "0.7639593", "0.76352966", "0.74847287", "0.7469684", "0.7457494", "0.74517596", "0.7444335", "0.7439173", "0.74350154", "0.73948795", "0.7331406", "0.7319101", "0.73113704", "0.72769004", "0.7273352", "0.72649", "0.72365075", "0.72303337", "0.7206199", "0.71937...
0.7340032
11
Sets the location of the `Tesseract` data directory. > `datadir` must be an absolute path. > If __`update_env`__ is set to `True`, the `TESSDATA_PREFIX` environment variable > will be set using __`datadir`__'s value.
def set_data_dir(datadir, update_env=True): if os.path.isdir(datadir): _config.datadir = datadir if update_env: os.environ["TESSDATA_PREFIX"] = _config.datadir else: _warn("set_data_dir: Invalid directory: '{0}'".format(datadir))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_data_directory(path):\n if not os.path.exists(path):\n return False\n\n set(\"data_dir\", path)\n return True", "def setDataDir(self, directory):\n if os.path.exists(directory):\n self.__datadir = directory\n print(\"Datadir setted to '%s'\" % directory)\n ...
[ "0.647037", "0.61713034", "0.61525774", "0.6124337", "0.6050886", "0.600749", "0.5957269", "0.5850514", "0.5835769", "0.58260477", "0.5772531", "0.5740875", "0.5675667", "0.56664276", "0.559436", "0.559062", "0.55575013", "0.5543692", "0.5503705", "0.54893255", "0.54893255", ...
0.8902281
0
Returns `True` if the Tesseract's process can be started.
def runnable(): return tesseract_version() is not None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_running(self):\n\n command = ('ssh {0} -q -o StrictHostKeyChecking=no -o '\n 'UserKnownHostsFile=/dev/null \"pgrep httperf \"').format(self.client)\n\n if subprocess.call(command, stdout=subprocess.PIPE, shell=True) == 0:\n return True\n else:\n r...
[ "0.683426", "0.6659646", "0.664215", "0.66304106", "0.66205186", "0.6531204", "0.6444244", "0.63473004", "0.63375735", "0.6322206", "0.63049763", "0.6294021", "0.62681305", "0.6257287", "0.62284034", "0.6211846", "0.6209572", "0.6179766", "0.61707443", "0.61653566", "0.611733...
0.74139994
0
Converts and return the given `boxes` data as a dictionary. > __`boxes_data`__ __mustn't__ contain a header row.
def boxes_to_dict(boxes_data): boxes_data = "{0}\n{1}".format("char left bottom right top page", boxes_data) return sv_to_dict(boxes_data, " ")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def boxes(self) -> dict:\n return self.data[\"boxes\"]", "def return_boxes_class_as_dict(self) -> Dict[int, Dict]:\n\n boxes_dict = {}\n for index, sg_box in enumerate(self.root.iter('object')):\n boxes_dict[index] = {\"name\": sg_box.find(\"name\").text,\n ...
[ "0.73349506", "0.72075146", "0.68534106", "0.6157017", "0.6093826", "0.5986783", "0.5955362", "0.5873474", "0.5858902", "0.58416843", "0.57529616", "0.5615851", "0.5520696", "0.5509232", "0.5506957", "0.54658693", "0.5447993", "0.54431355", "0.53976685", "0.5395545", "0.53726...
0.8204854
0
Returns the target language to generate thrift stubs for.
def language(self, target): self._check_target(target) return target.language or self._default_language
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_language(benchmark):\n config = benchmark_config.get_config(benchmark)\n return config.get('language', 'c++')", "def generation_language(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"generation_language\")", "def genlangs(self):\r\n raise NotImplementedError", "de...
[ "0.68053067", "0.6592986", "0.63031936", "0.6204076", "0.61973584", "0.6124299", "0.60094357", "0.60094357", "0.59851927", "0.58956754", "0.58512294", "0.5836906", "0.5821554", "0.57853127", "0.5764415", "0.56837124", "0.56798995", "0.56651574", "0.566388", "0.55879116", "0.5...
0.6762571
1
Haversine formula on sphere for higher precission on ellipsoid use the Vincenty formula
def angular_distance(lng1, lat1, lng2, lat2): phi1 = math.radians(lat1) phi2 = math.radians(lat2) d_phi = math.radians(lat2 - lat1) d_lmd = math.radians(lng2 - lng1) A = math.pow(math.sin(d_phi / 2), 2) + \ math.cos(phi1) * math.cos(phi2) * \ math.pow(math.sin(d_lmd / 2), 2) return 2 * math.atan2(math.sqr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vincenty(lon0, lat0, a1, s):\n\n lon0 = np.deg2rad(lon0)\n lat0 = np.deg2rad(lat0)\n a1 = np.deg2rad(a1)\n s = np.deg2rad(s)\n\n sina = np.cos(lat0) * np.sin(a1)\n\n num1 = np.sin(lat0) * np.cos(s) + np.cos(lat0) * np.sin(s) * np.cos(a1)\n den1 = np.sqrt(\n sina**2 + (np.sin(lat0) *...
[ "0.69954294", "0.69346416", "0.682316", "0.6611303", "0.64426804", "0.63463235", "0.63390005", "0.633222", "0.6327156", "0.624788", "0.62468785", "0.6216645", "0.62075424", "0.6169854", "0.616569", "0.6154425", "0.61390156", "0.6133285", "0.6108595", "0.60780424", "0.60658544...
0.0
-1
the environment settings from the processes perpective, C{dict}
def get_process_env(pid=1): try: pid = int(pid) except ValueError: raise TypeError('pid has to be an integer') env = {} envlist = open('/proc/%s/environ' % pid).read().split('\000') for e in envlist: (k, _, v) = e.partition('=') (k, v) = (k.strip(), v.strip()) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def env_dict(self): # type: () -> t.Dict[str, str]\n return dict((item[0], item[1]) for item in [e.split('=', 1) for e in self.env])", "def _get_env(self):\n env = {}\n for k, v in os.environ.items():\n k = k.decode() if isinstance(k, bytes) else k\n v = v.decode() if ...
[ "0.718508", "0.68794703", "0.6874064", "0.6855373", "0.6824463", "0.67537355", "0.66846347", "0.6677419", "0.6664762", "0.6663833", "0.66587687", "0.66257215", "0.66254795", "0.6573017", "0.6556915", "0.6537953", "0.6523665", "0.6515877", "0.6497401", "0.6468637", "0.64654106...
0.7048464
1
Return whether or not the given point is within the map boundaries
def is_in_map(self, x_ind, y_ind): return not (x_ind < self.origin[0] or x_ind > self.origin[0] + self.n * self.resolution or y_ind < self.origin[1] or y_ind > self.origin[1] + self.n * self.resolution)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_point_in(self, point):\n return (self.upperleft[0] <= point[0] <= self.upperright[0] and self.upperleft[1] <= point[1] <= self.bottomleft[1])", "def is_point_in(self, point):\n return (self.upperleft[0] <= point[0] <= self.upperright[0] and self.upperleft[1] <= point[1] <= self.bottomleft[1]...
[ "0.7987143", "0.7987143", "0.7729781", "0.77179474", "0.75761247", "0.7564899", "0.7471492", "0.7467558", "0.74525136", "0.7394972", "0.7375382", "0.73697674", "0.7348429", "0.73320854", "0.73303074", "0.73123896", "0.7300184", "0.7299072", "0.7272105", "0.72668654", "0.72182...
0.697793
35
Search a list and return the index if found. Returns 1 if target is not found.
def linearSearch(values: list, target: int) -> int: for i in range(len(values)): if target == values[i]: return i return -1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def linear_search(list, target):\n for i in range (0, len(list)):\n if list[i] == target:\n return i\n\n\n return None", "def search_linear(xs, target):\n for (i, v) in enumerate(xs):\n if v == target: # Is referred to as a probe.\n return i\n return -1", ...
[ "0.8447624", "0.7417838", "0.7409857", "0.73781145", "0.73247", "0.72921276", "0.7283297", "0.7274945", "0.72310674", "0.7228766", "0.7145641", "0.7131", "0.7107914", "0.71019", "0.70933586", "0.70343786", "0.6999882", "0.6978816", "0.68754834", "0.68739086", "0.68529516", ...
0.7741828
1
Search a list and return the index if found. Returns 1 if target is not found.
def binarySearch(values: list, target: int) -> int: lower: int = 0 upper: int = len(values) - 1 while lower <= upper: mid: int = (lower + upper) // 2 if target == values[mid]: return mid elif values[mid] > target: upper = mid - 1 else: lower = mid + 1 return -1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def linear_search(list, target):\n for i in range (0, len(list)):\n if list[i] == target:\n return i\n\n\n return None", "def linearSearch(values: list, target: int) -> int:\n for i in range(len(values)):\n if target == values[i]:\n return i\n \n return -1", "def search_linea...
[ "0.8448059", "0.7742417", "0.7418362", "0.74093527", "0.73779964", "0.732496", "0.7292039", "0.72828263", "0.7275577", "0.7232079", "0.7228574", "0.7145467", "0.71305627", "0.7107698", "0.71016955", "0.7093349", "0.7034138", "0.69996303", "0.6978775", "0.6876206", "0.6873684"...
0.6051626
71
Returns the hint associated with this widget.
def hint( self ): return self._urlEdit.hint()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def open_with_hint(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"open_with_hint\")", "def location_hint(self) -> str:\n return pulumi.get(self, \"location_hint\")", "def fake_get_hint(_):\r\n return {'best_hint': 'This is the best hint.',\r\n 'ran...
[ "0.661759", "0.6515099", "0.62544495", "0.6234342", "0.6205115", "0.61707467", "0.61353236", "0.5936446", "0.5921976", "0.5905496", "0.5902251", "0.5880721", "0.58197874", "0.58151376", "0.57911587", "0.5716246", "0.5640035", "0.56167537", "0.56085753", "0.5571308", "0.551909...
0.7135969
0
Sets the hint associated with this widget.
def setHint( self, hint ): self._urlEdit.setHint(hint)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SetToolTip(self, toolTip):\r\n\r\n self._label = toolTip", "def useHint(self):\n self.hints = self.hints - 1", "def Hint(self, hint):\n if hint not in [self.ORDER_FIRST, self.ANCESTOR_FIRST, self.FILTER_FIRST]:\n raise datastore_errors.BadArgumentError(\n 'Query hint must be OR...
[ "0.61764085", "0.60664254", "0.60035425", "0.5677366", "0.5666896", "0.5626259", "0.55662453", "0.5512495", "0.5485984", "0.5334489", "0.5307591", "0.52387357", "0.5234253", "0.5221844", "0.52141905", "0.5191375", "0.51860595", "0.51696134", "0.51231265", "0.503788", "0.50328...
0.77436554
0
Sets the url for this widget to the inputed url.
def setUrl( self, url ): self._urlEdit.setText(str(url))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_url(self, url):\n self.url = url", "def set_url(self, url):\n if url is not None:\n self.url = url", "def set_url(self, url):\n self.url = url", "def set_url(self, url):\n self.data['url'] = url", "def _set_url(self): \n self.url = self.geturl()", ...
[ "0.8465494", "0.83273196", "0.8215537", "0.8194674", "0.81919986", "0.7945045", "0.792966", "0.792966", "0.792966", "0.792966", "0.792966", "0.792966", "0.792966", "0.78585744", "0.78585744", "0.78585744", "0.73563415", "0.7195411", "0.70781684", "0.69121104", "0.6873997", ...
0.83152676
2
Add a new experience to memory.
def add(self, state, action, reward, next_state, done): e = self.experience(state, action, reward, next_state, done) self.memory.append(e)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_new_experience(self, state, action, reward, next_state, done):\n e = self.experience(state, action, reward, next_state, done, self.max_priority)\n self.memory.append(e)", "def add(self, state, action, reward, next_state, done):\n experience = Experience(state, action, reward, next_st...
[ "0.79568833", "0.79042006", "0.78795445", "0.7577913", "0.7570969", "0.74478436", "0.7361023", "0.72697705", "0.721816", "0.71451885", "0.7106998", "0.7101183", "0.69837016", "0.68905056", "0.68842727", "0.6755663", "0.6712557", "0.6677425", "0.64961654", "0.6488678", "0.6486...
0.71984994
13
Return the current size of internal memory.
def __len__(self): return len(self.memory)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getSize(self) -> int:\n return len(self.mem)", "def getSize(self):\n return self.bf.memory()", "def memsize(self):\n return self.xlist(\"get-memsize\")[1][0] * 1024", "def size(self):\n size = 0\n size += self.data.size * sys.getsizeof(self.data)\n return size / ...
[ "0.8573752", "0.82169205", "0.8200361", "0.8087402", "0.8021614", "0.7890747", "0.78219426", "0.78017354", "0.77905464", "0.7758844", "0.77559924", "0.77559924", "0.775519", "0.77544576", "0.7733221", "0.7732168", "0.7720068", "0.77145016", "0.77092093", "0.77077913", "0.7697...
0.75127405
52
Read a scale factor. This may be a floatingpoint number, e.g. for converting power readings.
def _file_scale(fn): s = utils.file_word(fn) try: n = int(s, 0) except ValueError: n = float(s) return n
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scale_to_factor(scale):\n return (B.pi / 2) / (2 * scale**2)", "def scale(self) -> pulumi.Input[int]:\n return pulumi.get(self, \"scale\")", "def get_scale():\r\n\r\n \r\n return 0.5", "def factor_to_scale(factor):\n return 1 / B.sqrt(4 * factor / B.pi)", "def scale(self):\n r...
[ "0.7054534", "0.6894709", "0.6773414", "0.6724019", "0.6504467", "0.64945567", "0.6454414", "0.6446829", "0.6436149", "0.64263034", "0.6356029", "0.6348863", "0.63482416", "0.63423437", "0.63321286", "0.6292325", "0.6279853", "0.6247982", "0.6205369", "0.6192286", "0.61603004...
0.63083655
15
Determine whether a geometry is polygon/multipolygon.
def is_area_types(geo): geo = geo.strip().upper() for a_geo_type_in_geo_area_types_list in GEO_AREA_TYPES: if geo.startswith(a_geo_type_in_geo_area_types_list) and \ len(geo) != len(a_geo_type_in_geo_area_types_list): return True continue return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_multipoint_on_polygon(feature_1: Sequence, feature_2: Sequence) -> bool:\n points_on_poly = False\n\n points_on_poly = all(\n boolean_point_in_polygon(coords_1, feature_2[1]) for coords_1 in feature_1[1]\n )\n\n if not points_on_poly:\n return points_on_poly\n\n points_on_poly =...
[ "0.72029394", "0.70008504", "0.6951204", "0.6922578", "0.6881032", "0.6877516", "0.687233", "0.6664226", "0.65382344", "0.64402676", "0.642092", "0.6388441", "0.63800293", "0.6355816", "0.6345165", "0.62584347", "0.62494534", "0.6210741", "0.6177175", "0.61690366", "0.6137858...
0.5294952
83
Determine whether a geometry is curve types, like CURVEPOLYGON/MULTISURFACE/SURFACE.
def is_surface(geo): geo = geo.strip().upper() for a_geo_type_in_surface_geo_types_list in SURFACE_TYPES: if geo.startswith(a_geo_type_in_surface_geo_types_list): return True # else: continue return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_curve(geo):\n geo = geo.strip().upper()\n\n for a_geo_type_in_curve_geo_types_list in CURVE_TYPES:\n if geo.startswith(a_geo_type_in_curve_geo_types_list):\n return True\n\n continue\n\n return False", "def _check_curve(layer: ogr.Layer) -> None:\n # Check if the f...
[ "0.7888874", "0.6682032", "0.6485352", "0.6381897", "0.63554496", "0.6241698", "0.6210336", "0.60134315", "0.6000302", "0.5997957", "0.5897315", "0.5796809", "0.5735795", "0.5591169", "0.5564868", "0.55087805", "0.5508492", "0.5504049", "0.5483914", "0.5463009", "0.54362524",...
0.56030655
13
Compare area of 2 geometry types.
def compare_area(geometry_x, geometry_y): arct = CreateGeometryFromWkt(geometry_x) pgis = CreateGeometryFromWkt(geometry_y) intersection_area = Geometry.Area(Geometry.Intersection(arct, pgis)) arct_area = Geometry.Area(arct) pgis_area = Geometry.Area(pgis) # print('arctern area: %s, postgis ar...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_area(self):\n r1 = Rectangle(3, 2)\n self.assertEqual(r1.area(), 6)\n\n r2 = Rectangle(2, 10)\n self.assertEqual(r2.area(), 20)\n\n r3 = Rectangle(10, 10)\n self.assertEqual(r3.area(), 100)", "def test_area(self):\r\n rect = Rectangle(30, 50, 130, 60)\r\n...
[ "0.69165844", "0.6771447", "0.6616793", "0.6609005", "0.65951675", "0.6591154", "0.65173155", "0.65087074", "0.64811593", "0.6477908", "0.64222854", "0.6401226", "0.6319201", "0.6307683", "0.6278989", "0.6251286", "0.62340486", "0.62248814", "0.62171525", "0.61616844", "0.613...
0.8082194
0
Compare whether 2 geometries is 'equal'.
def compare_geometry(config, geometry_x, geometry_y): if geometry_x.upper().endswith('EMPTY') and geometry_y.upper().endswith( 'EMPTY'): return True if config in BLIST: return arc_distance(geometry_x, geometry_y) < EPOCH_CURVE_RELATIVE # return True # else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def almost_equal(self, other, rtol=1e-05, atol=1e-08):\n\n # float attributes defining the instance\n fkeys = ['x0', 'y0', 'dx', 'dy']\n # unambiguous attributes\n ckeys = ['nx', 'ny', 'origin']\n\n ok = True\n for k in fkeys:\n ok = ok and np.isclose(getattr(se...
[ "0.7094907", "0.70925534", "0.70572674", "0.7016994", "0.7012777", "0.699036", "0.6879245", "0.6866964", "0.6801648", "0.67706764", "0.67370194", "0.6723489", "0.67227083", "0.6719405", "0.6710909", "0.670257", "0.6689699", "0.6685945", "0.668558", "0.66633034", "0.66488564",...
0.66584814
20
Compare whether 2 geometrycollections is 'equal'.
def compare_geometrycollection(config, geometry_x, geometry_y): if config in BLIST: # print('arc distance: %s' % str(arc_distance(x, y))) return arc_distance(geometry_x, geometry_y) < EPOCH_CURVE_RELATIVE # return True # else: # print('arc distance: %s' % str(arc_dist...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _vertices_are_equal(\n vertices1: List[np.ndarray], vertices2: List[np.ndarray]\n) -> bool:\n if len(vertices1) != len(vertices2):\n return False\n diff = vertices1 - vertices2\n if np.abs(np.max(diff)) < ways_are_equal_tolerance:\n return True\n return False", "def __eq__(self, ...
[ "0.69091654", "0.68075687", "0.6800454", "0.67977756", "0.67872643", "0.67437285", "0.67410314", "0.672413", "0.6664351", "0.66252893", "0.66123503", "0.6572574", "0.65541077", "0.654343", "0.65280193", "0.65280193", "0.6519642", "0.651917", "0.64945406", "0.6492785", "0.6460...
0.7223753
0
Compare whether 2 geometries and their intersection is 'equal'.
def compare_float(geometry_x, geometry_y, geometry_z, precision_error): value_x = float(geometry_x) value_y = float(geometry_y) value_z = float(geometry_z) return abs((value_x - value_y)) <= precision_error and \ abs((value_x - value_z)) <= precision_error and \ abs((value_y - value_z))...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_intersection(obj1, obj2):\n (x1, y1, w1, h1) = obj1.get_box()\n (x2, y2, w2, h2) = obj2.get_box()\n if x2 + w2 - 1 < x1 or x2 >= x1 + w1:\n return False\n if y2 + h2 - 1 < y1 or y2 >= y1 + h1:\n return False\n \n return True", "def intersects(self, other): # -> bool:\n ...
[ "0.7111413", "0.70493925", "0.68645746", "0.68594813", "0.6792225", "0.677465", "0.677109", "0.6721608", "0.6639272", "0.6590415", "0.6571525", "0.65494853", "0.6502445", "0.64740366", "0.64638644", "0.6438995", "0.6429389", "0.6425822", "0.63997346", "0.6391252", "0.6387845"...
0.0
-1
Compare whether 2 geometries and their intersection is 'equal', measure with relative.
def compare2float_relative(x_base, y_check, relative_error): value_x = float(x_base) value_y = float(y_check) return ((abs(value_x - value_y)) / (abs(value_x))) <= relative_error
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compare_surface(geometry_x, geometry_y):\n arct = CreateGeometryFromWkt(geometry_x)\n pgis = CreateGeometryFromWkt(geometry_y)\n\n intersection_area = Geometry.Area(Geometry.Intersection(arct, pgis))\n arct_area = Geometry.Area(arct)\n pgis_area = Geometry.Area(pgis)\n\n result = compare3floa...
[ "0.70972633", "0.6916985", "0.6654482", "0.66120017", "0.65347", "0.6462911", "0.64468485", "0.6380087", "0.629138", "0.62781775", "0.6277099", "0.62368965", "0.6225484", "0.62107533", "0.6177368", "0.6158703", "0.61506146", "0.61255056", "0.6110729", "0.610103", "0.6094156",...
0.0
-1
Compare whether 2 geometries and their intersection is 'equal', measure with relative.
def compare3float_relative(x_base, y_check, z_intersection, relative_error): return compare2float_relative(x_base, y_check, relative_error) and \ compare2float_relative(x_base, z_intersection, relative_error) and \ compare2float_relative(y_check, z_intersection, relative_error)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compare_surface(geometry_x, geometry_y):\n arct = CreateGeometryFromWkt(geometry_x)\n pgis = CreateGeometryFromWkt(geometry_y)\n\n intersection_area = Geometry.Area(Geometry.Intersection(arct, pgis))\n arct_area = Geometry.Area(arct)\n pgis_area = Geometry.Area(pgis)\n\n result = compare3floa...
[ "0.7097595", "0.6918924", "0.6655641", "0.66117334", "0.65374976", "0.64624953", "0.64464617", "0.6379857", "0.62917364", "0.6277179", "0.62768114", "0.62354904", "0.6226395", "0.6209696", "0.61761427", "0.61594754", "0.61502135", "0.6124798", "0.6111445", "0.61015993", "0.60...
0.5718311
83
Compare whether 2 curve geometries is 'equal'.
def compare_curve(geometry_x, geometry_y): arct = CreateGeometryFromWkt(geometry_x) pgis = CreateGeometryFromWkt(geometry_y) intersection_length = Geometry.Length(Geometry.Intersection(arct, pgis)) arct_length = Geometry.Length(arct) pgis_length = Geometry.Length(pgis) # result = compare_float(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def almost_equal(self, other, rtol=1e-05, atol=1e-08):\n\n # float attributes defining the instance\n fkeys = ['x0', 'y0', 'dx', 'dy']\n # unambiguous attributes\n ckeys = ['nx', 'ny', 'origin']\n\n ok = True\n for k in fkeys:\n ok = ok and np.isclose(getattr(se...
[ "0.682704", "0.67394716", "0.6681293", "0.6666702", "0.66638684", "0.66490424", "0.6630836", "0.6607531", "0.6598693", "0.65355104", "0.65225184", "0.6516983", "0.65034634", "0.6460942", "0.6443653", "0.6434982", "0.642313", "0.6423077", "0.64115363", "0.6397245", "0.6396407"...
0.74833715
0
Convert a string to float, if it's not a float value, return string to represent itself.
def convert_str(strr): if strr.lower() == 'true' or strr.lower() == 't': return True if strr.lower() == 'false' or strr.lower() == 'f': return False try: float_value = float(strr) return float_value except ValueError as ex: print(repr(ex)) return strr
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _convert_to_float(s):\n try:\n return float(s)\n except:\n return s", "def _string_to_float(s):\n try:\n f = float(s)\n return f\n except ValueError:\n return None", "def convertFloat(s):\n try:\n float(s)\n return \"FLOAT\"\n except:\n ...
[ "0.83481985", "0.8317203", "0.82903135", "0.82346004", "0.8163415", "0.79856145", "0.79477423", "0.7849998", "0.7792402", "0.7702471", "0.764283", "0.7580635", "0.75717115", "0.75323564", "0.74134165", "0.7366255", "0.7359386", "0.73569125", "0.7332301", "0.7324874", "0.72403...
0.6531462
58
Creates a tf.estimator.Estimator for the Criteo classification task.
def generate_estimator( mode_feature_cols_map, params, config): model_fn = generate_model_fn(mode_feature_cols_map) return tf.estimator.Estimator( model_fn, model_dir=config.model_dir, params=params, config=config )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_create_estimator(self):\n # Hyperparameters to create the Estimator\n hparams = tf.contrib.training.HParams(\n job_dir='test_dir',\n save_checkpoints_steps=1,\n keep_checkpoint_max=1,\n num_layers=2,\n dnn_dropout=0.7,\n dnn_optimizer='test_optimizer',\n ...
[ "0.65736884", "0.6459212", "0.64518964", "0.6445745", "0.644354", "0.6375797", "0.6341873", "0.6303075", "0.6288743", "0.60840476", "0.6058722", "0.5958758", "0.59304744", "0.59095865", "0.58988893", "0.58928365", "0.5768626", "0.57535154", "0.5752959", "0.57507414", "0.57486...
0.60478264
11
Returns a sorted list of text fonts.
def available_text_fonts(): bad = [u'acalc', u'acb', u'aco', u'acp'] all = available_fonts() fonts = [] for f in all: if (f == u'Series 60 ZDigi'): continue for b in bad: try: if (f.lower().startswith(b) and f[len(b)].isdigit()): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_fonts():\n fonts = [f.name for f in matplotlib.font_manager.fontManager.ttflist]\n fonts.append([f.name for f in matplotlib.font_manager.fontManager.afmlist])\n\n fonts = sorted(list(set(fonts[:-1])))\n\n return fonts", "def get_fonts(self):\n\n font_path = self.execute_shell([\"figlet...
[ "0.79203373", "0.75975627", "0.74923277", "0.7280089", "0.7266952", "0.6951139", "0.6929214", "0.6809537", "0.65878856", "0.645177", "0.64097315", "0.6324056", "0.6273209", "0.6161407", "0.6160687", "0.6150118", "0.6083486", "0.6083486", "0.60355866", "0.59985346", "0.5890237...
0.8360911
0
Constructor for Summoner objects
def __init__(self): # Mutual attributes (summoner_v1.4 & current_game_v1.0) self.id = None self.name = None self.profile_icon_id = None # summoner_v1.4 attributes self.revision_date = None self.level = None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, player_name, player_number, player_position):\n self.name = player_name\n self.number = player_number\n self.position = player_position", "def __init__(self):\n GameObject.__init__(self)\n\n # private attributes to hold the properties so they appear read only...
[ "0.7002948", "0.6885052", "0.68535846", "0.67939246", "0.6772736", "0.6697201", "0.66512406", "0.6595096", "0.6593353", "0.6555667", "0.65447843", "0.6538176", "0.6534193", "0.6527768", "0.6513118", "0.6508787", "0.6505901", "0.6502642", "0.64767426", "0.64461696", "0.6426768...
0.73586863
0
The shard for the match associated with this asset.
def shard(self): return self._shard or self._pubg.shard
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def shard(self):\n return self._shard", "def shard(self, shard: str) -> str:\n return self.shards(shard)[shard]", "def get_marathon_shard(self) -> Optional[int]:\n return self.config_dict.get(\"marathon_shard\", None)", "def shards(self) -> pulumi.Output[Sequence['outputs.ClusterShard']]...
[ "0.7990601", "0.6882858", "0.65893555", "0.6370745", "0.62622166", "0.62407625", "0.6142102", "0.6039497", "0.5863014", "0.58602816", "0.58247614", "0.58125615", "0.5611366", "0.5542409", "0.55184513", "0.5517245", "0.5513182", "0.5500133", "0.5492229", "0.54443204", "0.54437...
0.7335801
1
utility to form the zeros for the waypoint matrix where not defined
def form_waypoints_polytraj(waypoints,n_der): for key in waypoints.keys(): if waypoints[key] is not None: wayp_shape = np.shape(waypoints[key]) if np.size(wayp_shape)==0: wayp = np.reshape(waypoints[key],(1,1)) col = 1 row = 1 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def zeros_matrix(self, rows, cols):\r\n M = []\r\n while len(M) < rows:\r\n M.append([])\r\n while len(M[-1]) < cols:\r\n M[-1].append(0.0)\r\n\r\n return M", "def setZeroes(self, matrix: List[List[int]]) -> None:\r\n \r\n ...
[ "0.65860206", "0.6534495", "0.64906275", "0.6473783", "0.64656425", "0.6422799", "0.6419863", "0.64058954", "0.6391419", "0.6381557", "0.6359175", "0.6357462", "0.63506055", "0.6347687", "0.634098", "0.6335771", "0.6328608", "0.63040364", "0.629257", "0.629046", "0.62892205",...
0.0
-1
Removes uneccessary words (noise) or in this case words that will bring our models to the worse case scenario
def clean_docs(self,docs): # Remove numbers, but not words that contain numbers. docs = [[token for token in doc if not token.isnumeric()] for doc in docs] # Remove words that are only one character. docs = [[token for token in doc if len(token) > 1 and token not in stop_words] for doc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_noise(text):\n\n text = text.split()\n word = [word for word in text if word not in [\n 'pertain',\n 'estimate',\n 'link',\n 'and',\n 'more',\n 'fetch',\n 'be',\n 'there',\n 'do',\n 'you',\n 'have',\n 'any',\n ...
[ "0.7709789", "0.7066685", "0.704916", "0.70323694", "0.702522", "0.70242274", "0.6978414", "0.6938854", "0.69256455", "0.6893404", "0.6856648", "0.68531317", "0.6847136", "0.6822239", "0.6819113", "0.680997", "0.67715293", "0.6758504", "0.6746686", "0.6740852", "0.67384934", ...
0.0
-1
Retrieve single user by user_id
def get(self, user_id): return jsonify(User.objects(user_id__exact=user_id))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_user_by_id(user_id):\n return User.query.get(user_id)", "def get_user_by_id(user_id):\n\n return User.query.get(user_id)", "def get_user_by_id(user_id):\n\n return User.query.get(user_id)", "def get_user_by_id(user_id):\n\n return User.query.get(user_id)", "def get_user_by_id(user_id):\...
[ "0.8679874", "0.86036724", "0.86036724", "0.86036724", "0.86036724", "0.8600261", "0.85471445", "0.8524966", "0.852111", "0.848765", "0.847361", "0.8471266", "0.8417174", "0.8322282", "0.82993853", "0.82962936", "0.8284257", "0.8250569", "0.82421017", "0.8237911", "0.82235414...
0.0
-1
Reinitialize all current conditions by querying the managed plumbing engine.
def reinitialize_conditions(self): if self._plumb is not None and self.current_step is not None: time = self._plumb.time pressures = self._plumb.current_pressures() state = {'time': time, 'pressures': pressures} for condition, _ in self.current_step.conditions: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset_new_conditions (self):\n self.solver.pop()\n self.solver.push()", "def initial_conditions(self):\n pass", "def update_conditions(self):\n if self._plumb is not None and self.current_step is not None:\n time = self._plumb.time\n pressures = self._plumb.cur...
[ "0.67511904", "0.6440019", "0.6085579", "0.5955797", "0.5798823", "0.5726613", "0.5684762", "0.56458586", "0.5617931", "0.5559797", "0.55384314", "0.5535065", "0.55286676", "0.5515799", "0.5489002", "0.54856473", "0.54601055", "0.54493713", "0.54383904", "0.54343176", "0.5420...
0.77014667
0
Gets the median of a list of `values`
def find_median(values): midpoint = int(len(values) / 2) if len(values) % 2 == 0: median = (values[midpoint - 1] + values[midpoint]) / 2 else: median = values[midpoint] return median
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def median(values):\n # Write the median() function\n midpoint = int(len(values) / 2)\n if len(values) % 2 == 0:\n median = (values[midpoint - 1] + values[midpoint]) / 2\n else:\n median = values[midpoint]\n return median", "def median(values):\n # Write the median() function\n mid...
[ "0.83553493", "0.8320773", "0.8221512", "0.8133533", "0.8071878", "0.78409564", "0.76371264", "0.75885296", "0.74441516", "0.741083", "0.718382", "0.71094555", "0.70965976", "0.702743", "0.6996409", "0.69004005", "0.68841726", "0.6878317", "0.6859416", "0.68488604", "0.682027...
0.8168769
3
Test tracks that had no match on Spotify.
def test_missing_tracks(self): # Taylor Swift doesn't have her albums on Spotify expected_missing = [track_id for track_id, track in self.ilibrary.tracks.iteritems() if track.artists[0] == 'Taylor Swift'] for missing_id in expected_missing: self.assertNo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_no_tracks(self):\n (added, status) = self.app.add_album([])\n self.assertEqual(added, False)\n self.assertIn('No files', status)\n self.assertEqual(self.get_album_count(), 0)", "def test_get_all_unassociated_no_tracks(self):\n self.assertEqual(self.get_track_count(), 0...
[ "0.7115361", "0.7030869", "0.7018613", "0.68461215", "0.68134826", "0.677911", "0.67133105", "0.6693357", "0.6673518", "0.6613481", "0.65948635", "0.6546225", "0.6501048", "0.64998555", "0.6478059", "0.6464242", "0.6413985", "0.6375597", "0.63656217", "0.6356694", "0.6342923"...
0.7899877
0
Get absolute path to resource, works for dev and for PyInstaller
def resource_path(relative_path): try: # PyInstaller creates a temp folder and stores path in _MEIPASS base_path = sys._MEIPASS except Exception: base_path = os.path.abspath(".") return os.path.join(base_path, relative_path)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_resource_path():\n return os.path.join(os.path.dirname(__file__), \"resources\") + os.path.sep", "def resourcePath(relative):\r\n try:\r\n # PyInstaller creates a temp folder and stores path in _MEIPASS\r\n base_path = sys._MEIPASS\r\n except Exception:\r\n base_path = os.pa...
[ "0.83695436", "0.8280479", "0.82485795", "0.8139178", "0.8114118", "0.80985415", "0.80940944", "0.80797124", "0.80677074", "0.80673695", "0.80569947", "0.80545217", "0.80448323", "0.80448323", "0.80448323", "0.80448323", "0.80448323", "0.80448323", "0.80448323", "0.80448323", ...
0.8062465
13
Constructor for TreeNode objects.
def __init__(self, x=None): self.v = x self.cl = None self.cr = None return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n self.root = TreeNode(\"\")", "def __init__(self):\n self.root = TreeNode(\"\")", "def __init__(self):\n self.root = TreeNode(None)", "def __init__(self, c):\n TreeNode.__init__(self)\n self.c = c", "def __init__(self, tree_node=None):\n self.r...
[ "0.8108362", "0.8108362", "0.80510664", "0.7995875", "0.7857959", "0.77767617", "0.76096493", "0.7608917", "0.75968015", "0.75060695", "0.7416862", "0.7405482", "0.7405482", "0.73914033", "0.7352291", "0.7305388", "0.72537965", "0.72537965", "0.7243767", "0.72123665", "0.7210...
0.0
-1
Return a point in the direction of the goal, that is distance away from start
def steer(self, start, goal, eta=2): if self.planning_env.compute_distance(start, self.goal_config) < eta: return self.goal_config mode = 1 if mode == 1: vec = np.array([goal[0]-start[0], goal[1]-start[1]]) if np.linalg.norm(vec) != 0: normed_v...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getPointAwayFrom(startPoint, direction, distance):\n x = vectorMultiply(direction, distance)\n return vectorAdd(startPoint, x)", "def heuristic(current, goal):\r\n\r\n return Vector2.fromCell(current).distanceTo(Vector2.fromCell(goal))", "def heuristic(current, goal):\r\n # First tried manhatta...
[ "0.7263192", "0.70914197", "0.7077755", "0.7043159", "0.70124775", "0.6848783", "0.68483174", "0.6754525", "0.67367446", "0.6692805", "0.66923237", "0.66436154", "0.66000587", "0.6594549", "0.6594549", "0.6594549", "0.6583815", "0.65731794", "0.65434194", "0.65385026", "0.650...
0.6728221
9
The type of startPoint and endPoint are both Apoint
def AddLine(self,startPoint,endPoint): line=self.Space.AddLine(startPoint,endPoint) return line
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_types(begin, end):\n try:\n begin.get_midpoint()\n end.get_midpoint()\n except AttributeError:\n return False\n\n return isinstance(begin.get_midpoint(), type(end.get_midpoint()))", "def line_points(start, end):\n # Setup initial conditions\n ...
[ "0.63737124", "0.58355296", "0.5744403", "0.5739648", "0.5611249", "0.560081", "0.55754626", "0.55473876", "0.5480396", "0.54778105", "0.54730177", "0.54477584", "0.5432151", "0.5398801", "0.53956187", "0.53817874", "0.53817874", "0.536356", "0.53416574", "0.5339345", "0.5328...
0.50400436
47
Return string representation of the User.
def __repr__(self): return "<User({0} {1})>".format(self.first_name, self.last_name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n return str(self.user)", "def __str__(self):\n return str(self.user)", "def __str__(self):\n return str(self.user)", "def __str__(self):\n return str(self.user)", "def __str__(self):\n return str(self.user)", "def __str__(self):\n return str(s...
[ "0.80204374", "0.80204374", "0.80204374", "0.80204374", "0.80204374", "0.79963815", "0.79010034", "0.78993464", "0.7849589", "0.7805852", "0.7790258", "0.77716625", "0.77405465", "0.7725637", "0.7719646", "0.77193236", "0.7677248", "0.76671654", "0.7621111", "0.7618286", "0.7...
0.7590695
23
Redirects to '/' for React.
def index_file(): return redirect("/")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def home_page():\n return redirect(url_for(_DEFAULT_ROUTE, _external=True))", "def homepage():\n return redirect('index.html')", "def root_redirect():\r\n return redirect(url_for(\"display_top\"))", "def index():\n return redirect('/client/index.html')", "def index():\n return redirect(url_f...
[ "0.68406916", "0.66070217", "0.64793056", "0.6467528", "0.64633787", "0.6451695", "0.64498746", "0.64498746", "0.6431607", "0.64271945", "0.6388806", "0.638211", "0.638211", "0.638211", "0.63774633", "0.6318395", "0.6318395", "0.61303633", "0.61268705", "0.6079922", "0.607503...
0.64293826
9
Returns a unicode string of the float f in scientific notation
def scientific_notation(x, sigfigs=4, mode='eng'): times = u'\u00d7' thinspace = u'\u2009' hairspace = u'\u200a' sups = {u'-': u'\u207b', u'0': u'\u2070', u'1': u'\xb9', u'2': u'\xb2', u'3': u'\xb3', u'4': u'\u2074', u'5': u'\u2075...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_endf_float(value):\n if(abs(value) < 1e-9 or abs(value) > 9.999e9):\n raise ValueError(\"value is too small or too big\")\n valstring = \"{:>13.6e}\".format(value).replace('e','').replace('+0','+').replace('-0','-')\n # with AMPX written files we use \"-0\" instead of \"+0\" for some reas...
[ "0.741223", "0.7393204", "0.7084752", "0.69652367", "0.6941697", "0.6908427", "0.68731135", "0.6822854", "0.680802", "0.66980255", "0.6602326", "0.65827733", "0.65619725", "0.6514971", "0.6394553", "0.63863117", "0.6370054", "0.6353309", "0.63241047", "0.62823147", "0.6278941...
0.65549004
13
Remove query params from url.
def clean_url(url: str, keys: List[str]) -> str: u = urlparse(url) query = parse_qs(u.query, keep_blank_values=True) for key in keys: query.pop(key, None) u = u._replace(query=urlencode(query, True)) return urlunparse(u)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _clean_url(self, url):\n return \"\".join(url.split(\"?\")[:1])", "def delete_query_parameter(url, param_name):\n scheme, netloc, path, query_string, fragment = urlsplit(url)\n query_params = parse_qs(query_string)\n query_params.pop(param_name, None)\n new_query_string = urlencode(query_p...
[ "0.74262947", "0.73947424", "0.73772", "0.7178138", "0.70974606", "0.7031972", "0.6832554", "0.67748135", "0.67263204", "0.66971165", "0.66971165", "0.66083294", "0.6603337", "0.6602175", "0.6508045", "0.648584", "0.64378726", "0.6405395", "0.63618296", "0.63330454", "0.63227...
0.63810515
18
Initializes the target actor network parameters to be equal to the actor network parameters.
def init_target_net(self, sess): sess.run(self.init_target_net_op)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, agents_count, state_size, action_size, random_seed, buffer_size, batch_size, gamma, fc1_units, fc2_units, noise, lr_actor, lr_critic):\n\n self.agents_count = agents_count\n self.state_size = state_size\n self.action_size = action_size\n self.seed = random.seed(random...
[ "0.68795633", "0.66666377", "0.65482813", "0.65352494", "0.64881486", "0.64176387", "0.64176387", "0.6396988", "0.6379652", "0.63649195", "0.63557506", "0.6322816", "0.625571", "0.62532794", "0.62394834", "0.6234573", "0.6157013", "0.60524565", "0.60516924", "0.6032544", "0.6...
0.6642051
2
A DataFrame of representing the result of the select query. The columns represent the variables selected in the query.
def dataFrame(self): memory_file = StringIO(initial_value=self.sparql_result.decode('utf-8'), newline='\n') reader = DictReader(memory_file) schema = StructType( list(map(lambda f: StructField(f, StringType()), reader.fieldnames)) ) data = list(map(lambda d: [d[f] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_df(self) -> pd.DataFrame:\n return pd.DataFrame(self.fetchall(), columns=self.headers())", "def query_to_df(query):\n df = pd.DataFrame(query.all())\n df.columns = [x['name'] for x in query.column_descriptions]\n return df", "def query2df(query):\n df = pd.DataFrame(data = list(itert...
[ "0.7230331", "0.70914006", "0.70416063", "0.6963313", "0.6932767", "0.6884644", "0.68565303", "0.68536127", "0.6831924", "0.67554104", "0.67497116", "0.6732183", "0.67120475", "0.66844964", "0.6670939", "0.6639539", "0.6619899", "0.66052437", "0.65703833", "0.6535148", "0.653...
0.6706322
13
Returns True if the file exists (and is more recent than other file, if given).
def file_exists(file_name, must_be_more_recent_than_file = None): if file_name is None or len(file_name) == 0: return False existe = os.path.exists(file_name) if not existe: return False if not must_be_more_recent_than_file or file_name == must_be_more_recent_than_file or \ not os.path.exists(must_b...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _newer(a: str, b: str) -> bool:\n if not os.path.exists(a):\n return False\n if not os.path.exists(b):\n return True\n return os.path.getmtime(a) >= os.path.getmtime(b)", "def existing_and_newer(fn0, fn):\n\n if not os.path.isfile(fn0):\n error(\"Dependency '{}' does not exis...
[ "0.7733384", "0.77123404", "0.7630011", "0.7624326", "0.7501783", "0.7480417", "0.7347702", "0.73237956", "0.72982496", "0.71522486", "0.69876426", "0.69071954", "0.683656", "0.67223984", "0.6721324", "0.6690824", "0.658699", "0.65533054", "0.6496951", "0.64750165", "0.647011...
0.77571195
0
Get the file path where the parsed video is/will be stored.
def __get_parsed_video_file_path(season: int, episode: int) -> str: return rootpath.detect() + "/" + SAVE_FOLDER + "s" + str(season) + "e" + str(episode) + ".data"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def video_path(self):\n return self.file_path", "def video_path(self):\n return self.file_path", "def video_path(self):\n return os.path.splitext(self.file_path)[0]", "def return_testvideo_path():\r\n\tpath = '{}/Downloads/Test_videos/BigBuckBunny.mp4'.format(os.environ['USERPROFILE'] if...
[ "0.85231555", "0.85231555", "0.8235891", "0.7674073", "0.72091955", "0.7098715", "0.7097677", "0.70801026", "0.70344365", "0.69199836", "0.690058", "0.68986714", "0.68931055", "0.68681747", "0.6832103", "0.6819424", "0.6789256", "0.67562103", "0.67001826", "0.6696218", "0.668...
0.74255216
4
Get a list created by splitting the original list every nth element
def _split_lists(sequence, chunk_size): return [ sequence[i : i + chunk_size] # noqa:E203 for i in range(0, len(sequence), chunk_size) ]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def split_list_into_sublists_of_size_n(lst, n):\n return [lst[i : i + n] for i in range(0, len(lst), n)]", "def split_list(lst, n):\n for i in range(0, len(lst), n):\n yield lst[i:i + n]", "def split_list(l, n):\n n *= 2\n returned_list = [l[i: i + n] for i in range(0, len(l), n)]\n retur...
[ "0.787494", "0.78545505", "0.7850438", "0.77798975", "0.7771513", "0.77320516", "0.77215755", "0.77149105", "0.76562124", "0.7651313", "0.7622942", "0.7583266", "0.74826866", "0.7478271", "0.7415005", "0.7401781", "0.73882306", "0.738319", "0.738081", "0.73632675", "0.7360445...
0.0
-1
Take an escaped string and return the unescaped bytes equivalent.
def escaped_str_to_bytes(data): if not isinstance(data, str): raise ValueError("data must be str, but is {}".format(data.__class__.__name__)) # This one is difficult - we use an undocumented Python API here # as per http://stackoverflow.com/a/23151714/934719 return codecs.escape_decode(data)[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def escapeDecode(s: unicode) -> unicode:\n ...", "def unquote_to_bytes(string):\n if not string:\n string.split\n return b''\n if isinstance(string, str):\n string = string.encode('utf-8')\n bits = string.split(b'%')\n if len(bits) == 1:\n return string\n res = [...
[ "0.67220753", "0.6676036", "0.65465456", "0.6455765", "0.64344394", "0.636072", "0.62976956", "0.62214756", "0.6195873", "0.6176674", "0.6171069", "0.61613655", "0.6156362", "0.6111844", "0.61062294", "0.6104151", "0.60751057", "0.60701096", "0.6030536", "0.5999434", "0.59269...
0.6618639
2
Split a string of code into a [code, special area, code, special area, ..., code] list. For example, >>> split_special_areas( >>> "test / don't modify me / foo", >>> [r"/\\[\\s\\S]?\\/"]) (regex matching comments) ["test ", "/ don't modify me /", " foo"] "".join(split_special_areas(x, ...)) == x always holds true.
def split_special_areas( data: str, area_delimiter: Iterable[str], ): return re.split( "({})".format("|".join(area_delimiter)), data, flags=re.MULTILINE )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def split(string):\n\n # Turn into a list of characters\n array = list(map(str, string))\n\n # Turn escaped characters into character literals\n escaped = []\n while array:\n item = array.pop(0)\n if item == '\\\\' and array:\n escaped.append(_Literal(array.pop(0)))\n ...
[ "0.5259422", "0.5140174", "0.5116077", "0.5112465", "0.51049143", "0.50778687", "0.5018822", "0.49102008", "0.48966205", "0.4877502", "0.48298082", "0.4796882", "0.4787333", "0.47462273", "0.47404748", "0.47366232", "0.47345012", "0.4709167", "0.4676014", "0.4663034", "0.4652...
0.74224913
0
Check for a string at an address and return a UTF8 encoded byte array. If there is already data present at the address, use this to determine the string encoding. Otherwise use the datatype info passed in to determine the encoding. Check that the bytes at the address represent a valid string encoding that doesn't excee...
def getStringData(self, addrString: unicode, dtName: unicode, dtId: unicode) -> ghidra.app.decompiler.DecompileCallback.StringData: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def STRtoMEM(string, address, constraint, assertion, limit=None, lmax=STR_TO_MEM_LMAX\\\n ,addr_str=None, hex_info=False, optimizeLen=False): \n if( not limit is None and address > limit ):\n return (None, None)\n \n chain = None\n chain2 = None\n chain3 = None\n \n # Try with...
[ "0.53155714", "0.52981293", "0.5213753", "0.5135215", "0.5127046", "0.51104397", "0.5105791", "0.5099844", "0.5086397", "0.50706136", "0.499725", "0.49599066", "0.4952889", "0.49104223", "0.4891124", "0.4889233", "0.4887384", "0.4876069", "0.48680133", "0.48588645", "0.484833...
0.57434416
0
Returns a 2d gaussian function with the given parameters
def gaussian(height, center_x, center_y, width_x, width_y): width_x = float(width_x) width_y = float(width_y) return lambda x,y: height*np.exp( -(((center_x-x)/width_x)**2+((center_y-y)/width_y)**2)/2)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gaussian2d(x, y, A, sigma, x0):\n Z = A * np.exp(-( (x-x0[0])**2/(2*sigma[0]**2) + (y-x0[1])**2/(2*sigma[1]**2)))\n return Z", "def gaussian2d(p, x, y):\n #2010-06-08 20:00 IJC: Created\n #2013-04-19 23:49 IJMC: Improved documentation, per BACM's request.\n \n x = array(x, dtype=float).copy...
[ "0.7324225", "0.7215325", "0.7173185", "0.70675343", "0.702932", "0.7028148", "0.686321", "0.6761602", "0.6750571", "0.6738603", "0.6702997", "0.66618747", "0.6621917", "0.65679467", "0.6567921", "0.65630645", "0.6557936", "0.65531415", "0.6545881", "0.6541525", "0.6510242", ...
0.7087846
5
Wrapper for a matrixvariate normal distribution with mean matrix M, column/left covariance matrix U and row/right covariance matrix V.
def matrix_normal(M,U,V): return numpy.random.multivariate_normal(M.ravel(), np.kron(V, U)).reshape(M.shape)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __call__(self, mean=None, cov=1):\r\n return multivariate_normal_frozen(mean, cov)", "def safe_multivariate_normal(mean, cov, size=None, rng=None):\n res = np.atleast_1d(\n stats.multivariate_normal(mean=mean, cov=cov, allow_singular=True).rvs(\n size=size, random_state=rng\n ...
[ "0.6991815", "0.6650995", "0.66411173", "0.65573484", "0.6537078", "0.650255", "0.64847136", "0.6455964", "0.63620806", "0.63019603", "0.62965226", "0.62950706", "0.6079157", "0.60671943", "0.60643196", "0.60547173", "0.6046039", "0.6045435", "0.60196877", "0.6017453", "0.600...
0.7643551
0
Produces a matrix useful for including a polynomial component of order 'order' in G for a DLM.
def polynomial_matrix(order): matrix = np.identity(order) for i in range(order-1): matrix[i,i+1] = 1 return matrix
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_g_matrix(order, arrays):\n size = len(order)\n g = np.zeros((size, size), dtype=np.int)\n for i, row in enumerate(g):\n for j, col in enumerate(order):\n g[i][j] = arrays[i][order[j]]\n return g", "def poly_matrix(x, y, order=2):\r\n ncols = (order + 1)**2\r\n G = n...
[ "0.7718904", "0.70684236", "0.670039", "0.62359166", "0.61884737", "0.6137331", "0.60008657", "0.5993289", "0.597499", "0.59245527", "0.5882654", "0.5836604", "0.5759323", "0.5654383", "0.56192493", "0.561696", "0.5611295", "0.5600098", "0.55963385", "0.5454992", "0.54461604"...
0.750896
1
Convert torch.Tensor to np.ndarray.
def to_numpy(tensor: torch.Tensor) -> np.ndarray: return ( tensor.detach().cpu().numpy() if tensor.requires_grad else tensor.cpu().numpy() )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _torch_to_numpy(tensor):\n return tensor.detach().cpu().numpy()", "def to_numpy(tensor):\n raise NotImplementedError", "def to_numpy(x):\n if isinstance(x, torch.Tensor):\n x = x.cpu().detach().numpy()\n return x", "def th_to_arr(tens: torch.Tensor) -> np.ndarray:\n return check...
[ "0.87928337", "0.8669646", "0.8364229", "0.7886286", "0.7858516", "0.78459454", "0.7812589", "0.7611705", "0.75641793", "0.74913985", "0.740594", "0.7331686", "0.7305684", "0.73014843", "0.7247689", "0.72379434", "0.71137154", "0.7094674", "0.70865655", "0.70853114", "0.70853...
0.81380445
3
Determine if a string is a number.
def is_number(str): try: float(str) return True except ValueError as e: print(e) try: unicodedata.numeric(str) return True except (TypeError, ValueError) as e: print(e) return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_number(s):\r\n try:\r\n int(s)\r\n return True\r\n except ValueError:\r\n return False", "def is_number(string):\r\n try:\r\n float(string)\r\n return True\r\n except ValueError: return False", "def is_number(s):\n try:\n int(s)\n return Tr...
[ "0.84806883", "0.8465859", "0.8432079", "0.8429942", "0.8400312", "0.8236704", "0.8220147", "0.8178517", "0.8178517", "0.8178517", "0.8160241", "0.8057642", "0.8054465", "0.8035937", "0.80095077", "0.79583895", "0.78929424", "0.77899206", "0.77663577", "0.77380216", "0.772265...
0.82054204
7
Compute euclidian distance between 2 points
def distance(point1, point2): return math.sqrt(math.pow((point1[0] - point2[0]), 2) + math.pow(point1[1] - point2[1], 2))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def euclidian_distance(x1, y1, x2, y2):\n distance = sqrt(pow((x1-x2), 2)+(pow((y1-y2), 2)))\n return distance", "def eucl_dist(x_0, y_0, x_1, y_1):\n return sqrt((x_1 - x_0)**2 + (y_1 - y_0)**2)", "def euclid_dist(p1, p2):\n \n return float(np.linalg.norm(np.array(p1)-np.array(p2)))", "def eu...
[ "0.86372054", "0.8209718", "0.8076259", "0.80592096", "0.7922613", "0.78931886", "0.7879183", "0.78760016", "0.78725135", "0.787059", "0.7801263", "0.7794017", "0.7744587", "0.7725364", "0.77234155", "0.7713019", "0.76902175", "0.7685397", "0.76832205", "0.7680615", "0.76502"...
0.7321107
61
Takes an LDAP timestamp and converts it to a datetime object
def ldap_to_datetime(timestamp: float): from datetime import datetime, timedelta return datetime(1601, 1, 1) + timedelta(timestamp/10000000)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _timestamp_to_datetime(timestamp):\n return datetime.fromtimestamp(timestamp * 0.001, tz=timezone.utc)", "def to_datetime(timestamp: str) -> datetime.datetime:\n if timestamp is None:\n return\n\n if timestamp.endswith(\"+00:00\"):\n timestamp = timestamp[:-6]\n\n try:\n ...
[ "0.69570124", "0.6798226", "0.6788359", "0.6673895", "0.6667453", "0.66557354", "0.664417", "0.6633878", "0.6618822", "0.65907073", "0.65794194", "0.6566606", "0.65553665", "0.6494342", "0.64844996", "0.6453235", "0.64423996", "0.6424587", "0.64125794", "0.6380295", "0.637308...
0.83100456
0
Gets all files in a directory and returns them as a generator Optionally takes an extension and returns only files with that extension
def get_files_in_dir(dir, ext): import os for root, dirs, files in os.walk(dir): for file in files: if file.split('.')[1].lower() == ext.lower() or not ext: file_full_path = os.path.join(root, file) yield file_full_path
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all_files(directory, extension):\n return (f for f in os.listdir(directory) if f.endswith(extension) and os.path.isfile(os.path.join(directory, f)))", "def getFiles(searchDir = './', extension = 'source'):\n from glob import glob \n\n return glob(searchDir+'/*.'+extension)", "def __get_file...
[ "0.7587808", "0.74356925", "0.7359545", "0.73289007", "0.7299761", "0.7112189", "0.70964307", "0.7009721", "0.7002529", "0.69936913", "0.6981189", "0.69266367", "0.6907293", "0.6906844", "0.69042885", "0.690211", "0.688046", "0.6875419", "0.6874009", "0.68681043", "0.6844086"...
0.78696007
0
Onehot encode a matrix with samples in its rows and features in its columns. Columns share number of classes.
def one_hot_encode(x_: ArrayLike) -> tuple[IntArray, dict[str, int]]: x: np.ndarray = np.copy(x_) if x.ndim == 1: x = x[:, np.newaxis] shape = x.shape has_na = np.any(pd.isna(x)) if x.dtype == object: x = x.astype(str) categories, codes = np.unique(x, return_inverse=True) num...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def one_hot(x, num_classes, dtype=jnp.float32):\n return jax.nn.one_hot(x, num_classes).astype(dtype)", "def one_hot_encode(x, n_classes):\n return np.eye(n_classes)[x]", "def one_hot_encode(Y, classes):\n if type(classes) is not int:\n return None\n if Y is None or type(Y) != np.ndarray:\n ...
[ "0.81431544", "0.8078312", "0.7979102", "0.7965783", "0.790906", "0.7873546", "0.78724784", "0.78724784", "0.7794382", "0.7780159", "0.773806", "0.77087766", "0.7708256", "0.769487", "0.76832706", "0.7667626", "0.76672274", "0.76662755", "0.7656931", "0.7624143", "0.76124936"...
0.7463399
37
Onehot encode a single value given an existing mapping.
def one_hot_encode_single(mapping: dict[str, int], value: Optional[str]) -> IntArray: encoded_value = np.zeros((1, len(mapping))) if not pd.isna(value): code = mapping[str(value)] encoded_value[0, code] = 1 return encoded_value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def one_hot_enc(self, word):\n word = self.text_to_int(word)\n word = Variable(torch.tensor(word))\n word = torch.nn.functional.one_hot(word, len(self.index_map))\n return word.transpose(0, 1)", "def one_hot_encode(x):\n # TODO: Implement Function\n output = np.zeros((len(x), 10...
[ "0.78757477", "0.78410596", "0.77623206", "0.7745399", "0.7715436", "0.7655086", "0.7651322", "0.76193875", "0.76150674", "0.757775", "0.75697935", "0.7514445", "0.74897856", "0.74132633", "0.73941153", "0.7384662", "0.73734295", "0.737268", "0.7364205", "0.73638296", "0.7352...
0.8763734
0
Sets an image's anchor point to its center
def center_image(image): image.anchor_x = image.width / 2 image.anchor_y = image.height / 2
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_anchor_center(img):\n img.anchor_x = int(img.width / 2)\n img.anchor_y = int(img.height / 2)", "def center_image_anchor(image):\n image.anchor_x = image.height/2\n image.anchor_y = image.height/2", "def center_image(image):\n image.anchor_x = image.width/2\n image.anchor_y = image.he...
[ "0.90281963", "0.8889724", "0.83751583", "0.7735093", "0.6865935", "0.6865935", "0.6865935", "0.6598224", "0.6543568", "0.6492926", "0.64924777", "0.64914834", "0.6450042", "0.64482135", "0.6326582", "0.62869936", "0.62598854", "0.62326556", "0.61813617", "0.6158871", "0.6137...
0.84558606
2
Turns a list (seq) into a list of smaller lists len <= size, where only the last list will have len < size.
def chunker(seq: list, size: int) -> list: if isinstance(seq, list) == False: raise ValueError("`seq` must be a list") return list(seq[pos:pos + size] for pos in range(0, len(seq), size))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def slice_list(input, size):\n input_size = len(input)\n slice_size = input_size // size\n remain = input_size % size\n result = []\n iterator = iter(input)\n for i in range(size):\n result.append([])\n for j in range(slice_size):\n result[i].append(next(iterator))\n ...
[ "0.7792886", "0.7583097", "0.7489251", "0.7420136", "0.73593587", "0.73382896", "0.73261523", "0.73095775", "0.7190314", "0.7104177", "0.7100655", "0.7095236", "0.7009843", "0.6979322", "0.6960295", "0.687287", "0.6866229", "0.68394846", "0.6810673", "0.6785111", "0.6721349",...
0.8156676
0
Annotate the queryset with ``number_of_published_feedbacksets``
def annotate_with_number_of_published_feedbacksets(self): return self.annotate( number_of_published_feedbacksets=models.Count( models.Case( # When grading_published_datetime, count that as 1 in the Count. models.When(feedbackset__grading_publis...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def annotate_with_is_corrected_count(self):\n whenquery = models.Q(\n models.Q(cached_data__last_feedbackset=models.F(\n 'cached_data__last_published_feedbackset')),\n )\n return self.annotate(\n annotated_is_corrected=models.Count(\n models....
[ "0.6241891", "0.6162761", "0.612647", "0.6054583", "0.5876955", "0.5813578", "0.5635396", "0.55372936", "0.5529012", "0.5456611", "0.542744", "0.5423302", "0.5390988", "0.53699577", "0.52902174", "0.5274658", "0.52679217", "0.5255331", "0.5202402", "0.51720786", "0.511927", ...
0.8731602
0
Annotate the queryset with ``annotated_is_waiting_for_feedback``. Groups waiting for feedback is all groups where
def annotate_with_is_waiting_for_feedback_count(self): now = timezone.now() whenquery = models.Q( cached_data__last_feedbackset__grading_published_datetime__isnull=True, cached_data__last_feedbackset__deadline_datetime__lt=now ) return self.annotate( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def annotate_with_is_waiting_for_deliveries_count(self):\n now = timezone.now()\n whenquery = models.Q(\n models.Q(cached_data__last_feedbackset__grading_published_datetime__isnull=True)\n |\n models.Q(cached_data__last_feedbackset__grading_published_datetime__isnull=...
[ "0.66416025", "0.57109416", "0.5615562", "0.55359405", "0.51586306", "0.50935", "0.47668773", "0.47282854", "0.45111638", "0.44789162", "0.44469404", "0.44078752", "0.43912956", "0.4362576", "0.43571055", "0.43520662", "0.43323195", "0.43153945", "0.42924458", "0.4283329", "0...
0.7781642
0
Annotate the queryset with ``annotated_is_waiting_for_deliveries``. Groups waiting for deliveries is all groups where
def annotate_with_is_waiting_for_deliveries_count(self): now = timezone.now() whenquery = models.Q( models.Q(cached_data__last_feedbackset__grading_published_datetime__isnull=True) | models.Q(cached_data__last_feedbackset__grading_published_datetime__isnull=False, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def annotate_with_is_waiting_for_feedback_count(self):\n now = timezone.now()\n whenquery = models.Q(\n cached_data__last_feedbackset__grading_published_datetime__isnull=True,\n cached_data__last_feedbackset__deadline_datetime__lt=now\n )\n\n return self.annotate(\...
[ "0.636188", "0.5467847", "0.5259589", "0.49896196", "0.48864347", "0.48101753", "0.47321013", "0.4712756", "0.4699364", "0.46990243", "0.4670556", "0.4668696", "0.46457908", "0.46424592", "0.4638873", "0.45634142", "0.4505655", "0.44983035", "0.44358492", "0.44142082", "0.441...
0.77949655
0
Annotate the queryset with ``annotated_is_corrected``. Corrected groups is all groups where the last feedbackset is the same as the last published feedbackset. This means that this method annotates with the same logic
def annotate_with_is_corrected_count(self): whenquery = models.Q( models.Q(cached_data__last_feedbackset=models.F( 'cached_data__last_published_feedbackset')), ) return self.annotate( annotated_is_corrected=models.Count( models.Case( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_corrected(self):\n return self.cached_data.last_published_feedbackset_is_last_feedbackset", "def annotate_with_is_waiting_for_feedback_count(self):\n now = timezone.now()\n whenquery = models.Q(\n cached_data__last_feedbackset__grading_published_datetime__isnull=True,\n ...
[ "0.5746616", "0.53334796", "0.51703966", "0.5131228", "0.51200956", "0.49407178", "0.49389604", "0.49074098", "0.48306704", "0.48254755", "0.47719547", "0.47653466", "0.47572133", "0.47415987", "0.4721871", "0.46469527", "0.4620674", "0.45998254", "0.45436025", "0.44854292", ...
0.7498719
0
Annotate the queryset with ``is_passing_grade``. ``is_passing_grade`` is ``True`` if the following is true
def annotate_with_is_passing_grade_count(self): return self.annotate( is_passing_grade=models.Count( models.Case( models.When( cached_data__last_published_feedbackset__isnull=False, cached_data__last_published_feedba...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def this_is_the_grade(self, grade_to_set):\n\n\t\tcmds.intField(self.grade_intField, edit = True, value = grade_to_set['grade_value'])\n\t\tself.update_subcategory('intField')\n\t\tif grade_to_set['grade_value'] is not '':\n\t\t\tcmds.scrollField(self.comments_text_field, edit = True, text = grade_to_set['comment_...
[ "0.5995545", "0.53032815", "0.51084197", "0.506959", "0.4960031", "0.49054807", "0.48585275", "0.4833941", "0.48213074", "0.48007125", "0.47800314", "0.47686103", "0.47686103", "0.47634307", "0.46888748", "0.46597368", "0.4585901", "0.45417282", "0.44740984", "0.4469044", "0....
0.760103
0
Returns a QuerySet matching all AssignmentGroups where the given user is student.
def where_is_candidate(cls, user_obj): return AssignmentGroup.objects.filter(cls.q_is_candidate(user_obj))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all_allowed_students(self):\n if self.is_superuser:\n return Student.objects.all()\n\n # Students who this user manages\n manages = Q(case_manager=self)\n # Students in a class this user teaches\n teaches = Q(enrollment__section__teacher=self)\n\n valid_...
[ "0.60944504", "0.6058301", "0.5985827", "0.5879116", "0.5852799", "0.5801987", "0.57185704", "0.559262", "0.5571089", "0.5569297", "0.5542978", "0.55106735", "0.5505366", "0.5502392", "0.54324675", "0.5427524", "0.5398659", "0.5383785", "0.53642976", "0.5343562", "0.5342866",...
0.61185515
1
Get the anonymous displayname for this group.
def get_anonymous_displayname(self, assignment=None): if assignment is None: assignment = self.assignment candidateids = [] for candidate in self.candidates.all(): candidateids.append(str(candidate.get_anonymous_name(assignment=assignment))) if candidateids: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def display_name(self):\n return self.settings['displayName']", "def display_name(self):\n return self.properties.get(\"displayName\", None)", "def display_name(self):\n if \"displayName\" in self._prop_dict:\n return self._prop_dict[\"displayName\"]\n else:\n ...
[ "0.74992424", "0.74468815", "0.7426055", "0.7426055", "0.7426055", "0.7426055", "0.7426055", "0.73345494", "0.71123296", "0.71061194", "0.71061194", "0.71061194", "0.7104129", "0.70770425", "0.7047298", "0.7047298", "0.7047298", "0.7047298", "0.7047298", "0.7047298", "0.70472...
0.7947346
0
A short displayname for the group. If the assignment is anonymous, we list the candidate IDs. If the group has a name, the name is used, else we fall back to a comma separated list of usernames. If the group has no name and no students, we use the ID.
def short_displayname(self): return self.get_short_displayname()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_anonymous_displayname(self, assignment=None):\n if assignment is None:\n assignment = self.assignment\n\n candidateids = []\n for candidate in self.candidates.all():\n candidateids.append(str(candidate.get_anonymous_name(assignment=assignment)))\n if candid...
[ "0.7948296", "0.6684177", "0.6370828", "0.6358396", "0.6309768", "0.61962223", "0.61941844", "0.6178053", "0.6150803", "0.6150803", "0.6095031", "0.60350853", "0.59816104", "0.59704864", "0.5907948", "0.58956707", "0.58673894", "0.5845144", "0.58423465", "0.58333063", "0.5832...
0.5529985
45
Get a string contaning the shortname of all examiners in the group separated by comma (``','``).
def get_examiners(self, separator=', '): warnings.warn("deprecated", DeprecationWarning) examiners = [examiner.user.shortname for examiner in self.examiners.select_related('user')] examiners.sort() return separator.join(examiners)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extract_names(collection):\n return (\n '[{}]'.format(', '.join(map(repr, groups[n].entity_names)))\n if n in groups else repr(n) for n in collection\n )", "def get_examiners(self):\n return u', '.join([u.username for u in self.examiner...
[ "0.61967695", "0.61785257", "0.6165374", "0.61302996", "0.6028557", "0.59972143", "0.5992494", "0.59858793", "0.5962725", "0.5924417", "0.5915202", "0.5909044", "0.5886847", "0.58594227", "0.582712", "0.5817088", "0.575587", "0.5731914", "0.5687156", "0.5686465", "0.56674427"...
0.6358391
0
Returns ``True`` if this AssignmentGroup does not contain any deliveries.
def is_empty(self): from .delivery import Delivery return Delivery.objects.filter(deadline__assignment_group=self).count() == 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def missing_expected_delivery(self):\n from devilry.apps.core.models import Delivery\n from devilry.apps.core.models import Deadline\n if self.assignment.is_electronic and self.get_status() == \"waiting-for-feedback\":\n return not Delivery.objects.filter(\n deadline_...
[ "0.6735427", "0.6497307", "0.63981503", "0.63849527", "0.6172128", "0.61249626", "0.60911006", "0.60464543", "0.5982698", "0.59305555", "0.5923261", "0.59223324", "0.59017694", "0.59017694", "0.59017694", "0.5888088", "0.5886479", "0.58774376", "0.5861332", "0.5843115", "0.58...
0.7579992
0
Returns ``True`` if the last feedbackset is published.
def is_corrected(self): return self.cached_data.last_published_feedbackset_is_last_feedbackset
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_next(self) -> bool:\n return self.published_after().count() != 0", "def is_published(self) -> bool:\n return self.published and self.published <= timezone.now()", "def is_published(self):\n now = timezone.now()\n return now >= self.pub_date", "def has_previous(self) -> boo...
[ "0.7354891", "0.7104928", "0.69184667", "0.6914546", "0.688464", "0.68714714", "0.6863141", "0.664994", "0.6407359", "0.6332567", "0.6322119", "0.6319217", "0.62568265", "0.6135828", "0.6129512", "0.6125349", "0.60762244", "0.5992559", "0.5981163", "0.5961078", "0.5930414", ...
0.7249451
1
Density of the excess logreturn.
def density(self, arg): mean = - self.sigma**2 * self.data['maturity'] std = self.sigma * self.data['maturity']**.5 return scs.norm(mean, std).pdf(arg)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def weighted_log_density(self):\n return self.rho*math.log(self.density)", "def density( self ) :\n return self.__density", "def density( self ) :\n return self.__density", "def density( self ) :\n return self.__density", "def density(self, arg):\n return self.gb2_density...
[ "0.72120595", "0.68245167", "0.68245167", "0.68245167", "0.6793508", "0.6786592", "0.6729758", "0.6675245", "0.6600844", "0.65504026", "0.6527812", "0.6521712", "0.6504028", "0.6493991", "0.6492609", "0.6469018", "0.646606", "0.643575", "0.643467", "0.6415614", "0.6415313", ...
0.64329064
19