prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>plugin.js<|end_file_name|><|fim▁begin|>(function () {
var print = (function () {
'use strict';
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var register = function (editor) {
editor.addCommand('mcePrint', function () {
editor.getWin().print();
});
};
var $_brq... | |
<|file_name|>lists.py<|end_file_name|><|fim▁begin|>##
## This file is part of the libsigrokdecode project.
##
## Copyright (C) 2014 Uwe Hermann <uwe@hermann-uwe.de>
##
## 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 F... | 'page_wraparound': True,
'addr_bytes': 1,
'addr_pins': 3, # Called E0, E1, E2 on this chip.
'max_speed': 400, |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>fn main() {
println!("Hello, world!");
}
// Description:
// Consider an array of sheep where some sheep may be missing from their place. We need a function that counts the number of sheep present in the array (true means present).
// For example,
// &[true, tru... | |
<|file_name|>address.rs<|end_file_name|><|fim▁begin|>//! Ethereum address
use std::str::FromStr;
use std::fmt;
use utils::bigint::M256;
use utils::{read_hex, ParseHexError};
use rlp::{Encodable, RlpStream};
#[derive(Eq, PartialEq, Debug, Copy, Clone, Hash)]
/// Represents an Ethereum address. This address is 20 bytes... | s.encoder().encode_value(&buffer);
}
}
|
<|file_name|>narglatch_sick.py<|end_file_name|><|fim▁begin|>import sys
from services.spawn import MobileTemplate
from services.spawn import WeaponTemplate
from resources.datatables import WeaponType
from resources.datatables import Difficulty
from resources.datatables import Options
from java.util import Vector
def a... | mobileTemplate.setTemplates(templates)
weaponTemplates = Vector()
weapontemplate = WeaponTemplate('object/weapon/melee/unarmed/shared_unarmed_default.iff', WeaponType.UNARMED, 1.0, 6, 'kinetic') |
<|file_name|>chardetect.rs<|end_file_name|><|fim▁begin|>use chardet::detect;
use rayon::prelude::*;
use super::consts::space_fix;
use std::fs::File;
use std::io::{self, BufReader, Read};
use std::path::Path;
#[derive(Debug, Default)]
pub struct CharDet {
pub files: Vec<String>,
}
impl CharDet {
pub fn call(s... | }
Ok(()) |
<|file_name|>many-array-test.js<|end_file_name|><|fim▁begin|>import setupStore from 'dummy/tests/helpers/store';
import Ember from 'ember';
import {module, test} from 'qunit';
import DS from 'ember-data';
var env, store;
var attr = DS.attr;
var hasMany = DS.hasMany;
var belongsTo = DS.belongsTo;
var run = Ember.run;... | store.peekRecord('post', 3);
store.push({
data: { |
<|file_name|>BaseDbContext.js<|end_file_name|><|fim▁begin|>/**
* Imports
*/
var path = require('path');
var fs = require('fs');
var _ = require('lodash');
/**
* BaseDbContext class
* @param {Object} options
*/
var BaseDbContext = module.exports = function(options) {
options || (options = {});
this.e... | }; |
<|file_name|>perl_stack.hpp<|end_file_name|><|fim▁begin|>#ifndef YOBAPERL_PERL_STACK_HPP
#define YOBAPERL_PERL_STACK_HPP
#include "yobaperl/common.hpp"
namespace yoba {
class Perl;
class Scalar;<|fim▁hole|>
}
namespace yoba { namespace priv {
class PerlStack
{
public:
PerlStack(Perl & perl);
~PerlStack();
... | class Array;
class Code; |
<|file_name|>turns.hpp<|end_file_name|><|fim▁begin|><|fim▁hole|>
#include "geometry/point2d.hpp"
#include "std/initializer_list.hpp"
#include "std/limits.hpp"
#include "std/string.hpp"
#include "std/vector.hpp"
#include "3party/osrm/osrm-backend/typedefs.h"
namespace routing
{
using TNodeId = uint32_t;
using TEdgeWe... | #pragma once
#include "indexer/feature_decl.hpp" |
<|file_name|>CEPMigrationTest.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 yo... | import org.apache.flink.streaming.api.windowing.time.Time;
import org.apache.flink.streaming.runtime.streamrecord.StreamRecord;
import org.apache.flink.streaming.util.KeyedOneInputStreamOperatorTestHarness; |
<|file_name|>jquery.timeago.am.js<|end_file_name|><|fim▁begin|>(function (factory) {
if (typeof define === 'function' && define.amd) {
define(['jquery'], factory);
} else if (typeof module === 'object' && typeof module.exports === 'object') {
factory(require('jquery'));
} else {
factory(jQuery);
}
}... | seconds: "ከአንድ ደቂቃ በታች", |
<|file_name|>test_cycles.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from nose.tools import raises
from openfisca_core import periods
from openfisca_core.columns import IntCol
from openfisca_core.formulas import CycleError, SimpleFormulaColumn
from openfisca_core.tests import dummy_country
from openfisca... | @raises(CycleError)
def test_cycle_time_offset():
simulation = tax_benefit_system.new_scenario().init_single_entity(
period = reference_period, |
<|file_name|>rmTimeUtils.py<|end_file_name|><|fim▁begin|># Copyright (c) 2014 RainMachine, Green Electronics LLC
# All rights reserved.
# Authors: Nicu Pavel <npavel@mini-box.com>
# Codrin Juravle <codrin.juravle@mini-box.com>
from datetime import datetime, timedelta, tzinfo
from math import sin, cos, asin, a... | |
<|file_name|>searches.py<|end_file_name|><|fim▁begin|>"""JSON implementations of relationship searches."""
# pylint: disable=no-init
# Numerous classes don't require __init__.
# pylint: disable=too-many-public-methods,too-few-public-methods
# Number of methods are defined in specification
# pylint: disable=pro... | raise: Unsupported -
``has_record_type(family_search_record_type)`` is
``false``
*compliance: mandatory -- This method must be implemented.* |
<|file_name|>settings.py<|end_file_name|><|fim▁begin|>import os
WAGTAIL_ROOT = os.path.dirname(__file__)
STATIC_ROOT = os.path.join(WAGTAIL_ROOT, 'test-static')
MEDIA_ROOT = os.path.join(WAGTAIL_ROOT, 'test-media')
MEDIA_URL = '/media/'
DATABASES = {
'default': {
'ENGINE': os.environ.get('DATABASE_ENGIN... |
WAGTAIL_SITE_NAME = "Test Site" |
<|file_name|>hark.py<|end_file_name|><|fim▁begin|># -*- coding: latin-1 -*-
import re
import json
from .common import InfoExtractor
from ..utils import determine_ext
class HarkIE(InfoExtractor):
_VALID_URL = r'https?://www\.hark\.com/clips/(.+?)-.+'
_TEST = {
u'url': u'http://www.hark.com/clips/mmbzy... | 'thumbnail': info['image_original'],
'duration': info['duration'],
} |
<|file_name|>api_python.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#-*- coding: utf-8 -*-
import sys, urllib2
def main():
if len(sys.argv) < 2:
print("Error, usage: {0} <your url>".format(sys.argv[0]))
return 1
url = sys.argv[1]
print(urllib2.urlopen('http://t34.me/api/?u=' + ur... | |
<|file_name|>vertexdomain.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-<|fim▁hole|>#
# vertexdomain.py
#
# Copyright 2016 notna <notna@apparat.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as p... | |
<|file_name|>assessments.py<|end_file_name|><|fim▁begin|># Copyright 2012 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/licen... | if auth[i]:
complete = complete and (score <> None)
i += 1 |
<|file_name|>connect.rs<|end_file_name|><|fim▁begin|>//! CONNECT
use std::io::{self, Read, Write};
use crate::control::variable_header::protocol_level::SPEC_3_1_1;
use crate::control::variable_header::{ConnectFlags, KeepAlive, ProtocolLevel, ProtocolName, VariableHeaderError};
use crate::control::{ControlType, FixedH... | |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>const express = require('express');
const app = express();
app.use(express.static('./src/'))
app.listen(8000, () => {<|fim▁hole|><|fim▁end|> | console.log('The server is running on the http://localhost:8000/......');
}); |
<|file_name|>apphtml_settings.py<|end_file_name|><|fim▁begin|># vim: fileencoding=utf-8
"""
AppHtml settings
@author Toshiya NISHIO(http://www.toshiya240.com)
"""
defaultTemplate = {
'1) 小さいボタン': '${badgeS}',
'2) 大きいボタン': '${badgeL}',
'3) テキストのみ': '${textonly}',
"4) アイコン付き(小)": u"""<span class="appIcon... | |
<|file_name|>task-move-position.js<|end_file_name|><|fim▁begin|>KB.component('task-move-position', function (containerElement, options) {
function getSelectedValue(id) {
var element = KB.dom(document).find('#' + id);
if (element) {
return parseInt(element.options[element.selectedIndex]... | .on('submit', onSubmit)
.add(KB.dom('div').attr('id', 'message-container').build()) |
<|file_name|>association-set-test.js<|end_file_name|><|fim▁begin|>import Helper, { states } from './_helper';
import { module, test } from 'qunit';
module('Integration | ORM | Has Many | Named Reflexive | association #set', function(hooks) {
hooks.beforeEach(function() {
this.helper = new Helper();
});
/*
... | assert.ok(tag.labels.includes(savedTag));
assert.equal(tag.labelIds[0], savedTag.id);
assert.ok(savedTag.labels.includes(tag), 'the inverse was set');
|
<|file_name|>__manifest__.py<|end_file_name|><|fim▁begin|>##############################################################################<|fim▁hole|>#
# Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar)
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it... | |
<|file_name|>camera.py<|end_file_name|><|fim▁begin|>"""Support for Abode Security System cameras."""
from datetime import timedelta
import logging
import requests
from homeassistant.components.camera import Camera
from homeassistant.util import Throttle
from . import DOMAIN as ABODE_DOMAIN, AbodeDevice
DEPENDENCIES... | def _capture_callback(self, capture): |
<|file_name|>meeting_rooms.py<|end_file_name|><|fim▁begin|>intervals = [[10,20],[6,15],[0,22]]<|fim▁hole|>
print(sorted(intervals))<|fim▁end|> | |
<|file_name|>MC_AudioPlayer.py<|end_file_name|><|fim▁begin|>from enigma import eTimer, iServiceInformation, iPlayableService, ePicLoad, RT_VALIGN_CENTER, RT_HALIGN_LEFT, RT_HALIGN_RIGHT, RT_HALIGN_CENTER, gFont, eListbox, ePoint, eListboxPythonMultiContent, eServiceCenter, getDesktop
from Components.MenuList import Men... | sTitle = currPlay.info().getInfoString(iServiceInformation.sTagTitle) |
<|file_name|>VisitorOutput.java<|end_file_name|><|fim▁begin|>package org.xmlcml.ami.visitor;
import java.io.File;
import java.util.List;
import org.apache.commons.io.FilenameUtils;
import org.apache.log4j.Logger;
import org.xmlcml.ami.util.AMIUtil;
import org.xmlcml.ami.visitable.VisitableInput;
/** manage... | } |
<|file_name|>knowledgebase.js<|end_file_name|><|fim▁begin|>/**
* Created by Dennis on 08/11/16.
*/
/*
* action types<|fim▁hole|>/*
* other constants
*/
/*
* action creators
*/
export function setKnowledgebase(k){
return function (dispatch) {
dispatch({type: KNOWLEDGEBASE_CHANGE, knowledgebase: k});
}
... | */
export const KNOWLEDGEBASE_CHANGE = 'KNOWLEDGEBASE_CHANGE'
|
<|file_name|>aggregation.py<|end_file_name|><|fim▁begin|>'''
TODO:
optimize adds, multiplies, 'or' and 'and' as they can accept more than two values
validate type info on specific functions
'''
from .matching import AstHandler, ParseError, DateTimeFunc
class AggregationParser(AstHandler):
FUNC_TO_ARGS = {'concat... | col_offset=node.col_offset)
if node.func.id not in self.GROUP_FUNCTIONS:
raise ParseError('Unsupported group function: {0}'.format(node.func.id), |
<|file_name|>users.client.routes.js<|end_file_name|><|fim▁begin|>'use strict';
// Setting up route
angular.module('users').config(['$stateProvider',
function ($stateProvider) {
// Users state routing
$stateProvider
.state('settings', {
abstract: true,
url: '/settings',
templateU... | }) |
<|file_name|>hmm.py<|end_file_name|><|fim▁begin|>hmm = [<|fim▁hole|> "https://media4.giphy.com/media/MsWnkCVSXz73i/giphy.gif",
"https://media1.giphy.com/media/l2JJEIMLgrXPEbDGM/giphy.gif",
"https://media0.giphy.com/media/dgK22exekwOLm/giphy.gif"
]<|fim▁end|> | "https://media3.giphy.com/media/TPl5N4Ci49ZQY/giphy.gif",
"https://media0.giphy.com/media/l14qxlCgJ0zUk/giphy.gif", |
<|file_name|>messages.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright 2015 Thomas Amland
#
# 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/li... |
Failure = namedtuple('Failure', ['ref', 'exception', 'traceback'])
Supervise = namedtuple('Supervise', ['ref'])
Terminated = namedtuple('Terminated', ['ref']) |
<|file_name|>PlayerManager.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2012 MineStar.de
*
* This file is part of Contao.
<|fim▁hole|> * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* Contao is distributed in the ... | *
* Contao is free software: you can redistribute it and/or modify
|
<|file_name|>json.py<|end_file_name|><|fim▁begin|>from io import StringIO
class TOKEN_TYPE:
OPERATOR = 0
STRING = 1
NUMBER = 2
BOOLEAN = 3
NULL = 4
class __TOKENIZER_STATE:
WHITESPACE = 0
INTEGER_0 = 1
INTEGER_SIGN = 2
INTEGER = 3
INTEGER_EXP = 4
INTEGER_EXP_0 = 5
FLO... | raise ValueError("Invalid character code: {}".format(char))
next_state = __TOKENIZER_STATE.UNICODE_2
char = "" |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from readSVCsig import readSVCdata
from readSVCsig import readSVCheader<|fim▁hole|><|fim▁end|> | from readSVCsig import readSVCsig |
<|file_name|>extension.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#Copyright (C) Fiz Vazquez vud1@sindominio.net
#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 ... | prefs = info.getAllValues("conf-values")
prefs.append(("status","0")) |
<|file_name|>mongodb.py<|end_file_name|><|fim▁begin|>#!/bin/python
from zeroos.core0.client import Client
import sys
import time
"""
This script expect you know the IP of the core0 and you can access it from the machine running this script.
an easy way to do it is to build the initramfs with a customr zerotier networ... | except Exception as e:
print("[-] error during container creation: %s" % e) |
<|file_name|>unique-move-drop.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>// 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://w... | |
<|file_name|>manage.py<|end_file_name|><|fim▁begin|><|fim▁hole|>import sys
PROJECT_DIR = os.path.abspath(os.path.dirname(__file__))
sys.path.append(PROJECT_DIR)
sys.path.append(os.path.abspath(PROJECT_DIR + '/../'))
sys.path.append(os.path.abspath(PROJECT_DIR + '/../realestate/'))
if __name__ == "__main__":
os.en... | #!/usr/bin/env python
import os |
<|file_name|>code.js<|end_file_name|><|fim▁begin|>$(document).ready(function () {
$("#bSort").hide();
$("#bShare").hide();
var movieCache = new Array();
//var movieRatingCache = new Array();
var isDebugMode = false;
var webSocketAddress, imdbServletUrl, treeUrl, sortUrl, shareServlet... | console.log(xhr);
|
<|file_name|>yf.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
#* This file is part of the MOOSE framework
#* https://www.mooseframework.org
#*
#* All rights reserved, see COPYRIGHT for full restrictions
#* https://github.com/idaholab/moose/blob/master/COPYRIGHT
#*
#* Licensed under LGPL 2.1, please see LICENSE... | p.add_option("-a", action="store_true", dest="twoD_example_alternative", help="Yield function will contain contributions from an alternative example 2D yield function")
(opts, args) = p.parse_args() |
<|file_name|>auditgroups.py<|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/.
"""
Audit groups and removes inactive users.
"""
import dateti... | |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#![allow(non_snake_case)]
mod counter;
use counter::Counter;
use std::mem::transmute;
#[no_mangle]
pub extern fn createCounter(val: u32) -> *mut Counter {
let _counter = unsafe { transmute(Box::new(Counter::new(val))) };
_counter
}
<|fim▁hole|>pub extern fn ge... | #[no_mangle] |
<|file_name|>test_generic.py<|end_file_name|><|fim▁begin|>#
# Copyright 2015 Intel Corp.
#
# 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
#
... | self.assertEqual(2, len(data)) |
<|file_name|>actor.go<|end_file_name|><|fim▁begin|>// Package sharedaction handles all operations that do not require a cloud
// controller
package sharedaction
type AuthActor interface {
IsLoggedIn() bool
}
// Actor handles all shared actions
type Actor struct {
Config Config
AuthActor
}
// NewActor returns an A... | return &Actor{
AuthActor: authActor,
Config: config, |
<|file_name|>quotes.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import scrapy
class QuotesSpider(scrapy.Spider):
name = 'quotes'
allowed_domains = ['quotes.topscrape.com/tag/humor/']
start_urls = ['http://quotes.topscrape.com/tag/humor/']
def parse(self, response):
for quote in re... | }
|
<|file_name|>manifest.rs<|end_file_name|><|fim▁begin|>use std::hash;
use std::fmt::{mod, Show, Formatter};
use semver::Version;
use serialize::{Encoder,Encodable};
use core::source::SourceId;
use core::{
Dependency,
PackageId,
Summary
};
use core::package_id::Metadata;
use core::dependency::SerializedDepend... | version: self.summary.get_version().to_string(),
dependencies: self.summary.get_dependencies().iter().map(|d| { |
<|file_name|>map.js<|end_file_name|><|fim▁begin|>/**
* @ngdoc filter
* @name map
* @kind function
*
* @description
* Returns a new collection of the results of each expression execution.
*/
angular.module('a8m.map', [])
.filter('map', ['$parse', function($parse) {
return function (collection, expression) {... |
collection = (isObject(collection))
? toArray(collection)
: collection; |
<|file_name|>settings.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
SITE_ROOT = os.path.dirname(os.path.abspath(__file__))
DEBUG = True # 调试模式
TEMPLATE_DIR = os.path.join(SITE_ROOT, 'templates') # 模板目录
BASE_TEMPLATE = 'base' # 基础模板
# URL 映射
URLS = (
'/', 'Index',
... | 'user': 'py',
'pw': 'py_passwd',
'host': 'localhost', |
<|file_name|>util.test.ts<|end_file_name|><|fim▁begin|>import {
objectNameToFirestorePaths,
isValidDocumentName,
isValidDocumentId,
mirrorDocumentPathToTombstonePath,
} from "../src/util";
const root = process.env.FIRESTORE_ROOT;
const prefixes = process.env.PREFIXES_SUBCOLLECTION_NAME;
const prefixesTombstone... | const longName = "a".repeat(6144);
expect(isValidDocumentName(deepNestedName)).toBe(true);
expect(isValidDocumentName(longName)).toBe(true); |
<|file_name|>36.rs<|end_file_name|><|fim▁begin|>/* Problem 36: Double-base palindromes
*
* The decimal number, 585 = 10010010012 (binary), is palindromic in both bases.
*
* Find the sum of all numbers, less than one million, which are palindromic in base 10 and base 2.
*
* (Please note that the palindromic number... | |
<|file_name|>multilineArrow.ts<|end_file_name|><|fim▁begin|>// @onlyOwnGrammar - As this has type parameters that would be jsx in tsx files
const method1 = <T>(
param1: T,
param2: T
): Promise<T> => {
return param1;
};
const method2 = async <T>(
param1: T,
param2: T
): Promise<T> => {
<|fi... | return param1;
}; |
<|file_name|>RecordTimer.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from enigma import eEPGCache, getBestPlayableServiceReference, \
eServiceReference, iRecordableService, quitMainloop, eActionMap, setPreferredTuner
from Components.config import config
from Components.UsageConfig import defaultMoviePath
from Compone... | import os |
<|file_name|>Code.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Copyright NumFOCUS
#
# 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... | inputFileName = sys.argv[1]
outputFileName = sys.argv[2]
if len(sys.argv) > 3: |
<|file_name|>ChangeInventoryEvent.java<|end_file_name|><|fim▁begin|>/*
* This file is part of SpongeAPI, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org><|fim▁hole|> * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software... | * Copyright (c) contributors
* |
<|file_name|>android.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*-
try:
from httplib import HTTPSConnection
from urlparse import urlparse
except ImportError:
from http.client import HTTPSConnection
from urllib.parse import urlparse
from json import dumps, loads
from django.conf import sett... | "title": kwargs.pop("event"),
'message': message, |
<|file_name|>TabsMenu.java<|end_file_name|><|fim▁begin|>package com.ilad.teamwork;
import org.openqa.selenium.WebElement;
import io.appium.java_client.android.AndroidDriver;
public class TabsMenu extends AbstractTeamWork {
public TabsMenu(AndroidDriver<WebElement> driver) {
super(driver);
}
public AllProject... | return new AllProjectsPage(driver);
}
} |
<|file_name|>YieldAssignThrow.js<|end_file_name|><|fim▁begin|>function* f() {
var x;
try {
x = yield 1;
} catch (ex) {
yield ex;
}
return 2;<|fim▁hole|>expect(g.next()).toEqual({value: 2, done: true});
g = f();
expect(g.next()).toEqual({value: 1, done: false});
expect(g.throw(3)).toEqual({value: 3, d... | }
var g = f();
expect(g.next()).toEqual({value: 1, done: false}); |
<|file_name|>ClassicState2DDrawer.ts<|end_file_name|><|fim▁begin|>module Engine {
export class ClassicState2DDrawer implements State2DDrawer {
draw(gl: WebGLRenderingContext, canvas: HTMLCanvasElement, frameManager: FrameManager, frameTimeInfo: FrameTimeInfo, cam: CameraState, state: State2D): void {
... | } |
<|file_name|>0015_pattern_json.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-05-30 22:20
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pattern', '0014_pattern_editn... |
operations = [ |
<|file_name|>decorators.ts<|end_file_name|><|fim▁begin|>/*---------------------------------------------------------------------------------------------<|fim▁hole|> * Licensed under the MIT License. See License.txt in the project root for license information.
*----------------------------------------------------------... | * Copyright (c) Microsoft Corporation. All rights reserved. |
<|file_name|>linux_groups.go<|end_file_name|><|fim▁begin|>/*
* Github Authorized Keys - Use GitHub teams to manage system user accounts and authorized_keys
*
* Copyright 2016 Cloud Posse, LLC <hello@cloudposse.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file exc... | |
<|file_name|>udp_server.go<|end_file_name|><|fim▁begin|>// Copyright 2019, OpenTelemetry Authors
//
// 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/L... | numReceivedMetricPoints++
metric, err := p.Parse(line)
if err != nil { |
<|file_name|>example.rs<|end_file_name|><|fim▁begin|><|fim▁hole|> // Une calculatrice simple avec des entiers :
// `+` ou `-` signifie ajouter ou soustraire 1
// `*` ou `/` signifie multiplier ou diviser par 2
let programme = "+ + * - /";
let mut accumulateur = 0;
for symbole in programme.chars... | // Ce code est modifiable et exécutable !
fn main() { |
<|file_name|>chunker.js<|end_file_name|><|fim▁begin|>"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
// Split the input into chunks.
exports.default = (function (input, fail) {
var len = input.length;
var level = 0;
var parenLevel = 0;
var lastOpening;
var lastOpeningPar... | case 96: // ", ' and `
matched = 0;
currentChunkStartIndex = chunkerCurrentIndex;
for (chunkerCurrentIndex = chunkerCurrentIndex + 1; chunkerCurrentIndex < len; chunkerCurrentIndex++) { |
<|file_name|>vpxor.rs<|end_file_name|><|fim▁begin|>use ::{BroadcastMode, Instruction, MaskReg, MergeMode, Mnemonic, OperandSize, Reg, RoundingMode};
use ::RegType::*;
use ::instruction_def::*;
use ::Operand::*;
use ::Reg::*;
use ::RegScale::*;<|fim▁hole|> run_test(&Instruction { mnemonic: Mnemonic::VPXOR, operand1: ... |
fn vpxor_1() { |
<|file_name|>pat-lt-bracket-3.rs<|end_file_name|><|fim▁begin|>// Copyright 2015 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... | // option. This file may not be copied, modified, or distributed
// except according to those terms.
|
<|file_name|>Controller.py<|end_file_name|><|fim▁begin|><|fim▁hole|> def __init__(self, model):
self._model = model
self._view = None
def register_view(self, view):
self._view = view
def on_quit(self, *args):
raise NotImplementedError
def on_keybinding_activ... | class Controller(object):
|
<|file_name|>c.js<|end_file_name|><|fim▁begin|>define(function (require) {
var a = require('a');
return {
name: 'c',<|fim▁hole|> };
});<|fim▁end|> | aName: a.name |
<|file_name|>tabmenu.ts<|end_file_name|><|fim▁begin|>import {NgModule, Component, OnDestroy, Input, EventEmitter} from "@angular/core";
import {CommonModule} from "@angular/common";
import {DomHandler} from "../dom/domhandler";
import {MenuItem} from "../common/api";
import {Router} from "@angular/router";
@Component(... | item: item |
<|file_name|>ReferenceEditor.js<|end_file_name|><|fim▁begin|>import core from 'comindware/core';
import CanvasView from 'demoPage/views/CanvasView';
export default function() {
const model = new Backbone.Model({
referenceValue: {
<|fim▁hole|> }
});
return new CanvasView({
v... | id: 'test.1',
text: 'Test Reference 1'
|
<|file_name|>kill-setuid.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>
fn main() {
unsafe {
let context = seccomp_sys::seccomp_init(seccomp_sys::SCMP_ACT_ALLOW);
let comparator = seccomp_sys::scmp_arg_cmp {
arg: 0,
op: seccomp_sys::scmp_compare::SCMP_CMP_EQ,
datum_... | extern crate libc;
extern crate seccomp_sys; |
<|file_name|>SagaFactory.ts<|end_file_name|><|fim▁begin|>import {AssociationValues} from "./AssociationValues";
import {Saga, SagaType} from "./Saga";
export interface SagaFactory<T extends Saga> {
createSaga(sagaType: SagaType<T>, id: string, associationValues: AssociationValues): T;<|fim▁hole|><|fim▁end|> | supports(sagaType: SagaType<T>): boolean;
hydrate(saga: T): void;
dehydrate(saga: T): void;
} |
<|file_name|>S15.7.3.5_A1.js<|end_file_name|><|fim▁begin|>// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* Number.NEGATIVE_INFINITY is -Infinity<|fim▁hole|> * @path ch15/15.7/15.7.3/15.7.3.5/S15.7.3.5_A1.js
* @description Checki... | * |
<|file_name|>DynamicControl.java<|end_file_name|><|fim▁begin|>package net.happybrackets.core.control;
import com.google.gson.Gson;
import de.sciss.net.OSCMessage;
import net.happybrackets.core.Device;
import net.happybrackets.core.OSCVocabulary;
import net.happybrackets.core.scheduling.HBScheduler;
import net.happybra... | }
}
} |
<|file_name|>controller.js<|end_file_name|><|fim▁begin|>module.exports = NotImplementedError => {
const throwNotImplemented = function () {
throw new NotImplementedError()
};
<|fim▁hole|> * @interface
* @memberof module:client.synth
*/
var Controller = throwNotImplemented;
/**
... | /**
* Controller control interface
* |
<|file_name|>scripts.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | function test(){return 5} |
<|file_name|>test_ja.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# <Lettuce - Behaviour Driven Development for python>
# Copyright (C) <2010-2012> Gabriel Falc達o <gabriel@nacaolivre.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public ... | u"\033[1;37mフィーチャ: アウトラインを日本語で書く \033[1;30m# tests/functional/language_specific_features/ja/success/outlines.feature:3\033[0m\n"
u"\033[1;37m 図表のテストをパスすること \033[1;30m# tests/functional/language_specific_features/ja/success/outlines.feature:4\033[0m\n" |
<|file_name|>marked.js<|end_file_name|><|fim▁begin|>/**
* marked - a markdown parser
* Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed)
* https://github.com/chjj/marked
*/
;(function() {
/**
* Block-Level Grammar
*/
var block = {
newline: /^\n+/,
code: /^( {4}[^\n]+\n*)+/,
fences: noop,
hr:... |
return this.token(src, true);
};
|
<|file_name|>Image.py<|end_file_name|><|fim▁begin|># -*- coding: UTF-8 -*-
#
# Copyright © 2003 - 2018 Michal Čihař <michal@cihar.com>
#
# This file is part of Wammu <https://wammu.eu/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as pub... | import wx
import wx.lib.throbber
import base64 |
<|file_name|>jquery.countto.js<|end_file_name|><|fim▁begin|>(function ($) {
$.fn.countTo = function (options) {
options = options || {};
return $(this).each(function () {
// set options for current element
var settings = $.extend({}, $.fn.countTo.defaults, {
from: $(this).data('from'),
... | // references & variables that will change with each update
var self = this, |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// in the event of macro failure, uncomment these lines:
//#![feature(trace_macros)]
//trace_macros!(true);
//use super::*;
pub mod employee_setup;
pub mod generic;<|fim▁hole|>pub mod general;<|fim▁end|> | |
<|file_name|>claimcode.ts<|end_file_name|><|fim▁begin|>/*
* Copyright 2020 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*... | *
* Player
* UserId - [private] user associated with this player
* Name - [public] nickname |
<|file_name|>test_resample.py<|end_file_name|><|fim▁begin|># pylint: disable=E1101
from datetime import datetime, timedelta
from functools import partial
from pandas.compat import range, lrange, zip, product
import numpy as np
from pandas import (Series, TimeSeries, DataFrame, Panel, Index,
isnul... | rng = period_range('2000Q1', periods=10, freq='Q-DEC')
ts = Series(np.arange(10), index=rng)
result = ts.resample('A') |
<|file_name|>UserFormModal.tsx<|end_file_name|><|fim▁begin|>import { Trans } from "@lingui/macro";
import { i18nMark, withI18n } from "@lingui/react";
import mixin from "reactjs-mixin";
import { Hooks } from "PluginSDK";
import * as React from "react";
import StoreMixin from "#SRC/js/mixins/StoreMixin";
import AuthSt... | getHeader() { |
<|file_name|>Sort.java<|end_file_name|><|fim▁begin|>package models;
import java.util.List;
/**
* The model class to store the sorting information
*
* @author Sandro
*
*/
public class Sort {
private String text;
private String supplier;
private String status;
private String dateCreateStart;
p... | String dateUpdateStart, String dateUpdateEnd, String sort,
|
<|file_name|>down_celebrity_images.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import ast
import os
import requests
import models
from config import config, sqla
from gevent.pool import Pool
from helpers import random_str, down
base_path = config.get('photo', 'path')
base_path = os.path.join(base_path, '... | create_down(thumbnail_photos_url, douban_id, 'thumbnail_photos')
|
<|file_name|>level.rs<|end_file_name|><|fim▁begin|>#![feature(test)]
use byteorder::{LittleEndian as E, ReadBytesExt};
use std::{
fs::File,
io::{Read, Seek},
};
const VMC_PATH: &'static str = "/hub/gog/Vangers/game/thechain/fostral/output.vmc";
const SIZE: [usize; 2] = [1 << 11, 1 << 14];
#[bench]
fn load_le... | file.read_to_end(&mut buffer).unwrap();
bench.iter(|| { |
<|file_name|>lower.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python
import event<|fim▁hole|>import nxt.locator
import nxt.motor as motor
brick = nxt.locator.find_one_brick()
height_motor = motor.Motor(brick, motor.PORT_A)
height_motor.turn(127, 5000, brake=False)<|fim▁end|> | |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>use n_queens_problem::{n_queens, semi_parallel_n_queens};
fn main() {<|fim▁hole|> for num in 0i32..16 {
println!("Parallel: {}: {}", num, semi_parallel_n_queens(num));
}
}<|fim▁end|> | for num in 0i32..16 {
println!("Sequential: {}: {}", num, n_queens(num));
} |
<|file_name|>source_loc_macros.rs<|end_file_name|><|fim▁begin|>// This test makes sure that different expansions of the file!(), line!(),
// column!() macros get picked up by the incr. comp. hash.
// revisions:rpass1 rpass2
// compile-flags: -Z query-dep-graph
#![feature(rustc_attrs)]
#[rustc_clean(cfg="rpass2")]
f... | fn line_different() {
#[cfg(rpass1)]
{ |
<|file_name|>async_multicast.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
"""
@file async_multicast.py
@author Woong Gyu La a.k.a Chris. <juhgiyo@gmail.com>
<http://github.com/juhgiyo/pyserver>
@date March 10, 2016
@brief AsyncMulticast Interface
@version 0.1
@section LICENSE
The MIT License (MIT)
Copyr... | |
<|file_name|>test_rest_stream_responses_async.py<|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.
# -------... | async with client.send_request(request, stream=True) as response:
response.raise_for_status()
except HttpResponseError as e:
pass |
<|file_name|>PredictorRegressionMetrics.tsx<|end_file_name|><|fim▁begin|>import * as React from 'react'
import { ValueLine } from '@framework/Lines'
import { TypeContext } from '@framework/TypeContext'
import { PredictorRegressionMetricsEmbedded, PredictorEntity } from '../Signum.Entities.MachineLearning'
export... | renderRow(ctx: TypeContext<PredictorEntity>, property: (val: PredictorRegressionMetricsEmbedded) => number | null | undefined) {
const ctxT = ctx.subCtx(a => a.regressionTraining!);
const ctxV = ctx.subCtx(a => a.regressionValidation!);
|
<|file_name|>sm.py<|end_file_name|><|fim▁begin|>import os
from pyjs import linker
from pyjs import translator
from pyjs import util
from optparse import OptionParser
import pyjs
PLATFORM='spidermonkey'
APP_TEMPLATE = """
var $wnd = new Object();
$wnd.document = new Object();
var $doc = $wnd.document;
var $moduleName ... | * prepare app system vars
*/
$pyjs.platform = 'spidermonkey';
$pyjs.appname = '%(app_name)s'; |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>extern crate docopt;
extern crate futures;
extern crate http;
extern crate hyper;
#[macro_use]
extern crate serde_derive;
use docopt::Docopt;
use std::env;
mod server;
const USAGE: &'static str = "
HTTP server for theremins.club
Usage:
theremins-http-server [--por... |
server::serve(port, ws_url);
} |
<|file_name|>config.py<|end_file_name|><|fim▁begin|># --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
"""Fast R-CNN confi... | def get_output_dir(imdb, net):
"""Return the directory where experimental artifacts are placed.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.