prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>ure_sub_unmatched.py<|end_file_name|><|fim▁begin|># test re.sub with unmatched groups, behaviour changed in CPython 3.5
try:
import ure as re
except ImportError:
try:
import re<|fim▁hole|> raise SystemExit
try:
re.sub
except AttributeError:
print("SKIP")
raise SystemExi... | except ImportError:
print("SKIP") |
<|file_name|>log_pres_2.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# Creator: Daniel Wooten
# License: GPL
# import the python logging utility as log<|fim▁hole|>
# Set the root logger level ( what messages it will print )
log.basicConfig( level = 10 )
# Some sample messages for the root logger
log.debug( "This... | import logging as log |
<|file_name|>whatsnew_73.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from selenium.webdriver.common.by import By
from pages.base import BasePage
class FirefoxWhatsNew73Page(BasePage):
URL_TEMPLATE = '/{locale}/firefox/73.0/whatsnew/all/{params}'
_set_default_button_locator = (By.ID, 'set-as-default-button'... | # 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/.
|
<|file_name|>order.js<|end_file_name|><|fim▁begin|>'use strict';
module.exports = function(sequelize, DataTypes){
var Order = sequelize.define('Order', {<|fim▁hole|> }, {
classMethods: {
associate: function(models){
Order.belongsTo(models.User);
Order.belongsTo(models.Listing);
}
... | state: {
type: DataTypes.ENUM('active', 'purchased', 'cancelled')
} |
<|file_name|>SocketConnectionFacadeImpl.java<|end_file_name|><|fim▁begin|>/**
*
*/
package me.dayler.ai.ami.conn;
import javax.net.SocketFactory;
import javax.net.ssl.SSLSocketFactory;
import java.io.*;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.util.NoSuchEle... |
/**
* Default implementation of the SocketConnectionFacade interface using java.io.
* |
<|file_name|>supervised_reduction.py<|end_file_name|><|fim▁begin|># License: MIT License https://github.com/passalis/sef/blob/master/LICENSE.txt
from __future__ import absolute_import, division, print_function, unicode_literals
import numpy as np
import sklearn
from sklearn.discriminant_analysis import LinearDiscrimin... | print("LDA: ")
supervised_reduction('lda')
print("S-LDA: ") |
<|file_name|>infer_util_test.py<|end_file_name|><|fim▁begin|><|fim▁hole|># 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 b... | # Copyright 2022 The Magenta Authors.
# |
<|file_name|>errors.py<|end_file_name|><|fim▁begin|>class ProxyPoolError(Exception):
"""proxypool error base"""
<|fim▁hole|> return 'crawler rule required "start_url", "ip_xpath" and "port_xpath".'
class CrawlerRuleBaseInstantiateError(ProxyPoolError):
def __str__(self):
return "crawler rule b... |
class CrawlerRuleImplementionError(ProxyPoolError):
def __str__(self): |
<|file_name|>new_component.routes.js<|end_file_name|><|fim▁begin|>'use strict';
<|fim▁hole|> 'ngInject';
$routeProvider.when('/new_component', {
template: '<about></about>'
});
$routeProvider.when('/new_component/:somethingToPrint', {
template: '<about></about>'
});
}<|fim▁end|> | export default function routes($routeProvider) { |
<|file_name|>aggregate.py<|end_file_name|><|fim▁begin|>import logging
from datetime import datetime
import os
from flask import request, g, Response, jsonify
from openspending.views.api_v4.common import blueprint
from openspending.lib.apihelper import DataBrowser_v4, GEO_MAPPING,FORMATOPTS
from openspending.lib.jso... | dataset = get_dataset(cube)
if dataset:
results['models'][cube] = dataset.detailed_dict()
|
<|file_name|>window.py<|end_file_name|><|fim▁begin|>import types
from sikwidgets.region_group import RegionGroup
from sikwidgets.util import to_snakecase
from sikwidgets.widgets import *
def gen_widget_method(widget_class):
def widget(self, *args, **kwargs):
return self.create_widget(widget_class, *args, *... | |
<|file_name|>getopts.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-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/li... | vals[optid].push(Given);
} |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls.defaults import patterns, url
urlpatterns = patterns(
'show.views',
url(r'^radioshow/entrylist/$', 'radioshow_entryitem_list', name='radioshow_entryitem_list'),
url(r'^showcontributor/list/(?P<slug>[\w-]+)/$', 'showcontributor_content_... | |
<|file_name|>action_it_test.go<|end_file_name|><|fim▁begin|>// +build integration
/*
Real-time Online/Offline Charging System (OCS) for Telecom & ISP environments
Copyright (C) ITsysCOM GmbH
This program is free software: you can redistribute it and/or modify<|fim▁hole|>the Free Software Foundation, either version 3 ... | it under the terms of the GNU General Public License as published by |
<|file_name|>clubs.py<|end_file_name|><|fim▁begin|>import datetime
import os
import json
import re
import psycopg2 as dbapi2
from flask import Flask
from flask import redirect
from flask import request
from flask import render_template
from flask.helpers import url_for
from store import Store
from fixture import *
f... | INSERT INTO CLUBS
(NAME, PLACES, YEAR, CHAIR, NUMBER_OF_MEMBERS, REWARDNUMBER) VALUES ( |
<|file_name|>factory.go<|end_file_name|><|fim▁begin|>/*
* Copyright 2021 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/LICE... | }
// Key is used as the key for associating information with a context.Context. |
<|file_name|>AggregatingProcessor.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2011 Vasily Shiyan
*
* 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/licen... | }
});
}
|
<|file_name|>tables.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2015 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/lic... | ('\u{2d27}', '\u{2d27}'), ('\u{2d2d}', '\u{2d2d}'), ('\u{a641}', '\u{a641}'), ('\u{a643}',
'\u{a643}'), ('\u{a645}', '\u{a645}'), ('\u{a647}', '\u{a647}'), ('\u{a649}', '\u{a649}'),
('\u{a64b}', '\u{a64b}'), ('\u{a64d}', '\u{a64d}'), ('\u{a64f}', '\u{a64f}'), ('\u{a651}',
'\u{a651}'), ('... |
<|file_name|>ICleaning.js<|end_file_name|><|fim▁begin|>"use strict";
/*
Copyright (C) 2013-2017 Bryan Hughes <bryan@nebri.us>
Aquarium Control is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of t... | |
<|file_name|>get.js<|end_file_name|><|fim▁begin|>JsonRecordApp.contorller(getCtrl, ['$scope', '$http', function($scope, $http){
var testArray = new Array();
var errorChar = 1;
for (var i = 10001; i < 10101; i++) {
var query = jQuery.ajax({
url: jsonUrl + jsonName + i + ".json",
type: "GET",
... | type: "POST",
context: testJson,
contentType: "application/json",
async: false, |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.http import HttpResponse, Http404
from django.core.exceptions import ObjectDoesNotExist
from django.shortcuts import render, get_object_or_404
from django.core.urlresolvers import reverse
from django.utils.xmlutils import SimplerXMLGenerator
from models imp... | |
<|file_name|>test_icalbouncer.py<|end_file_name|><|fim▁begin|># -*- Mode: Python; -*-
# vi:si:et:sw=4:sts=4:ts=4
# Flumotion - a streaming media server
# Copyright (C) 2004,2005,2006,2007,2008,2009 Fluendo, S.L.
# Copyright (C) 2010,2011 Flumotion Services, S.A.
# All rights reserved.
#
# This file may be distributed ... | self.failUnless(result)
self.assertEquals(result.state, keycards.AUTHENTICATED)
self.failUnless(result.duration)
self.failIf(result.duration > 60) |
<|file_name|>layer_block.py<|end_file_name|><|fim▁begin|>import os
import inspect
import sys
class BlockStore:
def __init__(self, input_file, block_size, output_dir):
self.input_file = input_file
self.block_size = block_size
file_size = os.stat(input_file).st_size
print 'file_size:... |
try: |
<|file_name|>TimeEntry.ts<|end_file_name|><|fim▁begin|>import { Activity } from "./Activity";
export interface TimeEntry {
activity: Activity;
comments: string;
created_on: string;<|fim▁hole|> spent_on: string;
updated_on: string;
user: any;
}<|fim▁end|> | hours: number;
id: number;
issue: any;
project: any; |
<|file_name|>surface2d_to_hdf5.py<|end_file_name|><|fim▁begin|>import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy.ndimage import gaussian_filter
from srxraylib.plot.gol import plot
from oasys.util.oasys_util import write_surface_file
from srxraylib.metrology.profiles_simulation impo... | # #print("Detrending straight line on sloped (axis=%d): zfit = %g * coordinate + %g " % (axis, coeff[1], coeff[0]))
# print("Radius of curvature: %g m" % (1.0 / coeff[0]))
#
# if radius >= 0:
|
<|file_name|>editable.rs<|end_file_name|><|fim▁begin|>// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use ffi;
use glib::GString;
use glib::object::IsA;
use glib::translate::*;
use std::fmt;
use std::mem;
glib_wrapper! {
pub ... | }
|
<|file_name|>index.js<|end_file_name|><|fim▁begin|>const path = require('path');
const fs = require('fs');
const escapeRegExp = require("lodash/escapeRegExp");
require("@babel/register")({
extensions: [".es6", ".es", ".jsx", ".js", ".mjs", ".ts"],
only: [
new RegExp("^" + escapeRegExp(path.resolve(__di... | // Set up fake translation |
<|file_name|>StringUtilities_test.ts<|end_file_name|><|fim▁begin|>// Copyright (c) 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import {StringUtilities} from '../../../../front_end/platform/platform.js';
import {... | ['klmno', 'a2xtbm8='],
['pqrstu', 'cHFyc3R1'], |
<|file_name|>treeview.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Maestro Music Manager - https://github.com/maestromusic/maestro
# Copyright (C) 2009-2015 Martin Altmayer, Michael Helmling
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General P... | model.startDrag()
try:
super().startDrag(supportedActions) |
<|file_name|>ZookeeperPoolManager.java<|end_file_name|><|fim▁begin|>package com.jxtech.distributed.zookeeper.pool;
import java.util.NoSuchElementException;
import org.apache.commons.pool.ObjectPool;
import org.apache.commons.pool.PoolableObjectFactory;
import org.apache.commons.pool.impl.StackObjectPool;
import org.a... | |
<|file_name|>selectable.interface.ts<|end_file_name|><|fim▁begin|>export interface Selectable {<|fim▁hole|> onDeselected(): void
}<|fim▁end|> | onSelected(): void |
<|file_name|>travis.py<|end_file_name|><|fim▁begin|>"""
rebuildbot/travis.py
Wrapper around travispy
The latest version of this package is available at:
<https://github.com/jantman/rebuildbot>
################################################################################
Copyright 2015 Jason Antman <jason@jasonant... | self.trigger_travis(repo_slug, branch=branch)
try:
new_id = self.wait_for_new_build(repo_slug, last_build.id) |
<|file_name|>TestCC.java<|end_file_name|><|fim▁begin|>/**
Copyright (C) SYSTAP, LLC 2006-2012. 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.ap... | }
|
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Copyright 2020 TiKV Project Authors. Licensed under Apache-2.0.
#![feature(min_specialization)]
#[allow(unused_extern_crates)]
extern crate tikv_alloc;
#[macro_use]
extern crate lazy_static;
macro_rules! define_error_codes {
($prefix:literal,
$($name:ide... | use std::fmt::{self, Display, Formatter}; |
<|file_name|>too-much-recursion-unwinding.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at<|fim▁hole|>//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licen... | // http://rust-lang.org/COPYRIGHT. |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf import settings
from django.conf.urls import url
from django.conf.urls.static import static
from vod import user_views
from vod.alias_id_views import AliasIdListView, AliasIdCreateView, AliasIdUpdateView, AliasIdRetireView
from vod.datatype_views impor... |
url(r'^patient/detail/(?P<id>\d+)/$', login_required(PatientIdentifiersDetailView.as_view()), name='patient-detail'), |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>import legacyProcessorShim from './legacy-processor-shim';
import legacyReaderShim from './legacy-reader-shim';<|fim▁hole|>import operationAPIShim from './operation-api-shim';
import processorShim from './processor-shim';
import readerShim from './reader-shim';
import ... | import legacySliceEventsShim from './legacy-slice-events-shim'; |
<|file_name|>skipUntil.ts<|end_file_name|><|fim▁begin|>import { Observable } from '../Observable';
import { skipUntil as higherOrder } from '../operators/skipUntil';
/**
* Returns an Observable that skips items emitted by the source Observable until a second Observable emits an item.
*
* <img src="./img/skipUntil.p... | * an item, then emits the remaining items.
* @method skipUntil |
<|file_name|>custom_exceptions.py<|end_file_name|><|fim▁begin|>class PGeoException(Exception):
status_code = 400
def __init__(self, message, status_code=None, payload=None):
Exception.__init__(self, message)
self.message = message
if status_code is not None:
self.status_code... | rv['message'] = self.message
rv['status_code'] = self.status_code
return rv
|
<|file_name|>hl2mp_cvars.cpp<|end_file_name|><|fim▁begin|>//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#include "cbase.h"
#include "hl2mp_cvars.h"
// R... | |
<|file_name|>regexify.py<|end_file_name|><|fim▁begin|>from re import compile
# ----------------- Local variables ----------------- #
__reCompiles = []
# ----------------- Global methods ----------------- #
def compileTitleRe():
"""Generates and compiles regex patterns"""
rePats = [
r'[\{\(\[].*?[\... | ).rstrip().lstrip() # strip whitespace from beginning and end only
) |
<|file_name|>container_test.py<|end_file_name|><|fim▁begin|># Copyright 2015 Metaswitch Networks
#
# 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... | Test validate_arguments for calicoctl container command |
<|file_name|>oscilloscope.py<|end_file_name|><|fim▁begin|>import beaglebone_pru_adc as adc<|fim▁hole|>import time
numsamples = 10000 # how many samples to capture
capture = adc.Capture()
capture.oscilloscope_init(adc.OFF_VALUES, numsamples) # captures AIN0 - the first elt in AIN array
#capture.oscilloscope_init(adc.... | |
<|file_name|>syscoin_pt_PT.ts<|end_file_name|><|fim▁begin|><TS language="pt_PT" version="2.1">
<context>
<name>AddressBookPage</name>
<message>
<source>Right-click to edit address or label</source>
<translation>Clique com o botão direito para editar o endereço ou etiqueta</translation>
</mes... | |
<|file_name|>install_test.go<|end_file_name|><|fim▁begin|>// Copyright 2017 CoreOS, 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... | |
<|file_name|>AppRunnerService.java<|end_file_name|><|fim▁begin|>package org.protocoderrunner.apprunner;
import android.app.AlarmManager;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.Service;
import android.app.TaskStackBuilder;
import android.content.BroadcastReceiver;
i... |
AppRunnerSettings.get().project = currentProject; |
<|file_name|>HelloWorld.py<|end_file_name|><|fim▁begin|><|fim▁hole|>print("Greetings Earth! We come in peace.")<|fim▁end|> | |
<|file_name|>replace_ctf.py<|end_file_name|><|fim▁begin|># Replaces the ctf values in input star file with the values in a reference star file
import argparse
import os
from star import *
def parse_args():
parser = argparse.ArgumentParser(description="Replaces the ctf values in input star file with the values in a ... |
for line in ref_star.body:
mic_root = rootname(ref_star.getMic(line))
|
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Definitions
mod definitions {
//
// Each encoded block begins with the varint-encoded length of the decoded data,
// followed by a sequence of chunks. Chunks begin and end on byte boundaries.
// The
// first byte of each chunk is broken into its 2 least and 6 mo... | // For literal tags:
// - If m < 60, the next 1 + m bytes are literal bytes.
// - Otherwise, let n be the little-endian unsigned integer denoted by the next
// m - 59 bytes. The next 1 + n bytes after that are literal bytes. |
<|file_name|>error.rs<|end_file_name|><|fim▁begin|>use std::error;
use std::fmt;
pub type RResult<T, E> where E: error::Error = Result<T, E>;
#[derive(Debug, PartialEq)]
pub enum RLispError {
EvalError(EvalError),
ParseError(ParseError),
}
impl fmt::Display for RLispError {
fn fmt(&self, f: &mut fmt::For... | impl error::Error for RLispError { |
<|file_name|>SynonymStreamStruct.java<|end_file_name|><|fim▁begin|>package jcl.lang;
import jcl.lang.internal.stream.SynonymStreamStructImpl;
/**
* The {@link SynonymStreamStruct} is the object representation of a Lisp 'synonym-stream' type.
*/
public interface SynonymStreamStruct extends IOStreamStruct {
/**
*... | }
} |
<|file_name|>SectionAttributesTestCase.js<|end_file_name|><|fim▁begin|>/*
* Copyright 2013 Amadeus s.a.s.
* 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... | |
<|file_name|>bitcoin_la.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="la" version="2.0">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About Termocoin</source>
... | Quoque hortatur alertnotify constituere ut tu notificetur de problematibus;
exempli gratia: alertnotify=echo %%s | mail -s "Termocoin Notificatio" admin@foo.com |
<|file_name|>apply3.js<|end_file_name|><|fim▁begin|>//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//--... | });
// 5, 7 argArray.length is invalid
|
<|file_name|>command.go<|end_file_name|><|fim▁begin|>package medtronic
import (
"bytes"
"fmt"
"log"
"github.com/ecc1/medtronic/packet"
)
// Command represents a pump command.
type Command byte
//go:generate stringer -type Command
const (
ack Command = 0x06
nak Command = 0x15... | |
<|file_name|>test_what_color_is_your_name.py<|end_file_name|><|fim▁begin|>import unittest
from katas.beta.what_color_is_your_name import string_color
class StringColorTestCase(unittest.TestCase):
def test_equal_1(self):<|fim▁hole|> self.assertEqual(string_color('Joshua'), '6A10D6')
def test_equal_3(s... | self.assertEqual(string_color('Jack'), '79CAE5')
def test_equal_2(self): |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import Y... | static_lsp.static_lsp,
yang_name="static-lsp", |
<|file_name|>a3.js<|end_file_name|><|fim▁begin|>var formMode="detail"; /*formMode 页面模式 页面有三种模式 detail add modify*/
var panelType="form"; /*panelType 面板类型 form表单 search 查询 child 从表对象*/
var editIndex = undefined; /*datagrid 编辑对象的行号*/
var dg1EditIndex = undefined;
var objName=label.objName; /*页面管理对象名称*/
var lblDe... | useEditMode();
}
else $.messager.alert('选择提示', '请选择您编辑的数据!',"info");
} |
<|file_name|>fc_zone_manager.py<|end_file_name|><|fim▁begin|># (c) Copyright 2014 Brocade Communications Systems Inc.
# All Rights Reserved.
#
# Copyright 2014 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with th... |
try: |
<|file_name|>refeds.py<|end_file_name|><|fim▁begin|>__author__ = 'rolandh'
RESEARCH_AND_SCHOLARSHIP = "http://refeds.org/category/research-and-scholarship"
RELEASE = {
"": ["eduPersonTargetedID"],<|fim▁hole|> RESEARCH_AND_SCHOLARSHIP: ["eduPersonPrincipalName",
"eduPersonScopedAf... | |
<|file_name|>influx_udp.py<|end_file_name|><|fim▁begin|>import logging
import asyncio
logger = logging.getLogger(__name__)
class InfluxLineProtocol(asyncio.DatagramProtocol):
def __init__(self, loop):
self.loop = loop<|fim▁hole|>
def connection_made(self, transport):
self.transport = transpor... | self.transport = None |
<|file_name|>AssistmentsProperties.py<|end_file_name|><|fim▁begin|># datapath config
# data folder location
data_folder = '/home/data/jleeae/ML/e_learning/KnowledgeTracing/data/'
csv_original_folder = data_folder + 'csv_original/'
csv_rnn_data_folder = data_folder + 'csv_rnn_data/'
pkl_rnn_data_folder = data_folder + '... | if ('datapath' not in self.__dict__):
if ('csv' == ext and is_original):
if ('2009' == self.version): |
<|file_name|>combine_vector.py<|end_file_name|><|fim▁begin|>import bpy
from ... base_types.node import AnimationNode
class CombineVectorNode(bpy.types.Node, AnimationNode):
bl_idname = "an_CombineVectorNode"
bl_label = "Combine Vector"
dynamicLabelType = "HIDDEN_ONLY"<|fim▁hole|> self.newInput("Floa... |
def create(self):
self.newInput("Float", "X", "x") |
<|file_name|>testing.go<|end_file_name|><|fim▁begin|>package loader
import (
"net"
"sync"
log "github.com/hashicorp/go-hclog"
plugin "github.com/hashicorp/go-plugin"
"github.com/hashicorp/nomad/helper"
"github.com/hashicorp/nomad/plugins/base"
)
// MockCatalog provides a mock PluginCatalog to be used for testi... | // passed inst as the plugin
func MockBasicExternalPlugin(inst interface{}, apiVersion string) *MockInstance { |
<|file_name|>Yarn.js<|end_file_name|><|fim▁begin|><|fim▁hole|>/*
* Copyright (c) 2014 airbug Inc. All rights reserved.
*
* All software, both binary and source contained in this work is the exclusive property
* of airbug Inc. Modification, decompilation, disassembly, or any other means of discovering
* the source ... | |
<|file_name|>test_dispatch.js<|end_file_name|><|fim▁begin|>/**
* Copyright (C) 2015 Swift Navigation Inc.
* Contact: Joshua Gross <josh@swift-nav.com>
* This source is subject to the license found in the file 'LICENSE' which must
* be distributed together with this source. All other rights reserved.
*
* THIS CODE... |
var rs = new Readable();
rs.push(msgVelEcefPayload);
rs.push(msgLlhPayload); |
<|file_name|>admin-item.js<|end_file_name|><|fim▁begin|>import m from 'mithril';
import _ from 'underscore';
import h from '../h';
const adminItem = {
oninit: function(vnode) {
vnode.state = {
displayDetailBox: h.toggleProp(false, true)
};
},
view: function({state, attrs}) {
... | |
<|file_name|>DossierLogResultsModel.java<|end_file_name|><|fim▁begin|>//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be... | |
<|file_name|>test_floating_ip.py<|end_file_name|><|fim▁begin|># #!/usr/bin/env python
#
# Copyright 2016 Sungard Availability Services
# Copyright 2016 Red Hat
# 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... | return [{'router_id': 'e24f8a37-1bb7-49e4-833c-049bb21986d2', |
<|file_name|>overlord.go<|end_file_name|><|fim▁begin|>package http
import (
"go-common/app/admin/main/cache/model"
bm "go-common/library/net/http/blademaster"
)
// @params OverlordReq
// @router get /x/admin/cache/overlord/clusters
// @response OverlordResp
func overlordClusters(ctx *bm.Context) {
req := new(model... | |
<|file_name|>ComboBox.cpp<|end_file_name|><|fim▁begin|>#include "ComboBox.h"
#include <QDebug>
ComboBox::ComboBox(QWidget* parent)
: QComboBox(parent)
{
}
ComboBox::~ComboBox()
{
}
void ComboBox::setCurrentItemById(const int id)
{
<|fim▁hole|> {
if (id == itemData(i).toInt())
{
setCurrentIn... | const int size = count();
for (int i = 0; i < size; ++i)
|
<|file_name|>actions.js<|end_file_name|><|fim▁begin|>/*
* Slimey - SLIdeshow Microformat Editor - http://slimey.sourceforge.net
* Copyright (C) 2007 - 2008 Ignacio de Soto
*
* Base Action definitions.
*/
/**
* abstract class SlimeyAction - Actions on the editor
* name: name of the action
*/
va... | if (oldw) {
this.oldw = oldw;
|
<|file_name|>forms.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.core.exceptions import ValidationError
from django.forms import models
from djanban.apps.hourly_rates.models import HourlyRate
from django import forms
# Hourly rate creation and edition fo... | class HourlyRateForm(models.ModelForm):
class Meta:
model = HourlyRate |
<|file_name|>RETSourceTableModel.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2015 Torridity.
*
* 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|> * http://www.apache... | |
<|file_name|>test_qgscomposerlabel.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
'''
test_qgscomposerlabel.py
--------------------------------------
Date : Oct 2012
Copyright : (C) 2012 by Dr. Hugo Mercier
email ... | * *
***************************************************************************/
''' |
<|file_name|>analysis_DropTest.py<|end_file_name|><|fim▁begin|>import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.cm
fig = plt.figure()
ax = {}
ax["DropOut"] = fig.add_subplot(121)
ax["NoDropOut"] = fig.add_subplot(122)
dList = {}
dList["DropOut"] = ["DropOut1","DropOut2",... | print dfile
d = pd.read_csv("Output_DropTest/%s/output.dat"%dfile)
dTrain = d[d["mode"]=="Train"] |
<|file_name|>escape_uri.rs<|end_file_name|><|fim▁begin|>// Copyright 2019 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
... | /// Converts this iterator into a [`std::borrow::Cow<str>`].
#[cfg(feature = "std")]
pub fn to_cow(&self) -> Cow<'a, str> {
if self.is_needed() { |
<|file_name|>common.rs<|end_file_name|><|fim▁begin|>use std::ffi::CString;
use std::os::raw::c_char;
pub mod nom7 {
use nom7::bytes::streaming::{tag, take_until};
use nom7::error::{Error, ParseError};
use nom7::ErrorConvert;
use nom7::IResult;
/// Reimplementation of `take_until_and_consume` for n... | #[macro_export]
macro_rules! debug_validate_bug_on (
($item:expr) => { |
<|file_name|>ResponseCode.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2010 The UAPI Authors
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at the LICENSE file.
*
* You must gained the permission from the authors if you want to
* use the project i... | |
<|file_name|>PatchToPatchInterpolation_.C<|end_file_name|><|fim▁begin|>/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (... | } // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // |
<|file_name|>Client.cpp<|end_file_name|><|fim▁begin|>// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
/... | |
<|file_name|>locate.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Written by Chema Garcia (aka sch3m4)
# Contact: chema@safetybits.net || http://safetybits.net || @sch3m4
#
import serial.tools.list_ports
from SerialCrypt import Devices
<|fim▁hole|> Returns the serial port path of the arduino if found, or N... | def locateDevice(devid):
''' |
<|file_name|>validators.go<|end_file_name|><|fim▁begin|>/*
Copyright 2016 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unl... | func Validate() error {
var errs []error |
<|file_name|>ezrss.py<|end_file_name|><|fim▁begin|># Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickRage.
#
# SickRage 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 So... | # You should have received a copy of the GNU General Public License
# along with SickRage. If not, see <http://www.gnu.org/licenses/>. |
<|file_name|>package.py<|end_file_name|><|fim▁begin|># Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Libgcrypt(AutotoolsPackage):
"""Crypt... | version('1.9.3', sha256='97ebe4f94e2f7e35b752194ce15a0f3c66324e0ff6af26659bbfb5ff2ec328fd')
version('1.9.2', sha256='b2c10d091513b271e47177274607b1ffba3d95b188bbfa8797f948aec9053c5a')
version('1.9.1', sha256='c5a67a8b9b2bd370fb415ed1ee31c7172e5683076493cf4a3678a0fbdf0265d9') |
<|file_name|>userService.js<|end_file_name|><|fim▁begin|>/*
* The MIT License
* Copyright (c) 2014-2016 Nick Guletskii
*
* 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 restrict... | |
<|file_name|>custom_error_handler.rs<|end_file_name|><|fim▁begin|>#[macro_use] extern crate nickel;
use std::io::Write;
use nickel::{Nickel, NickelError, Request, HttpRouter, Action};
use nickel::status::StatusCode;
fn main() {
let mut server = Nickel::new();
// go to http://localhost:6767/user/4711 to see t... | }
_ => {}
}
} |
<|file_name|>register.rs<|end_file_name|><|fim▁begin|>// Copyright 2020 MaidSafe.net limited.
//
// This SAFE Network Software is licensed to you under The General Public License (GPL), version 3.
// Unless required by applicable law or agreed to in writing, the SAFE Network Software distributed
// under the GPL Licenc... | use super::chunk::{Chunk, ChunkId};
use sn_data_types::{ |
<|file_name|>train_convnet.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# coding: utf-8
import sys, os
sys.path.append(os.pardir) # 親ディレクトリのファイルをインポートするための設定
import numpy as np
import matplotlib.pyplot as plt
from dataset.mnist import load_mnist
from simple_convnet import SimpleConvNet
from common.trainer im... | max_epochs = 20 |
<|file_name|>product.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribut... | help='If checked all users can modify the price of this product in a sale order or invoice.'), |
<|file_name|>matFiles.cpp<|end_file_name|><|fim▁begin|>#include "matFiles.hpp"
#include <iostream>
int writeFs (MATFile *pmat, mxArray *pn, double fsHz) {
/* fsHZ */
pn = mxCreateDoubleScalar(fsHz);
if (pn == NULL) {
printf("Unable to create mxArray with mxCreateDoubleMatrix\n");
return(1);
}
... | mxArray *var;
const size_t *dims;
size_t ndims; |
<|file_name|>webpack.mix.js<|end_file_name|><|fim▁begin|>let mix = require('laravel-mix');
let fs = require('fs');
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a cl... | |
<|file_name|>pollReply.js<|end_file_name|><|fim▁begin|>'use strict';
var mongoose = require('mongoose')
, Schema = mongoose.Schema;
// 스키마 구조
var PollReplySchema = new Schema({
_id: { type:Schema.Types.ObjectId, required:true },
itemMulti: [{
_id: { type:Schema.Types.ObjectId, required:true },
... | }], |
<|file_name|>test_cli20_servicetype.py<|end_file_name|><|fim▁begin|># Copyright 2013 Mirantis Inc.
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# h... | resources = "service_providers"
cmd = servicetype.ListServiceProvider(test_cli20.MyApp(sys.stdout),
None)
self._test_list_resources(resources, cmd, |
<|file_name|>axis-time-base.js<|end_file_name|><|fim▁begin|>/*
YUI 3.17.2 (build 9c3c78e)
Copyright 2014 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add('axis-time-base', function (Y, NAME) {
/**
* Provides functionality for the handling of time axis data fo... | val = val.valueOf();
}
else if(!Y_Lang.isNumber(obj)) |
<|file_name|>fake_browser.rs<|end_file_name|><|fim▁begin|>extern crate cookie;
use self::cookie::CookieJar;
extern crate regex;
use self::regex::Regex;
extern crate hyper;
use self::hyper::client::{Client, RedirectPolicy};
use self::hyper::Url;
use std::io::prelude::*;
use std::error::Error;
use std::fmt::{Display, ... | }
/// Error returned if captcha was detected on login process
/// _Warning:_ the error isn't about 'Captcha needed' VK.com API real error. |
<|file_name|>attach.go<|end_file_name|><|fim▁begin|>package stream
import (
"io"
"sync"
"golang.org/x/net/context"
"github.com/docker/docker/pkg/pools"
"github.com/docker/docker/pkg/term"
"github.com/sirupsen/logrus"
)
var defaultEscapeSequence = []byte{16, 17} // ctrl-p, ctrl-q
// AttachConfig is the config... | } |
<|file_name|>receive_logs_direct.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import puka
import sys
client = puka.Client("amqp://localhost/")
promise = client.connect()
client.wait(promise)
promise = client.exchange_declare(exchange='direct_logs', type='direct')
client.wait(promise)
promise = client.queue... | promise = client.queue_bind(exchange='direct_logs', queue=queue_name,
routing_key=severity)
client.wait(promise) |
<|file_name|>find.rs<|end_file_name|><|fim▁begin|>use std;
use walkdir::WalkDir;
/// Recursively finds tests for the given paths.
pub fn in_paths<'a,P>(paths: P) -> Result<Vec<String>,String>
where P: IntoIterator<Item=&'a str> {
let mut tests = Vec::new();
for path in paths.into_iter() {
let path... | pub fn in_path(path: &str)
-> Result<Vec<String>,String> {
let metadata = match std::fs::metadata(path) { |
<|file_name|>ThumbnailGrid.stories.js<|end_file_name|><|fim▁begin|>import React from "react";
import { storiesOf, fixtures } from "helpers/storybook/exports";
import ThumbnailGrid from "..";
import EntityThumbnail from "global/components/atomic/EntityThumbnail";
import shuffle from "lodash/shuffle";
const issues = fix... | }
</ThumbnailGrid> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.