prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>irtkAnisoDiffusion.cc<|end_file_name|><|fim▁begin|>/*=========================================================================
Date : $Date: 03.03.2009$
Changes : $Author: Laurent Risser $
=========================================================================*/
#include <irtkImage.h>
#incl... | for (z=1;z<NBZ-1;z++) for (x=0;x<NBX;x++) u_next.Put(x, 0, z, 0,u_next.Get(x, 1, z, 0));
for (z=1;z<NBZ-1;z++) for (x=0;x<NBX;x++) u_next.Put(x, NBY-1, z, 0,u_next.Get(x, NBY-2, z, 0));
for (y=0;y<NBY;y++) for (x=0;x<NBX;x++) u_next.Put(x, y, 0, 0,u_next.Get(x, y, 1, 0)); |
<|file_name|>model_fasttext.py<|end_file_name|><|fim▁begin|>import random
from os.path import join, dirname
import numpy as np
from sklearn.base import ClassifierMixin, BaseEstimator
import fasttext as ft
from underthesea.util.file_io import write
import os
from underthesea.util.singleton import Singleton
class Fas... | self.estimator = ft.supervised(train_file) |
<|file_name|>StaticRouteProfile.java<|end_file_name|><|fim▁begin|>/*================================================================================
Copyright (c) 2012 Steve Jin. All Rights Reserved.
Redistribution and use in source and binary forms, with or without modification, <|fim▁hole|>
* Redistributions of sour... | are permitted provided that the following conditions are met: |
<|file_name|>settings.py<|end_file_name|><|fim▁begin|>"""
Django settings for webserver project.
Generated by 'django-admin startproject' using Django 1.11.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://doc... | |
<|file_name|>restrictederrorinfo.rs<|end_file_name|><|fim▁begin|>// Licensed under the Apache License, Version 2.0<|fim▁hole|>// except according to those terms.
use shared::wtypes::BSTR;
use um::unknwnbase::{IUnknown, IUnknownVtbl};
use um::winnt::HRESULT;
RIDL!{#[uuid(0x82ba7092, 0x4c88, 0x427d, 0xa7, 0xbc, 0x16, 0xd... | // <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
// All files in the project carrying such notice may not be copied, modified, or distributed |
<|file_name|>test_wrapper.py<|end_file_name|><|fim▁begin|>import threading
from mock import patch<|fim▁hole|>
def generate_jobstep_data():
# this must generic a *valid* dataset that should result in a full
# run
return {
'status': {'id': 'queued'},
'data': {},
'expectedSnapshot': No... | from uuid import uuid4
from changes_lxc_wrapper.cli.wrapper import WrapperCommand
|
<|file_name|>MethodSignatureTester.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2014 Matej Kormuth <http://matejkormuth.eu>
*
* 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 ve... | if (!interfMethodSignatures.contains(ms)) { throw new RuntimeException(
"Interface '" + interf.getName() |
<|file_name|>theme-merbivore_soft.js<|end_file_name|><|fim▁begin|>version https://git-lfs.github.com/spec/v1
oid sha256:57f07eb24fc71a0deb80c59e16d9ba40da0e8cb6fe6b9156fd85cc14f56c8f8a<|fim▁hole|><|fim▁end|> | size 2663 |
<|file_name|>quicksort.rs<|end_file_name|><|fim▁begin|>// use rand::{thread_rng, Rng};
use std::mem;
use super::insertion_sort;
/// quicksort partitioning
fn partition<T: PartialOrd>(a: &mut [T], lo: usize, hi: usize) -> usize {
let mut i = lo;
let mut j = hi + 1;
loop {
loop {
i += 1... | // BUG FIXED: (in original code) if j == 0, j - 1 overflows
if j > 1 { |
<|file_name|>PfractL.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# Copyright (C) 2002 Noufal Ibrahim <noufal@cisco.com>
#
# This program is part of PfractL
#
# PfractL 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... | |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>// Works under Rust 1.14.0 :)
extern crate rand;
use std::io::prelude::*;
use std::io;
use rand::{thread_rng, Rng};
const MAX_ATTEMPTS:i16 = 5;
fn play(guess:u8, target:u8, remaining_guesses:i16) -> bool {
if guess == target {
// We won!
println!("Noice! You gon... | |
<|file_name|>PresentationException.java<|end_file_name|><|fim▁begin|>package com.thegame.server.presentation.exceptions;
import com.thegame.server.common.exceptions.TypifiedException;
/**
* @author e103880
*/
public class PresentationException extends TypifiedException{
private final PresentationExcept... | return getProcessedMessage();
}
|
<|file_name|>toml.d.ts<|end_file_name|><|fim▁begin|>// Type definitions for toml-j0.4 1.0
// Project: https://github.com/jakwings/toml-j0.4
export function parse(src: string): any;
export class SyntaxError {
constructor(message: string, offset: number, line: number, column: number);
/**
* the line numbe... | message: string;
} |
<|file_name|>gate_tuner.cpp<|end_file_name|><|fim▁begin|>#include <opencv2/opencv.hpp>
#include <iostream>
using namespace cv;
using namespace std;
int ratio = 3; //per canny's suggestion
int canny_thresh = 12; //starts at 12, this is what we will be changing though
int hough_thresh = 27;
int angle_tracker = 20;
... |
for(int i = 0; i < xbin_count.size(); i++){
cout << "bin" << i << "=" << " " << xbin_count[i] << endl; |
<|file_name|>models.py<|end_file_name|><|fim▁begin|># import needed models
from django.db import models
from django.utils import timezone
from django.contrib.auth.models import User
# Create your models here.
# create user object
class Person(User):<|fim▁hole|> verified = models.NullBooleanField(default=F... | internal_id = models.CharField(max_length=25, null=True, blank=True) |
<|file_name|>update_public_key.go<|end_file_name|><|fim▁begin|>package ram
//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 required ... | var err error
defer close(result)
response, err = client.UpdatePublicKey(request) |
<|file_name|>torrentz.py<|end_file_name|><|fim▁begin|>#VERSION: 2.14
#AUTHORS: Diego de las Heras (diegodelasheras@gmail.com)
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must r... | self.current_item['desc_link'] = self.url + params['href'].strip() |
<|file_name|>load.js<|end_file_name|><|fim▁begin|>var _ = require('lodash');
var requireAll = require('require-all');
function load(router, options) {
if (_.isString(options))
options = {dirname: options};<|fim▁hole|> recursive: true,
resolve: function (Controller) {
var c = new (Controller.__esMod... |
return requireAll(_.defaults(options, {
filter: /(.*Controller)\.js$/, |
<|file_name|>conv_ops_test.py<|end_file_name|><|fim▁begin|># Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apa... | 5742.0, 6069.0, 6396.0, 6723.0, 7050.0, 7377.0, 7047.0, 7449.0, 7851.0,
8253.0, 8655.0, 9057.0, 8352.0, 8829.0, 9306.0, 9783.0, 10260.0,
10737.0, 3582.0, 3783.0, 3984.0, 4185.0, 4386.0, 4587.0, 10962.0,
11589.0, 12216.0, 12843.0, 13470.0, 14097.0, 12267.0, 12969.0, 13671.0, |
<|file_name|>43-basic-object-oriented-analysis-and-design.py<|end_file_name|><|fim▁begin|># Exercise 43: Basic Object-Oriented Analysis and Design
# Process to build something to evolve problems
# 1. Write or draw about the problem.
# 2. Extract key concepts from 1 and research them.
# 3. Create a class hierarchy and ... | print "wrong 10 times then the lock closes forever and you can't"
print "get the bomb. The code is 3 digits." |
<|file_name|>LogImpl.hpp<|end_file_name|><|fim▁begin|>// ========================================================================= //
// Fighting game framework (2D) with online multiplayer.
// Copyright(C) 2014 Jordan Sparks <unixunited@live.com>
//<|fim▁hole|>// as published by the Free Software Foundation; either ve... | // This program is free software; you can redistribute it and / or
// modify it under the terms of the GNU General Public License |
<|file_name|>labels_range.py<|end_file_name|><|fim▁begin|>import json
import numpy as np
import cPickle as pickle
with open('../validation/v_xgboost_word_tfidf.csv') as train_file:
content = train_file.readlines()
testData = []
scores = []
element = content[1].strip("\r\n").split(",")
for i in range(1, len(co... | f1.write(testData[i][0]+','+testData[i][1]+','+str(ypred[i])+'\n') |
<|file_name|>result_parser.py<|end_file_name|><|fim▁begin|># This import depends on the automake rule protoc_middleman, please make sure
# protoc_middleman has been built before run this file.
import json
import re
import os.path
# BEGIN OPENSOURCE
import sys
sys.path.append(os.path.join(os.path.dirname(os.path.realpat... | "language": language,
"dataFilename": __extract_file_name(result["filename"]),
"behavior": behavior, |
<|file_name|>TestNativeDivide.rs<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2016 The Android Open Source Project
*
* 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://ww... | * See the License for the specific language governing permissions and
* limitations under the License.
*/ |
<|file_name|>Info.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2004 NNL Technology AB
* Visit www.infonode.net for information about InfoNode(R)
* products and how to contact NNL Technology AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Genera... |
// $Id: Info.java,v 1.6 2004/09/22 14:31:39 jesper Exp $
package com.supermap.desktop.ui.docking.info; |
<|file_name|>issue-4264.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/lice... | pub enum Baz {
BazVariant([int, ..5u])
}
|
<|file_name|>partition.py<|end_file_name|><|fim▁begin|># Copyright 2014, Doug Wiegley, 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.o... | try:
self._post("system.partition.search", {'name': name}) |
<|file_name|>0002_auto_20160403_1645.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-04-03 16:45
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
... | ),
migrations.DeleteModel(
name='Server', |
<|file_name|>aes.js<|end_file_name|><|fim▁begin|>const AES = require('./aesjs');
function encrypt(text, key) {
key = new TextEncoder().encode(key);
const textBytes = AES.utils.utf8.toBytes(text);
const aesCtr = new AES.ModeOfOperation.ctr(key);
const encryptedBytes = aesCtr.encrypt(textBytes);
return AES.uti... | module.exports = {
encrypt,
decrypt,
}; |
<|file_name|>ufcs-qpath-missing-params.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.... | |
<|file_name|>require.d.ts<|end_file_name|><|fim▁begin|>// Compiled using typings@0.6.8
// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/4de74cb527395c13ba20b438c3a7a419ad931f1c/requirejs/require.d.ts
// Type definitions for RequireJS 2.1.20
// Project: http://requirejs.org/
// Definitions ... |
interface RequireConfig { |
<|file_name|>result.go<|end_file_name|><|fim▁begin|>package pg
import (
"bytes"
"strconv"<|fim▁hole|>
"github.com/go-pg/pg/internal"
"github.com/go-pg/pg/orm"
)
// A result summarizes an executed SQL command.
type result struct {
model orm.Model
affected int
returned int
}
var _ orm.Result = (*result)(nil)
... | |
<|file_name|>test_validation.py<|end_file_name|><|fim▁begin|># Copyright 2013-2016 DataStax, 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.... |
import sys
from datetime import datetime, timedelta, date, tzinfo
from decimal import Decimal as D |
<|file_name|>nlc.py<|end_file_name|><|fim▁begin|># coding: utf-8
"""
Stakeholder engagement API
This API enables Intelligent Engagement for your Business. iEngage is a platform that combines process, augmented intelligence and rewards to help you intelligently engage customers.
OpenAPI spec version: 1.0
... | """ |
<|file_name|>category.server.model.js<|end_file_name|><|fim▁begin|>'use strict';
/**
* Module dependencies.
*/
var mongoose = require('mongoose'),
Schema = mongoose.Schema;
/**
* Category Schema
*/
var CategorySchema = new Schema({
name: {
type: String,
default: '',
required: 'Plea... | |
<|file_name|>marker.ts<|end_file_name|><|fim▁begin|>import {RenderOne} from "./defs"
import {XYGlyph, XYGlyphView, XYGlyphData} from "../glyphs/xy_glyph"
import type {MarkerGLGlyph} from "../glyphs/webgl/markers"
import {PointGeometry, SpanGeometry, RectGeometry, PolyGeometry} from "core/geometry"
import {LineVector, F... | const index = candidates[i]
if (hittest.point_in_poly(this.sx[i], this.sy[i], sx, sy)) {
indices.push(index) |
<|file_name|>kalahBoard.hpp<|end_file_name|><|fim▁begin|>#ifndef KALAH_BOARD_H
#define KALAH_BOARD_H
#include <vector>
#include "houseContainer.hpp"
#include "storeContainer.hpp"
using namespace std;
class kalahBoard
{
public:
kalahBoard(unsigned int numberOfHousesIn);
void fillHouses(vector<unsigned int> home... |
#endif |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
from django.conf import settings
from django.contrib.auth.models import AnonymousUser
from django.http import HttpResponse
from django.shortcuts import render
from django.views.decorators.cache import never_cache
from django.vie... |
@never_cache |
<|file_name|>num_instances_constraint.py<|end_file_name|><|fim▁begin|># Copyright (c) 2014 Cisco Systems 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
#... | CONF = cfg.CONF
CONF.import_opt("max_instances_per_host",
"nova.scheduler.filters.num_instances_filter")
|
<|file_name|>MCScoreboard.java<|end_file_name|><|fim▁begin|>package com.laytonsmith.abstraction;
import com.laytonsmith.abstraction.enums.MCDisplaySlot;
import java.util.Set;<|fim▁hole|>public interface MCScoreboard {
public void clearSlot(MCDisplaySlot slot);
public MCObjective getObjective(MCDisplaySlot slot);
pu... | |
<|file_name|>common.py<|end_file_name|><|fim▁begin|>import numpy
import os
class ByteOrder:
LittleEndian, BigEndian = range(2)
class FeatureException(Exception):
def __init__(self,msg):
self.msg = msg
def __str__(self):
return repr(self.msg)
def ReadLabel(filename):<|fim▁hole|>
class BaseReader():
def __i... | labels = numpy.loadtxt(filename, ndmin=1)
return labels.astype(numpy.int32) |
<|file_name|>test_host_specific_configuration.py<|end_file_name|><|fim▁begin|># -*- python -*-
# test_host_specific_configuration.py - Unit tests for
# swift_build_support.host_specific_configuration
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2019 Apple Inc. and the Swift... | args.build_stdlib_deployment_targets = 'all'
|
<|file_name|>counter.py<|end_file_name|><|fim▁begin|>import cv2
import numpy as np
import datetime as dt
# constant
faceCascade = cv2.CascadeClassifier('haarcascade_frontalface_alt.xml')
OPENCV_METHODS = {
"Correlation": 0,
"Chi-Squared": 1,
"Intersection": 2,
"Hellinger": 3}
hist_limit = 0.6
ttl = 1 *... | flags=cv2.CASCADE_SCALE_IMAGE
) |
<|file_name|>OverviewRuler.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
* Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse P... |
/**
* Draws this overview ruler. |
<|file_name|>requirements.cpp<|end_file_name|><|fim▁begin|>/// @copyright
/// Copyright (C) 2020 Assured Information Security, Inc.
///
/// @copyright
/// 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... | /// copies of the Software, and to permit persons to whom the Software is
/// furnished to do so, subject to the following conditions: |
<|file_name|>pe598-split-divisibilities.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# coding=utf-8
"""598. Split Divisibilities
https://projecteuler.net/problem=598
Consider the number 48.
There are five pairs of integers $a$ and $b$ ($a \leq b$) such that $a \times
b=48$: (1,48), (2,24), (3,16), (4,12) a... | In general:
Let $C(n)$ be the number of pairs of positive integers $a \times b=n$, ($a
\leq b$) such that $a$ and $b$ have the same number of divisors;
so $C(48)=1$. |
<|file_name|>CassandraClient.java<|end_file_name|><|fim▁begin|>/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to yo... | |
<|file_name|>LoginBean.java<|end_file_name|><|fim▁begin|>/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package edu.iit.sat.itmd4515.yzhan214.fp.web.hospital;
import edu.ii... | try {
req.logout();
} catch (ServletException ex) {
|
<|file_name|>hypothesis.ts<|end_file_name|><|fim▁begin|>import {Component, View, Inject} from 'angular2/core';
import {IONIC_DIRECTIVES} from 'ionic-angular';
import {Story} from '../../models/story/story';
import {
Control,
ControlGroup,
NgForm,
Validators,
NgControl,
ControlValueAccessor,
NgControlName,... | |
<|file_name|>tableExamples.service.js<|end_file_name|><|fim▁begin|>/*
* @class TableExamplesService
*/
export default class TableExamplesService {
constructor($http) {
this.$http = $http;
}
static getClassName() { return 'TableExamplesService'; }
getClassName() { return TableExamplesService.getClassName(... | |
<|file_name|>listeners.rs<|end_file_name|><|fim▁begin|>// Copyright 2021 MaidSafe.net limited.
//
// This SAFE Network Software is licensed to you under The General Public License (GPL), version 3.
// Unless required by applicable law or agreed to in writing, the SAFE Network Software distributed
// under the GPL Licen... | } => {
debug!(
"Cmd Error was received for Message w/ID: {:?}, sending on error channel",
correlation_id |
<|file_name|>exceptions.py<|end_file_name|><|fim▁begin|>"""Custom Exception Classes for Phylotyper Module<|fim▁hole|> """Basic exception for errors raised by Phylotyper modules"""
def __init__(self, subtype, msg=None):
if msg is None:
msg = "An error occured for subtype {}".format(subtype)
... |
"""
class PhylotyperError(Exception): |
<|file_name|>ManageFlow.py<|end_file_name|><|fim▁begin|>def DataToTreat(Catalogue = 'WHT_observations'):
Catalogue_Dictionary = {}
if Catalogue == 'WHT_observations':
Catalogue_Dictionary['Folder'] = '/home/vital/Dropbox/Astrophysics/Data/WHT_observations/'
Catalogue_Dictionary['D... | |
<|file_name|>driverskeleton_test.go<|end_file_name|><|fim▁begin|>// Copyright 2016 The Periph Authors. All rights reserved.
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.
package driverskeleton
import (
"strings"
"testing"
"periph.io/x/periph... | )
func TestDriverSkeleton(t *testing.T) { |
<|file_name|>org.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Organization Registry - Controllers
"""
module = request.controller
resourcename = request.function
if not settings.has_module(module):
raise HTTP(404, body="Module disabled: %s" % module)
# ----------------------------------------... | msg_record_deleted = T("Donor deleted"),
msg_list_empty = T("No Donors currently registered")) |
<|file_name|>text_area.py<|end_file_name|><|fim▁begin|>import fsui<|fim▁hole|>
class TextArea(fsui.TextArea):
pass<|fim▁end|> | |
<|file_name|>StatusButton.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# This file is part of emesene.
#
# emesene 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 th... | |
<|file_name|>functions_6.js<|end_file_name|><|fim▁begin|>var searchData=
[
['player',['player',['../classplayer.html#a4c43d838817775e2a2b0241d30de4abc',1,'player']]]<|fim▁hole|><|fim▁end|> | ]; |
<|file_name|>coding.rs<|end_file_name|><|fim▁begin|>/*
Copyright 2015 Tyler Neely
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
U... | buf[5] = (0xff & (frameSize >> 16)).to_u8().unwrap();
buf[6] = (0xff & (frameSize >> 8)).to_u8().unwrap();
buf[7] = (0xff & (frameSize)).to_u8().unwrap();
buf |
<|file_name|>hartree_slater_gos.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2007-2020 The HyperSpy developers
#
# This file is part of HyperSpy.
#
# HyperSpy is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Fre... | |
<|file_name|>callback_buttonLed_toggle.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""
Copyright (c) 2015-2017 Alan Yorinks All rights reserved.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
Version 3 as published by the F... | def signal_handler(sig, frame):
print('You pressed Ctrl+C')
if board is not None: |
<|file_name|>base.py<|end_file_name|><|fim▁begin|>"""Base classes for classifiers"""
from ..core.classes import Processor
class BaseClassifier(Processor):
'''
The base class for classifiers.
'''
def __init__(self, *args, **kwargs):<|fim▁hole|> self.classifier = None
class SklearnClassifier(Ba... | super(BaseClassifier, self).__init__(*args, **kwargs) |
<|file_name|>Options.AreaChart.js<|end_file_name|><|fim▁begin|>/*
* File: Options.AreaChart.js
*
*/
/*
Object: Options.AreaChart
<AreaChart> options.
Other options included in the AreaChart are <Options.Canvas>, <Options.Label>, <Options.Margin>, <Options.Tips> and <Options.Events>.
Syntax:
(star... | restoreOnRightClick: false |
<|file_name|>ObsoletedTasksReport.py<|end_file_name|><|fim▁begin|>from django.template import RequestContext
from django.shortcuts import render_to_response
from django.db import connection
from collections import OrderedDict
from datetime import datetime
import time
import scipy.cluster.hierarchy as hcluster
import nu... | return render_to_response('reportObsoletedTasks.html', data, RequestContext(request)) |
<|file_name|>ExcelExportorExample.java<|end_file_name|><|fim▁begin|>package example;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.junit.Test;
import com.piedra.excel.... | |
<|file_name|>timezone.ts<|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/. */
export interface TimeZones {
name: string;<|fim▁hole|> offs... | abbrev: string; |
<|file_name|>small_vector.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.o... | let mut replacement = ZeroIterator; |
<|file_name|>monica.py<|end_file_name|><|fim▁begin|># !/bin/python
# -*- coding: latin-1 -*-
# Copyright (C) 2009-2014 CEA/DEN, EDF R&D
#
# This 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 the Free Software Foundation; ... | zmin = min (zmin, node.getZ()) ; zmax = max (zmax, node.getZ())
tabv1.append (node)
|
<|file_name|>model.py<|end_file_name|><|fim▁begin|># Copyright (C) 2006, 2007, 2008 One Laptop per Child
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (... | self.data['pathsnd'] = join(ART4APPS_AUDIO_PATH, language)
|
<|file_name|>common.rs<|end_file_name|><|fim▁begin|>pub const SYS_DEBUG: usize = 0;
// Linux compatible
pub const SYS_BRK: usize = 45;
pub const SYS_CHDIR: usize = 12;
pub const SYS_CLOSE: usize = 6;
pub const SYS_CLONE: usize = 120;
pub const CLONE_VM: usize = 0x100;
pub const CLONE_FS: usize = 0x200;
pub... | |
<|file_name|>util.py<|end_file_name|><|fim▁begin|>from hq.models import Domain
from xformmanager.models import FormDataColumn, FormDataGroup, FormDataPointer
from xformmanager.manager import *
from xformmanager.storageutility import StorageUtility
from receiver.models import Submission, Attachment
from receiver.tests.u... | return None
f = open(xsd_file_path,"r")
manager = XFormManager()
formdefmodel = manager.add_schema(xsd_file_name, f) |
<|file_name|>hide-reveal.js<|end_file_name|><|fim▁begin|>/**<|fim▁hole|> * - Each section should have an id attribute
* - Links that open a section should have the class `js-hide-reveal-link`
* - Each links' href attribute should specify the id of the section to reveal.
*/
(function($) {
/**
* Event handle... | * Collapse sections then reveal them when an associated link is clicked.
*
* - Each section should have the class `js-hide-reveal` |
<|file_name|>AlignBoxBottomRight.d.ts<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | export { AlignBoxBottomRight as default } from "./"; |
<|file_name|>threadtest.py<|end_file_name|><|fim▁begin|>import threading
import time
class Status:
lock = None
statusno =0
def __init__(self):
self.lock = threading.Lock()
def update(self, add):
self.lock.acquire()
self.statusno = self.statusno + add<|fim▁hole|> ... | self.lock.release()
def get(self): |
<|file_name|>cooperation-company.js<|end_file_name|><|fim▁begin|>define(function(require, exports, module) {
var $ = require('jquery');
var leftBtn =$('#company-list').find('.left-btn'),
rightBtn = $('#company-list').find('.right-btn'),
show = $('#company-list').find('.show');
module.export... | _this.rightMove();
});
rightBtn.on('click', function() { |
<|file_name|>config.py<|end_file_name|><|fim▁begin|># Copyright 2015 OpenStack Foundation.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/... | help=_("Allow to perform insecure SSL (https) requests to "
"nova metadata")),
cfg.StrOpt('nova_client_cert', |
<|file_name|>package.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from flask import Blueprint, render_template, Markup, url_for
from flask_toolbox.models import Package
package_page = Blueprint('package_page', __name__,
... | print(len(package_list))
return render_template( |
<|file_name|>credentials.rs<|end_file_name|><|fim▁begin|>#[macro_use]
extern crate accord;
use accord::{Accord, Result as AccordResult};
use accord::validators::{length, contains, not_contain_any};
struct Credentials {
pub email: String,
pub password: String,
}
impl Accord for Credentials {
#[cfg(not(fea... | rules!{ |
<|file_name|>_hasnolatorlon.py<|end_file_name|><|fim▁begin|>#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2002-2006 Donald N. Allingham
#
# 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 Softwa... | #
#-------------------------------------------------------------------------
class HasNoLatOrLon(Rule): |
<|file_name|>dogs_go_woof_actors.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
from __future__ import print_function
from guild.actor import Actor, actor_method, process_method, late_bind
class Dog(Actor):
@actor_method # Input - triggered by data coming in
def woof(self):
print("Woof", self... | class Shitzu(Dog):
def __init__(self): |
<|file_name|>MessageController.java<|end_file_name|><|fim▁begin|>package com.rockey.emonitor.jms.controller;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
impo... | |
<|file_name|>diff_int.py<|end_file_name|><|fim▁begin|>def diff_int(d=0.01*u.cm,a=0.001*u.cm,wl=400*u.nm):
'''
function that returns the intensity of a double slit interference pattern
'''
theta = arange(-10,10,1e-5)*u.degree
x = pi*a*sin(theta)/wl*u.radian
xnew = x.decompose()
i_single = (si... | i_double = (cos(ynew))**2
I = i_single*i_double
|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|># Generator package<|fim▁end|> | |
<|file_name|>class_with_inner_struct.rs<|end_file_name|><|fim▁begin|>#![allow(
dead_code,
non_snake_case,
non_camel_case_types,
non_upper_case_globals
)]
#[repr(C)]
#[derive(Copy, Clone)]
pub struct A {
pub c: ::std::os::raw::c_uint,
pub named_union: A__bindgen_ty_1,
pub __bindgen_anon_1: A... | |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>import os, unicodedata
from django.utils.translation import ugettext_lazy as _
from django.core.files.storage import FileSystemStorage
from django.db.models.fields.files import FileField<|fim▁hole|>
class AdminThumbnailMixin(object):
thumbnail_options = {'size': (... | from django.core.files.storage import default_storage
from django.conf import settings
from django.utils.safestring import mark_safe |
<|file_name|>domxml.py<|end_file_name|><|fim▁begin|>"""Handy XML processing utility functions.
Various XML processing utilities, using minidom, that are used in
various places throughout the code.
"""
"""
============================== License ========================================
Copyright (C) 2008, 2010-12 Uni... |
Returns a tuple of their values if they're all found.
""" |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>//! Immutable binary search tree.
//!
//! This crate provides functional programming style binary search trees which returns modified
//! copy of original map or set with the new data, and preserves the original. Many features and
//! algorithms are borrowed from `Data.M... | |
<|file_name|>tr_global.js<|end_file_name|><|fim▁begin|>var mdeps = require('../');
var test = require('tape');
var JSONStream = require('JSONStream');
var packer = require('browser-pack');
var concat = require('concat-stream');
var path = require('path');
test('global transforms', function (t) {
t.plan(1);
... | });
p.end(path.join(__dirname, '/files/tr_global/main.js'));
var pack = packer();
|
<|file_name|>SkinColorRGBHCbCrStrategy.java<|end_file_name|><|fim▁begin|><|fim▁hole|>import com.harium.keel.core.helper.ColorHelper;
import com.harium.keel.core.strategy.SelectionStrategy;
import com.harium.keel.filter.selection.SimpleToleranceStrategy;
/**
* Based on: Nusirwan Anwar bin Abdul Rahman, Kit Chong Wei a... | package com.harium.keel.filter.selection.skin;
|
<|file_name|>visit_tests.ts<|end_file_name|><|fim▁begin|>import { TurbolinksTestCase } from "./helpers/turbolinks_test_case"
import { get } from "http"
export class VisitTests extends TurbolinksTestCase {
async setup() {
this.goToLocation("/fixtures/visit.html")
}
async "test programmatically visiting a sam... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>import json
import re
import subprocess
from django.conf import settings
default_app_config = "peering.apps.PeeringConfig"
def call_irr_as_set_resolver(irr_as_set, address_family=6):
"""
Call a subprocess to expand the given AS-SET for an IP version.
... |
def parse_irr_as_set(asn, irr_as_set):
""" |
<|file_name|>serializers.py<|end_file_name|><|fim▁begin|>from collections import OrderedDict
from django.contrib.auth.models import AnonymousUser
from rest_framework_json_api import serializers
from share import models
from share.models import ChangeSet, ProviderRegistration, CeleryProviderTask
class ShareModelSer... | |
<|file_name|>exceptions.py<|end_file_name|><|fim▁begin|><|fim▁hole|>@date 2014-11-16
@author Hong-She Liang <starofrainnight@gmail.com>
"""
from selenium.common.exceptions import *<|fim▁end|> | """ |
<|file_name|>http.pb.go<|end_file_name|><|fim▁begin|>// Code generated by protoc-gen-go.
// source: google/api/http.proto
// DO NOT EDIT!
package google_api
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
// Reference imports to suppress errors if they are not otherwise used.
var ... | // service Storage { |
<|file_name|>forms.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from django import forms
from giza.models import Giza
class GizaEditForm(forms.ModelForm):
"""Giza edit form"""
class Meta:
"""Meta for GizaEditForm"""
model = Giza<|fim▁hole|> exclude = ('user',)
def __i... | |
<|file_name|>devicemotion.js<|end_file_name|><|fim▁begin|>var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && ty... | __decorate([
|
<|file_name|>BankGuaranteeReturnInvalid.java<|end_file_name|><|fim▁begin|>//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will b... | |
<|file_name|>exceptions.py<|end_file_name|><|fim▁begin|>class UnknownAccess(Exception):<|fim▁hole|> pass<|fim▁end|> | """
Access doesn't exist for this user.
""" |
<|file_name|>util.py<|end_file_name|><|fim▁begin|>""" Common utility
"""
import logging
import time
def measure(func, *args, **kwargs):
def start(*args, **kwargs):
begin = time.time()
result = func(*args, **kwargs)
end = time.time()
arg = args
while not (isinstance(arg, s... | |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This software may be used and distributed according to the terms of the<|fim▁hole|> */
use std::path::Path;
use anyhow::{Context, Result};
use serde::{Deserialize, Serialize};
use stack_config::StackConfig;... | * GNU General Public License version 2. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.