prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>package-info.java<|end_file_name|><|fim▁begin|>/**
* Ядро булевой логики
*/
/**
* @author Алексей Кляузер <drum@pisem.net><|fim▁hole|>package org.deneblingvo.booleans.core;<|fim▁end|> | * Ядро булевой логики
*/ |
<|file_name|>Print.js<|end_file_name|><|fim▁begin|>/*
Copyright (C) 2014 Härnösands kommun
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
Lice... | };
var onClose = function() {
close(); |
<|file_name|>Fonts.java<|end_file_name|><|fim▁begin|>package de.uks.beast.editor.util;
public enum Fonts
{
//@formatter:off
HADOOP_MASTER_TITEL ("Arial", 10, true, true),<|fim▁hole|>
HADOOP_MASTER_PROPERTY ("Arial", 8, false, true),
HADOOP_SLAVE_PROPERTY ("Arial", 8, false, true),
NETWORK_PROPERTY... | HADOOP_SLAVE_TITEL ("Arial", 10, true, true),
NETWORK_TITEL ("Arial", 10, true, true),
CONTROL_CENTER_TITEL ("Arial", 10, true, true), |
<|file_name|>page.py<|end_file_name|><|fim▁begin|>"""
Created on Sep 14, 2015
@author: Mikhail
"""
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support.expected_conditions import visibility_of_element_located, visibility_of
from selenium.common.exceptions import TimeoutException
__a... | |
<|file_name|>Assignment.py<|end_file_name|><|fim▁begin|>from django.core import serializers
from django.http import HttpResponse, JsonResponse
from Assessment.models import *
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.http import require_POST, require_GET
import json
@csrf_exempt... | response_data["success"] = 0
response_data['exception'] = str(e)
else:
response_data["success"] = 1 |
<|file_name|>delete_handler.go<|end_file_name|><|fim▁begin|>package users
import (
"net/http"
"regexp"
"strings"
"github.com/pivotal-cf-experimental/warrant/internal/server/common"
"github.com/pivotal-cf-experimental/warrant/internal/server/domain"
)
type deleteHandler struct {
users *domain.Users
tokens *do... | |
<|file_name|>test_utils.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, unicode_literals
from case import Mock, patch
from amqp.five import text_t
from amqp.utils import (NullHandler, bytes_to_str, coro, get_errno, get_logger,
str_to_bytes)
class test_get_errno:
... | def test_as_logger(self): |
<|file_name|>range_test.go<|end_file_name|><|fim▁begin|>// Copyright 2014 The Cockroach 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/L... | {gossip.KeyConfigAccounting, []*prefixConfig{&prefixConfig{KeyMin, &testDefaultAcctConfig}}},
{gossip.KeyConfigPermission, []*prefixConfig{&prefixConfig{KeyMin, &testDefaultPermConfig}}}, |
<|file_name|>vsock_others.go<|end_file_name|><|fim▁begin|>//go:build !linux
// +build !linux
package vsock
import (
"fmt"
"net"
"os"
"runtime"
"syscall"
"time"
)
// errUnimplemented is returned by all functions on platforms that
// cannot make use of VM sockets.
var errUnimplemented = fmt.Errorf("vsock: not im... | func (*listener) Addr() net.Addr { return nil } |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | from .lsm import * |
<|file_name|>test_colors.py<|end_file_name|><|fim▁begin|>#
# Unit Tests for the colors.py functions
#
# Rajul Srivastava (rajul09@gmail.com)
#
import unittest
import logging
import numpy as np
import ginga.colors
class TestError(Exception):
pass
class TestColors(unittest.TestCase):
def setUp(self):
self.lo... | expected = len(ginga.colors.color_dict)
actual = len(ginga.colors.color_list)
assert expected == actual
|
<|file_name|>errors.py<|end_file_name|><|fim▁begin|>"""
The MIT License (MIT)
Copyright (c) 2014 Chris Wimbrow
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 restriction, including witho... | The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
|
<|file_name|>difficulty_test.go<|end_file_name|><|fim▁begin|>// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// ... | // "difficulty.json": true, // Testing ETH mainnet config
"difficultyFrontier.json": true,
"difficultyHomestead.json": true, |
<|file_name|>ink.formvalidator-2.js<|end_file_name|><|fim▁begin|>/**
* Form Validation
* @module Ink.UI.FormValidator_2
* @version 2
*/
Ink.createModule('Ink.UI.FormValidator', '2', [ 'Ink.UI.Common_1','Ink.Dom.Element_1','Ink.Dom.Event_1','Ink.Dom.Selector_1','Ink.Dom.Css_1','Ink.Util.Array_1','Ink.Util.I18n_1','... | FormValidator.appendI18n = function () {
validationMessages.append.apply(validationMessages, [].slice.call(arguments)); |
<|file_name|>CumulusCI.py<|end_file_name|><|fim▁begin|>import logging
from cumulusci.cli.config import CliConfig
from cumulusci.core.config import TaskConfig
from cumulusci.core.exceptions import TaskNotFoundError
from cumulusci.core.exceptions import TaskOptionsError
from cumulusci.core.tasks import CURRENT_TASK
from ... | """
return self.org.config |
<|file_name|>relative-date-formatter-example.ts<|end_file_name|><|fim▁begin|>/* tslint:disable:no-magic-numbers */
import { Component } from '@angular/core';
import { DateAdapter, MC_DATE_LOCALE } from '@ptsecurity/cdk/datetime';
import { LuxonDateAdapter } from '@ptsecurity/mosaic-luxon-adapter/adapter';
import { Date... | afterTomorrowCurrentYearSeconds: '',
afterTomorrowCurrentYearMilliseconds: '', |
<|file_name|>admin_views.py<|end_file_name|><|fim▁begin|>from db_utils import deleteLinksByHost
from db_utils import deleteHost
from db_utils import addNewHost
from db_utils import getAllHosts
from error_message import showErrorPage
from error_message import ErrorMessages
import utils
import webapp2
from google.appeng... | class DeleteHost(webapp2.RequestHandler):
def get(self):
"""
description: |
<|file_name|>pseudo_legals.rs<|end_file_name|><|fim▁begin|>pub fn pseudo_legal_moves<T: PieceType>(src: Square, color: Color, combined: BitBoard, mask: BitBoard) {<|fim▁hole|><|fim▁end|> |
} |
<|file_name|>osfm.py<|end_file_name|><|fim▁begin|>"""
OpenSfM related utils
"""
import os, shutil, sys, json, argparse
import yaml
from opendm import io
from opendm import log
from opendm import system
from opendm import context
from opendm import camera
from opendm.utils import get_depthmap_resolution
from opendm.pho... | if a single file is missing from the submodule, no files are returned for that submodel.
(i.e. get_multi_submodel_paths("path/", "odm_orthophoto.tif", "dem.tif")) --> |
<|file_name|>reflector.ts<|end_file_name|><|fim▁begin|>import {Type, isPresent, stringify} from 'angular2/src/facade/lang';
import {BaseException, WrappedException} from 'angular2/src/facade/exceptions';
import {
ListWrapper,
Map,
MapWrapper,
Set,
SetWrapper,
StringMapWrapper
} from 'angular2/src/facade/col... |
constructor(reflectionCapabilities: PlatformReflectionCapabilities) { |
<|file_name|>55ef8d641456cf304b91346e5672f316c68f8da9.js<|end_file_name|><|fim▁begin|>var fb = "https://glaring-fire-5349.firebaseio.com";
var TodoCheck = React.createClass({displayName: "TodoCheck",
getInitialState: function() {
this.checked = false;
return {checked: this.checked};
},
componentWillUnmou... | )
);
} |
<|file_name|>WaitUntilCommand.cpp<|end_file_name|><|fim▁begin|>/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2011. All Rights Reserved.
*/
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD l... | void WaitUntilCommand::Interrupted() {} |
<|file_name|>metrix++.py<|end_file_name|><|fim▁begin|>#
# Metrix++, Copyright 2009-2013, Metrix++ Project
# Link: http://metrixplusplus.sourceforge.net
#
# This file is a part of Metrix++ Tool.
#
# Metrix++ is free software: you can redistribute it and/or modify
# it under the terms of the... | |
<|file_name|>multi_view.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (C) 2008-2011, Luis Pedro Coelho <luis@luispedro.org>
# vim: set ts=4 sts=4 sw=4 expandtab smartindent:
#
# License: MIT. See COPYING.MIT file in the milk distribution
import numpy as np
__all__ = [
'multi_view_learner',
... | Ps = np.array([model.apply(f) for model,f in zip(self.models, features)])
if np.any(Ps <= 0.): return False |
<|file_name|>XZCompressionInputStream.java<|end_file_name|><|fim▁begin|>package io.sensesecure.hadoop.xz;
import java.io.BufferedInputStream;
import java.io.EOFException;
import java.io.IOException;
import java.io.InputStream;
import org.apache.hadoop.io.SequenceFile;
import org.apache.hadoop.io.compress.CompressionIn... | |
<|file_name|>inherited_box.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<|fim▁hole|> * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
<%namespace name="helpers" file="/helpe... | |
<|file_name|>GetBarcodeRecognitionQuality.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from com.aspose.barcoderecognition import BarCodeReadType
from com.aspose.barcoderecognition import BarCodeReader
class GetBarcodeRecognitionQuality:
def __init__(self):
dataDir = Settings.dataDir + 'WorkingWithBarcodeRe... | from asposebarcode import Settings |
<|file_name|>incar.py<|end_file_name|><|fim▁begin|>import os
from .input import VaspInput
__author__ = "Guillermo Avendano-Franco"<|fim▁hole|>__copyright__ = "Copyright 2016"
__version__ = "0.1"
__maintainer__ = "Guillermo Avendano-Franco"
__email__ = "gtux.gaf@gmail.com"
__status__ = "Development"
__date__ = "May 13... | |
<|file_name|>data-table.js<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain... | if (node) { |
<|file_name|>main.controller.js<|end_file_name|><|fim▁begin|>'use strict';
export default class MainController {
/*@ngInject*/
constructor($scope, Auth) {
$scope.loggedIn = false;
$scope.isStudent = false;
$scope.isInstructor = false;
Auth.getCurrentUser((user) => {
$scope.user = user;
... | }
} |
<|file_name|>cli.js<|end_file_name|><|fim▁begin|>#!/usr/bin/env node
var path = require('path');
var fs = require('fs');
var optimist = require('optimist');
var prompt = require('prompt');
var efs = require('efs');
var encext = require('./index');
var defaultAlgorithm = 'aes-128-cbc';<|fim▁hole|> .boolean('r')
.ali... |
var argv = optimist
.usage('usage: encext [-r] [-a algorithm] [file ...]')
.describe('r', 'recursively encrypt supported files') |
<|file_name|>NewQuestionPanel.js<|end_file_name|><|fim▁begin|>/*
* This file is part of ARSnova Mobile.
* Copyright (C) 2011-2012 Christian Thomas Weber
* Copyright (C) 2012-2015 The ARSnova Team
*
* ARSnova Mobile is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Pub... | |
<|file_name|>utility.ts<|end_file_name|><|fim▁begin|>/*tslint:disable:no-bitwise*/
import {InjectedRouter} from 'react-router';
import * as store from 'store';
import {EcpState} from '../store/ecp.state';
import * as session from '../login/session.model';
import * as moment from 'moment';
export class Utility {
... | |
<|file_name|>render.rs<|end_file_name|><|fim▁begin|>use syntax::ast::{Expr, Ident, Pat, Stmt, TokenTree};
use syntax::ext::base::ExtCtxt;
use syntax::ext::build::AstBuilder;
use syntax::parse::token;
use syntax::ptr::P;
use maud;
#[derive(Copy, Clone)]<|fim▁hole|>
pub struct Renderer<'cx> {
pub cx: &'cx ExtCtxt<'... | pub enum Escape {
PassThru,
Escape,
} |
<|file_name|>services-wrapper.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python3
"""
services-wrapper A small tool which wraps around check-services.php and tries to
guide the services process with a more modern approach with a
Queue and workers.
Based on the original version of ... | |
<|file_name|>line.js<|end_file_name|><|fim▁begin|>import {Curve} from '../curve'
export class Line extends Curve {
constructor(p0, v) {
super();
this.p0 = p0;
this.v = v;
this._pointsCache = new Map();
}
intersectSurface(surface) {
if (surface.isPlane) {
const s0 = surface.normal.mult... | |
<|file_name|>main.ts<|end_file_name|><|fim▁begin|>import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { enableProdMode } from '@angular/core';
import { AppModule } from './app/app.module';
<|fim▁hole|>platformBrowserDynamic().bootstrapModule(AppModule);<|fim▁end|> | enableProdMode(); |
<|file_name|>HTMLBodyElement.js<|end_file_name|><|fim▁begin|>"use strict";
const conversions = require("webidl-conversions");
const utils = require("./utils.js");
const HTMLElement = require("./HTMLElement.js");
const impl = utils.implSymbol;
const mixin = utils.mixin;
const WindowEventHandlers = require("./WindowEven... | set(V) {
V = conversions["DOMString"](V, { treatNullAsEmptyString: true }); |
<|file_name|>boxplus.transition.js<|end_file_name|><|fim▁begin|>/**@license boxplus image transition engine
* @author Levente Hunyadi
* @version 1.4.2
* @remarks Copyright (C) 2009-2010 Levente Hunyadi
* @remarks Licensed under GNU/GPLv3, see http://www.gnu.org/licenses/gpl-3.0.html
* @see http://hunyadi.info... | |
<|file_name|>mi_parse.test.ts<|end_file_name|><|fim▁begin|>import * as assert from 'assert';
import { parseMI, MINode } from '../../backend/mi_parse';
suite("MI Parse", () => {
test("Simple out of band record", () => {
const parsed = parseMI(`4=thread-exited,id="3",group-id="i1"`);
assert.ok(parsed);
assert.equ... | });
test("Empty line", () => { |
<|file_name|>vacuum2Runner.py<|end_file_name|><|fim▁begin|>import agents as ag
import envgui as gui
# change this line ONLY to refer to your project
import submissions.Porter.vacuum2 as v2
# ______________________________________________________________________________
# Vacuum environmenty
class Dirt(ag.Thing):
... | agent.performance -= 1
|
<|file_name|>TimeSyncProxy.java<|end_file_name|><|fim▁begin|>package me.tatarka.timesync.lib;
import android.content.Context;
import java.util.Arrays;
/**
* A class for interacting with a {@link TimeSync}. You can get and set it's configuration, and
* force it to sync immediately. Ta get an instance of the class f... | */
public void edit(Iterable<TimeSync.Edit> edits) {
listener.edit(edits);
TimeSyncService.update(context, name); |
<|file_name|>dialog.ts<|end_file_name|><|fim▁begin|>// SPDX-FileCopyrightText: 2018-2020 The Manyverse Authors
//
// SPDX-License-Identifier: MPL-2.0
import {Stream} from 'xstream';
import {Image} from 'react-native-image-crop-picker';
import {DialogSource} from '../../drivers/dialogs';
import {t} from '../../drivers/... | |
<|file_name|>mattex.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import sys, re
output = open(sys.argv[1])
output = output.read()
output = re.split('thisisalinebreak =',output)
<|fim▁hole|> if line == "<?ml\n":
matlab = True
j = 0
for oline in output[i].split('\n'):
if (... | f = open(sys.argv[2])
i = 1
matlab = False
for line in f: |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
website.api
~~~~~~~~~~~<|fim▁hole|>"""<|fim▁end|> |
website api blueprint. |
<|file_name|>BufferedWriter.java<|end_file_name|><|fim▁begin|>// The MIT License (MIT)
// Copyright © 2015 AppsLandia. All rights reserved.
// 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... | |
<|file_name|>validation.py<|end_file_name|><|fim▁begin|>import difflib
import inflect
import itertools
import logging
import netaddr
import os
import re
import toposort
import yaml
import hotcidr.state
def inflect_a(s, p=inflect.engine()):
x = p.plural(s)
if p.compare(s, x) == 'p:s':
return s
retur... | def validate_group_names(self): |
<|file_name|>lda_testing.py<|end_file_name|><|fim▁begin|>__author__ = 'fpena'
import numpy as np
import lda
import lda.datasets
def run():
# document-term matrix
X = lda.datasets.load_reuters()
print("type(X): {}".format(type(X)))
print("shape: {}\n".format(X.shape))
# the vocab
vocab = lda... |
reuters_dataset = lda.datasets.load_reuters()
vocab = lda.datasets.load_reuters_vocab()
titles = lda.datasets.load_reuters_titles() |
<|file_name|>FormRigDisplay.py<|end_file_name|><|fim▁begin|><|fim▁hole|># Form implementation generated from reading ui file 'UI_RigDisplay.ui'
#
# Created: Wed Mar 21 21:43:33 2018
# by: pyside-uic 0.2.14 running on PySide 1.2.0
#
# WARNING! All changes made in this file will be lost!
from PySide import QtCore, ... | # -*- coding: utf-8 -*-
|
<|file_name|>StatefulIntersectionProps.tsx<|end_file_name|><|fim▁begin|>import * as React from 'react';
export interface StatefulProps {
/** myProp description */
myProp: string;
}
export interface StatefulMoreProps {
/** moreProp description */
moreProp: number;
}
/** StatefulIntersectionProps description *... | export class StatefulIntersectionProps extends React.Component< |
<|file_name|>LUIInputField.py<|end_file_name|><|fim▁begin|>import re
from LUIObject import LUIObject
from LUISprite import LUISprite
from LUILabel import LUILabel
from LUIInitialState import LUIInitialState
from LUILayouts import LUIHorizontalStretchedLayout
__all__ = ["LUIInputField"]
class LUIInputField(LUIObject... | self.trigger_event(key_name, self._value)
def on_keyrepeat(self, event): |
<|file_name|>app.js<|end_file_name|><|fim▁begin|>/**
* Module dependencies.
*/
var express = require('express')
, http = require('http')
, path = require('path')
, mongo = require('mongodb')
, format = require('util').format;
var app = express();
<|fim▁hole|>app.set('view engine', 'jade');
app.use(express.f... | // all environments
app.set('port', process.env.PORT || 3000);
app.set('views', __dirname + '/views'); |
<|file_name|>UIMenuControllerArrowDirection.java<|end_file_name|><|fim▁begin|>package apple.uikit;
import java.io.*;
import java.nio.*;
import java.util.*;
import com.google.j2objc.annotations.*;
import com.google.j2objc.runtime.*;
import com.google.j2objc.runtime.block.*;
import apple.audiotoolbox.*;
import apple.co... | import apple.coreimage.*;
import apple.coretext.*; |
<|file_name|>hdu.py<|end_file_name|><|fim▁begin|>import time
import requests
import answer
min_question_id = 1000
max_question_id = 5604
sleep_time = 10
submit_url = 'http://acm.hdu.edu.cn/submit.php?action=submit'
login_url = 'http://acm.hdu.edu.cn/userloginex.php?action=login'
headers = {
'User-Agent': 'Moz... | |
<|file_name|>option.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses... | |
<|file_name|>status_icon_linux_wrapper.cc<|end_file_name|><|fim▁begin|>// Copyright 2013 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.
#include "chrome/browser/ui/views/status_icons/status_icon_linux_wrapper.h"
#inclu... |
void StatusIconLinuxWrapper::SetImage(const gfx::ImageSkia& image) {
image_ = GetBestImageRep(image); |
<|file_name|>LogisticErrorFunction.java<|end_file_name|><|fim▁begin|><|fim▁hole|>import de.jungblut.math.DoubleMatrix;
import de.jungblut.math.MathUtils;
/**
* Logistic error function implementation.
*
* @author thomas.jungblut
*
*/
public final class LogisticErrorFunction implements ErrorFunction {
@Overrid... | package de.jungblut.math.squashing;
|
<|file_name|>keras_saved_model.py<|end_file_name|><|fim▁begin|># Copyright 2018 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... | - Training: model is compiled with an optimizer defined under `tf.train`.
This is because `tf.keras.optimizers.Optimizer` instances cannot be |
<|file_name|>repl.js<|end_file_name|><|fim▁begin|>/* */
(function(Buffer) {
var crypto = require("crypto");
var sign = require("./sign");
var m = new Buffer('AF2BDBE1AA9B6EC1E2ADE1D694F41FC71A831D0268E9891562113D8A62ADD1BF', 'hex');
var xbuf = new Buffer('009A4D6792295A7F730FC3F2B49CBC0F62E862272F', 'hex');
... | var k = sign.makeKey(q, kv, 'sha256', crypto);
console.log('k', k); |
<|file_name|>hauling_v2.js<|end_file_name|><|fim▁begin|>$( document ).ready( function () {
$( "#form" ).validate( {
rules: {
company: { required: true },
truckType: { required: true },
materialType: { required: true },
fromSite: { required: true },
toSite: { required: true },
hourI... | $("#btnEmail").click(function(){ |
<|file_name|>chanclient.rs<|end_file_name|><|fim▁begin|>use std::sync::mpsc::{channel, Receiver, Sender};<|fim▁hole|>use routing::{NodeHandle, EffectMeta, EffectId};
/// Client that turns all messages into an enum variant
/// and sends them accross a thread-safe channel.
#[derive(Debug)]
pub struct MpscClient {
tx... |
use ndarray::Array2;
use super::Client; |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""Service layer (domain model) of practice app<|fim▁hole|><|fim▁end|> | """ |
<|file_name|>TransactionalFilesystemInterface.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2006-2008 Alfresco Software Limited.
*
* 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; eit... | |
<|file_name|>saml.go<|end_file_name|><|fim▁begin|>// Package saml contains a partial implementation of the SAML standard in golang.
// SAML is a standard for identity federation, i.e. either allowing a third party to authenticate your users or allowing third parties to rely on us to authenticate their users.
//
// In S... | // |
<|file_name|>user.go<|end_file_name|><|fim▁begin|>/*
* Spreed WebRTC.
* Copyright (C) 2013-2015 struktur AG
*
* This file is part of Spreed WebRTC.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free So... |
// RemoveSession removes a session from the session table abd returns
// true if no session is left left. |
<|file_name|>linux.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>// Copyright (c) 2014 Robert Clipsham <robert@octarineparrot.com>
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT... | |
<|file_name|>FileParser.py<|end_file_name|><|fim▁begin|># This is a separate module for parser functions to be added.
# This is being created as static, so only one parser exists for the whole game.
from nota import Nota
from timingpoint import TimingPoint
from tools import *
import random
import math
<|fim▁hole|> if... | def get_Name (osufile):
Splitlines = osufile.split('\n')
for Line in Splitlines: |
<|file_name|>Props.java<|end_file_name|><|fim▁begin|>package eu.monnetproject.util;
import java.util.*;
/**
* Utility function to syntactically sugar properties for OSGi.
* This allows you to create a property map as follows<|fim▁hole|> * <code>Props.prop("key1","value1")</code><br/>
* <code> .prop("key2","val... | |
<|file_name|>triangle_making.py<|end_file_name|><|fim▁begin|>class TriangleMaking:
def maxPerimeter(self, a, b, c):
first = a
second = b
third = c
sides = [first, second, third]
for idx, side in enumerate(sides):
one = (idx + 1) % 3
two = (idx + 2) ... | return sum(sides) |
<|file_name|>rtree.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# 使用 UTF-8
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
import sys
from heap import Heap
class Rectangle(object):
"""docstring for Rectangle"""
def __init__(self, dimension, entry=None):
super(Rectangle, self).__ini... | |
<|file_name|>Achievement.ts<|end_file_name|><|fim▁begin|>import { Component } from '@angular/core';
import { NavParams, ViewController } from 'ionic-angular';
@Component({
selector: 'page-Achievement',
templateUrl: 'Achievement.html'
})
export class Achievement {
<|fim▁hole|> }
dismiss() {
this.viewCtrl.d... | readonly achievement:{title:string,description:string, recompense:number, imageUrl: string};
constructor(public navParams: NavParams, public viewCtrl: ViewController) {
this.achievement = navParams.get("achievement"); |
<|file_name|>editSpecification_job_parameters.js<|end_file_name|><|fim▁begin|><!--<|fim▁hole|> this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. ... | Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with |
<|file_name|>test-kube-client.js<|end_file_name|><|fim▁begin|>/*
* This file is part of Cockpit.
*
* Copyright (C) 2015 Red Hat, Inc.
*
* Cockpit is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; e... | |
<|file_name|>fast_marker_cluster.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from folium.plugins.marker_cluster import MarkerCluster
from folium.utilities import if_pandas_df_convert_to_numpy, validate_location
from jinja2 import Template
class FastMarkerCluster(MarkerCluster):
"""
Add marker cl... |
Parameters
---------- |
<|file_name|>test-trac-0218.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import logging
if __name__ == '__main__':
logging.basicConfig()
_log = logging.getLogger(__name__)
import pyxb.binding.generate
import pyxb.utils.domutils
from xml.dom import Node
import os.path
xst = '''<?xml version="1.0"?>
<xs:s... |
import unittest
class TestTrac0218 (unittest.TestCase): |
<|file_name|>alignment-gep-tup-like-2.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... | trait Invokable<A,B> {
fn f(&self) -> (A, B);
}
|
<|file_name|>tensor_signature_test.py<|end_file_name|><|fim▁begin|># Copyright 2016 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:/... | self.assertTrue(tensor_signature.tensors_compatible(placeholder_d,
signatures)) |
<|file_name|>content_panel.js<|end_file_name|><|fim▁begin|>var $$ = React.createElement;
var Substance = require("substance");
var Scrollbar = require("./scrollbar");
var _ = require("substance/helpers");
var PanelMixin = require("./panel_mixin");
var ContentPanelMixin = _.extend({}, PanelMixin, {
contextTypes: {
... | },
render: function() {
var app = this.context.app; |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from rest_framework import viewsets
from rest_framework.permissions import IsAuthenticated
from .models import Submission
from .serializers import SubmissionSerializer
from django.views.generic import ListView, DetailView
from django.views.generic.edit import CreateV... | def get_context_data(self, **kwargs): |
<|file_name|>setup.js<|end_file_name|><|fim▁begin|>require('babel-core/register')
const path = require('path')
const jsdom = require('jsdom').jsdom
const exposedProperties = ['window', 'navigator', 'document']
global.document = jsdom('')
global.window = document.defaultView
Object.keys(document.defaultView).forEach((... | |
<|file_name|>ajaxwrapper.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from __future__ import print_function
import os
import cgi
from subprocess import Popen, PIPE, STDOUT
# Java
SCRIPTDIR = 'javaprolog'
# SCRIPT = ['/usr/bin/java', '-cp', 'json-simple-1.1.1.jar:gnuprologjava-0.2.6.jar:.', 'Shrdlite']
impo... |
if err:
raise Exception(err)
|
<|file_name|>character.rs<|end_file_name|><|fim▁begin|>use datatypes::{Coords, Region};
use terminal::{CharData, CellData, UseStyles};
use terminal::interfaces::{WriteableGrid, WriteableCell};
impl CharData for char {
fn write<T>(&self, coords: Coords, styles: UseStyles, grid: &mut T) -> Coords
where T: Writea... | |
<|file_name|>config.rs<|end_file_name|><|fim▁begin|>//! Customize line editor
use std::default::Default;
/// User preferences
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct Config {
/// Maximum number of entries in History.
max_history_size: usize, // history_max_entries
history_duplicates: Histor... | |
<|file_name|>let-destruct-ref.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.or... | // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms. |
<|file_name|>drivercommon.cpp<|end_file_name|><|fim▁begin|>#include "drivercommon.h"
#include <common/fortconf.h>
#include <common/fortioctl.h>
#include <common/fortlog.h>
#include <common/fortprov.h>
namespace DriverCommon {
QString deviceName()
{
return QLatin1String(FORT_DEVICE_NAME);
}
quint32 ioctlValidate... |
quint32 logStatTrafSize(quint16 procCount)
{ |
<|file_name|>handler.go<|end_file_name|><|fim▁begin|>package httpd
import (
"bytes"
"compress/gzip"
"encoding/json"
"errors"
"expvar"
"fmt"
"io"
"io/ioutil"
"log"
"math"
"net/http"
"os"
"runtime/debug"
"strconv"
"strings"
"sync/atomic"
"time"
"github.com/bmizerany/pat"
"github.com/dgrijalva/jwt-go"... | level := r.URL.Query().Get("consistency")
consistency := models.ConsistencyLevelOne |
<|file_name|>auth.go<|end_file_name|><|fim▁begin|>// Copyright 2010 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 smtp
import (
"crypto/hmac"
"crypto/md5"
"errors"
"fmt"
)
// Auth is implemented by an SMTP auth... | |
<|file_name|>ScoreCaculating.py<|end_file_name|><|fim▁begin|>import math
import sys
sys.path.append('..')
import Analyse.AFX as AFX
class State:
def __init__(self):
self.SenShifterState = True
self.MoodStrength = 1.0
self.positive = 0.0
self.negative = 0.0
def Process(self, score):
if self.SenShifterState... | print Sen
print CaculateASentence(Sen) |
<|file_name|>ReplayMessageHandler.java<|end_file_name|><|fim▁begin|>package tracker.message.handlers;
import elasta.composer.message.handlers.MessageHandler;
import io.vertx.core.eventbus.Message;<|fim▁hole|> */
public interface ReplayMessageHandler extends MessageHandler<JsonObject> {
@Override
void handle(Me... | import io.vertx.core.json.JsonObject;
/**
* Created by sohan on 2017-07-26. |
<|file_name|>thrifttest_handler.go<|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 ... | |
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import jsonfield.fields
import django.utils.timezone
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
... | |
<|file_name|>music_box.py<|end_file_name|><|fim▁begin|>from gpiozero import Button
import pygame.mixer<|fim▁hole|>pygame.mixer.init()
button_sounds = {
Button(2): Sound("samples/drum_tom_mid_hard.wav"),
Button(3): Sound("samples/drum_cymbal_open.wav"),
}
for button, sound in button_sounds.items():
button.... | from pygame.mixer import Sound
from signal import pause
|
<|file_name|>test_json.py<|end_file_name|><|fim▁begin|>from unittest import TestCase
from firstinbattle.deck import Card
from firstinbattle.json_util import js
class TestJson(TestCase):
def test_encode_loads(self):
cards = {
Card(5, 'diamond'),
Card(9, 'heart'),
}
... | decoded_obj = js.loads(encoded_str) |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import styled from "styled-components"
export const Code = styled.code`
padding: 3px 8px;
background-color: ${({ theme }) => theme.posts.inlineCodeBackground};
color: ${({ theme }) => theme.posts.inlineCodeColor};
border-radius: 6px;<|fim▁hole|><|fim▁end|> | ` |
<|file_name|>ordered-dict.py<|end_file_name|><|fim▁begin|>"""
Task
You are the manager of a supermarket.
You have a list of N items together with their prices that consumers bought on a particular day.
Your task is to print each item_name and net_price in order of its first occurrence.
item_name = Name of the item.
n... | total_price = ordered_dict.get(item)
total_price += price |
<|file_name|>make_mo_files.py<|end_file_name|><|fim▁begin|># (C) Copyright 2014 Voyager Search
#
# 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
... | import sys |
<|file_name|>ByteToCharISO8859_7.java<|end_file_name|><|fim▁begin|>/*<|fim▁hole|> *
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as sub... | * Copyright 1996-2003 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
<|file_name|>app-routing.module.ts<|end_file_name|><|fim▁begin|>import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
<|fim▁hole|>const routes: Routes = [
{
path: 'members',
component: MembersComponent
},
{
path: 'seating-map',
component: SeatingMapCompo... | import { MembersComponent } from './members/members.component';
import { SeatingMapComponent } from './seating-map/seating-map.component';
|
<|file_name|>HorizontalRule.js<|end_file_name|><|fim▁begin|>dojo.provide("dijit.form.HorizontalRule");
dojo.require("dijit._Widget");
dojo.require("dijit._Templated");
dojo.declare("dijit.form.HorizontalRule", [dijit._Widget, dijit._Templated],
{
// summary:
// Hash marks for `dijit.form.HorizontalSlider`
templa... | }
innerHTML += this._genHTML(100, this.count-1);
}else{
innerHTML = this._genHTML(100, 0); |
<|file_name|>subrepo.py<|end_file_name|><|fim▁begin|># subrepo.py - sub-repository handling for Mercurial
#
# Copyright 2009-2010 Matt Mackall <mpm@selenic.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
import errno, os, re,... | @annotatesubrepoerror |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.