ngram
listlengths
0
67.8k
[ "TMS Global Mercator pyramid\" self.tileSize = tileSize self.initialResolution = 2 * math.pi *", "GlobalGeodetic (based on EPSG:4326) for OpenLayers Base Map and Google Earth compatible tiles", "= math.log( math.tan((90 + lat) * math.pi / 360.0 )) / (math.pi /", "= 156543.03392804062 What is the difference be...
[ "= ['name', 'product_image', 'price', 'discount_price', 'slug', 'label'] inlines = [ProductImageModel] list_per_page = 3", "from .models import Product, CartProduct, Order, Address, Payment, Coupon, Refund, Setting, ProductImages, Profile,", "readonly_fields = ['stripe_charge_id', 'paypal_order_key', 'paypal_us...
[ "('amount', models.DecimalField(decimal_places=2, max_digits=9)), ('amount_received', models.DecimalField(decimal_places=2, default=Decimal('0'), max_digits=9)), ('bitcoin_amount', models.PositiveIntegerField()), ('bitcoin_amount_received', models.PositiveIntegerField(default=0)), ('bitcoin_uri', models.TextField(b...
[ "parknn = min(5, n_samples, self.X_.shape[0]) Xnew, y = SMOTE(sampling_strategy = parss, k_neighbors =", "return self.mname_ # ============================================================================= # # TEST # # from sklearn.datasets import make_classification", "import matplotlib.pyplot as plt # plt.scat...
[ "True: j = random.randint(0 , 119) if i != j: break while True:", "119) while True: j = random.randint(0 , 119) if i != j: break", "m != l: break return i , j , z , k ,", "random.randint(0 , 119) if z != i and z != j: break k", "= random.randint(0 , 119) if z != i and z != j: break", "i and z != j: break ...
[ "-1 shutil.copy(eachfile, targetDir + os.path.basename(eachfile)) print eachfile + \" copy succeeded!\" cmd =", "\"--------------------------------------------------\" def feature_generator_query(target_dir): ''' 根据图片文件列表,获取线上系统 查询视频帧 .bow .hash .txt 信息 :param target_dir: endswith", "= [] img_names = get_all_fi...
[ "walk of a tree (left, right, parent)\"\"\" def post_order_walk(node, result: list, left: Callable,", "q.put(node) tree.append(node) if current_parent is not None: if (is_full(current_parent)): current_parent = q.get(block=False) add_child(current_parent,", "= [] post_order_walk(tree[0], post_order_walk_result,...
[ "out_shp: int corresponding to the output image shape on the considered axis. \"\"\"", "{} reverse = True if not broadcastable: reverse = False a_idx = [None]", "s in node_a.shape: idx = node_a.shape.index(s) all_ops.append(idx) else: assert s in node_b.shape, f\"Output", "0 if s in a_map: start = a_map[s] si...
[ "Lower directory 참조 def function_2(): print(\"function_2 of second module imported\") def call_function_in_first_module(): print(\"called", "import first_module # Upper directory 에서 Lower directory 참조 def function_2(): print(\"function_2 of", "경로 sys.path.append(UPPER_PATH) # 상위 경로를 추가 from my_tools import firs...
[ "x.pop('kind') yield 'user-id', x.pop('user-id') yield 'group-id', x.pop('group-id') yield 'environ', Map(x.pop('environ')) yield 'memory-limit', x.pop('memory-limit')", "BaseLoader except ImportError: from yaml import SafeDumper as BaseDumper from yaml import SafeLoader", "def tag_map_repr(self, value): return...
[ "tuple = (0.05, 0.05, 0.08, 1.0) canvas_dark_mode_clear_color: tuple = (0.05, 0.05, 0.08, 1.0)", "str = \":/dark/stylesheet.qss\" light_stylesheet: str = \":/light/stylesheet.qss\" canvas_light_mode_clear_color: tuple = (0.05, 0.05, 0.08,", "\":/dark/stylesheet.qss\" light_stylesheet: str = \":/light/stylesheet...
[ "'correct_switched', 'incorrect_switched', 'is_switchable', 'is_associative', 'translated']) return df def generate_json(df): json_rows = [] for", "else wsc_json[i+1]['substitution'] # noqa E226 correct_sentence = correct_sentence.replace('recieved', 'received') incorrect_sentence = incorrect_sentence.replace('re...
[ "i in range(mat['R'].shape[0])] print(len(actualHs),actualHs[0].shape) for i in range(mat['R'].shape[0]): for k in range(mat['R'].shape[1]-1): actualHs[i]", "np.dot(Hs[i][k] , actualHs[i]) print(actualHs[0].shape) registeredModel = [] #registeredmodel[0][x][0] cointains the array of points", "matlab.engine impo...
[ "headers_useragents=[] headers_referers=[] request_counter=0 flag=0 safe=0 def inc_counter(): global request_counter request_counter+=1 def set_flag(val): global", "1.0') headers_useragents.append(':robot/1.0 (linux) ( admin e-mail: undefined http://www.neofonie.de/loesungen/search/robot.html )') headers_useragen...
[ "with open(path) as csvfile: df = pd.read_csv(csvfile) url = df['url'] products = extract_products_json(url)", "'./stores.csv' import pandas as pd from shopify import extract_products_json result = '' with", "extract_products_json result = '' with open(path) as csvfile: df = pd.read_csv(csvfile) url =", "resu...
[ "result.append(\"\\\\u%.4X\" % ord(c)) else: result.append(c) return \"\".join(result) def to_json(obj): t = type(obj) if", "query.get() def to_json(self): return to_json({'name': self.name, 'count': self.count}) class Version(db.Model): current_suite = db.StringProperty()", "'\\f': '\\\\f', '\\n': '\\\\n', '\\...
[ "setuptools import setup, find_packages with open('requirements.txt') as f: required = f.read().splitlines() setup( name='taming-transformers',", "from setuptools import setup, find_packages with open('requirements.txt') as f: required = f.read().splitlines() setup(", "setup, find_packages with open('requiremen...
[ "the grouping matrix. It is important to # extract the values in the", "return self._compute_r_stat(grouping_tri) def _compute_r_stat(self, grouping_tri): # within r_W = np.mean(self._ranked_dists[grouping_tri]) # between r_B", "matrix where True means that the two objects are in the same #", "means that the ...
[]
[ "supports PySide2 and 6 but needs to adapt to whats already imported NOT", "<reponame>ewerybody/siding<gh_stars>0 \"\"\" singlesiding supports PySide2 and 6 but needs to adapt to whats", "in sys.modules: from PySide2 import QtCore, QtWidgets, QtNetwork else: try: from PySide6 import", "PySide2 import QtCore, ...
[ "main(direc): direc_list = get_direc(direc) for file in direc_list: file_code = file.split('/')[-1].split('.')[0] table_csv =", "all files under the directory\"\"\" path = os.path.join(direc, direc+'png', '*png') direc_list = glob.glob(path)", "directory\"\"\" path = os.path.join(direc, direc+'png', '*png') dir...
[]
[ "aname = 'Anonymous' # get article title atitle = soup.find(class_=\"_21349 india none _4ca8e\")", "= link # get page text page = requests.get(url) # parse with BFS", "get the text only text = paragraph.get_text() paragraphtext.append(text) # combine all paragraphs into", "india none _4ca8e\") thetitle = atit...
[ "prices[i-1]) dp_i_k_1[i][j] = max(dp_i_k_1[i-1][j], dp_i_k_0[i-1][j-1] - prices[i-1]) return dp_i_k_0[nLen][k] # 边界 solution =", "len(prices) = 2 assert(solution.maxProfit(1, [1,4]) == 3) assert(solution.maxProfit(2, [1,4]) == 3) assert(solution.maxProfit(2, [4,1])", "0 dp_i_1 = -sys.maxsize for i in range(nLe...
[ "import LogicPy.flipflops as flipflops import LogicPy.combination_logic as combination_logic import LogicPy.display_terminals as display_terminals import", "LogicPy.main_functions as main_functions import LogicPy.conversion as conversion import LogicPy.gates as gates import LogicPy.flipflops", "LogicPy.conversi...
[ "count in range(size): message += str(random.randint(0,1)) return message n = 32 * 10000", "'' for count in range(size): message += str(random.randint(0,1)) return message n = 32", "random binary string def generateMessage (size): message = '' for count in range(size):", "string def generateMessage (size): me...
[ "in fobj.readlines()]) git_repo = Repo(\"dvc\") hashes = [git_repo.commit(t).hexsha + os.linesep for t in", "convert_to_sha(tags_filename=\"tags.txt\", hashes_filename=\"hashes.txt\"): tags = [] with open(tags_filename, \"r\") as fobj: tags.extend([l.strip() for l", "os from git import Repo def convert_to_sha(t...
[]
[ "CCA = 1 SECOND = 2 def start(update, context): username = update.message.from_user.username first_name", "your CCAs.\" % ( first_name), reply_markup=reply_markup) return CCA def end(update, context): query =", "import InlineKeyboardButton, InlineKeyboardMarkup from telegram.ext import ConversationHandler impor...
[ "<gh_stars>0 from kivy.uix.widget import Widget from kivy.uix.floatlayout import FloatLayout class RootWidget(FloatLayout): def __init__(self,", "kivy.uix.widget import Widget from kivy.uix.floatlayout import FloatLayout class RootWidget(FloatLayout): def __init__(self, **kwargs): super().__init__(**kwargs)", "...
[ "__init__(self, *dirs): self.dirname = BASE_DIR / self.default_dir / '/'.join(*dirs) mkdir_if_not_exists(self.dirname) def write_file(self, name,", "language) -> bool: basename = remove_win_special_char(name) file = self.dirname / ''.join([basename, get_extension(language)]) if", "'w', encoding='utf-8') as f: f...
[ "9.0; en-US)', 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0; .NET", "= { 'house_renting.pipelines.HouseRentingPipeline': 100, 'house_renting.pipelines.DuplicatesPipeline': 200, 'scrapy.pipelines.images.ImagesPipeline': 300, 'house_renting.pipelines.ESPipeline': 400, } IMAGES_STORE =...
[ "(1-q_j) * (1-q_k) def circuit_011(self, q_i, q_j, q_k): \"\"\"Implements a circuit that checks", "the nonsensical string 000.\"\"\" return (1-q_i) * (1-q_j) * (1-q_k) def circuit_011(self, q_i,", "r in range(maximum)]) for k in ['y', 'z']]) return prefactor * \\ (", "j, 'x+'), 'x-': self.sum_string(i, j, 'x-...
[ "django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations =", "models.CharField(choices=[('unrated', 'Unrated'), ('1', '1'), ('2', '2'), ('3', '3'), ('4', '4'), ('5', '5'), ('6',", "('animated_film', ...
[ "the axis and way to manipulate the axis appearance. \"\"\" @mark_backend_unsupported def enable_zooming(self,", "self.colorbar.finalize() del self.colorbar def add_line( self, id: str, orientation: str, position: float, bounds:", "\"\"\"Cursor on a plot.\"\"\" #: x_value = Float() #: y_value = Float() #:", "...
[]
[ "False def __init__(self, *args, **kwargs): super(Node, self).__init__(*args, **kwargs) self.sockets = {} self.processes =", "stop(self): try: self._process.terminate() self._process.wait() except psutil.NoSuchProcess: pass def restart(self): print(\"restarting %s\" % self)", "self._services.append((name, c.get...
[ "exitAction.setShortcut('Ctrl+Q') exitAction.setStatusTip('Exit application') exitAction.triggered.connect(QtGui.QApplication.quit) self.statusBar().showMessage('Ready') # menubar menubar = self.menuBar() menubar.setNativeMenuBar(False) fileMenu =", "self.toolbar2 = QtGui.QToolBar('name') self.toolbar2.setToolBut...
[ "nextNode=None): self.val = value self.next = nextNode class MyLinkedList(object): def __init__(self): \"\"\" Initialize", "\"\"\" Append a node of value val to the last element of the", "linked list. If index equals to the length of linked list, the node", "curr = curr.next def addAtHead(self, val): \"\"\" A...
[ "\"LMDG\": { \"title\": \"LMD-G\", \"color\": \"tab:red\", }, \"ROCKE3D\": { \"title\": \"ROCKE-3D\", \"color\": \"tab:green\",", "\"color\": \"tab:red\", }, \"ROCKE3D\": { \"title\": \"ROCKE-3D\", \"color\": \"tab:green\", }, \"UM\": { \"title\":", "}, \"LMDG\": { \"title\": \"LMD-G\", \"color\": \"tab:red\", ...
[ "[], [] for _ in range(trials + 1): x, y = random(), random()", "+ \" trials processing time: \" + str(time.process_time() - start)) return 4 *", "time import logging import matplotlib.pyplot as plt logger = logging.getLogger() logging.basicConfig(level=logging.INFO) def estimate_pi(trials):", "/ trials def g...
[ "[] phenotype_structured = self.phenotype_structured.all() for phenotype in self.phenotype_structured.all(): data.append('<b>'+phenotype.id+'</b>: '+phenotype.label) return data def", ") name = models.CharField(verbose_name='Performance Metric Name', max_length=100, null=False) # ex: \"Odds Ratio\" name_short", ...
[ "train_dataloader(self): return DataLoader( dataset=self.train_dataset, batch_size=self.batch_size, shuffle=True, num_workers=self.num_workers, ) def val_dataloader(self): return DataLoader( dataset=self.valid_dataset,", "dataset=self.valid_dataset, batch_size=self.batch_size, shuffle=True, num_workers=self.num_w...
[ "init_token is properly handled. field = data.TextField(fix_length=4, init_token=\"<bos>\") minibatch = [[\"a\", \"sentence\", \"of\",", "== expected_output assert field.decode(np.asarray(word_idxs)) == expected_output # Single caption word_idxs = [0, 3,", "# Test init_token is properly handled. field = data.Te...
[ "'UNDEFINED' SITTINGOUT_STR = 'Sitting Out' BASE_DIR = '/home/nonroot/Projects/' #Change this path HH_PATH =", "SLEEP_MILLISECONDS = 750 GET_SESSION_URL = 'https://sealswithclubs.eu/sealsloginhandler.php?login=X&JSON=1&Version=v0.2.18' USER_AGENT_STR = 'python-requests/1.1.0 CPython/2.7.3 Windows/7' SERVICE_URL =...
[ "StringIO # h( h(1) + h(2) ) # 0df4085b3a65bd26ca6ab608c0f70c41213f77e56bc5b33bd9899db5d39a7cd8 # h( h(3) +", "% 2 != 0: hashes.append(hashes[-1]) i = 0 j = 0 while i", "+ 1 < len(hashes): hashes[j] = sha256(str(hashes[i] + hashes[i + 1]).encode('utf-8')).hexdigest() i +=", "bitcoin core implementation ''' im...
[ "P def f(x): P = 4e9 return ones(shape(x)) * P x = arange(0,3e6,100)", "label='Moon') plt.plot(x,mars(x), label='Mars') plt.plot(x,earth(x), label='Earth') plt.plot(x,jupiter(x), label='Jupiter') plt.axis([0,3e6,0,y_max]) plt.legend() #~ plt.plot([1,2,3,4]) #~ plt.ylabel('some", "5510 * 9.807 * x return P def j...
[ "count else: for i, square in enumerate(squares): # Find the biggest square that", "in square_nums: if is_divided_by(n - k, count - 1): return True return False", "= min(dp[i], dp[i - square] + 1) return dp[-1] # Greedy DFS 1", "1, squares[i:]) # Greedy DFS 2 class Solution: def numSquares(self, n): def is_di...
[ "selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support.expected_conditions import ( url_contains, url_matches ) url = 'https://selenium.dunossauro.live/aula_10_c.html'", "browser = Firefox() browser.get(url) wdw = WebDriverWait(browser, 10) links = browser.find_elements_by_css_selecto...
[ "else: raise NotImplementedError(f\"Datatype {datatype} not implemented\") def buildSnak(propertyId: str, value): datatype = getPropertyType(propertyId)", "\"math\", \"commonsMedia\", ]: if type(value) == dict: return {\"value\": value, \"type\": \"string\"} elif", "not convert type {type(value)} to datatype {d...
[ "0. self.counterparty_bond_repo_rate = 0. self.variation_margin_interest_rate = 0.1 self.stock_repo_rate = 0.07 * np.ones(dimension, dtype=float)", "np.zeros(num_of_assets, dtype=float) bank_bond_yield = 0 counterparty_bond_yield = 0 counterparty_bond_repo_rate = 0 variation_margin_interest_rate =", "expect_bas...
[ "iter(self._containers) def __repr__(self): self._get_containers() return f\"<{self.__class__.__name__}: {repr(self._containers)}>\" def _get_containers(self): containers = [] for", "\"\"\" kwargs = {\"node\": self._node, \"vmid\": self._vmid} return self._api.suspend_container(**kwargs) def resume(self) -> str:"...
[ "a, b, c, d) MAX = max(MAX, a, b, c, d) return (MIN,", "* b else: assert False def MinAndMax(i, j): MIN = float('inf') MAX =", "op == '-': return a - b elif op == '*': return a", "MAX = float('-inf') for k in range(i, j): a = evalt(M[i][k], M[k +", "op = [dataset[i] for i in range(1, len(dataset), 2)] m, M,...
[ "str 'DEN', 'BUF', etc. Returns: HTML string \"\"\" url = f\"http://www.espn.com/nfl/team/roster/_/name/{team_code}\" return self.get(url,", "Tag): player[\"source_player_name\"] = child.string player[\"source_player_id\"] = child.attrs.get(\"playerid\") results.append(player) return results @staticmethod def wee...
[ "s3_bucket=None): \"\"\" Upload a dataframe to redshift via s3. Parameters ---------- name: str", "= True except ImportError: HAS_PYMSSQL = False DBPY_PROFILE_ID = \".db.py_\" S3_PROFILE_ID = \".db.py_s3_\"", "and rendered using handlebars. union: bool Whether or not \"UNION ALL\" handlebars templates.", "chu...
[ "<reponame>LucasLaibly/Intrusion class Development(object): DEBUG: True class Testing(object): DEBUG: False class Production(object): DEBUG: False" ]
[]
[ "hidden_dim=1024, num_filters=128, kernel_size=5, name=\"attention block\", rate=0.1, residual=True, last=False, **kwargs): super(AttentionBlock, self).__init__(name=name, **kwargs) self.attention_layer", "self.activation_layer = Activation('relu') self.dense1 = Dense(hidden_dim/2) self.dense2 = Dense(hidden_dim)...
[ "= result[\"Tag\"] print(Tags) allTag = \"\" for row in result.index: allTag = allTag", "as np import nltk nltk.download('punkt') import os import nltk.corpus from nltk.probability import FreqDist", "allTag = \"\" for row in result.index: allTag = allTag + \" \"", "word_tokenize # read result result = pd.read...
[ "== '__main__': # path = 'D:/Desktop/artigos/rdml.pdf' # #id = 20367574 # print(get_data_from_pdf_path(path, '<EMAIL>'))", "Bio import Entrez import os import sys sys.path.append(os.path.dirname(os.path.dirname(__file__))) import nltk from data_structures.document import", "= '<KEY>' try: title = get_title_from...
[]
[ "api_base_url = 'https://api.thetvdb.com' resource_base_url_per_ep = 'https://thetvdb.com/banners/' headers = {} def get_jwt(): data =", "resource_base_url = 'https://thetvdb.com' api_base_url = 'https://api.thetvdb.com' resource_base_url_per_ep = 'https://thetvdb.com/banners/' headers = {} def", "def get_image...
[ "Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python", "find_packages setup( name='blueliv-python-sdk', version='2.3.0', description='Blueliv API SDK for Python', url='https://github.com/Blueliv/api-python-sdk', author='Blueliv', author_email='<EMAIL>', license='MIT',", ":: Py...
[ "# Equation 2 def eq2(x): return (pow(x, 2) - 4) def eq2_d(x): return", "Sample Equations # # Description: Sample functions (and their derivatives) # to be", "Equations # # Description: Sample functions (and their derivatives) # to be used", "5*x + 1 def eq1_d(x): return 5*(x**4) - 5 # Equation 2 def", "(an...
[ "y.ndim - 1 y_in = y.astype(xp.float64) lam1 = xp.broadcast_to(lam, (y_in.shape[0], 1)).astype(xp.float64) if lam2", "xp.max(xp.abs(cdf - norm_cdf(ys, xp.mean(yp, axis=1), xp.var(yp, axis=1))), axis=1) ks_mask = ks < best_ks", "ret[zero_mask] = xp.exp(y_in[zero_mask]) - lam2[zero_mask] ret[~zero_mask] = (lam1[~...
[ "1 def DZ_main(): filename = sys.argv[1] df = pd.read_csv(filename) if DZstats == 1:", "define lower limit for probability density plots (PDPs) and kernel density estimates (KDEs)", "intersample_results = intersample(df, xmin, xmax, xint) print(intersample_results) if PlotDistributions == 1: fig, axs", "sys.a...
[ "Activation : 0.4228725100457559 V Eta Concentration : 0.0007181421727400468 V Eta Ohmic : 0.006390481776561363", "0.2 E : 6.068413961701556 V Eta Activation : 0.23146009851376736 V Eta Concentration :", ": 0.41280968341523216 W ########### I : 0.4 E : 6.068410886366294 V Eta Activation", "4.0 E : 6.144553093...
[ ":param MLLD_functions: this class has several functions that are usually used by myself.", "\"\"\" var_average = np.average(variable) var_std = np.std(variable) new_variable = [] for i in", "for i in range(variable.size): new_variable_i = (variable[i] - var_average)/var_std new_variable.append(new_variable_i) ...
[ "json import torch from editsql.data_util import atis_batch from editsql.data_util.atis_data import ATISDataset from editsql.data_util.interaction", "= comparisons else: eval_output[\"diff\"] = comparisons write_json_log_results(eval_output, CURRENT_DIR / \"evaluation/results\") # ------------ Batch", "the firs...
[ "shutil import sys import tempfile from observations.r.rep_vict import rep_vict def test_rep_vict(): \"\"\"Test module", "downloading rep_vict.csv and testing shape of extracted data has 8 rows and 8", "import rep_vict def test_rep_vict(): \"\"\"Test module rep_vict.py by downloading rep_vict.csv and testing sh...
[ "validation accuracy as a performance measure def test_synthetic_data(): \"\"\" Generate the synthetic data", "= ut.compute_cross_validation_error(X, y, x_control, NUM_FOLDS, loss_function, apply_fairness_constraints, apply_accuracy_constraint, sep_constraint, ['s1'], [{} for i", "lf # loss funcs that can be op...
[ "BlogPosts().get() try: message = self._BLOG_MESSAGE.format( name=random_blog['title'], url=random_blog['link'] ) PostTweet().post(message) except: print(\"Error posting to", "message, random_blog['title'], random_blog['link'] ) except: print(\"Error posting to LinkedIn\") pass #self.blog() def oss(self):", "Ch...
[ "env = os.environ.copy() env.update(new_env) abs_bname = os.path.join(apppath, binary_name) abs_ihex_name = abs_bname + \".ihex\"", "longskips, n_emptys, ccas, nodemaps): n_empty = NemptyTuple(*n_empty) cca = CcaTuple(*cca) simdir = \"sink%03d_snd%02d_p%02d_c%02d_e%.2f_ns%02d_nt%02d_na%02d_ds%02d_dt%02d_da%02d_sy...
[ "+= val * n self.count += n self.avg = self.sum / self.count if", "model, criterion, optimizer, epoch, output_dir, tb_log_dir, writer_dict): batch_time = AverageMeter() data_time = AverageMeter()", "'.join(['| {:.3f}'.format(value) for value in values]) + ' |' ) class AverageMeter(object): \"\"\"Computes", "n...
[ "b'Thanks'), (b'SUPPORTER', 'Idol Supporter'), (b'LOVER', 'Idol Lover'), (b'AMBASSADOR', 'Idol Ambassador'), (b'PRODUCER', 'Idol Producer'),", "class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('web', '0001_initial'), ] operations = [ migrations.Cr...
[ "set version = \"' + str(self.context.version) + '\" %}'}, ) __all__ = [\"Sync\"]", "= \"{}\"'.format(self.context.source(\"date\")), }, ) def fix_recipe(self) -> None: if self.has(\"recipe\"): self.replace_substrs( self.context.path_source(\"recipe\"), {\"{%", "/ self.context.project / \"__init__.py\", { \"__s...
[ "data. asol : string Name of the variable on the grid. \"\"\" X,", "else: values = (-8 * numpy.pi**2 * numpy.cos(2 * numpy.pi * X) *", "* numpy.pi * Y)) else: values = (-8 * numpy.pi**2 * numpy.cos(2 *", "the right-hand side of the Poisson system. Arguments --------- grid : flowx.Grid object", "grid.y) if(u...
[]
[ "for t in reversed(range(0, len(dOut))): dAct = dH[t] * self.activation.d(outputs[t]) ''' the following", "dCache is not None: dCell[-1] += dCache['dCell'] dH[-1] += dCache['dHidden'] for t in", "cache[l]['cn'] if 'cn' in cache[l] else None, 'h0': cache[l]['hn'] if 'hn' in cache[l]", "optimality ''' tmp_ = np...
[ "root node of tree # @return an integer def isSameTree(self, A, B): if", "__name__ == \"__main__\": root1, root1.left, root1.right = TreeNode(1), TreeNode(2), TreeNode(3) root2, root2.left, root2.right", "root1.right = TreeNode(1), TreeNode(2), TreeNode(3) root2, root2.left, root2.right = TreeNode(1), TreeNode(...
[]
[ "10:00:02 GMT\\r\\nAccept-Ranges: bytes\\r\\nContent-Length: 5092104\\r\\nX-Content-Type-Options: nosniff\\r\\nConnection: close\\r\\nContent-Type: application/pdf\\r\\nStrict-Transport-Security: max-age=31536000; includeSubDomains; preload;\\r\\nX-Frame-Options: SAMEORIGIN\\r\\nX-XSS-Protection: 1; mode=block\\r\\...
[ "None: raise TypeError(self.messages.ILLEGAL_ARGUMENT_NONE_TYPE.value) if not isinstance(data, pandas.DataFrame): raise TypeError(self.messages.ILLEGAL_ARGUMENT_TYPE.value) if not all(column in", ":param data_segments: :param selected_columns: :param axis: :return: \"\"\" try: data = None for", "mode is None or...
[ "struct unpacked_wo_header = unpacked[len(asdict(packet_header)) : :] # Get telemetry for each active car", "allocate to position on car (fl, fr, rl, rr). Args: telemetry_values(list): List of", "m_header: PacketHeader m_car_telemetry_data: List[CarTelemetryData] m_mfd_panel_index: ctypes.c_uint8 m_mfd_panel_in...
[ "Takes 9-class (categorical) hamming weight labels and reduces it to 2 semi-fixed classes.", "weight labels and reduces it to 2 classes: semi-fixed and random. \"\"\" hamming_weight", "traces, encode(la_bit, 2) if __name__ == '__main__': trace_set = TraceSetHW(Database.ascad, Pollution(PollutionType.gauss, 0), ...
[ "ForbiddenError: raise HTTPException(403, f\"Application not setup for the repository {action.repo}\") except NotFoundError: raise", "react_to_pr(action: ActionIn): gh = login_as_installation(action) issue = get_pr(gh, action).issue() issue._post( issue._api + '/reactions',", "get_pr(gh, action).create_comment(...
[ "WordNetLemmatizer() ''' print(lemmatizer.lemmatize(\"cacti\")) print(lemmatizer.lemmatize(\"geese\")) print(lemmatizer.lemmatize(\"rocks\")) print(lemmatizer.lemmatize(\"python\")) ''' #default pos=\"n\"(noun) #\"a\" = adjective, \"v\"", "#lemmas give back actual words, usually better then stemmers print(lemmati...
[ "location = models.ForeignKey(Location,on_delete=models.CASCADE) # one image belongs to a single location category =", "image belongs to a single category name= models.CharField(max_length=200) description = models.TextField(max_length=300) image =", "slug = models.SlugField(unique=True) def __str__(self): retu...
[ "as inout :param queue_name: The name of the queue where to put the", "FixedProtoField from diplomacy_research.utils.model import pad_list # Constants LOGGER = logging.getLogger(__name__) class FeedableDataset(metaclass=ABCMeta): \"\"\"", "it is a remote (RPC) dataset \"\"\" raise NotImplementedError() @propert...
[ "def analysis(obj): params = dict() params['size'] = size(obj) params['rgb'] = color(obj) params['lines'] =", "params['opacity'] = opacity(obj) params['original'] = o if (o := obj.get('original')) else False params['colour']", "try: line_arg = i.split(',') if len(line_arg) >= 7: lines.append([(int(line_arg[0]),...
[ "shape in slide.shapes: if shape.has_text_frame: print(shape.text_frame.text) if shape.has_table: for cell in shape.table.iter_cells(): print(cell.text)", "for slide in p.slides: for shape in slide.shapes: if shape.has_text_frame: print(shape.text_frame.text) if shape.has_table:", "p = Presentation('a.pptx') fo...
[ "the ones # that are not so sparse and that I FEEL makes", "picking the ones # that are not so sparse and that I FEEL", "bors and yahoo data''' import numpy as np import pandas as pd from", "sense to include. df_stats = df_stats[cng.SELECTED_FEATURES] df_combined = pd.merge(df_bors, df_stats, on=cng.MERGE_DFS...
[ "# print('双字词个数:',shuangzi) # print('其他字词个数:',qita) # for i, (k, v) in enumerate(word_listindex.items()): # if", "matplotlib import fileDispose import numpy as np def get_bench(text,n): \"\"\" get_bench(list,int) 共现矩阵窗口循环的范围,对联选择上下联两句做循环范围 text:文本列表", "import numpy as np def get_bench(text,n): \"\"\" get_bench(...
[ "True rcParams['figure.edgecolor'] = 'k' rcParams['grid.color'] = 'k' rcParams['grid.linestyle'] = ':' rcParams['grid.linewidth'] = 0.5", "alpha=0.1, color=sns.xkcd_rgb[\"magenta\"]) plt.plot(list(np.arange(1, len(data_LTO[\"Average costs LTO\"]) + 1)), data_LTO[\"Average costs LTO\"], linewidth=4, label=\"LTO\",...
[ "= [ ('analytics', '0003_searchtracking'), ] operations = [ migrations.AlterField( model_name='searchtracking', name='query_type', field=models.CharField(choices=[['free_text', 'Free", "class Migration(migrations.Migration): dependencies = [ ('analytics', '0003_searchtracking'), ] operations = [ migrations.AlterF...
[ "<filename>LaureatsBackEnd-master/laureats/migrations/0008_etudiant.py # Generated by Django 3.0.2 on 2020-01-10 20:43 from django.db import migrations,", "[ ('laureats', '0007_laureat_filiere'), ] operations = [ migrations.CreateModel( name='Etudiant', fields=[ ('laureat_ptr', models.OneToOneField(auto_created=T...
[ "import Embedding from allennlp.nn import util from allennlp.common.checks import ConfigurationError class MaxSpanExtractor(SpanExtractor): def", "torch.FloatTensor, span_indices: torch.LongTensor, sequence_mask: torch.BoolTensor = None, span_indices_mask: torch.BoolTensor = None, ) ->", "torch.BoolTensor = Non...
[]
[ "power level.\"\"\" dps_mode = self._device.get_property(self.get_property_to_dps_id[ATTR_POWER_MODE]) if dps_mode == ATTR_POWER_MODE_USER: return self._device.get_property(self.get_property_to_dps_id[ATTR_POWER_LEVEL]) elif dps_mode", "not None: self.set_target_temperature(kwargs.get(ATTR_TEMPERATURE)) def set_t...
[ "from .importer import * from .settings import * __all__ = [ 'DraftstarsCSVImporter', 'DraftstarsNFLSettings'", "<filename>pydfs_lineup_optimizer/sites/draftstarsnfl/__init__.py from .importer import * from .settings import * __all__ = [ 'DraftstarsCSVImporter',", ".importer import * from .settings import * __a...