prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>tags.test.ts<|end_file_name|><|fim▁begin|>import { KeyAuthPlugin, xKongPluginKeyAuth } from '../types/kong'; import { getSpec, tags } from './jest/test-helpers'; import { generatePlugins } from './plugins'; import { generateServices } from './services'; import { generateUpstreams } from './upstreams'; des...
});
<|file_name|>compositedataelemspec.go<|end_file_name|><|fim▁begin|>package handlers import ( "github.com/bbiskup/edify-web/defs" "github.com/gorilla/mux" "html/template" "log" "net/http" ) <|fim▁hole|>func init() { funcMap := template.FuncMap{ "DataElemSpecURL": DataElemSpecURL, } t := template.New("layout.h...
var compositeDataElemSpecTemplates *template.Template
<|file_name|>rest.go<|end_file_name|><|fim▁begin|>package server import ( "io" "io/ioutil" "log" "net/http" ) type Rest struct { channels map[string]*Channel } func NewRestServer(server *Server) *Rest { return &Rest{server.channels} }<|fim▁hole|> return func(w http.ResponseWriter, r *http.Request) { if r...
func (self *Rest) PostOnly(h http.HandlerFunc) http.HandlerFunc {
<|file_name|>stdio.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/...
use slice::ImmutableVector; use str::StrSlice; use uint;
<|file_name|>irs.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from BJFinanceLib.instruments.swapleg import SwapLegFixed, SwapLegFloating from BJFinanceLib.objects.cashflowschedule import CashflowSchedule from numbers import Number class IRS(): pass class IRSFixedForFloat(): @staticmethod def...
if payerReceiverFlag in ['p','pay','pay fixed','payer','fixed','fixed payer']: return 1.0 elif payerReceiverFlag in ['r','rec','receiver','floating', 'pay floating','floating payer']:
<|file_name|>securitygroup.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 # # ...
class SecurityGroupMissingIcmpType(exceptions.InvalidInput):
<|file_name|>size.py<|end_file_name|><|fim▁begin|>item_id = 4986168 user_id = 20000 item_category = 9656<|fim▁hole|><|fim▁end|>
time = 31
<|file_name|>sound.js<|end_file_name|><|fim▁begin|>'use strict'; define([ 'three', 'explorer', 'underscore' ], function( THREE, Explorer, _ ) { var mp3names = ['crystalCenter', 'cellCollision', 'atomCollision', 'popOutOfAtom', 'dollHolder', 'atomUnderDoll', 'navCube', 'dollArrived', 'leapGrab', 'leapN...
_this.play('crystalCenter', centroid, true); },2000);
<|file_name|>submission.py<|end_file_name|><|fim▁begin|>import logging import tmlib.models as tm class SubmissionManager(object): '''Mixin class for submission and monitoring of computational tasks.''' def __init__(self, experiment_id, program_name): ''' Parameters<|fim▁hole|> experim...
----------
<|file_name|>problem7.py<|end_file_name|><|fim▁begin|># Problem 7 # 20.0 points possible (graded) # Write a function called general_poly. def general_poly(L): """ L, a list of numbers (n0, n1, n2, ... nk) Returns a function, which when applied to a value x, returns the value n0 * x^k + n1 * x^(k-1) + ... nk * x^...
value = 0
<|file_name|>stats_bootstrap.py<|end_file_name|><|fim▁begin|>import random from math import sqrt import numpy def validate_cost(result, boot_size, delta=500): budget = result["budget"] for metric_name, _, data_process in result['analysis']: if metric_name == "cost": cost_data = list(x() fo...
<|file_name|>notifycli.go<|end_file_name|><|fim▁begin|>package main import ( "bytes" "fmt" "os" "strings" "github.com/chzyer/flagx" "github.com/jj-io/jj/rpc" "github.com/jj-io/jj/rpc/rpcenc" "github.com/jj-io/jj/rpc/rpclink" "github.com/jj-io/jj/rpc/rpcmux" "github.com/jj-io/readline" "gopkg.in/logex.v1" )...
packet := &rpc.Packet{ Meta: rpc.NewReqMeta(path),
<|file_name|>unique-assign.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<|fim▁hole|>// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the...
// http://rust-lang.org/COPYRIGHT. //
<|file_name|>forms.py<|end_file_name|><|fim▁begin|>from django import forms from django.utils.translation import ugettext_lazy as _ from django_summernote.widgets import SummernoteInplaceWidget from crispy_forms.helper import FormHelper from crispy_forms.layout import Submit from .models import Speaker, Program class...
self.helper.add_input(Submit('submit', _('Submit'))) class Meta: model = Speaker
<|file_name|>resource_aws_load_balancer_backend_server_policy.go<|end_file_name|><|fim▁begin|>package aws import ( "fmt" "strconv" "strings" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/service/elb" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" )...
<|file_name|>create_terrain.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python ''' create ardupilot terrain database files ''' from MAVProxy.modules.mavproxy_map import srtm import math, struct, os, sys import crc16, time, struct # MAVLink sends 4x4 grids TERRAIN_GRID_MAVLINK_SIZE = 4 # a 2k grid_block on disk co...
ref_lat = self.lat_degrees*10*1000*1000 ref_lon = self.lon_degrees*10*1000*1000
<|file_name|>ErrorCodes.cpp<|end_file_name|><|fim▁begin|>#include "ErrorCodes.h" <|fim▁hole|>{ return {static_cast<int>(ec), simblockErrCategory}; }<|fim▁end|>
std::error_code make_error_code(SimBlockErrc ec)
<|file_name|>bench_walk.py<|end_file_name|><|fim▁begin|>"""Benchmark Walk algorithm""" import numpy as np import bench import obsoper.walk<|fim▁hole|>class BenchmarkWalk(bench.Suite): def setUp(self): longitudes, latitudes = np.meshgrid([1, 2, 3], [1, 2, 3], ...
<|file_name|>lift.rs<|end_file_name|><|fim▁begin|>#![allow(dead_code, unused)] #![feature(type_ascription)] use std::collections::linked_list::LinkedList; use std::collections::vec_deque::VecDeque; use std::collections::{BinaryHeap, BTreeSet, HashSet}; pub trait Higher<A> { type B; //current type inside higher typ...
lift!(Box); lift!(LinkedList);
<|file_name|>cardinality.py<|end_file_name|><|fim▁begin|># Copyright 2015, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without<|fim▁hole|># modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must re...
<|file_name|>ticker.rs<|end_file_name|><|fim▁begin|>// Copyright (c) 2015-2017 Ivo Wetzel // 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 b...
Ticker { tick_start: Instant::now(), tick_overflow: 0, tick_overflow_recovery: config.tick_overflow_recovery,
<|file_name|>Card.js<|end_file_name|><|fim▁begin|>"use strict"; var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard"); var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.defaul...
var _useThemeProps = _interopRequireDefault(require("../styles/useThemeProps"));
<|file_name|>indexing.rs<|end_file_name|><|fim▁begin|>use numeric::Tensor; macro_rules! add_impl { ($t:ty, $m:ident) => ( mod $m { use numeric::Tensor; type T = Tensor<$t>; /* #[test] fn indexing() { let t = T::range(6); ...
assert_eq!(t.unravel_index(33), vec![0, 1, 0, 3]);
<|file_name|>liballoc_arc.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 //// http://...
//// /// Drops the `Weak` pointer. //// ///
<|file_name|>_SplitView.ts<|end_file_name|><|fim▁begin|>// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License.txt in the project root for license information. /// <reference path="../../../../../typings/require.d.ts" /> import Animations = require('../../Animations')...
// 30% of the size change instantly and then animate the other 70%) var animationOffsetFactor = 0.3;
<|file_name|>test_location.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*- """Test class for Locations UI""" from fauxfactory import gen_ipaddr, gen_string from nailgun import entities from robottelo.config import settings from robottelo.datafactory import generate_strings_list, invalid_values_list from robo...
self.assertIsNotNone(element) @run_only_on('sat')
<|file_name|>cs_send.cpp<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2008-2017 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version...
} }
<|file_name|>024_event_resource_name.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 # # Unl...
event.c.logical_resource_id.alter(name='resource_name')
<|file_name|>ValidatorConstraintTests.java<|end_file_name|><|fim▁begin|>package org.codehaus.groovy.grails.validation; import groovy.lang.Closure; import groovy.lang.GroovyShell; /** * Test cases for custom 'validator' constraint. * * @author Sergey Nebolsin (<a href="mailto:nebolsin@gmail.com"/>) */ pu...
getConstraint("{val,obj -> return ['test.message', 'arg', 123L]}"), "test",
<|file_name|>print_cfg.rs<|end_file_name|><|fim▁begin|>//! The `print-cfg` sub-command. //! //! Read a series of Cranelift IR files and print their control flow graphs<|fim▁hole|>use crate::utils::read_to_string; use crate::CommandResult; use cranelift_codegen::cfg_printer::CFGPrinter; use cranelift_reader::parse_funct...
//! in graphviz format.
<|file_name|>rest_fewspi.py<|end_file_name|><|fim▁begin|>import json import requests import types import pandas as pd from datetime import datetime, date import gzip import io from ..utils.simplenamespace import * from ..utils.query_helper import query from ..utils.pi_helper import * import collections class PiRest(...
<|file_name|>droptarget.py<|end_file_name|><|fim▁begin|>__author__ = 'Exter, 0xBADDCAFE' import wx class FTDropTarget(wx.DropTarget): """ Implements drop target functionality to receive files and text receiver - any WX class that can bind to events evt - class that comes from wx.lib.newevent.NewComm...
drop_type = self.composite.GetReceivedFormat().GetType()
<|file_name|>ZoomingTextLabelsViewer.java<|end_file_name|><|fim▁begin|>package edu.cmu.minorthird.text.gui; import edu.cmu.minorthird.text.FancyLoader; import edu.cmu.minorthird.text.TextLabels; import edu.cmu.minorthird.util.gui.ControlledViewer; import edu.cmu.minorthird.util.gui.VanillaViewer; import edu.cmu.minort...
public ZoomingTextLabelsViewer(TextLabels labels){ Viewer zoomedOut=new ControlledViewer(new TextLabelsViewer(labels),new MarkupControls(labels)); Viewer zoomedIn=new VanillaViewer("[Empty TextBase]");
<|file_name|>ModalBox.tsx<|end_file_name|><|fim▁begin|>import React from 'react' import styled from 'styled-components' const StyledModalBox = styled.div` background-color: #ffffff; display: flex; flex-direction: column; justify-content: space-between; height: 100%; width: 100%; overflow-y:...
</StyledModalBox> )
<|file_name|>RootCursusModel.js<|end_file_name|><|fim▁begin|>Ext.define('ExtJsMVC.model.cursus.RootCursusModel', { <|fim▁hole|> ], childType : 'ExtJsMVC.model.cursus.CursusModel' });<|fim▁end|>
extend : 'Ext.data.TreeModel', fields : [ {name: 'itemId'}, {name: 'name'}
<|file_name|>app.py<|end_file_name|><|fim▁begin|><|fim▁hole|>subreddit = 'technology' t_channel = '@r_technology' def send_post(submission, r2t): return r2t.send_simple(submission)<|fim▁end|>
#encoding:utf-8
<|file_name|>test_models.py<|end_file_name|><|fim▁begin|>from django.conf.global_settings import PASSWORD_HASHERS from django.contrib.auth import get_user_model from django.contrib.auth.hashers import get_hasher from django.contrib.auth.models import ( AbstractUser, Group, Permission, User, UserManager, ) from djan...
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- # Distutils installer for PyJack # Test for Jack2 #---------------------------------------------------# import os if os.path.exists("/usr/local/include/jack/jack.h"): path = "/usr/local/include/jack/jack.h" elif os.path.exis...
)
<|file_name|>start.rs<|end_file_name|><|fim▁begin|>// STD Dependencies -----------------------------------------------------------<|fim▁hole|> // Discord Dependencies ------------------------------------------------------- use discord::model::{ChannelId, ServerId}; // Internal Dependencies --------------------------...
use std::fmt;
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages import sys # Define required packages. requires = [] # Assume spidev is required on non-windows & non-mac platforms (i.e. linux). if sys.platform != 'win32' and sys.platf...
setup(name = 'Adafruit_GPIO', version = '0.8.0', author = 'Tony DiCola',
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # -*- coding: utf-8 -*- import os import json from flask import Flask app = Flask(__name__) app.config.from_object(__name__) # Loads the restaurants RESTAURANTS = {} with open('./refuge/var/restaurants.json', 'r') as f: RESTAURANTS = js...
jc_decaux_api_key = os.environ.get('JCDecauxAPIKEY', None) openrouteservice_api_key = os.environ.get('openrouteserviceAPIKEY', None)
<|file_name|>regress-509961.js<|end_file_name|><|fim▁begin|>// Copyright 2015 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. var o = { x: 0 }; delete o.x; function store(o, p, v) { o[p] = v; } store(o, "x", 1);<|fim▁h...
store(o, "x", 1); store(o, "0", 1);
<|file_name|>XMPCommonFwdDeclarations_8h.js<|end_file_name|><|fim▁begin|>var XMPCommonFwdDeclarations_8h = [ [ "cIUTF8Strings", "XMPCommonFwdDeclarations_8h.html#aae5dbe164f71188aa24c87fa6306539a", null ], [ "IConfigurationManager_base", "XMPCommonFwdDeclarations_8h.html#ab6a71f81b4e3c8e5d2d0c90f82fbee08", null...
<|file_name|>iconunix.go<|end_file_name|><|fim▁begin|>//+build linux darwin // File generated by 2goarray (http://github.com/cratonica/2goarray) package main var iconData []byte = []byte { 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x48, 0x00,...
0xfe, 0x59, 0x60, 0xd1, 0xdb, 0x08, 0xb2, 0x05, 0x21, 0xd0, 0x16, 0x88, 0x00, 0x5b, 0x00, 0xfc, 0xad, 0x84, 0x65, 0xf5, 0x83, 0xd1, 0x62, 0x84,
<|file_name|>app.js<|end_file_name|><|fim▁begin|>/** * vue app * Created by HC on 2016/7/19. */ var header = Vue.extend({ template: '#header' }); // 全局注册组件 Vue.component('my-header', header); var footer = Vue.extend({ template: '#footer' }); // 全局注册组件 Vue.component('my-footer', footer); var index = Vue.ex...
component: footer } });
<|file_name|>basic.js<|end_file_name|><|fim▁begin|>(function (factory) { if (typeof define === 'function') { if(define.amd) { define(['common/metastore', 'jslet', 'mock/employee-mock'], factory); } else { define(function(require, exports, module) { module.exports = factory(); ...
jslet('#tblEmployee').fixedCols(count).renderAll();
<|file_name|>fractions_limit_denominator.py<|end_file_name|><|fim▁begin|>import fractions import math<|fim▁hole|>print('PI =', math.pi) f_pi = fractions.Fraction(str(math.pi)) print('No limit =', f_pi) for i in [1, 6, 11, 60, 70, 90, 100]: limited = f_pi.limit_denominator(i) print('{0:8} = {1}'.format(i...
<|file_name|>format_iaga02.py<|end_file_name|><|fim▁begin|>""" MagPy IAGA02 input filter Written by Roman Leonhardt June 2012 - contains test, read and write function """ from __future__ import print_function from __future__ import unicode_literals from __future__ import absolute_import from __future__ import division ...
<|file_name|>performance.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::bindings::cell::DomRefCell; use crate::d...
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licens...
FIXME (#2810): hygiene. Search for "__" strings (in other files too).
<|file_name|>middleware.py<|end_file_name|><|fim▁begin|>from django.conf import settings from django.contrib.auth.models import AnonymousUser import commonware.log import waffle from users.models import UserProfile from .models import Access from .oauth import OAuthServer log = commonware.log.getLogger('z.api') ...
<|file_name|>pre-processor.js<|end_file_name|><|fim▁begin|>import {FkJsListener} from './antlr/FkJsListener'; import {FkJsParser} from './antlr/FkJsParser'; /** * Obtains a list of modes and mixins from a .fk * file, as well as other information. */ export default class PreProcessor extends FkJsListener { /** ...
enterModeDecl(ctx) {
<|file_name|>common.js<|end_file_name|><|fim▁begin|>jQuery.fn.nextInArray = function(element) { var nextId = 0; for(var i = 0; i < this.length; i++) { if(this[i] == element) { nextId = i + 1; break; } } if(nextId > this.length-1) nextId = 0; return thi...
keys[0] = keys[0].substr(0, j) + '_' + keys[0].substr(j + 1); }
<|file_name|>FlowSnapshotClient.java<|end_file_name|><|fim▁begin|>/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You ...
/** * Gets the latest snapshot metadata for the given flow.
<|file_name|>Solution.java<|end_file_name|><|fim▁begin|>import java.util.Scanner; /** * @author Oleg Cherednik * @since 04.08.2018 */ public class Solution { static class SinglyLinkedListNode { public int data; public SinglyLinkedListNode next; public SinglyLinkedListNode(int nodeData...
} scanner.close();
<|file_name|>Settings.js<|end_file_name|><|fim▁begin|>export const DEFAULTS = { API_BASE_URI: 'http://localhost:3000/axway', granularity: 'monthly', startDate: '2010-01-01', cacheExpirySeconds: 300//5 minutes }; export class Settings { /** * @param {string} setting * @returns {*} */...
export default new Settings;
<|file_name|>util.rs<|end_file_name|><|fim▁begin|>use std::io::{Cursor, Read}; use std::io; use psoserial::Serial; use psomsg::util::*; static COLOR_RED: &'static str = "\x1B[31m"; static COLOR_RESET: &'static str = "\x1B[0m"; /// Creates a 3-column view of the buffer with index, bytes, and ASCII /// representation....
// write the next 16 bytes let leftover; let end = { if array.len() > row * 16 + 16 {
<|file_name|>index.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
//= require ./map
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
from module import *
<|file_name|>CustomTabsAndroid.js<|end_file_name|><|fim▁begin|>/** * @private * @providesModule CustomTabsAndroid * @flow<|fim▁hole|>import type { TabOption } from './TabOption'; const CustomTabsManager = NativeModules.CustomTabsManager; /** * To open the URL of the http or https in Chrome Custom Tabs. * If Chro...
*/ 'use strict'; import { NativeModules } from 'react-native';
<|file_name|>disk_get_parameters.go<|end_file_name|><|fim▁begin|>// Code generated by go-swagger; DO NOT EDIT. package storage // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command import ( "context" "net/http" "time" "github.com/go-...
} }
<|file_name|>console.go<|end_file_name|><|fim▁begin|>// Copyright 2015 The go-earthdollar Authors // This file is part of the go-earthdollar library. // // The go-earthdollar library is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by //...
return nil }
<|file_name|>test.py<|end_file_name|><|fim▁begin|>from test_support import check_output_file, prove_all <|fim▁hole|><|fim▁end|>
prove_all() check_output_file(sort=True)
<|file_name|>LPWSANSCLASSINFO.hpp<|end_file_name|><|fim▁begin|>// This file auto generated by plugin for ida pro. Generated code only for x64. Please, dont change manually<|fim▁hole|>#include <common/common.h> #include <_WSANSClassInfoA.hpp> START_ATF_NAMESPACE typedef _WSANSClassInfoA *LPWSANSCLASSINFO; END_ATF_...
#pragma once
<|file_name|>block.py<|end_file_name|><|fim▁begin|># coding=utf-8 # Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache....
<|file_name|>NSEC3PARAM.py<|end_file_name|><|fim▁begin|># Copyright (C) 2004-2007, 2009-2011 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notic...
import binascii import dns.exception
<|file_name|>TreeLogger.java<|end_file_name|><|fim▁begin|>package antw.logger; import java.util.Date; import org.apache.tools.ant.BuildEvent; import antw.common.util.Constants; import antw.common.util.StringUtil; import antw.common.util.TimeUtil; import antw.logger.model.Project; import antw.logger.model.Target; pu...
space(_spaceCount + 1); out(project.getName()); }
<|file_name|>glue.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 cssparser::Parser; use cssparser::ToCss a...
<|file_name|>convert_to_constraints.js<|end_file_name|><|fim▁begin|>/** * Copyright 2012-2018, Plotly, Inc. * All rights reserved. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ 'use strict'; var Lib = require('../../lib'); // The cont...
break; } };
<|file_name|>test.js<|end_file_name|><|fim▁begin|>function main() { var N = 10000; var lines = generateLines(N); //timeCanvas2D(lines, N); timeBatchDraw(lines, N); } function generateLines(N) { var lines = new Array(N); let canvas = document.getElementById("canvas"); let w = canvas.width;...
console.timeEnd("Canvas2D"); }
<|file_name|>app_config.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """ Project-wide application configuration. DO NOT STORE SECRETS, PASSWORDS, ETC. IN THIS FILE. They will be exposed to users. Use environment variables instead. See get_secrets() below for a fast way to access them. """ import os """ NAM...
S3_BUCKET = None
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>//! This crate provides an interface, `Shifter` that makes it trivially easy to //! manipulate [shift registers][4] with a Raspberry Pi (thanks to [CuPi][1]). //! Internally it keeps track of each shift register's state, allowing you to //! manipulate each pin individual...
} } self.clock.high().unwrap(); }
<|file_name|>Bootstrap.java<|end_file_name|><|fim▁begin|>package com.djtu.signExam.util; import java.io.IOException; import com.djtu.signExam.model.support.EntityGenerator; /** * use this class to bootstrap the project. * There is no need for developers to write model classes themselves. * Once there are some upd...
} catch (IOException e) { e.printStackTrace();
<|file_name|>poll.rs<|end_file_name|><|fim▁begin|>/// A macro for extracting the successful type of a `Poll<T, E>`. /// /// This macro bakes propagation of both errors and `NotReady` signals by /// returning early. #[macro_export] macro_rules! try_ready { ($e:expr) => (match $e { Ok($crate::Async::Ready(t))...
impl<T> AsyncSink<T> {
<|file_name|>stix_transform.py<|end_file_name|><|fim▁begin|># Copyright (C) 2013 Johnny Vestergaard <jkv@unixcluster.dk> # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of t...
<|file_name|>random_points_on_a_circle.py<|end_file_name|><|fim▁begin|><|fim▁hole|> import os from collections import defaultdict from random import choice world = defaultdict(int) possiblepoints = [(x, y) for x in range(-15, 16) for y in range(-15, 16) if 10 <= abs(x + y * 1j) <= 1...
# -*- coding: utf-8 -*-
<|file_name|>bfe_photo_resources_brief.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2006, 2007, 2008, 2010, 2011 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## publi...
"""BibFormat element - Prints brief HTML picture and links to resources
<|file_name|>QueryThirdpartyAlertResult.java<|end_file_name|><|fim▁begin|>package org.zstack.sdk.zwatch.thirdparty.api; public class QueryThirdpartyAlertResult { public java.util.List inventories; public void setInventories(java.util.List inventories) { this.inventories = inventories;<|fim▁hole|> ...
} public java.util.List getInventories() { return this.inventories; }
<|file_name|>simul.py<|end_file_name|><|fim▁begin|>#!/usr/env python3 try: import numpypy as np except: import numpy as np try: import cPickle as pickle except ImportError: import pickle #import ipdb ## Tri Diagonal Matrix Algorithm(a.k.a Thomas algorithm) solver def TDMAsolver(a, b, c, d): ''' ...
- amp(abs(old[n]))) out = "".join([ gr(self.T, self.T_old,n) + "\t" + gr(self.omega, self.omega_old,n) + "\t" +
<|file_name|>test_workspace.py<|end_file_name|><|fim▁begin|>from mock import patch from unittest import TestCase from whitefly.models.workspace import Workspace def always_true(instance): return True def always_false(instance): return False class TestWorkspace(TestCase): @patch('os.path.isdir') de...
ret = workspace.workspace_config_exists()
<|file_name|>export-bugzilla.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python -t __requires__ = 'TurboGears' import pkg_resources pkg_resources.require('CherryPy >= 2.0, < 3.0alpha') import logging logging.basicConfig() import os import sys import getopt import xmlrpclib import smtplib from email.Message import Mess...
smtp = smtplib.SMTP(MAILSERVER) smtp.sendmail(ADMINEMAIL, recipients, msg.as_string()) smtp.quit()
<|file_name|>main.py<|end_file_name|><|fim▁begin|>import json import random import ssl import string import threading import time import websocket import settings<|fim▁hole|> class WebsocketPlayerControl(object): def __init__(self, player, server=settings.WS_SERVER): websocket.enableTrace(settings.DEBUG)...
from player import Player
<|file_name|>workbook_definition.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # Copyright 2013 - Mirantis, 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 # # ...
from pecan import request from mistral.openstack.common import log as logging from mistral.db import api as db_api
<|file_name|>signals.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2015 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either vers...
after_record_update = _signals.signal('after-record-update') """Signal sent after a record is updated."""
<|file_name|>exclusive_limit_state_machine.ts<|end_file_name|><|fim▁begin|>/**<|fim▁hole|> */ import { InstantiateObjectOptions } from "../address_space_ts"; import { StateMachine, StateMachineType } from "./state_machine"; // tslint:disable-next-line:no-empty-interface export interface ExclusiveLimitStateMachine exte...
* @module node-opcua-address-space
<|file_name|>celery.py<|end_file_name|><|fim▁begin|>import os from celery import Celery from django.apps import apps, AppConfig from django.conf import settings if not settings.configured: # set the default Django settings module for the 'celery' program. os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'confi...
<|file_name|>q3_2.py<|end_file_name|><|fim▁begin|>test = { 'name': '', 'points': 1, 'suites': [ { 'cases': [ { 'code': r""" >>> type(imdb_by_year) == tables.Table True >>> imdb_by_year.column('Title').take(range(3)) array(['The Kid (1921)', 'The ...
],
<|file_name|>express-config.js<|end_file_name|><|fim▁begin|>/* * This file exports the configuration Express.js back to the application * so that it can be used in other parts of the product. */ var path = require('path'); var logger = require('morgan'); var cookieParser = require('cookie-parser');<|fim▁hole|> exp...
var bodyParser = require('body-parser'); var session = require('express-session'); var RedisStore = require('connect-redis')(session);
<|file_name|>dnp3-gen.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # # Copyright (C) 2015 Open Information Security Foundation # # You can copy, redistribute or modify this Program under the terms of # the GNU General Public License version 2 as published by the Free # Software Foundation. # # This program is...
if (!DNP3ReadUint8(buf, len, &object->{{field.name}})) { goto error; } {% elif field.type == "uint16" %}
<|file_name|>mixins.py<|end_file_name|><|fim▁begin|>from djangorestframework.mixins import ModelMixin, CreateModelMixin, \ UpdateModelMixin from djangorestframework_extensions.utils import user_passes_test __all__ = ['RoleBasedExclusion', 'RestrictedModelMixin', 'RestrictedCreateModelMixin', 'RestrictedUpdateM...
return fields
<|file_name|>sidenav.d.ts<|end_file_name|><|fim▁begin|>export declare const MAT_DRAWER_DEFAULT_AUTOSIZE: InjectionToken<boolean>; export declare function MAT_DRAWER_DEFAULT_AUTOSIZE_FACTORY(): boolean; export declare class MatDrawer implements AfterContentInit, AfterContentChecked, OnDestroy { _animationEnd: Subj...
_animationStartListener(event: AnimationEvent): void; close(): Promise<MatDrawerToggleResult>;
<|file_name|>base_classes.cc<|end_file_name|><|fim▁begin|>// { dg-do compile } // 2001-08-27 Benjamin Kosnik <bkoz@redhat.com><|fim▁hole|>// 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, or (at...
// Copyright (C) 2001, 2003, 2009 Free Software Foundation // // This file is part of the GNU ISO C++ Library. This library is free
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>pub mod pipeline;<|fim▁end|>
//! A collection of components for rapid protocol development
<|file_name|>llrepr.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/licenses...
impl LlvmRepr for Type { fn llrepr(&self, ccx: &CrateContext) -> String { ccx.tn().type_to_string(*self)
<|file_name|>cfi_frame_info_unittest.cc<|end_file_name|><|fim▁begin|>// Copyright (c) 2010, Google 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: // // * Redistributions of source...
} TEST_F(Parser, RA) {
<|file_name|>admin.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
#from django.contrib import admin
<|file_name|>Experiments.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Author: Thomas Beucher Module: Experiments Description: Class used to generate all the trajectories of the experimental setup and also used for CMAES optimization ''' import numpy as np import time #from Utils...
self.costStore.append([xy[0], xy[1], meanCost]) self.trajTimeStore.append([xy[0], xy[1], meanTrajTime]) globMeanCost+=meanCost globTimeCost+=meanTrajTime
<|file_name|>test.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import base64 import inspect import json import logging import requests import types from django.conf import settings from django.core.management import call_command from django_nose import FastFixtureTestCase from functools import wraps from mo...
if get_setting('API_URL', None): try: func_type = types.UnboundMethodType except:
<|file_name|>_base_test.py<|end_file_name|><|fim▁begin|>import numpy as np import unittest import logging class _BaseTest(unittest.TestCase): # def energy_test(self, x, e): # e = self.pot.getEnergy(x) # print e # self.assertAlmostEqual(e, self.target_E, 4) def grad_t(self, x): ...
numerical_g = self.pot.NumericalDerivative(x) log.debug( "g= %r", g ) log.debug( "numerical_g= %r", numerical_g )
<|file_name|>Fog.js<|end_file_name|><|fim▁begin|>ml.module('three.scenes.Fog') .requires('three.Three', 'three.core.Color') .defines(function(){ /**<|fim▁hole|> * @author alteredq / http://alteredqualia.com/ */ THREE.Fog = function ( hex, near, far ) { this.color = new THREE.Color( hex ); this.near = (...
* @author mrdoob / http://mrdoob.com/