prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>service-registry.spec.ts<|end_file_name|><|fim▁begin|>import { ExpressServiceRegistry } from './service-registry';
import { JsRestfulRegistryConfig } from './registry';
import * as express from 'express';
import {expect} from 'chai';
import { Factory } from './test-util.spec';
class TestServiceC {
}
des... | |
<|file_name|>SortDirection.java<|end_file_name|><|fim▁begin|>package com.docuware.dev.schema._public.services.platform;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlType;
@XmlType(name = "SortDirection")
@XmlEnum
public enum SortDirectio... | @XmlEnumValue("Default")
DEFAULT("Default"),
|
<|file_name|>requests.js<|end_file_name|><|fim▁begin|>var request = require('request');
var url = require('url');
var authenticate = require('./oauthentication');
var Request = function(obj){
this.obj = obj;
};
Request.prototype.mailboxes = function(method, specific_url, params, callback){
/*
* @params:
* @ ... | };
Request.prototype.shipments = function(method, specific_url, params, callback){
makeRequest(this, method, 'https://api.slice.com/api/v1/shipments', specific_url, params, callback); |
<|file_name|>mod.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/LI... | /* |
<|file_name|>.eslintrc.js<|end_file_name|><|fim▁begin|>module.exports = {
parserOptions: {<|fim▁hole|> },
};<|fim▁end|> | sourceType: 'script', |
<|file_name|>defines_15.js<|end_file_name|><|fim▁begin|>var searchData=
[
['undefined_5fband',['UNDEFINED_BAND',['../a01181.html#a9efc501b4bfd07c8e00e55bbb5f28690',1,'blkocc.h']]],
['uni_5fmax_5flegal_5futf32',['UNI_MAX_LEGAL_UTF32',['../a00614.html#a98a2f50a1ca513613316ffd384dd1bfb',1,'unichar.cpp']]],
['unichar... | ['unz_5fbufsize',['UNZ_BUFSIZE',['../a01562.html#ac88907609a3408a8ee6544287b6c9880',1,'unzip.c']]],
['unz_5fcrcerror',['UNZ_CRCERROR',['../a01565.html#ae9155f504a5db40587b390f9e487c303',1,'unzip.h']]], |
<|file_name|>chat_commands.py<|end_file_name|><|fim▁begin|>__all__ = ['chatcommand', 'execute_chat_command', 'save_matchsettings', '_register_chat_command']
import functools
import inspect
from .events import eventhandler, send_event
from .log import logger
from .asyncio_loop import loop
_registered_chat_commands =... | def func_wrapper(*args, **kwargs):
return func(*args, **kwargs)
return func_wrapper
|
<|file_name|>PointDistance.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
***************************************************************************
PointDistance.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email ... | current = 0
total = 100.0 / float(len(features)) |
<|file_name|>_outlook.py<|end_file_name|><|fim▁begin|>import datetime
import sqlalchemy.orm.exc
from nylas.logging import get_logger
log = get_logger()
from inbox.auth.oauth import OAuthAuthHandler
from inbox.basicauth import OAuthError
from inbox.models import Namespace
from inbox.config import config<|fim▁hole|>fr... | from inbox.models.backends.outlook import OutlookAccount
from inbox.models.backends.oauth import token_manager |
<|file_name|>caches.py<|end_file_name|><|fim▁begin|>"""
Various caching help functions and classes.
"""
from django.core.cache import cache
DEFAULT_CACHE_DELAY = 60 * 60 # Default cache delay is 1hour. It's quite long.
USERACCOUNT_CACHE_DELAY = 60 * 3 # 3 minutes here. This is used to know if a user i... | We store the key prefix for easy values retrieval
""" |
<|file_name|>local_test.go<|end_file_name|><|fim▁begin|>// Copyright 2011, 2012, 2013 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
package ec2_test
import (
"fmt"
"net"
"regexp"
"sort"
"strings"
"github.com/juju/errors"
jc "github.com/juju/testing/checkers"
"github.com/juju/util... | |
<|file_name|>mirall_cs.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="cs_CZ" version="2.0">
<context>
<name>FolderWizardSourcePage</name>
<message>
<location filename="../src/gui/folderwizardsourcepage.ui" line="14"/>
<source>Form</source>
<translation>F... | <message>
<location filename="../src/gui/logbrowser.cpp" line="194"/>
<source>Error</source>
<translation>Chyba</translation> |
<|file_name|>test_filtering.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2015, 2016 OpenMarket Ltd
#
# 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... | "room": {
"state": {
"types": ["m.*"] |
<|file_name|>ControlGame.ts<|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/.
*/
export interface ControlPoint {
faction: string;<|... | id: string;
size: string; |
<|file_name|>sol-popmenu.js<|end_file_name|><|fim▁begin|>import {module, inject, createRootFactory} from '../mocks';
describe('solPopmenu directive', function () {
let $compile;
let $rootScope;
let createRoot;
let rootEl;
beforeEach(module('karma.templates'));
beforeEach(module('ui-kit'));
... | |
<|file_name|>CTFGameMods.java<|end_file_name|><|fim▁begin|><|fim▁hole|>
import org.bukkit.plugin.java.JavaPlugin;
public class CTFGameMods extends JavaPlugin
{
}<|fim▁end|> | package br.com.gamemods.tutorial.ctf; |
<|file_name|>middleware.py<|end_file_name|><|fim▁begin|>from threading import local
from django.contrib.sites.models import Site
import os<|fim▁hole|>
def get_current_request():
return getattr(_locals, 'request', None)
def get_current_site():
request = get_current_request()
host = request.get_host()
t... |
_locals = local() |
<|file_name|>SMB_Core.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# ============================================================================ #
# SMB_Core.py
#
# Copyright:
# Copyright (C) 2014 by Christopher R. Hertel
#
# $Id: SMB_Core.py; 2019-04-14 16:25:33 -0500; Ch... | return( (8 - (msglen % 8)) & 0x7 ) # 9% code, 91% documentation.
|
<|file_name|>ContinuousOperations.java<|end_file_name|><|fim▁begin|>/*<|fim▁hole|> * Copyright 2004,2005 The Apache Software Foundation.
*
* 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|>__init__.py<|end_file_name|><|fim▁begin|>"""
mbed SDK
Copyright (c) 2011-2017 ARM Limited
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... | # Ignore paths that include parts starting with dot.
skip = False
for part in parts: |
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>"""
Tests for file field behavior, and specifically #639, in which Model.save()
gets called *again* for each FileField. This test will fail if calling a
ModelForm's save() method causes Model.save() to be called more than once.
"""
from __future__ import absolute_impo... | from .models import Photo, PhotoForm, temp_storage_dir
|
<|file_name|>af.js<|end_file_name|><|fim▁begin|>/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.<|fim▁hole|>CKEDITOR.plugins.setLang( 'blockquote', 'af', {
toolbar: 'Sitaatblok'
} );<|fim▁end|> | For licensing, see LICENSE.md or http://ckeditor.com/license
*/ |
<|file_name|>clientos.py<|end_file_name|><|fim▁begin|>"""
Based on http://vaig.be/2009/03/getting-client-os-in-django.html
"""
import re
def client_os(user_agent):
'''
Context processor for Django that provides operating system
information base on HTTP user agent.
A user agent looks like (line break ... | |
<|file_name|>mongolian-vowel-separator.js<|end_file_name|><|fim▁begin|>// Copyright (C) 2016 André Bargull. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-white-space
description: >
Mongolian Vowel Separator is not recognized as white space.
info: |
11.2... | <ZWNBSP>
<USP>
<USP> :: |
<|file_name|>light.cpp<|end_file_name|><|fim▁begin|>#include "stdafx.h"
#include "light.h"
using namespace graphic;
cLight::cLight()
{
}
cLight::~cLight()
{
}
void cLight::Init(TYPE type,
const Vector4 &ambient, // Vector4(1, 1, 1, 1),
const Vector4 &diffuse, // Vector4(0.2, 0.2, 0.2, 1)
const Vector4 &spec... | const Vector3 &direction) // Vector3(0,-1,0) |
<|file_name|>scaler.py<|end_file_name|><|fim▁begin|>import time
import config
from ophyd import scaler
from ophyd.utils import enum
ScalerMode = enum(ONE_SHOT=0, AUTO_COUNT=1)
loggers = ('ophyd.signal',
'ophyd.scaler',
)
config.setup_loggers(loggers)
logger = config.logger
sca = scaler.Epics... | logger.info('sca.channels.get() shows: %s', sca.channels.get()) |
<|file_name|>gengo.py<|end_file_name|><|fim▁begin|>from datetime import datetime
import rfGengou
from . import PluginBase
__all__ = ['Gengo']<|fim▁hole|>
class Gengo(PluginBase):
def execute(self, args):
if len(args) == 0:
target = datetime.now()
elif len(args) == 1:
targe... | |
<|file_name|>and_then.rs<|end_file_name|><|fim▁begin|>#![feature(core, unboxed_closures)]
extern crate core;
#[cfg(test)]
mod tests {
use core::clone::Clone;
// #[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)]
// #[stable(feature = "rust1", since = "1.0.0")]
// pub enum Option<T> {
... | // /// assert!(v == ["Dirt"]);
// /// } |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from setuptools import setup
NAME = "apicaller"
DESCRIPTION = "APICaller makes the creating API client library easier."
AUTHOR = "Jan Češpivo"
AUTHOR_EMAIL = "jan.cespivo@gmail.com"
URL = "https://github.com/cespivo/apicaller"
VERSION = '0.1.2a... | 'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
'Programming Language :: Python', |
<|file_name|>VelocityOverTime.py<|end_file_name|><|fim▁begin|># -*- coding: Latin-1 -*-
"""
@file VelocityOverTime.py
@author Sascha Krieg
@author Daniel Krajzewicz
@author Michael Behrisch
@date 2008-05-29
Shows the velocityCurve of the chosen taxi for all available sources, thereby the time duration per Edg... | |
<|file_name|>version.go<|end_file_name|><|fim▁begin|>// Copyright 2016 <chaishushan{AT}gmail.com>. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package ptyy<|fim▁hole|><|fim▁end|> |
// 数据版本号
const DataVersion = "20160519" |
<|file_name|>xtrabytes_es_DO.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="es_DO" version="2.1">
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About hackcoin</source>
<translation type="un... | </message>
<message> |
<|file_name|>copymapping.go<|end_file_name|><|fim▁begin|>package batch
type CopyMapping struct {<|fim▁hole|><|fim▁end|> | MemberEmail string `json:"member_email"`
SrcPath string `json:"src_path"`
DstPath string `json:"dst_path"`
} |
<|file_name|>0004_add_sqlivrbackend_sqlkookoobackend.py<|end_file_name|><|fim▁begin|>from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('sms', '0003_add_backend_models'),
]
<|fim▁hole|> operations = [
migrations.CreateModel(
name='SQLIVRBa... | |
<|file_name|>twoNode_cfoLogging.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from datetime import *
from numpy import log10, linspace
import time
import sys
mods = [[2,2,2100,78-1]]
pktLens = [1412]; #range(1412, 91, -240) #[1440:-120:120]-28
time_on = 5*60
time_off = 0
numItrs = 1
fileName_offset = 50
#cfo = 2**20
c... | from warpnet_framework.warpnet_client import *
from warpnet_framework.warpnet_common_params import *
from warpnet_experiment_structs import *
from twisted.internet import reactor |
<|file_name|>CommonRequest$29$1.java<|end_file_name|><|fim▁begin|>package com.ximalaya.ting.android.opensdk.datatrasfer;
import com.google.gson.reflect.TypeToken;
import com.ximalaya.ting.android.opensdk.model.album.HotAggregation;
import java.util.List;
class CommonRequest$29$1 extends TypeToken<List<HotAggregation>... | {
} |
<|file_name|>mock_transport.ts<|end_file_name|><|fim▁begin|>// tslint:disable:no-console
import chalk from "chalk";
import { EventEmitter } from "events";
import { assert } from "node-opcua-assert";
import { display_trace_from_this_projet_only, hexDump, make_debugLog } from "node-opcua-debug";
import { analyseExtension... | this._mockTransport.initialize(() => {
console.log("initialized");
});
|
<|file_name|>dbh.py<|end_file_name|><|fim▁begin|>#!/usr/local/bin/python3.4
# dbh.ph debounce hardware
"""
Pyboard:
Switch pins: Y1 or X19
usage:
>>> init()
>>> loop()
"""
from pyb import ExtInt,Pin
# declare the pin id
pinId = 'X19' # interrupt 0 'Y1' # interrupt 6
# itnerrupt mechanics and debounce globals
fla... | except KeyboardInterrupt:
print('Test ended!\nBye ...') |
<|file_name|>0009_auto_20170608_0525.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import datetime
class Migration(migrations.Migration):
dependencies = [
('ccx', '0008_auto_20170523_0630'),<|fim▁hole|> ]
... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | "'--to-user'.") from e
|
<|file_name|>extensionEditingBrowserMain.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 infor... | |
<|file_name|>generate_bnmf.py<|end_file_name|><|fim▁begin|>"""
Generate a toy dataset for the matrix factorisation case, and store it.
We use dimensions 100 by 50 for the dataset, and 10 latent factors.
As the prior for U and V we take value 1 for all entries (so exp 1).
As a result, each value in R has a value of a... |
# Store all matrices in text files |
<|file_name|>write_log.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3
import datetime
import sys
import os
homedir = os.environ['HOME']
log_path = homedir + "/Pigrow/logs/trigger_log.txt"
script = "write_log.py"
message = ""
for argu in sys.argv[1:]:
argu_l = str(argu).lower()
if argu_l == 'help' or argu_... | |
<|file_name|>attr.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 devtools_traits::AttrInfo;
use dom::bindings::cell::DOMRefCe... | /// Sets the owner element. Should be called after the attribute is added
/// or removed from its older parent. |
<|file_name|>main.cpp<|end_file_name|><|fim▁begin|>/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the demonstration applications of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$... | **
****************************************************************************/ |
<|file_name|>tests.rs<|end_file_name|><|fim▁begin|>// Copyright 2016-2018 Matthew D. Michelotti
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICE... | |
<|file_name|>api.py<|end_file_name|><|fim▁begin|>import eventlet
import gettext
import sys
from staccato.common import config
import staccato.openstack.common.wsgi as os_wsgi
import staccato.openstack.common.pastedeploy as os_pastedeploy
# Monkey patch socket and time
eventlet.patcher.monkey_patch(all=False, socket=T... | server.start()
server.wait() |
<|file_name|>app.py<|end_file_name|><|fim▁begin|>from flask import Flask, render_template, flash, session, redirect, url_for
from wtforms import TextAreaField
from wtforms.validators import DataRequired
from flask.ext.wtf import Form
from flask.ext.wtf.recaptcha import RecaptchaField
DEBUG = True
SECRET_KEY = 'secret... | form=form) |
<|file_name|>test_db_consistency.py<|end_file_name|><|fim▁begin|>import pytest
from django.db import connection, IntegrityError
from .models import MyTree
<|fim▁hole|> # Django's testcase thing does eventually flush the constraints but to
# actually test it *within* a testcase we have to flush it manually.
... | def flush_constraints():
# the default db setup is to have constraints DEFERRED.
# So IntegrityErrors only happen when the transaction commits. |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># (C) Datadog, Inc. 2018
# All rights reserved<|fim▁hole|><|fim▁end|> | # Licensed under a 3-clause BSD style license (see LICENSE) |
<|file_name|>jobsReducer.js<|end_file_name|><|fim▁begin|>import {
RECEIVE_ALL_JOBS, RECEIVE_JOB, REQUEST_ALL_JOBS, REQUEST_JOB,
RECEIVE_FILTERED_JOBS, REQUEST_FILTERED_JOBS, CREATE_JOBS,
PAGINATE_JOBS, UPDATE_JOB, DELETE_JOB } from './constants'
const initialState = {
fetchingSelected: false,
selected: null,... | filtered: state.filteredJobs !== null, |
<|file_name|>test.rs<|end_file_name|><|fim▁begin|>macro_rules! enforce {
($($e:expr),+,) => {
if $(!$e)||+ {
return TestResult::discard();
}
}
}
macro_rules! test {
($e:expr) => {
TestResult::from_bool($e)
}
}
trait IsClose {
fn is_close(self, rhs: Self) -> bool... | use quickcheck::TestResult; |
<|file_name|>PyDesignAnalysisItem.py<|end_file_name|><|fim▁begin|>from PyQt5.QtCore import *
from PyDesignData.PyDesignObject import *
from PyDesignModel.PyDesignCalcSheetsItem import PyDesignCalcSheetsItem
from PyDesignModel.PyDesignIcons import *
from PyDesignModel.PyDesignMaterialsItem import PyDesignMaterialsItem
f... | |
<|file_name|>test-router.js<|end_file_name|><|fim▁begin|>"use strict"
var o = require("../../ospec/ospec")
var callAsync = require("../../test-utils/callAsync")
var browserMock = require("../../test-utils/browserMock")
var m = require("../../render/hyperscript")
var callAsync = require("../../test-utils/callAsync")
v... |
redrawService.redraw()
|
<|file_name|>error.go<|end_file_name|><|fim▁begin|>package s3util
import (
"bytes"
"fmt"
"io"
"net/http"<|fim▁hole|>type respError struct {
r *http.Response
b bytes.Buffer
}
func newRespError(r *http.Response) *respError {
e := new(respError)
e.r = r
io.Copy(&e.b, r.Body)
r.Body.Close()
return e
}
func (e... | )
|
<|file_name|>SHA1.java<|end_file_name|><|fim▁begin|>/**
* 对公众平台发送给公众账号的消息加解密示例代码.
*
* @copyright Copyright (c) 1998-2014 Tencent Inc.
*/
// ------------------------------------------------------------------------
package com.weixin.sdk.encrypt;
import java.security.MessageDigest;
import java.util.Arr... | |
<|file_name|>Util.java<|end_file_name|><|fim▁begin|>/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the ... | return visitor.getPhysicalPlan();
}
|
<|file_name|>endpoint_cache_test.go<|end_file_name|><|fim▁begin|>package loadbalancer_test
import (
"io"
"testing"
"time"
"golang.org/x/net/context"
"github.com/go-kit/kit/endpoint"
"github.com/go-kit/kit/loadbalancer"
"github.com/go-kit/kit/log"
)
func TestEndpointCache(t *testing.T) {
var (
e = func(co... | t.Errorf("didn't close the deleted instance in time")
}
|
<|file_name|>placeholderhandler.go<|end_file_name|><|fim▁begin|>package compiler
import (
"bytes"
"fmt"
"net/http"
"github.com/go-on/lib/html/element"
"github.com/go-on/lib/misc/replacer"
)
func mkPhHandler(e *element.Element, key string, buf *bytes.Buffer) (phdl []*placeholderHandler) {
phdl = []*placeholderH... | element.Post(e, buf) |
<|file_name|>kinds.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/... |
#[cfg(stage0)]
#[lang="owned"] |
<|file_name|>gesture.rs<|end_file_name|><|fim▁begin|>// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use EventController;
use EventSequenceState;
use ffi;
use gdk;
use gdk_ffi;
use glib::StaticType;
use glib::Value;
use glib::obje... | fn set_window<'a, P: IsA<gdk::Window> + 'a, Q: Into<Option<&'a P>>>(&self, window: Q);
|
<|file_name|>form.py<|end_file_name|><|fim▁begin|>"""
This module implements the FormRequest class which is a more convenient class
(than Request) to generate Requests based on form data.
See documentation in docs/topics/request-response.rst
"""
import six
from six.moves.urllib.parse import urljoin, urlencode
import... | |
<|file_name|>tasks.py<|end_file_name|><|fim▁begin|>from django.conf import settings
from django.contrib.sites.models import Site
from celery import task
from tower import ugettext as _
from kitsune.sumo.decorators import timeit
from kitsune.sumo import email_utils
@task()
@timeit
def send_award_notification(award):... | html_template='kbadge/email/award_notification.html',
context_vars=context,
from_email=settings.DEFAULT_FROM_EMAIL,
to_email=email) |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
from django.db import models
from imagekit.models.fields import ProcessedImageField
from imagekit.processors import ResizeToFill
from .utils import unique_filename
class DateTimeModel(models.Model):
class Meta:
... | class TypeChart(DateTimeModel):
def __unicode__(self):
return ' '.join([self.frm.name, self.ttype, 'against', self.to.name]) |
<|file_name|>test_lib.js<|end_file_name|><|fim▁begin|>jQuery(function(){
'use strict';
var Test={};<|fim▁hole|> success: 'Success',
failed: 'FAILED',
pending: 'Pending...'
};
var classes = {
success: 'success',
failed: 'danger',
pending: 'warning'
}
var row_id_prefix = 'tests_td_';
var textPrope... | var tests=[];
var messages={ |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#![cfg(test)]<|fim▁hole|>extern crate servo_config;
mod opts;
mo... | |
<|file_name|>subscribeOn.ts<|end_file_name|><|fim▁begin|>import {Observable} from '../../Observable';
import {subscribeOn, SubscribeOnSignature} from '../../operator/subscribeOn';
Observable.prototype.subscribeOn = subscribeOn;
declare module '../../Observable' {
interface Observable<T> {<|fim▁hole|><|fim▁end|> | subscribeOn: SubscribeOnSignature<T>;
}
} |
<|file_name|>TestUnnestOperator.java<|end_file_name|><|fim▁begin|>/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless require... | testUnnest(replicatedTypes, unnestTypes, types);
} |
<|file_name|>ion.rs<|end_file_name|><|fim▁begin|>use shell::Shell;
use shell::status::*;
use std::path::Path;
<|fim▁hole|>
const DOCPATH: &str = "/usr/share/ion/docs/index.html";
pub(crate) fn ion_docs(_: &[&str], shell: &mut Shell) -> i32 {
if !Path::new(DOCPATH).exists() {
eprintln!("ion: ion shell docum... | use std::process::Command; |
<|file_name|>ToolProtocolHTTP.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (c) 2006-2010 Tampere University of Technology
#
# 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 Soft... | |
<|file_name|>test_max_cell.py<|end_file_name|><|fim▁begin|>from __future__ import annotations
import random
import pytest
import scitbx.matrix
from cctbx import sgtbx
from cctbx.sgtbx import bravais_types
from dials.algorithms.indexing.max_cell import find_max_cell
from dials.array_family import flex
@pytest.fixt... | )
known_max_cell = max( |
<|file_name|>mod.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/LI... | pub type CFGIndex = graph::NodeIndex; |
<|file_name|>display.py<|end_file_name|><|fim▁begin|># (c) 2014, Michael DeHaan <michael.dehaan@gmail.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 ve... | else:
new_msg = msg
if new_msg not in self._errors: |
<|file_name|>reference-carried-through-struct-field.rs<|end_file_name|><|fim▁begin|>struct Wrap<'a> { w: &'a mut u32 }
fn foo() {
let mut x = 22;
let wrapper = Wrap { w: &mut x };<|fim▁hole|>fn main() { }<|fim▁end|> | x += 1; //~ ERROR cannot use `x` because it was mutably borrowed [E0503]
*wrapper.w += 1;
}
|
<|file_name|>fence.rs<|end_file_name|><|fim▁begin|>// Copyright 2017 Dasein Phaos aka. Luxko
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license<|fim▁hole|>// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. Thi... | |
<|file_name|>messages.go<|end_file_name|><|fim▁begin|><|fim▁hole|>
import (
"fmt"
"strings"
"github.com/zmj/sfslack/slack"
"github.com/zmj/sfslack/workflow"
)
const (
wfTypeQueryKey = "wftype"
)
func loginMessage(loginURL string) slack.Message {
return slack.Message{
Text: fmt.Sprintf("Please %v", slack.Form... | package wfhost |
<|file_name|>mt.ts<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright Google Inc. 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
*/
// THIS CODE IS GENERATED - DO NOT MODIFY
// See angular/tools/gulp-... | u,
[
['Ħd', 'T', 'Tl', 'Er', 'Ħm', 'Ġm', 'Sb'],
['Ħad', 'Tne', 'Tli', 'Erb', 'Ħam', 'Ġim', 'Sib'], |
<|file_name|>command.rs<|end_file_name|><|fim▁begin|>use std::fmt;
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum DroneMode {
Normal = 0,
TakingOff = 1,
Landing = 2,
TookOff = 3, // Helper mode, doesn't exist on drone
Abort = 4,
}
pub struct Command {
pub pitch: i8,
pub yaw: i8,
pub... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#
# author: Cosmin Basca
#
# Copyright 2010 University of Zurich
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.ap... |
# ----------------------------------------------------------------------------------------------------------------------
# |
<|file_name|>serviceport_test.go<|end_file_name|><|fim▁begin|>// Copyright 2017 The Kubernetes Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/lic... | []api.ServicePort{
{Port: 123, Protocol: api.ProtocolTCP},
{Port: 1, Protocol: api.ProtocolUDP}, |
<|file_name|>hr_attendance_day.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (C) 2018 Compassion CH
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import logging
import pytz
from odoo import models, fields, api
_logger = logging.getLogger(__name__)
class HrAttendanceDay(models... |
# Specific period
att_schedule = current_cal_att.filtered( |
<|file_name|>document_page.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redis... | class DocumentPage(models.Model):
"""This class is use to manage Document."""
_name = "document.page" |
<|file_name|>run_exporter.py<|end_file_name|><|fim▁begin|># run using env as parameter: python run_exporter.py cad id api_key
import exporter
#parse into data type files
import dataset_export
import update_datastore_content #enter key as an argument
from sys import argv
script, env, res_id, api_key = argv
with ope... | update_datastore_content.update_resource(env, res_id, api_key) |
<|file_name|>test_auth.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:/... | response = self.request.get_response(self.middleware) |
<|file_name|>user-service.spec.ts<|end_file_name|><|fim▁begin|>import { UserService } from './user-service';
import { IUser } from './user-model';
import { MockAuthService } from '../../common/services/mock-auth.service';
import { TestBed, getTestBed } from '@angular/core/testing';
import { HttpClientTestingModule, Htt... | |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>//! this is the unoptimized version that performs all 100
//! passes, as per the original description of the problem
fn main() {
// states for the 100 doors
// uses a vector of booleans,
// where state==false means the door is closed
let mut doors = [fa... |
/// unoptimized solution for the 100 Doors problem, |
<|file_name|>test_empty_input.py<|end_file_name|><|fim▁begin|>from io import StringIO
from pathlib import Path
from cwltool.main import main
from .util import get_data
<|fim▁hole|> empty_json = "{}"
empty_input = StringIO(empty_json)
params = [
"--outdir",
str(tmp_path),
get_data(... | def test_empty_input(tmp_path: Path) -> None:
"""Affirm that an empty input works.""" |
<|file_name|>HelloWorldTest.java<|end_file_name|><|fim▁begin|>package com.iclockwork.percy.wechat4j;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/**
* HelloWorldTest
*
* @author: fengwang
* @date: 2016/3/9 13:40
* @version: 1.0
* @si... | private HelloWorld helloworld; |
<|file_name|>test_models.py<|end_file_name|><|fim▁begin|>"""
Tests for miscellaneous models
Author: Chad Fulton
License: Simplified-BSD
"""
from __future__ import division, absolute_import, print_function
import numpy as np
import pandas as pd
import os
import re
import warnings
from statsmodels.tsa.statespace impor... | assert_allclose( |
<|file_name|>url_extractor.py<|end_file_name|><|fim▁begin|>"""
The consumer's code.
It takes HTML from the queue and outputs the URIs found in it.
"""
import asyncio
import json
import logging
from typing import List
from urllib.parse import urljoin
import aioredis
from bs4 import BeautifulSoup
from . import app_cli... | _log.info('Processing HTML from URL %s', html_payload.url)
scraped_urls = _scrape_urls(html_payload.html, html_payload.url)
_log.info('Scraped URIs from URL %s', html_payload.url)
|
<|file_name|>admin.py<|end_file_name|><|fim▁begin|># -*- coding:utf8 -*-
from __future__ import unicode_literals
from django.contrib import admin
from core.models import Post
from core.models import Category
from core.models import Comment
from core.models import Tag
from core.forms import PostForm
@admin.register(Pos... | class Meta:
model = Post
|
<|file_name|>resolver.rs<|end_file_name|><|fim▁begin|>use std::sync::{Arc,Mutex};
use std::collections::HashMap;
use std::io::BufReader;
use rustls::{ResolvesServerCert, ClientHello};
use rustls::sign::{CertifiedKey, RSASigningKey};
use rustls::internal::pemfile;
use sozu_command::proxy::{CertificateAndKey, CertFinger... | impl ResolvesServerCert for CertificateResolverWrapper {
fn resolve(
&self,
client_hello: ClientHello |
<|file_name|>util.js<|end_file_name|><|fim▁begin|>// -*- Mode: JavaScript; tab-width: 2; indent-tabs-mode: nil; -*-
// vim:set ft=javascript ts=2 sw=2 sts=2 cindent:
require('./lib/webfont');
//jquery
var $ = require('jquery');
var Util = (function(window, undefined) {
var fontLoadTimeout = 5000; // 5 seconds
... | var profileEnable = function(on) {
if (on === undefined) on = true;
profileOn = on;
}; // profileEnable |
<|file_name|>vmwareapi_net.py<|end_file_name|><|fim▁begin|># vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2011 Citrix Systems, Inc.
# Copyright 2011 OpenStack LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. Y... | |
<|file_name|>blockdev.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/.
// Code to handle a single block device.
use std::{fs::OpenOpt... | user_info,
hardware_info,
underlying_device,
}) |
<|file_name|>run.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
<|fim▁hole|># See the test.osl source for explanation of this test
command = ... | |
<|file_name|>urlresolvers.py<|end_file_name|><|fim▁begin|>"""
This module converts requested URLs to callback view functions.
RegexURLResolver is the main class here. Its resolve() method takes a URL (as
a string) and returns a ResolverMatch object which provides access to all
attributes of the resolved URL match.
"""... | raise ImproperlyConfigured(msg.format(name=self.urlconf_name))
return patterns
def resolve_error_handler(self, view_type): |
<|file_name|>RegisterModal.js<|end_file_name|><|fim▁begin|>import React from 'react';
import xhttp from 'xhttp';
import {Modal, Button, Input, Alert} from 'react-bootstrap';
import ee from './../Emitter.js';
import ModalComponent from '../components/ModalComponent.js'
import RegistrationForm from './../forms/Registr... | msg: 'Registration request received. You will receive an email when an admin approves your request.',
style: 'success'
})
else |
<|file_name|>driver_mocks.go<|end_file_name|><|fim▁begin|>// Copyright 2018 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 located at
//
// ... | )
|
<|file_name|>reaction.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
###############################################################################
# Module to define chemical reaction functionality
###############################################################################
from math... | check_estequiometria += self.coef[i]*compuesto[1]
self.nombre = nombre
self.peso_molecular = peso_molecular |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.