prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>celeryconfig.py<|end_file_name|><|fim▁begin|># List of modules to import when celery starts.
# CELERY_IMPORTS = ('libcloud_sandbox.tasks.code_execute', )
# Result store settings.
CELERY_RESULT_BACKEND = 'database'
CELERY_RESULT_DBURI = 'sqlite:///mydatabase.db'
# Broker settings.
BROKER_TRANSPORT = 'sqla... | |
<|file_name|>article.rs<|end_file_name|><|fim▁begin|>use std::collections::HashMap;
use iron::prelude::*;
use base::framework::{ResponseData, temp_response,
json_error_response, json_ok_response,<|fim▁hole|>use base::db::MyPool;
use form_checker::{Validator, Checker, Rule, Str, I64};
use base::fra... | not_found_response};
use urlencoded::UrlEncodedBody; |
<|file_name|>AmazonImageSelectInput.spec.tsx<|end_file_name|><|fim▁begin|>import React from 'react';
import { mockHttpClient } from 'core/api/mock/jasmine';
import { mock } from 'angular';
import { ShallowWrapper, ReactWrapper, shallow, mount } from 'enzyme';
import { IAmazonImage } from 'amazon/image';
import { Appli... | };
|
<|file_name|>Minesweeper.py<|end_file_name|><|fim▁begin|># public class Solution {
# public char[][] updateBoard(char[][] board, int[] click) {
# int m = board.length, n = board[0].length;
# int row = click[0], col = click[1];
#
# if (board[row][col] == 'M') { // Mine
# board[row... | |
<|file_name|>card.js<|end_file_name|><|fim▁begin|>/**
* @license Copyright (c) 2013, Viet Trinh All Rights Reserved.
* Available via MIT license.
*/
/**
* A card entity.
*/
define([ 'framework/entity/base_entity' ],
function(BaseEntity)
{
/**
* Constructor.
* @param rawObject (optional)
* The raw object ... | BaseEntity.generateProperties(Card);
// The card rarities.
Card.RARITY = {}; |
<|file_name|>GuiDimletScrambler.java<|end_file_name|><|fim▁begin|>package mcjty.rftools.blocks.dimlets;
import mcjty.lib.container.GenericGuiContainer;
import mcjty.lib.gui.Window;
import mcjty.lib.gui.layout.PositionalLayout;
import mcjty.lib.gui.widgets.EnergyBar;
import mcjty.lib.gui.widgets.ImageLabel;
import mcjt... | tileEntity.requestScramblingFromServer();
}
} |
<|file_name|>static_analysis.py<|end_file_name|><|fim▁begin|># Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://w... | return True
|
<|file_name|>config.rs<|end_file_name|><|fim▁begin|>//! Utilities for managing the configuration of the website.
//!
//! The configuration should contain values that I expect to change. This way, I can edit them all
//! in a single human-readable file instead of having to track down the values in the code.
use std::fs... | {
let config = serde_yaml::from_reader(reader)?; |
<|file_name|>bluetoothconfigview.py<|end_file_name|><|fim▁begin|>import kivy
kivy.require('1.9.1')
from kivy.app import Builder
from kivy.uix.gridlayout import GridLayout
from kivy.properties import ObjectProperty
from kivy.logger import Logger
from settingsview import SettingsView, SettingsSwitch, SettingsButton
from ... | |
<|file_name|>irods_auth_object.cpp<|end_file_name|><|fim▁begin|>/* -*- mode: c++; fill-column: 132; c-basic-offset: 4; indent-tabs-mode: nil -*- */
#include "irods_auth_object.hpp"
namespace irods {
auth_object::auth_object(
rError_t* _r_error ) : r_error_( _r_error ) {
// TODO - stub
}
... | context_ = _rhs.context();
return *this; |
<|file_name|>2016-12-16 tryout2.py<|end_file_name|><|fim▁begin|>"""
This script investigates how calculating phasic currents from voltage clamp
recordings may benefit from subtracting-out the "noise" determined from a
subset of the quietest pieces of the recording, rather than using smoothing
or curve fitting to guess... | histValidIs=np.where(~np.isnan(hist))
histX,histY=bins[:-1][histValidIs],hist[histValidIs] # remove nans |
<|file_name|>actix_state.rs<|end_file_name|><|fim▁begin|>use super::repo_actor;<|fim▁hole|>pub struct State {
pub db: Addr<repo_actor::DbExecutor>,
}<|fim▁end|> | use ::actix::prelude::*;
|
<|file_name|>passphrases.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from flask import Blueprint<|fim▁hole|>
@route(bp, '/')
def get():
p = Passphrase.get_random()
return {"results": p}<|fim▁end|> | from jotonce.api import route
from jotonce.passphrases.models import Passphrase
bp = Blueprint('passphrase', __name__, url_prefix='/passphrase') |
<|file_name|>test_object.go<|end_file_name|><|fim▁begin|>package model
type TypeA struct {
Int int
String string
}
type TypeB struct {
Int int
String string
}
type TypeC struct {
Field1 int
Field2 int
}
type TypeD struct {
Field int
}
type TypeE struct {
Field *int<|fim▁hole|><|fim▁end|> | } |
<|file_name|>weight_drop.py<|end_file_name|><|fim▁begin|># Taken from https://github.com/salesforce/awd-lstm-lm/blob/master/weight_drop.py
import torch
from torch.nn import Parameter
from functools import wraps
class WeightDrop(torch.nn.Module):
def __init__(self, module, weights, dropout=0, variational=False):
... |
def _dummy(*args, **kwargs):
# We need to replace flatten_parameters with a nothing function |
<|file_name|>issue-62046.rs<|end_file_name|><|fim▁begin|>// build-fail
// ignore-emscripten no asm! support
<|fim▁hole|>fn main() {
unsafe {
llvm_asm!("nop" : "+r"("r15"));
//~^ malformed inline assembly
}
}<|fim▁end|> | #![feature(llvm_asm)]
#![allow(deprecated)] // llvm_asm!
|
<|file_name|>loopbce.go<|end_file_name|><|fim▁begin|>package ssa
type indVar struct {
ind *Value // induction variable
inc *Value // increment, a constant
nxt *Value // ind+inc variable
min *Value // minimum value. inclusive,
max *Value // maximum value. exclusive.
entry *Block // entry block in the lo... | // ind = (Phi min nxt), |
<|file_name|>test_audioop.py<|end_file_name|><|fim▁begin|>import audioop
import sys
import unittest
def pack(width, data):
return b''.join(v.to_bytes(width, sys.byteorder, signed=True) for v in data)
def unpack(width, data):
return [int.from_bytes(data[i: i + width], sys.byteorder, signed=True)
fo... | self.assertEqual(audioop.cross(p(minvalues[w], maxvalues[w]), w), 1)
|
<|file_name|>responsive-scripts.js<|end_file_name|><|fim▁begin|>/*! Responsive JS Library v1.2.2 */
/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license */
/*! NOTE: If you're already including a window.matchMedia poly... | xmlhttpmethod = new ActiveXObject( "Microsoft.XMLHTTP" ); |
<|file_name|>app.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# (c) 2015 Andreas Motl, Elmyra UG <andreas.motl@elmyra.de>
from kotori.version import __VERSION__
from pyramid.config import Configurator
def main(global_config, **settings):
"""This function returns a Pyramid WSGI application."""
sett... | |
<|file_name|>af.js<|end_file_name|><|fim▁begin|>/*
Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
<|fim▁hole|>*/
CKEDITOR.plugins.setLang( 'newpage', 'af', {
toolbar: 'Nuwe bladsy'
} );<|fim▁end|> | |
<|file_name|>contain_substring_matcher.go<|end_file_name|><|fim▁begin|>package matchers
import (
"fmt"
"github.com/chai2010/gopkg/database/leveldb/internal/gomega/format"
"strings"
)
type ContainSubstringMatcher struct {
Substr string
Args []interface{}
}
func (matcher *ContainSubstringMatcher) Match(actual i... |
func (matcher *ContainSubstringMatcher) stringToMatch() string {
stringToMatch := matcher.Substr
if len(matcher.Args) > 0 { |
<|file_name|>base.py<|end_file_name|><|fim▁begin|>'''Base module to handle the collection and the output of statistical data.'''
import logging
import time
import multiprocessing as mp
import queue
from collections import Counter
log = logging.getLogger(__name__)
current_milli_time = lambda: int(round(time.time() * ... | |
<|file_name|>totaltime.go<|end_file_name|><|fim▁begin|>// totaltime shows the total play time of the video content rooted at current
// directory.
package main
import (
"errors"
"fmt"
"math"
"os"
"os/exec"
"path/filepath"
"strings"
"time"
)
var (
ignoreSuffixes = []string{
".srt",
}
videoSuffixes = []str... | } |
<|file_name|>angular.d.ts<|end_file_name|><|fim▁begin|>// Type definitions for Angular JS 1.3+
// Project: http://angularjs.org
// Definitions by: Diego Vilar <http://github.com/diegovilar>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts" />
declare var angula... | * {ignoreRequestError} is set to true).
*
* @param tpl The template URL. |
<|file_name|>test_inifile.py<|end_file_name|><|fim▁begin|>from textwrap import dedent
import inspect
from collections import OrderedDict
from clusterjob import JobScript
import pytest
import logging
try:
from ConfigParser import Error as ConfigParserError
except ImportError:
from configparser import Error as Co... | def test_read_invalid_attribute(caplog, tmpdir): |
<|file_name|>hp_roman8.py<|end_file_name|><|fim▁begin|>""" Python Character Mapping Codec generated from 'hp_roman8.txt' with gencodec.py.
Based on data from ftp://dkuug.dk/i18n/charmaps/HP-ROMAN8 (Keld Simonsen)
Original source: LaserJet IIP Printer User's Manual HP part no
33471-90901, Hewlet-Packard, J... | |
<|file_name|>rendermonitor.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
# Generic rendering function that can handle all simulations, but makes poor renders. Nice for sketching.
import os, time, subprocess, re
def Say(text, verbosity=0, end='\n', suppressTime=False):
if verbosity<=V... | |
<|file_name|>DropdownTimePicker.js<|end_file_name|><|fim▁begin|>dojo.provide("dojo.widget.DropdownTimePicker");
dojo.require("dojo.widget.*");
dojo.require("dojo.widget.DropdownContainer");
dojo.require("dojo.widget.TimePicker");
dojo.require("dojo.event.*");
dojo.require("dojo.html.*");
dojo.require("dojo.date.format... | setValue: function(/*Date|String*/rfcDate){ |
<|file_name|>ref.py<|end_file_name|><|fim▁begin|># encoding: utf-8
#
#
# 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/.
#
# Author: Kyle Lahnakoski (kyle@lahnakoski.com)
... | USE json.net CONVENTIONS TO LINK TO INLINE OTHER JSON
"""
if not _Log:
_late_import() |
<|file_name|>utils.go<|end_file_name|><|fim▁begin|>package rpc
import (
"errors"
log "github.com/Sirupsen/logrus"
"strconv"
"strings"
)
var (
ERRINVALIDLENGTH = errors.New("Invalid length of message field")
ERRINVALIDTOKEN = errors.New("Invalid authentication token")
)
func (s *Sender) Sign() ([]byte, error) ... |
body = append(body[:], []byte(p.Name)[:]...) |
<|file_name|>connector.py<|end_file_name|><|fim▁begin|># Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Vers... | |
<|file_name|>errorRibbonPlotMulti.py<|end_file_name|><|fim▁begin|>import sys
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.backends.backend_pdf import PdfPages
sys.path.append('../../')
from util import readCSVToMatrix
file_path = sys.argv[1]
file = open(file_path)
def plotErrorRibbon(x, mu, std... | plotErrorRibbon(data[:,0], data[:,3], data[:,7], 'distance', pp) |
<|file_name|>actions.py<|end_file_name|><|fim▁begin|>import datetime
import hashlib
import itertools
import logging
import os
import time
from collections import defaultdict
from dataclasses import asdict, dataclass, field
from operator import itemgetter
from typing import (
IO,
AbstractSet,
Any,
Callab... | assert message.rendered_content is None |
<|file_name|>experimental_lambdify.py<|end_file_name|><|fim▁begin|>""" rewrite of lambdify - This stuff is not stable at all.
It is for internal use in the new plotting module.
It may (will! see the Q'n'A in the source) be rewritten.
It's completely self contained. Especially it does not use lambdarepr.
It does not ... | return dict_fun |
<|file_name|>storage_transfer_client.go<|end_file_name|><|fim▁begin|>// Copyright 2022 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... | return err |
<|file_name|>uninstall.ts<|end_file_name|><|fim▁begin|>import { ConfigManager } from './configuration/configManager';<|fim▁hole|>
void ConfigManager.removeSettings();<|fim▁end|> | |
<|file_name|>parse_number_test.cpp<|end_file_name|><|fim▁begin|>/* Copyright 2014 MongoDB Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/l... | ASSERT_EQUALS(ErrorCodes::FailedToParse, parseNumberFromStringWithBase("0X", 10, &x));
ASSERT_EQUALS(ErrorCodes::FailedToParse, parseNumberFromStringWithBase("+0X", 16, &x));
ASSERT_EQUALS(ErrorCodes::FailedToParse, parseNumberFromStringWithBase("+0x", 16, &x));
ASSERT_EQ... |
<|file_name|>csr_firewall_svc_helper.py<|end_file_name|><|fim▁begin|># Copyright 2014 Cisco Systems, 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
#
# ... | @log_helpers.log_method_call
def get_tenants_with_firewalls(self, context, **kwargs):
"""Get Tenants that have Firewalls configured from plugin.""" |
<|file_name|>RuleAnythingUntil.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2009-2013 by The Regents of the University of California
* 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 from
*... | |
<|file_name|>form.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
#<|fim▁hole|>#
# Unless required by applicable law or agreed to in writing, software
# distribu... | # http://www.apache.org/licenses/LICENSE-2.0 |
<|file_name|>update_ingest.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at h... |
ingested = ingest_item(item, provider, feeding_service, rule_set, routing_scheme) |
<|file_name|>simd-intrinsic-generic-scatter.rs<|end_file_name|><|fim▁begin|>// Copyright 2016 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:/... |
#[repr(simd)] |
<|file_name|>index.d.ts<|end_file_name|><|fim▁begin|>import { Message, MessagePayload } from '../main'
import { ObservableWithInitialValue, Observable } from '../observable'
export interface RegisterMessages<S> {
/**
* Registers an Observable and call the handler function every time the observable has a new valu... | */
send<P>(payload: MessagePayload<P>): void
} |
<|file_name|>grafana_dashboard.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2017, Thierry Sallé (@tsalle)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
ANSIBLE_MET... | validate_certs=dict(type='bool', default=True)
),
supports_check_mode=False,
required_together=[['grafana_user', 'grafana_password', 'org_id']], |
<|file_name|>15.2.3.3-4-230.js<|end_file_name|><|fim▁begin|>/// Copyright (c) 2012 Ecma International. All rights reserved.
/**
* @path ch15/15.2/15.2.3/15.2.3.3/15.2.3.3-4-230.js
* @description Object.getOwnPropertyDescriptor - ensure that 'writable' property of returned object is data property with correct 'confi... | |
<|file_name|>opcodes.py<|end_file_name|><|fim▁begin|>#
#
# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Google Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the... | |
<|file_name|>256-header_op-add2.py<|end_file_name|><|fim▁begin|>from base import *
DIR = "headerop_add2"
HEADERS = [("X-What-Rocks", "Cherokee does"),
("X-What-Sucks", "Failed QA tests"),
("X-What-Is-It", "A successful test")]
CONF = """
vserver!1!rule!2560!match = directory
vserver!1!rule!2560... | |
<|file_name|>system.py<|end_file_name|><|fim▁begin|># Copyright [2015] Hewlett-Packard Development Company, L.P.
# 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/licens... | STATUS_DB_DOWN = "/opt/vertica/bin/adminTools -t db_status -s DOWN"
SET_RESTART_POLICY = ("/opt/vertica/bin/adminTools -t set_restart_policy " |
<|file_name|>parse-data.js<|end_file_name|><|fim▁begin|>'use strict';
var _ = require( 'lodash' );
/* RESPONSE DATA STRUCTURE
==========================================================================
data = [ ..., { // Day Object
stop_id: '2681',
stop_name: 'Highland Ave @ Benton Rd... | sch_arr_dt: '1434278820',
sch_dep_dt: '1434278820',
trip_id: '26616679', |
<|file_name|>recurring-list.ts<|end_file_name|><|fim▁begin|>import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
@Component({
templateUrl: 'recurring-list.html'
})<|fim▁hole|> submitted = false;
constructor(
public nav: NavController) {}
add() {
}
}<|fim... |
export class RecurringListPage {
login: {username?: string, password?: string} = {}; |
<|file_name|>htmlparagraphelement.rs<|end_file_name|><|fim▁begin|><|fim▁hole|> * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::Bindings::HTMLParagraphElementBinding;
use dom::bindings::js::Root;
use dom::bindings::str::DOMString;
use dom::document::Document;
use dom::htmleleme... | /* 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_name|>azure_storageaccountclient.go<|end_file_name|><|fim▁begin|>// +build !providerless
/*
Copyright 2020 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:/... | }
// listStorageAccountKeys get a list of storage account keys. |
<|file_name|>TAGSORT.C<|end_file_name|><|fim▁begin|>/*
#Identification: TAGSORT.FOR
#Revision: B003
#Task: Sort for PALL
#First issue: 901019
#Author: POLA Ivan Polak
#Changes: %datum: %autor:
#===============================================================*/
#include <stdio.h>
int TagSort(unsigned long... |
#parameters:
|
<|file_name|>test_guest_event_page.py<|end_file_name|><|fim▁begin|>import unittest
from datetime import datetime
from flask import url_for
from app import current_app as app
from app.helpers.data import save_to_db
from app.models.call_for_papers import CallForPaper
from tests.unittests.object_mother import ObjectMoth... | save_to_db(session, "Session Saved")
rv = self.app.get(url_for('event_detail.display_event_schedule', identifier=event.identifier),
follow_redirects=True)
self.assertEqual(rv.status_code, 404) |
<|file_name|>Conditional.tsx<|end_file_name|><|fim▁begin|>import React from "react"
type Props = {<|fim▁hole|>}
export const Conditional = ({ condition, children, wrap }: Props) =>
condition ? React.cloneElement(wrap(children)) : children<|fim▁end|> | condition: boolean
children: React.ReactElement
wrap: (children: React.ReactNode) => JSX.Element |
<|file_name|>mirrors.py<|end_file_name|><|fim▁begin|>##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, t... | #
# For details, see https://github.com/llnl/spack |
<|file_name|>predict_sample.py<|end_file_name|><|fim▁begin|># Copyright (c) 2016 Baidu, 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/... | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
<|file_name|>validators.js<|end_file_name|><|fim▁begin|>define([
'lib/validators/moment',
'lib/validators/unequalTo'<|fim▁hole|><|fim▁end|> | ], function () {
}); |
<|file_name|>messagearchivesimple.py<|end_file_name|><|fim▁begin|>#/u/Goldensights
import praw
import time
import datetime
'''USER CONFIG'''
USERNAME = ""
#This is the bot's Username. In order to send mail, he must have some amount of Karma.
PASSWORD = ""
#This is the bot's Password.
USERAGENT = ""
#This is a sho... | |
<|file_name|>fix_provincie_autonome.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from django.core.management.base import BaseCommand
from ...territori.models import Territorio
class Command(BaseCommand):
help = 'Fix for provincie autonome'
def handle(self, *args, **options):
Territorio.ob... |
for name in ['BOLZANO', 'TRENTO']:
territorio = Territorio.objects.provincie().get(denominazione__istartswith=name) |
<|file_name|>testpatch.py<|end_file_name|><|fim▁begin|># Copyright (C) 2007-2012 Michael Foord & the mock team
# E-mail: fuzzyman AT voidspace DOT org DOT uk
# http://www.voidspace.org.uk/python/mock/
import os
import sys
import unittest
from unittest.test.testmock import support
from unittest.test.testmock.support i... | "patch not restored")
|
<|file_name|>0006_auto_20190926_1218.py<|end_file_name|><|fim▁begin|># Generated by Django 2.2.5 on 2019-09-26 12:18
from django.db import migrations, models
import weblate.utils.backup
class Migration(migrations.Migration):
dependencies = [("wladmin", "0005_auto_20190926_1332")]
operations = [
mi... | ),
),
migrations.AlterField(
model_name="backupservice", |
<|file_name|>test_variables.rs<|end_file_name|><|fim▁begin|>use crate::ast::rules;
use super::utils::{interpret_rule, interpret_rule_env};
#[test]
fn test_variable_simple() {
let (_val, env) = interpret_rule("x = 3", rules::stat);
assert_eq!(env, r#"{"x": RefCell { value: Number(3.0) }}"#);
let (_val, en... | let (_val, mut env) = interpret_rule("x = {y = 5}", rules::stat);
|
<|file_name|>harness.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
import os
from rapidsms.router import Router
from rapidsms.backends.backend import Backend
from rapidsms.app import App
# a really dumb Logger stand-in
class MockLogger (list):
def __init__(self):
# enable ... |
class EchoApp (MockApp):
def handle (self, message):
MockApp.handle(self, message) |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>from .models import *
from django.contrib import admin
from django.db import models
from website.base.form import TinyMCEAdminMixin
from django.utils.translation import ugettext_lazy as _
from mediastore.admin import ModelAdmin
class SessionAdmin(TinyMCEAdminMixin, M... | ) |
<|file_name|>udp.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.org/licenses/LI... | pub fn recv_from(&mut self, buf: &mut [u8]) -> IoResult<(uint, SocketAddr)> {
self.inner.recv_from(buf)
}
|
<|file_name|>nn.py<|end_file_name|><|fim▁begin|>"""Neural network operations."""
from __future__ import absolute_import as _abs
from . import _make
def conv2d(data,
weight,
strides=(1, 1),
padding=(0, 0),
dilation=(1, 1),
groups=1,
channels=None,
... | out_dtype : str, optional
Specifies the output data type for mixed precision conv2d.
Returns |
<|file_name|>nxtWin5Control1.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Copyright (c) 2014 l8orre
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, including w... | |
<|file_name|>parser.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import common
import sys, os, traceback
import time
import random
import re
import urllib
import string
from string import lower
from entities.CList import CList
from entities.CItemInfo import CItemInfo
from entities.CListItem import CListItem... | info_tmp.src = value
elif tmpkey == '': |
<|file_name|>grin.rs<|end_file_name|><|fim▁begin|>// Copyright 2021 The Grin Developers
//<|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 distributed ... | // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. |
<|file_name|>IndexFactory.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2009-2015 Tilmann Zaeschke. All rights reserved.
*
* This file is part of ZooDB.
*
* ZooDB 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... | * @param type
* @param storage |
<|file_name|>control-flow.rs<|end_file_name|><|fim▁begin|>// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/li... |
} |
<|file_name|>currency.js<|end_file_name|><|fim▁begin|>dojo.provide("tests.currency");
dojo.require("dojo.currency");
tests.register("tests.currency",
[
{
// Test formatting and parsing of currencies in various locales pre-built in dojo.cldr
// NOTE: we can't set djConfig.extraLocale before bootstrapping uni... | |
<|file_name|>a744.js<|end_file_name|><|fim▁begin|>//~ name a744
alert(a744);<|fim▁hole|><|fim▁end|> |
//~ component a745.js |
<|file_name|>org.w3c.dom.DOMConfiguration.d.ts<|end_file_name|><|fim▁begin|>declare namespace org {
namespace w3c {
namespace dom {
interface DOMConfiguration {
setParameter(arg0: java.lang.String | string, arg1: java.lang.Object | any): void
getParameter(arg0: java.lang.String | string): j... | } |
<|file_name|>authenticate.js<|end_file_name|><|fim▁begin|>/**<|fim▁hole|> * This method start authentication workflow.
* It should be called by application which require authentication.
*
* Author: Yuriy Movchan Date: 11/06/2013
*/
var uuid = require('uuid');
var async = require('async');
var oxutil = require('../... | |
<|file_name|>fixer_util.py<|end_file_name|><|fim▁begin|>"""
Utility functions from 2to3, 3to2 and python-modernize (and some home-grown
ones).
Licences:
2to3: PSF License v2
3to2: Apache Software License (from 3to2/setup.py)
python-modernize licence: BSD (from python-modernize/LICENSE)
"""
from lib2to3.fixer_util imp... | |
<|file_name|>widgets.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# progressbar - Text progress bar library for Python.
# Copyright (c) 2005 Nilton Volpato
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# Lic... | |
<|file_name|>test_codecs.py<|end_file_name|><|fim▁begin|>from test import support
import unittest
import codecs
import locale
import sys, _testcapi, io
class Queue(object):
"""
queue: write bytes at one end, read bytes from the other end
"""
def __init__(self, buffer):
self._buffer = buffer
... | def test_unicode_escape(self):
# Escape-decoding an unicode string is supported ang gives the same
# result as decoding the equivalent ASCII bytes string. |
<|file_name|>server.py<|end_file_name|><|fim▁begin|>"""
The server module is responsible for managng the threaded UDP socket server.
This server is used to communicate with Matlab/Simulink simulations. It will be renamed appropriately soon
@todo: rename this module to indicate it's role in any Matlab connections
"""
... | def _run(self):
self.is_running = False
self.start()
self.function(*self.args, **self.kwargs) |
<|file_name|>pogoInput.py<|end_file_name|><|fim▁begin|>import numpy as np
import warnings
import subprocess
import pogoFunctions as pF
import pdb
from PolyInterface import poly
class PogoInput:
def __init__(self,
fileName,
elementTypes,
signals,
hi... | |
<|file_name|>bcc_common.cc<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2015 PLUMgrid, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENS... | void bpf_module_destroy(void *program) {
auto mod = static_cast<ebpf::BPFModule *>(program);
if (!mod) return; |
<|file_name|>sale.ts<|end_file_name|><|fim▁begin|>/**
* Created by cghislai on 01/09/15.
*/
import {LocalAccountingTransaction} from './accountingTransaction';
import {LocalCompany} from './company';
import {LocalCustomer} from './customer';
import {InvoiceRef} from '../domain/invoice';
import {AccountingTransactio... | discountAmount: null
});
|
<|file_name|>test.rs<|end_file_name|><|fim▁begin|>#[macro_use]<|fim▁hole|>use std::collections::HashMap;
#[test]
fn it_returns_a_hashmap() {
let map: HashMap<_, u32> = hashmap! {
key: 2u32,
key2: 33u32
};
let mut tmp_map: HashMap<_, u32> = HashMap::new();
tmp_map.insert("key", 2u32);
tmp_map.insert("key2", ... | extern crate hashmacro; |
<|file_name|>dataSource.js<|end_file_name|><|fim▁begin|>define(["require", "exports", "./selection", "./collection", "./utils/arrayUtils"], function (require, exports, selection_1, collection_1, arrayUtils_1) {
Object.defineProperty(exports, "__esModule", { value: true });
var DataSource = (function () {
... | this.groupHeight = config.groupHeight || 25; |
<|file_name|>OculusRift.py<|end_file_name|><|fim▁begin|># start the service<|fim▁hole|>oculusrift = Runtime.start("oculusrift","OculusRift")<|fim▁end|> | |
<|file_name|>weave-ping.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
#
# Copyright (c) 2015-2017 Nest Labs, 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 cop... | print(WeavePing.WeavePing.__doc__)
sys.exit(0)
|
<|file_name|>organizations.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
u"""
.. module:: organizations
"""
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse
from django.shortcuts import get_object_or_404
from django.sh... | |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db.models import Transform
from django.db.models import DateTimeField, TimeField
from django.utils.functional import cached_property
class TimeValue(Transform):
lookup_name = 'time'
function = 'time'
def as_sql(self, compiler, connection):<|... | lhs, params = compiler.compile(self.lhs)
return 'TIME({})'.format(lhs), params
|
<|file_name|>campaign_manager.py<|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 ... | |
<|file_name|>FonttblDestinations.ts<|end_file_name|><|fim▁begin|>/*
The MIT License (MIT)
Copyright (c) 2015 Thomas Bluemel
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, i... | case 0:
this.pitch = Helper.FONTPITCH.DEFAULT;
break;
case 1: |
<|file_name|>element.rs<|end_file_name|><|fim▁begin|>//! Improvements to `xmltree::Element`.
use {Error, Result};
use std::str::FromStr;
use xmltree::Element;
/// An extension to the xmltree element to make it more ergonomic.
pub trait Extension {
/// Returns a child element by slash-seperated names, or an error ... | /// # Examples
///
/// `Extension` is implemented for `xmltree::Element`: |
<|file_name|>drawing_tester.py<|end_file_name|><|fim▁begin|>import contextlib
import os
import shutil
import tempfile
import numpy
from PIL import Image
from kiva.fonttools import Font
from kiva.constants import MODERN
class DrawingTester(object):
""" Basic drawing tests for graphics contexts.
"""
def... | with self.draw_and_check():
self.gc.begin_path()
self.gc.move_to(100, 100)
self.gc.line_to(150, 200) |
<|file_name|>condition.js<|end_file_name|><|fim▁begin|>"use strict";
var cases = module.exports = [];
cases[0] = {};
cases[0].resources = [{
"resource": {
"id": "Condition/c-0-0",
"resourceType": "Condition",
"status": "confirmed",
"onsetDateTime": "2012-08-05",
"dateAsser... | "resource": {
"id": "Condition/c-2-0",
"resourceType": "Condition", |
<|file_name|>utils.js<|end_file_name|><|fim▁begin|>import { isObject, isFunction, keys } from 'lodash';
// Removes all functions in an object so you can test
// against objects without errors
export const withoutFunctions = (obj) => {
if (!isObject(obj)) {
return obj;
}
let temp = {}
const _keys = keys(obj)... | } else if (isFunction(obj[k])) {
temp[k] = null;
} else { |
<|file_name|>int.rs<|end_file_name|><|fim▁begin|>use arch::int;
pub fn mask_interrupt(i: u32, mask: bool) {
int::mask_interrupt(i, mask);
}
pub fn set_int(i: u32, idt_idx: u32) {
int::set_int(i, idt_idx);
}
pub fn fire_timer() {
int::fire_timer();
}
pub fn enable_interrupts() {
int::enable_interrupt... |
pub fn interrupt_handler(int_id: u32, error_code: u32, retaddr: usize) { |
<|file_name|>recognize.spec.ts<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {Routes} from '../src/config';
import {recognize}... | ],
'a/(b//left:c)', (s: RouterStateSnapshot) => {
const c = s.children(<any>s.firstChild(s.root));
checkActivatedRoute(c[0], 'b', {}, ComponentB, PRIMARY_OUTLET); |
<|file_name|>issue-17718-static-sync.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.ap... | // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your |
<|file_name|>triqs_cthyb_qmc.cpp<|end_file_name|><|fim▁begin|>#if defined HAVE_CONFIG_H
#include "config.h"
#endif
#include <solver_core.hpp>
#include <triqs/operators/many_body_operator.hpp>
#include <triqs/hilbert_space/fundamental_operator_set.hpp>
#include <triqs/gfs.hpp>
#include <stdlib.h>
#include <stdio.h>
#in... |
auto iw = w_mesh.index_to_point(w_index);
auto cell = delta_iw[w_index]; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.