prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>extglyde.js<|end_file_name|><|fim▁begin|>// extglyde
//
// Glyde Glue Plugin
// (c)2015 by Cylexia, All Rights Reserved
//
// Version: 1.15.0625
//
// MIT License
var ExtGlyde = {
GLUE_STOP_ACTION: -200,
plane: null, // Canvas
resources: null,
styles: null,
buttons: null,
keys: null... |
/** |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from cms.utils.urlutils import admin_reverse
from django.core.urlresolvers import reverse
from cms.utils import get_language_from_request
from cms.utils.compat.dj import python_2_unicode_compatible
from django.db import models
from cms.models.fields import Placeholder... | def __init__(self, *args, **kwargs):
super(Example1, self).__init__(*args, **kwargs)
def callable_item(self, request): |
<|file_name|>scanner.rs<|end_file_name|><|fim▁begin|>// The MIT License (MIT)
//
// Copyright (c) 2017 Doublify Technologies
//
// 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 rest... | Token::new(Kind::Identifier, "stable")]; |
<|file_name|>blueprint_templates.py<|end_file_name|><|fim▁begin|>from flask_restful import marshal_with, reqparse
from flask import abort, g
from flask import Blueprint as FlaskBlueprint
from flask_restful import fields
from sqlalchemy.orm.session import make_transient
import logging
import uuid
from pebbles.models i... | "placeholder": "Blueprint details"
}
] + blueprint_form
|
<|file_name|>AbstractCommunicator.java<|end_file_name|><|fim▁begin|>/*
* An Abstract communicator interface which implements listeners.
*/
/*
Copywrite 2013 Will Winder
This file is part of Universal Gcode Sender (UGS).
UGS is free software: you can redistribute it and/or modify
it under the terms ... | this.commRawResponseListener = new ArrayList<SerialCommunicatorListener>();
//instanciate all known connection drivers
//TODO: Scan the classpath for classes extending Connection, |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>var i18n = require('i18n');
var _ = require('lodash');
exports.register = function (plugin, options, next) {
i18n.configure(options);
plugin.ext('onPreResponse', function (request, extNext) {
// If is an error message
if(request.response.isBoom) {
... | return extNext(request.response); |
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|>"""<|fim▁hole|>
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "fitch.sett... | WSGI config for fitch project. |
<|file_name|>log.py<|end_file_name|><|fim▁begin|><|fim▁hole|>import time
import logging
def time_zone(t):
if t.tm_isdst == 1 and time.daylight == 1:
tz_sec = time.altzone
tz_name = time.tzname[1]
else:
tz_sec = time.timezone
tz_name = time.tzname[0]
if tz_sec > 0:
t... | |
<|file_name|>test_rail.py<|end_file_name|><|fim▁begin|>import sys
import traceback
import unittest
import unittest.mock
import rail
class TestIdentity(unittest.TestCase):
def test_returns_input_value(self):
value = unittest.mock.Mock()
self.assertEqual(value, rail.identity(value))
class TestNot... | self.assertEqual(value, context.exception.value) |
<|file_name|>scrabble_score_test.py<|end_file_name|><|fim▁begin|>import unittest
from scrabble import score
class WordTest(unittest.TestCase):
def test_invalid_word_scores_zero(self):
self.assertEqual(0, score(''))
self.assertEqual(0, score(' \t\n'))
self.assertEqual(0, score('hous3'))
... | unittest.main() |
<|file_name|>changepassword.js<|end_file_name|><|fim▁begin|>$(document).ready(function() {
$("#frmChangePass").submit(function() {
//get the url for the form
AJAX.post(<|fim▁hole|> _password : $("#newPass").val(),
_password_confirm : $("#newPass2").val()
},
$("#msgbox_changepass"),
$("#btnChangep... | $("#frmChangePass").attr("action"),
{
_password_current : $("#currentPass").val(), |
<|file_name|>BlockGrid.js<|end_file_name|><|fim▁begin|>import React from 'react';
import $ from 'jquery';
import _ from 'lodash';
import Block from './Block';
export default class BlockGrid extends React.Component {
constructor() {
super();
this.setDefaults();
this.setContainerWidth = this.setContainerWidth.... | |
<|file_name|>vimawesome.rs<|end_file_name|><|fim▁begin|>use std::io;
use std::process::{Command, Stdio};
use std::rc::Rc;
use std::thread;
use serde_json;
use glib;
use gtk;
use gtk::prelude::*;
use super::store::PlugInfo;
pub fn call<F>(query: Option<String>, cb: F)
where
F: FnOnce(io::Result<DescriptionList>)... | }
}
#[derive(Deserialize, Debug, Clone)] |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import React, { useState, useRef } from 'react';
import { computeOutOffsetByIndex, computeInOffsetByIndex } from './lib/Util';
// import { SVGComponent } from './lib-hooks/svgComp-hooks';
import Spline from './lib/Spline';
import DragNode from './lib/Node';
const inde... | onCompleteConnector={(nid, inputIdx) => handleCompleteConnector(nid, inputIdx)}
onNodeSelect={nid => handleNodeSelect(nid)} |
<|file_name|>pair_lj_sdk_coul_msm.cpp<|end_file_name|><|fim▁begin|>/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright... | if (EFLAG) |
<|file_name|>__main__.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python<|fim▁hole|>import argparse
from . import core
from . import gui
def main():
parser = argparse.ArgumentParser(
description="Track opponent's mulligan in the game of Hearthstone.")
parser.add_argument('--gui', action='store_tru... | |
<|file_name|>wipe.js<|end_file_name|><|fim▁begin|>var helpers = require('./../../../helpers'),
path = require('path'),
os = require('os'),
should = require('should'),
sinon = require('sinon'),
lib_path = helpers.lib_path(),
join = req... | before(() => { |
<|file_name|>tradchinese.rs<|end_file_name|><|fim▁begin|>// This is a part of rust-encoding.
// Copyright (c) 2013-2015, Kang Seonghoon.
// See README.md and LICENSE.txt for details.
//! Legacy traditional Chinese encodings.
use std::convert::Into;
use std::default::Default;
use util::StrCharIndex;
use index_tradchin... | for ((i,j), ch) in input.index_iter() {
if ch < '\u{80}' {
output.write_byte(ch as u8);
} else { |
<|file_name|>filepond.js<|end_file_name|><|fim▁begin|>/*!
* FilePond 4.26.0
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit https://pqina.nl/filepond/ for details.
*/
/* eslint-disable */
(function(global, factory) {
typeof exports === 'object' && typeof module !== 'undefined'
... | return items.filter(function(item) { |
<|file_name|>cdn.js<|end_file_name|><|fim▁begin|>module.exports = cdn
var MaxCDN = require('maxcdn')
function cdn (self) {<|fim▁hole|> self.settings.maxcdn.consumerKey,
self.settings.maxcdn.consumerSecret
)
maxcdn.del('zones/pull.json/' + self.settings.maxcdn.zoneId + '/cache', function (err, res) {
... | if (self.settings.maxcdn.zoneId) {
var maxcdn = new MaxCDN(
self.settings.maxcdn.companyAlias, |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>#[cfg(target_os = "windows")]
#[path = "schannel.rs"]
mod imp;
#[cfg(not(any(target_os = "windows", target_os = "macos", target_os = "ios")))]
#[path = "openssl.rs"]
mod imp;
#[cfg(not(any(target_os = "windows", target_os = "macos", target_os = "ios")))]
pub use self::im... | #[allow(dead_code)]
pub fn build_tls_from_pfx(pfx_path: &str) -> TlsAcceptor {
let mut pfx_file = File::open(pfx_path).unwrap(); |
<|file_name|>lib.js<|end_file_name|><|fim▁begin|>/******/ (function(modules) { // webpackBootstrap
/******/ // install a JSONP callback for chunk loading
/******/ var parentJsonpFunction = window["webpackJsonp"];
/******/ window["webpackJsonp"] = function webpackJsonpCallback(chunkIds, moreModules) {
/******/ // a... | bubbled: keyOf({ onTimeUpdate: true }), |
<|file_name|>structfile.py<|end_file_name|><|fim▁begin|>"""A way to read and write structs to a binary file, with fast access
Licensed under the 3-clause BSD License:
Copyright (c) 2011-2014, Neeraj Kumar (neerajkumar.org)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modifi... | Negative indices work as well.
Raised IndexError on invalid index.
Raises IOError if the file doesn't have write permissions. |
<|file_name|>ICalendar.java<|end_file_name|><|fim▁begin|>package cgeo.calendar;
<|fim▁hole|>
static final String URI_SCHEME = "add";
static final String URI_HOST = "cgeo.org";
static final String PARAM_SHORT_DESC = "shortDesc"; // cache short description
static final String PARAM_HIDDEN_DATE = "hiddenD... | public interface ICalendar {
static final String CALENDAR_ADDON_URI = "market://details?id=cgeo.calendar";
static final String INTENT = "cgeo.calendar.RESERVE"; |
<|file_name|>types.spec.ts<|end_file_name|><|fim▁begin|>/*!
* Copyright(c) 2018-2021 Vasu Vanka
* MIT Licensed
*/
import {
GET,
PUT,
POST,
PATCH,
DELETE,
HttpMethod,
CREATED,
OK,
BADREQUEST,
INTERNALSERVERERROR,
IAppConfig,
} from "../src/types";
describe("Types", () => {
it("Get", () => {
expect(GET).... | });
it("Get not equal to any", () => { |
<|file_name|>ManifestDataNode.java<|end_file_name|><|fim▁begin|>package org.netbeans.modules.manifestsupport.dataobject;
import org.openide.loaders.DataNode;
import org.openide.nodes.Children;
public class ManifestDataNode extends DataNode {
private static final String IMAGE_ICON_BASE = "SET/PATH/TO/ICON/... | |
<|file_name|>error.go<|end_file_name|><|fim▁begin|>package render
import (
"github.com/gin-gonic/gin"
)
/* ================================================================================
* Render 工具模块<|fim▁hole|> * ================================================================================ */
/* ++++++++++++... | * qq group: 582452342
* email : 2091938785@qq.com
* author : 美丽的地球啊 - mliu |
<|file_name|>reconciler_controller_stub.go<|end_file_name|><|fim▁begin|>/*
Copyright 2020 The Knative 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/LIC... | "k8s.io/gengo/generator"
"k8s.io/gengo/namer"
"k8s.io/gengo/types"
"k8s.io/klog" |
<|file_name|>configurationResolver.ts<|end_file_name|><|fim▁begin|>/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information... | resolve(folder: IWorkspaceFolder | undefined, value: string): string;
resolve(folder: IWorkspaceFolder | undefined, value: string[]): string[]; |
<|file_name|>fib.py<|end_file_name|><|fim▁begin|>"""
The Fibonacci Sequence is the series of numbers:
0, 1, 1, 2, 3, 5, 8, 13, 21, 34, ...
The next number is found by adding up the two numbers before it.
The 2 is found by adding the two numbers before it (1+1)
Similarly, the 3 is found by adding the two numb... | |
<|file_name|>homepage.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
import frappe
from frappe.model.document import Document
from frappe.website.utils import delete_page_cache
class Homepage(Document):
def vali... |
doc = frappe.get_doc('Item', d.name) |
<|file_name|>util.rs<|end_file_name|><|fim▁begin|>use std::collections::HashMap;
use std::sync::mpsc::{self, Receiver};
use std::thread;
use failure::format_err;
use octobot_lib::errors::*;
fn escape_for_slack(str: &str) -> String {
str.replace("&", "&")
.replace("<", "<")
.replace(">", "&... | |
<|file_name|>attempted-access-non-fatal.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www... | let _ = x.bar; //~ ERROR attempted access of field
} |
<|file_name|>int.rs<|end_file_name|><|fim▁begin|>/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information<|fim▁hole|> * "License"); you may not use this file except in compliance
* with the ... | * regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the |
<|file_name|>script_utils.py<|end_file_name|><|fim▁begin|>import logging
import os
import subprocess
import traceback
from zipfile import ZipFile
from os import listdir
from os.path import isfile, join
'''
A utility python module containing a set of methods necessary for this kbase
module.
'''
LEVELS = {'debug': log... | |
<|file_name|>ad_group_ad_error.pb.go<|end_file_name|><|fim▁begin|>// Code generated by protoc-gen-go. DO NOT EDIT.
// source: google/ads/googleads/v1/errors/ad_group_ad_error.proto
package errors
import (
fmt "fmt"
math "math"
proto "github.com/golang/protobuf/proto"
_ "google.golang.org/genproto/googleapis/api/... | }
func (m *AdGroupAdErrorEnum) Reset() { *m = AdGroupAdErrorEnum{} } |
<|file_name|>message.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
"""
用户消息相关的视图
"""
from rest_framework import generics
from rest_framework.response import Response
from rest_framework.permissions import IsAuthenticated
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework.filters ... |
class MessageDetailView(generics.RetrieveDestroyAPIView):
""" |
<|file_name|>questdisplay.cpp<|end_file_name|><|fim▁begin|>#include "questdisplay.h"
#include "../core/global.h"
//QuestLister stuff
QuestLister::QuestLister(int xp, int yp, int wp, int hp) : BasicGUI(xp, yp, wp, hp) {
headerSize = 35;
//-1 due to the header
displayableQuestCount = h / headerSize - 1;
padding = ... | questsToDisplay.push_back(questToAdd); |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>export * from './AuthenticationService';
export * from './AuthenticationInitializer';
export * from './userMenu/UserMenu';<|fim▁end|> | |
<|file_name|>BsVendor$Dollar.java<|end_file_name|><|fim▁begin|>package org.docksidestage.oracle.dbflute.bsentity;
import java.util.List;
import java.util.ArrayList;
import org.dbflute.dbmeta.DBMeta;
import org.dbflute.dbmeta.AbstractEntity;
import org.dbflute.dbmeta.accessory.DomainEntity;
import org.docksidestage.or... |
/**
* [get] VENDOR_$_DOLLAR_NAME: {NotNull, VARCHAR2(32)} <br> |
<|file_name|>format.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses... | |
<|file_name|>lib_output.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import csv, sys, subprocess
from lib_time import *
<|fim▁hole|># normalize the dictionary with the word count to generate the wordcloud
def normalize_dict(dic):
max_elem = max(dic.values())
for key, value in dic.item... | # returns the given float number with only 2 decimals and a % appended
def float_to_percentage(float_number):
return("%0.2f" % float_number +"%")
|
<|file_name|>push_reducer.ts<|end_file_name|><|fim▁begin|>import {JSONAPIDataObject, JSONAPIListResponse} from "../json-api";
import * as actions from "./push_actions";
import {Certificate} from "./types";
export interface PushState {
items?: JSONAPIListResponse<JSONAPIDataObject<Certificate>>;
loading: boolea... | ...state,
loading: true,
}; |
<|file_name|>test_IndependentDiscretization.py<|end_file_name|><|fim▁begin|>from rlpy.Representations import IndependentDiscretization<|fim▁hole|>
def test_number_of_cells():
""" Ensure create appropriate # of cells (despite ``discretization``) """
mapDir = os.path.join(__rlpy_location__, "Domains", "GridWorldM... | from rlpy.Domains import GridWorld, InfiniteTrackCartPole
import numpy as np
from rlpy.Tools import __rlpy_location__
import os |
<|file_name|>export.rs<|end_file_name|><|fim▁begin|>pub mod cf;
pub mod container;
mod export_common;
pub mod mesos;<|fim▁hole|><|fim▁end|> | pub mod tar; |
<|file_name|>platform-examples.component.ts<|end_file_name|><|fim▁begin|>import { Component, ChangeDetectionStrategy } from "@angular/core";
import { Link } from "./../../link";
let menuLinks = [
new Link("Usage", "/platform/usage")
];
@Component({
moduleId: module.id,
templateUrl: "./../../examples-list.... |
for (let i = 0; i < menuLinks.length; i++) { |
<|file_name|>test_sphere.py<|end_file_name|><|fim▁begin|>from impedance_map.sphere import correlation_coefficient, form_factor, \
pair_distribution_function_PY, structure_factor_function_PY, \
cross_section_dimension, fit_correlation_coefficient_nls, \
fit_form_factor_nls
import numpy as np
import math
impo... | self.assertTrue(np.allclose(a, a_guess))
|
<|file_name|>win_delay_load_hook.rs<|end_file_name|><|fim▁begin|>//! Rust port of [win_delay_load_hook.cc][].
//!
//! When the addon tries to load the "node.exe" DLL module, this module gives it the pointer to the
//! .exe we are running in instead. Typically, that will be the same value. But if the node executable
//!... | use winapi::shared::minwindef::{BOOL, DWORD, FARPROC, HMODULE, LPVOID};
use winapi::shared::ntdef::LPCSTR; |
<|file_name|>wizard.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2015 thomasv@gitorious, kyuupichan@gmail
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Soft... | |
<|file_name|>1000.cpp<|end_file_name|><|fim▁begin|>// 1000. 连通性问题
#include <iostream>
using namespace std;
int unionFind[100001];
int find(int val) {
if (val == unionFind[val]) return val;
unionFind[val] = find(unionFind[val]);
return unionFind[val];
}<|fim▁hole|>int main() {
int a, b;
for (int i = 0; i < 1... | |
<|file_name|>list.rs<|end_file_name|><|fim▁begin|>use clap::ArgMatches;
use doapi::{DoManager, DoRequest};
use config::Config;
use message::CliMessage;
pub fn run(m: &ArgMatches, cfg: &mut Config) {
if m.is_present("verbose") {
cfg.verbose = true;
}
if m.is_present("nosend") {
cfg.no_send... | ("domains", Some(m)) => {
if cfg.verbose || m.is_present("verbose") {
CliMessage::Request(
&domgr.domains() |
<|file_name|>review_gui_helper.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (C) 2009 Canonical
#
# Authors:
# Michael Vogt
#
# 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
# Foundati... | |
<|file_name|>eventhandler.go<|end_file_name|><|fim▁begin|>package events
import (
"errors"
"github.com/miketheprogrammer/go-thrust/lib/commands"
"github.com/miketheprogrammer/go-thrust/lib/dispatcher"
)
/*
Create a new EventHandler for a give event.
*/
func NewHandler(event string, fn interface{}) (ThrustEventHan... | Begin Thrust Handler Code. |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright 2013 - Red Hat, 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/LICENSE-2.0
#
# U... | from solum.objects.sqlalchemy import sensor
from solum.objects.sqlalchemy import service |
<|file_name|>UrlHistory.java<|end_file_name|><|fim▁begin|>/*
* The University of Wales, Cardiff Triana Project Software License (Based
* on the Apache Software License Version 1.1)
*
* Copyright (c) 2007 University of Wales, Cardiff. All rights reserved.
*
* Redistribution and use of the software in source and bi... | |
<|file_name|>cppu.py<|end_file_name|><|fim▁begin|># -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
#
# This file is part of the LibreOffice project.
#
# 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... | from libreoffice.util import printing
from libreoffice.util.uno import TypeClass, make_uno_type, uno_cast |
<|file_name|>testTwoLayerQG.py<|end_file_name|><|fim▁begin|>import time, sys
import numpy as np
import matplotlib.pyplot as plt
sys.path.append('../../')
from py2Periodic.physics import twoLayerQG
from numpy import pi
params = {
'f0' : 1.0e-4,
'Lx' : 1.0e6,
'beta' : 1.5e-11,
'... | 'H1' : 500.0,
'H2' : 2000.0,
'U1' : 2.5e-2, |
<|file_name|>temca_graph.py<|end_file_name|><|fim▁begin|>"""
Python wrapper for functionality exposed in the TemcaGraph dll.
@author: jayb
"""
from ctypes import *
import logging
import threading
import time
import os
import sys
import numpy as np
from pytemca.image.imageproc import fit_sin
from numpy.ctypeslib impo... | logging.info ('callback error is' + error_string) |
<|file_name|>tables.py<|end_file_name|><|fim▁begin|># Copyright 2013 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.... | _('Domain Context updated to Domain %s.') %
domain.name)
except Exception: |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from customers.models import Client
from django.conf import settings
from django.db import utils
from django.views.generic import TemplateView
from tenant_schemas.utils import remove_www
class HomeView(TemplateView):
template_name = "index_public.html"
def ... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>###############################################################################
# Name: __init__.py #
# Purpose: Put the src package in the Editra packages namespace #
# Author: Cody Precord ... | |
<|file_name|>ListenerAction.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2005-2007 Maarten Billemont
*
* 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.ap... | |
<|file_name|>TcSets.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2010 Herve Quiroz
*
* This library 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 Foundation; either version 2.1 of the License, or (at... | import java.util.Set; |
<|file_name|>scheduler.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
AGO_SCHEDULER_VERSION = '0.0.1'
############################################
"""
Basic class for device and device group schedule
"""
__author__ = "Joakim Lindbom"
__copyright__ = "Copyright 2017, Joakim Lindbom"
__date__ = "2017-01-27... | x["days"] = ["mo", "tu", "we", "th", "fr", "sa", "su"]
else: |
<|file_name|>PullRequestHandler.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2016 Shredder121.
*
* 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... | } |
<|file_name|>buildsets.py<|end_file_name|><|fim▁begin|># This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it ... | reason=row.reason, sourcestampsetid=row.sourcestampsetid, |
<|file_name|>resizeUninitialized.cpp<|end_file_name|><|fim▁begin|>///
/// @file resizeUninitialized.cpp
/// @brief Test resizeUninitialized() which resizes a std::vector
/// without default initialization.
///
/// Copyright (C) 2022 Kim Walisch, <kim.walisch@gmail.com>
///
/// This file is distributed under ... | check(vect.size() == size * 50);
std::cout << "vect.capacity() = " << vect.capacity(); |
<|file_name|>shortcuts.py<|end_file_name|><|fim▁begin|>"""
This module collects helper functions and classes that "span" multiple levels
of MVC. In other words, these functions/classes introduce controlled coupling
for convenience's sake.
"""
from django.http import (
Http404, HttpResponse, HttpResponsePermanentRed... |
The arguments could be:
|
<|file_name|>JbossDeployBehavior.java<|end_file_name|><|fim▁begin|>package com.pahlsoft.ws.iaas.provision.deploy.behaviors;
import org.apache.log4j.Logger;
import com.pahlsoft.ws.iaas.provision.generated.InstructionType;
import com.pahlsoft.ws.iaas.provision.generated.ProvisionProperties;
import com.pahlsoft.ws.iaas.... | } |
<|file_name|>_vsrc.py<|end_file_name|><|fim▁begin|>import _plotly_utils.basevalidators
class VsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="vsrc", parent_name="cone", **kwargs):
super(VsrcValidator, self).__init__(
plotly_name=plotly_name,
... | role=kwargs.pop("role", "info"),
**kwargs
) |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>pub mod session;
pub mod templating;<|fim▁hole|><|fim▁end|> | pub mod util; |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Copyright (c) 2020 DDN. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
use futures::{future::BoxFuture, Future, FutureExt, TryFutureExt};
use std::{
error, fmt, io,
pin::Pin,
pr... | |
<|file_name|>sweetalert.component.spec.ts<|end_file_name|><|fim▁begin|>import { SweetAlertComponent } from './sweetalert.component';
describe('Component: SweetAlert', () => {
it('should create an instance', () => {
const instance = new SweetAlertComponent();
expect(instance).toBeTruthy();
<|fi... | });
}); |
<|file_name|>CNN.py<|end_file_name|><|fim▁begin|>import os
import sys
root_path = os.path.abspath("../../../")
if root_path not in sys.path:
sys.path.append(root_path)
import numpy as np
import tensorflow as tf
from _Dist.NeuralNetworks.Base import Generator4d
from _Dist.NeuralNetworks.h_RNN.RNN import Basic3d
fr... |
def init_from_data(self, x, y, x_test, y_test, sample_weights, names): |
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|>"""
WSGI config for pyday2016 project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/<|fim▁hole|>from django.core.wsgi import get_wsgi_... | """
import os
|
<|file_name|>Invoker.java<|end_file_name|><|fim▁begin|>package net.butfly.bus.invoker;
import net.butfly.albacore.service.Service;
import net.butfly.albacore.utils.async.Options;
import net.butfly.bus.Request;
import net.butfly.bus.Response;
import net.butfly.bus.config.bean.InvokerConfig;
import net.butfly.bus.contex... | |
<|file_name|>loggedin.py<|end_file_name|><|fim▁begin|>import logging
from joj.lib.base import *<|fim▁hole|>
class LoggedinController(BaseController):
def index(self):
#self closes window
return '<html><head></head><body onload="window.close()"></body></html>'<|fim▁end|> | from paste.request import parse_querystring
import urllib2
log = logging.getLogger(__name__) |
<|file_name|>util.py<|end_file_name|><|fim▁begin|># urllib3/util.py
# Copyright 2008-2012 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from __future__ import absolute_import
from base... | context.verify_mode = cert_reqs
if ca_certs: |
<|file_name|>extern-yield.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/li... | use std::task; |
<|file_name|>test_cli_config.py<|end_file_name|><|fim▁begin|>import click
import mock
import pytest
from click.testing import CliRunner
from sigopt.cli import cli
class TestRunCli(object):
@pytest.mark.parametrize('opt_into_log_collection', [False, True])
@pytest.mark.parametrize('opt_into_cell_tracking', [False... | 'api_token': 'some_test_token',
'code_tracking_enabled': opt_into_cell_tracking,
'log_collection_enabled': opt_into_log_collection,
}) |
<|file_name|>file_io.go<|end_file_name|><|fim▁begin|>package fakes
import "os"
type FileIO struct {
TempFileCall struct {
CallCount int
Receives struct {
Dir string
Prefix string
}
Returns struct {
File *os.File
Error error
}
}
ReadFileCall struct {
CallCount int
Receives struct {
... | |
<|file_name|>OpenLayers.js<|end_file_name|><|fim▁begin|>// ----------------------------------------------------------------------------
// To provide some additional features for OpenLayers, portions of the OpenLayers support
// have been copied from 'mapstraction.js' [www.mapstraction.com] which includes the
// copyr... | this.replayTimer = setTimeout("jsmap._replayPushpins("+replay+")", interval); |
<|file_name|>test_ddl_stress.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Copyright (c) 2012 Cloudera, 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
#
#... |
# Simple stress test for DDL operations. Attempts to create, cache, |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>use core;
#[repr(C)]
#[derive(Debug,Clone,Copy, PartialEq)]
pub enum BroCatliResult {
Success = 0,
NeedsMoreInput = 1,
NeedsMoreOutput = 2,
BrotliFileNotCraftedForAppend = 124,
InvalidWindowSize = 125,
WindowSizeLargerThanPreviousFile = 126,
BrotliFileNotC... | pub fn new() -> BroCatli {
BroCatli { |
<|file_name|>api_command_test.go<|end_file_name|><|fim▁begin|>package v2_test
import (
"errors"
"code.cloudfoundry.org/cli/api/cloudcontroller/ccerror"
"code.cloudfoundry.org/cli/command"
"code.cloudfoundry.org/cli/command/commandfakes"
. "code.cloudfoundry.org/cli/command/v2"
"code.cloudfoundry.org/cli/command... | It("sets the target with a warning", func() {
Expect(err).ToNot(HaveOccurred())
Expect(fakeActor.SetTargetCallCount()).To(Equal(1)) |
<|file_name|>mediaconvert.rs<|end_file_name|><|fim▁begin|>#![cfg(feature = "mediaconvert")]
extern crate rusoto_core;
extern crate rusoto_mediaconvert;<|fim▁hole|>use rusoto_mediaconvert::{MediaConvert, MediaConvertClient, ListJobsRequest};
use rusoto_core::Region;
#[test]
fn should_list_jobs() {
let client = Med... | |
<|file_name|>monitor.js<|end_file_name|><|fim▁begin|>var Thoonk = require('../thoonk').Thoonk;
var thoonk = new Thoonk();
var jobs = {};
var stats = thoonk.feed('thoonk_job_stats');
thoonk.mredis.smembers('feeds', function(err, feeds) {
feeds.forEach(function(name) {
thoonk.mredis.hget('feed.config:' + ... | |
<|file_name|>transformed_distribution.py<|end_file_name|><|fim▁begin|># Copyright 2016 The TensorFlow 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
#
# htt... | # We override `_call_sample_n` rather than `_sample_n` so we can ensure that
# the result of `self.bijector.forward` is not modified (and thus caching |
<|file_name|>graph.py<|end_file_name|><|fim▁begin|>import re
CJDNS_IP_REGEX = re.compile(r'^fc[0-9a-f]{2}(:[0-9a-f]{4}){7}$', re.IGNORECASE)
class Node(object):
def __init__(self, ip, version=None, label=None):
if not valid_cjdns_ip(ip):
raise ValueError('Invalid IP address')
if not ... | raise ValueError('Invalid version') |
<|file_name|>funct.py<|end_file_name|><|fim▁begin|>import codecs
def funct(f_name):
"""Remove leading and trailing whitespace from file."""
f_read = codecs.open(f_name, 'r')
f_lines = f_read.readlines()
out_lines = map(str.strip, f_lines)
f_read.close()
while True:
o_write = raw_input... |
f_write = codecs.open(f_name, 'w') |
<|file_name|>NormalModuleFactory.js<|end_file_name|><|fim▁begin|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const asyncLib = require("neo-async");
const Tapable = require("tapable").Tapable;
const AsyncSeriesWaterfallHook = require("tapabl... | const resolveOptions = settings.resolve;
callback(null, {
context: context,
request: loaders
|
<|file_name|>polyfill.intersection-observer.js<|end_file_name|><|fim▁begin|>import IntersectionObserverPolyfill from './resources/IntersectionObserverPolyfill';
import IntersectionObserverEntryPolyfill from './resources/IntersectionObserverEntryPolyfill';
export {
IntersectionObserverEntryPolyfill,
Intersectio... | }; |
<|file_name|>ftfilemapper.cc<|end_file_name|><|fim▁begin|>#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <errno.h>
#include <iostream>
#include "ftfilemapper.h"
//#define DEBUG_FILEMAPPER
ftFileMapper::ftFileMapper(uint64_t file_size,uint32_t chunk_size)
: _file_size(file_size),_chunk_size(chun... | void *buff = malloc(size) ; |
<|file_name|>bsla_scanf.cpp<|end_file_name|><|fim▁begin|>// bsla_scanf.cpp -*-C++-*-
#include <bsla_scanf.h>
#include <bsls_ident.h>
BSLS_IDENT("$Id$ $CSID$")
// ----------------------------------------------------------------------------
// Copyright 2019 Bloomberg... | // |
<|file_name|>constants.go<|end_file_name|><|fim▁begin|>package v1
const (
MODULE_NAME = "node/croncache/v1"<|fim▁hole|><|fim▁end|> | ) |
<|file_name|>client.go<|end_file_name|><|fim▁begin|>package autorest
import (<|fim▁hole|>)
const (
// The default delay between polling requests (only used if the http.Request lacks a well-formed
// Retry-After header).
DefaultPollingDelay = 60 * time.Second
// The default total polling duration.
DefaultPolling... | "fmt"
"net/http"
"time" |
<|file_name|>createuser.py<|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/.
"""
Create a user.
"""
from django.contrib.auth.models import U... | user.save()
self.stdout.write("User {} created.".format(username)) |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models<|fim▁hole|># Create your models here.
class TempMail(models.Model):
mailfrom = models.EmailField()
mailsubj = models.CharField(max_length=20)
mailrcvd = models.DateTimeField()
mailhdrs = models.CharField()
class SavedMail(... | # from django.contrib.gis.geoip import GeoIP
#
# g = GeoIP()
|
<|file_name|>string.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.apache.org/licenses... | fn eq(&self, other: &&'b str) -> bool { PartialEq::eq(&self[..], &other[..]) }
#[inline] |
<|file_name|>test_rjust.py<|end_file_name|><|fim▁begin|>from django.template.defaultfilters import rjust
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class RjustTests(SimpleTestCase):
@setup({'rjust01': '{% autoescape off %}.{{ a|rjust:"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.