prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>forms.py<|end_file_name|><|fim▁begin|># ------------------------------------------------------------------------
# coding=utf-8
# ------------------------------------------------------------------------
from __future__ import absolute_import
import os
from django import forms
from django.utils.translati... | |
<|file_name|>my_elbow_angle_tcr_imgt.py<|end_file_name|><|fim▁begin|>'''
More information at: http://www.pymolwiki.org/index.php/elbow_angle
Calculate the elbow angle of an antibody Fab complex and optionally draw a
graphical representation of the vectors used to determine the angle.
NOTE: There is no automatic chec... |
REQUIRES: com.py, transformations.py, numpy (see above) |
<|file_name|>Icon.js<|end_file_name|><|fim▁begin|>let _ = require('underscore'),
React = require('react');
class Icon extends React.Component {
render() {
let className = "icon " + this.props.icon;
let other = _.omit(this.props.icon, "icon");
return (
<span classNa... | |
<|file_name|>bench_setup.rs<|end_file_name|><|fim▁begin|>use froggy::Pointer;
/// Entities with velocity and position component.
pub const N_POS_VEL: usize = 5_000;
/// Entities with position component only.
pub const N_POS: usize = 15_000;
pub struct Position {
pub x: f32,<|fim▁hole|>#[allow(dead_code)]
pub str... | pub y: f32,
}
|
<|file_name|>E0516.rs<|end_file_name|><|fim▁begin|>// Copyright 2016 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/... | let x: typeof(92) = 92; //~ ERROR E0516
//~| reserved keyword
} |
<|file_name|>resources.py<|end_file_name|><|fim▁begin|>from __future__ import with_statement
import sys
import logging
import warnings
import django
from django.conf import settings
try:
from django.conf.urls import patterns, url
except ImportError: # Django < 1.4
from django.conf.urls.defaults import patterns,... | except KeyError:
pass
return kwargs_subset |
<|file_name|>PersistentConnection.d.ts<|end_file_name|><|fim▁begin|>import { ServerActions } from './ServerActions';
import { AuthTokenProvider } from './AuthTokenProvider';
import { RepoInfo } from './RepoInfo';
import { Query } from '../api/Query';
/**
* Firebase connection. Abstracts wire protocol and handles... | /**
* @private
*/
|
<|file_name|>rm.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2011 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.ap... | # Tracks if any buckets were missing. |
<|file_name|>images.js<|end_file_name|><|fim▁begin|>var request = require("request");
var AuthDetails = require("../../auth.json");
exports.commands = [
"image", //gives top image from google search
"rimage", //gives random image from google search
"ggif" //gives random gif from google search
];
exports.i... | }
|
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|>"""
WSGI config for django_webapp project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/
"""<|fim▁hole|>from django.core.wsgi import ge... |
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django_webapp.settings")
|
<|file_name|>p1.py<|end_file_name|><|fim▁begin|>f = open('input.txt')
triangles = [map(int,l.split()) for l in f.readlines()]
possible = 0<|fim▁hole|>
print(possible)<|fim▁end|> | for t in triangles:
t.sort()
if t[0] + t[1] > t[2]:
possible += 1 |
<|file_name|>UnreachableCodeElimination.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2008 Google 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/... | |
<|file_name|>serializer.rs<|end_file_name|><|fim▁begin|>use serialize::json;
use object_builder;
/// Provides functionality to create custom JSON presenters for your structs.
///
/// ## Example
///
/// ```
/// use jsonway::{self, Serializer};
///
/// struct Jedi {
/// name: String
/// }
///
/// struct JediSeri... | ///
/// assert_eq!(
/// json.find_path(&[ |
<|file_name|>number.tsx<|end_file_name|><|fim▁begin|>/**
* @author Adam Meadows <ameadows@ciena.com>
* @copyright 2015 Ciena Corporation. All rights reserved.
*/
import * as React from 'react';
const Demo = require('cy-gh-pages/src/components/demo');
import DemoComponent from './code/number';
const demoSource = re... | /* React method */ |
<|file_name|>GetMetricStatisticsRequestUnmarshaller.java<|end_file_name|><|fim▁begin|>package com.transcend.monitor.transform;
import java.util.Date;
import java.util.Map;
import java.util.TimeZone;
import org.slf4j.Logger;
import com.msi.tough.core.Appctx;
import com.msi.tough.core.DateHelper;
import com.msi.tough.... | logger));
req.setEndTime(MarshallingUtils.unmarshallString(in,
MonitorConstants.NODE_ENDTIME,
logger)); |
<|file_name|>testcase_units.rs<|end_file_name|><|fim▁begin|>// https://rustbyexample.com/generics/phantom/testcase_units.html
// http://rust-lang-ja.org/rust-by-example/generics/phantom/testcase_units.html
use std::ops::Add;
use std::marker::PhantomData;
/// Create void enumerations to define unit types.
#[derive(Deb... | fn add(self, rhs: Length<Unit>) -> Length<Unit> {
// `+` calls the `Add` implementation for `f64`. |
<|file_name|>sequence.js<|end_file_name|><|fim▁begin|><|fim▁hole|>// Copyright 2007 The Closure Library Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//... | |
<|file_name|>5ca019edf61f_cascade_on_delete.py<|end_file_name|><|fim▁begin|>"""Cascade on Delete
Revision ID: 5ca019edf61f
Revises: 469f428604aa
Create Date: 2019-06-23 05:49:26.061932
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "5ca019edf61f"
down_revision... | |
<|file_name|>test_alignments.py<|end_file_name|><|fim▁begin|>import six
from unittest import TestCase
from dark.reads import Read, Reads
from dark.score import HigherIsBetterScore
from dark.hsp import HSP, LSP
from dark.alignments import (
Alignment, bestAlignment, ReadAlignments, ReadsAlignmentsParams,
ReadsA... | alignments = [alignment1, alignment2, alignment3]
hit = ReadAlignments(Read('id1', 'aaa'), alignments) |
<|file_name|>conference.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""
conference.py -- Udacity conference server-side Python App Engine API;
uses Google Cloud Endpoints
$Id: conference.py,v 1.25 2014/05/24 23:42:19 wesc Exp wesc $
created by wesc on 2014 apr 21
"""
__author__ = 'wesc+api@google.com... | # copy SessionForm/ProtoRPC Message into dict |
<|file_name|>int.rs<|end_file_name|><|fim▁begin|>// Copyright 2015 The Ramp Developers
//
// 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... | _ => (), |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | pub mod i32x4; |
<|file_name|>primePalindromeCodeEval.py<|end_file_name|><|fim▁begin|>'''
primepalCodeEval.py - Solution to Problem Prime Palindrome (Category - Easy)
Copyright (C) 2013, Shubham Verma
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as ... |
Input sample:
None |
<|file_name|>desktop-capturer.d.ts<|end_file_name|><|fim▁begin|>// https://github.com/electron/electron/blob/master/docs/api/desktop-capturer.md
declare namespace Electron {
/**
* This module can be used to get available sources that can be used to be captured with getUserMedia.
*/
interface DesktopCapturer {
... | * The format looks like window:XX or screen:XX where XX is a random generated number.
*/
id: string; |
<|file_name|>encoder.rs<|end_file_name|><|fim▁begin|>#![cfg_attr(all(feature = "unstable", test), feature(test))]
#[macro_use]
extern crate serde_derive;
#[macro_use]
extern crate arthas_derive;
extern crate rand;
extern crate arthas;
#[macro_use]
extern crate maplit;
extern crate env_logger;
extern crate serde_json;
... | day_26.clone() => title_26.clone(),
day_27.clone() => title_27.clone()
}), |
<|file_name|>sizzle-src.js<|end_file_name|><|fim▁begin|>/**
* Sizzle Engine Support v2.2.0
* http://rightjs.org/plugins/sizzle
*
* Copyright (C) 2009-2011 Nikolay Nemshilov
*/
/**
* sizzle initialization script
*
* Copyright (C) 2010-2011 Nikolay Nemshilov
*/
RightJS.Sizzle = {
version: '2.2.0'
};
/*!
... |
if ( filter ) { |
<|file_name|>env_gce.go<|end_file_name|><|fim▁begin|>package fingerprint
import (
"encoding/json"
"io/ioutil"
"log"
"net/http"
"net/url"
"os"
"regexp"
"strconv"
"strings"
"time"
"github.com/hashicorp/go-cleanhttp"
"github.com/hashicorp/nomad/client/config"
"github.com/hashicorp/nomad/nomad/structs"
)
//... | metadataURL := os.Getenv("GCE_ENV_URL") |
<|file_name|>test_mixins.py<|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/.
from django.core.exceptions import PermissionDenied
from mock i... |
with patch('oneanddone.users.mixins.redirect') as redirect: |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from PySide2.QtWidgets import QApplication
<|fim▁hole|><p>This plugin allows to create sets of words that can be matched with the
attributes of the project's variants.</p>
<p>
Once the addition of a word set is started, a manual addition one by one of the
words is p... | __title__ = "Wordsets editor"
__description__ = "A plugin to manage word sets"
__long_description__ = """ |
<|file_name|>serviceworkerglobalscope.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;
use devtools_traits::DevtoolSc... | Response(mediator) => {
// TODO XXXcreativcoder This will eventually use a FetchEvent interface to fire event
// when we have the Request and Response dom api's implemented
// https://slightlyoff.github.io/ServiceWorker/spec/service_worker_1/index.html#fetch-e... |
<|file_name|>Renderer.ts<|end_file_name|><|fim▁begin|>import AwaitBlock from './handlers/AwaitBlock';
import Comment from './handlers/Comment';
import DebugTag from './handlers/DebugTag';
import EachBlock from './handlers/EachBlock';
import Element from './handlers/Element';
import Head from './handlers/Head';
import H... | |
<|file_name|>strcmp.rs<|end_file_name|><|fim▁begin|>#[macro_export]
macro_rules! strcmp_tests {
( $TestRegion:path ) => {
use libc::{c_char, c_int, c_void, strcmp};
use lucet_runtime::vmctx::lucet_vmctx;
use lucet_runtime::{lucet_hostcalls, Error, Limits, Region, Val, WASM_PAGE_SIZE};
... | let module = test_module_c("strcmp", "guest.c").expect("compile module");
let region = TestRegion::create(10, &Limits::default()).expect("region can be created"); |
<|file_name|>database.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright 2012 Institut für Experimentelle Kernphysik - Karlsruher Institut für Technologie
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You... | |
<|file_name|>cooki.js<|end_file_name|><|fim▁begin|>/*!<|fim▁hole|> *
* Copyright 2014 Contributors
* Released under the MIT license
* https://github.com/Manoz/Cooki/blob/master/LICENSE
*/
/*!
* Your website scripts below
*/<|fim▁end|> | * Cooki v1.0.0
* http://k-legrand.fr |
<|file_name|>wiki_plugin.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
from __future__ import unicode_literals
# -*- coding: utf-8 -*-
from django.utils.translation import ugettext as _
from wiki.core.plugins import registry
from wiki.core.plugins.base import BasePlugin
from wiki.plugins.macro... | def __init__(self): |
<|file_name|>21613.js<|end_file_name|><|fim▁begin|>/*
This file is part of the HeavenMS MapleStory Server
Copyleft (L) 2016 - 2019 RonanLana
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 Soft... | } else {
qm.forceStartQuest();
} |
<|file_name|>scope.go<|end_file_name|><|fim▁begin|>package scope
import (
"fmt"
"net/url"
"github.com/docker/infrakit/pkg/discovery"
"github.com/docker/infrakit/pkg/discovery/local"
"github.com/docker/infrakit/pkg/plugin"
"github.com/docker/infrakit/pkg/run/scope"
"github.com/docker/infrakit/pkg/spi/controller... |
lookup, _ := name.GetLookupAndType() |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>// Copyright 2013 The GLFW-RS Developers. For a full listing of the authors,
// refer to the AUTHORS file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compli... | // Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and |
<|file_name|>onp_roiswglm.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
# Plugins
Plugins allow flexible modification and execution of OpenNFT without touching the core codebase. Plugins can access data, process them in a specific way,
and they can be switched on and off according to the user's need.
Ea... | - plugin_exec: It is the execution code of the plugin, and it is usually calls the plugin's load_data method to transfer some data to the plugin. |
<|file_name|>itunes_item_extension_builder.rs<|end_file_name|><|fim▁begin|>// This file is part of feed.
//<|fim▁hole|>// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation; either version 3 of the License, or
// (at your option) any later version.
//! The fiel... | // Copyright © 2015-2017 Chris Palmer <pennstate5013@gmail.com>
//
// This program is free software; you can redistribute it and/or modify |
<|file_name|>0012_auto__chg_field_conclusion_title__chg_field_answer_title__chg_field_qu.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration)... | |
<|file_name|>apigenrole.py<|end_file_name|><|fim▁begin|>from docutils import nodes, utils
from docutils.parsers.rst.roles import set_classes
# I cant figure out how the hell to import this so I'm just gonna forget it for now
def apigen_role(name, rawtext, text, lineno, inliner, options={}, content=[]):
"""Link to... |
:param app: Sphinx application context. |
<|file_name|>nurseconnect_tags.py<|end_file_name|><|fim▁begin|>import calendar
from django.template import Library
from molo.core.templatetags.core_tags import load_sections
from molo.profiles.models import UserProfilesSettings
from nurseconnect.utils import get_survey_results_for_user
register = Library()
@regis... | If a user has already submitted an answer they see their results |
<|file_name|>317ce6b677c486cd0ff0fa900186c6309aa26ae3.js<|end_file_name|><|fim▁begin|>var Todo = React.createClass({displayName: "Todo",
getInitialState: function() {
this.text = "";
return {text: ""};
},
componentWillUnmount: function() {
this.ref.off();
},
componentWillMount: function() {
th... | React.createElement("li", null, React.createElement("a", {href: "?"}, "Lists"))
)
) |
<|file_name|>plugin-flattener.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.
*-... | filename: "code-model-v4-no-tags.yaml",
content: serialize(result), |
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|>"""
WSGI config for mysite project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
import os, sys
from django.core.wsgi import get... | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "evewspace.settings") |
<|file_name|>bigint.js<|end_file_name|><|fim▁begin|>// Copyright (C) 2017 Josh Wolfe. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: Bitwise AND for BigInt values
esid: sec-bitwise-op
info: |
BitwiseOp(op, x, y)
1. Let result be 0.
2. Let shift be ... | assert.sameValue(0b01n & 0b00n, 0b00n, "0b01n & 0b00n === 0b00n");
assert.sameValue(0b00n & 0b10n, 0b00n, "0b00n & 0b10n === 0b00n"); |
<|file_name|>Dijkstra.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Created on Tue Nov 17 19:41:46 2015
@author: deep
"""
from graph import weightedGraph
import heapq
def djikstra(a,S):
N = len(a.adjLst)
Visited = [False for i in xrange(N)]
Distance = [float('inf') for i in xrange(N)]
Dis... | if Distance[v] > Distance[u] + weight_uv: |
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>import json
from djpcms import test
from djpcms.plugins.text import Text
class Editing(test.TestCase):
def setUp(self):
super(Editing,self).setUp()
p = self.get()['page']
p.set_template(p.create_template('thre-columns',
... |
def testRearrange1to4SameBlock(self):
block = self.get_block(2,1)
toblock = self.get_block(2,4)
|
<|file_name|>feeds.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
from django.contrib.syndication.views import Feed
from django.contrib.sites.models import get_current_site
from django.shortcuts import get_object_or_404
from django.contrib.auth.models import User
from django_images.models imp... | |
<|file_name|>minimal.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# minimal.py --- Minimal example of using traits.
<|fim▁hole|>from traits.api import HasTraits, Float
class Person(HasTraits):
weight = Float(150.0)<|fim▁end|> | |
<|file_name|>psapi.rs<|end_file_name|><|fim▁begin|>// Copyright © 2015, skdltmxn
// Licensed under the MIT License <LICENSE.md>
//! API Prototypes and Definitions for PSAPI.DLL
pub const LIST_MODULES_DEFAULT: ::DWORD = 0x0;
pub const LIST_MODULES_32BIT: ::DWORD = 0x01;
pub const LIST_MODULES_64BIT: ::DWORD = 0x02;
pub ... | pub type PPSAPI_WS_WATCH_INFORMATION_EX = *mut PSAPI_WS_WATCH_INFORMATION_EX; |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>#[macro_use]
pub mod assert;
<|fim▁hole|><|fim▁end|> | pub mod task_domain; |
<|file_name|>_models.py<|end_file_name|><|fim▁begin|># coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by ... | self.destination_ports = kwargs.get('destination_ports', None)
self.protocols = kwargs.get('protocols', None) |
<|file_name|>settings.py<|end_file_name|><|fim▁begin|>"""
Django settings for MapaAsentamientosTecho project.
Generated by 'django-admin startproject' using Django 1.9.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
... | |
<|file_name|>imagenator.ts<|end_file_name|><|fim▁begin|>//original code is from http://www.html5canvastutorials.com/tutorials/html5-canvas-wrap-text-tutorial/
class Imagenator {
static convertText(text: string = "표 표 고 으 로 리\r\n로 온 랑 문 로 스\r\n 점 자 죽 만 트\r\n치 과 마 더 간 스 들 도\r\n환 침 배 크 고\r\n! 꺾 표 따 경... | |
<|file_name|>getElementsByCache.js<|end_file_name|><|fim▁begin|><|fim▁hole|>// 如果没有缓存的话建立缓存,否则返回缓存中的标签对象
function getElements(name) {
if (!getElements.cache) {
getElements.cache = {};
}
return getElements.cache[name] = getElements.cache[name] || document.getElementsByTagName(name);
}<|fim▁end|> | // 使用缓存优化标签选择 |
<|file_name|>print_with_newline.rs<|end_file_name|><|fim▁begin|>// FIXME: Ideally these suggestions would be fixed via rustfix. Blocked by rust-lang/rust#53934
// // run-rustfix
#![allow(clippy::print_literal)]
#![warn(clippy::print_with_newline)]
fn main() {
print!("Hello\n");
print!("Hello {}\n", "world");
... | "
);
print!(
r" |
<|file_name|>dynamic_shaders.rs<|end_file_name|><|fim▁begin|>use std::time::Instant;<|fim▁hole|><|fim▁end|> |
use super::{ShaderSetInner, ShaderSource}; |
<|file_name|>hidden-rt-injection.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
// http://www.apache... |
// This is testing that users can't access the runtime crate.
mod m { |
<|file_name|>WebConfig.java<|end_file_name|><|fim▁begin|>package com.pcalouche.spat.config;
import com.pcalouche.spat.interceptors.LoggerInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servle... | public class WebConfig implements WebMvcConfigurer {
private final SpatProperties spatProperties;
private final LoggerInterceptor loggerInterceptor; |
<|file_name|>keycodes.py<|end_file_name|><|fim▁begin|>import pygame
# EXPORT
KeyCodes = {
"BACKSPACE": pygame.K_BACKSPACE,
"TAB": pygame.K_TAB,
"CLEAR": pygame.K_CLEAR,
"RETURN": pygame.K_RETURN,
"PAUSE": pygame.K_PAUSE,
"ESCAPE": pygame.K_ESCAPE,
"SPACE": pygame.K_SPACE,
"EXCLAIM": pyg... | "u": pygame.K_u,
"v": pygame.K_v,
"w": pygame.K_w,
"x": pygame.K_x, |
<|file_name|>aiohttp.py<|end_file_name|><|fim▁begin|>"""Utilities to help with aiohttp."""
import json
from typing import Any, Dict, Optional
from urllib.parse import parse_qsl
from multidict import CIMultiDict, MultiDict
class MockRequest:
"""Mock an aiohttp request."""
def __init__(
self,
... | |
<|file_name|>AgentPath.java<|end_file_name|><|fim▁begin|>/**
* This file is part of the CRISTAL-iSE kernel.
* Copyright (c) 2001-2015 The CRISTAL Consortium. All rights reserved.
<|fim▁hole|> * This library is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Publ... | *
|
<|file_name|>setup.py<|end_file_name|><|fim▁begin|># Copyright 2012 Anton Beloglazov
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.<|fim▁hole|>#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | # You may obtain a copy of the License at |
<|file_name|>cloudpipe.py<|end_file_name|><|fim▁begin|># 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. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENS... | except db.NoMoreNetworks:
msg = _("Unable to claim IP for VPN instances, ensure it "
"isn't running, and try again in a few minutes")
raise exception.ApiError(msg) |
<|file_name|>core_dependencies.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# Copyright 2003 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
# This tests correct handling of dependencies, specifically,... | |
<|file_name|>bools.py<|end_file_name|><|fim▁begin|>"""
Some utilities for bools manipulation.
<|fim▁hole|>Copyright 2013 Deepak Subburam
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... | |
<|file_name|>xgen_usb_otg_device.go<|end_file_name|><|fim▁begin|>package usb
// DO NOT EDIT THIS FILE. GENERATED BY xgen.
import (
"bits"
"mmio"
"unsafe"
"stm32/o/f411xe/mmap"
)
type USB_OTG_Device_Periph struct {
DCFG RDCFG
DCTL RDCTL
DSTS RDSTS
_ uint32
DIEPMSK RDIEPMSK
DOE... | |
<|file_name|>test_worker.js<|end_file_name|><|fim▁begin|>importScripts('../js/examples.js', './solutions.js', '../js/Puzzle.js');
onmessage = function (event) {
if (event.data === 'start') {
runTests();
}
};
function runTests() {
var count = 1;
for (var name in solutions) {
test... | |
<|file_name|>KafkaST.java<|end_file_name|><|fim▁begin|>/*
* Copyright Strimzi authors.
* License: Apache License 2.0 (see the file LICENSE or http://apache.org/licenses/LICENSE-2.0.html).
*/
package io.strimzi.systemtest.kafka;
import io.fabric8.kubernetes.api.model.ConfigMap;
import io.fabric8.kubernetes.api.model... | .endTemplate() |
<|file_name|>gwcred.py<|end_file_name|><|fim▁begin|>###
# Copyright (c) 2005, Ali Afshar
# 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 abov... | """ Return an avatar id or return an error """
a = self.cb.getUser(protocol=self.cb.PROTOCOL,
username=credentials.username, |
<|file_name|>drive_api_util.cc<|end_file_name|><|fim▁begin|>// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/drive/drive_api_util.h"
#include <string>
#include "base/files/... | scoped_ptr<google_apis::AppList> resource(new google_apis::AppList);
|
<|file_name|>multi_product.rs<|end_file_name|><|fim▁begin|>#![cfg(feature = "use_std")]
use crate::size_hint;
use crate::Itertools;
#[derive(Clone)]
/// An iterator adaptor that iterates over the cartesian product of
/// multiple iterators of type `I`.
///
/// An iterator element type is `Vec<I>`.
///
/// See [`.mult... | /// finished; false otherwise.
fn in_progress(&self) -> bool { |
<|file_name|>gamification.js<|end_file_name|><|fim▁begin|>openerp.gamification = function(instance) {
var QWeb = instance.web.qweb;
instance.gamification.Sidebar = instance.web.Widget.extend({
template: 'gamification.UserWallSidebar',
init: function (parent, action) {
var self = thi... | |
<|file_name|>core.py<|end_file_name|><|fim▁begin|># Copyright (c) 2014 by Ecreall under licence AGPL terms
# available on http://www.gnu.org/licenses/agpl.html
# licence: AGPL
# author: Amen Souissi
import colander
import venusian
from BTrees.OOBTree import OOBTree
from persistent.list import PersistentList
from pers... | |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use document_loader::{DocumentLoader, LoadType};
use dom::binding... | Tokenizer::Xml(self::xml::Tokenizer::new(document, url)),
LastChunkState::NotReceived,
ParserKind::Normal);
parser.parse_string_chunk(String::from(input)); |
<|file_name|>PopupWindow.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General ... | super.notifyLocationChanged(newX, newY);
anchorX.set(windowToAnchorX(newX));
anchorY.set(windowToAnchorY(newY));
} |
<|file_name|>FSRepositoryTest.java<|end_file_name|><|fim▁begin|>/**
* Copyright (c) 2005-2011 Juan F. Codagnone <http://juan.zaubersoftware.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 Lice... | final Course beforeCourse = new MockCourse(courseName, courseCode,
courseLevel , Arrays.asList(new Material[] {
new MockMaterialFile(fileName, content[0], beforeDate)
})); |
<|file_name|>expression_test.go<|end_file_name|><|fim▁begin|>// Copyright 2016 PingCAP, 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/licenses/LICEN... | stmt := st.(*ast.SelectStmt)
return stmt.Fields.Fields[0].Expr
}
|
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from setuptools import setup, find_packages
setup(
name="tomorrow",
version="0.2.4",
author="Madison May",
author_email="madison@indico.io",
packages=find_packages(
exclude=[
'tests'
]
),
install_requires=[
... | Magic decorator syntax for asynchronous code.
""",
license="MIT License (See LICENSE)",
long_description=open("README.rst").read(), |
<|file_name|>trakt_lookup.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals, division, absolute_import
import logging
from flexget import plugin
from flexget.event import event
from flexget.manager import Session
try:
from flexget.plugins.api_trakt import ApiTrakt
lookup_series = ApiTrak... | |
<|file_name|>__main__.py<|end_file_name|><|fim▁begin|>#
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 by Anselm Kruis
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apa... | |
<|file_name|>deploy_symbols_s3.py<|end_file_name|><|fim▁begin|>import sys
import os.path
import lzma
import time
import os
import subprocess
if "APPVEYOR_REPO_TAG" not in os.environ or os.environ["APPVEYOR_REPO_TAG"] != "true":
print("Not uploading symbols since build is not tagged")
sys.exit()
symbol_filenam... |
with open(symbol_filename, "rt") as fh:
first_line = next(fh).strip() |
<|file_name|>forEach.js<|end_file_name|><|fim▁begin|>describe("The ot object has a forEach method, which allows you: ", function () {
it("To iterate over an array", function () {
var array = [1, 2, 4, 8, 16];
var sum = 0;
var sumIndex = 0;
ot.forEach(array, function (value, index) ... | ot.forEach(obj, function (value, key) { |
<|file_name|>api_tests.rs<|end_file_name|><|fim▁begin|>// Copyright (C) 2017 Red Hat, Inc.
//
// This file is part of bdcs-api-server.
//
// bdcs-api-server 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, ei... | |
<|file_name|>test_watcher.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
""" watcher test cases """
<|fim▁hole|>from zk_shell.watcher import ChildWatcher
class WatcherTestCase(ShellTestCase):
""" test watcher """
def test_add_update(self):
watcher = ChildWatcher(self.client, print_func=self.... | from .shell_test_case import ShellTestCase
|
<|file_name|>MailAlarm.java<|end_file_name|><|fim▁begin|>package com.taobao.zeus.broadcast.alarm;
import java.net.InetAddress;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Properties;
import javax.mail.Message;
import javax.mail.Messagin... | log.info( "jobId: " + jobId +" begin to send the email!");
Properties props = new Properties();
props.put("mail.smtp.host", host); |
<|file_name|>index.tsx<|end_file_name|><|fim▁begin|>import * as React from 'react';
import PropTypes from 'prop-types';
import RcSelect, { Option, OptGroup } from 'rc-select';
import classNames from 'classnames';
import LocaleReceiver from '../locale-provider/LocaleReceiver';
import defaultLocale from '../locale-provid... | );
}
|
<|file_name|>notparallel_chain_fit.py<|end_file_name|><|fim▁begin|># Copied from LMC documentation
# Modified to use MPI (but not enable parallelization), to increase the parameter degeneracy, and to disperse the start points
# Here is a simple example. As shown it will run in non-parallel mode; comments indicate what... |
### Print the chain to the terminal as well
#backends.append( stdoutBackend() )
|
<|file_name|>lint-non-uppercase-associated-const.rs<|end_file_name|><|fim▁begin|>#![deny(non_upper_case_globals)]
#![allow(dead_code)]
<|fim▁hole|>impl Foo {
const not_upper: bool = true;
}
//~^^ ERROR associated constant `not_upper` should have an upper case name
fn main() {}<|fim▁end|> | struct Foo;
|
<|file_name|>CardImg.d.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>import { CSSModule } from './utils';
export interface CardImgProps
extends React.ImgHTMLAttributes<HTMLImageElement> {
[key: string]: any;
tag?: React.ElementType;
top?: boolean;
bottom?: boolean;
cssModule?: CSSModule;
}
declare class Car... | import * as React from 'react'; |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//
// imag - the personal information management suite for the commandline
// Copyright (C) 2015-2020 Matthias Beyer <mail@beyermatthias.de> and contributors
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesse... | //
// This library is distributed in the hope that it will be useful, |
<|file_name|>endpoint_handler.py<|end_file_name|><|fim▁begin|>"""
HTTP handeler to serve specific endpoint request like
http://myserver:9004/endpoints/mymodel
For how generic endpoints requests is served look
at endpoints_handler.py
"""
import json
import logging
import shutil
from tabpy.tabpy_server.common.util impo... | # delete files
if endpoint_info["type"] != "alias":
delete_path = get_query_object_path( |
<|file_name|>app.ts<|end_file_name|><|fim▁begin|>import {Component} from 'angular2/core';
import {RouteConfig, ROUTER_DIRECTIVES} from 'angular2/router';
import {ManagmentFormComponent} from '/app/component/managment/form';<|fim▁hole|>
@Component({
selector: 'my-app',
template: `
<!-- Static navbar -->
<nav... | import {ManagmentFormAddComponent} from '/app/component/managment/form.add'; |
<|file_name|>wallet.py<|end_file_name|><|fim▁begin|># Electrum - lightweight Bitcoin client
# Copyright (C) 2015 Thomas Voegtlin
#
# 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 rest... | _type, data, value = o |
<|file_name|>RoleTreeView.java<|end_file_name|><|fim▁begin|>package org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui;
import java.util.ArrayList;
import org.ovirt.engine.core.common.businessentities.ActionGroup;
import org.ovirt.engine.core.common.mode.ApplicationMode;
import org.ovirt.engine.ui.uicommonweb.... | ConstantsManager.getInstance()
.getConstants()
.allowToChangeStorageDomainStatusRoleTreeTooltip()) })), |
<|file_name|>name-list.service.spec.ts<|end_file_name|><|fim▁begin|>import { NameListService } from "./name-list.service";
<|fim▁hole|> beforeEach(() => {
nameListService = new NameListService;
});
it("should return the list of names", () => {
let names = nameListService.get();
expect(name... | export function main() {
describe("NameList Service", () => {
let nameListService: NameListService;
|
<|file_name|>messages.cpp<|end_file_name|><|fim▁begin|>/*****************************************************************************
* messages.cpp : Information about an item
****************************************************************************
* Copyright (C) 2006-2011 the VideoLAN team
* $Id$
*
* Autho... |
updateButton = new QPushButton( QIcon(":/update"), "" ); |
<|file_name|>helper_blackbox_test.go<|end_file_name|><|fim▁begin|>/*
Copyright 2015 The Kubernetes Authors.
<|fim▁hole|> http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES... | 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
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.