prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>textAngular.js<|end_file_name|><|fim▁begin|>/*
@license textAngular
Author : Austin Anderson
License : 2013 MIT
Version 1.3.0-17
See README.md or https://github.com/fraywing/textAngular/wiki for requirements and use.
*/
(function(){ // encapsulate all variables so they don't become global vars
"Use Stric... | if(isSelectableElementTool){
// re-apply the selectable tool events
scope['reApplyOnSelectorHandlerstaTextElement' + _serial](); |
<|file_name|>products.js<|end_file_name|><|fim▁begin|>define([], function() {
Path.map("#!/products").to(function(){
}).enter(function() {
require([
'tpl!template/products.html', 'tpl!template/username.html', 'tpl!template/product-tpl.html',
'bootstrap', 'bootstrapHover', 'utils'
], function(tpl, userTpl, p... |
function render(){
var products = JSON.parse(localStorage.getItem('products')); |
<|file_name|>base.js<|end_file_name|><|fim▁begin|>'use strict';exports.__esModule = true;var _stringify = require('babel-runtime/core-js/json/stringify');var _stringify2 = _interopRequireDefault(_stringify);var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');var _classCallCheck3 = _interopRequireDefa... |
/** |
<|file_name|>client.go<|end_file_name|><|fim▁begin|>package docker_helpers
import "github.com/fsouza/go-dockerclient"
type Client interface {
InspectImage(name string) (*docker.Image, error)
PullImage(opts docker.PullImageOptions, auth docker.AuthConfiguration) error
ImportImage(opts docker.ImportImageOptions) err... | RemoveContainer(opts docker.RemoveContainerOptions) error |
<|file_name|>boxed_value.hpp<|end_file_name|><|fim▁begin|>// This file is distributed under the BSD License.
// See "license.txt" for details.
// Copyright 2009-2012, Jonathan Turner (jonathan@emptycrate.com)
// Copyright 2009-2015, Jason Turner (jason@emptycrate.com)
// http://www.chaiscript.com
#ifndef CHAISCRIPT_BO... | |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>//!
//! Core library entry point.
//!
extern crate rustc_serialize;
extern crate byteorder;
extern crate bincode;
extern crate flate2;
extern crate rust_htslib as htslib;
use std::fs;
use std::io::ErrorKind;
use std::process::exit;
// generic functions<|fim▁hole|> let ... | pub fn file_exists<P: AsRef<Path>>(filename: P) -> bool { |
<|file_name|>node-test.js<|end_file_name|><|fim▁begin|>/*eslint-env mocha*/
/*
* mochify.js
*
* Copyright (c) 2014 Maximilian Antoni <mail@maxantoni.de>
*
* @license MIT
*/
'use strict';
var assert = require('assert');
var fs = require('fs');
var run = require('./fixture/run');
var sandbox = require('./fixture/s... | }); |
<|file_name|>1_twoSum.py<|end_file_name|><|fim▁begin|>class Solution(object):
def twoSum(self, nums, target):
lookup = {}
for i, num in enumerate(nums):<|fim▁hole|> if target - num in lookup:
return [lookup[target - num], i]
lookup[num] = i
return []
i... | |
<|file_name|>fake_service_builder.go<|end_file_name|><|fim▁begin|>// This file was generated by counterfeiter
package fakes
import (
. "github.com/cloudfoundry/cli/cf/actors/service_builder"
"github.com/cloudfoundry/cli/cf/models"
"sync"
)
type FakeServiceBuilder struct {
GetAllServicesStub func() ([]model... | |
<|file_name|>valid.go<|end_file_name|><|fim▁begin|>// chris 071615 Generation of validator code.
package main
import (
"fmt"
"strings"
"unicode"
"go/ast"
"go/token"
"unicode/utf8"
)
// XXX There is too much duplication of generated code among the
// validators.
// validateString writes validator code for a s... | validateFloat(ctx, fieldname, meta, 32)
case "float64":
ctx.addImport("strconv")
validateFloat(ctx, fieldname, meta, 64) |
<|file_name|>generic_layer_metadata.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
InaSAFE Disaster risk assessment tool developed by AusAid -
**metadata module.**
Contact : ole.moller.nielsen@gmail.com
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms... | """
return super(GenericLayerMetadata, self).json
|
<|file_name|>layout.ts<|end_file_name|><|fim▁begin|>import { Inject, Service } from 'libs/typedi';
import { computed, observable } from 'mobx';
import { Dimensions } from 'core/interfaces';
import { NotesEditorScroll } from 'features/NotesEditor/core';
@Service()
export default class NotesEditorLayout {
@Inject(_ =... | dimensions: Dimensions = {
height: 500, |
<|file_name|>MemConfig.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relati... | |
<|file_name|>MessageExchangesAdapter.java<|end_file_name|><|fim▁begin|>/**
* <copyright>
* Copyright (c) 2008 IBM Corporation 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,... | MessageExchangesEditPart result = new MessageExchangesEditPart();
result.setLabelProvider(PropertiesLabelProvider.getInstance());
result.setModel(model); |
<|file_name|>udp_dispatcher.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: Tamas Gal <tgal@km3net.de>
# License: MIT
#!/usr/bin/env python
# vim: ts=4 sw=4 et
"""
=============================
UDP Forwarder for ControlHost
=============================
A simple UDP forwarder fo... |
import km3pipe as kp |
<|file_name|>25.py<|end_file_name|><|fim▁begin|>instr = [x.strip().split(' ') for x in open("input/dec25").readlines()]
skip = {}
modified = {}
#instr[1] = ['add', 'a', '2572']
#skip[2] = skip[3] = skip[4] = skip[5] = skip[6] = skip[7] = skip[8] = skip[9] = True<|fim▁hole|>#modified[6] = modified[7] = modified[8] = Tr... | #instr[6] = ['add', 'a', 'c'] # adds c to d, sets c to 0
#skip[7] = True
#skip[8] = True |
<|file_name|>path.rs<|end_file_name|><|fim▁begin|>//! This module contains functions for file system path manipulation.
use std::{
ffi::{OsStr, OsString},
path::{Path, PathBuf},
};
/// This traits extends the available methods on [`Path`].
pub trait PathExt {
/// Iterator over all file extensions of a [`P... | /// # Example |
<|file_name|>activate.service.js<|end_file_name|><|fim▁begin|>(function() {
'use strict';
<|fim▁hole|> Activate.$inject = ['$resource'];
function Activate ($resource) {
var service = $resource('api/activate', {}, {
'get': { method: 'GET', params: {}, isArray: false}
});
... | angular
.module('echarliApp')
.factory('Activate', Activate);
|
<|file_name|>0003_change_type_va_first_use.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
for u in or... | |
<|file_name|>failure.py<|end_file_name|><|fim▁begin|>"""
SleekXMPP: The Sleek XMPP Library
Copyright (C) 2011 Nathanael C. Fritz
This file is part of SleekXMPP.
See the file LICENSE for copying permission.
"""
from sleekxmpp.stanza import StreamFeatures
from sleekxmpp.xmlstream import ElementBase, St... | class Failure(StanzaBase):
""" |
<|file_name|>tracelog.py<|end_file_name|><|fim▁begin|>#
# A PyGtk-based Python Trace Collector window
#
# Copyright (C) 2007 TK Soh <teekaysoh@gmail.com>
#
import pygtk
pygtk.require("2.0")
import gtk
import gobject
import pango
import threading
import Queue
import win32trace
try:
from gitgtk.gitlib import toutf
... | scrolledwindow = gtk.ScrolledWindow()
scrolledwindow.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
self.textview = gtk.TextView(buffer=None) |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>import numpy as np
def weighted_pick(weights):
t = np.cumsum(weights)
s = np.sum(weights)
return(int(np.searchsorted(t, np.random.rand(1)*s)))
def list_to_string(ascii_list):
res = u""
for a in ascii_list:
if a >= 0 and a < 256:
res += unichr(a)<|fim▁hole|... | return res |
<|file_name|>22-cli-productivity-illustration.js<|end_file_name|><|fim▁begin|>import * as React from "react";
import Slide from "../../components/slide";
const bgImage = require("../../images/hulk-feriggno-bixby.jpg");
class ImageSlide extends React.Component {
render() {
return (
<span/>
);
}<|fim▁... | }
export default ( |
<|file_name|>methodData.hpp<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Pu... |
public:
JumpData(DataLayout* layout) : ProfileData(layout) { |
<|file_name|>with_primitives.rs<|end_file_name|><|fim▁begin|>// @has with_primitives.json "$.index[*][?(@.name=='WithPrimitives')].visibility" \"public\"
// @has - "$.index[*][?(@.name=='WithPrimitives')].kind" \"struct\"
// @has - "$.index[*][?(@.name=='WithPrimitives')].inner.generics.params[0].name" \"\'a\"
// @has ... | pub struct WithPrimitives<'a> {
num: u32, |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>__version__ = '1.0.1'<|fim▁end|> | from __future__ import unicode_literals
from .service import Service # noqa:flake8
|
<|file_name|>if.py<|end_file_name|><|fim▁begin|>x = int(input())
y = int(input())
print('In this test case x =', x, 'and y =', y)
if x >= y:
print('(The maximum is x)')
theMax = x<|fim▁hole|>else:
print('(The maximum is y)')
theMax = y
print('The maximum is', theMax)<|fim▁end|> | |
<|file_name|>SDODataObjectGetDataObjectConversionTest.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
* Copyright (c) 1998, 2012 Oracle and/or its affiliates. All rights reserved.
* This program and the accompanying materials are made available unde... | |
<|file_name|>auth.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import datetime
from frappe import _
import frappe
import frappe.database
import frappe.utils
from frappe.utils import cint, flt... |
def set_lang(self):
from frappe.translate import guess_language
frappe.local.lang = guess_language() |
<|file_name|>test_client.py<|end_file_name|><|fim▁begin|>from time import time
import unittest
from unittest.mock import patch, Mock
from urllib.error import URLError
from suds import WebFault
from ..exceptions import (
ConnectError, ServiceError, ApiLimitError, AccountFault, TableFault, ListFault)
from .. import... | |
<|file_name|>client.py<|end_file_name|><|fim▁begin|>try:
from urllib.parse import quote, urljoin
except ImportError:
from urllib import quote
from urlparse import urljoin
import requests
class BandsintownError(Exception):
def __init__(self, message, response=None):
self.message = message
... | """ |
<|file_name|>x-tag-no-polyfills.js<|end_file_name|><|fim▁begin|>(function () {
/*** Variables ***/
var win = window,
doc = document,
attrProto = {
setAttribute: Element.prototype.setAttribute,
removeAttribute: Element.prototype.removeAttribute
},
hasShadow = Element.prototype.c... | return listener;
},
removePseudos: function(target, pseudos){
|
<|file_name|>let-else-non-diverging.rs<|end_file_name|><|fim▁begin|>#![feature(let_else)]
fn main() {
let Some(x) = Some(1) else { //~ ERROR does not diverge
Some(2)
};
let Some(x) = Some(1) else { //~ ERROR does not diverge
if 1 == 1 {
panic!();
}
};<|fim▁hole|> ... | |
<|file_name|>update_creative_set.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Copyright 2015 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
#
# ... | |
<|file_name|>tokens.py<|end_file_name|><|fim▁begin|>from contrib import *
import re
def tokenize(text):
tokens = re.findall('(?u)[\w.-]+',text)
tokens = [t for t in tokens if not re.match('[\d.-]+$',t)]
#tokens = [t for t in tokens if len(t)>2]
# TODO remove stopwords
return u' '.join(tokens)
## text = KV('data... | ## tokens = KV('data/tokens.db',5)
text = KO('data/text')
tokens = KO('data/tokens')
for k,v in text.items(): |
<|file_name|>async_pipe.d.ts<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be<|fim▁hole|> */
import { ChangeDetectorRef, OnDestroy } from '@angular/core';
import { EventEmitter, Observable } from '../... | * found in the LICENSE file at https://angular.io/license |
<|file_name|>jquery.waypoints.min.js<|end_file_name|><|fim▁begin|>/*!
Waypoints - 4.0.0
Copyright © 2011-2015 Caleb Troughton
Licensed under the MIT license.
https://github.com/imakewebthings/waypoints/blog/master/licenses.txt
*/
! function () {
"use strict";
function t(o) {
if (!o) throw new Error("N... | this.waypoints.sort(t);
var i = n.Adapter.inArray(e, this.waypoints) |
<|file_name|>test_connect_combo_selection.py<|end_file_name|><|fim▁begin|>import pytest
import numpy as np
from qtpy import QtWidgets
from echo.core import CallbackProperty
from echo.selection import SelectionCallbackProperty, ChoiceSeparator
from echo.qt.connect import connect_combo_selection
class Example(object)... | assert combo.itemData(0).data == 9
|
<|file_name|>FWebReportPage.java<|end_file_name|><|fim▁begin|>package org.mo.game.editor.face.apl.logic.report;
import org.mo.jfa.common.page.FAbstractFormPage;
public class FWebReportPage<|fim▁hole|> extends FAbstractFormPage{
private static final long serialVersionUID = 1L;
private String _tempName;
... | |
<|file_name|>test_bayesian_linear_regression.py<|end_file_name|><|fim▁begin|>import unittest
import numpy as np
from robo.models.bayesian_linear_regression import BayesianLinearRegression
class TestBayesianLinearRegression(unittest.TestCase):
def setUp(self):
self.X = np.random.rand(10, 1)
y = s... | self.model = BayesianLinearRegression(alpha=1, beta=1000)
self.model.train(self.X, self.y, do_optimize=False)
def test_predict(self): |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>use serialize::json;
use std::collections::HashMap;
use std::f32;
use std::f64;
use time;
use time::Timespec;
use postgres::{PostgresConnection, NoSsl};
use postgres::types::array::ArrayBase;
use postgres::types::{ToSql, FromSql};
mod array;
mod range;
fn test_type<T:... | }
|
<|file_name|>list.js<|end_file_name|><|fim▁begin|>import Ember from 'ember';
const { Controller } = Ember;
export default Controller.extend({
columns: [
{
propertyName : 'name',
template : 'components/ui-table/cell/cell-event',
title : 'Name'
},
{
propertyName : 'start... | disableSorting : true, |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from django.utils.translation import ugettext_lazy as _
from appconf import AppConf
trans_app_label = _('Core')
class OppsCoreConf(AppConf):
DEFAULT_URLS = ('127.0.0.1', 'localhost',)
SHORT = 'googl'
SHORT_URL = 'googl.short.... |
class Meta: |
<|file_name|>dbquery.py<|end_file_name|><|fim▁begin|>## This file is part of Invenio.
## Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013 CERN.
##
## Invenio 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; e... | """Exception raised when query limit reached.""" |
<|file_name|>macros.rs<|end_file_name|><|fim▁begin|>// Copyright (c) 2017, All Contributors (see CONTRIBUTORS file)
//
// 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/.... | };
}
|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from admin_views import *<|fim▁end|> | |
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# This file is part of PrawoKultury, licensed under GNU Affero GPLv3 or later.
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
from datetime import datetime
from django.core.mail import send_mail, mail_managers
from... | |
<|file_name|>test_config.py<|end_file_name|><|fim▁begin|>import codecs
import mock
import os
import tempfile
import unittest
from time import strftime
import six
from kinto import config
from kinto import __version__
class ConfigTest(unittest.TestCase):
def test_transpose_parameters_into_template(self):<|fim▁ho... | self.maxDiff = None
template = "kinto.tpl"
dest = tempfile.mktemp() |
<|file_name|>PositionedTooltips.tsx<|end_file_name|><|fim▁begin|>import * as React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import Grid from '@material-ui/core/Grid';
import Button from '@material-ui/core/Button';
import Tooltip from '@material-ui/core/Tooltip';
const useStyles = makeStyles... | <Tooltip title="Add" placement="top-start">
<Button>top-start</Button>
</Tooltip>
<Tooltip title="Add" placement="top"> |
<|file_name|>GraphicFunctions.cpp<|end_file_name|><|fim▁begin|>/*******************************************************************
This file is part of iContact.
iContact 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... |
CBR(pStream != NULL && pulSize != NULL);
|
<|file_name|>settings.py<|end_file_name|><|fim▁begin|>"""
Django settings for librarymanagementsystem project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Bu... | MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware', |
<|file_name|>doc.go<|end_file_name|><|fim▁begin|>// Copyright 2014 CoreOS, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//<|fi... | // Unless required by applicable law or agreed to in writing, software |
<|file_name|>interfaces.go<|end_file_name|><|fim▁begin|>/*
Copyright 2021 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
Unl... | |
<|file_name|>object-one-type-two-traits.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... | #![allow(unknown_features)] |
<|file_name|>read.js<|end_file_name|><|fim▁begin|>'use strict'
const t = require('tcomb')
const fetch = require('node-fetch')
const { requestProperties, validateResponse, parseJSON } = require('../utils')
const PATH = '/designs'
module.exports = function getDesign(id) {
t.String(id)
return new Promise((resolve,... | )
|
<|file_name|>test_directory.py<|end_file_name|><|fim▁begin|>import gc
import os
import hashlib
import inspect
import shutil
import tempfile
import yaml
import zipfile
from juju.errors import CharmError, FileNotFound
from juju.charm.errors import InvalidCharmFile
from juju.charm.metadata import MetaData
from juju.charm... | |
<|file_name|>SearchProvider.ts<|end_file_name|><|fim▁begin|>/// <reference path="../_References.ts" />
/**
Providers
@namespace App.Providers
*/
module App.Providers {
export class LazyLoadHandle {
private lazyLoadCount: number = 0;
private successCallback: () => void;... | (searchHandle: SearchHandle) => this.searchWithSuccess(SearchProvider.SourceWikipedia, searchHandle),
(errorMessage: string, searchHandle: SearchHandle) => this.searchWithError(SearchProvider.SourceWikipedia, errorMessage, searchHandle));
}
|
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#[cfg(test)]
mod tests {
#[test]
fn it_works() {
assert_eq!(2 + 2, 4)
}<|fim▁hole|> #[test]
fn another() {
panic!("Make this eat fail");
}
// 还可以通过 should_panic 注解
#[test]
#[should_panic(expected = "Panic")]
fn test... | |
<|file_name|>drude.py<|end_file_name|><|fim▁begin|># Copyright (C) 2010-2018 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 Foundation, either version ... | #T_spring_fs = T_spring/fs_to_md_time |
<|file_name|>Heap.java<|end_file_name|><|fim▁begin|>public class Heap {
public static <E extends Comparable<E>> void sort(E[] array) {
constructHeap(array);
sortHeap(array);
String debug = "";
}
private static <E extends Comparable<E>> void sortHeap(E[] array) {
for (int i ... | |
<|file_name|>data_source_sakuracloud_packet_filter_test.go<|end_file_name|><|fim▁begin|>// Copyright 2016-2022 terraform-provider-sakuracloud 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 ... | source_network = "0.0.0.0/0"
source_port = "0-65535"
destination_port = "80"
allow = true |
<|file_name|>yid_test.go<|end_file_name|><|fim▁begin|>package yid
/*
import "testing"
// S = eps | S
func rec_alt1() Grammar {
s := Alt{ Eps, Eps }
s.Right = s
return s
}
// S = eps . S
func rec_cat1() Grammar {
s := Cat{ Eps, Eps }
s.Second = s
return s
}
// S = S . eps
func rec_cat2() Grammar {
s := &Cat... | { &Cat{ &Empty{}, &Eps{} }, TheEmpty },
{ &Cat{ &Eps{}, &Eps{} }, TheEps },
{ &Cat{ &Eps{}, &Lit{ "hello" } }, &Lit{ "hello" } }, |
<|file_name|>known_bug_excentric_convex.rs<|end_file_name|><|fim▁begin|>/*!
* # Expected behaviour:
* Same as the box_vee3d demo.
*
* It seems to behave as expected if the excentricity is not too big (tested with 10 and 100).
*
* # Symptoms:
* Some object just fall through the ground, missing any collison. Then,... | fn main() { |
<|file_name|>ablation.py<|end_file_name|><|fim▁begin|># ===============================================================================
# Copyright 2013 Jake Ross
#
# 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 cop... | Item('y', editor=RangeEditor(low_name='stage_manager.ymin', |
<|file_name|>MinimumWindowSubstring.py<|end_file_name|><|fim▁begin|>__source__ = 'https://leetcode.com/problems/minimum-window-substring/'
# https://github.com/kamyu104/LeetCode/blob/master/Python/minimum-window-substring.py
# Time: O(n)
# Space: O(k), k is the number of different characters
# Hashtable
#
# Descriptio... | cnt += 1;
} |
<|file_name|>1028_musical_all_of_us.py<|end_file_name|><|fim▁begin|>'''
NPR Puzzle 2018-10-28
https://www.npr.org/2018/10/28/660936138/sunday-puzzle-row-row-row
Think of a famous Broadway musical in two words.
Change one letter in it to the preceding letter of the alphabet —
so B would become A, C would become B, e... | # Get a list of musicals from Wikipedia |
<|file_name|>eric6_doc.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2003 - 2014 Detlev Offenbach <detlev@die-offenbachs.de>
#
"""
Eric6 Documentation Generator.
This is the main Python script of the documentation generator. It is
this script that gets called via the ... | excludePatterns = []
outputDir = "doc"
recursive = False |
<|file_name|>EventTrackingField.java<|end_file_name|><|fim▁begin|>package com.github.dandelion.gua.core.field;
public enum EventTrackingField implements AnalyticsField, AnalyticsCreateField {<|fim▁hole|> @AnalyticsFieldControl(AnalyticsFieldControl.Policy.TEXT) eventCategory,
@AnalyticsFieldControl(AnalyticsFie... | |
<|file_name|>wrapper.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/. */
#![allow(unsafe_code)]
//! Wrapper definitions on top of Ge... | &self,
longhand_id: LonghandId, |
<|file_name|>test_parser.py<|end_file_name|><|fim▁begin|>"""
This file is part of Maml.
Maml 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) an... |
You should have received a copy of the GNU General Public License |
<|file_name|>layout.rs<|end_file_name|><|fim▁begin|>// Copyright (c) 2013-2015 Sandstorm Development Group, Inc. and contributors
// Licensed under the MIT License:
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"),... | pub unsafe fn init_struct_pointer<'a>(mut reff: *mut WirePointer, |
<|file_name|>CargaUsuario.java<|end_file_name|><|fim▁begin|>/*
*
* Copyright (c) 2013 - 2014 INT - National Institute of Technology & COPPE - Alberto Luiz Coimbra Institute
- Graduate School and Research in Engineering.
* See the file license.txt for copyright permission.
*
*/
... | "no Sistema. Porém, não possui acesso a área Administrativa.");
|
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>import os
import shutil
from codecs import open as codecs_open
import numpy as np
from setuptools import setup, find_packages
from distutils.core import Distribution, Extension
from distutils.command.build_ext import build_ext
from distutils import errors
from Cython.B... | 'include_dirs': [ np.get_include() ]
}
extensions = [ |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>extern crate piston;
use std::path::Path;
use sdl2_window::Sdl2Window;
use opengl_graphics::{ GlGraphics, Texture, OpenGL };
use graphics::math::Matrix2d;
use piston::window::WindowSettings;
use piston::event::*;
fn render_text(face: &mut ft::Face, gl: &mu... | extern crate graphics;
extern crate freetype as ft;
extern crate sdl2_window;
extern crate opengl_graphics; |
<|file_name|>channel_announcement_test.go<|end_file_name|><|fim▁begin|>package lnwire
import (
"bytes"
"reflect"
"testing"
"github.com/roasbeef/btcd/btcec"
"github.com/roasbeef/btcd/chaincfg/chainhash"
)
func TestChannelAnnoucementEncodeDecode(t *testing.T) {
ca := &ChannelAnnouncement{
FirstNodeSig: som... | hash = chainhash.DoubleHashB(secondNodePubKey.SerializeCompressed())
secondBitcoinSig, _ := secondBitcoinPrivKey.Sign(hash)
|
<|file_name|>kubeconfig_test.go<|end_file_name|><|fim▁begin|>/*
Copyright (c) 2019 the Octant contributors. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package kubeconfig
import (
"context"
"io/ioutil"
"os"
"path/filepath"
"strings"
"testing"
"github.com/stretchr/testify/assert"
"github.com/s... | )
require.NoError(t, err)
kubeConfigs.SwitchContext(context.TODO(), "other-context") |
<|file_name|>ascii.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-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/lice... | |
<|file_name|>multihash.rs<|end_file_name|><|fim▁begin|>use crate::Error;
#[cfg(feature = "alloc")]
use alloc::vec::Vec;
use core::convert::TryFrom;
use core::convert::TryInto;
use core::fmt::Debug;
#[cfg(feature = "serde-codec")]
use serde_big_array::BigArray;
use unsigned_varint::encode as varint_encode;
#[cfg(feat... | #[test]
fn test_resize_up() {
let hash = Code::Sha2_256.digest(b"hello world"); |
<|file_name|>joint.rs<|end_file_name|><|fim▁begin|>use detection::joint::anchor::Anchor;
// FIXME: this wont be very helpful to mix several joints.
/// Trait implemented by every joint.
pub trait Joint<A> {
/// The first anchor affected by this joint.
fn anchor1(&self) -> &Anchor<A>;
/// The second anchor ... | /// The second attach point in global coordinates.
fn anchor2_pos(&self) -> A;
} |
<|file_name|>shinryu1_h4.js<|end_file_name|><|fim▁begin|>{
id: "shinryu1_h4",
name: "竜帝級 雷鳴轟く至天塔",
desc: "",
overlap: false,
aprnum: 5,
data: [
{
appearance: [
1
],
enemy: [
{
name: "ボルケーノドラゴン",
hp: 45000,
... | |
<|file_name|>main.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
from linker import Linker<|fim▁hole|># TODO put into config
spbBudgetXlsPath='../spb-budget-xls'
if __name__=='__main__':
linker=Linker('filelists',{
'csv':['csv'],
'xls':['xls'],
'db':['zip','sql','xlsx'],
})
htmlPage.HtmlPage('index.h... | import htmlPage
import content.index,content.db,content.fincom
|
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>#![cfg_attr(feature = "clippy", feature(plugin))]
#![cfg_attr(feature = "clippy", plugin(clippy))]
#[macro_use]
extern crate clap;
#[macro_use]
extern crate gfx;
extern crate gfx_window_glutin;
extern crate glutin;
extern crate image;
#[macro_use]
extern crate log;
ext... | |
<|file_name|>testFarray.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
from __future__ import division, absolute_import, print_function
# System imports
from distutils.util import get_platform
import os
import sys
import unittest
# Import NumPy
import numpy as np
major, minor = [ int(d) for d in np.__versio... | self.failUnless(isinstance(self.array, Farray.Farray))
|
<|file_name|>part2.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""Docstring."""
import re
from functools import reduce
from collections import Counter
from common import get_input
class SSLTester:
"""."""
def __init__(self, input_list=[]):
"""Initialize."""
self.input_list = input... | """Return int: number of items in <input_list> which support SSL."""
input_list = input_list if input_list else self.input_list
return Counter([self.ip_supports_ssl(x) for x in input_list])[True]
|
<|file_name|>Resources.hpp<|end_file_name|><|fim▁begin|>#include <cpp3ds/Config.hpp>
#include <map>
namespace cpp3ds {
namespace priv {
struct ResourceInfo {
ResourceInfo() : data(nullptr), size(0) { }
ResourceInfo(const Uint8 *x, const Uint32 y) : data(x), size(y) { }<|fim▁hole|> ... | const Uint8 *data; |
<|file_name|>tabs.js<|end_file_name|><|fim▁begin|>/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE_AFL.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/lic... | |
<|file_name|>clean_mac_info_plist.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Jonas Schnelli, 2013
# make sure the Nichts-Qt.app contains the right plist (including the right version)
# fix made because of serval bugs in Qt mac deployment (https://bugreports.qt-project.org/browse/QTBUG-21267)
from str... | |
<|file_name|>__openerp__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# © 2009 Pexego/Comunitea
# © 2011-2012 Iker Coranti (www.avanzosc.es)
# © 2014 Juanjo Algaz (gutierrezweb.es)
# © 2014-2016 Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3.0).
{
"name": "Account balance... | "views/account_balance_reporting_menu.xml",
"report/account_balance_reporting_reports.xml",
"report/report_generic.xml", |
<|file_name|>test_iptables_firewall.py<|end_file_name|><|fim▁begin|># Copyright 2012, Nachi Ueno, NTT MCL, 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... | egress = None
self._test_prepare_port_filter(rule, ingress, egress) |
<|file_name|>Phoenician-symbols.js<|end_file_name|><|fim▁begin|>// All symbols in the Phoenician block as per Unicode v6.1.0:
[
'\uD802\uDD00',
'\uD802\uDD01',
'\uD802\uDD02',
'\uD802\uDD03',
'\uD802\uDD04',
'\uD802\uDD05',
'\uD802\uDD06',
'\uD802\uDD07',
'\uD802\uDD08',
'\uD802\uDD09',
'\uD802\uDD0A',
'\uD... | |
<|file_name|>bifibits.py<|end_file_name|><|fim▁begin|>#vim
import sqlite3
from flask import Flask, request, g, redirect, url_for, abort, \
render_template, flash, session
from wtforms import Form, TextField, validators<|fim▁hole|>
#configuration
DATABASE = 'bifi.db'
DEBUG = True
SECRET_KEY = "CHANGEME"
a... | from model import QueueEntry
import os
from sqlobject import connectionForURI, sqlhub |
<|file_name|>app-routing.module.ts<|end_file_name|><|fim▁begin|>import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { DashboardComponent } from './components/dashboard/dashboard.component';
import { CityComponent } from './components/city/city.component... | { path: '', redirectTo: '/dashboard', pathMatch: 'full' },
{ path: 'dashboard', component: DashboardComponent },
{ path: 'area/:id/:title', component: CityComponent },
{ path: 'area/:id/trails', component: TrailListComponent }, |
<|file_name|>enum.py<|end_file_name|><|fim▁begin|># Copyright 2016 Quora, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | |
<|file_name|>TestCreateTable.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2015 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.a... | import org.apache.hadoop.hbase.HTableDescriptor;
import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.client.RegionInfo;
import org.junit.Assert; |
<|file_name|>TestXMLNode.java<|end_file_name|><|fim▁begin|>/*
* @file TestXMLNode.java
* @brief XMLNode unit tests
*
* @author Akiya Jouraku (Java conversion)
* @author Michael Hucka <mhucka@caltech.edu>
*
* $Id: TestXMLNode.java 11442 2010-07-09 02:23:35Z mhucka $
* $HeadURL: https://sbml.svn.sourcefor... | |
<|file_name|>cwEdgeTile.cpp<|end_file_name|><|fim▁begin|>/**************************************************************************
**
** Copyright (C) 2013 by Philip Schuchardt
** www.cavewhere.com
**
**************************************************************************/
#include "cwEdgeTile.h"
//Qt incl... | float yPos = row * spacing + halfSpacing;
Vertices.append(QVector2D(0.0, yPos)); |
<|file_name|>test_draft_registration_institutions_list.py<|end_file_name|><|fim▁begin|>import pytest
from api.base.settings.defaults import API_BASE
from api_tests.nodes.views.test_node_institutions_list import TestNodeInstitutionList
from osf_tests.factories import DraftRegistrationFactory, AuthUserFactory
@pytest.... | @pytest.fixture()
def node_one_url(self, node_one):
# Overrides TestNodeInstitutionList |
<|file_name|>learn_svd.py<|end_file_name|><|fim▁begin|>import os,sys,cv2,pdb
from sklearn.decomposition import TruncatedSVD
from pylab import *
def get_feature(imgpath):
img = cv2.imread(imgpath,0)
img = cv2.resize(img,(32,64))
img = np.float32(img)
img = img / 255
img = np.reshape(img, (1,32*64))
... | mark = 'rx' |
<|file_name|>strings.js<|end_file_name|><|fim▁begin|>///////////////////////////////////////////////////////////////////////////
// Copyright © Esri. 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 o... | "attributeSettingsPopupTitle": "Ustawienia atrybutów warstwy"
}, |
<|file_name|>lib.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 egl::egl::EGLContext;
use egl::egl::EGLDisplay;
use egl::egl... | native_display_pointer: Some(disp),
}; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.