prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>app2.js<|end_file_name|><|fim▁begin|>/**
(function(){
window.saveUser();
saveBlog();
var util_v1 = new window.util_v1();
util_v1.ajax();
test1();
test2();
test3(); //当$(function(){window.test3=fn});时,报错!
test4();
})();
**/
/**
(function(w){
w.saveUser();
saveBlog();
var util_v1 = new w.ut... | |
<|file_name|>EllipsisSpec.js<|end_file_name|><|fim▁begin|><|fim▁hole|> expect(moj.Modules.CaseCreation.init).toBeDefined();
});
});<|fim▁end|> | describe('Modules.Ellipsis.js', function() {
it('should exist with expected constructures', function() { |
<|file_name|>NET_Client.cpp<|end_file_name|><|fim▁begin|>#include "stdafx.h"
#include "NET_Common.h"
#include "net_client.h"
#include "net_server.h"
#include "net_messages.h"
#include "NET_Log.h"
#include "../xr_3da/xrGame/battleye.h"
#pragma warning(push)
#pragma warning(disable:4995)
#include <malloc.h>
#include "dx... | NET_Packet* INetQueue::Create (const NET_Packet& _other)
{
NET_Packet* P = 0; |
<|file_name|>encryption.rs<|end_file_name|><|fim▁begin|>use std::fs::{File, remove_file};<|fim▁hole|>use std::io::{ErrorKind, Read, Write};
use hyper::Client as HyperClient;
use rusoto_core::{
ChainProvider,
DispatchSignedRequest,
ProvideAwsCredentials,
Region,
default_tls_client,
};
use rusoto_kms... | |
<|file_name|>Settings.js<|end_file_name|><|fim▁begin|>import React, { useCallback, useState } from 'react';
import { css } from 'emotion';
import { Button, Col, Input, Row } from 'reactstrap';
import Localized from 'components/Localized/Localized';
import LocationsCount from 'components/LocationsCount/LocationsCount';
... | <DefaultLocationsList version={2} onSelectAll={selectAllLocations} onDeselectAll={deselectAllLocations} />
<CustomLocationsList onSelectAll={selectAllLocations} onDeselectAll={deselectAllLocations} />
</>
)} |
<|file_name|>metadata.py<|end_file_name|><|fim▁begin|># (c) 2014 Michael DeHaan, <michael@ansible.com>
#
# 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 versio... | if ds: |
<|file_name|>TimeUtility.js<|end_file_name|><|fim▁begin|>'use strict';
/**
* @module br/test/TimeUtility
*/
var Errors = require('br/Errors');
/**
* @private
* @class
* @alias module:br/test/TimeUtility
*
* @classdesc
* Utility class containing static methods that can be useful for controlling time in tests.... | };
module.exports = TimeUtility; |
<|file_name|>yamsdaq_models.py<|end_file_name|><|fim▁begin|>from sqlalchemy import Column, ForeignKey, Integer, String, Text, DateTime, Float
from models import Base, Account
from sqlalchemy.orm import relationship
from datetime import datetime
# STOCK EXCHANGE
class Company(Base):
__tablename__ = 'companies'
... | Account.owned_stocks = relationship('Stock', back_populates="owner", cascade="all, delete, delete-orphan") |
<|file_name|>vktImageTests.cpp<|end_file_name|><|fim▁begin|>/*------------------------------------------------------------------------
* Vulkan Conformance Tests
* ------------------------
*
* Copyright (c) 2016 The Khronos Group Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may ... | imageTests->addChild(createImageAtomicOperationTests(testCtx)); |
<|file_name|>detector2dview.py<|end_file_name|><|fim▁begin|># Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source
# & Institut Laue - Langevin
# SPDX - License - Identifie... | |
<|file_name|>async_call_cpp.cc<|end_file_name|><|fim▁begin|>// NOLINT(namespace-envoy)
#include <string>
#include <unordered_map>
#include "proxy_wasm_intrinsics.h"
class ExampleContext : public Context {
public:
explicit ExampleContext(uint32_t id, RootContext* root) : Context(id, root) {}
FilterHeadersStatus o... | |
<|file_name|>db.py<|end_file_name|><|fim▁begin|>from peewee import * # no other way to reach playhouse :(
from playhouse import flask_utils as peewee_flask_utils<|fim▁hole|><|fim▁end|> | from playhouse import signals as peewee_signals
database = peewee_flask_utils.FlaskDB() |
<|file_name|>channel_test.go<|end_file_name|><|fim▁begin|>// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
package api
import (
"github.com/mattermost/platform/model"
"github.com/mattermost/platform/store"
"github.com/mattermost/platform/utils"
"net/http"
"s... | t.Fatal("shouldn't be able to join secret group")
}
rchannel := Client.Must(Client.CreateDirectChannel(th.BasicUser.Id)).Data.(*model.Channel) |
<|file_name|>customelementregistry.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::callback::CallbackContainer;... | match self.definitions.borrow().get(&name) {
Some(definition) => {
rooted!(in(cx) let mut constructor = UndefinedValue());
definition.constructor.to_jsval(cx, constructor.handle_mut()); |
<|file_name|>imports.ts<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import * as ts from 'typescript';
import {ModuleResolver} from ... | const next = new Found(importedFile, current);
if (next.sourceFile === end) { |
<|file_name|>entry.rs<|end_file_name|><|fim▁begin|>//
// imag - the personal information management suite for the commandline
// Copyright (C) 2015, 2016 Matthias Beyer <mail@beyermatthias.de> and contributors
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Le... | // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
//
|
<|file_name|>dt.py<|end_file_name|><|fim▁begin|>"""Helper methods to handle the time in Home Assistant."""
from __future__ import annotations
from contextlib import suppress
import datetime as dt
import re
from typing import Any, cast
import ciso8601<|fim▁hole|>import pytz.tzinfo as pytzinfo
from homeassistant.const... | import pytz
import pytz.exceptions as pytzexceptions |
<|file_name|>test_list_floating_ips_negative.py<|end_file_name|><|fim▁begin|># Copyright 2012 OpenStack Foundation
# 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... |
CONF = config.CONF
|
<|file_name|>NetworkManager.cpp<|end_file_name|><|fim▁begin|>/*
* This file is part of the CMaNGOS Project. See AUTHORS file for Copyright information
*
* 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 ... |
#include "Common.h"
#include "NetworkManager.h"
#include "NetworkThread.h" |
<|file_name|>payment_app_info_fetcher.cc<|end_file_name|><|fim▁begin|>// Copyright 2017 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 "content/browser/payments/payment_app_info_fetcher.h"
#include <limits>
#i... | base::SequencedTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::BindOnce(std::move(callback_),
std::move(fetched_payment_app_info_)));
delete this; |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Copyright 2017 Eser Aygün
//
// 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... | |
<|file_name|>test_web_provider.py<|end_file_name|><|fim▁begin|># Copyright (c) 2011, Found IT A/S and Piped Project Contributors.
# See LICENSE for details.
import json
from StringIO import StringIO
from twisted.application import service
from twisted.internet import defer, address
from twisted.python import filepath,... | )
)
)
) |
<|file_name|>GLRenderManager.ts<|end_file_name|><|fim▁begin|>/**
* @module Kiwi
* @submodule Renderers
* @main Renderers
* @namespace Kiwi.Renderers
*/
module Kiwi.Renderers {
/**
* Manages all rendering using WebGL.
* Directly manages renderer objects, including factory methods
* for their creation.
* Creates... |
this._batches = []; |
<|file_name|>lab.py<|end_file_name|><|fim▁begin|>###
# #%L
# Artimate Model Compiler
# %%
# Copyright (C) 2011 - 2012 INRIA
# %%
# 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 ... | self.start = float(start)
self.end = float(end) |
<|file_name|>doc.go<|end_file_name|><|fim▁begin|>// Copyright (c) 2016 Tristan Colgate-McFarlane
//
// This file is part of hugot.
//
// hugot 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... | //
// In addition to these basic handlers some more complex handlers are supplied. |
<|file_name|>room.rs<|end_file_name|><|fim▁begin|>use diesel;
use diesel::pg::PgConnection;
use regex::Regex;
use rocket::http::Status;
use rocket::response::Failure;
use super::schema::rooms;
use player::play_video_thread;
#[derive(Clone, Serialize, Deserialize, Queryable, Identifiable)]
pub struct Room {
pub id:... | }
Err(_) => Err(Failure(Status::Conflict)),
}
} |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#![deny(missing_docs)]
//! Bootstrapped meta rules for mathematical notation.
extern crate range;
extern crate piston_meta;
use piston_meta::Syntax;
pub mod interpreter;
/// Gets the syntax rules.
pub fn syntax_rules() -> Syntax {
use piston_meta::*;
let me... |
#[cfg(test)]
mod tests { |
<|file_name|>UnknownRoleException.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2005-2014 The Kuali Foundation
*
* Licensed under the Educational Community License, Version 2.0 (the "License");<|fim▁hole|> * you may not use this file except in compliance with the License.
* You may obtain a copy of the License ... | |
<|file_name|>content.js<|end_file_name|><|fim▁begin|>(function (w) {
var MIN_LENGTH = 4;
if (w.self != w.top) {
return;
}
function colorize(config) {
if ((config.enabled && config.disallowed && config.disallowed.indexOf(w.location.hostname)!== -1) ||
(!config.enabled && (!config.allowed || con... | if (element.nodeType === Node.TEXT_NODE && (/\S/.test(element.nodeValue))) { |
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*-
# Copyright (c) 2017-2021 THL A29 Limited, a Tencent company. 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 ... | if len(memeber_set) > 0: |
<|file_name|>GameResultGui.java<|end_file_name|><|fim▁begin|>package com.github.lg198.codefray.jfx;
import com.github.lg198.codefray.api.game.Team;
import com.github.lg198.codefray.game.GameEndReason;
import com.github.lg198.codefray.game.GameStatistics;
import com.github.lg198.codefray.util.TimeFormatter;
import java... | key.setStyle("-fx-font-size: 20px");
value.setStyle(key.getStyle()); |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>//! Iota
//!
//! A highly customisable text editor built with modern hardware in mind.
//!
//! This module contains all you need to create an `iota` executable.
#![cfg_attr(feature="clippy", feature(plugin))]
#![cfg_attr(feature="clippy", plugin(clippy))]
#![warn(missin... | mod command;
mod textobject; |
<|file_name|>fsu-moves-and-copies.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.... | assert_eq!(*b.moved, 13);
assert_eq!(c.copied, 14);
assert_eq!(*c.moved, 12);
} |
<|file_name|>security-check.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Perform basic ELF security checks on a ser... | |
<|file_name|>static-ctor-not-thread-safe.cpp<|end_file_name|><|fim▁begin|>// Copyright (c) 2014, Ruslan Baratov
// All rights reserved.
class Foo {
public:
Foo() {
}
};
int main() {
#include <leathers/push>
<|fim▁hole|>#endif
static Foo foo;
#include <leathers/pop>
}<|fim▁end|> | #if !defined(SHOW_WARNINGS)
# include <leathers/static-ctor-not-thread-safe>
|
<|file_name|>PasswordUIField.ts<|end_file_name|><|fim▁begin|>module kit.fields {
export class PasswordUIField extends TextUIField {
<|fim▁hole|> super(id, value, required, readOnly)
this.inputTemplate = "ui-field-password-template"
}
}
}<|fim▁end|> | constructor(id: string, value: any, required?: boolean, readOnly?: boolean) { |
<|file_name|>mpeg.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# enzyme - Video metadata parser
# Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com>
# Copyright 2003-2006 Thomas Schueppel <stain@acm.org>
# Copyright 2003-2006 Dirk Meyer <dischi@freevo.org>
#
# This file is part of enzyme.
#
# enzyme is... | _id = indexbytes(buffer, offset + 3)
if _id == PADDING_PKT:
return offset + (indexbytes(buffer, offset + 4) << 8) + \ |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># coding: utf-8
from flask import Blueprint
user = Blueprint('user', __name__)
<|fim▁hole|><|fim▁end|> | from . import views |
<|file_name|>goceditor.py<|end_file_name|><|fim▁begin|>#coding=UTF-8
"""
This file is part of GObjectCreator.
GObjectCreator 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
(a... | |
<|file_name|>dfp_utils_test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#
# Copyright 2013 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... | 'second': '02',
'timeZoneID': 'GMT'},
'Value_Type': 'DateTimeValue'}]}]
|
<|file_name|>raw.py<|end_file_name|><|fim▁begin|># Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Matti Hämäläinen <msh@nmr.mgh.harvard.edu>
# Martin Luessi <mluessi@nmr.mgh.harvard.edu>
# Denis Engemann <denis.engemann@gmail.com>
# Teon Brooks <teon.brooks@gmail.com>
#
... | self._read_raw_file(next_fname, allow_maxshield,
preload, do_check_ext) |
<|file_name|>hints_processing_util_unittest.cc<|end_file_name|><|fim▁begin|>// Copyright 2019 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 "components/optimization_guide/hints_processing_util.h"
#include "co... | ConvertProtoEffectiveConnectionType( |
<|file_name|>es_predict.py<|end_file_name|><|fim▁begin|>import json
import requests
from transliterate import translit
_eng_chars = "~!@#$%^&qwertyuiop[]asdfghjkl;'zxcvbnm,./QWERTYUIOP{}ASDFGHJKL:\"|ZXCVBNM<>?"
_rus_chars = "ё!\"№;%:?йцукенгшщзхъфывапролджэячсмитьбю.ЙЦУКЕНГШЩЗХЪФЫВАПРОЛДЖЭ/ЯЧСМИТЬБЮ,"
_trans_table = ... | |
<|file_name|>26_1.rs<|end_file_name|><|fim▁begin|>/*
重载
*/
void func(int& a)
{
printl 'func int'
}
<|fim▁hole|>{
printl 'func char'
}
void main()
{
func int()
func char()
}<|fim▁end|> |
void func(char& a)
|
<|file_name|>NativeRoleMappingStore.java<|end_file_name|><|fim▁begin|>/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
package ... | loadMappings(listener);
} else { |
<|file_name|>thrSMA.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Created on Tue Nov 03 13:06:56 2015
@author: Eunice
"""
if __name__ == '__main__':
import sys
sys.path.append("..")
from engine import bar
# 以上模块仅测试用
from engine.broker.fillstrategy import DefaultStrategy
from engine.broker.ba... | |
<|file_name|>PhotoListActivity.java<|end_file_name|><|fim▁begin|>package com.jmbsystems.fjbatresv.mascotassociales.photoList.ui;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;
import android.provider.MediaStore;
import android.support.design.widge... | |
<|file_name|>try-is-identifier-edition2015.rs<|end_file_name|><|fim▁begin|>// Copyright 2018 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://... | let try = 2;
struct try { try: u32 }; |
<|file_name|>fixtures.go<|end_file_name|><|fim▁begin|>package testing
import (
"fmt"
"net/http"
"testing"
"github.com/gophercloud/gophercloud/openstack/objectstorage/v1/containers"
th "github.com/gophercloud/gophercloud/testhelper"
fake "github.com/gophercloud/gophercloud/testhelper/client"
)
// ExpectedListIn... | func HandleListContainerNamesSuccessfully(t *testing.T) {
th.Mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
th.TestMethod(t, r, "GET")
th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) |
<|file_name|>Gruntfile.js<|end_file_name|><|fim▁begin|>module.exports = function( grunt ) {
// Project configuration.
grunt.initConfig(
{
pkg : grunt.file.readJSON( "bower.json" ),
jshint : {
options : {
jshintrc : true
},
src : {
src : [
"src/*.js"
]
}
},
ugl... | }; |
<|file_name|>guiutil.cpp<|end_file_name|><|fim▁begin|>#include <QApplication>
#include "guiutil.h"
#include "bitcoinaddressvalidator.h"
#include "walletmodel.h"
#include "bitcoinunits.h"
#include "util.h"
#include "init.h"
#include <QDateTime>
#include <QDoubleValidator>
#include <QFont>
#include <QLineEdit>
#if QT... | void copyEntryData(QAbstractItemView *view, int column, int role) |
<|file_name|>codeworld_shared.js<|end_file_name|><|fim▁begin|>/*
* Copyright 2017 The CodeWorld 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
*
* ht... | showCancelButton: true,
confirmButtonColor: '#DD6B55', |
<|file_name|>InstanceBodyReader.java<|end_file_name|><|fim▁begin|>package com.sirma.itt.seip.rest.handlers.readers;
import static com.sirma.itt.seip.rest.utils.request.params.RequestParams.PATH_ID;
import java.io.IOException;
import java.io.InputStream;
import java.lang.annotation.Annotation;
import java.lang.reflect... | import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.ext.MessageBodyReader;
import javax.ws.rs.ext.Provider; |
<|file_name|>TeamMatch.ts<|end_file_name|><|fim▁begin|>import {Team} from "./Team";
import {ParticipantMatch} from "./ParticipantMatch";
export interface TeamMatch {
id?: string;
round: number;
teamOne: Team;
teamTwo: Team;
participantMatches?: ParticipantMatch[];
section: number;
scoreTeamOne: numb... |
scoreTeamOne: json.scoreTeamOne ? json.scoreTeamOne : 0,
scoreTeamTwo: json.scoreTeamTwo ? json.scoreTeamTwo : 0, |
<|file_name|>memuserkernel-r0drv-darwin.cpp<|end_file_name|><|fim▁begin|>/* $Id: memuserkernel-r0drv-darwin.cpp $ */
/** @file
* IPRT - User & Kernel Memory, Ring-0 Driver, Darwin.
*/
/*
* Copyright (C) 2009 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from htt... |
/*******************************************************************************
* Header Files * |
<|file_name|>application.py<|end_file_name|><|fim▁begin|>import yaml
import tornado.web
import elephunk.handlers
import elephunk.database<|fim▁hole|>import elephunk.ui_modules
def create(port, debug, config_file):
with open(config_file, 'r') as f:
config = yaml.load(f.read())
application = tornado.we... | import elephunk.ui_methods |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>let screenshotsCounter = 0;
<|fim▁hole|>export const saveScreenshot = (name?:string) => {
if (name === undefined){
name = screenshotsCounter++ + '.png';
}
browser.saveScreenshot('./app/tests/selenium/_screenshots/' + name);
};<|fim▁end|> | |
<|file_name|>issue-2927.rs<|end_file_name|><|fim▁begin|>// rustfmt-edition: 2018
#![feature(rust_2018_preview, uniform_paths)]
use futures::prelude::*;<|fim▁hole|>use ::log::{error, info, log};
use structopt::StructOpt;<|fim▁end|> | use http_03::cli::Cli;
use hyper::{service::service_fn_ok, Body, Response, Server}; |
<|file_name|>restclient.module.js<|end_file_name|><|fim▁begin|>/*
* JBoss, Home of Professional Open Source.
* Copyright 2014-2020 Red Hat, Inc., and individual contributors
* as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except i... |
// TODO: Remove this unnecessary layer of indirection.
module.factory('REST_BASE_URL', [
'restConfig', |
<|file_name|>dpo.src.js<|end_file_name|><|fim▁begin|>/**
* @license Highstock JS v8.0.3 (2020-03-06)
*
* Indicator series type for Highstock
*
* (c) 2010-2019 Wojciech Chmiel
*
* License: www.highcharts.com/license
*/
'use strict';
(function (factory) {
if (typeof module === 'object' && module.exports) {
... | |
<|file_name|>area.rs<|end_file_name|><|fim▁begin|>use xpath_reader::{FromXml, Error, Reader};
use crate::entities::{Mbid, Resource};
use crate::client::Request;
<|fim▁hole|>enum_mb_xml! {
/// Specifies what a specific `Area` instance actually is.
pub enum AreaType {
/// Areas included (or previously in... | |
<|file_name|>p144.py<|end_file_name|><|fim▁begin|>inside = lambda x, y: 4*x*x+y*y <= 100
def coll(sx, sy, dx, dy):
m = 0
for p in range(32):<|fim▁hole|> return (sx + dx*m, sy + dy*m)
def norm(x, y):
l = (x*x + y*y)**0.5
return (x/l, y/l)
sx, sy = 0, 10.1
dx, dy = 1.4, -19.7
for I in range(999):
... | m2 = m + 2**(-p)
if inside(sx + dx * m2, sy + dy * m2): m = m2 |
<|file_name|>RedisSessionConfiguration.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2012-2017 the original author or 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
*
* ... | import org.springframework.session.data.redis.RedisOperationsSessionRepository;
import org.springframework.session.data.redis.config.annotation.web.http.RedisHttpSessionConfiguration; |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>import { Graphics } from '@pixi/graphics';
import { drawTorus } from './drawTorus';
import { drawChamferRect } from './drawChamferRect';
import { drawFilletRect } from './drawFilletRect';
import { drawRegularPolygon } from './drawRegularPolygon';
export interface IGra... | |
<|file_name|>solarxyz.js<|end_file_name|><|fim▁begin|>/**
* @copyright 2013 Sonia Keys
* @copyright 2016 commenthol
* @license MIT
* @module solarxyz
*/
/**
* Solarxyz: Chapter 26, Rectangular Coordinates of the Sun.
*/
import base from './base.js'
import nutation from './nutation.js'
import solar from './solar.... | const zz = cθ
return {
x: xx * x0 + yx * y0 + zx * z0,
y: xy * x0 + yy * y0 + zy * z0, |
<|file_name|>insertion.js<|end_file_name|><|fim▁begin|>const ESCAPES = {
u: (flags) => {
flags.lowercaseNext = false
flags.uppercaseNext = true
},
l: (flags) => {
flags.uppercaseNext = false
flags.lowercaseNext = true
},
U: (flags) => {
flags.lowercaseAll = false
flags.uppercaseAll = t... | n: (flags, result) => {
result.push('\\n')
},
$: (flags, result) => { |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>extern crate messengerdep;
pub struct Messenger {
message: String,
}
impl Messenger {
pub fn new(message: &str) -> Messenger {
Messenger { message: message.to_string(), }
}<|fim▁hole|> println!("I have a message to deliver to you: {}", &self.... |
pub fn deliver(&self) { |
<|file_name|>coherence-blanket-conflicts-with-specific-multidispatch.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 <LI... | fn get(&self) -> uint { (*self).clone() }
} |
<|file_name|>FamilyGroupTest.ts<|end_file_name|><|fim▁begin|>import { assert, UnitTest } from '@ephox/bedrock';
import { DomUniverse } from '@ephox/boss';
import { Document } from '@ephox/dom-globals';
import { Arr, Fun } from '@ephox/katamari';
import { Element, Text } from '@ephox/sugar';
import * as Family from 'eph... | |
<|file_name|>htmlbuttonelement.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::activation::Activatable;
use dom::attr::At... | |
<|file_name|>file_info_local.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
extract FileInfo object for local files
"""
from __future__ import (absolute_import, division, print_function, unicode_literals)
import multiprocessing as mp
from concurrent.futures import ProcessPoolExecutor... | FileInfo.__init__(self, fn=absfn, url=_url, md5=md5, sha1=sha1, fs=fs, in_tuple=in_tuple)
def get_md5(self):
""" Wrapper around sync_utils.get_md5 """ |
<|file_name|>makeNewArray.java<|end_file_name|><|fim▁begin|><|fim▁hole|> /** Generate code to create an array with given element type and number
* of dimensions.
*/
Item makeNewArray(DiagnosticPosition pos, Type type, int ndims) {
try {//我加上的
DEBUG.P(this,"makeNewArray(3)");
DEBUG.P("type="+type);
... | //where |
<|file_name|>GameStates.py<|end_file_name|><|fim▁begin|>from StateMachine.State import State<|fim▁hole|>class StateT(State):
state_stack = list()
game_data = GameData()
def __init__(self):
self.transitions = None
def next(self, input):
if self.transitions.has_key(input):
ret... | from StateMachine.StateMachine import StateMachine
from StateMachine.InputAction import InputAction
from GameData.GameData import GameData
|
<|file_name|>solution_11.py<|end_file_name|><|fim▁begin|>"""Largest product in a grid
In the 20×20 grid below, four numbers along a diagonal line have been marked in red.
08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08
49 49 99 40 17 81 18 57 60 87 17 40 98 43 69 48 04 56 62 00
81 49 31 73 55 79 14 29 93 ... |
Arguments:
serialized (str): Serialized representation of a grid of integers.
adjacent (int): How many adjacent numbers to consider. |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>/*
* This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.
* License: AGPLv3 s.t. "Commons Clause" – see LICENSE.md for details
*/
<|fim▁hole|>import "./enter";
import "./shift-enter";
import "./select-all";
import "./spacebar";
import "./tab";
import "./ar... | export { getHandler } from "./register";
import "./backspace"; |
<|file_name|>Contact.java<|end_file_name|><|fim▁begin|>package au.gov.ga.geodesy.sitelog.domain.model;
import javax.validation.constraints.Size;
/**
* http://sopac.ucsd.edu/ns/geodesy/doc/igsSiteLog/contact/2004/baseContactLib.xsd:contactType<|fim▁hole|> */
public class Contact {
private Integer id;
@Size(ma... | |
<|file_name|>Demo.java<|end_file_name|><|fim▁begin|>/**
* This is a demo class
*
* @author Ravi
*/
public class Demo
{
<|fim▁hole|> *
* @param args
*/
public static void main(String[] args)
{
System.out.println("This is a demo.");
}
}<|fim▁end|> | /**
* This is the main method
|
<|file_name|>test_socket.rs<|end_file_name|><|fim▁begin|>use nix::sys::socket::{InetAddr, UnixAddr, getsockname};
use std::{mem, net};
use std::path::Path;
use std::str::FromStr;
use std::os::unix::io::{AsRawFd, RawFd};
use ports::localhost;
#[test]
pub fn test_inetv4_addr_to_sock_addr() {
let actual: net::SocketA... | .unwrap();
write(fd1, b"hello").unwrap(); |
<|file_name|>MeshInformation.py<|end_file_name|><|fim▁begin|>"""Gets information about the mesh of a case. Makes no attempt to manipulate
the mesh, because this is better left to the OpenFOAM-utilities"""
from PyFoam.RunDictionary.SolutionDirectory import SolutionDirectory
from PyFoam.RunDictionary.ListFile import Lis... | |
<|file_name|>test_protocols.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import pytest
from tinyrpc.protocols.jsonrpc import JSONRPCProtocol
from tinyrpc import RPCErrorResponse
@pytest.fixture(params=['jsonrpc'])
def protocol(request):
if 'jsonrpc':
return JSONRPCProtoc... | req = protocol.create_request('foo', ['bar'])
err_rep = req.error_respond(Exception('foo'))
|
<|file_name|>roles.py<|end_file_name|><|fim▁begin|>from django import template
from manage_treemap.views.roles import options_for_permission
from treemap.audit import FieldPermission
from treemap.lib.object_caches import role_field_permissions<|fim▁hole|>
register = template.Library()
@register.filter
def photo_per... | |
<|file_name|>assigning_non_slot.py<|end_file_name|><|fim▁begin|>""" Checks assigning attributes not found in class slots
will trigger assigning-non-slot warning.
"""
# pylint: disable=too-few-public-methods, no-init, missing-docstring, no-absolute-import, import-error
from collections import deque
from missing import ... | __slots__ = ['a']
|
<|file_name|>UserActivityTest.java<|end_file_name|><|fim▁begin|>package fr.xebia.unittestwithdagger;
import android.widget.TextView;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.Robolectric;
import org.robolectric.RobolectricTestRunner;
import org.robolectric... | |
<|file_name|>test_threading.py<|end_file_name|><|fim▁begin|>import cx_Logging
import os
import sys
import threading
if len(sys.argv) > 1:
numThreads = int(sys.argv[1])
else:
numThreads = 5
if len(sys.argv) > 2:
numIterations = int(sys.argv[2])
else:
numIterations = 1000
def Run(threadNum):
cx_Logg... | thread = threading.Thread(target = Run, args = (i + 1,)) |
<|file_name|>cache.rs<|end_file_name|><|fim▁begin|>use std::rc::Rc;
use std::cell::RefCell;
use super::types;
/// Evaluation cache. Know how to store reference for a particular execution context: environment of table.
/// Called to speedup execution of block cycles
#[derive(Debug, Clone, Default)]
pub struct Cache {
... | } |
<|file_name|>script.js<|end_file_name|><|fim▁begin|>// autocomplet : this function will be executed every time we change the text
function autocomplet() {
var min_length = 0; // min caracters to display the autocomplete
var keyword = $('#code0').val();
if (keyword.length >= min_length) {
$.ajax({
url: 'ajax_ref... | //================================================== End of desc8 ====================================================== |
<|file_name|>bindscene.cpp<|end_file_name|><|fim▁begin|>//
// This source file is part of appleseed.
// Visit https://appleseedhq.net/ for additional information and resources.
//
// This software is released under the MIT license.
//
// Copyright (c) 2012-2013 Esteban Tovagliari, Jupiter Jazz Limited
// Copyright (c) ... | }
|
<|file_name|>MalwareBazaar.py<|end_file_name|><|fim▁begin|>import copy
import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
QUERIES = {
"tag": "get_taginfo",
"signature": "get_siginfo",
"file_type": "get_file_type",
"clamav": "get_clamavinfo",
"imphash": "get_i... |
reliability = demisto.params().get('integrationReliability', DBotScoreReliability.A) |
<|file_name|>htmloptgroupelement.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::attr::Attr;
use dom::attr::AttrHelpers;
... | |
<|file_name|>gulpfile.js<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright 2016 The Lovefield Project 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... | |
<|file_name|>deriving-zero.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.... | #[deriving(Zero)]
struct C(int, int); |
<|file_name|>test_coercion.py<|end_file_name|><|fim▁begin|>"""
Tests for values coercion in setitem-like operations on DataFrame.
For the most part, these should be multi-column DataFrames, otherwise
we would share the tests with Series.
"""
import numpy as np
import pytest
import pandas as pd
from pandas import (
... | # TODO: i think this isn't about MultiIndex and could be done with iloc? |
<|file_name|>LocationAddSelectFragment.java<|end_file_name|><|fim▁begin|>package com.faralot.core.ui.fragments;
<|fim▁hole|>import android.app.AlertDialog.Builder;
import android.app.Fragment;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
... | import android.app.Activity; |
<|file_name|>exhaustive_natural_range.rs<|end_file_name|><|fim▁begin|>use itertools::Itertools;
use malachite_base::num::basic::traits::{One, Zero};
use malachite_base::num::conversion::traits::ExactFrom;
use malachite_base::strings::ToDebugString;
use malachite_nz::natural::exhaustive::exhaustive_natural_range;
use ma... | exhaustive_natural_range_helper(
Natural::ZERO,
Natural::exact_from(10), |
<|file_name|>TestHttp2Section_6_1.java<|end_file_name|><|fim▁begin|>/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file t... | } |
<|file_name|>problem005.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# pylint: disable=invalid-name
"""
2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.
What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?
""... | while(notfound):
notfound = False
val = val + 1
for n in range(1, self.range): |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>var names = Alloy.Collections.name;
function green(str) { return '\x1B[32m' + str + '\x1B[39m'; }
function red(str) { return '\x1B[31m' + str + '\x1B[39m'; }
// show the info from the selected model
function showInfo(e) {
// get the model id from the list item
var ... | model.fetch({ id: modelId });
|
<|file_name|>mod.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/. */
//! Common [values][values] used in CSS.
//!
//! [values]: https:... | if excluding.iter().any(|s| ident.eq_ignore_ascii_case(s)) { |
<|file_name|>11.cpp<|end_file_name|><|fim▁begin|>#include <iostream>
#include <math.h>
#include <vector>
using namespace std;
#define ADJACENT_DIGITS_NUM 4
#define ROW_COL_LENGTH 20
int digits[ROW_COL_LENGTH][ROW_COL_LENGTH] = {
{ 8, 2, 22, 97, 38, 15, 0, 40, 0, 75, 4, 5, 7, 78, 52, 12, 50, 77, 91, 8 },
... | highestProduct = productDiagonalLeftToRight; |
<|file_name|>export.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... | // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.