prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>Panel.js<|end_file_name|><|fim▁begin|>/*jshint maxstatements:false*/ define(function (require, exports) { "use strict"; var moment = require("moment"), Promise = require("bluebird"), _ = brackets.getModule("thirdparty/lodash"), CodeI...
$editedList.remove();
<|file_name|>issue79.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Reporter: pixdamix # # What steps will reproduce the problem? # ====================================== # # 1. Given three packages A, B, C # A depends on B # A failed postinst and is in unpacked state # C depends on B<|fim▁hole|># 2. Upgrade to ...
#
<|file_name|>editor.spec.js<|end_file_name|><|fim▁begin|>describe('Controller: EditorCtrl', function () { var $rootScope, $scope, $controller; beforeEach( module( 'PMTViewer' ) ); <|fim▁hole|> $controller('EditorCtrl', { '$rootScope' : $rootScope, '$scope': $scope }); })); it('sh...
beforeEach(inject(function (_$rootScope_, _$controller_) { $rootScope = _$rootScope_; $scope = $rootScope.$new(); $controller = _$controller_;
<|file_name|>toodle_sync.py<|end_file_name|><|fim▁begin|>''' Simple pull of account info ''' import requests import datetime import pickle import json import time import sys account_url = 'https://api.toodledo.com/3/account/get.php?access_token=' tasks_get_url = 'https://api.toodledo.com/3/tasks/get.php?access_token='...
start_date = datetime.date.strftime(start_date, '%A, %b %d, %Y')
<|file_name|>prefs.py<|end_file_name|><|fim▁begin|>import os, socket, sys, urllib from wx.lib.embeddedimage import PyEmbeddedImage ldc_name = "Live Debian Creator" ldc_cli_version = "1.4.0" ldc_gui_version = "1.11.0" if (sys.platform == "win32"): slash = "\\" if os.path.isfile(sys.path[0]): #fix for compiled...
"bviAMTB98OZqakfAH65vx4rqKBlNm2+8grUeWGCrGW5S9yWwti7ofW5Ucx9rIBK6bIRB2lVN" "Y29tQcBonG4Ta6k/NSBeDkSH2Sp0GoiUYYsQ+AB+0rTt4hov/lpQ0lrKDT/F66y3IjLN9rmh" "VQVo1b4StHgkWhAIEjioKBFfx91GFzR5wJ5HRINpem3YQfzyklAihgCjxDT1SvLvLLLkR0rA" "jdzOmjxwotbVf656+/20YmS9wrIfvSdO8p53A0UAM0RihVqIjNSB/WXRIFpwXVhebgxCkwdu"
<|file_name|>ca.js<|end_file_name|><|fim▁begin|>/* Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or http://ckeditor.com/license <|fim▁hole|> preview: 'Visualització prèvia' } );<|fim▁end|>
*/ CKEDITOR.plugins.setLang( 'preview', 'ca', {
<|file_name|>article_detail.js<|end_file_name|><|fim▁begin|>var angularjs = angular.module('articleDetailModule', ['courseTagServiceModule', 'ngCookies', 'ngVideo']); angularjs.controller('ArticleDetailController', ['$rootScope', '$scope', '$http', '$stateParams', '$state', '$location', 'CourseTagService', '$sce', '$...
<|file_name|>agg_run.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # Copyright (C) 2015 Swift Navigation Inc. # Contact: Ian Horn <ian@swiftnav.com> # # This source is subject to the license found in the file 'LICENSE' which must # be be distributed together with this source. All other rights reserved. # # THIS...
<|file_name|>markdown.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/licens...
let input = Path::new($input); match load_string(&input) { Err(e) => {
<|file_name|>ssa-sra-1.C<|end_file_name|><|fim▁begin|>/* { dg-do compile } */ /* { dg-options "-O1 -fdump-tree-optimized" } */ void link_error(); <|fim▁hole|> inline State(){p0=0;p1=0;p2=0;} inline State(const State &s) { p0 = s.p0; p1 = s.p1; p2 = s.p2; } inline void operator =(const State &s)...
struct State { int p0, p1, p2;
<|file_name|>testSpec.js<|end_file_name|><|fim▁begin|>define(['Scripts/App/CommentsScraper'], function(CommentsScraper) { describe('myFilter', function() { var failTest = function(error) { expect(error).toBeUndefined(); }; beforeEach(function(){ jasmine.addMatchers({ toBeE...
<|file_name|>main.cpp<|end_file_name|><|fim▁begin|>// Preprocessor Directives #define STB_IMAGE_IMPLEMENTATION // Local Headers #include "glitter.hpp" #include "shader.h" #include "camera.h" // Console Color #include "consoleColor.hpp" // System Headers #include <glad/glad.h> #include <GLFW/glfw3.h> #include <glm/gt...
<|file_name|>iam.rs<|end_file_name|><|fim▁begin|>//! Amazon Identity and Access Management <|fim▁hole|><|fim▁end|>
#![cfg_attr(feature = "nightly-testing", allow(while_let_loop))] include!(concat!(env!("OUT_DIR"), "/iam.rs"));
<|file_name|>statement.ts<|end_file_name|><|fim▁begin|>import { Month } from '../core/month'; import { Balance } from '../core/balance'; // Abstraction for a financial statement for a period of time. export abstract class Statement { name: string; // Period of time for the statement month: Month; // Recorded...
} }
<|file_name|>c_win32.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/license...
/// Macro for creating a compatibility fallback for a Windows function ///
<|file_name|>test_dave_reader.py<|end_file_name|><|fim▁begin|>from test.fixture import * from hypothesis import given from hypothesis.strategies import text from astropy.io import fits import utils.dave_reader as DaveReader from utils.dave_reader import save_to_intermediate_file, load_dataset_from_intermediate_file i...
@given(text()) def test_get_fits_dataset_lc(s):
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>from django.contrib import admin from django.contrib import messages from django.core.mail import EmailMultiAlternatives from django.conf import settings from .models import Email from users.models import User @admin.register(Email) class EmailAdmin(admin.ModelAdmin...
email = queryset.first()
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|>from south.db import db from django.db import models from transifex.releases.models import * class Migration: def forwards(self, orm):<|fim▁hole|> "Write your backwards migration here" models = { } complete_apps = ['releases']<|fim▁e...
"Write your forwards migration here" def backwards(self, orm):
<|file_name|>uvio.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/licenses/L...
fn test_callback_run_once() { do run_in_bare_thread { let mut event_loop = UvEventLoop::new();
<|file_name|>common.py<|end_file_name|><|fim▁begin|>"""Common code for Withings.""" import asyncio from dataclasses import dataclass import datetime from datetime import timedelta from enum import Enum, IntEnum import logging import re from typing import Any, Callable, Dict, List, Optional, Tuple, Union from aiohttp.w...
return None
<|file_name|>rules.py<|end_file_name|><|fim▁begin|>""" The symbols and rules for the CFG of C. I generated these myself by hand, so they're probably not perfectly correct. """ from rules_obj import * from lexer import * import tokens ### Symbols ### # Most symbols are either self-explanatory, or best understood by e...
<|file_name|>mxCompositeLayout.js<|end_file_name|><|fim▁begin|>/** * $Id: mxCompositeLayout.js,v 1.11 2010-01-02 09:45:15 gaudenz Exp $ * Copyright (c) 2006-2010, JGraph Ltd */ /** * Class: mxCompositeLayout * * Allows to compose multiple layouts into a single layout. The master layout * is the layout that hand...
}; /**
<|file_name|>review.server.model.js<|end_file_name|><|fim▁begin|>'use strict'; /** * Module dependencies. */ var mongoose = require('mongoose'),<|fim▁hole|> /** * Review Schema */ var ReviewSchema = new Schema({ content: { type: String, default: '', trim: true }, contentHTML: { ...
Schema = mongoose.Schema;
<|file_name|>ComSchemaName.cpp<|end_file_name|><|fim▁begin|>/********************************************************************** // @@@ START COPYRIGHT @@@ // // Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work fo...
{ NAString extSchemaName; #ifndef NDEBUG
<|file_name|>Gruntfile.js<|end_file_name|><|fim▁begin|>module.exports = function(grunt) { // Add our custom tasks. grunt.loadTasks('../../../tasks'); // Project configuration. grunt.initConfig({ mochaTest: { options: { reporter: 'spec', grep: 'tests that match grep', ...
}); // Default task. grunt.registerTask('default', ['mochaTest']);
<|file_name|>hello.py<|end_file_name|><|fim▁begin|>from helper import greeting <|fim▁hole|><|fim▁end|>
greeting('Hello')
<|file_name|>diff.py<|end_file_name|><|fim▁begin|>"""Test diff.""" # --- import ------------------------------------------------------------------------------------- import numpy as np import WrightTools as wt # --- test --------------------------------------------------------------------------------------- de...
assert np.all((np.abs(d - np.sin(x)) < 0.0001)[3:-4]) def test_descending_1():
<|file_name|>test_projection.py<|end_file_name|><|fim▁begin|>from __future__ import print_function, absolute_import, division import warnings import pytest import numpy as np from astropy import units as u from astropy.wcs import WCS from astropy.io import fits from radio_beam import Beam, Beams from .helpers impor...
roundtrip_spec = newspec.to(init_unit) np.testing.assert_almost_equal(roundtrip_spec.value, spec.value)
<|file_name|>utils.js<|end_file_name|><|fim▁begin|>'use strict'; Object.defineProperty(exports, "__esModule", { value: true<|fim▁hole|> case 'm': return { c: 'M', x: p.x + c.dx, y: p.y + c.dy }; case 'z': return { c: 'Z' }; case 'l': return { c: 'L', x: p....
}); var makeCommandAbsolute = exports.makeCommandAbsolute = function makeCommandAbsolute(p, c) { switch (c.c) {
<|file_name|>cli.js<|end_file_name|><|fim▁begin|>#!/usr/bin/env node /** * * Copyright 2014-2019 David Herron * * This file is part of AkashaCMS (http://akashacms.com/). * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * Y...
try { const config = require(path.join(process.cwd(), configFN)); let akasha = config.akasha;
<|file_name|>reportService.js<|end_file_name|><|fim▁begin|>(function () { 'use strict'; app.service('reportService', reportService); function reportService($http, $window, $interval, timeAgo, restCall, queryService, dashboardFactory, ngAuthSettings, reportServiceUrl) { var populateReport = function (report, u...
totalPending: 0, totalInProgress: 0,
<|file_name|>spinner.rs<|end_file_name|><|fim▁begin|>// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use Buildable; use Widget; use ffi; use glib; use glib::StaticType; use glib::Value; use glib::object::Downcast; use glib::object...
fn start(&self);
<|file_name|>Buffer.cpp<|end_file_name|><|fim▁begin|>/* Buffer.cpp - This file is part of Element Copyright (C) 2014 Kushview, LLC. All rights reserved. */ <|fim▁hole|>#if ELEMENT_BUFFER_FACTORY Buffer::Buffer (DataType dataType_, uint32 subType_) : factory (nullptr), refs (0), dataType (data...
<|file_name|>parse-links.service.js<|end_file_name|><|fim▁begin|>'use strict'; angular.module('donetexampleApp') .service('ParseLinks', function () { this.parse = function (header) { if (header.length == 0) { throw new Error("input must not be of zero length"); }<|fi...
<|file_name|>descriptor.go<|end_file_name|><|fim▁begin|>package lib import ( "strings" cvmfsUtil "github.com/cvmfs/docker-graphdriver/plugins/util" ) // m is the manifest of the original image // repoLocation is where inside the repo we saved the several layers // origin is an ecoding fo the original referencese a...
<|file_name|>run.py<|end_file_name|><|fim▁begin|>"""<|fim▁hole|> Input: Templated Antimony model (stdin) Output: Expanded Antimony model (stdout) """ import fileinput import os import sys directory = os.path.dirname(os.path.abspath(__file__)) path = os.path.join(directory, "TemplateSB") sys.path.append(path) fro...
Running the template pre-processor standalone.
<|file_name|>BlockNoteblock.java<|end_file_name|><|fim▁begin|>package cn.nukkit.block; import cn.nukkit.Player; import cn.nukkit.item.Item; import cn.nukkit.item.ItemTool; import cn.nukkit.level.Level; import cn.nukkit.level.sound.NoteBoxSound; import cn.nukkit.network.protocol.BlockEventPacket; /** * Created by Sna...
case GOLD_ORE: case IRON_ORE: case LAPIS_ORE: case REDSTONE_ORE:
<|file_name|>base.py<|end_file_name|><|fim▁begin|># Copyright (c) 2012 OpenStack Foundation. # 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:/...
# a 403. Otherwise, pretend that it doesn't exist to avoid # giving away information.
<|file_name|>attrib.go<|end_file_name|><|fim▁begin|>package glw import "golang.org/x/mobile/gl" type A2fv gl.Attrib func (a A2fv) Enable() { ctx.EnableVertexAttribArray(gl.Attrib(a)) } func (a A2fv) Disable() { ctx.DisableVertexAttribArray(gl.Attrib(a)) } func (a A2fv) Pointer() { a.Enable() ctx.VertexAttribPoint...
ctx.VertexAttribPointer(gl.Attrib(a), 3, gl.FLOAT, false, 0, 0) }
<|file_name|>test_queue.py<|end_file_name|><|fim▁begin|>import uuid import pytest from kazoo.testing import KazooTestCase from kazoo.tests.util import CI_ZK_VERSION class KazooQueueTests(KazooTestCase): def _makeOne(self): path = "/" + uuid.uuid4().hex return self.client.Queue(path) def tes...
def test_queue(self): queue = self._makeOne() queue.put(b"one")
<|file_name|>templates.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- ## $Id: webmessage_templates.py,v 1.32 2008/03/26 23:26:23 tibor Exp $ ## ## handles rendering of webmessage module ## ## This file is part of Invenio. ## Copyright (C) 2009, 2010, 2011 CERN. ## ## Invenio is free software; you can redistrib...
<a class="header" href="%(edit_job_url)s?ln=%(language)s">%(label_new_job)s</a> </td>
<|file_name|>Command.java<|end_file_name|><|fim▁begin|>package redis.clients.jedis; import com.esotericsoftware.reflectasm.MethodAccess; import org.apache.log4j.Logger; import java.util.Map; public abstract class Command { private final static Logger LOG = Logger.getLogger(Command.class); private final static Met...
Object ret = null; ShardedJedis jedis = pool.getResource();
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#![feature(old_io)] //! This test file mostly just has tests that make sure that the macros successfully compile. extern crate fern;<|fim▁hole|>use std::sync; #[test] fn test_log() { fern::local::set_thread_logger(sync::Arc::new( Box::new(fern::NullLogger) ...
#[macro_use] extern crate fern_macros;
<|file_name|>webhook_test.go<|end_file_name|><|fim▁begin|>// Copyright 2016 LINE Corporation // // LINE Corporation licenses this file to you 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...
if !reflect.DeepEqual(got, want) {
<|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, getDe...
<|file_name|>types.rs<|end_file_name|><|fim▁begin|>/// A point relative to the dimensions of a region. pub enum AnchorPoint { Center, Bottom, Top, Left, Right, BottomLeft, BottomRight,<|fim▁hole|>// General layering order of frames pub enum FrameStrata { Background, Low, Medium, ...
TopLeft, TopRight }
<|file_name|>storage_file.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Tests for the storage file CLI arguments helper.""" import argparse import unittest from plaso.cli import tools from plaso.cli.helpers import storage_file from plaso.lib import errors from tests.cli import tes...
self.assertEqual(test_tool._storage_file_path, options.storage_file) with self.assertRaises(errors.BadConfigObject): storage_file.StorageFileArgumentsHelper.ParseOptions(options, None)
<|file_name|>index.js<|end_file_name|><|fim▁begin|>'use strict'; import v1 from './v1' import v2 from './v2' import v3 from './v3' import v4 from './v4' import ugc from './ugc' import bos from './bos' import eus from './eus' import admin from './admin' import payapi from './payapi' import statis from './statis' import...
app.use('/ugc', ugc); app.use('/bos', bos);
<|file_name|>0016_service_position.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-02-22 21:06 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('statusboard', '0015_merge...
] operations = [
<|file_name|>keyframes.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/. */ //! Keyframes: https://drafts.csswg.org/css-animations/#key...
} }
<|file_name|>process.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 delineator = "//" hashtag = "#" # generate poems from a file # out: list of poem lines def generate_poems(filename): g = [] # get to the first poem in the file with open(filename, 'r') as f: for line in f: line...
<|file_name|>ast.py<|end_file_name|><|fim▁begin|># mako/ast.py # Copyright 2006-2020 the Mako authors and contributors <see AUTHORS file> # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """utilities for analyzing expressions and blocks of Pyth...
f.visit(expr) class PythonFragment(PythonCode):
<|file_name|>items.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Define here the models for your scraped items # # See documentation in: # http://doc.scrapy.org/en/latest/topics/items.html<|fim▁hole|>class TiebaItem(scrapy.Item): # define the fields for your item here like: # name = scrapy.Field() ...
import scrapy
<|file_name|>GlobalLocation.java<|end_file_name|><|fim▁begin|>package jqian.sootex.location; import soot.SootField; import soot.Type; /** Model a static class field */ public class GlobalLocation extends Location{ protected final SootField _field; GlobalLocation(SootField field){ this....
public SootField getSootField(){ return _field; }
<|file_name|>create-module.js<|end_file_name|><|fim▁begin|>'use strict' let React = require('react'), ReactDOM = require('react-dom'), $ = require('jquery'), d3 = require('d3'), storage = window.localStorage, ProgressBar = require('react-progress-bar-plus'), CheckOptionBox = require('../compone...
<|file_name|>main.go<|end_file_name|><|fim▁begin|>package main import ( "github.com/dr4ke616/GoProxy/server" "log" "os" ) func main() { server.DEVIL = false <|fim▁hole|> var err error proxy := server.Proxy{} // Load the proxy from a config file c := "/etc/goproxy/config.json" if server.DEVIL { c = "config...
<|file_name|>nzbget.py<|end_file_name|><|fim▁begin|>from flask import render_template, jsonify, request from jsonrpclib import jsonrpc import base64 import urllib from maraschino import app, logger from maraschino.tools import * def nzbget_http(): if get_setting_value('nzbget_https') == '1': return 'http...
try: nzbget = jsonrpc.ServerProxy('%s/jsonrpc' % nzbget_url())
<|file_name|>Torus_bin.js<|end_file_name|><|fim▁begin|>// Converted from: ../../examples/obj/torus/Torus.obj // vertices: 576 // faces: 576 // materials: 1 // <|fim▁hole|>// Generated with OBJ -> Three.js converter // http://github.com/alteredq/three.js/blob/master/utils/exporters/convert_obj_three.py va...
<|file_name|>struct_defs.rs<|end_file_name|><|fim▁begin|>// This test case tests the incremental compilation hash (ICH) implementation // for struct definitions. // The general pattern followed here is: Change one thing between rev1 and rev2 // and make sure that the hash has changed, then change nothing between rev2 ...
// Record Struct Field Type ----------------------------------------------------
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># encoding: utf-8 """ __init__.py<|fim▁hole|><|fim▁end|>
Created by Thomas Mangin on 2010-01-15. Copyright (c) 2009-2015 Exa Networks. All rights reserved. """
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>/* io::mod.rs */ use core::mem::volatile_store; use kernel::sgash; mod font; /* http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0225d/BBABEGGE.html */ pub static UART0: *mut u32 = 0x101f1000 as *mut u32; pub static UART0_IMSC: *mut u32 = (0x101f1000 + ...
draw_cursor(); } pub unsafe fn write_char(c: char, address: *mut u32) {
<|file_name|>webgl.js<|end_file_name|><|fim▁begin|>"use strict"; /*** * critical element webgl demo by Silke Rohn and Benedikt Klotz * Source is the Basis applikation. * Added and changed functionalities: * @Benedikt: Objects, Lighting, particle systems, shader, blending and face culling * @Silke: particle system, ch...
window.alert("Die kritische Masse ist explodiert!!!"); }
<|file_name|>_tickformat.py<|end_file_name|><|fim▁begin|>import _plotly_utils.basevalidators<|fim▁hole|> self, plotly_name="tickformat", parent_name="scattercarpet.marker.colorbar", **kwargs ): super(TickformatValidator, self).__init__( plotly_name=plotly_name, ...
class TickformatValidator(_plotly_utils.basevalidators.StringValidator): def __init__(
<|file_name|>macros.rs<|end_file_name|><|fim▁begin|>#[macro_use] extern crate gfx; pub use gfx::format as fm; #[derive(Clone, Debug)] pub struct Rg16; gfx_format!(Rg16: R16_G16 = Vec2<Float>); gfx_defines!{ #[derive(PartialEq)] vertex Vertex { _x: i8 = "x", _y: f32 = "y", } vertex...
let init = testraw::Init { vertex: (&[("a_Special", special)], 12, 0), cbuf: "Locals",
<|file_name|>EditorViewSet.py<|end_file_name|><|fim▁begin|>from django.conf import settings from rest_framework import viewsets from rest_framework.response import Response import snotes20.models as models class EditorViewSet(viewsets.ViewSet): def list(self, request): return Response([ { ...
'long': long, 'url': settings.EDITORS[short]['userurl'] } for short, long in models.EDITOR_CHOICES
<|file_name|>slack.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # # Copyright (c) 2017 Nick Douma # # 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 wi...
# Software is furnished to do so, subject to the following conditions:
<|file_name|>euler.rs<|end_file_name|><|fim▁begin|>// Copyright 2016 The CGMath Developers. For a full listing of the authors, // refer to the Cargo.toml file at the top-level directory of this distribution. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in com...
/// /// # Ranges /// /// - x: [-pi, pi]
<|file_name|>InputHandler.js<|end_file_name|><|fim▁begin|>function InputHandler(viewport) { var self = this; self.pressedKeys = {}; self.mouseX = 0; self.mouseY = 0; self.mouseDownX = 0; self.mouseDownY = 0; self.mouseMoved = false; self.mouseDown = false; self.mouseButton = 0; // 1...
this.pressedKeys[keyCode] = true; var ctrl = event.ctrlKey; this.target.onKeyPress(keyCode, ctrl);
<|file_name|>rows.rs<|end_file_name|><|fim▁begin|>use crate::{ Dao, Value, }; use serde_derive::{ Deserialize, Serialize, }; use std::slice; /// use this to store data retrieved from the database /// This is also slimmer than Vec<Dao> when serialized<|fim▁hole|> /// can be optionally set, indicates ...
#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)] pub struct Rows { pub columns: Vec<String>, pub data: Vec<Vec<Value>>,
<|file_name|>Classes.java<|end_file_name|><|fim▁begin|>package lesson.types; public class Classes { public static void main(String[] args) { JustClass one = new JustClass(); JustClass two = new JustClass(123, "sdf"); System.out.println(one); System.out.println(two); } } class...
@Override public String toString() { return String .format("JustClass {%s, %d}", name,number);
<|file_name|>mymedialite.py<|end_file_name|><|fim▁begin|>## # Copyright 2009-2021 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (ht...
# the Free Software Foundation v2. # # EasyBuild is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of
<|file_name|>Strategies.py<|end_file_name|><|fim▁begin|>from .. import NogginConstants from . import PBConstants from . import Formations def sReady(team, workingPlay): workingPlay.setStrategy(PBConstants.S_READY) Formations.fReady(team, workingPlay) def sNoFieldPlayers(team, workingPlay): workingPlay.set...
elif useFinder(team): Formations.fFinder(team, workingPlay)
<|file_name|>_mock-principal.service.ts<|end_file_name|><|fim▁begin|><%# Copyright 2013-2017 the original author or authors. This file is part of the JHipster project, see https://jhipster.github.io/ for more information. Licensed under the Apache License, Version 2.0 (the "License");<|fim▁hole|> You may obtain a...
you may not use this file except in compliance with the License.
<|file_name|>BaseDao.java<|end_file_name|><|fim▁begin|>package com.starfarers.dao; import java.util.List; public interface BaseDao<T> { public void create(T entity); public T save(T entity); public void save(List<T> entities); public void remove(T entity); public T find(Integer id); <|fim▁hole|>}<|fim▁end|>
public List<T> findAll(); public <P> T findBy(String attribute, P parameter);
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>mod sql_safe; pub use self::sql_safe::{SqlSafe, SQL_CHECK};<|fim▁end|>
//! This is documentation for the `mylib::sql::traits` module. //! //! # Examples
<|file_name|>ProxyConfig.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 required by ap...
public class ProxyConfig { private URI uri;
<|file_name|>errors.cc<|end_file_name|><|fim▁begin|>/** File errors.cc author Vladislav Tcendrovskii * Copyright (c) 2013 * This source subjected to the Gnu General Public License v3 or later (see LICENSE) * All other rights reserved * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY * OF ANY ...
<|file_name|>def_build_graph.py<|end_file_name|><|fim▁begin|>from networkx import DiGraph from networkx.readwrite import json_graph import cantera as ct import numpy as np import json #from src.core.def_tools import * import os __author__ = 'Xiang Gao' """ ---------------------------------------------- construction...
:param raw: type = dict, keys include "mole_fraction", "net_reaction_rate", etc :param traced_element: type = str
<|file_name|>authentication.service.ts<|end_file_name|><|fim▁begin|>/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file<|fim▁hole|> * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (t...
* distributed with this work for additional information
<|file_name|>show_tests.py<|end_file_name|><|fim▁begin|># coding=utf-8 # This file is part of SickChill. # # URL: https://sickchill.github.io # Git: https://github.com/SickChill/SickChill.git # # SickChill is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as ...
(False, ''): None, (False, '123'): None, (True, ''): None,
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>from django.contrib import admin from Blogs.models import(Post, Comment)<|fim▁hole|>admin.site.register(Comment)<|fim▁end|>
admin.site.register(Post)
<|file_name|>rsh_driver.cpp<|end_file_name|><|fim▁begin|>/* Copyright (C) 2011 Equinor ASA, Norway. The file 'rsh_driver.c' is part of ERT - Ensemble based Reservoir Tool. ERT is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by t...
} return has_option;
<|file_name|>index.js<|end_file_name|><|fim▁begin|><|fim▁hole|>module.exports = { Device: Device }<|fim▁end|>
'use strict' // import Device from './Device' let Device = require('./Device').Device
<|file_name|>SuperUglyNumber.java<|end_file_name|><|fim▁begin|>package problems; import java.util.Arrays; import java.util.PriorityQueue; /** * Leetcode: Super Ugly Number * Created by alan on 2/24/2016. */ public class SuperUglyNumber { class Node implements Comparable<Node> { int val; final i...
PriorityQueue<Node> pq = new PriorityQueue<>();
<|file_name|>test_template.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python #pylint: disable=missing-docstring #################################################################################################### # DO NOT MODIFY THIS HEADER # # ...
<|file_name|>gunicorn_config.py<|end_file_name|><|fim▁begin|># gunicorn configuration bind = '0.0.0.0:8000' workers = 3 # These log settings assume that gunicorn log config will be included in the django base.py logging configuration accesslog = '-'<|fim▁hole|>access_log_format = '{"request": "%(r)s", "http_status_co...
errorlog = '-'
<|file_name|>trait-implementations.rs<|end_file_name|><|fim▁begin|>// compile-flags:-Zprint-mono-items=eager #![deny(dead_code)] #![feature(start)] pub trait SomeTrait { fn foo(&self); fn bar<T>(&self, x: T); } impl SomeTrait for i64 { //~ MONO_ITEM fn <i64 as SomeTrait>::foo fn foo(&self) {} f...
}
<|file_name|>KURLCFNet.cpp<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2004, 2008 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must reta...
}
<|file_name|>test_param_methods.py<|end_file_name|><|fim▁begin|>""" Testing for enumerate_param, enumerate_params, and enumerate_keyed_param """ import unittest import mws # pylint: disable=invalid-name class TestParamsRaiseExceptions(unittest.TestCase): """ Simple test that asserts a ValueError is raised by ...
""" param = "something" values = ["this is not a dict like it should be!"] with self.assertRaises(ValueError):
<|file_name|>node_table.rs<|end_file_name|><|fim▁begin|>// Copyright 2015, 2016 Parity Technologies (UK) Ltd. // This file is part of Parity. // Parity 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...
if let Err(e) = file.write(&json.into_bytes()) {
<|file_name|>user_event_log_proxy.cc<|end_file_name|><|fim▁begin|>/* Copyright 2008 (C) Nicira, Inc. * * This file is part of NOX. * * NOX 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...
<|file_name|>commits.py<|end_file_name|><|fim▁begin|>#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2017, Anaconda, Inc. All rights reserved. # # Powered by the Bokeh Development Team. # # The full license is in the file LICENSE.txt, distributed with this software....
#----------------------------------------------------------------------------- # Dev API
<|file_name|>app-main.js<|end_file_name|><|fim▁begin|>/** * * Online store PWA sample.<|fim▁hole|> * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distribu...
* Copyright 2017 Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.
<|file_name|>cli.py<|end_file_name|><|fim▁begin|>import optparse from os import curdir from os.path import abspath import sys from autoscalebot.tasks import start_autoscaler from autoscalebot import version def main(args=sys.argv[1:]): CLI_ROOT = abspath(curdir) sys.path.insert(0, CLI_ROOT) parser = opt...
parser.add_option("--settings", dest="settings", default=None,
<|file_name|>htmlanchorelement.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::activation::Activatable; use dom::attr::A...
// https://html.spec.whatwg.org/multipage/#dom-hyperlink-hostname
<|file_name|>plotutils.py<|end_file_name|><|fim▁begin|>import numpy as nm try: import matplotlib.pyplot as plt import matplotlib as mpl except (ImportError, RuntimeError): plt = mpl = None #print 'matplotlib import failed!' from sfepy.base.base import output, pause def spy(mtx, eps=None, color='b', *...
mtx_dr = mtx_da.copy() mtx_dr.data[:] = -1 iin = nm.where( nm.abs( mtx1.data ) > eps )[0]
<|file_name|>Extension.py<|end_file_name|><|fim▁begin|>class Extension(object): """ Base class for creating extensions. Args: kwargs[dict]: All key, value pairings are stored as "configuration" options, see getConfigs. """ def __init__(self, **kwargs): #: Configure options self._configs = kwargs...
<|file_name|>0059_session_has_finished.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Generated by Django 1.11.8 on 2017-12-18 07:22 from __future__ import unicode_literals from django.db import migrations, models<|fim▁hole|> dependencies = [ ('exams', '0058_fill_explanation_is_contribution'), ...
class Migration(migrations.Migration):
<|file_name|>shader.rs<|end_file_name|><|fim▁begin|>use gl; use version::Version; use version::Api; use CapabilitiesSource; use backend::Facade; use context::Context; use ContextExt; use std::{ffi, mem, ptr}; use std::rc::Rc; use GlObject; use Handle; use program::ProgramCreationError; /// A single, compiled but u...
match id {
<|file_name|>client.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- __author__ = 'mkaplenko' import httplib import time class MobilMoneySms(object): def __init__(self, phone_to, message): self.phone_to = phone_to<|fim▁hole|> self.message = message self.sync = int(time.time()*100) ...