prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.conf import settings
from django.contrib.auth.decorators import user_passes_test
from django.core.paginator import Paginator
from django.core.urlresolvers import reverse
from django.http import Http404, HttpResponseRedirect, HttpResponse
from django.shortcu... | rx = re.compile(r'^m_([0-9a-f]+)')
rx_plural = re.compile(r'^m_([0-9a-f]+)_([0-9]+)')
file_change = False |
<|file_name|>types.go<|end_file_name|><|fim▁begin|>/*
Copyright 2015 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
Unless r... | // NonResourceAttributes includes the authorization attributes available for non-resource requests to the Authorizer interface
type NonResourceAttributes struct {
// Path is the URL path of the request |
<|file_name|>UIVisibilityBase.hpp<|end_file_name|><|fim▁begin|>#ifndef UIVISIBILITYBASE_HPP
#define UIVISIBILITYBASE_HPP
/*
This file is part of AlgAudio.
AlgAudio, Copyright (C) 2015 CeTA - Audiovisual Technology Center
AlgAudio is free software: you can redistribute it and/or modify
it under the terms of the GNU Le... | License, or (at your option) any later version.
|
<|file_name|>0072_auto_20180502_0834.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2018-05-02 08:34
from __future__ import unicode_literals
import dirtyfields.dirtyfields
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion... | ),
migrations.AddField(
model_name='whereabout', |
<|file_name|>LocatorUtilTest.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2000-2014 Vaadin Ltd.
*
* 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... | public void testIsUI3() {
boolean isUI = LocatorUtil |
<|file_name|>NSMachPort.py<|end_file_name|><|fim▁begin|>"""
LLDB AppKit formatters
part of The LLVM Compiler Infrastructure
This file is distributed under the University of Illinois Open Source
License. See LICENSE.TXT for details.
"""
# example summary provider for NSMachPort
# the real summary is now C++ code built ... | import lldb.formatters.Logger
|
<|file_name|>kimsufi_eu.js<|end_file_name|><|fim▁begin|>// Generated by CoffeeScript 1.10.0
var api, baseOVHKonnector, connector, name, slug;
baseOVHKonnector = require('../lib/base_ovh_konnector');
name = 'Kimsufi EU';
slug = 'kimsufi_eu';
api = {
endpoint: 'kimsufi-eu',<|fim▁hole|> appSecret: ''
};
connector ... | appKey: '', |
<|file_name|>input_helper.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# This tool helps you rebase your package to the latest version
# Copyright (C) 2013-2019 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as p... | import logging
from typing import cast |
<|file_name|>Suppressions.java<|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<|fim▁hole|> *
* Code generated by Microsoft (R) AutoRest Code Generator.
*/
package com.microsoft.azure.management.ad... | * license information. |
<|file_name|>373.js<|end_file_name|><|fim▁begin|>require("./46.js");<|fim▁hole|>require("./93.js");
require("./186.js");
require("./372.js");
module.exports = 373;<|fim▁end|> | |
<|file_name|>GuiAchievements.java<|end_file_name|><|fim▁begin|>// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) braces deadcode fieldsfirst
package net.minecraft.src;
import java.util.List;
import java.util.Random;
im... | } else |
<|file_name|>01nn_otto.py<|end_file_name|><|fim▁begin|>__author__ = 'alexs'
import theano.tensor as T
import theano
import numpy as np
import cPickle
import pandas as pd
from sklearn.preprocessing import LabelEncoder
from sklearn.preprocessing import StandardScaler
import numpy as np
import random
import json
def ge... |
class Layer():
def __init__(self, size): |
<|file_name|>util.js<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright 2013 Google Inc. All rights reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache... | 'returnValue': returnValue,
'error': error
});
}; |
<|file_name|>doc2vector.py<|end_file_name|><|fim▁begin|># -*- coding: UTF-8 -*-
import sys
sys.path.append("./")
import pandas as pd
import gensim
from utility.mongodb import MongoDBManager
from utility.sentence import segment, sent2vec
class Doc2Vector(object):
"""
文本转向量
"""
def __init__(self):
... | self.mongo_db.insert("title_vector", title) |
<|file_name|>index.d.ts<|end_file_name|><|fim▁begin|>export { default } from './GridListTile';<|fim▁hole|>export * from './GridListTile';<|fim▁end|> | |
<|file_name|>blog.js<|end_file_name|><|fim▁begin|>const express = require('express');
const feedr = require('feedr').create();
const router = express.Router();
router.get('/', (req, res) => {
feedr.readFeed('https://blog.schul-cloud.org/rss', {
requestOptions: { timeout: 2000 },
}, (err, data) => {
let blogFeed... | const date = new Date(e.pubDate); |
<|file_name|>kill.rs<|end_file_name|><|fim▁begin|>use log::{error, info, warn};
use pueue_lib::network::message::{Signal, TaskSelection};
use pueue_lib::state::GroupStatus;
use pueue_lib::task::TaskStatus;
use crate::ok_or_shutdown;
use crate::platform::process_helper::*;
use crate::state_helper::save_state;
use crat... | group.status = GroupStatus::Paused;
}
info!("Killing tasks of group {group_name}");
|
<|file_name|>template.rs<|end_file_name|><|fim▁begin|>use handlebars::Handlebars;
use std::path::{Path, PathBuf};
use glob::glob;
use std::sync::Mutex;
use itertools::Itertools;
use std::error::Error;
use std::borrow::Cow;
use serde_json::{Value, to_value};
use rocket::response::{Responder, Response};
use rocket::reque... | } |
<|file_name|>treeUtils.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.
*--------... | import * as _ from 'vs/base/parts/tree/browser/tree'; |
<|file_name|>config.in.rs<|end_file_name|><|fim▁begin|>/*
Copyright (c) 2015, Alex Frappier Lachapelle
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source co... | |
<|file_name|>gat-in-trait-path.rs<|end_file_name|><|fim▁begin|>#![feature(generic_associated_types)]
#![feature(associated_type_defaults)]
trait Foo {
type A<'a> where Self: 'a;
}
struct Fooy;
impl Foo for Fooy {
type A<'a> = &'a ();
}
#[derive(Clone)]
struct Fooer<T>(T);<|fim▁hole|> type A<'x> where T: ... |
impl<T> Foo for Fooer<T> { |
<|file_name|>DataTx.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
#... | #
"""
|
<|file_name|>health_test.go<|end_file_name|><|fim▁begin|>/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the... | defer resp.Body.Close()
Expect(resp.StatusCode).To(Equal(http.StatusOK))
})
}) |
<|file_name|>repeated_letters.py<|end_file_name|><|fim▁begin|>from pprint import pprint
from Conundrum.utils import sanitize
def decrypt(msg: str, repeated_letter: str) -> str:
"""
Extract every letter after an occurrence of the repeated letter
"""
msg = sanitize(msg)
result = []
remove_next... |
if __name__ == '__main__':
# Used in Movies 4
encrypted_msg = 'i bet pews or leisure chains can seem to stink of effort, george, under no illusions of vanity' |
<|file_name|>winprocess.py<|end_file_name|><|fim▁begin|># A module to expose various thread/process/job related structures and
# methods from kernel32
#
# The MIT License
#
# Copyright (c) 2006 the Mozilla Foundation <http://www.mozilla.org>
#
# Permission is hereby granted, free of charge, to any person obtaini... | LPPROCESS_INFORMATION = POINTER(PROCESS_INFORMATION)
# STARTUPINFO structure
|
<|file_name|>and_gate01.py<|end_file_name|><|fim▁begin|><|fim▁hole|> tmp = x1 * w1 + x2 * w2
if tmp <= theta:
print(0)
elif tmp > theta:
print(1)
AND(0, 0)
AND(1, 0)
AND(0, 1)
AND(1, 1)<|fim▁end|> | def AND(x1, x2):
w1, w2, theta = 0.5, 0.5, 0.7 |
<|file_name|>comment_controller.js<|end_file_name|><|fim▁begin|>var models=require('../models/models.js');
// Autoload :id de comentarios
exports.load=function (req,res,next,commentId) {
models.Comment.find({
where:{
id:Number(commentId)
}
}).then(function (comment) {
if(comment){
req.comment=comment;
... | res.render('comments/new.ejs', |
<|file_name|>etw_results.py<|end_file_name|><|fim▁begin|>"""
Parses the results found for the ETW started on a machine,
downloads the results and stops the ETW.
All credit to pauldotcom-
http://pauldotcom.com/2012/07/post-exploitation-recon-with-e.html
Module built by @harmj0y
"""
import settings
from lib i... | else: |
<|file_name|>nodemailer-mailgun-transport-tests.ts<|end_file_name|><|fim▁begin|>import mailgunTransport = require('nodemailer-mailgun-transport');
import nodemailer = require('nodemailer');
const opts: mailgunTransport.Options = {
auth: {
api_key: "harry"<|fim▁hole|>const optsWithDomain: mailgunTransport.O... | }
};
|
<|file_name|>atomics.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
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/li... | |
<|file_name|>crypto_utils.ts<|end_file_name|><|fim▁begin|>// tslint:disabled:no-var-requires
/**
* @module node_opcua_crypto
*/
import * as constants from "constants";
import * as crypto from "crypto";
import { createFastUninitializedBuffer } from "./buffer_utils";
import { Certificate, CertificatePEM, DER, PEM, Priv... | } |
<|file_name|>constants.spec.ts<|end_file_name|><|fim▁begin|>import {
URL_REGEX,
MESSAGE_SENDER_REGEX,
MENTION_REGEX,
CARD_CALLOUT_REGEX,
CALLOUT_BOUNDARY_REGEX,
} from './constants';
describe('RegEx', () => {
describe('URL_REGEX', () => {
it('should match and capture whole url in main capture group', (... | |
<|file_name|>base_test_onramp.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Yannick Vaucher, Ema... | "x-cim-ToAddress": "CH",
}
def _test_no_token(self): |
<|file_name|>mnist_benchmark.rs<|end_file_name|><|fim▁begin|>#![feature(test)]
extern crate o2lsh;
extern crate test;
use test::Bencher;
#[bench]
fn build_table_from_mnist_and_query(b: &mut Bencher) {
let mnist_data = match o2lsh::util::get_mnist_vector("mnist1k.dts") {
Ok(v) => v,
Err(reason) => ... | b.iter(run_test);
}
#[bench] |
<|file_name|>S15.4.4.10_A5.6.js<|end_file_name|><|fim▁begin|>// Copyright 2009 the Sputnik authors. All rights reserved.<|fim▁hole|>/**
* The slice property of Array has not prototype property
*
* @path ch15/15.4/15.4.4/15.4.4.10/S15.4.4.10_A5.6.js
* @description Checking Array.prototype.slice.prototype
*/
//CHE... | |
<|file_name|>task_review.go<|end_file_name|><|fim▁begin|>package dao
import (
"context"
xsql "database/sql"
"encoding/json"
"fmt"
"strings"
"time"
"go-common/app/admin/main/videoup-task/model"
"go-common/library/database/sql"
"go-common/library/log"
"go-common/library/xstr"
)
const (
_reviewCfg = 3
_c... | if err = rows.Scan(&trc.ID, &jsonCfg, &cfgType, &trc.Bt, &trc.Et, &trc.State, &trc.UID, &trc.Uname, &trc.Desc, &trc.Mt); err != nil {
log.Error("rows.Scan error(%v)", err) |
<|file_name|>header.js<|end_file_name|><|fim▁begin|>module.exports = {
<% if (modules === 'systemjs') { -%>
templateUrl: 'app/header.html'<|fim▁hole|> template: require('./header.html')
<% } -%>
};<|fim▁end|> | <% } else { -%> |
<|file_name|>run.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
__version__= "$Version: $"
__rcsid__="$Id: $"
import matplotlib
#matplotlib.use('WX')
from wx import MilliSleep
from wx import SplashScreen, SPLASH_CENTRE_ON_SCREEN, SPLASH_TIMEOUT
import os
import sys
import warnings
from . import zpickle
from ... |
self.params['load_sim_file']=self.tmpfile
self.running=False
if self.quitting: |
<|file_name|>ConcurrentNavigableMapTestSuiteBuilder.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2015 The Guava 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... | import com.google.common.annotations.GwtIncompatible; |
<|file_name|>reveal.js<|end_file_name|><|fim▁begin|>/*!
* reveal.js
* http://lab.hakim.se/reveal-js
* MIT licensed
*
* Copyright (C) 2016 Hakim El Hattab, http://hakim.se
*/
(function( root, factory ) {
if( typeof define === 'function' && define.amd ) {
// AMD. Register as an anonymous module.
define( functi... | // the other elements
element.style.height = '0px';
newHeight = height - element.parentNode.offsetHeight; |
<|file_name|>basic_sniff.py<|end_file_name|><|fim▁begin|>'''
The MIT License (MIT)
<|fim▁hole|>of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or s... | Copyright (c) 2015 Dan Gunter
Permission is hereby granted, free of charge, to any person obtaining a copy |
<|file_name|>foodentery.directive.ts<|end_file_name|><|fim▁begin|>import { Directive, ElementRef ,OnInit} from "@angular/core";
@Directive({
selector: '[scoller]',
})
export class FoodEnteryDirective implements OnInit{
private el: ElementRef;
constructor(el: ElementRef) {
this.el=el;
... | ngOnInit(){
var el=this.el; |
<|file_name|>repeating_task.cc<|end_file_name|><|fim▁begin|>/*
* Copyright 2019 The WebRTC Project Authors. All rights reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights gr... | if (!alive_flag_->alive())
return true;
|
<|file_name|>test_modeling_flax_gpt2.py<|end_file_name|><|fim▁begin|># Copyright 2021 The HuggingFace Team. 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:/... | pt_inputs = {k: torch.tensor(v.tolist()) for k, v in prepared_inputs_dict.items()}
# load corresponding PyTorch class
pt_model_class_name = model_class.__name__[4:] # Skip the "Flax" at the beginning |
<|file_name|>integer.py<|end_file_name|><|fim▁begin|>from lexer import lang
from ..tree import Node
class Integer(Node):
datatype = lang.SEMANTIC_INT_TYPE
"""docstring for Integer."""
def __init__(self, symbol, token):
super().__init__(symbol, token)
<|fim▁hole|><|fim▁end|> | def generate_code(self, **cond):
array, line = Node.assignated_array()
Node.array_append(array, f'{line} LIT {self.symbol}, 0') |
<|file_name|>multiplication.js<|end_file_name|><|fim▁begin|>/**
* 乘法操作符
*/
define( function ( require, exports, modules ) {
var kity = require( "kity" );
return kity.createClass( 'MultiplicationOperator', {
base: require( "operator/binary-opr/left-right" ),
constructor: function () {
... | rtl = new kity.Rect( 20, 0, 3, 43, 3 ).fill( "black" ); |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>extern crate uuid;
extern crate proc_macro2;
extern crate quote;
#[cfg(feature = "native_coin_cbc")]
extern crate coin_cbc;
#[cfg(feature = "minilp")]
extern crate minilp;
pub mod util;
pub mod dsl {
pub mod variables;
pub use self::variables::*;
pub mod o... | pub mod format {
pub mod lp_format;
} |
<|file_name|>defaults_test.go<|end_file_name|><|fim▁begin|>/*
Copyright 2015 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
... | // verify that if a min is provided, it will be the default if no limit is specified
requestMinValue := defaultRequest[v1.ResourceMemory]
if requestMinValue.String() != "100Mi" { |
<|file_name|>gatewaydef.py<|end_file_name|><|fim▁begin|># Copyright (c) 2014 by Ecreall under licence AGPL terms
# available on http://www.gnu.org/licenses/agpl.html
# licence: AGPL
# author: Amen Souissi
from dace.processinstance.gateway import (
ExclusiveGateway, ParallelGateway, InclusiveGateway)
from .core i... | initiator=self)
initial_path.add_transition(transition)
startable_paths = nodedef.find_startable_paths(
initial_path, self) |
<|file_name|>publisher.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
from werkzeug.exceptions import ServiceUnavailable, NotFound
from r5d4.flask_redis import get_conf_db
def publish_transaction(channel, tr_type, payload):
conf_db = get_conf_db()
if tr_type not in ["insert", "delete"]... | if listened != subscribed:
raise ServiceUnavailable((
"Subscription-Listened mismatch",
"Listened count = %d doesn't match Subscribed count = %d" % ( |
<|file_name|>CMDParser.cpp<|end_file_name|><|fim▁begin|>/********************************************************************************
-- Halo Dev Controls
Copyright © 2011 Jesus7Freak
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public L... | SpecificMsg = FailLowAdminLvl;
|
<|file_name|>screenshot.js<|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/. */
/* eslint-env browser */
"use strict";
const {
TAKE_SC... | function simulateCameraEffects(node) {
if (Services.prefs.getBoolPref("devtools.screenshot.audio.enabled")) {
let cameraAudio = new window.Audio(CAMERA_AUDIO_URL); |
<|file_name|>hook.go<|end_file_name|><|fim▁begin|>// Copyright 2012, 2013 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
// hook provides types that define the hooks known to the Uniter
package hook
import (
"fmt"
"gopkg.in/juju/charm.v6-unstable/hooks"
"gopkg.in/juju/names.v2"
)
// T... | hooks.CollectMetrics, hooks.MeterStatusChanged, hooks.UpdateStatus:
return nil
case hooks.Action:
return fmt.Errorf("hooks.Kind Action is deprecated") |
<|file_name|>_color.py<|end_file_name|><|fim▁begin|>import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="color", parent_name="scatter.unselected.textfont", **kwargs
):
super(ColorValidator, self).__init__(
... | **kwargs
) |
<|file_name|>dataSetToJS.js<|end_file_name|><|fim▁begin|>import explicitElementToString from './elementToString';
import * as util from './util';
/**
* converts an explicit dataSet to a javascript object
* @param dataSet
* @param options
*/
export default function explicitDataSetToJS (dataSet, options) {
if (dat... |
asString = undefined;
if (element.length < options.maxElementLength) {
asString = explicitElementToString(dataSet, element); |
<|file_name|>zlb.py<|end_file_name|><|fim▁begin|>from django.shortcuts import render_to_response
from django.template import RequestContext
from django.core.exceptions import ObjectDoesNotExist
from django.views.decorators.cache import never_cache
from django.http import HttpResponse, HttpResponseRedirect
from session_... | form = ZLBForm(request.POST) |
<|file_name|>stata.py<|end_file_name|><|fim▁begin|>"""
pygments.lexers.stata
~~~~~~~~~~~~~~~~~~~~~
Lexer for Stata
:copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, default, include, word... | include('numbers'),
include('keywords'),
include('operators'),
include('format'), |
<|file_name|>wxsimagetreeeditordlg.cpp<|end_file_name|><|fim▁begin|>/** \file wxsimagetreeeditordlg.cpp
*
* This file is part of wxSmith plugin for Code::Blocks Studio
* Copyright (C) 2010 Gary Harris
*
* wxSmith is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public Lice... | const long wxsImageTreeEditorDlg::ID_STATICTEXT9 = wxNewId();
const long wxsImageTreeEditorDlg::ID_COMBOBOX4 = wxNewId();
const long wxsImageTreeEditorDlg::ID_STATICTEXT10 = wxNewId(); |
<|file_name|>collada.rs<|end_file_name|><|fim▁begin|>/// Implements the logic behind converting COLLADA documents to polygon-rs meshes.
extern crate parse_collada as collada;
use math::*;
use polygon::geometry::mesh::*;
pub use self::collada::{
AnyUri,
ArrayElement,
Collada,
GeometricElement,
Geom... |
unimplemented!();
} |
<|file_name|>app.component.ts<|end_file_name|><|fim▁begin|>import { Component } from '@angular/core';
@Component({
selector: 'my-app',
template:`
<h1>{{title}}</h1>
<ul class="heroes">
<li *ngFor="let hero of heroes" (click)="onSelect(hero)"">
<span class="badge">{{hero.id}}</span> {{hero.name}}
... | <h2>{{selectedHero.name}} details</h2>
<div><label>id: </label>{{selectedHero.id}}</div>
<div>
<label>name: </label> |
<|file_name|>nxos_vlan.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible 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 the License, or
# (at y... | #body = execute_show_command(command, module, command_type='cli_show_ascii')[0]
value = '' |
<|file_name|>MonitorPlatformServerDao.java<|end_file_name|><|fim▁begin|>package com.asura.monitor.platform.dao;
import com.asura.framework.base.paging.PagingResult;
import com.asura.framework.base.paging.SearchMap;
import com.asura.framework.dao.mybatis.base.MybatisDaoContext;
import com.asura.framework.dao.mybatis.pa... | * @version 1.0
* @date 2016-11-07 11:35:05
* @since 1.0 |
<|file_name|>keyword-mod-as-identifier.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.... | // option. This file may not be copied, modified, or distributed
// except according to those terms.
// This file was auto-generated using 'src/etc/generate-keyword-tests.py mod' |
<|file_name|>search.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# vim: sw=4:ts=4:sts=4:fdm=indent:fdl=0:
# -*- coding: UTF8 -*-
#
# A sword KJV indexed search module.
# Copyright (C) 2012 Josiah Gordon <josiahg@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the ... | verse_text = self._clean_regex.sub('', verse_text)
verse_text = self._notes_regex.sub(self._notes_str, verse_text)
|
<|file_name|>true.rs<|end_file_name|><|fim▁begin|>// rustfmt-reorder_impl_items: true<|fim▁hole|>struct Dummy;
impl Iterator for Dummy {
type Item = i32;
fn next(&mut self) -> Option<Self::Item> {
None
}
}<|fim▁end|> | |
<|file_name|>plugin.js<|end_file_name|><|fim▁begin|>/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.3.1 (... | return;
}
while (i--) {
content = content.replace(nonEditableRegExps[i], replaceMatchWithSpan(editor, content, getNonEditableClass(editor))); |
<|file_name|>numbers_international.py<|end_file_name|><|fim▁begin|>"""
The Plaid API
The Plaid REST API. Please see https://plaid.com/docs/api for more details. # noqa: E501
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from plaid.model_utils import (... | required_properties = set([
'_data_store',
'_check_type',
'_spec_property_naming', |
<|file_name|>test_run_script.py<|end_file_name|><|fim▁begin|>import subprocess
import pytest
from utils import *
@all_available_simulators()
def test_filter(tmp_path, simulator):
unit_test = tmp_path.joinpath('some_unit_test.sv')
unit_test.write_text('''
module some_unit_test;
import svunit_pkg::*;
`in... |
`SVTEST(some_passing_test) |
<|file_name|>movie.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import allure
from selenium.webdriver.common.by import By
from .base import BasePage
from .elements import SimpleInput, SimpleText
from .blocks.nav import NavBlock
class BrowseMoviePageLocators(object):
"""Локаторы страницы просмотра инф... | def click_remove_button(self):
"""
:rtype: HomePage |
<|file_name|>gecko.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
//! Specified types for legacy Gecko-only properties.
use cra... | /// The value of an IntersectionObserver's rootMargin property.
/// |
<|file_name|>tar.py<|end_file_name|><|fim▁begin|>"""SCons.Tool.tar
Tool-specific initialization for tar.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001 - 2015 The SCons Foundation
#
#... | #
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE |
<|file_name|>mnist.py<|end_file_name|><|fim▁begin|># Copyright 2016 Anonymous researcher(s)
# This file is part of BinaryNet.
# BinaryNet 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 ... | test_loss = T.mean(T.sqr(T.maximum(0.,1.-target*test_output)))
test_err = T.mean(T.neq(T.argmax(test_output, axis=1), T.argmax(target, axis=1)),dtype=theano.config.floatX)
|
<|file_name|>video.hpp<|end_file_name|><|fim▁begin|>/* $Id$ */
/*
Copyright (C) 2003 - 2013 by David White <dave@whitevine.net>
Part of the Battle for Wesnoth Project http://www.wesnoth.org/
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public Li... | //an object which prevents resizing of the screen occurring during
//its lifetime.
struct resize_lock { |
<|file_name|>errors.go<|end_file_name|><|fim▁begin|>// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package kinesisvideo
const (
// ErrCodeAccountStreamLimitExceededException for service response error code
// "AccountStreamLimitExceededException".
//
// The number of streams created for the... | ErrCodeInvalidResourceFormatException = "InvalidResourceFormatException"
// ErrCodeNotAuthorizedException for service response error code |
<|file_name|>SmsAction.java<|end_file_name|><|fim▁begin|>package com.metrink.action;
import org.apache.commons.mail.EmailException;
import org.apache.commons.mail.SimpleEmail;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.inject.Provider;
import com.metrink.alert.ActionBean;
import com.me... | public abstract class SmsAction implements Action {
private static final Logger LOG = LoggerFactory.getLogger(SmsAction.class);
private final Provider<SimpleEmail> emailProvider; |
<|file_name|>Overview.cpp<|end_file_name|><|fim▁begin|>/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
/*
Sonic Visualiser
An audio file viewer and annotation editor.
Centre for Digital Music, Queen Mary, University of London.
This file copyright 2006 Chris Cannam and QMU... |
if (getXForFrame(m_playPointerFrame) != getXForFrame(f)) changed = true;
m_playPointerFrame = f;
|
<|file_name|>ninja_test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
""" Unit tests for the ninja.py file. """
import sys
import unittest
import gyp.ge... | |
<|file_name|>widgettoolbarrepository.d.ts<|end_file_name|><|fim▁begin|>import { Plugin } from '@ckeditor/ckeditor5-core';
import { DocumentSelection } from '@ckeditor/ckeditor5-engine';
import Selection from '@ckeditor/ckeditor5-engine/src/view/selection';
import EngineView from '@ckeditor/ckeditor5-engine/src/view/vie... | } |
<|file_name|>archive.py<|end_file_name|><|fim▁begin|>import os
import six
from aleph.util import checksum
class Archive(object):
def _get_file_path(self, meta):
ch = meta.content_hash
if ch is None:
raise ValueError("No content hash available.")
path = os.path.join(ch[:2], ch... |
Return an updated metadata object. If ``move`` is given, the
original file will not exist afterwards. |
<|file_name|>newick_git.py<|end_file_name|><|fim▁begin|>import string
class Tree:
def __init__(self,u,vs):
self.u = u
self.vs = vs
def distance(self,w):
if w == self.u:
return 0,[w]
for v in self.vs:
d,path = v.distance(w)
if d != -1:
... | |
<|file_name|>mouth.ts<|end_file_name|><|fim▁begin|>import type {<|fim▁hole|> ComponentPickCollection,
ColorPickCollection,
} from '../static-types';
export const mouth: ComponentGroup = {
default: (components: ComponentPickCollection, colors: ColorPickCollection) =>
`<path d="M27.93 46a1 1 0 0 1 1-1h9.14a1 1 ... | ComponentGroup, |
<|file_name|>ellipse.js<|end_file_name|><|fim▁begin|>'use strict';
QUnit.module('ellipse', function() {
var boundaryOnAngle = function(ellipse, angle) {
var a = ellipse.a;
var b = ellipse.b;
var rad = angle * Math.PI / 180;
return g.Point(ellipse.x + a * Math.cos(rad), ellipse.y ... | for (var angle = 0; angle <= 360; angle += 5) { |
<|file_name|>core_test.py<|end_file_name|><|fim▁begin|># Copyright 2015 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
#
# http://www.apache.... | self.assertEqual(outputs.get_shape().as_list(), [5, 7])
inputs = random_ops.random_uniform((5, 2, 3), seed=1)
outputs = dense(inputs) |
<|file_name|>mtfn.cpp<|end_file_name|><|fim▁begin|>/* Copyright (c) 2015 Michael Hamilton.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with teh License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/... | void sound::vowel( void )
{
string::const_iterator& c( m_cursor );
|
<|file_name|>globals.d.ts<|end_file_name|><|fim▁begin|>declare interface KernelOpts {
//
}
declare interface StonehengeOpts {
//
}
declare namespace NodeJS {
interface Global {
kernel: StonehengeKernel
opts: StonehengeOpts<|fim▁hole|> hardReset: () => void
}
}
// Extended Screeps globals
interfac... | |
<|file_name|>loglisteners.js<|end_file_name|><|fim▁begin|>(function() {
'use strict';
angular
.module('blocks.logger')
.factory('logListeners', logListeners);
/**
* @ngdoc service
* @name spaghetto.logger:logListeners
*
* @description
* Manage different log listene... | * @param {Object} logListener log listener object
* @param {Function} logListener.error log an error message
* @param {Function} logListener.info log an info message |
<|file_name|>drive_integration.py<|end_file_name|><|fim▁begin|>__author__ = "Wren J. R. (uberfastman)"
__email__ = "wrenjr@yahoo.com"
# code snippets taken from: http://stackoverflow.com/questions/24419188/automating-pydrive-verification-process
import datetime
import logging
from pathlib import Path
from pydrive.aut... | f"mimeType='application/vnd.google-apps.folder' and " |
<|file_name|>logic.py<|end_file_name|><|fim▁begin|>from ..workspace import Block
from twisted.internet import defer
from .variables import lexical_variable
import operator
class logic_null (Block):
def eval (self):
return defer.succeed(None)
class logic_boolean (Block):
def eval (self):
return defer.succeed(... | "EQ": operator.eq,
"NEQ": operator.ne, |
<|file_name|>restyle_damage.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
//! The restyle damage is a hint that tells layout whi... | |
<|file_name|>hw.api.homewatch.jsonlist.js<|end_file_name|><|fim▁begin|>/**
* Created by RSC on 05.04.2016.
*/
myApp.factory('HomeWatchFactory', function ($http, $q, $rootScope, $log) {
return {
getFhemJsonList: function (name, type) {
var url = '';
if ($rootScope.config.connecti... | |
<|file_name|>harvester.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import traceback
from ckan.lib.helpers import json
from ckanext.harvest.model import HarvestObject, HarvestObjectExtra
from ckanext.harvest.harvesters import HarvesterBase
from ckanext.geocat.utils import search_utils, csw_processor, ogdch... | import ckan.plugins.toolkit as tk
from ckan import model
from ckan.model import Session
import uuid |
<|file_name|>CauseOfDeath.java<|end_file_name|><|fim▁begin|>package org.mafagafogigante.dungeon.stats;
import org.mafagafogigante.dungeon.game.Id;
import org.jetbrains.annotations.NotNull;
import java.io.Serializable;
/**
* CauseOfDeath class that defines what kind of death happened and the ID of the related Item ... | } |
<|file_name|>app.js<|end_file_name|><|fim▁begin|>var jsVars = {
appBaseUrl: null,
appBasePath: null,
init: function ()
{
var jsVarsAttributes = angular.element('#js-vars')[0].attributes;
jsVars.appBaseUrl = jsVarsAttributes['data-base-url'].value;
jsVars.appBaseP... | var now = new Date();
var utc_now = new Date(
now.getUTCFullYear(), |
<|file_name|>Cache2.java<|end_file_name|><|fim▁begin|>package qj.util.cache;
import java.util.ArrayList;
import qj.util.funct.F2;
public class Cache2<A, B, T> {
private final F2<A, B, T> func;
ArrayList<Holder> holders = new ArrayList<Holder>();
public Cache2(F2<A, B, T> func) {
this.func = func;
}
public... | }
T t = func.e(a, b);
holders.add(new Holder(a, b, t)); |
<|file_name|>screenshot.rs<|end_file_name|><|fim▁begin|>extern crate kiss3d;
extern crate nalgebra as na;
use std::path::Path;
use kiss3d::light::Light;
use kiss3d::window::Window;
use na::{UnitQuaternion, Vector3};
// Based on cube example.
fn main() {
let mut window = Window::new("Kiss3d: screenshot");
let... | ));
window.set_light(Light::StickToCamera);
|
<|file_name|>print_course_duplicates_yaml.py<|end_file_name|><|fim▁begin|>"""Management command for uploading master json data for OCW courses"""
from django.core.management import BaseCommand
<|fim▁hole|> """Print course duplicates yaml"""
help = "Print course duplicates yaml"
def handle(self, *args, **op... | from course_catalog.etl.deduplication import generate_duplicates_yaml
class Command(BaseCommand): |
<|file_name|>xml-parser.js<|end_file_name|><|fim▁begin|>var parseString = require('xml2js').parseString;
module.exports = function(req, res, next){
if (req.is('xml')){
var data = '';
req.setEncoding('utf8');<|fim▁hole|> req.on('end', function(){
if (!data){
return next();
}
parse... | req.on('data', function(chunk){
data += chunk;
}); |
<|file_name|>assertions_on_constants.rs<|end_file_name|><|fim▁begin|>//FIXME: suggestions are wrongly expanded, this should be fixed along with #7843
#![allow(non_fmt_panics)]
macro_rules! assert_const {
($len:expr) => {
assert!($len > 0);
debug_assert!($len < 0);
};
}
fn main() {
assert!(t... | |
<|file_name|>storage.py<|end_file_name|><|fim▁begin|>from django.conf import settings
from images.models import S3Connection
from shutil import copyfileobj
import tinys3
import os
import urllib
class LocalStorage(object):
def __init__(self, filename):
self.filename = filename
def get_file_data(self):
... | data = open(image_path, 'r').read()
return data |
<|file_name|>kepoutlier.py<|end_file_name|><|fim▁begin|>from .utils import PyKEArgumentHelpFormatter
import numpy as np
from astropy.io import fits as pyfits
from matplotlib import pyplot as plt
from tqdm import tqdm
from . import kepio, kepmsg, kepkey, kepfit, kepstat, kepfunc
__all__ = ['kepoutlier']
def kepoutli... | The polynomial order of each best-fit function.
niter : int
If outliers are found in a particular data section, that data will be |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.