prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>fullscreen.js<|end_file_name|><|fim▁begin|>// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"));
... | CodeMirror.defineOption("fullScreen", false, function(cm, val, old) {
if (old == CodeMirror.Init) old = false; |
<|file_name|>model.py<|end_file_name|><|fim▁begin|>"""
Implementation of model
"""
import numpy as np
import numpy.random as npr
from scipy import ndimage
from configuration import get_config
config = get_config()
class LatticeState(object):
""" Treat 1D list as 2D lattice and handle coupled system
Th... |
flat_camp = res[:self.get_size()].reshape(self.get_size() * t_range)
flat_exci = res[self.get_size():].reshape(self.get_size() * t_range) |
<|file_name|>menubar.ts<|end_file_name|><|fim▁begin|>import { NgModule, Component, ElementRef, Input, Renderer2, OnDestroy,ChangeDetectorRef, ChangeDetectionStrategy, ViewEncapsulation, AfterContentInit, ContentChildren, QueryList, TemplateRef, ViewChild, Output, EventEmitter } from '@angular/core';
import { CommonModu... | [ngClass]="{'p-menuitem-link':true,'p-disabled':child.disabled}"
[fragment]="child.fragment" [queryParamsHandling]="child.queryParamsHandling" [preserveFragment]="child.preserveFragment" [skipLocationChange]="child.skipLocationChange" [replaceUrl]="child.replaceUrl" [stat... |
<|file_name|>16f121110a0f_add_same_tool_and_tool_id.py<|end_file_name|><|fim▁begin|>"""Add same_tool and tool_id
Revision ID: 16f121110a0f
Revises: 2c58f1b857f1
Create Date: 2015-11-09 12:28:43.019410
"""
# revision identifiers, used by Alembic.
revision = '16f121110a0f'
down_revision = '2c58f1b857f1'
from alembic ... | op.add_column('ActiveTranslationMessages', sa.Column('tool_id', sa.Unicode(length=255), nullable=True))
op.create_index(u'ix_ActiveTranslationMessages_same_tool', 'ActiveTranslationMessages', ['same_tool'], unique=False)
op.create_index(u'ix_ActiveTranslationMessages_tool_id', 'ActiveTranslationMessages', [... |
<|file_name|>tls.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>//! Types for reading certificates, private keys, and root certificate stores from the CLI
pub use habitat_core::tls::rustls_wrapper::{CertificateChainCli,
PrivateKeyCli,
... | |
<|file_name|>gulpfile.babel.js<|end_file_name|><|fim▁begin|>/**
* Run this using node_modules/gulp/bin/gulp.js !!!
* mhm 8.6.2017
*/
'use strict';
import plugins from 'gulp-load-plugins';<|fim▁hole|>import rimraf from 'rimraf';
import yaml from 'js-yaml';
import fs from 'fs';
// Load all Gulp plugins into one var... | //import rename from 'gulp-rename';
import yargs from 'yargs';
import gulp from 'gulp'; |
<|file_name|>wamptestserver.py<|end_file_name|><|fim▁begin|>###############################################################################
##
## Copyright 2011,2012 Tavendo GmbH
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
... | """ |
<|file_name|>web.py<|end_file_name|><|fim▁begin|>"""
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in... | _zk = KazooClient(
app.config['ZK_CONNECTION_STRING'],
default_acl=( |
<|file_name|>test_fmax_op.py<|end_file_name|><|fim▁begin|># Copyright (c) 2021 PaddlePaddle 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.ap... | self.op_type = "elementwise_fmax"
# If x and y have the same value, the max() is not differentiable.
# So we generate test data by the following method
# to avoid them being too close to each other. |
<|file_name|>debug-option-without-group.rs<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | // compile-flags: --unpretty=hir |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""
Initialize the module.
Author:
Panagiotis Tsilifis
<|fim▁hole|>
"""
from _forward_model_dmnless import *<|fim▁end|> | Date:
5/22/2014 |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""
A framework for data processing and data preparation DAG (directed acyclic graph) pipelines.
The examples in the documentation assume
>>> from __future__ import print_function
if running pre Py3K, as well as
>>> from dagpype import *
"""
import types
fr... | if eval('not isinstance(m.%s, types.ModuleType)' % s): |
<|file_name|>rpc.rs<|end_file_name|><|fim▁begin|>use crate::{prelude::*, serializer::*};
use std::{
io::{self, Cursor, Error},
mem,
sync::Arc,
};
#[repr(u8)]
pub enum RpcType {
// Operations that can update the connection or blockchain state
Broadcast = 0x10,
SetBlockFilter = 0x11,
ClearBlo... | }
} |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>'use strict';
var getSubplotCalcData = require('../get_data').getSubplotCalcData;
var counterRegex = require('../../lib').counterRegex;
var createPolar = require('../polar/polar');
var constants = require('./constants');
var attr = constants.attr;
var name = constan... | |
<|file_name|>R6.1A.py<|end_file_name|><|fim▁begin|># Given the list values = [] , write code that fills the list with each set of numbers below.
# a.1 2 3 4 5 6 7 8 9 10
list = []
for i in range(11):<|fim▁hole|><|fim▁end|> | list.append(i)
print(list) |
<|file_name|>usuario.js<|end_file_name|><|fim▁begin|>var direccion = '/api/Usuarios/' + sessionStorage.userId + '?access_token=' + sessionStorage.userToken;
var nombre;
/* Eliminar los valores de sesión */
function eliminarStorage(){
sessionStorage.removeItem("userToken");
sessionStorage.removeItem("userId");
sess... | |
<|file_name|>example.js<|end_file_name|><|fim▁begin|>!(function(){
var spg = require('./simple-password-generator.js');<|fim▁hole|>
console.log(spg.generate({
length : 3
}));
})();<|fim▁end|> | |
<|file_name|>Psiquica_vw.js<|end_file_name|><|fim▁begin|>function dialogoCV() {
var dialogo = getDiv();
var actualizarDialogoPsiquica = function() {
var titulo;
var contenido;
var cvLibres = personaje_actual.getHabilidadDePersonaje(HB_CV).valorFinalActual() - personaje_actual.getCVGasta... |
function appendPoderesPsiquicos(elemento, disciplinaPsiquica) {
var poderesDominados = personaje_actual.getPoderesDominadosDisciplina(disciplinaPsiquica);
|
<|file_name|>input_properties_py.hpp<|end_file_name|><|fim▁begin|>//
// input_properties_py.hpp
// blockscipy
//
// Created by Malte Moeser on 8/26/19.
//
#ifndef input_properties_py_h
#define input_properties_py_h
#include "method_tags.hpp"
#include <blocksci/chain/block.hpp>
struct AddInputMethods {
templa... | |
<|file_name|>pipes.d.ts<|end_file_name|><|fim▁begin|>import { DomSanitizer } from '@angular/platform-browser';
export declare class IndexTrack {
transform(_x: any): (index: any) => any;
}
export declare class Stringify {
transform(input: any, spaces?: number): string;
}
export declare class ForceArray {
tra... | export declare class toNumber {
transform(input: string): number;
} |
<|file_name|>phantom.rs<|end_file_name|><|fim▁begin|>// https://rustbyexample.com/generics/phantom.html
// http://rust-lang-ja.org/rust-by-example/generics/phantom.html
use std::marker::PhantomData;
// A phantom tuple struct which is generic over `A` with hidden parameter `B`.
#[derive(PartialEq)] // Allow equality t... | // Compile-time Error! Type mismatch so these cannot be compared: |
<|file_name|>issue-81839.rs<|end_file_name|><|fim▁begin|>// edition:2018
pub struct Test {}
impl Test {<|fim▁hole|> pub async fn answer_str(&self, _s: &str) -> Test {
Test {}
}
}<|fim▁end|> | |
<|file_name|>partner_events.py<|end_file_name|><|fim▁begin|># -*- coding: UTF-8 -*-
import haystack
from django.core.management.base import BaseCommand, CommandError
from django.db import transaction
from conference import models
from conference.templatetags.conference import fare_blob<|fim▁hole|>from datetime import... |
from collections import defaultdict |
<|file_name|>global-functions.js<|end_file_name|><|fim▁begin|>/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
( function($) {
} )( jQuery );
var waitForFinalEvent = (f... | if (!uniqueId) {
uniqueId = "Don't call this twice without a uniqueId";
|
<|file_name|>RouteUtils.js<|end_file_name|><|fim▁begin|>'use strict';
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = ... | routes = [routes];
}
return routes; |
<|file_name|>widgets.py<|end_file_name|><|fim▁begin|>"""
Extra HTML Widget classes
"""
import datetime
import re
from django.newforms.widgets import Widget, Select
from django.utils.dates import MONTHS
from django.utils.safestring import mark_safe
__all__ = ('SelectDateWidget',)
RE_DATE = re.compile(r'(\d{4})-(\d\d... | select_html = Select(choices=month_choices).render(self.month_field % name, month_val, local_attrs)
output.append(select_html)
|
<|file_name|>TeamCommands.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2018 Aleksander Jagiełło
*
* 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/licens... | |
<|file_name|>getaviprop.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""
gets basic info about AVI file using OpenCV
input: filename or cv2.Capture
"""
from pathlib import Path
from struct import pack
from typing import Dict, Any
import cv2
def getaviprop(fn: Path) -> Dict[str, Any]:
if isinstance(fn, (... | |
<|file_name|>svhn.py<|end_file_name|><|fim▁begin|>"""
.. todo::
WRITEME
"""
import os
import gc
import warnings
try:
import tables
except ImportError:
warnings.warn("Couldn't import tables, so far SVHN is "
"only supported with PyTables")
import numpy
from theano import config
from pylearn2.dat... | self.__dict__.update(locals()) |
<|file_name|>scheduler.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | from datetime import datetime, timedelta |
<|file_name|>batch_insert_is_not_supported_on_sqlite.rs<|end_file_name|><|fim▁begin|>#[macro_use]
extern crate diesel;
use diesel::*;
use diesel::backend::Backend;
use diesel::sqlite::{Sqlite, SqliteQueryBuilder, SqliteConnection};
use diesel::types::{Integer, VarChar};
table! {
users {
id -> Integer,
... | |
<|file_name|>pipeline.js<|end_file_name|><|fim▁begin|>/**
* grunt/pipeline.js
*
* The order in which your css, javascript, and template files should be
* compiled and linked from your views and static HTML files.
*<|fim▁hole|> * (Note that you can take advantage of Grunt-style wildcard/glob/splat expressions
* fo... | |
<|file_name|>model.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# This file is part of INSPIRE.
# Copyright (C) 2014, 2015, 2016 CERN.
#
# INSPIRE 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, e... | |
<|file_name|>filtersSpec.js<|end_file_name|><|fim▁begin|>'use strict';
/* jasmine specs for filters go here */<|fim▁hole|>
describe('filter', function() {
});<|fim▁end|> | |
<|file_name|>extra.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2016, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from django.core.exceptio... | |
<|file_name|>CollectionProductData.ts<|end_file_name|><|fim▁begin|>import { Collection, Product } from ".";
import { IdentifierColumn } from "../../../src/Decorator/Column/IdentifierColumn";
import { RelationshipData } from "../../../src/Decorator/Relation/RelationshipData";<|fim▁hole|> @IdentifierColumn()
publi... | @RelationshipData<CollectionProductData>(Collection || "Collection", "Contain", Product || "Product", [(o) => o.CollectionId], [(o) => o.ProductId], "CollectionProducts")
export class CollectionProductData { |
<|file_name|>ivf_parser_unittest.cc<|end_file_name|><|fim▁begin|>// Copyright 2015 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 <stddef.h>
#include <stdint.h>
#include "base/files/memory_mapped_file.h"
#incl... | EXPECT_EQ(0, file_header.version);
EXPECT_EQ(sizeof(IvfFileHeader), file_header.header_size);
EXPECT_EQ(0x30385056u, file_header.fourcc); // VP80 |
<|file_name|>raster_test.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2019 The ESPResSo project
*
* This file is part of ESPResSo.
*
* ESPResSo 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, eit... | |
<|file_name|>reader.rs<|end_file_name|><|fim▁begin|>use std::vec::Vec;
use std::mem::replace;
use std::io::{BufRead,Result};
use std::default::Default;
// Reserving space for the column Strings initially seems to significantly increase performance
// Especially for column lengths <STRING_INITIAL_CAPACITY
static STRING... | // read (up to) new line character
let line_result = self.input_reader.read_until('\n' as u8, &mut self.line_bytes);
match line_result { |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""setup.py: setuptools control."""
import ez_setup
ez_setup.use_setuptools()
from os.path import dirname, abspath, join
from setuptools import setup
BASE_DIR = join(dirname(abspath(__file__)), 'orka/orka.py')
import ork... | name = "orka",
packages = ["orka"],
# starts from this main |
<|file_name|>groups.js<|end_file_name|><|fim▁begin|>"use strict";
/*global define, templates, socket, ajaxify, app, admin, bootbox, utils, config */
define('admin/manage/groups', [
'translator',
'components'
], function(translator, components) {
var Groups = {};
var intervalId = 0;
Groups.init = function() {
... | createModal.modal('hide');
} |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import React, { Component, PropTypes } from 'react';
import ItemTypes from './ItemTypes';
import { DragSource, DropTarget } from 'react-dnd';
import flow from 'lodash.flow';
function isNullOrUndefined(o) {
return o == null;
}
const cardSource = {
beginDrag(props)... | |
<|file_name|>test-var-read-outerscope-closed.js<|end_file_name|><|fim▁begin|>/*
* Reading a variable.
*/
if (typeof print !== 'function') { print = console.log; }
function test() {<|fim▁hole|> return function inner() {
var i;
var t;
for (i = 0; i < 1e6; i++) {
... | function outer() {
var o = 123;
|
<|file_name|>agents.tsx<|end_file_name|><|fim▁begin|>/*
* Copyright 2020 ThoughtWorks, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICEN... | |
<|file_name|>common.js<|end_file_name|><|fim▁begin|>(function(){
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x){
window.requestAnimation = window[vendors[x] + 'RequestAnimationFrame'];
window.cancelAnimtionFrame =
... | }
if(!window.requestAnimationFrame) |
<|file_name|>deque.rs<|end_file_name|><|fim▁begin|>// SPDX-License-Identifier: Unlicense
//! A static array of nodes which are all in one of a set of deques.
//!
//! Provides O(1) for operations including:
//! - remove an item at an arbitrary index and push it onto a specific
//! deque.
//! - remove an arbitrary sub... | //!
//! Removing m items from the tail of a deque is O(m) because the list |
<|file_name|>SystemBundleLoader.js<|end_file_name|><|fim▁begin|>Clazz.declarePackage ("org.eclipse.osgi.framework.internal.core");
Clazz.load (["org.eclipse.osgi.framework.internal.core.BundleLoader"], "org.eclipse.osgi.framework.internal.core.SystemBundleLoader", null, function () {
c$ = Clazz.decorateAsClass (functi... | return null;
} else { |
<|file_name|>test_hist_method.py<|end_file_name|><|fim▁begin|># coding: utf-8
""" Test cases for .hist method """
import pytest
from pandas import Series, DataFrame
import pandas.util.testing as tm
import pandas.util._test_decorators as td
import numpy as np
from numpy.random import randn
from pandas.plotting._cor... | pytest.raises(ValueError, df.hist, column='height', by=df.category,
layout=(1, 3)) |
<|file_name|>rtapi_app.cc<|end_file_name|><|fim▁begin|>/* Copyright (C) 2006-2008 Jeff Epler <jepler@unpythonic.net>
* Copyright (C) 2012-2014 Michael Haberler <license@mah.priv.at>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as pub... | } else { |
<|file_name|>decorators.py<|end_file_name|><|fim▁begin|># !/usr/bin/env python
# -*- coding: UTF-8 -*-
# Copyright (c) 2012-2015 Christian Schwarz
#
# 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 S... | #
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
<|file_name|>fr-NE.ts<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
// THIS CODE IS GENERATED - DO NOT MODIFY
// See angular/tools/gu... | let i = Math.floor(Math.abs(n));
if (i === 0 || i === 1) return 1;
return 5; |
<|file_name|>_009_change_token_value.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2018 GIG Technology NV
#
# 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://... | if role.name in ('invited', 'members'):
menu_item_roles.append(role.id)
system.put_menu_item(api_key, icon_name, BUY_TOKENS_TAG, coords, None, label, static_flow=flow, |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// We have a lot of c-types in here, stop warning about their names!<|fim▁hole|>// fmt::Debug isn't helpful on FFI types
#![allow(missing_debug_implementations)]
// unreachable_pub warns `#[no_mangle] pub extern fn` in private mod.
#![allow(unreachable_pub)]
//! # hyper... | #![allow(non_camel_case_types)] |
<|file_name|>issue-5550.rs<|end_file_name|><|fim▁begin|>// Copyright 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/lice... | // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your |
<|file_name|>mut_.rs<|end_file_name|><|fim▁begin|>use std::fmt::{self, Debug};
use std::marker;
use std::mem;
use std::ops::{Index, IndexMut, Deref};
use base;
use base::Stride as Base;
/// A mutable strided slice. This is equivalent to `&mut [T]`, that
/// only refers to every `n`th `T`.
///
/// This can be viewed as... | /// access to the slice.
#[inline(always)]
pub fn reborrow<'b>(&'b mut self) -> Stride<'b, T> {
Stride::new_raw(self.base) |
<|file_name|>settings.go<|end_file_name|><|fim▁begin|>package realtime
import (
"log"
"github.com/Jeffail/gabs"
"github.com/lnxjedi/gopherbot/connectors/rocket/models"
)
// GetPublicSettings gets public settings
//
// https://rocket.chat/docs/developer-guides/realtime-api/method-calls/get-public-settings
func (c ... | |
<|file_name|>partition_helper_mrbpr.py<|end_file_name|><|fim▁begin|># =======================================================================
# This file is part of MCLRE.
#
# MCLRE 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 ... | |
<|file_name|>Circle.java<|end_file_name|><|fim▁begin|>/* Copyright 2010 - 2013 by Brian Uri!
This file is part of DDMSence.
This library is free software; you can redistribute it and/or modify
it under the terms of version 3.0 of the GNU Lesser General Public
License as published by the Free ... | home page is located at http://ddmsence.urizone.net/
|
<|file_name|>all-scores-view.js<|end_file_name|><|fim▁begin|>// Full high scores view
define([
"jquery",
"underscore",
"backbone",
"dispatcher",
"config",
"views/score-table-cells"
], function ($, _, Backbone, dispatcher, config, TableCells) {
var AllScoresView = Backbone.View.extend({
... | this.listenTo(this.model, "add", this.render);
this.listenTo(this.model, "change", this.render);
this.grid = new Backgrid.Grid({ |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import { Component } from 'react';
import format from '../components/format';
import parse from 'date-fns/parse';
import getDay from 'date-fns/get_day';
import Media from 'react-media';
import Page from '../layouts/Page';
import TimelineView from '../components/Timelin... | {(matches) => {
const Component = matches ? ListView : TimelineView;
return <Component events={this.props.events} />;
}} |
<|file_name|>ContactedClasses.java<|end_file_name|><|fim▁begin|>package com.intel.ide.eclipse.mpt.classpath;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Properties;
import com.intel.ide.eclipse.mpt.launching.J... | private List externalList;
|
<|file_name|>placements.js<|end_file_name|><|fim▁begin|>const autoAdjustOverflow = {
adjustX: 1,
adjustY: 1
}
const targetOffset = [0, 0]
export const placements = {
left: {
points: ['cr', 'cl'],
overflow: autoAdjustOverflow,
offset: [-3, 0],
targetOffset
},
right: {
points: ['cl', 'cr']... | offset: [0, 3],
targetOffset
},
leftBottom: { |
<|file_name|>afu_use30.py<|end_file_name|><|fim▁begin|>import csv
import matplotlib.pyplot as plt
import numpy as np
import scipy.stats as stats
from scipy.optimize import curve_fit
def countKey(key,listDataDicts):
outDict = {}
for row in listDataDicts:
try:
outDict[row[key]] += 1
... | totalDays = 0
numberUsers = 0
for person in listDataDicts:
if ( int(person[key]) < 31 ): |
<|file_name|>constraints.py<|end_file_name|><|fim▁begin|>import datetime
import logging
from django.conf import settings
from django.core.exceptions import NON_FIELD_ERRORS
from google.appengine.api.datastore import Key, Delete, MAX_ALLOWABLE_QUERIES
from google.appengine.datastore.datastore_rpc import TransactionOpti... | ))
else: |
<|file_name|>item_view.js<|end_file_name|><|fim▁begin|>Noted.ItemView = Ember.View.extend({
templateName: "item_static",
didInsertElement: function() {
if (this.listItem.get("isEditing") === true) {
this._toEditingView();
}
else if (this.get("listItem.isActive")) {
this._updateScrollPositio... | },
doubleClick: function() {
// make de-selectable so that a triple click will not select |
<|file_name|>boss_bug_trio.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license: http://github.com/azerothcore/azerothcore-wotlk/LICENSE-GPL2
* Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaN... | |
<|file_name|>pose_and_debug_publisher.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
import roslib; roslib.load_manifest('zaber_stage')
import rospy
import actionlib
from geometry_msgs.msg import Pose
from zaber_stage.msg import PoseAndDebugInfo
from zaber_stage.srv import GetPoseAnd... | if __name__ == '__main__':
try: |
<|file_name|>bpzfinalize.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
from __future__ import division
# python bpzchisq2run.py ACS-Subaru
# PRODUCES ACS-Subaru_bpz.cat
# ADDS A FEW THINGS TO THE BPZ CATALOG
# INCLUDING chisq2 AND LABEL HEADERS
# ~/p/bpzchisq2run.py NOW INCLUDED!
# ~/Tonetti/c... | mybpz.add('stel', mycat.stel)
elif 'stellarity' in mycat.labels:
mybpz.add('stel', mycat.stellarity) |
<|file_name|>window.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 app_units::Au;
use devtools_traits::{ScriptToDevtoolsContr... |
next_worker_id: Cell<WorkerId>,
/// For sending messages to the memory profiler. |
<|file_name|>Loading.java<|end_file_name|><|fim▁begin|>package com.badlogic.gdx.ingenuity.scene2d;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.ingenuity.GdxData;
import com.badlogic.gdx.ingenuity.helper.PixmapHelper;
import com.badlogic.gdx.ingenuity.utils.GdxUtilities;
import com.badlogic.gdx.scen... | * @时间 2017年3月24日 下午3:09:56
* @类说明: |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*-
#
# 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
#
... | boolean = pp.Regex(boolean).setParseAction(lambda t: t[0].lower() == "true")
hex_string = lambda n: pp.Word(pp.hexnums, exact=n)
uuid = pp.Combine(hex_string(8) + ("-" + hex_string(4)) * 3 + |
<|file_name|>catchflames-custom.js<|end_file_name|><|fim▁begin|>// Catch Flames Custom Scripts
jQuery(document).ready(function() {
/* Waypoint */
if ( jQuery.isFunction( jQuery.fn.waypoint ) ) {
var waypointheader = new Waypoint({
element: document.getElementById('page'),
handler: function(direction) {
... | jQuery('#header-top').removeClass( 'fixed-header' ); |
<|file_name|>Phi_test.cpp<|end_file_name|><|fim▁begin|>#include <stan/math/prim/scal.hpp>
#include <boost/math/special_functions/fpclassify.hpp>
#include <gtest/gtest.h>
TEST(MathFunctions, Phi) {
EXPECT_EQ(0.5 + 0.5 * boost::math::erf(0.0), stan::math::Phi(0.0));
EXPECT_FLOAT_EQ(0.5 + 0.5 * boost::math::erf(0.9/s... | |
<|file_name|>GestureTrailsPreview.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2013 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
*
* htt... |
/**
* Draws the preview |
<|file_name|>strings.js<|end_file_name|><|fim▁begin|>define(
({
addLayer: "レイヤーの追加",
layerName: "レイヤー",
layerRefresh: "更新",
layerLabel: "ラベル",
actions: "操作",
popupOk: "OK",
popupCancel: "キャンセル",
mainPanelTextPlaceholder: "例: 高速道路の状態",
invalidInterval: "数字のみがサポートされています。"... | refreshIntervalInstruction: "更新間隔",
|
<|file_name|>aggregate_work_time.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# coding: UTF-8
# The MIT License
#
# Copyright (c) 2011 Keita Kita
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
#... | import sqlite3
import sys |
<|file_name|>javascript.js<|end_file_name|><|fim▁begin|>(function (){
"use strict";
(function() {
var $bordered = $('.bordered');
window.setInterval(function() {
var top = window.pageYOffset || document.documentElement.scrollTop;
if(top > 0) {
$bordere... |
(function(){
|
<|file_name|>fizzBuzz.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# https://www.codeeval.com/open_challenges/1/
import sys<|fim▁hole|>
def solve(X, Y, N):
r = []
for i in range(1, N + 1):
if i % X == 0 and i % Y == 0:
r.append('FB')
elif i % X == 0:
r.append('... | |
<|file_name|>player_test.go<|end_file_name|><|fim▁begin|>package kiiroo
import (
"bytes"
"fmt"
"runtime"
"testing"
"time"
"github.com/funjack/launchcontrol/protocol"
)
// Badish input scenario, contains dups and short timings
var scenario = "{1.00:1,1.50:4,1.51:4,1.51:3,1.52:4,1.66:1,1.84:2,1.85:3,1.90:4,1.95:... | t.Error(err) |
<|file_name|>mv.rs<|end_file_name|><|fim▁begin|>use board::chess::board::*;
use pgn_traits::pgn::PgnBoard;
use board_game_traits::board::Board;
use std::fmt;
#[derive(Clone, Eq, PartialEq, Debug)]
pub struct ChessReverseMove {
pub from : Square,
pub to : Square,
pub capture : PieceType,
pub prom : boo... |
pub fn new_prom(from : Square, to : Square, prom : PieceType) -> ChessMove {
ChessMove { from, to, prom: Some(prom) }
} |
<|file_name|>test_obstacle_avoidance.py<|end_file_name|><|fim▁begin|>import sys
sys.path.insert(0,'../src/')
# Begin From obstacle_avoidance
import rospy
import math
from math import sin, cos
from geometry_msgs.msg import Twist
from sensor_msgs.msg import LaserScan
from collections import namedtuple
Obstacle = named... | |
<|file_name|>parse.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 cg;
use quote::Tokens;
use syn::DeriveInput;
use synstructu... | /// Parse this keyword.
#[inline]
pub fn parse<'i, 't>(
input: &mut ::cssparser::Parser<'i, 't>, |
<|file_name|>function.hpp<|end_file_name|><|fim▁begin|>#ifndef __tc_function_h__
#define __tc_function_h__
#include <atomic>
namespace tc {
#define TC_FUNCTION_TD_0 typename R
#define TC_FUNCTION_TD_1 TC_FUNCTION_TD_0 , typename A1
#define TC_FUNCTION_TD_2 TC_FUNCTION_TD_1 , typename A2<|fim▁hole|>// template specia... | #define TC_FUNCTION_TD_3 TC_FUNCTION_TD_2 , typename A3
#define TC_FUNCTION_TD_4 TC_FUNCTION_TD_3 , typename A4
#define TC_FUNCTION_TD_5 TC_FUNCTION_TD_4 , typename A5
|
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>use iso8601::*;
#[test]
fn test_date() {
assert_eq!(<|fim▁hole|> Ok(Date::YMD {
year: 2015,
month: 6,
day: 26,
}),
date("2015-06-26")
);
assert_eq!(
Ok(Date::YMD {
year: -333,
... | |
<|file_name|>bvh4_factory.cpp<|end_file_name|><|fim▁begin|>// ======================================================================== //
// Copyright 2009-2015 Intel Corporation //
// //
// Licensed under the Ap... | |
<|file_name|>4c094013699a_update_load_balancer_amphora.py<|end_file_name|><|fim▁begin|># Copyright 2014 Rackspace
#
# 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:... | name=u'fk_load_balancer_amphora_load_balancer_id'),
sa.ForeignKeyConstraint([u'amphora_id'],
[u'amphora.id'],
name=u'fk_load_balancer_amphora_id'), |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import { createSelector } from 'reselect';
import { bindActionCreators, compose } from 'redux';
import { connect } from 'react-redux';
import { reduxForm } from 'redux-form';
import {
requestContact, createContact, deleteContact, invalidate as invalidateContacts,
} f... |
const updateTagCollection = (i18n, {
type, entity, tags: tagCollection, lazy, |
<|file_name|>2016-11-20-irina-and-lucian-maternity-photo-session.js<|end_file_name|><|fim▁begin|>import React from 'react';
import PostImage from '../components/story/PostImage';
import TwoPostImages from '../components/story/TwoPostImages';
import StoryPage from '../components/story/StoryPage';
import StoryTextBlock f... | render() {
return (
<StoryPage logoDirPath={imgDirPath1}
logoPrefix="teaser" |
<|file_name|>HTTP2Framer.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2016, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in t... | return ErrorCode::PROTOCOL_ERROR;
}
cursor.pull(&outOpaqueData, sizeof(outOpaqueData)); |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
//! Computed values.
use {Atom, Namespace};
use context::QuirksM... | |
<|file_name|>Flex.ts<|end_file_name|><|fim▁begin|>// NG2
import { Component, HostBinding, Input } from '@angular/core';
@Component({
selector: 'novo-flex,novo-row',
template: ` <ng-content></ng-content> `,
})
export class NovoFlexElement {
@HostBinding('style.display')
get display(): string {
return 'flex'... | @Input()
direction: string = 'column';
|
<|file_name|>chip8.rs<|end_file_name|><|fim▁begin|>extern crate chip8;
use std::env;
use std::fs::File;
use std::path::Path;<|fim▁hole|>fn main() {
let args: Vec<String> = env::args().collect();
if args.len() != 2 {
println!("Usage: {} ROM_FILE", args[0]);
::std::process::exit(1);
}
let... | |
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# tm1640-rpi documentation build configuration file, created by
# sphinx-quickstart on Fri Apr 12 19:52:17 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration val... | # If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here. |
<|file_name|>cursors.py<|end_file_name|><|fim▁begin|>"""MySQLdb Cursors
This module implements Cursors of various types for MySQLdb. By
default, MySQLdb uses the Cursor class.
"""
import re
import sys
try:
from types import ListType, TupleType, UnicodeType
except ImportError:
# Python 3
ListType = list
... |
def nextset(self):
"""Advance to the next result set.
|
<|file_name|>InstanceSaveMgr.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2010-2011 Project SkyFire <http://www.projectskyfire.org/>
* Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistr... | }
void InstanceSaveManager::LoadInstances()
{ |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | from transmute_core import *
from .route import route
from .swagger import add_swagger |
<|file_name|>builtin-superkinds-simple.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>// 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
// option. This file may not be copied... | // Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
// |
<|file_name|>settings.py<|end_file_name|><|fim▁begin|># coding:utf-8
"""
Django settings for turbo project.
Generated by 'django-admin startproject' using Django 1.11.1.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
... | |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|># Copyright 2012 NEC Corporation
#
# 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|>rect.rs<|end_file_name|><|fim▁begin|>use crate::{fragment::Bounds, util, Cell, Point};
use std::fmt;
use ncollide2d::shape::{Segment, Shape};
use sauron::{
html::{attributes, attributes::*},
svg::{attributes::*, *},
Node,
};
use std::cmp::Ordering;
#[derive(Debug, Clone)]
pub struct Rect {
... | }
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.