prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>InvalidParameterValueExceptionUnmarshaller.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2010-2015 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 cop... | return errorTypeFromHeader.equals("InvalidParameterValueException"); |
<|file_name|>phone_number_extractor.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import urllib.request
import re
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("url", help="the URL whose HTML you want to extract telephone numbers from", type=str)
args = parser.parse_args()
with urllib... | |
<|file_name|>testcase_create_input_incomplete_data.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from bitcodin import create_input
from bitcodin import Input
from bitcodin.exceptions import BitcodinBadRequestError
from bitcodin.test.bitcodin_test_case import BitcodinTestCase
class CreateInputIncompleteDataTestCase(Bitc... | __author__ = 'Dominic Miglar <dominic.miglar@bitmovin.net>'
import unittest |
<|file_name|>image.service.spec.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>import { TestBed, async, inject } from '@angular/core/testing';
import { ImageService } from './image.service';
describe('ImageService', () => {
beforeEach(() => {
TestBed.configureTestingModule({
providers: [ImageService]
});
... | /* tslint:disable:no-unused-variable */
|
<|file_name|>10_class.test.js<|end_file_name|><|fim▁begin|>test('has a constructor for initialization', () => {
// Create an Animal class
// Add a constructor that takes one param, the name.
// Set this.name to the name passed in
const animal = new Animal()
const dog = new Animal('Dog')
expect(animal.name... | |
<|file_name|>request.rs<|end_file_name|><|fim▁begin|>//! Client Requests
use std::marker::PhantomData;
use std::io::{self, Write, BufWriter};
use url::Url;
use method::{self, Method};
use header::Headers;
use header::{self, Host};
use net::{NetworkStream, NetworkConnector, HttpConnector, Fresh, Streaming};
use http::... | if chunked {
ChunkedWriter(self.body.into_inner()) |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import patterns, url
from rai00base.raccordement import getModeleRaccordement, createRaccordement, deleteRaccordement, listRaccordement
urlpatterns = patterns('',
url('getModeleRaccordement/$', getModeleRaccordement),
url('createRaccordeme... | ) |
<|file_name|>iacolorhist.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*-<|fim▁hole|> import numpy as np
from iahistogram import iahistogram
WFRAME=5
f = np.asarray(f)
if len(f.shape) == 1: f = f[np.newaxis,:]
if not f.dtype == 'uint8':
raise Exception,'error, can only process uin... | # Module iacolorhist
def iacolorhist(f, mask=None): |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from frontend import app
from flask import render_template
from flask import send_from_directory
from flask import request
from flask import redirect
from flask import url_for
from flask import flash
from flask import abort
import os
import models
import form... | |
<|file_name|>type_extras.py<|end_file_name|><|fim▁begin|>from collections.abc import Iterable
from django import template
from django.db.models import Model
register = template.Library()
@register.filter
def get_type(value):
# inspired by: https://stackoverflow.com/a/12028864
return type(value)
@register.... | def is_model(value): |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
## This file is part of Invenio.
## Copyright (C) 2011, 2012, 2013, 2014 CERN.
##
## Invenio 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 Softwar... | return md5(password).digest()
email = self.__clause_element__().table.columns.email
return db.func.aes_encrypt(email, password)
|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | __all__ = ["user_controller", "plant_controller"] |
<|file_name|>trait_no_fields.rs<|end_file_name|><|fim▁begin|>use juniper::graphql_union;
#[graphql_union]
trait Character {}<|fim▁hole|>fn main() {}<|fim▁end|> | |
<|file_name|>property_group_actions.cpp<|end_file_name|><|fim▁begin|>#include <GsTLAppli/actions/property_group_actions.h>
#include <GsTLAppli/actions/defines.h>
#include <GsTLAppli/utils/string_manipulation.h>
#include <GsTLAppli/utils/error_messages_handler.h>
#include <GsTLAppli/appli/manager_repository.h>
#inc... | grid->remove_group(params[1]);
|
<|file_name|>pelicanconf.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python<|fim▁hole|># -*- coding: utf-8 -*- #
from __future__ import unicode_literals
import os
AUTHOR = u'Eric Carmichael'
SITENAME = u"Eric Carmichael's Nerdery"
SITEURL = os.environ.get("PELICAN_SITE_URL", "")
TIMEZONE = 'Europe/Paris'
DEFAULT... | |
<|file_name|>hook-vispy.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | from PyInstaller.utils.hooks import collect_submodules, collect_data_files
datas = collect_data_files('vispy') |
<|file_name|>stream.rs<|end_file_name|><|fim▁begin|>// Copyright © 2017-2018 Mozilla Foundation
//
// This program is made available under an ISC-style license. See the
// accompanying file LICENSE for details.
use callbacks::cubeb_device_changed_callback;
use channel::cubeb_channel_layout;
use device::cubeb_device;
... | pub fn cubeb_stream_stop(stream: *mut cubeb_stream) -> c_int;
pub fn cubeb_stream_reset_default_device(stream: *mut cubeb_stream) -> c_int;
pub fn cubeb_stream_get_position(stream: *mut cubeb_stream, position: *mut u64) -> c_int; |
<|file_name|>types.py<|end_file_name|><|fim▁begin|>import typing
import twittback<|fim▁hole|>TweetSequence = typing.Sequence[twittback.Tweet]
UserSequence = typing.Sequence[twittback.User]<|fim▁end|> | |
<|file_name|>streaming.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""Functions for video streaming."""
import cStringIO
import fcntl
import os
import signal
import struct
import subprocess
import sys
import time
import types
import json
from PIL import Image
import v4l2
VIDEO_DEVICE = None
VIDEO_STREAM_P... | res = fcntl.ioctl(VIDEO_DEVICE, v4l2.VIDIOC_S_FMT, f)
if res != 0:
raise RuntimeError("Could not initialize video device: %d" % res) |
<|file_name|>ShopOrder.ts<|end_file_name|><|fim▁begin|>import {ShopOrderDetail} from './ShopOrderDetail';
export class ShopOrder {
order_id: string;
user_id: number;
username: string;
is_vip: number;
payment: number;
order_no: number;
shopway: number;
status: number;<|fim▁hole|> orderdealtime: Date;
... | employee_id: string;
buytime: Date; |
<|file_name|>send_via_pyxmpp.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3
# https://bugzilla.altlinux.org/show_bug.cgi?id=33532
#!/usr/bin/env -S python3 -u
# -*- coding: utf-8 -*-
#
# A simple message-sending script
# TODO: When error: No handlers could be found for logger "pyxmpp.Client"
import os, sys
# pyt... |
if len(sys.argv)!=4:
print("Usage:")
print("\t%s recipient_jid subject body" % (sys.argv[0],)) |
<|file_name|>IndexManagerTest.java<|end_file_name|><|fim▁begin|>/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to y... | assertEquals(true, initActual); |
<|file_name|>is-implemented.js<|end_file_name|><|fim▁begin|>'use strict';
var re = /\|/;
module.exports = function() {<|fim▁hole|> return re.split( 'bar|foo' )[1] === 'foo';
};<|fim▁end|> | if( typeof re.split !== 'function' ) return false; |
<|file_name|>MainPresenterImpl.java<|end_file_name|><|fim▁begin|>package com.ipvans.flickrgallery.ui.main;
import android.util.Log;
import com.ipvans.flickrgallery.data.SchedulerProvider;
import com.ipvans.flickrgallery.di.PerActivity;
import com.ipvans.flickrgallery.domain.FeedInteractor;<|fim▁hole|>
import java.uti... | import com.ipvans.flickrgallery.domain.UpdateEvent; |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>pub mod data;
pub mod value;<|fim▁hole|>pub mod builtins;
pub mod lambda;<|fim▁end|> | pub mod list;
pub mod lexer;
pub mod parser;
pub mod scope; |
<|file_name|>RecorderVideoActivity.java<|end_file_name|><|fim▁begin|>/************************************************************
* * EaseMob CONFIDENTIAL
* __________________
* Copyright (C) 2013-2014 EaseMob Technologies. All rights reserved.
*
* NOTICE: All information contained herein is, and remains
... | msc.connect(); |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""Utility modules used throughout the rest of the codebase.
<|fim▁hole|>Note that these modules should in general not depend (at compile time)
on any other modules, to avoid cyclic dependencies. They could be
imported (at the top level) into any other module so s... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | from checkpy.assertlib.basic import * |
<|file_name|>page-share.module.ts<|end_file_name|><|fim▁begin|>/*
* 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 required ... | |
<|file_name|>textarea.sandbox.ts<|end_file_name|><|fim▁begin|>import Vue, { PluginObject } from 'vue';
import { Component } from 'vue-property-decorator';
import { TEXTAREA_NAME } from '../component-names';<|fim▁hole|>
@WithRender
@Component
export class MTextareaSandbox extends Vue {
public test4Model: string = '... | import WithRender from './textarea.sandbox.html';
import TextareaPlugin from './textarea'; |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from setuptools import setup, find_packages
setup(
description='RESTful Nagios/Icinga Livestatus API',
author='Christoph Oelmueller',
url='https://github.com/zwopiR/lsapi',
download_url='https://github.com/zwopiR/lsapi',
autho... | ) |
<|file_name|>0013_auto__add_field_tttrip_shape.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# ... | |
<|file_name|>Pipelines.java<|end_file_name|><|fim▁begin|>/**
* Copyright (C) 2015 Agro-Know, Deutsches Forschungszentrum für Künstliche Intelligenz, iMinds,
* Institut für Angewandte Informatik e. V. an der Universität Leipzig,
* Istituto Superiore Mario Boella, Tilde, Vistatec, WRIPL (http://freme-project.eu)
*
*... | } catch (org.springframework.security.access.AccessDeniedException | InsufficientAuthenticationException ex) {
logger.error(ex.getMessage(), ex);
throw new ForbiddenException(ex.getMessage()); |
<|file_name|>searchbar-compiled.js<|end_file_name|><|fim▁begin|>'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descr... | |
<|file_name|>view.py<|end_file_name|><|fim▁begin|># Copyright (C) 2013, Walter Bender - Raul Gutierrez Segales
#
# 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, ... | for service in services:
service_grid = Gtk.Grid()
icon = CanvasIcon(icon_name=service.get_icon_name()) |
<|file_name|>prediction-gen.go<|end_file_name|><|fim▁begin|>// Package prediction provides access to the Prediction API.
//
// See https://developers.google.com/prediction/docs/developer-guide
//
// Usage example:
//
// import "google.golang.org/api/prediction/v1.4"
// ...
// predictionService, err := prediction.... | |
<|file_name|>qmlengine.rs<|end_file_name|><|fim▁begin|>use qvariant::*;
use types::*;
use qurl::*;
extern "C" {
fn dos_qguiapplication_create();
fn dos_qguiapplication_exec();
fn dos_qguiapplication_quit();
fn dos_qguiapplication_delete();
fn dos_qqmlapplicationengine_create() -> DosQmlApplication... | /// Loads a file as a qml file
pub fn load_file(&mut self, path: &str) {
let path_raw = ::std::env::current_dir().unwrap().join(path);
let path = if cfg!(windows) { |
<|file_name|>Gruntfile.js<|end_file_name|><|fim▁begin|>module.exports = function(grunt) {
var commonTasks = ['jscs', 'jshint', 'concat', 'uglify'];
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jscs: {
src: ['Gruntfile.js', 'src/*.js', 'test/utils-test.js', 'test/basicTimerSpec', 'test/timedFun... | uglify: {
dist: {
src: 'dist/timer.jquery.js',
dest: 'dist/timer.jquery.min.js' |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>export { default as Toolbar } from './Toolbar';<|fim▁hole|><|fim▁end|> | export { default as ToolbarSection } from './ToolbarSection';
export { default as ToolbarTitle } from './ToolbarTitle';
export { default as ToolbarRow } from './ToolbarRow';
export { default as ToolbarIcon } from './ToolbarIcon'; |
<|file_name|>vue-meta.js<|end_file_name|><|fim▁begin|>/**
* vue-meta v2.2.0
* (c) 2019
* - Declan de Wet
* - Sébastien Chopin (@Atinux)
* - All the amazing contributors
* @license MIT
*/
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
... | |
<|file_name|>euler 02.py<|end_file_name|><|fim▁begin|>def fib():
a, b = 1, 1
while True:
yield b
<|fim▁hole|> for n in seq:
if n % 2 == 0:
yield n
def menores_4M(seq):
for n in seq:
if n > 4000000:
break
yield n
print (sum(pares(menores_4M(fib()))))<|fim▁end|> | a, b = b, a + b
def pares(seq):
|
<|file_name|>e362.py<|end_file_name|><|fim▁begin|>from __future__ import print_function, division
import matplotlib
import logging
from sys import stdout
matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab!
from neuralnilm import (Net, RealApplianceSource,
BLSTMLayer, Di... | # 7000: 1e-06
# 2000: 5e-06
# 3000: 1e-05 |
<|file_name|>dev.command.ts<|end_file_name|><|fim▁begin|>import * as yargs from "yargs";
import { getEnvironment, getSlimConfig } from "../cli-helpers";
export const devCommand: yargs.CommandModule = {
command: "dev",
describe: "Start a development server.",
builder: {
open: {
alias: "o... | |
<|file_name|>TpchIndex.java<|end_file_name|><|fim▁begin|>/*
* 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 required by appl... | import static com.google.common.base.Preconditions.checkNotNull;
|
<|file_name|>migrate.py<|end_file_name|><|fim▁begin|>from optparse import OptionParser
import simplejson as json
import spotify_client
import datatype
import datetime
import time
import calendar
import wiki
import omni_redis
def migrate_v1(path_in, path_out):
client = spotify_client.Client()
uris = []<|fim▁hol... | with open(path_in, 'rb') as f:
for line in f: |
<|file_name|>dialogs_lt.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS version="2.1" language="lt">
<context>
<name>ReminderDialog</name>
<message>
<location filename="../src/reboot-reminder-dialog/reminderdialog.cpp" line="35"/>
<source>Restart the computer to use the sy... | <translation>Išjungti</translation>
</message> |
<|file_name|>test_ldap.py<|end_file_name|><|fim▁begin|># 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 required by applicable law ... | # under the License.
from oslo_config import fixture as config_fixture |
<|file_name|>Sam and sub-strings.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Problem Statement
Samantha and Sam are playing a game. They have 'N' balls in front of them, each ball numbered from 0 to 9, except the
first ball which is numbered from 1 to 9. Samantha calculates all the sub-strings of the n... |
# solve |
<|file_name|>colors.js<|end_file_name|><|fim▁begin|>({
// local representation of all CSS3 named colors, companion to dojo.colors. To be used where descriptive information
// is required for each color, such as a palette widget, and not for specifying color programatically.
//Note: due to the SVG 1.0 spec additions, ... | darkorange: "برتقالي داكن",
darkorchid: "أرجواني داكن",
darkred: "أحمر داكن",
darksalmon: "فضي داكن", |
<|file_name|>psqt.rs<|end_file_name|><|fim▁begin|>use {Player,SQ,File,Piece};
use core::masks::*;
use core::score::*;
const BONUS: [[[Score; (FILE_CNT / 2)]; RANK_CNT]; PIECE_TYPE_CNT] = [
[ // NO PIECE
[ Score(0, 0), Score(0, 0), Score(0, 0), Score(0, 0)],
[ Score(0, 0), Score(0, 0), Score(0, 0... | (*(PIECE_VALUE.get_unchecked(piece as usize)).get_unchecked(eg as usize)) |
<|file_name|>callback.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python2.7
from django.http import HttpResponse
from AfricasTalkingGateway import AfricasTalkingGateway, AfricasTalkingGatewayException
from reminder.models import Reminder
import sys
import os
import django
sys.path.append("/home/foxtrot/Dropbox/tunza_v2... |
resp = HttpResponse(respond, 200, content_type='application/xml') |
<|file_name|>metrics.go<|end_file_name|><|fim▁begin|>// Copyright 2019, OpenCensus Authors
//<|fim▁hole|>// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distribut... | // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. |
<|file_name|>DeleteTail.java<|end_file_name|><|fim▁begin|>package chapter1_3;
public class DeleteTail<Item> {
private Node<Item> first;
private int N;
public int getN(){
return N;
}
private static class Node<Item>{
private Item item;
private Node<Item> next;
}
public static void main(String[] args) {
... | |
<|file_name|>ole32.go<|end_file_name|><|fim▁begin|>// Copyright 2010-2012 The W32 Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build windows
package w32
import (
"syscall"
"unsafe"
)<|fim▁hole|> procCoInitializeEx =... |
var (
modole32 = syscall.NewLazyDLL("ole32.dll")
|
<|file_name|>neptune.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>
extern crate rusoto_core;
extern crate rusoto_neptune;
use rusoto_core::Region;
use rusoto_neptune::{DescribeDBClustersMessage, Neptune, NeptuneClient};
#[tokio::test]
async fn should_describe_db_clusters() {
let client = NeptuneClient::new(Region:... | #![cfg(feature = "neptune")] |
<|file_name|>scraper.py<|end_file_name|><|fim▁begin|>"""
This module contains a single class that manages the scraping of data
from one or more supermarkets on mysupermarket.co.uk
"""
from datetime import datetime
from os import remove
from os.path import isfile, getmtime
from time import time
from scrapy import signa... | |
<|file_name|>ec2_ami_find.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible 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... | no_result_action = module.params.get('no_result_action')
filter = {'state': state} |
<|file_name|>smart-answers.js<|end_file_name|><|fim▁begin|>function browserSupportsHtml5HistoryApi() {
return !! (history && history.replaceState && history.pushState);
}
$(document).ready(function() {
//_gaq.push(['_trackEvent', 'Citizen-Format-Smartanswer', 'Load']);
if(browserSupportsHtml5HistoryApi()) {
... | |
<|file_name|>companies.js<|end_file_name|><|fim▁begin|>$(function(){
$("#addCompanyForm").validate({
rules: {
name : {
required : true
},
email: {
required: true,
email: true
},
url : {
required : true,
url : true
}
},
messages: {
name : {
required : "Please ente... | getCompanies(); |
<|file_name|>BootTableRenderer.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
* Copyright (C) 2016 Kwaku Twumasi-Afriyie <kwaku.twumasi@quakearts.com>.
* All rights reserved. This program and the accompanying materials
* are made available under t... | writer.endElement("tbody");
return;
}
|
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# SRL 5 documentation build configuration file, created by
# sphinx-quickstart on Sat Oct 16 15:51:55 2010.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values a... | |
<|file_name|>test_permissions.py<|end_file_name|><|fim▁begin|>"""
This test will use the default permissions found in
flaskbb.utils.populate
"""
from flaskbb.utils.permissions import *
<|fim▁hole|> """
assert moderator_user in forum.moderators
assert can_post_reply(moderator_user, forum)
asser... | def test_moderator_permissions_in_forum(
forum, moderator_user, topic, topic_moderator):
"""Test the moderator permissions in a forum where the user is a
moderator. |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>pub mod multi;
pub mod threshold;
use std::cmp::min;
use crate::{Levenshtein, Metric};
impl Default for Levenshtein {
fn default() -> Self {
Levenshtein {}
}
}
impl<T: Eq, R: AsRef<[T]>> Metric<T, R> for Levenshtein {
fn distance(a: R, b: R) -> us... | }
};
buffer.push(value); |
<|file_name|>default_name_resolver.py<|end_file_name|><|fim▁begin|>import scrapy
from scrapy.crawler import CrawlerProcess
class IPv6Spider(scrapy.Spider):
name = "ipv6_spider"<|fim▁hole|>
process = CrawlerProcess(settings={"RETRY_ENABLED": False})
process.crawl(IPv6Spider)
process.start()<|fim▁end|> | start_urls = ["http://[::1]"]
|
<|file_name|>bba880ef5bbd_add_is_loud_and_pronouns_columns_to_.py<|end_file_name|><|fim▁begin|>"""Add is_loud and pronouns columns to PanelApplicant
Revision ID: bba880ef5bbd
Revises: 8f8419ebcf27
Create Date: 2019-07-20 02:57:17.794469
"""
# revision identifiers, used by Alembic.
revision = 'bba880ef5bbd'
down_rev... | op.add_column('panel_applicant', sa.Column('pronouns', sa.Unicode(), server_default='', nullable=False))
op.add_column('panel_application', sa.Column('is_loud', sa.Boolean(), server_default='False', nullable=False))
|
<|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::CCR1 {
#[doc = r" Modifies the contents of the register"]
#[inline(always)]
pub fn modify<F>(&sel... | |
<|file_name|>utilities.py<|end_file_name|><|fim▁begin|>'''Simple utility functions that should really be in a C module'''
from math import *
from OpenGLContext.arrays import *
from OpenGLContext import vectorutilities
def rotMatrix( (x,y,z,a) ):
"""Given rotation as x,y,z,a (a in radians), return rotation matrix
... | vec1 = reshape(b-a,(1,3))
rest = points[2:] - b
vecs = vectorutilities.crossProduct( |
<|file_name|>entity_test.py<|end_file_name|><|fim▁begin|>import unittest
import itertools
class TestWorld(object):
def __init__(self, **kw):<|fim▁hole|> self.__dict__.update(kw)
self.components = self
self.entities = set()
self.new_entity_id = itertools.count().__next__
self.new_entity_id() # skip id 0
... | |
<|file_name|>check_query_file.py<|end_file_name|><|fim▁begin|>from django.core.management.base import BaseCommand, CommandError
from django.core import management
from django.db.models import Count
from scoping.models import *
<|fim▁hole|> help = 'check a query file - how many records'
def add_arguments(self, ... | class Command(BaseCommand): |
<|file_name|>generic.go<|end_file_name|><|fim▁begin|>/*
Copyright 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 requ... | switch resource { |
<|file_name|>tty.d.ts<|end_file_name|><|fim▁begin|>declare module "tty" {
import * as net from "net";
function isatty(fd: number): boolean;
class ReadStream extends net.Socket {
isRaw: boolean;
setRawMode(mode: boolean): void;
isTTY: boolean;
}
/**
* -1 - to the left fr... | */ |
<|file_name|>pipes.py<|end_file_name|><|fim▁begin|>from cgi import escape
import gzip as gzip_module
import re
import time
import types
import uuid
from cStringIO import StringIO
def resolve_content(response):
rv = "".join(item for item in response.iter_content())
if type(rv) == unicode:
rv = rv.encod... | def get_char(self):
if self._index >= len(self.string): |
<|file_name|>iban.js<|end_file_name|><|fim▁begin|>QUnit.test( "testGetIbanCheckDigits", function( assert ) {
assert.equal(getIBANCheckDigits( 'GB00WEST12345698765432' ), '82', 'Get check digits of an IBAN' );
assert.equal(getIBANCheckDigits( '1234567890' ), '', 'If string isn\'t an IBAN, returns empty' );
... | assert.equal(isSepaCountry( 'US' ), 0, 'Rejects non SEPA countries' );
assert.equal(isSepaCountry( '' ) , 0, 'If string is empty, returns empty' );
} ); |
<|file_name|>path.go<|end_file_name|><|fim▁begin|>// Copyright (c) 2014 Datacratic. All rights reserved.
package path
import (
"bytes"
"fmt"
"strings"<|fim▁hole|>// slice indexes should be specified using non-negative numbers. Only map keyed
// with string are currently supported. Channels can be read by providing... | )
// P represents a path through an object seperated by '.' characters. A path can
// also contain wildcard components indicated by a '*' character. Arrays and |
<|file_name|>CronetUrlRequestContext.java<|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.
package org.chromium.net.impl;
import android.content.Context;
import android.os.B... | private native void nativeStartNetLogToFile(long nativePtr, String fileName, boolean logAll);
@NativeClassQualifiedName("CronetURLRequestContextAdapter")
private native void nativeStopNetLog(long nativePtr); |
<|file_name|>iothub.d.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>
export import Client = require('./lib/client');
export import ConnectionString = require('./lib/connection_string');
export import Registry = require('./lib/registry');
export import SharedAccessSignature = require('./lib/shared_access_signature');
expo... | // Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information. |
<|file_name|>authentication.rs<|end_file_name|><|fim▁begin|>// Authentication
use hyper::client::{Client};
use hyper::server::{Server, Request, Response, Listening};
use hyper::uri::RequestUri::AbsolutePath;
use regex::Regex;
use rustc_serialize::json::Json;
use std::fs;
use std::io::prelude::*;
use std::process::Comma... | let mut res = res.start().unwrap(); |
<|file_name|>coroutine.py<|end_file_name|><|fim▁begin|>import asyncio
from unittest.mock import MagicMock
def SimpleCoroutineMock(f=lambda *args, **kwargs: None):
builder = CoroutineMockBuilder()
return builder.addDelegate(f).build().mock()
class CoroutineMock(object):
# Handy for debugging failing test... | def blocksOn(self, event:asyncio.Event):
self.__block = event |
<|file_name|>raw.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licens... | f(&mut *self.inner.get())
}
|
<|file_name|>leads_dry_run.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from openerp import fields, models, api
class crm_leads_dry_run(models.TransientModel):
_name = "crm.leads.dry.run"
lead_id = fields.Many2one('crm.lead', string='Lead', required=True)
team_id = fields.Many2one('crm.team', ... | |
<|file_name|>asm.py<|end_file_name|><|fim▁begin|># coding=utf8
"""
asm.py - (dis)assembly features.
(c) 2014 Samuel Groß
"""
from willie import web
from willie.module import commands, nickname_commands, example
from random import choice
from binascii import hexlify, unhexlify
import string
import re
import os
from su... | arg = re.sub(r"[^a-fA-F0-9]", r"", arg)
code = unhexlify(arg) |
<|file_name|>rpc_test.go<|end_file_name|><|fim▁begin|>// Copyright 2013 <chaishushan{AT}gmail.com>. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package codec
import (
"errors"
"net"
"net/rpc"
"testing"
// can not import xxx.pb with... | return nil
}
|
<|file_name|>filer.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2016, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import ab... | upload = upload_form.save(commit=False)
upload.is_public = True
if isinstance(path, Folder):
upload.folder = path |
<|file_name|>idleoutd.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
""" Marcos Moyano - marcos@anue.biz
Logout users of a specified period of idle time.
Copyright (c) 2006 Marcos Moyano
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public Lic... | # Compute info #
################## |
<|file_name|>Overfit_underfit.py<|end_file_name|><|fim▁begin|>import numpy as np
import matplotlib.pyplot as plt
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import PolynomialFeatures
from sklearn.linear_model import LinearRegression
from sklearn.model_selection import cross_val_score
np.random.see... | |
<|file_name|>xml.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: ISO-8859-15 -*-
import rlib
myreport = rlib.Rlib()
print rlib.version<|fim▁hole|>myreport.add_report("array.xml")
myreport.set_output_format_from_text("pdf")
myreport.execute()
print myreport.get_content_type_as_text()
open('xml.pdf','wb... | myreport.add_datasource_xml("local_xml")
myreport.add_query_as("local_xml", "data.xml", "data") |
<|file_name|>process.py<|end_file_name|><|fim▁begin|>import os
sys = os.system
CC = 'g++ {} -std=gnu++0x -Wall'
FLAG_clear = ['/c', '-c']
FLAG_window = ['/w', '-w']
FLAG_exit = ['/e', '-e']
def main():
print('List of existing <*.cpp> files:')<|fim▁hole|> counter = 0
for file in os.listdir():
if file[-4:] == '.cp... | files = [] |
<|file_name|>overflowing_sub.rs<|end_file_name|><|fim▁begin|>#![feature(core, wrapping)]
extern crate core;
#[cfg(test)]
mod tests {
use core::num::wrapping::OverflowingOps;
// mod shift_max {
// #![allow(non_upper_case_globals)]
//
// pub const i8: u32 = (1 << 3) - 1;
// pub cons... | // pub const u32: u32 = i32; |
<|file_name|>buildbot_spec.py<|end_file_name|><|fim▁begin|><|fim▁hole|># Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
#!/usr/bin/env python
usage = '''
Write buildbot spec to outfile based on the bot name:
$ python buildbot_spec.py outfile Test-Ubuntu-GCC-GCE... | #
# Copyright 2015 Google Inc.
# |
<|file_name|>subst.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/... | impl ParamSpace { |
<|file_name|>password-reset-init.component.spec.ts<|end_file_name|><|fim▁begin|>import { ComponentFixture, TestBed, inject } from '@angular/core/testing';
import { Renderer, ElementRef } from '@angular/core';
import { Observable } from 'rxjs/Rx';
import { JhipsterappTestModule } from '../../../../test.module';
import {... | |
<|file_name|>test_codec.py<|end_file_name|><|fim▁begin|>import unittest
from elasticmagic.types import Integer, Float, Boolean
from elasticmagic.ext.queryfilter.codec import SimpleCodec
class SimpleCodecTest(unittest.TestCase):
def test_decode(self):
codec = SimpleCodec()
self.assertEqual(
... | codec.decode({'manu': ['1:nokia:true', '2:samsung:false']}, {'manu': [Integer, None, Boolean]}), |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# This file is part of the osmxapi Python module.
#
# osmxapi 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 ... | uri = self.base+"?*"+repr(query) |
<|file_name|>PromptsActivity.java<|end_file_name|><|fim▁begin|>package biz.golek.whattodofordinner.view.activities;
import android.support.annotation.NonNull;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.ContextMenu;
import andr... | |
<|file_name|>DriveToPointExample.java<|end_file_name|><|fim▁begin|>import pl.edu.agh.amber.common.AmberClient;
import pl.edu.agh.amber.drivetopoint.DriveToPointProxy;
import pl.edu.agh.amber.drivetopoint.Location;
import pl.edu.agh.amber.drivetopoint.Point;
import pl.edu.agh.amber.drivetopoint.Result;
import java.io.I... | |
<|file_name|>transport.py<|end_file_name|><|fim▁begin|># Copyright 2019, OpenCensus 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
... | |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>use super::core::{
af_array, af_window, AfError, Array, ColorMap, HasAfEnum, MarkerType, HANDLE_ERROR,
};
use libc::{c_char, c_double, c_float, c_int, c_uint};
use std::ffi::CString;
use std::ptr;
/// Represents a sub-view of Window
///
/// This struct is used in c... | |
<|file_name|>interproscanner.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
class OutputParser(object):
def __init__(self, fmt, file_to_parse):
self.fmt = fmt.upper()
self.file_to_parse = file_to_parse
def parse(self):
""" Wrapper function in case I want to be able to parse ot... | for fas_file in fas_files: |
<|file_name|>CompositeAction.java<|end_file_name|><|fim▁begin|>package com.integpg.synapse.actions;
import com.integpg.logger.FileLogger;
import java.io.IOException;
import java.util.Json;
public class CompositeAction extends Action {
private String[] _actions;
public CompositeAction(Json json) {
... |
} |
<|file_name|>FlowLayout.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""PyQt4 port of the layouts/flowlayout example from Qt v4.x"""
from PyQt4 import QtCore, QtGui
# ------------------------------------------------------------------------
class FlowLayout(QtGui.QLayout):
"""
Standard PyQt examples FlowL... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.