prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>restor.py<|end_file_name|><|fim▁begin|># Copyright (c) 2014 by Ecreall under licence AGPL terms
# available on http://www.gnu.org/licenses/agpl.html
# licence: AGPL
# author: Amen Souissi
import deform
from pyramid.view import view_config
from dace.processinstance.core import DEFAULTMAPPING_ACTIONS_VIE... | DEFAULTMAPPING_ACTIONS_VIEWS.update(
{Restor: RestorView}) |
<|file_name|>password_test.go<|end_file_name|><|fim▁begin|>package password_test
import (
"net/http"
"net/http/httptest"
"time"
"github.com/cloudfoundry/cli/cf/api/apifakes"
"github.com/cloudfoundry/cli/cf/net"
"github.com/cloudfoundry/cli/cf/terminal/terminalfakes"
testconfig "github.com/cloudfoundry/cli/test... | |
<|file_name|>basic-types.unit.test.js<|end_file_name|><|fim▁begin|>const clone = require('lodash/clone');
const testHelpers = require('@quoin/node-test-helpers');
const BasicTypes = require('./basic-types');
const expect = testHelpers.expect;
describe("lib/core/basic-types", () => {
it("should export an object",... | 'Password',
'Number',
'String', |
<|file_name|>schemamigration.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
INSTALLED_APPS = [
'django.contrib.contenttypes',
'django.contrib.auth',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
'mptt',
'cms',
'menus... | |
<|file_name|>20140912211135_1efacad0fff5_index_for_object_folders.py<|end_file_name|><|fim▁begin|># Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
<|fim▁hole|>
"""Index for object_folders
Revision ID: 1efacad0fff5
Revises: 4d7ce1eaddf2
Create Date: 2014-09... | |
<|file_name|>test_sender.py<|end_file_name|><|fim▁begin|>import socket
import sys
import time
server_add = './bob_system_socket'
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
message = sys.argv[1]+" "+sys.argv[2]
if sys.argv[1] == 'set':
message+= " "+sys.argv[3]
else:
message+= " null"
try:
sock.connec... | sys.exit(1) |
<|file_name|>functions.ts<|end_file_name|><|fim▁begin|>import { TupleType } from './tuples.ts'
import { Kind } from './types/kinds.ts'
import { Type } from './types/types.ts'
import { pairHash } from './utils/hash.ts'
import { Value } from './values.ts'
export interface FunctionType extends Type {
input: TupleType
... | type(input: TupleType, output: Type): FunctionType {
return { kind: Kind.Function, input, output, hash: pairHash(input, output, 0xf4527105) } |
<|file_name|>publishconf.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals<|fim▁hole|># explicitly specify it as your config file.
import os
import sys
sys.path.append(os.curdir)
from pelicanconf import *
SITEURL = 'http://mpdev.mattew.se'
RELATIVE... |
# This file is only used if you use `make publish` or |
<|file_name|>coherence_copy_like_err_tuple.rs<|end_file_name|><|fim▁begin|>// Test that we are able to introduce a negative constraint that
// `MyType: !MyTrait` along with other "fundamental" wrappers.
// aux-build:coherence_copy_like_lib.rs
extern crate coherence_copy_like_lib as lib;
struct MyType { x: i32 }
tra... | |
<|file_name|>mqttplugin.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# vim: set encoding=utf-8 tabstop=4 softtabstop=4 shiftwidth=4 expandtab
#########################################################################
# Copyright 2019- Martin Sinn m.sinn@gmx.de
######################... | def mqtt_init(self):
"""
Dummy method - should not be called any more |
<|file_name|>conversion.go<|end_file_name|><|fim▁begin|>/*
Copyright 2014 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
Unl... | |
<|file_name|>constants.py<|end_file_name|><|fim▁begin|># -*- coding: UTF-8 -*-
'''
virtualbox_const_support.py
Constants for VirtualBox.
'''
__author__ = "Karol Będkowski <karol.bedkowski@gmail.com>"
__version__ = '0.3'
# virtual machine states
VM_STATE_POWEROFF = 0
VM_STATE_POWERON = 1
VM_STATE_PAUSED = 2<|fim▁hole|... | |
<|file_name|>test_ssd1306.py<|end_file_name|><|fim▁begin|>import sys
sys.path.append("../../")
from unittest.mock import patch, MagicMock
MockRPi = MagicMock()
MockSpidev = MagicMock()
modules = {
"RPi": MockRPi,
"RPi.GPIO": MockRPi.GPIO,
"spidev": MockSpidev
}
<|fim▁hole|>
from gfxlcd.driver.ssd1306.spi i... | patcher = patch.dict("sys.modules", modules)
patcher.start() |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from osweb.projects.ManageProject import ManageProject
from osweb.projects.projects_data import ProjectsData<|fim▁end|> | |
<|file_name|>lexical-scope-in-if.rs<|end_file_name|><|fim▁begin|>// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache... | |
<|file_name|>macros.rs<|end_file_name|><|fim▁begin|><|fim▁hole|> () => (3);
}
/*macro_rules! BOARD_MAX
{
() => { BOARD_SIZE!()-1 };
}*/<|fim▁end|> | #[macro_export]
macro_rules! BOARD_SIZE
{ |
<|file_name|>jquery.tablesorter.widgets.js<|end_file_name|><|fim▁begin|>/*! tableSorter (FORK) 2.16+ widgets - updated 12/22/2014 (v2.18.4)
*
* Column Styles
* Column Filters
* Column Resizing
* Sticky Header
* UI Theme (generalized)
* Save Sort
* [ "columns", "filter", "resizable", "stickyHeaders", "uitheme", ... | return filter === '' ? true : !(c.widgetOptions.filter_startsWith ? indx === 0 : indx >= 0); |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from app import app
from flask import render_template
@app.route('/')
def index():
return render_template('index.html')
@app.route('/story/')
def story():
return render_template('story.html')
@app.route('/bio/')
def bio():<|fim▁hole|> return render_template('conta... | return render_template('bio.html')
@app.route('/contact/')
def contact(): |
<|file_name|>stream_frame_identifier.py<|end_file_name|><|fim▁begin|>import av
import logging
import random
import sys
import time
import warnings
from livestreamer import Livestreamer
from experiments.test_detecting_in_lol_or_not import get_classifier, process_image
from ocr import ocr_image
logging.getLogger("lib... | |
<|file_name|>qdelegatingnamespaceresolver.cpp<|end_file_name|><|fim▁begin|>/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtXmlPatterns module of the ... |
QXmlName::NamespaceCode DelegatingNamespaceResolver::lookupNamespaceURI(const QXmlName::PrefixCode prefix) const |
<|file_name|>_connectors.py<|end_file_name|><|fim▁begin|>"""Connectors"""
__copyright__ = "Copyright (C) 2014 Ivan D Vasin"
__docformat__ = "restructuredtext"
import abc as _abc
import re as _re
from ... import plain as _plain
from .. import _std as _std_http
_BASIC_USER_TOKENS = ('user', 'password')
class HttpB... |
def _outputs(self, upstream_affordances, downstream_affordances): |
<|file_name|>composer.py<|end_file_name|><|fim▁begin|>from yaml.composer import Composer
from yaml.nodes import MappingNode
class AnsibleComposer(Composer):
def __init__(self):
self.__mapping_starts = []
super(Composer, self).__init__()
def compose_node(self, parent, index):
# the line ... | node.__line__ = cur_line
node.__column__ = cur_column |
<|file_name|>app.js<|end_file_name|><|fim▁begin|>var express = require('express'),
compression = require('compression'),
path = require('path'),
favicon = require('serve-favicon'),
logger = require('morgan'),
cookieParser = require('cookie-parser'),
bodyParser = require('body-parser'),
sessi... | organization = require('./routes/organization'), |
<|file_name|>flyaround_cube_animate.py<|end_file_name|><|fim▁begin|>import os
import numpy as np
import matplotlib.pyplot as plt
from hyperion.model import ModelOutput
from hyperion.util.constants import pc
# Create output directory if it does not already exist
if not os.path.exists('frames'):
os.mkdir('frames')... |
# Close figure
plt.close(fig) |
<|file_name|>unary.rs<|end_file_name|><|fim▁begin|>//! Module implementing evaluation of unary operator AST nodes.
use eval::{self, api, Eval, Context, Value};
use parse::ast::UnaryOpNode;
impl Eval for UnaryOpNode {
fn eval(&self, context: &mut Context) -> eval::Result {
let arg = try!(self.arg.eval(con... | }
impl UnaryOpNode {
/// Evaluate the "+" operator for one value. |
<|file_name|>isDate.js<|end_file_name|><|fim▁begin|>"use strict";
exports.__esModule = true;<|fim▁hole|>
function isDate(value) {
return value instanceof Date && !isNaN(+value);
}
//# sourceMappingURL=isDate.js.map
module.exports = exports["default"];
//# sourceMappingURL=isDate.js.map<|fim▁end|> | exports["default"] = isDate; |
<|file_name|>DataUtilsTest.java<|end_file_name|><|fim▁begin|>package ca.six.tomato.util;
import org.json.JSONArray;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;
import org.robolectric.shadows.ShadowEnvironment;
import j... | /**
* Created by songzhw on 2016-10-03
*/ |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// U... | |
<|file_name|>HighPassFilter.py<|end_file_name|><|fim▁begin|>'''Created by rj as part of the Pytnam Project'''
from analysis.Reportable import Reportable
<|fim▁hole|> pass
# TODO<|fim▁end|> | class HighPassFilter(Reportable):
def return_as_node(self): |
<|file_name|>FinancialInstrument11.go<|end_file_name|><|fim▁begin|>package iso20022
// Security that is a sub-set of an investment fund, and is governed by the same investment fund policy, eg, dividend option or valuation currency.
type FinancialInstrument11 struct {
// Unique and unambiguous identifier of a securit... | TransferType *TransferType1Code `xml:"TrfTp"`
}
|
<|file_name|>haiku.ts<|end_file_name|><|fim▁begin|>export const font = [
[0x00,0x00,0x00,0x00,0x00,0x00], //
[0x00,0x5e,0x00,0x00,0x00,0x00], // !
[0x00,0x0e,0x0e,0x00,0x00,0x00], // "
[0x00,0x7f,0x40,0x40,0x7f,0x00], // #
[0x00,0x7e,0x52,0xd2,0x52,0x76], // $
[0x00,0x7f,0x40,0x40,0x7f,0x00], // %
[0x00... | [0x00,0x82,0xfe,0x00,0x00,0x00], // )
[0x00,0x14,0x0e,0x14,0x00,0x00], // *
[0x10,0x10,0x38,0x10,0x10,0x00], // +
[0x00,0xc0,0x00,0x00,0x00,0x00], // ,
|
<|file_name|>HomeJourney.js<|end_file_name|><|fim▁begin|>/*global QUnit*/
sap.ui.define([
"sap/ui/test/opaQunit",
"./pages/Home",
"./pages/Overview"
], function (opaTest) {
"use strict";
QUnit.module("Home");
opaTest("Should see the homepage displayed", function (Given, When, Then) {
// Arrangements
Given.... | opaTest("Should be on the Home page when back button is pressed", function (Given, When, Then) {
//Actions
When.onTheOverviewPage.iPressTheNavigationBackButton();
|
<|file_name|>measure_dialog.py<|end_file_name|><|fim▁begin|>import datetime as dt
import threading
from serial_device.or_event import OrEvent
import numpy as np
import pandas as pd
import gobject
import gtk
import matplotlib as mpl
from streaming_plot import StreamingPlot
from ...max11210_adc_ui import MAX11210_read
... | |
<|file_name|>delegates.rs<|end_file_name|><|fim▁begin|>use std::sync::Arc;
use std::collections::HashMap;
use jsonrpc_core::{Params, Value, Error};
use jsonrpc_core::{BoxFuture, Metadata, RemoteProcedure, RpcMethod, RpcNotification};
use jsonrpc_core::futures::IntoFuture;
use jsonrpc_pubsub::{self, SubscriptionId, Su... | Unsub: Send + Sync + 'static, |
<|file_name|>serial.cpp<|end_file_name|><|fim▁begin|>/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can re... | dest->_pos = pos;
} else {
error("Seeking a WriteStream isn't allowed");
} |
<|file_name|>16878_H2.rs<|end_file_name|><|fim▁begin|>Per(s)PSA @ damp 02% PSA @ damp 05% PSA @ damp 07% PSA @ damp 10% PSA @ damp 20% PSA @ damp 30% (m/s/s)
0.000 3.8242000E-002 3.8242000E-002 3.8242000E-002 3.8242000E-002 3.8242000E-002 3.8242000E-002
0.010 3.8247300E-002 3.8247550E-002 3.8247650E-002 3.8247790E-00... | 4.800 1.5809870E-002 9.9182000E-003 8.8440400E-003 7.3632600E-003 6.1308200E-003 5.1893300E-003
|
<|file_name|>weather.py<|end_file_name|><|fim▁begin|>"""Support for HomematicIP Cloud weather devices."""
import logging
from homematicip.aio.device import (
AsyncWeatherSensor, AsyncWeatherSensorPlus, AsyncWeatherSensorPro)
from homematicip.aio.home import AsyncHome
from homeassistant.components.weather import W... | if hasattr(self._device, "raining") and self._device.raining: |
<|file_name|>translate.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Translator module that uses the Google Translate API.
Adapted from Terry Yin's google-translate-python.
Language detection added by Steven Loria.
"""
from __future__ import absolute_import
import json
import re
import codecs
from textbl... | json_data = json.loads(content)
if 'src' in json_data: |
<|file_name|>fast_consensus.py<|end_file_name|><|fim▁begin|>"""
@author waziz
"""
import logging
import sys
import traceback
import os
import argparse
import numpy as np
from functools import partial
from multiprocessing import Pool
from chisel.decoder import MBR, MAP, consensus
from chisel.util.iotools import read_sam... | return cmp(lhs[0], rhs[0])
def create_decision_rule_dir(workspace, decision_rule, metric_name=None): |
<|file_name|>IMoveModel.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2012-2013 Open Source Community - <http://www.peerfact.org>
* Copyright (c) 2011-2012 University of Paderborn - UPB
* Copyright (c) 2005-2011 KOM - Multimedia Communications Lab
*
* This file is part of PeerfactSim.KOM.
*
* PeerfactSim... |
public Point getNextPosition(IDOApplication app); |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>// this is just a demo. To run it execute from the root of repository:
//
// > npm start
//
// Then open ./example/index.html
//
module.exports.main = function () {
var graph = require('ngraph.generators').balancedBinTree(6);
var createPixiGraphics = require('../')... | } |
<|file_name|>resource_task.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 task that takes a URL and streams back the binary... |
impl ResourceManager {
fn set_cookies_for_url(&mut self, request: Url, cookie_list: String, source: CookieSource) {
let header = Header::parse_header(&[cookie_list.into_bytes()]); |
<|file_name|>SettableDisposable.ts<|end_file_name|><|fim▁begin|>/** @license MIT License (c) copyright 2010-2017 original author or authors */
import { Disposable } from '@most/types'
export default class SettableDisposable implements Disposable {
private disposable?: Disposable;
private disposed: boolean;
cons... | }
}
} |
<|file_name|>monitor.cpp<|end_file_name|><|fim▁begin|>#include <QDebug>
#include <net/if.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include "monitor.h"<|fim▁hole|>Monitor::Monitor()
{
running = 0;
}
void Monitor::start()
{
int rc;
int s;
fd_set rdfs;
int nbytes;
struct sockaddr_c... | |
<|file_name|>user.server.model.js<|end_file_name|><|fim▁begin|><|fim▁hole|> bcrypt = require('bcrypt'),
userSchema = mongoose.Schema({
fullName: { type: String },
email: { type: String, required: true, unique: true, lowercase: true },
password: { type: String, req... | var mongoose = require('mongoose'), |
<|file_name|>translate.ts<|end_file_name|><|fim▁begin|>import { getVendorPrefixedName } from './prefixes';
import { camelCase } from './camel-case';
// browser detection and prefixing tools
const transform = typeof window !== 'undefined' ? getVendorPrefixedName('transform') : undefined;
const backfaceVisibility = type... | }
} |
<|file_name|>IfcMember.cpp<|end_file_name|><|fim▁begin|>/* Code generated by IfcQuery EXPRESS generator, www.ifcquery.com */
#include <sstream>
#include <limits>
#include "ifcpp/model/AttributeObject.h"
#include "ifcpp/model/BuildingException.h"
#include "ifcpp/model/BuildingGuid.h"
#include "ifcpp/reader/Reade... | {
|
<|file_name|>main.js<|end_file_name|><|fim▁begin|>/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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... | *
* function log( chunk ) { |
<|file_name|>datacenter.js<|end_file_name|><|fim▁begin|>import emotion from 'preact-emotion';
import remcalc from 'remcalc';
import { Category } from './service';<|fim▁hole|>
export const Place = emotion(Category)`
margin-bottom: ${remcalc(10)};
`;
export const Region = emotion('h6')`
margin: ${remcalc(6)} 0;
... | |
<|file_name|>operations.go<|end_file_name|><|fim▁begin|>package desktopvirtualization
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes ma... | return
} |
<|file_name|>pos_receipt.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import time
from openerp.osv import osv
from openerp.report import report_sxw
def titlize(journal_name):
words = journal_name.split()
while words.pop() !... | self.localcontext.update({
'time': time,
'disc': self.discount, |
<|file_name|>tests.rs<|end_file_name|><|fim▁begin|>use crate::Server;
use std::path::PathBuf;
use std::sync::Arc;
use std::time::Duration;
use futures::future;
use nails::execution::{child_channel, ChildInput, Command, ExitCode};
use nails::Config;
use task_executor::Executor;
use tokio::net::TcpStream;
use tokio::ru... | future::Either::Right((_, s_s)) => server_shutdown = s_s,
x => panic!("Server should not have shut down: {:?}", x),
} |
<|file_name|>user.py<|end_file_name|><|fim▁begin|>import factory
from zeus import models
from zeus.utils import timezone<|fim▁hole|>
class UserFactory(ModelFactory):
id = GUIDFactory()
email = factory.Faker("email")
date_created = factory.LazyAttribute(lambda o: timezone.now())
date_active = factory.L... |
from .base import ModelFactory
from .types import GUIDFactory |
<|file_name|>connectors.py<|end_file_name|><|fim▁begin|>from asyncio import AbstractEventLoop
import aiomysql.sa
import asyncpg
from asyncio_extras import async_contextmanager
from cetus.types import (ConnectionType,
MySQLConnectionType,
PostgresConnectionType)
from sq... | host=db_uri.host, |
<|file_name|>data.js<|end_file_name|><|fim▁begin|>import { apiUrl } from '../../constants';
export default class DataService {
/** @ngInject */
constructor($http, $q) {
this.$http = $http;
this.$q = $q;
this.dataStore = {
categories: [],
providers: [],
resources: [],
services: [... | |
<|file_name|>SpringDataVisitRepository.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2002-2013 the original author or 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
*
* ... | * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, |
<|file_name|>EntityConverter.java<|end_file_name|><|fim▁begin|>/*-
* See the file LICENSE for redistribution information.
*
* Copyright (c) 2002,2008 Oracle. All rights reserved.
*
* $Id: EntityConverter.java,v 1.11 2008/01/07 14:28:58 cwl Exp $
*/
package com.sleepycat.persist.evolve;
import java.util.Collect... | * automatically deleted based on field deletion, because field Deleter objects
* are not used in conjunction with a Converter mutation. The EntityConverter
* can be used instead of a plain Converter to specify the key names to be
* deleted.</p> |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls.defaults import patterns, url
urlpatterns = patterns('webapp',
url(r'^/?$', 'views.home', name='home'),
url(r'^auth_redirect$', 'views.auth_redirect', name='auth_redirect'),
url(r'^nights$', 'views.night_inde... | ) |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models<|fim▁hole|>class Language(models.Model):
code = models.CharField(max_length=50,
null=False,
unique=True,
verbose_name='Code',
... | from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible |
<|file_name|>guest-form.component.ts<|end_file_name|><|fim▁begin|>import { Component, Input, Output, EventEmitter } from '@angular/core';
import { IGuest } from '../../core';
@Component({
selector: 'wd-guest-form',
styles: [require('./guest-form.css').toString()],
template: require('./guest-form.html')
})<|fim▁h... | export class GuestFormComponent {
@Input() title: string;
@Input() guest: IGuest; |
<|file_name|>qa.js<|end_file_name|><|fim▁begin|>import React, { Component } from 'react';
import Steps from './widgets/steps/steps';
import PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core/styles';
const styles = {
container: {
display: 'flex',
justifyContent: 'space-around',
fl... | |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import include, url
from django.views.generic.base import RedirectView
from cms.models import *
from cms.views import show
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()<|fim▁hole|> u... |
urlpatterns = [
url(r'^$', show,{'slug':"/%s"%settings.HOME_SLUG}, name='cms.home'), # contenido definido en home slug |
<|file_name|>speech_client_example_test.go<|end_file_name|><|fim▁begin|>// Copyright 2016 Google 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:... | }
stream, err := c.StreamingRecognize(ctx) |
<|file_name|>precond-tests.ts<|end_file_name|><|fim▁begin|>import precond = require('precond');
precond.checkArgument(true);
precond.checkArgument(true, "msg");
precond.checkArgument(true, "%s %s %s", 1, "two");
precond.checkState(true);
precond.checkState(true, "msg");
precond.checkState(true, "%s %s %s", 1, "two");... |
precond.checkIsString(true);
precond.checkIsString(true, "msg"); |
<|file_name|>home.component.ts<|end_file_name|><|fim▁begin|>/*import { Component } from '@angular/core';*/
import { Http, Headers } from '@angular/http';
import { AppState } from '../app.service';
import { HomeService } from './home.service';
import { CourseComponent } from '../course';
import { Course } from '../cours... | } |
<|file_name|>ButtonSet.tsx<|end_file_name|><|fim▁begin|>/*
MIT License
Copyright (c) 2022 Looker Data Sciences, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, inc... | copies or substantial portions of the Software.
|
<|file_name|>chatbot.py<|end_file_name|><|fim▁begin|>import urllib
import urllib2
import xml.dom.minidom
import re
import socket
from util import hook
chatbot_re = (r'(^.*\b(taiga|taigabot)\b.*$)', re.I)
@hook.regex(*chatbot_re)
@hook.command
def chatbot(inp, reply=None, nick=None, conn=None):
inp = inp.group(1).l... | args = {'bot_id': '6', 'say': inp.strip(), 'convo_id': conn.nick, 'format': 'xml'}
data = urllib.urlencode(args)
resp = False
url_response = urllib2.urlopen('http://api.program-o.com/v2/chatbot/?', data) |
<|file_name|>struct-in-struct.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-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.apac... | }
} |
<|file_name|>migrator.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
import os
import ssl
import sys
import cassandra
from cassandra import auth
from cassandra.cluster import Cluster
import yaml
from cdeploy import cqlexecutor
class Migrator:
def __init__(self, migrations_path, session):
... | migration_dir_listing)
def migration_version(self, file_name):
return int(file_name.split('.')[0].split('_')[0]) |
<|file_name|>test_codecmaps_cn.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
#
# test_codecmaps_cn.py
# Codec mapping tests for PRC encodings
#
from test import support
from test import test_multibytecodec_support
import unittest
class TestGB2312Map(test_multibytecodec_support.TestBase_Mapping,
... |
class TestGBKMap(test_multibytecodec_support.TestBase_Mapping,
|
<|file_name|>dvs_manager_dvs_config_target.py<|end_file_name|><|fim▁begin|>import logging
from pyvisdk.exceptions import InvalidArgumentError
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
def DVSManagerDvsCo... |
obj = vim.client.factory.create('ns0:DVSManagerDvsConfigTarget')
# do some validation checking... |
<|file_name|>TimedFilter.java<|end_file_name|><|fim▁begin|>/***************************************************************************
* Project file: NPlugins - NTalk - TimedFilter.java *
* Full Class name: fr.ribesg.bukkit.ntalk.filter.bean.TimedFilter *
* ... | }
|
<|file_name|>category.model.ts<|end_file_name|><|fim▁begin|>export interface CategoryInterface {
id?: number,
name: string,
created: Date
}
export class CategoriesModel implements CategoryInterface {
id?: number;
name: string;<|fim▁hole|><|fim▁end|> | created: Date;
} |
<|file_name|>assembunny.rs<|end_file_name|><|fim▁begin|>use std::io::prelude::*;
use std::fs::File;
struct Registers {
a: i32,
b: i32,
c: i32,
d: i32
}
impl Registers {
fn new() -> Registers {
Registers{a: 0, b: 0, c: 0, d: 0}
}
fn get(&self, name: &str) -> i32 {
match nam... | |
<|file_name|>tessellation.rs<|end_file_name|><|fim▁begin|>#[macro_use]
extern crate glium;
use glium::Surface;
use glium::glutin;
use glium::index::PrimitiveType;
mod support;
fn main() {
use glium::DisplayBuild;
// building the display, ie. the main object
let display = glutin::WindowBuilder::new()
... | #version 330
|
<|file_name|>holiday.module.ts<|end_file_name|><|fim▁begin|>import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterModule, Routes } from '@angular/router';
import { IconModule } from './../shared/icon/icon.module';
import { ListModule } from './../shared/list/list.modu... | this._slotRegistry.register(new ApproveHolidayDetailSlot());
}
} |
<|file_name|>Select-test.js<|end_file_name|><|fim▁begin|>'use strict';
/* global describe, it, beforeEach */
var jsdomHelper = require('../testHelpers/jsdomHelper');
var sinon = require('sinon');
var unexpected = require('unexpected');
var unexpectedDom = require('unexpected-dom');
var unexpectedSinon = require('unex... |
it('should call onChange with a empty value', () => { |
<|file_name|>InputFileReader.java<|end_file_name|><|fim▁begin|>package com.yngvark.communicate_through_named_pipes.input;
import org.slf4j.Logger;
import java.io.BufferedReader;
import java.io.IOException;
import static org.slf4j.LoggerFactory.getLogger;
public class InputFileReader {
private final Logger logge... | |
<|file_name|>create_messages.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3
# Generate .js files defining Blockly core and language messages.
#
# Copyright 2013 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You ma... | import codecs
import os |
<|file_name|>display.rs<|end_file_name|><|fim▁begin|>use alloc::boxed::Box;
use collections::String;
use common::event::Event;
use core::{cmp, ptr};
use core::mem::size_of;
use fs::{KScheme, Resource, ResourceSeek, Url};
use system::error::{Error, Result, EACCES, EBADF, ENOENT, EINVAL};
use system::graphics::fast_... | Err(Error::new(EBADF))
}
} |
<|file_name|>issue-5572.rs<|end_file_name|><|fim▁begin|>fn foo<T: ::std::cmp::Eq>(t: T) { }
<|fim▁hole|><|fim▁end|> | fn main() { } |
<|file_name|>JustPremium.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import re
from module.plugins.internal.Addon import Addon
class JustPremium(Addon):
__name__ = "JustPremium"
__type__ = "hook"
__version__ = "0.25"
__status__ = "testing"
__config__ = [("activated", "bool", ... |
for pluginname in set(linkdict.keys()) - hosterlist: |
<|file_name|>IssueTrackerConfig.java<|end_file_name|><|fim▁begin|>/******************************************************************************
*
* Copyright 2013-2019 Paphus Solutions Inc.
*
* Licensed under the Eclipse Public License, Version 1.0 (the "License");
* you may not use this file except in compli... |
public String getCreateAccessMode() { |
<|file_name|>ckeygen.py<|end_file_name|><|fim▁begin|># -*- test-case-name: twisted.conch.test.test_ckeygen -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Implementation module for the `ckeygen` command.
"""
import sys, os, getpass, socket
if getpass.getpass == getpass.unix_getpass:
... |
def run(): |
<|file_name|>0047_auto_20170525_2011.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.9.12 on 2017-05-25 20:11
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('anagrafica', '0046_delega_stato... | ),
] |
<|file_name|>frame_x86.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Pub... | map->set_location(rbp->as_VMReg(), (address) link_addr); |
<|file_name|>tools.d.ts<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | export { enableDebugTools, disableDebugTools } from 'angular2/src/tools/tools'; |
<|file_name|>sqs_transport.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import boto.sqs
import uuid
from beaver.transports.base_transport import BaseTransport
from beaver.transports.exception import TransportException
class SqsTransport(BaseTransport):<|fim▁hole|>
def __init__(self, beaver_config, log... | |
<|file_name|>15.9.5.30-1.js<|end_file_name|><|fim▁begin|>/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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://moz... | If min is not specified, this behaves as if min were specified with the
value getMinutes( ). If sec is not specified, this behaves as if sec were
specified with the value getSeconds ( ). If ms is not specified, this
behaves as if ms were specified with the value getMilliseconds( ). |
<|file_name|>test_shared_folders.py<|end_file_name|><|fim▁begin|>from nxdrive.tests.common_unit_test import UnitTestCase
from nxdrive.client import RemoteDocumentClient
from nxdrive.client import LocalClient
class TestSharedFolders(UnitTestCase):
def test_move_sync_root_child_to_user_workspace(self):
"""... | self.engine_2.start()
|
<|file_name|>zip.py<|end_file_name|><|fim▁begin|>def zip(*arg):
Result = []
Check = 1
#check if every item in arg has the same length
for i in arg:
if len(i) != len(arg[0]):
print 'please make sure enter all items with the same length'
Check = 0
break
whil... | print unzip(zip([100,200,300],[200,300,400], [0,0,0]))
print '\n'
if __name__ == '__main__': |
<|file_name|>indexer.rs<|end_file_name|><|fim▁begin|>// Copyright (C) 2013-2020 Blockstack PBC, a public benefit corporation
// Copyright (C) 2020 Stacks Open Internet Foundation
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as publish... | pub trait BurnchainBlockDownloader {
type H: BurnHeaderIPC + Sync + Send + Clone;
type B: BurnBlockIPC + Sync + Send + Clone;
|
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|>"""
WSGI config for django_mailing project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see<|fim▁hole|>
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SE... | https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/
""" |
<|file_name|>macho_analysis.py<|end_file_name|><|fim▁begin|># !/usr/bin/python
# coding=utf-8
import logging
import lief
logger = logging.getLogger(__name__)
class Checksec:
def __init__(self, macho):
self.macho = lief.parse(macho.as_posix())
def checksec(self):
macho_dict = {}
mach... | 'Deployment Postprocessing to YES, ' |
<|file_name|>gen_generic.py<|end_file_name|><|fim▁begin|>extensions = dict(
required_params=[], # empty to override defaults in gen_defaults
validate_required_params="""
# Required args: either model_key or path
if (is.null(model_key) && is.null(path)) stop("argument 'model_key' or 'path' must be provided")
""... | |
<|file_name|>mootools-core-1.4.5.js<|end_file_name|><|fim▁begin|>/*
---
MooTools: the javascript framework
web build:
- http://mootools.net/core/8423c12ffd6a6bfcde9ea22554aec795
packager build:
- packager build Core/Core Core/Array Core/String Core/Number Core/Function Core/Object Core/Event Core/Browser Core/Class... | |
<|file_name|>nova.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://www.apache... | |
<|file_name|>test_unit_gpcheckcat.py<|end_file_name|><|fim▁begin|>import imp
import logging
import os
import sys
from mock import *
from .gp_unittest import *
from gppylib.gpcatalog import GPCatalogTable
class GpCheckCatTestCase(GpTestCase):
def setUp(self):
# because gpcheckcat does not have a .py exten... | def test_checkForeignKey__with_arg_gp_fastsequence(self, process_foreign_key_mock,fast_seq_mock):
cat_mock = Mock()
self.subject.GV.catalog = cat_mock |
<|file_name|>StationEquipmentAlarmActionCreators.js<|end_file_name|><|fim▁begin|>//
"use strict";
var AppDispatcher = require('../dispatcher/AppDispatcher');
var StationEquipmentAlarmConstants = require('../constants/StationEquipmentAlarmConstants');<|fim▁hole|>var StationEquipmentAlarmActionCreators = {
loadDefec... | var StationEquipmentAlarmsWebApiUtils = require('../webapiutils/StationEquipmentAlarmsWebApiUtils')
var Station = require('../domain/Station');
|
<|file_name|>rotate_matrix.py<|end_file_name|><|fim▁begin|>import unittest
def rotate_matrix(matrix):
end = len(matrix) - 1 # The index of the last row
# Rotating the matrix layer by layer
for row in range((end + 1) / 2):
for col in range(row, end - row):
temp = matrix[row][col]
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.