prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>main.js<|end_file_name|><|fim▁begin|>var game, gameOptions;
gameOptions = {
renderer: Kiwi.RENDERER_WEBGL,
deviceTarget: Kiwi.TARGET_BROWSER,
width: 1280,
height: 800
};
game = new Kiwi.Game("content", "MAZE", null, gameOptions);<|fim▁hole|>
//# sourceMappingURL=main.js.map<|fim▁end|> |
game.states.addState(MAZE.Game);
game.states.switchState("Game"); |
<|file_name|>MerkleSnapshot.js<|end_file_name|><|fim▁begin|>import {keccak256, bufferToHex} from "ethereumjs-util"
import MerkleTree from "../../utils/merkleTree"
import Fixture from "./helpers/Fixture"
import {web3, ethers} from "hardhat"
import chai, {expect, assert} from "chai"
import {solidity} from "ethereum-waffl... | |
<|file_name|>skin.py<|end_file_name|><|fim▁begin|>from Tools.Profile import profile
profile("LOAD:ElementTree")
import xml.etree.cElementTree
import os
profile("LOAD:enigma_skin")
from enigma import eSize, ePoint, eRect, gFont, eWindow, eLabel, ePixmap, eWindowStyleManager, addFont, gRGB, eWindowStyleSkinned, getDeskto... | |
<|file_name|>Badges.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
###############################################################################
#
# Badges
# Returns badges for a given user.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 ... | #
# |
<|file_name|>DbUrlUtil.java<|end_file_name|><|fim▁begin|>package org.cobbzilla.util.jdbc;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class DbUrlUtil {
public static final Pattern JDBC_URL_REGEX = Pattern.compile("^jdbc:postgresql://[\\.\\w]+:\\d+/(.+)$");
public static String set... | return renamed;
}
|
<|file_name|>yedit.py<|end_file_name|><|fim▁begin|># pylint: skip-file
class YeditException(Exception):
''' Exception class for Yedit '''
pass
class Yedit(object):
''' Class to modify yaml files '''
re_valid_key = r"(((\[-?\d+\])|([a-zA-Z-./]+)).?)+$"
re_key = r"(?:\[(-?\d+)\])|([a-zA-Z-./]+)"
... | elif arr_ind and isinstance(data, list) and int(arr_ind) <= len(data) - 1:
data = data[int(arr_ind)]
else:
return None |
<|file_name|>test_rest_providers_remove.py<|end_file_name|><|fim▁begin|>""" Test for the remove.py module in the vcontrol/rest/providers directory """
from os import remove as delete_file
from web import threadeddict
from vcontrol.rest.providers import remove
PROVIDERS_FILE_PATH = "../vcontrol/rest/providers/provider... | assert provider_contents == expected_providers_contents |
<|file_name|>edgeos_facts.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2018 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
A... | |
<|file_name|>list_fast_connect_provider_virtual_circuit_bandwidth_shapes_request_response.go<|end_file_name|><|fim▁begin|>// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved.
// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://o... |
import (
"github.com/oracle/oci-go-sdk/common" |
<|file_name|>project-settings.page.ts<|end_file_name|><|fim▁begin|>import {browser, by, element, ExpectedConditions} from 'protractor';
import { ProjectsPage } from './projects.page';
export class BellowsProjectSettingsPage {
private readonly projectsPage = new ProjectsPage();
conditionTimeout: number = 3000;
... | // placeholder since we don't have Reports tests |
<|file_name|>charactersCount.js<|end_file_name|><|fim▁begin|>/**
* Lists the number of different characters
*/
/* global document: true, Node: true, window: true */
exports.version = '1.0';
exports.module = function(phantomas) {
'use strict';
//phantomas.setMetric('differentCharacters'); // @desc the numbe... | });
phantomas.log("charactersCount: analyzing characters done."); |
<|file_name|>relay.js<|end_file_name|><|fim▁begin|>/**
* React Starter Kit for Firebase
* https://github.com/kriasoft/react-firebase-starter
* Copyright (c) 2015-present Kriasoft | MIT License
*/
<|fim▁hole|>import schema from './schema';
import { Context } from './context';
export function createRelay(req) {
fu... | import { graphql } from 'graphql';
import { Environment, Network, RecordSource, Store } from 'relay-runtime';
|
<|file_name|>deque.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from double_linked import DoubleLinkedList
class Deque(object):
'''Deque is a composition of Double Linked List'''
def __init__(self, input=None):
'''create doubly linked list'''
self.deque = DoubleLinkedList(input)
... |
def size(self): |
<|file_name|>user.service.ts<|end_file_name|><|fim▁begin|>import { Injectable } from '@angular/core';
import { Http, Headers, RequestOptions, Response } from '@angular/http';
import { User } from '../models/index';
@Injectable()
export class UserService {
constructor(private http: Http) { }
getAll() {
... | return this.http.delete('/api/users/' + id, this.jwt()).map((response: Response) => response.json()); |
<|file_name|>quobyte.go<|end_file_name|><|fim▁begin|>/*
Copyright 2016 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/licenses/LICENSE-2.0
Unless... | config: &quobyteAPIConfig{
quobyteUser: quobyteUser,
quobytePassword: quobytePassword, |
<|file_name|>fileoo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import csv
import os
import gzip
class File:
def read(self, path, **kwargs):
path = os.path.join(kwargs.get('root_path', ''), path)
content_type = kwargs.get('content_type', 'txt')
if content_type == 'txt':
... |
def exists(self, path):
return os.path.exists(path) |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>#![feature(macro_rules)]
#![feature(globs)]
#![feature(phase)]
#![allow(missing_copy_implementations)]
#[phase(plugin)]
extern crate gl_generator;
extern crate glfw;
extern crate time;
use glfw::{Glfw, Context, OpenGlProfileHint, WindowHint, WindowMode};
use std::ra... | |
<|file_name|>_internal.py<|end_file_name|><|fim▁begin|>import array
<|fim▁hole|>
def format_sequence(seq):
def wrap(s):
return '{' + s + '}'
a, b = (seq, '') if len(seq) <= 10 else (seq[0:10], ' ...')
return wrap(' '.join(map(str, a)) + b)
def write_symbol_array(path, symbols):
with open(pat... | def read_symbol_array(path):
with open(path, 'r') as f:
return array.array('H', map(int, f.read().split())) |
<|file_name|>TabPane.tsx<|end_file_name|><|fim▁begin|>import classNames from 'classnames';
import * as React from 'react';
import PropTypes from 'prop-types';
import SelectableContext from '@restart/ui/SelectableContext';
import TabContext from '@restart/ui/TabContext';
import { useTabPanel } from '@restart/ui/TabPanel... |
as: PropTypes.elementType,
/** |
<|file_name|>unicode.rs<|end_file_name|><|fim▁begin|>#[warn(clippy::invisible_characters)]
fn zero() {
print!("Here >< is a ZWS, and another");
print!("This\u{200B}is\u{200B}fine");
print!("Here >< is a SHY, and another");
print!("This\u{ad}is\u{ad}fine");
print!("Here >< is a WJ, and another"... | #[warn(clippy::non_ascii_literal)]
fn uni() { |
<|file_name|>notifications.js<|end_file_name|><|fim▁begin|>/*
This file is part of the Juju GUI, which lets users view and manage Juju
environments within a graphical interface (https://launchpad.net/juju-gui).
Copyright (C) 2012-2013 Canonical Ltd.
This program is free software: you can redistribute it and/or modify ... | * @method notificationSelect
*/
notificationSelect: function(evt) {
var notifications = this.get('notifications'), |
<|file_name|>branch_test.go<|end_file_name|><|fim▁begin|>package config
import (
. "gopkg.in/check.v1"
"gopkg.in/src-d/go-git.v4/plumbing"
)
type BranchSuite struct{}
var _ = Suite(&BranchSuite{})
func (b *BranchSuite) TestValidateName(c *C) {
goodBranch := Branch{
Name: "master",
Remote: "some_remote",
... | }
actual, err := cfg.Marshal()
c.Assert(err, IsNil) |
<|file_name|>QuestionShuffling.py<|end_file_name|><|fim▁begin|>import numpy as np
# import text file, which has a determined format
a=open("test.dat")
b=open("test2.dat","w")
f=a.read()
g=f.split("\n")
nlines=6
nquestions=16
q1=[g[nlines*i:nlines*(i+1)] for i in range(nquestions)]
# these two lines can be commented if ... | np.random.shuffle(q2)
|
<|file_name|>model.js<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2013 Huub de Beer
*
* 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... | maximum: T_END,
value: m2t(now),
stepsize: T_STEP,
unit: "ms", |
<|file_name|>eventSingelton.js<|end_file_name|><|fim▁begin|>"use strict";
//Singleton pattern for things context
exports.emitter = (function () {
// Instance stores a reference to the Singleton
var instance;
function init() {
// Singleton
// Private methods and variables
var EventEmitter = r... |
})(); |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Resources
from lob.resource import (
Address,
BankAccount,
BillingGroup,
BulkUSVerification,
BulkIntlVerification,
Card,
CardOrder,
Check,
Letter,
Postcard,
SelfMailer,
USAutocompletion,
USReverseGeocodeLookup,
... | USZipLookup, |
<|file_name|>core.module.ts<|end_file_name|><|fim▁begin|>import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { AuthService } from './auth.service';
@NgModule({<|fim▁hole|> declarations: [],
providers: [AuthService]
})
export class CoreModule { }<|fim▁end|> | imports: [
CommonModule
], |
<|file_name|>AbstractInvocation.java<|end_file_name|><|fim▁begin|>/**
* This file was copied and re-packaged automatically by
* org.xtext.example.delphi.build.GenerateCS2AST
* from
* ..\..\org.eclipse.qvtd\plugins\org.eclipse.qvtd.runtime\src\org\eclipse\qvtd\runtime\evaluation\AbstractInvocation.java
*
... | }
@Override
public void addWriteSlot(SlotState.@NonNull Incremental writeSlot) { |
<|file_name|>test_chainable.js<|end_file_name|><|fim▁begin|>var assert = require('assert')
, fs = require('fs');
var DB_PATH = __dirname + '/../../tmp/db';
var USERS = {
1: {name: 'Pedro', age: 35, sex: 'm'}
, 2: {name: 'John', age: 32, sex: 'm'}
, 3: {name: 'Bruno', age: 28, sex: 'm'}
, 4: {name: 'Sa... | .where({'age' : {$gt: 29, $lt: 35}})
.or({'sex': {$eq: 'f'}})
(function(err, key, value) {
if (err) { next(err); return; } |
<|file_name|>demo.cpp<|end_file_name|><|fim▁begin|>// Copyright (c) 2012, Andre Caron (andre.l.caron@gmail.com)
// 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 sour... | //
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution. |
<|file_name|>test_util.py<|end_file_name|><|fim▁begin|>from decimal import Decimal
from electrum.util import (format_satoshis, format_fee_satoshis, parse_URI,
is_hash256_str, chunks)
from . import SequentialTestCase
class TestUtil(SequentialTestCase):
def test_format_satoshis(self):
... | self.assertFalse(is_hash256_str(None)) |
<|file_name|>SymantecBackupExec.py<|end_file_name|><|fim▁begin|># Symantec BackupExec
# CVE-2007-6016,CVE-2007-6017
import logging
log = logging.getLogger("Thug")
def Set_DOWText0(self, val):
self.__dict__['_DOWText0'] = val
if len(val) > 255:
log.ThugLogging.log_exploit_event(self._window.url,
... |
if len(val) > 255: |
<|file_name|>dup_helpers.py<|end_file_name|><|fim▁begin|>import string
from django.utils.text import slugify
from django.utils.timezone import now
from lxml import html
from lxml.html import tostring
from lxml.html.clean import Cleaner
from cl.lib.string_utils import anonymize, trunc
from cl.search.models import Opini... |
Returns True if so, else False.
"""
regex = re.compile('[%s]' % re.escape(string.punctuation)) |
<|file_name|>test_bugs.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/.
import pytest
from socorro.external.postgresql.bugs import Bugs
... | "id": 1, |
<|file_name|>_camera.py<|end_file_name|><|fim▁begin|>#Copyright Mir Immad - RealTimeCam
import cv2
import numpy as np
class VideoCamera(object):
def __init__(self):
self.video = cv2.VideoCapture(0)
def __del__(self):
self.video.release()
def get_frame(self):
success, image = self.video.read()<|fim▁hole|>... | ret, jpeg = cv2.imencode('.jpg', image)
return jpeg.tostring() |
<|file_name|>url_dispatch.py<|end_file_name|><|fim▁begin|>#-*- coding: utf-8 -*-
"""URL映射"""
from django.views.generic.base import View
from django.http import HttpResponse
from django.shortcuts import render
from jiaxiao.config import site_name, channels, theme
class URLDispatchView(View):
"""URL映射"""
def ... | |
<|file_name|>CaseInsensitiveMapTest.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... | map.put("Foo", "cheese");
map.put("BAR", "cake");
assertEquals(2, map.size());
assertEquals(true, map.containsKey("foo")); |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># This file is part of the GBI project.<|fim▁hole|># You may obtain a copy of the License at
#
# 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 a... | # Copyright (C) 2015 Omniscale GmbH & Co. KG <http://omniscale.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. |
<|file_name|>actor.test.ts<|end_file_name|><|fim▁begin|>import actorTest from './utils/actorTest';
describe('get ids statements in actor', () => {<|fim▁hole|> });
});<|fim▁end|> | actorTest((actor: any): any => {
return { actor }; |
<|file_name|>fetch.py<|end_file_name|><|fim▁begin|>import datetime
import sys
from django.utils.timezone import utc, now<|fim▁hole|>
class Command(BaseCommand):
help = 'Fetches the items from all stored feeds.'
def handle(self, *args, **options):
for feed in Feed.objects.all():
print('upda... | from django.core.management.base import BaseCommand
from feeds.models import Feed, Meta
from feeds.exceptions import FeedException
|
<|file_name|>2016_01_23_391b3fa1471_add_archived_field_to_custom_form.py<|end_file_name|><|fim▁begin|>"""Add archived field to custom form
Revision ID: 391b3fa1471
Revises: 473f91b5874
Create Date: 2016-01-23 15:51:40.304025
"""
# revision identifiers, used by Alembic.
revision = '391b3fa1471'
down_revision = '473f9... | op.alter_column('custom_form', 'price',
existing_type=mysql.FLOAT(),
nullable=False,
existing_server_default=sa.text("'0'")) |
<|file_name|>RaceRestriction.java<|end_file_name|><|fim▁begin|>package org.reunionemu.jreunion.model.quests.restrictions;
import org.reunionemu.jreunion.model.quests.Restriction;
<|fim▁hole|> * @author Aidamina
* @license http://reunion.googlecode.com/svn/trunk/license.txt
*/
public interface RaceRestriction extends... | /** |
<|file_name|>get_with_single_header.py<|end_file_name|><|fim▁begin|>import requests
headers = {
'foo': 'bar',
}
<|fim▁hole|><|fim▁end|> | response = requests.get('http://example.com/', headers=headers) |
<|file_name|>doc.py<|end_file_name|><|fim▁begin|>def topgeo ('topgeo'):<|fim▁hole|> Esta libreria funciona para realizar calculos topograficos.
"""<|fim▁end|> | """ |
<|file_name|>application-768a0262af2eb7663859c5e8395c2b25.js<|end_file_name|><|fim▁begin|>/*!
* jQuery JavaScript Library v1.11.2
* http://jquery.com/
*
* Includes Sizzle.js
* http://sizzlejs.com/
*
* Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors
* Released under the MIT license
* http://... | // Vendor-prefix box-sizing
support.boxSizing = style.boxSizing === "" || style.MozBoxSizing === "" || |
<|file_name|>network_menu.cpp<|end_file_name|><|fim▁begin|>/******************************************************************************
* Warmux is a convivial mass murder game.
* Copyright (C) 2001-2010 Warmux Team.
*
* This program is free software; you can redistribute it and/or modify
* it under the ter... | {
if( close_menu ) |
<|file_name|>verify-dup-in-leaf.cc<|end_file_name|><|fim▁begin|>/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
#ident "$Id$"
/*
COPYING CONDITIONS NOTICE:
This program is free software; you can redistribute it and/or modify
it under the terms of ... | } |
<|file_name|>hubble_status.go<|end_file_name|><|fim▁begin|>// Code generated by go-swagger; DO NOT EDIT.
// Copyright Authors of Cilium
// SPDX-License-Identifier: Apache-2.0
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate co... |
return nil
}
|
<|file_name|>__openerp__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
##############################################################################
#
# Author: Yannick Buron
# Copyright 2015, TODAY Clouder SASU
#<|fim▁hole|># clause as published by the Free Software Foundation, either version 3 of the
# Lic... | # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License with Attribution |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from distutils.core import setup
setup(name='django-modeltranslation',
version='0.4.0-alpha1',
description='Translates Django models using a registration approach.',
long_description='The modeltranslation application can be used... | package_data={'modeltranslation': ['static/modeltranslation/css/*.css', |
<|file_name|>rwlock.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.org/licenses... | drop(R.read().unwrap());
}
} |
<|file_name|>test_cluster.py<|end_file_name|><|fim▁begin|>import tornado.ioloop
from functools import partial
from tornado.testing import AsyncTestCase
from elasticsearch_tornado import ClusterClient
try:
# python 2.6
from unittest2 import TestCase, SkipTest
except ImportError:
from unittest import Te... | "move" :
{
"index" : "test", "shard" : 0, |
<|file_name|>sum-mllt-accs.cc<|end_file_name|><|fim▁begin|>// bin/sum-mllt.cc
// Copyright 2014 LINSE/UFSC; Augusto Henrique Hentz
// See ../../COPYING for clarification regarding multiple authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance w... | |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>extern crate clap;
extern crate ansi_term;
extern crate vagment;
use std::io;
use std::io::Write;
use std::io::stdout;
use clap::ArgMatches;
use ansi_term::Colour::Yellow;
use vagment::app::logger;
use vagment::app::vagrant;
use vagment::app::formatter;
use vagment:... | }
if command.needs_a_machine() {
let search = machines.get_machine_by_number(number); |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># coding: utf-8
# Copyright: (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# Copyright: (c) 2018, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ ... | |
<|file_name|>TestZipWithFunction.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 requir... | asList(4, null));
assertFunction("zip_with(ARRAY['a', 'b'], ARRAY[1, 3], (x, y) -> NULL)",
new ArrayType(UNKNOWN), |
<|file_name|>no_mime_type.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
def main(request, response):
headers = []
if 'Content-Type' in request.GET:
headers += [('Content-Type', request.GET['Content-Type'])]
with open('./resources/ahem/AHEM____.TTF') as f:
return 200, headers, f.read()<|fim▁e... | # 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/. |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.o... | model_to_estimator = tf_export('keras.estimator.model_to_estimator')(
stub_model_to_estimator) |
<|file_name|>test_relationships.py<|end_file_name|><|fim▁begin|>from random import shuffle
import pytest
from utils import testgen<|fim▁hole|>
from cfme.containers.pod import Pod, paged_tbl as pod_paged_tbl
from cfme.containers.provider import ContainersProvider, paged_tbl as provider_paged_tbl,\
navigate_and_get... | from utils.version import current_version
from cfme.web_ui import paginator, summary_title |
<|file_name|>python_pca.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from __future__ import division
import numpy as np
import pylab
def PCA(Z, verbose = 0):
"""
PCA Mc Vean style ... | '''
Data = np.array([[0,1],[1,0],[0,0]])
evals, evecs, Y = PCA(Data)
print "evals ", evals |
<|file_name|>driftscatter.py<|end_file_name|><|fim▁begin|>import ctypes
import random
import math
import numpy
import stats
import constants
#energy = mesh.bandstructure.random_
ext = ctypes.cdll.LoadLibrary("c_optimized/driftscatter.so")
def randomElectronMovement(particle,electric_field,density_func,mesh,reaper):
... | |
<|file_name|>plugins.py<|end_file_name|><|fim▁begin|># Copyright (C) 2008-2010 Adam Olsen
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later vers... | |
<|file_name|>OcmFactoryImpl.java<|end_file_name|><|fim▁begin|>/**
*/
package org.tud.inf.st.mbt.ocm.impl;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.impl.EFactoryImpl;
import org.eclipse.emf.ecore.plugin.EcorePlugin;... | * <!-- end-user-doc -->
* @generated
*/ |
<|file_name|>ImageUI.ts<|end_file_name|><|fim▁begin|>/// <reference path="../../typings/virtual-dom/virtual-dom.d.ts" />
/// <reference path="../../node_modules/rx/ts/rx.all.d.ts" />
<|fim▁hole|>import {Node} from "../Graph";
import {Container, Navigator} from "../Viewer";
interface ICanvasNode {
canvas: HTMLCanva... | import * as rx from "rx";
import * as vd from "virtual-dom";
import {UIService, UI} from "../UI"; |
<|file_name|>models_tests.py<|end_file_name|><|fim▁begin|>import unittest
import os
os.environ['MIAMI_ENV'] = 'test'
import simplejson as json
from miami.models import Team, User, Task
class ModelsTest(unittest.TestCase):
def test_team_toJSON(self):
team = Team('Log')
team.id = 1
self.asse... | team = Team('Log')
team.id = 1
task = Task('title1', 'detail', status='DONE', price=1, estimate=4, team=team) |
<|file_name|>html.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# diffoscope: in-depth comparison of files, archives, and directories
#
# Copyright © 2014-2015 Jérémy Bobbio <lunar@debian.org>
# © 2015 Reiner Herrmann <reiner@reiner-h.de>
# © 2012-2013 Olivier Matz <zer0@droids-corp... | - parent is a PartialString representing the body of the node, including
its comments, visuals, unified_diff and headers for its children - but
not the bodies of the children
- continuation is either None or (only in html-dir mode) a function which |
<|file_name|>test_crs.py<|end_file_name|><|fim▁begin|>from fiona import crs
def test_proj_keys():
assert len(crs.all_proj_keys) == 85
assert 'proj' in crs.all_proj_keys
assert 'no_mayo' in crs.all_proj_keys
def test_from_string():
# A PROJ.4 string with extra whitespace.
val = crs.from_string(
... | |
<|file_name|>DerivedClassInclusionEntailsObjectPropertyAssertionAxiomImpl.java<|end_file_name|><|fim▁begin|>/*-
* #%L
* ELK Reasoner Core
* $Id:$
* $HeadURL:$
* %%
* Copyright (C) 2011 - 2016 Department of Computer Science, University of Oxford
* %%
* Licensed under the Apache License, Version 2.0 (the "License... | |
<|file_name|>sub_resource_py3.py<|end_file_name|><|fim▁begin|># coding=utf-8
# --------------------------------------------------------------------------<|fim▁hole|>#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# ------... | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information. |
<|file_name|>ioriocli.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
'''ioriodb CLI client to interact with the api from the command line'''
from __future__ import print_function
import time
import json
import argparse
import iorio
def get_arg_parser():
'''build the cli arg parser'''
parser = argparse... | else:
return json.loads(data_raw) |
<|file_name|>routes.go<|end_file_name|><|fim▁begin|>package routes
import (
"appengine"
"admin"
"api"
"net/http"
"html/template"
)
func init() {
http.HandleFunc("/", HomeRequest)
// Admin Functions
http.HandleFunc("/admin/", admin.AdminHandler)
http.HandleFunc("/admin/seasons/", admin.SeasonHandler)
http.... | c.Infof("Home request")
tmpl := template.Must(template.ParseFiles("templates/base.html", "templates/home_page.html")) |
<|file_name|>VBoxUsbRt.cpp<|end_file_name|><|fim▁begin|>/* $Id: VBoxUsbRt.cpp $ */
/** @file
* VBox USB R0 runtime
*/
/*
* Copyright (C) 2011 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* you can redi... | NTSTATUS Status;
|
<|file_name|>consensus.rs<|end_file_name|><|fim▁begin|>use lib::blockchain::{Chain,Blockchain};
use serde_json;
use reqwest::{Client, StatusCode};
use std::io::{Read};
#[derive(Deserialize)]
struct ChainResponse {
chain: Chain
}
pub struct Consensus;
impl Consensus {
pub fn resolve_conflicts(blockchain: &mut... | |
<|file_name|>constructed.rs<|end_file_name|><|fim▁begin|>use std::any::Any;
use std::ops::{Deref, DerefMut};
use std::sync::{Mutex, Arc, LockResult, PoisonError, MutexGuard};
enum MaybeMutexGuardValue<'a, T: 'a> {
Guard(MutexGuard<'a, T>),
Ref(&'a mut T),
}
pub struct MaybeMutexGuard<'a, T: 'a> {
inner: M... | }
|
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>pub use self::app::run_server;
mod staticfiles;
mod templates;
mod app;
mod utils;<|fim▁hole|><|fim▁end|> | pub mod oauth; |
<|file_name|>CRC_sdx_ENS.js<|end_file_name|><|fim▁begin|>/**
* @projectDescription The SDX controller library for the PatientRecordSet data-type.
* @namespace i2b2.sdx.TypeControllers.ENS
* @inherits i2b2.sdx.TypeControllers
* @author Mike Mendis
* @version 1.6
* @see i2b2.sdx
* ---------------------... | retHtml += sImgEvents;
retHtml += '>';
|
<|file_name|>apps.py<|end_file_name|><|fim▁begin|>from django.apps import AppConfig
class AccountConfig(AppConfig):
name = 'account'
verbose_name = "EVE W-Space account module"
# Register registries provided by this app
import account.profile_section_registry
import account.group_admin_section_registry<|fim▁h... | |
<|file_name|>settings.py<|end_file_name|><|fim▁begin|>"""
Django settings for todo project.
Generated by 'django-admin startproject' using Django 1.9.2.
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
https://docs.djang... | |
<|file_name|>list_salesummary.js<|end_file_name|><|fim▁begin|>var gId = '#dataGrid';
var lastIndex;
$(document).ready(function(){
//列表
$(gId).datagrid({
url:getUrlOpt(),
idField:'id',
fitColumns:true,
frozenColumns:[[
{field:'ck',checkbox:true}
]],
columns:[
getTableHeadOpt(),
... | function selectWarehousePosition(){
var warehouseName=$('#warehouseName').val(); |
<|file_name|>trait_base.py<|end_file_name|><|fim▁begin|>#------------------------------------------------------------------------------
#
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt... | return path
#------------------------------------------------------------------------------- |
<|file_name|>int-to-negabinary-coverter.py<|end_file_name|><|fim▁begin|># The MIT License (MIT)
# Copyright (c) 2017 Kinga Makowiecka
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation file
# (the "Software"), to deal in the Software without re... | result = ""
number = int(sys.argv[1])
print "converting number " + str(number) + " to negabinary value:"
while number != 0: |
<|file_name|>inotify.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/.
pub use lrs_inotify::{Inotify, InodeWatch, InodeData, InodeDataI... | |
<|file_name|>config.go<|end_file_name|><|fim▁begin|>package ca
import (
"crypto/tls"
"crypto/x509"
"encoding/pem"
"fmt"
"io/ioutil"
"math/rand"
"path/filepath"
"strings"
"sync"
"time"
log "github.com/Sirupsen/logrus"
cfconfig "github.com/cloudflare/cfssl/config"
"github.com/docker/distribution/digest"
"... | log.Debugf("failed to create a new client TLS config: %v", err)
updates <- CertificateUpdate{Err: err}
}
serverTLSConfig, err := NewServerTLSConfig(tlsKeyPair, rootCA.Pool) |
<|file_name|>Envelope.cpp<|end_file_name|><|fim▁begin|>/**********************************************************************
Audacity: A Digital Audio Editor
Envelope.cpp
Dominic Mazzoni (original author)
Dr William Bland (integration - the Calculus kind)
Monty (xiphmont) (important bug fixes)
*********... | // because the rounding errors would otherwise get too large. The threshold value is 1.0e-5 because at that
// point the rounding errors become larger than the difference between linear and logarithmic (I tested this in Octave).
if(logarithmic) |
<|file_name|>executor.hpp<|end_file_name|><|fim▁begin|>// Copyright (C) 2013,2014 Vicente J. Botet Escriba
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// 2013/09 Vicente J. Botet Escriba
// Adapt to b... |
/**
* \par Effects
* Destroys the executor. |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Author: Alexandre Fayolle
# Copyright 2013 Camptocamp SA
# Author: Damien Crier
# Copyright 2015 Camptocamp SA
# © 2015 Eficent Business and IT Consulting Services S.L. -
# Jordi Ballester Alomar
# © 2015 Serpent Consulting Serv... |
from . import purchase
from . import invoice |
<|file_name|>decorator_opencl.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
PyCOMPSs Testbench
========================
"""
# Imports
import unittest
from modules.testOpenclDecorator import testOpenclDecorator<|fim▁hole|> suite = unittest.TestLoader().loadTestsFromTestCase(testOpe... |
def main(): |
<|file_name|>test_lms_matlab_problem.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Test for matlab problems
"""
import time
from ...pages.lms.matlab_problem import MatlabProblemPage<|fim▁hole|>
class MatlabProblemTest(ProblemsTest):
"""
Tests that verify matlab problem "Run Code".
"""
de... | from ...fixtures.course import XBlockFixtureDesc
from ...fixtures.xqueue import XQueueResponseFixture
from .test_lms_problems import ProblemsTest
from textwrap import dedent |
<|file_name|>__openerp__.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) cgstudiomap <cgstudiomap@gmail.com>
#
# This program is free software: you ... | |
<|file_name|>camera_helpers.js<|end_file_name|><|fim▁begin|>var WALKING_SPEED_RATIO = 30; // how many times faster than walking speed are you?
var FIRST_PERSON = false;
var RESET_CAMERA_POSITION = function() {camera.position.set(-168, 25, -17);}
var PATH_ANIMATION_RUNNING = false;
function endPathAnimation() {
PAT... | return tween.chain(nextCameraTween(path,index+1, sf, ef)); |
<|file_name|>coherence-iterator-vec.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// ... | // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at |
<|file_name|>ItemRequest.ts<|end_file_name|><|fim▁begin|>import * as Models from './'
export const ItemRequestPriority = [
'low',
'standard',
'high',
'highest'
] as const
export type ItemRequestPriorityTuple = typeof ItemRequestPriority
export type ItemRequestPriority = ItemRequestPriorityTuple[number]
export con... | statusId?: Models.StatusId
statusName?: string
uid?: string
isActive?: boolean |
<|file_name|>indexController.js<|end_file_name|><|fim▁begin|>// home page
exports.index = function(req, res){<|fim▁hole|>};<|fim▁end|> | res.render('index', { title: 'B O X L A N D' }); |
<|file_name|>macros.rs<|end_file_name|><|fim▁begin|>/// Shortcut to generate an ESC-prefixed CSI sequence
macro_rules! csi {
($( $l:expr ),*) => {
concat!("\x1b[", $( $l ),*)
};
}
/// Generates an empty struct that prints as a CSI sequence
macro_rules! generate_csi_struct {
($name:ident, $value:exp... | } |
<|file_name|>3dhtml.js<|end_file_name|><|fim▁begin|>/*
* 3dhtml Core Library
* http://3dhtml.netzministerium.de
* Version 1.1, 27/02/2002
*
* Copyright (c) 2001, 2002 by Till Nagel and René Sander
* Written by Till Nagel <till@netzministerium.de> and René Sander <rene@netzministerium.de>
* Performance optimizati... | * Parameters
* String body - an HTML snippet (e.g. '<font color=red>+</font>')
* Function refresh - the function to call if model was drawn |
<|file_name|>agreement.component.ts<|end_file_name|><|fim▁begin|>import {
Component,
OnInit
} from '@angular/core';
import { DataService, NavigateService } from '../common';<|fim▁hole|>@Component({
selector: 'agreement',
styleUrls: ['./agreement.component.scss'],
templateUrl: './agreement.component.html'
})
e... | import { AppSettings } from '../app.module';
|
<|file_name|>patsub.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (C) 2020 Rocky Bernstein
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the... |
if __name__ == "__main__": |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>use std::net::{TcpListener};
use std::io::{BufReader, BufWriter, BufRead, Write};
use std::thread;
fn main() {
let listener = match TcpListener::bind("127.0.0.1:8888") {
Ok(v) => { println!("127.0.0.1:8888 binded."); v },
Err(e) => { panic!("bind fa... | } |
<|file_name|>gen-anim.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
from PIL import Image
import os.path
import sys
if __name__ == '__main__':
img = Image.open(sys.argv[1])
img.load()
name = os.path.splitext(os.path.basename(sys.argv[1]))[0]
frames = 0
for i in range(65536):<|fim▁hole... | try:
img.seek(i) |
<|file_name|>weakref.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/. */
//! Weak-referenceable JS-managed DOM objects.
//!
//! IDL in... | unsafe { &*self.cell.get() }.as_ref().and_then(WeakRef::root) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.