ngram listlengths 0 67.8k |
|---|
[
"# clip to mitigate exploding gradients return loss, dW_xh, dW_hh, dW_hy, db_h, db_y,",
"1 ixes.append(ix) return ixes n, p = 0, 0 mW_xh, mW_hh, mW_hy =",
"(H x 1) array of initial hidden state returns the loss, gradients on",
"steps seq_length long) if p + seq_length + 1 >= len(data) or n",
"for next chars... |
[
"(UTILITIES) DESCRIPTION ORGANIZATION OF FITNESS RANKS & ASSOCIATED STATS DESCRIPTION Series of functions",
"FLYCOP run (configuration) as a single str line - extract_ratios ANALYSIS OF BIOMASS",
"row[0] = Index Number ref_variable = dataframe.loc[row[0], ref_column] for i in range(1, len(rank_limits_set)+1):",... |
[
"(b'', '<KEY>'), (b'abc', '18587dc2ea106b9a1563e32b3312421ca164c7f1f07bc922a9c83d77cea3a1e5d0c69910739025372dc14ac9642629379540c17e2a65b19d77aa511a9d00bb96'), (b'<KEY>', '<KEY>'), (b'abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu', 'ac2fb35251825d3aa... |
[
"commands from bot_constant import bot_constant from command_handler import command_handler from bot_listener import bot_listener",
"import commands from bot_constant import bot_constant from command_handler import command_handler from bot_listener import",
"self.bot.add_cog(self.command_handler) self.bot_liste... |
[
"\"ATHENS\" #upload data try: city_listings = pd.read_csv(\"DATA/raw/\" + city + \"_listings.csv\") except Exception:",
"and predicted_price/real_price > 1 - precision: aces += 1 del train_set[\"distance\"] average_deviation =",
"= test_set.loc[[index], :][\"price\"] real_price = real_price.item() differences_s... |
[
"= list(map(int, input().split())) # process ''' 각 장이 섞여도 됨. >> 힙에서 제일",
"# input t = int(input()) for _ in range(t): chapter = int(input()) pages",
"= 0 hq.heapify(pages) for _ in range(chapter - 1): cost = hq.heappop(pages) +",
"sol = 0 hq.heapify(pages) for _ in range(chapter - 1): cost = hq.heappop(pages)... |
[
"counter_message = '\\n'.join( [\"\\tCount\\tMessage\"] + [ f\"\\t{count}\\t{message}\" for message, count in Counter(self.message).most_common() ]",
"None, x0: np.ndarray = None, fval0: float = None, history: History = None,",
"else None self.sres: np.ndarray = np.array(sres) if sres is not None else None",
... |
[
"sess: filename = ['A.jpg', 'B.jpg', 'C.jpg'] # string_input_producer会产生一个文件名队列,shuffle=False不打乱数据顺序,num_epochs训练周期 filename_queue = tf.train.string_input_producer(filename, shuffle=False, num_epochs=5)",
"num_epochs=5) # reader从文件名队列中读数据,对应的方法是reader.read--输出文件名(key)和该文件内容(value) reader = tf.WholeFileReader() ke... |
[
"0b0), 0) self.assertEqual(count_unequal_bits(0b1, 0b1), 0) self.assertEqual(count_unequal_bits(0b01, 0b10), 2) self.assertEqual(count_unequal_bits(0b001, 0b110), 3) if __name__",
"tests for q0505.py.\"\"\" import unittest from src.q0505 import count_unequal_bits class TestCountUnequalBits(unittest.TestCase): def... |
[
"of this comparison will be truePositives(B) and falsePositives(B) (this is falsePosMode). \"\"\" hpTests",
"%9s, %9s, %9s, %9s' % ('dataset', 'Precision', 'Recall', 'F-score', 'TP (A)', 'TP (B)',",
"+ 'B', True) falsePosSelf = getItem(pairs, 'falsePos' + suffix, True) falseNegSelf = getItem(pairs,",
"+ self.... |
[
"block.to_python({ 'link': [{'type': 'page', 'value': page.pk}] }) assert value.link_url == page.url assert value.link_text",
"be empty if the field is not required }) # This should not",
"{ 'times': [ {'weekday': 4}, match, ], } assert OpeningTimesBlock.get_time_for_date(value, datetime.date(2017, 12, 10))",
... |
[
"get_response_schema as date_range_question_schema from .free_form_question import get_response_schema as free_form_question_schema from .multiple_choice_question import (",
"get_response_schema as free_form_question_schema from .multiple_choice_question import ( get_response_schema as multiple_choice_question_sc... |
[
"open start message file start_file = open('ressources/start.txt', 'r', encoding='utf-8') message = start_file.read() start_file.close()",
"<filename>utils/start.py # coding:utf-8 # open start message file start_file = open('ressources/start.txt', 'r', encoding='utf-8')",
"# open start message file start_file =... |
[
"@property def simulation(self) -> BlueSkySimulatorControls: return self._sim_controls @property def sim_version(self) -> VersionInfo: return",
"to re-add the tests for string parsing/units from the old API tests import",
"construct before sending it \"\"\" # Probably a cleaner way of doing this...",
"List fr... |
[
"if lns_pp == np.inf: print (\"***\\n***\\n2nd derivative of log of z/z0 is infinite.\\nWe",
"start xi from dxi rather than 0 to avoid singularity xi = np.copy(dxi)",
"this point.\\nBreaking the loop ...\\n***\\n***\") break if lns_pp == np.inf: print (\"***\\n***\\n2nd derivative",
"[] ypp_arr = [] rho_arr =... |
[
"and len(texto[i].strip())<2: missImagem[i] = 1 else: missImagem[i] = 0 texto = texto +",
"0 texto = texto + ' ' + banco.DS_OBSERVACOES_GERAIS for i in range(len(texto)):",
"= texto + ' ' + banco.NV_USG_CALC_DESC texto = texto + ' '",
"texto,bancoNovo = gerarbanco() bancoNovo['texto'] = list(texto) # type cla... |
[
"inside `for .. in ..` without skipping on `send` if isGen: g.send(extCmd) def",
"collections \"\"\" Collection of methods for working with Generators, which respects `yield ..",
"except StopIteration: return () def gChain(*gens): for g in gens: isGen=isinstance(g, types.GeneratorType) for",
"extCmd=(yield o)... |
[
"alt_names: self.name, self.alt_name, self.id = genetic_codes[alt_names[alt_name]] return raise ValueError(f\"Unknown alternative name {alt_name}.\") assert",
"\"\": alt_names[alt_name] = len(genetic_codes) ids[id] = len(genetic_codes) genetic_codes.append((name, alt_name, id)) register_ncbi_genetic_code( \"Stand... |
[
"integers, return all possible permutations. Example: Input: [1,2,3] Output: [ [1,2,3], [1,3,2], [2,1,3],",
"Output: [ [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], [3,2,1] ] ''' class Solution: def",
"[1,3,2], [2,1,3], [2,3,1], [3,1,2], [3,2,1] ] ''' class Solution: def permute(self, nums: List[int])",
"[2,3,... |
[
") if __name__ == '__main__': _client = SentinelClient(url='redis://localhost:26379') _pub_sub = _client.client.pubsub() _pub_sub.psubscribe('*') for",
"is healthy. \"\"\" self.client = StrictRedis.from_url( url=url, db=db, client_name=name, health_check_interval=health_check_interval, decode_responses=True ) if"... |
[
"harmonic transform of the instrumental beam \\ (assumed to be rotationally symmetric -",
"alms[:, :, 1] return alms def get_templates(self): \"\"\" Returns a 3D array ([ntemp][nmap][npix])",
"0 to 3*nside-1). :param purify_e: use pure E-modes? :param purify_b: use pure B-modes?",
"# Flatten if 2D maps try: t... |
[
"* len(perms) for j in range(len(perms)): out[perms[j]-1] = str(nums[j]) print(linesep.join(out)) if i !=",
"i in range(num_tests): input() perms = list(map(int, input().split())) nums = list(map(str, input().split())) out",
"perms = list(map(int, input().split())) nums = list(map(str, input().split())) out = [... |
[
"= \"m\" FEMALE = \"f\" UNSPECIFIED = \"-\" GENDERS = {(MALE, _(\"male\")), (FEMALE,",
"= \"-\" GENDERS = {(MALE, _(\"male\")), (FEMALE, _(\"female\")), (UNSPECIFIED, _(\"don't want to answer\"))}",
"django.utils.translation import ugettext_lazy as _ MALE = \"m\" FEMALE = \"f\" UNSPECIFIED =",
"from django.ut... |
[
"\"win10\") self.assertEqual(o.Arch, \"X64\") def test_arm_arch(self): o = CatGenerator(\"arm\", \"win10\") self.assertEqual(o.Arch, \"ARM\") def test_arm64_arch(self):",
"\"10\") def test_win10Server_OS(self): o = CatGenerator(\"x64\", \"Server10\") self.assertEqual(o.OperatingSystem, \"Server10\") def test_inva... |
[
"if X.shape == (2,): X = [X] for x, y in X: ax.plot(",
"float = 15 ) -> Tuple[float, float]: return a - np.cos(y) * b,",
"**knobs ) return ax def root_mean_squared_error( x: Union[float, np.ndarray], y: Union[float, np.ndarray] )",
"linestyle=linestyle, marker=marker, markersize=markersize, markevery=markever... |
[
"environmental variables load_dotenv(dotenv_path=ENV_VAR_PATH) def environment_var_exist(): return os.environ.get(CRYPTO_KEY_ENV_VAR) def generate_key(): return Fernet.generate_key() def write_key_env_var(crypto_key):",
"import Path # Third party from cryptography.fernet import Fernet from dotenv import load_dote... |
[
"#Q19: Elhuyar #positem = \"Q8\" # Q7: substantibo, Q8: aditza with open(infilename, encoding=\"utf-8\")",
"\"Q8\" # Q7: substantibo, Q8: aditza with open(infilename, encoding=\"utf-8\") as csvfile: sourcedict =",
"csvfile: sourcedict = csv.DictReader(csvfile) lex_elh = {} for row in sourcedict: lex_elh[row['le... |
[
"casim.calculations import word_entropy def test_word_entropy(): test_arr = np.array([1, 0, 0, 1, 1, 0,",
"numpy as np from casim.calculations import word_entropy def test_word_entropy(): test_arr = np.array([1, 0,",
"def test_word_entropy(): test_arr = np.array([1, 0, 0, 1, 1, 0, 1, 0]) assert",
"test_word_e... |
[
"), migrations.AddField( model_name='prisonerprofile', name='disbursement_total', field=models.IntegerField(default=0), ), migrations.AddField( model_name='prisonerprofile', name='recipients', field=models.ManyToManyField(related_name='prisoners', to='security.RecipientProfile'), ), migrations.AddField(",
"), mig... |
[
"BACKGROUND = (33, 47, 60) #initial game setup def get_events(): global running for",
"pygame.init() window = pygame.display.set_mode((WIDTH, HEIGHT)) clock = pygame.time.Clock() game_window = Game_window(window, 150, 180)",
"pygame.event.get(): if event.type == pygame.QUIT: running = False def update(): game_w... |
[
"for char in new_expr: if char not in EvaluateExpression.valid_char: self.expr = \"\" return",
"char not in EvaluateExpression.valid_char: self.expr = \"\" return self.expr = new_expr def insert_space(self):",
"len(self._items) class EvaluateExpression: valid_char = '0123456789+-*/() ' valid_num = '0123456789' ... |
[
"lcb in merged_split_lcbs: merged.add_lcb(lcb) return merged class Realigner: # local realignment around overlapping",
"= next_hspfrag.hit_start - hspfrag.hit_end if inter_hit_len > 0: seq_one_list.append(seq_one[hspfrag.hit_end:next_hspfrag.hit_start]) seq_two_list.append(\"-\" * inter_hit_len) inter_query_len",... |
[
"it's read in, so ### the memory lines up better? output[i,:] = self.data[:,data_index]",
"length of the timeseries Outputs: site_indices: the list of sites with active capacity",
"the memory lines up better? output[i,:] = self.data[:,data_index] * total_cap return site_indices, output",
"THE SOFTWARE OR THE ... |
[
". import api from ..database import Interval @api.route('/intervals') def get_intervals(): intervals = Interval.query.all()",
"..database import Interval @api.route('/intervals') def get_intervals(): intervals = Interval.query.all() return jsonify([{ 'id': interval.id,",
"import api from ..database import Inte... |
[] |
[
"import expand_dict_as_keys from tests.common import BaseCase class Test(BaseCase): def test_empty(self): self.assertEqual(expand_dict_as_keys(dict()), [ tuple()",
"2), ('c', 5)]), tuple([('a', 1), ('b', 3), ('c', 4)]), tuple([('a', 1), ('b', 3),",
"self.assertEqual(expand_dict_as_keys(dict(a=1, b=[2, 3])), [ t... |
[
"None and b is not None: # Can put good if space +",
"None: # Can put good if space + g <= m: # Can't",
"gi = 0 bi = 0 while space < m: g = good[gi]",
"+= 1 # Can't put good but can put bad elif space +",
"None b = bad[bi] if bi < len(bad) else None # Both good",
"None: # Still room left if space + g <= m... |
[
"not the config :return: \"\"\" init(config) return { grp: {name: content.asdict() for name,",
"= config.DB_TIMEOUT_SEC from . import exploration from . import comparison from . import",
"random def get_kankeiforms(config): init(config) return KankeiForm.registry def get_kankeiforms_dict(config): \"\"\" note:: ... |
[
"roll): self._rolls.append(roll) def clear_rolls(self): self._rolls = [] @property def rolls(self): return self._rolls @property",
"Roll import Roll class Roller: def __init__(self, user): self._rolls = [] self._user =",
"self._rolls = [] @property def rolls(self): return self._rolls @property def user(self): r... |
[
"np.concatenate((r1,r2,r3))/100000.0 m,s = blockavg(r[:,1]) print(\"%10.1f %10.3f %10.3f\"%(float(c),m,s)) f.write(\"%10.1f %10.3f %10.3f\\n\"%(float(c),m,s)) osmp.append((float(c),m,s)) osmp =",
"osmp_c36 = np.loadtxt('OSMP_%s_%s_c36.dat'%(mol1,mol2)) plt.figure() plt.title(mol1.upper()+' - '+mol2.upper()) plt.e... |
[
"tf.int64, default_value=0), 'frame_2/width': tf.io.FixedLenFeature((), tf.int64, default_value=0), 'path': tf.io.FixedLenFeature((), tf.string, default_value=''), } return feature_map",
"max_examples > 0: return dataset.take(max_examples) return dataset @gin.configurable('training_dataset') def create_training_d... |
[
"len(s)==1: return True for i in range(1,len(s),1): if ord(s[i])-ord(s[i-1])!=1: return False return True",
"s.sort() s=''.join(s) if len(s)==1: return True for i in range(1,len(s),1): if ord(s[i])-ord(s[i-1])!=1: return",
"s=''.join(s) if len(s)==1: return True for i in range(1,len(s),1): if ord(s[i])-ord(s[i-... |
[
"return mat #plt.matshow(makeMatCores(100,100)) #define range of Z's Z_low = 2 Z_top = 150",
"BE_liquidDrop(N+1,Z) BE_f_down = BE_liquidDrop(N,Z) Qdown = BE_f_down-BE_i_down if (Q<0): mat[Z-Zstart, N-Nstart] = 1",
"N else: N = N+1 def makeMatCores(Zrange): Nstart = 0 Nrange = int(2.3*Zrange)",
"BE_liquidDrop(... |
[
"import * from DNAInteractiveProp import DNAInteractiveProp class DNAAnimBuilding(DNAInteractiveProp): def __init__(self): DNAInteractiveProp.__init__(self) self.anim =",
"DNAInteractiveProp import DNAInteractiveProp class DNAAnimBuilding(DNAInteractiveProp): def __init__(self): DNAInteractiveProp.__init__(self) ... |
[] |
[
"__init__(self, parent: wx.Window, gc_app: GCraftApp): wx.glcanvas.GLCanvas.__init__(self, parent, -1) self._renderer = gc_app self._renderer.swap_buffers =",
"key=event.GetKeyCode()) self._renderer.input_state.update_state(input_event) self._renderer.on_input(input_event) class GCraftContinuousRenderer(wx.Timer)... |
[
"/ (1 + np.exp(-x)) class LogisticsReg(): def __init__(self,learn_rate=1e-3,niter=100000): self.lr=learn_rate self.iter=int(niter) def fit(self,x,y): x=np.insert(x,",
"np.exp(-x)) class LogisticsReg(): def __init__(self,learn_rate=1e-3,niter=100000): self.lr=learn_rate self.iter=int(niter) def fit(self,x,y): x=np... |
[
"!= ' ': self.layers[layerNumber + 0][key] = baseKey if shiftKey != ' ':",
"in dead_keys: if dk['char'] in self.dead_keys: self.dk_index.append(dk['char']) # remove unused characters in self.dead_keys[].{base,alt}",
"layer_has_char(base[i], 1): used_base += base[i] used_alt += alt[i] self.dead_keys[dk_id]['base... |
[
"by key(elem). Analogous to itertools.group_by; however this function doesn't care about the order",
"of x, f(x), f(f(x)), ... See Clojure's iterate. \"\"\" while True: yield x",
"keys. \"\"\" d: dict[_K, list[_T]] = {} for elem in iterable: d.setdefault(key(elem), []).append(elem)",
"Iterable, TypeVar _T = T... |
[
"env.observation_space.seed(seed) # return env # # return thunk class MFRL: \"\"\" Model-Free Reinforcement",
"rl.environments from rl.data.buffer import TrajBuffer, ReplayBuffer # from rl.data.buffer import TrajBuffer, ReplayBufferNP #",
"el += 1 t += 1 self.buffer.store(o, a, r, o_next, v, log_pi, el)",
"ev... |
[
"configparser.RawConfigParser() config.read('.twconfig') print('success!') except: print('failed to read config file!') exit() try: sys.stdout.write('connecting to",
"' % statusId ) status = api.GetStatus(statusId) print('success!') except: print('failed to get status!')",
"them signing up at https://apps.twitt... |
[
"dest_offset += 2 * 2 * npart continue if npart >= 11: src1",
"f\"ldrh {r}, [{addr}, #{i * 4 + offset}]\" else: yield f\"ldr {r}, [{addr},",
"a_offset += 2 * npart yield from blockload(src1, a, npart, a_offset) if npart",
"[sp, #4]\" if col & 1: # for odd columns, go 'back up'",
"{src1}, [sp, #4]\" if col &... |
[
"tf.compat.v1.get_variable(name='W1', shape=( layers[0], layers[1]), initializer=tf.random_normal_initializer(stddev=0.1)) W2 = tf.compat.v1.get_variable(name='W2', shape=( layers[1], layers[2]), initializer=tf.random_normal_initializer(stddev=0.1)) W3",
"tf.split( item_latent, [embed_dim, layers[0] // 2], 1) mf_... |
[
"test_co_occurrence_reproducibility(adata: AnnData, n_jobs: int, n_splits: int): \"\"\"Check co_occurrence reproducibility results.\"\"\" arr_1, interval_1 =",
"are the same for seq. and parallel computation.\"\"\" moran(dummy_adata) dummy_adata.var[\"highly_variable\"] = np.random.choice([True, False],",
"repr... |
[
"{'minValue': 10, 'maxValue': 20, 'step': 1} char = get_char(PROPERTIES.copy(), min_value=0, max_value=1) char.override_properties(properties=new_properties) assert",
"new_valid_values def test_get_hap_value(): max_value = 5 raw_value = 6 char = get_char(PROPERTIES.copy(), max_value=max_value)",
"min_value is n... |
[
"datasets.load_rossi() # Attention: duration column must be index 0, event column index 1",
"= RandomSurvivalForest(n_estimators=20, n_jobs=-1, min_leaf=10) rsf = rsf.fit(X, y) print(\"--- %s seconds ---\" %",
"y) print(\"--- %s seconds ---\" % (time.time() - start_time)) y_pred = rsf.predict(X_test) c_val",
... |
[
"the platform devices (compute) puppet resource. \"\"\" device_config = {} qat_c62x_devices = pci_device_list[constants.NOVA_PCI_ALIAS_QAT_C62X_PF_DEVICE]",
"{ 'qat_idx': idx, \"device_id\": \"dh895xcc\", } device_config.update({name: dev}) if len(device_config) == 0: return",
"configuration only required for c... |
[
"-1 minimum = 0 result = None while (result != target): m =",
"< midPoint): maximum = m -1 else: return m result = midPoint return",
"while (result != target): m = (maximum + minimum) // 2 midPoint =",
"len(list) -1 minimum = 0 result = None while (result != target): m",
"> midPoint): minimum = m +1 elif(ta... |
[
"from accounts.views import login, send_login_email app_name = 'accounts' urlpatterns = [ path(\"send_login_email\", send_login_email,",
"accounts.views import login, send_login_email app_name = 'accounts' urlpatterns = [ path(\"send_login_email\", send_login_email, name=\"send_login_email\"),",
"import LogoutV... |
[] |
[
"kernelized_vector)) theta_0= (theta_0 + labels[i]) print(theta) else: theta_0= theta_0 theta= theta return((theta, theta_0))",
"return np.array((1 + np.dot(data_vector, data_vector.T))**2) def perceptron_quadratic_kernel(feature_matrix, labels, T): # Your code here",
"if (labels[i]*(np.dot(kernelized_vector, t... |
[
"dist, _ = model(state) action = dist.sample().cpu().numpy()[0] next_state, reward, done, _ = env.step(action)",
"if frame_idx % save_iteration == 0: test_reward = np.mean([my_ppo.test_env() for _ in range(num_envs)])",
"# plot(frame_idx, test_rewards) if test_reward > threshold_reward: early_stop = True if fra... |
[
"by Django 2.1.2 on 2019-02-20 15:47 import django.contrib.postgres.fields.jsonb from django.db import migrations class",
"Generated by Django 2.1.2 on 2019-02-20 15:47 import django.contrib.postgres.fields.jsonb from django.db import migrations",
"Migration(migrations.Migration): dependencies = [(\"contentstor... |
[
"self.assertIn('Anonymous', rv.data) class TestPostRequest(BaseTestCase): data = {'title':'Lewiathanus livus', 'content':'A book by Hobbes is",
"self.app.post(\"/edit_profile\", data=dict(email=email, about_me=about_me), follow_redirects=True) def test_update_profile(self): rv = self.update_profile(\"maniana\", \... |
[] |
[
"contains the mongo_db_from_config code.\"\"\" from .mongo_db_from_config import db_from_config __version__ = \"0.0.1\" __all__ =",
"\"\"\"This package contains the mongo_db_from_config code.\"\"\" from .mongo_db_from_config import db_from_config __version__ = \"0.0.1\"",
"the mongo_db_from_config code.\"\"\" f... |
[
"range(number_qubits): for j in range(i): circuit.cu1(math.pi / float(2 ** (i - j)), qreg[i],",
"Copyright 2019, IBM. # # This source code is licensed under the Apache",
"the Apache License, Version 2.0 found in # the LICENSE.txt file in the",
"= QuantumRegister(number_qubits, name=\"myreg\") circuit = Quantu... |
[
"and Q signals together \"\"\" def __init__(self, totalTime, dt, dtIntegration, stokes, beta, signalToNoise=0.0,",
"= out.demodulateTrivial() # print \"Q/I_original={0} - Q/I_inferred={1} - Q/I_trivial={2} - diff={3}\".format(out.stokes[1] / out.stokes[0],",
"= [l for p in compression_pairs for l in p] ndarray ... |
[
"scene where the LMS device is installed.\") } class ConfigurationForm(forms.ModelForm): class Meta: model",
"fields = ('plant', 'capacity', 'unit', 'image') help_texts = { 'plant': _('The plant, this",
"'height', 'major_diameter', 'minor_diameter', 'diameter', 'unit', 'alignment') labels = { 'major_diameter': ... |
[
"and py < res[1]: diff = torch.Tensor([hm[py - 1][px] - hm[py - 1][px",
"scores.dim() == 4, 'Score maps should be 4-dim' maxval, idx = torch.max(scores.view(scores.size(0), scores.size(1),",
"* num_samples) #take top N images with smallesr error. sorted_list = np.argsort(max_error_list) for",
"below threshold... |
[
"if self._secure_header['Auth'] is None: raise Exception('Auth token for the header is undefined. No",
"networking setup task completes successfully. This needs to be done for OVA's that",
"the next reboot. if self._secure_header: return self._secure_header payload = {\"userName\": \"Administrator\", \"password... |
[
"if sserializer.is_valid(): sserializer.save() return Response(sserializer.data, status=status.HTTP_200_OK) return Response(sserializer.errors, status=status.HTTP_400_BAD_REQUEST) def get(self, request): try:",
"if not user: # return Response({'error': 'Invalid Credentials'}, # status=HTTP_404_NOT_FOUND) # token,... |
[
"# # Licensed under the Apache License, Version 2.0 (the \"License\"); # you",
"writing, software # distributed under the License is distributed on an \"AS IS\"",
"KIND, either express or implied. # See the License for the specific language",
"the License. \"\"\" Description of the module tasks.paraphraser: T... |
[
"simulations. .. currentmodule:: porespy .. autosummary:: :template: mybase.rst :toctree: generated/ dns.tortuosity \"\"\" from",
"direct numerical simulations. .. currentmodule:: porespy .. autosummary:: :template: mybase.rst :toctree: generated/ dns.tortuosity",
"**Direct Numerical Simulation** This module co... |
[
"'planning_poker_jira/templates'), ) ASGI_APPLICATION = 'example.routing.application' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME':",
"os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) DEBUG = True TEMPLATE_DEBUG = DEBUG SECRET_KEY = '<KEY>' TEMPLATE_DIRS = ... |
[
"- 0.5 * (self.xyscale[self.i] - 1) + xy_grid ) * self.strides[self.i] prediction_wh =",
"(batch_size, -1, 4)) prediction_prob = tf.reshape( prediction_prob, (batch_size, -1, self.classes) ) return prediction_xywh,",
"prediction_prob = detection_conf_sigmoid * classes_prob_sigmoid prediction_xywh = tf.reshape(p... |
[
"state['step'] = 0 # Exponential moving average of gradient values state['next_m'] = torch.zeros_like(p.data)",
"0.9 b2: Adams b2. Default: 0.999 e: Adams epsilon. Default: 1e-6 weight_decay: Weight",
"[0.0, 1.0[\".format(b2)) if not e >= 0.0: raise ValueError(\"Invalid epsilon value: {} -",
"max_grad_norm=1.... |
[
"'%s' >> ~/.deployer/history; \"\"\" % ('sudo' if run_entry.use_sudo else ' ', esc1(self.from_host), esc1(self.username),",
"' >> ~/.deployer/history; echo '%s' >> ~/.deployer/history; \"\"\" % ('sudo' if run_entry.use_sudo else",
"username): from socket import gethostname self.from_host = gethostname() self.us... |
[
"# Create buttons with a vertical configuration if orientation == \"vertical\": buttonWidth =",
"display of the menu\"\"\" # Draw the border surfBack = pygame.Surface((self._width, self._height)) surfBack.fill(self._borderColor)",
"= self._width - (2*h_padding) - (2*borderWidth) buttonHeight = (self._height - (... |
[
"gravity\", \"SRM\" : \"standard reference method\", \"t/h\" : \"tons per hour\", \"TA\" :",
"\"POST\"]) @login_required @adminRequired def editUnitOfMeasurement(unitOfMeasurementId): operation = \"Edit\" unitOfMeasurement = UnitOfMeasurement.query.get_or_404(unitOfMeasurementId) form =",
"@adminRequired def ed... |
[
"from unittest import mock import pytest from bs4 import BeautifulSoup from conf import",
"REQUEST_METHOD=\"GET\", HTTP_X_SCRIPT_NAME=script_name, ) response = wsgi.application(environ=environ, start_response=mock.Mock) assert response.status_code == 200 soup =",
"conf import wsgi @pytest.mark.django_db @pytest... |
[
"model_name='publishedgame', name='edition', ), migrations.RemoveField( model_name='publishedgame', name='game_system', ), migrations.RemoveField( model_name='publishedgame', name='isbn', ), migrations.RemoveField( model_name='publishedgame',",
"migrations.RemoveField( model_name='publishedgame', name='edition', ... |
[
"async def rename(self, client, message, parameters): session = SessionManager.get_session(message.channel) if session: if not",
"SyntaxBuilder from bashbot.session_manager import SessionManager class RenameCommand(Command): def __init__(self): super().__init__() self.name = \"Rename",
"= \"session.rename\" sel... |
[
"[0, 0, 0] positive_classes_weight = [0, 0, 0] negative_policy_weight = [0, 0, 0]",
"0] negative_policy_weight = [0, 0, 0] positive_policy_weight = [0, 0, 0] for i",
"0, 0] positive_classes_weight = [0, 0, 0] negative_policy_weight = [0, 0, 0] positive_policy_weight",
"for i in range(len(negative_identity_wei... |
[
"True if object in RRsTYPES else False def isClass(self, object): \"\"\"returns True if",
"in the Zone\"\"\" return set([i[4] for i in self.table]) def getClasses(self): \"\"\"returns set",
"closed from zone file line\"\"\" self.zone = [self.zone[i].replace(\"(\", \"\").replace(\")\", \"\") if self.zone[i].coun... |
[
"= { \"factory\": { \"address\": \"0xc0a47dFe034B400B47bDaD5FecDa2621de6c4d95\", \"abi\": factoryAbi, }, \"exchange\": { \"abi\": exchangeAbi,",
"util.read_json(\"./uniswap/abi/Exchange.json\") factoryAbi = util.read_json(\"./uniswap/abi/Factory.json\") contracts = { \"factory\": { \"address\": \"0xc0a47dFe034B40... |
[
"input_shape: th.Union[th.Tuple[int], th.List[int]], input_clamp: th.Optional[th.Union[float, tuple]] = (-1., 1.), model_params: th.Optional[dict] = None,",
"typing as th import torchmetrics from .. import utils as ebad_utils class AnoTrainer(pl.LightningModule):",
"th import torchmetrics from .. import utils a... |
[
"= requests.get( self.url, headers=headers, timeout=self.timeout, stream=True, proxies=self.proxies ) url_data = r.content.decode('utf-8', 'ignore') soup",
"'Mozilla/5.0 (Windows NT 6.3; Win64; x64) \\ AppleWebKit/537.36 (KHTML, like Gecko) \\ Chrome/60.0.3112.113",
"return \"\" return self.soup.body.getText() ... |
[
"setup(name='ttv', version='0.0.1', description='A command line tool and a python library for test, train,",
"library for test, train, validation set splitting', author='<NAME>', author_email='<EMAIL>', url='https://github.com/coopie/ttv', download_url='https://github.com/coopie/ttv/archive/master.zip', license='... |
[
"neither general or expected n_exp_ = 0 n_gen_ = 0 n_err_ = 0",
"that are more general than the expected one (therefore they are still true)",
"#note that the general values are all the returned values that are more",
"compute the number of expected/general/erroneous values returned by the approach #note that... |
[
"and the following disclaimer in the documentation # and/or other materials provided with",
"# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR #",
"EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES",
"AND FITNESS FOR A PARTICULAR PURPOSE ARE # DI... |
[
"with this environment.\\n\" b\"Removing context1 ... Done !\\n\" b\"Removing buildx ... Done !\\n\"",
"= ( b\"Warning: No docker-compose file is provided with this environment.\\n\" b\"Removing context1",
"\"flag\": \"flag_value\", \"buildx.cache_registry\": \"dummy\", \"buildx.builder_name\": \"testpkrbuilder... |
[
"<1> sentence = sentence.split(' ') for word in sentence: # <2> if len(word)",
"= sentence.split(' ') for word in sentence: # <2> if len(word) > 10:",
"') for word in sentence: # <2> if len(word) > 10: # <3>",
"sentence: # <2> if len(word) > 10: # <3> return True return False",
"in sentence: # <2> if len(wo... |
[
"<filename>src/wready/__init__.py from .sig_handler import SignalInterruptHandler from .wready_client import TaskContext, WReadyClient from .wready_server import",
"import SignalInterruptHandler from .wready_client import TaskContext, WReadyClient from .wready_server import InitTask, WReadyServer, WReadyServerObs... |
[
"product.pear, product.melon], create_price=[340, 490], create_time_sec=1800, manpower=108 ) # Iron Age IronForger = base.ManufactureBuilding(",
"create_time_sec=1800, manpower=108 ) # Iron Age IronForger = base.ManufactureBuilding( name=\"🥩🏠 Мясник\", products=[product.meat, product.chicken],",
"Плантация\",... |
[
"The Floor's Revenge - Project Euler # https://projecteuler.net/problem=546 # # Code by <NAME>",
"# #546 The Floor's Revenge - Project Euler # https://projecteuler.net/problem=546 # # Code",
"# # #546 The Floor's Revenge - Project Euler # https://projecteuler.net/problem=546 # #",
"Revenge - Project Euler # h... |
[
"field=models.DateTimeField(null=True), ), migrations.AlterField( model_name='assignment', name='end_hit', field=models.DateTimeField(null=True), ), migrations.AlterField( model_name='worker', name='qualification', field=models.IntegerField(default=0), ), ]",
"model_name='assignment', name='begin_hit', field=mode... |
[
"fox', '4 b1' ] \"\"\" newmols = Multiset() for mol in mollist: mol",
"educts.split('+') prlist = products.split('+') edmset = ReactionParser.parse_molecules( self, edlist ) prmset = ReactionParser.parse_molecules(",
"ValueError: print >> sys.stderr, \"syntax error on line=\", line exit(-1) if (edmset.empty() a... |
[
"sum([word not in word2id for word in vocab]) invalid_num = sum([word not in",
"3, 0, 0], # second post: <go> hello <eos> <pad> <pad> ]), \"resp_allvocabs\":",
"a dict, its value must be a list(or tuple) of lists(or tuples).') elif",
"text and returns the next label(integer). Note that it may raise StopIterat... |
[
"hero_data = HeropediaData.HERO_DATA self.assertTrue(path.isfile(path.join(self.DATA_DIR, hero_data))) class TestStringManipulation(TestCase): '''Tests string manipulation''' def test_sort_hero_name_change(self): '''str:",
"manipulation''' def test_sort_hero_name_change(self): '''str: sort_hero(\"wisp\") returns ... |