prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>CpuSpyApp.java<|end_file_name|><|fim▁begin|>//-----------------------------------------------------------------------------
//
// (C) Brandon Valosek, 2011 <bvalosek@gmail.com>
//
//-----------------------------------------------------------------------------
// Modified by Willi Ye to work with big.LITTLE... | @Override
public void onCreate() {
super.onCreate();
loadOffsets(getApplicationContext()); |
<|file_name|>test_edit_contact.py<|end_file_name|><|fim▁begin|>from model.contact import Contact
from random import randrange
def test_edit_contact(app, db, check_ui):
if len(db.get_contact_list()) == 0:
app.contact.create(Contact(first_name ="Sabina", last_name="test", company="Pewex",
... | contact.id = old_contact[index].id
app.contact.edit_contact_by_index(index, contact) |
<|file_name|>pipe.rs<|end_file_name|><|fim▁begin|>//!
//! Desync pipes provide a way to generate and process streams via a `Desync` object
//!
//! Pipes are an excellent way to interface `Desync` objects and the futures library. Piping
//! a stream into a `Desync` object is equivalent to spawning it with an executor, ... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-<|fim▁hole|><|fim▁end|> | # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from . import test_account_payment_transfer_reconcile_batch |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python<|fim▁hole|>.. moduleauthor:: Pat Daburu <pat@daburu.net>
Provide a brief description of the module.
"""<|fim▁end|> | # -*- coding: utf-8 -*-
"""
.. currentmodule:: __init__.py |
<|file_name|>resource.py<|end_file_name|><|fim▁begin|>import hashlib
import inspect
import json
import logging
import re
from xml.sax.saxutils import escape as xml_escape
import webob
from wsgiservice import xmlserializer
from wsgiservice.decorators import mount
from wsgiservice.exceptions import (MultiValidationExcep... | var emap = this.resource.properties.EXTENSION_MAP;
for (extension in emap) {
mimes.push(emap[extension]); |
<|file_name|>classifier.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author: Enrique Henestroza Anguiano
#
"""
Classifier for liblinear, svmlin. Agnostic about features or labels. Uses
'ranking', or dynamic classes.
"""
import sys
import os
import codecs
import svmlight
from libsv... | # 1 qid:1 1:1 2:-1 5:-1
# 0 qid:1 1:-1 2:1 4:-1
elif self._classtype in ["structured", "percrank"]:
for idxg,ex in examples: |
<|file_name|>omni.py<|end_file_name|><|fim▁begin|>"""
Methods for importing data from the OMNI.
"""
from heliopy.data import cdasrest
def _docstring(identifier, description):
return cdasrest._docstring(identifier, 'O', description)
def _omni(starttime, endtime, identifier, intervals='monthly',
warn_mi... | intervals='monthly')
|
<|file_name|>hls.js<|end_file_name|><|fim▁begin|>typeof window !== "undefined" &&
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define([], factory);
else if(... | clearCurrentCues(this.id3Track);
this.id3Track = undefined;
this.media = undefined; |
<|file_name|>docscrape.py<|end_file_name|><|fim▁begin|>"""Extract reference documentation from the NumPy source tree.
"""
import inspect
import textwrap
import re
import pydoc
from io import StringIO
from warnings import warn
import collections
class Reader(object):
"""A line-based string reader.
"""
... | return text + '\n' + style * len(text) + '\n'
class FunctionDoc(NumpyDocString): |
<|file_name|>en.js<|end_file_name|><|fim▁begin|>/*
* /MathJax-v2/localization/en/en.js
*
* Copyright (c) 2009-2018 The MathJax Consortium
*
* 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 Lice... | MathJax.Localization.addTranslation("en",null,{menuTitle:"English",version:"2.7.8",isLoaded:true,domains:{_:{version:"2.7.8",isLoaded:true,strings:{CookieConfig:"MathJax has found a user-configuration cookie that includes code to be run. Do you want to run it?\n\n(You should press Cancel unless you set up the cookie yo... |
<|file_name|>package.js<|end_file_name|><|fim▁begin|>/* global Package, Npm */
Package.describe({
name: 'procempa:keycloak-auth',
version: '1.0.0',
summary: 'Meteor Keycloak Handshake flow',
git: 'https://github.com/Procempa/meteor-keycloak-auth.git',
documentation: 'README.md'
});
Package.onUse(function(api) {
... | |
<|file_name|>iron_hippo.go<|end_file_name|><|fim▁begin|>package iron_hippo_exe
import (
"fmt"
"io"
"net/http"
"golang.org/x/oauth2"
"golang.org/x/oauth2/google"
"google.golang.org/appengine"
"google.golang.org/appengine/log"
"google.golang.org/appengine/urlfetch"
)
const ProjectID = "cpb101demo1"
type Data... | } `json:"environment"`
}
func init() { |
<|file_name|>aso_bin_log.go<|end_file_name|><|fim▁begin|>package service
import (
"context"
"encoding/json"
"strconv"
"time"<|fim▁hole|> "go-common/app/job/main/passport-game-local/model"
"go-common/library/log"
"go-common/library/queue/databus"
)
func (s *Service) asobinlogconsumeproc() {
mergeNum := int64(s.... | |
<|file_name|>GrayCompositeConverter.java<|end_file_name|><|fim▁begin|>/**
* Logback: the reliable, generic, fast and flexible logging framework.
* Copyright (C) 1999-2015, QOS.ch. All rights reserved.
*
<|fim▁hole|> * or (per the licensee's choosing)
*
* under the terms of the GNU Lesser General Public Lice... | * This program and the accompanying materials are dual-licensed under
* either the terms of the Eclipse Public License v1.0 as published by
* the Eclipse Foundation
*
|
<|file_name|>qa_vector_map.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Copyright 2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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 So... | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License |
<|file_name|>progress_bar.cpp<|end_file_name|><|fim▁begin|>#include <progress_bar.hh>
PROGRESS_BAR
::
PROGRESS_BAR(int x, int y, int w, int h, void(*opf)(void), void(*orf)(void), int ea, int ia, int l)
:<|fim▁hole|> this->int_angle = ia;
this->level = l;
}<|fim▁end|> | WIDGET(x,y,w,h,opf,orf)
{
this->ext_angle = ea; |
<|file_name|>album_endpoints.py<|end_file_name|><|fim▁begin|>import flask; from flask import request
import os
import urllib.parse
from voussoirkit import flasktools
from voussoirkit import gentools
from voussoirkit import stringtools
import etiquette
from .. import common
site = common.site
session_manager = commo... | |
<|file_name|>exp_XGB_CF_tc_mb_mf_ntree.py<|end_file_name|><|fim▁begin|>"""
Experiment for XGBoost + CF
Aim: To find the best tc(max_depth), mb(min_child_weight), mf(colsample_bytree * 93), ntree
tc: [13, 15, 17]
mb: [5, 7, 9]
mf: [40, 45, 50, 55, 60]
ntree: [160, 180, 200, 220, 240, 260, 280, 300, 320, 340, 360]
Avera... | kf = StratifiedKFold(y, n_folds=5, shuffle = True, random_state = 345) |
<|file_name|>vcpw15-5.py<|end_file_name|><|fim▁begin|># vcpw15-5.py
# Memory Puzzle
# Original By Al Sweigart al@inventwithpython.com
# http://inventwithpython.com/pygame
# Released under a "Simplified BSD" license
import random, pygame, sys
from pygame.locals import *
FPS = 30 # frames per second, the gener... | assert (BOARDWIDTH * BOARDHEIGHT) % 2 == 0, 'Board needs to have an even number of boxes for pairs of matches.'
XMARGIN = int((WINDOWWIDTH - (BOARDWIDTH * (BOXSIZE + GAPSIZE))) / 2)
YMARGIN = int((WINDOWHEIGHT - (BOARDHEIGHT * (BOXSIZE + GAPSIZE))) / 2)
|
<|file_name|>htmldialogelement.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 crate::dom::bindings::cell::DomRefCell;
use cr... | |
<|file_name|>default.py<|end_file_name|><|fim▁begin|>import os,sys,urllib2
import xbmcplugin,xbmcgui
import xml.etree.ElementTree as ET
__addon__ = "SomaFM"
__addonid__ = "plugin.audio.somafm"
__version__ = "0.0.2"
def log(msg):
print "[PLUGIN] '%s (%s)' " % (__addon__, __version__) + str(msg)
log("In... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from django.conf import settings
def MAX_USERNAME_LENGTH():
return getattr(settings, "MAX_USERNAME_LENGTH", 255)
def MAX_EMAIL_LENGTH():
return getattr(settings, "MAX_EMAIL_LENGTH", 255)
<|fim▁hole|>
def REQUIRE_UNIQUE_EMAIL():
return getattr(setting... | |
<|file_name|>SearchLayoutButton.js<|end_file_name|><|fim▁begin|>/**
* Copyright IBM Corp. 2016, 2018
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
import React, { Component } from 'react';
import PropTypes from 'prop-types';... | };
render() {
const { labelText, iconDescriptionList, iconDescriptionGrid } = this.props; |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>"""cmput404project URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to ... | from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.auth import views as auth_views |
<|file_name|>data.go<|end_file_name|><|fim▁begin|>package main<|fim▁hole|> "github.com/gokyle/adn"
"os"
"path/filepath"
)
const (
AppName = "The Social Gopher"
AppUnixName = "socialgopher"
AppVersion = "0.1"
)
var (
homeDir = os.ExpandEnv("${HOME}/." + AppUnixName)
authDatabaseFile = filepath.Joi... |
// store global values here
import ( |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""
Base backends structures.
This module defines base classes needed to define custom OpenID or OAuth
auth services from third parties. This customs must subclass an Auth and
and Backend class, check current implementation for examples.
Also the modules *must* de... | class OAuthBackend(SocialAuthBackend):
"""OAuth authentication backend base class.
EXTRA_DATA defines a set of name that will be stored in |
<|file_name|>cases.py<|end_file_name|><|fim▁begin|>import pingo
'''
In order to use this set of cases, it is necessary to set
the following attributes on your TestCase setUp:
self.analog_input_pin_number = 0
self.expected_analog_input = 1004
self.expected_analog_ratio = 0.98
'''
<|fim▁hole|> Wire a... | class AnalogReadBasics(object):
''' |
<|file_name|>sourcefilter.pipe.ts<|end_file_name|><|fim▁begin|>import { Pipe, PipeTransform} from '@angular/core';
@Pipe({
name: 'sourceFilter'
})
export class sourceFilter implements PipeTransform {
<|fim▁hole|> public regexp: RegExp;
public inputsource : string;
transform(value: any, args: any[]):... | |
<|file_name|>TestSyncGConfFolder.py<|end_file_name|><|fim▁begin|>#common sets up the conduit environment
from common import *
#setup test
test = SimpleSyncTest()
#Setup the key to sync
gconf = test.get_dataprovider("GConfTwoWay")
gconf.module.whitelist = ['/apps/metacity/general/num_workspaces']
folder = test.get_dat... |
finished() |
<|file_name|>cmd_listobj.cc<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2012 Stanford University
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.... | cmd_listobj(int argc, char * const argv[])
{
set<ObjectInfo> objects = repository.listObjects();
set<ObjectInfo>::iterator it; |
<|file_name|>libstdc++.a-gdb.py<|end_file_name|><|fim▁begin|># -*- python -*-
# Copyright (C) 2009 Free Software Foundation, Inc.
# 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 ... | pythondir = pythondir[len (prefix):]
libdir = libdir[len (prefix):] |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>mod map;<|fim▁hole|>
pub use map::{pos, Map, Pos};<|fim▁end|> | |
<|file_name|>bitcoin_id_ID.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="id_ID" version="2.1">
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About phreak</source>
<translation type="unfini... | <location line="+1"/>
<source>Output extra network debugging information</source>
<translation type="unfinished"/>
</message> |
<|file_name|>saveable_object.py<|end_file_name|><|fim▁begin|># Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.a... |
class SaveableObject(object):
"""Base class for saving and restoring saveable objects."""
|
<|file_name|>lightbox_plus.js<|end_file_name|><|fim▁begin|>// lightbox_plus.js
// == written by Takuya Otani <takuya.otani@gmail.com> ===
// == Copyright (C) 2006 SimpleBoxes/SerendipityNZ Ltd. ==
/*
Copyright (C) 2006 Takuya Otani/SimpleBoxes - http://serennz.cool.ne.jp/sb/
Copyright (C) 2006 SerendipityNZ - http://... | self._zoomimg.style.display = 'inline';
var check = self._current_setindex(); |
<|file_name|>ClusterLauncher.py<|end_file_name|><|fim▁begin|>import os
import sys
import time
import subprocess
import yaml
import pathlib
class ClusterLauncher:
def __init__(self, config_yaml):
self.Config = config_yaml
<|fim▁hole|>
#launch head node
head = ClusterLauncher.LaunchUn... | def Launch(self):
#read config
with open(self.Config, 'r') as yf:
config = yaml.safe_load(yf) |
<|file_name|>plotarea.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
# Copyright (c) 2010-2019 openpyxl
<|fim▁hole|> Alias,
)
from openpyxl.descriptors.excel import (
ExtensionList,
)
from openpyxl.descriptors.sequence import (
MultiSequence,
MultiSequencePart,
)
from openpyxl.des... | from openpyxl.descriptors.serialisable import Serialisable
from openpyxl.descriptors import (
Typed, |
<|file_name|>MentionExtractor.java<|end_file_name|><|fim▁begin|>package cmucoref.mention.extractor;
import cmucoref.document.Document;
import cmucoref.document.Lexicon;
import cmucoref.document.Sentence;
import cmucoref.exception.MentionException;
import cmucoref.mention.Mention;
import cmucoref.mention.eventextractor... | protected void markPredicateNominativeRelation(List<Mention> mentions, Sentence sent, RelationExtractor extractor) throws MentionException {
Set<Pair<Integer, Integer>> foundPairs = extractor.extractRelation(sent, mentions); |
<|file_name|>timeout.rs<|end_file_name|><|fim▁begin|>extern crate futures;
use futures::{Future, Poll};
use std::io;
use std::marker::PhantomData;
use std::time::{Duration, Instant};
pub struct Timeout<T,E> {
timestamp: Instant,
duration: Duration,
error: E,
phantom: PhantomData<T>,
}
impl<T,E> Timeo... | } else {
task::park().unpark(); // this tells the task driving the future to recheck this again |
<|file_name|>jslint-check.js<|end_file_name|><|fim▁begin|>load("build/jslint.js");
var src = readFile("dist/jquery.ImageColorPicker.js");
JSLINT(src, { evil: true, forin: true });
// All of the following are known issues that we think are 'ok'<|fim▁hole|>// http://docs.jquery.com/JQuery_Core_Style_Guidelines
var ok ... | // (in contradiction with JSLint) more information here: |
<|file_name|>js_JIzlcM6aM0LMxxWAo8iNMOVxFXtNamiOTTx6GLKu6cc.js<|end_file_name|><|fim▁begin|>/**
* @file
* Javascript for Goole Map widget of Geolocation field.
*/
(function ($) {
var geocoder;
Drupal.geolocation = Drupal.geolocation || {};
Drupal.geolocation.maps = Drupal.geolocation.maps || {};
Drupal.geol... | |
<|file_name|>inherit_stock_location.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2010-2012 Associazione OpenERP Italia
# (<http://www.openerp-italia.org>).
# Copyright (C) 2014 Didotech srl
# (<http:/... | # This program is distributed in the hope that it will be useful, |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import url, include
from django.contrib import admin
from django.conf import settings
from django.conf.urls.static import static
from api.views import router
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^', include(router.url... | static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) |
<|file_name|>twitter.py<|end_file_name|><|fim▁begin|><|fim▁hole|>import bitlyapi
import urllib2
import json
import re
from hasjob import app
@job('hasjob')
def tweet(title, url, location=None, parsed_location=None, username=None):
auth = OAuthHandler(app.config['TWITTER_CONSUMER_KEY'], app.config['TWITTER_CONSUME... | # -*- coding: utf-8 -*-
from flask.ext.rq import job
from tweepy import OAuthHandler, API |
<|file_name|>string_converter_python3.py<|end_file_name|><|fim▁begin|>from xcrawler.compatibility.string_converter.compatible_string_converter import CompatibleStringConverter
<|fim▁hole|>
class StringConverterPython3(CompatibleStringConverter):
"""A Python 3 compatible class for converting a string to a specified ... | |
<|file_name|>svnrepo.py<|end_file_name|><|fim▁begin|># #
# Copyright 2009-2016 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https... | raise EasyBuildError("Svn Client initialization failed.")
try: |
<|file_name|>15.4.4.17-7-c-iii-4.js<|end_file_name|><|fim▁begin|>// Copyright (c) 2012 Ecma International. All rights reserved.
// Ecma International makes this code available under the terms and conditions set<|fim▁hole|>/*---
es5id: 15.4.4.17-7-c-iii-4
description: >
Array.prototype.some - return value of callba... | // forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
// "Use Terms"). Any redistribution of this code must retain the above
// copyright and this notice and otherwise comply with the Use Terms.
|
<|file_name|>test_moveby.py<|end_file_name|><|fim▁begin|># This code is so you can run the samples without installing the package
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
#
testinfo = "s, t 3, s, t 6.1, s, q"
tags = "MoveBy"
import cocos
from cocos.director import directo... | def __init__(self):
super( TestLayer, self ).__init__() |
<|file_name|>util.py<|end_file_name|><|fim▁begin|>import tornado.web
import json
from tornado_cors import CorsMixin
from common import ParameterFormat, EnumEncoder
class DefaultRequestHandler(CorsMixin, tornado.web.RequestHandler):
CORS_ORIGIN = '*'
def initialize(self):
self.default_format = self.g... |
self.write(new_output)
|
<|file_name|>dom-debug.js<|end_file_name|><|fim▁begin|>/*
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.5.2
*/
/**
* The dom module provides helper methods for manipulating Dom elements.
* @module dom
*<|fim▁hole|> v... | */
(function() { |
<|file_name|>apps.py<|end_file_name|><|fim▁begin|>from django.apps import AppConfig
class JcvrbaseappConfig(AppConfig):<|fim▁hole|><|fim▁end|> | name = 'jcvrbaseapp' |
<|file_name|>derive_input_object.rs<|end_file_name|><|fim▁begin|>use fnv::FnvHashMap;
use juniper::{
marker, DefaultScalarValue, FromInputValue, GraphQLInputObject, GraphQLType, GraphQLValue,
InputValue, Registry, ToInputValue,
};<|fim▁hole|>#[graphql(
name = "MyInput",
description = "input descr",
... |
#[derive(GraphQLInputObject, Debug, PartialEq)] |
<|file_name|>fusiontables_v1_messages.py<|end_file_name|><|fim▁begin|>#
# Copyright 2015 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/LIC... | |
<|file_name|>2-17-a.cpp<|end_file_name|><|fim▁begin|>//<|fim▁hole|>using std::vector;
#include <iostream>
#include <cassert>
int min3(int a, int b, int c);
int minSubSum(const vector<int>& a);
int minSubRec(const vector<int>& a, int left, int right);
int main() {
vector<int> v{-2, -1, -2, 3, -4};
assert(min... | // Created by paysonl on 16-10-20.
//
#include <vector> |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|># Copyright 2016 Adler Brediks Medrado
#
# Licensed under the Apache License, Version 2.0 (the "License");<|fim▁hole|># You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | # you may not use this file except in compliance with the License. |
<|file_name|>OneDirectMappingProject.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
* Copyright (c) 1998, 2012 Oracle and/or its affiliates. All rights reserved.
* This program and the accompanying materials are made available under the
* terms ... | ******************************************************************************/
package org.eclipse.persistence.testing.oxm.readonly;
|
<|file_name|>module.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright(C) 2017 Vincent A
#
# This file is part of a weboob module.
#
# This weboob module is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Fre... | from .browser import LameteoagricoleBrowser |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from setuptools import setup
import os
execfile(os.path.join('sheetsync','version.py'))
with open('README.rst') as fh:
long_description = fh.read()
with open('requirements.txt') as fh:
requirements = [line.strip() for line in fh.readlines()]
setup(
name... | "License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 2.7",
],
) |
<|file_name|>Components.js<|end_file_name|><|fim▁begin|>/**
* Most of this code is adapated from https://github.com/qimingweng/react-modal-dialog
*/
import React from 'react';
import ReactDOM from 'react-dom';
import EventStack from './EventStack';
import PropTypes from 'prop-types';
const ESCAPE = 27;
/**
* Get t... | children: PropTypes.node, |
<|file_name|>TestAnalogInUsingJoistick.cpp<|end_file_name|><|fim▁begin|>/*
* The basic test codes to check the AnglogIn.
*/
#include "mbed.h"
static AnalogIn ain_x(A6); // connect joistics' x axis to A6 pin of mbed
static AnalogIn ain_y(A5); // connect joistics' y axis to A5 pin of mbed
static void printAnalogInpu... | }
|
<|file_name|>hattrie.go<|end_file_name|><|fim▁begin|>package safebrowsing
/*
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "hat-trie.h"
hattrie_t* start() {
hattrie_t* trie;
trie = hattrie_create();
return trie;
}
void set(hattrie_t* h, char* key, size_t len) {
value_t* val;
val = hattr... | ckey := C.CString(key)
defer C.free(unsafe.Pointer(ckey))
val := C.get(h.trie, ckey, C.size_t(len(key))) |
<|file_name|>Triangle.java<|end_file_name|><|fim▁begin|>package dkalymbaev.triangle;
class Triangle {
/**
* This class defines points a b and c as peacks of triangle.
*/
public Point a;
public Point b;
public Point c;
/**
* Creating of a new objects.
* @param a is the length of the first side.
* @param... | |
<|file_name|>config.go<|end_file_name|><|fim▁begin|>package logger
// FileConfig represents a file backend configuration.
type FileConfig struct {
// Logging output severity level. Messages with higher severity value will be discarded.
Level string
// File path of the logging output. If path is either empty or "-"... | Address string
Transport string |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>"""kaxabu URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:<|fim▁hole|> 1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based views
1. Add an im... | ERROR: type should be large_string, got " https://docs.djangoproject.com/en/1.9/topics/http/urls/\nExamples:\nFunction views" |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#[macro_use]
#[cfg(test)]
extern crate lazy_static;
#[cfg(test)]
extern crate itertools;
extern crate r68k_common;
#[cfg(test)]
extern crate r68k_tools;
pub mod cpu;
pub mod ram;
pub mod interrupts;
pub mod musashi;
#[cfg(test)]
mod tests {
use cpu::TestCore;
... | |
<|file_name|>nn_cuda.py<|end_file_name|><|fim▁begin|>from __future__ import print_function, division
import os
import sys
import time
import h5py
import torch
from torch import nn
from torch.autograd import Variable
import torch.nn.functional as F
import torch.utils.data as Data
import numpy as np
import json
from skle... | |
<|file_name|>range.cc<|end_file_name|><|fim▁begin|>// Copyright (C) 2014 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library 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 Softwar... |
int main()
{
time_counter time; |
<|file_name|>fallback_chooser.py<|end_file_name|><|fim▁begin|>"""Pure TTY chooser UI"""
from __future__ import print_function, absolute_import
__author__ = "Stephan Sokolow (deitarion/SSokolow)"
__license__ = "GNU GPL 2 or later"
import os
# Use readline if available but don't depend on it
try:
import readline
... | try:
return [int(in_str)]
except ValueError:
choices = [] |
<|file_name|>bitcoin_sk.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="sk" version="2.0">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About StreamCoin</source>
... | <message>
<location line="+14"/>
<source>&Delete</source> |
<|file_name|>_9_1_geometry_shader_houses.rs<|end_file_name|><|fim▁begin|>#![allow(non_upper_case_globals)]
#![allow(non_snake_case)]
use std::ptr;
use std::mem;
use std::os::raw::c_void;
extern crate glfw;
use self::glfw::Context;
extern crate gl;
use self::gl::types::*;
use cgmath::{Point3};
use common::{process_... | #[cfg(target_os = "macos")]
glfw.window_hint(glfw::WindowHint::OpenGlForwardCompat(true)); |
<|file_name|>h_third_party_apps.py<|end_file_name|><|fim▁begin|>try:<|fim▁hole|> INSTALLED_APPS
except NameError:
INSTALLED_APPS=()
#Generated Config - Don't modify above this line<|fim▁end|> | |
<|file_name|>memory.rs<|end_file_name|><|fim▁begin|>// This file is part of zinc64.
// Copyright (c) 2016-2019 Sebastian Jastrzebski. All rights reserved.
// Licensed under the GPLv3. See LICENSE file in the project root for full license text.
#[cfg(not(feature = "std"))]
use alloc::prelude::*;
use zinc64_core::{Addre... | kernal: Shared<Rom>, |
<|file_name|>ShortTimeProcessImpl.cpp<|end_file_name|><|fim▁begin|>/*
* ShortTimeProcess.cpp
* Copyright 2016 (c) Jordi Adell
* Created on: 2015
* Author: Jordi Adell - adellj@gmail.com
*
* This file is part of DSPONE
*
* DSPONE is free software: you can redistribute it and/or modify
* it under the terms of the GNU Ge... | {
return _windowShift;
}
|
<|file_name|>digits_test.go<|end_file_name|><|fim▁begin|>package digits
import (
"net/http"
"net/http/httptest"
"net/url"
"testing"
"github.com/stretchr/testify/assert"
)
// testServer returns an http Client, ServeMux, and Server. The client proxies
// requests to the server and handlers can be registered on th... | return http.DefaultTransport.RoundTrip(req)
}
return t.Transport.RoundTrip(req) |
<|file_name|>imagenet.py<|end_file_name|><|fim▁begin|># ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2020, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
#... | inplace=True
),
], |
<|file_name|>s3query.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
""" S3 Query Construction
@copyright: 2009-2015 (c) Sahana Software Foundation
@license: MIT
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
file... |
# ============================================================================= |
<|file_name|>ImageViewerQt.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
""" ImageViewer.py: PyQt image viewer widget for a QPixmap in a QGraphicsView scene with mouse zooming and panning. """
import os.path
from PyQt5.QtCore import Qt, QRectF, pyqtSignal, QT_VERSION_STR
from PyQt5.QtGui import QImage, QPixm... | self.updateViewer()
self.setDragMode(QGraphicsView.NoDrag)
self.rightMouseButtonReleased.emit(scenePos.x(), scenePos.y()) |
<|file_name|>SliderWnd.cpp<|end_file_name|><|fim▁begin|>#include "SliderWnd.h"
#include <windowsx.h>
#include "SliderKnob.h"
#define TIMER_IGNORE_INPUT 50
#define IGNORE_DURATION 100
SliderWnd::SliderWnd(LPCWSTR className, LPCWSTR title, HINSTANCE hInstance) :
MeterWnd(className, title, hInstance),
_dragging(false)... | if (loc.y < mRect.top) {
loc.y = mRect.top;
}
|
<|file_name|>FindCallVisitor.java<|end_file_name|><|fim▁begin|>/**
* Copyright (c) 2005-2012 by Appcelerator, Inc. All Rights Reserved.
* Licensed under the terms of the Eclipse Public License (EPL).
* Please see the license.txt included with this distribution for details.
* Any modifications to this file must keep... |
public FindCallVisitor(Name name) {
this.name = name; |
<|file_name|>qa_burst_shaper.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2015 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
from gnuradio import gr, gr_unittest
from gnuradio import blocks, digital
im... | -1.0 * np.ones(length2 - len(window)),
-1.0 * window[5:10], np.zeros(postpad)))
elentag1_offset = 0 |
<|file_name|>Attribute.java<|end_file_name|><|fim▁begin|>package com.thecodeinside.easyfactory.core;
/**
* A factory's attribute.
*
* @author Wellington Pinheiro <wellington.pinheiro@gmail.com>
*
* @param <T> type of the attribute
*/
public class Attribute<T> {
private String id;
private T value;
p... | this.value = value;
}
|
<|file_name|>birdCLEF_test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
print "HANDLING IMPORTS...",<|fim▁hole|>import random
import operator
import argparse
import numpy as np
import cv2
from sklearn.utils import shuffle
import itertools
import scipy.io.wavfile as wave
from scipy import interpolate
impor... |
import os
import time |
<|file_name|>cinetorrent.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import sys
PY3 = False
if sys.version_info[0] >= 3: PY3 = True; unicode = str; unichr = chr; long = int
if PY3:
import urllib.parse as urlparse # Es muy lento en PY2. En PY3 es nativo
else... | |
<|file_name|>__openerp__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# © <YEAR(S)> <AUTHOR(S)>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Account Analytic Warehouse",
"summary": "Add analytic in stock_warehouse",
"version": "9.0.1.0.0",
"category": "Accou... | "bin": [],
},
"depends": [
"base", |
<|file_name|>hammer_v0.py<|end_file_name|><|fim▁begin|># coding=utf-8
# Copyright 2022 The Google Research 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.o... | self.im_size, self.im_size, camera_id=self._camera_id)
qp = self.physics.data.qpos.ravel().copy()
qv = np.clip(self.physics.data.qvel.ravel(), -1.0, 1.0).copy()
palm_pos = self.physics.data.site_xpos[self.S_grasp_sid].ravel().copy() |
<|file_name|>outputstreamadaptor.cpp<|end_file_name|><|fim▁begin|>#include "bond/api/libio.h"
#include "bond/io/outputstream.h"
#include "bond/io/outputstreamadaptor.h"
#include <cstdio>
namespace Bond
{
void OutputStreamAdaptor::Print(const char *str)
{
const char *format = ((mFlags & IO::Left) != 0) ? "%-*s" : "%*... | *format++ = '0';
} |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// Copyright 2018 MaidSafe.net limited.
//
// This SAFE Network Software is licensed to you under The General Public License (GPL), version 3.
// Unless required by applicable law or agreed to in writing, the SAFE Network Software distributed
// under the GPL Licence is ... | use futures::Future;
/// Helper type for futures that can result in `NfsError`. |
<|file_name|>p3.py<|end_file_name|><|fim▁begin|># $Id: p3.py,v 1.2 2003/11/18 19:04:03 phr Exp phr $
# Simple p3 encryption "algorithm": it's just SHA used as a stream
# cipher in output feedback mode.
# Author: Paul Rubin, Fort GNOX Cryptography, <phr-crypto at nightsong.com>.
# Algorithmic advice from David Wagner,... | |
<|file_name|>dnsblocker.go<|end_file_name|><|fim▁begin|>package main
import (
"bufio"
"flag"
"fmt"
"io"
"os"
"strings"
"github.com/coocood/freecache"
"github.com/miekg/dns"
"github.com/op/go-logging"
)
var logger = logging.MustGetLogger("dnsblocker")
var logFormatter = logging.MustStringFormatter(
"%{color... | |
<|file_name|>environment.js<|end_file_name|><|fim▁begin|>module.exports = function() {
return {
modulePrefix: 'some-cool-app',
EmberENV: {
asdflkmawejf: ';jlnu3yr23'<|fim▁hole|> autoboot: false
}
};
};<|fim▁end|> | },
APP: { |
<|file_name|>EncodeBufr302053.cc<|end_file_name|><|fim▁begin|>/*
Kvalobs - Free Quality Control Software for Meteorological Observations
$Id: Data.h,v 1.2.6.2 2007/09/27 09:02:22 paule Exp $
Copyright (C) 2007 met.no
Contact information:
Norwegian Meteorological Institute
Box 43 Blindern
0313 OSLO
NO... | logIdentifier() const |
<|file_name|>snake_game.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# Copyright (C) 2013 rapidhere
#
# Author: rapidhere <rapidhere@gmail.com>
# Maintainer: rapidhere <rapidhere@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public ... | print "'d' or 'D' or RG-Arrpw right"
print "'q' or 'Q' quit"
sys.exit(0)
else: |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>"""
Django Views for service status app
"""
<|fim▁hole|>import json
import time
from celery.exceptions import TimeoutError
from django.http import HttpResponse
from djcelery import celery
from openedx.core.djangoapps.service_status.tasks import delayed_ping
def inde... | from __future__ import absolute_import
|
<|file_name|>script_runtime.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/. */
//! The script runtime contains common traits and str... | GlobalScope::from_object(incumbent_global.get())
} else { |
<|file_name|>CidrAddressBlockTranslatorFactory.java<|end_file_name|><|fim▁begin|>// Copyright 2017 The Nomulus 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 a... | |
<|file_name|>validators.py<|end_file_name|><|fim▁begin|>"""
"""
# Created on 2016.08.09
#
# Author: Giovanni Cannata
#
# Copyright 2016, 2017 Giovanni Cannata
#
# This file is part of ldap3.
#
# ldap3 is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License ... | |
<|file_name|>campaign.cpp<|end_file_name|><|fim▁begin|>/******************************************************************************
* irrlamb - https://github.com/jazztickets/irrlamb
* Copyright (C) 2019 Alan Witkowski
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of ... | |
<|file_name|>ex2.py<|end_file_name|><|fim▁begin|># A comment, this is so you can read your program later.
# Anything after the # is ignored by python.
print "I could have code like this." # and the comment after is ignored
# You can also use a comment to "disable" or comment out a piece of code:
# print "This won't ... | |
<|file_name|>render_target.rs<|end_file_name|><|fim▁begin|>//! Defines the render target for tray, where our image will be written too
//! during rendering
use std::vec::Vec;
use std::{iter, cmp, f32};
use std::sync::Mutex;
use film::Colorf;
use film::filter::Filter;
use sampler::Region;
const FILTER_TABLE_SIZE: usi... | /// a list of block positions in pixels and then pixels for the blocks (in a single f32 vec). |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.