prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>transactional_messaging.py<|end_file_name|><|fim▁begin|>""" handlers for transactional messaging service """ import json # tornado imports from tornado.queues import Queue from tornado import websocket, gen, web #local imports from settings import DEBUG #================================================...
print('[channel]: started connection')
<|file_name|>JuniperFamily.java<|end_file_name|><|fim▁begin|>package org.batfish.datamodel.vendor_family.juniper; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.annotations.VisibleForTesting; import java.io.Serializable; import java.util.Collections; import java.util.SortedMap; import j...
@JsonProperty(PROP_TACPLUS_SERVERS) public void setTacplusServers(SortedMap<String, TacplusServer> tacplusServers) { _tacplusServers = tacplusServers;
<|file_name|>browser.js<|end_file_name|><|fim▁begin|>/** * Super-Cache for Browser * * @author Zongmin Lei <leizongmin@gmail.com> */ var CacheManager = require('./lib/manager'); var MemoryStore = require('./lib/store/memory'); var LocalStore = require('./lib/store/local'); module.exports = exports = CacheManager...
// ADM mode
<|file_name|>BuildImages.py<|end_file_name|><|fim▁begin|>''' Created on Jan 6, 2013 __author__ = "Elizabeth 'pidge' Flanagan" __copyright__ = "Copyright 2012-2013, Intel Corp." __credits__ = ["Elizabeth Flanagan"] __license__ = "GPL" __version__ = "2.0" __maintainer__ = "Elizabeth Flanagan" __email__ = "elizabeth.flan...
from buildbot.steps.shell import ShellCommand from buildbot.process.buildstep import LogLineObserver
<|file_name|>util.go<|end_file_name|><|fim▁begin|>package context import ( "context" "time" ) // Since looks up key, which should be a time.Time, and returns the duration // since that time. If the key is not found, the value returned will be zero. // This is helpful when inferring metrics related to context execut...
if startedAt, ok := ctx.Value(key).(time.Time); ok { return time.Since(startedAt) }
<|file_name|>id.service.ts<|end_file_name|><|fim▁begin|>import {TreeNode} from '../index' <|fim▁hole|><|fim▁end|>
export abstract class IdService { generateUniqueId: (node:TreeNode) => string; }
<|file_name|>template.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- """Template""" from os import path import jinja2 from jinja2 import FileSystemLoader, ChoiceLoader from jinja2.exceptions import TemplateNotFound import peanut from peanut.utils import get_resource class SmartLoade...
<|file_name|>core.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, division, print_function from itertools import chain from dynd import nd import datashape from datashape.internal_utils import IndexCallable from datashape import discover from functools import partial from ..dispatch import disp...
return self.dshape.subarray(1) raise TypeError('Datashape is not indexable to schema\n%s' %
<|file_name|>WheelWidget.java<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2008-2011, Matthias Mann * * 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...
} } @Override
<|file_name|>StringPool.java<|end_file_name|><|fim▁begin|>/* * Copyright 2012, 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 code must r...
package org.jf.dexlib2.writer.pool; import org.jf.dexlib2.iface.reference.StringReference; import org.jf.dexlib2.writer.StringSection;
<|file_name|>receipt.go<|end_file_name|><|fim▁begin|>// Copyright 2014 The go-krypton Authors // This file is part of the go-krypton library. // // The go-krypton 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 // the Free So...
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>#![deny(trivial_casts, trivial_numeric_casts)] extern crate byteorder; #[macro_use] extern crate clap; #[macro_use] extern crate enum_primitive; extern crate num; extern crate rand; extern crate sdl2; extern crate time; use std::fs::File; use std::io::Read; use clap::...
<|file_name|>MainController.js<|end_file_name|><|fim▁begin|>/* * The MIT License (MIT) * * Copyright (c) 2014 Marcel Mika, marcelmika.com * * 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 Softw...
/** * The initializer runs when a MainController instance is created, and gives
<|file_name|>ui.flow.js<|end_file_name|><|fim▁begin|>/*requires core.js*/ /*requires load.js*/ /*requires ajax.js*/ /*requires dom.js*/ /*requires selector.js*/ /*requires ua.js*/ /*requires event.js*/ /*requires ui.js*/ /*requires ui.tab.js*/ /*requires ui.slide.js*/ /*requires ui.nav.js*/ /** * nova.ui.flow * 在页面中四...
<|file_name|>example.js<|end_file_name|><|fim▁begin|>import {Component} from 'react' export class Greeter { constructor (message) { this.greeting = message; } greetFrom (...names) { let suffix = names.reduce((s, n) => s + ", " + n.toUpperCase()); return "Hello, " + this.greeting + " from " + suffix;...
new Greeter("foo").greetNTimes({name: "Webstorm", times: 3})
<|file_name|>f32.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/LI...
impl Default for f32 { #[inline] fn default() -> f32 { 0.0 }
<|file_name|>panes.py<|end_file_name|><|fim▁begin|># =============================================================================== # Copyright 2015 Jake Ross # # 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 o...
) return MenuManager( Action(name="Add Unknowns", action="add_data"),
<|file_name|>find.js<|end_file_name|><|fim▁begin|>var db= require('../../db'); var test = require('assert'); var create; var createEmbeded; var createOne; var createOneEmbeded; var find; var findEmbeded; var findOne; var findOneEmbeded; describe('core',function () { before(function (done) { db.connect(function ()...
});
<|file_name|>itemlist-uploader.js<|end_file_name|><|fim▁begin|>/** * Copyright (C) SiteSupra SIA, Riga, Latvia, 2015 * * 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 th...
target = itemlist.get('iframe').one('.supra-itemmanager-wrapper');
<|file_name|>IntroduceGroupByForSubplanRule.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_name|>InterlevelScene.java<|end_file_name|><|fim▁begin|>/* * Pixel Dungeon * Copyright (C) 2012-2014 Oleg Dolya * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 o...
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, division, print_function, unicode_literals import string import urllib try: from urllib.parse import urlparse, urlencode, urljoin, parse_qsl, urlunparse from urllib.request import urlopen, Request from urllib.error im...
:type base: str ::param additional_params: Additional query parameters to include. :type additional_params: dict
<|file_name|>AudioCore.cpp<|end_file_name|><|fim▁begin|>/* * AudioCore.c: Implements the JNi interface and handles * * (C) Copyright 2015 Simon Grätzer * Email: simon@graetzer.org * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as...
* Method: stop * Signature: ()V */
<|file_name|>scroll.js<|end_file_name|><|fim▁begin|>// Copyright 2013 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. // Scroll handling. // // Switches the sidebar between floating on the left and position:fixed // depe...
(function() {
<|file_name|>WMTSGetFeatureInfo.js<|end_file_name|><|fim▁begin|>/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for * full list of contributors). Published under the 2-clause BSD license. * See license.txt in the OpenLayers distribution or repository for the * full text of the license. */ /*...
* Method: getInfoForClick
<|file_name|>MeshLambertMaterial.js<|end_file_name|><|fim▁begin|>/** * @author mrdoob / http://mrdoob.com/ * @author alteredq / http://alteredqualia.com/ * * parameters = { * color: <hex>, * opacity: <float>, * * map: new THREE.Texture( <Image> ), * * lightMap: new THREE.Texture( <Image> ), * lightMapIn...
this.skinning = false; this.morphTargets = false; this.morphNormals = false;
<|file_name|>main.py<|end_file_name|><|fim▁begin|><|fim▁hole|>import random from kivy.clock import Clock from kivy.properties import StringProperty, NumericProperty from webScrape import webScraper class MirrorWindow(Widget): dayPrint = ['Sön', 'Mån', 'Tis', 'Ons', 'Tors', 'Fre', 'Lör'] secondsAnim = Numeri...
# -*- coding: utf-8 -*- import datetime from kivy.app import App from kivy.uix.widget import Widget
<|file_name|>ansitowin32.py<|end_file_name|><|fim▁begin|><|fim▁hole|>import os from .ansi import AnsiFore, AnsiBack, AnsiStyle, Style from .winterm import WinTerm, WinColor, WinStyle from .win32 import windll, winapi_test winterm = None if windll is not None: winterm = WinTerm() def is_stream_close...
# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. import re import sys
<|file_name|>codehilite.py<|end_file_name|><|fim▁begin|>import logging import re from markdown.extensions.codehilite import CodeHilite from markdown.extensions.codehilite import CodeHiliteExtension from markdown.preprocessors import Preprocessor from markdown.treeprocessors import Treeprocessor from wiki.core.markdown...
<|file_name|>_mysql.py<|end_file_name|><|fim▁begin|># Copyright (c) 2014 Rich Porter - see LICENSE for further details import accessor import decimal import json as json_ import message import MySQLdb, MySQLdb.cursors import os.path import Queue import re import socket import sys import threading ####################...
class json(json_.JSONEncoder) : 'Serialize Decimal objects as integers' def default(self, obj):
<|file_name|>root.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/. */ //! Smart pointers for the JS-managed DOM objects. //! //! The D...
<|file_name|>Dialog.js<|end_file_name|><|fim▁begin|>window.addEventListener("DOMContentLoaded", () => { let watchers = {}; new DOM('@Dialog').forEach((dialog) => { dialogPolyfill.registerDialog(dialog); if (dialog.querySelector('Button[Data-Action="Dialog_Submit"]')) { dialog.addEventListener("keydown", (eve...
<|file_name|>expr_use_visitor.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.or...
<|file_name|>with_sqlite3_conn_contextmanager.py<|end_file_name|><|fim▁begin|>import contextlib<|fim▁hole|>import sqlite3 @contextlib.contextmanager def sqlite3_connection(db_name): connection = sqlite3.connect(db_name) yield connection connection.close() with sqlite3_connection('dhcp_snooping.db') as co...
<|file_name|>lut.rs<|end_file_name|><|fim▁begin|>use crate::asset::AssetLoadContext; use anyhow::Error; use rayon::prelude::*; use serde::{Deserialize, Serialize}; pub(crate) trait LookupTableDefinition: Sync { fn name(&self) -> String; fn size(&self) -> [u16; 3]; fn compute(&self, _: [u16; 3]) -> [f32; 4]...
pub data: Vec<[f32; 4]>, }
<|file_name|>storage.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright: Damien Elmes <anki@ichi2.net> # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html import copy import os import re import json from anki.collection import _Collection from anki.consts import * from anki...
# failed order was removed
<|file_name|>selectors.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/. */<|fim▁hole|>use style::selector_impl::TheSelectorImpl; fn pa...
use cssparser::Parser; use selectors::parser::{Selector, ParserContext, parse_selector_list};
<|file_name|>celery.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, unicode_literals import os from celery import Celery # set the default Django settings module for the 'celery' program. os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'celcius.settings') app = Celery('celsius') # Using a str...
# the configuration object to child processes.
<|file_name|>config_matching.ts<|end_file_name|><|fim▁begin|>/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {Route} from '../config'; import {defaultUrlMatch...
<|file_name|>interface.js<|end_file_name|><|fim▁begin|>(function(exports) { function changeSky(location) { var sky = document.getElementById("image-360"); sky.setAttribute('src', location); } function addMonolith() { var box = document.createElement('a-box'); document.querySelector('a-scene').ap...
exports.addRain = addRain;
<|file_name|>ard_mediathek.py<|end_file_name|><|fim▁begin|>import re from streamlink.plugin import Plugin from streamlink.plugin.api import validate from streamlink.stream import HDSStream, HLSStream, HTTPStream MEDIA_URL = "http://www.ardmediathek.de/play/media/{0}" SWF_URL = "http://www.ardmediathek.de/ard/static/p...
return HDSStream.parse_manifest(self.session, url, pvswf=SWF_URL).items()
<|file_name|>JsonObjectMapperTest.java<|end_file_name|><|fim▁begin|>package uk.gov.openregister; import org.junit.Test; import java.util.HashMap; import java.util.Map; import static org.junit.Assert.assertEquals; public class JsonObjectMapperTest { @Test public void convertToString_Map_convertsMapToCononica...
Map<String, Object> jsonMap = new HashMap<>(); jsonMap.put("key1", "value1");
<|file_name|>clusterClippedReads.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python #coding: utf-8 #### CLASSES #### class fasta(): """ """ def __init__(self): """ """ self.fastaDict = {} #### FUNCTIONS #### def fasta_reader(self, fastaFile): """ """ ...
print print "***** ", scriptName, " configuration *****" print "insertionsPath: ", insertionsPath
<|file_name|>dev.py<|end_file_name|><|fim▁begin|><|fim▁hole|>REDIS_PORT = 6379 DEBUG = False<|fim▁end|>
SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://root@localhost:3306/microblog' SQLALCHEMY_TRACK_MODIFICATIONS = False REDIS_HOST = 'localhost'
<|file_name|>associated-const-self-type.rs<|end_file_name|><|fim▁begin|>// run-pass trait MyInt { const ONE: Self; } impl MyInt for i32 { const ONE: i32 = 1; } fn main() {<|fim▁hole|><|fim▁end|>
assert_eq!(1, <i32>::ONE); }
<|file_name|>error_details.pb.go<|end_file_name|><|fim▁begin|>// Code generated by protoc-gen-go. // source: google/rpc/error_details.proto // DO NOT EDIT! package google_rpc import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" import google_protobuf "go.pedge.io/google-protobuf" // Re...
// Describes what error is encountered when accessing this resource.
<|file_name|>infer.py<|end_file_name|><|fim▁begin|>import sys, os import pickle import nltk import paths from utils import * def words_to_dict(words): return dict(zip(words, range(0, len(words)))) nltk.data.path.append(paths.nltk_data_path) use_wordnet = True if use_wordnet: stemmer = nltk.stem.wordnet.Wo...
metric = distance fmt = '%d' elif dfun == "kl":
<|file_name|>ContactFolderCollectionResponse.java<|end_file_name|><|fim▁begin|>// Template Source: BaseEntityCollectionResponse.java.tt // ------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See Li...
}
<|file_name|>requests_api.py<|end_file_name|><|fim▁begin|>import requests import yaml class RequestsApi: def __init__(self): 'init' self.config = yaml.load(open("config/request_settings.yml", "r")) def get_objects(self, sector): 'request to get objects' objects_points = [] url = self.config['host'] + sel...
'requets to send trajectory' url = self.config['host'] + self.config['trajectory_path'] % sector
<|file_name|>test_reconciler.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 ...
def setUp(self): self.fake_ring = FakeRing() reconciler.direct_get_container_policy_index.reset()
<|file_name|>message.py<|end_file_name|><|fim▁begin|><|fim▁hole|> servername: str nickname: str username: str hostname: str command: str origin: Origin params: List[str]<|fim▁end|>
from typing import List class Message(object): class Origin(object):
<|file_name|>CreateWindow.cpp<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that ...
<|file_name|>sidebar.controller.js<|end_file_name|><|fim▁begin|>(function () { 'use strict'; angular .module('app.layout') .controller('SidebarController', SidebarController); SidebarController.$inject = ['routerHelper', '$scope', '$rootScope']; /* @ngInject */ function SidebarCont...
<|file_name|>select_provider.py<|end_file_name|><|fim▁begin|>doubleClick("1370381210737.png") <|fim▁hole|>wheel(Pattern("1370381239650.png").targetOffset(-1,30), WHEEL_DOWN, 7) click(Pattern("mary_hager.png").targetOffset(97,-2)) find("1370381955817.png")<|fim▁end|>
click("1370381239650.png")
<|file_name|>urls.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from django.conf.urls import url<|fim▁hole|> urlpatterns = [ url(r'^$', DicItemsListView.as_view(), name='items-list'), url(r'^add/$', DicItemsCreateView.as_view(), name='items-add'), url(r'^(?P<dictionary_id>[0-9]+)/$', DicItemsDeta...
from dictionaries.items.views import DicItemsListView, DicItemsCreateView, \ DicItemsDetailView, DicItemsUpdateView, DicItemsDeleteView
<|file_name|>slice.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/...
<|file_name|>evaluate-senna-hash-2-pos-chunk-128-64-rmsprop5.py<|end_file_name|><|fim▁begin|>''' evaluate result ''' from keras.models import load_model from keras.utils import np_utils import numpy as np import os import sys # add path sys.path.append('../') sys.path.append('../tools') from tools import conf fro...
<|file_name|>node.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/L...
/// but merges left and right if left is low too. unsafe fn handle_underflow_to_left(&mut self) { let left_len = self.node.edges()[self.index - 1].len(); if left_len > min_load_from_capacity(self.node.capacity()) {
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from .tables import Base, Component, Mixture, Ref, Measurement, Listing, Property from .utils import get_or_create<|fim▁hole|><|fim▁end|>
__all__ = ['Base', 'Component', 'Mixture', 'Ref', 'Measurement', 'Listing', 'Property', 'get_or_create']
<|file_name|>integration_test.go<|end_file_name|><|fim▁begin|>// +build integration package storage import ( "bytes" "encoding/base64" "errors" "fmt" "io/ioutil" "log" "net/http" "os" "strings" "testing" "golang.org/x/net/context" "golang.org/x/oauth2" "golang.org/x/oauth2/google" "google.golang.org/ap...
<|file_name|>vendordata_json.py<|end_file_name|><|fim▁begin|># Copyright 2013 Canonical Ltd # 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://...
LOG.warning(_LW("%(logprefix)s failed to load json"), {'logprefix': logprefix}) raise
<|file_name|>ServerHeader.Props.ts<|end_file_name|><|fim▁begin|><|fim▁hole|> numberOfUsers?: string; roles: Array<IRole>; }<|fim▁end|>
import { IRole } from '../../models/IRole'; export interface IServerHeaderProps { serverName: string;
<|file_name|>brbblock.cpp<|end_file_name|><|fim▁begin|>// (C) Copyright 1996-2006 by Autodesk, Inc. // // Permission to use, copy, modify, and distribute this software in // object code form for any purpose and without fee is hereby granted, // provided that the above copyright notice appears in all copies and ...
<|file_name|>regionck.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://www.apache.org/l...
r_o); let sup_type = self.resolve_type(r_o.sup_type);
<|file_name|>vpnsessionpolicy_vpnvserver_binding.py<|end_file_name|><|fim▁begin|># # Copyright (c) 2008-2015 Citrix Systems, 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 # # ...
@property def activepolicy(self) :
<|file_name|>issue-44406.rs<|end_file_name|><|fim▁begin|>// Copyright 2017 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/lic...
bar(baz: $rest) } }
<|file_name|>tests.py<|end_file_name|><|fim▁begin|><|fim▁hole|>######################################################################### # # Copyright (C) 2017 OSGeo # # 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...
# -*- coding: utf-8 -*-
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2008 Adriano Monteiro Marques # # Author: Francesco Piccinno <stack.box@gmail.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public L...
"""
<|file_name|>types.d.ts<|end_file_name|><|fim▁begin|>/// <reference types="pixi.js" /> declare namespace PIXI.filters { class ColorReplaceFilter extends PIXI.Filter<{}> { constructor(originalColor?:number|number[], newColor?:number|number[], epsilon?:number); epsilon:number; originalColor:nu...
} }
<|file_name|>tinylogger.rs<|end_file_name|><|fim▁begin|>extern crate log; use log::{SetLoggerError, LogLevelFilter, LogMetadata, LogLevel, LogRecord}; pub struct TinyLogger; pub fn init(level: LogLevelFilter) -> Result<(), SetLoggerError> { log::set_logger(|max_log_level| { max_log_level.set(level); ...
fn log(&self, record: &LogRecord) { if self.enabled(record.metadata()) { let prompt = match record.level() { LogLevel::Trace => "[TACE]",
<|file_name|>float.rs<|end_file_name|><|fim▁begin|>use crate::msgpack::encode::*; #[test] fn pass_pack_f32() { let mut buf = [0x00, 0x00, 0x00, 0x00, 0x00]; write_f32(&mut &mut buf[..], 3.4028234e38_f32).ok().unwrap(); assert_eq!([0xca, 0x7f, 0x7f, 0xff, 0xff], buf); }<|fim▁hole|>fn pass_pack_f64() { ...
#[test]
<|file_name|>console.py<|end_file_name|><|fim▁begin|>from unicurses import * class Console: def __init__(self): stdscr = initscr() noecho() cbreak() curs_set(False) start_color() use_default_colors() init_pair( 0, COLOR_WHITE, COLOR_BLACK) init_pair( 1, COLOR_RED, COLOR_BLACK) ...
init_pair( 3, COLOR_GREEN, COLOR_BLACK)
<|file_name|>DataSourceProvider.java<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2000 - 2021 Silverpeas *<|fim▁hole|> * License, or (at your option) any later version. * * As a special exception to the terms and conditions of version 3.0 of * the GPL, you may redistribute this Program in connection with Free/L...
* This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the
<|file_name|>test.rs<|end_file_name|><|fim▁begin|>#[macro_use] extern crate smelter; #[derive(PartialEq, Debug, Builder, Default)] struct Point { x: u32, #[smelter(field_name="y_axis")] y: u32, } #[derive(PartialEq, Debug, Builder, Default)] struct Container<T> where T: PartialEq + Default { ite...
}
<|file_name|>optimize.rs<|end_file_name|><|fim▁begin|>extern crate tis_100_superoptimizer; <|fim▁hole|> fn main() { let node: Node = Node::new().set_up(Port::new(vec![0, 1, 2, 3])); let expected_output: Vec<i32> = vec![0, 0, 0, 0]; let config: Config = Config::new(10, 3); match optimize(node, expected_...
use tis_100_superoptimizer::TIS_100::Node; use tis_100_superoptimizer::TIS_100::Ports::Port; use tis_100_superoptimizer::optimizer::{Config, optimize};
<|file_name|>test.py<|end_file_name|><|fim▁begin|># run some tests # # author: sganis # date: 05/16/2015 import unittest class TestVersions(unittest.TestCase): def test_python(self): import platform self.assertEqual(platform.python_version(), "2.7.10rc1") def test_numpy(self):<|fim▁hole|> self.assertEqual(n...
import numpy
<|file_name|>asl.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- """Tests for Apple System Log file parser.""" import unittest from plaso.formatters import asl as _ # pylint: disable=unused-import from plaso.lib import timelib from plaso.parsers import asl from tests.parsers import test_li...
self.assertEqual(event_object.message, expected_message) expected_extra = (
<|file_name|>textToDOM.js<|end_file_name|><|fim▁begin|>// @flow import { Parser, DomHandler } from 'htmlparser2'; const textToDOM = (html: string): any => {<|fim▁hole|> parser.write(html); parser.done(); return handler.dom; }; export default textToDOM;<|fim▁end|>
const handler = new DomHandler(); const parser = new Parser(handler);
<|file_name|>VisageStepRequest.java<|end_file_name|><|fim▁begin|>/* * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public Lice...
/** * * @author sundar
<|file_name|>jquery.mousewheel.js<|end_file_name|><|fim▁begin|>/*! Copyright (c) 2013 Brandon Aaron (http://brandon.aaron.sh) * Licensed under the MIT License (LICENSE.txt). * * Version: 3.1.11 * * Requires: jQuery 1.2.2+ */ ;define(function (require, exports, module) { //导入全局依赖模块 var $,jQuery; $ = j...
delta *= pageHeight; deltaY *= pageHeight;
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>""" <|fim▁hole|><|fim▁end|>
This module provides the Koalix CRM core functionality """
<|file_name|>router.rs<|end_file_name|><|fim▁begin|>extern crate iron; extern crate iron_mountrouter; // To run, $ cargo run --example router // To use, go to http://127.0.0.1:3000/ use std::fs::File; use std::io::Read; use iron::{Iron, Request, Response, IronResult}; use iron::headers::ContentType; use iron::status;...
let mut book_router = Router::new(); book_router.add_route("/page/:key/", handler, false); book_router.add_route("/contents/", handler, false);
<|file_name|>iana.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python #----------------------------------------------------------------------------- # Copyright (c) 2008-2012, David P. D. Moss. All rights reserved. # # Released under the BSD license. See the LICENSE file for details. #----------------------------...
<|file_name|>MP.Vehicle.d.ts<|end_file_name|><|fim▁begin|>/// <reference path="../index.d.ts" /> declare interface MpVehicle extends MpEntity { gear: number; steeringAngle: number; rpm: number; removeHighDetailModel(): void; setCreatesMoneyPickupsWhenExploded(toggle: boolean): void; s...
setEngineTorqueMultiplier(value: number): void; setTyreSmokeColor(r: number, g: number, b: number): void;
<|file_name|>QuoteDisplayWebPart.ts<|end_file_name|><|fim▁begin|>import * as React from 'react'; import * as ReactDom from 'react-dom'; import { Version, Environment } from '@microsoft/sp-core-library'; import { BaseClientSideWebPart, IPropertyPaneConfiguration, PropertyPaneSlider } from '@microsoft/sp-webpa...
import ExceptionDisplay from './components/ExceptionDisplay/ExceptionDisplay';
<|file_name|>test_oss.py<|end_file_name|><|fim▁begin|># -*- coding=utf-8 -*- # 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 ...
class ObjectTestCase(unittest.TestCase):
<|file_name|>SendingMessageNotification.tsx<|end_file_name|><|fim▁begin|>import { useState, useRef, useLayoutEffect } from 'react'; import { c } from 'ttag'; import createListeners from '@proton/shared/lib/helpers/listeners'; import { wait } from '@proton/shared/lib/helpers/promise'; import { AppLink, useIsMounted } fr...
ID: -1,
<|file_name|>sanity.go<|end_file_name|><|fim▁begin|>/* Copyright 2017 Luis Pabón luis@portworx.com 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 Un...
return targetPath, nil
<|file_name|>firewalls_utils.py<|end_file_name|><|fim▁begin|># Copyright 2014 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.org/lic...
<|file_name|>bluetoothremotegattdescriptor.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public<|fim▁hole|> * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use bluetooth_traits::{BluetoothRequest, BluetoothResponse}; use bluetooth_traits::blacklist::{Blac...
* License, v. 2.0. If a copy of the MPL was not distributed with this
<|file_name|>token.cpp<|end_file_name|><|fim▁begin|>// Nome: token // Progetto: CPP/Lexer // Autore: Ruffaldi Emanuele // Descrizione: implementazione dei contenitori di token #include "token.h" #include <string.h> static char * nomi[] = { "tknNONE", "tknIDENT", "", "", "" , "", "", "EOF", "<=", ...
}
<|file_name|>goalEvolution.py<|end_file_name|><|fim▁begin|>from django.db import models from metronus_app.model.actor import Actor from metronus_app.model.task import Task class GoalEvolution(models.Model): """ Each time the goal or the price per unit/hour from a task is changed, a new entry is created in the...
actor_id = models.ForeignKey(Actor)
<|file_name|>vcard.py<|end_file_name|><|fim▁begin|># Xandikos # Copyright (C) 2017 Jelmer Vernooij <jelmer@jelmer.uk>, et al. # # 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; version 3 # of the ...
<|file_name|>exercise2_3_7.py<|end_file_name|><|fim▁begin|>from chapter02.exercise2_3_5 import recursive_binary_search from chapter02.textbook2_3 import merge_sort from util import between def sum_search(S, x): n = S.length merge_sort(S, 1, n) for i in between(1, n - 1):<|fim▁hole|> if recursive_bi...
<|file_name|>window.rs<|end_file_name|><|fim▁begin|>use std::process::{Command,Output}; use std::io; use tmux::pane::Pane; use capture::retrieve_capture; use serde::Serializer; use serde::ser::Serialize; // Come back and question the accuracy of windows without names // that have active, or previous window designation...
}; let layout = match retrieve_capture(line, LAYOUT_REGEX) {
<|file_name|>push.rs<|end_file_name|><|fim▁begin|>/* * Copyright 2018 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.org/lic...
impl_push_for_endian_scalar!(i32); impl_push_for_endian_scalar!(u64); impl_push_for_endian_scalar!(i64); impl_push_for_endian_scalar!(f32);
<|file_name|>ActivityIndicatorExample.js<|end_file_name|><|fim▁begin|>/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @format * @flow strict-local */ 'use strict'; import typ...
{ title: 'Large', render(): Node {
<|file_name|>match-all.js<|end_file_name|><|fim▁begin|>var parent = require('../../stable/string/match-all'); <|fim▁hole|>module.exports = parent;<|fim▁end|>
<|file_name|>DefaultJsonMapper.java<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2010-2011 Mark Allen. * * 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, includin...
if (facebookFieldNamesWithMultipleMappings.contains(facebookFieldName)) { try { fieldWithAnnotation.getField()
<|file_name|>_references.ts<|end_file_name|><|fim▁begin|>// Typedefs /// <reference path="./typedefs/typedefs.ts" /> // VisualsContracts /// <reference path="../VisualsContracts/data/dataView.d.ts" /> /// <reference path="../VisualsContracts/data/dataViewObject.d.ts" /> /// <reference path="../VisualsContracts/data/se...
// VisualsCommon /// <reference path="../VisualsCommon/debug.ts" />