prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>scatter_profile.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- noplot -*-
"""
N Classic Base renderer Ext renderer
20 0.22 0.14 0.14
100 0.16 0.14 0.13
1000 0.45 0.26 0.17
10000 3.30 1.31 ... | |
<|file_name|>prng.cpp<|end_file_name|><|fim▁begin|>// prng.cpp or pseudo-random number generator (prng)
// Generates some pseudo-random numbers.
#include <iostream>
#include <iomanip>
using std::cout; // iostream
using std::endl;
using std::setw; // iomanip
// function generates random number
unsigned pseudoRNG() {
s... |
// new line every fifth number |
<|file_name|>Hotdot.js<|end_file_name|><|fim▁begin|>import React from 'react';
import {
Link
} from 'react-router';
import HotdotActions from '../actions/HotdotActions';
import HotdotObjStore from '../stores/HotdotObjStore';
import MyInfoNavbar from './MyInfoNavbar';
import Weixin from './Weixin';
class Hotdot ... | var monthList = firstHotData.month.map((monthItem,i)=>(
<li className="list-group-item" key={i}> |
<|file_name|>kindle_test.go<|end_file_name|><|fim▁begin|>package kindle
import (
"fmt"
"path/filepath"
"reflect"
"runtime"
"strings"
"testing"
"time"
ledgertools "github.com/ginabythebay/ledger-tools"
)
var happyEmail = strings.TrimSpace(`
Hello Gina White,
Thank you for shopping with us. All Kindle content... | fmt.Printf("\033[31m%s:%d: unexpected error: %s\033[39m\n\n", filepath.Base(file), line, err.Error())
tb.FailNow() |
<|file_name|>stats.py<|end_file_name|><|fim▁begin|>from datetime import datetime
from app import app
from app.authentication import with_login
from flask import Blueprint, jsonify, request, Response
from app.generate_csv import generate_csv_clean
from app.msol_util import get_next_update_estimation_message_aws
from app... | |
<|file_name|>ShoppingCartComponent.java<|end_file_name|><|fim▁begin|>package sunning.democollection.learn._0331.component;
import dagger.Component;
import sunning.democollection.learn._0331.UserActivity;
import sunning.democollection.learn._0331.module.ShoppingCartModule;
<|fim▁hole|>public interface ShoppingCartCompo... | /**
* Created by sunning on 16/3/31.
*/
@Component(dependencies = ActivityComponent.class, modules = ShoppingCartModule.class) |
<|file_name|>tty_term.go<|end_file_name|><|fim▁begin|>package namespaces
import (
"io"<|fim▁hole|> "github.com/dotcloud/docker/pkg/term"
)
type TtyTerminal struct {
stdin io.Reader
stdout, stderr io.Writer
master *os.File
state *term.State
}
func (t *TtyTerminal) Resize(h, w int) error... | "os"
"os/exec"
|
<|file_name|>css-hint-server.js<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2012-2015 S-Core Co., Ltd.
*
* 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... | token.type = 'class';
token.start = token.start + 1;
token.string = token.string.substr(1);
} else if (token.type === 'builtin' && /^#/.test(token.string)) { |
<|file_name|>ge.rs<|end_file_name|><|fim▁begin|>#![feature(core)]
extern crate core;
// macro_rules! e {
// ($e:expr) => { $e }
// }
// macro_rules! tuple_impls {
// ($(
// $Tuple:ident {
// $(($idx:tt) -> $T:ident)+
// }
// )+) => {
// ... | // (0) -> A
// (1) -> B
// (2) -> C |
<|file_name|>getIconUnicode.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>import defaultIconsMeta from '../../form/editors/impl/iconEditor/icons.json';
type options = {
iconsMeta: any
};
export default ({ iconsMeta = defaultIconsMeta }: options = { iconsMeta }): Function => {
const getIconUnicode = (iconName: s... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
import binascii
import hashlib
import logging
import socket
import ssl
import sys
from ansible.module_utils.mt_api.retryloop import RetryError
from ansible.module_utils.mt_api.retryloop import retryloop
from ansible.module_u... | mt = RosAPI(s)
mt.login(self.username, self.password)
return mt
|
<|file_name|>views.py<|end_file_name|><|fim▁begin|><|fim▁hole|>import httplib2
import urllib
from django.utils import simplejson as json
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.utils.html import escape
from django.views.decorators.csrf import csrf_exempt
im... | import random
from django.http import HttpResponse
from httplib import HTTPConnection, HTTPSConnection
from urlparse import urlsplit |
<|file_name|>EventInterface.ts<|end_file_name|><|fim▁begin|>interface EventInterface <EventPayload> {
<|fim▁hole|> removeHandler<T>(handler: EventInterface.HandlerInterface<EventPayload, T>, context?: T): EventInterface<EventPayload>;
}
module EventInterface {
export interface HandlerInterface<EventPayload, T>... | addHandler<T>(handler: EventInterface.HandlerInterface<EventPayload, T>, context?: T): EventInterface<EventPayload>;
|
<|file_name|>api.xpack.autoscaling.put_autoscaling_policy.go<|end_file_name|><|fim▁begin|>// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License.<|fim▁hole|>// See the LICENSE file in the project root for more information.
//
// Code g... | |
<|file_name|>CmdAppBase.java<|end_file_name|><|fim▁begin|>/**
*
*/
package edu.ku.brc.specify.tools.export;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;... | |
<|file_name|>add-channel-form.js<|end_file_name|><|fim▁begin|><|fim▁hole|> actions: {
addFavorite() {
this.sendAction('addFavorite', this.get('newFavorite'));
}
}
});<|fim▁end|> | import Ember from 'ember';
export default Ember.Component.extend({ |
<|file_name|>manager.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use std::io;
use std::sync::mpsc::{channel, RecvTimeoutError,... | application, |
<|file_name|>IO_coroutine_stu1.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# -*- coding:UTF-8 -*-
#Copyright (c) 1986 Nick Wong.
#Copyright (c) 2016-2026 TP-NEW Corp.
# License: TP-NEW (www.tp-new.com)
__author__ = "Nick Wong"
"""
用asyncio提供的@asyncio.coroutine可以把一个generator标记为coroutine类型,然后在coroutine内部用yi... | loop.run_until_complete(hello1()) |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Copyright © 2015, Peter Atashian
// Licensed under the MIT License <LICENSE.md>
//! FFI bindings to elfapi.
#![no_std]
#![experimental]
extern crate winapi;<|fim▁hole|>}<|fim▁end|> | use winapi::*;
extern "system" { |
<|file_name|>Utility.js<|end_file_name|><|fim▁begin|>define([], function () {
var TAGNAMES = {
'select':'input',
'change':'input',
'submit':'form',
'reset':'form',
'error':'img',
'load':'img',
'abort':'img'
};
var Utility = function() {
};
Utility.isEventSupported = functi... |
for (var i = 0; i < len; i++) { |
<|file_name|>syntax-extension-bytes-unsupported-literal.rs<|end_file_name|><|fim▁begin|>// Copyright 2013 The Rust Project Developers. See the COPYRIGHT<|fim▁hole|>//
// 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... | // file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT. |
<|file_name|>Communicator.js<|end_file_name|><|fim▁begin|>// @flow
import React from 'react'
import withPropsStream from '@vega/utils/withPropsStream'
import {map} from 'rxjs/operators'<|fim▁hole|>
import styles from './styles/Communicator.css'
import ThreadList from './ThreadList'
import CreateComment from './CreateCo... | |
<|file_name|>OneCustomerCtrl.js<|end_file_name|><|fim▁begin|>(function () {
'use strict';
angular.module('customers')
.controller('OneCustomerCtrl', function ($scope, customers, $stateParams) {
var cid = $stateParams.cid;<|fim▁hole|> console.log($scope.customer);
});
})... | $scope.customer=_.find(customers, function (customer) {
return customer.profile.userName===cid;
}); |
<|file_name|>select.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|>ECBDataLoaderScheduler.java<|end_file_name|><|fim▁begin|>package ch.bisi.koukan.job;
import ch.bisi.koukan.provider.XMLExchangeRatesProvider;
import ch.bisi.koukan.repository.DataAccessException;
import ch.bisi.koukan.repository.ExchangeRatesRepository;
import java.io.IOException;
import java.io.InputStre... | |
<|file_name|>viewport.rs<|end_file_name|><|fim▁begin|>// This file is part of rgtk.
//
// rgtk 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 License, or
// (at your option) a... | }
} |
<|file_name|>1A.py<|end_file_name|><|fim▁begin|>num = input("What is the numerator")
dem = input("What is the denominator")
counta = 2
countb = 2
def math (num,dem):
remainsa = 1
remainsb = 1
remains = remainsa - remainsb
while remains > 0:
a = num / counta
b = dem / countb<|fim▁hole|... | remainsa = num % counta
remainsb = num % countb
remains = remainsa - remainsb |
<|file_name|>nested.py<|end_file_name|><|fim▁begin|>def g(x):
import random
return int(x * random.random())
def h(x):
return sum(tmap(g, x))
def f(x,y):
return x*y<|fim▁hole|>
x = range(10)
y = range(5)
if __name__ == '__main__':
from pathos.helpers import freeze_support
freeze_support()
from p... | |
<|file_name|>ckanutils.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# vim: sw=4:ts=4:expandtab
"""
ckanutils
~~~~~~~~~
Provides methods for interacting with a CKAN instance
Examples:
literal blocks::
python example_google.py
Attributes:
CKAN_KEYS (List[str]): available CKAN keyword argum... | |
<|file_name|>test_OCB.py<|end_file_name|><|fim▁begin|># ===================================================================
#
# Copyright (c) 2014, Legrandin <helderijs@gmail.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that th... | data_128 = get_tag_random("data_128", 16)
def test_loopback_128(self):
cipher = AES.new(self.key_128, AES.MODE_OCB, nonce=self.nonce_96) |
<|file_name|>marathon.py<|end_file_name|><|fim▁begin|>import contextlib
import pytest
import logging
from distutils.version import LooseVersion
from .service import service_available_predicate
from ..clients import marathon
from ..matcher import assert_that, eventually, has_len
logger = logging.getLogger(__name__)
... | |
<|file_name|>Registry.java<|end_file_name|><|fim▁begin|>package crashreporter.api;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Registry for API provider objects.
*
* @author Richard
*/
public c... | // first the preferred one
PastebinProvider preferred = CallHandler.instance.getPastebin();
if (preferred != null) providers.add(preferred);
// then the rest |
<|file_name|>production.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, unicode_literals
from .base import *
DEBUG = False
TEMPLATE_DEBUG = False
COMPRESS_OFFLINE = True
AWS_STORAGE_BUCKET_NAME = get_env_variable("AWS_STORAGE_BUCKET_NAME")
AWS_S3_CUSTOM_DOMAIN = '{}.s3.amazonaws.com'.format(... | |
<|file_name|>interfaces.py<|end_file_name|><|fim▁begin|>from django.utils.safestring import mark_safe
from corehq.apps.data_interfaces.dispatcher import EditDataInterfaceDispatcher
from corehq.apps.groups.models import Group
from django.core.urlresolvers import reverse
from corehq.apps.reports import util
from corehq.a... | display = CaseDisplay(self, case)
yield [
checkbox % dict(case_id=case['_id'], owner=display.owner_id, owner_type=display.owner_type),
display.case_link, |
<|file_name|>win_reward.py<|end_file_name|><|fim▁begin|># This file is part of ArcJail.
#
# ArcJail 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 of the License, or
# (at your option) any la... | |
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function
from django.db import models
from django.apps import apps
from empresa.models import Empresa
import json
import os
import tempfile
import datetime
import requests
class Parking(models.M... | |
<|file_name|>weir.py<|end_file_name|><|fim▁begin|>import math
from .link import Link
from nimbus.reports import report as rp
from nimbus.reports import input as inp
from nimbus.network.links.sections import circle as cir
from nimbus.network.links.sections import rectangle as rct
class Weir(Link):
def... | def get_flow(self, stage1, stage2):
"""Return the flow of the weir given the stages on both sides of the link."""
crown = self.invert + self.section.rise / 12.0
center = self.invert + self.section.rise / 12.0 / 2.0
|
<|file_name|>notify.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python<|fim▁hole|>import sys
import time
from timerasp import gmail
if __name__ == '__main__':
time.sleep(300)
gmail.send_email('notify.py: IP:{}'.format(' '.join(sys.argv[1:])),
'Notify was run and is telling you somethin... | |
<|file_name|>inst.apk.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
<|fim▁hole|>import os
import shutil
import glob
import time
import sys
import subprocess
from optparse import OptionParser, make_option
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARAMETERS = None
ADB_CMD = "adb"
def doCMD(cmd)... | |
<|file_name|>cachestatus.js<|end_file_name|><|fim▁begin|>/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obta... | var cache_service = Components.classes["@mozilla.org/network/cache-service;1"]
|
<|file_name|>benchmark.py<|end_file_name|><|fim▁begin|>from djangobench.utils import run_benchmark
from query_latest.models import Book
def benchmark():
Book.objects.latest()<|fim▁hole|>
run_benchmark(
benchmark,
meta = {
'description': 'A simple Model.objects.latest() call.',
}
)<|fim▁end|> | |
<|file_name|>generator2.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Module: generator2.py
# Purpose: sample generator classes #2
# Date: N/A
# Notes:
# 1) Test python code
# 2) Ref: https://docs.python.org/2/reference/expressions.html
import numpy as np
print "generator2.py: python generato... | iiv=xv
except Exception, e:
yield e |
<|file_name|>TestConfig.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2002-2018 "Neo Technology,"
* Network Engine for Objects in Lund AB [http://neotechnology.com]
*
* This file is part of Neo4j.
*
* Neo4j is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Pub... | |
<|file_name|>JRubyExample.java<|end_file_name|><|fim▁begin|>package me.soulmachine;
import org.jruby.embed.ScriptingContainer;
import java.util.List;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineFactory;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
/**
* A sim... | final ScriptEngine pyEngine = mgr.getEngineByName("ruby"); |
<|file_name|>barnes_two_planets.py<|end_file_name|><|fim▁begin|>#!usr/bin/env python<|fim▁hole|>from pyspace.simulator import BarnesSimulator
import numpy
x = numpy.array([0,100])
y = numpy.array([0,0])
z = numpy.array([0,0])
m = numpy.array([1000,1])
v_y = numpy.array([0,(1000/100)**0.5])
pa = PlanetArray(x, y, z,... | from pyspace.planet import PlanetArray |
<|file_name|>0039_auto__add_externalaccount.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'ExternalAccount'
... | 'always_auto_complete': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'auto_complete': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'... |
<|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 phreak</source>
<translation type="unfinished"/... | <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+4"/> |
<|file_name|>local-store-manager.service.ts<|end_file_name|><|fim▁begin|>// =============================
// Email: info@ebenmonney.com
// www.ebenmonney.com/templates
// =============================
import { Injectable } from '@angular/core';
import { Observable, Subject } from 'rxjs';
import { Utilities } from './... | |
<|file_name|>PokecheckmeCommand.java<|end_file_name|><|fim▁begin|>package com.pixelutilitys.commands;
import com.pixelmonmod.pixelmon.Pixelmon;
import com.pixelmonmod.pixelmon.enums.EnumGui;
import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.Entity... | return "/pokecheckme";
}
|
<|file_name|>deletionServerInput.ts<|end_file_name|><|fim▁begin|>/**
* vinimay
* Vinimay is a decentralised social network focused on giving back control of its data to the user
*
* OpenAPI spec version: 0.1.0
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/... | /**
* The token identifying the relationship |
<|file_name|>behavior_binary_table.py<|end_file_name|><|fim▁begin|>"""
BORIS
Behavioral Observation Research Interactive Software
Copyright 2012-2022 Olivier Friard
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 S... | sel_subject_dict, t, time_interval)
cols = [float(t)] # time
|
<|file_name|>moc_qtesteventloop.cpp<|end_file_name|><|fim▁begin|>/****************************************************************************
** Meta object code from reading C++ file 'qtesteventloop.h'
**
** Created: Mon 26. Nov 09:22:32 2012
** by: The Qt Meta Object Compiler version 63 (Qt 4.8.4)
**
** WARNING... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""
Weather component that handles meteorological data for your location.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/weather/
"""
import asyncio
import logging
from homeassistant.helpers.entity_... | """ABC for weather data."""
|
<|file_name|>sample-nowplaying.js<|end_file_name|><|fim▁begin|>// GET /api/v1/nowplaying/groovesalad
{
"stationId": "groovesalad",
"time": 1425871720000,
"artist": "Panorama",<|fim▁hole|> "artistCorrected": false,
"albumCorrected": false,
"corrected": false,
"duration": 335000,
"durationEstimated": false... | "title": "Selene",
"album": "Panorama",
"trackCorrected": false, |
<|file_name|>cmdi2html.js<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2015 Max Planck Institute for Psycholinguistics
*
* 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... | $(".searchword").parents('.IMDI_group.cmdi').addClass('expanded');
}
|
<|file_name|>test_curried.py<|end_file_name|><|fim▁begin|>import toolz
from toolz.curried import take, first, second, sorted, merge_with
def test_take():
assert list(take(2)([1, 2, 3])) == [1, 2]
<|fim▁hole|>
def test_merge_with():
assert merge_with(sum)({1: 1}, {1: 2}) == {1: 3}
def test_sorted():
as... | def test_first():
assert first is toolz.itertoolz.core.first |
<|file_name|>context.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/. */
//! Data needed by the layout task.
#![deny(unsafe_code)]
u... | use script::layout_interface::{Animation, LayoutChan, ReflowGoal};
use std::cell::{RefCell, RefMut};
use std::collections::HashMap; |
<|file_name|>metrics_test.py<|end_file_name|><|fim▁begin|># Copyright 2021 The FedLearner Authors. 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.apac... | |
<|file_name|>attachment.py<|end_file_name|><|fim▁begin|>from django.conf import settings
from django.db import models
<|fim▁hole|>
class Attachment(models.Model):
"""Ticket attachment model."""
ticket = models.ForeignKey(
Ticket, blank=False, related_name='attachments', db_index=True,
on_delete... | from .ticket import Ticket
|
<|file_name|>xkcdplot.py<|end_file_name|><|fim▁begin|>"""
XKCD plot generator
-------------------
Author: Jake Vanderplas
This is a script that will take any matplotlib line diagram, and convert it
to an XKCD-style plot. It will work for plots with line & text elements,
including axes labels and titles (but not axes ... | |
<|file_name|>exceptions.py<|end_file_name|><|fim▁begin|><|fim▁hole|>"""<|fim▁end|> | """
Contains exception classes specific to this project. |
<|file_name|>ObservationSequences.cpp<|end_file_name|><|fim▁begin|>#include "ObservationSequences.h"
#include <iostream>
#include <fstream>
#include <algorithm>
#include "boost\filesystem.hpp"
using namespace std;
namespace bst = boost::filesystem;
ObservationSequences::~ObservationSequences()
{
}
ObservationSeque... | |
<|file_name|>error.rs<|end_file_name|><|fim▁begin|>use mysql;
use std::{error, fmt, result};
<|fim▁hole|>pub enum Error {
Mysql(mysql::Error),
RecordNotFound(u64),
ColumnNotFound,
AddressChecksumToTrits,
}
pub type Result<T> = result::Result<T, Error>;
impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt... | #[derive(Debug)] |
<|file_name|>test_vpc_network_pfrules.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 ... |
def __init__(self):
self.services = { |
<|file_name|>try_catch.rs<|end_file_name|><|fim▁begin|>/// Wraps a computation with an RAII-allocated Nan::TryCatch.<|fim▁hole|><|fim▁end|> | pub use neon_sys::Neon_TryCatch_With as with;
pub use neon_sys::TryCatchControl; |
<|file_name|>books.server.controller.js<|end_file_name|><|fim▁begin|>'use strict';
/**
* Module dependencies.
*/
var mongoose = require('mongoose'),
errorHandler = require('./errors'),
Book = mongoose.model('Book'),
_ = require('lodash');
// ,
// googleapi = require('node-google-api')('AIzaSyAffzxPYpgZ14gieEE04... | req.book = book ;
next();
});
}; |
<|file_name|>tree.rs<|end_file_name|><|fim▁begin|>// Copyright 2016 The xi-editor 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... | if rope1.is_ok_child() && rope2.is_ok_child() { |
<|file_name|>session.py<|end_file_name|><|fim▁begin|># coding: utf-8
"""
Talon.One API
The Talon.One API is used to manage applications and campaigns, as well as to integrate with your application. The operations in the _Integration API_ section are used to integrate with our platform, while the other operati... |
:return: The token of this Session. # noqa: E501 |
<|file_name|>brocade_aaa.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import xml.etree.ElementTree as ET
class brocade_aaa(object):
"""Auto generated class.
"""
def __init__(self, **kwargs):
self._callback = kwargs.pop('callback')
def aaa_config_aaa_authentication_login_... | """Auto Generated Code
""" |
<|file_name|>guiTest.py<|end_file_name|><|fim▁begin|>import os
import sys
import shutil
import errno
import time
import hashlib
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions
i... | |
<|file_name|>Deferred.js<|end_file_name|><|fim▁begin|>dojo.provide("tests._base.Deferred");
var delay = function(ms){
var d = new dojo.Deferred();
ms = ms || 20;
setTimeout(function(){
d.progress(0.5);
},ms/2);
setTimeout(function(){
d.resolve();
},ms);
return d.promise;
};
doh.register("tests._base.Deferre... | |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>import re
from setuptools import setup, find_packages
# Auto detect the library version from the __init__.py file
with open('xbee/__init__.py', 'r') as fd:
version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]',
fd.read(), re.MULTILI... | extras_require={
'tornado': ['tornado']
} |
<|file_name|>shows-model.js<|end_file_name|><|fim▁begin|>import xhr from './lib/xhr';
class ShowsModel {
constructor() {
this.shows = [];<|fim▁hole|> fetch(cb) {
xhr('https://raw.githubusercontent.com/dashersw/erste.js-demo/master/src/static/data/shows.json', (err, data) => {
this.sh... | }
|
<|file_name|>Alayaya.js<|end_file_name|><|fim▁begin|>const DrawCard = require('../../drawcard.js');
class Alayaya extends DrawCard {
setupCardAbilities() {<|fim▁hole|> this.reaction({
when: {
afterChallenge: event => (
event.challenge.winner === this.controlle... | |
<|file_name|>test-fast-csv.js<|end_file_name|><|fim▁begin|>// Generated by CoffeeScript 1.7.1
(function() {
var $, CSV, ES, TEXT, TRM, TYPES, alert, badge, create_readstream, debug, echo, help, info, log, njs_fs, rainbow, route, rpr, urge, warn, whisper;
njs_fs = require('fs');
TYPES = require('coffeenode-types... | var count;
count = 0;
input_stream.on('end', function() { |
<|file_name|>app.js<|end_file_name|><|fim▁begin|>/**
* @module main application controller
* @description Runs socket.io and static http server, listens for client connections and directs user/room instances.
*
* @author cemckinley <cemckinley@gmail.com>
* @copyright Copyright (c) 2013 Author, contributo... | socketio = require('socket.io'),
config = require('./config/env'),
db = require('./controllers/db'),
SessionHandler = require('./controllers/session-handler'), |
<|file_name|>NapierDBVis.java<|end_file_name|><|fim▁begin|>package example.multiview;
import io.db.Connect;
import io.db.ConnectFactory;
import io.db.FormatResultSet;
import io.json.JSONStructureMaker;
import io.parcoord.db.MakeTableModel;
import java.awt.BasicStroke;
import java.awt.BorderLayout;
import java.awt.Col... | jtp.setPreferredSize(new Dimension (800, 480)); |
<|file_name|>run.py<|end_file_name|><|fim▁begin|>"""
Usage:
run.py mlp --train=<train> --test=<test> --config=<config>
run.py som --train=<train> --test=<test> --config=<config>
Options:
--train Path to training data, txt file.
--test Path to test data, txt file.
--config Json configuration for th... | |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""This file contains utility functions."""
import logging
import re
# Illegal Unicode characters for XML.
ILLEGAL_XML_RE = re.compile(
ur'[\x00-\x08\x0b-\x1f\x7f-\x84\x86-\x9f'
ur'\ud800-\udfff\ufdd0-\ufddf\ufffe-\uffff]')
def IsTe... |
Parsers need quick and at least semi reliable method of discovering whether
or not a particular byte stream is a text or resembles text or not. This can
be used in text parsers to determine if a file is a text file or not for |
<|file_name|>logging.js<|end_file_name|><|fim▁begin|>/**
@license
* @pnp/logging v1.0.3 - pnp - light-weight, subscribable logging framework
* MIT (https://github.com/pnp/pnp/blob/master/LICENSE)
* Copyright (c) 2018 Microsoft
* docs: http://officedev.github.io/PnP-JS-Core
* source: https://github.com/pnp/pnp
* b... | Logger.instance.log({ level: level, message: message });
}
/**
* Writes the supplied string to the subscribed listeners
|
<|file_name|>type_support.cpp<|end_file_name|><|fim▁begin|>// Copyright 2014 Open Source Robotics Foundation, 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.apa... | {
return rosidl_typesupport_cpp::get_message_type_support_handle< |
<|file_name|>test_UseCaseContribution.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... | self.assertEqual(orc.meansEnd(), irc.meansEnd())
self.assertEqual(orc.contribution(), irc.contribution())
def testUpdateContribution(self): |
<|file_name|>cargo_compile.rs<|end_file_name|><|fim▁begin|>//!
//! Cargo compile currently does the following steps:
//!
//! All configurations are already injected as environment variables via the
//! main cargo command
//!
//! 1. Read the manifest
//! 2. Shell out to `cargo-resolve` with a list of dependencies and so... | build_config.release = release;
if let CompileMode::Doc { deps } = mode {
build_config.doc_all = deps;
} |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>/*
* Geoide Composer, configuration tool for Geoide Viewer <|fim▁hole|>
import './startup.js';
import './jsonapi.js';
import './json_gv_api.js';
import './json_map_api.js';
import './parse_capabilities.js';<|fim▁end|> | * Copyright (C) 2016 IDgis
* See license:
* https://github.com/IDgis/geoide-admin/blob/master/LICENSE
*/ |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# LICENSE
#
# Copyright (c) 2010-2017, GEM Foundation, G. Weatherill, M. Pagani,<|fim▁hole|>#
# The Hazard Modeller's Toolkit is free software: you can redistribute
# it and/or modify it under th... | # D. Monelli. |
<|file_name|>demo42.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# Copyright (c) 2015, BROCADE COMMUNICATIONS SYSTEMS, INC
# All rights reserved.
# Redistribution and use in source and binary forms, with or without<|fim▁hole|># 1. Redistributions of source code must retain the above copyright notice,
# this li... | # modification, are permitted provided that the following conditions are met:
|
<|file_name|>other.go<|end_file_name|><|fim▁begin|>// Copyright 2015 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build !windows
package windriver
import (<|fim▁hole|> "github.com/oakmound/oak/v3/shiny/driver/internal... | "fmt"
"runtime"
|
<|file_name|>error.rs<|end_file_name|><|fim▁begin|>extern crate openssl;
use openssl::error as openssl_err;
use postgres::error as postgres_err;
use rustc_serialize::json;
use std::{io, error, fmt};
/// Proton's own error type, to make return types consistent.
#[derive(Debug)]
pub enum Error {
Io(io::Error),
... | Error::DuplicateUser(_, _) => "User already exists",
Error::DuplicateSequence(_) => "Sequence already exists", |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>use crate::c_str;
use crate::graphic::{GlBuffer, GlProgram, GlProgramBuilder, GlUniform, GlVertexArray};
use crate::opengl;
use nalgebra::{Isometry3, Matrix4, Point3};
use opengl::types::{GLsizeiptr, GLuint};
use std::ffi::c_void;
use std::mem;
use std::rc::Rc;
mod la... | } |
<|file_name|>user.py<|end_file_name|><|fim▁begin|>from rest_framework import serializers<|fim▁hole|>
class UserProfileSerializer(serializers.ModelSerializer):
class Meta:
model = UserProfile
fields = ('name', )
class UserSerializer(serializers.ModelSerializer):
"""
Serializes User objects... | from django.contrib.auth.models import User
from dixit.account.models import UserProfile
|
<|file_name|>message.go<|end_file_name|><|fim▁begin|>// Copyright 2014 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum 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... | }
// Send writes an RLP-encoded message with the given code. |
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>"""
Tests for open ended grading interfaces
./manage.py lms --settings test test lms/djangoapps/open_ended_grading
"""
import ddt
import json
import logging
from django.conf import settings
from django.contrib.auth.models import User
from django.core.urlresolvers imp... | |
<|file_name|>moveit_attached_object_demo.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""
moveit_attached_object_demo.py - Version 0.1 2014-01-14
Attach an object to the end-effector and then move the arm to test collision avoidance.
Created for the Pi Robot Project: http://www.pirobot.o... | |
<|file_name|>15.py<|end_file_name|><|fim▁begin|><|fim▁hole|> if number not in found_numbers:
found_numbers[number] = number
else:
return False
return True<|fim▁end|> | def unique_elems(data):
found_numbers = {}
for number in data: |
<|file_name|>detectFlash.js<|end_file_name|><|fim▁begin|>// -----------------------------------------------------------------------------
// Globals
// Major version of Flash required
var requiredMajorVersion = 8;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Minor version of Flash required
... | versionMinor = tempArrayMajor[1];
if ( descArray[3] != "" ) {
tempArrayMinor = descArray[3].split("r");
|
<|file_name|>mongo.go<|end_file_name|><|fim▁begin|>// Copyright (C) MongoDB, Inc. 2017-present.
//
// 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
... | registry = bson.DefaultRegistry
}
if val == nil {
return bsoncore.Value{}, ErrNilValue |
<|file_name|>test.routing.ts<|end_file_name|><|fim▁begin|>/**
* Created by Andreas Mann on 20.12.2016.
*/
import { Routes, RouterModule } from '@angular/router';
import { TestComponent } from './test.component';
import { TableComponent } from './table/table.component';<|fim▁hole|> path: '',
component: TestCom... | import { ProjectComponent } from './project/project.component';
const routes: Routes = [
{ |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import include, url
<|fim▁hole|> url(r'^$', views.BlogListView.as_view(), name="blog_list"),
url(r'^(?P<slug>[\w-]+)/$', views.BlogSingleView.as_view(), name="blog_single"),
url(r'^category/(?P<slug>[\w-]+)/$', views.BlogCategoryView.as_... | from . import views
urlpatterns = [ |
<|file_name|>validator.go<|end_file_name|><|fim▁begin|>// Package govalidator is package of validators and sanitizers for strings, structs and collections.
package govalidator
import (
"encoding/json"
"fmt"
"net"
"net/url"
"reflect"
"regexp"
"sort"
"strings"
"unicode"
"unicode/utf8"
)
var fieldsRequiredByDe... | case Errors:
for _, item := range e.(Errors).Errors() {
m[item.(Error).Name] = item.(Error).Err.Error()
} |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Amara, universalsubtitles.org
#
# Copyright (C) 2013 Participatory Culture Foundation
#
# 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 Found... | # License, or (at your option) any later version.
# |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.