prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>test_views.py<|end_file_name|><|fim▁begin|>from django.test import TestCase, RequestFactory
from main.models import *
from main.views import *
from bs4 import BeautifulSoup
from .base import *
import datetime
from feedback.models import IndividualFeedback
class StatusCheckTest(TestCase):
"""Testing t... | student2 = stuff[2]
assessment1 = Assessment.objects.create(
module=module, title="Essay 1", value=50)
assessment2 = Assessment.objects.create( |
<|file_name|>slider.rs<|end_file_name|><|fim▁begin|>use {
Backend,
CharacterCache,
Color,
Colorable,
FontSize,
Frameable,
Labelable,
IndexSlot,
KidArea,
Mouse,
Padding,
Positionable,
Range,
Rect,
Rectangle,
Scalar,
Text,
Widget,
};
use num::{Float,... | pub enum Interaction {
Normal,
Highlighted, |
<|file_name|>sync.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015 SUSE Linux GmbH. All rights reserved.
#
# This file is part of kiwi.
#
# kiwi 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 vers... | # not changed |
<|file_name|>provider_test.go<|end_file_name|><|fim▁begin|>package openstack_test
import (
"flag"
. "launchpad.net/gocheck"
"testing"<|fim▁hole|>func Test(t *testing.T) {
if *live {
registerOpenStackTests()
}
registerLocalTests()
TestingT(t)
}<|fim▁end|> | )
var live = flag.Bool("live", false, "Include live OpenStack (Canonistack) tests")
|
<|file_name|>_security_rules_operations.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.
#... | return deserialized |
<|file_name|>MultiLineFunctionDeclarationUnitTest.js<|end_file_name|><|fim▁begin|>function someFunctionWithAVeryLongName(firstParameter='something',
secondParameter='booooo',
third=null, fourthParameter=false,
fifthParameter=123.12,
sixthParam=true
){
}
function someFunctionWithAVeryLongName2(
firstPara... | }
someFunctionWithAVeryLongName3: function ( |
<|file_name|>exceptions.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
class APIClientException(Exception):
pass
class APIForbidden(APIClientException):
pass
<|fim▁hole|>
class APIInvalidData(APIClientException):
pass
class APIDuplicateObject(APIClientException):
def __init__(self, msg... | class APINotAuthorized(APIClientException):
pass |
<|file_name|>slushfile.js<|end_file_name|><|fim▁begin|>/*
* slush-ml-3t
* https://github.com/edmacabebe/slush-ml-3t
*
* Copyright (c) 2017, edmacabebe
* Licensed under the MIT license.
*/
'use strict';
var gulp = require('gulp'),<|fim▁hole|> rename = require('gulp-rename'),
_ = require('underscore.string... | install = require('gulp-install'),
conflict = require('gulp-conflict'),
template = require('gulp-template'), |
<|file_name|>scriptin.js<|end_file_name|><|fim▁begin|>/* webui functions */
function model_server(data) {
var self = this;
$.extend(self, data);
self.mem_utilization = ko.computed(function() {
return '{0} / {1}'.format(parseInt(self.memory), self.java_xmx);
})
self.capacity = ko.computed(function(... | },
importable: function(data) {
self.vmdata.importable(data.ascending_by('filename'));
|
<|file_name|>megaslider.js<|end_file_name|><|fim▁begin|>$(document).ready(function(){
'use strict';<|fim▁hole|>
//Turn off and on the music
$("#sound-control").click(function() {
var toggle = document.getElementById("sound-control");
var music = document.getElementById("music");
if(music.paused){
musi... | |
<|file_name|>IssueView.ts<|end_file_name|><|fim▁begin|>// Copyright 2020 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.
import * as Common from '../../core/common/common.js';
import * as Host from '../../core/host/host.... | i18nString(UIStrings.hideIssuesLikeThis),
menuItemAction: () => {
const setting = IssuesManager.IssuesManager.getHideIssueByCodeSetting();
const values = setting.get(); |
<|file_name|>test_compat.py<|end_file_name|><|fim▁begin|>from django.db import models
from django.test import TestCase<|fim▁hole|>from ..models.compat import YAMLField
class TestYAMLModel(models.Model):
yaml_field = YAMLField()
class TestYAMLField(TestCase):
...
def test_to_python(self):
yaml_d... | |
<|file_name|>config_personal.py<|end_file_name|><|fim▁begin|>import os.path as osp
import os
USE_GPU = False
AWS_REGION_NAME = 'us-east-2'<|fim▁hole|># DOCKER_IMAGE = 'dwicke/jump:docker'
DOCKER_IMAGE = 'dwicke/parameterized:latest'
DOCKER_LOG_DIR = '/tmp/expt'
AWS_S3_PATH = 's3://pytorchrl/pytorchrl/experim... |
if USE_GPU:
DOCKER_IMAGE = 'dementrock/rllab3-shared-gpu'
else: |
<|file_name|>encodable.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/... | encoder, |
<|file_name|>mkfs.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*-
"""
@todo: Update argument parser options
"""
# Imports. {{{1
import sys
# Try to load the required modules from Python's standard library.
try:
import os
import argparse
from time import time
import hashlib
except ImportError a... |
for modname in compression_methods:
_fuse.appendCompression(modname) |
<|file_name|>webpack.dev.conf.js<|end_file_name|><|fim▁begin|>var utils = require('./utils')
var webpack = require('webpack')
var config = require('../config')<|fim▁hole|>var baseWebpackConfig = require('./webpack.base.conf')
var HtmlWebpackPlugin = require('html-webpack-plugin')
var FriendlyErrorsPlugin = require('fri... | var merge = require('webpack-merge') |
<|file_name|>test_dms.py<|end_file_name|><|fim▁begin|># -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*-
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 fileencoding=utf-8
#
# MDAnalysis --- https://www.mdanalysis.org
# Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors... | # MDAnalysis: A Toolkit for the Analysis of Molecular Dynamics Simulations.
# J. Comput. Chem. 32 (2011), 2319--2327, doi:10.1002/jcc.21787 |
<|file_name|>clients.go<|end_file_name|><|fim▁begin|>package core
<|fim▁hole|>type Clients []*Client
// RLockRecursive _
func (cs *Clients) RLockRecursive() {
for _, client := range *cs {
client.RLockAnon()
}
}
// RUnlockRecursive _
func (cs *Clients) RUnlockRecursive() {
for _, client := range *cs {
client.RU... | // Clients _ |
<|file_name|>directors_api.py<|end_file_name|><|fim▁begin|># coding: utf-8
"""
Server API
Reference for Server API (REST/Json)
OpenAPI spec version: 2.0.6
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import sys
import os
import re... | This method makes a synchronous HTTP request by default. To make an |
<|file_name|>showdesktop.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="en_US">
<context>
<name>ShowDesktop</name>
<message>
<location filename="../showdesktop.cpp" line="48"/>
<source>Show desktop</source>
<translation ty... | </message>
<message> |
<|file_name|>TargetPolicy.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2005 JBoss 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/LICENS... | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ |
<|file_name|>validators.py<|end_file_name|><|fim▁begin|>import struct
def validate_transaction_id(request_mbap, response):<|fim▁hole|> """ Check if Transaction id in request and response is equal. """
assert struct.unpack('>H', request_mbap[:2]) == \
struct.unpack('>H', response[:2])
def validate_pro... | |
<|file_name|>NameDatabase.hpp<|end_file_name|><|fim▁begin|>/*
Copyright_License {
XCSoar Glide Computer - http://www.xcsoar.org/
Copyright (C) 2000-2016 The XCSoar Project
A detailed list of copyright holders can be found in the file "AUTHORS".
This program is free software; you can redistribute it and/or
m... | int Find(FlarmId id) const;
gcc_pure |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>export * from './number-spinner.component';<|fim▁end|> | |
<|file_name|>data_source_obmcs_identity_group_test.go<|end_file_name|><|fim▁begin|>// Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
package main
import (
"testing"
"time"
"github.com/MustWin/baremetal-sdk-go"
"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terrafo... | resource.UnitTest(s.T(), resource.TestCase{ |
<|file_name|>version.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-<|fim▁hole|><|fim▁end|> |
__version__ = "1.2.3" |
<|file_name|>get_bucket_location.go<|end_file_name|><|fim▁begin|>/**
* Author: CZ cz.theng@gmail.com
*/
package bucket
import (
"encoding/xml"
"github.com/cz-it/aliyun-oss-golang-sdk/ossapi"
"path"
"strconv"
)
// LocationInfo is locaiton struct<|fim▁hole|>type LocationInfo struct {
XMLName xml.Name `xml:"Loca... | |
<|file_name|>runserver.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
import errno
import os
import re
import socket
import sys
from datetime import datetime
<|fim▁hole|>from django.db import DEFAULT_DB_ALIAS, connections
from django.db.migrations.executor import MigrationExecutor
from django.... | from django.core.exceptions import ImproperlyConfigured
from django.core.management.base import BaseCommand, CommandError
from django.core.servers.basehttp import get_internal_wsgi_application, run |
<|file_name|>en-gb.py<|end_file_name|><|fim▁begin|># coding: utf8
{
' Assessment Series Details': ' Assessment Series Details',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" is an optional expression like "field1=\'newvalue\'". You cannot u... | 'Wind Chill': 'Wind Chill',
'Window frame': 'Window frame',
'Winter Storm': 'Winter Storm', |
<|file_name|>email_test.py<|end_file_name|><|fim▁begin|>import bountyfunding
from bountyfunding.core.const import *
from bountyfunding.core.data import clean_database
from test import to_object
from nose.tools import *
USER = "bountyfunding"
class Email_Test:
def setup(self):
self.app = bountyfunding.... | r = self.app.delete("/email/%s" % email.id) |
<|file_name|>SemiLagrangianExpression.cpp<|end_file_name|><|fim▁begin|>// Copyright (C) 2013 Columbia University in the City of New York and others.
//
// Please see the AUTHORS file in the main source directory for a full list
// of contributors.
//
// This file is part of TerraFERMA.
//
// TerraFERMA is free software... | // check if the current xstar_ is in the cache and/or is valid
//*******************************************************************|************************************************************// |
<|file_name|>custom.py<|end_file_name|><|fim▁begin|>#This is a cell with a custom comment as marker
x=10<|fim▁hole|>print(x+y)<|fim▁end|> | y=11 |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>import { RNGeth as Geth, Hooks } from './packages/geth';
export default Geth;
export const useKeyStore = Hooks.useKeyStore;<|fim▁hole|><|fim▁end|> | export const useEthereumClient = Hooks.useEthereumClient; |
<|file_name|>test_migrations.py<|end_file_name|><|fim▁begin|># Copyright 2010-2011 OpenStack Foundation
# Copyright 2012-2013 IBM 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
# ... | super(TestWalkVersions, self).setUp()
self.migration_api = mock.MagicMock()
self.engine = mock.MagicMock()
self.REPOSITORY = mock.MagicMock() |
<|file_name|>ExampleInterface.java<|end_file_name|><|fim▁begin|><|fim▁hole|>package org.edtoktay.dynamic.compiler;
/**
* @author deniz.toktay
*
*/
public interface ExampleInterface {
void addObject(String arg1, String arg2);
Object getObject(String arg1);
}<|fim▁end|> | /**
*
*/ |
<|file_name|>languages.py<|end_file_name|><|fim▁begin|># coding=utf-8
from __future__ import unicode_literals
c_lang_config = {
"name": "c",
"compile": {
"group_memory": True,
"src_name": "main.c",
"exe_name": "main",
"max_cpu_time": 5.0,
"max_real_time": 10.0,
"... | |
<|file_name|>sqrl_xcu1525.py<|end_file_name|><|fim▁begin|>#
# This file is part of LiteX-Boards.
#
# Copyright (c) 2020 David Shah <dave@ds0.me>
# Copyright (c) 2020 Florent Kermarrec <florent@enjoy-digital.fr>
# SPDX-License-Identifier: BSD-2-Clause
from litex.build.generic_platform import Pins, Subsignal, IOStandard... | |
<|file_name|>AccountUtil.java<|end_file_name|><|fim▁begin|>/*
* Project: NextGIS Mobile
* Purpose: Mobile GIS for Android.
* Author: Dmitry Baryshnikov (aka Bishop), bishop.dev@gmail.com
* Author: NikitaFeodonit, nfeodonit@yandex.com
* Author: Stanislav Petriakov, becomeglory@gmail.com
* *****************... | |
<|file_name|>prefs.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 basedir::default_config_dir;
use embedder_traits::resources... | let mut prefs = self.0.write().unwrap();
if let Some(pref) = prefs.get_mut(name) {
pref.set(value); |
<|file_name|>test_replay.py<|end_file_name|><|fim▁begin|>import unittest
import time
import random<|fim▁hole|>import os
os.environ['USE_CALIENDO'] = 'True'
from caliendo.db import flatfiles
from caliendo.facade import patch
from caliendo.patch import replay
from caliendo.util import recache
from caliendo import Ignor... | |
<|file_name|>teamcoco.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
import base64
import re
from .common import InfoExtractor
from ..utils import qualities
class TeamcocoIE(InfoExtractor):
_VALID_URL = r'http://teamcoco\.com/video/(?P<video_id>[0-9]+)?/?(?P<display_id>.*)'
_TESTS =... | 'age_limit': self._family_friendly_search(webpage), |
<|file_name|>magic-string.es.js<|end_file_name|><|fim▁begin|>import { encode } from 'vlq';
function Chunk ( start, end, content ) {
this.start = start;
this.end = end;
this.original = content;
this.intro = '';
this.outro = '';
this.content = content;
this.storeName = false;
this.edited = false;
// we make ... |
var hasOwnProp = Object.prototype.hasOwnProperty; |
<|file_name|>entity.js<|end_file_name|><|fim▁begin|>/* Copyright 2015 Dietrich Epp.
This file is part of Dash and the Jetpack Space Pirates. The Dash
and the Jetpack Space Pirates source code is distributed under the
terms of the MIT license. See LICENSE.txt for details. */
'use strict';
var glm = require(... | var inh = value.inherit, i;
if (inh) {
for (i = 0; i < inh.length; i++) {
_.defaults(value, inh[i]); |
<|file_name|>xml-parse.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf8 -*-
import xml.etree.ElementTree as ET<|fim▁hole|>filename = 'GeoLogger.gpx'
def main():
tree = ET.parse(filename)
root = tree.getroot()
pprint(root.tag)
pprint(root.attrib)
pprint(root.findtext('.'))
... | from pprint import pprint
|
<|file_name|>test_std.py<|end_file_name|><|fim▁begin|># #!/usr/bin/env python
#
# import nlopt # THIS IS NOT A PACKAGE!
# import numpy as np
#
# print(('nlopt version='+nlopt.__version__))
#
# def f(x, grad):
# F=x[0]
# L=x[1]
# E=x[2]
# I=x[3]
# D=F*L**3/(3.*E*I)
# return D
#
# n = 4
# opt = nl... | # opt.set_min_objective(f)
# lb = np.array([40., 50., 30e3, 1.]) |
<|file_name|>_constraints.py<|end_file_name|><|fim▁begin|>"""Constraints definition for minimize."""
from __future__ import division, print_function, absolute_import
import numpy as np
from ._hessian_update_strategy import BFGS<|fim▁hole|>from scipy._lib._numpy_compat import suppress_warnings
from scipy.sparse import i... | from ._differentiable_functions import (
VectorFunction, LinearVectorFunction, IdentityVectorFunction)
from .optimize import OptimizeWarning
from warnings import warn |
<|file_name|>mocha.d.ts<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | export * from "./src/mocha/testing"; |
<|file_name|>Launcher.java<|end_file_name|><|fim▁begin|>package me.streib.janis.nanhotline.web;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.net.InetSocketAddress;
import org.eclipse.jetty.server.Handler;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.... | public class Launcher {
public static void main(String[] args) throws Exception {
NANHotlineConfiguration conf;
if (args.length != 1) { |
<|file_name|>cvc.js<|end_file_name|><|fim▁begin|>/*
* ---------
* |.##> <##.| Open Smart Card Development Platform (www.openscdp.org)
* |# #|
* |# #| Copyright (c) 1999-2006 CardContact Software & System Consulting
* |'##> <##'| Andreas Schwier, 32429 Minden, Germany (www.cardcontact.de)
*... | offset += len;
this[name] = val;
}
this.certificateData = certdata;
|
<|file_name|>eclipse_gen.py<|end_file_name|><|fim▁begin|># coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
... | includes=[lib_path]))
configured_project = TemplateData(
name=self.project_name, |
<|file_name|>legacy_file_diff_data.py<|end_file_name|><|fim▁begin|>"""LegacyFileDiffData model defitnition."""
<|fim▁hole|>from django.db import models
from django.utils.translation import ugettext_lazy as _
from djblets.db.fields import Base64Field, JSONField
class LegacyFileDiffData(models.Model):
"""Deprecated... | from __future__ import unicode_literals
|
<|file_name|>AndroidSDKVersioner.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#
# Copyright 2014-2015 Facebook, 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.ap... | self.env['version'] = result
self.output("Version: %s" % self.env['version']) |
<|file_name|>TestActor.ts<|end_file_name|><|fim▁begin|>import { Actor, StaticMeshComponent, CameraComponent, Game } from "../XEngine";
export class TestActor extends Actor {
public mesh: StaticMeshComponent;
public camera: CameraComponent;
constructor(game: Game) {
super(game)... | }
private moveForward(axisValue: number) { |
<|file_name|>JobPlatform.py<|end_file_name|><|fim▁begin|>import platform
import socket
import sys
import os
from mule_local.JobGeneration import *
from mule.JobPlatformResources import *
from . import JobPlatformAutodetect
# Underscore defines symbols to be private
_job_id = None
def get_platform_autodetect():
... | string
unique ID of platform
""" |
<|file_name|>FavoriteLocationTest.java<|end_file_name|><|fim▁begin|>/*
* Transportr
*
* Copyright (c) 2013 - 2021 Torsten Grote
*
* 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 Founda... | assertEquals(loc1.name, f1.name);
assertEquals(loc1.products, f1.products);
|
<|file_name|>mainwindow.cpp<|end_file_name|><|fim▁begin|>/****************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the examples... | #ifndef QT_NO_OPENGL
else if (action == m_glAction) {
m_highQualityAntialiasingAction->setEnabled(true); |
<|file_name|>recipe-577484.py<|end_file_name|><|fim▁begin|># PRNG (Pseudo-Random Number Generator) Test
# PRNG info:
# http://en.wikipedia.org/wiki/Pseudorandom_number_generator
# FB - 201012046
# Compares output distribution of any given PRNG
# w/ an hypothetical True-Random Number Generator (TRNG)
import math
import ... | global x
x = math.fmod((x + math.pi) ** 2.0, 1.0) |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | import MapGenerator from './mapGenerator';
export default MapGenerator; |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>extern crate netcdf;
extern crate ndarray;
use ndarray::ArrayD;
use netcdf::{test_file, test_file_new};
// Failure tests
#[test]
#[should_panic(expected = "No such file or directory")]
fn bad_filename() {
let f = test_file("blah_stuff.nc");
let _file = netcdf::... | #[test] |
<|file_name|>deleteNode.py<|end_file_name|><|fim▁begin|># Write a function to delete a node (except the tail) in a singly linked list,
# given only access to that node.
#
# Supposed the linked list is 1 -> 2 -> 3 -> 4 and you are given the third node
# with value 3, the linked list should become 1 -> 2 -> 4 after calli... |
if __name__ == '__main__': |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import url, patterns
<|fim▁hole|>
urlpatterns = patterns(
"phileo.views",
url(r"^like/(?P<content_type_id>\d+):(?P<object_id>\d+)/$", "like_toggle", name="phileo_like_toggle")
)<|fim▁end|> | |
<|file_name|>player.py<|end_file_name|><|fim▁begin|>#!/Users/wuga/Documents/website/wuga/env/bin/python2.7
#
# The Python Imaging Library
# $Id$
#
from __future__ import print_function
import sys
if sys.version_info[0] > 2:
import tkinter
else:
import Tkinter as tkinter
from PIL import Image, ImageTk
# --... | |
<|file_name|>frost-detail-tabs-more-tabs.js<|end_file_name|><|fim▁begin|>/**<|fim▁hole|><|fim▁end|> | * Simple re-export of frost-detail-tabs-more-tabs in the app namespace
*/
export {default} from 'ember-frost-tabs/components/frost-detail-tabs-more-tabs' |
<|file_name|>server.rs<|end_file_name|><|fim▁begin|>#![feature(core)]
extern crate eve;
extern crate getopts;
extern crate url;
extern crate core;
use std::thread;
use std::env;
use getopts::Options;
use std::net::SocketAddr;
use core::str::FromStr;
use eve::server;
use eve::login;
#[allow(dead_code)]
fn main() {
... | server::run(&*autosave); |
<|file_name|>version.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | VERSION = '0.3.4' |
<|file_name|>harjutus ülesanne 6.py<|end_file_name|><|fim▁begin|>a = "1"
b = 1<|fim▁hole|>print("Arvud on " + 5 * a + " ja " + str(5 * b))<|fim▁end|> | |
<|file_name|>morestack4.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/lice... | extern mod std;
fn getbig_and_fail(i: int) { |
<|file_name|>test_index.py<|end_file_name|><|fim▁begin|>import ujson
from unittest import mock
from unittest.mock import MagicMock
from flask import url_for
from flask_login import login_required, AnonymousUserMixin
from requests.exceptions import HTTPError
from werkzeug.exceptions import BadRequest, InternalServerErr... | self.assert200(r)
mock_authorize_mb_user_deleter.assert_called_once_with('132') |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import json
from django.http import HttpResponse
from django.contrib.auth.models import User
from django.shortcuts import get_object_or_404
from apps.exercises.models import Attempts
from apps.maps.models import Graphs<|fim▁hole|>
from apps.ki.utils import performInf... | |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import React from 'react';
const isArray = x => Array.isArray(x);
const isString = x => typeof x === 'string' && x.length > 0;
const isSelector = x => isString(x) && (startsWith(x, '.') || startsWith(x, '#'));
const isChildren = x => /string|number|boolean/.test(typeo... | if (isChildren(second)) { |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>
pub use self::cpu::Cpu;
pub use self::instruction::Instruction;<|fim▁end|> | mod cpu;
mod instruction;
mod cp0;
mod opcode; |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>"""
Helper functions for handling DB accesses.
"""
import subprocess
import logging
import gzip
import io
from nominatim.db.connection import get_pg_env
from nominatim.errors import UsageError
LOG = logging.getLogger()
def _pipe_to_proc(proc, fdesc):
chunk = fde... | if column is None:
self.buffer.write('\\N')
else: |
<|file_name|>glib-gtypes-generator.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# Generate GLib GInterfaces from the Telepathy specification.
# The master copy of this program is in the telepathy-glib repository -
# please make any changes there.
#
# Copyright (C) 2006, 2007 Collabora Limited
#
# This library is ... | items = tuple(Signature(sig))
gtypes = types_to_gtypes(items)
for gtype in gtypes: |
<|file_name|>screen.py<|end_file_name|><|fim▁begin|>import os
import sys
import datetime as dt
import json
from itertools import groupby
from kivy.properties import (StringProperty,
DictProperty,
ListProperty,
BooleanProperty)
from ... | def loadCache(self):
"""Retrieves cached recorings and returns as a python list object."""
try: |
<|file_name|>map.py<|end_file_name|><|fim▁begin|>#===========================================================================
# Copyright (c) 2011-2012, the PyFACT developers
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the fo... | |
<|file_name|>faToggleOn.d.ts<|end_file_name|><|fim▁begin|>import { IconDefinition, IconPrefix, IconName } from "@fortawesome/fontawesome-common-types";
export const definition: IconDefinition;
export const faToggleOn: IconDefinition;
export const prefix: IconPrefix;
export const iconName: IconName;
export const width: ... | export const unicode: string;
export const svgPathData: string; |
<|file_name|>session_mgmt.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
#-*- coding: utf-8 -*-
# ***** BEGIN LICENSE BLOCK *****
# This file is part of Shelter Database.
# Copyright (c) 2016 Luxembourg Institute of Science and Technology.
# All rights reserved.
#
#
#
# ***** END LICENSE BLOCK *****
__author_... | #def signup():
# """if not conf.SELF_REGISTRATION:
# flash("Self-registration is disabled.", 'warning')
# return redirect(url_for('index'))""" |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>pub use self::collision_objects_dispatcher::CollisionObjectsDispatcher;
pub use self::collision_world::{BroadPhaseObject, CollisionWorld};
use na::{Pnt3, Iso3, Pnt2, Iso2};
mod collision_object;
mod collision_groups;
mod collision_objects_dispatcher;
mod co... | //! High level API to detect collisions in large, complex scenes.
pub use self::collision_object::CollisionObject;
pub use self::collision_groups::CollisionGroups; |
<|file_name|>google3.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# 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.apache.... | come before other non-python-standard imports.
"""
__author__ = 'apenwarr@google.com (Avery Pennarun)' |
<|file_name|>uidmap.rs<|end_file_name|><|fim▁begin|>use std::cmp::min;
use std::env;
use std::fs::{File};
use std::io::{BufReader, BufRead};
use std::str::FromStr;
use std::str::from_utf8;
use std::path::{Path, PathBuf};
use unshare::{Command, Stdio};
use libc::funcs::posix88::unistd::{geteuid, getegid};
use libc::{ui... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import Y... | |
<|file_name|>gfortran.py<|end_file_name|><|fim▁begin|>"""SCons.Tool.gfortran
Tool-specific initialization for gfortran, the GNU Fortran 95/Fortran
2003 compiler.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
""... | # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE |
<|file_name|>comp-1531.component.spec.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
*/
import { async, ComponentFixture, TestBed } fr... | |
<|file_name|>virtualnetworktaps.go<|end_file_name|><|fim▁begin|>package network
// Copyright (c) Microsoft and contributors. 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 Li... | // tapName - the name of virtual network tap.
func (client VirtualNetworkTapsClient) Get(ctx context.Context, resourceGroupName string, tapName string) (result VirtualNetworkTap, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkTapsClient.Get") |
<|file_name|>CallEventExecutionImpl.cpp<|end_file_name|><|fim▁begin|>#include "fUML/Semantics/CommonBehavior/impl/CallEventExecutionImpl.hpp"
#ifdef NDEBUG
#define DEBUG_MESSAGE(a) /**/
#else
#define DEBUG_MESSAGE(a) a
#endif
#ifdef ACTIVITY_DEBUG_ON
#define ACT_DEBUG(a) a
#else
#define ACT_DEBUG(a) /**/
#en... | Any result;
switch(operationID)
{ |
<|file_name|>intersection_two.rs<|end_file_name|><|fim▁begin|>use docset::DocSet;
use query::Scorer;
use DocId;
use Score;
use SkipResult;
/// Creates a `DocSet` that iterator through the intersection of two `DocSet`s.
pub struct IntersectionTwoTerms<TDocSet> {
left: TDocSet,
right: TDocSet
}
impl<TDocSet: D... | |
<|file_name|>20.rs<|end_file_name|><|fim▁begin|>/* Problem 20: Factorial digit sum<|fim▁hole|> *
* For example, 10! = 10 × 9 × ... × 3 × 2 × 1 = 3628800,
* and the sum of the digits in the number 10! is 3 + 6 + 2 + 8 + 8 + 0 + 0 = 27.
*
* Find the sum of the digits in the number 100! */
use num::bigint::{BigUint, ... | *
* n! means n × (n − 1) × ... × 3 × 2 × 1 |
<|file_name|>ModelManager.java<|end_file_name|><|fim▁begin|>/*
* ModelManager.java
*
* DMXControl for Android
*
* Copyright (c) 2012 DMXControl-For-Android. All rights reserved.
*
* This software is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public L... | try { |
<|file_name|>simpleWorker.nls.zh-cn.js<|end_file_name|><|fim▁begin|>/*!-----------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.5.3(793ede49d53dba79d39e52205f16321278f5183c)
* Released under the MIT license
* https://github.com/Microsoft/vs... | "Windows",
"控件", |
<|file_name|>accessorsEmit.ts<|end_file_name|><|fim▁begin|>class Result { }
class Test {
get Property(): Result {
var x = 1;
return null;
}
<|fim▁hole|>
class Test2 {
get Property() {
var x = 1;
return null;
}
}<|fim▁end|> | }
|
<|file_name|>search.py<|end_file_name|><|fim▁begin|>import json
import logging
import socket
from contextlib import closing
from django.core.exceptions import ValidationError
from django.db import connection
from zeroconf import get_all_addresses
from zeroconf import NonUniqueNameException
from zeroconf import Service... | "id": id,
"ip": ip,
"local": ip in get_all_addresses(), |
<|file_name|>slots.rs<|end_file_name|><|fim▁begin|>// Copyright (c) 2016 Daniel Grunwald
//
// 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, including without limitatio... | }
|
<|file_name|>notFound.js<|end_file_name|><|fim▁begin|>/**
* 404 (Not Found) Handler
*
* Usage:
* return res.notFound();
* return res.notFound(err);
* return res.notFound(err, 'some/specific/notfound/view');
*
* e.g.:
* ```
* return res.notFound();
* ```
*
* NOTE:
* If a request doesn't match any explicit ... |
// Only include errors in response if application environment
// is not set to 'production'. In production, we shouldn't |
<|file_name|>builtin.py<|end_file_name|><|fim▁begin|>#!/bin/false
# -*- coding: utf-8 -*-
from objects.orobject import OrObject
from objects.function import Function
from objects.number import Number
from objects.file import File
from objects.inheritdict import InheritDict
from objects.ordict import OrDict
from object... | |
<|file_name|>domrectreadonly.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::codegen::Bindings::DOMRectReadOnly... | }
} |
<|file_name|>app.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
from flask import Flask, session, render_template, url_for, redirect, request, flash, g
from flask.ext import assets
import pyxb
import json
import json
import os
import paypalrestsdk
app = Flask(__name__)
paypal_client_id = "AacMHTvbcCGRzaeuHY6i6zwqGv... | } |
<|file_name|>config.py<|end_file_name|><|fim▁begin|># Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright 2012 Red Hat, Inc.
# Copyright 2013 NTT corp.
#
# Licensed under the Apache License, Version 2.0... | from oslo_log import log as logging
from oslo_utils import netutils
|
<|file_name|>debounce.js<|end_file_name|><|fim▁begin|>var asyncplify = require('../dist/asyncplify');
var tests = require('asyncplify-tests');
describe('debounce', function () {
asyncplify
.interval(15)
.debounce(10)
.take(1)
.pipe(tests.itShouldClose())
.pipe(tests.itShouldEndAsy... | }); |
<|file_name|>box.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/. */
//! The `Box` type, which represents the leaves of the layout tre... | need_clip: self.needs_clip()
};
list.append_item(ClipDisplayItemClass(item));
} |
<|file_name|>jqwidgets.d.ts<|end_file_name|><|fim▁begin|>/*
jQWidgets TypeScript definitions
Copyright (c) 2011-2021 jQWidgets.
License: https://jqwidgets.com/license/
*/
interface JQueryStatic {
jqx: any;
}
declare var generatedata: any;
declare var jqx: any;
declare module jqwidgets {
... | palette?: any[];
type?: string; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.