prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>sending_img_through_links.py<|end_file_name|><|fim▁begin|># coding: utf-8"
"""
Example demonstrating how to use the ``input_label`` to send images between
blocks.<|fim▁hole|>
Required hardware:
- Any camera
"""
import crappy
if __name__ == "__main__":
cam1 = crappy.blocks.Camera('Webcam')
dis = c... |
This mechanism is useful to perform fake tests by using using generated images
instead of cameras to read images. |
<|file_name|>soccer_ball.py<|end_file_name|><|fim▁begin|># Copyright 2019 The dm_control Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE... |
class SoccerBall(props.Primitive): |
<|file_name|>grpc_error_test.go<|end_file_name|><|fim▁begin|>/*
Copyright 2017 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
Unless req... | |
<|file_name|>address_gateway.py<|end_file_name|><|fim▁begin|>import re
import braintree
from braintree.address import Address
from braintree.error_result import ErrorResult
from braintree.exceptions.not_found_error import NotFoundError
from braintree.resource import Resource
from braintree.successful_result import Succ... | return SuccessfulResult({"address": Address(self.gateway, response["address"])})
elif "api_error_response" in response:
return ErrorResult(self.gateway, response["api_error_response"]) |
<|file_name|>qa_flysky_dumpsync.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Copyright 2012 <+YOU OR YOUR COMPANY+>.
#
# This 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, or... | |
<|file_name|>app.module.ts<|end_file_name|><|fim▁begin|>import { Store, StoreModule } from '@ngrx/store';
import { StoreDevtoolsModule } from '@ngrx/store-devtools';
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { HttpModule } from '@angular/http';
imp... | |
<|file_name|>interstitial_page_impl.cc<|end_file_name|><|fim▁begin|>// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "content/browser/frame_host/interstitial_page_impl.h"
#include <vector>
#in... | InterstitialPageImpl::UnderlyingContentObserver::UnderlyingContentObserver(
WebContents* web_contents,
InterstitialPageImpl* interstitial) |
<|file_name|>suite_teardown.py<|end_file_name|><|fim▁begin|>'''
Integration Test Teardown case
@author: Youyk
'''
import zstacklib.utils.linux as linux
import zstacklib.utils.http as http
import zstackwoodpecker.setup_actions as setup_actions
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.cle... | http.json_dump_post(testagent.build_http_path(host.managementIp_, host_plugin.DELETE_VLAN_DEVICE_PATH), cmd)
|
<|file_name|>plot-util.ts<|end_file_name|><|fim▁begin|>/*
* Lumeer: Modern Data Definition and Processing Platform
*
* Copyright (C) since 2017 Lumeer.io, s.r.o. and/or its affiliates.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License a... | max = numberValue;
}
}); |
<|file_name|>unmount_linux.go<|end_file_name|><|fim▁begin|>package bazilfuse
import (
"bytes"
"errors"
"os/exec"
)
func unmount(dir string) error {
cmd := exec.Command("fusermount", "-u", dir)
output, err := cmd.CombinedOutput()<|fim▁hole|> if err != nil {
if len(output) > 0 {
output = bytes.TrimRight(outpu... | |
<|file_name|>sync_provider.rs<|end_file_name|><|fim▁begin|>// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity 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, eith... | use parking_lot::RwLock;
use ethsync::{SyncProvider, EthProtocolInfo, SyncStatus, SyncState, PeerInfo, TransactionStats};
/// TestSyncProvider config. |
<|file_name|>editMapTestScene.py<|end_file_name|><|fim▁begin|>import os
import os.path
import sys
import pygame
from buffalo import utils
from buffalo.scene import Scene
from buffalo.label import Label
from buffalo.button import Button
from buffalo.input import Input
from buffalo.tray import Tray
from camera import ... | ),
)
self.tool_tray.render() |
<|file_name|>core.module.ts<|end_file_name|><|fim▁begin|>'use strict';
namespace dogsrus.virtdog {
(() => {
angular.module('app.core', [
/*
* Angular modules
*/
'ngRoute'
/*
* Our reusable cross app code modules
*/
// exception service, logger service
... | }
} |
<|file_name|>BaseController__query_values.go<|end_file_name|><|fim▁begin|>package controllers
import (
"net/url"
"strconv"
"strings"
)
func (this *BaseController) GetOptionalQueryValueBoolean(queryKey string, defaultVal bool) (hadQueryValue bool, boolVal bool) {
escapedQueryValue := this.Ctx.Input.Query(queryKey)... | func (this *BaseController) GetOptionalQueryValueString(queryKey, defaultVal string) (bool, string) {
escapedQueryValue := this.Ctx.Input.Query(queryKey)
if escapedQueryValue == "" {
return false, defaultVal |
<|file_name|>pie.rs<|end_file_name|><|fim▁begin|>use std::f32::consts;
use graph::{Graph, Tools, Coord, Padding, HTML, Size};
use entry::Entry;
pub struct PieBuilder {
width: f32,
height: f32,
entries: Option<Vec<Entry>>,
}
impl PieBuilder {
pub fn new() -> PieBuilder {
PieBuilder {
... | ];
if i >= colors.len() { |
<|file_name|>background_datastore.rs<|end_file_name|><|fim▁begin|>use rand;
use rand::distributions::*;
use structures;
use constants::*;
use GameUpdateArgs;
pub struct BackgroundDatastore<'a>
{
buffer_data: &'a mut [structures::BackgroundInstance; MAX_BK_COUNT],
instance_data: &'a mut [u32; MAX_BK_COUNT]
}
impl <'a... | self.buffer_data[i].scale = [scale, scale, 1.0f32, 1.0f32]; |
<|file_name|>_ualib_imageCarousel.js<|end_file_name|><|fim▁begin|>angular.module('ualib.imageCarousel', ['angular-carousel'])
.constant('VIEW_IMAGES_URL', '//wwwdev2.lib.ua.edu/erCarousel/api/slides/active')
.factory('imageCarouselFactory', ['$http', 'VIEW_IMAGES_URL', function imageCarouselFactory($http, url)... | |
<|file_name|>base.py<|end_file_name|><|fim▁begin|>from math import sqrt
from datetime import datetime
from dexter.models import db, Document, Person
from sqlalchemy.sql import func<|fim▁hole|>
class BaseAnalyser(object):
"""
Base for analyser objects that handles a collection of
documents to analyse, bas... | from sqlalchemy.orm import joinedload |
<|file_name|>tutorial03-curved_polys.py<|end_file_name|><|fim▁begin|>#!PYRTIST:VERSION:0:0:1
from pyrtist.lib2d import Point, Tri
#!PYRTIST:REFPOINTS:BEGIN
bbox1 = Point(0.0, 50.0); bbox2 = Point(100.0, 12.5838926174)
p1 = Point(3.15540458874, 46.942241204)
p2 = Point(3.23537580547, 42.1395946309)
p4 = Point(28.5119375... | s, "Click on the left button of the mouse\n",
"STEP 4: repeat step 3 to create other 3 vertices. You should see\n",
s, "a black polygon with straight boundaries\n",
"STEP 5: move the mouse over one of the vertices. Press the CTRL\n", |
<|file_name|>SymbolLoader.java<|end_file_name|><|fim▁begin|>package oo.Prototype;
/*
* A Symbol Loader to register all prototype instance<|fim▁hole|>import java.util.*;
public class SymbolLoader {
private Hashtable symbols = new Hashtable();
public SymbolLoader() {
symbols.put("Line", new LineSy... | */ |
<|file_name|>foreign.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/li... | |
<|file_name|>activities.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# * Authors:
# * TJEBBES Gaston <g.t@majerti.fr>
# * Arezki Feth <f.a@majerti.fr>;
# * Miotte Julien <j.m@majerti.fr>;
import os
from pyramid.httpexceptions import HTTPFound
from autonomie.forms.admin import (
Activity... | actions = query.filter_by(active=True)
|
<|file_name|>HtmlClipboardFormat.py<|end_file_name|><|fim▁begin|># Copyright (c) 2008, Humanized, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source co... | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""
|
<|file_name|>test_signal.py<|end_file_name|><|fim▁begin|># Test quiver-time
import keras as ks
from quiver_engine import server
import sys
# Load model
if sys.version_info.major == 2:<|fim▁hole|> model = ks.models.load_model('models/my_bestmodel.h5')
elif sys.version_info.major == 3:
model = ks.models.load_mode... | |
<|file_name|>Relations.js<|end_file_name|><|fim▁begin|>module.exports = {
'handles belongsTo (blog, site)': {
mysql: {
result: {
id: 2,
name: 'bookshelfjs.org'
}
},
postgresql: {
result: {
id: 2,
name: 'bookshelfjs.org'
}
},
sqlite3: {
... | }]
},{
id: 2,
site_id: 1, |
<|file_name|>demo3.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import pexpect
import sys
import logging
import vt102
import os
import time
def termcheck(child, timeout=0):
time.sleep(0.05)
try:
logging.debug("Waiting for EOF or timeout=%d"%timeout)
child.expect(pexpect.EOF, timeout=timeout)
except pexpe... | |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>use std::collections::HashSet;
fn main() {
struct PentNums {
n: usize,
curr: usize
}<|fim▁hole|> if index == 0 {
return PentNums{n: index, curr: 0};
}
PentNums{n: index, curr: PentNums::get(ind... |
impl PentNums {
fn new(index: usize) -> PentNums { |
<|file_name|>cleanupslides.py<|end_file_name|><|fim▁begin|>from django.core.management.base import NoArgsCommand
from django.conf import settings
class Command(NoArgsCommand):
help = "Removes CompSlides from the database that do not have matching files on the drive."
def handle_noargs(self, **options):<|fim... | |
<|file_name|>stateWithExternalTypeAndDirectImport.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>import { MyMap, IMapState } from './stateWithType';
export interface IApplicationState extends bf.IState {
someExternalMap: MyMap;
externalState: IMapState;
}<|fim▁end|> | import * as bf from 'bobflux'; |
<|file_name|>namespace_linux.go<|end_file_name|><|fim▁begin|>package sandbox
import (
"fmt"
"net"
"os"
"os/exec"
"runtime"
"sync"
"syscall"
"time"
log "github.com/Sirupsen/logrus"
"github.com/docker/docker/pkg/reexec"
"github.com/vishvananda/netlink"
"github.com/vishvananda/netns"
)
const prefix = "/var/... | |
<|file_name|>FlashOn.js<|end_file_name|><|fim▁begin|>import React from 'react';
import IconBase from '@suitejs/icon-base';
function MdFlashOn(props) {
return (
<IconBase viewBox="0 0 48 48" {...props}>
<polygon points="14 4 14 26 20 26 20 44 34 20 26 20 34 4" />
</IconBase>
);
}<|fim▁hole|>
export de... | |
<|file_name|>post_listfield_item_listfield.py<|end_file_name|><|fim▁begin|>import unittest
import json
from datetime import datetime
from pymongo import MongoClient
from apps.basic_resource import server
from apps.basic_resource.documents import Article, Comment, Vote
class ResourcePostListFieldItemListField(unittest... | text="Test comment old",
email="test@example.com",
upvotes=[ |
<|file_name|>functions_a.js<|end_file_name|><|fim▁begin|>var searchData=
[<|fim▁hole|><|fim▁end|> | ['takeoff',['takeOff',['../class_flight_controller.html#a514f2619b98216e9fca0ad876d000966',1,'FlightController']]]
]; |
<|file_name|>Search.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
###############################################################################
#
# Search
# Returns current committees, subcommittees, and their membership.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under ... | # |
<|file_name|>ext.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from datetime import timedelta, datetime
import asyncio
import random
from .api import every, once_at, JobSchedule, default_schedule_manager
__all__ = ['every_day', 'every_week', 'every_monday', 'every_tuesday', 'every_wednesday',
'eve... | |
<|file_name|>test_net.py<|end_file_name|><|fim▁begin|>import unittest
"""
Test for the local and the web html page for table table generation
"""
class TestNET(unittest.TestCase):
def test_net(self):
pass
<|fim▁hole|><|fim▁end|> | if __name__ == "__main__":
unittest.main() |
<|file_name|>attack_plaidctf.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
import sys
import os
import deadpool_dfa
import phoenixAES
import binascii
def processinput(iblock, blocksize):
#p=b'%0*x' % (2*blocksize, iblock) # Requires python3.5
p=('%0*x' % (2*blocksize, iblock)).encode('utf8')
ope... | for trace in tracefiles_sets[1]:
if phoenixAES.crack_file(trace, encrypt=False):
break |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>from django.contrib import admin
from tsj.models import *
admin.site.register(Company)
admin.site.register(Resident)<|fim▁hole|>admin.site.register(MeterReadingHistory)
admin.site.register(Employer)
admin.site.register(Notification)<|fim▁end|> | admin.site.register(House)
admin.site.register(ServiceCompany)
admin.site.register(MeterType) |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LI... |
// Do not remove on snapshot creation. Needed for bootstrap. (Issue #22364)
#![cfg_attr(stage0, feature(custom_attribute))]
#![crate_name = "alloc"] |
<|file_name|>test_decibel.py<|end_file_name|><|fim▁begin|>from acoustics.decibel import *
def test_dbsum():
assert(abs(dbsum([10.0, 10.0]) - 13.0103) < 1e-5)
<|fim▁hole|>def test_dbadd():
assert(abs(dbadd(10.0, 10.0) - 13.0103) < 1e-5)
def test_dbsub():
assert(abs(dbsub(13.0103, 10.0) - 10.0) < 1e-5)
def... | def test_dbmean():
assert(dbmean([10.0, 10.0]) == 10.0)
|
<|file_name|>zoom-dom.ts<|end_file_name|><|fim▁begin|>import { fullSrc } from '../element/element';
import { pixels } from '../math/unit';
import { Clone } from './clone';
import { Container } from './container';
import { Image } from './image';
import { Overlay } from './overlay';
import { Wrapper } from './wrapper';
... | }
appendImageToContainer(): void {
this.container.element.appendChild(this.image.element); |
<|file_name|>jade.js<|end_file_name|><|fim▁begin|>var gulp = require('gulp');
var jade = require('gulp-jade');
var config = require('../../config');
<|fim▁hole|> gulp.src(config.samples.jade.src)
.pipe(jade({}))
.pipe(gulp.dest(config.samples.html.dest));
});<|fim▁end|> | gulp.task('samples:jade', function () { |
<|file_name|>Promise.js<|end_file_name|><|fim▁begin|>// **********************************************************************
//
// Copyright (c) 2003-2015 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
/... | });
return promise;
},
exception: function(onException) |
<|file_name|>DATAXFER.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2017 Trail of Bits, 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/license... | auto src2_vec = FReadV32(src2);
float32v4_t temp_vec = {};
temp_vec = FInsertV32(temp_vec, 0, FExtractV32(src1_vec, 0)); |
<|file_name|>sleeper.py<|end_file_name|><|fim▁begin|>import os
import sys
import time
import itertools
def get_sleeper():
if os.isatty(sys.stdout.fileno()):
return PrettySleeper()
return Sleeper()
_PROGRESS_WIDTH = 50
_WATCHING_MESSAGE = "Watching for changes... "
_PROGRESS_BAR = [
_WATCHING_MESSA... |
class PrettySleeper(object):
def __init__(self): |
<|file_name|>database.cc<|end_file_name|><|fim▁begin|>#include <string.h>
#include <node.h>
#include "macros.h"
#include "database.h"
#include "statement.h"
using namespace node_sqlite3;
Persistent<FunctionTemplate> Database::constructor_template;
void Database::Init(Handle<Object> target) {
NanScope();
Lo... | |
<|file_name|>imgsearch.py<|end_file_name|><|fim▁begin|>import os, sys, argparse
from os import listdir
from os.path import isfile, join
from os import walk
from dd_client import DD
from annoy import AnnoyIndex
import shelve
import cv2
parser = argparse.ArgumentParser()
parser.add_argument("--index",help="repository of... | near_names.append(s[str(n)])
print near_names
cv2.imshow('query',image_resize(args.search,224.0)) |
<|file_name|>vc_usd_nt.py<|end_file_name|><|fim▁begin|>#
# Copyright (c) 2017 Sugimoto Takaaki
#
# 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... |
# dictionary of api url
d = OrderedDict() |
<|file_name|>TestEvents.js<|end_file_name|><|fim▁begin|>'use strict';
var assert = require('assert')
, TestEvents = require('../lib/TestEvents');
var wasCalled = false;
var FN = function (ev) {
wasCalled = true;
};
describe('TestEvents', function () {
beforeEach(function () {
wasCalled = false;
});
d... | |
<|file_name|>FunctionReturnType.py<|end_file_name|><|fim▁begin|>from typing import Optional, List
def a(x):
# type: (List[int]) -> List[str]
return <warning descr="Expected type 'List[str]', got 'List[List[int]]' instead">[x]</warning>
def b(x):
# type: (int) -> List[str]
return <warning descr="Expect... | |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>'use strict';
var util = require('util')
, yeoman = require('yeoman-generator')
, github = require('../lib/github')
, path = require('path')
, inflect = require('inflect');
var BBBGenerator = module.exports = function BBBGenerator(args, options, config... | default: '0.1.0'
}]; |
<|file_name|>commands.py<|end_file_name|><|fim▁begin|>import re, shlex
<|fim▁hole|>
from hangupsbot.utils import text_to_segments
from hangupsbot.handlers import handler, StopEventHandling
from hangupsbot.commands import command
default_bot_alias = '/bot'
def find_bot_alias(aliases_list, text):
"""Return True i... | import hangups |
<|file_name|>no.js<|end_file_name|><|fim▁begin|><|fim▁hole|> For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang("widget","no",{move:"Klikk og dra for å flytte",label:"%1 widget"});<|fim▁end|> | /*
Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. |
<|file_name|>mail.py<|end_file_name|><|fim▁begin|># Copyright 2018 Google LLC. 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.apache.org/licenses/LICEN... | if sender_name: |
<|file_name|>main.py<|end_file_name|><|fim▁begin|>import tensorflow as tf
import tensorflow.contrib.slim as slim
import pprint
import os
from datasets import dataset_factory
from dcgan import dcgan_generator, dcgan_discriminator
from train import dcgan_train_step
from tensorflow.python.training import optimizer
from ... | |
<|file_name|>UnmarshalProcessorTest.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... | |
<|file_name|>ui.py<|end_file_name|><|fim▁begin|>import os
import pygtk
pygtk.require('2.0')
import gtk
from gtkcodebuffer import CodeBuffer, SyntaxLoader
class Ui(object):
"""
The user interface. This dialog is the LaTeX input window and includes
widgets to display compilation logs and a preview. It use... | # This is our main container, vertically ordered.
self.box_container = gtk.VBox(False, 5)
self.box_container.show() |
<|file_name|>page.cc<|end_file_name|><|fim▁begin|>#include "page.h"
using namespace AhoViewer::Booru;
#include "curler.h"
#include "image.h"
#include "settings.h"
#include "site.h"
#include "threadpool.h"
#include <glibmm/i18n.h>
#include <iostream>
#define RETRY_COUNT 5
void Page::CellRendererThumbnail::get_prefer... | {
tags += " -rating:explicit";
} |
<|file_name|>PRESUBMIT.py<|end_file_name|><|fim▁begin|># Copyright 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Presubmit script for changes affecting tools/perf/.
See http://dev.chromium.org/developers/how-tos... | for affected_file in change.AffectedFiles():
affected_file_path = affected_file.LocalPath()
file_path, _ = os.path.splitext(affected_file_path) |
<|file_name|>test_all.rs<|end_file_name|><|fim▁begin|>//! A compiler from an LR(1) table to a [recursive ascent] parser.
//!
//! [recursive ascent]: https://en.wikipedia.org/wiki/Recursive_ascent_parser
use grammar::repr::{Grammar, NonterminalString, TypeParameter};
use lr1::core::*;
use rust::RustWrite;
use std::io::... | .filter(|&tp| match *tp { |
<|file_name|>fib.py<|end_file_name|><|fim▁begin|>def fib_recursive(n):
"""[summary]
Computes the n-th fibonacci number recursive.
Problem: This implementation is very slow.
approximate O(2^n)
Arguments:
n {[int]} -- [description]
Returns:
[int] -- [description]
"""
... | list_results.append(list_results[i-1] + list_results[i-2]) |
<|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 g... | // Fast path: No need to create a pattern.
if bounds.size == *stretch_size { |
<|file_name|>OperatorExpression.java<|end_file_name|><|fim▁begin|>package org.poormanscastle.studies.compilers.grammar.grammar3_1.astparser.ast;
import org.poormanscastle.studies.compilers.utils.grammartools.ast.CodePosition;
/**
* Created by georg on 15.01.16.
*/
public class OperatorExpression extends AbstractAst... |
@Override
public boolean handleProceedWith(AstItemVisitor visitor) { |
<|file_name|>rest_client.py<|end_file_name|><|fim▁begin|>import time
import requests
from .exceptions import HttpError
from .json import json_loads
def check_rep(rep):
if (rep.status_code // 100) != 2:
raise HttpError(rep.text, rep.status_code)
def rep_to_json(rep):
check_rep(rep)
# we use our ... | rep = self.session.get( |
<|file_name|>lexer.js<|end_file_name|><|fim▁begin|>/*
* THIS FILE IS AUTO GENERATED FROM 'lib/lex/lexer.kep'
* DO NOT EDIT
*/
define(["require", "exports", "bennu/parse", "bennu/lang", "nu-stream/stream", "ecma-ast/token", "ecma-ast/position",
"./boolean_lexer", "./comment_lexer", "./identifier_lexer", "./line_te... | |
<|file_name|>__main__.py<|end_file_name|><|fim▁begin|>"""__Main__."""
import sys
import os
import logging
import argparse
import traceback
import shelve
from datetime import datetime
from CONSTANTS import CONSTANTS
from settings.settings import load_config, load_core, load_remote, load_email
from settings.settings impo... | |
<|file_name|>retorno.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from django.db import models
from Corretor.base import CorretorException
from Corretor.base import ExecutorException
from Corretor.base import CompiladorException
from Corretor.base import ComparadorException
from Corretor.base import LockExc... | tipo = RetornoCorrecao.TIPOS.compilacao
if isinstance(erroException,ComparadorException): |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#
# Copyright (c) 2010 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A ... | # in this software or its documentation.
#
# |
<|file_name|>client.go<|end_file_name|><|fim▁begin|>package gatt
import (
"encoding/binary"
"fmt"
"log"
"sync"
"github.com/currantlabs/ble"
"github.com/currantlabs/ble/linux/att"
)
const (
cccNotify = 0x0001
cccIndicate = 0x0002
)
// NewClient returns a GATT Client.
func NewClient(conn ble.Conn) (*Client,... | |
<|file_name|>mappingMaker.js<|end_file_name|><|fim▁begin|>'use strict';
const inflect = require('i')();
const _ = require('lodash');
const Promise = require('bluebird');
const fs = Promise.promisifyAll(require('fs'));
const options = {
adapter: 'mongodb',
connectionString: 'mongodb://127.0.0.1:27017/testDB',
db:... | };
cursor[propertyName] = {
type: 'string',
index: 'not_analyzed' |
<|file_name|>webglshaderprecisionformat.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/. */
// https://www.khronos.org/registry/webgl/... |
fn RangeMax(self) -> i32 {
self.range_max |
<|file_name|>libxml.js<|end_file_name|><|fim▁begin|>const express = require('express');
const libxmljs = require('libxmljs');
express().get('/some/path', function(req) {<|fim▁hole|> libxmljs.parseXml(req.param("some-xml"));
});<|fim▁end|> | // OK: libxml does not expand entities by default |
<|file_name|>CategoryManagerImpl.java<|end_file_name|><|fim▁begin|>package hska.iwi.eShopMaster.model.businessLogic.manager.impl;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.sun.jersey.api.client.Client;
import com.sun.jersey.api.client.ClientResponse;
import com.sun.jersey.api.client.WebResource;
... | .header("usr", currentUser.getUsername())
.header("pass", currentUser.getPassword()) |
<|file_name|>numpy2go.py<|end_file_name|><|fim▁begin|>import numpy as np
import ctypes
import numpy.ctypeslib as npct<|fim▁hole|># https://scipy-lectures.github.io/advanced/interfacing_with_c/interfacing_with_c.html#id5
numpy2go = npct.load_library("numpy2go", ".")
array_1d_double = npct.ndpointer(dtype=np.double... |
# For more information see: |
<|file_name|>messages.js<|end_file_name|><|fim▁begin|>/*
* Returns Messages
*
* This contains all the text for the Returns component.
*/
import { defineMessages } from 'react-intl';
export default defineMessages({
header: {
id: 'app.components.Returns.header',
defaultMessage: 'returns',
},
returnPoli... | id: 'app.components.Returns.returnPolicy',
defaultMessage: 'Return Policy',
}, |
<|file_name|>WinEventsWayland.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2005-2013 Team XBMC
* http://xbmc.org
*
* 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|>match-vec-unreachable.rs<|end_file_name|><|fim▁begin|>fn main() {
let x: ~[(int, int)] = ~[];
match x {
[a, (2, 3), _] => (),
[(1, 2), (2, 3), b] => (), //~ ERROR unreachable pattern
_ => ()
}
match [~"foo", ~"bar", ~"baz"] {
[a, _, _, .._] => { println(a); ... | _ => { } |
<|file_name|>actorRegistry.ts<|end_file_name|><|fim▁begin|>/**
* Holds instances to Actor classes for instantiation
*/
import { ActorType } from '../../actor/actor';
/* tslint:disable-next-line interface-over-type-literal */
type ActorRegister = { [actorClassName: string]: ActorType };
export class ActorRegistry {... | * @param {string} actor - The string name of the actor class
* @return {ActorType} - The actor class, or throw
*/ |
<|file_name|>spatial_query.hpp<|end_file_name|><|fim▁begin|>// Boost.Geometry Index
//
// R-tree spatial query visitor implementation
//
// Copyright (c) 2011-2014 Adam Wulkiewicz, Lodz, Poland.
//
// This file was modified by Oracle on 2019-2021.
// Modifications copyright (c) 2019-2021 Oracle and/or its affiliates.
/... | } |
<|file_name|>GHRelease.java<|end_file_name|><|fim▁begin|>package org.kohsuke.github;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.net.URLEncoder;
import java.util... | * Upload asset gh asset.
*
* @param filename |
<|file_name|>node_style.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/. */
// Style retrieval from DOM elements.
use css::node_util:... | self.get_css_select_results()
} |
<|file_name|>loadtrain.py<|end_file_name|><|fim▁begin|>import numpy as np
import fnmatch, os
import h5py
class Hdf5Loader():
def loadDirectory(self, dirname):
"""
Loads all hdf5 files in the directory dirname
@param dirname: The directory which contains the files to load
... | fd.readline()
count = len(fd.readline().split(self.sep))
|
<|file_name|>salt-call.py<|end_file_name|><|fim▁begin|>__author__ = 'Jason Mehring'
#
# This module is only used with WingIDE debugger for testing code within
# The debugging environment
#
# Stage 1: bind /srv/...modules to cache/extmods. No sync will take place
# since files are bound
# BIND
# True : bi... | _bind('outputters', umount=umount)
_bind('utils', umount=umount)
if __name__ == '__main__': |
<|file_name|>sparkline.rs<|end_file_name|><|fim▁begin|>use std::fmt;
pub struct Ascii {
min: f64,
max: f64,
data: Vec<f64>,
step: usize,
}
impl Ascii {
pub fn new(min: f64, max: f64, data: Vec<f64>, step: usize) -> Self {
Self {<|fim▁hole|> step,
}
}
}
impl fmt::Dis... | min,
max,
data, |
<|file_name|>parser.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/. */
use attr::{AttrSelectorWithNamespace, ParsedAttrSelectorOperat... | // https://github.com/servo/servo/issues/15335 |
<|file_name|>gapic_batch_controller_v1.ts<|end_file_name|><|fim▁begin|>// 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 at
//
// https://www.apache.org/licens... | const client = new batchcontrollerModule.v1.BatchControllerClient({ |
<|file_name|>Computer.js<|end_file_name|><|fim▁begin|>import Off from './Off';
import On from './On';
// ==============================
// CONCRETE CONTEXT
// ==============================
export default class Computer {
constructor() {
this._currentState = null;
this._states = {
off:... | getCurrentState() { |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|># ===========================================================================
# This file contain some utilities for the course
# ===========================================================================
from __future__ import print_function, division, absolute_impor... | |
<|file_name|>SrcAbsoluteURLRule.js<|end_file_name|><|fim▁begin|>'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
// This is a very simple test, and could be made more robust.
// All we do is check for the presence of "http://" or "https://"<|fim▁hole|>// at the start of the string.
var d... | |
<|file_name|>mobile-detect.js<|end_file_name|><|fim▁begin|>define(["mobile-detect"], function(MobileDetect){
function Factory(){
var md = new MobileDetect(window.navigator.userAgent);<|fim▁hole|> return md.mobile();
}
};
}
return [Factory];
});<|... |
return {
isMobile : function(){ |
<|file_name|>jquery-extend.js<|end_file_name|><|fim▁begin|>define('util', ['jquery'], function($){
$.extend({
restGet: function(url, data, callback){
$.get(url, data, function(data){
if(data.success){
callback(data);
} else {
if(data.redirect){
location.href = data.redirect;
... | if(data.redirect){
location.href = data.redirect;
|
<|file_name|>TestPojoPageTwo.java<|end_file_name|><|fim▁begin|>/**
* CommonFramework
*
* Copyright (C) 2017 Black Duck Software, Inc.
* http://www.blackducksoftware.com/
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed wit... | */
public void setValue2page2(String value2page2) { |
<|file_name|>enumerations.py<|end_file_name|><|fim▁begin|>#===- enumerations.py - Python LLVM Enumerations -------------*- python -*--===#
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
#===----... | ('Call', 45),
('Select', 46),
('UserOp1', 47), |
<|file_name|>autocomplete_test.py<|end_file_name|><|fim▁begin|># coding: utf-8
# Copyright (c) 2001-2018, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# powered by Canal TP (www.canaltp.fr).
# Help us simplify ... | assert resp['admin_level'] == [8]
|
<|file_name|>settings.controller.js<|end_file_name|><|fim▁begin|>'use strict';
angular.module('refugeesApp')<|fim▁hole|> .controller('SettingsController', function ($scope, Principal, Auth, Language, $translate) {
$scope.success = null;
$scope.error = null;
Principal.identity().then(function... | |
<|file_name|>TrackSubscriber1.java<|end_file_name|><|fim▁begin|><|fim▁hole|>import java.util.concurrent.TimeUnit;
import rx.*;
import rx.plugins.RxJavaHooks;
import rx.schedulers.Schedulers;
public class TrackSubscriber1 {
@SuppressWarnings("unchecked")
public static void main(String[] args) throws Exception... | package hu.akarnokd.rxjava;
|
<|file_name|>test_stft.py<|end_file_name|><|fim▁begin|>import numpy as np
from scipy import linalg
from numpy.testing import assert_almost_equal, assert_array_almost_equal
from nose.tools import assert_true
from mne.time_frequency.stft import stft, istft, stftfreq, stft_norm2
def test_stft():
"Test stft and istf... |
assert_array_almost_equal(x, xp, decimal=6) |
<|file_name|>CommandException.java<|end_file_name|><|fim▁begin|>/*
* JasperReports - Free Java Reporting Library.
* Copyright (C) 2001 - 2014 TIBCO Software Inc. All rights reserved.
* http://www.jaspersoft.com
*
* Unless you have purchased a commercial license agreement from Jaspersoft,
* the following license t... | |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from catkin_pkg.python_setup import generate_distutils_setup
from setuptools import setup
d = generate_distutils_setup(
packages=['catkin'],
package_dir={'': 'python'},
scripts=[
'bin/catkin_find',<|fim▁hole|> 'bin/catkin_make_isolated',
... | 'bin/catkin_init_workspace',
'bin/catkin_make', |
<|file_name|>findModel.test.ts<|end_file_name|><|fim▁begin|>/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*---... | findState.change({ searchString: 'hello', replaceString: 'hi', wholeWord: true }, false);
let findModel = new FindModelBoundToEditorModel(editor, findState);
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.