prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>0004_auto_20150623_1623.py<|end_file_name|><๏ฝœfimโ–begin๏ฝœ># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('server', '0003_auto_20150612_1123'), ]<๏ฝœfimโ–hole๏ฝœ> operations = ...
<|file_name|>E0687.rs<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>#![allow(warnings)] #![feature(in_band_lifetimes)] fn foo(x: fn(&'a u32)) {} //~ ERROR must be explicitly fn bar(x: &Fn(&'a u32)) {} //~ ERROR must be explicitly fn baz(x: fn(&'a u32), y: &'a u32) {} //~ ERROR must be explicitly <๏ฝœfimโ–hole๏ฝœ>impl Foo<'a> { fn bar...
struct Foo<'a> { x: &'a u32 }
<|file_name|>ValidateProjectIT.java<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>package acceptance; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; import utils.CommandStatus; import utils.TemporaryDigdagServer; import java.nio.file.Path; import static org.hamcrest.Mat...
private Path config; private Path projectDir;
<|file_name|>ResourcePropertiesEditStub.java<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>/********************************************************************************** * $URL: https://source.sakaiproject.org/svn/providers/tags/sakai-10.6/jldap-mock/src/java/edu/amc/sakai/user/ResourcePropertiesEditStub.java $ * $Id: ResourcePr...
* override {@link Properties}. *
<|file_name|>lib.rs<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>#[macro_use] extern crate log; use special_fun::FloatSpecial; use std::collections::VecDeque; use std::f64; #[derive(Clone, Debug)] pub struct PhiFailureDetector { min_stddev: f64, history_size: usize, buf: VecDeque<u64>, prev_heartbeat: Option<u64>, } ...
env_logger::try_init().unwrap_or_default();
<|file_name|>package.py<|end_file_name|><๏ฝœfimโ–begin๏ฝœ># Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Prokka(Package): """Prokka is a softw...
<|file_name|>mtmap.rs<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>#[deriving(Clone)] #[deriving(ToStr)] type LinkedList = Option<~Node>; #[deriving(Clone)] struct Node { val: int, tail: LinkedList } trait Length { fn length(&self) -> int; } #[allow(dead_code)] fn length(p: LinkedList) -> int { match p { None => ...
fn expensive_inc(n: int) -> int { let mut a = 1; println!("starting inc: {:d}", n);
<|file_name|>main.ts<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>function pyramid (a:number):void{ for(var i:number = 1; i <= a; i++){ var b:string = ''; for(var j:number = 0; j <= a-i-1 ; j++){ b += ' '; } for(var k:number = 1; k <= 2*i-1; k++){<๏ฝœfimโ–hole๏ฝœ> b += '*'; ...
<|file_name|>bitcoin_he.ts<|end_file_name|><๏ฝœfimโ–begin๏ฝœ><?xml version="1.0" encoding="utf-8"?> <!DOCTYPE TS> <TS language="he" version="2.0"> <defaultcodec>UTF-8</defaultcodec> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About Sp...
</message> <message>
<|file_name|>remote.py<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>import re from contextlib import contextmanager from tempfile import NamedTemporaryFile from plumbum.commands import CommandNotFound, ConcreteCommand, shquote from plumbum.lib import ProcInfo from plumbum.machines.base import BaseMachine from plumbum.machines.env imp...
self._program_cache[key] = fn
<|file_name|>seamcarver.js<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>๏ปฟ function SeamCarver(ctx) { var w = ctx.canvas.width; var h = ctx.canvas.height; var imgd = ctx.getImageData(0, 0, w, h); var pix = imgd.data; var img = []; for (var i = 0; i < h; i++) { img.push(new Uint32Array(w)); f...
var energy = this._energyInternal(j, i); var dleft = prevRow[j - 1]; var dcenter = prevRow[j];
<|file_name|>data-field.go<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>package sprucelib // A Field is a concrete instance of a FieldType attached to a ContentType in a particular<๏ฝœfimโ–hole๏ฝœ>// // For example, the "Department" Field on a "Staff" ContentType which should be the // 3rd field in the UI. // // NOTE: This type does not s...
// position.
<|file_name|>classes_a.js<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>var searchData= [ ['map',['Map',['../d7/db0/classMap.html',1,'']]], ['memorystream',['MemoryStream',['../dd/d97/classMemoryStream.html',1,'']]], ['message',['Message',['../d6/d28/classMessage.html',1,'']]], ['module',['module',['../d0/dd3/classmodule.html',...
<|file_name|>show_license.py<|end_file_name|><๏ฝœfimโ–begin๏ฝœ># -*- coding: utf-8 -*- # # license.py # # ะ’ั‹ะฒะพะดะธั‚ ะพะบะฝะพ ั ั‚ะตะบัั‚ะพะผ ะปะธั†ะตะฝะทะธะธ. # import os from kivy.clock import Clock from kivy.uix.rst import RstDocument from libs.uix.dialogs import dialog, card class ShowLicense(object): def show_license(self, *args):...
def show_license(dialog, on_language): path_to_license = '{}/license/license_{}.rst'.format( self.directory, self.data.dict_language[on_language]
<|file_name|>poll.rs<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>extern crate futures_mutex; extern crate futures; <๏ฝœfimโ–hole๏ฝœ>fn main() { let future = future::lazy(|| { let lock1 = Mutex::new(0); // Mutex can be easily cloned as long as you need let lock2 = lock1.clone(); assert!(lock1.poll_lock...
use futures_mutex::Mutex; use futures::{future, Async, Future};
<|file_name|>create_table_test.py<|end_file_name|><๏ฝœfimโ–begin๏ฝœ># -*- coding: utf-8; -*- # # Licensed to CRATE Technology GmbH ("Crate") under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. Crate licenses # this f...
def setUp(self): self.engine = sa.create_engine('crate://') self.Base = declarative_base(bind=self.engine)
<|file_name|>__init__.py<|end_file_name|><๏ฝœfimโ–begin๏ฝœ># PPFem: An educational finite element code # Copyright (C) 2015 Matthias Rambausek # # 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, eithe...
<|file_name|>upload.py<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>#!/usr/bin/env python3 from argparse import ArgumentParser from os import environ from sys import argv from requests import put def read_file(file_path): # pragma: no cover with open(file_path, 'rb') as f: return f.read() def upload(file_path, reposi...
parser.add_argument('repository', help='Nexus3 repository, e.g. maven-releases')
<|file_name|>stylesheets.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/. */ //! A collection of invalidations due to changes in which...
/// A style sheet invalidation represents a kind of element or subtree that may
<|file_name|>authorise.js<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>/** * Copyright 2013-present NightWorld. * * 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/LI...
var headerToken = this.req.get('Authorization'), getToken = this.req.query.access_token, postToken = this.req.body ? this.req.body.access_token : undefined;
<|file_name|>FinalizePhase.java<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>package org.jboss.windup.config.phase; import org.jboss.windup.config.AbstractRuleProvider; import org.ocpsoft.rewrite.config.Rule; /** * Previous: {@link PostReportRenderingPhase}<br/> * Next: {@link PostFinalizePhase}<๏ฝœfimโ–hole๏ฝœ> * may have been opened ...
* * <p> * This occurs at the end of execution. {@link Rule}s in this phase are responsible for any cleanup of resources that
<|file_name|>ConfusionMatrixViewer.java<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>/** * Copyright (C) 2001-2019 by RapidMiner and the contributors * * Complete list of developers available at our web site: * * http://rapidminer.com * * This program is free software: you can redistribute it and/or modify it under th...
@Override public void actionPerformed(ActionEvent e) { if (plotButton.isSelected()) { cardLayout.show(mainPanel, "plot");
<|file_name|>buttons.py<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>import logging from datetime import datetime from .actions import actions from .system_menu.system_menu import system_menu from .library.buttons import library_buttons from .book.buttons import book_buttons from .go_to_page.buttons import go_to_page_buttons from .boo...
<|file_name|>env.ts<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>import * as moment from 'moment';<๏ฝœfimโ–hole๏ฝœ> export const dateFormat = 'DD/MM/YYYY'; export const datePickerFormat = 'dd/mm/yy'; export const minDate = moment('1900-01-01').toDate();<๏ฝœfimโ–end๏ฝœ>
<|file_name|>test_unit.py<|end_file_name|><๏ฝœfimโ–begin๏ฝœ># This doesn't work- not updated with eventmaster.py updates # TODO: Fix This :) # Import Libraries import eventmaster import time import random import sys import unittest import sys class InputsTestCase(unittest.TestCase): def setUp(self): self.s3 ...
MyObject = type('MyObject', (object,), {}) self.assertEqual(self.s3.get_input(0).set_Name(MyObject), None)
<|file_name|>test_obs_block.py<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>import datetime from ecl.util.util import BoolVector from ecl.util.test import TestAreaContext from tests import ResTest from res.enkf import ObsBlock class ObsBlockTest(ResTest): def test_create(self): block = ObsBlock("OBS" , 1000) ...
<|file_name|>checkReport.sub.js<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>(function () { // Get values from the substitution engine. // We can't just pull these from the document context // because this script is intended to be transcluded into // another document, and we want the GET values used to request it, // not th...
if (reportCount != "") { var reportCountTest = async_test("Test number of sent reports."); var reportCountReport = new XMLHttpRequest();
<|file_name|>FileStorage.java<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>package io.github.notsyncing.cowherd.files; import io.github.notsyncing.cowherd.Cowherd; import io.github.notsyncing.cowherd.commons.CowherdConfiguration; import io.github.notsyncing.cowherd.commons.RouteType; import io.github.notsyncing.cowherd.models.ActionM...
to = to.resolve(fileName); } else { to = store.resolve(fileName);
<|file_name|>borrowck-assign-to-andmut-in-aliasable-loc.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 ...
fn c(s: & &mut S) {
<|file_name|>api_backend.go<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>// Copyright 2016 The go-trustmachine Authors // This file is part of the go-trustmachine library. // // The go-trustmachine library is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as publishe...
// // The go-trustmachine library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
<|file_name|>router.go<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>package routers import ( "github.com/astaxie/beego" "github.com/royburns/goTestLinkReport/apis" "github.com/royburns/goTestLinkReport/controllers" ) func init() { // main beego.Router("/", &controllers.IndexController{}) beego.Router("/plan", &controllers.Pla...
}
<|file_name|>render_context.rs<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>use std::collections::{HashMap}; use std::path::{Path}; use std::sync::{Arc}; use crossbeam::sync::{MsQueue}; use glium::backend::{Facade}; use debug::{gnomon, indicator}; use inverse_kinematics::{Chain}; use model::{Model}; use unlit_model::{UnlitModel}; us...
RenderContext { q: q,
<|file_name|>hdrs.py<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>"""HTTP Headers constants.""" from .multidict import upstr METH_ANY = upstr('*') METH_CONNECT = upstr('CONNECT') METH_HEAD = upstr('HEAD') METH_GET = upstr('GET') METH_DELETE = upstr('DELETE') METH_OPTIONS = upstr('OPTIONS') METH_PATCH = upstr('PATCH') METH_POST = upst...
CONTENT_RANGE = upstr('CONTENT-RANGE')
<|file_name|>4.py<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>#Python 2.7<๏ฝœfimโ–hole๏ฝœ><๏ฝœfimโ–end๏ฝœ>
candidates = set([str(a * b) for a in range(100, 1000) for b in range(100, 1000)]) candidates = filter(lambda x: x == x[::-1], candidates) print max([int(x) for x in candidates])
<|file_name|>app.py<|end_file_name|><๏ฝœfimโ–begin๏ฝœ><๏ฝœfimโ–hole๏ฝœ> app = Flask(__name__) app.config.from_object("configs.appconfig.DevelopmentConfig")<๏ฝœfimโ–end๏ฝœ>
from flask import Flask
<|file_name|>LmsApiUserService.java<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>package com.softech.ls360.lms.api.proxy.service; import com.softech.vu360.lms.webservice.message.lmsapi.serviceoperations.user.AddUserResponse; import com.softech.vu360.lms.webservice.message.lmsapi.serviceoperations.user.UpdateUserResponse; import com.s...
public interface LmsApiUserService {
<|file_name|>delayed_gcode.py<|end_file_name|><๏ฝœfimโ–begin๏ฝœ># A simple timer for executing gcode templates # # Copyright (C) 2019 Eric Callahan <arksine.code@gmail.com> # # This file may be distributed under the terms of the GNU GPLv3 license. import logging class DelayedGcode: def __init__(self, config): ...
<|file_name|>saveFile.js<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>Meteor.methods({ uploadFile: function (file) { console.log('saving '+file.name+' on server'); //appends to current file by same name.. file.save('/tmp/uploads', {});<๏ฝœfimโ–hole๏ฝœ><๏ฝœfimโ–end๏ฝœ>
} });
<|file_name|>services.js<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>var sbModule = angular.module('sbServices', ['ngResource']); sbModule.factory('App', function($resource) { return $resource('/api/v1/app/:name', { q: '' }, { get: { method: 'GET' }, //isArray: false },<๏ฝœfimโ–hole๏ฝœ> query: { method: 'GET'} //, para...
<|file_name|>filters.py<|end_file_name|><๏ฝœfimโ–begin๏ฝœ># # Copyright (c) 2015 Red Hat # Licensed under The MIT License (MIT)<๏ฝœfimโ–hole๏ฝœ># http://opensource.org/licenses/MIT # from django.conf import settings from django.forms import SelectMultiple import django_filters from pdc.apps.common.filters import MultiValueFilt...
<|file_name|>mastodon.js<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>import React from 'react'; import { Provider } from 'react-redux'; import PropTypes from 'prop-types'; import configureStore from '../store/configureStore'; import { BrowserRouter, Route } from 'react-router-dom'; import { ScrollContext } from 'react-router-scroll-4...
<|file_name|>paint_context.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/. */ //! Painting of display lists using Moz2D/Azure. use a...
origin.x = origin.x + glyph_advance; }; }
<|file_name|>cuki.js<|end_file_name|><๏ฝœfimโ–begin๏ฝœ><๏ฝœfimโ–hole๏ฝœ> result = 0, i = 0; while (true) { if (i === 0) { current = numbers[i]; if (numbers.length === 1) { result = current; break; } i++; } ...
function solve(args) { const module = 1024; let numbers = args.slice(1).map(Number), current,
<|file_name|>urls.py<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>"""template_III URL Configuration The `urlpatterns` list routes URLs to views. For more information please see:<๏ฝœfimโ–hole๏ฝœ>Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Cla...
ERROR: type should be large_string, got " https://docs.djangoproject.com/en/1.10/topics/http/urls/"
<|file_name|>LibraryRuntimeClasspathScope.java<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>/* * Copyright 2000-2009 JetBrains s.r.o. * * 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...
final Set<Module> processedModules = new THashSet<Module>();
<|file_name|>TestEnumStates.java<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>package Init.Enum; import Generics.Generator; import java.util.EnumMap; import java.util.Iterator; import static Init.Enum.Input.*; import static Init.Print.print; /** * Created by Defias on 2020/07.<๏ฝœfimโ–hole๏ฝœ> * Description: ไฝฟ็”จenum็š„็Šถๆ€ๆœบ * */ public ...
<|file_name|>lib.rs<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>pub fn bottle_or_bottles(n: i32) -> &'static str { match n { 1 => "bottle", _ => "bottles", } } pub fn sing(n: i32) { for i in (1..n + 1).rev() { println!( "{0} {1} of beer on the wall, {0} {1} of beer.", i, ...
i - 1, bottle_or_bottles(i - 1) );
<|file_name|>metadata.rs<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>// Copyright 2015 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/licens...
let error_message = format!("Mismatch between Ty and \
<|file_name|>test_person_misc_api.py<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>__author__ = 'sweemeng' from rest_framework import status from popit.signals.handlers import * from popit.models import * from popit.tests.base_testcase import BasePopitAPITestCase class PersonLinkAPITestCase(BasePopitAPITestCase): def test_view_p...
"url": "http://github.com/sinar"
<|file_name|>pipeline.py<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>from accounts.models import Practice def create_practice(request, strategy, backend, uid, response={}, details={}, user=None, social=None, *args, **kwargs): """ if user has a practice skip else create new practice<๏ฝœfimโ–hole๏ฝœ> """ practice, creat...
<|file_name|>ease.js<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>import "../arrays/map"; import "../core/array"; import "../core/identity"; import "../math/trigonometry"; var d3_ease_default = function() { return d3_identity; }; var d3_ease = d3.map({ linear: d3_ease_default, poly: d3_ease_poly, quad: function() { return d3_e...
function d3_ease_elastic(a, p) {
<|file_name|>post_remote_api_j_account_fetch_payment_methods_id_responses.go<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>package j_account // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command import ( "fmt" "io"<๏ฝœfimโ–hole๏ฝœ> strfmt "github.com/go-open...
"github.com/go-openapi/errors" "github.com/go-openapi/runtime" "github.com/go-openapi/swag"
<|file_name|>SpecialCells.cpp<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>// BEGIN CUT HERE // END CUT HERE #include <sstream> #include <cstdio> #include <cstdlib> #include <iostream> #include <cstring> #include <algorithm> #include <cmath> #include <vector> #include <map> #include <string> #include <set> #include <algorithm> using...
eU[eIndex] = v, eV[eIndex] = u, eCapacity[eIndex] = 0, eCost[eIndex++] = -cost; } pair <int, int> minCostMaxFlow(int n, int s, int t) {
<|file_name|>config.go<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>package config import ( log "github.com/Sirupsen/logrus" _ "github.com/confur-me/confur-api/lib/logrus" cfg "github.com/olebedev/config" ) var c *cfg.Config func init() {<๏ฝœfimโ–hole๏ฝœ>func Read(path string) error { log.Info("Reading configuration from ", path) v...
c = new(cfg.Config) }
<|file_name|>__init__.py<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>"""Multidict implementation. HTTP Headers and URL query string require specific data structure: multidict. It behaves mostly like a dict but it can have several values for the same key. """ import os __all__ = ('MultiDictProxy', 'CIMultiDictProxy', 'Mu...
from ._multidict_py import (MultiDictProxy,
<|file_name|>base.py<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>import logging import uuid from datetime import timedelta from typing import List, Optional import stripe from django.apps import apps from django.db import IntegrityError, models, transaction from django.utils import dateformat, timezone from django.utils.encoding imp...
:param current_ids: stripe ids of objects that are currently being processed
<|file_name|>ml_input_utils.py<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>######################################################################################################### # ml_input_utils.py # One of the Python modules written as part of the genericQSARpyUtils project (see below). # # #######################################...
f_out = open(ID_descriptors_File,'w') try: for LINE in input_lines:
<|file_name|>reset-password.component.ts<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>import { Component } from "@angular/core"; import { emailPattern } from "../../core/utils/utils"; import { FormHandlerService } from "../../services/form-handler.service"; @Component({ selector: "bsc-reset-password", styleUrls: [ "reset-password...
}
<|file_name|>bundles.config.js<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>/** * Copyright 2018 The AMP HTML 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 * * htt...
latestVersion: '0.1', type: TYPES.MEDIA,
<|file_name|>SensorDataManager.java<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>/***************************************************************** SPINE - Signal Processing In-Node Environment is a framework that allows dynamic configuration of feature extraction capabilities of WSN nodes via an OtA protocol Copyright (C)...
private static int totEnergy(int[] data) { double totEn = 0; for (int i = 0; i < data.length; i++)
<|file_name|>index.js<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>const HttpStatus = require('http-status-codes'); const build = status => { return (ctx, message) => { ctx.status = status ctx.body = message || {message: HttpStatus.getStatusText(status)} return ctx } } module.exports = { accepted:...
}
<|file_name|>utils.js<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>"use strict"; const removeDiacritics = require('diacritics').remove; const request = require('request'); //const pSegCases = require('../test/promiseSwitchCase.js'); var utils = { /** * Resolve all promises in Object via for ... in loop * @param {object} obj...
);
<|file_name|>helper_test.go<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>package elasticsearch_test import ( "fmt" "path/filepath" "reflect" "runtime" "testing" ) //https://github.com/benbjohnson/testing // Test represents a set of helper functions to test type Test struct{} // Assert fails the test if the condition is false....
// OK fails the test if an err is not nil.
<|file_name|>cursor.py<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>from .util.deb import deb from .util.nrange import nrange from .cell import Cell #F,e,Cursor from .grid import spoint CURSOR_POS=None def gcp(): #get cursor position global CURSOR_POS deb('gcp',CURSOR_POS) return CURSOR_POS def scp(x,y): deb('scp',gcp(),x,y) ...
HG=spoint(i+1,j,HG,cxr)
<|file_name|>CLIProcessor.hpp<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>/* * Stellarium * Copyright (C) 2009 Fabien Chereau * * 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 ...
<|file_name|>flat.py<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>#!/usr/bin/env python import copy from cStringIO import StringIO<๏ฝœfimโ–hole๏ฝœ>import gzip import hashlib import mimetypes import os import boto from boto.s3.key import Key from boto.s3.connection import OrdinaryCallingFormat import app_config GZIP_FILE_TYPES = ['.html...
from fnmatch import fnmatch
<|file_name|>test_service_project_link.py<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>from rest_framework import test, status from waldur_core.structure.models import CustomerRole, ProjectRole from waldur_core.structure.tests import factories as structure_factories from . import factories class ServiceProjectLinkPermissionTest(te...
def test_user_cannot_revoke_service_and_project_permission_if_he_is_project_manager(self): user = self.users['manager']
<|file_name|>webdriver.py<|end_file_name|><๏ฝœfimโ–begin๏ฝœ># Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apa...
try: RemoteWebDriver.quit(self) except http_client.BadStatusLine: pass
<|file_name|>0004_auto_20170307_0605.py<|end_file_name|><๏ฝœfimโ–begin๏ฝœ># -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-03-07 06:05<๏ฝœfimโ–hole๏ฝœ> class Migration(migrations.Migration): dependencies = [ ('news', '0003_auto_20170228_2249'), ] operations = [ migrations.CreateModel( ...
from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion
<|file_name|>backwards_compatibility.py<|end_file_name|><๏ฝœfimโ–begin๏ฝœ># Copyright 2016 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 # # ...
<|file_name|>ext.js<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>function onLoaded() { var csInterface = new CSInterface(); var appName = csInterface.hostEnvironment.appName; if(appName != "FLPR"){ loadJSX(); } var appNames = ["PHXS"]; for (var i = 0; i < appNames.length; i+...
<|file_name|>MoverInterpolateComponent.cpp<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>/* * i6engine * Copyright (2016) Daniel Bonrath, Michael Baer, All rights reserved. * * This file is part of i6engine; i6engine is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * Li...
if (_positioning == Positioning::POSITIONING_RELATIVE) { // for absolute, startPos will be ignored because it doesn't make any sense _realStartPos = startPos; }
<|file_name|>nodetool.ts<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>//import toolLib = require('vsts-task-tool-lib/tool'); //import taskLib = require('vsts-task-lib/task'); import * as toolLib from 'vsts-task-tool-lib/tool'; import * as taskLib from 'vsts-task-lib/task'; import * as restm from 'typed-rest-client/RestClient'; import ...
default: throw new Error(`Unexpected OS '${osPlat}'`); }
<|file_name|>http_cache.rs<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ use hyper::header::{Expires, HttpDate}; use hyper::method...
destination: Destination::Document, origin: url.clone().origin(),
<|file_name|>DataTypeUtils.java<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under...
return Short.parseShort((String) value);
<|file_name|>FLAT.py<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>################################################################ # LiveQ - An interactive volunteering computing batch system # Copyright (C) 2013 Ioannis Charalampidis # # This program is free software; you can redistribute it and/or # modify it under the terms of the...
<|file_name|>split.py<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>''' split a file into two randomly, line by line. Usage: split.py <input file> <output file 1> <output file 2> [<probability of writing to the first file>]' ''' import csv import sys<๏ฝœfimโ–hole๏ฝœ>try: P = float( sys.argv[4] ) except IndexError: P = 0.9 print "P = %...
import random
<|file_name|>Location.py<|end_file_name|><๏ฝœfimโ–begin๏ฝœ><๏ฝœfimโ–hole๏ฝœ> 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, or (at your option) any later versio...
""" <This library provides a Python interface for the Telegram Bot API> Copyright (C) <2015> <Jacopo De Luca>
<|file_name|>types.py<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>from __future__ import annotations from typing import ( Any, Awaitable, Callable, Iterable, AsyncIterator, Tuple, Mapping, ) from aiohttp import web import aiohttp_cors WebRequestHandler = Callable[ [web.Request], Awaitable[web.StreamRes...
Tuple[web.Application, Iterable[WebMiddleware]] ] PluginAppCreator = Callable[ [Mapping[str, Any], CORSOptions],
<|file_name|>cli.py<|end_file_name|><๏ฝœfimโ–begin๏ฝœ># # Utility functions for the command line drivers # # Copyright 2006-2007, 2013, 2014 Red Hat, Inc. # Jeremy Katz <katzj@redhat.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as publis...
<|file_name|>_helpers.py<|end_file_name|><๏ฝœfimโ–begin๏ฝœ># Copyright 2016 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unles...
<|file_name|>identify.js<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>/* globals describe, beforeEach, $fixture, qq, assert, it, qqtest, helpme, purl */ if (qq.supportedFeatures.imagePreviews && qqtest.canDownloadFileAsBlob) { describe("identify.js", function() { "use strict"; function testPreviewability(expectedT...
}); }
<|file_name|>extinfo.cc<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>#include "peerreview/vrf.h" #define SUBSYSTEM "VrfExtInfoPolicy" VrfExtInfoPolicy::VrfExtInfoPolicy(VerifiablePRNG *vprng) : ExtInfoPolicy() { this->vprng = vprng; } VrfExtInfoPolicy::~VrfExtInfoPolicy() { } int VrfExtInfoPolicy::storeExtInfo(SecureHistory *his...
extInfoLen = history->getEntry(ne, buffer, maxlen);
<|file_name|>__init__.py<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>#!/usr/bin/env python """ The scripts that compose this module contains a set of functions needed to process properly a background subtraction of each camera of a dataset """ <๏ฝœfimโ–hole๏ฝœ>import numpy as np import sys from gui import trackbar from threedgeometry im...
import cbackground import cv2
<|file_name|>worldMap.py<|end_file_name|><๏ฝœfimโ–begin๏ฝœ># Copyright (C) 2001 Steve Howell # You must read the file called INFO.txt before distributing this code. # --- # Worlds for Karel are defined with simple text files that we parse out # in this module. See the worlds folder for examples. from world import NORTH,...
numBeepers = 0
<|file_name|>M_InOutLine_Shipment.java<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>package de.metas.inoutcandidate.modelvalidator; /* * #%L<๏ฝœfimโ–hole๏ฝœ> * Copyright (C) 2015 metas GmbH * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as * published...
* de.metas.swat.base * %%
<|file_name|>rule_profiler.cc<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>//-------------------------------------------------------------------------- // Copyright (C) 2015-2016 Cisco and/or its affiliates. All rights reserved. // // This program is free software; you can redistribute it and/or modify it // under the terms of the GNU...
<|file_name|>test_whoosh_backend.py<|end_file_name|><๏ฝœfimโ–begin๏ฝœ># encoding: utf-8 from __future__ import absolute_import, division, print_function, unicode_literals import os import unittest from datetime import timedelta from decimal import Decimal from django.conf import settings from django.test import TestCase ...
self.raw_whoosh = self.sb.index self.parser = QueryParser(self.sb.content_field_name, schema=self.sb.schema) self.sb.delete_index()
<|file_name|>manifest.js<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>import ResourceProcessorBase from './resource-processor-base'; class ManifestProcessor extends ResourceProcessorBase { processResource (manifest, ctx, charset, urlReplacer) { var lines = manifest.split('\n');<๏ฝœfimโ–hole๏ฝœ> if (line && line !== ...
for (var i = 0; i < lines.length; i++) { var line = lines[i].trim();
<|file_name|>vip.py<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>import urllib from models.vipsubscriber import VipSubscriber from base import BaseHandler class Vip(BaseHandler): LOCATION = "../views/vip.html" def GetContext(self): tContext = {} tVipList = [] tVipKey = urllib.unquote(self.requ...
<|file_name|>_exception.py<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>from __future__ import absolute_import, division, print_function # ---------------------------------------------------------------------------- # Copyright (c) 2013--, scikit-bio development team. # # Distributed under the terms of the Modified BSD License. # # T...
class DuplicateNodeError(TreeError): """Duplicate nodes with identical names""" pass
<|file_name|>unify.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.apache.org/licenses/...
impl InferCtxtMethods for InferCtxt { fn simple_vars<T:Clone + Eq + InferStr + SimplyUnifiable,
<|file_name|>logcontrol.py<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>"Messages used to internally control thesplog settings." from thespian.actors import ActorSystemMessage<๏ฝœfimโ–hole๏ฝœ>class SetLogging(ActorSystemMessage): def __init__(self, threshold, useLogging, useFile): self.threshold = threshold self.useLo...
<|file_name|>http_cache.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/. */ #![deny(missing_docs)] //! A memory cache implementing th...
<|file_name|>online.py<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>''' Online link spider test ''' from __future__ import print_function from future import standard_library standard_library.install_aliases() from builtins import next import unittest from unittest import TestCase import time import sys from os import path sys.path.ap...
sys.exit(1) # clear out older test keys if any
<|file_name|>LoginUsuarioServlet.java<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>package br.edu.utfpr.cm.pi.controller; import java.io.IOException; <๏ฝœfimโ–hole๏ฝœ>import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSess...
import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet;
<|file_name|>transformation.py<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>import numpy<๏ฝœfimโ–hole๏ฝœ> """Combined translational and rotational transformation. This is a subclass of Transformation. Objects of this class are not created directly, but can be the result of a composition of rotations and translations. ...
class RotationTranslation:
<|file_name|>yaml-comparison.py<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>#!/usr/bin/env python from __future__ import division import sys, os import numpy as np import readnew from glob import glob #import re import yaml import os.path import time # Need to wait some time if file is being written # Example: /home/jordan/sad-mon...
if yamlRef: # if using yaml as a reference the range is from 0 to len while for C++ the range is # from maxref to minref + 1
<|file_name|>com_biomedcentral.py<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>from share.transform.chain import * # noqa class AgentIdentifier(Parser): uri = IRI(ctx) class WorkIdentifier(Parser): uri = IRI(ctx) class Tag(Parser): name = ctx class ThroughTags(Parser): tag = Delegate(Tag, ctx) class Person(P...
class Extra: openaccess = ctx.openaccess
<|file_name|>reload.py<|end_file_name|><๏ฝœfimโ–begin๏ฝœ>"""Class to reload platforms.""" from __future__ import annotations import asyncio from collections.abc import Iterable import logging from typing import Any from homeassistant import config as conf_util from homeassistant.const import SERVICE_RELOAD from homeassist...
for p_config in platform_configs ] await asyncio.gather(*tasks)