prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>ActionWithdrawTest.java<|end_file_name|><|fim▁begin|>package com.simplyian.superplots.actions; import static org.mockito.Matchers.contains; import static org.mockito.Mockito.verify; import static org.powermock.api.mockito.PowerMockito.mock; import static org.powermock.api.mockito.PowerMockito.when; impor...
verify(player).sendMessage(contains("must be an administrator")); }
<|file_name|>test_log.py<|end_file_name|><|fim▁begin|>from chimera.core.chimeraobject import ChimeraObject from chimera.core.manager import Manager from chimera.core.exceptions import ChimeraException from nose.tools import assert_raises import chimera.core.log import logging log = logging.getLogger("chimer...
<|file_name|>login.js<|end_file_name|><|fim▁begin|>window.onload=function() { var start = document.getElementById('start');<|fim▁hole|> if (name == "") { alert("请输入名字"); return false; } if (!isName(name)) { alert("请输入正确的姓名") return false; ...
start.onclick = function () { var name = document.getElementById('Name').value; var id = document.getElementById('Id').value; var tel = document.getElementById("Tel").value;
<|file_name|>events.js<|end_file_name|><|fim▁begin|>function runTest(config,qualifier) { var testname = testnamePrefix( qualifier, config.keysystem ) + ', basic events'; var configuration = getSimpleConfigurationForContent( config.content ); if ( config.initDataType && config.initData ) configuration.ini...
initData = getInitData(config.content, initDataType); } return access.createMediaKeys();
<|file_name|>pet-add.component.spec.ts<|end_file_name|><|fim▁begin|>import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { PetAddComponent } from './pet-add.component'; describe('PetAddComponent', () => { let component: PetAddComponent;<|fim▁hole|> let fixture: ComponentFixture<PetAddCo...
<|file_name|>Battery.cpp<|end_file_name|><|fim▁begin|>/* Copyright_License { XCSoar Glide Computer - http://www.xcsoar.org/ Copyright (C) 2000-2014 The XCSoar Project A detailed list of copyright holders can be found in the file "AUTHORS". This program is free software; you can redistribute it and/or modify...
if (result >= sizeof(sps)) { if (sps.BatteryLifePercent != BATTERY_PERCENTAGE_UNKNOWN){ Power::Battery::RemainingPercent = sps.BatteryLifePercent;
<|file_name|>builder.py<|end_file_name|><|fim▁begin|># This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) GNU Lesser General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (at your option) any later version. # # ...
if len(resolved) > 0: if resolved.mixed(): value = Factory.property(resolved.name) md = value.__metadata__
<|file_name|>parse_version.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. ## this functions are taken from the setuptools package (version 0.6c8) ## http://peak.telecommunity.com/DevCenter/PkgResources#parsing-utilities from __future_...
alphabetically follows "final" represents a "patch level". So, "2.4-1" is assumed to be a branch or patch of "2.4", and therefore "2.4.1" is considered newer than "2.4-1", whic in turn is newer than "2.4".
<|file_name|>function.rs<|end_file_name|><|fim▁begin|>use std::borrow::ToOwned; use std::collections::HashMap; use std::collections::hash_map::Entry; use std::ops::Index; use std::{error,fmt,iter}; use sxd_document::XmlChar; use super::{EvaluationContext,Functions,Value}; use super::nodeset::Nodeset; pub trait Funct...
let chars = s.chars().enumerate(); let selected_chars = chars.filter_map(|(p, s)| { let p = (p+1) as f64; // 1-based indexing if p >= start && p < start + len {
<|file_name|>compile.py<|end_file_name|><|fim▁begin|>from sys import stdout from collections import defaultdict from .parse import main, HTMLTag def maybe_call(f, *args, **kwargs): if callable(f): return f(*args, **kwargs) return f class Compiler(object): def __init__(self, stream): sel...
# tag(id=xxx) takes precedence over tag#xxx tag.id_ = None elif k == 'class': # merge tag(class=xxx) with tag.xxx
<|file_name|>base.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use std::vec; use stb_image = stb_image::image; // FIXME: Image...
1 => image.data[pixel * 4 + 1], 2 => image.data[pixel * 4 + 0],
<|file_name|>enums.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, division, print_function, unicode_literals CASH_TRANSACTION_TYPES = {'Cashflow', 'Coupon', 'Dividend', 'Payment'} TRANSACTION_TYPES = {'Allocation', 'Block', 'Exercise', 'Expiry', 'Journal', 'Maturity', 'Net', ...
<|file_name|>school-competencies-list.js<|end_file_name|><|fim▁begin|>import Component from '@ember/component'; export default Component.extend({ domains: null<|fim▁hole|><|fim▁end|>
});
<|file_name|>count.py<|end_file_name|><|fim▁begin|>""" count number of reads mapping to features of transcripts """ import os import sys import itertools import pandas as pd import gffutils from bcbio.utils import file_exists from bcbio.distributed.transaction import file_transaction from bcbio.log import logger from...
if not file_exists(dbfn):
<|file_name|>SerialExecutor.cpp<|end_file_name|><|fim▁begin|>/* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include "SerialExecutor.h" namespace facebook { namespace hermes { n...
<|file_name|>SearchPage.tsx<|end_file_name|><|fim▁begin|>import * as React from 'react'; import { Menu, Container, Checkbox, Icon } from 'semantic-ui-react'; import * as SelectRP from 'react-select-plus'; import SearchPageState from '../State/Pages/SearchPageState'; import MealSearchFilter from '../State/Meal/Filters/...
return txtFilter == filter; });
<|file_name|>rakibolanamalagasy.py<|end_file_name|><|fim▁begin|>from threading import Lock import requests from api.decorator import critical_section from api.importer import AdditionalDataImporter from api.importer import AdditionalDataImporterError from api.importer.wiktionary import dyn_backend rmi_lock = Lock() ...
self.data_type = 'rakibolana/raw' try:
<|file_name|>threads.rs<|end_file_name|><|fim▁begin|>//! Threading code. use std::mem; use remacs_macros::lisp_fn; use remacs_sys::{current_thread, thread_state}; use buffers::LispBufferRef; use lisp::{ExternalPtr, LispObject}; use lisp::defsubr; pub type ThreadStateRef = ExternalPtr<thread_state>; pub struct Thre...
#[inline] pub fn is_alive(self) -> bool { !self.m_specpdl.is_null()
<|file_name|>client.js<|end_file_name|><|fim▁begin|>var nock = require('nock'); var Mockaroo = require('../lib/mockaroo'); require('chai').should(); describe('Client', function() { describe('constructor', function() { it('should require an api key', function() { (function() { ne...
<|file_name|>IADSR.cpp<|end_file_name|><|fim▁begin|>//////////////////////////////////////////////////////////////////////// // This file is part of the SndObj library // // 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 // th...
if(!m_error){ float a = 0.f; for(m_vecpos=0; m_vecpos < m_vecsize; m_vecpos++){ if(m_enable){
<|file_name|>useful.py<|end_file_name|><|fim▁begin|># # This file is part of pyasn1 software. # # Copyright (c) 2005-2017, Ilya Etingof <etingof@gmail.com> # License: http://pyasn1.sf.net/license.html #<|fim▁hole|> NoValue = univ.NoValue noValue = univ.noValue class ObjectDescriptor(char.GraphicString): __doc__ =...
from pyasn1.type import univ, char, tag __all__ = ['ObjectDescriptor', 'GeneralizedTime', 'UTCTime']
<|file_name|>build.rs<|end_file_name|><|fim▁begin|>// Copyright © 2015, Peter Atashian<|fim▁hole|> println!("cargo:rustc-link-lib=comctl32"); }<|fim▁end|>
// Licensed under the MIT License <LICENSE.md> fn main() {
<|file_name|>create.js<|end_file_name|><|fim▁begin|>;(function(){ 'use strict' const express = require('express'); const router = express.Router(); router.post('/', function(req, res){ console.error('route: /create, ip: %s, time: %s', req.ip, new Date().toTimeString().substr(0,9)); console.error(Object.ke...
})();
<|file_name|>grunt-iconv.js<|end_file_name|><|fim▁begin|>/* * y * * * Copyright (c) 2013 ssddi456 * Licensed under the MIT license. */ 'use strict'; var iconvLite = require('iconv-lite'); var _ = require('underscore'); var path = require('path'); module.exports = function(grunt) { function det...
<|file_name|>StmtNodes.py<|end_file_name|><|fim▁begin|>from .Child import Child from .Node import Node # noqa: I201 STMT_NODES = [ # continue-stmt -> 'continue' label? ';'? Node('ContinueStmt', kind='Stmt', children=[ Child('ContinueKeyword', kind='ContinueToken'), Child('La...
<|file_name|>test_functional.py<|end_file_name|><|fim▁begin|># # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
<|file_name|>bitcoin.cpp<|end_file_name|><|fim▁begin|>// Copyright (c) 2011-2013 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include <QApplication> #include "bitcoingui.h" #include "clientmodel.h...
#include "guiconstants.h" #include "init.h" #include "util.h" #include "ui_interface.h"
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>import http = require('http'); import path = require('path'); import fs = require('fs'); import request = require('request'); import express = require('express'); import calais = require('calais-entity-extractor'); interface IGeoJsonGeometry { type: string; co...
for (var key in json) { if (!json.hasOwnProperty(key)) continue; var item = json[key]; if (!item.hasOwnProperty('_typeGroup') || !item.hasOwnProperty('name')) continue;
<|file_name|>beanbot-client.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import sys, re from socket import * serve_addr = ('localhost', 47701) if __name__ == '__main__':<|fim▁hole|> IRC_ULINE = '\x1f' IRC_NORMAL = '\x0f' IRC_RED = '\x034' IRC_LIME = '\x039' IRC_BLUE = '\x0312' repo, branch, author, ...
IRC_BOLD = '\x02'
<|file_name|>ZabbixHelper.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- ''' Created on 2015/04/17 @author: 2015 AIST ''' import time from django.conf import settings from zbxsend import Metric, send_to_zabbix import logging import json from vt_manager_kvm.communication.geni.v3.configurators.handlerconfigurat...
tmpobj = {"data": discoveryList} discoveryStr = json.dumps(tmpobj) metric = Metric(vm.name, settings.ZBX_ITEM_DISCOVERY_USERVMSTATUS, str(discoveryStr), timestamp) ZabbixHelper.sendZabbix(metric)
<|file_name|>recovered-block.rs<|end_file_name|><|fim▁begin|>use std::env; pub struct Foo {<|fim▁hole|>} pub fn foo() -> Foo { let args: Vec<String> = env::args().collect(); let text = args[1].clone(); pub Foo { text } } //~^^ ERROR missing `struct` for struct definition pub fn bar() -> Foo { fn ...
text: String
<|file_name|>kikidocs.py<|end_file_name|><|fim▁begin|>from celery.app.task import BaseTask from sphinx.ext import autodoc class TaskDocumenter(autodoc.DataDocumenter): @classmethod def can_document_member(cls, member, membername, isattr, parent): if isinstance(member, BaseTask): return True<|fim▁hole|> def se...
<|file_name|>DefinitionFormalParametersImpl.java<|end_file_name|><|fim▁begin|>// This is a generated file. Not intended for manual editing. package org.modula.parsing.definition.psi.impl; import java.util.List; import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; import com.intellij.psi.PsiEleme...
}
<|file_name|>treeMultiSelectorCtrl.js<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2021 Inera AB (http://www.inera.se) * * This file is part of sklintyg (https://github.com/sklintyg). * * sklintyg is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as ...
modalInstance.result.then(function() {
<|file_name|>HomeController.js<|end_file_name|><|fim▁begin|>(function() { 'use strict'; function HomeController($scope, $q, $timeout) { var self = this; self.time = 50; self.message = "Mensagem para mostrar"; var promiseTimeout; var deferredToast; self.mo...
deferredToast.promise.then(toastResolved, toastRejected); self.activeShow = true;
<|file_name|>trazabilidad_articulos.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright (C) 2005-2008 Francisco José Rodríguez Bogado, # # Diego Muñoz Escala...
productos = [] if isinstance(objeto, pclases.Lote):
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2017-09-21 12:06 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): ...
}, ),
<|file_name|>h3.py<|end_file_name|><|fim▁begin|>#!python3 import requests import yaml<|fim▁hole|>import sys import re import logging import ssl from requests.auth import HTTPDigestAuth from requests.auth import HTTPBasicAuth from lxml import etree as ET from requests.packages.urllib3.exceptions import InsecureRequestWa...
import time import enum
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>use ini::Ini; use ini::Properties; use postgres::config::Config; fn build_from_section(section: &Properties) -> Config { let mut username: Option<String> = None; let mut password: Option<String> = None; let mut builder = Config::new(); let mut options = String::ne...
) -> Option<Config> { if let Ok(home) = std::env::var("HOME")
<|file_name|>buffer-builder.js<|end_file_name|><|fim▁begin|>// Copyright 2015-present runtime.js project authors<|fim▁hole|>// // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, ...
// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at
<|file_name|>create_default_super_user.py<|end_file_name|><|fim▁begin|>from django.contrib.auth.models import User from django.core.management.base import BaseCommand from djangoautoconf.local_key_manager import get_default_admin_username, \ get_default_admin_password from djangoautoconf.management.commands.web_man...
print("default admin created") else:
<|file_name|>macros.rs<|end_file_name|><|fim▁begin|>#[macro_export] macro_rules! declare_ser_tests { ($($name:ident { $($value:expr => $tokens:expr,)+ })+) => { $( #[test] fn $name() { $( ::token::assert_ser_tokens(&$value, $tokens); ...
macro_rules! btreemap { () => { BTreeMap::new()
<|file_name|>macros.rs<|end_file_name|><|fim▁begin|>#[macro_export] #[cfg(not(feature = "clipboard"))] macro_rules! editeur_new { ($graphic: expr, $output: expr) => ({ use std::io; Editeur { graphic: $graphic, output: $output, input: io::stdin().events(), ...
}); }
<|file_name|>remove.rs<|end_file_name|><|fim▁begin|>use libc::{c_ulong, c_ulonglong, c_void}; use super::super::error_type::ErrorType; use super::super::instance::Instance; use super::format_error; #[repr(C)] #[derive(Debug, Clone, Copy)] pub struct RemoveInternal { pub cookie: *mut c_void, pub key: *const c...
impl RemoveInternal { pub fn key(&self) -> Option<String> {
<|file_name|>deprecation.py<|end_file_name|><|fim▁begin|># Human friendly input/output in Python. # # Author: Peter Odding <peter@peterodding.com> # Last Change: March 2, 2020 # URL: https://humanfriendly.readthedocs.io """ Support for deprecation warnings when importing names from old locations. When software evolve...
<|file_name|>writer.rs<|end_file_name|><|fim▁begin|>//! Writes audio samples to files. (Reads too, this module needs a rename) //! //! ### Audacity PCM import settings //! //! * File > Import > Raw Data... //! * Signed 16-bit PCM //! * Little-endian //! * 1 Channel (Mono) //! * Sample rate: 44_100Hz (or whatever your s...
<|file_name|>bitcoin_cs.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="cs" version="2.0"> <defaultcodec>UTF-8</defaultcodec> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="14"/> <source>About Emercoin</source> ...
<translation>Smaž aktuálně vybranou adresu ze seznamu. Smazány mohou být pouze adresy příjemců.</translation> </message> <message> <location filename="../forms/addressbookpage.ui" line="113"/>
<|file_name|>api.py<|end_file_name|><|fim▁begin|>import copy from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.urlresolvers import reverse from django.utils.translation import ugettext as _ from django_countries import countries import accounts import third_part...
# meant to confirm the user's email address. email_label = _(u"Confirm Email") error_msg = accounts.REQUIRED_FIELD_CONFIRM_EMAIL_MSG
<|file_name|>webid.js<|end_file_name|><|fim▁begin|>var passport = require('passport'); var WebIDStrategy = require('passport-webid').Strategy; var tokens = require('../../util/tokens'); var ids = require('../../util/id'); var console = require('../../log'); var createError = require('http-errors'); var dateUtils = requ...
var enabled = conf.enabledStrategies.filter(function (v) { return (v === auth_type); });
<|file_name|>set-tp-dst.js<|end_file_name|><|fim▁begin|>/* * Author: Zoltán Lajos Kis <zoltan.lajos.kis@ericsson.com> */ "use strict"; (function() { var util = require('util'); var ofp = require('../ofp.js'); var offsets = ofp.offsets.ofp_action_tp_port; module.exports = {<|fim▁hole|> ...
"unpack" : function(buffer, offset) { var action = { "header" : {"type" : 'OFPAT_SET_TP_DST'},
<|file_name|>QTextStream.py<|end_file_name|><|fim▁begin|># encoding: utf-8 # module PyQt4.QtCore # from /usr/lib/python3/dist-packages/PyQt4/QtCore.cpython-34m-x86_64-linux-gnu.so # by generator 1.135 # no doc # imports import sip as __sip class QTextStream(): # skipped bases: <class 'sip.simplewrapper'> """ ...
<|file_name|>objectinspector.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, division, print_function import os from idaskins import UI_DIR from PyQt5 import uic from PyQt5.Qt import qApp from PyQt5.QtCore import Qt from PyQt5.QtGui import QCursor, QFont, QKeySequence from PyQt5.QtWidgets impo...
<|file_name|>imagecropper.controller.js<|end_file_name|><|fim▁begin|>//this controller simply tells the dialogs service to open a mediaPicker window //with a specified callback, this callback will receive an object with a selection on it angular.module('umbraco') .controller("Umbraco.PropertyEditors.ImageCropperCon...
<|file_name|>SalesforceStepTest.java<|end_file_name|><|fim▁begin|>/*! ****************************************************************************** * * Pentaho Data Integration * * Copyright (C) 2002-2017 by Hitachi Vantara : http://www.pentaho.com * **************************************************************...
Mockito.when( valueMeta.getDateFormatTimeZone() ).thenReturn( TimeZone.getTimeZone( "UTC" ) );
<|file_name|>topic.py<|end_file_name|><|fim▁begin|>""" Author: Keith Bourgoin, Emmett Butler """ __license__ = """ Copyright 2015 Parse.ly, 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 ...
<|file_name|>init.go<|end_file_name|><|fim▁begin|>package cmd import ( "fmt" "io/ioutil" "os" "github.com/mpppk/gitany" "github.com/mpppk/hlb/hlblib" "github.com/spf13/cobra" "gopkg.in/yaml.v2" ) // initCmd represents the init command var initCmd = &cobra.Command{ Use: "init", Short: "Generate setting fi...
config := hlblib.Config{Services: hosts} f, err := yaml.Marshal(config) hlblib.PanicIfErrorExist(err) configFileDirPath, err := hlblib.GetConfigDirPath()
<|file_name|>RequestApplication.go<|end_file_name|><|fim▁begin|>// Code generated by msgraph.go/gen DO NOT EDIT. package msgraph import "context" // ApplicationRequestBuilder is request builder for Application type ApplicationRequestBuilder struct{ BaseRequestBuilder } // Request returns ApplicationRequest func (b ...
// type ApplicationRemoveKeyRequestBuilder struct{ BaseRequestBuilder }
<|file_name|>parser.go<|end_file_name|><|fim▁begin|>package schego import ( "bytes" "encoding/binary" "errors" "fmt" "math" "strconv" "strings" ) type AstNodeType int const ( ProgramNode AstNodeType = iota AddNode SubNode MulNode DivNode GtNode LtNode GteNode LteNode EqNode IfNode DefNode LambdaN...
<|file_name|>kendo.culture.pa-IN.js<|end_file_name|><|fim▁begin|>/* * Kendo UI v2014.3.1119 (http://www.telerik.com/kendo-ui) * Copyright 2014 Telerik AD. All rights reserved. * * Kendo UI commercial licenses may be obtained at * http://www.telerik.com/purchase/license-agreement/kendo-ui-complete * If you do not own a ...
} }
<|file_name|>escape.js<|end_file_name|><|fim▁begin|>YUI.add('escape', function(Y) { /** Provides utility methods for escaping strings. @module escape @class Escape @static @since 3.3.0 **/ var HTML_CHARS = { '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#x27;',...
<|file_name|>suggestion.py<|end_file_name|><|fim▁begin|>import json from google.appengine.ext import ndb from models.account import Account class Suggestion(ndb.Model): """ Suggestions are generic containers for user-submitted data corrections to the site. The generally store a model, a key, and then a ...
""" Keys aren't required for this model. This is only necessary if checking for duplicate suggestions is desired. """
<|file_name|>google-docs.js<|end_file_name|><|fim▁begin|><|fim▁hole|> const GoogleDocs = Component.extend({ layout, tagName: 'a', attributeBindings: ['href', 'rel', 'target'], type: 'reference', referenceUrl: 'https://developers.google.com/maps/documentation/javascript/reference#', guideUrl: 'https://devel...
import Component from '@ember/component'; import layout from '../templates/components/google-docs'; import { computed, get } from '@ember/object'; import { capitalize } from '@ember/string';
<|file_name|>Yasara.py<|end_file_name|><|fim▁begin|>#!/bin/env python # # This file is part Protein Engineering Analysis Tool (PEAT) # (C) Copyright Jens Erik Nielsen, University College Dublin 2003- # All rights reserved # # Damien Farrell April 2010 from Tkinter import * import Pmw class YasaraControl(Fr...
labelpos = 'w',
<|file_name|>outline-intro-step.ts<|end_file_name|><|fim▁begin|>/* Copyright 2018 The Outline 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/L...
value: null, }, localize: {
<|file_name|>property.js<|end_file_name|><|fim▁begin|>/** * Checks if a given DOM property of an element has the expected value. For all the available DOM element properties, consult the [Element doc at MDN](https://developer.mozilla.org/en-US/docs/Web/API/element). * * @example * this.demoTest = function (browser)...
* * @method property * @param {string} property The property name
<|file_name|>PersistenceManager.java<|end_file_name|><|fim▁begin|>package org.drools.persistence; import javax.transaction.xa.XAResource; public interface PersistenceManager { XAResource getXAResource(); Transaction getTransaction(); <|fim▁hole|>}<|fim▁end|>
void save(); void load();
<|file_name|>xcb.rs<|end_file_name|><|fim▁begin|>use libc::{c_int, c_char, c_uchar, c_ushort, c_uint}; use std::ptr; use std::mem; use std::default::Default; // CONSTANTS const XCB_WINDOW_CLASS_INPUT_OUTPUT: c_ushort = 1; const XCB_GC_FOREGROUND: c_uint = 4; const XCB_GC_GRAPHICS_EXPOSURES: c_uint = 65536; const XC...
<|file_name|>manage.py<|end_file_name|><|fim▁begin|>""" Performs management commands for the scheduler app """ import hashlib from flask.ext.script import Manager from sqlalchemy import exc # Importing routes causes our URL routes to be registered from src import routes from src import models from src import schedule...
try: scheduler.db.session.add(user_1)
<|file_name|>log_utils.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import os import logging import datetime def get_logger(directory, name): """ """ logger = logging.getLogger(name) logger.setLevel(logging.INFO) date_handler = DateFileHandler(directory, name) fmt_str = '%(asctime)s...
self.acquire() try: if self.stream: self.flush()
<|file_name|>AttackProcess.py<|end_file_name|><|fim▁begin|>from threading import Thread import time<|fim▁hole|> class AttackProcess(Thread): def __init__(self, main): Thread.__init__(self) self.main = main self.selected_hosts = [] self.is_attacking = False def run(self): ...
from scapy.all import *
<|file_name|>fire.py<|end_file_name|><|fim▁begin|># Source:https://github.com/FastLED/FastLED/blob/master/examples/Fire2012WithPalette/Fire2012WithPalette.ino from __future__ import division import math import random <|fim▁hole|> from components import App def hex_to_rgb(value): value = value.lstrip('#'...
from colour import Color #import randomcolor from PIL import Image, ImageChops, ImageDraw, ImageFont
<|file_name|>fdmgrid.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """interpret a comapct grid specification using regex""" import re # use a compact regular expression with nested OR expressions, # and hence many groups, but name the outer (main) groups: real_short1 = \<|fim▁hole|> r'\s*(?P<upper>-?(\d+(\.\d*...
r'\s*(?P<lower>-?(\d+(\.\d*)?|\d*\.\d+)([eE][+\-]?\d+)?)\s*' real_short2 = \
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|># License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from . import event_mass_edit<|fim▁end|>
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*- # Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol
<|file_name|>ee-TG.ts<|end_file_name|><|fim▁begin|><|fim▁hole|> * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ // THIS CODE IS GENERATED - DO NOT MODIFY // See angular/...
/**
<|file_name|>api.ts<|end_file_name|><|fim▁begin|>/// <reference path="indexer.ts" /> module api { declare var window; declare var uuid; export var version = 0; type Id = string; type Fact = any[]; interface Constraint { view?: Id, leftSource?: Id, leftField?: Id, rightSource?: Id, rig...
if(!params) { //if we have no content, then there's nothing for us to do.
<|file_name|>basic.py<|end_file_name|><|fim▁begin|>"""Base class for all the objects in SymPy""" from __future__ import print_function, division from .assumptions import BasicMeta, ManagedProperties from .cache import cacheit from .sympify import _sympify, sympify, SympifyError from .compatibility import (iterable, It...
concerned: Derivatives, Functions and Symbols. Don't return any 'atoms' that are inside such quantities unless they also appear outside, too.
<|file_name|>ivy_jinja.py<|end_file_name|><|fim▁begin|># ------------------------------------------------------------------------------ # This extension adds support for Jinja templates. # ------------------------------------------------------------------------------ import sys from ivy import hooks, site, templates ...
msg = "------------------------\n"
<|file_name|>complex1.py<|end_file_name|><|fim▁begin|># test basic complex number functionality # constructor print(complex(1)) print(complex(1.2)) print(complex(1.2j)) print(complex("1")) print(complex("1.2")) print(complex("1.2j")) print(complex(1, 2)) print(complex(1j, 2j)) # unary ops print(bool(1j)) print(+(1j))...
except TypeError: print("TypeError") # unsupported unary op
<|file_name|>queue.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding:UTF-8 __author__ = 'shenshijun' import copy class Queue(object): """ 使用Python的list快速实现一个队列 """ def __init__(self, *arg): super(Queue, self).__init__() self.__queue = list(copy.copy(arg)) self....
def exit(self): if self.__size <= 0: return None
<|file_name|>inFuture.js<|end_file_name|><|fim▁begin|>export default function (value, opts) {<|fim▁hole|>}<|fim▁end|>
return value > Date.now() ? opts.fn(this) : '';
<|file_name|>test_notifications.py<|end_file_name|><|fim▁begin|># Copyright (c) 2012 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # ...
<|file_name|>test_python_driver.py<|end_file_name|><|fim▁begin|>import io import json import os import subprocess import sys import unittest from os.path import join, abspath, dirname sys.path.append('..') from python_driver import __version__, get_processor_instance from python_driver.requestprocessor import ( Re...
self.assertIsInstance(response['ast'][root_key]['body'], list)
<|file_name|>test_model_versioned_delete.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*- import pytest from django.utils import timezone from base.model_utils import BaseError from example_base.models import FruitCake from login.tests.factories import UserFactory from .factories import FruitCakeFactory @p...
assert obj.deleted is False
<|file_name|>main.py<|end_file_name|><|fim▁begin|>from __future__ import print_function __author__ = 'breddels' # import astropy.vo.samp as sampy import platform import vaex.utils import sys import threading import vaex.export import vaex.utils import vaex.promise import vaex.settings import vaex.remote import psutil ...
if path.startswith("http") or path.startswith("ws"): dataset = vaex.open(path, thread_mover=self.call_in_main_thread) else: dataset = vaex.open(path)
<|file_name|>test_ldcdns.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import unittest import ldc import uuid class TestLDCDNSInterface(unittest.TestCase): def test_ldcdns(self): rand_str = str(uuid.uuid4()) ldc.dns.add(rand_str, '1.1.1.1') assert ldc.dns.resolve(rand_str) == [ '1.1.1....
ldc.dns.delete(rand_str) assert ldc.dns.resolve(rand_str) == []
<|file_name|>fstream.cc<|end_file_name|><|fim▁begin|>// Copyright (C) 2004-2013 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library 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 ...
VERIFY( pos03 == pos04 ); // out pos05 = is03.tellg();
<|file_name|>variable_inspector.js<|end_file_name|><|fim▁begin|>import React from "react"; import ReactDOM from "react-dom"; import VariableInspector from "./components/VariableInspector"; ReactDOM.render( <VariableInspector />, document.getElementById("root")<|fim▁hole|><|fim▁end|>
);
<|file_name|>XBee802.cpp<|end_file_name|><|fim▁begin|>/** * Copyright (c) 2015 Digi International Inc., * All rights not expressly granted are reserved. * * 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 c...
RadioStatus XBee802::set_pwm(const RemoteXBee& remote, IoLine line, float duty_cycle)
<|file_name|>generator.go<|end_file_name|><|fim▁begin|>package main import ( "bytes" "fmt" "html" "strings" "text/template" b64 "encoding/base64" "github.com/bsm/openrtb" ) const ( //Auction Macros AUCTION_ID = "${AUCTION_ID}" AUCTION_IMP_ID = "${AUCTION_IMP_ID}" AUCTION_SEAT_ID = "${AUCTION_SEA...
<|file_name|>test.py<|end_file_name|><|fim▁begin|># # Copyright 2013 eNovance # # 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 re...
def __init__(self): self.notifications = []
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>""" A collection of Xentica models and experiments. Indended to illustrate how to use the framework. """<|fim▁end|>
<|file_name|>objects.js<|end_file_name|><|fim▁begin|>let obj = { @readonly firstName: "first", @readonly lastName: "last", @nonconfigurable fullName() { return `${this.firstName} ${this.lastName}`; } }; /* // Desugaring // // The following is an approximate down-level desugaring to m...
<|file_name|>main.py<|end_file_name|><|fim▁begin|>from inventory import Inventory import cmd from room import get_room from player import Player import textwrap import time import random class Controls(cmd.Cmd): prompt = '> ' def __init__(self): #--------------------------------------------------------------...
<|file_name|>tags.py<|end_file_name|><|fim▁begin|>import parsers import tokenizer import context html_escape_table = { "&": "&amp;", '"': "&quot;", "'": "&apos;", ">": "&gt;", "<": "&lt;", } def html_escape(text): """Produce entities within text.""" return "".join(html_escape_table.ge...
class IfTag(PairedTag): closing_literal = 'if'
<|file_name|>text.rs<|end_file_name|><|fim▁begin|>use crate::color::conv::IntoLinSrgba; use crate::draw::drawing::DrawingContext; use crate::draw::primitive::Primitive; use crate::draw::properties::spatial::{self, dimension, orientation, position}; use crate::draw::properties::{ ColorScalar, LinSrgba, SetColor, Set...
/// Set all the parameters via an existing `Layout`
<|file_name|>client.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # author: bambooom ''' My Diary Web App - CLI for client ''' import sys reload(sys) sys.setdefaultencoding('utf-8') import requests from bs4 import BeautifulSoup import re HELP = ''' Input h/help/? for help. Input q/quit to quit the proces...
<|file_name|>test_api.py<|end_file_name|><|fim▁begin|># encoding: utf-8 """Tests of Branding API """ from __future__ import absolute_import, unicode_literals import mock from django.conf import settings from django.test import TestCase from django.test.utils import override_settings from django.urls import reverse fr...
def test_get_footer_custom_contact_url(self):
<|file_name|>0002_auto_20151223_1508.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Generated by Django 1.9 on 2015-12-23 15:08 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('django_ca', '0001_initial'...
migrations.AlterField( model_name='certificate', name='revoked_date', field=models.DateTimeField(blank=True, null=True, verbose_name='Revoked on'),
<|file_name|>UnlinkResponseCallback.java<|end_file_name|><|fim▁begin|>/** * Copyright 2014 Kakao Corp. * * Redistribution and modification in source or binary forms are not permitted without specific prior written permission.  * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use t...
<|file_name|>LessonProviderTest.java<|end_file_name|><|fim▁begin|>/* * jMemorize - Learning made easy (and fun) - A Leitner flashcards tool * Copyright(C) 2004-2006 Riad Djemili * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as publi...
m_lessonProvider.addLessonObserver(this); m_log = new StringBuffer();