prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>server_run_options.go<|end_file_name|><|fim▁begin|>/*
Copyright 2016 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-... | if s.MaxRequestsInFlight < 0 { |
<|file_name|>issue-2185.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.<|fim▁hole|>// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.... | // |
<|file_name|>common.rs<|end_file_name|><|fim▁begin|>use chrono::NaiveDate;
use std::fmt;
/// A common type for toornament dates.
pub type Date = NaiveDate;
macro_rules! enum_number {
($name:ident { $($variant:ident = $value:expr, )* }) => {
#[allow(missing_docs)]
#[derive(Clone, Copy, Debug, Eq, P... | impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = $name;
fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
<|file_name|>ApplicationMenu.py<|end_file_name|><|fim▁begin|>##########################################################################
#
# Copyright (c) 2011-2012, John Haddon. All rights reserved.
# Copyright (c) 2011, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary fo... | |
<|file_name|>editor_plugin_src.js<|end_file_name|><|fim▁begin|>/**
* $Id: sites/all/libraries/tinymce/jscripts/tiny_mce/plugins/visualchars/editor_plugin_src.js 1.3 2010/02/18 14:48:59EST Linda M. Williams (WILLIAMSLM) Production $
*
* @author Moxiecode
* @copyright Copyright © 2004-2008, Moxiecode Systems AB,... | ed.dom.setOuterHTML(nl[i], nl[i].innerHTML.replace(/(·|\u00b7)/g, ' '), d);
}
}
|
<|file_name|>test_lore.py<|end_file_name|><|fim▁begin|># Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
# ++ single anchor added to individual output file
# ++ two anchors added to individual output file
# ++ anchors added to individual output files
# ++ entry added to index
# ++ index entry poi... | |
<|file_name|>day_09.rs<|end_file_name|><|fim▁begin|>use std::iter::{Enumerate, Peekable};
use std::str::{Chars, FromStr};
type Cursor<'c> = Peekable<Enumerate<Chars<'c>>>;
#[derive(Debug, PartialEq)]
pub enum Ast {
Num(f64),
Op(char, Box<Ast>, Box<Ast>),
}
impl Ast {
fn index(chars: &mut Cursor) -> usize... |
#[test] |
<|file_name|>test_writing.py<|end_file_name|><|fim▁begin|>"""
(Future home of) Tests for program enrollment writing Python API.
Currently, we do not directly unit test the functions in api/writing.py.
This is okay for now because they are all used in
`rest_api.v1.views` and is thus tested through `rest_api.v1.tests.te... | """
from __future__ import absolute_import, unicode_literals |
<|file_name|>gulpfile.babel.js<|end_file_name|><|fim▁begin|>'use strict';
import gulp from 'gulp';<|fim▁hole|>import webpack from 'webpack';
import path from 'path';
import sync from 'run-sequence';
import rename from 'gulp-rename';
import template from 'gulp-template';
import fs from 'fs';
import... | |
<|file_name|>0015_datapoint_sorttimestamp.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
<|fim▁hole|>
class Migration(migrations.Migration):
dependencies = [
('agentex', '0014_remove_decision_datacollect'),
]
operations = [
migrations.AddFie... | from django.db import models, migrations
|
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>#![cfg_attr(all(test, feature = "nightly"), feature(test))] // we only need test feature when testing
#[macro_use] extern crate log;
extern crate syntex_syntax;
extern crate toml;
extern crate env_logger;
#[macro_use] extern crate clap;
extern crate racer;
#[cfg(not... | fn cache_file_contents_from_stdin(file: &PathBuf, cache: &core::FileCache) {
let stdin = io::stdin(); |
<|file_name|>ticket2855.py<|end_file_name|><|fim▁begin|># Copyright (C) 2007, Red Hat, Inc.
#
# 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 by the Free Software Foundation; either
# version 2 of the License, or (at you... | |
<|file_name|>guiInspector.cc<|end_file_name|><|fim▁begin|>//-----------------------------------------------------------------------------
// Copyright (c) 2013 GarageGames, LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (... | }
mStack->freeze(false);
mStack->updatePanes();
|
<|file_name|>node-check_test.go<|end_file_name|><|fim▁begin|>// Copyright 2020, Square, Inc.
package spec_test
import (
"fmt"
"testing"
. "github.com/square/spincycle/v2/request-manager/spec"
)
func TestFailHasCategoryNodeCheck(t *testing.T) {
check := HasCategoryNodeCheck{}
node := Node{
Name: nodeA,
... | |
<|file_name|>16.d.ts<|end_file_name|><|fim▁begin|>import { TextLinkAnalysis16 } from "../../";<|fim▁hole|>export = TextLinkAnalysis16;<|fim▁end|> | |
<|file_name|>module_creator.py<|end_file_name|><|fim▁begin|>import os
import shutil
import logging
from getpass import getuser
from dls_ade import vcs_git, Server
from dls_ade.exceptions import (RemoteRepoError, VerificationError,<|fim▁hole|> ArgumentError)
class ModuleCreator(object):... | |
<|file_name|>extract_images_to_s3.py<|end_file_name|><|fim▁begin|>import os
import posixpath
import random
import string
import logging
import tempfile
import time
from .extract_images import ExtractImages
logger = logging.getLogger(__name__)
class ExtractImagesToS3(ExtractImages):
'''
This KnowledgePostPr... | try:
# Get image type
img_ext = posixpath.splitext(img_path)[1]
|
<|file_name|>templating.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
flask.templating
~~~~~~~~~~~~~~~~
Implements the bridge to Jinja2.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import posixpath
from jinja2 import BaseLoader, Environmen... | |
<|file_name|>clean.rs<|end_file_name|><|fim▁begin|>// Copyright 2016 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/... | rm_rf("tmp".as_ref());
rm_rf(&build.out.join("tmp"));
rm_rf(&build.out.join("dist"));
|
<|file_name|>boot_wym.js<|end_file_name|><|fim▁begin|>onOpenDialog = function(dialog) {
$('.ui-dialog').corner('6px').find('.ui-dialog-titlebar').corner('1px top');
$(document.body).addClass('hide-overflow');
}
onCloseDialog = function(dialog) {
$(document.body).removeClass('hide-overflow');
}
var wymeditor_inp... | ,{'name': 'Unlink', 'title': 'Unlink', 'css': 'wym_tools_unlink'}
,{'name': 'InsertImage', 'title': 'Image', 'css': 'wym_tools_image'} |
<|file_name|>testStream.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#-------------------------------------------------------------------------------
# Name: testStream.py
# Purpose: tests for stream.py
#
# Authors: Michael Scott Cuthbert
# Christopher Ariza
#
# Copyright: ... |
def testAugmentOrDiminishCorpus(self):
'''Extract phrases from the corpus and use for testing |
<|file_name|>plugin_utils.py<|end_file_name|><|fim▁begin|>import json
import datetime
import threading
from base_plugin import *
import base_plugin
#=============================================Messaging===================================
def send_message(recipient, message, mtype='chat'):
'''
Send a message to r... |
:param year: year of the event |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// The MIT License (MIT)
// Copyright (c) 2015 Y. T. Chung <zonyitoo@gmail.com><|fim▁hole|>// 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... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright(c) 2016-2020 Jonas Sjöberg <autonameow@jonasjberg.com>
# Source repository: https://github.com/jonasjberg/autonameow
#
# This file is part of autonameow.
#
# autonameow is free software: you can redistribute it and/or mod... | from .extractor_filetags import FiletagsMetadataExtractor
from .extractor_guessit import GuessitMetadataExtractor
from .extractor_jpeginfo import JpeginfoMetadataExtractor
from .extractor_pandoc import PandocMetadataExtractor |
<|file_name|>remote.go<|end_file_name|><|fim▁begin|>package remote
//go:generate mockery -name Remote -output mock -case=underscore
import (
"net/http"
"time"
"github.com/drone/drone/model"
"golang.org/x/net/context"
)
type Remote interface {
// Login authenticates the session and returns the
// remote user ... | // Refresh refreshes an oauth token and expiration for the given
// user. It returns true if the token was refreshed, false if the
// token was not refreshed, and error if it failed to refersh.
func Refresh(c context.Context, u *model.User) (bool, error) { |
<|file_name|>HiveSourceTableLoader.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
* ... | |
<|file_name|>GameClient.py<|end_file_name|><|fim▁begin|>import Network
from time import sleep
from threading import Thread
CALL_ROOMLIST = 0
CALL_WEAPLIST = 1
CALL_PLAYERLIST = 2
CALL_NEWPLAYER = 3
CALL_PLAYERLEFT = 4
CALL_CHAT = 5
CALL_PLAYERDAT = 6
CALL_ROOMSTAT = 7
CALL_LEAVEROOM = 8
CALL_SHOOT = 9
CALL_SCORE = 10
... | self.main.onRoomSwitch(action, result) |
<|file_name|>app.component.ts<|end_file_name|><|fim▁begin|>// ==================================================================================================================
// ,::i ... | export class AppComponent {
title = 'app works!';
} |
<|file_name|>webclient.py<|end_file_name|><|fim▁begin|>import logging
import requests
import slacksocket.errors as errors
log = logging.getLogger('slacksocket')
class WebClient(requests.Session):
""" Minimal client for connecting to Slack web API """
def __init__(self, token):
self._token = token
... | max_attempts=max_attempts - 1, |
<|file_name|>migrated_0115.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | a enum; |
<|file_name|>gruntfile.js<|end_file_name|><|fim▁begin|>/***********************************************
gruntfile.js for jquery-bootstrap
https://github.com/fcoo/jquery-bootstrap
***********************************************/
module.exports = function(grunt) {
"use strict";
//****************************... | |
<|file_name|>std_hash.hpp<|end_file_name|><|fim▁begin|>#ifndef STD_HASH_HPP
#define STD_HASH_HPP
#include <functional>
// this is largely inspired by boost's hash combine as can be found in
// "The C++ Standard Library" 2nd Edition. Nicolai M. Josuttis. 2012.
<|fim▁hole|>template <typename T> void hash_combine(std::s... | |
<|file_name|>issue-3099-a.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.<|fim▁hole|>//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.ap... | |
<|file_name|>common.py<|end_file_name|><|fim▁begin|># This is modified from a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild
import array
import struct
import zlib
from enum import Enum
from pkg_resources import parse_version
from kaitaistruct import __version__ as ks_version, K... | class VersionNumberEnum(Enum): |
<|file_name|>sw_config_backup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# vim:set sw=4 ts=4 et:
import sys
import pexpect
import threading
import os
import shutil
import logging
import time
import configparser
import ast
import subprocess
def backup(switch, server):
if switch['ty... |
def main():
app_cfg = load_app_cfg() |
<|file_name|>roundd.py<|end_file_name|><|fim▁begin|># (c) Nelen & Schuurmans. GPL licensed, see LICENSE.rst.
# -*- coding: utf-8 -*-
"""
Round raster to set decimals.
"""
from os.path import dirname, exists
import argparse
import os
from osgeo import gdal
import numpy as np
from raster_tools import datasets
# output... | )
parser.add_argument(
'-r', '--round',
type=int, |
<|file_name|>minhash.go<|end_file_name|><|fim▁begin|>// Package minhash implements a probabilistic data structure for computing the
// similarity between datasets.
//
// The original MinHash paper:
// http://cs.brown.edu/courses/cs253/papers/nearduplicate.pdf
//
// The b-Bit MinWise Hashing:
// http://research.microsof... |
// New creates a new MinHash signature.
// `seed` is used to generate random permutation functions. |
<|file_name|>portpicker_test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#
# Copyright 2007 Google 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... | |
<|file_name|>main.go<|end_file_name|><|fim▁begin|>/*
Copyright 2016 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 re... | } else {
b, err := c.MarshalBytes() |
<|file_name|>laplace2d-pa.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
import time
import numpy as np
from numba import jit, stencil
@stencil
def jacobi_kernel(A):
return 0.25 * (A[0,1] + A[0,-1] + A[-1,0] + A[1,0])
@jit(parallel=True)
def jacobi_relax_core(A, Anew):
error = 0.0
n = A.shape[0]
m = A... | #!/usr/bin/env python
from __future__ import print_function |
<|file_name|>control_get_firmware.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
"""
# control_get_firmware.py: get firmware version of Gemalto readers
# Copyright (C) 2009-2012 Ludovic Rousseau
"""
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU... | # You should have received a copy of the GNU General Public License along
# with this program; if not, see <http://www.gnu.org/licenses/>. |
<|file_name|>account.js<|end_file_name|><|fim▁begin|>var passport = require('passport');
var LocalStrategy = require('passport-local').Strategy;
var bodyParser = require('body-parser')
var chip = require('../../chip.js');
var Syndicate = require('../../model/syndicate');
var Account = require('../../model/account');
va... |
function getGroup(req, res) {
return Group.get(req.params.gid).then(function(group) {
var g = chip.getGroup(group.groupme_id); |
<|file_name|>same-origin-test.js<|end_file_name|><|fim▁begin|>// Copyright 2018 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.
function waitUntilIdle() {
return new Promise(resolve=>{
window.requestIdleCallback(()... |
await expectationComment('Load [A] from Disk Cache. -->');
// As we cleared [A] from MemoryCache, this doesn't hit MemoryCache, but still |
<|file_name|>profitbricks.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at ... | state = module.params.get('state')
try:
if state == 'running': |
<|file_name|>vote-taker.componet.ts<|end_file_name|><|fim▁begin|>import {Component} from '@angular/core';
import { HEROES } from './mock-heroes';
@Component({
selector: 'vote-taker',
template: `<|fim▁hole|> [name]="voter.name"
(onVoted)="onVoted($event)">
</my-voter>
`
})
export class Vo... | <h2>Should mankind colonize the Universe?</h2>
<h3>Agree: {{agreed}}, Disagree: {{disagreed}}</h3>
<my-voter *ngFor="let voter of heroes"
length=5 |
<|file_name|>StopMojo.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 the ... | * See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.sling.maven.slingstart.run; |
<|file_name|>test_get_query_entities.py<|end_file_name|><|fim▁begin|>import sqlalchemy as sa
from sqlalchemy_utils import get_query_entities
from tests import TestCase
class TestGetQueryEntities(TestCase):
def create_models(self):
class TextItem(self.Base):
__tablename__ = 'text_item'
... | assert list(get_query_entities(query)) == [selectable]
|
<|file_name|>home.client.controller.test.js<|end_file_name|><|fim▁begin|>'use strict';
(function() {
describe('HomeController', function() {
//Initialize global variables
var scope,
HomeController,
myFactory;
// Load the main application module
beforeEach(module(ApplicationConfiguration.applic... | scope.feedSrc = 'http://rss.cnn.com/rss/cnn_topstories.rss';
}); |
<|file_name|>not-found.page.ts<|end_file_name|><|fim▁begin|>import { Component } from '@angular/core';
import { Store } from '@ngrx/store';
import { AppState } from '../store/root.reducer';
@Component({
template: `
<ais-header pageTitle="Page not found"></ais-header>
<ion-content padding class="marginTopAdj... | } |
<|file_name|>block-title.d.ts<|end_file_name|><|fim▁begin|>import { ComponentType } from 'react';<|fim▁hole|> interface Props {
children?: never;
clientId: string;
}
}
declare const BlockTitle: ComponentType<BlockTitle.Props>;
export default BlockTitle;<|fim▁end|> |
declare namespace BlockTitle { |
<|file_name|>webide.py<|end_file_name|><|fim▁begin|># coding: utf-8
import os
import sys
import logging
import webbrowser
import socket
import time
import json
import traceback
import cv2
import tornado.ioloop
import tornado.web
import tornado.websocket
from tornado.concurrent import run_on_executor
from concurrent.f... | sock.close()
if result != 0: |
<|file_name|>0004_auto__add_imagetranslationtranslation__add_unique_imagetranslationtran.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
... | 'Meta': {'object_name': 'ImageTranslationRenamed'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'image': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['filer.Image']"}),
'language': ('django.db.models.fields.CharField', [], {... |
<|file_name|>projectlists.go<|end_file_name|><|fim▁begin|>package builder
import (
"fmt"
"github.com/bitrise-io/go-xamarin/analyzers/project"
"github.com/bitrise-io/go-xamarin/constants"
"github.com/bitrise-io/go-xamarin/utility"
)
func (builder Model) whitelistedProjects() []project.Model {
projects := []proje... | |
<|file_name|>MainHandler.py<|end_file_name|><|fim▁begin|>import BaseHTTPServer
import thread
import urlparse
import string
from move import Move
from move import MoveInfo
from battery import BatteryStatus
move = Move()
def sendResponse(s, code, message):
print "... ", s.path
s.send_response(code)
s.send_header(... |
def executeGenericTurn(move, moveInfo): |
<|file_name|>vue.ts<|end_file_name|><|fim▁begin|>import Vue from "vue";
import * as Vuex from "../index";
const store = new Vuex.Store({
state: {
value: 1
}
});
const vm = new Vue({<|fim▁hole|>});
vm.$store.state.value;<|fim▁end|> | store |
<|file_name|>reverse_graph.rs<|end_file_name|><|fim▁begin|>use crate::core::{
property::{AddEdge, RemoveEdge},
Directed, Ensure, Graph, GraphDerefMut, GraphMut,
};
use delegate::delegate;
use std::borrow::Borrow;
#[derive(Debug)]
pub struct ReverseGraph<C: Ensure>(C)
where
C::Graph: Graph<Directedness = Directed>;
... | &'a mut self, |
<|file_name|>bitcoin_fa_IR.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="fa_IR" version="2.0">
<defauproodec>UTF-8</defauproodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About Procoin</sourc... | |
<|file_name|>mapStateModelValueInStrict.common.js<|end_file_name|><|fim▁begin|>/**
* vuex-mapstate-modelvalue-instrict- v0.0.4
* (c) 2017 fsy0718
* @license MIT
*/
'use strict';
var push = Array.prototype.push;
var pop = Array.prototype.pop;
var _mapStateModelValueInStrict = function (modelValue, stateName, type, ... | var _type = modulePath ? (modulePath + "/" + type) : type; |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>(function() {
'use strict';
var mergeModuleExports = require('../../utils/mergemoduleexports');
<|fim▁hole|><|fim▁end|> | mergeModuleExports(module.exports, require('./loader'));
mergeModuleExports(module.exports, require('./any'));
})(); |
<|file_name|>walletkit_server.go<|end_file_name|><|fim▁begin|>// +build walletrpc
package walletrpc
import (
"bytes"
"errors"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/txscript"
"github.com/btcsuite/btcd/wire"
"github.com/lightningnetwork... | // main macaroon service. |
<|file_name|>MyfastfileCom.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from module.common.json_layer import json_loads
from module.network.RequestFactory import getURL
from module.plugins.internal.MultiHoster import MultiHoster
class MyfastfileCom(MultiHoster):
__name__ = "MyfastfileCom"
__typ... | __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>export * from './ManagedReader';
export * from './ManagedWriter';
export * from './ManagedResourceDetailsIndicator';
export * from './managedResourceDetailsIndicator.component';
export * from './ManagedResourceStatusIndicator';
export * from './managed.modu... | export * from './DeployingIntoManagedClusterWarning'; |
<|file_name|>symbolize.cc<|end_file_name|><|fim▁begin|>// Copyright (c) 2006, Google 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:
//
// * Redistributions of source code must ret... |
// Check start and end addresses.
if (!(start_address <= pc && pc < end_address)) {
continue; // We skip this map. PC isn't in this map. |
<|file_name|>ReadSavedData.java<|end_file_name|><|fim▁begin|>import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
public class ReadSavedData
{
public static void StartRead() throws IOException
{
FileReader file = new FileReader("C:/... | |
<|file_name|>validation.py<|end_file_name|><|fim▁begin|>from voluptuous import Invalid
import re
def Url(msg=None):
def f(v):
regex = re.compile(
r'^(?:http|ftp)s?://' # http:// or https://
r'(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+(?:[A-Z]{2,6}\.?|[A-Z0-9-]{2,}\.?)|' #domain... | r'localhost|' #localhost...
r'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})' # ...or ip
r'(?::\d+)?' # optional port
r'(?:/?|[/?]\S+)$', re.IGNORECASE) |
<|file_name|>issue-7660.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.org/lice... | let A(ref _a, ref _b) = *m.get(&1);
let (a, b) = match *m.get(&1) { A(ref _a, ref _b) => (_a, _b) };
} |
<|file_name|>cloudns.py<|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 the Apache Lic... | def parse_error(self):
context = self.connection.context |
<|file_name|>mime_classifier.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/. */
use std::borrow::ToOwned;
pub struct MIMEClassifier ... | mask: b"\xFF\xFF\xFF\xFF",
content_type: ("video", "webm"),
leading_ignore: &[]
} |
<|file_name|>problem2.py<|end_file_name|><|fim▁begin|>import matplotlib.pyplot as plt
import numpy as np
import matplotlib.mlab as mlab
import math
import scipy.special as sps
mean = 0
variance = 1
sigma = math.sqrt(variance)
def drawSampleNormal(sampleSize):
samples = np.random.normal(mean, sigma, sampleSize)
... | drawSampleNormal(20)
drawSampleNormal(50)
drawSampleNormal(100)
drawSampleNormal(500) |
<|file_name|>UsbDeviceSpinnerAdapter.java<|end_file_name|><|fim▁begin|>package com.autowp.canreader;
import android.content.Context;
import android.hardware.usb.UsbDevice;
import android.os.Build;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAd... |
if (v == null) {
LayoutInflater vi; |
<|file_name|>apiwrappers.py<|end_file_name|><|fim▁begin|>import urllib.parse
import urllib.request
import json
import logging
import requests
log = logging.getLogger('tyggbot')
class APIBase:
@staticmethod
def _get(url, headers={}):
try:
req = urllib.request.Request(url, None, headers)
... | class ImraisingAPI(APIBase):
def __init__(self, apikey):
APIBase.__init__(self) |
<|file_name|>configuration_server.py<|end_file_name|><|fim▁begin|><|fim▁hole|>import zmq
import sys
import ConfigParser
import os.path
import proto_objs.venue_configuration_pb2
import daemon
import signal
import lockfile
from optparse import OptionParser
import datetime
full_config = proto_objs.venue_configuration_pb2... | |
<|file_name|>test_submit_group.py<|end_file_name|><|fim▁begin|># This file is part of the Simulation Manager project for VecNet.
# For copyright and licensing information about this project, see the
# NOTICE.txt and LICENSE.md files in its top-level directory; they are
# available at https://github.com/vecnet/simulatio... | """
@classmethod
def setUpClass(cls): |
<|file_name|>AppFemGui.cpp<|end_file_name|><|fim▁begin|>/***************************************************************************
* Copyright (c) 2008 Jürgen Riegel (juergen.riegel@web.de) *
* *
* This file is part of the ... | void loadFemResource()
{
// add resources and reloads the translators
|
<|file_name|>TeeOutputStream.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 und... | import java.io.IOException;
import java.io.OutputStream;
/** |
<|file_name|>environment_tools_test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python2.4
# Copyright 2009, Google 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:
#
# * Redistributions o... | # distribution.
# * Neither the name of Google Inc. nor the names of its |
<|file_name|>msgfmt.py<|end_file_name|><|fim▁begin|>""" msgfmt tool """
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentati... | # Here we add support for 'LINGUAS_FILE' keyword. Emitter is not suitable |
<|file_name|>lookup.rs<|end_file_name|><|fim▁begin|>// CITA
// Copyright 2016-2017 Cryptape Technologies LLC.
// This program is free software: you can redistribute it
// and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation,
// either version 3 of the Licen... | |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>'use strict'
module.exports = {
info: {
key: 'javascript',
title: 'JavaScript',
extname: '.js',
default: 'xhr'<|fim▁hole|> jquery: require('./jquery'),
fetch: require('./fetch'),
xhr: require('./xhr'),
axios: require('./axios')
}<|fim▁end|> | },
|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# __init__.py
# Copyright (C) 2015 LEAP
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Li... | |
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>from django.test import TestCase, Client
from jpspapp.models import Club, Activity,UserProfile
from django.contrib.auth.models import User
from django.contrib.auth import authenticate, login
import datetime
# Create your tests here.
class ClubTestCase(TestCase):
... |
def delete(self):
pass |
<|file_name|>gsrt_config.py<|end_file_name|><|fim▁begin|>import os
# maintain python 2.7 compatibility for time being. GSRTConfig is a dependency on everything else,
# including ow-swagger-library, which supports both python2 and python3. I think we should
# stop supporting 2.x if needed, but since many people outside... | secrets_file = os.path.join(self.secrets_dir,
"{}_{}".format(section, name)) |
<|file_name|>sample_stats_test.py<|end_file_name|><|fim▁begin|># Copyright 2016 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... |
from __future__ import absolute_import |
<|file_name|>test_match_without_extension.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# encoding: utf-8
from nose import with_setup
from tests.utils import *
@with_setup(usual_setup_func, usual_teardown_func)
def test_negative():
create_file('xxx', 'b.png')
create_file('xxx', 'a.png')
create_fil... | def test_positive():
create_file('xxx', 'a.png') |
<|file_name|>shapes.ts<|end_file_name|><|fim▁begin|>import { Actor } from './game';
import { Point, Size } from './foundation';
export class Rectangle implements Actor {
public isAlive: boolean;
protected rectCenter: Point;
protected rectSize: Size;
protected horizontalDirection: number;
protected... | |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>//! AWS Support
//!
//! If you're using the service, you're probably looking for [AWSSupportClient](struct.AWSSupportClient.html) and [AWSSupport](trait.AWSSupport.html).
extern crate hyper;
extern crate rusoto_core;
extern crate serde;
#[macro_use]<|fim▁hole|>extern cr... | |
<|file_name|>UPnP.SOAPRequest.js<|end_file_name|><|fim▁begin|>class upnp_soaprequest {
constructor() {
}<|fim▁hole|> // System.Runtime.Remoting.ObjRef CreateObjRef(type requestedType)
CreateObjRef() {
}
// bool Equals(System.Object obj)
Equals() {
}
// int GetHashCode()
GetHas... | |
<|file_name|>sanitizer.pipe.ts<|end_file_name|><|fim▁begin|>import { Pipe, PipeTransform } from '@angular/core';
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
<|fim▁hole|>})
export class SanitizerPipe implements PipeTransform {
constructor(private _sanitizer: DomSanitizer) {
}
transf... | @Pipe({
name: 'sanitizeHtml',
pure: false |
<|file_name|>webserver.js<|end_file_name|><|fim▁begin|>webserver.prototype.__proto__ = require('events').EventEmitter.prototype;
webserver.prototype.server = null;
webserver.prototype.config = null;
webserver.prototype.endpoints = [];
const bodyParser = require('body-parser');<|fim▁hole|>const formData = multer({ st... | const express = require('express');
const multer = require('multer'); |
<|file_name|>default.py<|end_file_name|><|fim▁begin|>import sys, xbmcplugin, xbmcgui,xbmc
_id = "plugin.video.italian-news"
_resdir = "special://home/addons/" + _id + "/resources"
_thisPlugin = int(sys.argv[1])
_icons = _resdir + "/icons/"
sys.path.append( xbmc.translatePath(_resdir + "/lib/"))
import rai
_tg1Icon=x... | xbmcplugin.endOfDirectory(_thisPlugin)
|
<|file_name|>preferencesRenderers.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.... | const setting = this.workspaceSettingsEditorModel.getPreference(unsupportedKey); |
<|file_name|>SyncSet.py<|end_file_name|><|fim▁begin|>"""
Represents a group of conduits
Copyright: John Stowers, 2007
License: GPLv2
"""
import traceback
import os
import xml.dom.minidom
import gobject
import logging
log = logging.getLogger("SyncSet")
import conduit
import conduit.Conduit as Conduit
import conduit.Se... | for policyName in Conduit.CONFLICT_POLICY_NAMES:
conduitxml.setAttribute(
"%s_policy" % policyName, |
<|file_name|>api.py<|end_file_name|><|fim▁begin|>import itertools
import json
import re
import flask
from flask import request
from web.cache import cache
import rethinkdb as r
import web.api.api_util as api_util
import db<|fim▁hole|>
api = flask.Blueprint("api", __name__, url_prefix="/api")
r_conn = db.util.r_conn... | import util |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>struct User {<|fim▁hole|>}
fn main() {
let user1 = User {
email: "someone@example.com",
username: "someusername123",
active: true,
sign_in_count: 1,
};
}<|fim▁end|> | active: bool,
username: &str,
email: &str,
sign_in_count: u64, |
<|file_name|>create.expense.component.ts<|end_file_name|><|fim▁begin|>import { Component } from '@angular/core';
import {ApiService} from "../services/api.service";
@Component({
moduleId: module.id,
selector: 'recharge',
templateUrl: 'create.expense.component.html',
styleUrls: ['./create.expense.component.less... | public phone:any;
public time:any;
|
<|file_name|>build.rs<|end_file_name|><|fim▁begin|>#[cfg(any(feature = "build_stub_miniz", feature = "build_orig_miniz"))]
extern crate cc;
#[cfg(not(any(feature = "build_stub_miniz", feature = "build_orig_miniz")))]<|fim▁hole|>fn main() {
cc::Build::new()
.files(&[
"miniz_stub/miniz.c",
... | fn main() {}
#[cfg(feature = "build_stub_miniz")] |
<|file_name|>GSML1FEC.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright 2008 Free Software Foundation, Inc.
*
* This software is distributed under the terms of the GNU Public License.
* See the COPYING file in the main directory for details.
This program is free software: you can redistribute it and/or modify
it... | // decode from c[] to u[]
mClass1_c.decode(mVCoder, mTCHU);
//mC.head(378).decode(mVCoder,mTCHU);
|
<|file_name|>render.py<|end_file_name|><|fim▁begin|>import os
import sys
import json
from optional_django import staticfiles
from optional_django.serializers import JSONEncoder
from optional_django.safestring import mark_safe
from optional_django import six
from js_host.function import Function
from js_host.exceptions ... | |
<|file_name|>boot.rs<|end_file_name|><|fim▁begin|>use arch::device_tree;
use arch::memory;
use klog;
const SERIAL_PORT_ADDRESS: usize = 0x0900_0000;
const DEVICE_TREE_ADDRESS: usize = 0x4000_0000;
// TODO: replace with a proper serial port handling code
fn write(s: &str) {
let ptr = SERIAL_PORT_ADDRESS as *mut u8... | |
<|file_name|>hrtb-parse.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.org/lice... | #![allow(unused_variables)]
#![allow(dead_code)]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.