prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>CreateImgFromInterval.java<|end_file_name|><|fim▁begin|>/*<|fim▁hole|> * #%L
* ImageJ software for multidimensional image processing and analysis.
* %%
* Copyright (C) 2014 - 2017 Board of Regents of the University of
* Wisconsin-Madison, University of Konstanz and Brian Northan.
* %%
* Redistributio... | |
<|file_name|>master_source_cfg.py<|end_file_name|><|fim▁begin|># Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from master import gitiles_poller
def Update(config, active_master, c):
master_poller = gi... | c['change_source'].append(master_poller) |
<|file_name|>CopyToOperation.java<|end_file_name|><|fim▁begin|>package de.mhus.cha.cao.action;
import java.io.File;
import de.mhus.lib.cao.CaoElement;
import de.mhus.lib.cao.CaoException;
import de.mhus.lib.cao.CaoList;
import de.mhus.lib.cao.CaoMonitor;
import de.mhus.lib.cao.CaoOperation;
import de.mhus.cap.core.Ac... | target = ChaElement; |
<|file_name|>ShouldDecorateChildren.js<|end_file_name|><|fim▁begin|><|fim▁hole|>import TouchPositionLabel from './TouchPositionLabel';
import OnPositionChangedLabel from './OnPositionChangedLabel';
import InstructionsLabel from './InstructionsLabel';
export default class extends React.Component {
constructor(prop... | import React from 'react';
import ReactTouchPosition from '../../../dist/ReactTouchPosition';
|
<|file_name|>localization.py<|end_file_name|><|fim▁begin|>import pytz
from django.conf import settings
from django.utils.dates import MONTHS, WEEKDAYS, WEEKDAYS_ABBR
from django.utils.translation import gettext as _
# Wagtail languages with >=90% coverage
# This list is manually maintained
WAGTAILADMIN_PROVIDED_LANG... | |
<|file_name|>main.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python3
# -*- coding: utf-8 -*-
# main.py file is part of spman
#
# spman - Slackware package manager
# Home page: https://github.com/MyRequiem/spman
#
# Copyright (c) 2018 Vladimir MyRequiem Astrakhan, Russia<|fim▁hole|>
"""
main.py
"""
import sys
f... | # <mrvladislavovich@gmail.com>
# All rights reserved
# See LICENSE for details. |
<|file_name|>data.js<|end_file_name|><|fim▁begin|>/*jshint node:true, indent:2, curly:false, eqeqeq:true, immed:true, latedef:true, newcap:true, noarg:true,
regexp:true, undef:true, strict:true, trailing:true, white:true */
/*global X:true, XT:true */
(function () {
"use strict";
// All of the "big 4" routes are ... | // "adapter" functions that call the engines and adapt to the express convention. These
// adapter functions are also nearly identical so I've reused code there as well.
// Sorry for the indirection. |
<|file_name|>mpv.py<|end_file_name|><|fim▁begin|>from ctypes import *
import ctypes.util
import threading
import os
import sys
from warnings import warn
from functools import partial
import collections
import re
import traceback
# vim: ts=4 sw=4 et
if os.name == 'nt':
backend = CDLL('mpv-1.dll')
fs_enc = 'utf... | try:
cval = _mpv_get_property(self.handle, name.encode('utf-8'), fmt, outptr)
rv = MpvNode.node_cast_value(outptr, fmt, decode_str or proptype in (str, commalist)) |
<|file_name|>generic_nondefining_use.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>
fn main() {}
type OneTy<T> = impl Debug;
//~^ ERROR could not find defining uses
type OneLifetime<'a> = impl Debug;
//~^ ERROR could not find defining uses
type OneConst<const X: usize> = impl Debug;
//~^ ERROR could not find defining us... | #![feature(type_alias_impl_trait)]
use std::fmt::Debug; |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>/// <reference path="references.ts"/>
class Index {
public instance;
public addMarker;
public addTopoJson;
public addGeoJson;
public addPanel;
public center;
public updateMarker;
public updateMap;
public updateFeature;
public removeMarker;
public... | |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models
class EventTeam(models.Model):
name = models.CharField(max_length=100)
class Event(models.Model):
team1 = models.ForeignKey(EventTeam, null=True, related_name='opponent1')
team2 = models.ForeignKey(EventTeam, null=True, rel... | championship = models.ForeignKey('Championship', related_name='days')
|
<|file_name|>JdbcStatisticTest.java<|end_file_name|><|fim▁begin|>package nl.astraeus.jdbc;
import org.junit.Assert;
import org.junit.Test;
/**
* User: rnentjes
* Date: 4/13/12
* Time: 10:55 PM
*/
public class JdbcStatisticTest {
@Test
public void test() {<|fim▁hole|><|fim▁end|> | Assert.assertTrue(true);
}
} |
<|file_name|>modular_inverse.rs<|end_file_name|><|fim▁begin|>// http://rosettacode.org/wiki/Modular_inverse
#[cfg(not(test))]
fn main() {
println!("{:?}", mul_inv(42, 2017));
}
fn mul_inv(a: i32, b: i32) -> Option<i32> {
let (gcd, mut x, _) = egcd(a, b);
if gcd != 1 { // No multiplicative inverse exists
... |
let (g, y, x) = egcd(b % a, a);
(g, x - (b / a) * y, y)
} |
<|file_name|>get-all-results.js<|end_file_name|><|fim▁begin|>// This file is part of Pa11y Webservice.
//
// Pa11y Webservice 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, ... | |
<|file_name|>assignments_turnitin_msonline_list.py<|end_file_name|><|fim▁begin|># https://canvas.instructure.com/doc/api/assignments.html
from datetime import datetime
from canvas.core.courses import get_courses, get_courses_whitelisted, get_course_people, get_courses_by_account_id
from canvas.core.io import write... | |
<|file_name|>test_orthogonal_eval.py<|end_file_name|><|fim▁begin|>import numpy as np
from numpy.testing import assert_
import scipy.special.orthogonal as orth
from scipy.special._testutils import FuncData
def test_eval_chebyt():
n = np.arange(0, 10000, 7)
x = 2*np.random.rand() - 1
v1 = np.cos(n*np.arcco... | self.check_poly(orth.eval_sh_jacobi, orth.sh_jacobi,
param_ranges=[(1, 10), (0, 1)], x_range=[0, 1],
rtol=1e-5)
|
<|file_name|>tensor_product_test.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2018-2019 The ESPResSo project
*
* This file is part of ESPResSo.
*
* ESPResSo 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 Fo... | /* Unit tests for the Utils::tensor_product class. */
|
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import React from 'react';
import ReactDOM from 'react-dom';
import { Router, IndexRoute, Route, browserHistory } from 'react-router'
import App from './components/App';
import Home from './components/Home';
import Page1 from './components/Page1';
import Page2 from '.... | <Router history={browserHistory}>
<Route component={App}>
<Route path="/" component={Home}></Route>
<Route path="page1" component={Page1}></Route> |
<|file_name|>person.py<|end_file_name|><|fim▁begin|>import re
from stgit.compat import environ_get
from stgit.config import config
from .base import Immutable
from .date import Date
class Person(Immutable):
"""Represents an author or committer in a Git commit object.
Contains :attr:`name`, :attr:`email` an... | @classmethod
def committer(cls): |
<|file_name|>JBoss5WC.py<|end_file_name|><|fim▁begin|>from src.platform.jboss.interfaces import WebConsoleInterface
<|fim▁hole|> def __init__(self):
super(FPrint, self).__init__()
self.version = "5.0"<|fim▁end|> | class FPrint(WebConsoleInterface):
|
<|file_name|>OSXUchrKeyResource.cpp<|end_file_name|><|fim▁begin|>/*
* synergy -- mouse and keyboard sharing utility
* Copyright (C) 2016 Symless Ltd.
*
* This package is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* found in the file LICENSE that sh... | }
bool |
<|file_name|>cordic.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
gplheader = """Harmon Instruments CORDIC generator
Copyright (C) 2014 Harmon Instruments, LLC
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 Sof... | print """initial
begin |
<|file_name|>data_handler.py<|end_file_name|><|fim▁begin|># Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
import urllib
from copy import deepcopy
from datetime import date
from logging import getLogger
from urlparse import urljoin
from sqlalchemy import... | |
<|file_name|>package-info.java<|end_file_name|><|fim▁begin|>@ParametersAreNonnullByDefault<|fim▁hole|>
import javax.annotation.ParametersAreNonnullByDefault;<|fim▁end|> | package org.zalando.problem.spring.web.advice; |
<|file_name|>exec_test.go<|end_file_name|><|fim▁begin|>package container
import (
"context"
"io/ioutil"
"testing"
"github.com/docker/cli/cli"
"github.com/docker/cli/cli/config/configfile"
"github.com/docker/cli/internal/test"
"github.com/docker/cli/opts"
"github.com/docker/docker/api/types"
"github.com/pkg/e... | },
}
for _, tc := range testCases { |
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|><|fim▁hole|>app = create_app()
if __name__ == "__main__":
app.run()<|fim▁end|> | from memoria.app import create_app
|
<|file_name|>centosPatching.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#
# Copyright 2014 Microsoft Corporation
#<|fim▁hole|># 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:... | |
<|file_name|>PosixRegEx.hpp<|end_file_name|><|fim▁begin|>/*******************************************************************************
* Copyright (C) 2005 Novell, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the followin... | |
<|file_name|>timestamp.rs<|end_file_name|><|fim▁begin|>pub struct Timestamp(u64);
pub trait InTimestampUnits {
/// milliseconds
fn ms(self) -> Timestamp;
<|fim▁hole|> /// nanoseconds
fn ns(self) -> Timestamp;
}
impl InTimestampUnits for f64 {
fn ms(self) -> Timestamp {
Timestamp((self * 1_0... | /// microseconds
fn us(self) -> Timestamp;
|
<|file_name|>conftest.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# This file is part of CERN Document Server.
# Copyright (C) 2016, 2019 CERN.
#
# CERN Document Server 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... | # In Python 2.7 the fallback kwarg of os.environ.get is `failobj`,
# in 3.x it's `default`. |
<|file_name|>EnvyBarChart.js<|end_file_name|><|fim▁begin|>import {Chart} from 'react-google-charts';
import React, {Component, PropTypes} from 'react';
import DataFormatter from '../../utils/DataFormatter';
class EnvyBarChart extends Component {
constructor(props) {
super(props);
this.state={
options:{
hAx... | EnvyBarChart.propTypes = {
events: PropTypes.array.isRequired |
<|file_name|>_parser.py<|end_file_name|><|fim▁begin|># BSD 3-Clause License
#
# Copyright (c) 2016-19, University of Liverpool
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions... | # this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# * Neither the name of the copyright holder nor the names of its |
<|file_name|>auth.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
Unless re... | |
<|file_name|>SceneSwitchUI.py<|end_file_name|><|fim▁begin|>##########################################################################
#
# Copyright (c) 2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided tha... | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
<|file_name|>value_test.go<|end_file_name|><|fim▁begin|>package contracts
import (
"testing"
"time"
"github.com/stretchr/testify/require"
"go.dedis.ch/cothority/v3"
"go.dedis.ch/cothority/v3/byzcoin"
"go.dedis.ch/cothority/v3/darc"
"go.dedis.ch/onet/v3"
)
func TestValue_Spawn(t *testing.T) {
local := onet.Ne... | genesisMsg.BlockInterval = time.Second
cl, _, err := byzcoin.NewLedger(genesisMsg, false)
require.NoError(t, err) |
<|file_name|>append-impl.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>// no-prefer-dynamic
#![crate_type = "proc-macro"]
extern crate proc_macro;
use proc_macro::TokenStream;
#[proc_macro_derive(Append)]
pub fn derive_a(input: TokenStream) -> TokenStream {
"impl Append for A {
fn foo(&self) {}
}
... | // force-host |
<|file_name|>play.py<|end_file_name|><|fim▁begin|>#
# Copyright (C) 2008 Cournapeau David <cournape@gmail.com>
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of sou... | |
<|file_name|>main.js<|end_file_name|><|fim▁begin|>(function() {
// Creating application
var app = {};
var parseData = function(data) {
var result = {};
// TODO: Get better performance here
var years = _.groupBy(data, 'year');
for (var key in years) {
result[key] = _.groupBy(years[key], 'ca... | if (this.max === current) {
this.stop(); |
<|file_name|>http.py<|end_file_name|><|fim▁begin|>import socket
try:
import requests
httplib2 = None
except ImportError:
requests = None
try:
import httplib2
except ImportError:
raise ImportError('No module named requests or httplib2')
ConnectionError = requests.exceptions.Connect... | |
<|file_name|>properties.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/. */
// This file is a Mako template: http://www.makotempl... | match inheritedbox_style.clone_direction() {
computed_values::direction::T::ltr => {},
computed_values::direction::T::rtl => {
flags.insert(logical_geometry::FLAG_RTL); |
<|file_name|>collectionsexample.py<|end_file_name|><|fim▁begin|>#!/bin/env python
import itertools
import collections
def read_table(filename):
with open(filename) as fp:
header = next(fp).split()
rows = [line.split()[1:] for line in fp if line.strip()]<|fim▁hole|> data = dict(zip(header, colu... | columns = zip(*rows) |
<|file_name|>test_calibration.py<|end_file_name|><|fim▁begin|># Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# License: BSD 3 clause
import numpy as np
from scipy import sparse
from sklearn.utils.testing import (assert_array_almost_equal, assert_equal,
asser... | |
<|file_name|>FacadesSpec.ts<|end_file_name|><|fim▁begin|>import {DomElementDoesNotExist} from './DomElementDoesNotExist';
import {getMetaValue, queryOrThrow, testDom} from './Facades';
describe('DOM Facades', () => {
it('should find no meta values', () => {
const tpl = `<meta name="tests" content="value">... |
it('should find meta values', () => {
const tpl = `<meta name="test" content="value">`;
testDom('head', HTMLHeadElement, tpl, () => { |
<|file_name|>secure_comparator.ts<|end_file_name|><|fim▁begin|>// Copyright (c) 2019 Cossack Labs Limited
//
// 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/l... |
export class SecureComparator { |
<|file_name|>ServerImplTest.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2013 Cisco Systems, Inc. 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... | import com.google.common.base.Optional; |
<|file_name|>OrderReceiptTO.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2006 - 2010 LinogistiX GmbH
*
* www.linogistix.com
*
* Project myWMS-LOS
*/
package de.linogistix.los.inventory.query.dto;
import java.util.Date;
import de.linogistix.los.inventory.model.LOSOrderRequestState;
import de.linogis... | |
<|file_name|>latest_updates.js<|end_file_name|><|fim▁begin|>// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
wn.pages['latest-updates'].onload = function(wrapper) {
wn.ui.make_app_page({
parent: wrapper,
title: wn._('Latest Update... | });
log.repo = log.repo==="lib" ? "wnframework" : "erpnext";
$(repl('<tr>\ |
<|file_name|>providers.rs<|end_file_name|><|fim▁begin|>// Copyright 2020 The Kythe 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.apache.... | let content_base64: &str = content_option.unwrap();
let content: Vec<u8> = base64::decode(&content_base64).map_err(|err| {
KytheError::IndexerError(format!( |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls.defaults import patterns, url<|fim▁hole|>
import views
urlpatterns = patterns('',
# CRUD
url(r'^new$', views.new, name='create'),
# Search
url(r'^search$', views.search, name='search'),
url(r'^search/can... | from django.conf import settings |
<|file_name|>signverifymessagedialog.cpp<|end_file_name|><|fim▁begin|>#include "signverifymessagedialog.h"
#include "ui_signverifymessagedialog.h"
#include "addressbookpage.h"
#include "base58.h"
#include "guiutil.h"
#include "init.h"
#include "main.h"
#include "optionsmodel.h"
#include "walletmodel.h"
#include "walle... | |
<|file_name|>parsers.rs<|end_file_name|><|fim▁begin|>use nom;
#[derive(Debug, PartialEq)]
pub enum Hashline {
OpenEnv(Environment),
PlainLine(String),
}
#[derive(Debug, PartialEq)]
pub struct Environment {
indent_depth: usize,
name: String,
opts: String,
comment: String,
is_list_like: boo... | assert_eq!(env_2.latex_end(), " \\end{abc}");
assert_eq!(env_2.is_list_like(), false);
assert_eq!(env_2.indent_depth(), 2);
} |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors<|fim▁hole|># the New BSD License: http://www.opensource.org/licenses/bsd-license.php<|fim▁end|> | #
# This module is part of GitDB and is released under |
<|file_name|>frontendMiddleware.js<|end_file_name|><|fim▁begin|>const express = require('express');
const path = require('path');
const compression = require('compression');
const webpackDevMiddleware = require('webpack-dev-middleware');
const webpackHotMiddleware = require('webpack-hot-middleware');
const webpack = re... |
app.get('*', (req, res) => res.sendFile(path.join(options.output.path, 'index.html')));
};
|
<|file_name|>SASD.py<|end_file_name|><|fim▁begin|>from __future__ import division
from os.path import expanduser, exists
from os import chdir, mkdir
import pickle
import numpy as np
from scipy import sparse
import networkx as nx
home = expanduser('~')
chdir(home+'/workspace/vichakshana/vichakshana/')
#CELERY
from my... | |
<|file_name|>yaml.go<|end_file_name|><|fim▁begin|>// Package yaml implements YAML support for the Go language.
//
// Source code and other details for the project are available at GitHub:
//
// https://github.com/go-yaml/yaml
//
package yaml
import (
"errors"
"fmt"
"reflect"
"strings"
"sync"
)
// MapSlice enco... | } |
<|file_name|>results.rs<|end_file_name|><|fim▁begin|>use std::collections::{HashMap, HashSet};
use super::automata::State;
use rustc_serialize::{Encoder, Encodable};
use ::{Node, NodeIndex, Edge, GraphDB, Graph, PropVal};
use std::hash::{Hash, Hasher};
pub struct MatchResult<'a> {
parent_lookup: HashMap<NodeIndex,... | head: Node,
tail: Vec<EdgeNode>
} |
<|file_name|>components.rs<|end_file_name|><|fim▁begin|>/*
src/gui/components.rs, 2017-08-17
Copyright (c) 2017 Juuso Tuononen
This file is licensed under
Apache License, Version 2.0
or
MIT License
*/
//! GUI toolkit components.
use cgmath::{Matrix4, Point2, Vector3};
use cgmath::prelude::*;
use renderer::{Mode... | |
<|file_name|>freedb-submit.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os, re, sys
if len(sys.argv) < 2:
print "usage: %s <recordfile>" % sys.argv[0]
sys.exit(1)
# Read record
filename = sys.argv[1]
fd = file(filename)
record = fd.read()
fd.close()
# Update revision
newrecord = []<|fim▁hole... | lbreak = "\r\n"
for line in record.splitlines():
if line.startswith('# Revision:'):
rev = int(line.split(':')[1]) + 1 |
<|file_name|>SCDParser.java<|end_file_name|><|fim▁begin|>/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the... | |
<|file_name|>IRSenderBlaster.cpp<|end_file_name|><|fim▁begin|>#include <Arduino.h>
#include <IRSender.h>
// Send IR using the IR Blaster. The IR Blaster generates the 38 kHz carrier frequency
IRSenderBlaster::IRSenderBlaster(uint8_t pin) : IRSender(pin)
{
pinMode(_pin, OUTPUT);
}
void IRSenderBlaster::setFrequen... | |
<|file_name|>amldbg.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>fn main() {
println!("amldbg");
}<|fim▁end|> | |
<|file_name|>notification.py<|end_file_name|><|fim▁begin|># Copyright (C) 2018 DataArt
#
# 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... | # See the License for the specific language governing permissions and
# limitations under the License.
# =============================================================================
|
<|file_name|>glance_client.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*-
# Copyright (c) 2016 Intel Corp
#
# Authors: Prudhvi Rao Shedimbi <prudhvi.rao.shedimbi@intel.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
#... | conf.register_opts(GLANCE_CLIENT_OPTS, group=glance_client)
|
<|file_name|>main.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# coding: utf-8
from .src import *<|fim▁hole|>
distractionless.plugin_loaded(reload=False)
def plugin_unloaded():
distractionless.plugin_unloaded()<|fim▁end|> |
def plugin_loaded(): |
<|file_name|>multiAgents.py<|end_file_name|><|fim▁begin|># multiAgents.py
# --------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribut... | Design a better evaluation function here.
The evaluation function takes in the current and proposed successor |
<|file_name|>ofApp.cpp<|end_file_name|><|fim▁begin|>#include "ofApp.h"
void ofApp::setup() {
ofSetVerticalSync(true);
cam.initGrabber(1280, 720);<|fim▁hole|>}
void ofApp::update() {
cam.update();
}
void ofApp::draw() {
if(ofGetMousePressed()) {
bulgeEffect.addBulge(ofGetWidth() / 2 - mouseX, ofGetHeight() / 2,... | bulgeEffect.setup(1280, 720); |
<|file_name|>StringInListFilterCriteria.java<|end_file_name|><|fim▁begin|>package org.nww.core.data.filter;
import java.util.List;
/**
* A simple filter criteria implementation checking the existence of a string
* inside a list of strings. Does only match if the list contains a totally
* equal string like t... | /**
|
<|file_name|>doc.go<|end_file_name|><|fim▁begin|>// Copyright 2011 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.
/*
Package template implements data-driven templates for generating textual output
such as HTML.
Templates are... | the set but the Funcs methods can be used to add them.
Predefined global functions are named as follows. |
<|file_name|>357. Count Numbers with Unique Digits.py<|end_file_name|><|fim▁begin|>class Solution(object):
def intersect(self, nums1, nums2):
"""
:type nums1: List[int]
:type nums2: List[int]
:rtype: List[int]
"""
from collections import Counter
nums2 = Counte... | cnt = min(nums1[i], nums2.get(i, 0))
for j in range(cnt): |
<|file_name|>floats.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 app_units::{Au, MAX_AU};
use crate::block::FormattingConte... | floats: PersistentList::new(),
max_block_start: None,
}
} |
<|file_name|>apps.py<|end_file_name|><|fim▁begin|>from django.apps import AppConfig<|fim▁hole|>
class UserprofilesConfig(AppConfig):
name = 'userprofiles'<|fim▁end|> | |
<|file_name|>board_client.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import argparse
from board_manager import BoardManager
from constants import *
def main():
parser = argparse.ArgumentParser(description='Board client settings')
parser.add_argument('-sp', '--PORT', help='server port', type=int,
... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | __all__ = ['pleth_analysis', 'ekg_analysis'] |
<|file_name|>player.js<|end_file_name|><|fim▁begin|>var groove = require('groove');
var semver = require('semver');
var EventEmitter = require('events').EventEmitter;
var util = require('util');
var mkdirp = require('mkdirp');
var fs = require('fs');
var uuid = require('./uuid');
var path = require('path');
var Pend = ... | withoutMatch = withoutExt; |
<|file_name|>webpack.config.js<|end_file_name|><|fim▁begin|>const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const WatchMissingNodeModulesPlugin = require('react-dev-utils/WatchMissingNodeModulesPlugin');
const webpack = require('... | // directory for faster rebuilds.
cacheDirectory: true
} |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""
Init
"""
from __future__ import unicode_literals
import datetime
import os
import subprocess
VERSION = (2, 2, 13, 'final', 0)
def get_version(version=None):
"""
Returns a PEP 386-compliant version number from VERSION.
"""
if not version:
... | sub = '.dev%s' % git_changeset |
<|file_name|>task.py<|end_file_name|><|fim▁begin|>import time
from aquests.athreads import socket_map
from aquests.athreads import trigger
from rs4.cbutil import tuple_cb
from aquests.client.asynconnect import AsynSSLConnect, AsynConnect
from aquests.dbapi.dbconnect import DBConnect
import threading
from aquests.protoc... | def _avails (self):
return len (self._nodes)
|
<|file_name|>immut-function-arguments.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.a... | |
<|file_name|>Select.java<|end_file_name|><|fim▁begin|>package com.jt.test.sort;<|fim▁hole|>
import java.util.Arrays;
import java.util.Random;
/**
* since 2016/10/19.
*/
public class Select {
public static void sort(Comparable[] data) {
for (int i = 0; i < data.length; i++) {
int min = i;
... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>import os, glob<|fim▁hole|><|fim▁end|> | __all__ = [os.path.basename(f)[:-3] for f in glob.glob(os.path.dirname(__file__) + "/*.py")] |
<|file_name|>tab.js<|end_file_name|><|fim▁begin|>class TabList {
constructor (tabs, parentTaskList) {
this.tabs = tabs || []
this.parentTaskList = parentTaskList
}
//tab properties that shouldn't be saved to disk
static temporaryProperties = ['hasAudio', 'previewImage', 'loaded']
add (tab = {}, opt... | |
<|file_name|>starter.js<|end_file_name|><|fim▁begin|>/*
jjs -Djava.system.class.loader=io.trivium.TriviumLoader -Djava.protocol.handler.pkgs=io.trivium.urlhandler -server -cp bnd-tibco-ems-receiver:tpe-timer:tsk-consoleLogger:bnd-timer:tpe-timerconfig:tsk-excel2table:tpe-error:tpe-timertick:tsk-java-compiler:tpe-logent... | |
<|file_name|>extended_volumes.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/lic... | from nova import volume
ALIAS = "os-extended-volumes"
LOG = logging.getLogger(__name__) |
<|file_name|>225_implement_stack_using_queues.go<|end_file_name|><|fim▁begin|>package leetcode
// https://leetcode-cn.com/problems/implement-stack-using-queues/
/**
// 225. 用队列实现栈
使用队列实现栈的下列操作:
push(x) -- 元素 x 入栈
pop() -- 移除栈顶元素
top() -- 获取栈顶元素
empty() -- 返回栈是否为空
注意:
1. 你只能使用队列的基本操作-- 也就是 push to back, peek/pop ... | |
<|file_name|>SearchResultEntry.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2012-2018 Red Hat, Inc.
* 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
* http://... | public SearchResultEntry(String filePath, List<OffsetData> data) {
this.filePath = filePath;
this.data = data; |
<|file_name|>EmailField.test.js<|end_file_name|><|fim▁begin|>import React from 'react';
import { shallow } from 'enzyme';
import toJson from 'enzyme-to-json';
import EmailField from '../EmailField';
// EmailField
// props: inputId
// behavior: renders a <Field /> component
// test: renders a <Field /> component
... | it('should render a Field component', () => {
let wrapper = shallow(<EmailField inputId='testField'/>);
expect(toJson(wrapper)).toMatchSnapshot(); |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from .. import Provider as PersonProvider
class Provider(PersonProvider):
formats_female = (
'{{first_name_female}} {{last_name}}',
'{{first_name_female}} {{last_name}}',
'{{first_name_female}} {{last_name}}',
'{{first_name_fema... | 'Sabine', |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// The MIT License (MIT)
//
// Copyright (c) 2016 Skylor R. Schermer
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restricti... | } |
<|file_name|>go-junit-report_test.go<|end_file_name|><|fim▁begin|>package main
import (
"bytes"
"fmt"
"io/ioutil"
"os"
"runtime"
"strings"
"testing"
"github.com/jstemmer/go-junit-report/parser"
)
type TestCase struct {
name string
reportName string
report *parser.Report
noXMLHeader bool
pac... | |
<|file_name|>useDrag.tsx<|end_file_name|><|fim▁begin|>import React from 'react';
type UseDragArgs = {
value: number;
direction?: 'horizontal' | 'vertical';
reverse?: boolean;
double?: boolean;
min?: number;
max?: number;
onChange: (value: number) => unknown;
};
type DragState = {
startValue: number;
... | // 1. Proper cleanup on unmount
// 2. The 'mousedown' events is never attached more than once |
<|file_name|>boss_moorabi.cpp<|end_file_name|><|fim▁begin|>/* This file is part of the ScriptDev2 Project. See AUTHORS file for Copyright information
* 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... | else
m_uiRoarTimer -= uiDiff;
|
<|file_name|>collections.js<|end_file_name|><|fim▁begin|>// code sent to client and server
// which gets loaded before anything else (since it is in the lib folder)
// define schemas and collections
// those will be given to all templates
Schemas = {};
// Collections = {};
Items = new Mongo.Collection('items');
Times... |
/* |
<|file_name|>ordered_code_test.cc<|end_file_name|><|fim▁begin|>/* Copyright 2015 The TensorFlow 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.apache.o... | {17179869183ll, ByteSequence("\373\377\377\377\377")}, |
<|file_name|>frame.rs<|end_file_name|><|fim▁begin|>// Copyright (C) 2018-2019, Cloudflare, Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code mu... | let mut b = octets::Octets::with_slice(&d);
assert_eq!(Frame::from_bytes(&mut b, packet::Type::Short), Ok(frame));
|
<|file_name|>dashboard.component.ts<|end_file_name|><|fim▁begin|>import { Component } from '@angular/core';
/**
* This class represents the lazy loaded DashboardComponent.
*/
@Component({
moduleId: module.id,
selector: 'dashboard-cmp',<|fim▁hole|> templateUrl: 'dashboard.component.html'
})
export class DashboardCo... | |
<|file_name|>bitcoin_fa.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="fa" version="2.1">
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About Doubloon</source>
<translation type="unfinished... | <message>
<location line="-133"/> |
<|file_name|>xbox_controller.py<|end_file_name|><|fim▁begin|>from xboxdrv_parser import Controller
from time import sleep
import argparse
import os
import sys
sys.path.append(os.path.abspath("../../.."))
from util.communication.grapevine import Communicator
from robosub_settings import settings
def main (args):
co... | control_packet["pitch"] = -control_packet["pitch"]
|
<|file_name|>test_views.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import csv
import json
from cStringIO import StringIO
from datetime import datetime
from django.conf import settings
from django.core import mail
from django.core.cache import cache
import mock
from pyquery import PyQuery as pq
from olym... | def test_required_app(self):
d = dict(locale='zh-CN', collection=80)
data = formset(self.initial, d, initial_count=1) |
<|file_name|>expect.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*
import os, StringIO, sys, traceback, tempfile, random, shutil
from status import OutputStatus
from sagenb.misc.format import format_for_pexpect
from worksheet_process import WorksheetProcess
from sagenb.misc.misc import (walltime,
... | self._is_computing = False |
<|file_name|>fu.py<|end_file_name|><|fim▁begin|>"""
Implementation of the trigsimp algorithm by Fu et al.
The idea behind the ``fu`` algorithm is to use a sequence of rules, applied
in what is heuristically known to be a smart order, to select a simpler
expression that is equivalent to the input.
There are transform ... | n, d = rv.as_numer_denom()
if d is not S.One:
newn = TR14(n, first=False)
newd = TR14(d, first=False) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.