ngram
listlengths
0
67.8k
[ "-*- coding: utf-8 -*- import os import pytest import json from kafkacli.formatter import", "'{\"a\": \"s\", \"b\": 1}\\n' def test_print_idents(capsys): Formatter(indents=True).print(sampleJson) captured = capsys.readouterr() assert captured.out ==", "os import pytest import json from kafkacli.formatter import...
[ "django import forms from .models import Application class ApplicationForm(forms.ModelForm): class Meta: model =", "import forms from .models import Application class ApplicationForm(forms.ModelForm): class Meta: model = Application", "from django import forms from .models import Application class ApplicationFo...
[ "# Tests: vistprotocol unit test # # <NAME>, Tue Jan 11 10:19:23 PST", "Tue Jan 11 10:19:23 PST 2011 # ---------------------------------------------------------------------------- tapp = visit_bin_path(\"visitprotocol\") res =", "PST 2011 # -----------------------------------------------------------------------...
[ "> 0: if table[x][y-2] == black: return 1 return 0 black = libtcod.black", "elif direction == 4: if x - 2 <= 0: return 0 if", "* 2 + 1 SCREEN_WIDTH = nTiles SCREEN_HEIGHT = nTiles libtcod.console_set_custom_font(\"cp437_12x12.png\", libtcod.FONT_LAYOUT_ASCII_INROW) libtcod.console_init_root(SCREEN_WIDTH,", "P...
[ "under the Apache License, Version 2.0 (the \"License\"). You may not use this", "\"BatchSegmentJob,\", ], ) def test_resource_naming(klass, camel, dash, snake): assert klass().name.camel == camel assert", "implied. See the License for # # the specific language governing permissions and", "@pytest.mark.parame...
[ "Usage:\\n\\n % python gradefiles-send.py <###> <Fall|Spring> <YYYY> <task> <sender-username>\\n') exit() ##################################################################### ## Check", "string. from subprocess import Popen, PIPE # For sending email on linux. import", "## Script to send grade files by email to...
[ "model_name = 'model' if not os.path.exists(save_path): os.makedirs(save_path) save_path_full = os.path.join(save_path, model_name) saver.save(sess, save_path_full)", "reader = tf.train.NewCheckpointReader(ckpt.model_checkpoint_path) all_variables = list(reader.get_variable_to_shape_map().keys()) npy = dict(zip(a...
[ "range(0,pinSize): p = pin[i] if CurrentGpio[p]>degree[i]: update = -update for deg in range(CurrentGpio[p],degree[i],update):", "= [5,6,7,8] deg = [[80,50,100,70],[110,90,110,90]] select = [89,93,472,347,2, 34, 134, 1937, 1983, 1739,", "for i in range(0,15): r = select[i%len(select)]%4 print (' move ',r) chang...
[ "ForeignKey('languages.id'), nullable=False) ) written_association_table = Table( 'written_lang_association', Base.metadata, Column( 'translator_id', UUID, ForeignKey('translators.id'), nullable=False),", "Column, Text, Table, ForeignKey from sqlalchemy.orm import object_session from onegov.core.orm import Base f...
[ "KIND, either express or implied. # See the License for the specific language", "Unless required by applicable law or agreed to in writing, software # distributed", "the values from a const NodeDef as a numpy ndarray. Args: node_def: Const", "ValueError(\"No node named '%s' found in map.\" % name) return node...
[ "from . import register_classification_loss_fn from .. import BaseCriteria @register_classification_loss_fn(name=\"binary_cross_entropy\") class ClsBinaryCrossEntropy(BaseCriteria): \"\"\"Binary CE", "**kwargs ) -> Tensor: if target.dim() != prediction.dim(): target = F.one_hot(target, num_classes=prediction.shap...
[ "else: break return arr def main(): arr_input = [10, 5, 30, 1, 2,", "30, 1, 2, 5, 10, 10] a2 = insertion_sort(arr_input) print(a2) # Using the", "break return arr def main(): arr_input = [10, 5, 30, 1, 2, 5,", "for i in range(1, n): swap_index = i for j in range(i-1, -1,", "Algorithm:\"\"\" \"\"\"Implementa...
[ "indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: \"\"\"Top-level namespace", "OneSampleTTestDesign, TwoSampleTTestDesign, PairedTTestDesign, MultipleRegressionDesign) from .utils import (Analyze2nii, CalcCoregAffine, ApplyTransform, Reslice, ApplyInverseDeformation, ResliceToReference,", "DART...
[ "from all the training data. \"\"\" deltaBiasVectors, deltaWeightMatrices = self._backpropagate(inputs, expected) newSumBiasVectors =", "based on that set of training data, and add it to a set", "_evaluate(self, testData): \"\"\"Test the network with the specified test data and return the", "return the number...
[ "False, 'email': ['<EMAIL>'] } dag = DAG( 'etl_orders_7_days', schedule_interval='@hourly', catchup=False, default_args=default_args, description='Loads newly", "REFERENCES menu_items(id), category_id INTEGER REFERENCES categories(id) );''', dag=dag ) t2 = PostgresOperator( task_id='tuncate',", "dag=dag ) t3 = ...
[ "= { 'crust': 'thick', 'toppings': ['mushrooms', 'extra vegan cheese'] } # summarize the", "a \" + pizza['crust'] + \"-crust pizza\" + \"with the following toppings:\") for", "['mushrooms', 'extra vegan cheese'] } # summarize the order print(\"You ordered a \"", "print(\"You ordered a \" + pizza['crust'] + \"...
[ "produto? R$')) d = a - (a * 23 / 100) print('O produto", "print('O produto que custava R${:.2f}, na promoção de 23% de desconto vai custar:", "= float(input('Qual é o preço do produto? R$')) d = a - (a", "preço do produto? R$')) d = a - (a * 23 / 100)", "23 / 100) print('O produto que custava R${:.2f}, na ...
[ "def _populate_run_dir(submit_config: SubmitConfig, run_dir: str) -> None: # Copy all necessary files into", "in a computing cluster. # Compared to original StyleGAN implementation, we extend the", "time.time() run_func_obj = util.get_obj_by_name(submit_config.run_func_name) assert callable(run_func_obj) sig = ...
[ "Adaptive by default. :param grid_top: Distance between grid component and the top side", "container. :return: \"\"\" if self._chart is None: self._chart = chart self._chart._option.update(grid=[]) self._js_dependencies =", "not None: try: _xaxis[0].update(gridIndex=_index-1) _yaxis[0].update(gridIndex=_index-1...
[ "options and type(options) is list: return True return False else: if user_id and", "values uris\"\"\" if not valid_args(user_id, message, options): logging.warning(\"send links called with invalid args", "short_text, result in options: buttons.append({ \"type\": \"link\", \"text\": short_text, \"uri\": result}...
[ "import zipfile print(\"Extract\") zip_ref = zipfile.ZipFile(\"./asset.zip\", 'r') zip_ref.extractall(\".\") zip_ref.close() print(\"Load Model\") model=load_model(\"cifar-model.h5\") CIFAR_10_CLASSES=[\"Plane\",\"Car\",\"bird\",\"cat\",\"deer\",\"dog\",\"frog\",\"horse\",\"ship\",\"truck\"]", "<reponame>Sharkbyt...
[ "# Uncomment the next line to enable the admin: path('admin/', admin.site.urls), path('', include('blog.urls')),", "Add a URL to urlpatterns: path('blog/', include('blog.urls')) \"\"\" # Uncomment next two lines", "URL to urlpatterns: path('', views.home, name='home') Class-based views 1. Add an import: from", ...
[]
[ "\"*.png_large\", \"*.jpg_orig\"] file_list = list() for extension in extensions: file_list = file_list +", "for file in file_list: for extension in extensions: new_extension = extension.replace('*', '') if", "in extensions: file_list = file_list + glob.glob(extension) for file in file_list: for extension", "...
[ "1, \"no\": 0}, \"y\": {\"yes\": 1, \"no\": 0}} dataset.replace(cleanup_nums, inplace=True) dataset.head() dataset.dtypes dataset", "from sklearn.metrics import confusion_matrix cm = confusion_matrix(y_test, y_pred) target_names = ['NOT-sub', 'Subscribed'] print(classification_report(y_test,", "= clf_dt.fit(X_t...
[ "| [0]'.format( RouteTableTest._subnet_id_suffix(RouteTableTest.allowed_subnet_name) ), 'value': 'not-null' }, { 'type': 'value', 'key': 'length(properties.subnets)', 'op':", "KIND, either express or implied. # See the License for the specific language", "Unless required by applicable law or agreed to in writin...
[ "sanity check in order to improve runtime by eliminating the obvious exception errors.", "ArtifactTransactionHandler object. Args: namespace_prefix (str): The namepsace prefix of the transaction family \"\"\"", "state storage. Args: transaction (Transaction): The transaction pertaining the payload context (Stat...
[ "as f: self.data = json.load(f) for item in self.data: if (item['url'] is not", "json.load(f) for item in self.data: if (item['url'] is not None): yield scrapy.Request(url=item['url'], headers={'Referer':'http://www.google.com/'},", "self.data: if (item['url'] is not None): yield scrapy.Request(url=item['url'],...
[ "of all the lights in the LightSystem.\"\"\" raise NotImplementedError class LightGroup(ABC): @classmethod def", "return (hasattr(subclass, 'turn_on') and callable(subclass.turn_on) and hasattr(subclass, 'turn_off') and callable(subclass.turn_off) and hasattr(subclass, 'set_transition_time')", "class LightSyste...
[ "the punnet square in genetics we know thatt a donor #with blue eyes", "is the dominant hair color Daughter = Kids('Danielle', 'Smith', 'Brown' ) Son =", "Son = Family('Kevin', 'Smith', 'Brown') print(Daughter.eyes) print(Son.eyes) #with the kids being born it", "= first self.last = last self.hair = hair def ...
[ "DEPENDENCIES = ['mqtt'] LOCATION_TOPIC = 'owntracks/+/+' def setup_scanner(hass, config, see): \"\"\" Set up", "'Unable to parse payload as JSON: %s', payload) return if not isinstance(data, dict)", "topic.split('/') kwargs = { 'dev_id': '{}_{}'.format(parts[1], parts[2]), 'host_name': parts[1], 'gps': (data['...
[ "-1) # (batch_size, num_spans_to_keep, event_type_size + max_antecedents) candidate_antecedent_mention_scores = torch.cat([event_type_prior_scores, candidate_antecedent_mention_scores], -1) #", "[m['gold_label_spans'] for m in metadata] self._mention_f1_score(pred_label_spans_list, gold_label_spans_list, ) self._...
[ "move_to_new_state(current_state): global solutions_count, current_path if 7 in current_state: solutions_count += 1 else: #", "move_to_new_state(new_state) current_path.pop() # Fill bottle for i in range(3): if current_state[i] != CAPACITIES[i]:", "0]] CAPACITIES = (3, 5, 9) solutions_count = 0 def move_to_new_...
[ "ValueError(msg) LOG.exception('Failed registering rule from %s.', rule) else: registered_count += 1 return registered_count", "KIND, either express or implied. # See the License for the specific language", "Unless required by applicable law or agreed to in writing, software # distributed", "from pack \"%s\":...
[ "True}, } _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'display': {'key': 'display',", "columns class ReportConfigDefinition(msrest.serialization.Model): \"\"\"The definition of a report config. All required parameters must", "alerts results if there are any. :vartype next_link: str \"\"\" _valida...
[ "if not next_data: break compressed_chunks.append(c.compress(next_data)) compressed_chunks.append(c.finish()) decompressed = brotli.decompress(b''.join(compressed_chunks)) with open(one_compressed_file, 'rb') as", "d.decompress(compressed) assert uncompressed == s @pytest.mark.parametrize( \"params\", [ {\"mode\"...
[ "float): self._vol = Decimal(value) @property def vol_cur(self) -> Decimal: return self._vol_cur @vol_cur.setter def", "buy(self, value: float): self._buy = Decimal(value) @property def sell(self) -> Decimal: return self._sell", "high self.low = low self.avg = avg self.vol = vol self.vol_cur = vol_cur", "floa...
[ "p2 = 27038194053540661979045656526063 p3 = 26440615366395242196516853423447 n = p1*p2*p3 e = 3 c", "\"rb\").read().encode(\"hex\"), 16) # from User's Guide to PARI/GP, nth_root function sqrtnall = 'sqrtnall(x,n)={my(V,r,z,r2);r=sqrtn(x,n,&z);if(!z,error(\"Impossible", "c1: for y in c2: for z in c3: crt = chine...
[ "models.CharField(blank=True, max_length=70)), ('favourite_music', models.CharField(blank=True, max_length=70)), ('about', models.TextField(blank=True, max_length=300)), ('picture', models.ImageField(default='/profile_images/avatar.jpeg', upload_to='profile_images')), ('user', models.OneToOneField(on_delete=django....
[ "# # Licensed under the Apache License, Version 2.0 (the \"License\"); # you", "writing, software # distributed under the License is distributed on an \"AS IS\"", "loop_start_label = context.allocateLabel(\"loop_start\") if not statement.isStatementAborting(): loop_end_label = context.allocateLabel(\"loop_end\"...
[ "Реализуем для удобства отдельную СД, из методов необходимо: изменить # указанный бит на", "знать первые k простых чисел. Посчитаем их один раз в конструкторе BloomFilter #", "!= 8: _line = '0' * (8 - len(_line)) + _line array_str +=", "m = -(nlog2P) / ln2 (2 - основание), количество хеш-функций будет равно -...
[ "# Copyright (c) 2010 <NAME> # # Distributed under the terms of the", "= ctx.socket(zmq.SUB) s.connect(connect_to) s.setsockopt(zmq.SUBSCRIBE,'') sync(connect_to) start = time.clock() print \"Receiving arrays...\" for i", "time.clock() print \"Receiving arrays...\" for i in range(array_count): a = s.recv_pyobj(...
[ "extension loading again con.enable_load_extension(False) # example from SQLite wiki con.execute(\"create virtual table recipe", "loading again con.enable_load_extension(False) # example from SQLite wiki con.execute(\"create virtual table recipe using", "into recipe (name, ingredients) values ('broccoli stew', ...
[ "cluster_params.mode = 'sync' cluster_params.job = 'decoder' cluster_params.add_summary = False cluster_params.do_eval = True Update(cluster_params.controller)", "= random_seed model_cfg.is_inference = True if disable_packed_input: def _DisablePackedInput(task): if (_ParamExists(task, 'encoder') and", "Unless r...
[ "# Extracting the table name from and year from the given file path", "path[path.index(\".xls\")-4:path.index(\".xls\")] try: # Read the Excel spreadsheet df = pd.read_excel(path,sheet_name=t_name) # Get the", "# If there is no such data return an empty dataframe i_list =", "inplace = True) # Return the value...
[ "self.vocab.add_token_to_namespace(\"2\") self.vocab.add_token_to_namespace(\"3\") self.vocab.add_token_to_namespace(\"4\") def test_forward_calculates_bow_properly(self): params = Params({}) embedder = BagOfWordCountsTokenEmbedder.from_params(self.vocab, params=params) numpy_tensor", "numpy_tensor = np.array([[2...
[ "os.path.join(curr_path, \"cube_mesh\") if not Path(cmesh_odir).is_dir(): os.mkdir(cmesh_odir) cube_mesh_file = os.path.join(cmesh_odir, \"%s_cube.obj\" % (im_name)) c_verts,", "(im_name)) verts, faces = meshes_pred[-1].get_mesh_verts_faces(0) save_obj(save_file, verts, faces) logger.info(\"Predictions saved for ...
[ "self.voter = keras.Sequential() self.voter.add( layers.Dense( 1, activation=\"linear\", input_shape=(X.shape[1],), name=\"transform_to_vote\", ) ) self.voter.compile( loss=self.loss,", "= np.where(X == leaf_id)[0] label_counts = [ len(np.where(y[idxs_in_leaf, j] == 1)[0]) for j", "= [ len(np.where(y[idxs_in_le...
[ "tumblr_blog = 'soniaetjeremie' # replace with your tumblr account name without .tumblr.com tagsForTumblr", "tumblr account name without .tumblr.com tagsForTumblr = \"photobooth\" # change to tags you", "photo count between taking photos. If false, do not. False is faster. make_gifs", "max. camera_iso = 400 #...
[ "Group from accounts.models import EmailUser from shared.admin import ExportCsvMixin # no need for", "\"last_login\",), ) ordering = (\"last_name\", \"first_name\") readonly_fields = (\"date_joined\", \"last_login\",) list_per_page = 200", "have regular users and superusers admin.site.unregister(Group) @admin.r...
[ "the requested time range here since there # is no argument in the", "response: {response.text}') if 'data' not in json_ret: raise RemoteError(f'Coinbase json response does not", "# movement_category: Union[Literal['deposit'], Literal['withdrawal']] if 'type' in raw_data: # Then this should be", "tx: continue...
[ "project details. \"\"\" __all__ = [ 'DEREF_CONTROL_OID', 'DereferenceControl', ] import ldap.controls from ldap.controls", "compatibility with ASN.1 declaration in I-D AttributeList = AttributeDescriptionList class DerefSpec(univ.Sequence): componentType =", "class PartialAttribute(univ.Sequence): componentTyp...
[ "import csv def main(): with open(\"data.csv\") as i: #Open the data.csv file instances", "instances = i.readlines() #Write them into memory instances = [x.strip() for x in", "for fetching data path = \"emoji/%s/\" % name #Because of the clone function", "path = \"emoji/%s/\" % name files = os.listdir(path) f...
[ "2][j - 1] + 1) else: f[i % 2][j] = min(f[(i - 1)", "* (m + 1) for _ in range(2)] for j in range(m +", "if abs(len(s) - len(t)) > 1: return False n, m = len(s), len(t)", "@param s: a string @param t: a string @return: true if they are", "here if s == t: return False if abs(len(s) - len(t)) > 1:", "Solutio...
[ "%r', sig_num) tornado.ioloop.IOLoop.instance().stop() def run(): \"\"\" Starts any instantiated :class:`nsq.Reader` or :class:`nsq.Writer` \"\"\"", "( Error, unpack_response, decode_message, valid_topic_name, valid_channel_name, identify, subscribe, ready, finish, touch, requeue, nop,", "any instantiated :clas...
[ "def getLinearTimeTimeAndSize(graph): return get_data_LinearTime.getLinearTimeTimeAndSize(graph, linearTimeDir) def minProperty(graph, prop): oursequential = getOurTimeAndSizeSequential(graph)[prop] ourparallel =", "ourtimeParallel = [] akibasize = [] akibatime = [] nearlinearsize = [] nearlineartime", "def min...
[ "**kwargs): def decorator(method): if not hasattr(method, 'options'): method.options = [] method.options.append((args, kwargs)) return", "enumerate(args): if arg in self.commands.keys(): args.pop(index) return self._call_method(self.commands[arg], args) return self.help() def opt(self,", "= str(command.__doc__ ...
[ "save_path, filename = 'feat42_C4_N3') ########### Occipital electrodes ############# main_path = \"D:/1D_TimeSeries/raw_EEG/without artefact/train_test/\" fname_O_N3", "200, T = 30) X_fp2_REM,y_fp2_REM = Object_fp2_REM.FeatureExtraction() Object_fp2_REM.SaveFeatureSet(X = X_fp2_REM, y=y_fp2_REM, path =", ",mea...
[ "timestamp = datetime.datetime.now().strftime(\"%Y-%m-%d_%H-%M-%S\") if vr_log_path is None: vr_log_path = \"{}_{}_{}_{}.hdf5\".format(task, task_id, scene, timestamp)", ") log_writer.set_up_data_storage() satisfied_predicates_cached = {} post_task_steps = copy.deepcopy(POST_TASK_STEPS) physics_warming_steps = co...
[ "or slugify(unicode(label))) self.order = order def render_html(self): return format_html( u\"\"\"<li class=\"menu-{0}\"><a href=\"{1}\" class=\"{2}\">{3}</a></li>\"\"\",", "import slugify from django.utils.html import format_html class MenuItem(object): def __init__(self, label, url, name=None,", "url, name=No...
[ "django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations =", "serialize=False, verbose_name='ID')), ('created_at', models.DateTimeField(auto_now_add=True)), ('last_used_at', models.DateTimeField(null=T...
[ "my_collection import logger if __name__ == \"__main__\": logger.now().debug(\"debug1\") logger.now().debug(\"debug2\") logger.now().info(\"hello1\") logger.now().info(\"hello2\") logger.now().with_field(\"key\", \"val\").error(\"with", "from my_collection import logger if __name__ == \"__main__\": logger.now().d...
[ "port\", default=8270) args = parser.parse_args() server = RobotRemoteServer( Iperf3(), host=args.address, port=args.port ) server.serve()", "\"--address\", type=str, help=\"server listen address\", default='0.0.0.0') parser.add_argument( \"-p\", \"--port\", type=int, help=\"server listen port\",", "type=int, h...
[ "0.124 -0.170 -0.722 -0.79 -0.91 -2.09 # 1.42 -0.409 -0.525 2.155 -0.841 -0.19", "0.959 -0.009 -0.47 0.41 -0.52 # 0.49 0.170 0.124 -0.170 -0.722 -0.79 -0.91", "-0.09 0.944 0.160 0.271 -0.351 1.66 -2.32 -0.86 # -0.95 0.669 0.664 1.535", "0.32 1.27 # 0.17 0.657 0.970 -0.419 -1.413 -0.51 0.64 -1.25 # 0.58", "#...
[ "'_' # self._data = dict(mapping) self._data[key] = value def __getattr__(self, name): if hasattr(self._data,", "def __new__(cls, arg): if isinstance(arg, abc.Mapping): return super().__new__(cls) elif isinstance(arg, abc.MutableSequence): return [cls[item]", "abc.Mapping): return super().__new__(cls) elif isin...
[ "= copy.deepcopy(state) next_state.robot_position = TagTransitionModel.if_move_by(self._grid_map, state.robot_position, action) # If Tag action if isinstance(action,", "class TagTransitionModel(pomdp_py.TransitionModel): def __init__(self, grid_map, target_motion_policy): self._grid_map = grid_map self.target_mot...
[ "to clone the repository {package_name}; \" \"please make sure that you are authorized", "repository {package_name}; \" \"please make sure that you are authorized to clone repositories", "TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.", "the Software is # furnish...
[ "an arraycollection of MaskedArrays. Downside: this # strategy does not give a \"filled\"", "100 #print(repr(c)) ## second try: Subclass of ArrayCollection #c = MaskedArrayCollection([('age', a), ('weight',", "Tests for Masked ArrayCollections. # # First try: Simply make an arraycollection of", "of ArrayColle...
[ "{self.short()}...\" def words_num(self): return len(self.text.split()) def character_num(self): return len(self.text) def sentences_num(self): return len([s", "{self.short()}...\" return f\"[{self.label}] {self.short()}...\" def words_num(self): return len(self.text.split()) def character_num(self): return len(s...
[ "def test_generate_topright(self): board = StubBoard() board[C('h7')] = StubPiece(board, BLACK, C('h7')) bishop = self.get_bishop(board,", "results) self.assertTrue(all(correct)) def test_generate_topleft(self): board = StubBoard() board[C('c6')] = StubPiece(board, WHITE, C('c6')) bishop", "WHITE, C('c6')) bish...
[ "[] if hasattr(context, 'filter'): context.log.debug('Using filter [%s]' % context.filter) entries = context.ddb.list(context.filter) else:", "from lib.exceptions.workflow import EntryException @Action(ListStage.DATAGATHERING) def list_records(context, output): output = [] if hasattr(context,", "Action, ListSta...
[ "of each item to see if it is enabled in the request. If", "or no switches matched. :param action_request: The request object :type action_request: EnrichedActionRequest :return:", "(such as an actual integer) or a switch that provides an attribute `value`", "= None matched_action = None default_action = None...
[ "* SECRET_KEY = 'test' # SECURITY WARNING: don't run with debug turned on", "WARNING: don't run with debug turned on in production! DEBUG = True TEMPLATE_DEBUG", "['127.0.0.1'] DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': 'sqlite3.db', 'USER': '', 'PASSWORD':", "'NAME': 'sqlite3....
[ "bs.serialize(data) jserial = js.serialize(data) bdserial = bs.deserialize(bserial) jdserial = js.deserialize(jserial) print('bdserial', bdserial) ioS", "pulledObj = cc.pull(metaData='pickle') print('PulledObj', pulledObj, data) assert(pulledObj == data) rmTry = cc.removeTrace(data, asPickle=True)", "stream', i...
[ "# This file is part of dataframe. # # dataframe is free software:", "PURPOSE. See the # GNU General Public License for more details. # #", "itertools import chain import tabulate from ._dataframe_column import DataFrameColumn from ._dataframe_row import DataFrameRow", "by # the Free Software Foundation, eith...
[ "\"@java_debug_image_base//image\", \"@io_bazel_rules_docker//:optimized\": \"@java_image_base//image\", \"//conditions:default\": \"@java_image_base//image\", }) DEFAULT_JETTY_BASE = select({ \"@io_bazel_rules_docker//:fastbuild\": \"@jetty_image_base//image\", \"@io_bazel_rules_docker//:debug\": \"@jetty_debug_im...
[ "= AtomicOp( 'Sub', ('int32', 'uint32')) atomic_exch = AtomicOp( 'Exch', ('int32', 'uint32', 'uint64', 'float32'))", "``{self._name}`` function. Please refer to `Warp Shuffle Functions`_ for detailed explanation. .. _Warp", "computed. value: Represent the value to use for the specified operation. For the", "D...
[ "\" hello \" print(str1) print(len(str1)) # 去除两端的空格 print(str1.strip()) print(len(str1.strip())) # 去除左侧的空格 print(str1.lstrip()) print(len(str1.lstrip()))", "\" print(str1) print(len(str1)) # 去除两端的空格 print(str1.strip()) print(len(str1.strip())) # 去除左侧的空格 print(str1.lstrip()) print(len(str1.lstrip())) # 去除右侧的空格", ...
[ "rms from .util import moving_average from .util import moving_avg_conv from .util import moving_avg_fft", "import top_and_tail from .util import extrapolate from .util import nearest from .util import", "from .util import moving_avg_conv from .util import moving_avg_fft from .util import normalize from", "-*...
[ "DoorTypes.EXT_STANDARD: house = base.cr.doId2do.get(self.houseId) if not isinstance(house, DistributedHouse): self.notify.error('tried to use {0} as", "self.building def isInterior(self): if self.doorType == DoorTypes.INT_STANDARD: return 1 return 0 def getDoorNodePath(self):", "self.ignoreAll() def setZoneIdA...
[ "number of missing data N_obs = obs.shape[0] # number of observed data modelfile", "in range(0, nchains): chaininit = { 'delta': np.random.uniform(1, 3, size=ncohers), 'alpha': np.random.uniform(.5, 1.),", "data_winner = {'N_obs':N_obs, #Number of trial-level observations 'N_mis':N_mis, #Number of trial-level m...
[ "queue = Queue(queue_name) return render_template('rq_dashboard/dashboard.html', workers=Worker.all(), queue=queue, page=page, queues=Queue.all(), rq_url_prefix=url_for('.overview')) @dashboard.route('/job/<job_id>/cancel', methods=['POST']) @jsonify", "def overview(queue_name, page): if queue_name is None: # Sho...
[ "acquisition.fork_step import AcquisitionForkStep from acquisition.archive_step import AcquisitionArchiveStep from acquisition.listener import AcquisitionListener __all__ =", "acquisition.step import AcquisitionStep from acquisition.stats import AcquisitionStatsDClient from acquisition.move_step import Acquisitio...
[ "-*- # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors # For", "Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from", "2017, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see", "utf-8 -*- # Copyright (c) 2017, Fra...
[ "nn.Linear(np.prod(x), 512), nn.Linear(512,1024),BaseN.AdaptiveTanh(), nn.Linear(1024,256), BaseN.EigenLayer(256,self.output_shape[0],bias=False)) self.compile() class ConvNet2(BaseN.BaseNetwork): name=\"ConvNet2\" def __init__(self,input_shape,output_shape,owner_name=\"\"): super(ConvNet2,self).__init__(input_shap...
[ "= Field( ..., description=\"Icelandic text for analysis.\", min_length=1, max_length=_MAX_LENGTH, ) # Strange things", "ImportantWordsRequest(BaseModel): input_string: str = Field( ..., description=\"Icelandic text for analysis.\", min_length=1, max_length=_MAX_LENGTH, )", "analysis.\", min_length=1, max_lengt...
[ "/ 0 number = int(input(\"Enter a number: \")) print(number) # catch specific errors", "0 number = int(input(\"Enter a number: \")) print(number) # catch specific errors except", "\")) print(number) # catch specific errors except ZeroDivisionError as err: print(err) except ValueError:", "print(number) # catch...
[ "= np.asarray(y) z = np.asarray(z) t = np.asarray(t) y = np.pad(y, [(0, 0)]", "the signals is given by peaks positions even when they are summed. Parameters", "by `a`). t : int array (..., N,) The indices of the position", "for each signal. Broadcasted along non-last axis. \"\"\" y, a = _yz(y, a,", "signal ...
[ "super().__init__(0, 0, None, False) def used_mio(self, **kwargs): raise NotImplementedError # :nocov: def generate_mapping(self,", "* from amaranth.build import * from .common import PS8Resource, MIOSet __all__ = (", "from amaranth import * from amaranth.build import * from .common import PS8Resource, MIOSet",...
[ "from django.test import TestCase from django.urls import reverse from rest_framework import status from", "village.save() self.item = ListItem.objects.create( pk=1, dormroom=self.room, desc=\"Vask badet\", completed=True ) self.item.save() def test_job_resets_items(self):", "self.room = Dormroom.objects.create...
[ "MobileNetV3: weights = MobileNet_V3_Large_Weights.verify(weights) inverted_residual_setting, last_channel = _mobilenet_v3_conf(\"mobilenet_v3_large\", **kwargs) return _mobilenet_v3(inverted_residual_setting, last_channel, weights,", "ImageNet1K_V1 @handle_legacy_interface(weights=(\"pretrained\", MobileNet_V3_L...
[ "allow reverse() call inside app, for example when email # with verification link", "urlpatterns = [ re_path(r'^$', RegisterView.as_view(), name='rest_register'), re_path(r'^verify-email/$', VerifyEmailView.as_view(), name='rest_verify_email'), # This url is", "for example when email # with verification link is...
[ "if self.event is None: self.event = Event(shortname='CVPR2019') self.event.save() def test_animal_can_download(self): #print(get_html(self.url)) f =", "f = open('cvpr2019.bib', 'w') print(soup.title) bibtexs = soup.find_all(\"div\", attrs={\"class\": \"bibref\"}) #print(bibtexs) for bib", "from crawler.models ...
[ "# Extract and output tags of interest for item in doc.iterfind('channel/item'): title =", "title = item.findtext('title') date = item.findtext('pubDate') link = item.findtext('link') print(title) print(date) print(link) print()", "interest for item in doc.iterfind('channel/item'): title = item.findtext('title'...
[ "= [ path('', views.index, name='contact_index'), path('', views.index, name='lead_index'), path('contacts/', views.contacts, name='contacts'), path('leads/', views.leads,", "URL to urlpatterns: path('', views.home, name='home') Class-based views 1. Add an import: from", "Home 2. Add a URL to urlpatterns: path(...
[ ". import qtlib QT_LIB = qtlib.QT_LIB if QT_LIB == 'PyQt5': from PyQt5.uic import", "<gh_stars>0 from . import qtlib QT_LIB = qtlib.QT_LIB if QT_LIB == 'PyQt5': from", "from . import qtlib QT_LIB = qtlib.QT_LIB if QT_LIB == 'PyQt5': from PyQt5.uic", "import qtlib QT_LIB = qtlib.QT_LIB if QT_LIB == 'PyQt5': fr...
[ "# # Licensed under the Apache License, Version 2.0 (the \"License\"); # you", "writing, software # distributed under the License is distributed on an \"AS IS\"", "request') return status @app.errorhandler(500) def server_error(e): logging.exception('An error occurred during a request.') return", "KIND, eithe...
[]
[ "def find_by_sitename(cls, sitename): ''' Class method that takes a site name and returns", "Class method that takes a site name and returns the credential that matches", "[] def __init__(self,username,sitename,password): self.username = username self.password = password self.sitename = sitename def", "delete...
[]