prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>glusterfs.go<|end_file_name|><|fim▁begin|>/* Copyright 2015 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 Unle...
} if err != nil { glog.Errorf("failed to create endpoint: %v", err)
<|file_name|>day5.go<|end_file_name|><|fim▁begin|>package main import ( "crypto/md5" "flag" "fmt" "log" "os" "runtime/pprof" "strconv" "sync" ) var prefix = []byte{0x6f, 0x6a, 0x76, 0x74, 0x70, 0x75, 0x76, 0x67} var cpuprofile = flag.String("cpuprofile", "", "write cpu profile to file") func find(l int) { c...
var wg sync.WaitGroup out := make(chan []byte, 2) // Start an output goroutine for each input channel in cs. output
<|file_name|>bayesian.rs<|end_file_name|><|fim▁begin|>// Copyright 2016 Johannes Köster. // Licensed under the MIT license (http://opensource.org/licenses/MIT) // This file may not be copied, modified, or distributed // except according to those terms. //! Utilities for Bayesian statistics. use itertools::Itertools; ...
/// A vector of expected FDRs in the same order as the given PEPs. pub fn expected_fdr(peps: &[LogProb]) -> Vec<LogProb> { // sort indices let sorted_idx =
<|file_name|>analyzer.py<|end_file_name|><|fim▁begin|># Copyright (C) 2019 Fassio Blatter from stopeight import analyzer version=analyzer.version from stopeight.util.editor.data import ScribbleData <|fim▁hole|> from stopeight.matrix import Vectors from stopeight.analyzer import legal_segments return legal_s...
def legal_segments(data):
<|file_name|>cell-does-not-clone.rs<|end_file_name|><|fim▁begin|>// Copyright 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...
<|file_name|>TestRbacDeprecated.java<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2010-2017 Evolveum * * 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...
return ROLE_GOVERNOR_DEPRECATED_FILE; } @Override
<|file_name|>libaio.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import os from autotest.client import utils version = 1 def setup(tarball, topdir): srcdir = os.path.join(topdir, 'src') utils.extract_tarball_to_dir(tarball, srcdir) os.chdir(srcdir) utils.system('patch -p1 < ../00_arches.patch') ...
# now grabbing from debian # http://ftp.debian.org/debian/pool/main/liba/libaio/libaio_0.3.106.orig.tar.gz # architecture patch from here # http://git.hadrons.org/?p=debian/pkgs/libaio.git;a=tree;f=debian/patches
<|file_name|>client.js<|end_file_name|><|fim▁begin|>"use strict"; module.exports = { delegates: { im_too_lazy: function() { $C("button", { name: "my first button" }, function(btn) { $("#button_holder").empty(); // extra<|fim▁hole|> btn.prependTo($("#button_holder")); ...
<|file_name|>FormCreateRequest.java<|end_file_name|><|fim▁begin|>/** * Copyright 2017, 2018, 2019, 2020 Stephen Powis https://github.com/Crim/pardot-java-client * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to...
return this; }
<|file_name|>action_log.py<|end_file_name|><|fim▁begin|># Copyright 2014 Mirantis, Inc. # # 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/...
class ActionLog(NailgunObject):
<|file_name|>destroy.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import click from aeriscloud.cli.helpers import standard_options, Command @click.command(cls=Command) @standard_options(start_prompt=False) def cli(box):<|fim▁hole|> if __name__ == '__main__': cli()<|fim▁end|>
""" Destroy a box """ box.destroy()
<|file_name|>test_analytic_dimension.py<|end_file_name|><|fim▁begin|># Copyright 2019 Ecosoft Co., Ltd (http://ecosoft.co.th/) # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html) from odoo.exceptions import ValidationError from odoo.addons.analytic_tag_dimension.tests.test_analytic_dimension import (...
# Mock data for testing model dimension, by_sequence with fitered vals = {
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # Copyright © 2012 - 2015 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <http://weblate.org/> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License a...
<|file_name|>TMXTiledMapArtifactFixerTest.java<|end_file_name|><|fim▁begin|>package org.anddev.andengine.entity.layer.tiled.tmx; import static junit.framework.Assert.assertEquals; import java.io.File; import org.junit.Test; /** * @author Nicolas Gramlich * @since 21:21:51 - 28.07.2010 */ public class TMXTiledMap...
}
<|file_name|>mtl.rs<|end_file_name|><|fim▁begin|>// Copyright 2017 GFX Developers // // 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/LICENS...
pub map_ks: Option<String>, pub map_ke: Option<String>, pub map_ns: Option<String>,
<|file_name|>selectionConfig.js<|end_file_name|><|fim▁begin|>/*jshint unused:false */ var dojoConfig = { async: 1,<|fim▁hole|> layers: {} }, packages: [ { name: 'oe_dojo', location: '..' } ] };<|fim▁end|>
cacheBust: 0, 'routing-map': { pathPrefix: '',
<|file_name|>raw.rs<|end_file_name|><|fim▁begin|>use std::borrow::Cow; use std::fmt; use http::buf::MemSlice; /// A raw header value. #[derive(Clone, PartialEq, Eq)] pub struct Raw(Lines); impl Raw { /// Returns the amount of lines. #[inline] pub fn len(&self) -> usize { match self.0 { ...
<|file_name|>test_config_flow.py<|end_file_name|><|fim▁begin|>"""Test the Balboa Spa Client config flow.""" from unittest.mock import patch from homeassistant import config_entries, data_entry_flow from homeassistant.components.balboa.const import CONF_SYNC_TIME, DOMAIN from homeassistant.config_entries import SOURCE_...
with patch( "homeassistant.components.balboa.config_flow.BalboaSpaWifi.connect", new=BalboaMock.connect,
<|file_name|>Permission.java<|end_file_name|><|fim▁begin|>package com.app.annotation.aspect; /** * Created by baixiaokang on 17/1/31. */<|fim▁hole|>import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Retent...
<|file_name|>visit.py<|end_file_name|><|fim▁begin|># # Copyright (C) 2014 Jonathan Finlay <jfinlay@riseup.net> # # 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 versio...
<|file_name|>courseware_index.py<|end_file_name|><|fim▁begin|>""" Code to allow module store to interface with courseware index """ from __future__ import absolute_import from abc import ABCMeta, abstractmethod from datetime import timedelta import logging import re from six import add_metaclass from django.conf impor...
course - course object from which to take properties, locate about information """ searcher = SearchEngine.get_search_engine(cls.INDEX_NAME)
<|file_name|>NoteSuppressedWarnings.java<|end_file_name|><|fim▁begin|>/* * FindBugs - Find bugs in Java programs * Copyright (C) 2003,2004 University of Maryland * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published b...
else for(int i = 0; i < suppressedWarnings.length; i++) suppressWarning((String)suppressedWarnings[i]); }
<|file_name|>manager.js<|end_file_name|><|fim▁begin|>/* Copyright (c) 2004-2008, The Dojo Foundation All Rights Reserved. Available via Academic Free License >= 2.1 OR the modified BSD license. see: http://dojotoolkit.org/license for details<|fim▁hole|> if(!dojo._hasResource["dijit._base.manager"]){ dojo._hasResour...
*/
<|file_name|>admin.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # This technical data was produced for the U. S. Government under Contract No. W15P7T-13-C-F600, and # is subject to the Rights in Technical Data-Noncommercial Items clause at DFARS 252.227-7013 (FEB 2012) from reversion.admin import VersionAdm...
model = Feedback list_display = ['name', 'email', 'topic', 'message'] save_as = True
<|file_name|>feature-gate-prelude_import.rs<|end_file_name|><|fim▁begin|>#[prelude_import] //~ ERROR `#[prelude_import]` is for use by rustc only use std::prelude::v1::*; <|fim▁hole|><|fim▁end|>
fn main() {}
<|file_name|>setup.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from setuptools import setup from setuptools import find_packages version = '0.1' shortdesc = "Klarna Payment for bda.plone.shop" setup( name='bda.plone.klarnapayment', version=version, description=shortdesc, classifiers=[ 'Enviro...
import os
<|file_name|>saluki.js<|end_file_name|><|fim▁begin|>'use strict'; function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error);...
return function () { var _ref = _asyncToGenerator(function* (ctx, next) { var url = ctx.url; ctx.services = services;
<|file_name|>surface.py<|end_file_name|><|fim▁begin|>import numpy as np class Surface(object): def __init__(self, image, edge_points3d, edge_points2d): """ Constructor for a surface defined by a texture image and 4 boundary points. Choose the first point as the origin of the surfac...
def bottom_left_corner3d(self): return self.edge_points3d[3]
<|file_name|>fuzzer.cpp<|end_file_name|><|fim▁begin|>/* * The ManaPlus Client * Copyright (C) 2013-2015 The ManaPlus Developers * * This file is part of The ManaPlus Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as pu...
{ fuzz = new Logger; fuzz->setLogFile(settings.localDataDir + "/fuzzer.log"); unsigned int sr = time(nullptr);
<|file_name|>merkleTree.js<|end_file_name|><|fim▁begin|>import {keccak256, bufferToHex} from "ethereumjs-util" export default class MerkleTree { constructor(elements) { // Filter empty strings and hash elements this.elements = elements.filter(el => el).map(el => keccak256(el)) // Deduplicate e...
getLayers(elements) {
<|file_name|>test_script_delete.py<|end_file_name|><|fim▁begin|>import os import time import sys FOLDERPATH = sys.argv[1] #os.chdir(FOLDERPATH) walk = os.walk(FOLDERPATH) FSEVENT = "delete"<|fim▁hole|> FILEPATHPREFIX = item[0] + "\\" for song in item[2]: if song.endswith(".mp3"): FILEPATH =...
for item in walk:
<|file_name|>redbox-factory.hpp<|end_file_name|><|fim▁begin|>void RedboxFactory::add (Addr addr, ActionType t) { switch (t) { case ActionType::RD8 : return add_read (addr, 1); case ActionType::RD16 : return add_read (addr, 2); case ActionType::RD32 : return add_read (addr, 4); case A...
// otherwise there is a gap betwen interval i and interval j, so we // need to create a new interval at offset i+1, only if i+1 != j ++i; if (i != j)
<|file_name|>CinematicCamera.js<|end_file_name|><|fim▁begin|>import { Mesh, OrthographicCamera, PerspectiveCamera, PlaneGeometry, Scene, ShaderMaterial, UniformsUtils, WebGLRenderTarget } from 'three'; import { BokehShader } from '../shaders/BokehShader2.js'; import { BokehDepthShader } from '../shaders/BokehS...
constructor( fov, aspect, near, far ) {
<|file_name|>Topic.java<|end_file_name|><|fim▁begin|><|fim▁hole|> * This file is part of Aspose.Words. The source code in this file * is only intended as a supplement to the documentation, and is provided * "as is", without warranty of any kind, either expressed or implied. */ package loadingandsaving.loadingand...
/* * Copyright 2001-2014 Aspose Pty Ltd. All Rights Reserved. *
<|file_name|>polygon_mask.cc<|end_file_name|><|fim▁begin|>/****************************************************************************** * Copyright 2017 The Apollo Authors. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance wit...
continue;
<|file_name|>JoinDirective.java<|end_file_name|><|fim▁begin|>/* * WANDORA * Knowledge Extraction, Management, and Publishing Application * http://wandora.org * * Copyright (C) 2004-2016 Wandora Team * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Genera...
} else joinRes=cachedJoin;
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>VERSION = "0.1" <|fim▁hole|><|fim▁end|>
from trello.api import *
<|file_name|>macro-crate-def-only.rs<|end_file_name|><|fim▁begin|>// Copyright 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.apach...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ <DefineSource> @Date : Fri Nov 14 13:20:38 2014 \n @Author : Erwan Ledoux \n\n </DefineSource> An Eulerer """ #<DefineAugmentation> import ShareYourSystem as SYS BaseModuleStr="ShareYourSystem.Specials.Simulaters.Populater" Decorati...
#return
<|file_name|>error.py<|end_file_name|><|fim▁begin|># # Copyright (c) SAS Institute Inc. # # 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 # # ...
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>extern crate hyper; extern crate rustc_serialize;<|fim▁hole|> pub use self::client::Client; pub use self::structs::{MarathonTask, ServiceDefinition}; mod client; mod structs; #[derive(RustcDecodable, RustcEncodable)] pub struct Apps { pub apps: Vec<ServiceDefinitio...
extern crate url;
<|file_name|>GraphQLSegment-test.js<|end_file_name|><|fim▁begin|>/** * Copyright (c) 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be...
var metadata = getAllMetadata(segment);
<|file_name|>avpr2rest.py<|end_file_name|><|fim▁begin|>import sys import json import os import re import argparse def get_file_locations(): parser = argparse.ArgumentParser() parser.add_argument('input', help='Input AVPR filename(s)', nargs='+') parser.add_argument('output', help='Output directory') args = par...
for message_name in data['messages']: message_def = data['messages'][message_name]
<|file_name|>fs-client.ts<|end_file_name|><|fim▁begin|>import fs from 'fs'; import mkdirp from 'mkdirp'; import path from 'path'; type FSWraps = | typeof fs.promises.readFile | typeof fs.promises.writeFile | typeof fs.promises.unlink | typeof fs.promises.readdir | typeof fs.promises.mkdir | typeof fs.promi...
writeFile: wrap(fs.promises.writeFile),
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// +--------------------------------------------------------------------------+ // | Copyright 2016 Matthew D. Steele <mdsteele@alum.mit.edu> | // | | // | This file is part of Syste...
<|file_name|>client_test.go<|end_file_name|><|fim▁begin|>package wsclient import ( "github.com/cosminrentea/gobbler/testutil" "fmt" "strings" "testing" "time" "github.com/gorilla/websocket" "github.com/stretchr/testify/assert" ) var aNormalMessage = `/foo/bar,42,user01,phone01,{},,1420110000,0 Hello World` ...
// stop client after 200ms time.AfterFunc(time.Millisecond*200, func() { c.Close() })
<|file_name|>index.js<|end_file_name|><|fim▁begin|>'use strict'; var _ = require('underscore'); var express = require('express'); var router = express.Router(); var ObjectId = require('mongoose').Types.ObjectId; var path = require('path'); /** * @apiDefine group Group based access * Resource access controlled by use...
<|file_name|>test_feature_extractor.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-<|fim▁hole|> class TestFeatureExtractor(object): """Tests for feature extractors. """ def test_context_size(self): f = FeatureExtractor() assert f.context_size == (0, 0) f.context_size = (1, 2...
import pytest from mmb_perceptron.feature_extractor import FeatureExtractor
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import url from django.conf.urls import patterns<|fim▁hole|>from pyday_alarms import views app_name = 'pyday_alarms' urlpatterns = [ url(r'^alarms/$', views.AlarmView.as_view(), name='alarms'), ] '''urlpatterns += patterns('pyday_social_netwo...
<|file_name|>bad-bang-ann.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://www.apache.org/li...
<|file_name|>tower_job_template.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # coding: utf-8 -*- # (c) 2017, Wayne Witzel III <wayne@riotousliving.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __m...
<|file_name|>metadata.go<|end_file_name|><|fim▁begin|>// Copyright 2016 Google Inc. // // 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 /...
"fmt" "io/ioutil" "os"
<|file_name|>triangle.rs<|end_file_name|><|fim▁begin|>// Copyright 2015 Brendan Zabarauskas and the gl-rs developers // // 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.a...
<|file_name|>cacheWrapper.test.ts<|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 yo...
* * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
<|file_name|>test_statepoint_batch.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import os import sys sys.path.insert(0, os.pardir)<|fim▁hole|>class StatepointTestHarness(TestHarness): def __init__(self): self._sp_name = None self._tallies = False self._opts = None self._ar...
from testing_harness import TestHarness
<|file_name|>wrapping_sub_mul.rs<|end_file_name|><|fim▁begin|>use num::arithmetic::traits::{ WrappingMul, WrappingSub, WrappingSubAssign, WrappingSubMul, WrappingSubMulAssign, }; fn wrapping_sub_mul<T: WrappingMul<T, Output = T> + WrappingSub<T, Output = T>>( x: T, y: T, z: T, ) -> T { x.wrapping_s...
}; } apply_to_primitive_ints!(impl_wrapping_sub_mul);
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals from .abc import ABCIE from .abc7news import Abc7NewsIE from .academicearth import AcademicEarthCourseIE from .addanime import AddAnimeIE from .adobetv import AdobeTVIE from .adultswim import AdultSwimIE from .aftonbladet imp...
from .ivi import ( IviIE,
<|file_name|>githubcron.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3.4 # -*- coding: utf-8 -*- # 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. # Th...
# Inform infra@ and private@$pmc that the mirror has been set up msg = MIMEText("New repository %s has now had GitHub integration enabled!\n\nWith regards,\nApache Infrastructure." % (reponame)) msg['Subject'] = 'Github integration set up: %s' % reponame
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>mod utils; use wasm_bindgen::prelude::*; // When the `wee_alloc` feature is enabled, use `wee_alloc` as the global // allocator. #[cfg(feature = "wee_alloc")] #[global_allocator] static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT; use vt::VT;<|fim▁hole|>pub ...
#[wasm_bindgen]
<|file_name|>test_jail_code.py<|end_file_name|><|fim▁begin|>"""Test jail_code.py""" import os import shutil import sys import textwrap import tempfile import unittest from nose.plugins.skip import SkipTest from codejail.jail_code import jail_code, is_configured, Jail, configure, auto_configure auto_configure() de...
res = jailpy( code="import sys; print(':'.join(sys.argv[1:]))", argv=["Hello", "world", "-x"]
<|file_name|>test_star.py<|end_file_name|><|fim▁begin|>"""star subcommand tests""" # (c) 2015-2021 Wibowo Arindrarto <contact@arindrarto.dev> import json import pytest from click.testing import CliRunner from crimson.cli import main from .utils import get_test_path @pytest.fixture(scope="module") def star_fail(): ...
("pctUnmappedForTooManyMismatches", 0.0),
<|file_name|>lookup-international-basic.5.x.py<|end_file_name|><|fim▁begin|><|fim▁hole|> # Python 3 from urllib.parse import quote except ImportError: # Python 2 from urllib import quote # Your Account Sid and Auth Token from twilio.com/console account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" auth_tok...
# Download the Python helper library from twilio.com/docs/python/install from twilio.rest.lookups import TwilioLookupsClient try:
<|file_name|>samba_ip_test.go<|end_file_name|><|fim▁begin|>package cmd import ( "testing" gomock "github.com/golang/mock/gomock" "github.com/jamesnetherton/homehub-cli/service" ) func TestSambaIPCommand(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() hub := NewMockHub(ctrl) service.SetHub...
service.AuthenticationComplete() hub.EXPECT().SambaIP().Return("192.168.1.254", nil)
<|file_name|>option_manager.go<|end_file_name|><|fim▁begin|>/* Copyright (c) 2016 VMware, Inc. 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/license...
res, err := methods.QueryOptions(ctx, m.Client(), &req)
<|file_name|>fixtures.js<|end_file_name|><|fim▁begin|>module.exports = function() { return [{ "request": { "method": "GET", "url": "http://api.wordnik.com/v4/word.json/test/definitions", "params": { "limit":"1", "includeRelated":"true", ...
"partOfSpeech":"noun", "attributionText": [ "from the GNU version of the Collaborative International ",
<|file_name|>parm.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://www.apache.org/licenses/L...
}) }
<|file_name|>app.py<|end_file_name|><|fim▁begin|># Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: # Maintained By: from . import settings # Initialize Flask app from flask import Flask app = Fla...
# Configure Flask-SQLAlchemy for app from . import db db.app = app
<|file_name|>hotel_date_selection_type.pb.go<|end_file_name|><|fim▁begin|>// Code generated by protoc-gen-go. DO NOT EDIT. // source: google/ads/googleads/v1/enums/hotel_date_selection_type.proto package enums import ( fmt "fmt" math "math" proto "github.com/golang/protobuf/proto" _ "google.golang.org/genproto/g...
<|file_name|>forms.py<|end_file_name|><|fim▁begin|>from django import forms from Crate.models import Discussion class ReportForm(forms.Form): report = forms.CharField(label="Enter your report", max_length=500, widget=forms.Textarea) class DiscussionForm(forms.ModelForm): class Meta:<|fim▁hole|><|fim▁end|>
model = Discussion fields = ['comment']
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>pub fn to_bytes(values: &[u32]) -> Vec<u8> { let mut idx = 0; let mut rb: u32; let mut per_stream_vec = Vec::new(); let mut per_byte_vec: Vec<u8> = Vec::new(); for value in values { rb = *value; loop { let mut b = rb & 0x7...
} /// Given a stream of bytes, extract all numbers which are encoded in there.
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>pub mod text; pub mod physical_body;<|fim▁end|>
pub mod actor; pub mod movement; pub mod logic_handler;
<|file_name|>comment.js<|end_file_name|><|fim▁begin|>define(['App', 'underscore', 'backbone', 'jquery'], function(App, _, Backbone, $) {<|fim▁hole|> data.childrenCount = data.children.length if (data.childrenCount == 1) { data.replyVerb = 'reply' } else { data.replyVerb = 'replies' ...
return Backbone.Model.extend({ parseAsCommentMoreLink: function(data) { if (data.children.length === 0) return null
<|file_name|>RoundRobinMerge.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
from MergeIndependent import *
<|file_name|>observe.js<|end_file_name|><|fim▁begin|>/** * Librerías Javascript * * @package Roraima * @author $Author$ <desarrollo@cidesa.com.ve> * @version SVN: $Id$ * * @copyright Copyright 2007, Cide S.A. * @license http://opensource.org/licenses/gpl-2.0.php GPLv2 */ //FUNCIONES JAVASCRIPT ...
Event.observe(document, 'keypress', function(event) { if(event.keyCode == Event.KEY_RETURN && form) {
<|file_name|>archive_tarcopyoptions_unix.go<|end_file_name|><|fim▁begin|>// +build !windows package daemon import ( "github.com/docker/docker/container" "github.com/docker/docker/pkg/archive" "github.com/docker/docker/pkg/idtools" ) func (daemon *Daemon) tarCopyOptions(container *container.Container, noOverwriteD...
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals<|fim▁hole|> import os.path from setuptools import setup, find_packages def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup(name='django-aloha-edit', version='0.4.0', descr...
<|file_name|>download-test-data.js<|end_file_name|><|fim▁begin|>const fs = require(`fs`) const fetchData = require(`../fetch`) // Fetch data from our sample site and save it to disk. <|fim▁hole|>const typePrefix = `wordpress__` const refactoredEntityTypes = { post: `${typePrefix}POST`, page: `${typePrefix}PAGE`, ...
<|file_name|>selinux_test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import os import selinux import tempfile import unittest import blivet from tests import loopbackedtestcase import blivet.formats.fs as fs from blivet.size import Size @unittest.skipUnless(selinux.is_selinux_enabled() == 1, "SELinux is disabl...
mountpoint = tempfile.mkdtemp("test.selinux") an_fs.mount(mountpoint=mountpoint)
<|file_name|>tiled_layer.cc<|end_file_name|><|fim▁begin|>// Copyright 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "cc/layers/tiled_layer.h" #include <algorithm> #include <vector> #include "base/auto_r...
gfx::Rect idle_paint_content_rect = IdlePaintRect();
<|file_name|>bitcoin_cs.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="cs" version="2.0"> <defaultcodec>UTF-8</defaultcodec> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About Legscoin</source> ...
<source>Loading block index...</source>
<|file_name|>subscriptions.js<|end_file_name|><|fim▁begin|>var icms = icms || {}; icms.subscriptions = (function ($) { this.active_link = {}; this.onDocumentReady = function () { this.setSubscribe(); $('.subscriber').on('click', function () { icms.subscriptions.active_link = th...
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//! Unix-specific extension to the primitives in the `std::ffi` module. //! //! # Examples //! //! ``` //! use std::ffi::OsString; //! use std::os::unix::ffi::OsStringExt; //! //! let bytes = b"foo".to_vec(); //! //! // OsStringExt::from_vec //! let os_string = OsString:...
//!
<|file_name|>xml_tools.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import pathlib from typing import Union import lxml.etree def save_as_xml( element_tree: Union[lxml.etree._Element, lxml.etree._ElementTree], filepath: Union[str, pathlib.Path], pretty_print: bool = Tr...
"""save ElementTree in the file as XML
<|file_name|>magento_model.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- ############################################################################## # # Author: Guewen Baconnier # Copyright 2013 Camptocamp SA # Copyright 2013 Akretion # # This program is free software: you can redistribute it a...
from_date = datetime.strptime(
<|file_name|>example.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import urllib from OpenGL.GL import * from OpenGL.GLU import * from OpenGL.GLUT import * from jp.ac.kyoto_su.aokilab.dragon.mvc.model import OpenGLModel from jp.ac.kyoto_su.aokil...
with open(filename, "rU") as a_file: while True:
<|file_name|>OversampleWithDepthTest.java<|end_file_name|><|fim▁begin|>package org.apache.lucene.facet.sampling; import java.io.IOException; import java.util.Collections; import org.apache.lucene.document.Document; import org.apache.lucene.facet.FacetTestCase; import org.apache.lucene.facet.index.FacetFields; import ...
private void index100Docs(Directory indexDir, Directory taxoDir, FacetIndexingParams fip) throws IOException { IndexWriterConfig iwc = newIndexWriterConfig(TEST_VERSION_CURRENT, null); IndexWriter w = new IndexWriter(indexDir, iwc); TaxonomyWriter tw = new DirectoryTaxonomyWriter(taxoDir);
<|file_name|>inputDateTest.js<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2013 salesforce.com, inc. * * 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.or...
* Verify behavior of Today() when 'format' is assigned a valid value. */ // TODO(W-2671175): Fails due to GMT/PST timezone difference for user.timezone and actual timezone
<|file_name|>task-comm-3.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-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...
<|file_name|>poddisruptionbudget.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...
<|file_name|>HSScreen.java<|end_file_name|><|fim▁begin|>package com.humooooour.kit.screen; import android.app.Activity; import android.view.KeyEvent; import android.view.MotionEvent; import com.humooooour.kit.HSApp; import com.humooooour.kit.geom.HSRect; import processing.core.PApplet; import processing.core.PGraphi...
} protected HSRect getContentBounds() { HSRect cBounds = new HSRect(mBounds);
<|file_name|>arena.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://www.apache.org/licenses/...
<|file_name|>toc.js<|end_file_name|><|fim▁begin|>(function($) { $.fn.toc = function(options) { var self = this; var opts = $.extend({}, jQuery.fn.toc.defaults, options); var container = $(opts.container); var headings = $(opts.selectors, container); var activeClassName = opts.prefix+'-active'; var scrollT...
} return this.each(function() { //build TOC
<|file_name|>test_midonet_plugin.py<|end_file_name|><|fim▁begin|># vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (C) 2012 Midokura Japan K.K. # Copyright (C) 2013 Midokura PTE LTD # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except...
test_bindings.PortBindingsTestCase):
<|file_name|>XDCC.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import os import re import select import socket import struct import time from module.plugins.internal.Hoster import Hoster from module.plugins.internal.misc import exists, fsjoin class XDCC(Hoster): __name__ = "XDCC" __type__ =...
for line in lines: # if self.pyload.debug: # self.log_debug("*> " + decode(line)) line = line.rstrip()
<|file_name|>multiwallet.go<|end_file_name|><|fim▁begin|>package multiwallet import ( "errors"<|fim▁hole|> "strings" "time" eth "github.com/OpenBazaar/go-ethwallet/wallet" "github.com/OpenBazaar/multiwallet/bitcoin" "github.com/OpenBazaar/multiwallet/bitcoincash" "github.com/OpenBazaar/multiwallet/client/blockb...
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//! Provides common neural network layers. //! //! For now the layers in common should be discribed as layers that are typical //! layers for building neural networks but are not activation or loss layers. #[macro_export] macro_rules! impl_ilayer_common { () => ( ...
output_dims }
<|file_name|>start.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>use types::{Cmd, Response}; use process::process; use state::State; use input::parse_input; use output::format_output; pub fn start<R, W>(input: R, output: W) where R: Read + Send + 'static, W: Write + Send + 'static { let mut state = State::new(); ...
use std::io::{Read, BufReader, Write}; use std::thread; use std::sync::mpsc::sync_channel;
<|file_name|>managers.py<|end_file_name|><|fim▁begin|>""" Data models managers for the user strike app. """ from django.db import models from django.db.models import Q from django.utils import timezone class UserStrikeManager(models.Manager): """ Manager class for the ``UserStrike`` data model. """ ...
# Compute the lookup expression if not user and not ip_address:
<|file_name|>layout.module.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>module app.layout { angular.module('app.layout', []); }<|fim▁end|>
/// <reference path="../_all.ts" /> 'use strict';
<|file_name|>dont-suggest-deref-inside-macro-issue-58298.rs<|end_file_name|><|fim▁begin|>fn warn(_: &str) {} <|fim▁hole|> //~^ ERROR mismatched types }; } fn main() { intrinsic_match! { "abc" }; }<|fim▁end|>
macro_rules! intrinsic_match { ($intrinsic:expr) => { warn(format!("unsupported intrinsic {}", $intrinsic));