prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>11.1.1_20_c.js<|end_file_name|><|fim▁begin|>// Copyright 2011-2012 Norbert Lindenberg. All rights reserved.
// Copyright 2012 Mozilla Corporation. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @description Tests that the number of fractional digits is d... | TTD: 2, |
<|file_name|>set_rec.cc<|end_file_name|><|fim▁begin|>#include <iostream>
#include <fstream>
#include <iterator>
#include <string>
#include <set>
#include <stdio.h>
#include <algorithm>
using namespace std;
typedef unsigned long long U64;
typedef int S32;
typedef unsigned int U32;
typedef struct tag_things
{
U64 ... | {
if (argc != 2)
{ |
<|file_name|>SqueezerRecipe.java<|end_file_name|><|fim▁begin|>package speiger.src.api.common.recipes.squezingCompressor.parts;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidTank;
import speiger.src.api.com... | return true;
}
return false;
|
<|file_name|>clipboard.rs<|end_file_name|><|fim▁begin|>extern crate clipboard_win;
use clipboard_win::*;
use clipboard_win::wrapper::{open_clipboard, close_clipboard, set_clipboard_raw, register_format, count_formats, is_format_avail, get_clipboard_seq_num};
//NOTE: parallel running may cause fail.
#[test]
f... | fn count_formats_test() {
|
<|file_name|>BasemapToggle.js<|end_file_name|><|fim▁begin|>// All material copyright ESRI, All Rights Reserved, unless otherwise specified.<|fim▁hole|>//>>built
define({widgetLabel:"Altl\u0131k haritay\u0131 a\u00e7/kapa"});<|fim▁end|> | // See https://js.arcgis.com/4.16/esri/copyright.txt for details. |
<|file_name|>jquery.theme.menuteaser.js<|end_file_name|><|fim▁begin|>//Menu teaser
(function(){
jQuery(document).ready(function(){
if ( jQuery('header.header').hasClass("teaser-menu") ) {
missTheme.options.header.params.teaser = 13;
}
jQuery('header.header.teaser-menu').find("nav > ul li a").each(
function... | });
})(); |
<|file_name|>0002_auto_20180409_1007.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.11.9 on 2018-04-09 08:07
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
<|fim▁hole|>class Migration(migrations.Migration):
depende... | |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | export * from './build/src/index'; |
<|file_name|>diverging_sub_expression.rs<|end_file_name|><|fim▁begin|>#![warn(clippy::diverging_sub_expression)]
#![allow(clippy::match_same_arms, clippy::logic_bug)]
#[allow(clippy::empty_loop)]
fn diverge() -> ! {
loop {}
}
struct A;
impl A {<|fim▁hole|> fn foo(&self) -> ! {
diverge()
}
}
#[allo... | |
<|file_name|>discord_test.go<|end_file_name|><|fim▁begin|>package bruxism
import (
"testing"
)
func TestCommandMatches(t *testing.T) {
tests := []struct {
Prefix string
Matches bool
Command string
Message string
Argument string
}{
{"", true, "hello", "hello", ""},
{"", true, "hello", " hello", ""},
... | t.Errorf("Incorrect matches with message `%v`: Have %v, Want %v. Prefix: %v. Command: %v", test.Message, matches, test.Matches, test.Prefix, test.Command) |
<|file_name|>const-fn-stability-calls.rs<|end_file_name|><|fim▁begin|>// run-pass
#![allow(dead_code)]
#![allow(unused_variables)]
// Test use of const fn from another crate without a feature gate.
// aux-build:const_fn_lib.rs<|fim▁hole|>extern crate const_fn_lib;
use const_fn_lib::foo;
static FOO: usize = foo();
co... | |
<|file_name|>plan-list.module.ts<|end_file_name|><|fim▁begin|>import { PlannerListModule } from 'fabric8-planner';
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { Http } from '@angular/http';
<|fim▁hole|> constructor(http: Http) {}
}<|fim▁end|> | @NgModule({
imports: [ CommonModule, PlannerListModule ]
})
export class PlanListModule { |
<|file_name|>TextCommandProcessor.java<|end_file_name|><|fim▁begin|>package com.quickserverlab.quickcached;
import java.io.IOException;
import java.net.SocketTimeoutException;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.quickserverlab.quickcached.cache.CacheException;
import com.quickse... |
if (noreplay) {
return; |
<|file_name|>example_numba.py<|end_file_name|><|fim▁begin|># coding: utf-8
from hyper import hyper
from numba import jit
<|fim▁hole|>def hyp_battin(x):
return hyper.hyp2f1(3, 1, 5/2, x)
if __name__ == '__main__':
print(hyp_battin(0.5))<|fim▁end|> |
@jit(nopython=True) |
<|file_name|>pat.rs<|end_file_name|><|fim▁begin|>use crate::check::FnCtxt;
use rustc_ast as ast;
use rustc_data_structures::fx::FxHashMap;
use rustc_errors::{pluralize, struct_span_err, Applicability, DiagnosticBuilder};
use rustc_hir as hir;
use rustc_hir::def::{CtorKind, DefKind, Res};
use rustc_hir::pat_util::Enume... | err.span_label(span, format!("type `{}` cannot be dereferenced", type_str));
if self.tcx.sess.teach(&err.get_code().unwrap()) { |
<|file_name|>DummyAgent.java<|end_file_name|><|fim▁begin|>/*
* eXist Open Source Native XML Database
* Copyright (C) 2001-07 The eXist Project
* http://exist-db.org
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as pu... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | # author: Milan Kubik |
<|file_name|>router_state.d.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 { Type } from '@angular/core';
import { Observable... | |
<|file_name|>installer_tools.py<|end_file_name|><|fim▁begin|>import os.path
from subprocess import call
class InstallerTools(object):
@staticmethod
def update_environment(file_path,environment_path):
update_file = open(file_path, 'r')
original_lines = update_file.readlines()
original_lines[0] = environment_pa... | buggy_file.close()
update_file = open(buggy_path,'w')
for lines in original_lines:
update_file.write(lines) |
<|file_name|>xml.rs<|end_file_name|><|fim▁begin|>/*
Copyright 2017 LambdaStack All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
... | #[derive(Default, Debug)]
pub struct XmlError {
pub error_type: String,
pub code: String, |
<|file_name|>test_runner.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# 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 runner
import pytest
def test_... | |
<|file_name|>style_resolver.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 https://mozilla.org/MPL/2.0/. */
//! Style resolution for a given element or pseudo-el... | |
<|file_name|>mouse.py<|end_file_name|><|fim▁begin|>#
# Chris Lumens <clumens@redhat.com>
#
# Copyright 2005, 2006, 2007 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use, modify,
# copy, or redistribute it subject to the terms and conditions of the GNU
# General Public License v.2. ... | #
# You should have received a copy of the GNU General Public License along with |
<|file_name|>binary_spots.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# coding: utf-8
# Binary with Spots
# ============================
#
# Setup
# -----------------------------
# Let's first make sure we have the latest version of PHOEBE 2.2 installed. (You can comment out this line if you don't use pip ... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from . import sale<|fim▁hole|><|fim▁end|> | from . import magento_model |
<|file_name|>LAX_DarkenRegion.js<|end_file_name|><|fim▁begin|>//=============================================================================
// Darken Region
// LAX_DarkenRegion.js
// v0.02
//=============================================================================
//==============================================... | if (!upperTiles.equals(lastUpperTiles)) { |
<|file_name|>logic.py<|end_file_name|><|fim▁begin|>import unittest
from collections import deque
import datetime
import sys
import os
import StringIO
from south import exceptions
from south.migration import migrate_app
from south.migration.base import all_migrations, Migration, Migrations
from south.migration.utils i... | |
<|file_name|>virtfunc.cc<|end_file_name|><|fim▁begin|>// Pls try the following program on virtual functions and try to do print on
// most of the code in main(). Almost none of them works !
//
// The inheritance structure is:
//
// V : VA VB
// A : (V)
// B : A
// D : AD (V)
// C : (V)
// E : B (V) D C
//
class VA ... | V* pVe = &e; |
<|file_name|>empty_paragraph_end.py<|end_file_name|><|fim▁begin|>from cast.analysers import log, mainframe
class EmptyParagraphEndOfSection(mainframe.Extension):
<|fim▁hole|>
def start_program(self, program):
self.program = program
def end_program(self, _):
self.program = None
... | def __init__(self):
self.program = None |
<|file_name|>0004_auto_20170703_1156.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-<|fim▁hole|>from django.db import migrations, models
import django.db.models.manager
class Migration(migrations.Migration):
dependencies = [
('wiblog', '0003_auto_20160325_1441'),
]
operations = [
... | # Generated by Django 1.11.3 on 2017-07-03 18:56
from __future__ import unicode_literals
|
<|file_name|>method-ambig-two-traits-cross-crate.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or... | // Test an ambiguity scenario where one copy of the method is available |
<|file_name|>galaxyperlin.py<|end_file_name|><|fim▁begin|>#!/home/elsa/Ureka/variants/common/bin/python
#Code to generate an image with perlin noise as background.
#Used in UO scientific computing course Spring 2016
#Perlin code and noise package is from Casey Duncan
#https://github.com/caseman/noise/examples/2dtextur... | |
<|file_name|>TestNativeExp2.rs<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2014 The Android Open Source Project
*
* 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.... | |
<|file_name|>upsert_iss_domains.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""Upserts Domains from Salesforce Domain__c.
"""
import logging
import os
from django.core.management.base import BaseCommand
import iss.models
import iss.salesforce
logger = logging.getLogger(os.path.basename(__file__))
class ... |
def add_arguments(self, parser): |
<|file_name|>features.py<|end_file_name|><|fim▁begin|>from django.conf import settings<|fim▁hole|>
def is_solr_supported():
try:
return 'Solr' in settings.HAYSTACK_CONNECTIONS['default']['ENGINE']
except (KeyError, AttributeError):
return False
def is_elasticsearch_supported():
try:
... | |
<|file_name|>handler.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
handler base
~~~~~~~~~~~~
Presents a reasonable base class for a ``Handler`` object, which handles
responding to an arbitrary "request" for action. For example, ``Handler``
is useful for responding to HTTP requests *or* noncyc... | connection receives a message from the client. It takes two parameters -
the ``message`` itself and whether it is ``binary`` or not. """
__socket__ = None # space for currently-active realtime socket |
<|file_name|>route.js<|end_file_name|><|fim▁begin|>"use strict"
var redrawService = require("./redraw")
<|fim▁hole|><|fim▁end|> | module.exports = require("./api/router")(window, redrawService) |
<|file_name|>time.py<|end_file_name|><|fim▁begin|># Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.<|fim▁hole|># Unless required by applicable law or agreed to in writing... | # You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# |
<|file_name|>Project.go<|end_file_name|><|fim▁begin|>package models
type Project struct {
Id int64 `json:"id"`<|fim▁hole|>}
type Projects []Project<|fim▁end|> | Name string `json:"name"` |
<|file_name|>package.py<|end_file_name|><|fim▁begin|>##############################################################################
# Copyright (c) 2017, Los Alamos National Security, LLC
# Produced at the Los Alamos National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All ... | |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from flask import Blueprint, request, render_template, jsonify
from housesGenerator import House
from holdings import Holdings
houses = Blueprint('houses', __name__, url_prefix='/houses')
@houses.route('/')<|fim▁hole|>def index():
return render_template('houses.... | |
<|file_name|>restart-scenarios-test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
from testUtils import Utils
from Cluster import Cluster
from WalletMgr import WalletMgr
from TestHelper import TestHelper
import random
###############################################################
# restart-scenarios-test
#... | if not cluster.createAccounts(eosioAccount):
errorExit("Accounts creation failed.") |
<|file_name|>mwc-tab-scroller.ts<|end_file_name|><|fim▁begin|>/**<|fim▁hole|> * Copyright 2018 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
// Style preference for leading underscores.
// tslint:disable:strip-private-property-underscore
import {customElement} from 'lit/decorators.js';
import {TabScrollerBas... | * @license |
<|file_name|>tac.rs<|end_file_name|><|fim▁begin|>use std::process::Command;
use util::*;
static PROGNAME: &'static str = "./tac";
#[path = "common/util.rs"]
#[macro_use]
mod util;
#[test]
fn test_stdin_default() {
let mut cmd = Command::new(PROGNAME);
let result = run_piped_stdin(&mut cmd, "100\n200\n300\n40... | |
<|file_name|>laravel_form.js<|end_file_name|><|fim▁begin|>/**
* Created by dlouvard_imac on 26/12/2016.
*/
(function () {
var laravel = {
initialize: function () {
this.methodLinks = $('a[data-method]');
this.registerEvents();
},
registerEvents: function () {
... | }); |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import Social from './Social'<|fim▁hole|><|fim▁end|> |
export default Social |
<|file_name|>mapper.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
##############################################################################
#
# Author: Guewen Baconnier
# Copyright 2013 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... | values = self._mapper._apply(self, options=options)
values.update(self._forced_values) |
<|file_name|>StubInput.java<|end_file_name|><|fim▁begin|>package ru.job4j.polymorphism;
/**
* Created on 01.09.2017.
*
* @author Aleks Sidorenko (alek.sidorenko1979@gmail.com).
* @version $Id$.
* @since 0.1.
*/
public class StubInput implements Input {
/**
* @param answers - array's param.
*/
... | } |
<|file_name|>network_suite_test.go<|end_file_name|><|fim▁begin|>// Copyright 2016 Mirantis
//
// 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... | |
<|file_name|>demo_32.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
from DataApi_32 import CDataProcess
#from DataApi_Linux import CDataApi
import datetime
def main():
#HOST = '192.168.1.186'
HOST = '180.166.168.126' #公网ip
PORT = 18201
subStock = ["999999"]
ApiInstance = CDataProcess(H... | 0,1,datetime.datetime(2012,1,1,0,0,0),datetime.datetime(2012,01,1,0,0,0) |
<|file_name|>post.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
eve.methods.post
~~~~~~~~~~~~~~~~
This module imlements the POST method, supported by the resources
endopints.
:copyright: (c) 2015 by Nicola Iarocci.
:license: BSD, see LICENSE for more details.
"""
from datetime ... | Added by : LHearen
E-mail : LHearen@126.com |
<|file_name|>Drawer.js<|end_file_name|><|fim▁begin|>import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
import _extends from "@babel/runtime/helpers/esm/extends";
import * as React from 'react';
import PropTypes from 'prop-types';
import clsx from 'clsx';
import { deepme... | anchor: anchorProp = 'left', |
<|file_name|>GameData.py<|end_file_name|><|fim▁begin|>'''
GameData.py
Last Updated: 3/16/17
'''
import json, os
import numpy as np
import pygame as pg
from GameAssets import GameAssets as ga
class GameData():
"""
GameData class is used to stores game state information.
"""
def __init__(self):
... | |
<|file_name|>http.go<|end_file_name|><|fim▁begin|>package nameserver
import (
"encoding/json"
"fmt"
"net/http"
"github.com/gorilla/mux"
"github.com/miekg/dns"
"github.com/weaveworks/weave/common/docker"
"github.com/weaveworks/weave/net/address"
)<|fim▁hole|> http.Error(w, err.Error(), http.StatusBadRequest)
... |
func (n *Nameserver) badRequest(w http.ResponseWriter, err error) { |
<|file_name|>test_footer.py<|end_file_name|><|fim▁begin|>import json
import mock
from django.test import TestCase
from django.test.client import RequestFactory
from readthedocs.core.middleware import FooterNoSessionMiddleware
from readthedocs.rtd_tests.mocks.paths import fake_paths_by_regex
from readthedocs.projects... | r = self.client.get('/api/v2/footer_html/?project=pip&version=latest&page=index', {}) |
<|file_name|>axes3d.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# axes3d.py, original mplot3d version by John Porter
# Created: 23 Sep 2005
# Parts fixed by Reinier Heeres <reinier@heeres.eu>
# Minor additions by Ben Axelrod <baxelrod@coroware.com>
# Significant updates and revisions by Ben Root <ben.v.root@gmail... | |
<|file_name|>rect.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/. */
//! Computed types for CSS borders.
use cssparser::Parser;
use ... | Rect::parse_with(context, input, LengthOrNumber::parse_non_negative)
}
} |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from flask import Flask
from flask_compress import Compress
from .. import db
app = Flask(__name__)
app.config.from_pyfile('../config.py')
<|fim▁hole|>Compress(app)
@app.before_first_request
def initialize_database():
db.init_db()<|fim▁end|> | from . import views
|
<|file_name|>testPropCallElem2.js<|end_file_name|><|fim▁begin|>// vim: set ts=4 sw=4 tw=99 et:
function testUKeyUObject(a, key1, key2, key3) {
a.a = function () { return this.d; }<|fim▁hole|> a.b = function () { return this.e; }
a.c = function() { return this.f; }
a.d = 20;
a.e = "hi";
a.f = 500... | |
<|file_name|>issue-818.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/licen... | fn main() {
let c = ctr::new(42);
let c2 = ctr::inc(c); |
<|file_name|>cleanup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
import os
import sys
import redis
app_path = os.path.realpath('%s/../../..' % os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, '%s/lib' % app_path)
import settings
def get_db(conf):
return redis.StrictRedis(host=conf['ho... | argparser = argparse.ArgumentParser(description="RedisDB clean-up utility")
argparser.add_argument('clean_what', metavar="ACTION", |
<|file_name|>seleareaTest.py<|end_file_name|><|fim▁begin|>#-*- coding: utf-8 -*-
'''
Created on 23 mar 2014
@author: mariusz
@author: tomasz
'''
import unittest
from selearea import get_ast, get_workareas
class seleareaTest(unittest.TestCase):
def get_fc_pages(self):
urls = {
"http://fc.p... | |
<|file_name|>MenuLockLayer.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
* Copyright (c) 2012-2017 Codenvy, S.A.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v... | public LockLayer() {
sinkEvents(Event.ONMOUSEDOWN); |
<|file_name|>list.py<|end_file_name|><|fim▁begin|>from django.core.urlresolvers import reverse, resolve
from django.utils.html import escape
from .base import Widget
from ..libs import List as TogaList, SimpleListElement as TogaSimpleListElement
class SimpleListElement(Widget):
def __init__(self, content, detail... | # print("SET FRAME", self, frame.origin.x, frame.origin.y, frame.size.width, frame.size.height)
# self._impl.setFrame_(frame) |
<|file_name|>split.py<|end_file_name|><|fim▁begin|>s="the quick brown fox jumped over the lazy dog"
t = s.split(" ")
for v in t:
print(v)
r = s.split("e")
for v in r:
print(v)
x = s.split()
for v in x:<|fim▁hole|>
# 2-arg version of split not supported
# y = s.split(" ",7)
# for v in y:
# print v<|fim▁e... | print(v) |
<|file_name|>socket_bsd.go<|end_file_name|><|fim▁begin|>// socket_bsd.go -- Socket handling specific to *BSD based systems.
// Copyright 2010 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package syscall
const SizeofSockad... | Port uint16
Flowinfo uint32
Addr [16]byte /* in6_addr */ |
<|file_name|>gainnode.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 https://mozilla.org/MPL/2.0/. */
use crate::dom::audionode::AudioNode;
use crate::dom::audio... | };
use crate::dom::bindings::codegen::Bindings::AudioParamBinding::AutomationRate; |
<|file_name|>gsExprAssembler_test.cpp<|end_file_name|><|fim▁begin|>/** @file gsExprAssembler_test.cpp
@brief Tests for gsExprAssembler
This file is part of the G+Smo library.
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 ... | gsMultiPatch<> patches = gsNurbsCreator<>::BSplineSquareGrid(1,2,1);
patches.patch(0).translate(translation);
patches.patch(1).translate(translation); |
<|file_name|>trainer.py<|end_file_name|><|fim▁begin|># This module is part of the Divmod project and is Copyright 2003 Amir Bakhtiar:
# amir@divmod.org. This is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free S... | self.guesser = Bayes()
else:
self.guesser = guesser |
<|file_name|>remove-dups.py<|end_file_name|><|fim▁begin|># remove duplicates of linked list
class Node(object): # define constructor
def __init__(self, data):
self.data = data
self.next = None
class LinkedList(object):
def __init__(self, head=None):
self.head = head
def add(self, new_node):
current_node =... | |
<|file_name|>relu.py<|end_file_name|><|fim▁begin|># Copyright 2019 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.org/l... | out = tf.nn.relu(input_tensor)
return [input_tensor], [out]
|
<|file_name|>Application.py<|end_file_name|><|fim▁begin|>import pygame
from pygame.locals import *
class Application:
def __init__(self, screen_size, caption="PyGame"):
pygame.init()
self.display_surface = pygame.display.set_mode(screen_size)
pygame.display.set_caption(caption)
self... | |
<|file_name|>issue-573-layout-test-failures.rs<|end_file_name|><|fim▁begin|>#![allow(
dead_code,
non_snake_case,
non_camel_case_types,
non_upper_case_globals
)]
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct Outer {
pub i: u8,
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub st... | concat!("Alignment of ", stringify!(AutoIdVector))
);
assert_eq!( |
<|file_name|>plot_cluster_stats_spatio_temporal_2samp.py<|end_file_name|><|fim▁begin|>"""
=========================================================================
2 samples permutation test on source data with spatio-temporal clustering
=========================================================================
Tests i... | ###############################################################################
# Visualize the clusters |
<|file_name|>Tos.java<|end_file_name|><|fim▁begin|>package com.twitter.meil_mitu.twitter4holo.api.help;
import com.twitter.meil_mitu.twitter4holo.AbsGet;
import com.twitter.meil_mitu.twitter4holo.AbsOauth;
import com.twitter.meil_mitu.twitter4holo.ITwitterJsonConverter;
import com.twitter.meil_mitu.twitter4holo.OauthT... | } |
<|file_name|>FlowBaseObject.js<|end_file_name|><|fim▁begin|>/* Copyright (C) 2011-2014 Mattias Ekendahl. Used under MIT license, see full details at https://github.com/developedbyme/dbm/blob/master/LICENSE.txt */
/**
* Base object for objects that are using properites to flow updates through the application.
*/
dbm.r... | * |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#[macro_use]
pub mod sync;
#[macro_use]
pub mod async;
#[macro_use]<|fim▁hole|><|fim▁end|> | extern crate log; |
<|file_name|>SettingsResolver.java<|end_file_name|><|fim▁begin|>package greymerk.roguelike.dungeon.settings;
import java.util.Collection;
import java.util.Random;
import greymerk.roguelike.config.RogueConfig;
import greymerk.roguelike.util.WeightedChoice;
import greymerk.roguelike.util.WeightedRandomizer;
import grey... |
if(settingsRandomizer.isEmpty()) return null;
|
<|file_name|>coolmoviezone.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# ..#######.########.#######.##....#..######..######.########....###...########.#######.########..######.
# .##.....#.##.....#.##......###...#.##....#.##....#.##.....#...##.##..##.....#.##......##.....#.##....##
# .##.....#.##.....#.... | |
<|file_name|>service-31.service.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 { Injectable } from '@angular/core';<|fim▁hol... |
@Injectable() |
<|file_name|>ContainerAlveary.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
* Copyright (c) 2011-2014 SirSengir.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Lesser Public Licens... | @Override |
<|file_name|>sprite.rs<|end_file_name|><|fim▁begin|>use crate::utility::pixel::Pixel;
<|fim▁hole|>#[derive(Debug)]
pub struct Sprite {
pub class: SpriteType,
pub rle_entry: Entry,
pub x_dim: i32,
pub y_dim: i32,
pub x_off: i32,
pub y_off: i32,
// pub image_raw: Vec<Pixel>,
pub i... | use crate::entity::entry::Entry;
use crate::entity::sprite_type::SpriteType;
|
<|file_name|>Avatar.js<|end_file_name|><|fim▁begin|>"use strict";
// Controller
function Avatar(app, req, res) {
// HTTP action<|fim▁hole|>
app.sendFile(res, './storage/users/' + params[0] + '/' + params[1]);
};
};
module.exports = Avatar;<|fim▁end|> | this.action = (params) => { |
<|file_name|>model.js<|end_file_name|><|fim▁begin|>(function( $, ko ) {
// Namespace for app.
window['massroute'] = window.massroute || {};
window.massroute['model'] = window.massroute.model || {};
/**
* Overall session model that holds state of the application.
* @return {massroute.... | |
<|file_name|>DigitalBookingExceptionCode.java<|end_file_name|><|fim▁begin|>package mx.com.cinepolis.digital.booking.commons.exception;
/**
* Clase con los códigos de errores para las excepciones
* @author rgarcia
*
*/
public enum DigitalBookingExceptionCode
{
/** Error desconocido */
GENERIC_UNKNOWN_ERROR(0),... | BOOKING_NUMBER_COPIES_ZERO(82),
BOOKING_NUM_SCREENS_GREATER_NUM_COPIES(83), |
<|file_name|>select_connection.py<|end_file_name|><|fim▁begin|>"""A connection adapter that tries to use the best polling method for the
platform pika is running on.
"""
import os
import logging
import socket
import select
import errno
import time
from operator import itemgetter
from collections import defaultdict
imp... | def stop(self):
"""Request exit from the ioloop.""" |
<|file_name|>vertex.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/. */
//! Rendering logic related to the vertex shaders and their st... | name: "aWavyLineThickness", |
<|file_name|>smallintmap.rs<|end_file_name|><|fim▁begin|>use std::collections::SmallIntMap;
struct Tenant<'a> {
name: &'a str,
phone: &'a str,
}
fn main() {
// Start with 5 apartments
let mut apartments = SmallIntMap::with_capacity(5);
// The compiler infers 1 as uint
apartments.insert(1, Ten... | });
|
<|file_name|>store.rs<|end_file_name|><|fim▁begin|>use std::path::PathBuf;
use std::env;
use std::ffi;
use std::fmt;
use std::convert;
use std::error;
use std::io;
use std::fs::File;
use std::fs;
use std::io::prelude::*;
use std::result;
use tree;
use gpgme;
use ::vcs;
macro_rules! println_stderr(
($($arg:tt)*) ... |
fn get_gpgid_from_file(path: &PathBuf) -> Result<String> {
let f = try!(fs::File::open(path));
let mut reader = io::BufReader::new(f); |
<|file_name|>validate-uncompressed.js<|end_file_name|><|fim▁begin|>/**
* @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
Object.append(Browser.Features, {
inputemail: (function() {
var i = document.createEl... | // Only validate the field if the validate class is set
var handler = (el.className && el.className.search(/validate-([a-zA-Z0-9\_\-]+)/) != -1) ? el.className.match(/validate-([a-zA-Z0-9\_\-]+)/)[1] : "";
if (handler == '') { |
<|file_name|>chrome_jni_onload.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/app/android/chrome_jni_onload.h"
#include "chrome/app/android/chrome_... | return false;
return RunChrome(); |
<|file_name|>solution_unittest.cpp<|end_file_name|><|fim▁begin|>#include <limits.h>
#include "../src/solution.h"
#include "gtest/gtest.h"<|fim▁hole|> EXPECT_TRUE(HasOnlyUnique("asd"));
}
TEST(HasOnlyUniqueTest, TrueSingleChar) {
EXPECT_TRUE(HasOnlyUnique("a"));
}
TEST(HasOnlyUniqueTest, TrueEmpty) {
EXPECT... |
TEST(HasOnlyUniqueTest, TrueText) { |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>extern crate bazel_protos;
extern crate digest;
extern crate grpcio;
extern crate protobuf;
extern crate sha2;
use std::collections::BTreeMap;
pub mod local;
pub mod remote;
#[cfg(test)]
mod test_server;
///
/// A process to be executed.
///
#[derive(Clone, Debug, Eq,... | |
<|file_name|>snapshot.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/. */
//! A gecko snapshot, that stores the element attributes and... | self.has_any(Flags::OtherPseudoClassState) |
<|file_name|>wordnet.py<|end_file_name|><|fim▁begin|>from neobunch import Bunch
import os
from nltk.corpus import wordnet as wn
import re
from itertools import izip
from definition.words.word_sampler import lemmatize_all
class NLTKWordNetParser(object):
def __init__(self, opt):
self.opt = opt
def to... | word = line.strip()
idx_entries, inflected = self.get_idx_entries(word)
entries = self.get_entries(idx_entries)
maybe_proper_noun = False |
<|file_name|>freespace.cpp<|end_file_name|><|fim▁begin|>/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU G... | |
<|file_name|>capitalizeFirstLetter.js<|end_file_name|><|fim▁begin|>import { Blaze } from 'meteor/blaze';
/**
* A global Blaze UI helper to capitalizes the first letter of an input String
*
* Credit to:<|fim▁hole|> * http://stackoverflow.com/questions/1026069/capitalize-the-first-letter-of-string-in-javascript
*/
B... | * |
<|file_name|>WallPiece.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright 2016 Takashi Inoue<|fim▁hole|> *
* This file is part of EzPuzzles.
*
* EzPuzzles 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|>3_welcome_with_rest.py<|end_file_name|><|fim▁begin|><|fim▁hole|>import json
from database.database import db_session
from models import City
app = Flask(__name__)
@app.teardown_appcontext
def shutdown_session(exception=None):
db_session.remove()
@app.route('/')
def api_root():
return 'Welcom... | from flask import Flask, url_for
import requests |
<|file_name|>resource.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | /* depends_on_multi_main 2.1.1 */ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.