prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>api.rs<|end_file_name|><|fim▁begin|>use std::collections::BTreeMap;
use anyhow::Result;
use lazy_static::lazy_static;
use super::WindowsEmulator;
pub enum CallingConvention {
Stdcall,
Cdecl,
}
pub struct ArgumentDescriptor {
pub ty: String,
pub name: String,
}
pub struct FunctionDesc... | } |
<|file_name|>query-generator.test.js<|end_file_name|><|fim▁begin|>'use strict';
const chai = require('chai'),
expect = chai.expect,
Support = require(__dirname + '/../../support'),
DataTypes = require(__dirname + '/../../../../lib/data-types'),
dialect = Support.getTestDialect(),
_ = require('lodash'),
mom... | expectation: "UPDATE `myTable` SET `bar`=2 WHERE `name` = 'foo'",
context: {options: {omitNull: true}} |
<|file_name|>handleprops.py<|end_file_name|><|fim▁begin|># GUI Application automation and testing library
# Copyright (C) 2006-2018 Mark Mc Mahon and Contributors
# https://github.com/pywinauto/pywinauto/graphs/contributors
# http://pywinauto.readthedocs.io/en/latest/credits.html
# All rights reserved.
#
# Redist... | |
<|file_name|>linux.py<|end_file_name|><|fim▁begin|>from main import KeyboardHandler
import threading
import thread
import pyatspi
def parse(s):
"""parse a string like control+f into (modifier, key).
Unknown modifiers will return ValueError."""
m = 0
lst = s.split('+')
if not len(lst):
retur... | pyatspi.KEY_PRESSED_EVENT,), mask=pyatspi.allModifiers())
pyatspi.Registry.start()
# the keys we registered
keys = {} |
<|file_name|>htmlfontelement.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 cssparser::RGBA;
use dom::attr::Attr;
use dom::bi... | fn SetSize(&self, value: DOMString) {
let element = self.upcast::<Element>(); |
<|file_name|>appservice.py<|end_file_name|><|fim▁begin|># Copyright 2015 OpenMarket Ltd
#
# 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
#<|f... | # Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>"""mysite URL Configuration<|fim▁hole|>The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to ... | |
<|file_name|>jquery.textillate.js<|end_file_name|><|fim▁begin|>/*
* textillate.js
* http://jschr.github.com/textillate
* MIT licensed
*
* Copyright (C) 2012-2013 Jordan Schroter
*/
(function ($) {
"use strict";
function isInEffect (effect) {
return /In/.test(effect) || $.inArray(effect, $.fn.textillate... | |
<|file_name|>admin.js<|end_file_name|><|fim▁begin|>jQuery(document).ready(function($){
$( "#remove_sp_league_menu_logo" ).click(function() {
$( ".sp-league-menu-logo-options" ).hide();
$("<input>").attr({
type: "hidden",
id: "sp_league_menu_logo_removed",<|fim▁hole|> name: "sp_league_menu_logo_rem... | |
<|file_name|>blackberry_pim_Attendee.js<|end_file_name|><|fim▁begin|>/*
* Copyright 2010-2011 Research In Motion Limited.
*
* 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... | */
blackberry.pim.Attendee.DECLINED = 3;
/**
|
<|file_name|>associationTestSuite.py<|end_file_name|><|fim▁begin|>import unittest
from TASSELpy.TASSELbridge import TASSELbridge
from TASSELpy.test.net.maizegenetics.analysis.association.FixedEffectLMPlugin import easy_GLMTest
class associationTestSuite(unittest.TestSuite):
def __init__(self):
super(associ... | self.addTest(unittest.makeSuite(easy_GLMTest))
if __name__ == "__main__":
runner = unittest.TextTestRunner() |
<|file_name|>FlagsSeries.js<|end_file_name|><|fim▁begin|>/* ****************************************************************************
* Start Flags series code *
*****************************************************************************/
var symbols = SVGRenderer.prototype.symbols;
// 1 - set defa... | |
<|file_name|>LanguageIDE.java<|end_file_name|><|fim▁begin|>package com.github.takezoe.xlsbeans;
import com.github.takezoe.xlsbeans.annotation.Column;
import com.github.takezoe.xlsbeans.annotation.MapColumns;
import java.util.Map;
public class LanguageIDE {
private String name;
private Map<String, Stri... | }
|
<|file_name|>test_infofile.py<|end_file_name|><|fim▁begin|># Copyright (C) 2013-2016 2ndQuadrant Italia Srl
#
# This file is part of Barman.
#
# Barman 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 ve... |
# This call should not raise |
<|file_name|>debug.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
debug.py - Functions to aid in debugging
Copyright 2010 Luke Campagnola
Distributed under MIT/X11 license. See license.txt for more information.
"""
from __future__ import print_function
import sys, traceback, time, gc, re, types, weakre... | else:
return [x for x in gc.get_objects() if re.match(regex, type(x).__name__)]
|
<|file_name|>graph_map.rs<|end_file_name|><|fim▁begin|>use typed_map::TypedMemoryMap;
pub struct GraphMMap {
nodes: TypedMemoryMap<u64>,
edges: TypedMemoryMap<u32>,<|fim▁hole|>}
impl GraphMMap {
#[inline(always)]
pub fn nodes(&self) -> usize { self.nodes[..].len() }
#[inline(always)]
pub fn ed... | |
<|file_name|>users.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""Setup the SkyLines application"""
from faker import Faker
from skylines.model import User
def test_admin():
u = User()
u.first_name = u'Example'
u.last_name = u'Manager'
u.email_address = u'manager@somedomain.com'
u.pas... | return u1
|
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>use serde_derive::Serialize;
mod basic;
mod errors;
mod inheritance;
mod macros;
mod square_brackets;
mod whitespace;
#[allow(dead_code)]
#[derive(Debug, Serialize)]
pub struct NestedObject {
pub label: String,
pub parent: Option<Box<NestedObject>>,
pub num... | |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>use chrono::{offset::Utc, DateTime};
use diesel::{self, pg::PgConnection};
use crate::{base_post::post::Post, schema::comments};
pub mod reaction;
#[derive(Debug, Identifiable, Queryable, QueryableByName)]
#[table_name = "comments"]
pub struct Comment {
id: i32,
... | |
<|file_name|>sciond.py<|end_file_name|><|fim▁begin|># Copyright 2014 ETH Zurich
#
# 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... | for cseg in self.core_segments(
first_ia=dseg_ia, last_ia=self.addr.isd_as, sibra=sibra):
res.add((None, cseg, dseg)) |
<|file_name|>dev_settings.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from .common_settings import *
DEBUG = True
TEMPLATE_DEBUG = DEBUG
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'dz(#w(lfve24ck!!yrt3l7$jfdoj+fgf+ru@w)!^gn9aq$s+&y'
<|fim▁hole|> 'ENGINE': 'djan... | DATABASES = {
'default': { |
<|file_name|>IMeasureableEntity.java<|end_file_name|><|fim▁begin|><|fim▁hole|>package com.github.scaronthesky.eternalwinterwars.view.entities;
public interface IMeasureableEntity {
public float getWidth();
public float getHeight();
}<|fim▁end|> | |
<|file_name|>out2_sup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated by generateDS.py.
#
import sys
import getopt
import re as re_
import base64
import datetime as datetime_
etree_ = None
Verbose_import_ = False
(
XMLParser_import_none, XMLParser_import_lxml,
XML... | if 'xsi' in node.nsmap:
classname = node.get('{%s}type' % node.nsmap['xsi'])
if classname is not None:
names = classname.split(':') |
<|file_name|>DialogueBoxSystem.cpp<|end_file_name|><|fim▁begin|>//
// DialogueBoxSystem.cpp
// Chilli Source
// Created by Ian Copland on 04/03/2014.
//
// The MIT License (MIT)
//
// Copyright (c) 2014 Tag Games Limited
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of thi... | |
<|file_name|>manager.py<|end_file_name|><|fim▁begin|># Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except i... | glance.get_remote_image_service(context, image_meta['id'])
self.driver.copy_volume_to_image(context, volume, image_service, |
<|file_name|>build.rs<|end_file_name|><|fim▁begin|>// Copyright (c) 2014 by SiegeLord
//
// All rights reserved. Distributed under ZLib. For full terms see the file LICENSE.
use std::env::var;
fn main()
{
if var("CARGO_FEATURE_LINK_NONE").is_ok()
{
return;<|fim▁hole|>
let debug = match var("CARGO_FEATURE_LINK_DE... | } |
<|file_name|>Content.tsx<|end_file_name|><|fim▁begin|>import styled from "./Theme";
export const Content = styled.div`<|fim▁hole|>`;<|fim▁end|> | margin: 2rem 0;
padding: 5px; |
<|file_name|>union_fields_1_0.rs<|end_file_name|><|fim▁begin|>#![allow(
dead_code,
non_snake_case,
non_camel_case_types,
non_upper_case_globals
)]
#[repr(C)]
pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>);
impl<T> __BindgenUnionField<T> {
#[inline]
pub fn new() -> Self {
... | impl<T> ::std::clone::Clone for __BindgenUnionField<T> {
#[inline] |
<|file_name|>drizzled.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
# -*- mode: python; indent-tabs-mode: nil; -*-
# vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
#
# Copyright (C) 2010,2011 Patrick Crews
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU ... | # (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
<|file_name|>api_samples_test_base.py<|end_file_name|><|fim▁begin|># Copyright 2012 Nebula, Inc.
# Copyright 2013 IBM Corp.
#
# 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
#
# ... | data = re.sub(r'([^"])%\((.+)\)s([^"])', r'\1"%(int:\2)s"\3', data)
return jsonutils.loads(data) |
<|file_name|>register.tsx<|end_file_name|><|fim▁begin|>import React from 'react';
import { addons, types } from '@storybook/addons';
import { ADDON_ID, PANEL_ID, PARAM_KEY } from './constants';
import { VisionSimulator } from './components/VisionSimulator';
import { A11YPanel } from './components/A11YPanel';
import { A... | addons.add(PANEL_ID, {
title: 'Accessibility',
type: types.PANEL, |
<|file_name|>LengthValidator.java<|end_file_name|><|fim▁begin|>package cn.javay.zheng.common.validator;
import com.baidu.unbiz.fluentvalidator.ValidationError;
import com.baidu.unbiz.fluentvalidator.Validator;
import com.baidu.unbiz.fluentvalidator.ValidatorContext;
import com.baidu.unbiz.fluentvalidator.ValidatorHand... | |
<|file_name|>TestConflictingDefinition.py<|end_file_name|><|fim▁begin|>"""Test that types defined in shared libraries work correctly."""
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class TestRealDefinition(TestBase):
mydir = Tes... | "A simple expression should execute correctly",
substrs=[
"42"])
|
<|file_name|>socket.go<|end_file_name|><|fim▁begin|>// Copyright 2016 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
package introspection
import (
"fmt"
"net"
"net/http"
"runtime"
"github.com/juju/errors"
"github.com/juju/loggo"
"gopkg.in/tomb.v1"
"gopkg.in/yaml.v2"
"github.com... | }
bytes, err := yaml.Marshal(s.reporter.Report())
if err != nil {
w.WriteHeader(http.StatusInternalServerError) |
<|file_name|>webhook-notification-spec.js<|end_file_name|><|fim▁begin|>import WebhookNotification, {
LinkClick,
LinkClickCount,
MessageTrackingData,
WebhookDelta,
WebhookObjectAttributes,
WebhookObjectData,
} from '../src/models/webhook-notification';
import { WebhookTriggers } from '../src/models/webhook';... | timestamp: 1602623966,
recents: [
{
ip: '24.243.155.85', |
<|file_name|>subject.cpp<|end_file_name|><|fim▁begin|><|fim▁hole|>/// -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: t -*-
///
/// \file subject.cpp
/// \author Martin Reddy
/// \brief The subject of an observer relationship.
///
/// Copyright (c) 2010, Martin Reddy. All rights reserved.
/// Distributed unde... | |
<|file_name|>ui-grid.language.sv.js<|end_file_name|><|fim▁begin|>/*!
* ui-grid - v4.8.2 - 2019-10-07
* Copyright (c) 2019 ; License: MIT
*/
(function () {
angular.module('ui.grid').config(['$provide', function($provide) {
$provide.decorator('i18nService', ['$delegate', function($delegate) {
$delegate.a... | }]); |
<|file_name|>CommentMgmtService.java<|end_file_name|><|fim▁begin|>/*
* Symphony - A modern community (forum/SNS/blog) platform written in Java.
* Copyright (C) 2012-2017, b3log.org & hacpai.com
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public ... | } |
<|file_name|>driver_alpha_tau_study.py<|end_file_name|><|fim▁begin|># test driver to verify that new version of code works
import opiniongame.config as og_cfg
import opiniongame.IO as og_io
import opiniongame.coupling as og_coupling
import opiniongame.state as og_state
import opiniongame.opinions as og_opinions
import ... | np.random.seed(config.startingseed) |
<|file_name|>selenium_helper.py<|end_file_name|><|fim▁begin|>from selenium.webdriver.support.select import Select
def get_selected_option(browser, css_selector):
# Takes a css selector for a <select> element and returns the value of<|fim▁hole|> # the selected option
select = Select(browser.find_element_by_c... | |
<|file_name|>PageInputBlock.tsx<|end_file_name|><|fim▁begin|>import React, {ChangeEvent, FC} from 'react'
type EntityProps = {
onInput: (e: ChangeEvent<HTMLInputElement>) => any,
label?: string,
error?: string,
placeholder?: string,
pattern?: string,
minlength?: number
}
const PageInputBlock: ... | |
<|file_name|>logging.py<|end_file_name|><|fim▁begin|># standard imports
import os
import logging
import traceback
# Qt imports
from PyQt5.QtCore import pyqtSignal, pyqtSlot
from PyQt5.QtWidgets import QPlainTextEdit
# toolbox imports
from dltb.util.debug import edit
# GUI imports
from ..utils import protect
# loggi... | |
<|file_name|>proxy_test.go<|end_file_name|><|fim▁begin|>// SPDX-License-Identifier: Apache-2.0
// Copyright Authors of Cilium
//go:build privileged_tests
// +build privileged_tests
package dnsproxy
import (
"bytes"
"context"
"encoding/json"
"fmt"
"net"
"sync"
"testing"
"time"
"github.com/golang/groupcache/... |
// Case 8 | EPID3 | DstID1 | 54 | example.com | Rejected | EPID3 is only allowed to ask DstID1 on Port 53 for example.com
allowed, err = s.proxy.CheckAllowed(epID3, 54, dstID1, nil, "example.com") |
<|file_name|>base.py<|end_file_name|><|fim▁begin|>"""Base settings shared by all environments.
This is a reusable basic settings file.
"""
from django.conf.global_settings import *
import os
import sys
import re
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_... | )
MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware', |
<|file_name|>policy_set_result.py<|end_file_name|><|fim▁begin|># coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code... | self.policy_violations = policy_violations |
<|file_name|>AuthRestHandler.java<|end_file_name|><|fim▁begin|>package jp.hashiwa.elasticsearch.authplugin;
import org.apache.logging.log4j.Logger;
import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.bytes.BytesArray;
import org.elasticsearch.common.bytes.BytesReference;
import org.elastic... | } |
<|file_name|>bitcoin_nl.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="nl" version="2.1">
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About ChiliCoin</source>
<translation>Over ChiliCoin<... | <translation>Bevestig de verstuuractie</translation> |
<|file_name|>error.rs<|end_file_name|><|fim▁begin|>use std::error::Error;
use std::fmt::{Display, Formatter, Result};
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct NotConnected;
impl Display for NotConnected {
fn fmt(&self, f: &mut Formatter) -> Result {
write!(f, "NotConnected error: {}", self)... | } |
<|file_name|>ICustomDrawGuiDisplay.java<|end_file_name|><|fim▁begin|>package joshie.progression.api.gui;
<|fim▁hole|>import net.minecraftforge.fml.relauncher.SideOnly;
/** Implement this on rewards, triggers, filters, conditions,
* if you wish to draw something special on them, other than default fields. */
public ... | import net.minecraftforge.fml.relauncher.Side; |
<|file_name|>signatures.go<|end_file_name|><|fim▁begin|>package ct
import (
"crypto"
"crypto/ecdsa"
"crypto/elliptic"
"crypto/rsa"
"crypto/sha256"
"crypto/x509"
"encoding/asn1"
"encoding/pem"
"errors"
//"flag"
"fmt"
"log"
"math/big"
)
var allowVerificationWithNonCompliantKeys = false //flag.Bool("allow_v... | } |
<|file_name|>email_errors.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import json
import logging
import traceback
import time
from google.appengine.api import app_identity, mail, capabilities
from google.appengine.runtime import DeadlineExceededError... | import settings # workaround. See https://github.com/renzon/zenwarch/issues/3
if isinstance(exception, PathNotFound):
self.handler.response.set_status(404) |
<|file_name|>sanitycheck.py<|end_file_name|><|fim▁begin|># jhbuild - a build script for GNOME 1.x and 2.x
# Copyright (C) 2001-2006 James Henstridge
#
# sanitycheck.py: check whether build environment is sane
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Gen... | |
<|file_name|>slice.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/lice... | |
<|file_name|>git_helper.rs<|end_file_name|><|fim▁begin|>use git2::{Repository, Object, BranchType};
use semver::{Version, VersionReq};
use regex::Regex;
use inner::logger::Logger;
pub fn get_latest_commit(repo: &Repository) -> Option<String> {
match repo.head() {
Ok(r) => match r.resolve() {
Ok... | match get_latest_commit(repo) {
Some(ver) => { |
<|file_name|>rest.py<|end_file_name|><|fim▁begin|># This file is part of kytos.
#
# Copyright (c) 2014 by ACK Labs
#
# Authors:
# Beraldo Leal <beraldo AT acklabs DOT io>
# Gabriel von. Winckler <winckler AT acklabs DOT io>
# Gustavo Luiz Duarte <gustavo AT acklabs DOT io>
#
# kytos is free software: you can r... | 'name': fields.String,
'description': fields.String,
'hardware_address': fields.String, |
<|file_name|>interpolators.py<|end_file_name|><|fim▁begin|>"""
Classes for easy interpolation of trajectories and Curves.
Requires Scipy installed.
"""
import numpy as np
class Interpolator:
""" Poorman's linear interpolator, doesn't require Scipy. """
def __init__(self, tt=None, ss=None, ttss = None, le... | fmt="%d", delimiter='\t')
|
<|file_name|>test_pipeline_server.rs<|end_file_name|><|fim▁begin|>#![allow(deprecated)]
extern crate futures;
extern crate tokio_core;
extern crate tokio_proto;
extern crate tokio_service;
extern crate rand;
#[macro_use]
extern crate log;
extern crate env_logger;
use std::cell::RefCell;
use std::io;
use std::sync::M... | assert_eq!(mock.next_write().unwrap_msg(), "resp");
assert_eq!(mock.next_write().unwrap_body(), Some(1)); |
<|file_name|>test.hpp<|end_file_name|><|fim▁begin|>// test
#ifndef TEST_HPP
#define TEST_HPP
<|fim▁hole|>#include <iostream>
#include <cmath>
#include <cassert>
#include "ga.hpp"
#include "ioga.hpp"
#include "ray.hpp"
#include "elem.hpp"
#include "rt.hpp"
#include "grid.hpp"
using namespace std;
#endif<|fim▁end|> | |
<|file_name|>entry.rs<|end_file_name|><|fim▁begin|>//
// imag - the personal information management suite for the commandline
// Copyright (C) 2015-2020 Matthias Beyer <mail@beyermatthias.de> and contributors
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Les... | "gps",
];
let hdr = self.get_header_mut(); |
<|file_name|>elaborate_drops.rs<|end_file_name|><|fim▁begin|>use crate::MirPass;
use rustc_data_structures::fx::FxHashMap;
use rustc_index::bit_set::BitSet;
use rustc_middle::mir::patch::MirPatch;
use rustc_middle::mir::*;
use rustc_middle::ty::{self, TyCtxt};
use rustc_mir_dataflow::elaborate_drops::{elaborate_drop, D... | (false, _, _) => DropStyle::Dead,
(true, false, _) => DropStyle::Static,
(true, true, false) => DropStyle::Conditional, |
<|file_name|>Subject.js<|end_file_name|><|fim▁begin|>namespace("JSTools.Event");
/// <class>
/// Provides an interface for attaching and detaching Observer objects. Any number of
/// Observer objects may observe a subject.
/// </class>
JSTools.Event.Subject = function()
{
//------------------------------------------... | |
<|file_name|>vendor.ts<|end_file_name|><|fim▁begin|>// Angular 2
import '@angular/platform-browser';
import '@angular/platform-browser-dynamic';
import '@angular/core';
import '@angular/common';
import '@angular/http';
import '@angular/router';
import 'rxjs/add/observable/throw';
import 'rxjs/add/observable/of';
impor... | |
<|file_name|>MovieCollection.js<|end_file_name|><|fim▁begin|>import PropTypes from 'prop-types';
import React, { Component } from 'react';
import MonitorToggleButton from 'Components/MonitorToggleButton';<|fim▁hole|>class MovieCollection extends Component {
//
// Lifecycle
constructor(props, context) {
supe... | import EditImportListModalConnector from 'Settings/ImportLists/ImportLists/EditImportListModalConnector';
import styles from './MovieCollection.css';
|
<|file_name|>WebGLRenderGroup.js<|end_file_name|><|fim▁begin|>/**
* @author Mat Groves http://matgroves.com/ @Doormat23
*/
/**
* A WebGLBatch Enables a group of sprites to be drawn using the same settings.
* if a group of sprites all have the same baseTexture and blendMode then they can be
* grouped into a batch.... | while(head.__next != nextRenderable) |
<|file_name|>mod.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/. */
//! Computed values.
use {Atom, Namespace};
use context::QuirksM... | }
}
|
<|file_name|>view.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
__author__ = 'itconsense@gmail.com'
from collections import OrderedDict
from math import pi
from Products.Five import BrowserView
from plone import api
import base64
import logging
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplo... | # We are going to plot the first line of the data frame.
# But we need to repeat the first value to close the circular graph: |
<|file_name|>persistence_strategies.py<|end_file_name|><|fim▁begin|>__author__ = 'dkador'
class BasePersistenceStrategy(object):
"""
A persistence strategy is responsible for persisting a given event
somewhere (i.e. directly to Keen, a local cache, a Redis queue, etc.)
"""
def persist(self, event... | |
<|file_name|>Footer.js<|end_file_name|><|fim▁begin|>// @flow
/* **********************************************************
* File: Footer.js
*
* Brief: The react footer component
*
* Authors: Craig Cheney, George Whitfield
*
* 2017.04.27 CC - Document created
*
********************************************************* ... | }; |
<|file_name|>common.js<|end_file_name|><|fim▁begin|>/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
http://dojotoolkit.org/community/licensing.shtml... | // flags.max A number, which the value must be less than or equal to for the validation to be true.
// flags.min A number, which the value must be greater than or equal to for the validation to be true.
// flags.decimal The character used for the decimal point. Default is ".".
|
<|file_name|>version.rs<|end_file_name|><|fim▁begin|>use crate::internal::consts;
// ========================================================================= //
/// The CFB format version to use.
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub enum Version {
/// Version 3, which uses 512-... | |
<|file_name|>Visitor.java<|end_file_name|><|fim▁begin|>/*
*******************************************************************************
* Copyright (C) 2002-2012, International Business Machines Corporation and *
* others. All Rights Reserved. *
******************... | doAt(last = c[i]); |
<|file_name|>object-does-not-impl-trait.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www... | |
<|file_name|>AvgAggFunction.java<|end_file_name|><|fim▁begin|>/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you ... | public DataType[] getAggBufferTypes() {
return new DataType[] {getSumType(), DataTypes.BIGINT()};
}
|
<|file_name|>sf_tuto.py<|end_file_name|><|fim▁begin|>import time<|fim▁hole|>import camkifu.stone
from camkifu.core import imgutil
class StonesFinderTuto(camkifu.stone.StonesFinder):
""" This class has been used to write a tutorial on how to create a new StonesFinder.
Run Camkifu with this class as the defaul... |
import numpy
from golib.config.golib_conf import gsize, B, W, E
|
<|file_name|>format.py<|end_file_name|><|fim▁begin|>"""Definitions for output formats."""
import collections
from enum import Enum, unique
__copyright__ = 'Copyright 2021, 3Liz'
__license__ = 'GPL version 3'
__email__ = 'info@3liz.org'
format_output = collections.namedtuple('format', ['label', 'driver_name', 'exten... |
GeoPackage = format_output('GeoPackage', 'GPKG', 'gpkg')
"""GeoPackage"""
|
<|file_name|>jquery.ui.datepicker-ms.js<|end_file_name|><|fim▁begin|>/* Malaysian initialisation for the jQuery UI date picker plugin. */
/* Written by Mohd Nawawi Mohamad Jamili (nawawi@ronggeng.net). */
jQuery(function ($) {
$.datepicker.regional['ms'] = {
closeText: 'Tutup',
prevText: '<Sebelum',
nextTex... | |
<|file_name|>descriptor.js<|end_file_name|><|fim▁begin|>// Copyright (C) 2017 Mozilla Corporation. All rights reserved.<|fim▁hole|>// This code is governed by the license found in the LICENSE file.
/*---
esid: sec-atomics.islockfree
description: Testing descriptor property of Atomics.add
includes: [propertyHelper.js]
... | |
<|file_name|>taggerscript.js<|end_file_name|><|fim▁begin|>/*
Language: Tagger Script
Author: Philipp Wolfer <ph.wolfer@gmail.com>
Description: Syntax Highlighting for the Tagger Script as used by MusicBrainz Picard.
Website: https://picard.musicbrainz.org<|fim▁hole|>function(hljs) {
var COMMENT = {
className: 'c... | */ |
<|file_name|>0007_create_allocation_strategy_and_behaviors.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def do_nothing(apps, schema_editor):
pass
def create_new_behaviors_and_strategies(apps, schema_editor):
Countin... | 'db_table': 'allocation_strategy', }, bases=(
models.Model,), ), migrations.CreateModel(
name='CountingBehavior', fields=[ |
<|file_name|>main.py<|end_file_name|><|fim▁begin|>import argparse
from PGEnv import PGEnvironment
from PGAgent import PGAgent
if __name__ == '__main__':
parser = argparse.ArgumentParser()<|fim▁hole|> parser.add_argument('--gym_environment', type=str, default='Pong-v0',
help='OpenAI Gym ... | |
<|file_name|>fabfile.py<|end_file_name|><|fim▁begin|>from fabric import api as fab
from contextlib import contextmanager<|fim▁hole|>@contextmanager
def with_vagrant():
with fab.settings(user="vagrant",host_string="127.0.0.1:2222",key_filename=".vagrant/machines/minecraft/virtualbox/private_key"):
yield
def... | |
<|file_name|>cell_range.rs<|end_file_name|><|fim▁begin|>// Copyright 2015 The Noise-rs Developers.
//
// 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... | // distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and |
<|file_name|>surface.rs<|end_file_name|><|fim▁begin|>// Copyleft (ↄ) meh. <meh@schizofreni.co> | http://meh.schizofreni.co
//
// This file is part of cancer.
//
// cancer 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 ... | |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>// We only need to import the modules necessary for initial render
import CoreLayout from '../layouts/CoreLayout';
import Home from './Home';
import CounterRoute from './Counter';
/* Note: Instead of using JSX, we recommend using react-router
PlainRoute objects t... | |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>'use strict';
<|fim▁hole|>require('./components/active-link');<|fim▁end|> | require('./components/dropdown'); |
<|file_name|>c_form.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import flt
from frappe import _
from frappe.model.document import... |
def on_update(self):
""" Update C-Form No on invoices"""
self.set_total_invoiced_amount() |
<|file_name|>EmberConsoleNcpValueCommand.java<|end_file_name|><|fim▁begin|>/**
* Copyright (c) 2016-2019 by the respective copyright holders.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distributi... |
@Override
public String getSyntax() {
return "[VALUEID] [VALUE]"; |
<|file_name|>nb.js<|end_file_name|><|fim▁begin|>/*! Select2 4.0.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function () {
if (jQuery && jQuery.fn && jQuery.fn.select2 && jQuery.fn.select2.amd)var e = jQuery.fn.select2.amd;
return e.define("select2/i18n/nb", [], function () {
return {<|fim... | inputTooLong: function (e) {
var t = e.input.length - e.maximum;
return "Vennligst fjern " + t + " tegn"
}, inputTooShort: function (e) { |
<|file_name|>test.js<|end_file_name|><|fim▁begin|>'use strict';
module.exports = {
db: 'mongodb://localhost/equinix-test',
port: 3001,
app: {
title: 'Equinix - Test Environment'
},
facebook: {
clientID: process.env.FACEBOOK_ID || 'APP_ID',
clientSecret: process.env.FACEBOOK_SECRET || 'APP_SECRET',
callbac... | linkedin: {
clientID: process.env.LINKEDIN_ID || 'APP_ID', |
<|file_name|>fall.py<|end_file_name|><|fim▁begin|>#
# Copyright (C) 2016 Dang Duong
#
# This file is part of Open Tux World.
#
# Open Tux World 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, ei... | own.worldOrientation[2] = [0.0,0.0,1.0]
own.state = logic.KX_STATE2 |
<|file_name|>view.py<|end_file_name|><|fim▁begin|># Copyright (C) 2008, One Laptop Per Child
# Copyright (C) 2009, Tomeu Vizoso
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2... | |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//! [Flexible target specification.](https://github.com/rust-lang/rfcs/pull/131)
//!
//! Rust targets a wide variety of usecases, and in the interest of flexibility,
//! allows new target triples to be defined in configuration files. Most users
//! will not need to care ... | Use 'em', 'gcc', 'ld' or 'msvc'", name, k)
})?; |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>var Transform = require('stream').Transform,
util = require('util');
var StreamConcat = function(streams, options) {
Transform.call(this, options);
var self = this;
this.streams = streams;
this.canAddStream = true;
this.currentStream = null;
this.str... | callback(null, chunk); |
<|file_name|>0129_auto_20170815_0946.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-08-15 09:46
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.M... | ('role', models.CharField(choices=[('OW', 'Owner'), ('AD', 'Admin'), ('RE', 'Reviewer'), ('VE', 'Viewer')], max_length=2)),
('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
), |
<|file_name|>about_dictionaries.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Based on AboutHashes in the Ruby Koans
#
from runner.koan import *
class AboutDictionaries(Koan):
def test_creating_dictionaries(self):
empty_dict = dict()
self.assertEqual(dict, typ... | |
<|file_name|>HeartBeatQueryListenWorker.java<|end_file_name|><|fim▁begin|>/*-
* <<
* UAVStack
* ==
* Copyright (C) 2016 - 2017 UAVStack
* ==
* 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... | import com.creditease.agent.spi.HttpMessage;
public class HeartBeatQueryListenWorker extends AbstractHttpServiceComponent<UAVHttpMessage> {
|
<|file_name|>pattern_substs_on_brace_struct.rs<|end_file_name|><|fim▁begin|>#![feature(nll)]
struct Foo<'a> { field: &'a u32 }
fn in_let() {
let y = 22;
let foo = Foo { field: &y };
//~^ ERROR `y` does not live long enough
let Foo::<'static> { field: _z } = foo;
}
fn in_main() {
let y = 22;<|fim▁... | let foo = Foo { field: &y };
//~^ ERROR `y` does not live long enough
match foo { |
<|file_name|>advanced_lane_finding-direction_of_the_gradient_exercise.py<|end_file_name|><|fim▁begin|>import numpy as np
import cv2
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import pickle
# Read in an image
image = mpimg.imread('signs_vehicles_xygrad.png')
# Define a function that applies Sobe... | # 3) Take the absolute value of the x and y gradients |
<|file_name|>nfs_cmode.py<|end_file_name|><|fim▁begin|># Copyright (c) 2012 NetApp, Inc. All rights reserved.
# Copyright (c) 2014 Ben Swartzlander. All rights reserved.
# Copyright (c) 2014 Navneet Singh. All rights reserved.
# Copyright (c) 2014 Clinton Knight. All rights reserved.
# Copyright (c) 2014 Alex Meade... | pool['netapp_mirrored'] = six.text_type(mirrored).lower()
pool['netapp_unmirrored'] = six.text_type(not mirrored).lower() |
<|file_name|>prism.js<|end_file_name|><|fim▁begin|>/* http://prismjs.com/download.html?themes=prism&languages=git&plugins=line-numbers */
self = (typeof window !== 'undefined')
? window // if in browser
: (
(typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope)
? self // if in worker
... | if (after) { |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.