prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>cancel_all.py<|end_file_name|><|fim▁begin|>import bot
import config
if __name__ == '__main__':
bot.init(config)<|fim▁hole|><|fim▁end|> | bot.cancel_all() |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>#![feature(custom_derive, plugin)]
#![plugin(serde_macros)]
extern crate mui;
use std::cell::Cell;
use mui::prelude::*;
fn main() {
let mut app = mui::App::new("Mui Widgets Demo!");
// primitives
let rect = mui::Rect::new("r1", true);
rect.set_zpos(3);
... | sa_button.set_text("I'm a button");
sa_button.set_xy(700.0, 300.0); |
<|file_name|>light.py<|end_file_name|><|fim▁begin|>"""Support for ISY994 lights."""
from typing import Callable, Dict
from pyisy.constants import ISY_VALUE_UNKNOWN
from homeassistant.components.light import (
DOMAIN as LIGHT,
SUPPORT_BRIGHTNESS,
LightEntity,
)
from homeassistant.config_entries import Conf... | async_setup_light_services(hass)
|
<|file_name|>XMLServlet.java<|end_file_name|><|fim▁begin|>package org.oguz.servlet;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebInitParam;
import javax.servlet.annotation.WebServlet;
import javax... | |
<|file_name|>filter_test.go<|end_file_name|><|fim▁begin|>package consul
import (
"reflect"
"testing"
"github.com/socketplane/socketplane/Godeps/_workspace/src/github.com/hashicorp/consul/acl"
"github.com/socketplane/socketplane/Godeps/_workspace/src/github.com/hashicorp/consul/consul/structs"
)
func TestFilterDi... | in: []string{"abe", "foo/1", "foo/2", "foo/3", "nope"},
out: []string{"foo/1", "foo/2", "foo/3"},
},
} |
<|file_name|>ExtractArchive.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import with_statement
import os
import sys
import traceback
# monkey patch bug in python 2.6 and lower
# http://bugs.python.org/issue6122 , http://bugs.python.org/issue1236 , http://bugs.python.org/issue1731717
if sys... | |
<|file_name|>puppet.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# This module 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 vers... | if module.check_mode:
cmd += " --noop" |
<|file_name|>ValidationMessage.java<|end_file_name|><|fim▁begin|>package uk.gov.prototype.vitruvius.parser.validator;
import java.util.List;
public class ValidationMessage {
private String message;
private ValidationType type;
public ValidationMessage() {
}
public ValidationMessage(String mess... | ERROR,
WARNING |
<|file_name|>app.module.ts<|end_file_name|><|fim▁begin|>import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { BrowserModule } from '@angular/platform-browser';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { Ng... | @NgModule({
declarations: [
AppComponent,
ChatWindowComponent |
<|file_name|>comedycentral.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
import re
from .mtv import MTVServicesInfoExtractor
from ..utils import (
compat_str,
compat_urllib_parse,
ExtractorError,
float_or_none,
unified_strdate,
)
class ComedyCentralIE(MTVServicesInfoExt... | dlNewest = False |
<|file_name|>authtest.py<|end_file_name|><|fim▁begin|>from com.googlecode.fascinator.common import JsonSimple
class AuthtestData:
def __init__(self):
pass
def __activate__(self, context):
request = context["request"]
response = context["response"]
writer = response.getPrintWri... | |
<|file_name|>typedoc.js<|end_file_name|><|fim▁begin|>module.exports = {
out: "./docs/",
readme: "README.md",
name: "Persian Tools",<|fim▁hole|> excludeExternals: true,
includeVersion: true,
excludePrivate: false,
};<|fim▁end|> | includes: "./src",
entryPoints: ["./src/index.ts"],
exclude: ["**/test/**/*", "**/*.js", "**/dist/**/*", "**/src/dummy/**"], |
<|file_name|>pageview.go<|end_file_name|><|fim▁begin|>package controller
import (
"beam/cmd/segments/app"
"beam/model"
"time"
"github.com/goadesign/goa"
)
// PageviewController implements the event resource.
type PageviewController struct {
*goa.Controller
PageviewStorage model.PageviewStorage
}
// NewPagevie... | |
<|file_name|>parsers.js<|end_file_name|><|fim▁begin|>import type {ResponseType} from "./base.type";
function parseJSON(response: ResponseType): Object {
return response.json();<|fim▁hole|>
export {parseJSON};<|fim▁end|> | } |
<|file_name|>FilmActor.py<|end_file_name|><|fim▁begin|>import unreal_engine as ue
import json
class FilmActor:
def begin_play(self):<|fim▁hole|>
def getjson(self):
ue.log("@@@@video getting json:")
loc = self.uobject.get_actor_location()
rot = self.uobject.get_actor_forward()
data = {
"x":loc.x,"y":loc.... | self.pawn = self.uobject.get_owner() |
<|file_name|>size_bmp32.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
"""
This script checks HighGUI's cvGetCaptureProperty functionality for correct return
of the frame width and height of an .avi file containing uncompressed 32bit Bitmap frames.
"""
# name if this test and it's requirements
TESTNAME = "siz... |
# needed for sys.exit(int), .works file handling and check routine |
<|file_name|>views.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Django
from django.views.generic import View, TemplateView
from django.shortcuts import redirect
from django.core.urlresolvers import reverse
from django.shortcuts import get_object_or_404
# CRMA
from .models import Subscription, EmailSchedu... |
def get(self, request, *args, **kwargs): |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | name = "neurogenesis" |
<|file_name|>chroot.py<|end_file_name|><|fim▁begin|>import json
from unit.http import TestHTTP
from unit.option import option
http = TestHTTP()
<|fim▁hole|> url='/config',
sock_type='unix',
addr=option.temp_dir + '/control.unit.sock',
body=json.dumps(
{
"lis... | def check_chroot():
available = option.available
resp = http.put( |
<|file_name|>filtersSpec.js<|end_file_name|><|fim▁begin|>//filters.js eventsApp.filter('durations'
'use strict';
describe('durations', function(){
beforeEach(module("eventsApp"));
it('should return "Half Hour" when given a 1', inject(function(durationFilter){
expect(durationFilter(1)).toEqual('Half Hour');
}))
it... | }))
it('should return " Hour" when given a 4', inject(function(durationFilter){ |
<|file_name|>symbolDeclarationEmit8.js<|end_file_name|><|fim▁begin|>//// [symbolDeclarationEmit8.ts]
var obj = {
[Symbol.isConcatSpreadable]: 0
}
//// [symbolDeclarationEmit8.js]
var obj = {
[Symbol.isConcatSpreadable]: 0
};
//// [symbolDeclarationEmit8.d.ts]
<|fim▁hole|> [Symbol.isConcatSpreadab... | declare var obj: {
|
<|file_name|>cisco_xr_ssh.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
from __future__ import unicode_literals
import re
from netmiko.cisco_base_connection import CiscoSSHConnection
class CiscoXrSSH(CiscoSSHConnection):
def session_preparation(self):
"""Prepare the session afte... | |
<|file_name|>gate_setting_sun.cpp<|end_file_name|><|fim▁begin|>/*
Dungeon : Gate of the Setting Sun 90 Heroic
Instance General Script<|fim▁hole|>
#include "gate_setting_sun.h"
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "Vehicle.h"
enum spells
{
SPELL_MANTID_MUNITION_EXPLOSION = 10715... | */ |
<|file_name|>vengine_cpy.py<|end_file_name|><|fim▁begin|>#
# DEPRECATED: implementation for ffi.verify()
#
import sys, imp
from . import model
from .error import VerificationError
<|fim▁hole|> _gen_python_module = True
def __init__(self, verifier):
self.verifier = verifier
self.ffi = verifier.f... | class VCPythonEngine(object):
_class_key = 'x' |
<|file_name|>rbfTool.py<|end_file_name|><|fim▁begin|>"""
General descrition of your module here.
"""
from functools import partial
from maya import OpenMaya
from maya import OpenMayaUI
from maya import cmds
from PySide import QtCore
from PySide import QtGui
from shiboken import wrapInstance
from s... | self.optionsWidget = RbfOptionsWidget()
|
<|file_name|>update-translations.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# Copyright (c) 2014 Wladimir J. van der Laan
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Run this script from the root of the repositor... | for (filename,filepath) in all_ts_files('.orig'):
# pre-fixups to cope with transifex output
parser = ET.XMLParser(encoding='utf-8') # need to override encoding because 'utf8' is not understood only 'utf-8'
with open(filepath + '.orig', 'rb') as f: |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*-coding:utf-8-*-
<|fim▁hole|>__all__ = ['database', 'guide', 'gff', 'uniprot']<|fim▁end|> | |
<|file_name|>F9.py<|end_file_name|><|fim▁begin|>import fechbase
class Records(fechbase.RecordsBase):
def __init__(self):
fechbase.RecordsBase.__init__(self)
self.fields = [
{'name': 'FORM TYPE', 'number': '1'},
{'name': 'FILER COMMITTEE ID NUMBER', 'number': '2'},
... | {'name': 'CUSTODIAN SUFFIX', 'number': '29'}, |
<|file_name|>renderer-texture.rs<|end_file_name|><|fim▁begin|>extern crate sdl2;
use sdl2::pixels::PixelFormatEnum;
use sdl2::rect::Rect;
use sdl2::event::Event;
use sdl2::keyboard::Keycode;
pub fn main() {
let sdl_context = sdl2::init().unwrap();
let video_subsystem = sdl_context.video().unwrap();
let w... | |
<|file_name|>test_carrot.py<|end_file_name|><|fim▁begin|># vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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 "L... | """
from nova import log as logging |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf import settings
from django.conf.urls import patterns, url
from haystack.views import SearchView
from elections.forms import ElectionForm
from elections.views import ElectionsSearchByTagView, HomeView, ElectionDetailView,\
CandidateDetailView, SoulM... | AreaDetailView.as_view(template_name='elections/area.html'), |
<|file_name|>17b.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
import sys
def main(args):
#cnt = 2017
cnt = 50000000
n = 3
n = 345
size = 0
buf = [0]
pos = 0
at_1 = None
for i in range(cnt):
pos = (pos + n) % (i+1)
if pos == 0:
at_1 = i+1
... | print(at_1)
if __name__ == '__main__':
sys.exit(main(sys.argv)) |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>#[doc = r" Value read from the register"]
pub struct R {
bits: u32,
}
#[doc = r" Value to write to the register"]
pub struct W {
bits: u32,
}
impl super::BRR {
#[doc = r" Modifies the contents of the register"]
#[inline(always)]
pub fn modify<F>(&self... | |
<|file_name|>NedGenerator.py<|end_file_name|><|fim▁begin|>__author__ = 'sianwahl'
from string import Template
class NedGenerator:
def __init__(self, number_of_channels):
self.number_of_channels = number_of_channels
def generate(self):
return self._generate_tuplefeeder_ned(), self._generate_... |
submodules:
tupleFeeder: TupleFeeder;
|
<|file_name|>run_electrum_creditbit_server.py<|end_file_name|><|fim▁begin|><|fim▁hole|># it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that ... | #!/usr/bin/env python
# Copyright(C) 2012 thomasv@gitorious
# This program is free software: you can redistribute it and/or modify |
<|file_name|>resolve_lifetime.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.apac... | |
<|file_name|>test_notifications.py<|end_file_name|><|fim▁begin|>"""Integration test for Notifications."""
import github3
from .helper import IntegrationHelper
class TestThread(IntegrationHelper):
"""Integration test for methods on Test class"""
def test_subscription(self):
"""Show that a user can re... | """Integration test for methods on Test class"""
def test_set(self): |
<|file_name|>demo_tokenizer_roberta.py<|end_file_name|><|fim▁begin|>from transformers import RobertaTokenizerFast
import scattertext as st
tokenizer_fast = RobertaTokenizerFast.from_pretrained(
"roberta-base", add_prefix_space=True)
tokenizer = st.RobertaTokenizerWrapper(tokenizer_fast)
df = st.SampleCorpora.Conv... | corpus = st.OffsetCorpusFactory(
df, |
<|file_name|>sidebar.client.controller.js<|end_file_name|><|fim▁begin|>'use strict';
angular.module('core').controller('SidebarController', ['$scope', 'Authentication',<|fim▁hole|> $scope.authentication = Authentication;
}
]);<|fim▁end|> | function($scope, Authentication) { |
<|file_name|>Trial6_pySerial_Mod.py<|end_file_name|><|fim▁begin|>import serial
port = "COM5"
baud = 19200
try:
ser = serial.Serial(port, baud, timeout=1)
ser.isOpen() # try to open port, if possible print message and proceed with 'while True:'
<|fim▁hole|>
except IOError: # if port is already opened, ... | print ("port is opened!")
|
<|file_name|>SplineSeries.js<|end_file_name|><|fim▁begin|>/* *
* (c) 2010-2019 Torstein Honsi
*
* License: www.highcharts.com/license
*/
'use strict';
import H from './Globals.js';
import './Utilities.js';
import './Options.js';
import './Series.js';
var pick = H.pick,
seriesType = H.seriesType;
/**
* Spli... | leftContX,
leftContY, |
<|file_name|>HomeController.java<|end_file_name|><|fim▁begin|>package es.ucm.fdi.iw.controller;
import java.security.Principal;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.EntityManager;
import javax.servlet.http.HttpSession;
import org.apache.log4j.Logger;
import org.springframework.... | {
UsuarioJSON usuarioJSON = new UsuarioJSON(u);
json += gson.toJson(usuarioJSON); |
<|file_name|>validate.js<|end_file_name|><|fim▁begin|>"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
let prettyPrintTypes = function (types) {
const addArticle = (str) => {
let vowels = ['a', 'e', 'i', 'o', 'u'];
if (vowels.indexOf(str[0]) !== -1) {
return '... | }
if (Buffer.isBuffer(value)) {
return 'buffer'; |
<|file_name|>test_del_contact.py<|end_file_name|><|fim▁begin|>from model.info_contact import Infos
import random
def test_delete_some_contact(app, db, check_ui):
if app.contact.count() == 0:
app.contact.create(Infos(firstname="AAAAA"))<|fim▁hole|> old_contacts.remove(contact)
assert old_contacts == ... | old_contacts = db.get_contact_list()
contact = random.choice(old_contacts)
app.contact.delete_contact_by_id(contact.id)
new_contacts = db.get_contact_list() |
<|file_name|>core.py<|end_file_name|><|fim▁begin|>import os
import sys
import codecs
from contextlib import contextmanager
from itertools import repeat
from functools import update_wrapper
from .types import convert_type, IntRange, BOOL
from .utils import make_str, make_default_short_help, echo
from .exceptions import... | parsing methods that do not depend on the Click parser.
|
<|file_name|>better_zoom_test_case.py<|end_file_name|><|fim▁begin|># Copyright (c) 2014, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in LICENSE.txt and may be redistributed only
# under the conditions described in the aforementioned... | |
<|file_name|>get.cc<|end_file_name|><|fim▁begin|>// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of Olena.
//
// Olena is free software: you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
// So... |
typedef image2d<int> I; |
<|file_name|>references.py<|end_file_name|><|fim▁begin|>"""
Module responsible for translating reference sequence data into GA4GH native
objects.
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import hashlib
import json
import os
import random
import ... | return reference
def checkQueryRange(self, start, end): |
<|file_name|>HTMLExtractorTest.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
* Copyright 2017 Adobe Systems Incorporated
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the ... | * http://www.apache.org/licenses/LICENSE-2.0 |
<|file_name|>popstateevent.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public<|fim▁hole|> * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::Bindings::EventBinding::EventMethods;
use dom::bindings::codegen::Bindings::PopStateEve... | * License, v. 2.0. If a copy of the MPL was not distributed with this |
<|file_name|>nodecounterssnapshotdto.go<|end_file_name|><|fim▁begin|>package model
type NodeCountersSnapshotDTO struct {
NodeId string `json:"nodeId"` // The unique ID that identifies the node<|fim▁hole|>}<|fim▁end|> | Address string `json:"address"` // The API address of the node
ApiPort int32 `json:"apiPort"` // The API port used to communicate with the node
Snapshot CountersSnapshotDTO `json:"snapshot"` // The counters from the node. |
<|file_name|>SingleProposalMisc.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
##Copyright (C) [2003] [Jürgen Hamel, D-32584 Löhne]
##This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as
##published by the Free Software Foundation; eithe... | import gtk.glade
import gobject
#from gtk import TRUE, FALSE |
<|file_name|>_WithWrapper.test.js<|end_file_name|><|fim▁begin|>/* global describe, test, expect, jest */
import React from "react";
import { mount } from "enzyme";
import Form from "../Form";
describe("HOC (WithWrapper)", () => {
test("[handleOnKeyup] should reset the error state", () => {
const onKeyUp = jest.f... | });
test("[handleOnChange] should set a hasValue and call the onChange prop", () => { |
<|file_name|>background.mako.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/. */
<%namespace name="helpers" file="/helpers.mako.rs" />... |
impl ToCss for computed_value::T { |
<|file_name|>acl.py<|end_file_name|><|fim▁begin|># Copyright (C) 2013-2018 Samuel Damashek, Peter Foley, James Forcier, Srijay Kasturi, Reed Koser, Christopher Reffett, and Tris Wilson
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as pu... | else:
if admin is None:
send(f"{cmdargs.nick} was not an {cmdargs.role}.") |
<|file_name|>horizontal.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# This file is part of pygal
#
# A python svg graph plotting library
# Copyright © 2012-2014 Kozea
#
# This library is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as pub... | |
<|file_name|>contacts-test.js<|end_file_name|><|fim▁begin|>import { moduleFor, test } from 'ember-qunit';
moduleFor('adapter:contacts', 'Unit | Adapter | contacts', {
// Specify the other units that are required for this test.
// needs: ['serializer:foo']
});
// Replace this with your real tests.
test('it exists'... | assert.ok(adapter);
}); |
<|file_name|>canvas_paint_thread.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 azure::azure::{AzColor, AzFloat};
use azure::... | |
<|file_name|>router.js<|end_file_name|><|fim▁begin|>PhotoAlbums.Router.map(function() {
this.resource('login');
this.resource('album', {path: '/:album_id'});
this.resource('photo', {path: 'photos/:photo_id'});<|fim▁hole|><|fim▁end|> | }); |
<|file_name|>test_rule_300.py<|end_file_name|><|fim▁begin|>import os
import unittest
from vsg.rules import iteration_scheme
from vsg import vhdlFile
from vsg.tests import utils
sTestDir = os.path.dirname(__file__)
lFile, eError =vhdlFile.utils.read_vhdlfile(os.path.join(sTestDir,'rule_300_test_input.vhd'))
dIndentM... |
oRule.fix(self.oFile)
|
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from setuptools import setup, find_packages
try: # for pip >= 10
from pip._internal.req import parse_requirements
except ImportError: # for pip <= 9.0.3
from pip.req import parse_requirements
import re, ast
# get version from __version__ variable in bench/__in... | author='Frappe Technologies',
author_email='info@frappe.io', |
<|file_name|>uniq.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.apache.org/licenses/L... | let body_datum = src_datum.box_body(bcx); |
<|file_name|>test_models.py<|end_file_name|><|fim▁begin|>from django.test import TestCase
from seedsdb.models import (
Plant, Tag, Harvest, Activity
)
class TestPlant(TestCase):
def tearDown(self):
Plant.objects.all().delete()
def make_test_plant(self, aliases=None):
if aliases:
... | expected_url = "/plants/detail/love-in-idleness/"
|
<|file_name|>InstallerUtil.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2009-2013 by The Regents of the University of California
* 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 from
*
* ... | import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller; |
<|file_name|>cilexer.py<|end_file_name|><|fim▁begin|># CodeIgniter
# http://codeigniter.com
#
# An open source application development framework for PHP
#
# This content is released under the MIT License (MIT)
#
# Copyright (c) 2014 - 2015, British Columbia Institute of Technology
#
# Permission is hereby granted, fr... | |
<|file_name|>cli_update.py<|end_file_name|><|fim▁begin|># This Source Code Form is subject to the terms of the Mozilla Public<|fim▁hole|># 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/.
from firefox_ui_harness.arguments import UpdateArgume... | |
<|file_name|>cli.py<|end_file_name|><|fim▁begin|># coding: utf-8
# <pycompressor - compress and merge static files (css,js) in html files>
# Copyright (C) <2012> Marcel Nicolay <marcel.nicolay@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Gen... | "YELLOW": "\033[33m",
"RED": "\033[31m",
"END": "\033[0m", |
<|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 dom::bindings::utils::{BindingObject,... | self.node.get_wrappercache() |
<|file_name|>challenge13.rs<|end_file_name|><|fim▁begin|>use aes::Aes128;
use aes::{chunks_count, BLOCK_SIZE};
use crate::errors::*;
use crate::prefix_suffix_oracles::Oracle;
use crate::prefix_suffix_oracles::Oracle13;
use super::challenge12::prefix_plus_suffix_length;
use super::prefix_length;
// The following fun... | |
<|file_name|>log.go<|end_file_name|><|fim▁begin|>package sdialog // import "github.com/nathanaelle/sdialog/v2"
import (
"fmt"
"log"
)
type (
// LogLevel describe a log handler for a severity
LogLevel byte
logWriter LogLevel
)
const (
LogEMERG LogLevel = iota + '0' // system is unusable
LogALERT ... | |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.contrib.auth import views as auth
def login(request):
return auth.login(request, template_name="registration/login.haml")
<|fim▁hole|>
def password_change_done(request):
return auth.password_change_done(request, template_name="registration/passw... | def password_change(request):
return auth.password_change(request, template_name="registration/password_change_form.haml") |
<|file_name|>hello.spec.ts<|end_file_name|><|fim▁begin|>import {expect} from "chai";
import {generateHello} from "./hello";<|fim▁hole|>describe("generateHello()", () => {
it("should error when a name contains a number", () => {
const name = "Freddie12";
const result = generateHello(name);
expect(result).t... | |
<|file_name|>delicious.py<|end_file_name|><|fim▁begin|># originally from
# http://code.google.com/p/django-syncr/source/browse/trunk/app/delicious.py
# supousse django-syncr should be installed as external app and this code
# inherit from that, but django-syncr have not a setup.py file (so can't be
# added in src/p... | DeliciousSyncr objects sync del.icio.us bookmarks to the Django
backend. The constructor requires a username and password for
authenticated access to the API. |
<|file_name|>test_future.py<|end_file_name|><|fim▁begin|>import asyncio
import sys
import traceback
import pytest
from pykka import Future, Timeout, get_all
def run_async(coroutine):
loop = asyncio.get_event_loop()
f = asyncio.ensure_future(coroutine, loop=loop)
return loop.run_until_complete(f)
def t... | |
<|file_name|>types.go<|end_file_name|><|fim▁begin|>/*
Copyright 2016 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
Unless r... | // +k8s:prerelease-lifecycle-gen:replacement=apps,v1,Deployment
// DEPRECATED - This group version of Deployment is deprecated by apps/v1beta2/Deployment. See the release notes for |
<|file_name|>GuildRankInfo.cpp<|end_file_name|><|fim▁begin|>/*
Copyright (c) 2014-2019 AscEmu Team <http://www.ascemu.org>
This file is released under the MIT license. See README-MIT for more information.
*/
#include "GuildRankInfo.h"
#include "GuildBankRightsAndSlots.h"
#include "Log.hpp"
#include "Database/Database.... | if (mRights == rights)
return;
mRights = rights; |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: UTF8 -*-
#
# Provides access to portaudio.
# Copyright (C) 2010 Josiah Gordon <josiahg@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as ... | |
<|file_name|>blunderbuss.go<|end_file_name|><|fim▁begin|>/*
Copyright 2015 The Kubernetes 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.org/lice... | }
printChance(potentialOwners, weightSum)
if issue.Assignee != nil {
cur := *issue.Assignee.Login |
<|file_name|>object_store_test.go<|end_file_name|><|fim▁begin|>// Copyright 2018 The Kubeflow 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
//
// https://www.apache.org/licenses... | assert.Nil(t, error)
assert.Equal(t, 1, minioClient.GetObjectCount()) |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>var async = require('async');
var rp = require('request-promise');
var Promise = require('bluebird');
/*
LoL API object that deals with everything.
*/
var LoLAPI = {
init: function(inputObj) {
/*
SET UP LOGGER
*/
if(typeof inputObj.logger !== 'unde... | }
else {
this.logger.log('SUCCESSFUL RESPONSE FROM: ' + endpoint);
return response.body; //Resolve promise |
<|file_name|>newtype-struct-with-dtor.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT<|fim▁hole|>// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.or... | // file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
// |
<|file_name|>qt_generic.py<|end_file_name|><|fim▁begin|>from functools import partial
import threading
from PIL import Image
from PyQt4.Qt import Qt
from PyQt4.Qt import QGridLayout, QInputDialog, QPushButton
from PyQt4.Qt import QVBoxLayout, QLabel, SIGNAL
from electrum_gui.qt.main_window import StatusBarButton
from ... |
from electrum.i18n import _
from electrum.plugins import hook, DeviceMgr |
<|file_name|>commonutils.go<|end_file_name|><|fim▁begin|>/*
Copyright IBM Corp. 2016 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... |
// ExtractEnvelopeOrPanic retrieves the requested envelope from a given block and unmarshals it -- it panics if either of these operation fail. |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""
import os
for module in os.listdir(os.path.dirname(__file__)):
if module == "__init__.py" or module[-3:] != ".py":<|fim▁hole|>del module
"""
import src.itemFolder.logistics.container
import src.itemFolder.logistics.mover
import src.itemFolder.logistics.pat... | continue
__import__("src.itemFolder.logistics." + module[:-3], locals(), globals()) |
<|file_name|>data.py<|end_file_name|><|fim▁begin|># Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
from __future__ import absolute_import
from digits.utils import subclass, override, constants
from digits.extensions.data.interface import DataIngestionInterface
from .forms import DatasetForm, InferenceFo... | template = open(os.path.join(extension_dir, TEMPLATE), "r").read()
context = {'form': form}
return (template, context) |
<|file_name|>async2.rs<|end_file_name|><|fim▁begin|>// compile-flags: --edition=2018
use core::{
future::Future,
marker::Send,
pin::Pin,
};
fn non_async_func() {
println!("non_async_func was covered");
let b = true;
if b {
println!("non_async_func println in block");
}
}
<|fim▁ho... |
async fn async_func() {
println!("async_func was covered");
let b = true; |
<|file_name|>qluamode_lua.cpp<|end_file_name|><|fim▁begin|>/* -*- C++ -*- */
#include <QtGlobal>
#include <QtAlgorithms>
#include <QChar>
#include <QDebug>
#include <QList>
#include <QMap>
#include <QPointer>
#include <QRegExp>
#include <QSettings>
#include <QSharedData>
#include <QSharedDataPointer>
#include "qluaa... | n->type = Statement;
break;
}
} |
<|file_name|>orm.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
import django
import patchy
from django.db.models.deletion import get_candidate_relations_to_delete
from django.db.models.query import QuerySet
from django.db.model... | + candidates_dict = OrderedDict()
+ for opts in candidate_models:
+ for field in opts.get_fields(include_hidden=True):
+ candidates_dict[field.name] = field |
<|file_name|>hw5_start.py<|end_file_name|><|fim▁begin|># CIS 410/510pm
# Homework 5 beta 0.0.1
# Cameron Palk
# May 2016
#
# Special thanks to Daniel Lowd for the skeletor code
import sys
import tokenize
from functools import reduce
global_card = []
num_vars = 0
''' Calc Strides
'''
def calcStrides( scope ):
rev_s... | self.stride == other.stride )
#
# A string used for printing the Factor Objects |
<|file_name|>HTMLStyleElement.py<|end_file_name|><|fim▁begin|>########################################################################
#
# File Name: HTMLStyleElement
#
# Documentation: http://docs.4suite.com/4DOM/HTMLStyleElement.html
#
### This file is automatically generated by GenerateHtml.py.
##... | |
<|file_name|>euler41.rs<|end_file_name|><|fim▁begin|>use std::char;
pub fn main() {
let primes = (2..).filter(|&n| (2..(n as f32).sqrt() as u32 + 1).all(|i| n % i != 0));
let pandigital = |number: &u32| {
let s = number.to_string();
(1..s.len() + 1).all(|n| s.chars().any(|p| p == char::from_dig... | println!("{}", ans); |
<|file_name|>gs-indexbuffer.cpp<|end_file_name|><|fim▁begin|>/*
* Modern effects for a modern Streamer
* Copyright (C) 2017 Michael Fabian Dirks
*
* 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 Found... | streamfx::obs::gs::index_buffer::index_buffer(std::vector<uint32_t>& other) |
<|file_name|>PlayPauseReceiver.java<|end_file_name|><|fim▁begin|>package insanityradio.insanityradio;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
public class PlayPauseReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context cont... | }
} |
<|file_name|>20200402_1113_933665578547_migrate_review_conditions_from_settings.py<|end_file_name|><|fim▁begin|>"""Migrate review conditions from settings
Revision ID: 933665578547
Revises: 02bf20df06b3
Create Date: 2020-04-02 11:13:58.931020
"""
import json<|fim▁hole|>
from indico.modules.events.editing.models.edita... | from collections import defaultdict
from uuid import uuid4
from alembic import context, op |
<|file_name|>layout.py<|end_file_name|><|fim▁begin|># This file is part of Indico.
# Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN).
#
# Indico 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 ... | if not event.has_stylesheet:
raise NotFound |
<|file_name|>settings.py<|end_file_name|><|fim▁begin|>"""
Django settings for SimpleChat project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths ins... | 'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware', |
<|file_name|>koenig-menu-content.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | export {default} from 'koenig-editor/components/koenig-menu-content'; |
<|file_name|>detector.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#*********************************************************************
# Software License Agreement (BSD License)
#
# Copyright (c) 2011 andrewtron3000
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or wit... | # Load the haar cascade. Note we get the
# filename from the "classifier" parameter
# that is configured in the launch script. |
<|file_name|>link_to_test.js<|end_file_name|><|fim▁begin|>import "ember";
import EmberHandlebars from "ember-handlebars";
var compile = EmberHandlebars.compile;
var Router, App, AppView, router, container;
var set = Ember.set;
function bootApplication() {
router = container.lookup('router:main');
Ember.run(App,... | App.IndexController = Ember.Controller.extend();
var indexController = container.lookup('controller:index'); |
<|file_name|>ZouHeNode.cpp<|end_file_name|><|fim▁begin|>#include <iostream>
#include <stdexcept>
#include <vector>
#include "latticeBase.hpp"
#include "collisionBase.hxx"
#include "latticeNode.hxx"
#include "latticeModel.hxx"
#include "ZouHeNode.hpp"
#include "latticeNode.hxx"
ZouHeNode::ZouHeNode
(
latticeBase... | }
case 2: |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.