prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>spectral.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""Algorithms for spectral clustering"""
# Author: Gael Varoquaux gael.varoquaux@normalesup.org
# Brian Cheung
# Wei LI <kuantkid@gmail.com>
# License: BSD 3 clause
import warnings
import numpy as np
from ..base import Base... |
Only kernels that produce similarity scores (non-negative values that
increase with similarity) should be used. This property is not checked |
<|file_name|>mq.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
connection = pika.BlockingConnection(pika.ConnectionParameters(
host='localhost'))
channel = connection.channel()
channel.exchange_declare(exchange='clock_output', type='fanout')
result = channel.queue_declare(exclusive=True)
queue_name = result.met... | import pika
import pickle
from display import LCDLinearScroll |
<|file_name|>posix.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/lice... | }
fn root_path(&self) -> Option<Path> {
if self.is_absolute() { |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># encoding: utf-8
#
#
# 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/.
#
# Author: Kyle Lahnakoski (kyle@lahnakoski.... | if seq[i] == ":":
seq[i - 1], seq[i + 1] = seq[i + 1], seq[i - 1]
|
<|file_name|>DropdownFilter.tsx<|end_file_name|><|fim▁begin|>/*
Copyright (C) 2017 Cloudbase Solutions SRL
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (... | )
}
}
|
<|file_name|>contextualTypeWithUnionTypeMembers.js<|end_file_name|><|fim▁begin|>//// [contextualTypeWithUnionTypeMembers.ts]
//When used as a contextual type, a union type U has those members that are present in any of
// its constituent types, with types that are unions of the respective members in the constituent ty... | return z;
},
commonPropertyDifferentType: 10
}; |
<|file_name|>spin-debug.js<|end_file_name|><|fim▁begin|>define("gallery/spin/2.0.0/spin-debug", [], function(require, exports, module) {
/**
* Copyright (c) 2011-2014 Felix Gnass
* Licensed under the MIT license
*/
(function(root, factory) {
/* CommonJS */
if (typeof exports == "object") modu... | }); |
<|file_name|>elementat.ts<|end_file_name|><|fim▁begin|>import { Enumerable } from "../enumerable_";
import { wrapInThunk } from "../common/wrap";
import { OperatorR } from "../common/types";
function _elementat<T>(source: Iterable<T>, index: number, defaultValue?: T): T | undefined {
if (index >= 0) {
var ... | export function elementat<T>(index: number): OperatorR<T, T | undefined>;
export function elementat() {
return wrapInThunk(arguments, _elementat); |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import Storyview from './Story'
export default {<|fim▁hole|> component: Storyview
}<|fim▁end|> | path: '/stories/:storyid', |
<|file_name|>vfmaddsub213ps.rs<|end_file_name|><|fim▁begin|>use ::{BroadcastMode, Instruction, MaskReg, MergeMode, Mnemonic, OperandSize, Reg, RoundingMode};
use ::RegType::*;
use ::instruction_def::*;
use ::Operand::*;
use ::Reg::*;
use ::RegScale::*;
fn vfmaddsub213ps_1() {
run_test(&Instruction { mnemonic: Mnem... | |
<|file_name|>extensionManagement.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.
... | getKeymapRecommendations(): string[];
}
export const ExtensionsLabel = localize('extensions', "Extensions"); |
<|file_name|>PsyInfo.java<|end_file_name|><|fim▁begin|>/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
/* JOrbis
* Copyright (C) 2000 ymnk, JCraft,Inc.
*
* Written by: 2000 ymnk<ymnk@jcraft.com>
*
* Many thanks to
* Monty <monty@xiph.org> and
* The XIPHOPHORUS Company http://www.xiph.or... | int noisemaskp;
float[] noiseatt_125Hz=new float[5];
float[] noiseatt_250Hz=new float[5];
float[] noiseatt_500Hz=new float[5]; |
<|file_name|>test_crossdomain.py<|end_file_name|><|fim▁begin|># Copyright (C) 2013 eNovance SAS <licensing@enovance.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://www.ap... | super(CrossdomainTest, self).setUp()
@decorators.idempotent_id('d1b8b031-b622-4010-82f9-ff78a9e915c7')
@utils.requires_ext(extension='crossdomain', service='object') |
<|file_name|>analyzer_test.go<|end_file_name|><|fim▁begin|>// Copyright 2015 go-swagger maintainers
//
// 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... | assertPattern(t, pt.items, "#/paths/~1some~1where~1{id}/get/parameters/1/items", "c[A-Za-z0-9]+")
assertPattern(t, pt.items, "#/paths/~1other~1place/post/responses/default/headers/Via/items", "[A-Za-z]+") |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
setup(name='uwosh.emergency.master',
version=version,
description="",
long_description=open("README.txt").read() + "\n" +
open(os.path.join("docs", "HISTORY.txt")).read(),
# Get more strings from http://www.py... | from setuptools import setup, find_packages
import os
version = '0.5' |
<|file_name|>57-add-parent-numbered-lists.ts<|end_file_name|><|fim▁begin|>// Numbered lists - Add parent number in sub number
// Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs";
import { AlignmentType, convertInchesToTwip, Document, HeadingLevel, LevelFormat, Packer, Paragraph... | },
}),
new Paragraph({
text: "Step 3 - Put in oven", |
<|file_name|>D3.java<|end_file_name|><|fim▁begin|>/**********************************************************************
Copyright (c) 2005 Erik Bengtson and others.
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 cop... | /**
* @param name The name to set.
*/
|
<|file_name|>TestEmitter.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>
showSectionRequest($scope, sectionId) {
var payload = {
id: sectionId
};
return payload;
}
}<|fim▁end|> | export class TestEmitter { |
<|file_name|>IUNegotiationLookupableHelperServiceImpl.java<|end_file_name|><|fim▁begin|>package org.kuali.kra.negotiations.lookup;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang.S... | fieldValues.put("negotiationId", StringUtils.join(wildcardNegotiationIds, '|')); |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>use std::io::BufReader;
use std::io::BufWriter;
use std::io::prelude::*;
use std::fs::File;
fn main() {
let mut input_path: String = String::new();
let mut output_path = String::new();
let mut input = std::io::stdin();
let mut vec = vec![String::from("<page>"),Stri... | let mut in_text = false;
let mut line_iter = reader.lines();
while let Some(l1) = line_iter.next(){
let line = l1.unwrap(); |
<|file_name|>writer.rs<|end_file_name|><|fim▁begin|>//! Formats a DOM structure to a Write
//!
//! ### Example
//! ```
//! use sxd_document::Package;
//! use sxd_document::writer::format_document;
//!
//! let package = Package::new();
//! let doc = package.as_document();
//!
//! let hello = doc.create_element("hello");... | |
<|file_name|>allocator.rs<|end_file_name|><|fim▁begin|>use core::ptr::RawPtr;
use core::mem::transmute;
use core::ptr::{set_memory, copy_memory};
use core::intrinsics::offset;
use core::intrinsics::ctlz32;
//use core::cmp::expect;
use util::bitv::Bitv;
#[repr(u8)]
enum Node {
UNUSED = 0,
USED = 1,
SPLIT =... | let (ptr, size) = self.alloc(s);
unsafe { set_memory(ptr, 0, size); }
(ptr, size)
} |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>// Copyright 2015 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
//
// http://www.apache.org/licenses/LICENSE-2.0
//
//... | }); |
<|file_name|>TriggersContainer.spec.js<|end_file_name|><|fim▁begin|>import React from 'react';
import { default as TriggersContainer } from './TriggersContainer';
import { mount } from 'enzyme';
const emptyDispatch = () => null;
const emptyActions = { setGeoJSON: () => null };<|fim▁hole|>describe('(Container) Triggers... | |
<|file_name|>accounts.js<|end_file_name|><|fim▁begin|>function collectWithWildcard(test) {
test.expect(4);
var api_server = new Test_ApiServer(function handler(request, callback) {
var url = request.url;
<|fim▁hole|> });
return void callback(null, [
account.redact()
]);
default:
let error ... | switch (url) {
case '/accounts?username=chariz*':
let account = new Model_Account({
username: 'charizard' |
<|file_name|>uFin3015.cpp<|end_file_name|><|fim▁begin|>/*
Módulo: Financeiro
Função: Relatório Recebimento por Cliente
Autor.: Jackson Patrick Werka
Data..: 01/07/2012
© Copyright 2012-2012 SoftGreen - All Rights Reserved
*/
//---------------------------------------------------------------------------
#include <vcl.h>
... | //--------------------------------------------------------------------------- |
<|file_name|>HaloCraft.java<|end_file_name|><|fim▁begin|>package com.tikaji.halocraft;
import com.tikaji.halocraft.common.handlers.ConfigurationHandler;
import com.tikaji.halocraft.common.proxy.IProxy;
import com.tikaji.halocraft.common.utility.Reference;
import com.tikaji.halocraft.common.utility.VersionChecker;<|fim... | import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.fml.common.Mod; |
<|file_name|>rc4_md5.rs<|end_file_name|><|fim▁begin|>//! Rc4Md5 cipher definition
use crate::crypto::{
digest::{self, Digest, DigestType},
openssl::OpenSSLCrypto,
CipherResult,
CipherType,
CryptoMode,
StreamCipher,
};
use bytes::{BufMut, BytesMut};
/// Rc4Md5 Cipher
pub struct Rc4Md5Cipher {
... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Import all metrics<|fim▁hole|><|fim▁end|> | from django_prometheus.db.metrics import * |
<|file_name|>demo-extend.test.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>import { extendTest } from '../../../tests/shared/demoTest';
extendTest('anchor');<|fim▁end|> | |
<|file_name|>MergeIntervals.java<|end_file_name|><|fim▁begin|>package com.zs.leetcode.array;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
<|fim▁hole|> public static void main(String[] args) {
}
public List<Interval> merge(List<Interval> inte... |
public class MergeIntervals {
|
<|file_name|>import_repo.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, print_function
import logging
from datetime import datetime
from changes.config import db
from changes.models import Repository, RepositoryStatus
from changes.queue.task import tracked_task
logger = logging.getLogger('r... | logger.info('Repository %s is inactive', repo.id)
return |
<|file_name|>errors.rs<|end_file_name|><|fim▁begin|>use std::ffi::OsString;
use std::path::PathBuf;
use std::result::Result as StdResult;
#[derive(Fail, Debug, Serialize, Deserialize)]
pub enum FFIError {
#[fail(display = "Could not chdir to {:?}: {}", path, error)]
ChdirError { path: PathBuf, error: String },... | |
<|file_name|>export-notebook.ts<|end_file_name|><|fim▁begin|>import * as path from "path";
import { promises } from "fs";
const { writeFile } = promises;
import { remote } from "electron";
const { dialog } = remote;
import { stringifyNotebook } from "@nteract/commutable";
import store from "./store";
export async fun... | });
} catch (err) { |
<|file_name|>log_writer.cc<|end_file_name|><|fim▁begin|>// Copyright (c) 2011 The LevelDB Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. See the AUTHORS file for names of contributors.
#include "db/log_writer.h"
#include <stdint.h>... | } // namespace leveldb |
<|file_name|>averageflags.py<|end_file_name|><|fim▁begin|>from pudzu.charts import *
from pudzu.sandbox.bamboo import *
flags = pd.read_csv("../dataviz/datasets/countries.csv").filter_rows("organisations >> un").split_columns('country', "|").split_rows('country').set_index('country').drop_duplicates(subset='flag', kee... |
df = pd.read_html("https://en.wikipedia.org/wiki/List_of_countries_and_dependencies_by_area")[0] |
<|file_name|>postmessage.js<|end_file_name|><|fim▁begin|>// @license
// Redistribution and use in source and binary forms ...
// Class for sending and receiving postMessages.
// Based off the library by Daniel Park (http://metaweb.com, http://postmessage.freebaseapps.com)
//
// Dependencies:
// * None
//
// Copyright ... | }
var target = options.target;
if (!target) {
console.warn("postMessage target window required."); |
<|file_name|>20151021114814-default-null.js<|end_file_name|><|fim▁begin|>export function up(queryInterface, Sequelize) {
return Promise.all([
queryInterface.changeColumn('memberships', 'approved', {
type: Sequelize.BOOLEAN,
defaultValue: null,
}),
queryInterface.changeColumn('quotes', 'approve... | queryInterface.changeColumn('memberships', 'approved', { |
<|file_name|>types.rs<|end_file_name|><|fim▁begin|>use std::collections::TreeMap;
use serde::json::Json;
use gfx;
use gfx_gl::types::GLenum;
#[deriving_deserializable]
pub struct Buffer {
pub uri: String,
#[serial_name = "byteLength"]
pub byte_length: uint,
pub name: String,
#[serial_name = "type"]... | pub blend_func_separate: (GLenum, GLenum, GLenum, GLenum),
#[serial_name = "colorMask"]
pub color_mask: (bool, bool, bool, bool), |
<|file_name|>test_utils.rs<|end_file_name|><|fim▁begin|>// ams - Advanced Memory Scanner
// Copyright (C) 2018 th0rex
//
// 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 ... | Node::new(
address,
MemoryRegion::new(unsafe { |
<|file_name|>lstm_ops.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.apache.o... | array_ops.stack([batch_size, self.num_units]), dtype=dtype) |
<|file_name|>create.ts<|end_file_name|><|fim▁begin|>import Rails from '@rails/ujs';
import { showNotification, showErrorNotification } from 'utilities/notifications';
import I18n from 'retrospring/i18n';
export function createListHandler(event: Event): void {
const button = event.target as HTMLButtonElement;
const... | success: (data) => {
if (data.success) {
document.querySelector('#lists-list ul.list-group').insertAdjacentHTML('beforeend', data.render); |
<|file_name|>LazyBannerAd.ts<|end_file_name|><|fim▁begin|>import {
AdObserver,
IBannerAd,
} from "../../ads";
import {
ObserverHandle,
ObserverManager,
Utils,
} from "../../core";
export class LazyBannerAd extends ObserverManager<AdObserver> implements IBannerAd {
private _ad?: IBannerAd;
p... | } |
<|file_name|>vdoaiBidAdapter.js<|end_file_name|><|fim▁begin|>import * as utils from '../src/utils.js';
import {config} from '../src/config.js';
import {registerBidder} from '../src/adapters/bidderFactory.js';
import {BANNER, VIDEO} from '../src/mediaTypes.js';
const BIDDER_CODE = 'vdoai';
const ENDPOINT_URL = 'https:/... | |
<|file_name|>LessonRouter.js<|end_file_name|><|fim▁begin|>import express from 'express';
import LessonController from '../controllers/LessonController';
const router = express.Router();
/* eslint-disable no-unused-vars */
const LessonsPath = '/api/lessonplans';
const teacherName = 'yonderWay';
const subjectName = 'the... | |
<|file_name|>test.js<|end_file_name|><|fim▁begin|>var expect = require('chai').expect;
var search = require('./');
describe('binary search', function() {
it('should search 0 elements', function() {
var arr = [];
expect(search(arr, 4)).to.equal(-1);
});
it('should search 1 element not found', function()... | |
<|file_name|>setup_for_centos7.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import sys
import os
import subprocess
import shutil
import fix_rocks_network
import json
pxelinux_kernels_dir='/tftpboot/pxelinux/';
centos7_templates_dir='./centos7_ks'
centos7_dir='/export/rocks/install/centos7/';
centos7_ks_scrip... | |
<|file_name|>reject.js<|end_file_name|><|fim▁begin|>var _complement = require('./internal/_complement');<|fim▁hole|>var filter = require('./filter');
/**
* Similar to `filter`, except that it keeps only values for which the given predicate
* function returns falsy. The predicate function is passed one argument: *(v... | var _curry2 = require('./internal/_curry2'); |
<|file_name|>get_process.go<|end_file_name|><|fim▁begin|>// Copyright © 2021 Sascha Andres <sascha.andres@outlook.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://www.ap... | // distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
<|file_name|>main.js<|end_file_name|><|fim▁begin|>var C = crel2;
var ventana = API.widget.create();
var textarea;
C(ventana,
C('button', ['onclick', local_set_test], 'LOCAL SET test'),
C('button', ['onclick', local_get_test], 'LOCAL GET test'),
C('button', ['onclick', local_delete_test], 'LOCAL DELETE test'),
C... | API.storage.remoteStorage.delete('test', function(entrada){
if(entrada){
log('REMOTE DELETE Test deleted OK.'); |
<|file_name|>voting.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
from commands.utilities import register
import asyncio
import re
class Voting():
def __init__(self, config=None):
# regex to match a number at the start of the message.
# Being a float is optional.
self.length_re = r'--(... | del self.active_votes[channel]
@register('!vote')
async def start_vote(self, msg, user, channel, client, *args, **kwargs): |
<|file_name|>SettingsEthernet.js<|end_file_name|><|fim▁begin|>"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _createSvgIcon = _interopRequireDefault(require("./utils/cre... |
var _jsxRuntime = require("react/jsx-runtime"); |
<|file_name|>BPMNServiceComponent.java<|end_file_name|><|fim▁begin|>/**
* Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) 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 th... | |
<|file_name|>exceptions.py<|end_file_name|><|fim▁begin|>class ParamsException(Exception):
"""Exception raised when tp, fmt and size values are wrongs"""
pass
class LineSizeException(Exception):
"""Exception raised when line size is bigger then specified"""
pass
class LineIdentifierException(Exceptio... | obs: line identifier is defined using .eq() function
""" |
<|file_name|>test_traversal.py<|end_file_name|><|fim▁begin|>from __future__ import division, print_function, absolute_import
import numpy as np
from numpy.testing import assert_array_almost_equal
from scipy.sparse.csgraph import breadth_first_tree, depth_first_tree,\
csgraph_to_dense, csgraph_from_dense
def test... | |
<|file_name|>HttpJsonRoutesCallableFactory.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2021 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.... | @Override |
<|file_name|>DevGarden_fr.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="fr_FR">
<context>
<name>DGWindow</name>
<message>
<location filename="src/ui/dgwindow.cpp" line="24"/>
<source>&File</source>
<translation>&f... | <source>&Window</source> |
<|file_name|>TestCheckYahooFinanceCurrencyData.py<|end_file_name|><|fim▁begin|>'''
Check Yahoo finance currency data helper.
Update log: (date / version / author : comments)
2017-12-10 / 1.0.0 / Du Jiang : Creation
2017-12-13 / 2.0.0 / Du Jiang : Use new API
'''
from com.djs.learn.financeapi import CheckFinanceDataR... | |
<|file_name|>CreateAuctionBox.js<|end_file_name|><|fim▁begin|>// @flow
import React, { Component, PropTypes } from "react"
import { connect } from "react-redux"
import TextField from 'material-ui/TextField'
import { CreateAuctionButton } from "../../molecules/"
import * as AuctionActions from "../../../actions/auction"... | super(props) |
<|file_name|>1579-Remove Max Number of Edges to Keep Graph Fully Traversable.py<|end_file_name|><|fim▁begin|>class Solution:
def maxNumEdgesToRemove(self, n: int, edges: List[List[int]]) -> int:
parent = list(range(n + 1))
def findParent(i):
while parent[i] != i:
parent[i... | e1 += 1
e2 += 1
else: |
<|file_name|>no.js<|end_file_name|><|fim▁begin|>/*<|fim▁hole|> Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang("placeholder","no",{title:"Egenskaper for plassholder",toolbar:"Opprett plassholder",name:"... | |
<|file_name|>Eastern.py<|end_file_name|><|fim▁begin|>'''tzinfo timezone information for US/Eastern.'''
from pytz.tzinfo import DstTzInfo
from pytz.tzinfo import memorized_datetime as d
from pytz.tzinfo import memorized_ttinfo as i
class Eastern(DstTzInfo):
'''US/Eastern timezone definition. See datetime.tzinfo for... | d(1974,1,6,7,0,0),
d(1974,10,27,6,0,0),
d(1975,2,23,7,0,0), |
<|file_name|>name.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
# -*- coding: UTF-8 -*-
# ---------------------------------------------------------------------------
# ___ __ ___ ___ ____ ____ __
# | \ | \ | | / | | | \ Automatic
# |__/ |__/ | | |... | # |
<|file_name|>main.js<|end_file_name|><|fim▁begin|>/*
* Store drawing on server
*/
function saveDrawing() {
var drawing = $('#imagePaint').wPaint('image');
var imageid = $('#imageTarget').data('imageid');
var creatormail = $('input[name=creatorMail]').val();
//Add spinning wheel
var spin = $(document.cr... | success: function (resp) {
if (resp.kind == 'success')
popup("<p>Die Zeichnung wurde erfolgreich gespeichert.</p><p>Sie wird jedoch zuerst überprüft bevor sie in der Galerie zu sehen ist.</p>");
if (resp.kind == 'error') |
<|file_name|>code1a.py<|end_file_name|><|fim▁begin|># coding=utf-8
import pygame
import pygame.locals
class Board(object):
"""
Plansza do gry. Odpowiada za rysowanie okna gry.
"""
def __init__(self, width, height):
"""
Konstruktor planszy do gry. Przygotowuje okienko gry... | if event.type == pygame.locals.QUIT:
pygame.quit()
|
<|file_name|>panic-handler-bad-signature-1.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://... | |
<|file_name|>configs-fn_call_style-block-trailing-comma.rs<|end_file_name|><|fim▁begin|>// rustfmt-error_on_line_overflow: false
// rustfmt-fn_call_style: Block
// rustfmt should not add trailing comma when rewriting macro. See #1528.
fn a() {
panic!(
"this is a long string that goes past the maximum line ... | foo( |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.views.generic.detail import DetailView
from django.core.urlresolvers import reverse_lazy
from django.utils.decorators import method_decorator
from django.contrib.auth.decorators import login_required
from django.views import generic
from django.views.generi... | @method_decorator(login_required)
def dispatch(self, *args, **kwargs):
return super(InstitutionDelete, self).dispatch(*args, **kwargs) |
<|file_name|>benchmark_covariance.py<|end_file_name|><|fim▁begin|>import pandas as pd
import numpy as np
import pymbar
from pymbar.testsystems.pymbar_datasets import load_gas_data, load_8proteins_data
import time
def load_oscillators(n_states, n_samples):
name = "%dx%d oscillators" % (n_states, n_samples)
O_k ... | def load_exponentials(n_states, n_samples):
name = "%dx%d exponentials" % (n_states, n_samples)
rates = np.linspace(1, 3, n_states)
N_k = (np.ones(n_states) * n_samples).astype('int') |
<|file_name|>0022_add_activity_types.py<|end_file_name|><|fim▁begin|># Generated by Django 3.0.9 on 2020-08-16 20:47
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('groups', '0042_auto_2020050... | model_name='activity', |
<|file_name|>register.go<|end_file_name|><|fim▁begin|>/*
Copyright 2014 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://www.apache.org/licenses/LICENSE-2... | func (*ContainerManifestList) IsAnAPIObject() {} |
<|file_name|>mock_api_parser.py<|end_file_name|><|fim▁begin|># 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://www.apache.org/li... | self._discovery_document = doc
self._parsed_schemas = {} |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>/*
* Katana - a powerful, open-source screenshot utility
*
* Copyright (C) 2018, Gage Alexander <gage@washedout.co>
*
* Katana is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* t... | overwrite: true, |
<|file_name|>testmfd.cpp<|end_file_name|><|fim▁begin|>#include "stdhdr.h"<|fim▁hole|>#include "simdrive.h"
#include "camp2sim.h"
#include "hud.h"
#include "aircrft.h"
#include "fack.h"
#include "otwdrive.h" //MI
#include "cpmanager.h" //MI
#include "icp.h" //MI
#include "aircrft.h" //MI
#include "fcc.h" //MI
#include "... | #include "camplib.h"
#include "mfd.h"
#include "Graphics/Include/render2d.h"
#include "dispcfg.h" |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#!python3.3
# -*- coding: utf-8 -*-
"""
.. module:: examples.benchmarks
:platform: Agnostic, Windows
:synopsis: Full suite of benchmarks
Created on 10/08/2013
"""
def standard_iges_setup(system, filename):
system.StartSection.Prolog = " "
... | |
<|file_name|>output.js<|end_file_name|><|fim▁begin|><|fim▁hole|>var p = Promise.resolve(0);
Promise.all([p]).then(function (outcome) {
alert("OK");
});<|fim▁end|> | import "core-js/modules/web.dom.iterable";
import "core-js/modules/es6.promise"; |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># PyAutoGUI: Cross-platform GUI automation for human beings.
# BSD license
# Al Sweigart al@inventwithpython.com (Send me feedback & suggestions!)
"""
IMPORTANT NOTE!
To use this module on Mac OS X, you need the PyObjC module installed.
For Python 3, run:
sudo... | # the mouse.
MINIMUM_DURATION = 0.1 |
<|file_name|>main.after.py<|end_file_name|><|fim▁begin|>import subprocess
import sys
import django.conf
import django.utils.encoding
import matplotlib.pyplot as plt
subprocess.Popen<|fim▁hole|>
sys.argv
plt.func()<|fim▁end|> | |
<|file_name|>ip.rs<|end_file_name|><|fim▁begin|>//! Handles parsing of Internet Protocol fields (shared between ipv4 and ipv6)
use nom::bits;
use nom::error::Error;
use nom::number;
use nom::sequence;
use nom::IResult;
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize,... | |
<|file_name|>microtask.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 https://mozilla.org/MPL/2.0/. */
//! Implementation of [microtasks](https://html.spec.whatw... | #[allow(unsafe_code)]
pub fn checkpoint<F>(
&self, |
<|file_name|>rdflib-stample-pg-extension-0.1.1.js<|end_file_name|><|fim▁begin|>(function(root, undef) {
///////////////////////////////////////////////////////////////////////////////////////////////
// pg.js, part of rdflib-pg-extension.js made by Stample
// see https://github.com/stample/rdflib.js
////////////////... | $rdf.PointedGraph.setLogLevel = function(level) { |
<|file_name|>basicShape.ts<|end_file_name|><|fim▁begin|>/*
* Power BI Visualizations
*
* Copyright (c) Microsoft Corporation
* All rights reserved.
* MIT License
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the ""... | default:
break; |
<|file_name|>androidUnlock.js<|end_file_name|><|fim▁begin|>"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});<|fim▁hole|><|fim▁end|> | var androidUnlock = exports.androidUnlock = { "viewBox": "0 0 512 512", "children": [{ "name": "path", "attribs": { "d": "M376,186h-20v-40c0-55-45-100-100-100S156,91,156,146h37.998c0-34.004,28.003-62.002,62.002-62.002\r\n\tc34.004,0,62.002,27.998,62.002,62.002H318v40H136c-22.002,0-40,17.998-40,40v200c0,22.002,17.998,40... |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models
from helusers.models import AbstractUser
<|fim▁hole|>class User(AbstractUser):
pass<|fim▁end|> | |
<|file_name|>termination.py<|end_file_name|><|fim▁begin|># Copyright 2015-2017 Cisco Systems, 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
#
# htt... |
@classmethod |
<|file_name|>brain_subprocess.py<|end_file_name|><|fim▁begin|># Copyright (c) 2016 Claudiu Popa <pcmanticore@gmail.com>
# Licensed under the LGPL: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html
# For details: https://github.com/PyCQA/astroid/blob/master/COPYING.LESSER
import sys
import textwrap
import si... | stdin=None, stdout=None, stderr=None,
preexec_fn=None, close_fds=False, shell=False,
cwd=None, env=None, universal_newlines=False, |
<|file_name|>mrp.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# © 2014 Elico Corp (https://www.elico-corp.com)
# Licence AGPL-3.0 or later(http://www.gnu.org/licenses/agpl.html)
import time
from datetime import datetime
import openerp.addons.decimal_precision as dp
from openerp.osv import fields, osv
from... | if production.move_prod_id and production.move_prod_id.location_id.id != production.location_dest_id.id:
move_obj.write(cr, uid, [production.move_prod_id.id],
{'location_id': production.location_dest_id.id})
return True |
<|file_name|>struct-field-privacy.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<|fim▁hole|>// <LICE... | // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import containers from './containers'<|fim▁hole|>
module.exports = {...containers, ...ui, App}<|fim▁end|> | import ui from './ui'
import App from './App' |
<|file_name|>TcpdumpWrapper.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# coding: UTF-8
# TcpdumpWrapper
#
# Copyright(c) 2015-2018 Uptime Technologies, LLC.
from datetime import datetime, timedelta, date, time
import hashlib
import os
import re
import subprocess
import sys
import log
class TcpdumpPacket... | cur = 0 |
<|file_name|>signal_propagation_shell.py<|end_file_name|><|fim▁begin|>import os
import sys<|fim▁hole|>import signal
import time
import subprocess
WHO = None
def handler(signum, frame):
global WHO
print('Signal handler', signum, WHO, frame)
print('Disable handler', signum, WHO, frame)
signal.signal(si... | |
<|file_name|>timer-impl.js<|end_file_name|><|fim▁begin|>/**
* Copyright 2015 The AMP HTML 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://... | this.canceled_ = {};
|
<|file_name|>test_env.py<|end_file_name|><|fim▁begin|>from mock import MagicMock, mock_open, patch
from unittest import TestCase
from warnings import simplefilter
import pconf
from pconf.store.env import Env
TEST_ENV_BASE_VARS = {
"env__var": "result",
"env__var_2": "second_result",
}
TEST_ENV_MATCHED_VARS =... |
self.assertEqual(env_store.separator, TEST_SEPARATOR)
self.assertEqual(env_store.match, TEST_MATCH) |
<|file_name|>SI_DeviceKeyboard.cpp<|end_file_name|><|fim▁begin|>// Copyright 2015 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.
#include "Core/HW/SI/SI_DeviceKeyboard.h"
#include <cstring>
#include "Common/ChunkFile.h"
#include "Common/CommonTypes.h"
#include "Common/Lo... | if (keys_held >= MAX_KEYS_HELD) |
<|file_name|>main.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>import 'rxjs/add/operator/map';
bootstrap(RedditFeed, [...HTTP_PROVIDERS]).catch(err => console.error(err));<|fim▁end|> | import {bootstrap} from 'angular2/platform/browser';
import {RedditFeed} from './components/reddit_feed';
import {HTTP_PROVIDERS} from 'angular2/http';
|
<|file_name|>ngfuse.service.ts<|end_file_name|><|fim▁begin|>import { Injectable } from '@angular/core';
import * as Fuse from 'fuse.js';
@Injectable()
export class NgFuseService {
defaults: NgFuseOptions = {
shouldSort: true,
threshold: 0.4,
location: 0,
distance: 100,
... | } |
<|file_name|>test_project_structure.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 un... | # specific language governing permissions and limitations
# under the License. |
<|file_name|>augmented-assignments.rs<|end_file_name|><|fim▁begin|>use std::ops::AddAssign;
struct Int(i32);
impl AddAssign for Int {
fn add_assign(&mut self, _: Int) {
unimplemented!()
}
}
fn main() {
let mut x = Int(1);
x
//~^ NOTE borrow of `x` occurs here
+=
x;
//~^ ERROR ... | } |
<|file_name|>create_pi.py<|end_file_name|><|fim▁begin|>from random import random
def ran_pi():
<|fim▁hole|> temp=[]
for j in range(dim[1]):
temp.append(random())
sm=sum(temp)
out.append([temp[i]/sm for i in range(dim[1])])
return out
pi={i:[[1.0,0.0],[0.0,1.0]] ... | dim=[2,3]
out=[]
for i in range(dim[0]):
|
<|file_name|>user-resource.go<|end_file_name|><|fim▁begin|>package main
import (
"log"
"net/http"
"github.com/emicklei/go-restful"
restfulspec "github.com/emicklei/go-restful-openapi"
"github.com/go-openapi/spec"
)
type UserResource struct {
// normally one would use DAO (data access object)
users map[string]... |
func main() { |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.