ngram
listlengths
0
82k
[ "return self._encoding def __str__(self): return \"<%s %s>\" % (self.method, self.url)", "attributes except for those given new values. \"\"\" for x", "well as having :ref:`downloader middlewares <topics-downloader-middleware>` and :ref:`spider middlewares <topics-spider-middleware>`", "Scrapy. See documentat...
[ "class Game(object): class Rules(): def __init__(self, shoe_size=4, min_bet=1, max_bet=10): self.shoe_size", "print(\"YOU CAN'T DOUBLE DOWN!!! double down is only available on", "not self.done: turn += 1 hits = 0 for p", "o+=\"{!s:^35}\".format(p.player) return o def __str__(self): return (\\ \"{:^30}\\n\"\\ ...
[ "i % 7 == 0: total = total+i print(\"Sumatoria de", "todos los múltiplos de 7 encontrados entre el 0 y", "to 100. total = 0 for i in range(101): if", "100. total = 0 for i in range(101): if i", "i in range(101): if i % 7 == 0: total", "= 0 for i in range(101): if i % 7", "el 100. # Summing all the multi...
[ "None) self.msgRateInSeconds = self.configHASS.get(\"msgRateInSeconds\", 60) self.resendRateInSeconds = self.configHASS.get(\"resendRateInSeconds\", 3600) self.retryRateInSeconds", "import time from ww import f logger = logging.getLogger(__name__.rsplit(\".\")[-1]) class", "= threading.Lock() backgroundTasksThr...
[ "import Blueprint, jsonify, request, render_template home_routes = Blueprint(\"home_routes\", __name__) @home_routes.route(\"/\")", "= Blueprint(\"home_routes\", __name__) @home_routes.route(\"/\") def index(): users = User.query.all() return", "reset(): DB.drop_all() DB.create_all() return render_template('bas...
[ "== len(gold_tokens): print(\"LENGTH OF SEQUENCE IS MISMATCHED\") continue gold_sents.append(gold_tokens) eval_sents.append(tag_tokens)", "inst in dev_xc: # word_align(inst.gloss, inst.lang) # inst.project_lang_to_gloss(tagmap = './data/tagset_mappings/ctn.txt')", "# Fix the tags... # fix_ctn_gloss_line(to_tag,...
[ "str(row[0]) #覆盖取值 rpiname = 'raspberrypi' # 获取指针并赋值 path = r'/root/video/realtime/%s'", "# 可能存在类型问题 # cursor.execute(sql) # row = cursor.fetchone() # #", "= r'/root/video/realtime/%s/%s.jpg' % (rpiname, picturecounter) image = cv2.imread(picpath) bs =", "= db.cursor() # # sql = \"select rpiname from user", ...
[ "matrix for float ambiguities ## ## - ncands : number", "# Get the float mu mu_dec = mu%1 # Get", "for # computational efficiency) # L,D : LtDL-decomposition of the", "float solution, so that all values are # between -1", "of a given variance or # covariance matrix. # #", "Z = np.round(np.linalg.inv(iZt.t...
[ "<filename>summarizer/test_summarizer.py from summarizer.summarizer import summarize def test_summarize_whenPassedEmptyString_ReturnsEmpty(): assert summarize(\"\") ==", "from summarizer.summarizer import summarize def test_summarize_whenPassedEmptyString_ReturnsEmpty(): assert summarize(\"\") == \"\"" ]
[ "hex to unicode string for i in range(len(hex_to_uni)): # Comparing", "to the length of message for i in range(0, len(msg),", "of message for i in range(0, len(msg), 2): # Decoding", "used, repeat the key iteration = 0 # Returning the", "= '' iteration = 0 # Running for loop in", "in range(len(msg)): temp...
[ "random def rename_files(path): file_list = os.listdir(path) print(file_list) for file_name in", "= os.listdir(path) print(file_list) for file_name in file_list: # Remove numbers", "new_file_name file_name.translation(None, \"0123456789\") # Add random numbers to beginning of", "file_name + \" to \" + new_fil...
[ "Parameters ---------- pad_width : mapping of hashable to tuple of", "values): self.data = values def to_base_variable(self): \"\"\"Return this variable as", "unmodified. \"\"\" if isinstance(data, pd.Index): return PandasIndexAdapter(data) return data def", "triggered by using an array indexer, in which case...
[ "number_of_pens, number_of_notebooks = map(int, input().split()) if number_of_pens >= number_of_participants and", "number_of_participants, number_of_pens, number_of_notebooks = map(int, input().split()) if number_of_pens >= number_of_participants", "number_of_pens >= number_of_participants and number_of_notebo...
[ "DLA import main_single d = main_single(1, gotosize=[1e4, 5e4]) d.plot_particles() d.plot_mass_distribution()", "<reponame>StanczakDominik/DLA from DLA import main_single d = main_single(1, gotosize=[1e4, 5e4])", "from DLA import main_single d = main_single(1, gotosize=[1e4, 5e4]) d.plot_particles()" ]
[ "util.BufferedByteStream() x.write('*' * 6000) x.seek(100) self.assertRaises(IOError, x.read, -345) def test_peek(self):", ") def test_nan(self): x = util.BufferedByteStream(b'\\xff\\xf8\\x00\\x00\\x00\\x00\\x00\\x00') self.assertTrue(isNaN(x.read_double())) x = util.BufferedByteStream(b'\\xff\\xf0\\x00\\x00\\x00...
[ "(Fore.RED +'[+] Result: No condition is set for \"all\"! Domain", "Record...') try: obj_answer = dns.resolver.resolve(Domain, 'TXT') except: sys.exit(Fore.RED + \"\\n[+]", "(answer[spf_pos:].find(\"\\n\"))-1 spf_end= answer[spf_pos:spf_pos+spf_end_tmp] print (Fore.GREEN + '[+] Domain: ' +", "= str(obj2_answe...
[ "speech = '。'.join([ 'それは {adjective} 質問ですね'.format(adjective=adjective[0]), 'きっと, {0} や {1}", "self.finish( dumps( answers, ensure_ascii=False, indent=4, sort_keys=True, separators=(',', ': ') )", "{2} のことです'.format(*nouns) ]) else: speech = 'それはきっと, {0} や {1}", "speech = 'それはきっと, {0} や {1} あるいは {2} のことです'.f...
[ "and self.state != chunkParserStates.COMPLETE: more, raw = self.process(raw) return raw", "chunkParserStates.COMPLETE: more, raw = self.process(raw) return raw def process(self, raw:", "ChunkParserStates = NamedTuple( 'ChunkParserStates', [ ('WAITING_FOR_SIZE', int), ('WAITING_FOR_DATA', int), ('COMPLETE',", ...
[ "managed device pools are present on a host. The check", "We might want to use TypedDict here. Refer to #", "alloc_devices: ty.List[objects.PciDevice] = [] for request in pci_requests: count =", "performance reason. return all( self._filter_pools(self.pools, r, numa_cells) for r in", "strutils.bool_from_str...
[ "renames all the files of the folder Desktop to 'new_name'", "to 'new_name' and count starts from 33 to further (we", "is given '.exe' hence the files will be renamed like", "renamed like : 1. new_name33.exe 2. new_name34.exe and so on", "starts from 33 to further (we can also provide 1", "folder Desktop ...
[ "not (os.path.islink(l)): return None p = os.readlink(l) if os.path.isabs(p): return", "import os def readlinkabs(l): \"\"\" Return an absolute path for", "for the destination of a symlink \"\"\" if not (os.path.islink(l)):", "readlinkabs(l): \"\"\" Return an absolute path for the destination of", "None p =...
[ "0 while True: cur = picam2.capture_buffer(\"lores\") cur = cur[:w *", "None: # Measure pixels differences between current and # previous", "mse > 7: if not encoding: epoch = int(time.time()) encoder.output.fileoutput", "encoder.output = CircularOutput() picam2.encoder = encoder picam2.start() picam2.start_en...
[ "two tuples, where the first element is the number of", "only add it if it is not already present new_pattern_info", "of the list. o bottom_num - The number of patterns", "self._pattern_list[-bottom_num:]: all_patterns.append(pattern_info[1]) return all_patterns def remove_polyA(self, at_percentage = .9): \"\...
[]
[ "dialog.setModal(True) result = dialog.exec_() if result == QtGui.QDialog.Rejected: return self.servo_model", "Add a new one. servo_id = len(self.servo_controls) label = QtGui.QLabel()", "control = self.servo_controls[ident] control['slider'].setSliderPosition(int(angle_deg)) control['doublespin'].setValue(angl...
[ "it (earlier) if # it isn't self.dispatchCommand(self, cmd, box).addCallbacks(sendAnswer, sendError", "self).__init__(**kw) self.certificate = __certificate self.verify = __verify self.sslstarted = __sslstarted", "is not None: self.sslstarted() class QuitBox(JuiceBox): def __repr__(self): return 'Quit(**%s)'", ...
[ "unregister_simulator(self, session_id: str): url = \"{}/v2/workspaces/{}/simulatorSessions/{}\".format( self._config.server, self._config.workspace, session_id )", "SimulatorInterface): reg_url = \"{}/v2/workspaces/{}/simulatorSessions\".format( config.server, config.workspace ) log.debug(\"Sending registration ...
[ "/ 100]) # perturbed_v = np.array([random.randint(-16000, 16000) / 100, random.randint(-16000,", "f.write(pickle_perturbed_data) # with open(self.save_path+'grey/'+perfix_+'_'+fold_curve+'.gw', 'wb') as f: # pickle_perturbed_data =", "fiducial_points, 'relativeShift_v2')) except BaseException as err: print(err)...
[ "data; take input from stdin if not present\") parser.add_argument('-o','--output-dir',dest='output_directory',default=os.environ['HOME'] +", "datetime.datetime.now() output_directory = '{0}/{1:04d}/{2:02d}/{3:02d}/'.format(args.output_directory.rstrip('/') ,time_now.year ,time_now.month ,time_now.day ) # get", ...
[ "from flask import Flask, request import os from twilio.twiml.messaging_response import", "error msg for TPC commands pass else: # Checking for", "'TPC -w -d': utils.portalLogin(os.environ.get('TPC_EMAIL'),os.environ.get('TPC_PWD')) utils.getWillingness() elif incoming_msg[:15] == 'TPC -experience'", "✉ : <EM...
[ "\"\"\" Custom exceptions for nflfastpy module \"\"\" class SeasonNotFoundError(Exception): pass" ]
[ "data point to the class with the highest score Inputs:", "array of shape (N,) giving predicted labels for each of", "layer biases; has shape (H,) W2: Second layer weights; has", "a ReLU nonlinearity after the first fully connected layer. In", "y] -= 1 d_scores /= N # W2 were multiplied", "score Inputs: -...
[ "self.assertEqual(setting.__str__(), name) self.assertEqual(setting.data, data) def test_delete_setting(self): \"\"\" Test Deleting a", "Setting class SettingTestCase(TestCase): def _create_setting(self, name, **kwargs): return Setting.objects.create(name=name, **kwargs)", "\"\"\" Test Getting a setting object....
[ "error from ZAMG: %s\", err) return add_entities([ZamgWeather(probe, name)], True) class", "current condition.\"\"\" return None @property def attribution(self): \"\"\"Return the attribution.\"\"\"", "and API logic from the sensor implementation from .sensor import", "def temperature_unit(self): \"\"\"Return ...
[ "= copy.deepcopy(config) for key in [\"pipeline\", \"policies\"]: if copied_config.get(key): for", "\"config\" FINGERPRINT_CONFIG_CORE_KEY = \"core-config\" FINGERPRINT_CONFIG_NLU_KEY = \"nlu-config\" FINGERPRINT_CONFIG_WITHOUT_EPOCHS_KEY = \"config-without-epochs\"", "to be created. fingerprint: A unique finge...
[ "if not self.position and price > self.sma[-1]: # market entry", "import Backtest, Strategy from backtesting.lib import crossover, cross from backtesting.test", "backtesting and set options import backtesting # Set notebook False", "- FAQ - License - API Reference Documentation source :", "import SMA, GOOG ...
[ "nomes = ['Carlos', 'Camila', 'Carla', 'Cristiana', 'Cristina', 'Vanessa'] print(any8[nomes[0] ==", "Comprehension; - Dictionary Comprehension; - Set Comprehension. Não foi abordado:", "print(res2) # O que faz a função de getsizeof()? ->", "de números com List Comprehension list_comp = getsizeof([x * 10", "...
[ "o terceiro número: \")) if (numero1 < numero2 and numero2", "int(input(\"Digite o segundo número: \")) numero3 = int(input(\"Digite o terceiro", "if (numero1 < numero2 and numero2 < numero3): print(\"crescente\") else:", "segundo número: \")) numero3 = int(input(\"Digite o terceiro número: \"))", "terceiro...
[ "range(2): tina.forward(lengte) tina.right(60) tina.forward(lengte) tina.right(120) def sneeuwvlok(lengte, num): for i", "i in range(num): parallellogram(lengte) tina.right(360.0/num) # 360.0 zorgt voor cast", "tina.right(120) def sneeuwvlok(lengte, num): for i in range(num): parallellogram(lengte) tina.right(3...
[ "WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT", "'basename': self.name, 'name': out_name, 'file_dep': template_deps, 'targets': [out_name], 'actions': [(render_listing,", "# This is necessary to reflect changes in blog title,", "folders, 'files': files, 'description': title, } self.site.render_te...
[ "= pulumi.ResourceOptions() if not isinstance(opts, pulumi.ResourceOptions): raise TypeError('Expected resource options", "of the resource. :param pulumi.ResourceOptions opts: Options for the resource.", "if account_name is None and not opts.urn: raise TypeError(\"Missing required", "the resource. :param pulu...
[ "All Rights Reserved. # # This file is licensed under", "snippet-sourcedescription:[s3-python-example-get-bucket-policy.py demonstrates how to list the Amazon S3 Buckets in", "under the License. import boto3 # Create an S3 client", "# License is located at # # http://aws.amazon.com/apache2.0/ # #", "at # # ...
[ "sys import aingle.codecs import aingle.datafile import aingle.io import aingle.schema NULL_CODEC", "License. import os import sys import aingle.codecs import aingle.datafile import", "as schema_file: interop_schema = aingle.schema.parse(schema_file.read()) for codec in CODECS_TO_VALIDATE: filename", "CODECS_...
[ "= array == unique_value if unique_value in values_to_ignore: all_entries_to_keep =", "unique_values: entries_of_this_value = array == unique_value if unique_value in values_to_ignore:", "result = array * all_entries_to_keep if new_value != 0: eroded_entries", "all_entries_to_keep if new_value != 0: eroded_en...
[ "t2 == lu2.function_unit with u.set_enabled_equivalencies(u.logarithmic()): assert_allclose(t2.to(u.dimensionless_unscaled, np.arange(3.)), lu2.to(lu2.physical_unit, np.arange(3.))) @pytest.mark.parametrize('other',", "4.)*u.Jy) lq2 = u.Magnitude(2.*u.Jy) assert np.all((lq1 > lq2) == np.array([True,", "test_uni...
[ "system_api_get_members_call(return_value): method_name = 'djconnectwise.api.SystemAPIClient.get_members' return create_mock_call(method_name, return_value) def system_api_get_member_image_by_photo_id_call(return_value): method_name", "def sales_api_get_opportunities_call(return_value, raised=None): method_name =...
[ "to the directory of pose file :param fivepoint: Whether to", "print(\"MSE Error: \", np.linalg.norm(estimated_coordinates - true_coordinates)) print(\"x: {}, y: {},", "255, 0)), 4) cv2.putText( trajectory, \"Actual Position:\", (140, 90), cv2.FONT_HERSHEY_SIMPLEX,", "Odometry Position:\", (30, 120), cv2.FONT...
[ "tensorflow as tf def get_train_data(train_dir, batch_size): train_images = np.load(os.path.join(train_dir, 'train_images.npy'))", "np import tensorflow as tf def get_train_data(train_dir, batch_size): train_images =", "train_images = np.load(os.path.join(train_dir, 'train_images.npy')) train_labels = np.load(o...
[ "model_name='carair_rbf_hinge_t-0') rbf_model.train() hinge_W = rbf_model.sess.run(rbf_model.params)[0] # Then load weights into", "np.load('G:/output/%s_inception_features_new_train.npz' % dataset_name) # train = DataSet(train_f['inception_features_val'], train_f['labels']) # test_f", "= dataset.find_distances...
[ "in enumerate(xid): count={} fo=open(data_path+'/'+f+'.asm') tot=0 a=-1 b=-1 d=-1 e=-1 for", "in count: cmd4g[i]=count[i]+cmd4g[i] del count cmd4gx={} for i in cmd4g:", "find_4g.py xid_train.p ../../data/train # xid_train.p is a list like ['loIP1tiwELF9YNZQjSUO',''....]", "data_path=sys.argv[2] xid=pickle.loa...
[]
[ "Operator), (r'(>=|<=|==|!=|' r'&&|\\|\\||' r'\\+=|.=|-=|\\*=|/=|%=|<<=|>>=|&=|\\|=|\\^=|' r'>>|<<|' r'\\+\\+|--|=>)', Operator), (r'[ \\t\\r]+', Text),", "Manager <http://www.riverbed.com/stingray>`_ .. versionadded:: 2.1 \"\"\" name = 'TrafficScript' aliases", "(r'\"', String, 'escapable-string'), (r'(0x[0-9a...
[ "not index._can_hold_na: pytest.skip(\"Skip na-check if index cannot hold na\") if", "first = index.copy().set_names(fname) second = index[1:].set_names(sname) intersect = first.intersection(second).sort_values() expected", "unique index if isinstance(index, RangeIndex): # RangeIndex cannot have duplicates", ...
[ "with_contact=with_contact), False) np.random.seed(42) if with_external_force: external_forces = [np.random.rand(6, nlp.model.nbSegment(), nlp.ns)]", "= np.random.rand(nlp.states.shape, nlp.ns) controls = np.random.rand(nlp.controls.shape, nlp.ns) params = np.random.rand(nlp.parameters.shape,", "nlp.control_typ...
[ "return [event_type for event_type, event in self.items if event.get_event_action() ==", "subscribe(SomeEvent) \"\"\" super().subscribe(obj=event) def knows(self, event_type): # pylint:disable=arguments-differ return super().knows(key=event_type)", "* CREATED * UPDATED * DELETED * RESUMED * COPIED", "on an ob...
[ "# convert dict to json by json.dumps() for body data.", "import * def test_f_login_andy(): url = \"http://central.orbits.local/rpc.AuthService/Login\" raw_payload = {\"name\":", "contents, e.g. status code. assert response.status_code == 200 # print", "payload = json.dumps(raw_payload) headers = {'Content-Ty...
[ "* q_l[1,:]) / (s[0,:] - s[1,:])) # Compute each family", "phi_l = q_l[0,:] * u_l**2 + 0.5 * g *", "cbar) * delta_h ) / cbar a2 = 0.5 *", "(-delta[1,:] + (ubar + cbar) * delta[0,:]) / cbar a2", "ubar-cbar s_index[2,:] = u_l + c_l s_index[3,:] = u_l -", "apdq = np.zeros( (num_eqn, num_rp) ) # Compute roe-a...
[ "False return True elif constant_type in (tuple, list): for element_value", "(tuple, list): for element_value in constant: if not isConstant(element_value): return", "key, value in iterItems(constant): result += getConstantWeight(key) result += getConstantWeight(value)", "if type(a) is dict: if len(a) != len(...
[ "is not None and \\ 'ResponseMetadata' in success_response[1]: # We", "threading.Lock() if response_parser_factory is None: response_parser_factory = parsers.ResponseParserFactory() self._response_parser_factory =", "governing permissions and limitations under the License. import os import", "before attemptin...
[ "small number). [1] This isn’t really the full picture, since", "the form of (use the correct numbers, do not round", "and those who know did not. This function should return", "Note: To aid in verification, the chickenpox_by_sex()['female'] value the autograder", "num_not_have_cpox_boy_injected ratio_girl ...
[ "open, high and close in their respective order. open.append(float(pd[start][1])) high.append(float(pd[start][2]))", "range(finish - start): # Below filtering is valid for eurusd.csv", "for x in range(len(close) - len(smb)): smb.append(smb[-1] + diff) fig", "z: # decision = \"buy\" sma = convolve_sma(close, 5...
[ "data_flag = False reader = open(file_path, \"r\") for line in", "in ['numeric', 'real', 'integer']: attribute_type = TornadoDic.NUMERIC_ATTRIBUTE attribute_value_range = []", "attributes_min_max[i][1] if elements[i] < min_value: min_value = elements[i] elif elements[i]", "attributes_min_max[i] = [min_value, ...
[ "import numpy as np from keras import backend as K", "import backend as K from evolution import Evolution from genome_handler", "GPUs Available: \", len(tf.config.list_physical_devices('GPU'))) K.set_image_data_format(\"channels_last\") #(x_train, y_train), (x_test, y_test) =", "= Evolution(genome_handler, da...
[ "en cada lado. for agent in self.schedule.agents: if agent.agent_type ==", "tienen más automóviles. count_left = 0 count_right = 0 #Loop", "agent.direction = (0, -1) elif row > height // 2", "self.model.height and position[0] >= 0 and position[1] >= 0: if", "1: return agent.light return True #Función para c...
[ "contents + '</style>')) else: # default to html. Anything else?", "for distributable packages, pkg_resources.resource_string is the # best way to", "content stored in a file to a jupyter notebook.\"\"\" import", "import resource_string from IPython.display import display, Javascript, HTML # Originally", "t...
[ "hub_client self._monitor = hub_monitor self._executing_program_label = QLabel() self._slot_spinbox = QSpinBox()", "%-12s %-10s\" % (i, decoded_name, sl['size'], modified, project, type)) print((\"Storage", "= PositionStatusWidget(status) self.motion_widget = MotionSensorWidget(status) self.program_widget = Pro...
[ "TaskList(ListView): model = Task context_object_name = 'tasks' class TaskDetail(DetailView): model", "model = Task context_object_name = 'task' class TaskCreate(CreateView): model =", "TaskDetail(DetailView): model = Task context_object_name = 'task' class TaskCreate(CreateView): model", "Create your views h...
[ "assert np.all(result >= (y - TOL)) assert np.all(result <= (y", "Dropout(input_op) tf_op = TensorflowConverter().visit(op) result_ = tf_op(x) assert isinstance(result_, tuple)", "np.array([3, 4]).astype(np.float32) op = Dropout(x) tf_op = TensorflowConverter().visit(op) result_ =", "* from dnnv.nn.operations...
[ "to instantiate a remote agent. The protocal is as follows:", "LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A", "THE USE OR OTHER DEALINGS IN # THE SOFTWARE. \"\"\"", "pid({os.getpid()}): Received interrupt signal.\" ) # Catch keyboard interrupt and", "for mod in modules: try: importlib.impor...
[ "(Minimum fixed monthly payment) Updated balance each month = (Monthly", "balance is not 0... while month <= 12 and updatedBalance", "12 months and while balance is not 0... while month", "Code Should Generate: ------------------- Lowest Payment: 440 Test Case 3:", "310 Test Case 2: balance = 4773 annualInt...
[ "for c, t in collections.Counter(s).most_common()) # V1 # IDEA :", "v return res ### Test case: s=Solution() assert s.frequencySort(['a','b','c','c']) ==", "V2' # Time: O(n) # Space: O(n) import collections class", "Solution(object): def frequencySort(self, s): return ''.join(c * t for c,", "return ''.join(...
[ "+ str(num_required) + \"\"\" ) { $(\"input[type=submit]\").removeAttr(\"disabled\"); } else {", "= 'worst' else: tag = '' html += '<th align=\"center\">%s<br>%s</th>'", "<td>Speaker %s: %s</td>\"\"\" % (speaker, example.target_lines[target_indices[1]]) html += \"\"\" <td>", "of radio buttons used for ranking...
[ "\"\"\" returns the parameter multiplied by a value @param mul", "= myclass(0) @endcode @endexample **FAQ** .. faqref:: :title: How to", ".. exref:: :title: an example of use Just for documentation", "first parameter \"\"\" self.pa = pa def get_value(self, mul): \"\"\"", "to add a question ? Just look a thi...
[ "= 1024 # Number of time steps num_ex = 10000", "\"dim\", \"Omega\", \"static_operators\", \"dynamic_operators\", \"noise_operators\", \"measurement_operators\", \"initial_states\", \"T\", \"M\", \"num_ex\",", "control Hamiltonian noise_operators = [0.5*Pauli_operators[3]] # noise Hamiltonian initial_states =",...
[]
[ "-*- coding: utf-8 -*- \"\"\" API definition module. \"\"\" from", ".resources.user import UserAuth, UserItem, UserList, UserFollow # Create an API-related", "from .resources.user import UserAuth, UserItem, UserList, UserFollow # Create an", "api = Api(api_bp) api.add_resource(UserList, '/users') api.add_reso...
[ "#!usr/bin/env python3 import itertools # itertools is a module that's", "infinite iterators # Joe # John # Mike # Joe", "John # Mike # Joe # John # 100 #", "function is true and then returns the rest of values", "python3 import itertools # itertools is a module that's not", "it is part of the standard li...
[ "self._endereco = str(endereco) self.__telefone = str(telefone) def imprimeNome(self): print(f\"Você pode", "nome, endereco, telefone): self.__codigo = int(codigo) self.nome = str(nome) self._endereco", "de {self.nome}.\") def __imprimeTelefone(self): print(f\"Você pode ligar para esta pessoa", "int(codigo) s...
[ "<filename>examples/plain_text_response.py from starlette.responses import PlainTextResponse async def serve(req): return PlainTextResponse(\"Hello", "from starlette.responses import PlainTextResponse async def serve(req): return PlainTextResponse(\"Hello World!\")" ]
[ "Record(self, rectype, message, error=error, **kwargs) self.write(record) pass def info(self, message,", ": bool, optional The argument is used to filter critical", "= f_code.co_name self.record(rectype, message, error=True, err_name=err_name, err_value=err_value, err_file=err_file, err_line=err_line, err_obj=e...
[ "Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose", "* 1024 STREAMING_DEFAULT_PART_SIZE = 10 * MEBIBYTE DEFAULT_PART_SIZE = 128", "2020, Oracle and/or its affiliates. All rights reserved. # This", "= 1024 * 1024 STREAMING_DEFAULT_PART_SIZE = 10 * MEBIBYTE DEFAULT_PART_...
[ "next_page = soup.find('a', text='Next ›').get('href') if next_page: yield response.follow(next_page, callback=self.parse)", "{'class': 'infinite-post'}) for post in posts: try: yield { 'image_url':", "Spider for MillardAyo.com import scrapy from bs4 import BeautifulSoup class", "= 'millardayo' allowed_urls =...
[ "return ( pcoll | beam.Filter( lambda elem, target: elem <=", "import apache_beam.transforms.combiners as combine from apache_beam.coders import StrUtf8Coder from apache_beam.pipeline", "the License. # # pytype: skip-file from __future__ import absolute_import", "apache_beam.runners.portability import expansi...
[ "sessionmaker from settings import DB_URI Session = sessionmaker(autocommit=False, autoflush=False, bind=create_engine(DB_URI))", "create_engine from sqlalchemy.orm import scoped_session from sqlalchemy.orm import sessionmaker from", "sqlalchemy.orm import scoped_session from sqlalchemy.orm import sessionmaker ...
[ "= tvm.gpu(0).compute_version else: if target is None or \"arch\" not", "'-arch=sm_xx' to your target.\" ) return False compute_version = target.attrs[\"arch\"]", "------- path : str Path to libdevice. \"\"\" cuda_path =", "to invoke nvcc compiler in the system\"\"\" from __future__ import", "Path to cuda r...
[ "Calculations.history[0] @staticmethod def get_calculation(num): \"\"\" get a specific calculation from", "\"\"\"clear the history of calculations\"\"\" Calculations.history.clear() return True @staticmethod def", "Multiplication from calc.calculations.division import Division class Calculations: \"\"\"Calculat...
[ "valores.append(valor) print(f'Foram digitados {len(valores)} números') valores.sort(reverse=True) print(f'Lista ordenada de forma", "digitados {len(valores)} números') valores.sort(reverse=True) print(f'Lista ordenada de forma decrescente: {valores}')", "print(f'O valor 5 foi digitado e está na {valores.index(...
[ "migrations.RenameField( model_name='transaction', old_name='authorityVerify', new_name='authority_verify', ), migrations.RenameField( model_name='transaction', old_name='failureReason', new_name='failure_reason', ),", "] operations = [ migrations.RenameField( model_name='transaction', old_name='authorityStart', ...
[ "from .bn import ABN, InPlaceABN, InPlaceABNWrapper, InPlaceABNSync, InPlaceABNSyncWrapper from .misc", ".misc import GlobalAvgPool2d from .residual import IdentityResidualBlock from .dense import", ".bn import ABN, InPlaceABN, InPlaceABNWrapper, InPlaceABNSync, InPlaceABNSyncWrapper from .misc import", "ABN,...
[ "None, False, True] ]: result = arr.filter(mask) assert result.equals(expected_drop) result", "5, 'b': 6}]), ] numerical_arrow_types = [ pa.int8(), pa.int16(), pa.int64(),", "OF ANY # KIND, either express or implied. See the", "('b', pa.int8())]), [ {'a': 1, 'b': 2}, None, {'a': 3,", "type=arrow_type) asser...
[ "noqa: E501 header_params = {} form_params = [] local_var_files =", "locals() for key, val in six.iteritems(params['kwargs']): if key not in", "noqa: E501 # verify the required parameter 'cluster' is set", "timestamps: :return: None If the method is called asynchronously, returns", "None If the method is ca...
[ "header = prefix + \"\\n\" header += prefix + nchar", "class.\"\"\" from openmdao.recorders.recording_iteration_stack import Recording from openmdao.solvers.solver import NonlinearSolver from", "system._check_child_reconf() rec.abs = 0.0 rec.rel = 0.0 self._solver_info.pop() def _mpi_print_header(self):", "mu...
[ "absl.testing import parameterized from tensorflow.contrib.data.python.ops import optimization from tensorflow.python.data.ops import", "x: x for x, predicate_1 in enumerate(filters): for y, predicate_2", "n: (n, x) tests.append(( \"Swap1\", [lambda x: (x, 42), swap],", "for predicate in predicates: if isinst...
[ "function if one exists. \"\"\" def __init__(self): self.channel = None", "self._cut.plot_append(int(to_x), int(to_y), parser.laser) else: new_cut() parser.position = position parser.header_write(self.data) cutcode", "0 self.distance_y = 0 if self.finish_state: # In finished all", "data self.operation = \"blo...
[ "MonitorMetric() obj._deserialize(item) self.Series.append(obj) self.Timestamp = params.get(\"Timestamp\") memeber_set = set(params.keys()) for", ":param Data: 健康得分以及异常扣分项。 :type Data: :class:`tencentcloud.dbbrain.v20210527.models.HealthScoreInfo` :param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的", "__init__(se...
[ "include in the requests. :type headers: dict :param status_code: HTTP", "= self.validate_redirect_uri(client_id, redirect_uri) if not is_valid_redirect_uri: return self._invalid_redirect_uri_response() # Check", "code self.discard_authorization_code(client_id, code) # Generate access tokens once all conditions...
[ "(w,h) a tuple for resizing the input images to the", "base_model='vgg16',#your feature map extractor model resorted_img_folder='resorted_data',#the folder for clustered images", "we can see, 21 may be the best cluster number", ") # #clustering for feature maps # m.imagecluster() #As we", "model import Imag...
[ "# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law", "# # Licensed under the Apache License, Version 2.0 (the", "compliance with the License. # You may obtain a copy", "an \"AS IS\" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF", "2.0 (the \"License\"); # you may not use th...
[ "over console cable but you can use underlaying method to", "def __repr__(self): return \"Executor serial: %s\" % (self.device) __str__ =", "to recognize a device with cisco like commands. \"\"\" def", "= parity self.stopbits = stopbits self.bytesize = bytesize self.timeout =", "0, \"\", \"\" def send(self,...
[ "(self >> 17) % 16 @property def process_id(self) -> int:", "number is incremented\"\"\" return self % 2048 @property def unix(self)", "always returned as strings in the HTTP API to prevent", "1420070400000. \"\"\" return self >> 22 @property def worker_id(self) ->", "bits in size (e.g. a uint64), they are ...