prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>error_types.rs<|end_file_name|><|fim▁begin|>use std::collections::BTreeMap;
use std::io::Write;
use ::Service;
use codegen::botocore::{Operation};
use super::{IoResult, FileWriter, error_type_name};
/// Examines the error types described in the botocore definition for an operation
/// and generates a Rus... | for (operation_name, operation) in service.operations().iter() {
self.generate_error_type(writer, &operation_name, &operation, &error_documentation)?;
}
Ok(()) |
<|file_name|>QTableProvider.java<|end_file_name|><|fim▁begin|>/**
* Copyright (c) 2012, 2016 Sme.UP and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* htt... |
/** |
<|file_name|>production.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Production Configurations
- Use Amazon's S3 for storing static files and uploaded media
- Use mailgun to send emails
- Use Redis for cache
- Use sentry for error logging
"""
from __future__ import absolute_import, unicode_literals
... | 'formatter': 'verbose' |
<|file_name|>service.go<|end_file_name|><|fim▁begin|>package service
import (
"io/ioutil"
"net/http"
"gopkg.in/gin-gonic/gin.v0"
"gopkg.in/jmoiron/sqlx.v0"
_ "gopkg.in/lib/pq.v0"
_ "gopkg.in/mattn/go-sqlite3.v0"
)
type Config struct {
ServiceHost string `yaml:"host,flow"`
DbDriver string `yaml:"driver,flo... | dbh, err := GetDBHandler(conf) |
<|file_name|>autoform.js<|end_file_name|><|fim▁begin|>Meteor.startup(() => {
AutoForm.setDefaultTemplate('ionic');<|fim▁hole|><|fim▁end|> | }); |
<|file_name|>app.js<|end_file_name|><|fim▁begin|>'use-strict';
var hours = ['6:00am', '7:00am', '8:00am', '9:00am', '10:00am', '11:00am', '12:00pm', '1:00pm', '2:00pm', '3:00pm', '4:00pm', '5:00pm', '6:00pm', '7:00pm'];
var allLocations = [];
var theTable = document.getElementById('pike');
var el = document.getElement... | // prevent empty
if(!newStoreLocation || !minCustomers || !maxCustomers || !avgCookie){
return alert('All fields must have a value');
} |
<|file_name|>ja_translator_diff_test.rs<|end_file_name|><|fim▁begin|>extern crate chrono;
extern crate tina;
use tina::*;
mod eew_builder;
use eew_builder::*;
enum Diff { Up, Down, Same }
fn expect_normal_eew_string(maximum_intensity: Option<IntensityClass>, updown: Diff) -> String
{
let i_str = match maximum_inte... | }
#[test]
fn it_should_format_with_intensity_up_from_unknown() |
<|file_name|>reaperlog.go<|end_file_name|><|fim▁begin|>package reaperlog
import (
log "github.com/Sirupsen/logrus"
"github.com/rifflock/lfshook"
"go.mozilla.org/mozlogrus"
)
var config LogConfig
type LogConfig struct {
Extras bool
}
func EnableExtras() {
config.Extras = true
}
func EnableMozlog() {
mozlogrus... | log.Warningf(format, args...)
}
|
<|file_name|>index.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | module.exports = require('./src/angularjs-dependencies-wrapper'); |
<|file_name|>TemplateString.js<|end_file_name|><|fim▁begin|>exports._buildExclamationKeyObject = function (tuples) {
var valueMap = {};
tuples.forEach(function (tuple) {
valueMap['!' + tuple.value0] = tuple.value1;
});
return valueMap;
};
var templatePattern = /\$\{([^}]+)\}/g;
<|fim▁hole|>};<|fim▁end|> | exports._getTemplateVars = function (str) {
return (str.match(templatePattern) || []).map(function (str) {
return str.substring(2, str.length - 1);
}); |
<|file_name|>Errors.py<|end_file_name|><|fim▁begin|>class BaseRuntimeException(BaseException):
def __init__(self, message):
super().__init__(message)
class MemoryError(BaseRuntimeException):
pass
class NameError(MemoryError):
pass
class TypeError(BaseRuntimeException):
pass
class ArithmeticE... | pass
|
<|file_name|>messages.component.spec.ts<|end_file_name|><|fim▁begin|>import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { MessagesComponent } from './messages.component';
import { MessageService } from '../message.service';
describe('MessagesComponent', () => {
let component: Me... | }).compileComponents();
messageService = TestBed.inject(MessageService);
})); |
<|file_name|>ansible_api.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python2
from collections import namedtuple
from ansible.parsing.dataloader import DataLoader
from ansible.vars import VariableManager
from ansible.inventory import Inventory
from ansible.playbook.play import Play
from ansible.executor.task_queue_manage... | |
<|file_name|>Cycle_Day_100_D_60.py<|end_file_name|><|fim▁begin|>import tests.periodicities.period_test as per
<|fim▁hole|><|fim▁end|> | per.buildModel((60 , 'D' , 100)); |
<|file_name|>currency.py<|end_file_name|><|fim▁begin|>from decimal import Decimal
import logging
logger = logging.getLogger(__name__)
def check_number_for_decimal_conversion(number):
a = type(number) in (int, long)
b = isinstance(number, (str, unicode, Decimal))
c = isinstance(number, float)
if not... | |
<|file_name|>ThreadPoolStats.java<|end_file_name|><|fim▁begin|>/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in complianc... | private final int threads;
private final int queue; |
<|file_name|>ckeditor.js<|end_file_name|><|fim▁begin|>/*
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
/**
* @fileOverview Contains the third and last part of the {@link CKEDITOR} object
* definition.
*/
// ... | * @name CKEDITOR#currentInstance
* @event
|
<|file_name|>suggestionsObservable.js<|end_file_name|><|fim▁begin|>(function() {
'use strict';
var module = angular.module('offerFormDirective');
module.factory('requestSuggestions', ['$http', function($http) {
return function(args) {
return Rx.Observable.fromPromise(
$http.post('/api/v1/resta... | }]);
})(); |
<|file_name|>option_chain.py<|end_file_name|><|fim▁begin|>from kaleidoscope.event import DataEvent
from kaleidoscope.options.option_query import OptionQuery
class OptionChainIterator(object):
def __init__(self, data):
self.data = data
# get all quote dates that can be iterated
self.dates ... | |
<|file_name|>editor.py<|end_file_name|><|fim▁begin|>from browser import window<|fim▁hole|>from preprocess import transform
from reeborg_en import * # NOQA
src = transform(window.editor.getValue())
exec(src)<|fim▁end|> | |
<|file_name|>base.py<|end_file_name|><|fim▁begin|>"""Common settings and globals."""
from os.path import abspath, basename, dirname, join, normpath
from sys import path
########## PATH CONFIGURATION
# Absolute filesystem path to the Django project directory:
DJANGO_ROOT = dirname(dirname(abspath(__file__)))
# Abso... | ('Your Name', 'your_email@example.com'), |
<|file_name|>MobilePromptSample.tsx<|end_file_name|><|fim▁begin|>/**
* Copyright 2020 Google LLC<|fim▁hole|> * 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/LICENSE-2.0
*
* Unless required by applicable law or agr... | *
* Licensed under the Apache License, Version 2.0 (the "License"); |
<|file_name|>nuvmresync.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redis... | This attribute is named `lastUpdatedBy` in VSD API.
"""
self._last_updated_by = value |
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>#! python 3
# -*- coding: utf8 -*-
from coverage import coverage
cov = coverage(branch=True, omit=['venv/*', 'tests.py'])
cov.start()
import os
import unittest
from datetime import datetime, timedelta
import bcrypt
from config import basedir, SQLALCHEMY_DATABASE_UR... | g.users.append(u1)
assert u1.groups.count() == 1
|
<|file_name|>RoomItem.js<|end_file_name|><|fim▁begin|>/* @flow */
import React, { Component, PropTypes } from 'react';
import ReactNative from 'react-native';
import shallowEqual from 'shallowequal';
import Colors from '../../../Colors';
import AppText from '../AppText';
import ListItem from '../ListItem';
import Icon... | },
});
};
|
<|file_name|>fix_doxygen_file_lines.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import sys
import re
"""Rewrite the doxygen \\file lines to have the full path to the file."""
def fix(filename):
contents = open(filename, "r").read()
contents = re.sub(
"\\\\file .*\\.h",
"\\\\file " ... | contents, |
<|file_name|>deep_extend_underscore_mixin.js<|end_file_name|><|fim▁begin|>/**
* Based conceptually on the _.extend() function in underscore.js ( see http://documentcloud.github.com/underscore/#extend for more details )<|fim▁hole|> * Copyright (C) 2012 Kurt Milam - http://xioup.com | Source: https://gist.github.co... | |
<|file_name|>instructions.py<|end_file_name|><|fim▁begin|>from util import A, B, B_reversed, C, D, E, F, G, H, instr, spec, spec_reversed
_mark = set(dir()) ; _mark.add('_mark')
@A
def jmp(address):
'''
1001 010k kkkk 110k
kkkk kkkk kkkk kkkk
'''
def cli():
return 16, 0b1001010011111000
@B
def ldi(reg... |
@G
def pop(Rd): |
<|file_name|>dell-wsman-reset-components-spec.js<|end_file_name|><|fim▁begin|>// Copyright 2017, Dell EMC, Inc.
/* jshint node:true */
'use strict';
describe(require('path').basename(__filename), function () {
var base = require('./base-task-data-spec');
base.before(function (context) {
context.taskd... | }); |
<|file_name|>Persona.java<|end_file_name|><|fim▁begin|>/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package beans;
import java.io.Serializable;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
/**
*
* @... | this.apellido = apellido; |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from setuptools import find_packages, setup
with open('README.rst') as r:
readme = r.read()
with open('AUTHORS.txt') as a:
# reSt-ify the authors list
authors = ''<|fim▁hole|> for author in a.read().split('\n'):
authors... | |
<|file_name|>spectrometers.py<|end_file_name|><|fim▁begin|>### import ####################################################################
import pycmds.project.classes as pc
import pycmds.hardware.hardware as hw
import pathlib
import appdirs
import toml
import yaqc
### driver ######################################... | |
<|file_name|>test_init.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3.8
import os
import sys
import unittest
SCRIPT_DIR = os.path.dirname(
os.path.realpath(os.path.join(os.getcwd(), os.path.expanduser(__file__))))
sys.path.append(
os.path.normpath(os.path.join(SCRIPT_DIR, os.path.pardir, os.path.pardi... | blocks = [
Block(start=1, end=10, length=4),
Block(start=6, end=9, length=4),
Block(start=3, end=7, length=4), |
<|file_name|>maintainers.py<|end_file_name|><|fim▁begin|>import sqlalchemy
from pypi_org.data.modelbase import SqlAlchemyBase
class Maintainer(SqlAlchemyBase):
__tablename__ = 'maintainers'
<|fim▁hole|><|fim▁end|> | user_id: int = sqlalchemy.Column(sqlalchemy.Integer, primary_key=True)
package_id: str = sqlalchemy.Column(sqlalchemy.String, primary_key=True) |
<|file_name|>test_nondet.py<|end_file_name|><|fim▁begin|>import numpy as np
from numba import cuda, float32
from numba.cuda.testing import unittest, CUDATestCase
<|fim▁hole|>def generate_input(n):
A = np.array(np.arange(n * n).reshape(n, n), dtype=np.float32)
B = np.array(np.arange(n) + 0, dtype=A.dtype)
re... | |
<|file_name|>callback.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/. */
//! Base classes to work with IDL callbacks.
use dom::bindi... | }
/// A common base class for representing IDL callback function and |
<|file_name|>ExpressionTest.java<|end_file_name|><|fim▁begin|>package com.logicalpractice.collections;
import static org.junit.Assert.*;
import static org.hamcrest.Matchers.* ;
import org.junit.Test;<|fim▁hole|>public class ExpressionTest {
@Test
public void script1() throws Exception {
Person bill... | |
<|file_name|>JCursorMapViewer.java<|end_file_name|><|fim▁begin|>/*FreeMind - A Program for creating and viewing Mindmaps
*Copyright (C) 2000-2011 Joerg Mueller, Daniel Polansky, Christian Foltin, Dimitri Polivaev and others.
*
*See COPYING for Details
*
*This program is free software; you can redistribute it and/o... | |
<|file_name|>functions.rs<|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 under the ... | "PrimitiveArray<UInt64>\n[\n 1,\n 1,\n]", |
<|file_name|>System.cpp<|end_file_name|><|fim▁begin|>#include "stdafx.h"
#include "Utilities/Log.h"
#include "Utilities/File.h"
#include "git-version.h"
#include "rpcs3/Ini.h"
#include "Emu/Memory/Memory.h"
#include "Emu/System.h"
#include "Emu/GameInfo.h"
#include "Emu/SysCalls/ModuleManager.h"
#include "Emu/Cell/PPU... | |
<|file_name|>TasksManager.js<|end_file_name|><|fim▁begin|>import React, {Component, Fragment} from "react";
import {Card, Button, ListGroup, ListGroupItem} from "helpers/reactstrap";
import {Duration} from "luxon";
import {Mutation} from "react-apollo";
import gql from "graphql-tag.macro";
import {capitalCase} from "ch... | |
<|file_name|>formatters.js<|end_file_name|><|fim▁begin|>/**
* general purpose formatters
*
* @author Tim Golen 2014-02-12
*/
define(['rivets'], function(rivets) {
/**
* casts a value to a number
*
* @author Tim Golen 2013-10-22
*
* @param {mixed} value
*
* @return {number}
*/
rivets.formatters.nu... | *
* @param {mixed} value |
<|file_name|>59855000.jsonp.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | jsonp({"cep":"59855000","cidade":"Ita\u00fa","uf":"RN","estado":"Rio Grande do Norte"}); |
<|file_name|>redraw.cpp<|end_file_name|><|fim▁begin|>/* Copyright (C) 2003-2013 Runtime Revolution Ltd.
This file is part of LiveCode.
LiveCode is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License v3 as published by the Free
Software Foundation.
LiveCode is dis... | t_is_sprite = false;
|
<|file_name|>wallets.js<|end_file_name|><|fim▁begin|>/*
Copyright 2017 Aleksandar Jankovic
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... | |
<|file_name|>vec_pad_left.rs<|end_file_name|><|fim▁begin|>use malachite_base::vecs::vec_pad_left;
use malachite_base_test_util::bench::bucketers::triple_1_vec_len_bucketer;
use malachite_base_test_util::bench::{run_benchmark, BenchmarkType};
use malachite_base_test_util::generators::common::{GenConfig, GenMode};
use ma... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|># License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import ir_model
from . import trgm_index<|fim▁end|> | # -*- coding: utf-8 -*- |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"kanbanpad.com API v1 library for Python"
<|fim▁hole|>VERSION = _version.tuple
__author__ = "Marek Wywia\xc5\x82"
__contact__ = "onjinx@gmail.com"
__homepage__ = "http://github.com/onjin/python-kanbanpad"
__version__ = _version.dotted<|fim▁e... | from kanbanpad import _version
|
<|file_name|>maint_graphics.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os
import time
import django
from userreport import maint
os.environ['DJANGO_SETTINGS_MODULE'] = 'userreport.settings'
django.setup()
start_time = time.time()
remove_time, get_time, save_time = maint.refresh_data()
total_time =... | print("--- Remove Time: {:>5.2f} seconds, {:>5.2%} ---".format(remove_time, remove_time / total_time))
print("--- Get Time: {:>5.2f} seconds, {:>5.2%} ---".format(get_time, get_time / total_time)) |
<|file_name|>screenshots.test.js<|end_file_name|><|fim▁begin|>'@fixture click';
'@page http://example.com';
'@test'['Take a screenshot'] = {
'1.Click on non-existing element': function () {
act.screenshot();
},
};<|fim▁hole|>'@test'['Screenshot on test code error'] = {
'1.Click on non-existing elem... | |
<|file_name|>test_file.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
from django.core.files.base import ContentFile
from sentry.models import File, FileBlob
from sentry.testutils import TestCase
class FileBlobTest(TestCase):
def test_from_file(self):
fileobj = ContentFile("foo b... | my_file2 = FileBlob.from_file(fileobj)
# deep check
assert my_file1.id == my_file2.id
assert my_file1.checksum == my_file2.checksum |
<|file_name|>gyptest-system-include.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
<|fim▁hole|># found in the LICENSE file.
"""
Checks that msvs_system_include_dirs works.
"""
import TestGyp
import sys
if sys.platform == 'win32':
test = TestGyp.TestGyp(formats=['msvs', 'ninja'])
CHDIR = 'system-include'... | # Copyright (c) 2014 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be |
<|file_name|>film_sorter.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
'''
Files and renames your films according to genre
using IMDb API
supert-is-taken 2015
'''
from imdb import IMDb<|fim▁hole|>import sys
import re
import os
import errno
import codecs
db=IMDb()
def main(argv):
for filename in sys.ar... | |
<|file_name|>app.ts<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright 2020 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
*
* http://www.apach... | import './components/file_modal/file_modal.js'; |
<|file_name|>GfxdConcurrentCache.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2010-2015 Pivotal Software, 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 a... | } |
<|file_name|>size.rs<|end_file_name|><|fim▁begin|>extern crate iron_valid;
extern crate mime;
extern crate params;
use iron_valid::{Rule, validate};
use mime::Mime;
use params::{File, Map, Value};
use std::collections::BTreeMap;
use std::path::PathBuf;
use std::str::FromStr;
#[test]
fn test_size_valid_string() {
... |
#[test] |
<|file_name|>DirectionToFeatureAction.js<|end_file_name|><|fim▁begin|>///////////////////////////////////////////////////////////////////////////
// Copyright © 2014 - 2016 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance w... | return clazz; |
<|file_name|>commands.rs<|end_file_name|><|fim▁begin|>#![allow(dead_code)]
extern crate jam;
extern crate cgmath;
extern crate time;
extern crate glutin;
extern crate image;
extern crate gfx_device_gl;
#[macro_use]
extern crate aphid;
use std::f64::consts::PI;
use std::path::{Path, PathBuf};
use cgmath::Rad;
use ap... | let keys_to_delete : Vec<_>= self.geometry.keys().filter(|e| pred(e)).cloned().collect();
for key in keys_to_delete.iter() {
self.geometry.remove(key); |
<|file_name|>0006_auto_20150729_1539.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('imager_images', '0005_auto_20150728_0129'),
]
operations = [
... | ),
] |
<|file_name|>zmq_comm.py<|end_file_name|><|fim▁begin|>import zmq
import random
import time
import zmq_ports as ports
import zmq_topics as topic
from websocket import create_connection
RCV_DELAY=0.01
WSPORT = 9000
########### WEBSOCKET EVENTS
########### WEBSOCKET EVENTS
if __name__ == '__main__':
#print("Startin... | if(msg[0]=="Q"):
comm_publisher.send_string("%s %s" % (topic.CONNECTION_TOPIC, msg[1]))
connected=msg[1] |
<|file_name|>statsd.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, division, print_function, unicode_literals
# Statsd client. Loosely based on the version by Steve Ivy <steveivy@gmail.com>
import logging
import random
import socket
import time
from contextlib import contextmanager
log = log... | """
Increments one or more stats counters
""" |
<|file_name|>plugins.js<|end_file_name|><|fim▁begin|>'use strict';
/*!
* V4Fire Client Core
* https://github.com/V4Fire/Client
*
* Released under the MIT license
* https://github.com/V4Fire/Client/blob/master/LICENSE
*/
const
$C = require('collection.js');
const
{getThemes} = include('build/ds'),
{getThemed... | isThemed = isFieldThemed(head), |
<|file_name|>LuceneSearchResultsMap.java<|end_file_name|><|fim▁begin|>/*
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agre... | * (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
<|file_name|>test.js<|end_file_name|><|fim▁begin|>/**
* Created by gbaldeck on 4/17/2017.
*/
var prototype = Object.create(HTMLElement.prototype)<|fim▁hole|>console.log("prototype: ", prototype)<|fim▁end|> | |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>mod token_builder;
use ast::{Exp, Lit};
use errors::{LexError, YamlError};
use lexer::token_builder::append_ch;
use std::collections::VecDeque;
#[derive(Clone, PartialEq)]
pub enum WordState {
Variable,
Number,
Decimal,
String,
Operator,
None,
}... |
pub struct Lexer {
pub state: LexerState, |
<|file_name|>file.py<|end_file_name|><|fim▁begin|># ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the L... | assert f.read() == data, "Eeek - Python could not read the data back correctly after recreating an existing file!" |
<|file_name|>tasks.py<|end_file_name|><|fim▁begin|>from django.conf import settings
<|fim▁hole|>
@app.task
def celery_healthcheck():
"""Ping healthchecks.io periodically to monitor celery/celerybeat health."""
response = requests.get(settings.HEALTHCHECKS_IO_URL)
return response.status_code == requests.co... | import requests
from mozillians.celery import app |
<|file_name|>tag.py<|end_file_name|><|fim▁begin|>from collections import UserList
from copy import copy
from npc.util import print_err
class Tag(UserList):
"""
Defines a mult-value tag object
"""
def __init__(self, name: str, *args, required: bool=False, hidden: bool=False, limit: int=-1):
"""
... | |
<|file_name|>clone.rs<|end_file_name|><|fim▁begin|>#![feature(core)]
extern crate core;
#[cfg(test)]
mod tests {
use core::hash::SipHasher;
use core::hash::Hasher;
use core::clone::Clone;
// pub struct SipHasher {
// k0: u64,
// k1: u64,
// length: usize, // how many bytes we'... | // while i < end {
// let mi = u8to64_le!(msg, i); |
<|file_name|>authinterceptor.js<|end_file_name|><|fim▁begin|>'use strict';
/**
* @ngdoc service<|fim▁hole|> * @name publicApp.AuthInterceptor
* @description
* # AuthInterceptor
* Factory in the publicApp.
*/
angular.module('publicApp')
.factory('AuthInterceptor', function(JwtFactory) {
// Public API h... | |
<|file_name|>PhysicsController.js<|end_file_name|><|fim▁begin|>(function(jiglib) {
var MaterialProperties = jiglib.MaterialProperties;
var CachedImpulse = jiglib.CachedImpulse;
var PhysicsState = jiglib.PhysicsState;
var RigidBody = jiglib.RigidBody;
var HingeJoint = jiglib.HingeJoint;
var BodyPair = jigl... | {
|
<|file_name|>list_comprehension.py<|end_file_name|><|fim▁begin|>squares = [x**2 for x in range(10)]<|fim▁hole|>print couples<|fim▁end|> | print squares
couples = [(x, y) for x in [1,2,3] for y in [3,1,4] if x != y] |
<|file_name|>Customer.java<|end_file_name|><|fim▁begin|>package com.pluralsight.orderfulfillment.customer;
/**
* Domain object for a Customer
*
* @author Michael Hoffman, Pluralsight
*
*/
public class Customer {
private long id;
private String firstName;
private String lastName;
private String email... |
/** |
<|file_name|>protractor.conf.js<|end_file_name|><|fim▁begin|>exports.config = {
allScriptsTimeout: 11000,
specs: [
'*.js'
],
capabilities: {
'browserName': 'chrome'
},
<|fim▁hole|> baseUrl: 'http://localhost:8080/mylibrary/',
framework: 'jasmine',
jasmineNodeOpts: {
defaultTimeoutInterval... | |
<|file_name|>2.cpp<|end_file_name|><|fim▁begin|>/*
* @Date : Shandagames2018/09/02
* @Author : IceCory (icecory520@gmail.com)
* @Copyright(C): GPL 3.0
*/
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <tuple>
// 输入三元组(x,y,z)数量n
// 一个值a
// logn 的复杂度内找到所有的三元组(满足 y <= a <= z... | std::vector<int> ans; |
<|file_name|>oe_test_utils.py<|end_file_name|><|fim▁begin|># Copyright (c) 2002-2016, California Institute of Technology.
# All rights reserved. Based on Government Sponsored Research under contracts NAS7-1407 and/or NAS7-03001.
#
# Redistribution and use in source and binary forms, with or without modification, are p... | |
<|file_name|>test_parser.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Author: Matías Bordese
"""Tests for the unified diff parser process."""
import os.path
import unittest2
from nlg4patch.unidiff import parser
class TestUnidiffParser(unittest2.TestCase):
"""Tests for Unified Diff Parser."""
<|fi... | def setUp(self): |
<|file_name|>omwllf.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
from struct import pack, unpack
from datetime import date
from pathlib import Path
import os.path
import argparse
import sys
import re
configFilename = 'openmw.cfg'
configPaths = { 'linux': '~/.config/openmw',
'freebsd': '~/... | if pl in configPaths:
baseModDir = os.path.expanduser(modPaths[pl])
elif pl == 'win32': |
<|file_name|>Time.py<|end_file_name|><|fim▁begin|>import time<|fim▁hole|>
def start():
return time.time()<|fim▁end|> | |
<|file_name|>symcrypto_test.py<|end_file_name|><|fim▁begin|>import unittest
from charm.toolbox.symcrypto import SymmetricCryptoAbstraction,AuthenticatedCryptoAbstraction, MessageAuthenticator
from charm.toolbox.pairinggroup import PairingGroup,GT
from charm.core.math.pairing import hashPair as sha1
class SymmetricCryp... | |
<|file_name|>preferWhile.examples.ts<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright 2018 Palantir Technologies, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* h... | for(let i = 1; i < 10; i++) { |
<|file_name|>TabBar.tsx<|end_file_name|><|fim▁begin|>import { themeGet } from "@styled-system/theme-get"
import React from "react"
import { Animated, View } from "react-native"
import styled from "styled-components/native"
import { Box, ClassTheme, Sans } from "palette"
/**
* Nearly all props are given by the Scroll... | const numberOfTabs = this.props.tabs.length
|
<|file_name|>forms.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, unicode_literals
import logging
from django import forms
from django.contrib import messages
from django.http import Http404
from django.utils.encoding import smart_str
from easy_maps.models import Address
from . import lib
l... | |
<|file_name|>event-delegate-debug.js<|end_file_name|><|fim▁begin|>version https://git-lfs.github.com/spec/v1
oid sha256:0f37b0ed995928892d2a7c5d05dbecd85b0d4d248931074f5f228f0c14bf5909<|fim▁hole|><|fim▁end|> | size 11378 |
<|file_name|>unsendable-class.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.or... | i: int, |
<|file_name|>workqueue.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/. */
//! A work queue for scheduling units of work across thread... | /// The amount of work that has been enqueued.
work_count: usize, |
<|file_name|>const_MIN_10_EXP.rs<|end_file_name|><|fim▁begin|>#![feature(core)]<|fim▁hole|>mod tests {
use core::f32::MIN_10_EXP;
// pub const MIN_10_EXP: i32 = -37;
#[test]
fn min_10_exp_test1() {
assert_eq!(MIN_10_EXP, -37);
}
}<|fim▁end|> | extern crate core;
#[cfg(test)] |
<|file_name|>customMarkerTest.py<|end_file_name|><|fim▁begin|>#!/bin/env python
from CoaSim import *
cm = CustomMarker(0.1)
assert cm.position == 0.1
class MyMarker(CustomMarker):
def __init__(self,pos):
CustomMarker.__init__(self,pos)
def defaultValue(self):
return 1
def mutate(self, par... | |
<|file_name|>logout.py<|end_file_name|><|fim▁begin|>from app import Handler
from handlers.auth import Auth
class LogoutHandler(Handler):<|fim▁hole|> def get(self):
Auth.logout(self.response)
self.redirect("/")<|fim▁end|> | |
<|file_name|>RegionFinderTest.java<|end_file_name|><|fim▁begin|>/*
************************************************************************
******************* CANADIAN ASTRONOMY DATA CENTRE *******************
************** CENTRE CANADIEN DE DONNÉES ASTRONOMIQUES **************
*
* (c) 2009. ... | |
<|file_name|>filterMaqMapview.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""
filterMapview.py <input mapview file> <output filename>
Author: Tony Papenfuss
Date: Mon Jun 16 14:31:42 EST 2008
"""
import os, sys
from useful import progressMessage
iFilename = sys.argv[1]
oFilename = sys.argv[2]
mQ_cutoff... | format = '\t'.join(['%s','%s','%i','%s','%i','%i','%i','%i'])
|
<|file_name|>import_window.py<|end_file_name|><|fim▁begin|># Copyright 2019 Virgil Dupras
#
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.gnu.org/licenses/gpl-3.0.html
import datetime
... | pass
|
<|file_name|>user.js<|end_file_name|><|fim▁begin|>import {extend} from 'lodash';
export default class User {
/**
* The User class
* @class
* @param {Object} user
* @return {Object} A User
*/<|fim▁hole|> console.log(this);
}
}<|fim▁end|> | constructor(user) {
extend(this, user);
|
<|file_name|>development.py<|end_file_name|><|fim▁begin|>from .common import *
<|fim▁hole|>CORS_ORIGIN_WHITELIST = (
'localhost:8000',
)
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
}
}
Q_CLUSTER = {
'name': 'DjangORM',
'workers': 2,
'timeout': 90,
... | INTERNAL_IPS = ['127.0.0.1', ] |
<|file_name|>cache.py<|end_file_name|><|fim▁begin|>"""Caching Library using redis."""
import logging
from functools import wraps
from flask import current_app
from walrus import Walrus
import api
import hashlib
import pickle
from api import PicoException
log = logging.getLogger(__name__)
__redis = {
"walrus": ... | def get_cache(): |
<|file_name|>KeyBindings.py<|end_file_name|><|fim▁begin|>keyBindings = { }
from keyids import KEYIDS
from Components.config import config
from Components.RcModel import rc_model
keyDescriptions = [{
KEYIDS["BTN_0"]: ("UP", "fp"),
KEYIDS["BTN_1"]: ("DOWN", "fp"),
KEYIDS["KEY_OK"]: ("OK", ""),
KEYIDS["KEY_UP"]:... | KEYIDS["KEY_1"]: ("1",),
KEYIDS["KEY_2"]: ("2",), |
<|file_name|>aria_slider_tpg.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
"""Test of ARIA horizontal sliders using Firefox."""
from macaroon.playback import *
import utils
sequence = MacroSequence()
#sequence.append(WaitForDocLoad())
sequence.append(PauseAction(10000))
sequence.append(KeyComboAction("Tab"))
se... | "5. Volume Left Arrow", |
<|file_name|>build.rs<|end_file_name|><|fim▁begin|>// Copyright © 2015, Peter Atashian<|fim▁hole|><|fim▁end|> | // Licensed under the MIT License <LICENSE.md>
fn main() {
println!("cargo:rustc-flags=-l rpcproxy");
} |
<|file_name|>package.py<|end_file_name|><|fim▁begin|>##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, t... | |
<|file_name|>validating.py<|end_file_name|><|fim▁begin|># coding: utf-8
"""参数验证相关工具
"""
import re
import ujson
import types
import numbers
from girlfriend.util.lang import args2fields
from girlfriend.exception import InvalidArgumentException
class Rule(object):
"""描述参数验证规则,并执行验证过程
"""
@args2fields()
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.