prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>jquery.thumbs.js<|end_file_name|><|fim▁begin|>{
"name": "jquery.thumbs.js",
"url": "https://github.com/nfort/jquery.thumbs.js.git"<|fim▁hole|>}<|fim▁end|> | |
<|file_name|>tcpconnection.cpp<|end_file_name|><|fim▁begin|>//
// tcpconnection.cpp
//
// This implements RFC 793 with some changes in RFC 1122 and RFC 6298.
//
// Non-implemented features:
// dynamic receive window
// URG flag and urgent pointer
// delayed ACK
// queueing out-of-order TCP segments
// security/compartm... | |
<|file_name|>test-localizer.js<|end_file_name|><|fim▁begin|>import globalize from 'globalize';
import configure from '../src/configure';
export default function testLocalizer() {
function getCulture(culture){
return culture ? globalize.findClosestCulture(culture) : globalize.culture()
}
function shortDay(d... | let names = getCulture(culture).calendar.days.namesShort; |
<|file_name|>gen_sync.py<|end_file_name|><|fim▁begin|>#------------------------------------------------------------------------------
# Copyright (C) 2009 Richard Lincoln
#
# 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 b... | # >>> imports
|
<|file_name|>v1.js<|end_file_name|><|fim▁begin|>/**
* DO NOT EDIT THIS FILE as it will be overwritten by the Pbj compiler.
* @link https://github.com/gdbots/pbjc-php
*
* Returns an array of curies using mixin "gdbots:ncr:mixin:node-marked-as-draft:v1"
* @link http://schemas.triniti.io/json-schema/gdbots/ncr/mixin/... | */
export default [
]; |
<|file_name|>resource-cycle2.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... | unsafe {
let i1 = ~0xA;
let i1p = cast::transmute_copy(&i1); |
<|file_name|>NounPhraseTest.js<|end_file_name|><|fim▁begin|>var Nightmare = require('nightmare')
var NTU = require('./NightmareTestUtils')
const NounPhraseTest = (nightmare, delay) => {
return nightmare
// Can I open the addedit form and make it go away by clicking cancel?
.click('#add-np')... | module.exports = NounPhraseTest |
<|file_name|>server.js<|end_file_name|><|fim▁begin|>var express = require( 'express' ),
router = require( './router' );
var app = express();
app.set('port', (process.env.PORT || 3000));
router.define( app );
// Set up port
// ========================================================
app.listen(app.get('port'), fu... | }); |
<|file_name|>NukeDemoController.js<|end_file_name|><|fim▁begin|>define( [
'jquery',
'angular',
'json!nuke/data/dummy_model.json',<|fim▁hole|> 'text!nuke/demo.html'
], function( $, ng, dummyModel, dummyLayout, htmlDemoTemplate ) {
'use strict';
var module = ng.module( 'NukeDemoApp', [ 'nbe' ] )
.... | 'json!nuke/data/dummy_layout.json', |
<|file_name|>params.rs<|end_file_name|><|fim▁begin|>use valico::json_dsl;
use valico::json_schema;
use rustless::server::status;
use rustless::batteries::schemes;
use rustless::{Nesting};<|fim▁hole|>
#[test]
fn it_urldecodes_path_params() {
let app = app!(|api| {
api.prefix("api");
api.get("users/... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (C) 2008 John Paulett (john -at- paulett.org)
# Copyright (C) 2009, 2011, 2013 David Aguilar (davvid -at- gmail.com)
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have ... | # json.load(),loads(), dump(), dumps() compatibility |
<|file_name|>test_services.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 ... | host1_rp_uuid = self._get_provider_uuid_by_host('host1')
flavors = self.api.get_flavors()
flavor1 = flavors[0]
flavor2 = flavors[1] |
<|file_name|>ogone.py<|end_file_name|><|fim▁begin|># -*- coding: utf-'8' "-*-"
from hashlib import sha1
import logging
from lxml import etree, objectify
from pprint import pformat
import time
from urllib import urlencode
import urllib2
import urlparse
from openerp.addons.payment.models.payment_acquirer import Validat... | 'CARDNO',
'CCCTY', |
<|file_name|>expression.js<|end_file_name|><|fim▁begin|>import {LooseParser} from "./state"
import {isDummy} from "./parseutil"
import {tokTypes as tt} from ".."
const lp = LooseParser.prototype
lp.checkLVal = function(expr) {
if (!expr) return expr
switch (expr.type) {
case "Identifier":
case "MemberExpressi... | lp.toAssignableList = function(exprList, binding) {
for (let i = 0; i < exprList.length; i++)
exprList[i] = this.toAssignable(exprList[i], binding)
return exprList |
<|file_name|>test_inotify.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import os
import unittest
import inotify.constants
import inotify.calls
import inotify.adapters
import inotify.test_support
try:
unicode
except NameError:
_HAS_PYTHON2_UNICODE_SUPPORT = False
else:
_HAS_PYTHON2_UNICODE_SUPP... | |
<|file_name|>node_auth.go<|end_file_name|><|fim▁begin|>package kubernetes
import (
"crypto/x509"
"net/http"
"strings"
"time"
"github.com/golang/glog"
"k8s.io/kubernetes/pkg/auth/authenticator"
kauthorizer "k8s.io/kubernetes/pkg/auth/authorizer"
"k8s.io/kubernetes/pkg/auth/user"
unversionedauthentication "k8... | |
<|file_name|>controller_test.go<|end_file_name|><|fim▁begin|>// black-box testing
package router_test
import (
"testing"
"github.com/kataras/iris"
"github.com/kataras/iris/context"
"github.com/kataras/iris/core/router"
"github.com/kataras/iris/httptest"
)
type testController struct {
router.Controller
}
var ... | router.Controller |
<|file_name|>program_tree_version.py<|end_file_name|><|fim▁begin|>##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universiti... | try: |
<|file_name|>healthcheck_test.go<|end_file_name|><|fim▁begin|>package integration
import (
"bytes"
"net/http"
"os"
"time"
"github.com/containous/traefik/integration/try"
"github.com/go-check/check"
checker "github.com/vdemeester/shakers"
)
// HealthCheck test suites (using libcompose)
type HealthCheckSuite st... | // Verify frontend health : after
err = try.Request(frontendHealthReq, 3*time.Second, try.StatusCodeIs(http.StatusOK))
c.Assert(err, checker.IsNil)
|
<|file_name|>BinaryTreeLevelOrderTraversal2.py<|end_file_name|><|fim▁begin|><|fim▁hole|># self.left = None
# self.right = None
class Solution(object):
def levelOrderBottom(self, root):
list = []
self.helper(list, root, 0)
return list[::-1]
def helper(self, list, root,... | # Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x |
<|file_name|>TopologyTestRunResource.java<|end_file_name|><|fim▁begin|>/**
* Copyright 2017 Hortonworks.
*
* 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/licen... | TopologyTestRunCase testRunCase) {
testRunCase.setTopologyId(topologyId);
Long currentVersionId = catalogService.getCurrentVersionId(topologyId);
testRunCase.setVersionId(currentVersionId); |
<|file_name|>lib.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/. */
//! This module contains shared types and messages for use by dev... | pub timeStamp: u64,
pub error: bool, |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>try:
import arcpy.mapping
from ._publishing import (convert_desktop_map_to_service_draft as convert_map_to_service_draft,<|fim▁hole|><|fim▁end|> | convert_toolbox_to_service_draft)
except:
from ._publishing import (convert_pro_map_to_service_draft as convert_map_to_service_draft,
convert_toolbox_to_service_draft) |
<|file_name|>http.rs<|end_file_name|><|fim▁begin|>//! Pieces pertaining to the HTTP message protocol.
use std::borrow::Cow::{Borrowed, Owned};
use std::borrow::IntoCow;
use std::cmp::min;
use std::old_io::{self, Reader, IoResult, BufWriter};
use std::num::from_u16;
use std::str::{self, FromStr};
use std::string::CowStr... | }
|
<|file_name|>parse_fasta.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import string, copy
<|fim▁hole|>import sys
def read_fasta(afile, query_id=''):
"""Parses any fasta, a2m, a3m file, sequence or alignment file.
@param afile input file
@param query_id ID of query sequence (de... | |
<|file_name|>lda.py<|end_file_name|><|fim▁begin|>from mnist import MNIST
import numpy as np
from thirdparty import log_mvnpdf, log_mvnpdf_diag
data = MNIST('./data/mnist')
data.load_training()
data.load_testing()
train = np.array(data.train_images)/255.0
test = np.array(np.array(data.test_images)/255.0)
dataset = {i: ... | results[np.argmax(e)].append(data.train_labels[it])
print(results) |
<|file_name|>sysdiag.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
""" sysdiag
Pierre Haessig — September 2013
"""
from __future__ import division, print_function
<|fim▁hole|> '''
base = str(base).strip()
if base == '':
# avoid having '' as name (although it would not bre... | def _create_name(name_list, base):
'''Returns a name (str) built on `base` that doesn't exist in `name_list`.
Useful for automatic creation of subsystems or wires |
<|file_name|>misc.rs<|end_file_name|><|fim▁begin|>//! Miscellaneous type-system utilities that are too small to deserve their own modules.<|fim▁hole|>use crate::infer::InferCtxtExt as _;
use crate::traits::{self, ObligationCause};
use rustc_hir as hir;
use rustc_infer::infer::TyCtxtInferExt;
use rustc_middle::ty::{sel... | |
<|file_name|>windowManager.ts<|end_file_name|><|fim▁begin|>import { app, BrowserWindow } from 'electron';
import path from 'path';
import createLogger from './functions/createLogger';
import directoryPaths from './electronDirectoryPaths';
const viewDirectoryPath = directoryPaths.views;
const logger = createLogger('ele... | 하드웨어 메인 윈도우는 하드웨어 연결중인 경우는 꺼지지 않도록 기획되었다.
그러므로 close native event 가 발생했을 때, 렌더러에 다시 물어본 후
해당 값을 세팅 한 뒤 다시 close 를 호출 하는 식으로 종료한다.
*/ |
<|file_name|>test_autocomplete.py<|end_file_name|><|fim▁begin|># encoding: utf-8
from collections import namedtuple
import inspect
import keyword
import sys
try:
import unittest2 as unittest
except ImportError:
import unittest
try:
import jedi
has_jedi = True
except ImportError:
has_jedi = False
... | def __nonzero__(self):
raise ValueError("The truth value of an array with more than one "
"element is ambiguous. Use a.any() or a.all()")
|
<|file_name|>training_utils.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... | |
<|file_name|>generalizedaffineimage1.cc<|end_file_name|><|fim▁begin|>/* Test Octagonal_Shape::generalized_affine_image().
Copyright (C) 2001-2009 Roberto Bagnara <bagnara@cs.unipr.it>
This file is part of the Parma Polyhedra Library (PPL).
The PPL is free software; you can redistribute it and/or modify it
under th... | |
<|file_name|>jquery.bxslider.min.js<|end_file_name|><|fim▁begin|>/**
* BxSlider v4.1.2 - Fully loaded, responsive content slider
* http://bxslider.com
*
* Copyright 2014, Steven Wanderski - http://stevenwanderski.com - http://bxcreative.com
* Written while drinking Belgian ales and listening to jazz
*
* R... | |
<|file_name|>km.js<|end_file_name|><|fim▁begin|>OC.L10N.register(
"passman",
{
"General" : "ទូទៅ",
"Done" : "Done",
"Sharing" : "ការចែករំលែក",
"Share link" : "Share link",
"Username" : "ឈ្មោះអ្នកប្រើ",
"File" : "File",
"Add" : "បញ្ចូល",
"Type" : "Type",
"Size" : "ទំហំ",
... | "Export" : "នាំចេញ",
"Version" : "កំណែ",
"Import" : "នាំយកចូល", |
<|file_name|>iterable.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/licens... | impl<T> Iterable for Vec<T> { |
<|file_name|>utf8.cpp<|end_file_name|><|fim▁begin|>#include "utf8.hpp"
#include "utf8/utf8.h"
#include <cstring>
namespace core
{
UTF8String::UTF8String()
{}
UTF8String::UTF8String(const UTF8String& cp)
: m_src(cp.m_src)
{}
UTF8String::UTF8String(const std::string& src)
: m_src(sr... | |
<|file_name|>MetricSource.java<|end_file_name|><|fim▁begin|>package eu.uqasar.model.measure;
/*
* #%L
* U-QASAR
* %%
* Copyright (C) 2012 - 2015 U-QASAR Consortium
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
... |
public IModel<String> getLabelModel() {
return ResourceBundleLocator.getLabelModel(this.getClass(), this);
}
|
<|file_name|>building_block_factory.py<|end_file_name|><|fim▁begin|># Copyright 2019, The TensorFlow Federated 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.apa... | raise TypeError('Unsupported placement {}.'.format( |
<|file_name|>Operations.py<|end_file_name|><|fim▁begin|># This file is part of HamsiManager.
#
# Copyright (c) 2010 - 2015 Murat Demir <mopened@gmail.com>
#
# Hamsi Manager 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 ... | tagger.setArtist(artistName) |
<|file_name|>ScreenAction.java<|end_file_name|><|fim▁begin|>/*
* This file is part of Spoutcraft (http://wiki.getspout.org/).
*
* Spoutcraft 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 ... | package org.getspout.spout.packet;
|
<|file_name|>luapat.rs<|end_file_name|><|fim▁begin|>// translation of Lua 5.2 string pattern code
use errors::*;
use std::ptr::null;
pub const LUA_MAXCAPTURES: usize = 32;
/* maximum recursion depth for 'match' */
const MAXCCALLS: usize = 200;
const L_ESC: u8 = b'%';
fn add(p: CPtr, count: usize) -> CPtr {
unsa... | } else {
let init = self.capture[i].init;
match self.capture[i].len { |
<|file_name|>koa__cors-tests.ts<|end_file_name|><|fim▁begin|>import Koa = require('koa');
import cors = require('@koa/cors');
<|fim▁hole|><|fim▁end|> | const app = new Koa();
app.use(cors()); |
<|file_name|>fielderrors.go<|end_file_name|><|fim▁begin|>/*
Copyright 2014 The Kubernetes 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.apache.org/lice... | return &ValidationError{ValidationErrorTypeNotFound, field, value, ""}
}
func NewFieldTooLong(field string, value interface{}, maxLength int) *ValidationError { |
<|file_name|>index.d.ts<|end_file_name|><|fim▁begin|>// Type definitions for grasp 0.6
// Project: http://graspjs.com
// Definitions by: Isaac Wolkerstorfer <https://github.com/agnoster>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.1
/// <reference types="node" />
import... | type GraspSearchWithQueryEngine = ((selector: string, input: string) => Node[]) &
((selector: string) => (input: string) => Node[]); |
<|file_name|>feedfetcher.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
"feed fetcher"
from db import MySQLDatabase
from fetcher import FeedFetcher
def main():
db = MySQLDatabase()
fetcher = FeedFetcher()
feeds = db.get_feeds(offset=0, limit=10)
read_count = 10
while len(feeds) > 0:
fo... | |
<|file_name|>Uploader.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | //>>built
define("dojox/form/nls/el/Uploader",{label:"\u0395\u03c0\u03b9\u03bb\u03bf\u03b3\u03ae \u03b1\u03c1\u03c7\u03b5\u03af\u03c9\u03bd..."}); |
<|file_name|>test_buffers.py<|end_file_name|><|fim▁begin|>"""Test kytos.core.buffers module."""
import asyncio
from unittest import TestCase
from unittest.mock import MagicMock, patch
from kytos.core.buffers import KytosBuffers, KytosEventBuffer
# pylint: disable=protected-access
class TestKytosEventBuffer(TestCase)... | @patch('janus._SyncQueueProxy.full')
def test_full(self, mock_full):
"""Test full method to full and not full query.""" |
<|file_name|>webpack.config.js<|end_file_name|><|fim▁begin|>const path = require('path');
require('dotenv').config();
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const { AureliaPlugi... | |
<|file_name|>instr_vcvtps2uqq.rs<|end_file_name|><|fim▁begin|>use ::{BroadcastMode, Instruction, MaskReg, MergeMode, Mnemonic, OperandSize, Reg, RoundingMode};
use ::RegType::*;
use ::instruction_def::*;
use ::Operand::*;
use ::Reg::*;<|fim▁hole|>fn vcvtps2uqq_1() {
run_test(&Instruction { mnemonic: Mnemonic::VCVTP... | use ::RegScale::*;
use ::test::run_test;
#[test] |
<|file_name|>builder.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import os
import shutil
from jinja2 import Environment, FileSystemLoader
from webassets import Environment as AssetsEnvironment
from webassets.ext.jinja2 import AssetsExtension<|fim▁hole|>class TemplateBuilder(object):
def __init__(self... | from webassets.loaders import YAMLLoader
|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from flask import Blueprint<|fim▁hole|><|fim▁end|> |
error = Blueprint('error', __name__, )
from . import view |
<|file_name|>result.rs<|end_file_name|><|fim▁begin|>fn main() {
let a = String::from("hello");
run1(&a).unwrap();
run2(&a).unwrap();
}<|fim▁hole|> Err(x) => return Err(x),
};
let c = match bar(a) {
Ok(x) => x,
Err(x) => return Err(x),
};
let d = match baz(&b, c) {
... |
fn run1(a: &String) -> Result<(), String> {
let b = match foo(a) {
Ok(x) => x, |
<|file_name|>dev_poll_reactor.hpp<|end_file_name|><|fim▁begin|>//
// detail/dev_poll_reactor.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or ... |
namespace boost {
namespace asio {
namespace detail { |
<|file_name|>FragmentConnection.java<|end_file_name|><|fim▁begin|>package com.app.labeli;
import com.app.labeli.member.Member;
import net.tools.*;
import android.app.ProgressDialog;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.Fr... |
editTextLogin = (EditText) v.findViewById(R.id.fragment_connection_edit_text_login);
editTextPassword = (EditText) v.findViewById(R.id.fragment_connection_edit_text_password);
|
<|file_name|>translate-contributors.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
#
# 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 licens... |
# Log any warnings encountered in the process |
<|file_name|>bench_plot_parallel_pairwise.py<|end_file_name|><|fim▁begin|># Author: Mathieu Blondel <mathieu@mblondel.org>
# License: BSD 3 clause
import time
import matplotlib.pyplot as plt
from sklearn.utils import check_random_state
from sklearn.metrics.pairwise import pairwise_distances
from sklearn.metrics.pairw... | func(X, n_jobs=1)
one_core.append(time.time() - start)
|
<|file_name|>bill_wizard.js<|end_file_name|><|fim▁begin|>function $(id) { return document.getElementById(id); }
function retrieve_mbts() {
g.network.simple_request('FM_MBTS_RETRIEVE.authoritative',[ses(),g.mbts_id],
function(req) {
try {
g.mbts = req.getResultObject();
... | var mb_id = g.network.request(
api.FM_MB_CREATE.app,
api.FM_MB_CREATE.method,
[ ses(), billing ] |
<|file_name|>apps.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
from django.apps import AppConfig<|fim▁hole|><|fim▁end|> |
class ScannerEngineConfig(AppConfig):
name = 'scanner_engine' |
<|file_name|>resizing_array_queue.rs<|end_file_name|><|fim▁begin|>use std::iter;
use std::fmt;
use super::{QueueOfStrings, Queue};
const INITIAL_QUEUE_CAPACITY: usize = 2;
pub struct ResizingArrayQueueOfStrings {
q: Vec<Option<String>>,
head: usize,
tail: usize
}
impl ResizingArrayQueueOfStrings {
pu... | self.tail
} else {
self.tail + cap |
<|file_name|>nolinux.rs<|end_file_name|><|fim▁begin|>use super::TimerImpl;
use ffi::SystemError;
use reactor::Reactor;
use std::cmp;
use std::sync::atomic::{AtomicUsize, Ordering};
pub struct TimerCtl {<|fim▁hole|>}
impl TimerCtl {
pub fn new() -> Result<Self, SystemError> {
Ok(TimerCtl { timeout_nsec: A... | timeout_nsec: AtomicUsize, |
<|file_name|>eina.rs<|end_file_name|><|fim▁begin|>// Eina Rust bindings for EFL.
// Copyright (C) 2014 Luis Araujo <araujoc.luisf@gmail.com>
// 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 Found... | }
}
/* Inline list functions */ |
<|file_name|>OpenningState.java<|end_file_name|><|fim▁begin|>package com.cheng.zenofdesignpatterns.patterns.state.liftstate;
/**
* 在电梯门开启的状态下能做什么事情
*/
public class OpenningState extends LiftState {
// 开启当然可以关闭了,我就想测试一下电梯门开关功能
@Override
public void close() {
// 状态修改
super.context.setLiftState(LiftContext.clos... |
// 打开电梯门
@Override |
<|file_name|>classic.py<|end_file_name|><|fim▁begin|>import sys
import time
import json
import logging
import random
import tornado.options
from tornado.options import define, options
from tornado import gen
define('srp_root',default='http://192.168.56.1')
#define('srp_root',default='https://remote-staging.utorrent.co... | |
<|file_name|>client.go<|end_file_name|><|fim▁begin|>/*
Copyright 2018 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.<|fim▁hole|>
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or... | You may obtain a copy of the License at |
<|file_name|>0009_auto_20181105_2039.py<|end_file_name|><|fim▁begin|># Generated by Django 2.0.8 on 2018-11-05 20:39
from django.db import migrations
<|fim▁hole|> ]
operations = [
migrations.AlterModelOptions(
name='ticket',
options={'default_permissions': ('add', 'change', 'de... | class Migration(migrations.Migration):
dependencies = [
('tickets', '0008_auto_20180730_2035'), |
<|file_name|>logo.js<|end_file_name|><|fim▁begin|><|fim▁hole|> evt.preventDefault();
Meteor.swiperV.slideTo(0);
}
});<|fim▁end|> | Template.botanikaLogo.events({
'click .botanika-logo' (evt) { |
<|file_name|>build.rs<|end_file_name|><|fim▁begin|>// Copyright © 2015, Peter Atashian
// Licensed under the MIT License <LICENSE.md><|fim▁hole|><|fim▁end|> | extern crate build;
fn main() {
build::link("netsh", true)
} |
<|file_name|>model_control_one_enabled_Quantization_MovingMedian_Seasonal_DayOfWeek_LSTM.py<|end_file_name|><|fim▁begin|>import tests.model_control.test_ozone_custom_models_enabled as testmod
<|fim▁hole|>testmod.build_model( ['Quantization'] , ['MovingMedian'] , ['Seasonal_DayOfWeek'] , ['LSTM'] );<|fim▁end|> | |
<|file_name|>helper9.js<|end_file_name|><|fim▁begin|><|fim▁hole|>if (typeof(console.log) == "undefined") { console.log = function() { return 0; }; };
String.prototype.capitalize = function() {
return this.charAt(0).toUpperCase() + this.slice(1);
};
if(typeof jQuery !== "undefined")
jQuery.support.placeholder = ... | if (typeof(console) == "undefined") { console = {}; } |
<|file_name|>GpxFromInstructions.java<|end_file_name|><|fim▁begin|>/*
* Licensed to GraphHopper GmbH under one or more contributor
* license agreements. See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*
* GraphHopper GmbH licenses this file to you unde... | |
<|file_name|>sql_test.go<|end_file_name|><|fim▁begin|>// Copyright 2020 Google LLC
//
// 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
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// ... | |
<|file_name|>sc27.js<|end_file_name|><|fim▁begin|>var sc1 = {
//funhouse mirror
setup:function(){
// videoSetup();
tree = new TREE();
tree.generate({
joints: [5,3,1,10],
divs: [1],
start: [0,0,2,0],
angles: [0,Math.PI/2,1],
length: [20,15,4,1],
rads: [1,2,1,3],
width: [1... | } |
<|file_name|>ReconnectExecutor.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2019 NAVER Corp.
*
* 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/LICE... | final Executor dispatch = new Executor() {
@Override
public void execute(Runnable command) {
ReconnectExecutor.this.execute0(command); |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import datetime
from django.db.models import Q
from django.http import HttpResponse, HttpResponseServerError, Http404, HttpResponseNotFound, HttpResponseRedirect
from django.shortcuts import render_to_response, get_object_or_404
from django.core.urlresolvers import re... | created_by = request.user,
)
prod_event.save() |
<|file_name|>ssh.js<|end_file_name|><|fim▁begin|>var Bluebird = require('bluebird');<|fim▁hole|>var connection = require('./connection');
var errors = require('./errors');
var mockOptions = {};
var offlineMode = false;
module.exports.errors = errors;
module.exports.connect = function connect(options) {
if (offline... | |
<|file_name|>Markers.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2008 Ayman Al-Sairafi ayman.alsairafi@gmail.com
*
* 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://... | SimpleMarker hMarker = (SimpleMarker) hilites[i].getPainter();
if (marker == null || hMarker.equals(marker)) {
hilite.removeHighlight(hilites[i]);
} |
<|file_name|>test_plugin_slurm.py<|end_file_name|><|fim▁begin|># pylint: disable=missing-docstring
# this fails on Python 2.6 but Slurm environment is 2.7
import unittest
from datetime import datetime
from reporting.plugins.slurm import SlurmInput
class SlurmTestCase(unittest.TestCase):
"""Test cases for slurm m... | if 'user' in message and len(message['user'].strip()):
qualified_count -= 1 |
<|file_name|>test3.rs<|end_file_name|><|fim▁begin|>extern crate blurz;
use std::error::Error;
use std::time::Duration;
use std::thread;
use blurz::bluetooth_adapter::BluetoothAdapter as Adapter;
use blurz::bluetooth_device::BluetoothDevice as Device;
use blurz::bluetooth_discovery_session::BluetoothDiscoverySession a... | match test3() { |
<|file_name|>gyp_flag_compare.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Copyright 2014 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.
"""Given the output of -t commands from a ninja build for a gyp and GN g... | sorted(gn_files - gyp_files))
print '\nNote that flags will only be compared for files in both sets.\n'
file_list = gyp_files & gn_files
files_with_given_differences = {} |
<|file_name|>_visualizer.py<|end_file_name|><|fim▁begin|># ----------------------------------------------------------------------------
# Copyright (c) 2016-2017, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this sof... | filtered_group_comparisons.append(
['%s:%s' % (category, names[i]),
'%s:%s' % (category, names[j])])
kw_H_pairwise = pd.DataFrame( |
<|file_name|>PredicateWordRule.java<|end_file_name|><|fim▁begin|>/*
* Created on May 13, 2003
*========================================================================
* Modifications history
*========================================================================
* $Log: PredicateWordRule.java,v $
* Revision 1.... | public IToken evaluate(ICharacterScanner scanner, boolean resume) { |
<|file_name|>messages.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.desk.notifications import delete_notification_count_for
from frappe.core.docty... | |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>// @adjivas - github.com/adjivas. See the LICENSE<|fim▁hole|>// This file may not be copied, modified, or distributed
// except according to those terms.
#[macro_use]
extern crate clap;
extern crate pasteur;
/// Default* const arguments defined by CLI.
const DEFAULT_... | // file at the top-level directory of this distribution and at
// https://github.com/adjivas/pasteur
// |
<|file_name|>package-info.java<|end_file_name|><|fim▁begin|><|fim▁hole|>@org.osgi.annotation.bundle.Export
@org.osgi.annotation.versioning.Version("2.0.0")
package bndtools.editor.model;<|fim▁end|> | |
<|file_name|>event.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 dom::bindings::cell::DOMRefCell;
use dom::bindings::codegen... | |
<|file_name|>pipeline_builder.cpp<|end_file_name|><|fim▁begin|>#include "pipeline_builder.hpp"
#include "pipeline_state.hpp"
#include "shader.hpp"
#include "shader_signature.hpp"
#include "constants.hpp"
#include "../Common/texture_formats_common.hpp"
#include <set>
#include <algorithm>
namespace AgpuGL
{
void proces... | graphicsState->cullingMode = mapCullingMode(cullingMode);
|
<|file_name|>IP_SSATaucTaoTikhonovProblemLCL.cc<|end_file_name|><|fim▁begin|>// Copyright (C) 2012, 2014, 2015, 2016, 2017 David Maxwell and Constantine Khroulev
//
// This file is part of PISM.
//
// PISM is free software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License a... | }
IP_SSATaucTaoTikhonovProblemLCL::DesignVec::Ptr IP_SSATaucTaoTikhonovProblemLCL::designSolution() { |
<|file_name|>lhpFunctions.py<|end_file_name|><|fim▁begin|>import operator
def pozicijaSprite(broj, x_velicina):
#vraca pixel na kojem se sprite nalazi
pixel = broj * (x_velicina + 1) #1 je prazan red izmedu spritova
return(pixel)
#spriteSlova = ["A", "B", "C", "D", "E", "F", "G", "H", "i", "s", "e"]
spriteSlova... | for i in [i for i,x in enumerate(spriteSlova) if x == slovo]:
return(i) |
<|file_name|>IActivationFunctor.java<|end_file_name|><|fim▁begin|>package org.amse.marinaSokol.model.interfaces.object.net;
public interface IActivationFunctor {
/**
* Ôóíêöèÿ àêòèâàöèè
* @param x - ÷èñëî, ïîäàííîå íà ôóíêöèþ àêòèâàöèè
<|fim▁hole|>
/**
* ïðîèçâîäíàÿ ôóíêöèè àêòèâàöèè
... | * @return âûõîä íåéðîíà
* */
double getFunction(double x);
|
<|file_name|>urls.py<|end_file_name|><|fim▁begin|># Copyright 2015 IBM Corp.
#
# 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 requi... | ] |
<|file_name|>event_loop.rs<|end_file_name|><|fim▁begin|>use std::sync::{Arc, Condvar, Mutex};
use std::thread::spawn;
use std::time::{Duration, Instant};
use super::schedule_queue::*;
use super::scheduler::*;
#[derive(Clone)]
pub struct EventLoop {
queue: Arc<(Mutex<ScheduleQueue<Box<Action + Send>>>, Condvar)>,
}... | |
<|file_name|>Item.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2015 The Android Open Source Project
*
* 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.o... | public abstract Builder text1(String s);
public abstract Item build();
}
|
<|file_name|>mdi.py<|end_file_name|><|fim▁begin|># Touchy is Copyright (c) 2009 Chris Radek <chris@timeguy.com>
#
# Touchy 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 2 of the License, or
#... | 'G64' : [_('Continuous mode'), 'P'], |
<|file_name|>convert_computation.cc<|end_file_name|><|fim▁begin|>/* Copyright 2017 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.apache... | |
<|file_name|>error.rs<|end_file_name|><|fim▁begin|>use std::fmt;
#[derive(Debug, PartialEq, Clone)]
pub struct LexerError {
line: usize,
col: usize,
}
impl LexerError {
pub fn new(line: usize, col: usize) -> LexerError {
LexerError {
line: line,
col: col,
}
}
}
... | assert_eq!("Invalid syntax at 1:10", format!("{}", err));
} |
<|file_name|>test_rbac_resolvers.py<|end_file_name|><|fim▁begin|># Licensed to the StackStorm, Inc ('StackStorm') 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 ... |
def _insert_common_mocks(self):
self._insert_common_mock_users() |
<|file_name|>test_util.py<|end_file_name|><|fim▁begin|>import unittest
from tests.test_basic import BaseTestCase
from datetime import timedelta, datetime, tzinfo
class UTC(tzinfo):
"""UTC"""
def utcoffset(self, dt):
return timedelta(0)
def tzname(self, dt):<|fim▁hole|> return timedelta(0)... | return "UTC"
def dst(self, dt): |
<|file_name|>grp_java.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
# kate: space-indent on; indent-width 4; mixedindent off; indent-mode python;
java = [
{'name':'common',
'mainpackage':True,
'shortdesc':'Installs the latest version of Java',
'description':'',
'packa... | 'depends':['common'],
'packages-trusty':['openjdk-7-jre-headless', 'openjdk-8-jre-headless'], |
<|file_name|>datepicker.js<|end_file_name|><|fim▁begin|>/*! jQuery UI - v1.11.4 - 2015-12-06
* http://jqueryui.com
* Includes: core.js, datepicker.js
* Copyright jQuery Foundation and other contributors; Licensed MIT */
(function( factory ) {
if ( typeof define === "function" && define.amd ) {
// AMD. Register ... | onSelect: null, // Define a callback function when a date is selected
onChangeMonthYear: null, // Define a callback function when the month or year is changed
onClose: null, // Define a callback function when the datepicker is closed
numberOfMonths: 1, // Number of months to show at a time |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>/**
* Copyright 2015 CANAL+ Group
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.<|fim▁hole|> *
* Unless required by applicable law or agreed to in writing, software
* distribu... | * You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.