prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>main.js<|end_file_name|><|fim▁begin|>container_interval_id = 0;
password_interval_id = 0;
distro_image = 'ubuntu.svg';
// Shows a message
// Leave text empty to hide message
// error is a boolean deciding whether or not to add an error class
function message(text, error) {
var message = docume... | onResize(el, callback);
|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import re
from DelogX.utils.i18n import I18n
from DelogX.utils.path import Path
from DelogX.utils.plugin import Plugin
class DelogReadMore(Plugin):
i18n = None
def run(self):
<|fim▁hole|> self.i18n = I18n(
... | conf = self.blog.default_conf
|
<|file_name|>algorithm.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#######################################################
# Copyright (c) 2015, ArrayFire
# All rights reserved.
#
# This file is distributed under 3-clause BSD license.
# The complete license agreement can be obtained at:
# http://arrayfire.co... | display_func(af.any_true(a, 1))
|
<|file_name|>simple_space_heating_mpc.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
################################################################################
# Copyright 2015 Brecht Baeten
# This file is part of mpcpy.
#
# mpcpy is free software: you can redistribute it and/or modify
# it und... | 'UA_in_am': 200,
'UA_em_in': 1600
} |
<|file_name|>websearch_regression_tests.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General P... | <subfield code="c">2001-06-14</subfield> |
<|file_name|>rule_forin.js<|end_file_name|><|fim▁begin|>var array = trace ( new Array());
var m = trace ( 0 );
var n = trace ( 3 );
var o = trace ( 5 );
var p = trace ( 7 );
<|fim▁hole|>array[0] = m;
array[1] = n;
array[2] = o;
array[3] = p;
var result = new Array();
// FOR-IN Schleife
for ( i in arra... | |
<|file_name|>paginators.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import abc
import math
import six
import sqlalchemy as sa
from marshmallow_sqlalchemy.convert import ModelConverter
from marshmallow_pagination import pages
converter = ModelConverter()
def convert_value(row, attr):
field = convert... |
class OffsetPaginator(BasePaginator):
"""Paginator based on offsets and limits. Not performant for large result sets. |
<|file_name|>spsr_model.js<|end_file_name|><|fim▁begin|>define(function(require) {
var Model = require("web/common/model");<|fim▁hole|> name: "SDI1",
kzck: 0,
ydsd: 0,
srjkxh: 0,
ld: 123,
dbd: 124,
bhd: 125,
sppy: 126,
czpy: 127
},
urls: {
"create": "spsr.psp",
"update": "spsr.p... |
var SpsrModel = Model.extend({
idAttribute: "recordId",
defaults: { |
<|file_name|>setvar2.py<|end_file_name|><|fim▁begin|><|fim▁hole|>year = 2015
print(year)<|fim▁end|> | |
<|file_name|>test_assumptions.py<|end_file_name|><|fim▁begin|>from sympy import I, sqrt, log, exp, sin, asin, factorial
from sympy.core import Symbol, S, Rational, Integer, Dummy, Wild, Pow
from sympy.core.facts import InconsistentAssumptions
from sympy import simplify
from sympy.core.compatibility import range
from s... | |
<|file_name|>text.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/. */
//! Text layout.
use layout::box_::{Box, ScannedTextBox, Scanne... | let is_singleton = self.clump.length() == 1;
let is_text_clump = match in_boxes[self.clump.begin()].specific {
UnscannedTextBox(_) => true, |
<|file_name|>e2e_test.go<|end_file_name|><|fim▁begin|>/*
Copyright 2015 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unles... | RunE2ETests(t)
} |
<|file_name|>test_switch.py<|end_file_name|><|fim▁begin|>"""Tests for 1-Wire devices connected on OWServer."""
import copy
from unittest.mock import patch
import pytest
from homeassistant.components.onewire.switch import DEVICE_SWITCHES
from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN
from homeassi... | for (key, value) in MOCK_OWPROXY_DEVICES.items()
if SWITCH_DOMAIN in value
}
|
<|file_name|>linspace_test.py<|end_file_name|><|fim▁begin|># Copyright 2020 The IREE Authors
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
from absl import app
from iree.tf.support i... | |
<|file_name|>controller.js<|end_file_name|><|fim▁begin|>(function() {
'use strict';
/**
* Get the main module (shared for Workout).
*/
angular.module(appName)
/**<|fim▁hole|>
ConfirmBooking.$inject = ['$state', '$filter', '$http', 'config', '$location','CommonService','BookingDataServ... | * Login Controller.
*/
.controller('ConfirmBookingController', ConfirmBooking); |
<|file_name|>test_vmwareapi_vm_util.py<|end_file_name|><|fim▁begin|># vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
# Copyright 2013 Canonical Corp.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not ... | DynamicProperty(name='name', val=MoRef(value='vm-123'))]),
ObjectContent(propSet=[ |
<|file_name|>event_importer.py<|end_file_name|><|fim▁begin|>from datetime import datetime, date, time
from HTMLParser import HTMLParser
import random
import urllib2
from django.conf import settings
from django.db import transaction
from django.db.models import Q
from django.utils import timezone
from icalendar import ... | rset.exdate(to_utc(dt.dt)) |
<|file_name|>app.component.ts<|end_file_name|><|fim▁begin|>import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html'
})
export class AppComponent {
marks: any =
{
colorRemaining: { color: '#373636', border: '#373636' },
colorProg... | };
} |
<|file_name|>thresholding.py<|end_file_name|><|fim▁begin|>__all__ = ['threshold_adaptive',
'threshold_otsu',
'threshold_yen',
'threshold_isodata',
'threshold_li', ]
import numpy as np
from scipy import ndimage as ndi
from ..exposure import histogram
from .._shared.utils impo... | |
<|file_name|>test_signals.py<|end_file_name|><|fim▁begin|>from datetime import datetime
from django.test import TestCase
from simple_history.signals import (
post_create_historical_record,
pre_create_historical_record,
)
from ..models import Poll<|fim▁hole|>
class PrePostCreateHistoricalRecordSignalTest(Test... |
today = datetime(2021, 1, 1, 10, 0)
|
<|file_name|>userassist_test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2012 The Plaso Project Authors.
# Please see the AUTHORS file for details on individual authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in ... |
expected_timestamp = timelib_test.CopyStringToTimestamp(
'2010-11-10 07:49:37.078067')
self.assertEquals(event_object.timestamp, expected_timestamp) |
<|file_name|>thread.rs<|end_file_name|><|fim▁begin|>// "Tifflin" Kernel
// - By John Hodge (thePowersGang)
//
// Core/threads/thread.rs
//! Representation of an active thread
/**
* Ownership
* =========
*
* The `Thread` struct is owned by the thread itself (the pointer stored within TLS)
* however, it po... |
pub fn get_process_local<T: Send+Sync+::core::marker::Reflect+Default+'static>(&self) -> Option<::lib::mem::aref::ArefBorrow<T>> {
|
<|file_name|>Languages.ts<|end_file_name|><|fim▁begin|>import { State } from '../Reducer/reducers';
<|fim▁hole|><|fim▁end|> | export function selectCurrentEditorLanguage(store: State) {
return store.global.languages.currentEditorLanguageCode;
} |
<|file_name|>gen_sample.rs<|end_file_name|><|fim▁begin|>use async_trait::*;
use futures::channel::mpsc::{channel, Receiver, Sender};
use futures::executor::LocalPool;
use futures::sink::SinkExt;
use futures::stream::StreamExt;
use futures::task::LocalSpawnExt;
use macro_test::gen_sample::*;
use pasta_core::Scriptor;
us... | 0u32
} |
<|file_name|>jSignerFastTest.java<|end_file_name|><|fim▁begin|>package it.everin.ui;
import static org.junit.Assert.*;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
public class jSignerFastTest {
@BeforeClass<|fim▁hole|>
@AfterClass
public static void tearDownAfterClass() thro... | public static void setUpBeforeClass() throws Exception {
} |
<|file_name|>ShardingManager.js<|end_file_name|><|fim▁begin|>const path = require('path');
const fs = require('fs');
const EventEmitter = require('events').EventEmitter;
const Shard = require('./Shard');
const Collection = require('../util/Collection');
const Util = require('../util/Util');
/**
* This is a utility cl... | /** |
<|file_name|>exec.js<|end_file_name|><|fim▁begin|>function dec(target, name, descriptor) {
assert(target);
assert.equal(typeof name, "string");
assert.equal(typeof descriptor, "object");
target.decoratedProps = (target.decoratedProps || []).concat([name]);
let value = descriptor.value;
Object.assign(descr... | @dec
enumconf(){
return 2; |
<|file_name|>PortableMemoryAllocatorChunk.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 fi... | /** Array offset: byte. */
protected static final long BYTE_ARR_OFF = UNSAFE.arrayBaseOffset(byte[].class);
/** Buffer size re-check frequency. */ |
<|file_name|>directiveHostEventsPlugin.ts<|end_file_name|><|fim▁begin|>import {DirectiveDefinitionEvent, DirectiveDefinitionType} from '@slicky/core/metadata';
import {forEach, exists} from '@slicky/utils';
import {OnProcessElementArgument} from '@slicky/templates-compiler';
import {BuilderFunction} from '@slicky/templ... | |
<|file_name|>nw_threat_2_file_attachment.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Copyright (C) 2012 nwmaltego Developer.
# This file is part of nwmaltego - https://github.com/bostonlink/nwmaltego
# See the file 'LICENSE' for copying permission.
# Netwitness Threat to Filename Maltego transform
# Author... | |
<|file_name|>ssdeep_analytics.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
'''
Set of analytics based on ssdeep hash.
- compare
Simple implementation of ssdeep comparisions using a few optimizations
described at the links below
https://www.virusbulletin.com/virusbulletin/2015/11/optimizing-ssdee... | |
<|file_name|>session_recording.py<|end_file_name|><|fim▁begin|># Source Generated with Decompyle++
# File: session_recording.pyc (Python 2.5)
from __future__ import absolute_import
from pushbase.session_recording_component import FixedLengthSessionRecordingComponent
class SessionRecordingComponent(FixedLengthSessionR... | |
<|file_name|>edit_server.rs<|end_file_name|><|fim▁begin|>// Copyright 2016 Matthew Collins
//
// 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... | elements.add(re);
elements.add(tre); |
<|file_name|>data.ts<|end_file_name|><|fim▁begin|>import { expect } from 'chai'
import { Component } from '../../../dist/index'
describe('data decorator', () => {
it('it should be able to do simple binding', () => {
@Component({
template: '<div id="foo"><div class="text">{{text}}</div></div>'
})
cl... | }
}
const vm = new Foo()['$mount']() |
<|file_name|>privacy1.rs<|end_file_name|><|fim▁begin|>// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licens... | |
<|file_name|>authenticated_client.py<|end_file_name|><|fim▁begin|>#
# GDAX/AuthenticatedClient.py
# Daniel Paquin
#
# For authenticated requests to the GDAX exchange
import hmac
import hashlib
import time
import requests
import base64
import json
from requests.auth import AuthBase
from gdax.public_client import Public... | |
<|file_name|>run.go<|end_file_name|><|fim▁begin|>package run
import (
"archive/tar"
"bytes"
"fmt"
"io"
"strings"
"github.com/docker/engine-api/types"
"github.com/docker/engine-api/types/container"
"github.com/docker/go-connections/nat"
"github.com/golang/glog"
"github.com/openshift/origin/pkg/oc/bootstrap/... | for _, c := range c.Cmd {
fmt.Fprintf(out, " %s\n", c)
} |
<|file_name|>manage.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "travis-ci.settings")
<|fim▁hole|> from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)<|fim▁... | |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>export * from "./src/worldmap";
import * as ngworldmap from "./src/worldmap";<|fim▁hole|><|fim▁end|> | export default ngworldmap; |
<|file_name|>02-constraint.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
from __future__ import unicode_literals
from builtins import str, bytes, dict, int
import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", ".."))
from pattern.search import search, Pattern, ... | m = search("rabbit stare at feet", s) |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>pub use self::charset::Charset;
pub use self::encoding::Encoding;
pub use self::entity::EntityTag;
pub use self::httpdate::HttpDate;
pub use self::language::Language;
pub use self::quality_item::{Quality, QualityItem, qitem, q};
<|fim▁hole|>mod charset;
mod encoding;
mod... | |
<|file_name|>h264_depacketizer_fuzzer.cc<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
*<|fim▁hole|> * tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHOR... | * Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source |
<|file_name|>trait-attributes.rs<|end_file_name|><|fim▁begin|>// Copyright 2018 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.or... | |
<|file_name|>test_handlers.py<|end_file_name|><|fim▁begin|>from log4mongo.handlers import MongoHandler
from pymongo.errors import PyMongoError
from StringIO import StringIO
import unittest
import logging
import sys
class TestMongoHandler(unittest.TestCase):
host_name = 'localhost'
database_name = 'log4mongo_te... | self.log.removeHandler(self.handler)
self.log = None
self.handler = None
sys.stderr.close() |
<|file_name|>resource_aws_appautoscaling_target_test.go<|end_file_name|><|fim▁begin|>package aws
import (
"fmt"
"regexp"
"testing"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/service/applicationautoscaling"
"github.com/hashicorp/terraform/helper/acctest"
"... | resource.TestCheckResourceAttr("aws_appautoscaling_target.bar", "service_namespace", "elasticmapreduce"), |
<|file_name|>GameRoutes.ts<|end_file_name|><|fim▁begin|>import * as express from "express";
import { GameDashboardController } from "../controllers/GameDashboardController";
import { GameLobbyController } from "../controllers/GameLobbyController";
var router = express.Router();
export class GameRoutes {
private ga... |
get routes() {
router.get("/games", this.gameDashboardController.retrieve);
router.post("/games", this.gameDashboardController.create); |
<|file_name|>valid_calc_excavation.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Shellscript to verify r.gwflow calculation, this calculation is based on
# the example at page 167 of the following book:
# author = "Kinzelbach, W. and Rausch, R.",
# title = "Grundwassermodellierung",
# publisher = "Gebr{\"u}de... | grass.run_command("r.mapcalc", expression="null=0.0")
#compute a steady state groundwater flow |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>use iron::prelude::*;
use mount::Mount;
use config::CONFIG;
mod handlers;
pub fn serve() {
let mut mount = Mount::new();
mount.mount("/pullrequests/",
router!(get "/" => handlers::pull_requests));
mount.mount("/issues/", router!(get "/" =>... | // middleware goes here
let server_addr = format!("0.0.0.0:{}", CONFIG.server_port); |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models<|fim▁hole|>
from jokeregistryweb.jokes.models import Joke
class Claim(models.Model):
'''A claim of prior art (or infringement)'''
FILED = 0
APPROVED = 1
REJECTED = 2
STATUS_CHOICES = (
(FILED, 'Filed'),
... | |
<|file_name|>zonefile_test.go<|end_file_name|><|fim▁begin|>package zonefile_test
import (
"bytes"
"fmt"
"github.com/bwesterb/go-zonefile"
"testing"
)
// XXX more tests for AddEntry.
// XXX test Value() and SetValue()
// Loading and saving a zonefile shouldn't do anything
func TestLoadThenSave(t *testing.T) {<|fi... | |
<|file_name|>clone.rs<|end_file_name|><|fim▁begin|>//! The `Clone` trait for types that cannot be 'implicitly copied'.
//!
//! In Rust, some simple types are "implicitly copyable" and when you
//! assign them or pass them as arguments, the receiver will get a copy,
//! leaving the original value in place. These types d... | } |
<|file_name|>x86_64.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>pub const UL_SETFSIZE: ::int_t = 2;<|fim▁end|> | pub const UL_GETFSIZE: ::int_t = 1; |
<|file_name|>games.js<|end_file_name|><|fim▁begin|>'use strict';
/**
* Module dependencies.
*/
var mongoose = require('mongoose'),
Game = mongoose.model('Game'),
Team = mongoose.model('Team'),
Player = mongoose.model('Player'),
async = require('async');
exports.all = function(req, res) {
Game.find({'playe... | callback(err);
} else {
callback();
} |
<|file_name|>codegen.rs<|end_file_name|><|fim▁begin|>use std::os::raw::c_char;
use std::collections::{HashSet, HashMap};
use std::process::Command;
use llvm_sys::prelude::*;
use llvm_sys::core::*;
use type_check::*;
use type_check::Type::*;
use inc::*;
trait ToRaw: Into<Vec<u8>> {
fn to_raw(self) -> Result<*cons... | Direct => {
let name = try!((*key).to_raw());
let phi = |
<|file_name|>test.py<|end_file_name|><|fim▁begin|># test.py (c) Mikhail Mezyakov <mihail265@gmail.com>
# Released under the GNU GPL v.3
#
# Module sends "success" message to user on a channel
<|fim▁hole|>def horo(channel, user, args):
"""Send "success" message if everything is ok"""
return u'PRIVMSG {channel}... | |
<|file_name|>GenericCallbackDevice.java<|end_file_name|><|fim▁begin|>/*
* Biocep: R-based Platform for Computational e-Science.
*
* Copyright (C) 2007-2009 Karim Chine - karim.chine@m4x.org
*
* This program is free software: you can redistribute it and/or modify
<|fim▁hole|> *
* This program is distributed ... | * 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 later version.
|
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright Google LLC All Rights Reserved.<|fim▁hole|>
import {Component, NgModule} from '@angular/core';
import {BrowserModule} from '@angular/platform-browser';
import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
@Component({s... | *
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/ |
<|file_name|>sysconfig_pypy.py<|end_file_name|><|fim▁begin|>"""Provide access to Python's configuration information.
This is actually PyPy's minimal configuration information.
The specific configuration variables available depend heavily on the
platform and configuration. The values may be retrieved using
get_config_... | compiler.linker_so.extend(ldflags)
|
<|file_name|>quantize.py<|end_file_name|><|fim▁begin|># Copyright 2017 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.apache.o... | is_training=is_training,
narrow_range=True,
vars_collection=vars_collection)
|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""generated file, don't modify or your data will be lost"""<|fim▁hole|><|fim▁end|> | try:
__import__('pkg_resources').declare_namespace(__name__)
except ImportError:
pass |
<|file_name|>askView_test.py<|end_file_name|><|fim▁begin|>"""Contain the AskViewTests class"""
import unittest
import os
import tempfile
import datetime
import json
import humanize
from shutil import copyfile
from pyramid import testing
from pyramid.paster import get_appsettings
from askomics.libaskomics.ParamManage... | |
<|file_name|>main.py<|end_file_name|><|fim▁begin|># Copyright 2017 Thomas Sterrenburg
#
# Licensed under the MIT License (the License); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at https://opensource.org/licenses/MIT#
import glob
import re
import sys
imp... | else: |
<|file_name|>AbstractGalleryItemRenderer.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
* Copyright (c) 2006-2007 Nicolas Richeton.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclips... | * @param gc
* @param x
* @param y
* @param ratio |
<|file_name|>json.go<|end_file_name|><|fim▁begin|>// Copyright 2020 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
package azuretesting
import (
"encoding/json"
"reflect"
)
// JsonMarshalRaw does the same a json.Marshal, except that it does not
// use the MarshalJSON methods of the valu... | return m.rawStructValue(v) |
<|file_name|>fluent.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# encoding: utf8
# license: ISC (MIT/BSD compatible) https://choosealicense.com/licenses/isc/
# This library is principally created for python 3. However python 2 support may be doable and is welcomed.
"""Use python in a more object oriented, ... | |
<|file_name|>test_project_processingissues.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
from datetime import datetime
from django.utils import timezone
from django.core.urlresolvers import reverse
from sentry.models import (
ProcessingIssue, EventError, RawEvent, EventProcessingIssue
)
f... |
def test_issues(self):
self.login_as(user=self.user) |
<|file_name|>no-data-to-display.src.js<|end_file_name|><|fim▁begin|>/**
* @license Highstock JS v2.1.4 (2015-03-10)
* Plugin for displaying a message when there is no data visible in chart.
*
* (c) 2010-2014 Highsoft AS
* Author: Oystein Moseng
*
* License: www.highcharts.com/license
*/
(function (H) {
var ... | function hasDataPie() {
return !!this.points.length; /* != 0 */ |
<|file_name|>coherence_local_err_tuple.rs<|end_file_name|><|fim▁begin|>// Test that we are able to introduce a negative constraint that
// `MyType: !MyTrait` along with other "fundamental" wrappers.
// aux-build:coherence_copy_like_lib.rs<|fim▁hole|>struct MyType { x: i32 }
// These are all legal because they are all... | #![allow(dead_code)]
extern crate coherence_copy_like_lib as lib;
|
<|file_name|>Drive.java<|end_file_name|><|fim▁begin|>package org.usfirst.frc.team6135.robot.subsystems;
import java.awt.geom.Arc2D.Double;
import org.usfirst.frc.team6135.robot.RobotMap;
import org.usfirst.frc.team6135.robot.commands.teleopDrive;
import com.kauailabs.navx.frc.AHRS;
import edu.wpi.first.wpilibj.ADXRS... | |
<|file_name|>MyDateUtil.java<|end_file_name|><|fim▁begin|>package com.project.library.utils;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;<|fim▁hole|>@Component
public class MyDateUtil {
public Date calculateDate(String currentDate, int... | import java.util.Date;
import org.springframework.stereotype.Component;
|
<|file_name|>gallery.component.ts<|end_file_name|><|fim▁begin|>import { Component } from '@angular/core'
@Component({
selector: 'gallery',
templateUrl: 'app/home/gallery.component.html'
})<|fim▁hole|><|fim▁end|> |
export class GalleryComponent {
} |
<|file_name|>CamelChronicleTest.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... |
@Ignore
@RunWith(PaxExam.class) |
<|file_name|>fixunoproj.js<|end_file_name|><|fim▁begin|>var fusepm = require('./fusepm');
module.exports = fixunoproj;
function fixunoproj () {
var fn = fusepm.local_unoproj(".");
fusepm.read_unoproj(fn).then(function (obj) {
var inc = [];
if (obj.Includes) {
var re = /\//;
for (var i=0; i<obj.Includes.le... | else {
inc.push(obj.Includes[i]);
}
|
<|file_name|>websocketproxy.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
'''
A WebSocket to TCP socket proxy with support for "wss://" encryption.
Copyright 2011 Joel Martin
Licensed under LGPL version 3 (see docs/LICENSE.LGPL-3)
You can make a cert/key with openssl using:
openssl req -new -x509 -days 365 -n... | |
<|file_name|>folder_detector.py<|end_file_name|><|fim▁begin|>import os
import numpy as np
import torch
from ..core import FaceDetector
class FolderDetector(FaceDetector):
'''This is a simple helper module that assumes the faces were detected already
(either previously or are provided as ground t... | |
<|file_name|>ioctl_structs.rs<|end_file_name|><|fim▁begin|>pub use super::{InterfaceNameTooLong, InterfaceNameTooShort, GetTapDescriptorResult};
static IFNAMSIZ: uint = 16;
static PADDINGSIZE: uint = 22;
static IFF_TAP: u16 = 2;
static IFF_NO_PI: u16 = 0x1000;
// A struct to pass to ioctl to create a new tap device.... | }
};
} |
<|file_name|>selection.rs<|end_file_name|><|fim▁begin|>// Copyright 2018 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
/... | SelectionState::SelectedRoad(id, current_turn_index),
animation::EventLoopMode::InputOnly,
)
} |
<|file_name|>confAbstractBook.py<|end_file_name|><|fim▁begin|>from MaKaC.webinterface.rh import conferenceDisplay
def index(req,**params):
return conferenceDisplay.RHAbstractBook(req).process(params)
def test(req,**params):<|fim▁hole|><|fim▁end|> | return conferenceDisplay.RHAbstractBook(req).process(params) |
<|file_name|>LinkButton.js<|end_file_name|><|fim▁begin|>import Button from './Button';
/**
* The `LinkButton` component defines a `Button` which links to a route.
*
* ### Props
*
* All of the props accepted by `Button`, plus:
*
* - `active` Whether or not the page that this button links to is currently
* act... | export default class LinkButton extends Button { |
<|file_name|>slow_splitters.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""Alternate versions of the splitting functions for testing."""
from __future__ import unicode_literals
import unicodedata
from natsort.compat.py23 import PY_VERSION
if PY_VERSION >= 3.0:
long = int
def int_splitter(x, signed, ... | nums = [char] |
<|file_name|>0019_baseresource_locked_time.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
<|fim▁hole|>
operations = [
migrations.AddField(
model_name='baseresource'... | dependencies = [
('hs_core', '0018_merge'),
] |
<|file_name|>VersionedGestureDetector.java<|end_file_name|><|fim▁begin|>package org.zarroboogs.weibo.widget.galleryview;
import android.annotation.TargetApi;
import android.content.Context;
import android.os.Build;
import android.util.FloatMath;
import android.view.MotionEvent;
import android.view.ScaleGestureDetecto... | public abstract boolean onTouchEvent(MotionEvent ev); |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licens... | |
<|file_name|>associated-const-ambiguity-report.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<|fim▁h... | // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license |
<|file_name|>question-4-1.js<|end_file_name|><|fim▁begin|>var answers = [];
var validate = () => {
$("#afev-answer-1").animate(
{ backgroundColor: "green"}<|fim▁hole|> good = false;
}
if (answers.indexOf(2) !== -1) {
$("#afev-answer-2").animate(
{ backgroundColor: "red"}
... | );
var good = true;
if (answers.indexOf(1) === -1) { |
<|file_name|>DialogTest_2_AskDeviceOnFinger.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from sre_parse import isdigit
import sys
__author__ = 'jpijper'
import roslib; roslib.load_manifest('smach_tutorials')<|fim▁hole|>
from DialogStateMachine import SMDialog
def main():
# To restrict the amount of fee... | import rospy
import smach_ros |
<|file_name|>app.module.ts<|end_file_name|><|fim▁begin|>import { NgModule, ApplicationRef } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { RouterModule } from '@angul... | import {CommercialService} from "./services/commercial/commercial.service";
import {OrdinaryService} from "./services/ordinary/ordinary.service";
import {DevicerelatService} from "./services/branch/devicerelat.service";
import {SplitbillService} from "./services/splitbill/splitbill.service"; |
<|file_name|>swagger_params.py<|end_file_name|><|fim▁begin|>from drf_yasg import openapi
organization_params_in_header = openapi.Parameter(
"org", openapi.IN_HEADER, required=True, type=openapi.TYPE_INTEGER
)
organization_params = [
organization_params_in_header,
]
opportunity_list_get_params = [
organiz... | ), |
<|file_name|>lib.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/. */
extern crate compiletest_rs as compiletest;
use std::env;
use st... | let mut base_path = env::current_dir().expect("Current directory is invalid"); |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-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/licens... | SanitizeMemoryAttribute = 1 << 37,
NoBuiltinAttribute = 1 << 38,
ReturnedAttribute = 1 << 39, |
<|file_name|>pfs_setup_object.cc<|end_file_name|><|fim▁begin|>/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
as published by the Free Software F... |
void lookup_setup_object(PFS_thread *thread,
enum_object_type object_type,
const char *schema_name, int schema_name_length, |
<|file_name|>theme.init.js<|end_file_name|><|fim▁begin|>// Commom Plugins
(function($) {
'use strict';
// Scroll to Top Button.
if (typeof theme.PluginScrollToTop !== 'undefined') {
theme.PluginScrollToTop.initialize();
}
// Tooltips
if ($.isFunction($.fn['tooltip'])) {
$('[data-tooltip]:not(.manual), [dat... | if ($.isFunction($.fn['popover'])) { |
<|file_name|>htmldatalistelement.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/. */
<|fim▁hole|>use crate::dom::bindings::root::DomRo... | use crate::dom::bindings::codegen::Bindings::HTMLDataListElementBinding;
use crate::dom::bindings::codegen::Bindings::HTMLDataListElementBinding::HTMLDataListElementMethods;
use crate::dom::bindings::inheritance::Castable; |
<|file_name|>animation_test.py<|end_file_name|><|fim▁begin|># ------------------------------------------------------------------------------------------------
# Copyright (c) 2016 Microsoft Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
# associate... | |
<|file_name|>pos_config.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from odoo import fields, models
class PosConfig(models.Model):
_inherit = "pos.config"
account_analytic_id = fields.Many2one(
comodel_name="account.analytic.account", string="Analytic Account"
)<|fim▁end|> | # Copyright 2015 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). |
<|file_name|>main.js<|end_file_name|><|fim▁begin|><|fim▁hole|>
import '../imports/startup/client/index.js';<|fim▁end|> | import 'bootstrap'; |
<|file_name|>returnck.rs<|end_file_name|><|fim▁begin|>use crate::vm::{Fct, FctSrc, VM};
use dora_parser::ast::visit::*;
use dora_parser::ast::Stmt::*;
use dora_parser::ast::*;
use dora_parser::lexer::position::Position;
pub fn check<'ast>(vm: &VM<'ast>) {
for fct in vm.fcts.iter() {
let fct = fct.read();
... | ok("fun f() -> Int { do { } catch x: String { return 2; } return 1; }"); |
<|file_name|>meshlabdocumentxml.cpp<|end_file_name|><|fim▁begin|>#include <QString>
#include <QtGlobal>
#include <QFileInfo>
#include <QtXml>
#include "meshmodel.h"
#include "meshlabdocumentxml.h"
#include <wrap/qt/shot_qt.h>
bool MeshDocumentToXMLFile(MeshDocument &md, QString filename, bool onlyVisibleLayers)
{
m... | |
<|file_name|>LayerTest.java<|end_file_name|><|fim▁begin|>/**********************************************************************
* Copyright (c) 2011 by the President and Fellows of Harvard College
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Publi... | |
<|file_name|>power.py<|end_file_name|><|fim▁begin|><|fim▁hole|>""" a custom layer for 'power', maybe we should implement this in standard way.
more info can be found here: http://caffe.berkeleyvision.org/tutorial/layers/power.html
"""
from .register import register
def power_shape(input_shape, shape=None):
""... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.