prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>use env_logger::{fmt::Formatter, Builder}; use log::{LevelFilter, Record}; use std::{ env, io::{self, Write}, }; pub fn init(without_time: bool, debug_level: u64, bin_name: &str) { let mut log_builder = Builder::new(); log_builder.filter(None, LevelFilte...
log_builder.filter(Some(bin_name), LevelFilter::Debug);
<|file_name|>04_coffee.js<|end_file_name|><|fim▁begin|><|fim▁hole|> // Inserts seed entries return knex('coffee').insert([ { id: 1, name: 'Three Africas', producer_id: 1, flavor_profile: 'Fruity, radiant, creamy', varieties: 'Heirloom', desc...
exports.seed = function(knex, Promise) { // Deletes ALL existing entries return knex('coffee').del() .then(function () {
<|file_name|>AbstractJsonQueryBuilderFactory.java<|end_file_name|><|fim▁begin|>package com.senseidb.search.node.impl; import org.json.JSONObject; import com.senseidb.search.node.SenseiQueryBuilder; import com.senseidb.search.node.SenseiQueryBuilderFactory; import com.senseidb.search.req.SenseiQuery; import com.sensei...
<|file_name|>local.py<|end_file_name|><|fim▁begin|><|fim▁hole|>DEBUG = True TEMPLATE_DEBUG = True ALLOWED_HOSTS = [] DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': Path.join(BASE_DIR, 'db.sqlite3'), } } STATIC_URL = '/static/'<|fim▁end|>
__author__ = 'soporte' from .base import *
<|file_name|>TestAtom.cpp<|end_file_name|><|fim▁begin|>#include <pulsar/testing/CppTester.hpp> #include <pulsar/system/Atom.hpp> using namespace pulsar; TEST_SIMPLE(TestAtom){ CppTester tester("Testing the Atom class"); Atom H=create_atom({0.0,0.0,0.0},1); Atom H2=create_atom({0.0,0.0,0.0},1,1); ...
D=H4; tester.test_equal("assignment works",D,H);
<|file_name|>find.d.ts<|end_file_name|><|fim▁begin|>import { find } from "lodash";<|fim▁hole|><|fim▁end|>
export default find;
<|file_name|>Pattern_White_Space-regex.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
// Regular expression that matches all symbols with the `Pattern_White_Space` property as per Unicode v6.3.0: /[\x09-\x0D\x20\x85\u200E\u200F\u2028\u2029]/;
<|file_name|>usodiz.py<|end_file_name|><|fim▁begin|># uso dizionario come cache per evitare di calcolare sempre PEOPLE = [] def main(): """ devo far inserire name, city, salary come input e salvarli nel dizionario # 1.finche utente non smette.<|fim▁hole|> usa raw_input per chiedere le info all'utente #...
# 2.l'utente inserisce il nome
<|file_name|>helpers.js<|end_file_name|><|fim▁begin|>const constants = require('./constants.js'); const AWS = constants.AWS; const DYNAMODB_TABLE = constants.DYNAMODB_TABLE; const model = require('./model.json'); // a static copy of your model, used to suggest custom slot values module.exports = { 'randomArrayEle...
case 'x-fast.slower':
<|file_name|>controllers.py<|end_file_name|><|fim▁begin|># This file is part of Indico. # Copyright (C) 2002 - 2021 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from flask import jsonify, session from marshmall...
def _process(self):
<|file_name|>ManagedCamelContextTest.java<|end_file_name|><|fim▁begin|>/** * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file t...
mock = getMockEndpoint("mock:result");
<|file_name|>IfcSlabTypeImpl.java<|end_file_name|><|fim▁begin|>/** * Copyright (C) 2009-2014 BIMserver.org * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the ...
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from rest_framework.decorators import list_route from rest_framework.permissions import IsAuthenticated from rest_framework import viewsets from .models import User from .serializers import UserSerializer <|fim▁hole|> class UserViewSet(viewsets.ModelViewSet): query...
<|file_name|>yaml_generator.py<|end_file_name|><|fim▁begin|>from ll1_symbols import * YAML_OUTPUT = """terminals: %s non-terminals: %s eof-marker: %s error-marker: %s start-symbol: %s productions: %s table: %s""" YAML_OUTPUT_NO_TABLE = """terminals: %s non-terminals: %s eof-marker: %s error-marker: %s start-symbol: ...
for key, value in a_dict.items()])) if ll1_table: return YAML_OUTPUT % (convert_list_str(list(self.grammar.term)),
<|file_name|>AggregationStateSortedImpl.java<|end_file_name|><|fim▁begin|>/************************************************************************************** * Copyright (C) 2008 EsperTech, Inc. All rights reserved. * * http://esper.codehaus.org ...
} public void clear() { sorted.clear();
<|file_name|>serialization.py<|end_file_name|><|fim▁begin|># Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
return backend.load_traditional_openssl_pem_private_key( data, password )
<|file_name|>Solution.java<|end_file_name|><|fim▁begin|>package MultiplyStrings; /** * Created by gzhou on 6/1/15. */ public class Solution {<|fim▁hole|> public static String multiply(String num1, String num2) { String n1 = new StringBuilder(num1).reverse().toString(); String n2 = new StringBuild...
public static void main(String[] args) { System.out.println(multiply("123", "20")); }
<|file_name|>comp_delib_player.rs<|end_file_name|><|fim▁begin|>extern crate time; use {Player, MoveResult}; use game_manager::{Game, State}; use gdl::{Move, Score}; /// A bounded compulsive deliberation player. This should only be used for single player games pub struct CompDelibPlayer { depth_limit: u32, bes...
<|file_name|>crop.py<|end_file_name|><|fim▁begin|># crop.py # Derek Groenendyk # 2/15/2017 # reads input data from Excel workbook from collections import OrderedDict import logging import numpy as np import os import sys from cons2.cu import CONSUMPTIVE_USE # from utils import excel logger = logging.getLogger('crop...
raise else: lines = infile.readlines() infile.close()
<|file_name|>script-jumping.js<|end_file_name|><|fim▁begin|>(function () { window.onload = function () { var stage, layer, layerBG, ball, constants, onJump, isOver; stage = new Kinetic.Stage({ container: 'kinetic-co...
function moveBall() { if (ball.deltaX === 1) { ball.speedX -= ball.decelerationX;
<|file_name|>hashcode_tests.py<|end_file_name|><|fim▁begin|>import unittest from rdflib import URIRef from owlapy import model from owlapy.util.hashcode import HashCode from owlapy.vocab.owlfacet import OWLFacet class TestHashCode(unittest.TestCase): def test_hash_ontology(self): ont_id = model.OWLOnto...
ann_val1 = model.OWLLiteral('annotation 1') ann1 = model.OWLAnnotation(ann_prop1, ann_val1, [])
<|file_name|>web.py<|end_file_name|><|fim▁begin|># Copyright [2017] [name of copyright owner] # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # U...
def get_drug(self, events): medicamentos=[] for event in events['results']: medicamentos+=[event['patient']['drug'][0]['medicinalproduct']]
<|file_name|>schema-validation.ts<|end_file_name|><|fim▁begin|>/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *...
} throw new OperationAbortedException(); } return await sink.Forward(fileIn.Description, fileIn);
<|file_name|>WavpackContext.java<|end_file_name|><|fim▁begin|>package com.wavpack.decoder; import java.io.RandomAccessFile; /* ** WavpackContext.java ** ** Copyright (c) 2007 - 2008 Peter McQuillan ** ** All Rights Reserved. ** ** Distributed under the BSD Software License (see licen...
public boolean isError() { return error;
<|file_name|>metricsPlugin.ts<|end_file_name|><|fim▁begin|>/// /// Copyright 2015 Red Hat, Inc. and/or its affiliates /// and other contributors as indicated by the @author tags. /// /// Licensed under the Apache License, Version 2.0 (the "License"); /// you may not use this file except in compliance with the License. ...
<|file_name|>DlgPrefsTechDrawDimensionsImp.cpp<|end_file_name|><|fim▁begin|>/*************************************************************************** * Copyright (c) 2015 FreeCAD Developers * * Author: WandererFan <wandererfan@gmail.com> * * Based on...
<|file_name|>packet_jsmall_scanner.cpp<|end_file_name|><|fim▁begin|>/*************************************************************************** * Copyright (C) 2007, Sly Technologies, Inc * * Distributed under the Lesser GNU Public License (LGPL) * ********************...
/* scanner specific debug_ trace functions */ void debug_header(char *msg, header_t *header) { debug_trace(msg,
<|file_name|>Entity.java<|end_file_name|><|fim▁begin|>package com.ek.mobileapp.model; import java.io.Serializable; public abstract class Entity implements Serializable { protected int id; public int getId() { return id; }<|fim▁hole|> public String getCacheKey() { return cacheKey; ...
protected String cacheKey;
<|file_name|>test_link_aggregator.py<|end_file_name|><|fim▁begin|>import unittest import logging from domaincrawl.link_aggregator import LinkAggregator from domaincrawl.link_filters import DomainFilter, is_acceptable_url_scheme from domaincrawl.site_graph import SiteGraph from domaincrawl.util import URLNormaliz...
domain_filter = DomainFilter(base_domain, logger) site_graph = SiteGraph(logger) link_aggregator = LinkAggregator(logger, site_graph, link_mappers=[url_norm.normalize_with_domain], link_filters=[domain_filter.passes, is_acceptable_url_scheme])
<|file_name|>browser_features.test.ts<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2022 Snowplow Analytics Ltd, 2010 Anthon Pang * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met:<|fim▁hole|>...
* * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer.
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models from django.db.models.signals import post_delete, post_save from django.dispatch import receiver from django.utils.translation import ugettext_lazy as _ from jsonfield import JSONField from model_utils import Choices from model_utils.mode...
from crate.web.packages.models import Package, Release, ReleaseFile class Event(TimeStampedModel):
<|file_name|>assets.js<|end_file_name|><|fim▁begin|><|fim▁hole|>gulp.task('assets', function() { gulp.src(config.src) .pipe(gulp.dest(config.dst)); });<|fim▁end|>
var config = require('../config').assets, gulp = require('gulp');
<|file_name|>inline-link.js<|end_file_name|><|fim▁begin|>import { Link, LocationProvider } from '@reach/router'; import router from '@elementor/router'; import { arrayToClassName } from 'elementor-app/utils/utils.js'; import './inline-link.scss'; export default function InlineLink( props ) { const baseClassName = '...
<Link
<|file_name|>unstable_alloc.rs<|end_file_name|><|fim▁begin|>use alloc::raw_vec::RawVec; /// Alternative way to allocate memory, requiring unstable RawVec.<|fim▁hole|> raw.into_box() } }<|fim▁end|>
pub fn allocate_boxed_slice(cap: usize) -> Box<[u8]> { let raw = RawVec::with_capacity(cap); unsafe {
<|file_name|>sbwatchpoint.rs<|end_file_name|><|fim▁begin|>use super::*; cpp_class!(pub unsafe struct SBWatchpoint as "SBWatchpoint"); unsafe impl Send for SBWatchpoint {} impl SBWatchpoint { pub fn id(&self) -> WatchpointID { cpp!(unsafe [self as "SBWatchpoint*"] -> WatchpointID as "watch_id_t" { ...
debug_descr(f, |descr| {
<|file_name|>synaptic.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- """Make use of synaptic as backend.""" # Copyright (C) 2008-2010 Sebastian Heinlein <devel@glatzor.de> # Copyright (C) 2005-2007 Canonical # # Licensed under the GNU General Public License Version 2 # # This program is f...
return deferred
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # phaxio-python documentation build configuration file, created by # sphinx-quickstart on Sun Jan 8 20:17:15 2017. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuratio...
source_suffix = '.rst'
<|file_name|>syscall-latency.py<|end_file_name|><|fim▁begin|># perf script event handlers, generated by perf script -g python # Licensed under the terms of the GNU GPL License version 2 # The common_* event handler fields are the most useful fields common to # all events. They don't necessarily correspond to the 'com...
print "[%04d] %04d => %9uns" % (pid, syscall_id, latency) def raw_syscalls__sys_enter(event_name, context, cpu,
<|file_name|>image.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ //! Generic types for the handling of [images]. //! //! [images...
dest.write_str("-moz-element(#")?; serialize_identifier(&selector.to_string(), dest)?; dest.write_str(")") },
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>import os PACKAGE_NAME = 'pyflux' def configuration(parent_package='', top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration(PACKAGE_NAME, parent_package, top_path) config.add_subpackage('__check_build') co...
config.add_subpackage('garch') config.add_subpackage('gas') config.add_subpackage('gpnarx') config.add_subpackage('inference')
<|file_name|>mempool_spendcoinbase.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Stardust Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test spending coinbase transactio...
assert_equal(set(self.nodes[0].getrawmempool()), set())
<|file_name|>unary-minus-suffix-inference.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://w...
let g = 1; let g_neg: u16 = -g; println!("{}", g_neg);
<|file_name|>timeout.rs<|end_file_name|><|fim▁begin|>use std::error::Error; use std::fmt; use std::io; use futures::{Async, Future, Poll, Stream}; use future; use stream; use reactor::wheel::Timer; pub struct TimeoutError<T> { inner: T, } impl<T> TimeoutError<T> { #[inline] fn new(inner: T) -> Self { ...
false => match self.stream.take() {
<|file_name|>SignUpForm.tsx<|end_file_name|><|fim▁begin|>import { createStyles, FormControl, Input, InputAdornment, InputLabel, Theme, WithStyles, } from '@material-ui/core'; import Button from '@material-ui/core/Button'; import Divider from '@material-ui/core/Divider'; import IconButton from '@material-ui/core/...
</Typography> <Divider /> <form onSubmit={handleCreateUser}> <TextField
<|file_name|>runtests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """ runtests.py [OPTIONS] [-- ARGS] Run tests, building the project first. Examples::<|fim▁hole|> $ python runtests.py --ipython $ python runtests.py --python somescript.py $ python runtests.py --bench Run a debugger: $ gdb -...
$ python runtests.py $ python runtests.py -s {SAMPLE_SUBMODULE} $ python runtests.py -t {SAMPLE_TEST}
<|file_name|>ManifestRDFUtils.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Coypyright (C) 2010, University of Oxford # # Licensed under the MIT License. You may obtain a copy of the License at: # # http://www.opensource.org/licenses/mit-license.php # # Unless required by applicable law or agreed to in wri...
# rdfGraph.bind("oxds", oxds, override=True)
<|file_name|>jstool.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import os import sys import argparse import requests import subprocess import shutil class bcolors: HEADER = '\033[90m' OKBLUE = '\033[94m' OKGREEN = '\033[92m' WARNING = '\033[93m' FAIL = '\033[91m' ENDC = '\033[0m' class C...
if __name__ == "__main__": main(sys.argv[1:])
<|file_name|>locustfile.py<|end_file_name|><|fim▁begin|>from locust import HttpLocust, TaskSet, task class WebsiteTasks(TaskSet): @task def page1(self): self.client.get("/sugestoes-para/6a-feira-da-quarta-semana-da-pascoa/") @task def page2(self): self.client.get("/sugestoes-para/5a-f...
<|file_name|>bg_BG.js<|end_file_name|><|fim▁begin|>OC.L10N.register( "updatenotification", { "Update notifications" : "Обновяване на известията", "{version} is available. Get more information on how to update." : "{version} е излязла. Прочетете повече как да обновите до нея. ", "Updated channel" : "...
"Show changelog" : "Показване на доклада с промени", "Your version is up to date." : "Вие разполагате с най-новата версия.", "Checked on %s" : "Проверено на %s", "Update channel:" : "Обновяване на канал:",
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.http import StreamingHttpResponse, HttpResponseServerError from download_service.zipbuilder import DDSZipBuilder, NotFoundException, NotSupportedException from django.contrib.auth.decorators import login_required from download_service.utils import make_clie...
except NotFoundException as e: raise Http404(str(e)) except NotSupportedException as e: return HttpResponseServerError(content=str(e))
<|file_name|>cronjob.go<|end_file_name|><|fim▁begin|>/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless...
return c.client.Delete(). Namespace(c.ns). Resource("cronjobs").
<|file_name|>Entry.js<|end_file_name|><|fim▁begin|>'use strict';<|fim▁hole|>import shortid from 'shortid'; const EntrySchema = new Schema({ _id: { type: String, unique: true, default: shortid.generate }, stepRef: { type: String, ref: 'Step' }, name: String, value: String, dateCreated: { type: Date, default: ...
import { Schema } from 'mongoose';
<|file_name|>tiledb_ls.cc<|end_file_name|><|fim▁begin|>/** * @file tiledb_list.cc * * @section LICENSE * * The MIT License * * @copyright Copyright (c) 2016 MIT and Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documenta...
tiledb_ctx, // Context argv[1], // Parent directory dirs, // Directories dir_types, // Directory types
<|file_name|>test_attachwatcher.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import os import shutil from tempfile import mkdtemp import wx from outwiker.core.attachment import Attachment from outwiker.core.tree import WikiDocument from outwiker.pages.text.textpage import TextPageFactory from outwiker.cor...
watcher.clear() self.assertEqual(self._eventCount, 0) def test_race_02(self):
<|file_name|>shared.service.ts<|end_file_name|><|fim▁begin|>import { Injectable, ViewContainerRef, ComponentFactoryResolver, Output, EventEmitter } from '@angular/core'; import { Util } from './util/util'; @Injectable() export class SharedService { _util: Util; @Output() sendmsg: EventEmitter<any> = new EventEmi...
<|file_name|>settings.py<|end_file_name|><|fim▁begin|>""" Django settings for sparta project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside ...
# Database # https://docs.djangoproject.com/en/1.6/ref/settings/#databases
<|file_name|>checkwholepdb.py<|end_file_name|><|fim▁begin|># Test which PDB entries error on PDB/mmCIF parsers # Writes output to a file labelled with the week import os from datetime import datetime from math import ceil<|fim▁hole|>start = datetime.now() basedir = "." pdbl = PDBList() pdblist = pdbl.get_all_entries()...
from Bio.PDB import PDBList from Bio.PDB.PDBParser import PDBParser from Bio.PDB.MMCIFParser import MMCIFParser
<|file_name|>imageVisual.ts<|end_file_name|><|fim▁begin|><|fim▁hole|> * Power BI Visualizations * * Copyright (c) Microsoft Corporation * All rights reserved. * MIT License * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation file...
/*
<|file_name|>SingleSourceHelperImpl.java<|end_file_name|><|fim▁begin|>package org.csstudio.swt.xygraph.util; import org.csstudio.swt.xygraph.figures.XYGraph; import org.eclipse.draw2d.FigureUtilities; import org.eclipse.draw2d.SWTGraphics; import org.eclipse.draw2d.geometry.Dimension; import org.eclipse.draw2d.g...
}
<|file_name|>lru_cache_test.py<|end_file_name|><|fim▁begin|># Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.ap...
from tensorflow.python.framework import ops from tensorflow.python.ops import array_ops
<|file_name|>block_contact.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
../../../../../../../../share/pyshared/papyon/service/AddressBook/scenario/contacts/block_contact.py
<|file_name|>ImportVmModel.java<|end_file_name|><|fim▁begin|>package org.ovirt.engine.ui.uicommonweb.models.vms; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import org.ovirt.engine.core.common.businessentities.DiskImage; import org.o...
AsyncDataProvider.GetTemplateDiskList(new AsyncQuery(this, new INewAsyncCallback() { @Override public void OnSuccess(Object target, Object returnValue) {
<|file_name|>InteractionBuilder.py<|end_file_name|><|fim▁begin|>import sys, string import os.path import unique import export import gene_associations import traceback import time ################# Parse directory files def filepath(filename): fn = unique.filepath(filename) return fn def read_directory(sub_d...
<|file_name|>defaults.py<|end_file_name|><|fim▁begin|>__author__ = 'Artur Barseghyan <artur.barseghyan@gmail.com>' __copyright__ = 'Copyright (c) 2013 Artur Barseghyan' __license__ = 'GPL 2.0/LGPL 2.1' __all__ = ('FIT_METHOD_CROP_SMART', 'FIT_METHOD_CROP_CENTER', 'FIT_METHOD_CROP_SCALE', 'FIT_METHOD_FIT_WIDT...
) FIT_METHODS_CHOICES_WITH_EMPTY_OPTION = [('', '---------')] + list(FIT_METHODS_CHOICES)
<|file_name|>waypointMaps.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python """ Copyright 2012 Paul Willworth <ioscode@gmail.com> This file is part of Galaxy Harvester. Galaxy Harvester is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as publishe...
GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License
<|file_name|>test_cmdparse.py<|end_file_name|><|fim▁begin|>import pickle import pytest from doit.cmdparse import DefaultUpdate, CmdParseError, CmdOption, CmdParse class TestDefaultUpdate(object): def test(self): du = DefaultUpdate() du.set_default('a', 0) du.set_default('b', 0) ...
<|file_name|>ajax.py<|end_file_name|><|fim▁begin|># coding=utf-8 import os from __init__ import * import traceback, cStringIO, re from flask import current_app from werkzeug.datastructures import FileStorage from server import user_server, article_server, status_server, form, \ account_server, news_server, resource...
# @accepted methods: [post]
<|file_name|>cmac.py<|end_file_name|><|fim▁begin|># This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function from cryptography impor...
digest = self._ctx.finalize() self._ctx = None return digest
<|file_name|>mixins.py<|end_file_name|><|fim▁begin|>import warnings from xigt.consts import ( ID, TYPE, ALIGNMENT, CONTENT, SEGMENTATION ) from xigt.errors import ( XigtError, XigtStructureError ) from xigt.ref import id_re # list.clear() doesn't exist in Python2, but del list[:] has other...
<|file_name|>variables_b.js<|end_file_name|><|fim▁begin|>var searchData= [<|fim▁hole|>];<|fim▁end|>
['neighbours',['neighbours',['../struct_parser_1_1_cell_atom_grammar.html#a6367dce3041506f4112c82e2ba5998a9',1,'Parser::CellAtomGrammar']]], ['newgrid',['newGrid',['../struct_compiler_1_1_state.html#a3a949d5132b7854fee15d6d13344652c',1,'Compiler::State']]]
<|file_name|>the_if.rs<|end_file_name|><|fim▁begin|>// // closure // see https://rustbyexample.com/fn/closures.html // fn _if<T, F1, F2>(cond: bool, mut then: F1, mut els: F2) -> T where F1: FnMut() -> T, F2: FnMut() -> T { if cond { then() } else { els() } } #[test] fn test() {<|fim▁hole|><|fim▁e...
assert!(_if(true, || 1, || 2) == 1); }
<|file_name|>subprocess.py<|end_file_name|><|fim▁begin|># subprocess - Subprocesses with accessible I/O streams # # For more information about this module, see PEP 324. # # Copyright (c) 2003-2005 by Peter Astrand <astrand@lysator.liu.se> # # Licensed to PSF under a Contributor Agreement. # See http://www.python.org/2....
file handle as for stdout.
<|file_name|>borrowck-struct-update-with-dtor.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or //...
} fn g(s0:T) {
<|file_name|>_nodeexception.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright 2017 IBM RESEARCH. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.<|fim▁hole|># # http://www.apache.org/license...
# You may obtain a copy of the License at
<|file_name|>ImcClientSocket.java<|end_file_name|><|fim▁begin|>package pt.lsts.imc; import java.io.IOException; import java.net.URI; import java.util.concurrent.Future; import org.eclipse.jetty.websocket.api.Session; import org.eclipse.jetty.websocket.api.annotations.OnWebSocketConnect; import org.eclipse.jetty.webso...
import org.eclipse.jetty.websocket.api.annotations.WebSocket; import org.eclipse.jetty.websocket.client.ClientUpgradeRequest;
<|file_name|>settings.py<|end_file_name|><|fim▁begin|>""" Django settings for testproject project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths in...
<|file_name|>actionTypes.js<|end_file_name|><|fim▁begin|><|fim▁hole|>export const CREATE_COURSE = 'CREATE_COURSE';<|fim▁end|>
<|file_name|>borrowck-pat-by-move-and-ref.rs<|end_file_name|><|fim▁begin|>// Test that `ref mut? @ pat_with_by_move_bindings` is prevented. fn main() { struct U; // Prevent promotion. fn u() -> U { U } fn f1(ref a @ b: U) {} //~^ ERROR cannot move out of value because it is borrowed ...
//~^ ERROR cannot move out of value because it is borrowed
<|file_name|>issue-10806.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.or...
use {};
<|file_name|>dbwrapper_tests.cpp<|end_file_name|><|fim▁begin|>// Copyright (c) 2012-2016 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "dbwrapper.h" #include "uint256.h" #include "random.h"...
// Call the destructor to free leveldb LOCK delete dbw;
<|file_name|>BasicTest.java<|end_file_name|><|fim▁begin|>/** * Copyright © 2013 enioka. All rights reserved * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/li...
} @Test
<|file_name|>plot_cluster_iris.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= K-means Clustering ========================================================= The plots display firstly what a K-means algorithm would yield using three...
# Plot the ground truth fig = pl.figure(fignum, figsize=(4, 3)) pl.clf()
<|file_name|>item-handler.ts<|end_file_name|><|fim▁begin|>import { useCallback } from 'react'; import { IUploadItemProps, IUploadFileItem } from '../types'; import { useEventCallbackRef } from '../../utils/hooks/useEventCallbackRef'; <|fim▁hole|>export function useItemHandler<UPLOAD_ITEM extends IUploadFileItem>( pr...
<|file_name|>i_before_e_except_after_c.rs<|end_file_name|><|fim▁begin|>// http://rosettacode.org/wiki/I_before_E_except_after_C #[cfg(not(test))] use std::fs::File; #[cfg(not(test))] use std::io::Read; #[cfg(not(test))] use std::path::Path; enum MatchState { Nothing, //Nothing of interest seen so far C, ...
(MatchState::E, 'i') => {saw_ei = true; MatchState::Nothing}, (_, 'i') => MatchState::I,
<|file_name|>SpecLoginRegisterCloudRequestPane.js<|end_file_name|><|fim▁begin|>require([ 'app/LoginRegisterCloudRequestPane', 'dojo/dom-construct', 'dojo/query' ], function( WidgetUnderTest, domConstruct, query ) { describe('app/LoginRegisterCloudRequestPane', function() { var wi...
expect(widget.validate('aB1&').result).toEqual(false); }); it('should have one uppercase letter', function() { expect(widget.validate('aB1234$&').result).toEqual(true);
<|file_name|>MaterialSplitPanelTest.java<|end_file_name|><|fim▁begin|>/* * #%L * GwtMaterial * %% * Copyright (C) 2015 - 2017 GwtMaterialDesign * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the...
public void testStructure() { // UiBinder // given
<|file_name|>Resolver.java<|end_file_name|><|fim▁begin|>/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under ...
/** * Resolver abstract class.
<|file_name|>bitcoin_hi_IN.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="hi_IN" version="2.1"> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About Stepcoin</source> <translation type="unfi...
<|file_name|>greedy.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright (c) 2016 Jérémie DECOCK (http://www.jdhp.org) # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without...
return choosen_action
<|file_name|>IntegrationRuntimeState.java<|end_file_name|><|fim▁begin|>/** * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for * license information. * * Code generated by Microsoft (R) AutoRest Code Generator. */ package com.micro...
import java.util.Collection; import com.fasterxml.jackson.annotation.JsonCreator;
<|file_name|>byte.py<|end_file_name|><|fim▁begin|>def hamming_distance(bytes1, bytes2): distance = 0 for b1, b2 in zip(bytes1, bytes2): xored = b1^b2 distance += sum(1 for n in range(8) if (xored >> n) & 0x01) <|fim▁hole|><|fim▁end|>
return distance
<|file_name|>res_config_settings.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details.<|fim▁hole|>from odoo import api, fields, models class ResConfigSettings(models.TransientModel): _inherit = "res.config.settings" google_drive_aut...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2011 Domsense srl (<http://www.domsense.com>)<|fim▁hole|># Copyright (C) 2011-15 Agile Business Group sagl (<http://www.agilebg.com>) # # ...
<|file_name|>exception.py<|end_file_name|><|fim▁begin|># Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2010, Eucalyptus Systems, Inc. # All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files ...
import boto
<|file_name|>strings.js<|end_file_name|><|fim▁begin|>define({ "unit": "Jedinica", "style": "Stil", "dual": "dvostruki", "english": "engleski", "metric": "metrički", "ruler": "ravnalo",<|fim▁hole|> "separator": "Prikaži razdjelnik tisućica" });<|fim▁end|>
"line": "linija", "number": "broj", "spinnerLabel": "Zaokruži broj mjerila na: ", "decimalPlace": "decimalno mjesto",
<|file_name|>HistoryUpdate.java<|end_file_name|><|fim▁begin|>/****************************************************************************** * Copyright (C) 2010-2016 CERN. All rights not expressly granted are reserved. * * This file is part of the CERN Control and Monitoring Platform 'C2MON'. * C2MON is free soft...
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
<|file_name|>generate-messages-header.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # # Copyright (C) 2010 Apple Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions ...
import webkit.messages def main(argv=None):
<|file_name|>database.py<|end_file_name|><|fim▁begin|>from flask.ext.sqlalchemy import SQLAlchemy db = SQLAlchemy()<|fim▁hole|><|fim▁end|>
from saef_app.core import models
<|file_name|>flipclock2.js<|end_file_name|><|fim▁begin|>/* Base.js, version 1.1a Copyright 2006-2010, Dean Edwards License: http://www.opensource.org/licenses/mit-license.php */ var Base = function() { // dummy }; Base.extend = function(_instance, _static) { // subclass "use strict"; var extend = Base.proto...
<|file_name|>creator.d.ts<|end_file_name|><|fim▁begin|>/** !#en The main namespace of Cocos2d-JS, all engine core classes, functions, properties and constants are defined in this namespace. !#zh Cocos 引擎的主要命名空间,引擎代码中所有的类,函数,属性和常量都在这个命名空间中定义。 */ declare module cc { /** !#en Init Debug setting. !#zh 设置调试模式。 */ expo...
@param subst JavaScript objects with which to replace substitution strings within msg. This gives you additional control over the format of the output.