prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>IpWatch.java<|end_file_name|><|fim▁begin|>/*
* $Id: IpWatch.java 3905 2008-07-28 13:55:03Z uckelman $
*
* Copyright (c) 2007-2008 by Rodney Kinney
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License (LGPL) as publi... | |
<|file_name|>test-api.ts<|end_file_name|><|fim▁begin|>// Typescript adaptation of mithril's test suite.
// Not intended to be run; only to compile & check types.
import * as m from 'mithril';
import * as Stream from 'mithril/stream';
const FRAME_BUDGET = 100;
{
const vnode = m('div');
console.assert(vnode.ta... | m('section#main', { style: { display: state.todos.length > 0 ? '' : 'none' } }, [
m("input#toggle-all[type='checkbox']", { checked: state.remaining === 0, onclick: ui.toggleAll }), |
<|file_name|>loadjs.js<|end_file_name|><|fim▁begin|>loadjs = (function () {
/**
* Global dependencies.
* @global {Object} document - DOM
*/
var devnull = function() {},
bundleIdCache = {},
bundleResultCache = {},
bundleCallbackQueue = {};
/**
* Subscribe to bundle load event.
* @param {string[]} bun... | continue;
}
// add to callback queue |
<|file_name|>fake_blobstore_factory.go<|end_file_name|><|fim▁begin|>package fakes<|fim▁hole|> biblobstore "github.com/cloudfoundry/bosh-cli/blobstore"
)
type FakeBlobstoreFactory struct {
CreateBlobstoreURL string
CreateBlobstore biblobstore.Blobstore
CreateErr error
}
func NewFakeBlobstoreFactory() *F... |
import ( |
<|file_name|>DataSetSelectionTable.java<|end_file_name|><|fim▁begin|>package idare.imagenode.internal.GUI.DataSetController;
import idare.imagenode.ColorManagement.ColorScalePane;
import idare.imagenode.Interfaces.DataSets.DataSet;
import idare.imagenode.Interfaces.Layout.DataSetLayoutProperties;
import idare.imagenod... | if(current != null) |
<|file_name|>LossOfControl.ts<|end_file_name|><|fim▁begin|>import { OvaleDebug } from "./Debug";
import { OvaleProfiler } from "./Profiler";
import { Ovale } from "./Ovale";
import { OvaleState } from "./State";
import { RegisterRequirement, UnregisterRequirement, Tokens } from "./Requirement";
import aceEvent fro... | |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from frontend import views
from rest_framework import routers
from django.conf.urls import patterns, url, include
router = routers.DefaultRouter()
router.register(r'categories', views.CategoryViewSet)
router.register(r'packages', views.PackageViewSet)
router.register(r... | router.register(r'packageavailability', views.ClientPackageAvailabilityViewSet)
router.register(r'fileavailability', views.ClientFileAvailabilityViewSet)
urlpatterns = patterns('', |
<|file_name|>SortedSetMultimap.java<|end_file_name|><|fim▁begin|>// Generated automatically from com.google.common.collect.SortedSetMultimap for testing purposes
package com.google.common.collect;
import com.google.common.collect.SetMultimap;
import java.util.Collection;
import java.util.Comparator;
import java.util.... | } |
<|file_name|>test_write_worksheet.py<|end_file_name|><|fim▁begin|>###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
import unittest<|fim▁hole|>
class TestWriteWorksheet(unittest.TestCase):
"""
... | from ...compatibility import StringIO
from ...worksheet import Worksheet
|
<|file_name|>score_board_test.py<|end_file_name|><|fim▁begin|>import unittest
import datetime
from classes.score_board import ScoreBoard
class DateTimeStub(object):
def now(self):
return "test_date_time"
class ScoreBoardTest(unittest.TestCase):
def __init__(self, *args, **kwargs):
super(ScoreBoardTest, se... | |
<|file_name|>main_ascii_iterate.go<|end_file_name|><|fim▁begin|>package main
import "./ascii"
func main() {<|fim▁hole|><|fim▁end|> | ascii.IterateOverASCIIStringLiteral()
} |
<|file_name|>helpers_test.go<|end_file_name|><|fim▁begin|>/*
Copyright 2014 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
U... | gv: schema.GroupVersion{Group: "", Version: "v1"},
expected: &v1.Pod{
TypeMeta: metav1.TypeMeta{
APIVersion: "v1", |
<|file_name|>errorlib.go<|end_file_name|><|fim▁begin|>package errorlib
import (
"bytes"
"errors"
"fmt"
)
// Merge merges a slice of errors into a single error.
func Merge(errs []error) error {
if len(errs) == 0 {
return nil<|fim▁hole|> if len(errs) == 1 {
return errs[0]
}
var buf bytes.Buffer
numErrors := ... | } |
<|file_name|>DoubleSquares.go<|end_file_name|><|fim▁begin|>/*
A double-square number is an integer X which can be expressed as the sum of two perfect squares. For example, 10 is a double-square because 10 = 32 + 12. Your task in this problem is, given X, determine the number of ways in which it can be written as the su... | lineNo++
continue |
<|file_name|>v8-profiler.js<|end_file_name|><|fim▁begin|>var binary = require('node-pre-gyp');
var path = require('path');<|fim▁hole|>
var Stream = require('stream').Stream,
inherits = require('util').inherits;
function Snapshot() {}
Snapshot.prototype.getHeader = function() {
return {
typeId: this.typeId,
... | var binding_path = binary.find(path.resolve(path.join(__dirname,'./package.json')));
var binding = require(binding_path); |
<|file_name|>LoginandSignupV10.py<|end_file_name|><|fim▁begin|>from tkinter import *
import mysql.connector as mysql
from MySQLdb import dbConnect
from HomeOOP import *
import datetime
from PIL import Image, ImageTk
class MainMenu(Frame):
def __init__(self, parent): #The very first screen of the web app
... | r = Tk() |
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*-
# Copyright (c) 2017-2021 THL A29 Limited, a Tencent company. 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 ... | """
self.CustomerAssetId = None |
<|file_name|>Font.js<|end_file_name|><|fim▁begin|>lychee.define('Font').exports(function(lychee) {
var Class = function(spriteOrImages, settings) {
this.settings = lychee.extend({}, this.defaults, settings);
if (this.settings.kerning > this.settings.spacing) {
this.settings.kerning = this.settings.spacing;
... | for (var c = 0, l = this.settings.charset.length; c < l; c++) { |
<|file_name|>test_bigaddrspace.py<|end_file_name|><|fim▁begin|>from test import support
from test.support import bigaddrspacetest, MAX_Py_ssize_t
import unittest
import operator
import sys
class StrTest(unittest.TestCase):
@bigaddrspacetest
def test_concat(self):
s1 = 'x' * MAX_Py_ssize_t
se... | x += '?' # this statement uses a fast path in ceval.c
except OverflowError:
pass
else: |
<|file_name|>meshconvert.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
""" Module for converting various mesh formats."""
# Copyright (C) 2006 Anders Logg
#
# This file is part of DOLFIN.
#
# DOLFIN is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public ... | |
<|file_name|>PoissonGeneratorTest.java<|end_file_name|><|fim▁begin|>// ============================================================================
// Copyright 2006-2012 Daniel W. Dyer
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the... | * with the specified distribution parameters.
*/
@Test(groups = "non-deterministic") |
<|file_name|>test_pt_stop_calc_dockwidget.py<|end_file_name|><|fim▁begin|># coding=utf-8
"""DockWidget test.
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of th... | QGIS_APP = get_qgis_app()
|
<|file_name|>get_test.py<|end_file_name|><|fim▁begin|>import os
import requests
import json
import pandas as pd
import numpy as np
import time
from datetime import datetime
TMDB_KEY = "60027f35df522f00e57a79b9d3568423"
"""
def get_tmdb_id_list():
#function to get all Tmdb_id between 06-16
import requests
... | stop = time.time()
print(ID_LIST)
print(stop - start)
""" |
<|file_name|>debug_unassigned_email.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
from sentry.models import Activity
from .mail import ActivityMailDebugView
class DebugUnassignedEmailView(ActivityMailDebugView):<|fim▁hole|> return {"type": Activity.UNASSIGNED, "user": request.user}<|... | def get_activity(self, request, event): |
<|file_name|>form.js<|end_file_name|><|fim▁begin|>export default {
"_id": "60228e64f2e20ca84010999a",
"type": "form",
"components": [{
"label": "Form",
"tableView": true,
"useOriginalRevision": false,
"components": [{
"label": "Text Field Child",
"tableView": true,
... | "rowDrafts": false,
"key": "editGrid",
"type": "editgrid",
"input": true, |
<|file_name|>closest_sum_pair_to_x.cpp<|end_file_name|><|fim▁begin|>#include "common_header.h"
namespace {
using ArrayType = std::vector<int>;
/** Given a sorted array and a number x, find the pair in array whose sum is closest to x
*
* @reference https://www.geeksforgeeks.org/given-sorted-array-number-x-find-p... | auto left = elements.cbegin(); |
<|file_name|>tcp_client.rs<|end_file_name|><|fim▁begin|>use std::{fmt, io};
use std::sync::Arc;
use std::net::SocketAddr;
use std::marker::PhantomData;
use BindClient;
use tokio_core::reactor::Handle;
use tokio_core::net::{TcpStream, TcpStreamNew};
use futures::{Future, Poll, Async};
// TODO: add configuration, e.g.:... | /// At the moment, this builder offers minimal configuration, but more will be
/// added over time.
#[derive(Debug)]
pub struct TcpClient<Kind, P> { |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>use std::io; // io::stdin().read_line(&mut <String>)
fn get_input() -> String {
let mut input = String::new();
match io::stdin().read_line(&mut input) {
Ok(string) => string,
Err(err) => panic!("Error: {}", err),
};
input
}
fn main() ... | .split_whitespace()
.map(|s| s.parse::<isize>().expect("Error: can't parse input"))
.sum()
); |
<|file_name|>win32spawn.py<|end_file_name|><|fim▁begin|>import os
import threading
import Queue
# Windows import
import win32file
import win32pipe
import win32api
import win32con
import win32security
import win32process
import win32event
class Win32Spawn(object):
def __init__(self, cmd, shell=False):
sel... | |
<|file_name|>BountyCoin_hi_IN.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="hi_IN" version="2.0">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About BitBl... | </message>
<message>
<location line="+4"/>
|
<|file_name|>edit-profile.route.js<|end_file_name|><|fim▁begin|>(function(){
'use strict';
angular
.module('app')
.config(['$stateProvider', '$urlRouterProvider', function($stateProvider, $urlRouterProvider) {
$stateProvider
.state('edit-profile', {<|fim▁hole|> ... | |
<|file_name|>Packages.js<|end_file_name|><|fim▁begin|>const Packages = [<|fim▁hole|> title: 'The Book',
price: 1000,
desc: `
- The Book
- 14 chapters
- 100s of examples
- Access to GitHub Repo + Source
`
},
{
id: 'bookAndVideos',
title: 'The Book and Videos',
price: 1000,
desc: `
- Th... | {
id: 'book', |
<|file_name|>service.effects.ts<|end_file_name|><|fim▁begin|>/**
* Copyright 2017 The Mifos Initiative.
*
* 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/licens... | import {Action} from '@ngrx/store'; |
<|file_name|>perfmon_tab.py<|end_file_name|><|fim▁begin|># pandas and numpy for data manipulation
import pandas as pd
import numpy as np
import sqlite3
from bokeh.plotting import Figure<|fim▁hole|> ColumnDataSource,
Panel,
FuncTickFormatter,
SingleIntervalTicker,
LinearAxis,
)
from bokeh.models impo... | from bokeh.models import (
CategoricalColorMapper,
HoverTool, |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import { combineReducers } from 'redux';
import PostsReducer from './reducer-posts';
import { reducer as formReducer } from 'redux-form';
const rootReducer = combineReducers({
posts: PostsReducer,
form: formReducer
});
<|fim▁hole|>export default rootReducer;<|fim▁... | |
<|file_name|>simplify_tables.py<|end_file_name|><|fim▁begin|>from typing import List, Tuple, Union
import fwdpy11._fwdpy11
import fwdpy11._types
import numpy as np
def simplify(pop, samples):
"""
Simplify a TableCollection stored in a Population.
:param pop: A :class:`fwdpy11.DiploidPopulation`
:par... | If the input contains ancient samples, and you wish to include them in the output, |
<|file_name|>test_default_pricing.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2016, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
import pyt... | get_default_shop
) |
<|file_name|>testPriority.rs<|end_file_name|><|fim▁begin|>extern mod extra;
use std::rt::io::*;
use std::rt::io::net::ip::SocketAddr;
use std::io::println;
use std::cell::Cell;
use std::{os, str, io, run, uint};
use extra::arc;
use std::comm::*;
use extra::priority_queue::PriorityQueue;
use std::rt::io::net::ip::*;
us... | return false; |
<|file_name|>plot_index_loop_seasonal.py<|end_file_name|><|fim▁begin|>import os
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm, colors<|fim▁hole|>nlon = 30
# Dimensions
L = 1.5e7
c0 = 2
timeDim = L / c0 / (60. * 60. * 24)
H = 200
tau_0 = 1.0922666667e-2
delta_T = 1.
sampFreq = 0.35 / 0.06... |
initDir = '../init/'
nlat = 31 |
<|file_name|>bootstrap.Spec.js<|end_file_name|><|fim▁begin|>var expect = chai.expect;
describe("sails", function() {<|fim▁hole|><|fim▁end|> | beforeEach(function() { });
afterEach(function() { });
it('should not fail', function() { expect(true).to.be.true; });
}); |
<|file_name|>file_test.go<|end_file_name|><|fim▁begin|>// Copyright 2013 com authors<|fim▁hole|>// a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, ... | //
// 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 |
<|file_name|>TeleportEvent.java<|end_file_name|><|fim▁begin|>/*
ComJail - A jail plugin for Minecraft servers
Copyright (C) 2015 comdude2 (Matt Armer)
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 Found... | (at your option) any later version.
|
<|file_name|>python_requirement_library.py<|end_file_name|><|fim▁begin|># coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
... | |
<|file_name|>6603.cpp<|end_file_name|><|fim▁begin|>#include <cstdio>
#include <vector>
using namespace std;
int k;
int s[13], result[6];
void dfs(int start, int depth) {
if (depth == 6) { // 숫자 6개를 선택했을 때
for (int i = 0; i < 6; i++) {
printf("%d ", result[i]);
}
printf("\n");
... | |
<|file_name|>file.spec.js<|end_file_name|><|fim▁begin|>const expect = require('chai').expect
const includeMimeType = require('../src/file').includeMimeType
const findInFile = require('../src/file').findInFile
describe('file : includeMimeType', () => {
it('MIME_TYPES_IGNORED contain this mime type', () => {
expe... | })
})
it('will nothing (string)', () => { |
<|file_name|>DistributedQueue.java<|end_file_name|><|fim▁begin|>package me.littlepanda.dadbear.core.queue;
<|fim▁hole|>
/**
* @author 张静波 myplaylife@icloud.com
*
*/
public interface DistributedQueue<T> extends Queue<T> {
/**
* <p>如果使用无参构造函数,需要先调用这个方法,队列才能使用</p>
* @param queue_name
* @param clazz
*... |
import java.util.Queue;
|
<|file_name|>atom_data.py<|end_file_name|><|fim▁begin|># Copyright 2013-2015 Lenna X. Peterson. All rights reserved.
from .meta import classproperty
class AtomData(object):
# Maximum ASA for each residue
# from Miller et al. 1987, JMB 196: 641-656
total_asa = {
'A': 113.0,
'R': 241.0,
... | |
<|file_name|>stderr.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | process.stderr.write('Test'); |
<|file_name|>generic_methods.hpp<|end_file_name|><|fim▁begin|>/*
* 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 later version.... | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* |
<|file_name|>mmio.rs<|end_file_name|><|fim▁begin|>// This file is part of zinc64.
// Copyright (c) 2016-2019 Sebastian Jastrzebski. All rights reserved.
// Licensed under the GPLv3. See LICENSE file in the project root for full license text.
use zinc64_core::{AddressableFaded, Chip, Ram, Shared};
pub struct Mmio {
... | 0xd400..=0xd7ff => self.sid.borrow_mut().read((address & 0x001f) as u8),
0xd800..=0xdbff => self.color_ram.borrow().read(address - 0xd800),
0xdc00..=0xdcff => self.cia_1.borrow_mut().read((address & 0x000f) as u8),
0xdd00..=0xddff => self.cia_2.borrow_mut().read((address ... |
<|file_name|>realign.py<|end_file_name|><|fim▁begin|>"""Perform realignment of BAM files around indels using the GATK toolkit.
"""
import os
import shutil
from contextlib import closing<|fim▁hole|>
import pysam
from bcbio import bam, broad
from bcbio.bam import ref
from bcbio.log import logger
from bcbio.utils import ... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2021 SoftBank Robotics. All rights reserved.
# Use of this source code is governed by a BSD-style license (see the COPYING file).<|fim▁hole|>""" This package contains the qibuild actions. """
from __... | |
<|file_name|>AHRS_Test.cpp<|end_file_name|><|fim▁begin|>// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
//
// Simple test for the AP_AHRS interface
//
#include <AP_AHRS/AP_AHRS.h>
#include <AP_HAL/AP_HAL.h>
const AP_HAL::HAL& hal = AP_HAL::get_HAL();
// INS and Baro declaration
AP_Iner... | #define HIGH 1 |
<|file_name|>grafana_dashboard.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Thierry Sallé (@seuf)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
ANSIBLE_M... | failed=False, |
<|file_name|>fft.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
<|fim▁hole|># 8 band Audio equaliser from wav file
# import alsaaudio as aa
# import smbus
from struct import unpack
import numpy as np
import wave
from time import sleep
import sys
ADDR = 0x20 #The I2C address of MCP23017
DIRA = 0x00... | |
<|file_name|>__init__.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 Apache... | # specific language governing permissions and limitations
# under the License.
''' api module ''' |
<|file_name|>presented_job_state.go<|end_file_name|><|fim▁begin|>package drain
import (
"encoding/json"
boshas "github.com/cloudfoundry/bosh-agent/agent/applier/applyspec"
bosherr "github.com/cloudfoundry/bosh-agent/internal/github.com/cloudfoundry/bosh-utils/errors"
)<|fim▁hole|>// presentedJobState exposes only ... | |
<|file_name|>lc587-erect-the-fence.py<|end_file_name|><|fim▁begin|># coding=utf-8
import unittest
"""587. Erect the Fence
https://leetcode.com/problems/erect-the-fence/description/
There are some trees, where each tree is represented by (x,y) coordinate in a
two-dimensional garden. Your job is to fence the entire gar... | |
<|file_name|>rpc.py<|end_file_name|><|fim▁begin|># =============================================================================
# Copyright [2013] [Kevin Carter]
# License Information :
# This software has no warranty, it is provided 'as is'. It is your
# responsibility to validate the behavior of the routines and its... | type='topic',
durable=RPC_CFG.get('durable_queues', False), |
<|file_name|>predefined.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""Copyright (C) 2009,2010 Wolfgang Rohdewald <wolfgang@rohdewald.de>
kajongg is free software you can redistribute it and/or modifys
it under the terms of the GNU General Public License as published by
the Free Software Foundation either... | description=m18n('2 Pungs or Kongs of dragons and 1 pair of dragons'))) |
<|file_name|>Content.tsx<|end_file_name|><|fim▁begin|>import * as React from 'react';
import '../Layout.scss';
import './Content.scss';
import { TextUpload } from '../../../components/molecules/TextUpload';
export interface ContentProps {
readonly content: string;
readonly onChange?: (content: string) => void;
... |
} |
<|file_name|>MainActivity.java<|end_file_name|><|fim▁begin|>package com.example.jmtransfers.jmtransfer; import android.content.SharedPreferences; import android.support.v7.app.ActionBar; import android.widget.TextView;
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.Bundle;
import a... | |
<|file_name|>im_export.py<|end_file_name|><|fim▁begin|># -* coding: utf-8 *-
from PyQt4 import QtGui
from collector.ui.gen.im_export import Ui_Dialog
from collector.ui.views import Dialog
from collector.ui.helpers.customtoolbar import CustomToolbar
from collector.core.controller import get_manager
from collector.core.p... | |
<|file_name|>mappingsPage.py<|end_file_name|><|fim▁begin|>## mappingsPage.py - show selinux mappings
## Copyright (C) 2006 Red Hat, Inc.
## 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; eithe... | import __builtin__
__builtin__.__dict__['_'] = unicode
|
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>extern crate xml;
extern crate clap;
mod polyfill;
mod emitter;
use emitter::Emitter;
use std::fs::File;
use std::io::BufReader;
use xml::reader::{EventReader, XmlEvent};
use clap::{Arg, App};
fn matching_element_id<'a>(ids: &str, attr: &'a Vec<xml::attribute::Owne... |
let id_str = id.to_owned(); |
<|file_name|>Stack.java<|end_file_name|><|fim▁begin|>package jp.teraparser.transition;
import java.util.Arrays;
/**
* Resizable-array implementation of Deque which works like java.util.ArrayDeque
*
* jp.teraparser.util
*
* @author Hiroki Teranishi
*/
public class Stack implements Cloneable {
private static ... | }
|
<|file_name|>test_v3.py<|end_file_name|><|fim▁begin|># Copyright 2013 OpenStack 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
#
# http://www.apache.org/licenses/LICENSE-2.0
... | |
<|file_name|>signup-form.component.ts<|end_file_name|><|fim▁begin|>import { Component, OnInit, NgZone } from '@angular/core'
import { Router } from '@angular/router'
import { FormBuilder, FormGroup, Validators } from '@angular/forms'
import { name, forceMail, passwd } from '/lib/validate'
import { RegisterUser } from '... | username: ['', name],
})
} |
<|file_name|>convert_ssh.go<|end_file_name|><|fim▁begin|>// +build dfssh
package dockerfile2llb
import (
"github.com/moby/buildkit/client/llb"
"github.com/moby/buildkit/frontend/dockerfile/instructions"
"github.com/pkg/errors"
)
func dispatchSSH(m *instructions.Mount) (llb.RunOption, error) {
if m.Source != "" {... | |
<|file_name|>gettags.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
##################################################
## DEPENDENCIES
import sys
import os
import os.path
try:
import builtins as builtin
except ImportError:
import __builtin__ as builtin
from os.path import getmtime, exists
import time... | _v = VFFSL(SL,"tag",True) # u'$tag' on line 5, col 10
if _v is not None: write(_filter(_v, rawExpr=u'$tag')) # from line 5, col 10. |
<|file_name|>CommentResult.java<|end_file_name|><|fim▁begin|>//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon r... | * Sets the value of the count property. |
<|file_name|>CacheInterceptor.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2002-2011 the original author or 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:/... | * CacheInterceptor simply calls the relevant superclass methods
* in the correct order.
*
* <p>CacheInterceptors are thread-safe. |
<|file_name|>conf.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# feeluown documentation build configuration file, created by
# sphinx-quickstart on Fri Oct 2 20:55:54 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all pos... | #texinfo_no_detailmenu = False |
<|file_name|>weaktuple.py<|end_file_name|><|fim▁begin|>"""tuple sub-class which holds weak references to objects"""
import weakref
class WeakTuple( tuple ):
"""tuple sub-class holding weakrefs to items
The weak reference tuple is intended to allow you
to store references to a list of objects without
... | |
<|file_name|>size_of.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 script::test::size_of;
// Macro so that we can stringif... | sizeof_checker!(size_characterdata, CharacterData, 216); |
<|file_name|>split.hpp<|end_file_name|><|fim▁begin|># /* **************************************************************************
# * *
# * (C) Copyright Paul Mensonides 2002.
# * Distributed under the Boost Software License, Version ... | # define BOOST_PP_SEQ_SPLIT_71(x) (x) BOOST_PP_SEQ_SPLIT_70 |
<|file_name|>JvR.py<|end_file_name|><|fim▁begin|># Chess Analyses by Jan van Reek
# http://www.endgame.nl/index.html
JvR_links = (
("http://www.endgame.nl/match.htm", "http://www.endgame.nl/MATCHPGN.ZIP"),
("http://www.endgame.nl/bad1870.htm", "http://www.endgame.nl/bad1870.pgn"),
("http://www.endgame.nl/w... | ("http://www.endgame.nl/nimzowitsch.htm", "http://www.endgame.nl/nimzowitsch.pgn"), |
<|file_name|>normal_gamma.py<|end_file_name|><|fim▁begin|>""" Normal-Gamma density."""
import numpy as np
from scipy.special import gammaln, psi
class NormalGamma(object):
"""Normal-Gamma density.
<|fim▁hole|> Attributes
----------
mu : numpy.ndarray
Mean of the Gaussian density.
kappa : f... | |
<|file_name|>during.rs<|end_file_name|><|fim▁begin|>use crate::{cmd, Command};
use ql2::term::TermType;
<|fim▁hole|>
impl Arg for Command {
fn arg(self) -> cmd::Arg<()> {
Self::new(TermType::During).with_arg(self).into_arg()
}
}<|fim▁end|> | pub trait Arg {
fn arg(self) -> cmd::Arg<()>;
} |
<|file_name|>arroyo_2010.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2014-2022 GEM Foundation
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by th... |
# convert from cm/s**2 to 'g' |
<|file_name|>Callout.Props.ts<|end_file_name|><|fim▁begin|>import * as React from 'react';
import { Callout } from './Callout';
import { CalloutContent } from './CalloutContent';
import { DirectionalHint } from '../../common/DirectionalHint';
import {
IPoint,
IRectangle
} from '../../Utilities';
export interface I... | */
ariaDescribedBy?: string;
|
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>export default {<|fim▁hole|> update: 'Aktualisieren',
complete: 'Komplett',
delete: 'Löschen',
cancel: 'Stornieren',
new: 'Neu',
list: 'Liste',
search: 'Suche',
confirmDelete: 'Bestätigung der Löschung',
},
}<|fim▁end|> | actions: {
label: 'Aktionen',
edit: 'Bearbeiten',
save: 'Speichern', |
<|file_name|>phones.service.spec.ts<|end_file_name|><|fim▁begin|>// #docregion
import {describe, beforeEachProviders, it, inject} from 'angular2/testing';
import {HTTP_PROVIDERS} from 'angular2/http';
import {Phones} from '../../app/js/core/phones.service';
describe('Phones', () => {
// load providers
beforeEachP... | // Test service availability
it('check the existence of Phones', inject([Phones], (phones) => { |
<|file_name|>windows.rs<|end_file_name|><|fim▁begin|>use std::sync::mpsc::{channel, Sender, Receiver, TryRecvError, sync_channel, SyncSender};
use std::io::{Read, Write};
use std::{io, thread};
use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt};
use named_pipe::{PipeOptions, OpenMode, PipeClient};
use li... | });
Ok(IpcClient {
|
<|file_name|>testLock2.py<|end_file_name|><|fim▁begin|><|fim▁hole|>with portalocker.Lock('text.txt', timeout=5) as fh:
fh.write("Sono in testLoxk2.py")
"""
from lockfile import LockFile
lock = LockFile('text.txt')
with lock:
print lock.path, 'is locked.'
with open('text.txt', "a") as file:
file.wri... | """import portalocker
|
<|file_name|>network.py<|end_file_name|><|fim▁begin|>import threading, time, Queue, os, sys, shutil, random
from util import user_dir, appdata_dir, print_error, print_msg
from bitcoin import *
import interface
from blockchain import Blockchain
DEFAULT_PORTS = {'t':'50011', 's':'50012', 'h':'8181', 'g':'8282'}
DEFAULT... | def on_peers(self, i, r):
if not r: return
self.irc_servers = parse_servers(r.get('result'))
self.trigger_callback('peers') |
<|file_name|>volume.go<|end_file_name|><|fim▁begin|>/*
Copyright 2014 Google Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0... | // GetPath returns the directory path the volume is mounted to. |
<|file_name|>create_buildpack.go<|end_file_name|><|fim▁begin|>package buildpack
import (
"fmt"
"strconv"
"code.cloudfoundry.org/cli/cf/flags"
. "code.cloudfoundry.org/cli/cf/i18n"
"code.cloudfoundry.org/cli/cf"
"code.cloudfoundry.org/cli/cf/api"
"code.cloudfoundry.org/cli/cf/commandregistry"
"code.cloudfound... | enableOption = &disabled |
<|file_name|>script.js<|end_file_name|><|fim▁begin|>/**
* @file
* A JavaScript file for the theme.
*
* In order for this JavaScript to be loaded on pages, see the instructions in
* the README.txt next to this file.
*/
// JavaScript should be made compatible with libraries other than jQuery by<|fim▁hole|> $(do... | // wrapping it with an "anonymous closure". See:
// - http://drupal.org/node/1446420
// - http://www.adequatelygood.com/2010/3/JavaScript-Module-Pattern-In-Depth
(function($, Drupal, window, document, undefined) { |
<|file_name|>pla.rs<|end_file_name|><|fim▁begin|>/*
Copyright (c) 2016-2017, Robert Ou <rqou@robertou.com> and contributors
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source c... | }
|
<|file_name|>Anchor.js<|end_file_name|><|fim▁begin|>import { createPlugin } from 'draft-extend';
// TODO(mime): can't we just use LINK? i forget why we're using ANCHOR separately..., something with images probably :-/
const ENTITY_TYPE = 'ANCHOR';
// TODO(mime): one day, maybe switch wholesale to draft-extend. for no... | htmlToEntity: (nodeName, node, create) => {
if (nodeName === 'a') {
const mutable = node.firstElementChild?.nodeName === 'IMG' ? 'IMMUTABLE' : 'MUTABLE';
const { href, target } = node; |
<|file_name|>kbxSlider.py<|end_file_name|><|fim▁begin|>##############################################################################################
# Copyright 2014-2015 Cloud Media Sdn. Bhd.
#
# This file is part of Xuan Application Development SDK.
#
# Xuan Application Development SDK is free software: you can... | #
# Xuan Application Development SDK is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
<|file_name|>ResponseParameters.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 u... | # "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at |
<|file_name|>cursor.py<|end_file_name|><|fim▁begin|>from django.conf import settings
from .locals import get_cid
DEFAULT_CID_SQL_COMMENT_TEMPLATE = 'cid: {cid}'
class CidCursorWrapper:<|fim▁hole|> """
def __init__(self, cursor):
self.cursor = cursor
def __getattr__(self, attr):
if attr ... | """
A cursor wrapper that attempts to add a cid comment to each query |
<|file_name|>forms.py<|end_file_name|><|fim▁begin|># !/usr/bin/env python
# -*- coding: utf-8 -*-
# created by restran on 2016/1/2
from __future__ import unicode_literals, absolute_import<|fim▁hole|>from django.utils.translation import ugettext_lazy as _
from .models import *
from common.forms import BaseModelForm
l... |
from django import forms |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#![recursion_limit = "160"] // 150 was too low in rust 1.15
use std::result;
mod operand;
use operand::Operand;
extern crate r68k_common;
use r68k_common::ops::*;
use r68k_common::constants::*;
mod constants;
use constants::*;
#[macro_use]
extern crate pest;
pub mod mem... | instruction!(MASK_OUT_X_Y, OP_ADDX | LONG_SIZED | MM_MODE, Size::Long, "ADDX", always, decode_pdx_pdy, is_pd_pd, encode_pdx_pdy),
instruction!(MASK_OUT_X_EA, OP_AND | BYTE_SIZED | DEST_DX, Size::Byte, "AND", ea_data, decode_ea_dx, is_ea_dn, encode_ea_dx), |
<|file_name|>ClassNode.java<|end_file_name|><|fim▁begin|>/**
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/<|fim▁hole|>
public class ClassNode extends AbstractReportNode {
private String className;
public ClassNode(String className) {
this.className = className;
... | package net.sourceforge.pmd.lang.dfa.report; |
<|file_name|>bitcoin_lv_LV.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="lv_LV" version="2.0">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About Hirocoin</sour... | |
<|file_name|>menu.py<|end_file_name|><|fim▁begin|>from django.utils.translation import ugettext_lazy as _<|fim▁hole|>navbar_links_registry = MenuRegistry(_("Navigation Bar Menu"))<|fim▁end|> | from oioioi.base.menu import MenuRegistry
|
<|file_name|>PrimaryKeyCache.java<|end_file_name|><|fim▁begin|>/*****************************************************************************
* *
* This file is part of the tna framework distribution. *
* Documentation an... | log.debug("完成装载表【" + tableName +"】的主键信息。"); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.