ngram listlengths 0 67.8k |
|---|
[
"with test files') parser.add_argument('ns_package_path', help='The path to the network service package') parser.add_argument('-t', '--test_package_path',",
"help='The path to the network service package') parser.add_argument('-t', '--test_package_path', help='The path to generated",
"argparse.ArgumentParser(de... |
[
"viewsets from rest_framework.generics import get_object_or_404 from rest_framework.views import APIView from rest_framework.response import Response",
"StateSerializer(states, many=True).data return Response(data) class StateDetail(APIView): @staticmethod def get(request, id): state = get_object_or_404(Data,",
... |
[
"0)) # ============================================================================= # #ouptut: # Largest element is: 9 # Row-wise maximum",
"6], [4, 7, 2], [3, 1, 9]]) # maximum element of array print",
"element of array print (\"Largest element is:\", arr.max()) print (\"Row-wise maximum elements:\", arr.max(... |
[
"to its initial configuration. \"\"\" # reset statistics self.stats_trees = np.zeros(3).astype(np.int) self.stats_trees[0] +=",
"c)], position=np.array([r, c]), numeric_id=r*self.dims[1]+c) self.urban.append((r, c)) # all other elements are trees else:",
"c+1 < self.dims[1]: self.group[(r, c)].neighbors.append(... |
[] |
[
"'\\033[0;33m', 'FAIL' : '\\033[31m', 'ENDC' : '\\033[0m', 'BOLD' : '\\033[1m', 'UNDERLINE' : '\\033[4m',",
"'FAIL' : '\\033[31m', 'ENDC' : '\\033[0m', 'BOLD' : '\\033[1m', 'UNDERLINE' : '\\033[4m', 'BGRED'",
"'\\033[31m', 'ENDC' : '\\033[0m', 'BOLD' : '\\033[1m', 'UNDERLINE' : '\\033[4m', 'BGRED' : '\\033[41;3... |
[
"active object, so we can keep track of it in a variable: bound_box",
"now the active object, so we can keep track of it in a",
"the active object, so we can keep track of it in a variable:",
"keep track of it in a variable: bound_box = bpy.context.active_object bpy.context.active_object.display_type = 'WIRE'... |
[
"author = 'sphinx-rego' release = '1' extensions = [\"sphinxrego.ext\"] exclude_patterns = ['_build', 'Thumbs.db',",
"= '1' extensions = [\"sphinxrego.ext\"] exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] html_theme = 'alabaster'",
"example' copyright = '2021, sphinx-rego' author = 'sphinx-rego' releas... |
[
"^ # | +-+ # | +-+ | +-+ # | | |",
"as # ^ # | +-+ # | +-+ | +-+ # |",
"| +-+ # | | | +-+ | # | +-+ | |",
"int(((v-self.min)-(v-self.min) % self.step)/(self.step)) self.array[bin_idx] += 1 def print_array(self): print(self.array) def print(self): for i",
"to plot an histogram as # ^ # | +-+ # | +-+",
"+-+... |
[
"= os.path.dirname(__file__) file_path = os.path.join(basepath, 'uploads', 'sample.pdf') fp = open(file_path, 'rb') rsrcmgr =",
"HTMLConverter, TextConverter from pdfminer.layout import LAParams import io app = Flask(__name__) # app.secret_key",
"df = pd.DataFrame(doc_term_matrix, columns=count_vectorizer.get_f... |
[
"return { \"id\": str(uuid4()), \"response-queue\": \"{}-response-queue\".format(str(uuid4())), \"event-name\": event_name, \"detail\": { \"rating\": rating, \"content\":",
"rating): return { \"id\": str(uuid4()), \"response-queue\": \"{}-response-queue\".format(str(uuid4())), \"event-name\": event_name, \"detail... |
[
"px_vis_2 = _random_batch(-100, 100) py_vis_2 = _random_batch(-100, 100) px_miss = _random_batch(-100, 100) py_miss",
"_random_batch(min_, max_): return numpy.random.uniform(min_, max_, (batch_size,)) for _ in range(num_tests): m_vis_1 = _random_batch(0,",
"import mt2_lester, mt2_tombs def test_simple_example()... |
[
"- pessoa['contratacao']) pessoa['aposentar'] = pessoa['idade'] + faltam print('-='*15) for k, v in pessoa.items():",
"')) pessoa['idade'] = anohoje - nasc pessoa['ctps'] = int(input('Informe a CTPS (0 se",
"!= 0: pessoa['contratacao'] = int(input('Informe o ano de contratação: ')) pessoa['salario'] = float(inp... |
[
"스레드랑 멀티 스레드 비교하기 from myThread import MyThread from time import ctime, sleep",
"'at : ', ctime() print funcs[i](n) print funcs[i].__name__, 'finished at :', ctime() print",
"nfuncs : print ' starting', funcs[i].__name__, 'at : ', ctime() print funcs[i](n) print",
"보았다. def fib(x) : sleep(0.005) if x<2 : retu... |
[
"!= wx.ID_OK: return dp = dicomparser.DicomParser(patient_data['images'][0]) reso = [ float(dp.ds.PixelSpacing[0]), float(dp.ds.PixelSpacing[1]), float(dp.ds.SliceThickness)] affine",
"# Create each Study but don't create one for RT Dose # since",
"[] for i, img in enumerate(patient_data['images']): dp = dicomp... |
[
"import data import torchvision.transforms as TF import datasets.transform as mytrans from utils.system import",
"self.clip_n: # short video idx_list.append(idx_list[-1]) if not self.crop: frames = torch.zeros((self.clip_n, 3, *self.output_size),",
"# ax.imshow(np.array(mask[k, 0], dtype=np.uint8)) ax.imshow(co... |
[
"= 0 cnt2 = 0 for num in nums: if num == n1:",
"num cnt2 += 1 else: cnt1 -= 1 cnt2 -= 1 # 筛选出现次数超过三分之一的",
"cnt1 == 0: n1 = num cnt1 += 1 elif cnt2 == 0:",
"cnt1 = 0 cnt2 = 0 for num in nums: if num ==",
"1 if cnt1 > n // 3: res.append(n1) if cnt2 > n //",
"= len(nums) res = [] cnt1 = 0 cnt2 = 0 n1 =",
"... |
[
"= paramiko.SSHClient() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) ssh.connect(rwflow_server_ip, username=user_name, key_filename=keyfile) stdin, stdout, stderr = ssh.exec_command(command + \"&&",
"for line in stdout.readlines(): # print line exit_status = stdout.channel.recv_exit_status() # Blocki... |
[
"from .t_inclusive_gateway import TInclusiveGateway __NAMESPACE__ = \"http://www.omg.org/spec/BPMN/20100524/MODEL\" @dataclass class InclusiveGateway(TInclusiveGateway): class Meta: name",
".t_inclusive_gateway import TInclusiveGateway __NAMESPACE__ = \"http://www.omg.org/spec/BPMN/20100524/MODEL\" @dataclass cla... |
[
"from cv2 import aruco # https://mecaruco2.readthedocs.io/en/latest/notebooks_rst/Aruco/Aruco.html aruco_dict = aruco.Dictionary_get(aruco.DICT_6X6_250) image = cv2.imread(\"../tests/aruco.jpg\") gray",
"ids) for i in range(len(ids)): c = corners[i][0] #lt.plot([c[:, 0].mean()], [c[:, 1].mean()], \"o\",",
"cv2 ... |
[
"curDepth < depth: depths.append(curDepth) depth=curDepth return depths def prettyPrint(treeInfo): for idx,node in enumerate(treeInfo):",
"scale = 2 def traverse(path, parents='', depth=0, isLast=True): tree = [(path, parents, depth,",
"return tree def addDepth(depth,connections,spacer=\" \"): return \"\".join(... |
[
"group='signing', default=\"/etc/keystone/ssl/certs/signing_cert.pem\") register_str('keyfile', group='signing', default=\"/etc/keystone/ssl/private/signing_key.pem\") register_str('ca_certs', group='signing', default=\"/etc/keystone/ssl/certs/ca.pem\") register_int('key_size', group='signing', default=1024) regist... |
[
"BcryptHash import pytest from src.users import Users from src.events import Events from src.stores",
"dur = timedelta(hours=1) params = {} params['password'] = 'password' password = BcryptHash('password').encrypt() user",
"MemoryStore() users = Users(store) events = Events(store) start = datetime.now(pytz.time... |
[
"not None: vault_cli_session.verify = verify requests_session.verify = verify vault_cli_session.get(\"https://bla\") # If this tests",
"requests_ca_bundle else: os.environ.pop(\"REQUESTS_CA_BUNDLE\", None) @pytest.mark.parametrize( \"verify, envvar, expected, expected_with_requests\", [ (None, None, True,",
"ex... |
[
"KIND, either express or implied. # See the License for the specific language",
"from tensorflow.python.platform import test class EstimatorHeadDistributionRegressionTest(test.TestCase): def _assert_output_alternatives(self, model_fn_ops): self.assertEquals({ None: constants.ProblemType.LINEAR_REGRESSION },",
"... |
[
"contact_email is not None: contact_email = contact_email.strip() if contact_email != '' and not",
"None) if name is not None: name = name.strip() if len(name) > 64:",
"def get_user_info(email): profile = Profile.objects.get_profile_by_user(email) info = {} info['email'] = email info['name'] =",
"long (maximu... |
[
"0): factors.append(i) i += 1 for i in range(0, len(factors)): sum += factors[i]",
"= 1 sum = 0 while(True): if(x // (10 ** i) == 0):",
"x = int(input(\"Enter number \")) p = x i = 1 sum =",
"== x): print(\"It is perfect number\") else: print(\"It is not a perfect number\")",
"python3 x = int(input(\"Enter ... |
[
"django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('recommendation', '0002_auto_20181115_2204'), ] operations",
"2.1.3 on 2018-11-15 22:59 from django.db import migrations, models class Migration(migrations.Migration): dependencies =",
"('recommendation', '0002_auto_20... |
[
"help for model type choice \"\"\" RESNET = 0 SQEEZENET = 1 INCEPTIONV3",
"type of the neural network (it must be the same of the training)",
"tuple (class_predicted, probability) that contains the best # prediction best_prediction = max( zip(predictions,",
"class RockPaperScissorsPredictor: \"\"\" This class... |
[
"Input(system.variables[\"dPhi_dT\"].adjectives[\"cw_slow\"]), Input(system.variables[\"dPhi_dT\"].adjectives[\"cw_slow\"]), ) ), CER=CER ) system.rules['accelerate ccw if down'] = Rule( adjective=a_left_slow,",
"= Adjective(Polygon([(-50.,0.),(-20.,1.),(-10.,0.)]),COM=COM) acceleration.adjectives['left_slow'] = ... |
[
"\"\"\"Varational Mixture of Posteriors prior by <NAME> Welling (2017). URL --- https://arxiv.org/abs/1705.07120 \"\"\"",
"URL --- https://arxiv.org/abs/1705.07120 \"\"\" def __init__(self, encoder, n_sample=50): super().__init__() self.encoder = encoder #",
"q.rsample().reshape(*index.shape, *self.event_shape)... |
[
"= list(s) list_chars.remove(c) return \"\".join(list_chars) if __name__ == \"__main__\": guessed = False attempts",
"a 4-digit number. For every digit that the user guessed correctly in the",
"a 4-digit number: \") attempts += 1 if user == secret: guessed =",
"to don't duplicate the count \"\"\" list_chars =... |
[
"Generated by Django 3.2.4 on 2021-12-14 11:17 from django.db import migrations, models class",
"import migrations, models class Migration(migrations.Migration): dependencies = [ ('finliveapp', '0027_gassystem_wind_direction'), ] operations =",
"2021-12-14 11:17 from django.db import migrations, models class Mi... |
[
"(batch_size, num_noise_words + 1) Sparse unnormalized log probabilities. The first element in each",
"self.W_R[ri,:] d_ri_emb = self.D_R[ri,:] #tj = random.sample(np.arange(0,self.num_docs).tolist(), hi_emb.shape[0]) #if torch.cuda.is_available(): # tj =",
"'transd': hi_emb = projection_transD(hi_emb, w_ri_emb... |
[
"__parseComponent children = [] for n in node.getchildren(): if n.tag == 'value': selected",
"screen-spec not found') self.retval = model.ScreenSpec() for n in node.getchildren(): self.__parseScreen(n, self.retval) def",
"@author: <NAME> ''' from lxml import etree from StringIO import StringIO from screensketch... |
[
"-> str: if not root: return '' left = encode(root.left) right = encode(root.right)",
"encode(root: Optional[TreeNode]) -> str: if not root: return '' left = encode(root.left) right",
"right = encode(root.right) encoding = str(root.val) + '#' + left + '#' +",
"encode(root.right) encoding = str(root.val) + '#'... |
[
"from discord.ext import commands import discord import datetime class OnError(commands.Cog): def __init__(self, bot):",
"= f\"You are missing a required argument for this command to work: `{error.param.name}`!\"",
"+ datetime.timedelta(seconds=seconds) await ctx.send(f'⏱️ This command is on a cooldown. Use it ... |
[
"= bpy.props.BoolProperty( name=\"Show Enum Properties\", description=\"Show enum properties\", default=True, update=update_lists) show_vector_props = bpy.props.BoolProperty(",
"bpy.props.BoolProperty( name=\"Show Header Button\", description=\"Show header button\", update=show_header_btn_update, default=True) ob... |
[
"0.8, name='net1_layer5') net = tflearn.fully_connected(net, 5, activation='softmax', name='net1_layer6') net = tflearn.regression(net, optimizer='rmsprop', loss='categorical_crossentropy',",
"128], name='net1_layer1') net = tflearn.lstm(net, n_units=256, return_seq=True, name='net1_layer2') net = tflearn.dropout... |
[
"'C']) >>> queue.popleft() 'Python' >>> queue.popleft() 'Java' >>> queue.clear() >>> len(queue) 0 >>>",
">>> queue deque([]) >>> queue.popleft() Traceback (most recent call last): ... IndexError: pop",
"queue.popleft() 'Java' >>> queue.clear() >>> len(queue) 0 >>> queue deque([]) >>> queue.popleft() Traceback",... |
[
"clip # model settings model = dict( neck=dict( start_level=0, # start_level=1, # add_extra_convs='on_input',",
"'./retinanet_r50_fpn_1x_TinyPerson640.py' ] optimizer = dict(type='SGD', lr=0.02, momentum=0.9, weight_decay=0.0001) # 4 gpu optimizer_config =",
"# model settings model = dict( neck=dict( start_leve... |
[
"\"hidden_size2\": 4, \"combined_hidden_size\": 16, \"num_attention_heads\": 2, \"dropout1\": 0.1, \"dropout2\": 0.2, } @pytest.fixture def",
"import BiModalAttention @pytest.fixture def params_dict(): return { \"hidden_size1\": 6, \"hidden_size2\": 4, \"combined_hidden_size\": 16,",
"BiModalAttention @pytest.f... |
[
"= 0 while days < num_days: for i, day in enumerate(self.WEEKDAYS): if days",
"Gets an event from a name and a date Args: calendar_date : date",
"don't pop this, or parents if not isinstance(nested_dict, dict): return False # if",
"on to return if included Returns: year (int), month (int), day (int), name",
... |
[
"setup(name='funniest_ieee', version='0.5', description='The funniest_ieee joke in the world', url='https://github.com/axel-sirota/IEEE-CICD', author='<NAME>', author_email='<EMAIL>', license='MIT', KEYWORDS",
"OS Independent\", \"Programming Language :: Python\", \"Programming Language :: Python :: 2\", \"Progra... |
[
"a number n and computes the sum 1 + 2 + ... +",
"... + ', n, ' is equal to ', s, '.', sep= '')",
"2 + ... + n. n = input('Type a natural number and press",
"s = { i for i in range(1, n+1) } s = sum(s)",
"+ n. n = input('Type a natural number and press return: ') n",
"i in range(1, n+1) } s = sum(s) print... |
[
"import enrollment_enroll_view from .enrollment_admin_view import enrollment_admin_view from .enrollment_admin_special_diets_view import enrollment_admin_special_diets_view from .enrollment_admin_menu_items import",
".enrollment_enroll_view import enrollment_enroll_view from .enrollment_admin_view import enrollme... |
[
"set anything only at test time if task is None: if test: task",
"self.goal_space_origin = np.array([0, 0.85, 0.175]) self.current_task_idx = 0 self.episode_steps = 0 self._max_episode_steps =",
"ReachML1Env(gym.Env): def __init__(self, max_episode_steps=150,out_of_distribution=False, n_train_tasks=50, n_test_t... |
[
"his or her # number at each house. # # So, the first",
"House 7 got 80 presents. # House 8 got 150 presents. # House",
"and 4, for a total of 10 + 20 + 40 = 70",
"# # --- Part Two --- # # The Elves decide they don't",
"based on that number: # # The first Elf (number 1) delivers presents",
"60 presents. #... |
[
"<<EMAIL>> # Released under the terms of the MIT License import xbmc xbmc.executebuiltin('xbmc.PlayerControl(Partymode(music)',",
"partymoder xbmc add-on # Copyright 2017 aerth <<EMAIL>> # Released under the terms",
"under the terms of the MIT License import xbmc xbmc.executebuiltin('xbmc.PlayerControl(Partymod... |
[
"if out.find('D Compiler v2.')>-1: conf.fatal('dmd2 on Windows is not supported, use gdc or",
"out=conf.cmd_and_log(conf.env.D+['--help']) if out.find(\"D Compiler v\")==-1: out=conf.cmd_and_log(conf.env.D+['-version']) if out.find(\"based on DMD v1.\")==-1: conf.fatal(\"detected compiler",
"v.LINKFLAGS=[] v.DF... |
[
"# Register your models here. admin.site.register((BlogComment,)) # it must be in tupple formate",
"it must be in tupple formate admin.site.register(Category) @admin.register(Post) class PostAdmin(admin.ModelAdmin): class Media: js",
"from blog.models import Post, BlogComment, Category # Register your models he... |
[
"name, activities, course): subject = Subject.get_by_id(int(subject_id)) subject.name = name subject.activities = activities subject.course",
"from tekton.gae.middleware.redirect import RedirectResponse from tekton.router import to_path __author__ = 'marcos' @no_csrf @login_not_required",
"TemplateResponse(ctx,... |
[
"from GameData import GameData class RandomChoice(Algorithm): def __init__(self): super().__init__() \"\"\" A stupid algorithm",
"r = int(random() * 3) if r == 0: return \"turn left\" elif",
"from Algorithms.Algorithms import Algorithm from GameData import GameData class RandomChoice(Algorithm): def __init__(se... |
[
"def get_args(self): \"\"\"Set argument options\"\"\" self.arg_parser.add_argument('--version', action = 'version', version = '%(prog)s '",
"'utf8')) print('exit') conn.close() s.close() exit(0) def show_help(self): \"\"\"Show help for shell options\"\"\" h",
"$ ' print('Type exit or enter EOF (ctrl-d) to exit.... |
[
"tempfile import jk_json import jk_logging import jk_typing import jk_git from TestHelper import TestHelper",
"\"mycommitmsg1\", log) th.createSingleFileAndCommitIt(\"foo2.txt\", \"mycommitmsg2\", log) \"\"\" with log.descend(\"Creating another file and committing it",
"...\") as log2: ret = th.git.listBranches... |
[
"QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.cbProtoView.sizePolicy().hasHeightForWidth()) self.cbProtoView.setSizePolicy(sizePolicy) self.cbProtoView.setObjectName(\"cbProto... |
[
"os.path.exists(\"target_p03_gray.mp4\"): to_grayscale(\"target_p02_denoised.mp4\", \"target_p03_gray.mp4\") gray_movie_viewer = Scrubber( get_frames(cv.VideoCapture(\"target_p03_gray.mp4\")), window_title=\"gray\" ) gray_movie_viewer.create() gray_movie_viewer.wait() if not",
"p03_gray import to_grayscale from p... |
[
"\"\"\" for address_in_factory, test in self._generate_tests(fixture_store): assert test.__slash__ is None test.__slash__ = Metadata(self,",
"def generate_tests(self, fixture_store): \"\"\" Generates :class:`.RunnableTest` instances to run Do not override this",
"None test.__slash__ = Metadata(self, test, addre... |
[
"condition_values) elif self.operator == ShardingOperator.BETWEEN: return RangeShardingValue(self.column.table_name, self.column.name, Range(condition_values[0], RangeType.CLOSED, condition_values[1], RangeType)) else:",
"class Conditions: def __init__(self, conditions=None): self.or_condition = OrCondition() if ... |
[
"+ x_train[i][3], int(x_train[i][0] + x_train[i][1] + x_train[i][2] + x_train[i][3] > 20), int(r[i][0] <",
"def get_data(nums): import os x_train = [] # 4*1 y_train = [] #",
"1*1 for i in range(nums): NewList = [] for m in list([0, 1,",
"= [] for m in list([0, 1, 2, 3]): NewList.append(random.random() // 0.1)... |
[
"<gh_stars>0 # Python program to draw # Spiral Helix Pattern # using Turtle",
"# Python program to draw # Spiral Helix Pattern # using Turtle Programming",
"using Turtle Programming import turtle loadWindow = turtle.Screen() turtle.speed(2) for i in range(100):",
"draw # Spiral Helix Pattern # using Turtle Pr... |
[
"[c * 1.0 / symbols for _,c in counts] codeu = make_code(counts) code16",
"c == ' ': return \"' '\" if code > 32 and code",
"display_list(codeu)) print 'code-16 (weighted lenght %s):\\n%s' % (sum((w * l for w,(_,l) in",
"in rows] return '\\n'.join(res) def test_coder(name, data, code): encoder = Encoder(code)... |
[
"commit_action from robotice.reasoner.comparators import BaseComparator logger = logging.getLogger(__name__) R_FCL_PATH = \"/srv/robotice/config/fuzzy\" FCL_VAR =",
"celery.signals import celeryd_after_setup from robotice.reactor.tasks import commit_action from robotice.reasoner.comparators import BaseComparator ... |
[
"return \"bert-base-cased\" elif model_name_or_path == \"CA-MTL-base-uncased\": return \"bert-base-uncased\" elif model_name_or_path == \"CA-MTL-tiny\": return",
"max_mean_batch_entropy ): max_mean_batch_entropy = batch_entropy_mean if labels is not None: loss_grouped_per_task[unique_task_id] = current_loss",
"... |
[
"uploaded</title><h1>File uploaded</h1>' else: return ''' <!doctype html> <title>Upload new File</title> <h1>Upload new File</h1>",
"ALLOWED_EXTENSIONS = set(['json']) app = Flask(__name__) app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER def allowed_file(filename): return '.'",
"allowed_file(filename): return '.' i... |
[] |
[
"print(Fore.CYAN + 'What is the root FQDN for this machine: ' + Fore.RESET,",
"Fore.RESET) # Get variables print() print(Fore.CYAN + 'What is the root FQDN for",
"server run: ' + Fore.RESET, end='') port = input() # Write out configuration",
"print(Fore.CYAN + '-' * 13 + Fore.RESET) print('Call Server') print... |
[
"credential: UserFreeCarrier, message, *args): if message is None: return data = { 'user':",
"query = parse.urlencode(data) url = f'https://smsapi.free-mobile.fr/sendmsg?{query}' res = requests.get(url) res.raise_for_status() # free api",
"res.raise_for_status() # free api # errorcodes = {400: 'Missing Paramete... |
[
"up and failing.\") else: scraper.logger.warning(\"Link failed after waiting over a minute, giving up",
"warning and keep going timeout_length = 2 html = None while timeout_length <",
"= timeout_length timeout_length **= 2 #this squares the result. awesome. scraper.logger.debug(\"Timed out after",
"while time... |
[
"def test_it_exists(self): self.assertNotEqual(GuessCombinator(), None) def test_it_returns_a_best_guess(self): # solution_unknown corpus = [\"abcde\", \"abcdf\", \"abcdg\",",
"def test_it_returns_a_best_guess(self): # solution_unknown corpus = [\"abcde\", \"abcdf\", \"abcdg\", \"abcdh\", \"abcdi\", \"efghi\"] ex... |
[
"_logmatmulexp(x, y) if time > even_time: contracted = torch.cat((contracted, logits[..., -1:, :, :]),",
"(self.S + 1)).to_event( 1 ), ) trans = expand_offtarget(trans) lamda = pyro.sample(\"lamda\", dist.Exponential(1))",
"if isinstance(fdx, int) and fdx < 1 else Vindex(pyro.param(\"z_trans\"))[ndx, fdx, z_pre... |
[
"to use. render (bool): the flag to render OpenAI Gym environment or not.",
"timeout_wait (Union[int, float]): the maximum wait time to respond step request to UDE",
"Optional[List[Tuple[str, Any]]] = None, compression: Compression = Compression.NoCompression, credentials: Optional[Union[ServerCredentials, Iter... |
[] |
[
"for the object model = cls.get(**{self.__param__: value}) if model is None: raise NotFound",
"= map self.model = model return @property def models(self): global MODELS if not",
"models(self): global MODELS if not MODELS: gather_models() return MODELS def to_python(self, value): mapper",
"other custom paramet... |
[
"return_tensors='tf') greedy_output = model.generate(torch.zeros((10, 1), dtype=torch.int), max_length=1024+1, min_length=1024+1) print(list(greedy_output.data[0].numpy())) for file in ('train',",
"GPT2LMHeadModel, GPT2Tokenizer, AutoTokenizer, GPT2Config PATH = './models' OUTPUT_PATH = './output/' if __name__ ==... |
[
"'i': 0x22, 'p': 0x23, 'l': 0x25, 'j': 0x26, '\\'': 0x27, 'k': 0x28, ';':",
": 0x3B, 'rightshift' : 0x3C, 'rightoption' : 0x3D, 'rightcontrol' : 0x3E, 'function' :",
"0x2c, 'n': 0x2d, 'm': 0x2e, '.': 0x2f, '`': 0x32, ' ': 0x31, '\\r':",
"1, 'KEYTYPE_BRIGHTNESS_UP': 2, 'KEYTYPE_BRIGHTNESS_DOWN': 3, 'KEYTYPE_CA... |
[
"__init__(self, pretrained_model='tfeat_misc/tfeat-liberty.params'): super( tfeat, self).__init__( name='tfeat', is_detector=False, is_descriptor=True, is_both=False, patch_input=True, can_batch=True) self.model =",
"batch_resized.append(cv2.resize(batch[i], (32, 32), interpolation=cv2.INTER_AREA)) batch_resized ... |
[
"files. A full dataframe by dataframe comparison is performed to ensure identical csv",
"replicate_file_names: dataframe_assertion( reference_path=Path(tmpdir, \"expected_replicated_results\", rep), test_path=Path(tmpdir, \"replicated\", rep), ) # # Remove temporary",
"to wrong values, not due to interchanged r... |
[
"import datetimes from axiom.attributes import LARGEST_NEGATIVE, LARGEST_POSITIVE def axiomText(*a, **kw): \"\"\" Strategy for",
"for generating lists storable with L{axiom.attributes.textlist}. \"\"\" return st.lists(st.text( alphabet=st.characters( blacklist_categories={'Cs'}, blacklist_characters={u'\\x00', u'... |
[
"nn.BatchNorm2d(out_channels) self.activation = Mish() def forward(self, x): x = self.conv(x) x = self.bn(x)",
"# -*- coding = utf-8 -*- # @Time : 2022/1/8 15:41 # @Author",
"self.conv(x) x = self.bn(x) x = self.activation(x) return x class VGG16(nn.Module): def __init__(self):",
"summary # # if __name__ == \... |
[
"# delay to switch windows time.sleep(10) # content you want to spam with",
"to spam with f = open(\"idoc.pub_green-lantern-movie-script.txt\", 'r') # loop to spam for word",
"'r') # loop to spam for word in f: # fetch and type",
"word from the file pyautogui.write(word) # press enter to send the message pyau... |
[
"tf.tensor_scatter_nd_max(tensor, indices, updates, name=name) elif segment_name in [\"segment_min\", \"min\", \"reduce_min\"]: pool = tf.tensor_scatter_nd_min(tensor,",
"= tf.tensor_scatter_nd_max(tensor, indices, updates, name=name) elif segment_name in [\"segment_min\", \"min\", \"reduce_min\"]: pool =",
"te... |
[
"modification of previously submitted commands/responses. if not self.CanEdit(): return key = event.KeyCode() currpos",
"'Show __module__', 'Show __module__ entries in the tree view', 1) m.AppendMenu(ID_FILLING, '&Filling', fm,",
"self.OnUpdateMenu) EVT_UPDATE_UI(self, ID_FILLING_SHOW_DOC, self.OnUpdateMenu) EV... |
[
"p = remote('pwnremote.threatsims.com', 9002) else: p = process(binary.path) p.sendlineafter('?\\n','%11$10p%15$10p') p.recvuntil('command: ') canary =",
"int(p.recv(10),16) - 95 log.info('main: ' + hex(main)) binary.address = main - binary.sym.main log.info('binary.address:",
"b'' payload += (0x21 - 0x10) * b'... |
[
"str container in storage account to open blobName: str name of blob in",
"storage. Parameters ---------- data: str (text)data to upload containerName: str container in storage",
"json.loads(res.content) except: blobData = {} return blobData def save_text_file(data, containerName, blobName, accountName, account... |
[
"test_requirements.txt\", shell=True, stderr=subprocess.STDOUT) except subprocess.CalledProcessError as exc: print(\"ERROR: Test dependency installation failed.\\n{}\\n\".format(exc.output.decode())) return",
"os.environ.setdefault(\"DJANGO_SETTINGS_MODULE\", \"django_test_app.settings\") from django.core.managem... |
[
"Query(AbstractType): book = relay.Node.Field(BookNode) book_page = relay.Node.Field(BookPageNode) all_books = DjangoFilterConnectionField(BookNode) all_pages = DjangoFilterConnectionField(BookPageNode)",
"'page_number': ['exact'], } interfaces = (relay.Node, ) class BookNode(DjangoObjectType): class Meta: model ... |
[
"import draw_line, draw_ellipse class TestTspBresenham(unittest.TestCase): def test_bresenham(self): x, y = 500, 500 for",
"y1, x1, y2) draw_line(x1, y2, x2, y1) def test_bresenham_ellipses(self): x, y = 500,",
"1) y2 = random.randint(0, y - 1) ligne1 = draw_line(x1, y1, x2, y2)",
"y1 = random.randint(0, y - ... |
[
"self.navigator = None curses.init_pair(2, curses.COLOR_GREEN, curses.COLOR_BLACK) def left(self): pass def right(self): pass def",
"rectangle(self.std_scr, self.origin_y - 1, self.origin_x - 1, self.origin_y + 1, self.width // 4",
"in self.all_editors.items(): if i == index: self.std_scr.addstr(self.origin_y +... |
[
"things like experiment name , task name, board id, etc. \"\"\" MESSAGE_TYPE_ALIAS =",
"# -*- coding: utf-8 -*- from pybpodapi.com.messaging.base_message import BaseMessage class DebugMessage(BaseMessage): \"\"\" Information",
"name, board id, etc. \"\"\" MESSAGE_TYPE_ALIAS = \"debug\" MESSAGE_COLOR = (200, 200... |
[
"cli_main from .extractor import TableauExtractor if __name__ == \"__main__\": cli_main(\"Tableau metadata extractor\", TableauExtractor)",
"metaphor.common.cli import cli_main from .extractor import TableauExtractor if __name__ == \"__main__\": cli_main(\"Tableau metadata",
"from metaphor.common.cli import cli... |
[] |
[
"가져올 때 import 모듈_명 obj = lib.A() # lib라는 모듈의 A클래스에 대한 인스턴스화",
"> import lib # 모듈을 가져올 때 import 모듈_명 obj = lib.A() #",
"<filename>opentutorials_python2/opentutorials_python2/20_Object_and_Module/1_Object_and_Module.py # < 객체와 모듈 > import lib # 모듈을 가져올 때 import",
"# < 객체와 모듈 > import lib # 모듈을 가져올 때 import 모듈_명... |
[
"the same as the 1st argument + some changes fn = fn +",
"balance: {:.2f} / transfers: {:.2f} / end balance: {:.2f}' \\ .format(fn, start_balance, total_amount,",
"+':99:' # parse the string in a field number 'num' and its corresponding",
"= match.group('num') field = match.group('field') # in case field numb... |
[
"rules.pop('monsters', {})) load_rules_section(manager.add_egg_rule, rules.pop('eggs', {})) load_rules_section(manager.add_raid_rule, rules.pop('raids', {})) for key in rules: raise",
"import json import sys from collections import OrderedDict from .Utilities.GenUtils import get_path log",
"e: log.error(\"Encou... |
[
"{}'.format(str(self.num), self.x, self.y)) if (self.labyrinth.isWalkable(self.x-1, self.y)): walkableSpots.append({'x': self.x-1, 'y': self.y}) if (self.labyrinth.isWalkable(self.x, self.y-1)):",
"self.y)): walkableSpots.append({'x': self.x-1, 'y': self.y}) if (self.labyrinth.isWalkable(self.x, self.y-1)): walka... |
[
"= find_paths(e1_map, q_ent, ans_ent) all_subgraphs[qid].append({'st': q_ent, 'en': ans_ent, 'chains': paths}) len_q += len(paths)",
"too much per query. Worth asking some SPARQL expert, how # to handle",
"hop=1) if not is_exception: all_subgraphs[qid].append({'st': q_ent, 'en': ans_ent, 'chains': ret[0]}) all_... |
[
"import Problem class ProblemPrinter: def __init__(self, fixture_order_raw, duration_rnd_seed, **kwargs): self.p = Problem(fixture_order_raw =",
"file1.write(\"TRAY_TASKS = \" + self.p.TrayTasksToString() + \";\\n\") file1.write(\"CAMERA_TASKS = \" + self.p.CameraTasksToString() +",
"self.fixture_order_raw[i] =... |
[
"da aplicação # import os from os.path import abspath DEBUG = True SECRET_KEY",
"DEBUG = True SECRET_KEY = 'a secret key' # diretório base basedir =",
"basedir # connection string: mysql://usuario:senha@host/nomedobanco SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://root:root@localhost/dbdevweb' # SQLAlchemy monito... |
[
"#Do we need to get the data or is it already there? shape_names",
"we want to extract the data ''' #Do we need to get the",
"is it already there? shape_names = os.listdir(f'{project_dir}/data/raw/shapefiles') if file_name not in shape_names: #Get",
"url: url for the shapefile zip file_name: name of the file ... |