prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>ISensorListener.java<|end_file_name|><|fim▁begin|>package com.touchableheroes.drafts.app.sensors;
/**
* Created by asiebert on 06.12.14.
*/
public class ISensorListener {
<|fim▁hole|><|fim▁end|> | } |
<|file_name|>hyperbolictangent.rs<|end_file_name|><|fim▁begin|>use std::f64;
use activation::Activation;
#[derive(Copy, Clone)]
pub struct HyperbolicTangent;
impl HyperbolicTangent {
pub fn new() -> HyperbolicTangent {
return HyperbolicTangent;
}
}
impl Activation for HyperbolicTangent {
/// Calc... | }
|
<|file_name|>server.js<|end_file_name|><|fim▁begin|>import Express from 'express';
import compression from 'compression';
import mongoose from 'mongoose';
import bodyParser from 'body-parser';
import path from 'path';
import IntlWrapper from '../client/modules/Intl/IntlWrapper';
// Webpack Requirements
import webpack ... |
// MongoDB Connection
mongoose.connect(serverConfig.mongoURL, (error) => {
if (error) { |
<|file_name|>MetaThemeMenuItemUI.java<|end_file_name|><|fim▁begin|>/*
* This file is part of MetaTheme.
* Copyright (c) 2004 Martin Dvorak <jezek2@advel.cz>
*
* MetaTheme 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 Softw... | |
<|file_name|>test_03b_subcmd_primer3.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""test_03b_subcmd_primer3.py
Test primer3 subcommand for pdp script. These tests require primer3 v2+.
This test suite is intended to be run from the repository root using:
pytest -v
(c) The James Hut... | Invergowrie, |
<|file_name|>merge_sort.py<|end_file_name|><|fim▁begin|>def merge(a, b):
"""
inuput: two sorted lists
output: a merged sorted list
for example:
merge([2,3], [1,4])
--> [1,2,3,4]
"""
merged = []
while a or b:
if a and b:
if a[0] < b[0]:
merged.appe... | |
<|file_name|>SocialIcon.js<|end_file_name|><|fim▁begin|>import React, { Component, PropTypes } from 'react';
import { Image } from 'react-bootstrap';
require('./styles.scss');
class SocialBar extends Component {
constructor(props) {
super(props);
}<|fim▁hole|> const { icon, url } = this.props;
return ... |
render() { |
<|file_name|>mp3.py<|end_file_name|><|fim▁begin|># PyMM - Python MP3 Manager
# Copyright (C) 2000 Pierre Hjalm <pierre.hjalm@dis.uu.se>
#
# Modified by Alexander Kanavin <ak@sensi.org>
# Removed ID tags support and added VBR support
# Used http://home.swipnet.se/grd/mp3info/ for information
#
# This program is free sof... | f.close()
return 0
f.close() |
<|file_name|>instagram.js<|end_file_name|><|fim▁begin|>var ig = {};
// !!! USE YOUR OWN TOKEN
ig.token = '43619676.1677ed0.5ca7163640fc4a7f89ca21dc02475134';
ig.init = function() {
$('.instagram').each(function(i) {
var args = {};
args.container = $(this);
args.userid = args.container.data('userid');<|fi... | args.limit = args.container.data('limit');
args.feedurl = 'https://api.instagram.com/v1/users/'+args.userid+'/media/recent/?access_token='+ig.token+'&count='+args.limit+'&callback=?'; |
<|file_name|>SliderOffsets.ts<|end_file_name|><|fim▁begin|>import { ClientRect } from '@ephox/dom-globals';
import { AlloyComponent } from '../../api/component/ComponentApi';
const top = 'top',
right = 'right',
bottom = 'bottom',
left = 'left',
width = 'width',
height = 'height';
// Scr... | };
const getMaxXBounds = (component: AlloyComponent): number => {
const bounds = getBounds(component); |
<|file_name|>distance-service.js<|end_file_name|><|fim▁begin|>var Service = require("./../service.js");
function DistanceService(deviceId, serviceId) {
var distanceService = {}
, _characteristics = {
'distance' : 1
, 'unit' : 2
}
, _requests = {
'read-dis... | |
<|file_name|>as_ref.rs<|end_file_name|><|fim▁begin|>#![feature(core)]
extern crate core;
#[cfg(test)]
mod tests {
use core::convert::AsRef;
// pub trait FixedSizeArray<T> {
// /// Converts the array to immutable slice
// fn as_slice(&self) -> &[T];
// /// Converts the array to mutable ... | // type IntoIter = IterMut<'a, T>;
//
// fn into_iter(self) -> IterMut<'a, T> { |
<|file_name|>SchemaFormContentFileService.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2017 OBiBa. All rights reserved.
*
* This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0.
*
* You should have received a copy of the GNU General Public License... | |
<|file_name|>action.py<|end_file_name|><|fim▁begin|>"""Provides a class for managing BIG-IP L7 Rule Action resources."""
# coding=utf-8
#
# Copyright (c) 2017-2021 F5 Networks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# Y... | self._data['shutdown'] = shutdown |
<|file_name|>simulation_CS3.py<|end_file_name|><|fim▁begin|>import modules.pumpingsystem as ps
import pandas as pd
import numpy as np
# Pump schedule as per SCADA. rows = pumps, columns 1:=Peak, 2:=Standard, 3:Off-peak
pump_schedule_41 = np.array([[72, 42, 50],
[95, 78, 86],
... | inflow_41, fed_to_level="31L", pump_statuses_for_validation=actual_status_41,
n_mode_max_pumps=2, n_mode_max_level=80, n_mode_control_range=30, |
<|file_name|>gallery_generator.py<|end_file_name|><|fim▁begin|>"""
Sphinx plugin to run example scripts and create a gallery page.
Lightly modified from the mpld3 project.
"""
from __future__ import division
import os
import os.path as op
import re
import glob
import token
import tokenize
import shutil
from seaborn.... | |
<|file_name|>globe_plugin.cpp<|end_file_name|><|fim▁begin|>/***************************************************************************
globe_plugin.cpp
Globe Plugin
a QGIS plugin
--------------------------------------
Date : 08-Jul-2010
Copyright : (C) 2010 by Sourc... | osgEarth::ImageLayerOptions options( "QGIS" ); |
<|file_name|>rssfeeds.py<|end_file_name|><|fim▁begin|># coding=utf-8
import re
import urlparse
from feedparser.api import parse
from feedparser.util import FeedParserDict
from sickbeard import logger
from sickrage.helper.exceptions import ex
def getFeed(url, request_headers=None, handlers=None):
parsed = list(ur... | else: |
<|file_name|>copyrequest.cpp<|end_file_name|><|fim▁begin|>#include <iostream>
#include <sys/stat.h>
#include <libgen.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include "copyrequest.h"
#include "urlencode.h"
using namespace std;
CopyRequest::CopyRequest(WebdavServer& owner, bool deleteSource) :
R... | |
<|file_name|>BeansResource.java<|end_file_name|><|fim▁begin|>package com.sebastian_daschner.scalable_coffee_shop.beans.boundary;
import javax.inject.Inject;
import javax.json.Json;
import javax.json.JsonObject;
import javax.json.JsonObjectBuilder;
import javax.ws.rs.BadRequestException;
import javax.ws.rs.GET;<|fim▁ho... | import javax.ws.rs.POST; |
<|file_name|>check-todos.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
#
# Copyright © 2019 Endless Mobile, Inc.
#
# SPDX-License-Identifier: LGPL-2.1-or-later
#
# Original author: Philip Withnall
"""
Checks that a merge request doesn’t add any instances of the string ‘todo’
(in uppercase), or similar keyword... | ['git', 'log', '--no-color', args.commits + '..HEAD'],
stdout=subprocess.PIPE, stderr=subprocess.PIPE, encoding='utf-8',
check=True) |
<|file_name|>adapt-contrib-slider.js<|end_file_name|><|fim▁begin|>define(function(require) {
var QuestionView = require('coreViews/questionView');
var Adapt = require('coreJS/adapt');
var Slider = QuestionView.extend({
events: {
'click .slider-sliderange': 'onSliderSelected',
... | },
onHandleFocus: function(event) { |
<|file_name|>StringUtilImpl.java<|end_file_name|><|fim▁begin|>package com.avsystem.scex.util.function;
import org.apache.commons.codec.digest.HmacAlgorithms;
import org.apache.commons.codec.digest.HmacUtils;
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.lang3.StringUtils;
import java.ut... | } |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// Copyright (C) 2013-2020 Blockstack PBC, a public benefit corporation
// Copyright (C) 2020 Stacks Open Internet Foundation
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published b... | bytes: Hash160([0xfc; 20]),
}, |
<|file_name|>ez-relationlist-editview-tests.js<|end_file_name|><|fim▁begin|>/*
* Copyright (C) eZ Systems AS. All rights reserved.
* For full copyright and license information view LICENSE file distributed with this source code.
*/
YUI.add('ez-relationlist-editview-tests', function (Y) {
var viewTest,
re... | |
<|file_name|>validator.go<|end_file_name|><|fim▁begin|>package graphql
import (
"github.com/housinganywhere/graphql/language/kinds"
"github.com/housinganywhere/graphql/language/visitor"
"github.com/housinganywhere/graphql/gqlerrors"
"github.com/housinganywhere/graphql/language/ast"
)
type ValidationResult struct ... | Errors []gqlerrors.FormattedError
}
|
<|file_name|>GuiceIdentityGenerator.java<|end_file_name|><|fim▁begin|>/*
* Copyright © 2013-2021, The SeedStack authors <http://seedstack.org>
*
* 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 ... |
@Named("guice")
public class GuiceIdentityGenerator implements SequenceGenerator { |
<|file_name|>test_airpollution_manager.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import unittest
from pyowm.airpollutionapi30 import airpollution_client, airpollution_manager, coindex, so2index, ozone, no2index, airstatus
from pyowm.config import DEFAULT_CONFIG
from pyow... | airpollution_client.AirPollutionHttpClient.get_no2 = ref_to_original
self.assertTrue(isinstance(result, no2index.NO2Index))
self.assertEqual('year', result.interval) |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from .tensor import *<|fim▁hole|><|fim▁end|> | from .math import * |
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|>"""
WSGI config for ldstext project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
"""<|fim▁hole|>import os
os.environ.setdefault("DJAN... | |
<|file_name|>dialogflow_v3_generated_agents_export_agent_async.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# 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... | print("Waiting for operation to complete...") |
<|file_name|>url.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- encoding: utf-8 -*-
import urlparse
def uc2utf8(input):
## argh! this feels wrong, but seems to be needed.
if type(input) == unicode:
return input.encode('utf-8')
else:
return input
class URL:
"""
This c... | return unicode(self.url_raw, 'utf-8')
|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from zope.interface import classImplements
from pyramid.config import Configurator
from clld.interfaces import ILanguage, IMapMarker, IValueSet, IValue
from clld.web.app import MapMarker
from clld.db.models.common import Parameter_files
# we must make sure custom ... | |
<|file_name|>bootstrap_js_tooltip_7.js<|end_file_name|><|fim▁begin|>/* ========================================================================
* Bootstrap: tooltip.js v3.2.0
* http://getbootstrap.com/javascript/#tooltip
* Inspired by the original jQuery.tipsy by Jason Frame
* ======================================... | // ===============================
|
<|file_name|>test_base.py<|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 the Apache L... | class BaseMockRawResponse(MockHttp):
def _(self, method, url, body, headers): |
<|file_name|>EnpassConversionHelper.js<|end_file_name|><|fim▁begin|>import * as randomMC from 'random-material-color';
import Localisation from '@js/Classes/Localisation';
import CustomFieldsHelper from '@js/Helper/Import/CustomFieldsHelper';
import ImportMappingHelper from '@js/Helper/Import/ImportMappingHelper';
exp... |
ImportMappingHelper.checkPasswordDuplicate(mapping, password);
this._processPasswordTags(element, password, tagMap); |
<|file_name|>utils.js<|end_file_name|><|fim▁begin|>const TelegramBot = require('node-telegram-bot-api');
const EnchancedTelegramTest = require('./EnhancedTelegramTest');
const { track, trackInline } = require('../src/analytics');
const { initHandlers } = require('../src/handlers');
function createBot() {<|fim▁hole|>}
... | return new TelegramBot('0123456789abcdef', { webhook: true }); |
<|file_name|>BouncyBall.java<|end_file_name|><|fim▁begin|>package net.yottabyte.game;
import java.awt.*;
/**
* @author Jason Fagan
*/
public class BouncyBall {
private int x;
private int y;
private int vx;
private int vy;
private int radius;
private int drag;
private int mass;
publ... | }
public void setDrag(int drag) { |
<|file_name|>local_data.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2013 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... | // caller. In doing so, the slot that the TLS entry is occupying cannot be |
<|file_name|>new-speaker-test.js<|end_file_name|><|fim▁begin|>import { test } from 'ember-qunit';
import moduleFor from 'open-event-frontend/tests/helpers/unit-helper';
<|fim▁hole|>moduleFor('controller:public/cfs/new-speaker', 'Unit | Controller | public/cfs/new speaker', []);
test('it exists', function(assert) {
l... | |
<|file_name|>common.rs<|end_file_name|><|fim▁begin|>use byteorder::ByteOrder;
/// Timestamp resolution of the pcap
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
pub enum TsResolution {
MicroSecond,
NanoSecond
}
/// Endianness of the pcap
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
pub enum Endianness {
Bi... | NETLINK,
BLUETOOTH_LINUX_MONITOR,
BLUETOOTH_BREDR_BB, |
<|file_name|>expected.js<|end_file_name|><|fim▁begin|>"use strict";
var _foob, _foob$test;
var _toArray = function (arr) { return Array.isArray(arr) ? arr : Array.from(arr); };
<|fim▁hole|>(_foob = foob).add.apply(_foob, [foo, bar].concat(_toArray(numbers)));
(_foob$test = foob.test).add.apply(_foob$test, [foo, bar].c... | |
<|file_name|>matching_layer.py<|end_file_name|><|fim▁begin|>"""An implementation of Matching Layer."""
import typing
import tensorflow as tf
from keras.engine import Layer
class MatchingLayer(Layer):
"""
Layer that computes a matching matrix between samples in two tensors.
:param normalize: Whether to L... | x1 = tf.math.l2_normalize(x1, axis=2)
x2 = tf.math.l2_normalize(x2, axis=2)
return tf.expand_dims(tf.einsum('abd,acd->abc', x1, x2), 3)
else: |
<|file_name|>ieq30pro.py<|end_file_name|><|fim▁begin|>import re
import time
from astropy import units as u
from astropy.coordinates import SkyCoord
from panoptes.utils.time import current_time
from panoptes.utils import error as error
from panoptes.pocs.mount.serial import AbstractSerialMount
class Mount(AbstractSe... | |
<|file_name|>subscriber_notifee.go<|end_file_name|><|fim▁begin|>package dht
import (
"context"
"fmt"
"github.com/libp2p/go-libp2p-core/event"
"github.com/libp2p/go-libp2p-core/network"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-eventbus"
"github.com/jbenet/goprocess"
ma "github.com/multif... | }
switch evt := e.(type) {
case event.EvtLocalAddressesUpdated: |
<|file_name|>visualization.py<|end_file_name|><|fim▁begin|>"""
Plotting (requires matplotlib)
"""
from colorsys import hsv_to_rgb, hls_to_rgb
from libmp import NoConvergence
class VisualizationMethods(object):
plot_ignore = (ValueError, ArithmeticError, ZeroDivisionError, NoConvergence)
def plot(ctx, f, xlim=[-5... | axes.set_ylim(map(float, ylim))
axes.set_xlabel('x')
axes.set_ylabel('f(x)') |
<|file_name|>automate_scrape.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python3
'''
automate_scrape.py - runs throught the online verision of the text book, 'Automate the boring stuff with python' and pulls out all of the projects and stores them in a file.
'''
import requests, os, bs4, sys
<|fim▁hole|> '''
... | def page_download(web_page, chapter_num, no_project_count, no_chapter_projects):
'''
Downloads the web page. Keeps the varibales, chapter_num, no_project_count, no_chapter_projects to be then used in chapter_loop_and_write. |
<|file_name|>section_test.js<|end_file_name|><|fim▁begin|>// ==========================================================================
// Project: Brochurno
// Copyright: @2011 Jason Dooley
// ==========================================================================
/*globals Brochurno module test ok equals same stop... | |
<|file_name|>encoder.go<|end_file_name|><|fim▁begin|>package sdp
func (s Session) appendAttributes(attrs Attributes) Session {
for _, v := range attrs {
if v.Value == blank {
s = s.AddFlag(v.Key)
} else {
s = s.AddAttribute(v.Key, v.Value)
}
}
return s
}
// Append encodes message to Session and returns... | } |
<|file_name|>type-alias-impl-trait.rs<|end_file_name|><|fim▁begin|>// run-pass
#![allow(dead_code)]
#![allow(unused_assignments)]
#![allow(unused_variables)]
#![feature(type_alias_impl_trait)]
fn main() {
assert_eq!(foo().to_string(), "foo");
assert_eq!(bar1().to_string(), "bar1");
assert_eq!(bar2().to_st... | type GenericBound<'a, T: Trait + 'a> = impl Sized + 'a; |
<|file_name|>draft_utils.py<|end_file_name|><|fim▁begin|>from .models import Framework
from .utils import get_json_from_request, json_has_required_keys, \
json_has_matching_id
from .validation import get_validation_errors
def validate_and_return_draft_request(draft_id=0):
json_payload = get_json_from_request(... | |
<|file_name|>math.js<|end_file_name|><|fim▁begin|>function mathGame(){
var game = new Phaser.Game(window.innerWidth, window.innerHeight, Phaser.auto, 'math', {
preload: onPreload,
create: onCreate,
// resize:onResize
});
WebFontConfig = {
active: function() { game.time.events.add(Phaser.Timer.SECO... | buttonMask.destroy();
replay.visible = true;
// gameOverSprite.visible = true; |
<|file_name|>svg-container.component.ts<|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
* ... | @ViewChild('svgInner', { static: true }) svgInner: ElementRef<SVGAElement>;
@Input() nzMaxZoom = 5; |
<|file_name|>BrightContrastFilter.rs<|end_file_name|><|fim▁begin|>#pragma version(1)
#pragma rs java_package_name(cn.louispeng.imagefilter.renderscript)
// 高亮对比度特效
#include "Clamp.rsh"
// set from the java SDK level
rs_allocation gIn;
rs_allocation gOut;
rs_script gScript;
// The brightness factor.
// Should be in ... |
float3 f3 = f4.rgb;
// Modify brightness (addition) |
<|file_name|>point.cpp<|end_file_name|><|fim▁begin|>/*
Copyright (c) 2006 Paolo Capriotti <p.capriotti@gmail.com>
(c) 2006 Maurizio Monge <maurizio.monge@kdemail.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published... | << ", " << (p.y == -1 ? QString("?") : QString::number(p.y)) << ")";
return dbg;
} |
<|file_name|>database.py<|end_file_name|><|fim▁begin|>from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
from sqlalchemy.ext.declarative import declarative_base
engine = create_engine('sqlite:////db/cities.sqlite', convert_unicode=True)
db_session = scoped_session(sessionmaker... | autoflush=False,
bind=engine))
Base = declarative_base()
Base.query = db_session.query_property() |
<|file_name|>UserOverview.ts<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2020 Graylog, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the Server Side Public License, version 1,
* as published by MongoDB, Inc.
*
* This program is distributed in the hope t... | |
<|file_name|>posts.client.routes.tests.js<|end_file_name|><|fim▁begin|>(function () {
'use strict';
describe('Posts Route Tests', function () {
// Initialize global variables
var $scope,
PostsService;
//We can start by loading the main application module
beforeEach(module(ApplicationConfigur... | })); |
<|file_name|>MobileStepper.js<|end_file_name|><|fim▁begin|>import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
import _extends from "@babel/runtime/helpers/esm/extends";
import * as React from 'react';
import PropTypes from 'prop-types';
import clsx from 'clsx';
import {... | slot: 'Dot'
})(({ |
<|file_name|>jquery-selective.es.js<|end_file_name|><|fim▁begin|>/**
* jQuery Selective v0.3.5
* https://github.com/amazingSurge/jquery-selective
*
* Copyright (c) amazingSurge
* Released under the LGPL-3.0 license
*/
import $$1 from 'jquery';
/*eslint no-empty-function: "off"*/
var DEFAULTS = {
namespace: 'selectiv... | } else {
return this.each(function() { |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//! Functions for filtering images.
mod median;
pub use self::median::median_filter;
use image::{GrayImage, GenericImage, GenericImageView, ImageBuffer, Luma, Pixel, Primitive};
use integral_image::{column_running_sum, row_running_sum};
use map::{WithChannel, ChannelM... | black_box(filtered);
});
}
|
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>from django.contrib import admin
from simulation.models import SimulationStage, SimulationStageMatch, SimulationStageMatchResult
class SimulationStageAdmin(admin.ModelAdmin):
list_display = ["number", "created_at"]
list_filter = ["created_at"]<|fim▁hole|>clas... | |
<|file_name|>modalStudent.js<|end_file_name|><|fim▁begin|>$('.registerModalButton').on("click", function () {
var courseId = $(this).data('id'),
courseName = $(this).data('name');
$("#studentModal .registerOkButton").data('courseToRegisterId', courseId);
$("#studentModal #courseNameModal").text(cou... | 'courseId': id,
'__RequestVerificationToken': token
}; |
<|file_name|>eqPattern.py<|end_file_name|><|fim▁begin|>from pattern import Pattern
import itertools
import random
import colorsys
import time<|fim▁hole|>class EqPattern(Pattern):
def __init__(self, meter_color=(255,100,50), background_color=(0,50,255)):
self.meter_r = meter_color[0]
self.meter_g = m... | |
<|file_name|>request.ts<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {HttpHeaders} from './headers';
import {HttpUrlParams} f... | options = fourth;
} else {
// No body required, options are the third argument. The body stays null. |
<|file_name|>definition.py<|end_file_name|><|fim▁begin|># Copyright (c) 2014 by Ecreall under licence AGPL terms
# available on http://www.gnu.org/licenses/agpl.html
# licence: AGPL
# author: Amen Souissi
from dace.processdefinition.processdef import ProcessDefinition
from dace.processdefinition.activitydef import Ac... | |
<|file_name|>monomorphized-callees-with-ty-params-3314.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 o... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from .module1 import *
from .module4 import *<|fim▁hole|>import sys<|fim▁end|> | |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2012 OpenPlans
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publishe... | |
<|file_name|>config.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""Configure batch3dfier with the input data."""
import os.path
from subprocess import call
from shapely.geometry import shape
from shapely import geos
from psycopg2 import sql
import fiona
def call_3dfier(db, tile, schema_tiles,
... | pc_path=pc_dataset,
output_format=output_format)
return(config)
|
<|file_name|>main.cpp<|end_file_name|><|fim▁begin|><|fim▁hole|>/*
This file is a part of the Depecher (Telegram client)
Copyright (C) 2017 Alexandr Akulich <akulichalexander@gmail.com>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public Lice... | |
<|file_name|>eachValue.next.js<|end_file_name|><|fim▁begin|>/**
*
* @function
* @param {Array|arraylike} value
* @param {Function} cmd<|fim▁hole|> * @returns {?}
*/
export default function eachValue(value, cmd, context, keepReverse) {
if (value === undefined || value === null) return undefined;
const size = (0 |... | * @param {any} context |
<|file_name|>CollectionEditor.js<|end_file_name|><|fim▁begin|>// Copyright 2016 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
//
// http://w... | 'WritableCollectionBackendApiService', 'CollectionRightsBackendApiService', |
<|file_name|>nxOMSAgentNPMConfig.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# ===================================
# Copyright (c) Microsoft Corporation. All rights reserved.
# See license.txt for license information.
# ===================================
import socket
import os
import sys
import imp
import ... | retval = Test(ConfigType, ConfigID, Contents, Ensure, ContentChecksum)
return retval
|
<|file_name|>wiki2asciidoc.py<|end_file_name|><|fim▁begin|>from optparse import OptionParser
from uuid import uuid4
import re
def main():
parser = OptionParser()
#parser.add_option("--skip-rows", type="int", dest="skip_rows", default="0", help="Number of lines/rows to skip when using --lines or --csv. Default: %defa... | |
<|file_name|>io.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: sw=4:ts=4:expandtab
"""
meza.io
~~~~~~~
Provides methods for reading/writing/processing tabular formatted files
Examples:
basic usage::
>>> from meza.io import read_csv
>>>
>>> path = p.j... | |
<|file_name|>template_constants.js<|end_file_name|><|fim▁begin|>(function () {
'use strict';
angular.module('openSnap')
.constant('CONFIG', {<|fim▁hole|> menuItems: [{
state: 'home',
icon: 'home'
},
{
state: 'codes',
icon: 'code'
},
{
... | |
<|file_name|>switch.py<|end_file_name|><|fim▁begin|>"""Support for switches which integrates with other components."""
import logging
import voluptuous as vol
from homeassistant.components.switch import (
ENTITY_ID_FORMAT,
PLATFORM_SCHEMA,
SwitchEntity,
)
from homeassistant.const import (
ATTR_ENTITY_... | SWITCH_SCHEMA = vol.Schema(
{ |
<|file_name|>pad-test.js<|end_file_name|><|fim▁begin|>var assert = require('chai').assert;
var Pad = require('../lib/pad');
describe('Pad', function() {
it('should be an object', function() {
var pad = new Pad();
assert.isObject(pad);
});
it('should have a x coordinate of 310 by default', function() {
... | |
<|file_name|>TimelineBodyPanel.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2010-2021 JPEXS
*
* 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... | g.fillRect(f * frameWidth, start_d * frameHeight, frameWidth, (end_d - start_d + 1) * frameHeight);
g.setColor(emptyBorderColor);
for (int d = start_d; d <= end_d; d++) { |
<|file_name|>Event.js<|end_file_name|><|fim▁begin|>import React, { PropTypes } from 'react';
import EventImage from '../components/EventImage';
const Event = ({ eventUrl, images, ingress, startDate, title }) => (
<div>
<div className="col-sm-8 col-md-4">
<div className="hero-title">
<a href={eventU... | ingress: PropTypes.string.isRequired,
startDate: PropTypes.string.isRequired, |
<|file_name|>compass.js<|end_file_name|><|fim▁begin|>/**
* Compile sass files to css using compass
*/
module.exports = {
dev: {<|fim▁hole|> config: 'config.rb',
environment: 'development'
}
},
};<|fim▁end|> | options: { |
<|file_name|>wallet_api_doc.go<|end_file_name|><|fim▁begin|>package client
const walletAPIDoc = `"keybase wallet api" provides a JSON API to the Keybase wallet.
EXAMPLES:
List the balances in all your accounts:
{"method": "balances"}
See payment history in an account:
{"method": "history", "params": {"optio... | {"method": "details", "params": {"options": {"txid": "e5334601b9dc2a24e031ffeec2fce37bb6a8b4b51fc711d16dec04d3e64976c4"}}}
|
<|file_name|>HorizontalListWidget.cpp<|end_file_name|><|fim▁begin|>/***********************************************************************************
** MIT License **
** *... | |
<|file_name|>messenger.py<|end_file_name|><|fim▁begin|>"""
Implements a simple, robust, safe, Messenger class that allows one to
register callbacks for a signal/slot (or event/handler) kind of
messaging system. One can basically register a callback
function/method to be called when an object sends a particular event.
... | particular event. The object, event and any other arguments |
<|file_name|>mini_lambda.py<|end_file_name|><|fim▁begin|>import json
<|fim▁hole|> 'statusCode': 200,
'body': json.dumps('Hello from Lambda!')
}<|fim▁end|> | def lambda_handler(event, context):
return { |
<|file_name|>MySQLToolTableCheckSettings.java<|end_file_name|><|fim▁begin|>/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2021 DBeaver Corp and others
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may ob... | * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
<|file_name|>bump_maven_version.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python
# Script for increasing versions numbers across the code
import sys
import glob
import re
import argparse
def check_version_format(version):
"""Check format of version number"""
pattern = '^[0-9]+[\.][0-9]+[\.][0-9]+(\-.+)*$'
... | self.replace_file(
toplevelpomfile, self.release_version_pattern, version)
self.replace_file(
toplevelpomfile, self.group_pattern, self.new_group) |
<|file_name|>range_map.rs<|end_file_name|><|fim▁begin|>//! Implements a map from integer indices to data.
//! Rather than storing data for every index, internally, this maps entire ranges to the data.
//! To this end, the APIs all work on ranges, not on individual integers. Ranges are split as
//! necessary (e.g., when... | vec![19, 19]
);
// A NOP `iter_mut` should trigger merging. |
<|file_name|>amqp_publisher.cpp<|end_file_name|><|fim▁begin|>#include <amqp_tcp_socket.h>
#include <amqp.h>
#include <amqp_framing.h>
#include <iostream>
#include <thread>
#include <chrono>
#include <string.h>
#include <signal.h>
volatile bool g_running = false;
void handler(int)
{
g_running = true;
}
int main(int... | |
<|file_name|>UniversalBodyWrapper.java<|end_file_name|><|fim▁begin|>/*
* ################################################################
*
* ProActive Parallel Suite(TM): The Java(TM) library for
* Parallel, Distributed, Multi-Core Computing for
* Enterprise Grids & Clouds
*
* Copyright (C) 1997-2012 INRI... | // /* (non-Javadoc) |
<|file_name|>api.go<|end_file_name|><|fim▁begin|>// Copyright 2016 The go-ethereum Authors
// This file is part of the go-ethereum library.<|fim▁hole|>// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the imp... | //
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or |
<|file_name|>fix-dynamic-style-sheets.js<|end_file_name|><|fim▁begin|>'use strict';
module.exports = function (t, a) {
t(document.createElement('p'));<|fim▁hole|><|fim▁end|> | }; |
<|file_name|>permission.rs<|end_file_name|><|fim▁begin|>use std::{error::Error as StdError, fmt, io::Write, str::FromStr};
use diesel::{backend::Backend, deserialize, serialize, sql_types::Text};
#[derive(AsExpression, Clone, Copy, Debug, Eq, FromSqlRow, Hash, PartialEq)]
#[sql_type = "Text"]
pub enum Permission {
... |
impl fmt::Display for PermissionParseError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { |
<|file_name|>common.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/.
*
* Copyright 2017 - Dario Ostuni <dario.ostuni@gmail.com>
*... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | # -*- coding: utf-8 -*-
default_app_config = 'escolar.apps.EscolarConfig' |
<|file_name|>backend.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
"""
Resources:
http://code.google.com/p/pybluez/
http://lightblue.sourceforge.net/
http://code.google.com/p/python-bluetooth-scanner
"""
from __future__ import with_statement
import select
import logging
import bluetooth
import gobject
import u... | (18 - 13, SERVICE_CLASS.RENDERING),
(19 - 13, SERVICE_CLASS.CAPTURING),
(20 - 13, SERVICE_CLASS.OBJECT_TRANSFER), |
<|file_name|>PageView.py<|end_file_name|><|fim▁begin|>"""
Page view class
"""
import os
from Server.Importer import ImportFromModule
<|fim▁hole|>
class PageView(ImportFromModule("Server.PageViewBase", "PageViewBase")):
"""
Page view class.
"""
_PAGE_TITLE = "Python Web Framework"
def __init__... | |
<|file_name|>Json.py<|end_file_name|><|fim▁begin|>import warnings
warnings.filterwarnings( "ignore", message = "The sre module is deprecated, please import re." )
from simplejson import JSONEncoder
from datetime import datetime, date
class Json( JSONEncoder ):
def __init__( self, *args, **kwargs ):
JSONEncoder.... | |
<|file_name|>p114.rs<|end_file_name|><|fim▁begin|>//! [Problem 114](https://projecteuler.net/problem=114) solver.
#![warn(
bad_style,
unused,
unused_extern_crates,
unused_import_braces,
unused_qualifications,
unused_results
)]
use std::collections::HashMap;
fn get_cnt((n, m): (u32, u32), map:... | sum += 1; // all black block |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.