prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>java.beans.EventHandler.d.ts<|end_file_name|><|fim▁begin|>declare namespace java {
namespace beans {
class EventHandler implements java.lang.reflect.InvocationHandler {
public constructor(arg0: java.lang.Object | any, arg1: java.lang.String | string, arg2: java.lang.String | string, arg3: java... | public getListenerMethodName(): java.lang.String
public invoke(arg0: java.lang.Object | any, arg1: java.lang.reflect.Method, arg2: java.lang.Object[] | any[]): java.lang.Object
public static create<T>(arg0: java.lang.Class<T>, arg1: java.lang.Object | any, arg2: java.lang.String | string): T |
<|file_name|>multiResolution.js<|end_file_name|><|fim▁begin|>export function getCorrectFontSizeForScreen(PixelRatio, screenWidth, screenHeight, currentFont){
let devRatio = PixelRatio.get();
let factor = (((screenWidth*devRatio)/320)+((screenHeight*devRatio)/640))/2.0;
let maxFontDifferFactor = 5; //the maximum p... | if(factor<=1){ |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
"""CnbetaApi URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
... | |
<|file_name|>BuildableTexture.java<|end_file_name|><|fim▁begin|>package org.anddev.andengine.opengl.texture;
import java.util.*;
import org.anddev.andengine.opengl.texture.source.*;
import org.anddev.andengine.util.*;
import org.anddev.andengine.opengl.texture.builder.*;
import android.graphics.*;
public class Builda... | public TextureSourceWithWithLocationCallback clone() {
return null;
} |
<|file_name|>VM.java<|end_file_name|><|fim▁begin|>package com.hadroncfy.jphp.jzend;
import com.hadroncfy.jphp.jzend.types.typeInterfaces.Zval;
/**
* Created by cfy on 16-9-1.
*/
public interface VM {
void push(Zval val);
Zval pop();
Zval peek();
void echo(String s);<|fim▁hole|> void jump(int line... | void exit(Zval ret);
void retour(Zval zval);
void doThrow(Zval zval);
void makeError(String msg); |
<|file_name|>config.py<|end_file_name|><|fim▁begin|># SPDX-License-Identifier: GPL-2.0
#
# Copyright 2019 Google LLC.
import gdb
import zlib
from linux import utils
class LxConfigDump(gdb.Command):
"""Output kernel config to the filename specified as the command
argument. Equivalent to 'zcat /proc/config... | if len(arg) == 0:
filename = "config.txt"
else:
filename = arg |
<|file_name|>GumballMachineTestDrive.java<|end_file_name|><|fim▁begin|>package ProxyPattern;
public class GumballMachineTestDrive {
public static void main(String[] args) {
int count = 0;
if (args .length < 2) {
System.out.println("GumballMachine <name> <inventory>");
System.exit(1);
}<|fim▁hole|> count ... | |
<|file_name|>AccountStatsMySqlStoreIntegrationTest.java<|end_file_name|><|fim▁begin|>/**
* Copyright 2020 LinkedIn Corp. 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... | for (String partitionClassName : partitionNameAndIds.keySet()) { |
<|file_name|>formdata.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::utils::{Reflectable, Reflector, reflect_d... | window: JS<Window>, |
<|file_name|>test_aggregates.py<|end_file_name|><|fim▁begin|># Copyright (c) 2012 Citrix 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
#
# ... |
def test_add_host_with_missing_host(self):
self.assertRaises(exc.HTTPBadRequest, self.controller.action,
self.req, "1", body={"add_host": {"asdf": "asdf"}}) |
<|file_name|>generateITetrisIntersectionMetrics.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""
@file generateITetrisIntersectionMetrics.py
@author Daniel Krajzewicz
@author Lena Kalleske
@author Michael Behrisch
@date 2007-10-25
@version $Id: generateITetrisIntersectionMetrics.py 14425 2013-08-16 2... | opfile.write('mean noise emission: %s\n' % tlsInfo[tl]['noise'])
if 'CO' in tlsInfo[tl]: |
<|file_name|>ListServerCertificatesResult.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright 2010-2015 Amazon.com, Inc. or its affiliates. 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.
* A copy of the License is l... | |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models
from django_hstore import hstore
# Create your models here.
class Place(models.Model):
osm_type = models.CharField(max_length=1)
osm_id = models.IntegerField(primary_key=True)
class_field = models.TextField(db_column='class') ... | return '%d, %s' % (self.poids, self.nom) |
<|file_name|>DefaultUnconfiguredTargetNodeFactoryTest.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* 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... | .put("name", "c")
.put("buck.base_path", "a/b")
.put("deps", ImmutableList.of("//a/b:d", "//a/b:e"))
.put( |
<|file_name|>json-reference.service.ts<|end_file_name|><|fim▁begin|>import { Injectable } from '@angular/core';
@Injectable()
export class JsonReferenceService {
constructor() { }
dereference<T>(obj: any, $ref: string): T {
if(!$ref.startsWith('#/')) {
console.warn('Invalid $ref. Only references to cur... | } |
<|file_name|>coords.rs<|end_file_name|><|fim▁begin|>//! Coordinate systems and geometry definitions. Some conversions are dependent on the application
//! state, and so those functions are a part of the `AppContext`.
use crate::app::config;
use metfor::{Celsius, CelsiusDiff, HectoPascal, Knots, Meters, PaPS, WindSpdDi... | |
<|file_name|>emojify.js<|end_file_name|><|fim▁begin|>'use strict';
<|fim▁hole|>
var generateEmoji = function(selector) {
if (!existingRules[selector]) {
existingRules[selector] = emojiArr[i];
if (i !== emojiArr.length) {
i++
} else {
i = 0;
}
}
return exist... | var emojiArr = require('./emojis');
var i = 0;
var existingRules = {}; |
<|file_name|>0003_auto_20160525_1521.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-<|fim▁hole|>from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('predict', '0002_auto_20160524_0947'),
]
operations =... | |
<|file_name|>sl.js<|end_file_name|><|fim▁begin|>/* Slovenian locals for flatpickr */
var flatpickr = flatpickr || { l10ns: {} };
flatpickr.l10ns.sl = {};
flatpickr.l10ns.sl.weekdays = {
shorthand: ["Ned", "Pon", "Tor", "Sre", "Čet", "Pet", "Sob"],
longhand: ["Nedelja", "Ponedeljek", "Torek", "Sreda", "Četrtek", "Pet... | flatpickr.l10ns.sl.rangeSeparator = " do "; |
<|file_name|>all-rules.js<|end_file_name|><|fim▁begin|>/*
* This file contains generic tests that are run against every rule. Early on,
* we found some common rule patterns that would cause errors under certain
* conditions. Instead of tracking them down individually, this file runs
* the same tests on every define... | var result = CSSLint.verify("@page { width: 100px; }", this.options); |
<|file_name|>value.py<|end_file_name|><|fim▁begin|>def represents_int(value):
try:
int(value)<|fim▁hole|>
return False
def bytes_to_gib(byte_value, round_digits=2):
return round(byte_value / 1024 / 1024 / float(1024), round_digits)
def count_to_millions(count_value, round_digits=3):
... | return True
except ValueError: |
<|file_name|>test_feature_version.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2017 GIG Technology NV
#
# 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... | updateAppAsset(update_app_asset_response, logError, app_user, request=request) |
<|file_name|>issue-57180.rs<|end_file_name|><|fim▁begin|>// compile-flags: -Cmetadata=aux
pub trait Trait {
}
pub struct Struct<F>
{
_p: ::std::marker::PhantomData<F>,
}
<|fim▁hole|> F: Fn() -> u32,
{
}<|fim▁end|> | impl<F: Fn() -> u32>
Trait for Struct<F>
where |
<|file_name|>CompletionParticipantTest.java<|end_file_name|><|fim▁begin|>/**
* Copyright (c) 2005-2013 by Appcelerator, Inc. All Rights Reserved.
* Licensed under the terms of the Eclipse Public License (EPL).
* Please see the license.txt included with this distribution for details.
* Any modifications to this file... | new String[] {});
Import importTok = new Import(new aliasType[] { new aliasType(new NameTok("unittest", NameTok.ImportModule), |
<|file_name|>boot.js<|end_file_name|><|fim▁begin|>import test from 'ava';
import { spawn } from 'child_process';
test.cb('app should boot without exiting', (t) => {
const cli = spawn('node', [ './cli' ]);
cli.stderr.on('data', (param) => {
console.log(param.toString());
});
cli.on('close', (code) => {
... | |
<|file_name|>custom_user_data_test.go<|end_file_name|><|fim▁begin|>package instance
import (
"io/ioutil"
"os"
"testing"
"github.com/scaleway/scaleway-cli/internal/core"
)
func Test_UserDataGet(t *testing.T) {
t.Run("Get an existing key", core.Test(&core.TestConfig{
BeforeFunc: core.BeforeFuncCombine(
creat... |
t.Run("on-random-key", core.Test(&core.TestConfig{ |
<|file_name|>TooltipDemo.js<|end_file_name|><|fim▁begin|>/**
* @license
* 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:... | type: 'String', |
<|file_name|>test_recaptcha.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""Copyright (C) 2013 COLDWELL AG
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, ... | data = {"recaptcha_challenge_field": challenge, "recaptcha_response_field": result}
resp = browser.post("http://www.google.com/recaptcha/demo/", data=data)
|
<|file_name|>dynamic-form-question.component.ts<|end_file_name|><|fim▁begin|>// #docregion
import { Component, Input } from '@angular/core';
import { ControlGroup } from '@angular/common';
import { QuestionBase } from './question-base';
@Component({
selector: 'df-question',
templateUrl: 'app/dynamic-form-... | export class DynamicFormQuestionComponent {
@Input() question: QuestionBase<any>;
@Input() form: ControlGroup; |
<|file_name|>lookup-get-basic-example-1.6.x.py<|end_file_name|><|fim▁begin|># Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client
# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACCOUNT_SID"
auth_token = "your_auth_token"
client = Client(a... |
print(number.carrier['type'])
print(number.carrier['name']) |
<|file_name|>gen-dq-textbox.go<|end_file_name|><|fim▁begin|>// old skool dw textbox:
// gen-dq-textbox dw.png
<|fim▁hole|>// gen-dq-textbox -bg "rgb(100,100,200)" -xbg "rgb(0,0,0)" -mbg 0.125 ff.png
package main
import (
"flag"
"fmt"
"image"
"image/color"
"log"
"math"
"os"
"github.com/qeedquan/... | // old skool ff textbox:
|
<|file_name|>grid.py<|end_file_name|><|fim▁begin|>import bisect
import string
from abc import ABC, abstractmethod
from typing import Optional
from django.conf import settings
class AbstractGrid(ABC):
enabled = False
@abstractmethod
def get_square_for_point(self, x, y) -> Optional[str]:
pass
... | return None |
<|file_name|>test_hazard_metadata.py<|end_file_name|><|fim▁begin|># coding=utf-8<|fim▁hole|>
from safe.common.utilities import unique_filename
from safe.metadata import HazardLayerMetadata
__copyright__ = "Copyright 2016, The InaSAFE Project"
__license__ = "GPL version 3"
__email__ = "info@inasafe.org"
__revision__ = ... | """Test Hazard Metadata."""
from unittest import TestCase |
<|file_name|>chat_msg.go<|end_file_name|><|fim▁begin|>package googlechat
import "time"
// ChatMessage is message type from Pub/Sub events
type ChatMessage struct {
Type string `json:"type"`
EventTime time.Time `json:"eventTime"`
Token string `json:"token"`
Message struct {
Name string `json:"... | |
<|file_name|>account_invoice.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# © 2013-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models, fields, api, _
from odoo.exceptions import ValidationError, UserError
... | """Copy from invoice line to move lines"""
res = super(AccountInvoice, self).invoice_line_move_line_get()
ailo = self.env['account.invoice.line']
for move_line_dict in res: |
<|file_name|>000.js<|end_file_name|><|fim▁begin|>odoo.define('website_sale.s_products_searchbar', function (require) {
'use strict';
const concurrency = require('web.concurrency');
const publicWidget = require('web.public.widget');
const { qweb } = require('web.core');<|fim▁hole|>publicWidget.registry.productsSearchB... |
/**
* @todo maybe the custom autocomplete logic could be extract to be reusable
*/ |
<|file_name|>dependency_viewer.py<|end_file_name|><|fim▁begin|># Opus/UrbanSim urban simulation software.
# Copyright (C) 2005-2009 University of Washington<|fim▁hole|>from PyQt4 import QtGui, Qt, QtCore
from opus_gui.general_manager.views.ui_dependency_viewer import Ui_DependencyViewer
class DependencyViewer(QtGui.QD... | # See opus_core/LICENSE
import os |
<|file_name|>perftest_data.rs<|end_file_name|><|fim▁begin|>// This file is generated. Do not edit
#![allow(dead_code)]
#![allow(non_camel_case_types)]
#![allow(non_upper_case_globals)]
#![allow(unused_imports)]
use protobuf::Message as Message_imported_for_functions;
use protobuf::ProtobufEnum as ProtobufEnum_importe... | |
<|file_name|>gentoo-compare-json.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3
# This script will compare the versions of ebuilds in the funtoo portage tree against
# the versions of ebuilds in the target portage tree. Any higher versions in the
# target Portage tree will be printed to stdout.
import portage.ve... | print("Package comparison for %s" % keywords)
print("============================================") |
<|file_name|>DirectoryTableModel.java<|end_file_name|><|fim▁begin|>package ls;
import java.util.*;
import javax.swing.table.AbstractTableModel;
public class DirectoryTableModel extends AbstractTableModel {
private final List<DirOpt> dirs = new ArrayList<>();
public List<DirOpt> getDirs () {
return... | fireTableDataChanged();
}
public DirOpt getDir (int row) {
|
<|file_name|>index.d.ts<|end_file_name|><|fim▁begin|>import { DataSecurity } from "../../";
<|fim▁hole|>export = DataSecurity;<|fim▁end|> | |
<|file_name|>Machine.java<|end_file_name|><|fim▁begin|>/*
* This file is part of LibrePlan
*
* Copyright (C) 2009-2010 Fundación para o Fomento da Calidade Industrial e
* Desenvolvemento Tecnolóxico de Galicia
* Copyright (C) 2010-2011 Igalia, S.L.
*
* This program is free software: you c... |
/**
* Used by Hibernate. Do not use! |
<|file_name|>weekdays.py<|end_file_name|><|fim▁begin|>import six
from sqlalchemy_utils.utils import str_coercible
from .weekday import WeekDay
@str_coercible
class WeekDays(object):
def __init__(self, bit_string_or_week_days):
if isinstance(bit_string_or_week_days, six.string_types):
self._d... | if bit == '1': |
<|file_name|>prog.go<|end_file_name|><|fim▁begin|>// Copyright 2014 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package ppc64
import (
"cmd/compile/internal/gc"
"cmd/internal/obj"
"cmd/internal/obj/ppc64"
)
const (
L... | if as2 != 0 && progtable[as2].Flags == 0 {
progtable[as2] = progtable[as] |
<|file_name|>z80_assembler.cpp<|end_file_name|><|fim▁begin|>/**
* libz80
* Copyright (C) 2015 David Jolly
* ----------------------
*
* libz80 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 versi... | TRACE_ENTRY(); |
<|file_name|>StudyURNFormatException.java<|end_file_name|><|fim▁begin|>package gov.va.med.imaging.exceptions;
public class StudyURNFormatException
extends URNFormatException<|fim▁hole|> {
super();
}
public StudyURNFormatException(String message)
{
super(message);
}
public StudyURNFormatException(Throwable ... | {
private static final long serialVersionUID = 6271193731031546478L;
public StudyURNFormatException() |
<|file_name|>mousewheelzoom.component.ts<|end_file_name|><|fim▁begin|>import { Component, Input, OnDestroy, OnInit } from '@angular/core';
import { interaction } from 'openlayers';
import { MapComponent } from '../map.component';<|fim▁hole|>})
export class MouseWheelZoomInteractionComponent implements OnInit, OnDestroy... |
@Component({
selector: 'aol-interaction-mousewheelzoom',
template: '' |
<|file_name|>app.component.ts<|end_file_name|><|fim▁begin|>/*
* Angular 2 decorators and services
*/
import {
Component,
OnInit,
ViewEncapsulation,
ChangeDetectionStrategy
} from '@angular/core';
import {
Event,
NavigationStart,
Router
} from '@angular/router';
import {
Store
} from '@ngrx/store';
import {... | } |
<|file_name|>no-use.rs<|end_file_name|><|fim▁begin|>// check that reservation impls can't be used as normal impls in positive reasoning.
#![feature(rustc_attrs)]<|fim▁hole|>
fn main() {
<() as MyTrait>::foo(&());
//~^ ERROR the trait bound `(): MyTrait` is not satisfied
}<|fim▁end|> |
trait MyTrait { fn foo(&self); }
#[rustc_reservation_impl = "foo"]
impl MyTrait for () { fn foo(&self) {} } |
<|file_name|>api.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# This file is part of CERN Analysis Preservation Framework.
# Copyright (C) 2016 CERN.
#
# CERN Analysis Preservation Framework is free software; you can redistribute
# it and/or modify it under the terms of the GNU General Public License as
# ... | |
<|file_name|>ViewPrivacyModels.java<|end_file_name|><|fim▁begin|>/*
* ARX: Powerful Data Anonymization
* Copyright 2012 - 2021 Fabian Prasser and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obt... | this.controller.addListener(ModelPart.ATTRIBUTE_TYPE_BULK_UPDATE, this);
|
<|file_name|>corpus.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (C) 2010 Samalyse SARL
# Copyright (C) 2010-2014 Parisson SARL
# This file is part of Telemeta.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License a... | verbose_name_plural = _('corpus related media') |
<|file_name|>glogrotate.go<|end_file_name|><|fim▁begin|>/*
Gzips and deletes log files generated by glog http://github.com/golang/glog
Basic usage:
glogrotate -base=/var/log -maxage=240h myapp myotherapp
glogrotate will not touch the current log files. There are different timeouts for the INFO, WARNING, and ERROR... | fmt.Printf("gzipping %s...\n", f)
}
if err := exec.Command("gzip", f).Run(); err != nil {
fatalf("gzip: %s", err) |
<|file_name|>dns.cc<|end_file_name|><|fim▁begin|>/**
* $Id$
* Copyright (C) 2008 - 2014 Nils Asmussen
*
* 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 2
* of the License, ... | |
<|file_name|>main.py<|end_file_name|><|fim▁begin|>import logging
from src.settings import JINJA_ENVIRONMENT
from src.base import BaseHandler
from src.main.models import Torrent, UserTorrent
from google.appengine.ext import ndb
from google.appengine.api import users
import arrow
from time import sleep
class IndexPage(... | # new episodes
if series_watching:
cutoff = arrow.utcnow().replace(days=-14).datetime |
<|file_name|>PicassoExecutorService.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2013 Square, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.or... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# © 2014 Elico Corp (https://www.elico-corp.com)<|fim▁hole|>from . import stock
from . import wizard
from . import product_price_history
from . import account_anglo_saxon_pos
from . import purchase<|fim▁end|> | # Licence AGPL-3.0 or later(http://www.gnu.org/licenses/agpl.html)
from . import product |
<|file_name|>bridge_name_generator_test.go<|end_file_name|><|fim▁begin|>package bridgemgr_test
import (
"code.cloudfoundry.org/garden-linux/network/bridgemgr"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("Bridge Name Generator", func() {
var (
generator bridgemgr.BridgeNameGenerator
... | It("includes the entire prefix as part of the name", func() { |
<|file_name|>main.js<|end_file_name|><|fim▁begin|>'use strict';
describe('Controller: MainCtrl', function () {
// load the controller's module
beforeEach(module('pillzApp'));
var MainCtrl,
scope,<|fim▁hole|>
// Initialize the controller and a mock scope
beforeEach(inject(function (_$httpBackend_, $cont... | $httpBackend; |
<|file_name|>realtime.go<|end_file_name|><|fim▁begin|>package realtime
import (
"context"
"fmt"
"net/http"
"strings"
"time"
"github.com/cozy/cozy-stack/model/instance"
"github.com/cozy/cozy-stack/model/permission"
"github.com/cozy/cozy-stack/model/vfs"
"github.com/cozy/cozy-stack/pkg/consts"
"github.com/coz... | |
<|file_name|>app.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import imp
import os
import sys
PYCART_DIR = ''.join(['python-', '.'.join(map(str, sys.version_info[:2]))])
try:
zvirtenv = os.path.join(os.environ['OPENSHIFT_HOMEDIR'], PYCART_DIR,
'virtenv', 'bin', 'activate_this.py... | ip = os.environ['OPENSHIFT_PYTHON_IP']
port = 8181
zapp = imp.load_source('application', 'wsgi/application')
|
<|file_name|>read_and_enrich.py<|end_file_name|><|fim▁begin|>import os
from HTMLParser import HTMLParser
from ConfigParser import NoOptionError
import nltk
from sentence import Sentence
from resources import Resources
from wordnet_cache import WordnetCache as Wordnet
class ReadAndEnrich(object):
def __init__(se... | toks += Resources.punct_re.split(tok)
return filter(lambda x: x not in ('', 's'), toks) |
<|file_name|>domain.go<|end_file_name|><|fim▁begin|>// Copyright 2014 Rafael Dantas Justo. All rights reserved.
// Use of this source code is governed by a GPL
// license that can be found in the LICENSE file.
// Package handler store the REST handlers of specific URI
package handler
import (
"github.com/rafaeljusto... | case protocol.ErrInvalidDSDigestType:
messageId = "invalid-ds-digest-type"
case protocol.ErrInvalidIP: |
<|file_name|>shell.js<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public<|fim▁hole|> * 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/. */
gTestsubsuite = 'Exceptions';<|fim▁end|> | |
<|file_name|>webpack.dev.config.js<|end_file_name|><|fim▁begin|>const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')
module.exports = {
context: path.resolve(__dirname, '../src'),
entry: './index.js',
output: {
path: path.resolve(__dirname, '../dist'),
filename: 'index.js... | |
<|file_name|>JUMISkinDeformer.java<|end_file_name|><|fim▁begin|>/*
* (C) Copyright 2015 Richard Greenlees
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
* and associated documentation files (the "Software"), to deal in the Software without restriction,
* incl... | |
<|file_name|>commandLineParser.ts<|end_file_name|><|fim▁begin|>/// <reference path="sys.ts"/>
/// <reference path="types.ts"/>
/// <reference path="core.ts"/>
/// <reference path="scanner.ts"/>
module ts {
var shortOptionNames: Map<string> = {
"d": "declaration",
"h": "help",
"m": ... |
switch (opt.type) {
|
<|file_name|>syscoin-util-test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# Copyright 2014 BitPay Inc.
# Copyright 2016-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test framework ... | input_data = json.loads(raw_data)
failed_testcases = []
|
<|file_name|>ProtocolDetector.java<|end_file_name|><|fim▁begin|>package org.ovirt.engine.core.bll.transport;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import org.ovirt.engine.core.bll.Backend;
import org.ovirt.engine.core.common.businessentities.VDS;
import org.ovirt.engine.c... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
jinja2
~~~~~~<|fim▁hole|>
Jinja2 is a template engine written in pure Python. It provides a
Django inspired non-XML syntax but supports inline expressions and
an optional sandboxed environment.
Nutshell
-----... | |
<|file_name|>host_key.hpp<|end_file_name|><|fim▁begin|>/**
@file
Host-key wrapper.
@if license
Copyright (C) 2010, 2013 Alexander Lamaison <awl03@doc.ic.ac.uk>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as publis... | |
<|file_name|>logger.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import logging, logging.handlers
from django.conf import settings
def get_logger(name, level=logging.INFO, format='[%(asctime)s] %(message)s', handler=None, filename=None):
new_logger = logging.getLogger(name)
new_logger.setLevel(lev... | if not handler: |
<|file_name|>io.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/license... | |
<|file_name|>datatypes.rs<|end_file_name|><|fim▁begin|>use serde_json;
use std::io;
use std::string::FromUtf8Error;
#[derive(Deserialize, Debug)]
pub struct Event {
pub version: String,
pub event: String,
pub data: DownloadComplete
}
#[derive(Deserialize, Debug)]
pub struct DownloadComplete {
pu... | }
} |
<|file_name|>_collapse.js<|end_file_name|><|fim▁begin|>(function ($) {
/**
* Toggle the visibility of a fieldset using smooth animations.
*/
Drupal.toggleFieldset = function (fieldset) {
var $toggle = $($(fieldset).find('[data-toggle=collapse]').data('target'));
if ($toggle.length) {
$toggle.collapse('toggle... | var h = document.documentElement.clientHeight || document.body.clientHeight || 0; |
<|file_name|>handler_test.go<|end_file_name|><|fim▁begin|>package provisioner
import (
"bytes"
"context"
"encoding/json"
"net/http"
"net/http/httptest"
"testing"
"github.com/gorilla/mux"
"github.com/pborman/uuid"
"github.com/pkg/errors"
"github.com/stretchr/testify/mock"
"github.com/supergiant/control/pkg... | provisionCluster func(context.Context, *profile.Profile, *steps.Config) (map[string][]*workflows.Task, error)
provisionNode func(context.Context, profile.NodeProfile, *model.Kube, *steps.Config) (*workflows.Task, error) |
<|file_name|>simple_point_picker.py<|end_file_name|><|fim▁begin|># The MIT License (MIT)
#
# Copyright (c) 2016 WUSTL ZPLAB
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restricti... |
point_item_position_has_changed = Qt.pyqtSignal(PointItem)
point_item_list_content_reset = Qt.pyqtSignal()
|
<|file_name|>prior.js<|end_file_name|><|fim▁begin|>'use strict';
var DB = require('./lib/database');
var rc_util = require('./lib/utility.js');
var modelsFactory = require('./lib/models.js');
var selective = require('./program').selective;
var Promise = require('bluebird');
module.exports = function(dbUrl, commander, ... | |
<|file_name|>uniqc_m.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python -Wall
# ================================================================
# Given a list, returns a list of pairs of elements and repetition counts.
# Example (with commas elided for legibility):
#
# Input: [ 1 1 1 2 2 3 3 3 3 5 5 1 1 ]
# Outpu... | |
<|file_name|>test_header.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*-
# from django.test import TestCase
# from block.tests.helper import check_content
# from compose.tests.factories import HeaderFactory
<|fim▁hole|># class TestHeader(TestCase):
#
# def test_content_methods(self):
# c = Head... | |
<|file_name|>gadt.rs<|end_file_name|><|fim▁begin|>extern crate gluon_base as base;
extern crate gluon_check as check;
extern crate gluon_parser as parser;
#[macro_use]
mod support;
use crate::check::typecheck::TypeError;
test_check! {
basic1,
r#"
type Test a =
| Int : Int -> Test Int
Int 1
... | let f x : Test a -> a =
match x with
| Int x -> x |
<|file_name|>discover.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Discover the target host types in the subnet
#
# @author: Sreejith Kesavan <sreejithemk@gmail.com>
import arp
import oui
import ipcalc
import sys
class Discovery(object):
""" Find out the host types in the Ip range (CIDR)
NOT... | print 'Exiting...'
if __name__ == '__main__': |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import sys, shutil
try:
from gi.repository import Gtk, Gdk, Vte, GLib, Pango, GConf, GdkPixbuf
import json, os, getpass
from pycm.pycm_globals import *
except ImportError as e:
print "Error during importing of necessaries modules.... | sys.exit()
|
<|file_name|>test_lapack.py<|end_file_name|><|fim▁begin|>#
# Created by: Pearu Peterson, September 2002
#
import sys
import subprocess
import time
from functools import reduce
from numpy.testing import (assert_equal, assert_array_almost_equal, assert_,
assert_allclose, assert_almost_equal,
... |
def test_ticket_1645(self): |
<|file_name|>dns.rs<|end_file_name|><|fim▁begin|>//! Helpers for parsing DNS packets, modifying properties, and building
//! common responses.
use rand::random;
use std::fmt;
use std::io::Write;
use super::{DNS_UDP_NOEDNS0_MAX_SIZE, DNS_QUERY_MIN_SIZE};
pub const DNS_CLASS_CH: u16 = 3;
pub const DNS_CLASS_IN: u16 = ... | } |
<|file_name|>HttpMethodPrefixCompleter.java<|end_file_name|><|fim▁begin|>/*
* Copyright © 2014 Cask Data, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org... | import java.util.List;
import java.util.Map; |
<|file_name|>pad_op_test.py<|end_file_name|><|fim▁begin|># Copyright 2015 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/licens... | xs = list(x.shape)
ina = tf.convert_to_tensor(a)
y = tf.pad(inx, ina, mode=mode) |
<|file_name|>db.py<|end_file_name|><|fim▁begin|>import logging
import json
import time
from collections import defaultdict
from flotilla.model import FlotillaServiceRevision, FlotillaUnit, \
GLOBAL_ASSIGNMENT, GLOBAL_ASSIGNMENT_SHARDS
from Crypto.Cipher import AES
logger = logging.getLogger('flotilla')
class Flo... | unit_environment = unit_item['environment']
unit_file = unit_item['unit_file']
unit = FlotillaUnit(unit_item['name'], unit_file, unit_environment) |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from setuptools import setup, find_packages
import gravatar
<|fim▁hole|> packages=find_packages(),
long_description=open('README.md').read(),
install_requires=[
'Django',
]
)<|fim▁end|> | setup(
name='dj-gravatar',
version=gravatar.__version__, |
<|file_name|>randomword.py<|end_file_name|><|fim▁begin|><|fim▁hole|>#!/usr/bin/env python
import subprocess, random, sys, os
def randomrange():
try:
value1 = int(sys.argv[1])
value2 = int(sys.argv[2])
randvalue = random.randint(value1, value2)
return randvalue
except IndexError:
randvalue = random.ran... | |
<|file_name|>longformer.py<|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.org/licenses/LICENSE-2.0
# Unless... | cls = self.param('cls', (1, 1, emb_dim), nn.initializers.zeros)
cls = jnp.tile(cls, [x.shape[0], 1, 1])
x = jnp.concatenate([cls, x], axis=1) |
<|file_name|>client.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 at
#
# http://ww... | """Serializes a dictionary into either XML or JSON.
A dictionary with a single key can be passed and it can contain any
structure. |
<|file_name|>protocol.cpp<|end_file_name|><|fim▁begin|>/**
* Copyright (c) 2011-2018 libgroestlcoin developers (see AUTHORS)
*
* This file is part of libgroestlcoin.
*
* libgroestlcoin is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License with
* add... | if (ec)
{ |
<|file_name|>UnitProcessor.java<|end_file_name|><|fim▁begin|>package com.nepfix.sim.elements;
import com.nepfix.sim.core.Processor;
import java.util.Map;
public class UnitProcessor implements Processor {<|fim▁hole|>
private String id;
@Override public void init(String id, Map<String, String> args) {
... | |
<|file_name|>ApplicationTest.java<|end_file_name|><|fim▁begin|>package sl.hr_client;
import android.app.Application;
import android.test.ApplicationTestCase;
/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<A... | |
<|file_name|>blind_sqli_time_delay.py<|end_file_name|><|fim▁begin|>'''
blind_sqli_time_delay.py
Copyright 2008 Andres Riancho
This file is part of w3af, w3af.sourceforge.net .
w3af 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 So... | res.append( statement("1');waitfor delay '0:0:"+str(self._wait_time)+"'--", dbms.MSSQL) )
res.append( statement("1'));waitfor delay '0:0:"+str(self._wait_time)+"'--", dbms.MSSQL) ) |
<|file_name|>socket.js<|end_file_name|><|fim▁begin|>var multiplayer = new function(){
this.players = [];
this.add_player = function(player){
console.log("new player");
var scale = [1,1,1];
var data = {};
data['x1'] = 0;
data['y1'] = 0;
elements.add_OBJ(link_mushroom_obj,link_tree_texture,data, scale,"op... | pickupMushroom: function (id, team, position) { |
<|file_name|>defs.hpp<|end_file_name|><|fim▁begin|>/**
Copyright (c) 2017, Philip Deegan.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyr... | #endif
#ifndef KUL_PRIVATE |
<|file_name|>hartmann6.py<|end_file_name|><|fim▁begin|>'''
Created on 14.07.2015
@author: Aaron Klein
'''
import numpy as np
from robo.task.base_task import BaseTask
class Hartmann6(BaseTask):
def __init__(self):
X_lower = np.array([0, 0, 0, 0, 0, 0])
X_upper = np.array([1, 1, 1, 1, 1, 1])
... | super(Hartmann6, self).__init__(X_lower, X_upper, opt, fopt)
self.alpha = [1.00, 1.20, 3.00, 3.20]
self.A = np.array([[10.00, 3.00, 17.00, 3.50, 1.70, 8.00], |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
#
# TheVirtualBrain-Framework Package. This package holds all Data Management, and
# Web-UI helpful to run brain-simulations. To use it, you also need do download
# TheVirtualBrain-Scientific Package (for simulators). See content of the
# doc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.