prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>AlertControl.tsx<|end_file_name|><|fim▁begin|>import * as React from 'react';
import { AccessPropertyName, Alert, AlertType } from '../Models';
import { ApplicationState, AppThunkAction } from '../store';
import { CloseAlertAction } from '../store/Alert';<|fim▁hole|> items: Alert[];
closeAlert(id: ... |
export interface AlertProps { |
<|file_name|>ButtonEvent.py<|end_file_name|><|fim▁begin|>'''
*******************************************************************************
* ButtonEvent.py 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 Founda... | 263 : "BUTTON_LEFT" ,
264 : "BUTTON_UP" ,
265 : "BUTTON_DOWN" ,
}[self.__button] |
<|file_name|>ThreadModel.java<|end_file_name|><|fim▁begin|>/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to yo... | * http://www.apache.org/licenses/LICENSE-2.0 |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>import {
parseProgrammes,
parseSubjects,
parseCourses,
} from "@education-data/parser";
import { join } from "path";
import { writeFileSync } from "fs";
<|fim▁hole|>import { format } from "date-fns";
import { sv } from "date-fns/locale";
import { sourceDirectory,... | |
<|file_name|>validat2.cpp<|end_file_name|><|fim▁begin|>// validat2.cpp - written and placed in the public domain by Wei Dai
#include "pch.h"
#include "blumshub.h"
#include "rsa.h"
#include "md2.h"
#include "elgamal.h"
#include "nr.h"
#include "dsa.h"
#include "dh.h"
#include "mqv.h"
#include "luc.h"
#inc... | cout << setw(2) << setfill('0') << hex << (int)buf[j];
cout << endl;
|
<|file_name|>notebook_utils.py<|end_file_name|><|fim▁begin|># Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#<|fim▁hole|># distributed under ... | # http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software |
<|file_name|>instr_vpmovm2q.rs<|end_file_name|><|fim▁begin|>use ::{BroadcastMode, Instruction, MaskReg, MergeMode, Mnemonic, OperandSize, Reg, RoundingMode};
use ::RegType::*;
use ::instruction_def::*;
use ::Operand::*;
use ::Reg::*;
use ::RegScale::*;
use ::test::run_test;
#[test]
fn vpmovm2q_1() {
run_test(&Inst... |
#[test]
fn vpmovm2q_5() { |
<|file_name|>Base64.java<|end_file_name|><|fim▁begin|>/**
* Encodes and decodes to and from Base64 notation.
*
* <p>
* Change Log:
* </p>
* <ul>
* <li>v2.1 - Cleaned up javadoc comments and unused variables and methods. Added
* some convenience methods for reading and writing to and from files.</li>
* <li>... | } // end encode3to4
|
<|file_name|>test_optimizers_by_linear_model.py<|end_file_name|><|fim▁begin|>import unittest
import numpy as np
import six
import chainer
from chainer import cuda
import chainer.functions as F
from chainer import optimizers
from chainer import testing
from chainer.testing import attr
from chainer.testing import condi... |
class TestSGD(OptimizerTestBase, unittest.TestCase):
def create(self):
return optimizers.SGD(0.1) |
<|file_name|>docs.py<|end_file_name|><|fim▁begin|>from fabric.api import task, local, run
from fabric.context_managers import lcd
import settings
@task(default=True)
def build():
"""
(Default) Build Sphinx HTML documentation
"""
with lcd('docs'):
local('make html')
@task()
def deploy():
... | """
build()
destination = '/usr/share/nginx/localhost/mysite/docs/build/html'
if settings.environment == 'vagrant': |
<|file_name|>element.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/. */
//! Element nodes.
use app_units::Au;
use cssparser::Color;
... | let base = doc.base_url();
// https://html.spec.whatwg.org/multipage/#reflect
// XXXManishearth this doesn't handle `javascript:` urls properly |
<|file_name|>main.js<|end_file_name|><|fim▁begin|>var gridOptions = {
columnDefs: [
{ field: 'country', rowGroup: true, hide: true },
{ field: 'athlete', minWidth: 180 },
{ field: 'age' },
{ field: 'year' },
{ field: 'date', minWidth: 150 },
{ field: 'sport', minWidth... | function onBtForEachNode() {
console.log('### api.forEachNode() ###');
gridOptions.api.forEachNode(this.printNode); |
<|file_name|>testing.js<|end_file_name|><|fim▁begin|>'use strict';
angular.module('testing').controller('TestingController', ['$scope', '$http', '$location', 'Authentication', 'Appprogress', 'Users', 'Registrations', 'creditCardMgmt', 'createDialog', 'bankAccountMgmt',
function ($scope, $http, $location, Authenticatio... | "account_type": "checking",
"name": "Johann Bernoulli", |
<|file_name|>graphicsapp.js<|end_file_name|><|fim▁begin|>/***** AVAILABLE JAVASCRIPT FUNCTIONS ******/
/* Function: GraphicsApp()
* --------------------------------
* Creates a new GraphicsApp object and returns it.
*
* Parameters: none
*/
function GraphicsApp() {}
/* Function: addButton(buttonName)
* -----... | |
<|file_name|>issue-29037.rs<|end_file_name|><|fim▁begin|>// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/lic... | fn c<'r>(x: Arc<&'static str>) -> Arc<&'r str> {
x
}
|
<|file_name|>CPUmon.rs<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | CPUmon |
<|file_name|>proda.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
"""
An interface to the web-based PROvider Direct Access (PRODA) system
of Medicare Australia
"""
import mechanize # available via PIP
import re
m = mechanize.Browser()
m.open("https://proda.humanservices.gov.au/prodalogin/pages/public/login.jsf?T... | |
<|file_name|>utils.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>use rustc_serialize::{Encodable, Encoder};
use url::Url;
use git2::{self, ObjectType};
use core::GitReference;
use util::{CargoResult, ChainError, human, ToUrl, internal};
#[derive(PartialEq, Clone, Debug)]
pub struct GitRevision(git2::Oid);
impl fmt::Di... | use std::fmt;
use std::path::{Path, PathBuf};
use std::fs;
|
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>import datetime
from django.contrib.contenttypes.models import ContentType
from django.utils import timezone
from .models import Action<|fim▁hole|>
def create_action(user, verb, target=None):
now = timezone.now()
last_minute = now - datetime.timedelta(second... | |
<|file_name|>chart_scatter.py<|end_file_name|><|fim▁begin|>#######################################################################
#
# An example of creating Excel Scatter charts with Python and XlsxWriter.
#
# Copyright 2013-2015, John McNamara, jmcnamara@cpan.org
#
import xlsxwriter
workbook = xlsxwriter.Workbook('c... | worksheet.insert_chart('D51', chart4, {'x_offset': 25, 'y_offset': 10})
#######################################################################
# |
<|file_name|>crs.py<|end_file_name|><|fim▁begin|># Coordinate reference systems and functions.
#
# PROJ.4 is the law of this land: http://proj.osgeo.org/. But whereas PROJ.4
# coordinate reference systems are described by strings of parameters such as
#
# +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs
#
# here we u... | and items where the value is otherwise not a str, int, or float are
omitted. |
<|file_name|>board.js<|end_file_name|><|fim▁begin|>define(["require", "exports", "./base", "./layer", "./util", "./view"], function (require, exports, base_1, layer_1, util_1, view_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.COL_LABELS = base_1.COL_LABELS;
c... | }
this.draw(); |
<|file_name|>client.go<|end_file_name|><|fim▁begin|>// Copyright 2014, Google Inc. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package vtctlclienttest contains the testsuite against which each
// RPC implementation of the vtctlclient i... | |
<|file_name|>tab.js<|end_file_name|><|fim▁begin|>semantic.dropdown = {};
// ready event
semantic.dropdown.ready = function() {
// selector cache
var
// alias
handler
;
// event handlers
handler = {
<|fim▁hole|> };
$('.first.example .menu .item')
.tab({
context: '.first... | |
<|file_name|>ItemForestRelic.java<|end_file_name|><|fim▁begin|>package com.compwiz1548.elementaltemples.item;
public class ItemForestRelic extends ItemET
{
public ItemForestRelic()<|fim▁hole|> }
}<|fim▁end|> | {
super();
this.setUnlocalizedName("forestRelic");
this.setMaxStackSize(1); |
<|file_name|>criteria-templates.types.disabled-spec.ts<|end_file_name|><|fim▁begin|>// import { IsExact } from "conditional-type-checks";
// import {
// InNumberRangeCriterion,
// InNumberSetCriterion,
// InstancedCriterionTemplate,
// NamedCriteria,<|fim▁hole|>// OrCriteriaTemplate,
// NamedCri... | // OrCriteria, |
<|file_name|>classifier_domain.py<|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://www.apa... | """
return {
'classifier_id': self.id, |
<|file_name|>test_ivim.py<|end_file_name|><|fim▁begin|>"""
Testing the Intravoxel incoherent motion module
The values of the various parameters used in the tests are inspired by
the study of the IVIM model applied to MR images of the brain by
Federau, Christian, et al. [1].
References
----------
.. [1] Federau, Chris... | assert_greater_equal(len([lw for lw in u_warn for m in message
if m in str(lw.message)]), 3)
|
<|file_name|>test_memorizingfile.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Copyright 2009, Google 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:
#
# * Redistributions o... |
# vi:sts=4 sw=4 et |
<|file_name|>SelectionToICompilationUnitList.java<|end_file_name|><|fim▁begin|>/*
Copyright (C) 2013 Jason Gowan
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(... | |
<|file_name|>svh-a-change-type-arg.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.apac... | 3
}
|
<|file_name|>make_interim.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import os
import logging
from dotenv import find_dotenv, load_dotenv
from constants import *
import json
from utils import json_from_file, merge_json
import shutil
from settings import *
def prepare_train_data():
""" Runs data proces... | source_tweet['replies'] = source_tweet_replies |
<|file_name|>table_test.qtpl.go<|end_file_name|><|fim▁begin|>// Code generated by qtc from "table_test.qtpl". DO NOT EDIT.
// See https://github.com/valyala/quicktemplate for details.
//line views/templates/tables/table_test.qtpl:1
package tables
//line views/templates/tables/table_test.qtpl:1
import (
qtio422016 "i... | |
<|file_name|>media.py<|end_file_name|><|fim▁begin|># oppia/api/media.py
from django.conf import settings
from django.contrib.auth import authenticate
from django.http import HttpResponseRedirect, Http404, HttpResponse, JsonResponse
from django.utils.translation import ugettext_lazy as _
from django.views.decorators.cs... | |
<|file_name|>file_util.py<|end_file_name|><|fim▁begin|>import os
import unicodedata
from keras.applications import InceptionV3, VGG16, MobileNet
image_type = ['.jpg']
def check_img(file_name):
"""To check image
Args:
file_name : file name
Returns:
if this file is image
"""<|fim▁hole... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import random
sys.path.append('.')
from twisted.internet import reactor
import marionette_tg.driver
import marionette_tg.multiplexer
import marionette_tg.record_layer
import marionette_tg.updater
EVENT_LOO... | self.driver_ = marionette_tg.driver.ServerDriver("server")
self.driver_.set_multiplexer_incoming(self.multiplexer_incoming_)
self.driver_.set_multiplexer_outgoing(self.multiplexer_outgoing_)
self.driver_.setFormat(self.format_name_) |
<|file_name|>test_spar_functions.py<|end_file_name|><|fim▁begin|>#-----------------------------------------------------------------------------
# Copyright (c) 2014, HFTools Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with t... | import hftools.dataset.arrayobj as aobj
import hftools.networks.spar_functions as spfun
|
<|file_name|>cesdkhandler.cpp<|end_file_name|><|fim▁begin|>/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** No Commercial Us... | |
<|file_name|>bulls_and_cows.py<|end_file_name|><|fim▁begin|>__author__ = 'BeyondSky'
from collections import defaultdict
class Solution(object):
def getHint(self, secret, guess):
"""
:type secret: str
:type guess: str
:rtype: str
"""
bulls = cows = 0
digits ... | # decrease number of non-matching digit by 1 if it is greater than 0
if digits[guess[index]] > 0:
cows += 1 |
<|file_name|>node_win32_etw_provider.cc<|end_file_name|><|fim▁begin|>#include "node_dtrace.h"
#include "node_win32_etw_provider.h"
#include "node_etw_provider.h"
#include "node_win32_etw_provider-inl.h"
namespace node {
using v8::JitCodeEvent;
using v8::V8;
HMODULE advapi;
REGHANDLE node_provider;
EventRegisterFunc ... | |
<|file_name|>epoch_fetch.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, either... | |
<|file_name|>0039_auto_20161101_1555.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-11-01 22:55
from __future__ import unicode_literals
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
<|fim▁hole|> operations = [
... | dependencies = [
('contentcuration', '0038_contentnode_author'),
]
|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | from .generate_detachment_ltd_erosion import DetachmentLtdErosion
from .generate_erosion_by_depth_slope import DepthSlopeProductErosion
__all__ = ["DetachmentLtdErosion", "DepthSlopeProductErosion"] |
<|file_name|>test_quil.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
##############################################################################
# Copyright 2016-2017 Rigetti Computing
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with ... | '0.0+0.0i, 0.5-0.5i, 0.0+0.0i, 0.5+0.5i\n ' \
'0.5-0.5i, 0.0+0.0i, 0.5+0.5i, 0.0+0.0i\n\nX-SQRT-X 0 1\n' |
<|file_name|>DROID_export_comparer.py<|end_file_name|><|fim▁begin|>import csv
import os
#### make sure these file names are the same as the ones on your system
baseline_csv = r"baseline.csv"
new_csv = r"cleaned_csv.csv"
########### do not edit below this line #################
baseline_as_rows = []
new_as_... | new_as_rows.append(row)
if len(baseline_as_rows) != len(new_as_rows):
|
<|file_name|>buffer.go<|end_file_name|><|fim▁begin|>// Copyright 2015 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/lice... | }
// Returns pointers to the last 'n' stats. |
<|file_name|>production.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import<|fim▁hole|><|fim▁end|> | from .base import * |
<|file_name|>config.rs<|end_file_name|><|fim▁begin|>use std::collections::HashMap;
use std::rc::Rc;
use serde::de::{Deserialize, Deserializer};
use serde_derive::Deserialize;
use toml::value;
use crate::errors;
use crate::icons::Icons;
use crate::protocol::i3bar_event::MouseButton;
use crate::themes::Theme;
#[derive... | icons_format: " {icon} ".to_string(),
scrolling: Scrolling::default(), |
<|file_name|>MessageRideArmor.java<|end_file_name|><|fim▁begin|>package zornco.reploidcraft.network;
import net.minecraft.entity.Entity;
import net.minecraft.server.MinecraftServer;
import net.minecraft.world.WorldServer;
import zornco.reploidcraft.ReploidCraft;
import zornco.reploidcraft.entities.EntityRideArmor;
imp... | |
<|file_name|>core_thread.rs<|end_file_name|><|fim▁begin|>use modulo_traits::core_msg::ToCoreThreadMsg;
use modulo_traits::file_msg::{FileThreadId, ToFileThreadMsg};
use file::file_thread::FileThread;
use std::collections::HashMap;
use std::path::PathBuf;
use std::sync::mpsc::{self, Sender, Receiver};
use std::thread::{... | core.run();
});
|
<|file_name|>test_c_generator.py<|end_file_name|><|fim▁begin|>import sys
import unittest
# Run from the root dir
sys.path.insert(0, '.')
from pycparser import c_parser, c_generator, c_ast
_c_parser = c_parser.CParser(
lex_optimize=False,
yacc_debug=True,
yacc_optimize=... | int main() { |
<|file_name|>LMS7002_DCCAL.py<|end_file_name|><|fim▁begin|>#***************************************************************
#* Name: LMS7002_DCCAL.py
#* Purpose: Class implementing LMS7002 DCCAL functions
#* Author: Lime Microsystems ()
#* Created: 2017-02-10
#* Copyright: Lime Microsystems (limemicro.com)
... | if self.chip.chipID == self.chip.chipIDMR3:
self._writeReg('TXAQ', 'DCRD_TXAQ', 0)
self._writeReg('TXAQ', 'DCRD_TXAQ', 1) |
<|file_name|>woocommerce.js<|end_file_name|><|fim▁begin|>(function ($, window, document) {
"use strict";
$(document).on( 'ready', function(){
var $body = $('body'),
$topbar = $( document.getElementById('topbar') ),
$products_sliders = $('.products-slider-wrapper, .categori... | if (product.find('.product-wrapper > .added_to_cart_ico').length == 0) {
setTimeout(function() {
product.find('.product-wrapper').append('<span class="added_to_cart_ico">' + yit.added_to_cart_ico + '</span>');
|
<|file_name|>index.d.ts<|end_file_name|><|fim▁begin|>/**
* @license
* 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/L... | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ |
<|file_name|>catalog.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Script to extract a catalog of Windows Registry keys and values."""
import argparse
import logging
import sys
from dfwinreg import creg as dfwinreg_creg
from dfwinreg import regf as dfwinreg_regf
from dfwinreg import... | |
<|file_name|>tables.py<|end_file_name|><|fim▁begin|>from django.core import urlresolvers
from django.utils.translation import ugettext_lazy as _
from django.template.defaultfilters import timesince, floatformat<|fim▁hole|>
class CSVSummary(tables.LinkAction):
name = "csv_summary"
verbose_name = _("Download CSV ... |
from horizon import tables
from horizon.templatetags.sizeformat import mbformat
|
<|file_name|>const-int-overflowing.rs<|end_file_name|><|fim▁begin|><|fim▁hole|> //~^ ERROR temporary value dropped while borrowed
let y: &'static (i32, bool) = &(5_i32.overflowing_sub(3));
//~^ ERROR temporary value dropped while borrowed
let z: &'static (i32, bool) = &(5_i32.overflowing_mul(3));
//~... | fn main() {
let x: &'static (i32, bool) = &(5_i32.overflowing_add(3)); |
<|file_name|>self-impl.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/licen... | // option. This file may not be copied, modified, or distributed
// except according to those terms.
|
<|file_name|>is_near_arterial.py<|end_file_name|><|fim▁begin|># Opus/UrbanSim urban simulation software.
# Copyright (C) 2005-2009 University of Washington
# See opus_core/LICENSE
from opus_core.variables.variable import Variable
from variable_functions import my_attribute_label
from urbansim.length_constants im... | def compute(self, dataset_pool):
|
<|file_name|>holidayConfiguration.ts<|end_file_name|><|fim▁begin|>import { IHolidayExtractorConfiguration, BaseHolidayParserConfiguration } from "../baseHoliday";
import { RegExpUtility } from "recognizers-text-number";
import { DateUtils } from "../utilities";
import { FrenchDateTime } from "../../resources/frenchDate... |
private static ValentinesDay(year: number): Date { return new Date(year, 2, 14);}
private static WhiteLoverDay(year: number): Date { return new Date(year, 3, 14);}
private static FoolDay(year: number): Date { return new Date(year, 4, 1);} |
<|file_name|>count-inversions.py<|end_file_name|><|fim▁begin|>def count_inversion(sequence):
flag, answer, sequence = True, 0, list(sequence)
while flag:
flag = False<|fim▁hole|> flag = True
return answer
def test_function():
assert count_inversion((1, 2, 5, 3, 4, 7, 6)) == 3, "... | for i in xrange(1, len(sequence)):
if sequence[i-1] > sequence[i]:
sequence[i], sequence[i-1] = sequence[i-1], sequence[i]
answer += 1 |
<|file_name|>apps.py<|end_file_name|><|fim▁begin|>"""Django app config for the analytics app."""<|fim▁hole|>
class AnalyticsAppConfig(AppConfig):
"""Analytics app init code."""
name = 'readthedocs.analytics'
verbose_name = 'Analytics'<|fim▁end|> |
from django.apps import AppConfig |
<|file_name|>EventPhase.ts<|end_file_name|><|fim▁begin|>/**
* @module seng-event
*/
/**
* An enum for possible event phases that an event can be in
*/
enum EventPhase {
/**
* Indicates that the event is currently not being dispatched
*/
NONE,
/**
* Indicates that the event is in the capturing phase,... | */
CAPTURING_PHASE, |
<|file_name|>magnet.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Hardware file for the Superconducting Magnet (SCM)
QuDi 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 Lice... | "function for more information") |
<|file_name|>pyRelocationObject.cpp<|end_file_name|><|fim▁begin|>/* Copyright 2017 - 2022 R. Thomas
* Copyright 2017 - 2022 Quarkslab
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
... | |
<|file_name|>test_noise.py<|end_file_name|><|fim▁begin|>import pytest
import numpy as np
import noisily as ns
# FIXME This has got to be an abuse of fixtures, right?
@pytest.fixture(scope='module', params=[(1, 1), (37, 57), (128, 128)])
def indices2D(request):
shape = request.param
return np.transpose(np.ind... | def test_output3D(generator3D, indices3D):
output = generator3D(indices3D)
|
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from django.contrib import admin
from django.db import models
class Band(models.Model):
name = models.CharField(max_length=100)
bio = models.TextField()
rank = models.IntegerField()
class Meta:
ordering = ('name',)
... | def get_ordering(self, request):
if request.user.is_superuser:
return ['rank'] |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>import json
import urllib
import urllib2
from django.core.files import File
from django.conf import settings
from django.contrib.gis.geos import Point
from .models import FloodMap, ReturnPeriod
def get_geoserver_baseurl():
'''
Just input the layer name, hei... | |
<|file_name|>test_mman.rs<|end_file_name|><|fim▁begin|>use nix::sys::mman::{mmap, MapFlags, ProtFlags};
#[test]
fn test_mmap_anonymous() {
unsafe {
let ptr = mmap(std::ptr::null_mut(), 1,
ProtFlags::PROT_READ | ProtFlags::PROT_WRITE,
MapFlags::MAP_PRIVATE | Map... | }; |
<|file_name|>reflector.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 syntax::ext::base::ExtCtxt;
use syntax::codemap::Span;
... | }
);
impl_item.map(|it| push(it))
} |
<|file_name|>platform.rs<|end_file_name|><|fim▁begin|>/*
* Copyright 2017 Sreejith Krishnan R
*
* 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... | Canvas::new(width.max(1.), height.max(1.),
self.ruler.get_sk_typeface()) |
<|file_name|>p2d.rs<|end_file_name|><|fim▁begin|>use super::vector::Vector;
#[derive(Debug, Copy, Clone)]
pub struct P2d(pub f32, pub f32);
impl Vector for P2d {
type Scalar = f32;
fn new() -> Self {
P2d(0.0, 0.0)
}
fn length_squared(&self) -> f32 {
self.0 * self.0 + self.1 * self.1
... | } else if self.0 > max.0 { |
<|file_name|>app.py<|end_file_name|><|fim▁begin|>from django.conf.urls import patterns, url
from django.contrib.auth.decorators import login_required
from django.shortcuts import get_object_or_404
from django.template.response import TemplateResponse
from django.utils.decorators import method_decorator
from ..core.app... | ]
order_list_templates = [
'satchless/order/my_orders.html', |
<|file_name|>kvstore.rs<|end_file_name|><|fim▁begin|>//! test was move from base (it could not compile in base since its trait just change
//! (bidirectional dependency))
//! TODO seems pretty useless : remove??
use keyval::KeyVal;
use node::{Node,NodeID};
use peer::{Peer,Shadow};
use std::cmp::Eq;
use std::cmp::Partia... | }
|
<|file_name|>plot.py<|end_file_name|><|fim▁begin|>import numpy as np
import matplotlib.pyplot as plt
b = map(int,open('data/dist_distances_enfermos_same_chr').readlines())
a = map(int,open('data/dist_distances_sanos_same_chr').readlines())
<|fim▁hole|>plt.show()<|fim▁end|> | plt.hist(b, bins=100, normed=0, alpha=0.5, label='enfermos')
plt.hist(a, bins=100, normed=0, alpha=0.5, label='sanos')
plt.legend(loc='upper right')
|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | __version__ = "1.3.15" |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>#![allow(unused_imports)]
//#![feature(optin_builtin_traits)]
//#![feature(clone_from_slice)]
//#![feature(question_mark)]
//#[macro_use] extern crate gfx;
extern crate dxsafe;
extern crate env_logger;
#[macro_use]
extern crate lazy_static;
extern crate libc;
#[macro_u... | fn print_adapter_info(adapter: &DXGIAdapter1) {
if let Ok(dev) = d3d12_create_device(Some(adapter), D3D_FEATURE_LEVEL_11_0) { |
<|file_name|>socket_mw.py<|end_file_name|><|fim▁begin|>import logging; logger = logging.getLogger("morse." + __name__)
import socket
import select
import json
import morse.core.middleware
from functools import partial
from morse.core import services
class MorseSocketServ:
def __init__(self, port, component_name):
... | # Data read functions
if function_name == "read_message":
component_instance.input_functions.append(partial(MorseSocketServ.main_read, serv, fun))
# Data write functions |
<|file_name|>edge-inspect-api-1.0.0.js<|end_file_name|><|fim▁begin|>/*************************************************************************
Copyright (c) 20136 Adobe Systems Incorporated. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compli... | my.cancel = function (devices) {
var parameters = {
subaction: 'cancel_connect',
deviceids: devices |
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (c) 2015 Conwet Lab., Universidad Politécnica de Madrid
# This file is part of Wirecloud.
# Wirecloud is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as publis... | |
<|file_name|>background.js<|end_file_name|><|fim▁begin|>Array.prototype.equals = function(array) {
// if the other array is a falsy value, return
if (!array)
return false;
// compare lengths - can save a lot of time
if (this.length != array.length)
return false;
for (var i = 0, l = this.length; i <... | "contexts": ["page", "selection", "image", "link"],
"onclick": clickHandler |
<|file_name|>AbstractBookmarkMarkerPropertiesProvider.java<|end_file_name|><|fim▁begin|>package mesfavoris.bookmarktype;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.StringReader;
import java.util.Optional;
import mesfavoris.model.Bookmark;
public abstract class AbstractBookmarkMarkerPro... | |
<|file_name|>textarea.js<|end_file_name|><|fim▁begin|>/**
* Textarea Element
*
* @copyright: Copyright (C) 2005-2013, fabrikar.com - All rights reserved.
* @license: GNU/GPL http://www.gnu.org/copyleft/gpl.html
*/
var FbTextarea = new Class({
Extends: FbElement,
initialize: function (element, options) {
th... | this.watchTextContainer();
this.parent(c); |
<|file_name|>test_sitemaps.py<|end_file_name|><|fim▁begin|>from django.core.urlresolvers import reverse
from django.test import TestCase as DjangoTestCase
from blognajd.models import Story, SiteSettings
from blognajd.sitemaps import StaticSitemap, StoriesSitemap
class StaticSitemap1TestCase(DjangoTestCase):
fixt... | sitesettings.has_projects_page = True
sitesettings.has_contact_page = True
sitesettings.save() |
<|file_name|>action.rs<|end_file_name|><|fim▁begin|>extern crate toml;
extern crate collections;
use std::io::fs;
use std::io::fs::PathExtensions;
use std::io::{Process, Command};
use std::collections::treemap::TreeMap;
#[deriving(Clone)]
pub struct Action {
pub name: String,
pub command: String,
pub do_f... | |
<|file_name|>sigfig.py<|end_file_name|><|fim▁begin|>from math import floor, log10
def round_(x, n):
"""Round a float, x, to n significant figures.
Caution should be applied when performing this operation.
Significant figures are an implication of precision; arbitrarily
truncating floats mid-calculation is probabl... | i = e + 1
sep = '' |
<|file_name|>games.js<|end_file_name|><|fim▁begin|>'use strict';
//Games service used for games REST endpoint
angular.module('mean.games').factory('Games', ['$resource',<|fim▁hole|> function($resource) {
return $resource('games/:gameid', {
gameid: '@_id'
}, {
update: {
... | |
<|file_name|>ElementCountDTO.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) 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 Lice... | private int attributeValueElementCount;
private int attributeSelectorElementCount; |
<|file_name|>macsec.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YAN... | |
<|file_name|>copy from.js<|end_file_name|><|fim▁begin|>var config = {
width: 800,
height: 600,
type: Phaser.AUTO,
parent: 'phaser-example',
scene: {
create: create,
update: update
}
};
var game = new Phaser.Game(config);
var graphics;
var pointerRect;
var rectangles;
function c... | function update ()
{
graphics.clear();
|
<|file_name|>move_imagery.py<|end_file_name|><|fim▁begin|>import os
import shutil
import re
import zipfile
import xml.etree.ElementTree as ET
from tempfile import TemporaryDirectory
import psycopg2
conn = psycopg2.connect(
database='innoter', user='postgres', password='postgres', host='192.168.0.107', port='5432')... |
# with zipfile.ZipFile(zip_path) as zf: |
<|file_name|>material-database.js<|end_file_name|><|fim▁begin|>import { setAttrs } from '../actions/object'
/*MATERIALDB_GROUP*/
export const addGroup = () => ({ type: "MATERIALDB_GROUP_ADD" });<|fim▁hole|>
/*MATERIALDB_PRESET (operations)*/
export const addPreset = (groupId, attrs = {}) => ({ type: "MATERIALDB_PRESET... | export const deleteGroup = (groupId) => ({ type: "MATERIALDB_GROUP_DELETE", payload: groupId });
export const setGroupAttrs = (groupId, attrs) => ({ type: "MATERIALDB_GROUP_SET_ATTRS", payload: { groupId, attrs } });
export const toggleGroupView = (groupId) => ({ type: "MATERIALDB_GROUP_TOGGLE_VIEW", payload: groupId }... |
<|file_name|>webserve.py<|end_file_name|><|fim▁begin|># This file is part of PlexPy.
#
# PlexPy is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any l... | "time_format": plexpy.CONFIG.TIME_FORMAT,
"grouping_global_history": checked(plexpy.CONFIG.GROUPING_GLOBAL_HISTORY),
"grouping_user_history": checked(plexpy.CONFIG.GROUPING_USER_HISTORY), |
<|file_name|>negamax.rs<|end_file_name|><|fim▁begin|>//! An implementation of Negamax.
//!
//! Currently, only the basic alpha-pruning variant is implemented. Further work
//! could add advanced features, like history and/or transposition tables. This
//! picks randomly among the "best" moves, so that it's non-determin... | where <E::G as Game>::S: Clone,
<E::G as Game>::M: Copy {
fn choose_move(&mut self, s: &<E::G as Game>::S, p: Player) -> Option<<E::G as Game>::M> { |
<|file_name|>exp_app.js<|end_file_name|><|fim▁begin|>var express = require('express');
var reload = require('reload');
var fs = require('fs');
var wss = new require('ws').Server({port: 3030});
var app = express();
var Chopper = require('./lib/Chopper');
app.set('port', process.env.PORT || 3000);
app.set('view ... | if (msg == 'exit') {
ws.close();
|
<|file_name|>monitor.rs<|end_file_name|><|fim▁begin|>use winapi::{
shared::{
minwindef::{BOOL, DWORD, LPARAM, TRUE, WORD},
windef::{HDC, HMONITOR, HWND, LPRECT, POINT},
},
um::{wingdi, winuser},
};
use std::{
collections::{BTreeSet, VecDeque},
io, mem, ptr,
};
use super::util;
use ... | // https://github.com/retep998/winapi-rs/issues/360
// https://github.com/retep998/winapi-rs/issues/396
unsafe impl Send for MonitorHandle {} |
<|file_name|>serial_serial.py<|end_file_name|><|fim▁begin|># Copyright (C) 2016 The BET Development Team
# -*- coding: utf-8 -*-
# This demonstrates how to use BET in serial to sample a serial external model.
# run by calling "python serial_serial.py"
import os
import subprocess
import scipy.io as sio
import bet.sam... | |
<|file_name|>start.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# coding:utf-8
import os
import sys
import time
import traceback
from datetime import datetime
import atexit
# reduce resource request for threading
# for OpenWrt
import threading
try:
threading.stack_size(128 * 1024)
except:
pass
try:... | sys_platform.sys_tray.serve_forever()
else: |
<|file_name|>func_noerror_query_getattr.py<|end_file_name|><|fim▁begin|># pylint:disable=R0201
from OpenOrange import *
from Document import Document
from Label import Label
from SQLTools import codeOrder, monthCode
from datetime import datetime
class AlotmentDoc(Document):
classattr = "classattr"
def getRe... | if specs.Status == 1: |
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
<|fim▁hole|>class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.A... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.