prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>gnome_keyring.py<|end_file_name|><|fim▁begin|>"""
Gnome keyring parser.
Sources:
- Gnome Keyring source code,
function generate_file() in keyrings/gkr-keyring.c,
Author: Victor Stinner
Creation date: 2008-04-09
"""
from hachoir_core.tools import paddingSize
from hachoir_parser import Parser
from hac... | yield Enum(UInt8(self, "hash"), self.HASH_NAMES) |
<|file_name|>Gruntfile.js<|end_file_name|><|fim▁begin|>module.exports = function(grunt) {
"use strict";
var fs = require('fs'), pkginfo = grunt.file.readJSON("package.json");
grunt.initConfig({
pkg: pkginfo,
meta: {
banner: "/*! <%= pkg.title %> <%= pkg.version %> | <%= pkg.... | },
uglify: {
distmin: { |
<|file_name|>dri_cursor.cc<|end_file_name|><|fim▁begin|>// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ui/ozone/platform/dri/dri_cursor.h"
#include "ui/base/cursor/ozone/bitmap_cursor_factor... | return;
DriWindow* window = window_manager_->GetWindow(cursor_window_);
const gfx::Size& size = window->GetBounds().size(); |
<|file_name|>CVQualifiers.cpp<|end_file_name|><|fim▁begin|>// -*- mode: C++ -*-
//
// Copyright (c) 2007, 2008, 2009, 2010, 2011 The University of Utah
// All rights reserved.
//
// This file is part of `csmith', a random generator of C programs.
//
// Redistribution and use in source and binary forms, with or without
... | CVQualifiers qual(consts, volatiles);
|
<|file_name|>pacemaker.py<|end_file_name|><|fim▁begin|># Copyright (C) 2009 Yan Gao <ygao@novell.com>
# See COPYING for license information.
import os
import tempfile
import copy
from lxml import etree
class PacemakerError(Exception):
'''PacemakerError exceptions'''
def get_validate_name(cib_elem):
if cib_... | if self.schema_filename in self.schema_str_docs: |
<|file_name|>MigrationsPage.tsx<|end_file_name|><|fim▁begin|>/*
Copyright (C) 2017 Cloudbase Solutions SRL
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (... | /> |
<|file_name|>MSChooser.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not... | if self.index >= len(self.items):
if self.loop: |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (C) 2013 Michael Hogg
# This file is part of bonemapy - See LICENSE.txt for information on usage and redistribution
import bonemapy
from distutils.core import setup
setup(
name = 'bonemapy',
version = bonemapy.__versio... | author_email = 'michael.christopher.hogg@gmail.com',
url = "https://github.com/mhogg/bonemapy",
download_url = "https://github.com/mhogg/bonemapy/releases",
classifiers = [ |
<|file_name|>0f383d.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (a... | assert_equal(myDisasm.infos.Reserved_.EVEX.pp, 0x1)
assert_equal(myDisasm.infos.Reserved_.EVEX.mm, 0x2)
assert_equal(hex(myDisasm.infos.Instruction.Opcode), '0x3d')
assert_equal(myDisasm.infos.Instruction.Mnemonic, b'vpmaxsd') |
<|file_name|>SplitLDIFFilterTranslator.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2016-2020 Ping Identity Corporation
* All Rights Reserved.
*/
/*
* Copyright 2016-2020 Ping Identity Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compli... | } |
<|file_name|>test_video_intelligence_service_client_v1beta2.py<|end_file_name|><|fim▁begin|># Copyright 2017, Google LLC 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
#... | from google.rpc import status_pb2 |
<|file_name|>opts.py<|end_file_name|><|fim▁begin|>class Options:
instance = None
def __init__(self,options):
self.options = options
@classmethod
def set(cls,options):
"""Create an Options instance with the provided dictionary of<|fim▁hole|> def inst(cls):
"""Get the Opti... | options"""
cls.instance = Options(options)
@classmethod |
<|file_name|>group.ts<|end_file_name|><|fim▁begin|>module csComp.Services {
export enum LayerType {
GeoJson,
Kml
}
/** a project group contains a list of layers that can be grouped together.
* Filters, styles can clustering is always defined on the group level.
* If a filter is ... | /** |
<|file_name|>SaveFileController.java<|end_file_name|><|fim▁begin|>/* SaveFileController
*
* Version 1.0
*
* November 13, 2017
*
* Copyright (c) 2017 Cup Of Java. All rights reserved.
*/
package com.cmput301f17t11.cupofjava.Controllers;
import android.content.Context;
import com.cmput301f17t11.cupofjava.Models... | |
<|file_name|>lvm.py<|end_file_name|><|fim▁begin|>#
# Copyright 2010-2011 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) an... | """Return the LV dm device.
returns: dm-X |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models
from django.core.urlresolvers import reverse
class Software(models.Model):
name = models.CharField(max_length=200)
def __unicode__(self):
return self.name
<|fim▁hole|> return reverse('software_edit', kwargs={'pk': ... | def get_absolute_url(self): |
<|file_name|>MaximumNumberOfApprovalsExceededException.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2017-2022 Amazon.com, Inc. or its affiliates. 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. A copy of... | public MaximumNumberOfApprovalsExceededException(String message) {
super(message); |
<|file_name|>change_detection.js<|end_file_name|><|fim▁begin|>'use strict';var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
__.prototype = b.prototype;
d.prototype = new __();
};
var __decor... | var lexer_1 = require('./parser/lexer');
|
<|file_name|>facade_tests.py<|end_file_name|><|fim▁begin|>from django.test import TestCase
from mock import Mock, patch
from paymentexpress.facade import Facade
from paymentexpress.gateway import AUTH, PURCHASE
from paymentexpress.models import OrderTransaction
from tests import (XmlTestingMixin, CARD_VISA, SAMPLE_SUC... | start_date="1010")
def test_successful_call_returns_valid_dict(self): |
<|file_name|>event_span.cc<|end_file_name|><|fim▁begin|>/* Copyright 2019 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.org/lice... | bool operator==(const StepEvents& a, const StepEvents& b) { |
<|file_name|>base.py<|end_file_name|><|fim▁begin|># Django settings for breeze project.
from unipath import Path
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
PROJECT_DIR = Path(__file__).ancestor(3)
DATABASES = {
'default': {
'ENGINE... | 'django.contrib.messages',
'django.contrib.staticfiles', |
<|file_name|>mixins.py<|end_file_name|><|fim▁begin|>from django.test import TestCase
from ...models import Office
class PublishedMixinTest(TestCase):
def test_only_published_manager_and_queryset_default_datetime(self):
data = [
dict(published=False, address='office', office='not_published'),... | |
<|file_name|>filterintra_predictors_test.cc<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2016, Alliance for Open Media. All rights reserved
*
* This source code is subject to the terms of the BSD 2 Clause License and
* the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
* was not distrib... | virtual ~AV1FilterIntraPredOptimzTest() {}
virtual void SetUp() {
PredFuncMode funcMode = GET_PARAM(0);
predFuncRef_ = std::tr1::get<0>(funcMode); |
<|file_name|>find_distributions_urlbuilder.go<|end_file_name|><|fim▁begin|>// Code generated by go-swagger; DO NOT EDIT.
package distribution
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the generate command
import (
"errors"
"net/url"
golangswaggerpaths ... | return nil, err
}
base.Scheme = scheme |
<|file_name|>LetsEncryptConfig.py<|end_file_name|><|fim▁begin|>ROOT = '/.well-known/acme-challenge'
ENDPOINT = '/k9s7WeOPg3HdSjwlAqEVRxnezsGGe-CFOwPfOcU3VgU'<|fim▁hole|><|fim▁end|> | RESPONSE = 'k9s7WeOPg3HdSjwlAqEVRxnezsGGe-CFOwPfOcU3VgU.QBkCfzPq0mKXIJSktgl4_b7psKazh3MSZ8juWnZbJbg' |
<|file_name|>zepto.touch.js<|end_file_name|><|fim▁begin|>define(function(require, exports, module) {
require('vendor/zepto/zepto');
var $ = window.Zepto;
// Zepto.js
// (c) 2010-2014 Thomas Fuchs
// Zepto.js may be freely distributed under the MIT license.
var touch = {},
touchTimeout,... | // This can occur if touchcancel doesn't fire due to preventDefault, etc. |
<|file_name|>test_sensor.py<|end_file_name|><|fim▁begin|>"""Test sensor of Brother integration."""
from datetime import datetime, timedelta
import json
from homeassistant.components.brother.const import UNIT_PAGES
from homeassistant.const import (
ATTR_DEVICE_CLASS,
ATTR_ENTITY_ID,
ATTR_ICON,
ATTR_UNIT... | |
<|file_name|>blocks.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
from django.utils.functional import cached_property
from django.contrib.contenttypes.models import ContentType
from wagtail.wagtailcore.blocks import ChooserBlock
class SnippetChooserBlock(ChooserBlock):
def __init__(self... |
@cached_property |
<|file_name|>freeinfo1.cc<|end_file_name|><|fim▁begin|>#include <iostream>
#include "common.h"
using namespace storage;
using namespace std;
StorageInterface* s = NULL;
void
test(const string& device)
{
ResizeInfo resize_info;
ContentInfo content_info;
if (s->getFreeInfo(device, true, resize_info, t... | |
<|file_name|>BucketsPage.ts<|end_file_name|><|fim▁begin|>import { SelectionModel } from '@angular/cdk/collections';
import { AfterViewInit, ChangeDetectionStrategy, Component, ViewChild } from '@angular/core';
import { FormControl, FormGroup } from '@angular/forms';
import { MatDialog } from '@angular/material/dialog';... |
deleteSelectedBuckets() { |
<|file_name|>domtokenlist.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 dom::attr::Attr;
use dom::bindings::codegen::Binding... | |
<|file_name|>Binary_Tree_Upside_Down.java<|end_file_name|><|fim▁begin|>/*
Binary Tree Upside Down
Given a binary tree where all the right nodes are either leaf nodes with a sibling (a left node that shares the same parent node) or empty, flip it upside down and turn it into a tree where the original right nodes turned ... | /**
* Definition for a binary tree node. |
<|file_name|>aql-helper.js<|end_file_name|><|fim▁begin|>/* jshint strict: false */
/* global assertTrue, assertFalse, assertEqual, fail,
AQL_EXECUTE, AQL_PARSE, AQL_EXPLAIN, AQL_EXECUTEJSON */
// //////////////////////////////////////////////////////////////////////////////
// / @brief aql test helper functions
// /... | |
<|file_name|>resume.ts<|end_file_name|><|fim▁begin|>import 'rxjs/add/operator/catch';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/switchMap';
import 'rxjs/add/operator/debounceTime';
import 'rxjs/add/operator/withLatestFrom';
import 'rxjs/add/operator/skip';
import 'rxjs/add/operator/takeUntil';
import { ... | private store: Store<IStoreState>,
) { } |
<|file_name|>online_accounts.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python3
from collections import OrderedDict
import datetime
import os
import sys
import textwrap
from plaid import Client
from plaid import errors as plaid_errors
import plaid2text.config_manager as cm
from plaid2text.interact import prompt... | |
<|file_name|>settingsData.py<|end_file_name|><|fim▁begin|><|fim▁hole|>#!/bin/python
# -*- coding: utf-8 -*-
# Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug
settingsData = {
'sound': {
'enabled': True,
'driver': 'genericDriver',
'theme': 'default'... | |
<|file_name|>monkey_scraper.py<|end_file_name|><|fim▁begin|>from sys import argv
import logging
from MonkeyScraper import MonkeyScraper
LOG_FILENAME = 'MonkeyScraper.log'<|fim▁hole|>
def main(username, password, survey_url):
"""
Creates a MonkeyScraper, logs in, and scrapes the survey at the provided url
... | logging.basicConfig(filename=LOG_FILENAME, level=logging.DEBUG) |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Landing pages administration module
===============================================
<|fim▁hole|> :platform: Django
:synopsis: Landing pages administration module
.. moduleauthor:: (C) 2015 Oliver Gutiérrez
... |
.. module:: landingpages.admin
|
<|file_name|>test.js<|end_file_name|><|fim▁begin|><|fim▁hole|>var throttle = require( "../throttle" );
// Fire callback at end of detection period
var func = throttle(function() {
// Do stuff here
console.log( "throttled" );
}, 200 );
func();<|fim▁end|> | |
<|file_name|>recipe.py<|end_file_name|><|fim▁begin|>import logging, os, random
from zc.buildout import UserError, easy_install
from zc.recipe.egg import Egg
SETTINGS_TEMPLATE = '''
from %(settings_module)s import *
SECRET_KEY = "%(secret)s"
%(settings_override)s
'''
SCRIPT_TEMPLATES = {
'wsgi': easy_install.sc... | attrs = "." + settings[1]
old_script_template = easy_install.script_template
easy_install.script_template = template |
<|file_name|>workflow-template.model.ts<|end_file_name|><|fim▁begin|>import { WithKey } from '../shared/table/data-table.component';
import { AuditWorkflowTemplate, AuditWorkflowTemplateInstance } from './audit.model';
import { Group } from './group.model';
import { Project } from './project.model';
import { Workflow }... | export class WorkflowTemplate {
id: number; |
<|file_name|>proxy.py<|end_file_name|><|fim▁begin|>"""LDAP protocol proxy server"""
from twisted.internet import reactor, defer
from ldaptor.protocols.ldap import ldapserver, ldapconnector, ldapclient
from ldaptor.protocols import pureldap
class Proxy(ldapserver.BaseLDAPServer):
protocol = ldapclient.LDAPClient
... | #TODO self.loseConnection()
return reason # TODO
|
<|file_name|>test_mixing.py<|end_file_name|><|fim▁begin|>import pytest
np = pytest.importorskip("numpy")
npt = pytest.importorskip("numpy.testing")
import networkx as nx
from .base_test import BaseTestAttributeMixing, BaseTestDegreeMixing
class TestDegreeMixingDict(BaseTestDegreeMixing):
def test_degree_mixing... | self.G, "fish", mapping=mapping, normalized=False
)
npt.assert_equal(a, a_result) |
<|file_name|>test_artificial_32_None_MovingAverage_30_12_20.py<|end_file_name|><|fim▁begin|>import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
<|fim▁hole|>art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "MovingAverage", cycle_length = 30, transform = "None", s... | |
<|file_name|>test_devstack.py<|end_file_name|><|fim▁begin|># Copyright 2013: Mirantis Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://w... | server = mock.Mock()
server.host = 'host'
m_endpoint.return_value = 'fake_endpoint'
m_gus.return_value = ds_server = mock.Mock() |
<|file_name|>verify.py<|end_file_name|><|fim▁begin|># Copyright 2010 http://www.collabq.com
import logging
from django.conf import settings
from django.http import HttpResponseRedirect
from common import api
from common import exception
class VerifyInstallMiddleware(object):
def process_request(self, request):<|fi... | |
<|file_name|>countdown.component.ts<|end_file_name|><|fim▁begin|>import { Component, Input } from '@angular/core';
@Component({
selector: 'my-countdown',
templateUrl: './countdown.component.html'
})
export class CountdownComponent {
@Input() milliseconds: number;<|fim▁hole|>
constructor() {
}
getHours() {... | |
<|file_name|>main.py<|end_file_name|><|fim▁begin|>from couchpotato.core.event import addEvent
from couchpotato.core.logger import CPLog
from couchpotato.core.plugins.base import Plugin
log = CPLog(__name__)
class ClientScript(Plugin):
urls = {
'style': {},
'script': {},
}
html = {
... | addEvent('clientscript.get_scripts', self.getScripts)
|
<|file_name|>head-title.js<|end_file_name|><|fim▁begin|>Ember.Handlebars.helper('headTitle', function(title) {<|fim▁hole|> Ember.$('head').find('title').text(title);
}, 'title');<|fim▁end|> | |
<|file_name|>font.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/. */
//! Specified values for font properties
use Atom;
use app_unit... | }
while let Ok(flag) = input.try(|input| { |
<|file_name|>doc.go<|end_file_name|><|fim▁begin|>/*
Copyright 2016 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");<|fim▁hole|> http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is dist... | you may not use this file except in compliance with the License.
You may obtain a copy of the License at
|
<|file_name|>sf_times.py<|end_file_name|><|fim▁begin|>from __future__ import division
from libtbx.test_utils import approx_equal
from libtbx.utils import Usage
from libtbx import easy_run
import libtbx.load_env
import platform
import time
import sys, os
op = os.path
__this_script__ = "cctbx_project/fable/test/sf_times... | compiler_versions = []
if (args[0] == "unit_test"): |
<|file_name|>wikipages.rs<|end_file_name|><|fim▁begin|>use structs::common::{Taiga};
pub struct WikiPagesProxy<'a> {
pub taiga_client: &'a Taiga,
pub project_id: Option<i64>,
}
pub struct WikiPageProxy<'a> {
pub taiga_client: &'a Taiga,
pub wikipage_id: i64,
}
#[derive(Serialize, Deserialize, Debug)]... | pub struct WikiPageListItem {
pub id: i64,
pub slug: String,
pub html: String, |
<|file_name|>views.go<|end_file_name|><|fim▁begin|>package user
import (
"errors"
"github.com/ungerik/go-start/view"
)
// The confirmation code will be passed in the GET parameter "code"
func EmailConfirmationView(profileURL view.URL) view.View {
return view.DynamicView(
func(ctx *view.Context) (view.View, erro... | return view.DIV("error", view.HTML("Invalid email confirmation code!")), nil |
<|file_name|>iDibo_tests.py<|end_file_name|><|fim▁begin|>from nose.tools import *
import iDibo
def setup():
print "SETUP!"
def teardown():
print "TEAR DOWN!"<|fim▁hole|> print "I RAN!"<|fim▁end|> |
def test_basic(): |
<|file_name|>musplayer_qt.cpp<|end_file_name|><|fim▁begin|>#ifndef MUSPLAY_USE_WINAPI
#include <QtDebug>
#include <QFileDialog>
#include <QMessageBox>
#include <QSlider>
#include <QSettings>
#include <QMenu>
#include <QDesktopServices>
#include <QUrl>
#include "ui_mainwindow.h"
#include "musplayer_qt.h"
#include "../P... | |
<|file_name|>cutoffs.cpp<|end_file_name|><|fim▁begin|>/******************************************************************************
** Filename: cutoffs.c
** Purpose: Routines to manipulate an array of class cutoffs.
** Author: Dan Johnson
** History: Wed Feb 20 09:28:51 1991, DSJ, Created.
**
*... | Include Files and Type Defines
----------------------------------------------------------------------------*/
#include "cutoffs.h"
|
<|file_name|>index.js<|end_file_name|><|fim▁begin|>'use strict';
var generators = require('yeoman-generator');
var chalk = require('chalk');
var path = require('path');
var extend = require('deep-extend');
var guid = require('uuid');
module.exports = generators.Base.extend({
/**
* Setup the generator
*/
con... | this.fs.copyTpl(
this.templatePath('common/_bowerrc'),
this.destinationPath('.bowerrc'),
this.genConfig); |
<|file_name|>fuzzy-match-fb-places-step_2.js<|end_file_name|><|fim▁begin|>var Connection = require("./db/db-connection").Connection;
var Tables = require("./db/tables");
const R = require("ramda");
var QUERY_MATCHES = {
$or: [
{percent_name: {$gt: 0.9}},
{
distance: {$lt: 1}
},
... | }
var fuzzyMatchColl = connection.db.collection(Tables.FUZZY_MATCHES_FB_ONE_TO_MANY); |
<|file_name|>stackmachine.py<|end_file_name|><|fim▁begin|>import operator
import math
class Machine():
"""Simple stack based machine designed for genetic programming (GP) experiments.
Easy to use and forgiving with nonfatal errors.
See README and tests for examples.
"""
def __init__(self, d... | self._jmp(a) |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------... | |
<|file_name|>main.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
This plugin is 3rd party and not it is not part of the plexus-streams addon
Torrent-tv.ru (All categories)
"""<|fim▁hole|>core_dir = current_dir.replace(basename,'').replace('parsers','')
sys.path.append(core_dir)
from utils.webutils imp... | import sys,os
current_dir = os.path.dirname(os.path.realpath(__file__))
basename = os.path.basename(current_dir) |
<|file_name|>borrowck-preserve-box-sometimes-needed.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
/... | switcher(None);
switcher(Some(@3));
} |
<|file_name|>issue-4517.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/lice... | fn main() {
let foo: [u8, ..4] = [1u8, ..4u];
bar(foo);
//~^ ERROR mismatched types: expected `int`, found `[u8, .. 4]` |
<|file_name|>archive_org_plugin.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import (unicode_literals, division, absolute_import, print_function)
store_version = 1 # Needed for dynamic plugin loading
__license__ = 'GPL 3'
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
__docfor... | from calibre.gui2.store.opensearch_store import OpenSearchOPDSStore
from calibre.gui2.store.search_result import SearchResult
|
<|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 https://mozilla.org/MPL/2.0/. */
#![deny(unsafe_code)]
#![crate_name = "servo_url"]
#![crate_type... | |
<|file_name|>tests.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from __future__ import unicode_literals
import django
from django.core.exceptions import FieldError
from django.test import SimpleTestCase, TestCase
from .models import (
AdvancedUserStat, Child1, Child2, Child3, Child4, Image, LinkedList,
Parent1... | |
<|file_name|>noise.py<|end_file_name|><|fim▁begin|># Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/... | from __future__ import division
from __future__ import print_function
|
<|file_name|>argumentschema.py<|end_file_name|><|fim▁begin|># Copyright 2014 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http:... | "pairs to your main function."
}
} |
<|file_name|>test10.cpp<|end_file_name|><|fim▁begin|><|fim▁hole|>for(int i=0;i<2000000000;i++);
printf("done\n");
scanf(" ");
}<|fim▁end|> | #include<stdio.h>
main(){ |
<|file_name|>files_2.js<|end_file_name|><|fim▁begin|>var searchData=
[<|fim▁hole|><|fim▁end|> | ['error_2eh',['error.h',['../error_8h.html',1,'']]]
]; |
<|file_name|>stop_signs.rs<|end_file_name|><|fim▁begin|>// Copyright 2018 Google LLC
//<|fim▁hole|>//
// http://www.apache.org/licenses/LICENSE-2.0
//
// 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... | // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at |
<|file_name|>umeditor.config.js<|end_file_name|><|fim▁begin|>/**
* umeditor完整配置项<|fim▁hole|>/**************************提示********************************
* 所有被注释的配置项均为UEditor默认值。
* 修改默认配置请首先确保已经完全明确该参数的真实用途。
* 主要有两种修改方案,一种是取消此处注释,然后修改成对应参数;另一种是在实例化编辑器时传入对应参数。
* 当升级编辑器时,可直接使用旧版配置文件替换新版配置文件,不用担心旧版配置文件中因缺少新功能所需的参数而导... | * 可以在这里配置整个编辑器的特性
*/ |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>"""
Some scripts define objects that we want to import via yaml files
that we pass to the script, so this directory must be a python
module, rather than just a directory full of scripts.
"""<|fim▁end|> | |
<|file_name|>configparser.go<|end_file_name|><|fim▁begin|>/*
Copyright (c) 2013, Alex Yu <alex@alexyu.se>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain ... | |
<|file_name|>main.go<|end_file_name|><|fim▁begin|>package main
import (
"github.com/kataras/iris"
)
// same as embedded-single-page-application but without go-bindata, the files are "physical" stored in the
// current system directory.
var page = struct {
Title string
}{"Welcome"}
func newApp() *iris.Application ... | |
<|file_name|>gohi.go<|end_file_name|><|fim▁begin|>package main<|fim▁hole|> "fmt"
"net/http"
"runtime"
)
func main() {
runtime.GOMAXPROCS(runtime.NumCPU())
http.HandleFunc("/", hello)
fmt.Println("listening...")
err := http.ListenAndServe(":8000", nil)
... |
import ( |
<|file_name|>effects.rs<|end_file_name|><|fim▁begin|>use super::{Effect, EffectState, EffectStats};
use super::EffectState::*;
pub struct DrainEffect {
remaining_duration: usize,
damage: usize,
health_regeneration: usize,
}
impl DrainEffect {
pub fn new(duration: usize, damage: usize, health_regenerat... | |
<|file_name|>about_iteration.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutIteration(Koan):
def test_iterators_are_a_type(self):
it = iter(range(1,6))
fib = 0
for num in it:
fib += num
... | return (item % 2) == 0
seq = [1, 2, 3, 4, 5, 6]
even_numbers = list() |
<|file_name|>erlang_rust_port.rs<|end_file_name|><|fim▁begin|>// see erlang_rust_port.erl
extern crate erl_ext;
extern crate getopts;
<|fim▁hole|>use std::io;
use std::env;
fn main() {
let args: Vec<String> = env::args().collect();
let mut opts = Options::new();
opts.optflag("u", "utf8-atoms", "Use utf-8... | use getopts::Options;
use erl_ext::{Decoder,Encoder,Error};
|
<|file_name|>gles2_implementation_unittest.cc<|end_file_name|><|fim▁begin|>// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Tests for GLES2Implementation.
#include "gpu/command_buffer/client/gles... | |
<|file_name|>persistent_factories.py<|end_file_name|><|fim▁begin|>"""Provides factories for Split."""
from xmodule.modulestore import ModuleStoreEnum
from xmodule.course_module import CourseDescriptor
from xmodule.x_module import XModuleDescriptor
import factory
from factory.helpers import lazy_attribute
from opaque_ke... | if isinstance(parent_location, UsageKey): |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># $Id: __init__.py 7646 2013-04-17 14:17:37Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
This package contains Docutils parser modules.
"""
__docformat__ = 'reStructuredText'
import sys
f... | |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>import { app } from "../src/app"<|fim▁hole|>import * as Mongoose from "mongoose"
(<any>Mongoose).Promise = global.Promise
Mongoose.connect("mongodb://localhost/simple-restful-api")
.catch(e => console.log(e))
app.listen(5000)
console.log("http://localhost:5000")<... | |
<|file_name|>test_compliancebuilding.py<|end_file_name|><|fim▁begin|>import os
import tempfile
import unittest
import logging
from pyidf import ValidationLevel
import pyidf<|fim▁hole|>
class TestComplianceBuilding(unittest.TestCase):
def setUp(self):
self.fd, self.path = tempfile.mkstemp()
def tearDow... | from pyidf.idf import IDF
from pyidf.compliance_objects import ComplianceBuilding
log = logging.getLogger(__name__) |
<|file_name|>docker_test.go<|end_file_name|><|fim▁begin|>package docker
import (
"testing"
"time"
"github.com/influxdata/telegraf/testutil"
"github.com/docker/docker/api/types"
"github.com/stretchr/testify/require"
)
func TestDockerGatherContainerStats(t *testing.T) {
var acc testutil.Accumulator
stats := te... | label, tt.include, tt.exclude) |
<|file_name|>2.py<|end_file_name|><|fim▁begin|>import timeit
import pyximport; pyximport.install()
from mod2 import cysum, cysum2
def pysum(start, step, count):
ret = start
for i in range(count):<|fim▁hole|> return ret
print('Python',
timeit.timeit('pysum(0, 1, 100)', 'from __main__ import pysum'))
... | ret += step |
<|file_name|>description.go<|end_file_name|><|fim▁begin|>package resources
import (
"fmt"
"strings"
)
// Description holds information about information of the SKU description, whith strings to be included/omitted.
type Description struct {
Contains []string
Omits []string
}
func (d *Description) fillForCompu... | d.Omits = append(d.Omits, "Preemptible") |
<|file_name|>net.rs<|end_file_name|><|fim▁begin|>//! A chat server that broadcasts a message to all connections.
//!
//! This example is explicitly more verbose than it has to be. This is to
//! illustrate more concepts.
//!
//! A chat server for telnet clients. After a telnet client connects, the first
//! line should... | });
|
<|file_name|>database_adapter.py<|end_file_name|><|fim▁begin|># ===============================================================================
# Copyright 2011 Jake Ross
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obta... | kw["joins"] = joins
return kw
|
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'TrackedUser'
db.create_table('us... | models = {
'user_analytics.trackeduser': { |
<|file_name|>hog.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# coding: utf-8
#
# License: BSD; see LICENSE for more details.
from pygments.lexer import RegexLexer, include, bygroups
import pygments.token as t
class SnortLexer(RegexLexer):
name = 'Snort'
aliases = ['snort', 'hog']
filenames = ['*.... |
if len(argv) > 1:
import io |
<|file_name|>pub-restricted-error.rs<|end_file_name|><|fim▁begin|>// Copyright 2017 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.apach... | |
<|file_name|>tax_summary_edit.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
"""<|fim▁hole|>edits mothur taxonomy summary file
transfers last name that is not "unclassified" or "uncultured" to "unclassified" or "uncultured" assignment
make sure that the file has default sorting (by rankID)
Copyright:
tax... | |
<|file_name|>ParseException.java<|end_file_name|><|fim▁begin|>/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 3.0 */
package org.cfeclipse.cfml.parser.cfscript;
/**
* This exception is thrown when parse errors are encountered.
* You can explicitly create objects of this exception type b... | |
<|file_name|>MinusMD.cpp<|end_file_name|><|fim▁begin|>// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
// NScD Oak Ridge National Laboratory, European Spallation Source
// & Institut Laue - Langevin
// SPDX - License - Identifie... | MDBoxIterator<MDE, nd> it2(box2, 1000, true);
do {
MDBox<MDE, nd> *box = dynamic_cast<MDBox<MDE, nd> *>(it2.getBox()); |
<|file_name|>artistphoto.py<|end_file_name|><|fim▁begin|>#################################################################
# This file is part of glyr
# + a command-line tool and library to download various sort of music related metadata.
# + Copyright (C) [2011-2012] [Christopher Pahl]
# + Hosted at: https://github.c... | 'data': [{
'options': {
'get_type': 'artistphoto',
'artist': 'Alestorm' |
<|file_name|>hexcodes.json.d.ts<|end_file_name|><|fim▁begin|>import { HexcodesDataset } from 'emojibase';
<|fim▁hole|>declare const data: HexcodesDataset;
export default data;<|fim▁end|> | |
<|file_name|>LinkCurrentWindowExample.py<|end_file_name|><|fim▁begin|>from muntjac.api import VerticalLayout, Link
from muntjac.terminal.theme_resource import ThemeResource
from muntjac.terminal.external_resource import ExternalResource
class LinkCurrentWindowExample(VerticalLayout):
_CAPTION = 'Open Google'
... | |
<|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/. */
#![deny(unsafe_code)]<|fim▁hole|>extern crate log;
extern crate m... |
extern crate ipc_channel;
#[macro_use] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.