prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>test_plugin.py<|end_file_name|><|fim▁begin|>import unittest
from mock import Mock
from nosealert.plugin import AlertPlugin
from nosealert.notifications import Notification
class TestAlertPlugin(unittest.TestCase):
def setUp(self):
self.plugin = AlertPlugin()
def test_get_notification_su... |
def test_get_notification_with_fails(self): |
<|file_name|>method-on-generic-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://... | // compile-flags:-g
|
<|file_name|>delete_target_pool.go<|end_file_name|><|fim▁begin|>package gce
import (
"context"
"github.com/supergiant/control/pkg/clouds/gcesdk"
"io"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/supergiant/control/pkg/workflows/steps"
"google.golang.org/api/compute/v1"
)
const DeleteTarget... | func (s *DeleteTargetPoolStep) Depends() []string {
return nil |
<|file_name|>form.js<|end_file_name|><|fim▁begin|>module.exports = {
label: {
display: 'block',
width: '90%',
marginBottom: 15
},
labelText: {
color: '#777',
fontSize: '15px',
display: 'block'
},
input: {
display: 'block',
fontSize: '20px',
padding: 10,
width: '100%',
border: '1px solid #ddd'... | |
<|file_name|>filters.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
# Copyright (C) Zing contributors.
#
# This file is a part of the Zing project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file f... | if not self.user:
return self.qs.none()
qs = self.qs.filter(
submitted_by=self.user, |
<|file_name|>MainWindow.cc<|end_file_name|><|fim▁begin|>/*
* Copyright 2012 Open Source Robotics Foundation
*
* 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.or... | |
<|file_name|>credentials.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# import keystoneclient.v2_0.client as ksclient
# import glanceclient.v2.client as glclient
# import novaclient.client as nvclient
# import neutronclient.v2_0.client as ntclient
# import cinderclient.v2.client as cdclient
# import swiftclie... | |
<|file_name|>TestLdapComplex.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2010-2014 Evolveum
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/lice... | import org.opends.server.types.LDIFImportConfig;
import org.opends.server.util.LDIFException; |
<|file_name|>slide_channel.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-<|fim▁hole|>
class Channel(models.Model):
_inherit = 'slide.channel'
nbr_certification = fields.Integer("Number of Certifications", compute='_compute_slides_statistics', store=True)
class Category(models.Model):
_inherit =... | # Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models |
<|file_name|>export_test.go<|end_file_name|><|fim▁begin|>// Copyright 2014 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
<|fim▁hole|> BundleCharms = (*Handler).bundleCharms
ParseSearchParams = parseSearchParams
DefaultIcon = defaultIcon
A... | package v4
var ( |
<|file_name|>table_manager.go<|end_file_name|><|fim▁begin|>package uploads
import (
"context"
"errors"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"regexp"
"sync"
"time"
"github.com/go-kit/log/level"
"github.com/prometheus/client_golang/prometheus"
"github.com/grafana/loki/pkg/storage/chunk"
"github.com/graf... | return nil
} |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>"""
dwm package setup
"""
from __future__ import print_function
from setuptools import setup, find_packages
__version__ = '1.1.0'
def readme():
""" open readme for long_description """
try:
with open('README.md') as fle:
return fle.r... | 'Operating System :: OS Independent',
'Topic :: Software Development :: Libraries :: Python Modules', |
<|file_name|>bbox.py<|end_file_name|><|fim▁begin|>import scipy.ndimage as ndi
class BBox(object):
def __init__(self, x1, y1, x2, y2):
'''
(x1, y1) is the upper left corner,
(x2, y2) is the lower right corner,
with (0, 0) being in the upper left corner.
'''
if x1 > x2: x1, x2 = x2... | # Threshold the blurred data (this needs to be a bit > 0 due to the blur) |
<|file_name|>persist_data.py<|end_file_name|><|fim▁begin|>"""BitBake Persistent Data Store
Used to store data in a central location such that other threads/tasks can
access them at some future date. Acts as a convenience wrapper around sqlite,
currently, providing a key/value store accessed by 'domain'.
"""
# Copyri... | raise TypeError('Only string values are supported')
data = self._execute("SELECT * from %s where key=?;" %
self.table, [key]) |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import patterns, include, url
from django.views.generic import TemplateView
home = TemplateView.as_view(template_name='home.html')
urlpatterns = patterns(
'',<|fim▁hole|>)<|fim▁end|> | url(r'^filter/', include('demoproject.filter.urls')),
# An informative homepage.
url(r'', home, name='home') |
<|file_name|>project.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Part of the PsychoPy library
# Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2022 Open Science Tools Ltd.
# Distributed under the terms of the GNU General Public License (GPL).
import io
import sys
import tempfile
i... | (descrLabel, 0, wx.ALIGN_RIGHT), self.descrBox,
(tagsLabel, 0, wx.ALIGN_RIGHT), self.tagsBox,
(publicLabel, 0, wx.ALIGN_RIGHT), self.publicBox]) |
<|file_name|>HashingOutputStream.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2017 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
*<|fim▁hole|> * Un... | * http://www.apache.org/licenses/LICENSE-2.0
* |
<|file_name|>warrantyscope.js<|end_file_name|><|fim▁begin|>/* Thing > Intangible > Enumeration > WarrantyScope - A range of of services that will be provided to a customer free of charge in case of a defect or malfunction of a product.
Commonly used values:
http://purl.org/goodrelations/v1#Labor-BringIn
http://purl.or... | image.push( ( <div key='footer' data-advice='HTML for the *footer* of the section'></div> ) );
} else { |
<|file_name|>problem_029.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#-*-coding:utf-8-*-<|fim▁hole|>
21 22 23 24 25
20 7 8 9 10
19 6 1 2 11
18 5 4 3 12
17 16 15 14 13
It can be verified that the sum of the numbers on the diagonals is 101.
What is the sum of the numbers on the diagonals
in a 1001 by ... |
'''
Starting with the number 1 and moving to the right
in a clockwise direction a 5 by 5 spiral is formed as follows: |
<|file_name|>main.go<|end_file_name|><|fim▁begin|>package main
import (
"os"
"github.com/mkideal/cli"
)<|fim▁hole|> Username string `cli:"u,username" usage:"github account" prompt:"type github account"`
Password string `pw:"p,password" usage:"password of github account" prompt:"type the password"`
}
func main() {... |
type argT struct {
cli.Helper |
<|file_name|>headerRenderer.js<|end_file_name|><|fim▁begin|>/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v12.0.1
* @link http://www.ag-grid.com/
* @license MIT
*/
"use strict";
var __decorate = (this && this.__decorate) || function (decorator... | __decorate([
context_1.Autowired('context'),
__metadata("design:type", context_1.Context) |
<|file_name|>runstatus_page.go<|end_file_name|><|fim▁begin|>package egoscale
import (
"context"
"encoding/json"
"fmt"
"log"
"time"
)
// RunstatusPage runstatus page
type RunstatusPage struct {
Created *time.Time `json:"created,omitempty"`
DarkTheme bool `json:"dark... |
pageURL = p.Next
} |
<|file_name|>inhibit.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2011 Christoph Reiter <reiter.christoph@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; eith... | PLUGIN_ICON = Icons.PREFERENCES_DESKTOP_SCREENSAVER
|
<|file_name|>Component.meta.tsx<|end_file_name|><|fim▁begin|>import { {%ComponentName%}, {%ComponentName%}Props } from '.';<|fim▁hole|>import Registry from '@ui-autotools/registry';
const {%ComponentName%}Metadata = Registry.getComponentMetadata({%ComponentName%});
{%ComponentName%}Metadata.nonReactStrictModeCompliant... | |
<|file_name|>noop_method_call.rs<|end_file_name|><|fim▁begin|>use crate::context::LintContext;
use crate::rustc_middle::ty::TypeFoldable;
use crate::LateContext;
use crate::LateLintPass;
use rustc_hir::def::DefKind;
use rustc_hir::{Expr, ExprKind};
use rustc_middle::ty;
use rustc_span::symbol::sym;
declare_lint! {
... | let expr_span = expr.span; |
<|file_name|>testAll.js<|end_file_name|><|fim▁begin|>const SafeHarborModules = require('./SafeHarborModules');
const SafeHarborInverters = require('./SafeHarborInverters');
module.exports = () => {
SafeHarborModules();<|fim▁hole|><|fim▁end|> | SafeHarborInverters();
} |
<|file_name|>event.py<|end_file_name|><|fim▁begin|>"""!event [num]: Displays the next upcoming H@B event."""
<|fim▁hole|><|fim▁end|> | __match__ = r"!event( .*)" |
<|file_name|>index.d.ts<|end_file_name|><|fim▁begin|>declare namespace binVersion {
interface Options {
/**
The arguments to pass to `binary` so that it will print its version.
@default ['--version']
*/
args?: string[];
}<|fim▁hole|>
/**
Get the version of a binary in [semver](https://github.com/npm/node-s... | } |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>/*
* Copyright 2020 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*... | |
<|file_name|>0076_articlepage_video_document.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
<|fim▁hole|> ('articles', '0075_auto_20151015_2022'),
... | dependencies = [
('wagtaildocs', '0003_add_verbose_names'), |
<|file_name|>LinePathAnnotation.tsx<|end_file_name|><|fim▁begin|>import React from 'react';
import cx from 'classnames';
import { Point } from '@visx/point';
import { Group } from '@visx/group';
import { LinePath } from '@visx/shape';
interface SimplePoint {
x: number;
y: number;
}
export type LinePathAnnotationP... | return (
<Group className="visx-line-path-annotation-group" top={top} left={left}>
<LinePath<Point | SimplePoint>
className={cx('visx-line-path-annotation', className)} |
<|file_name|>helpers.py<|end_file_name|><|fim▁begin|>import datetime
import commonware.log
import django_tables as tables
import jinja2
from django.conf import settings
from django.template import Context, loader
from django.utils.datastructures import SortedDict
from jingo import register
from tower import ugettext a... | |
<|file_name|>ColorPickerDialog.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2013 The Android Open Source Project
*
* 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:/... | refreshPalette();
}
}
|
<|file_name|>DictServiceImpl.java<|end_file_name|><|fim▁begin|>package com.cnpc.framework.base.service.impl;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Service;
import com.alibaba.fastjson.JSON;
<|fim▁hole|>import com.cnpc.framework.base... | |
<|file_name|>TDEMPlanewave.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import division
import numpy as np
from scipy.constants import mu_0, pi, epsilon_0
import numpy as np
from SimPEG import Utils
... | z = XYZ[:, 2]
bunja = -E0*(mu*sig)**0.5 * z * np.exp(-(mu*sig*z**2) / (4*t))
bunmo = 2 * np.pi**0.5 * t**1.5 |
<|file_name|>YieldFrom.py<|end_file_name|><|fim▁begin|>"""
YieldFrom astroid node
This node represents the Python "yield from" statement, which functions
similarly to the "yield" statement except that the generator can delegate
some generating work to another generator.
Attributes:
- value (GeneratorExp)
... | |
<|file_name|>StringField.cpp<|end_file_name|><|fim▁begin|>/**
* Pennyworth - A new smarthome protocol.
* Copyright (C) 2012 Dream-Crusher Labs LLC
*
* 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 Fo... | return this->value;
}
} /* namespace dvs */ |
<|file_name|>build.rs<|end_file_name|><|fim▁begin|>// Copyright 2017 The Xyrosource Team.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not... | |
<|file_name|>test_energy_profiler.py<|end_file_name|><|fim▁begin|>"""Test energy_profiler module."""
import unittest
from physalia.energy_profiler import AndroidUseCase
# pylint: disable=missing-docstring
class TestEnergyProfiler(unittest.TestCase):
def test_empty_android_use_case(self):
# pylint: disa... | use_case.run() |
<|file_name|>response.spec.js<|end_file_name|><|fim▁begin|>const { decode, parse } = require('./response')
describe('Protocol > Requests > ListOffsets > v1', () => {
test('response', async () => {
const data = await decode(Buffer.from(require('../fixtures/v1_response.json')))
expect(data).toEqual({
res... | partitions: [{ partition: 0, errorCode: 0, timestamp: '1543343103774', offset: '0' }],
},
], |
<|file_name|>alarm.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 ap... | |
<|file_name|>toolbar.d.ts<|end_file_name|><|fim▁begin|>import { ElementRef, Renderer } from '@angular/core';
import { Config } from '../../config/config';
import { Ion } from '../ion';
import { ToolbarTitle } from './toolbar-title';
import { ViewController } from '../../navigation/view-controller';
/**
* @name Header
... | * </ion-footer> |
<|file_name|>rendering.py<|end_file_name|><|fim▁begin|>import maya.cmds;mc = maya.cmds
import pymel.core;pm = pymel.core
from pytaya.core.general import listForNone
from pytd.util.logutils import logMsg
from pytd.util.sysutils import grouper
def fileNodesFromObjects(oObjList):
return fileNodesFromShaders(shaders... | continue |
<|file_name|>review.js<|end_file_name|><|fim▁begin|>// Release 1: User Stories
// As a user, I want to be able to create a new grocery list. After that, I need to be able to add an item with a quantity to the list, remove an item, and update the quantities if they change. I need a way to print out the list in a format ... |
// Release 5: Reflect
// What concepts did you solidify in working on this challenge? (reviewing the passing of information, objects, constructors, etc.)
// I solidified accessing different properties in an object. I was able to add strings from an array into an empty object and set their default value. To change thos... |
<|file_name|>LineNumbersTest.java<|end_file_name|><|fim▁begin|>import java.util.*;
public class LineNumbersTest extends LinkedList<Object>{
public LineNumbersTest(int x) {
super((x & 0) == 1 ?
new LinkedList<Object>((x & 1) == x++ ? new ArrayList<Object>() : new HashSet<Object>())
:... | System.out.println(new Throwable().fillInStackTrace().getStackTrace()[0].getFileName());
System.out.println(getLineNo()); |
<|file_name|>test_preprocess.py<|end_file_name|><|fim▁begin|>#
# This is Seisflows
#
# See LICENCE file
#
###############################################################################
# Import system modules
import sys
import traceback
from glob import glob
from os.path import abspath, basename, dirname, exists
# I... | setattr(PATH, 'WORKDIR', abspath('.'))
def main(self): |
<|file_name|>arrayCopy.js<|end_file_name|><|fim▁begin|>/**
* Copies the values of `source` to `array`.
*
* @private
* @param {Array} source The array to copy values from.
* @param {Array} [array=[]] The array to copy values to.
* @returns {Array} Returns `array`.<|fim▁hole|> */
function arrayCopy(source, array) {... | |
<|file_name|>run.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2.7
from argparse import ArgumentParser
parser = ArgumentParser()
args = parser.parse_args()
from sys import exit
from subtlenet.models import cluster as train
import numpy as np
from subtlenet.utils import mpl, plt
from mpl_toolkits.mplot3d import... | ax = Axes3D(fig)
mask = cls == 0 |
<|file_name|>base.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
requests_cache.backends.base
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Contains BaseCache class which can be used as in-memory cache backend or
extended to support persistence.
"""
from datetime import datetime
impor... | class BaseCache(object):
""" Base class for cache implementations, can be used as in-memory cache.
To extend it you can provide dictionary-like objects for |
<|file_name|>column.mako.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
<%namespace name="helpers" file="/helpers.mako.rs" />
<%... | extra_prefixes="moz",
spec="https://drafts.csswg.org/css-multicol/#propdef-column-count")}
${helpers.predefined_type("column-gap", |
<|file_name|>body_config.py<|end_file_name|><|fim▁begin|>from collections import namedtuple<|fim▁hole|># Size and Weight Constants
TOTAL_MASS = 20 # Made up units
TOTAL_HEIGHT = 350 # Pygame pixels
STARTING_SPEED = 0, 0 # pixels/sec?
BASE_STRENGTH = 1500000
# Mass Fractions #
mass_fractions = {
"head": 0.0826,
... | from math import pi
import pygame
|
<|file_name|>earthmine_qgis.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import copy
import json
import math
from functools import partial
from PyQt4.QtCore import QSettings, QTranslator, qVersion, QCoreApplication, pyqtSignal, QObject, pyqtSlot, Qt, QUrl, \
QRectF, SIGNAL, QPointF, QLineF
from PyQt4.Q... |
def connect_layer_signals(self, layer):
if not layer.type() == QgsMapLayer.VectorLayer: |
<|file_name|>log.js<|end_file_name|><|fim▁begin|>'use strict';
var util = require('util');
var events = require('events');
var _ = require('lodash');
var table = require('text-table');
var chalk = require('chalk');
// padding step
var step = ' ';
var padding = ' ';
// color -> status mappings
var colors = {
ski... | //
// Retunrns the logger
function log(msg, ctx) { |
<|file_name|>resource_app_engine_application_url_dispatch_rules.go<|end_file_name|><|fim▁begin|>// ----------------------------------------------------------------------------
//
// *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
//
// --------------------------------------------------------------... | return handleNotFoundError(err, d, fmt.Sprintf("AppEngineApplicationUrlDispatchRules %q", d.Id()))
} |
<|file_name|>reader.py<|end_file_name|><|fim▁begin|># Copyright 2020 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | def to_arrow(self, read_session=None):
"""Create a :class:`pyarrow.Table` of all rows in the stream.
|
<|file_name|>index.js<|end_file_name|><|fim▁begin|>/* eslint-env mocha */
import path from 'path';
import fs from 'fs';
import assert from 'assert';
import {transformFileSync} from 'babel-core';
function trim(str) {
return str.replace(/^\s+|\s+$/, '');
}
describe('Transpile ES7 async/await to vanilla ES6 Promise c... | // sometimes 2000 isn't enough when starting up in coverage mode.
this.timeout(5000); |
<|file_name|>convRolledInF4OutF8.rs<|end_file_name|><|fim▁begin|>#pragma version(1)
#pragma rs_fp_relaxed
#pragma rs java_package_name(layers)
rs_allocation In_Blob;
rs_allocation Kernel_Blob;
rs_allocation Bias_Blob;
rs_allocation Out_Alloc;
int c_i;
int h_i;
int w_i;
int n_k;
int c_k;
int h_k;
int w_k;... | sum2.w += bias2.w;
|
<|file_name|>RTree.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 you under the Apache ... | }
LOG.info("Bulk loading an RTree with " + elementCount + " elements");
// It turns out the findBestDegree returns the best degree when the |
<|file_name|>pico_dev_vde.rs<|end_file_name|><|fim▁begin|>#![allow(non_camel_case_types)]
extern crate libc;
use libc::{c_char, uint8_t, uint32_t};
use pico_stack::*;
/*
* FOREIGN FUNCTION INTERFACE
*/
#[link(name = "picotcp")]
extern "C" {
pub fn pico_vde_destroy(vde: *mut pico_device);
pub fn pico_vde_... | |
<|file_name|>config.go<|end_file_name|><|fim▁begin|>package server
import (
"io"
"time"
)
// DatabaseConfig contains all the information to start the Kappa server.
type DatabaseConfig struct {
// NodeName is the name of the node. If it is empty, a name
// will be generated.
NodeName string
// ClusterName prev... | // GossipBindAddr
GossipBindAddr string |
<|file_name|>mat4d.d.ts<|end_file_name|><|fim▁begin|>declare module goog {
function require(name: 'goog.vec.mat4d'): typeof goog.vec.mat4d;
}
declare module goog.vec.mat4d {
/** @typedef {goog.vec.Float64} */
type Type = goog.vec.Float64;
/**
* Creates a mat4d with all elements initialized to ze... | * Initializes the matrix from the set of values. Note the values supplied are
* in column major order.
* |
<|file_name|>routes.js<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2014 rafa
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) a... | $('#indexContenidoJsp').spinner(); |
<|file_name|>choices.py<|end_file_name|><|fim▁begin|># Add your own choices here!
fruit = ["apples", "oranges", "pears", "grapes", "blueberries"]
lunch = ["pho", "timmies", "thai", "burgers", "buffet!", "indian", "montanas"]<|fim▁hole|><|fim▁end|> | situations = {"fruit":fruit, "lunch":lunch} |
<|file_name|>test_signup.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from django.conf import settings
from django.test import TestCase
from zilencer.models import Deployment
from zerver.models import (
get_realm, get_user_profile_by_email,
PreregistrationUser, Realm, ScheduledJob, UserProfile,
)
... | """
self.login("hamlet@zulip.com") |
<|file_name|>local_settings_template.py<|end_file_name|><|fim▁begin|># flake8: noqa
# -*- coding: utf-8 -*-
###############################################
# Geosite local settings
###############################################
import os
# Outside URL
SITEURL = 'http://$DOMAIN'
OGC_SERVER['default']['LOCATION'] = o... | OGC_SERVER['default']['PUBLIC_LOCATION'] = os.path.join(SITEURL, 'geoserver/') |
<|file_name|>main.go<|end_file_name|><|fim▁begin|>package main
import (
"os"
"github.com/kamaln7/karmabot"
"github.com/kamaln7/karmabot/ctlcommands"
"github.com/aybabtme/log"
"github.com/urfave/cli"
)
var (
ll *log.Log
)
func main() {
// logging
ll = log.KV("version", karmabot.Version)
// commands
cc ... | Name: "webui",
Subcommands: webuiCommands,
}, |
<|file_name|>StructuralInterface.cpp<|end_file_name|><|fim▁begin|>#include "StructuralInterface.h"
StructuralInterface::StructuralInterface (StructuralEntity *parent)
: StructuralEntity (parent)
{
setCategory (Structural::Interface);
setStructuralType (Structural::NoType);
setResizable (false);
setTop (0... | painter->setPen (QPen (QBrush (QColor (76, 76, 76)), 2)); |
<|file_name|>suite.py<|end_file_name|><|fim▁begin|># uncompyle6 version 2.9.10
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10)
# [GCC 6.2.0 20161005]
# Embedded file name: suite.py
"""TestSuite"""
import sys
from . import case
from . import util
__unittest = True
def _... | """A crude way to tell apart testcases and suites with duck-typing"""
try: |
<|file_name|>mat3.ts<|end_file_name|><|fim▁begin|>namespace la.mat3 {
/// NOTE:
/// Row-major order
/// [m11, m12, m21, m22, x0, y0]
export function create(src?: number[]|Float32Array): Float32Array {
var dest = new Float32Array(6);
if (src) {
dest[0] = src[0];
... | |
<|file_name|>test_compute_api.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 req... | |
<|file_name|>managers.py<|end_file_name|><|fim▁begin|>"""Model managers for Reversion."""
try:
set
except NameError:
from sets import Set as set # Python 2.3 fallback.
from django.contrib.contenttypes.models import ContentType
from django.db import models
class VersionManager(models.Manager):
"""M... | known_serialized_data = set()
for version in versions: |
<|file_name|>test_utils.py<|end_file_name|><|fim▁begin|>################################
# Author : septicmk
# Date : 2015/07/24 19:41:26
# FileName : test_utils.py
################################
import shutil
import tempfile
import unittest
from numpy import vstack
from pyspark import SparkContext
class PyS... |
class PySparkTestCaseWithOutputDir(PySparkTestCase):
def setUp(self): |
<|file_name|>test_TxnProcessor.py<|end_file_name|><|fim▁begin|># coding=utf-8
# Distributed under the MIT software license, see the accompanying
# file LICENSE or http://www.opensource.org/licenses/mit-license.php.
from unittest import TestCase
from mock import Mock, patch
from qrl.core.misc import logger
from qrl.cor... |
def test_txnprocessor_tx_validate_fail(self, m_get_slave, m_logger):
m_get_slave.return_value = None |
<|file_name|>data.py<|end_file_name|><|fim▁begin|>import torch
def get_data(params):
batch_size = params["batch_size"]
M, N, K = params["problem"]["size"]
flop = (2.0 * M * N * K)
params["problem"]["flop_estimated"] = flop * params["nb_epoch"] * batch_size<|fim▁hole|> n = params["problem"]["size"][... | m = params["problem"]["size"][0] |
<|file_name|>host.html.0.js<|end_file_name|><|fim▁begin|><|fim▁hole|>Polymer('x-foo')<|fim▁end|> | |
<|file_name|>fs.rs<|end_file_name|><|fim▁begin|>// This file is part of the uutils coreutils package.
//
// (c) Joseph Crail <jbcrail@gmail.com>
// (c) Jian Zeng <anonymousknight96 AT gmail.com>
//
// For the full copyright and license information, please view the LICENSE
// file that was distributed with this source c... | |
<|file_name|>ClientCssHelper.js<|end_file_name|><|fim▁begin|>var logger = require('../logging').getLogger(__LOGGER__);
var {PAGE_CSS_NODE_ID} = require('../constants');
var Q = require('q');
var PageUtil = require('./PageUtil')
var loadedCss = {};
module.exports = {
registerPageLoad: function registerPageLoad() {
... | return Q.all(Object.keys(newCssByKey).map(newCssKey => {
var retval;
if (!loadedCss[newCssKey]) {
// this means that the CSS is not currently present in the |
<|file_name|>AdxDataSetMetadata.java<|end_file_name|><|fim▁begin|>package org.hisp.dhis.dxf2.adx;
/*
* Copyright (c) 2015, UiO
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistr... |
/**
* @author bobj |
<|file_name|>softlayer_vs_ip.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-<|fim▁hole|>DOCUMENTATION = '''
---
module: softlayer_vs_ip
short_description: Retrieves instance ip addresses from Softlayer
description:
- Retrieves instance ip addresses of all adapters from Softlayer
- the... | |
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import itertools
import tempfile
from django.core.files.storage import FileSystemStorage
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
calla... | ]
STRING_CHOICES_WITH_NONE = [ |
<|file_name|>mks.py<|end_file_name|><|fim▁begin|># Copyright 2016 OpenStack Foundation
# 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<|fim▁hole|># a copy of the License at
#
# h... | |
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|>"""
WSGI config for sms_relay project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable<|fim▁hole|>Usually you will have the standard Django WSGI application here... | named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` setting.
|
<|file_name|>gen_test2111b.py<|end_file_name|><|fim▁begin|>mcinif='mcini_gen2'<|fim▁hole|>update_prec=0.04
update_mf=False
update_part=500
import sys
sys.path.append(pathdir)
import run_echoRD as rE
rE.echoRD_job(mcinif=mcinif,mcpick=mcpick,runname=runname,wdir=wdir,pathdir=pathdir,update_prec=update_prec,update_mf=u... | runname='gen_test2111b'
mcpick='gen_test2b.pickle'
pathdir='/beegfs/work/ka_oj4748/echoRD'
wdir='/beegfs/work/ka_oj4748/gen_tests' |
<|file_name|>final.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'final.ui'
#
# Created by: PyQt5 UI code generator 5.8.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtCore import *
from P... | eco_mode.compute()
defuzz = eco_mode.output['Economy_level']
|
<|file_name|>wrappers.pb.go<|end_file_name|><|fim▁begin|>// Code generated by protoc-gen-gogo.
// source: wrappers.proto
// DO NOT EDIT!
/*
Package types is a generated protocol buffer package.
It is generated from these files:
wrappers.proto
It has these top-level messages:
DoubleValue
FloatValue
Int64Value
UI... | }
return false
}
|
<|file_name|>networkRead.java<|end_file_name|><|fim▁begin|>import java.io.IOException;
import java.net.Socket;
import java.util.Scanner;
public class networkRead implements Runnable
{
//Objects
Scanner read;
debugLogger myLogger;
sharedData myData;
arduinoWrite ardWriter;
Socket pipe;
//Variables
String dat... | keepAlive();
data = "";
|
<|file_name|>honest_node.rs<|end_file_name|><|fim▁begin|>use crate::protocol::{Node, Digest, Nid, SignedMessage, Slot, View, StateMachine};
use std::sync::mpsc::{Sender, Receiver};
use crate::network::Network;
pub(crate) struct HonestNode<S: StateMachine> {
pub(crate) state_machine: S,
pub(crate) network: Netw... | |
<|file_name|>32e5974ada25_add_neutron_resources_table.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/LICEN... | nullable=True)) |
<|file_name|>cli.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import os
gettext = lambda s: s
urlpatterns = []
def configure(**extra):
from django.conf import settings
os.environ['DJANGO_SETTINGS_MODULE'] = 'cms.test_utils.cli'
defaults = dict(
CACHE_BACKEND='locmem:///',
DEB... | 'django.contrib.auth.hashers.MD5PasswordHasher',
) |
<|file_name|>test__reshape_vector_args.py<|end_file_name|><|fim▁begin|># (C) British Crown Copyright 2014 - 2015, Met Office
#
# This file is part of Iris.
#
# Iris is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software F... | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License |
<|file_name|>mail.js<|end_file_name|><|fim▁begin|>/**
* Created by GYX on 15/6/27.
*/
var nodeMailer = require('nodemailer');
var Imap = require("imap");
var MailParser = require("mailparser").MailParser;
var imapconn =null;
function mail(option) {
this.smtp = option.smtp || "";
this.smtpPort = option.sm... | this._mailbox = mailbox;
this._onerror = onerror;
var self= this;
if(!imapconn){ |
<|file_name|>docs_test.py<|end_file_name|><|fim▁begin|>from selenium_test_case import SeleniumTestCase
class DocsTest(SeleniumTestCase):
def test_links_between_pages(self):
self.open_path('/help')
self.assert_text_present('Frequently Asked Questions')
self.click_and_wait('link=Terms of Se... | self.click_and_wait(u'link=Ed')
self.assert_text_present(u'Kesyon Div\u00e8s Moun Poze Tout Tan') |
<|file_name|>model.py<|end_file_name|><|fim▁begin|>import logging
from .data import DefinedTable
logger = logging.getLogger(__name__)
def ensure_tables():
"""When called, ensure that all the tables that we need are created in the
database. The real work is supplied by the DefinedTable base class
"""
... | """A single experimental condition that any number of subjects may be a part of
""" |
<|file_name|>str.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use app_units::Au;
use cssparser::{self, Color, RGBA};
use js::co... | if let Ok(Color::RGBA(rgba)) = cssparser::parse_color_keyword(input) { |
<|file_name|>ConversationSkinDirective.js<|end_file_name|><|fim▁begin|>// Copyright 2014 The Oppia Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// ... | |
<|file_name|>cli.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import logging
import argparse
from .imdb import find_movies
logger = logging.getLogger('mrot')
def parse_args():
parser = argparse.ArgumentParser(prog='mrot', description='Show movie ratings over time.',
... | |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>var chownr = require('chownr')
var tar = require('tar-stream')
var pump = require('pump')
var mkdirp = require('mkdirp')
var fs = require('fs')
var path = require('path')
var os = require('os')
var win32 = os.platform() === 'win32'
var noop = function () {}
var echo... | }
var head = function (list) {
return list.length ? list[list.length - 1] : null |
<|file_name|>Json.js<|end_file_name|><|fim▁begin|>/**
* Copyright 2012 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://www.apache.org/l... | } else if(cIdx > -1) {
idx = cIdx;
} else if(aIdx > -1) { |
<|file_name|>ProductDirective.java<|end_file_name|><|fim▁begin|><|fim▁hole|>/**
* Copyright (c) 2016-2020, Michael Yang 杨福海 (fuhai999@gmail.com).
* <p>
* Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
* you may not use this file except in compliance with the License.
* Yo... | |
<|file_name|>gulpfile.js<|end_file_name|><|fim▁begin|>'use strict';
<|fim▁hole|><|fim▁end|> |
require('require-dir')('./tasks'); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.