prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>mlp.py<|end_file_name|><|fim▁begin|>import sys
import numpy as np
from sklearn.model_selection import StratifiedKFold
from sklearn.neural_network import MLPClassifier
from sklearn.metrics import f1_score,accuracy_score, recall_score, precision_score
import scipy
from random import shuffle
def load_dataset... | print "(f1 : %4.3f) "%(f1_score(ytest,ypred, average='weighted'))
print "(recall : %4.3f) "%(recall_score(ytest,ypred,average='weighted')) |
<|file_name|>GatewayDetails.java<|end_file_name|><|fim▁begin|>package bp.details;
import javax.swing.JLabel;
import javax.swing.JSpinner;
import javax.swing.SpinnerModel;
import javax.swing.SpinnerNumberModel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import bp.model.data... | minInputSp.setValue(gateway.getMinInput());
}
|
<|file_name|>solver.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# Solver object
# Copyright (C) 2011-2012, Tomi Leppänen (aka Tomin)
#
# 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
# ... | # You should have received a copy of the GNU General Public License |
<|file_name|>FileRecord.ts<|end_file_name|><|fim▁begin|>/*
fTelnet: An HTML5 WebSocket client
Copyright (C) Rick Parrish, R&M Software
This file is part of fTelnet.
fTelnet is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by t... | constructor(name: string, size: number) {
this._Name = name; |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>/*!
This crate provides a number of conversion traits with more specific semantics than those provided by `as` or `From`/`Into`.
The goal with the traits provided here is to be more specific about what generic code can rely on, as well as provide reasonably self-describ... | type Err = NoError; |
<|file_name|>country.rs<|end_file_name|><|fim▁begin|>use std::collections::BTreeMap;
use std::f64;
use super::country_page_data::CountryPageData;
use super::event::Event;
use super::event_trunc::{EventTrunc, EventTruncRenderable};
use super::year::Year;
use super::year_page_data::YearPageData;
/// `Country` contains ... | year_vec.push(elem.clone());
}
for elem in &mut year_vec { |
<|file_name|>nav.component.ts<|end_file_name|><|fim▁begin|>import {Component, OnInit} from '@angular/core';
import {LegacyAppRouter} from '../../core/legacy-app-router';
import {AuthService} from 'app/auth/auth.service';
import {LoggedInUser} from '../../auth/logged-in-user';
@Component({
selector: 'tb-nav',
t... | ngOnInit() { |
<|file_name|>fcm.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
blank_datafile = '/home/kyleb/Dropbox/UCSF/cas9/FCS/150916-3.1/kyleb/150916-rfp-cas9/96 Well - Flat bottom_002/Specimen_001_F1_F01_046.fcs'
script_output_dir = 'script_output'
sample_directory = '/home/kyleb/Dropbox/UCSF/cas9/FCS/150916-3.1/kyleb/15091... | |
<|file_name|>3_2.cpp<|end_file_name|><|fim▁begin|>/*
How would you design a stack which, in addition to push and pop, also has a function min
which returns the minimum element? Push, pop and min should all operate in O(1) time.
*/
#include <stdio.h>
#include <map>
using namespace std;
#define N 500
typedef st... | s.minTr.insert(pair<int, int>(s.top, val));
s.min = val; |
<|file_name|>run_command.rs<|end_file_name|><|fim▁begin|>extern crate std;
extern crate hostname;
extern crate glob;
use std::str;
use std::ffi::OsString; // Probably want OsStr in a few places
use std::path::Path;
use std::process::Command;
use std::fs;
use state::ShellState;
impl ShellState {
pub fn run_command... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#
# Copyright 2011 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... | # distributed under the License is distributed on an "AS IS" BASIS, |
<|file_name|>Modal.js<|end_file_name|><|fim▁begin|>import './Modal.scss'
import pugTpl from './Modal.pug'
import mixin from '../../mixin'
import alert from '@vue2do/component/module/Modal/alert'
import confirm from '@vue2do/component/module/Modal/confirm'
export default {
name: 'PageCompModal',<|fim▁hole|>
mixins... |
template: pugTpl(), |
<|file_name|>test_mini_project7.py<|end_file_name|><|fim▁begin|># unit tests for Mini-project 7 (The Fifteen Puzzle), by k., 08/02/2014
import unittest
from mini_project7 import Puzzle
class TestFunctions(unittest.TestCase):
def setUp(self):
pass
def test_lower_row_invariant(self):
state = Pu... | |
<|file_name|>import_odbc.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
##############################################################################
#
# Daniel Reis
# 2011
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero Genera... | |
<|file_name|>return-list-item.component.ts<|end_file_name|><|fim▁begin|>import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-return-list-item',<|fim▁hole|> styleUrls: ['./return-list-item.component.css']
})
export class ReturnListItemComponent implements OnInit {
constructor() {}
ngOn... | templateUrl: './return-list-item.component.html', |
<|file_name|>sparse_matrix_vector_07.cc<|end_file_name|><|fim▁begin|>// ---------------------------------------------------------------------
//
// Copyright (C) 2004 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// The deal.II library is free software; you can use it, redistribute
//... | for (unsigned int i=0; i<v.size(); ++i)
{ |
<|file_name|>raster.rs<|end_file_name|><|fim▁begin|>//! Path rasterization.
use crate::{gpu::GpuVertex, Result, P2};
use lyon_path::Builder;
use lyon_tessellation::{
BuffersBuilder, FillAttributes, FillOptions, FillTessellator, LineJoin, StrokeAttributes,
StrokeOptions, StrokeTessellator, VertexBuffers,
};
use... | method: Method, |
<|file_name|>edit_channel.rs<|end_file_name|><|fim▁begin|>use internal::prelude::*;
/// A builder to edit a [`GuildChannel`] for use via [`GuildChannel::edit`]
///
/// Defaults are not directly provided by the builder itself.
///
/// # Examples
///
/// Edit a channel, providing a new name and topic:
///
/// ```rust,ig... | |
<|file_name|>transformer_benchmark.py<|end_file_name|><|fim▁begin|># Copyright 2019 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:/... | 'min_value': bleu_min,
'max_value': bleu_max})
if (warmup and 'step_timestamp_log' in stats and |
<|file_name|>WidthSizable.ts<|end_file_name|><|fim▁begin|>// Copyright 2021-2022, University of Colorado Boulder
/**
* Provides a minimum and preferred width. The minimum width is set by the component, so that layout containers could
* know how "small" the component can be made. The preferred width is set by the lay... | return this.minimumWidthProperty.value;
}
|
<|file_name|>test_share_types_negative.py<|end_file_name|><|fim▁begin|># Copyright 2014 OpenStack Foundation
# 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
#
... | self.assertRaises(lib_exc.NotFound,
self.create_share,
share_type_id=data_utils.rand_name("fake"))
|
<|file_name|>postprocess.py<|end_file_name|><|fim▁begin|># <hr>Calculates the tangents and bitangents for the imported meshes.
#
# Does nothing if a mesh does not have normals. You might want this post
# processing step to be executed if you plan to use tangent space calculations
# such as normal mapping applied to... | # exactly the same settings.
#
# Several material settings not contributing to the final appearance of |
<|file_name|>auth.py<|end_file_name|><|fim▁begin|>"""Flask Blueprint adding login functionality to our app. Note that we expect
gluten model and db config to be handled elsewhere
"""
import sys
import traceback
from functools import partial, wraps
from flask import redirect, request, flash, session, abort, g, url_fo... | def logout():
set_user_session() |
<|file_name|>ImprovementCardServiceSpec.ts<|end_file_name|><|fim▁begin|>// Copyright 2019 The Oppia 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
//
// ... | |
<|file_name|>ws_iris_AdaBoostClassifier_mysql_code_gen.py<|end_file_name|><|fim▁begin|>from sklearn2sql_heroku.tests.classification import generic as class_gen
<|fim▁hole|><|fim▁end|> |
class_gen.test_model("AdaBoostClassifier" , "iris" , "mysql") |
<|file_name|>create_secret_tls.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... | }
return nil
} |
<|file_name|>settings.py<|end_file_name|><|fim▁begin|>import os
# Django settings for mysite project.
DEBUG = True
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
SITE_ROOT = os.path.join(os.path.abspath(os.path.dirname(__file__)),... | },
'handlers': {
'mail_admins': {
'level': 'ERROR', |
<|file_name|>global.js<|end_file_name|><|fim▁begin|>$(function() {
(function() {
$('.j_toClass').each(function(index, el) {
var $it = $(this);
var targetTo = $it.attr('data-target');
var thisTo = $it.attr('data-this');<|fim▁hole|> var $target = $(targetId);
var _fn = {
on: function() {
$targe... | var targetId = $it.attr('href'); |
<|file_name|>syntaxEnvironment.js<|end_file_name|><|fim▁begin|>/**
* syntaxEnvironment.js
* Andrea Tino - 2015
*/
/**
* Main collection point for types to be rendered.
*/
module.exports = function() {
var tsClass = require('./class.js');
var tsInterface = require('./interface.js');
var tsEnum = require('./e... | */
buildInterfaces: function() {
}, |
<|file_name|>construct.cpp<|end_file_name|><|fim▁begin|>// Copyright Louis Dionne 2013-2017
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)<|fim▁hole|>
template <int i>
struct x { };
int main() {
constexpr hana::basic_... |
#include <boost/hana/basic_tuple.hpp>
namespace hana = boost::hana;
|
<|file_name|>rng.js<|end_file_name|><|fim▁begin|>// Random number generator - requires a PRNG backend, e.g. prng4.js
// For best results, put code like
// <body onClick='rng_seed_time();' onKeyPress='rng_seed_time();'>
// in your main HTML document.
var rng_state;
var rng_pool;
var rng_pptr;
// Mix in a 32-bit integ... | var ua = new Uint8Array(32);
window.crypto.getRandomValues(ua);
for(t = 0; t < 32; ++t) |
<|file_name|>store.js<|end_file_name|><|fim▁begin|>import { createStore } from '@utils/store.utils';
import placeholderImage from '../images/placeholder.jpeg';
import { getPhotoUrl, getPrefetchedPhotoForDisplay } from './api';
import { getLocalPhotoPath, getRandomLocalPhoto } from './photos.local';
import Settings from... |
// if allowed to fetch from server
// begin with assuming we get a
// prefetched photo from the api |
<|file_name|>erase_regions.rs<|end_file_name|><|fim▁begin|>use crate::mir;
use crate::ty::fold::{TypeFoldable, TypeFolder};
use crate::ty::{self, Ty, TyCtxt, TypeFlags};
pub(super) fn provide(providers: &mut ty::query::Providers) {
*providers = ty::query::Providers { erase_regions_ty, ..*providers };
}
fn erase_r... | where
T: TypeFoldable<'tcx>,
{ |
<|file_name|>pool.go<|end_file_name|><|fim▁begin|>package pipeline
import (
"runtime"
"sync/atomic"
"time"
"github.com/Jeffail/benthos/v3/internal/component"
iprocessor "github.com/Jeffail/benthos/v3/internal/component/processor"
"github.com/Jeffail/benthos/v3/internal/log"
"github.com/Jeffail/benthos/v3/inter... | case <-p.closeChan: |
<|file_name|>Holiday.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Source : Les recettes Python de Tyrtamos
http://python.jpvweb.com/mesrecettespython/doku.php?id=date_de_paques
"""
class jourferie:
def datepaques(self,an):
"""Calcule la date de Pâques d'une année do... | nj = self.numjoursem(d) |
<|file_name|>PhraseService.java<|end_file_name|><|fim▁begin|>/*
* PhraseService.java
*
* Copyright (C) 2018 [ A Legge Up ]
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
package com.aleggeup.confagrid.content;
import java.util.List;... | |
<|file_name|>pixel_collidable.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
class PixelCollidable( Collidable ) :
def __init__(self) :
self.spm = None
self.r = None<|fim▁end|> | from collidable import *
from math_3d import * |
<|file_name|>ArServerModeRatioDrive.cpp<|end_file_name|><|fim▁begin|>/*
MobileRobots Advanced Robotics Interface for Applications (ARIA)
Copyright (C) 2004, 2005 ActivMedia Robotics LLC
Copyright (C) 2006, 2007, 2008, 2009 MobileRobots Inc.
Copyright (C) 2010, 2011 Adept Technology, Inc.
This program is free soft... | |
<|file_name|>webserver.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from flask import Flask
from flask import Flask,jsonify, request, Response, session,g,redirect, url_for,abort, render_template, flash
from islem import *
from bot import *
import sys
import time
import datetime
reload(sys)
sys.setdefaultenc... | |
<|file_name|>fib.rs<|end_file_name|><|fim▁begin|>extern crate llvm;
use llvm::*;
use llvm::Attribute::*;
fn main() {
let ctx = Context::new();
let module = Module::new("simple", &ctx);
let func = module.add_function("fib", Type::get::<fn(u64) -> u64>(&ctx));
func.add_attributes(&[NoUnwind, ReadNone]);
... | |
<|file_name|>user_resource.go<|end_file_name|><|fim▁begin|>package dao
import (
"context"
"database/sql"
"go-common/app/service/live/resource/model"
"go-common/library/ecode"
"go-common/library/log"
"time"
"github.com/jinzhu/gorm"
)
var (
addSql = "INSERT INTO `user_resource`(`res_type`,`custom_id`,`title... | } |
<|file_name|>import_supervised_user_tests.js<|end_file_name|><|fim▁begin|>// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be<|fim▁hole|>
cr.define('user_manager.import_supervised_user_tests', function() {
function registerTests() {
... | // found in the LICENSE file. |
<|file_name|>cleanup.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/li... | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { |
<|file_name|>sextutils.py<|end_file_name|><|fim▁begin|>"""
Utilities for parseing SExtractor files.
H. Ferguson - revised 4/23/03 to promote ints to floats if a value
with a decimal point appears somewhere in the column originally thought
to be integers
version::
v2.1 - fails gracefully when the catalog has no s... | setattr(self, colname, N.zeros((len(self),), coltype)) |
<|file_name|>topup.go<|end_file_name|><|fim▁begin|>package stripe
// TopupParams is the set of parameters that can be used when creating or updating a top-up.
// For more details see https://stripe.com/docs/api#create_topup and https://stripe.com/docs/api#update_topup.
type TopupParams struct {
Params `f... | Description string `json:"description"` |
<|file_name|>StringUtils.java<|end_file_name|><|fim▁begin|>package com.temenos.soa.plugin.uml2dsconverter.utils;
// General String utilities
public class StringUtils {
/**
* Turns the first character of a string in to an uppercase character
* @param source The source string
* @return String Resultant string
... | result.append(Character.toLowerCase(source.charAt(0))).append(source.substring(1)); |
<|file_name|>_express_route_circuit_connections_operations.py<|end_file_name|><|fim▁begin|># coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for lic... | **kwargs # type: Any
):
# type: (...) -> None |
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>from django.test import TestCase
from manager.models import Page
from datetime import datetime, timedelta
from django.utils import timezone
class PageTestCase(TestCase):
def setUp(self):
now = timezone.now()
Page.objects.create(url="testurl", descript... | self.assertTrue(page.is_active(now))
|
<|file_name|>auth.py<|end_file_name|><|fim▁begin|>from django.contrib.auth.backends import ModelBackend
from django.contrib.sites.models import Site
from socialregistration.contrib.twitter.models import TwitterProfile
class TwitterAuth(ModelBackend):
def authenticate(self, twitter_id=None):
try:
... | except TwitterProfile.DoesNotExist: |
<|file_name|>certs_test.go<|end_file_name|><|fim▁begin|>/*
Copyright 2017 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... | kubeadmconstants.FrontProxyClientCertName, kubeadmconstants.FrontProxyClientKeyName,
},
}, |
<|file_name|>foldelf.cpp<|end_file_name|><|fim▁begin|>/* -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* 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/... | int uniquecount = 0, totalcount = 0;
for (elf_text_map::const_iterator entry = textmap.begin(); |
<|file_name|>ZipAssetBundle.cpp<|end_file_name|><|fim▁begin|><|fim▁hole|>#include "StableHeaders.h"
#include "ZipAssetBundle.h"
#include "ZipHelpers.h"
#include "ZipWorker.h"
#include "CoreDefines.h"
#include "Framework.h"
#include "FrameAPI.h"
#include "AssetAPI.h"
#include "AssetCache.h"
#include "LoggingFunctions.h... | // For conditions of distribution and use, see copyright notice in LICENSE
|
<|file_name|>AnnouncementDeleteRequest.ts<|end_file_name|><|fim▁begin|>import {AsyncTask} from "@/objects/task/AsyncTask";
import {TaskCallback} from "@/objects/task/TaskCallback";
import {NetworkCallStatus} from "@/objects/network/NetworkCallStatus";
import {TaskType} from "@/enums/TaskType";
import jqXHR = JQuery.jqX... | |
<|file_name|>server.js<|end_file_name|><|fim▁begin|>var http = require('http'),
fs = require('fs');
var people = {};
//var port = process.env.OPENSHIFT_NODEJS_PORT || "1337";
var port = "1337";
//var serverUrl = process.env.OPENSHIFT_NODEJS_IP || "127.0.0.1";
var serverUrl = "127.0.0.1";
var app = http.createSe... | io.sockets.to(client.id).emit('messageMe', 'Server', 'You have connected.');
io.sockets.emit("update", name + " has joined the server.") |
<|file_name|>header.hpp<|end_file_name|><|fim▁begin|>//
// header.hpp
// ~~~~~~~~~~
//
// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com)<|fim▁hole|>//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICE... | |
<|file_name|>gettext.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
sphinx.builders.gettext
~~~~~~~~~~~~~~~~~~~~~~~
The MessageCatalogBuilder class.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from __future__ import uni... | from sphinx.util.osutil import safe_relpath, ensuredir, SEP
from sphinx.util.i18n import find_catalog |
<|file_name|>main.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from flask import Flask, render_template, session, redirect, url_for, flash
from flask_wtf import FlaskForm
from flask_bootstrap import Bootstrap
from wtforms import StringField, SubmitField
from wtforms.validat... | def make_shell_context():
return dict(app=app, db=db, User=User, Role=Role) |
<|file_name|>oom_intervention_impl.cc<|end_file_name|><|fim▁begin|>// Copyright 2017 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 "third_party/blink/renderer/controller/oom_intervention_impl.h"
#include <alg... | host_->OnHighMemoryUsage();
MemoryUsageMonitorInstance().RemoveObserver(this);
// Send memory pressure notification to trigger GC. |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// Copyright (c) <2015> <lummax>
// Licensed under MIT (http://opensource.org/licenses/MIT)
<|fim▁hole|><|fim▁end|> | pub mod wayland; |
<|file_name|>std-uncopyable-atomics.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.apa... | // option. This file may not be copied, modified, or distributed
// except according to those terms.
|
<|file_name|>get_public_ipaddr.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import re,urllib2
class Get_public_ip:
def getip(self):
try:
myip = self.visit("http://ip.chinaz.com/getip.aspx")
except:
try:
myip = self.visit("http://ipv4.icanhazip.com/")
except:
myip = "... | if __name__ == "__main__":
getmyip = Get_public_ip()
print getmyip.getip() |
<|file_name|>application.py<|end_file_name|><|fim▁begin|>from selenium.webdriver.chrome.webdriver import WebDriver
from selenium import webdriver<|fim▁hole|>from fixture.mk import MkHelper
from fixture.cas import CasHelper
class Application:
def __init__(self):
self.wd = WebDriver()
self.wd.implic... | from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from fixture.session import SessionHelper |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>#![deny(warnings)]
use cases::case::*;
/// Converts a `&str` to `Title Case` `String`
///
/// ```
/// use inflector::cases::titlecase::to_title_case;
/// let mock_string: &str = "Foo bar";
/// let expected_string: String = "Foo Bar".to_string();
/// let a... |
#[cfg(test)]
mod tests { |
<|file_name|>synchronous-script-tag.js<|end_file_name|><|fim▁begin|>var Tag = require('./tag');
var ScriptTag = require('./script-tag');
var Utils = require('./../utils');
/**
* Script tag class that is loaded in a synchronous way.
*
* This is the class that will generate script tags that will be appended to the
*... | |
<|file_name|>NodeQueryCacheConfigurator.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2008-2018, Hazelcast, 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 ... | @Override
public QueryCacheConfig getOrCreateConfiguration(String mapName, String cacheName, String cacheId) {
MapConfig mapConfig = config.getMapConfig(mapName);
|
<|file_name|>timedrift_with_migration.py<|end_file_name|><|fim▁begin|>import logging
from autotest_lib.client.common_lib import error
import kvm_test_utils
def run_timedrift_with_migration(test, params, env):
"""
Time drift test with migration:
1) Log into a guest.
2) Take a time reading from the gue... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from . import families<|fim▁hole|><|fim▁end|> | from .glm import glm, linear_component, plot_posterior_predictive |
<|file_name|>measure_data_test.cc<|end_file_name|><|fim▁begin|>// Copyright 2018, OpenCensus 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/licens... |
Distribution actual_distribution = base_distribution;
data.AddToDistribution(&actual_distribution); |
<|file_name|>NetworkService.go<|end_file_name|><|fim▁begin|>//
// Copyright 2014, Sander van Harmelen
//
// 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/licen... | |
<|file_name|>Avatar.js<|end_file_name|><|fim▁begin|>import Canvas from '../tool/Canvas.js';
import Animation from './Animation/Animation.js';
import Frame from './Animation/Frame.js';
import Player from '../engine/Player.js';
class Avatar {
static radius = 360;
static shakeTime = 300;
constructor(player... | getSize() { |
<|file_name|>domain_tests.js<|end_file_name|><|fim▁begin|>odoo.define('web.domain_tests', function (require) {
"use strict";
var Domain = require('web.Domain');
QUnit.module('core', {}, function () {
QUnit.module('domain');
QUnit.test("basic", function (assert) {
assert.expect(3);
var field... | a: 3,
group_method: 'line',
select1: 'day', |
<|file_name|>webpack.dev.config.ts<|end_file_name|><|fim▁begin|>import * as ExtractTextPlugin from 'extract-text-webpack-plugin';
import * as path from 'path';
import * as webpack from 'webpack';
export const config: webpack.Configuration = {
module: {
rules: [{
test: /\.css$/,
use:... | })
}, { |
<|file_name|>vidspot.py<|end_file_name|><|fim▁begin|>'''
Allmyvideos urlresolver plugin
Copyright (C) 2013 Vinnydude
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, o... | raise ResolverError('could not find file') |
<|file_name|>template_components.cpp<|end_file_name|><|fim▁begin|>#include "template_components.h"
#include <QtGui/QSpacerItem>
TemplateComponents::TemplateComponents(const QSharedPointer<const Template>& templ,
QWidget *parent)
: QWidget(parent), templ(templ)
{
ui.setu... | i != validDimensions.end(); ++i)
{ |
<|file_name|>f5ssh.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
class ModuleDocFragment(object):
# Standard F5 documentati... | server:
description: |
<|file_name|>notificator.rs<|end_file_name|><|fim▁begin|>//
// imag - the personal information management suite for the commandline
// Copyright (C) 2015, 2016 Matthias Beyer <mail@beyermatthias.de> and contributors
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the ... | fn notify(&self, item: &T) -> Result<()>; |
<|file_name|>idt.rs<|end_file_name|><|fim▁begin|>use core::ptr;
use x86;
use x86::shared::dtables::*;
use x86::current::irq::IdtEntry;
use x86::shared::PrivilegeLevel;
use x86::shared::paging::VAddr;
extern "C" {
static interrupt_handlers: [*const u8; 256];
}
pub struct Idt {
table: [IdtEntry; 256],
}
impl I... | }
}
} |
<|file_name|>piechart.cpp<|end_file_name|><|fim▁begin|>/****************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the documentat... | {
// need to disable this flag to draw inside a QDeclarativeItem |
<|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 http://mozilla.org/MPL/2.0/. */
//! This module contains shared types and messages for use by dev... | SetTimelineMarkers(PipelineId, Vec<TimelineMarkerType>, IpcSender<Option<TimelineMarker>>),
/// Withdraw request for live timeline notifications for a given pipeline.
DropTimelineMarkers(PipelineId, Vec<TimelineMarkerType>),
/// Request a callback directed at the given actor name from the next animation... |
<|file_name|>graph_node.py<|end_file_name|><|fim▁begin|>from .graph_exception import GraphException
from .quality import Quality
from .node_factory import NodeFactory
# noinspection PyProtectedMember
class GraphNode(object):
"""
Base class for nodes in the calculation graph.
See: http:#richard-shepherd.g... | if node not in self._parent_nodes:
return # The node passed in is not one of our parent nodes.
# We remove the parent, and remove us as a child from the parent... |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|># Copyright 2015, A10 Networks
#
# 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... | #
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
<|file_name|>densenet_test.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.apa... |
def apply_gradients(model, optimizer, gradients):
optimizer.apply_gradients(zip(gradients, model.variables))
|
<|file_name|>frameNavigator-i18n.js<|end_file_name|><|fim▁begin|>'use strict';
if (mejs.i18n.ca !== undefined) {
//mejs.i18n.en["mejs.frame-rate"] = "Media frame rate (select according to your video source)";
//mejs.i18n.en["mejs.step-fwd"] = "Step forward";
//mejs.i18n.en["mejs.step-back"] = "Step back";
... | |
<|file_name|>event-list.component.spec.ts<|end_file_name|><|fim▁begin|>import { ComponentFixture, TestBed } from "@angular/core/testing";
import { EventListComponent } from "./event-list.component";
describe("EventListComponent", () => {
let component: EventListComponent;
let fixture: ComponentFixture<EventListCom... | expect(component).toBeTruthy();
});
}); |
<|file_name|>decorators.py<|end_file_name|><|fim▁begin|>"""
Decorators
"""
from __future__ import unicode_literals
from functools import wraps
from django.http import HttpResponseBadRequest
from django.utils.decorators import available_attrs
from django_ajax.shortcuts import render_to_json
def ajax(function=None, ... | JSON response. Usage::
@ajax |
<|file_name|>set_zhihu_point_table.py<|end_file_name|><|fim▁begin|>import cPickle
point_table = {}
point_table[( 4, 4)] = 400.
point_table[( 3, 4)] = 270.
point_table[( 2, 4)] = 170.
point_table[( 1, 4)] = 100.
point_table[( 0, 4)] = 0.
point_table[(-1, 4)] = 0.
point_table[(-2, 4)] = 0.
point_table[(-3, 4)] = 0.
poin... | point_table[(-3, 3)] = 0.
point_table[(-4, 3)] = 0. |
<|file_name|>test_indextable.py<|end_file_name|><|fim▁begin|>"""
A test script for the `indextable` module
"""
from random import randrange
import pytest
from HamiltonianPy.indextable import IndexTable
class TestIndexTable:
def test_init(self):
match0 = r"unhashable type"
match1 = r"The .* has... | num0 = 7 |
<|file_name|>longestValidParentheses.go<|end_file_name|><|fim▁begin|>package longestvalidparentheses
func longestValidParentheses(s string) int {
l := 0
if len(s) >= 1 {
i, stack := 0, make([]int, len(s)+1)
stack[0] = -1 // first index
for si := 0; si < len(s); si++ {
if s[si] == '(' { // if '('
i++ // ... | }
} |
<|file_name|>sharing.py<|end_file_name|><|fim▁begin|>import data
from utils import assert_403, assert_404, assert_200, parse_xml, xpath
PRD = 'prd'
def test_sharing(IndivoClient):
DS = 'ds'
def get_datastore(obj):
if hasattr(obj, DS):
return getattr(obj, DS).values()
return False
def set_datas... | bob_chrome_client.get_carenet_account_permissions(carenet_id= carenet_id,
record_id=record_id,
account_id=bob_account_id)
|
<|file_name|>bloom.py<|end_file_name|><|fim▁begin|>#
# bloom.py
#
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
"""Bloom filter support"""
from __future__ import absolute_import, division, print_function, unicode_literals... | i += 4
# tail
k1 = 0 |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>var engine = require('../');
var express = require('express');
var path = require('path');
var app = express();
app.engine('dot', engine.__express);
app.set('views', path.join(__dirname, './views'));
app.set('view engine', 'dot');
app.get('/', function(req, res) {<|... | res.render('index', { fromServer: 'Hello from server', });
}); |
<|file_name|>handler_test.go<|end_file_name|><|fim▁begin|>package http
import (
"bytes"
"context"
"errors"
"fmt"
"io"
"net/http/httptest"
"runtime"
"testing"
cmds "gx/ipfs/QmSXUokcP4TJpFfqozT69AVAYRtzXVMUjzQVkYX41R9Svs/go-ipfs-cmds"
cmdkit "gx/ipfs/Qmde5VP1qUkyQXKCfmEUA7bP64V2HAptbJ7phuPp7jXWwg/go-ipfs-cmd... |
err := cmds.EmitOnce(re, "some value")
if err != nil { |
<|file_name|>mlab.py<|end_file_name|><|fim▁begin|># This module is for compatibility only. All functions are defined elsewhere.
__all__ = ['rand', 'tril', 'trapz', 'hanning', 'rot90', 'triu', 'diff', 'angle',
'roots', 'ptp', 'kaiser', 'randn', 'cumprod', 'diag', 'msort',
'LinearAlgebra', 'Ra... | |
<|file_name|>compat.py<|end_file_name|><|fim▁begin|>import sys
<|fim▁hole|>if IS_PY3:
from http.client import NO_CONTENT
from email import encoders as Encoders
from urllib.parse import quote, urlencode
unicode = str
bytes = bytes
else:
from email import Encoders
from httplib import NO_CONTEN... | IS_PY3 = sys.version_info[0] == 3
|
<|file_name|>inline_fragments.rs<|end_file_name|><|fim▁begin|>/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
use crate::no_inline::NO_INLINE_DIRECTIVE_NAME;
use crate::node_ident... | directive.name.item == *NO_INLINE_DIRECTIVE_NAME |
<|file_name|>bsp_renderer.rs<|end_file_name|><|fim▁begin|>/*
Copyright 2013 Jesse 'Jeaye' Wilkerson
See licensing in LICENSE file, or at:
http://www.opensource.org/licenses/BSD-3-Clause
File: client/state/game/bsp_renderer.rs
Author: Jesse 'Jeaye' Wilkerson
Description:
A client-only ... | {
self.game_renderer.camera.update(delta);
false |
<|file_name|>PlaiCDN.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
#script is a replacement for https://github.com/Relys/3DS_Multi_Decryptor/blob/master/to3DS/CDNto3DS/CDNto3DS.py
#requires PyCrypto to be installed ("python3 -m ensurepip" then "pip3 install PyCrypto")
#requires makerom (https://github.com/prof... | # if the content location does not exist, redown is set, or the size is incorrect redownload |
<|file_name|>xdatcar2xyz.1.04.py<|end_file_name|><|fim▁begin|># The MIT License (MIT)
#
# Copyright (c) 2014 Muratahan Aykol
#
# 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 restrict... | |
<|file_name|>build.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/. */
extern crate cc;
extern crate gl_generator;
use gl_generator::... | }
} |
<|file_name|>pricing-admin.js<|end_file_name|><|fim▁begin|>jQuery(document).ready(function($){
// Pricing Tables Deleting
$('.uds-pricing-admin-table .pricing-delete').click(function(){
if(!confirm("Really delete table?")) {
return false;
}
});
// products
$('#uds-pricing-products form').submit(function()... | });
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.