prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>test_user_namespaces.py<|end_file_name|><|fim▁begin|>from ..user_namespaces import UserNamespaces
from ...parsers.cmdline import CmdLine
from ...parsers.grub_conf import Grub2Config
from ...tests import context_wrap
ENABLE_TOK_A = '''
user_namespaces.enable=1
'''.strip() # noqa
ENABLE_TOK_B = '''
user-n... | |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>/*
* Rust BareBones OS
* - By John Hodge (Mutabah/thePowersGang)
*
* arch/x86/mod.rs
* - Top-level file for x86 architecture
*
* == LICENCE ==
* This code has been put into the public domain, there are no restrictions on
* its use, and the author takes no liabi... | |
<|file_name|>simple_ws.py<|end_file_name|><|fim▁begin|>from tornado import websocket, web, ioloop, autoreload
import json
import sys
new_msg=''
old_msg=''
def send_response():
print 'msg'
if new_msg<>old_msg:
print new_msg
class SocketHandler(websocket.WebSocketHandler):
''' websocket handler '''... | app.listen(8888)
autoreload.add_reload_hook(send_response)
autoreload.start() |
<|file_name|>comm-not-freeze-receiver.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.a... | fn test<T: Sync>() {} |
<|file_name|>thrift.rs<|end_file_name|><|fim▁begin|>// Copyright 2019-2020 Twitter, Inc.
// Licensed under the Apache License, Version 2.0
// http://www.apache.org/licenses/LICENSE-2.0
#![allow(dead_code)]
use crate::codec::ParseError;
pub const STOP: u8 = 0;
pub const VOID: u8 = 1;
pub const BOOL: u8 = 2;
pub const... | #[inline] |
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [<|fim▁hole|> ('trans', '0045_auto_20150916_1007'),
... | migrations.swappable_dependency(settings.AUTH_USER_MODEL), |
<|file_name|>v8-views-test.cpp<|end_file_name|><|fim▁begin|>////////////////////////////////////////////////////////////////////////////////
/// DISCLAIMER
///
/// Copyright 2014-2020 ArangoDB GmbH, Cologne, Germany
/// Copyright 2004-2014 triAGENS GmbH, Cologne, Germany
///
/// Licensed under the Apache License, Versi... | auto result =
v8::Function::Cast(*fn_view)->CallAsFunction(context, fn_view, |
<|file_name|>NaviShare.java<|end_file_name|><|fim▁begin|>package com.navisens.pojostick.navishare;
import com.navisens.motiondnaapi.MotionDna;
import com.navisens.pojostick.navisenscore.*;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
/**
* Created by Joseph on 11/30/17.
* <p>
* NaviSh... | */
@SuppressWarnings("unused") |
<|file_name|>Bullet.py<|end_file_name|><|fim▁begin|>import pygame
from Explosion import Explosion
class Bullet(object):
PLAYER, ENEMY = 1, 0
def __init__(self, manager, parent, init_pos, direction, speed=3):
self.manager = manager
self.parent = parent
self.image = pygame.... | self.manager.remove_bullet(self)
return True
|
<|file_name|>test_future_or.rs<|end_file_name|><|fim▁begin|>use eventual::*;
use std::sync::mpsc::channel;
#[test]
pub fn test_or_first_success_async() {
let (c1, f1) = Future::<&'static str, ()>::pair();
let (c2, f2) = Future::<&'static str, ()>::pair();<|fim▁hole|>
c1.receive(move |c| {
tx1.send(... | let (tx1, rx) = channel();
let tx2 = tx1.clone(); |
<|file_name|>_arrayminussrc.py<|end_file_name|><|fim▁begin|>import _plotly_utils.basevalidators
class ArrayminussrcValidator(_plotly_utils.basevalidators.SrcValidator):<|fim▁hole|> ):
super(ArrayminussrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | def __init__(
self, plotly_name="arrayminussrc", parent_name="bar.error_x", **kwargs |
<|file_name|>NaviBar.java<|end_file_name|><|fim▁begin|>package com.github.mzule.androidweekly.ui.view;
import android.app.Activity;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.widget.TextView;
import com.github.mzule.androidweekly.R;
import c... | super(context, attrs, defStyleAttr);
}
|
<|file_name|>UrlUtil.java<|end_file_name|><|fim▁begin|>package edu.avans.hartigehap.web.util;
import java.io.UnsupportedEncodingException;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.util.UriUtils;
import org.springframework.web.util.WebUtils;
import lombok.extern.slf4j.Slf4j;
@Slf... | public class UrlUtil {
private UrlUtil() {
|
<|file_name|>endpoints_client.py<|end_file_name|><|fim▁begin|># Copyright 2016 Red Hat, 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
#... | |
<|file_name|>roisFromMask.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>import { Image } from 'image-js';
import { RoiList } from './RoiList';
interface IRoisFromMaskOptions {
/**
* If `true` pixels that touch by a corner (diagonal) are considered to be
* neighbors.
*/
allowCorners?: boolean;
}
export fun... | |
<|file_name|>IncomingMessage.java<|end_file_name|><|fim▁begin|>package org.reprap.comms;
import java.io.IOException;
import org.reprap.Device;
import org.reprap.ReprapException;
/**
*
*/
public abstract class IncomingMessage {
/**
* The actual content portion of a packet, not the frilly bits
*/
private byte... | |
<|file_name|>bitcoin_bs.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="bs" version="2.1">
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About buynowcoin</source>
<translation type="unfinish... | <location line="+22"/>
<location line="+35"/> |
<|file_name|>run_pytest_until_error.py<|end_file_name|><|fim▁begin|>import os
import sys
import signal
import logging
import pytest
import latus.logger
import test_latus.tstutil
os.environ["PYTHONPATH"] = '.'
g_keep_running = True
def control_key_handler(signal, frame):
global g_keep_running
print('%s : c... | print('pytest got an error - exiting')
g_keep_running = False
else:
count['pass'] += 1 |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
from future.builtins import str
from future.utils import with_metaclass
from json import loads
try:
from urllib.request import urlopen
from urllib.parse import urlencode
except ImportError:
from urllib import urlope... | |
<|file_name|>EventStaxUnmarshaller.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2014-2019 Amazon.com, Inc. or its affiliates. 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. A copy of the License is loca... | |
<|file_name|>conf.js<|end_file_name|><|fim▁begin|>window.appConf = {
author: 'React Drive CMS',<|fim▁hole|> shortname: 'easydrivecms',
root: 'react-drive-cms',
}<|fim▁end|> | dashboardId: '1-on_GfmvaEcOk7HcWfKb8B6KFRv166RkLN2YmDEtDn4',
sendContactMessageUrlId:
'AKfycbyL4vW1UWs4mskuDjLoLmf1Hjan1rTLEca6i2Hi2H_4CtKUN84d', |
<|file_name|>UmbrellaProtocol.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found... | }
break; |
<|file_name|>test_cache.py<|end_file_name|><|fim▁begin|>from unittest import TestCase
from pandas import Timestamp, Timedelta
from zipline.utils.cache import CachedObject, Expired, ExpiringCache
class CachedObjectTestCase(TestCase):
def test_cached_object(self):
expiry = Timestamp('2014')
befor... | |
<|file_name|>EventResource.java<|end_file_name|><|fim▁begin|>/**
* Copyright (c) 2010-2013, openHAB.org and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at... | *
* @Path("/{bundlename: [a-zA-Z_0-9]*}")
*
* @Produces({ MediaType.WILDCARD }) public SuspendResponse<Response> |
<|file_name|>io_handler.rs<|end_file_name|><|fim▁begin|>// Copyright 2015, 2016 Ethcore (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 o... | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License |
<|file_name|>discovery_setting_broker.py<|end_file_name|><|fim▁begin|>from ..broker import Broker
class DiscoverySettingBroker(Broker):
controller = "discovery_settings"
def index(self, **kwargs):
"""Lists the available discovery settings. Any of the inputs listed may be be used to narrow the list; o... | | ``default:`` None |
<|file_name|>instr_phaddd.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::*;
use ::test::run_test;
#[test]
fn phaddd_1() {
run_test(&Instruct... | |
<|file_name|>tooltip-modified-defaults-example.ts<|end_file_name|><|fim▁begin|>import {Component} from '@angular/core';
import {MAT_TOOLTIP_DEFAULT_OPTIONS, MatTooltipDefaultOptions} from '@angular/material/tooltip';
/** Custom options the configure the tooltip's default show/hide delays. */
export const myCustomToolt... | */
@Component({ |
<|file_name|>router.js<|end_file_name|><|fim▁begin|>import Vue from 'vue';
import Router from 'vue-router';
import StoryManager from './views/StoryManager.vue';
import StoryView from './views/StoryView.vue';
Vue.use(Router);
export default new Router({
routes: [
{
path: '/',
name: 'home',
comp... | |
<|file_name|>fa.js<|end_file_name|><|fim▁begin|>/* jshint -W100 */
/* jslint maxlen: 86 */
define(function () {
// Farsi (Persian)
return {
errorLoading: function () {
return 'امکان بارگذاری نتایج وجود ندارد.';
},
inputTooLong: function (args) {
var overChars = args.input.length - args.maxim... | return 'هیچ نتیجهای یافت نشد';
},
searching: function () { |
<|file_name|>cri_stats_provider_test.go<|end_file_name|><|fim▁begin|>/*
Copyright 2017 The Kubernetes 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/LIC... | ephemeralVolumes := makeFakeVolumeStats([]string{"ephVolume1, ephVolumes2"})
persistentVolumes := makeFakeVolumeStats([]string{"persisVolume1, persisVolumes2"}) |
<|file_name|>menu.py<|end_file_name|><|fim▁begin|>import sys
from core import loop
from util import jsonmanager, debug
def make_console_menu(name):
menu_data_file_path = '_Resources/Data/MenuData/'
path = menu_data_file_path + name + '.json'
data = jsonmanager.get_data(path)
title = data['Title']
... | self.text = text
self.action = action
def invoke(self): |
<|file_name|>actions.js<|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 la... | }
}
function showDeleteDocModal () { |
<|file_name|>474OnesAndZeros.java<|end_file_name|><|fim▁begin|>// https://discuss.leetcode.com/topic/71438/c-dp-solution-with-comments
// https://discuss.leetcode.com/topic/76103/0-1-knapsack-detailed-explanation
class Solution {
public int findMaxForm(String[] strs, int m, int n) {
int[][] dp = new int[m+1... | |
<|file_name|>init-embed.js<|end_file_name|><|fim▁begin|>/**
* Copyright 2015 aixigo AG
* Released under the MIT license.
* http://laxarjs.org/license
*/
require( [
'laxar',<|fim▁hole|> 'json!laxar-application/var/flows/embed/resources.json'
], function( ax, mainDependencies, mainResources ) {
'use strict';
... | 'laxar-application/var/flows/embed/dependencies', |
<|file_name|>foods.component.ts<|end_file_name|><|fim▁begin|>import { Component, OnInit, Input } from '@angular/core';
import {Response} from '@angular/http';
import { Food } from "../food.interface";
import { FoodService } from "../food.service";
import { SlickSliderComponent as slickComponent } from "../slick.slider.... | |
<|file_name|>test_context.py<|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 under the Apa... | jobIds = tracker.getJobIdsForGroup("test_progress_api")
self.assertEqual(1, len(jobIds))
job = tracker.getJobInfo(jobIds[0]) |
<|file_name|>html_writer.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
"""
html_writer.py - Construct HTML pages
"""
import datetime
import os
import types
import numpy as np
import xml.dom.minidom
class BaseHtmlWriter:
def __init__(self):
self.div_counter = 0
pass
def relative_to_full_... | pass
def relative_to_full_path(self, relpath):
pass |
<|file_name|>parse.py<|end_file_name|><|fim▁begin|>import os.path
import requests
import time
from bs4 import BeautifulSoup
from geotext import GeoText as gt
from string import punctuation
from collections import Counter
import re
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
<|fim▁hole|>
conservation = ['... | threats = ['loss', 'fragmentation', 'hunting', 'poaching', 'fishing', 'overfishing', 'environmental', 'environment', 'invasive', 'disease', 'pet', 'pollution'] |
<|file_name|>pat-ranges-1.rs<|end_file_name|><|fim▁begin|>// Parsing of range patterns
<|fim▁hole|>fn main() {
let macropus!() ..= 11 = 12; //~ error: expected one of `:`, `;`, `=`, or `|`, found `..=`
}<|fim▁end|> | |
<|file_name|>test_qltk_cbes.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# 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 the License, or
# (at your option) any lat... | |
<|file_name|>calendar-sw.js<|end_file_name|><|fim▁begin|>// ** I18N
Calendar._DN = new Array
("Söndag",
"Måndag",
"Tisdag",
"Onsdag",
"Torsdag",
"Fredag",
"Lördag",
"Söndag");
Calendar._MN = new Array
("Januari",
"Februari",
"Mars",
"April",
"Maj",
"Juni",
"Juli",
"Augusti",
"September... | |
<|file_name|>TerEntVigiCru.java<|end_file_name|><|fim▁begin|>/**
* Copyright (c) 2010-2020 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Pu... | * @SerializedName("LinkInfoCru")
* public String linkInfoCru; |
<|file_name|>TimeStampParserTests.java<|end_file_name|><|fim▁begin|>package ninja.mbedded.ninjaterm.util.rxProcessing.timeStamp;
import javafx.scene.paint.Color;
import ninja.mbedded.ninjaterm.JavaFXThreadingRule;
import ninja.mbedded.ninjaterm.util.rxProcessing.streamedData.StreamedData;
import ninja.mbedded.ninjater... | // inputStreamedData.append("abcdefEOL");
// inputStreamedData.addColour(2, Color.RED);
// inputStreamedData.addColour(3, Color.GREEN); |
<|file_name|>texture.rs<|end_file_name|><|fim▁begin|>// Copyright 2017 The gltf Library Developers
//
// 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 fil... | |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>import logger from './logger';<|fim▁hole|>
const port = app.get('port');
const server = app.listen(port);
process.on('unhandledRejection', (reason, p) =>
logger.error('Unhandled Rejection at: Promise ', p, reason)
);
server.on('listening', () =>
logger.info('Feat... | import app from './app'; |
<|file_name|>es5.demo.config.ts<|end_file_name|><|fim▁begin|>import * as fs from 'fs';
import * as minimist from 'minimist';
import * as path from 'path';
import {baseConfig} from './es5.base.config';
<|fim▁hole|>
const getDemos = source => {
return fs.readdirSync(source)
.filter(name => path.extname(name) ===... | // Allow for specific demos to built with a --demos=<someName>,<someOtherName>
// CLI format.
const args = minimist(process.argv.slice(2));
const specified: string[] = args.demos ? args.demos.split(',') : []; |
<|file_name|>test_server.py<|end_file_name|><|fim▁begin|>from spec.python import db_connection
import sam.common
import sam.constants
import web
app = web.application(sam.constants.urls, globals(), autoreload=False)
sam.common.session_store = web.session.DBStore(db_connection.db, 'sessions')
sam.common.session = web.s... | assert req.status == "404 Not Found"
req = app.request('/invalidendpoint', method='POST')
assert req.status == "404 Not Found"
|
<|file_name|>AppBar.test.js<|end_file_name|><|fim▁begin|>import React from 'react';
import { assert } from 'chai';
import { createMount, createShallow, getClasses } from '@material-ui/core/test-utils';
import describeConformance from '../test-utils/describeConformance';
import AppBar from './AppBar';
import Paper from ... |
before(() => { |
<|file_name|>archive.tsx<|end_file_name|><|fim▁begin|>// Copyright (c) 2017 Uber Technologies, 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/LI... | isError?: boolean;
error?: ApiError;
isAcknowledged?: boolean; |
<|file_name|>node.rs<|end_file_name|><|fim▁begin|>use crate::{Frame, Sample};
/// Types to be used as a **Node** within the DSP **Graph**.
pub trait Node<F>
where
F: Frame,
{
/// Request audio from the **Node** given some `sample_hz` (aka sample rate in hertz).
/// If the **Node** has no inputs, the `buffe... | }
/// Following the call to the `Node`'s `audio_requested` method, the `Graph` will sum together |
<|file_name|>gprof2dot.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Copyright 2008 Jose Fonseca
#
# This program 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 Software Foundation, either version 3 of the Lice... |
return profile
|
<|file_name|>incoming.rs<|end_file_name|><|fim▁begin|>use ::std::sync::{Arc, RwLock, Mutex};
use ::std::io::ErrorKind;
use ::jedi::{self, Value};
use ::error::{TResult, TError};
use ::sync::{SyncConfig, Syncer};
use ::sync::sync_model::{SyncModel, MemorySaver};
use ::storage::Storage;
use ::rusqlite::NO_PARAMS;
use ::a... | let res = match sync_id { |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>"""simpledrf URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpat... | |
<|file_name|>approve_change.py<|end_file_name|><|fim▁begin|>from lib.actions import BaseAction
class ApprovalAction(BaseAction):
def run(self, number):<|fim▁hole|> s.table = 'change_request'
res = s.get({'number': number})
sys_id = res[0]['sys_id']
response = s.update({'approval': '... | s = self.client |
<|file_name|>test_basic.py<|end_file_name|><|fim▁begin|>import unittest
import markovify
import os
import operator
def get_sorted(chain_json):
return sorted(chain_json, key=operator.itemgetter(0))
class MarkovifyTestBase(unittest.TestCase):
__test__ = False
def test_text_too_small(self):
text =... |
markovify.NewlineText("This sentence (would normall fail", well_formed=False)
|
<|file_name|>explorers.cpp<|end_file_name|><|fim▁begin|>#include <cstdio>
#include <cstring>
#define MAXX 50
#define MAXY 50
#define MAXLEN 100
#define Zero(v) memset((v), 0, sizeof(v))
int X, Y;
char ins[MAXLEN + 1];
int x, y, d;
bool scent[MAXX + 1][MAXY + 1];
const char dirs_str[] = "NESW";
const int dirs[4][... | x2 = x + dirs[d][0];
y2 = y + dirs[d][1];
|
<|file_name|>crypto.py<|end_file_name|><|fim▁begin|>import sys
from Crypto.Cipher import AES, PKCS1_OAEP
from Crypto.PublicKey import RSA
from Crypto import Random
#AES key size
AES_KEY_SIZE = 32
# Uses null character as the padding character
PADDING_VALUE = '/0'
def padAES(message):
lacking_char_num = (AES.blo... | |
<|file_name|>globalize.culture.co.js<|end_file_name|><|fim▁begin|>/*
* Globalize Culture co
*
* http://github.com/jquery/globalize
*
* Copyright Software Freedom Conservancy, Inc.
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* This file was generated by the Gl... | positiveInfinity: "+Infinitu",
|
<|file_name|>asyncio_example.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import time<|fim▁hole|>async def _main(args):
print(args)
print("Sleeping 2...")
time.sleep(2)
print("Sleeping 0...")
return 0
def atexit():
print("atexit")
app = Application(_main, atexit=atexit)
app.arg_parse... | from nicfit.aio import Application
|
<|file_name|>presentgetBothNodesEdges.py<|end_file_name|><|fim▁begin|>import re, sys
import functools
import graphviz as gv
from graphviz import Source
bad_words = [ 'jns', 'js', 'jnz', 'jz', 'jno', 'jo', 'jbe', 'jb', 'jle', 'jl', 'jae', 'ja', 'jne loc', 'je', 'jmp', 'jge', 'jg', 'SLICE_EXTRA', 'SLICE_ADDRESSING', '[B... | #Edx edges
elif splitStr[idz] == "edx":
for ido, k in enumerate(EDX):
datG.edge(k, tempNodeStr, label=str(k)+'(edx)'+str(ido)) |
<|file_name|>es6.function.name.js<|end_file_name|><|fim▁begin|>var setDesc = require('./$').setDesc
, createDesc = require('./$.property-desc')
, has = require('./$.has')
, FProto = Function.prototype
, nameRE = /^\s*function ([^ (]*)/
, NAME = 'name';
// 19.2.4.2 name
NAME in FProto |... | configurable: true,
get: function(){ |
<|file_name|>yaml.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Support a YAML file hosts.yml as external inventory in Ansible
# Copyright (C) 2012 Jeroen Hoekx <jeroen@hoekx.be>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License a... | |
<|file_name|>friendsWrapper.js<|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<|fim▁hole|> * to you under the Apache License, Version 2.0 (the
* "Licens... | * regarding copyright ownership. The ASF licenses this file |
<|file_name|>cssstylevalue.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::codegen::Bindings::CSSStyleV... | |
<|file_name|>url_utils_test.go<|end_file_name|><|fim▁begin|>/*
Copyright 2016 The Kubernetes 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/LICENSE-2.0
... | |
<|file_name|>measure_methods.js<|end_file_name|><|fim▁begin|>/**
* Copyright 2016, Optimizely
*
* 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... | assert.strictEqual(variationKey, 'variation');
return time;
}, |
<|file_name|>euler55.rs<|end_file_name|><|fim▁begin|>use num::BigUint;
use num::bigint::ToBigUint;
pub fn main() {
let ans = (1..10_000).filter(|n| is_lychrel(n)).count();
println!("{}", ans);
}
fn is_lychrel(n: &u64) -> bool {
let is_palindrom = |l: &str| l.chars().zip(l.chars().rev()).all(|(i, j)| i == ... | if is_palindrom(&m.to_string()) {
return false;
}
n = m; |
<|file_name|>map.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>
use super::area::PhysMemoryRange;
use super::constants::*;
use super::page_align;
use super::prelude::*;
/// Maximum number of ok-to-use entries
pub const MAX_OK_ENTRIES: usize = 20;
#[rustfmt::skip]
fn read_item(index: usize) -> (u64, u64, u32, u32) {
... | use core::ptr; |
<|file_name|>test_LilyPondParser__functions__transpose.py<|end_file_name|><|fim▁begin|>import abjad
def test_LilyPondParser__functions__transpose_01():
pitches = ["e'", "gs'", "b'", "e''"]
maker = abjad.NoteMaker()
target = abjad.Staff(maker(pitches, (1, 4)))
key_signature = abjad.KeySignature("e", "... | parser = abjad.parser.LilyPondParser()
result = parser(string)
assert abjad.lilypond(target) == abjad.lilypond(result) and target is not result
|
<|file_name|>axis2.py<|end_file_name|><|fim▁begin|># This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# Th... | #logging.getLogger('suds.client').setLevel(logging.DEBUG)
url = 'http://localhost:8080/axis2/services/BasicService?wsdl'
|
<|file_name|>cellaut.py<|end_file_name|><|fim▁begin|># Based on cage v1.1.4
# http://www.alcyone.com/software/cage/
# Copyright (C) 2002-2006 Erik Max Francis <max@alcyone.com>
# GPL License
class Topology:
"""Encaptulation of the shape and dimentionality of a cellular automata"""
def get(self, address):
... | class Automaton: |
<|file_name|>twitter_json_parser.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import json
from pprint import pprint
import re
import urllib
import time
from geopy import geocoders
import Image
import os
# TODO: handle test cases<|fim▁hole|># testcases:
# hollywood & vine, hollywood and vine
# order of operations... | |
<|file_name|>stats.rs<|end_file_name|><|fim▁begin|>use clap::ArgMatches;<|fim▁hole|>
use chrono::Local;
use serde_json;
use serde::ser::{MapVisitor, Serialize, Serializer};
use ilc_base;
use ilc_ops::stats::Stats;
use Environment;
use Cli;
use error;
struct StatFormat {
version: String,
master_hash: Option<S... | |
<|file_name|>signpdf.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os
import time
import argparse
import tempfile
import PyPDF2
import datetime
from reportlab.pdfgen import canvas
parser = argparse.ArgumentParser("Add signatures to PDF files")
parser.add_argument("pdf", help="The pdf file to annotate")... | help="Output file. Defaults to input filename plus '_signed'")
parser.add_argument("--coords", nargs='?', default='2x100x100x125x40', |
<|file_name|>SubMeshRenderElement.ts<|end_file_name|><|fim▁begin|>import { Event } from "../../../events/Event";
import { LayaGL } from "../../../layagl/LayaGL";
import { MeshRenderDynamicBatchManager } from "../../graphics/MeshRenderDynamicBatchManager";
import { MeshRenderStaticBatchManager } from "../../graphics/Mes... | dynBatchElement.material = dynOriElement.material;
dynBatchElement.setTransform(null);
dynBatchElement.render = dynOriRender; |
<|file_name|>xul.mako.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/. */
<%namespace name="helpers" file="/helpers.mako.rs" />
<% fro... | "-moz-box-align",
"stretch start center baseline end",
products="gecko",
gecko_ffi_name="mBoxAlign", |
<|file_name|>persist_test.go<|end_file_name|><|fim▁begin|>package pelican
/*
import (
"fmt"
cv "github.com/glycerine/goconvey/convey"
"testing"
)
func TestKnownHostsSaveAndRestoreWork(t *testing.T) {
StopAllDockers()
StartDockerImage(DockerHubTestImage)
defer StopAllDockers()
my_known_hosts_file := "my.known... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>import os
import sys
import math
import time
import json
from rpc_client import RPC_Client
ROOT = os.path.dirname(os.path.realpath(sys.argv[0]))
DBPATH = os.path.join(ROOT, 'build.json')
MAXGAS = hex(int(math.pi*1e6))<|fim▁hole|>
def save_db(db):
with open(DBPA... |
def get_db():
with open(DBPATH) as dbfile:
return json.load(dbfile) |
<|file_name|>builtin.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-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.org/li... | |
<|file_name|>EnumerationString.cpp<|end_file_name|><|fim▁begin|>/*
* True Reality Open Source Game and Simulation Engine
* Copyright © 2021 Acid Rain Studios LLC<|fim▁hole|>* The Base of this class has been adopted from the Delta3D engine
*
* This library is free software; you can redistribute it and/or modify it under... | * |
<|file_name|>test_results_exporter_view.py<|end_file_name|><|fim▁begin|>import io
import openpyxl
from django.test import (
Client, TestCase
)
from django.urls import reverse
from core.models import (
User, Batch, Section, Election, Candidate, CandidateParty,
CandidatePosition, Vote, VoterProfile, Settin... | def test_get_with_invalid_election_id_non_existent_election_id(self):
response = self.client.get( |
<|file_name|>zipping_list.py<|end_file_name|><|fim▁begin|>import sys
import random
from linked_list_prototype import ListNode
from reverse_linked_list_iterative import reverse_linked_list
# @include
def zipping_linked_list(L):
if not L or not L.next:
return L
# Finds the second half of L.
slow = ... | |
<|file_name|>PiMulticastGroupTranslatorImplTest.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2018-present Open Networking Foundation
*
* 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
... | |
<|file_name|>routes.js<|end_file_name|><|fim▁begin|>app.config(function ($routeProvider, $locationProvider) {
"use strict";
$routeProvider.when('/',
{
controller: 'HomeController',
templateUrl: '/static/apps/main/views/home.html',
resolve: {
tasks: fun... | { |
<|file_name|>channel.rs<|end_file_name|><|fim▁begin|>// Copyright 2013 The color-rs developers. For a full listing of the authors,
// refer to the AUTHORS file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in co... |
assert_eq!(0x00_u8.to_channel_f64(), 0f64); |
<|file_name|>contourf_demo.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import numpy as np
import matplotlib.pyplot as plt
origin = 'lower'
#origin = 'upper'
delta = 0.025
x = y = np.arange(-3.0, 3.01, delta)
X, Y = np.meshgrid(x, y)
Z1 = plt.mlab.bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0)
Z2 = plt.mlab.biv... | # data below the lowest contour level yellow, and above the
# highest level cyan: |
<|file_name|>target_action_support_test.js<|end_file_name|><|fim▁begin|>import Ember from "ember-metal/core";
import EmberObject from "ember-runtime/system/object";
import TargetActionSupport from "ember-runtime/mixins/target_action_support";
var originalLookup;
QUnit.module("TargetActionSupport", {
setup() {
o... | QUnit.test("it should use the action specified in the argument", function() {
expect(2);
|
<|file_name|>binduser.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
#
# Copyright (c) 2008-2009 University of Utah and the Flux Group.
#
# {{{GENIPUBLIC-LICENSE
#
# GENI Public License
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and/or hardware specifi... | # is furnished to do so, subject to the following conditions:
# |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from distutils.core import setup
from program_version import RELEASE
<|fim▁hole|> author_email='ninja@snow.com',
url='https://github.com/mr-ninja-snow/Self-Updating-Python-Program.git',
packages=[],
)<|fim▁end|> | setup(name='program',
version=RELEASE,
description='A self updating program example',
author='Mr Snow', |
<|file_name|>hello.rs<|end_file_name|><|fim▁begin|>use models::user::UserModel;
use helpers::db::DB;<|fim▁hole|>use responses::{APIResponse, ok};
#[get("/whoami")]
pub fn whoami(current_user: UserModel, db: DB) -> APIResponse {
ok().data(json!(current_user.email))
}<|fim▁end|> | |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.conf import settings
from django.db import models
from django.core.cache import cache
from django.dispatch import receiver
from seahub.base.fields import LowerCaseCharField
from seahub.profile.settings import EMAIL_ID_CACHE_PREFIX, EMAIL_ID_CACHE_TIMEOUT
... | key = normalize_cache_key(user.email, EMAIL_ID_CACHE_PREFIX)
cache.set(key, user.id, EMAIL_ID_CACHE_TIMEOUT) |
<|file_name|>speed.rs<|end_file_name|><|fim▁begin|>const MS_PER_S: f64 = 1000.0;
#[derive(Clone, Copy, Debug, Serialize, Deserialize)]
pub struct RealtimeSpeed {<|fim▁hole|>}
impl RealtimeSpeed {
pub fn from_cells_per_sec(cells_per_sec: f64) -> Self {
RealtimeSpeed { cells_per_ms: cells_per_sec / MS_PER_S... | cells_per_ms: f64, |
<|file_name|>HttpJsonRegionDiskTypesCallableFactory.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2021 Google LLC
*
* 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
*
* https://ww... | "The surface for long-running operations is not stable yet and may change in the future.")
@Override
public <RequestT, ResponseT, MetadataT> |
<|file_name|>content.js<|end_file_name|><|fim▁begin|>/*****************************************************************************
** Copyright (C) 2015 Intel Corporation. **
** **
** Licensed under the Apache L... |
(document.head||document.documentElement).appendChild(script);
function reeeplace() { |
<|file_name|>channel.go<|end_file_name|><|fim▁begin|>package api
import (
"errors"
"strconv"
"github.com/gempir/go-twitch-irc/v2"
)
// swagger:route GET /channel/{channel} logs channelLogs
//
// Get entire channel logs of current day
//
// Produces:
// - application/json
// - text/plain
//
// Resp... | if err != nil { |
<|file_name|>state.js<|end_file_name|><|fim▁begin|>// These two object contain information about the state of Ebl
var GlobalState = Base.extend({
constructor: function() {
this.isAdmin = false;
this.authToken = null;
this.docTitle = null;
this.container = null;
// d... | };
var gState = new GlobalState(); // state shared among the entire session |
<|file_name|>test_taps_not_list.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# write an experiment that raises an exception
import sys
import os
BOREALISPATH = os.environ['BOREALISPATH']
sys.path.append(BOREALISPATH)
<|fim▁hole|>import experiments.superdarn_common_fields as scf
from experiment_prototype.experim... | |
<|file_name|>account.py<|end_file_name|><|fim▁begin|>import telepathy
from telepathy.interfaces import CONN_MGR_INTERFACE
import dbus
def parse_account(s):
lines = s.splitlines()
pairs = []
manager = None
protocol = None
for line in lines:
if not line.strip():
continue
... | |
<|file_name|>meta-floor.js<|end_file_name|><|fim▁begin|>class MetaFloorController extends MRM.MetaBaseWallController{
constructor(dom){
super(dom);
this.dom = dom;
this.metaObject = this.createMetaObject()
this.metaVerse = null;
this.setupComponent();
this.updateMetaObject();
}
get metaA... |
get propertiesSettings(){
return {
width: { type: Number, default: 1 }, |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.