prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>calculate_size.js<|end_file_name|><|fim▁begin|>"use strict" var writeIEEE754 = require('../float_parser').writeIEEE754 , readIEEE754 = require('../float_parser').readIEEE754 , Long = require('../long').Long , Double = require('../double').Double , Timestamp = require('../timestamp').Timestamp ...
function calculateElement(name, value, serializeFunctions, isArray, ignoreUndefined) { // If we have toBSON defined, override the current object if(value && value.toBSON){ value = value.toBSON();
<|file_name|>auth.guard.ts<|end_file_name|><|fim▁begin|>import { Injectable } from '@angular/core'; import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot } from '@angular/router';<|fim▁hole|> @Injectable() export class AuthGuard implements CanActivate { constructor(protected _router: Router, ...
import { AppState } from '@genesis/$core/store/app.state';
<|file_name|>store_test.go<|end_file_name|><|fim▁begin|>package gomdi import ( "fmt" "testing" ) // Modify which store we're using since we want to test with a fast datastore func init() { // Implicitly create the tables. Store = NewTestStore(&testModel{}) } // Even more basic than the memory implementation type...
func (m testStore) Clear() {} func (m testStore) Len() int { return 0 }
<|file_name|>main.js<|end_file_name|><|fim▁begin|>jQuery(document).ready(function($){ var is_firefox = navigator.userAgent.indexOf('Firefox') > -1;<|fim▁hole|> $('#cd-team').find('ul a').on('click', function(event){ event.preventDefault(); var selected_member = $(this).data('type'); $('.cd-member-bio.'+selected_...
//open team-member bio
<|file_name|>base.py<|end_file_name|><|fim▁begin|># Peerz - P2P python library using ZeroMQ sockets and gevent # Copyright (C) 2014-2015 Steve Henderson # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Fou...
states = ['initialised', 'waiting response', 'complete', 'timedout'] transitions = [
<|file_name|>trait-safety-inherent-impl.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www...
fn main() { }
<|file_name|>sqlalchemy.py<|end_file_name|><|fim▁begin|>""" SQLAlchemy support. """ from __future__ import absolute_import import datetime from types import GeneratorType import decimal from sqlalchemy import func # from sqlalchemy.orm.interfaces import MANYTOONE from sqlalchemy.orm.collections import InstrumentedLis...
<|file_name|>TransformableModel.ts<|end_file_name|><|fim▁begin|>import { TransformOptions } from "./TransformOptions";<|fim▁hole|><|fim▁end|>
import { BaseModel, MongoBound } from "../models/base"; type TransformProperty<T> = {_apiTransform: (model: T | MongoBound<T>, options: TransformOptions) => any}; export type TransformableModel<T> = BaseModel<T> & TransformProperty<T>;
<|file_name|>test_multinic.py<|end_file_name|><|fim▁begin|># Copyright 2011 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 # # ht...
<|file_name|>prune.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*-<|fim▁hole|>import asyncio import yaml from pathlib import Path from logzero import logger from rizza import entity_tester from rizza import genetic_tester def genetic_prune(conf, entity='All'): """Check all saved genetic_tester tests for...
"""A utility that tries saved genetic tests and removes those failing"""
<|file_name|>version.go<|end_file_name|><|fim▁begin|>/* Copyright 2017 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.<|fim▁hole|> http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law o...
You may obtain a copy of the License at
<|file_name|>libusb0.py<|end_file_name|><|fim▁begin|># Copyright (C) 2009-2013 Wander Lairson Costa # # The following terms apply to all files associated # with the software unless explicitly disclaimed in individual files. # # The authors hereby grant permission to use, copy, modify, distribute, # and license this sof...
def get_endpoint_descriptor(self, dev, ep, intf, alt, config): interface = self.get_interface_descriptor(dev, intf, alt, config) if ep >= interface.bNumEndpoints: raise IndexError('Invalid endpoint index ' + str(ep))
<|file_name|>ihandlers.py<|end_file_name|><|fim▁begin|>#******************************************************************************** #* Dionaea #* - catches bugs - #* #* #* #* Copyright (C) 2010 Markus Koetter & Tan Kean Siong #* Copyright (C) 2009 Paul Baec...
#imp.reload(dionaea.emu)
<|file_name|>import_localities.py<|end_file_name|><|fim▁begin|>""" Usage: import_localities < Localities.csv """ from django.contrib.gis.geos import GEOSGeometry from django.utils.text import slugify from ..import_from_csv import ImportFromCSVCommand from ...utils import parse_nptg_datetime from ...models import L...
<|file_name|>issue-1895.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT<|fim▁hole|>// // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/...
// file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT.
<|file_name|>manager.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python #coding: utf-8 """ This module simply sends request to the Digital Ocean API, and returns their response as a dict. """ import requests API_ENDPOINT = 'https://api.digitalocean.com' class DoError(RuntimeError): pass class DoManager(objec...
return json
<|file_name|>ConfiguredBuckOutIntegrationTest.java<|end_file_name|><|fim▁begin|>/* * Copyright 2016-present Facebook, 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:...
workspace .runBuckBuild( "-c",
<|file_name|>tasks.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # OpenCraft -- tools to aid developing and hosting free software projects # Copyright (C) 2015 OpenCraft <xavier@opencraft.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero Gen...
# Logging ##################################################################### import logging
<|file_name|>Title.react.js<|end_file_name|><|fim▁begin|>import React, {PropTypes} from 'react'; import Anchor from './Anchor'; import getIdFromTitle from '../util/getIdFromTitle'; const Title = ({children}) => ( <h3> <Anchor id={getIdFromTitle(children)}> {children} </Anchor> </h3> ); Title.propT...
<|file_name|>Remove.java<|end_file_name|><|fim▁begin|>/* * Copyright 2006-2008 Kazuyuki Shudo. * * 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/LI...
CommandLine cmd = null; try { cmd = parser.parse(options, args); } catch (ParseException e) {
<|file_name|>DeletePermissionMutation.js<|end_file_name|><|fim▁begin|>/* eslint-disable class-methods-use-this */ import Relay from 'react-relay'; class DeletePermissionMutation extends Relay.Mutation { getMutation() { return Relay.QL` mutation { deletePermission(input: $input) } `; } ...
} } } allUsers {
<|file_name|>CustomizedHandlerExceptionResolver.java<|end_file_name|><|fim▁begin|>package com.zk.web.interceptor; import java.io.IOException; import java.io.PrintWriter; import java.io.StringWriter; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.commons...
import org.springframework.validation.BindException; import org.springframework.web.method.HandlerMethod; import org.springframework.web.servlet.HandlerExceptionResolver; import org.springframework.web.servlet.ModelAndView;
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
# 主要是为了使用中文显示 app 于 admin 界面 default_app_config = 'bespeak_meal.apps.Bespeak_meal_config'
<|file_name|>lib.js<|end_file_name|><|fim▁begin|>/** * @author Ultimo <von.ultimo@gmail.com> * @license http://www.opensource.org/licenses/mit-license.html MIT License * @version 0.1 (25-06-2017) * * Hier schreiben wir die JavaScript Funktionen. * */<|fim▁hole|>$(document).ready(function(){ $("td:contains('-'...
src="jquery-3.2.1.min";
<|file_name|>issue-888-enum-var-decl-jump.rs<|end_file_name|><|fim▁begin|>#![allow( dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals )] #[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)] pub mod root { #[allow(unused_imports)] use self::super::root; ...
extern "C" {
<|file_name|>sandglass.go<|end_file_name|><|fim▁begin|>package sandglass import ( "fmt" <|fim▁hole|> "google.golang.org/grpc" ) type Node struct { ID string Name string IP string GRPCAddr string RAFTAddr string HTTPAddr string Status serf.MemberStatus conn *grpc.ClientConn sgproto.Brok...
"github.com/hashicorp/serf/serf" "github.com/sandglass/sandglass-grpc/go/sgproto"
<|file_name|>forms.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2016 OSGeo # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published b...
class ProfileForm(forms.ModelForm):
<|file_name|>block_test.go<|end_file_name|><|fim▁begin|>// Copyright 2012-2014 Canonical Ltd. // Licensed under the AGPLv3, see LICENCE file for details. package common_test import ( jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" "github.com/juju/errors" "github.com/juju/juju/apiserver/common" "g...
s.assertDestroyBlocked(c) s.blockAllChanges(c) s.assertDestroyBlocked(c)
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>""" A misc set of utilities useful in the data-import domain. """ import logging from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned from open_municipio.people.models import Person, municipality from open_municipio.data_import.models import L...
"""
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>from django.contrib import admin from django.utils.translation import ugettext_lazy as _ from open_municipio.locations.models import Location<|fim▁hole|> class LocationAdmin(admin.ModelAdmin): list_display = ('name', 'count') admin.site.register(Location, Locatio...
<|file_name|>constant_op_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....
import tensorflow as tf
<|file_name|>limit.d.ts<|end_file_name|><|fim▁begin|>declare type Params = { min: number; max: number; }; export declare type Limit = { min: number; max: number; loop: (n: number) => number; constrain: (n: number) => number; reachedAny: (n: number) => boolean; reachedMax: (n: number) => ...
reachedMin: (n: number) => boolean;
<|file_name|>_labs_operations.py<|end_file_name|><|fim▁begin|># coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code gene...
<|file_name|>cors_cache.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/. */ //! An implementation of the [CORS preflight cache](https:...
/// Insert an entry pub fn insert(&mut self, entry: CorsCacheEntry) { self.cleanup();
<|file_name|>storySettings.js<|end_file_name|><|fim▁begin|>import { Category } from '../../../stories/storiesHierarchy';<|fim▁hole|> storyName: 'ColorPicker', dataHook: 'storybook-colorpicker', };<|fim▁end|>
export const storySettings = { category: Category.COMPONENTS,
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>""" Fantasm: A taskqueue-based Finite State Machine for App Engine Python Docs and examples: http://code.google.com/p/fantasm/ Copyright 2010 VendAsta Technologies Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file e...
shape = 'Mrecord' if colorMap.get(stateConfig.name): return '"%(stateName)s" [style=filled,fillcolor="%(fillcolor)s",shape=%(shape)s,label="{%(label)s}"];' % \ {'stateName': stateConfig.name,
<|file_name|>test_docx.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2.6 ''' Test docx module ''' import os import lxml from docx import * TEST_FILE = 'ShortTest.docx' IMAGE1_FILE = 'image1.png' # --- Setup & Support Functions --- def setup_module(): '''Set up test fixtures''' import shutil if IMAG...
<|file_name|>Crowbar.cpp<|end_file_name|><|fim▁begin|>#include <zmq.h> #include <zlib.h> #include <czmq.h> #include <zframe.h> #include "Crowbar.h" #include "boost/thread.hpp" #include "g2log.hpp" #include "Death.h" /** * Construct a crowbar for beating things at the binding location * * @param binding * A std...
}
<|file_name|>resource_compute_route_generated_test.go<|end_file_name|><|fim▁begin|>// ---------------------------------------------------------------------------- // // *** AUTO GENERATED CODE *** Type: MMv1 *** // // ---------------------------------------------------------------------------- // // ...
PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProvidersOiCS, CheckDestroy: testAccCheckComputeRouteDestroyProducer(t),
<|file_name|>0004_auto_20171023_2354.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Generated by Django 1.11.3 on 2017-10-23 23:54 from __future__ import unicode_literals <|fim▁hole|> class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_US...
from django.conf import settings from django.db import migrations, models import django.db.models.deletion
<|file_name|>en-gb.js<|end_file_name|><|fim▁begin|>/* Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'basicstyles', 'en-gb', {<|fim▁hole|> superscript: 'Superscript', underline: 'Underline' } );<|fim▁...
bold: 'Bold', italic: 'Italic', strike: 'Strike Through', subscript: 'Subscript',
<|file_name|>x1tool.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # coding:utf-8 import hashlib import logging from x1category import X1Category TOOL_PREFIX = 'X1Tool' <|fim▁hole|> def __init__(self, metadata=None): if metadata is None: metadata = self.DEFAULT_METADATA self.__me...
class X1Tool(object): 'appid:6376477c731a89e3280657eb88422645f2d1e2a684541222e21371f3110110d2' DEFAULT_METADATA = {'name': "X1Tool", 'author': "admin", 'comments': "default", 'template': "default/index.html", 'category': X1Category.DEFAULT}
<|file_name|>colorschemes.py<|end_file_name|><|fim▁begin|># These color schemes come from d3: http://d3js.org/ # # They are licensed under the following license: # # Copyright (c) 2010-2015, Michael Bostock # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, ...
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
<|file_name|>catch.hpp<|end_file_name|><|fim▁begin|>/* * Catch v1.7.2 * Generated: 2017-02-13 15:57:33.350226 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserv...
, result( _stats.assertionResult )
<|file_name|>regions-static-closure.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apa...
let cl_box = box_it(box || println!("Hello, world!")); call_static_closure(cl_box);
<|file_name|>check_const.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.or...
/// Returns true if the call is to a const fn or method.
<|file_name|>healthy.go<|end_file_name|><|fim▁begin|>package etcdutil import ( "log" "math/rand" "path" "strconv" "time" "github.com/coreos/go-etcd/etcd" ) // heartbeat to etcd cluster until stop func Heartbeat(client *etcd.Client, name string, taskID uint64, interval time.Duration, stop chan struct{}) error {...
} logger.Printf("got free task %v, randomly choose %d to try...", ListKeys(slots.Node.Nodes), ri) return id, nil }
<|file_name|>notifier.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright (C) 2011 Chris Dekter # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License...
self.configManager = autokeyApp.service.configManager self.indicator = AppIndicator3.Indicator.new("AutoKey", ConfigManager.SETTINGS[NOTIFICATION_ICON],
<|file_name|>test_tutorial001.py<|end_file_name|><|fim▁begin|>from fastapi.testclient import TestClient from docs_src.request_files.tutorial001 import app client = TestClient(app) openapi_schema = { "openapi": "3.0.2", "info": {"title": "FastAPI", "version": "0.1.0"}, "paths": { "/files/": { ...
}, },
<|file_name|>usergroup.py<|end_file_name|><|fim▁begin|># https://djangosnippets.org/snippets/2566/ from django import template from django.template import resolve_variable, NodeList from django.contrib.auth.models import Group register = template.Library() @register.tag()<|fim▁hole|> Usage: {% ifusergroup Admins...
def ifusergroup(parser, token): """ Check to see if the currently logged in user belongs to a specific group. Requires the Django authentication contrib app and middleware.
<|file_name|>test_update_network.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2008,2009,2010,2011,2012,2013,2015,2016,2018 Contributor # # Licensed under the Apache License, Version 2.0 (the ...
<|file_name|>L_gen.py<|end_file_name|><|fim▁begin|>import random T = 10 for tt in range(T): n = 10 ** 6 print(n)<|fim▁hole|> print() for i in range(n): print(random.randint(1, 1000), end = ' ') print()<|fim▁end|>
for i in range(n): print(random.randint(0, 1000), end = ' ')
<|file_name|>client_mock_tcp.rs<|end_file_name|><|fim▁begin|>#![feature(default_type_params)] extern crate curl; extern crate http; extern crate hyper; extern crate test; use std::fmt::{mod, Show}; use std::str::from_str; use std::io::{IoResult, MemReader}; use std::io::net::ip::{SocketAddr, ToSocketAddr}; use std::o...
"Bar".fmt(fmt)
<|file_name|>CircuitRequest.java<|end_file_name|><|fim▁begin|>package org.opennaas.extensions.genericnetwork.model.circuit.request; /* * #%L * OpenNaaS :: Generic Network * %% * Copyright (C) 2007 - 2014 Fundació Privada i2CAT, Internet i Innovació a Catalunya * %% * Licensed under the Apache License, Version 2....
* * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
<|file_name|>shuffle.py<|end_file_name|><|fim▁begin|># # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apac...
self.serializer.dump_stream([(k, v)], streams[h])
<|file_name|>api.py<|end_file_name|><|fim▁begin|>from jsonapi_requests import base from jsonapi_requests.orm import registry class OrmApi: def __init__(self, api): self.type_registry = registry.TypeRegistry() self.api = api @classmethod def config(cls, *args, **kwargs): return cls...
return self.api.endpoint(path)
<|file_name|>repl.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python #Written by Kjetil Matheussen: k.s.matheussen@notam02.no import sys import os import urllib2 import readline executable_path = os.path.split(os.path.abspath(os.path.realpath(sys.argv[0])))[0] # TODO: Use bin/packages/s7/s7webserver instead, a...
if len(sys.argv)>1: portnum = sys.argv[1]
<|file_name|>orgUserServiceTest.js<|end_file_name|><|fim▁begin|>/** * Copyright (c) 2015 Intel Corporation * * 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/...
});
<|file_name|>addfiledialog.py<|end_file_name|><|fim▁begin|>from PyQt4.QtGui import * import pypipe.formats import pypipe.basefile from pypipe.core import pipeline from widgets.combobox import ComboBox class AddFileDialog(QDialog): def __init__(self, parent=None): super(AddFileDialog, self).__init__(pare...
self.filename_edit.textChanged.connect(self.turn_ok_button)
<|file_name|>index.js<|end_file_name|><|fim▁begin|>'use strict'; const EmberApp = require('./ember-app'); /** * FastBoot renders your Ember.js applications in Node.js. Start by * instantiating this class with the path to your compiled Ember app: * * * #### Sandboxing * * For security and correctness reasons, E...
* with the updated assets.
<|file_name|>member-add.component.spec.ts<|end_file_name|><|fim▁begin|>/* tslint:disable:no-unused-variable */ import { TestBed, async } from "@angular/core/testing"; import { FormBuilder } from "@angular/forms"; import { Router } from "@angular/router"; import { MemberAddComponent } from "./member-add.component"; im...
describe("Component: MemberAdd", () => {
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>macro_rules! os_required { () => { panic!("mio must be compiled with `os-poll` to run.") }; } mod selector; pub(crate) use self::selector::{event, Event, Events, Selector}; mod waker; pub(crate) use self::waker::Waker; cfg_net! { pub(crate) mod tcp...
os_required!() } } }
<|file_name|>error.cc<|end_file_name|><|fim▁begin|>/* * descripten - ECMAScript to native compiler * Copyright (C) 2011-2014 Christian Kindahl * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser Public License as published by * the Free Software Foundati...
<|file_name|>PageProcessorCompiler.java<|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|>admin.py<|end_file_name|><|fim▁begin|>from django.contrib import admin from app.models import Home, Room, Thermostat, Door, Light, Refrigerator """ Administrator interface customization This module contains customization classes to the admin interface rendered by Django. This file is interpreted at run t...
StackedInline """ model = Door
<|file_name|>vmware_local_user_manager.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2016, IBM Corp # Author(s): Andreas Nafpliotis <nafpliot@de.ibm.com> # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import a...
self.module.exit_json(changed=True) except vmodl.RuntimeFault as runtime_fault:
<|file_name|>clob_string.py<|end_file_name|><|fim▁begin|>#------------------------------------------------------------------------------ # clob_string.py (Section 7.2) #------------------------------------------------------------------------------ #----------------------------------------------------------------------...
<|file_name|>testRaise.py<|end_file_name|><|fim▁begin|>class fooexception(Exception): def __init__(self, msg): Exception.__init__(self) print msg def __init__(self): Exception.__init__(self) print "i am a fooexception" data = 2 raise "foo" raise "foo", data # before raise ...
raise raise fooexception, (1, 2, 3), 1 + 1 raise
<|file_name|>0013_auto__add_field_userprofile_receive_notification.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'U...
'role': ('django.db.models.fields.CharField', [], {'max_length': '3'}), 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"})
<|file_name|>effectset.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- ################################################################################ # Copyright 2014, Distributed Meta-Analysis System ################################################################################ """Software structure for g...
""" suffix = ''.join(random.choice(string.lowercase) for i in range(6))
<|file_name|>ProceduralShape.cpp<|end_file_name|><|fim▁begin|>/* This file is part of TSRE5. * * TSRE5 - train sim game engine and MSTS/OR Editors. * Copyright (C) 2016 Piotr Gadecki <pgadecki@gmail.com> * * Licensed under GNU General Public License 3.0 or later. * * See LICENSE.md or https://www.g...
float step = 3; for (float i = 0; i < line.length; i += step) { line.getDrawPosition(posRot, i, stemplate->xOffset);
<|file_name|>bmn-paraBlastKepler.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python ### cut a fasta query (arg1) in "nbPart" (arg3) ### subFasta files and launches a blast programm (arg4) ### vs the bank (arg2) for each subfasta and then ### concatenates the tab delimited blast results in ### one file. You can add a...
<|file_name|>rules.py<|end_file_name|><|fim▁begin|># Copyright 2020 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from dataclasses import dataclass from typing import Tuple from pants.backend.python.lint.docformatter.skip_field import SkipDocformatte...
original_digest: Digest def generate_args(
<|file_name|>traversal.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/. */ //! Traversals over the DOM and flow trees, running the lay...
} } }
<|file_name|>day8.rs<|end_file_name|><|fim▁begin|>use std::io::prelude::*; use std::fs::File; const MAX_X: usize = 50; const MAX_Y: usize = 6; fn print_board(board: &Vec<Vec<bool>>) { let mut count = 0; for i in 0..MAX_Y { let mut line = String::new();; for j in 0..MAX_X {<|fim▁hole|> line += "#";...
if board[i][j] {
<|file_name|>print_MODFLOW_inputs_res_NWT.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ Created on Sun Sep 17 22:06:52 2017 Based on: print_MODFLOW_inputs_res_NWT.m @author: gcng """ # print_MODFLOW_inputs import numpy as np import MODFLOW_NWT_lib as mf # functions to write individual MODFLOW files im...
# MODFLOW output files GSFLOW_outdir = GSFLOW_DIR + '/outputs/MODFLOW_2005/' elif sw_2005_NWT == 2:
<|file_name|>ws_BinaryClass_100_SVC_sigmoid_sqlite_code_gen.py<|end_file_name|><|fim▁begin|>from sklearn2sql_heroku.tests.classification import generic as class_gen <|fim▁hole|><|fim▁end|>
class_gen.test_model("SVC_sigmoid" , "BinaryClass_100" , "sqlite")
<|file_name|>HUnitDaughter2Woman_ConnectedLHS.py<|end_file_name|><|fim▁begin|>from core.himesis import Himesis, HimesisPreConditionPatternLHS import uuid class HUnitDaughter2Woman_ConnectedLHS(HimesisPreConditionPatternLHS): def __init__(self): """<|fim▁hole|> super(HUnitDaughter2Woman_ConnectedLHS, self).__init_...
Creates the himesis graph representing the AToM3 model HUnitDaughter2Woman_ConnectedLHS """ # Flag this instance as compiled now self.is_compiled = True
<|file_name|>fan.py<|end_file_name|><|fim▁begin|>""" Support for ISY994 fans. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/fan.isy994/ """ import logging from typing import Callable from homeassistant.components.fan import (FanEntity, DOMAIN, SPEED_OF...
} STATE_TO_VALUE = {} for key in VALUE_TO_STATE:
<|file_name|>_y.py<|end_file_name|><|fim▁begin|>import _plotly_utils.basevalidators class YValidator(_plotly_utils.basevalidators.CompoundValidator): def __init__(self, plotly_name="y", parent_name="volume.caps", **kwargs): super(YValidator, self).__init__( plotly_name=plotly_name, ...
**kwargs )
<|file_name|>newc.go<|end_file_name|><|fim▁begin|>// Copyright 2013-2017 the u-root Authors. All rights reserved // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package cpio import ( "bytes" "encoding/binary" "encoding/hex" "fmt" "io" "os" "github.com/u-...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from .DiscreteFactor import State, DiscreteFactor from .CPD import TabularCPD<|fim▁hole|> 'State' ]<|fim▁end|>
from .JointProbabilityDistribution import JointProbabilityDistribution __all__ = ['TabularCPD', 'DiscreteFactor',
<|file_name|>vlog.go<|end_file_name|><|fim▁begin|>package common import ( "fmt" "os" ) type LogLevelType int var ( ShowLogLevel = true ErrorsFatal = true LogLevel = LogLevelType(0) ) var ( levelString = []string{"[ERR] ", "[WRN] ", "[LOG] "} unknownLevel = "[???] " ) func (l LogLevelType) String() str...
return } if ShowLogLevel { fmt.Fprint(os.Stderr, level)
<|file_name|>query.go<|end_file_name|><|fim▁begin|>// Copyright 2015, 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. package vtctl import ( "encoding/hex" "encoding/json" "flag" "fmt" "strconv" "strings" "time" "github....
if err != nil { return fmt.Errorf("cannot get EndPoint from tablet record: %v", err) }
<|file_name|>test_admin_global_index.py<|end_file_name|><|fim▁begin|># Copyright 2019 Google 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/LICEN...
def test_edit_sms_config(self): self._post_with_params(sms_number_to_repo='{"+1800pfhaiti": "haiti"}')
<|file_name|>gen.go<|end_file_name|><|fim▁begin|>// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build ignore //go:generate go run gen.go // This program generates internet protocol constants and table...
} if err := r.parse(&bb, resp.Body); err != nil { fmt.Fprintln(os.Stderr, err)
<|file_name|>test_RegexQuery.py<|end_file_name|><|fim▁begin|># ==================================================================== # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at #<|fim▁...
<|file_name|>modules.py<|end_file_name|><|fim▁begin|>__author__ = 'flaviocaetano' from django.utils.translation import ugettext_lazy as _ from admin_tools.dashboard import modules import psutil class PelicanAdmin(modules.DashboardModule): """Dashboard module for Pelican service administration. """ title...
try: if "pelican" in str(p.cmdline).lower(): self.pelican_status = True
<|file_name|>SHAKE256.py<|end_file_name|><|fim▁begin|># =================================================================== # # Copyright (c) 2015, Legrandin <helderijs@gmail.com> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that th...
if result: raise ValueError("Error %d while instantiating SHAKE256" % result)
<|file_name|>find_cmake.py<|end_file_name|><|fim▁begin|># -*- python -*- # stdlib imports --- import os import os.path as osp import textwrap # waf imports --- import waflib.Utils import waflib.Logs as msg from waflib.Configure import conf # _heptooldir = osp.dirname(osp.abspath(__file__)) def options(opt):<|fim▁ho...
opt.load('hwaf-base', tooldir=_heptooldir)
<|file_name|>chartable.rs<|end_file_name|><|fim▁begin|>//! char table related functions use remacs_macros::lisp_fn; <|fim▁hole|> hashtable::LispHashTableRef, lisp::{ExternalPtr, LispObject, LispStructuralEqual}, remacs_sys::{ char_table_specials, equal_kind, pvec_type, EmacsInt, Lisp_Char_Table, Lis...
use crate::{
<|file_name|>irc.go<|end_file_name|><|fim▁begin|>// Package irc provides a basic implementation of the IRC protocol. package irc import ( "bufio" "fmt" "io" "log" "net" "regexp" "strings" "time" ) // IRC represents an connection to a channel. type IRC struct { // The IRC server to connect to. server string ...
// A map where the key is a regexp pattern to be matched against, // and the value is a channel where to send messages that match // the specified pattern.
<|file_name|>dominators.rs<|end_file_name|><|fim▁begin|>//! Compute dominators of a control-flow graph. //! //! # The Dominance Relation //! //! In a directed graph with a root node **R**, a node **A** is said to *dominate* a //! node **B** iff every path from **R** to **B** contains **A**. //! //! The node **A** is sa...
<|file_name|>HashTableTest.java<|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 u...
}
<|file_name|>ItemOnItemVerificationHandler.java<|end_file_name|><|fim▁begin|>package org.apollo.game.event.handler.impl; import org.apollo.game.event.handler.EventHandler; import org.apollo.game.event.handler.EventHandlerContext; import org.apollo.game.event.impl.ItemOnItemEvent; import org.apollo.game.model.Inventory...
ctx.breakHandlerChain(); return;
<|file_name|>disk.py<|end_file_name|><|fim▁begin|>#coding:UTF-8 """ 磁盘监控模块<|fim▁hole|> from config import disk from lib import core import os,re def init(): "对外接口" sign=True for t in disk.DISK_PATH: warn,data=check(t) if not warn: login_time=time.time() message="磁盘...
"""
<|file_name|>history.js<|end_file_name|><|fim▁begin|>import {createBrowserHistory} from 'history';<|fim▁hole|>const history = createBrowserHistory({basename: stringUtil.withoutTrailingSlash(ConfigStore.getBaseURI())}); export default history;<|fim▁end|>
import stringUtil from '@shared/util/stringUtil'; import ConfigStore from '../stores/ConfigStore';
<|file_name|>index.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>export * from './types'; export * from './toast.component'; export * from './toast-instance'; export * from './toast.module'; export * from './toast.service'; export * from './toast';<|fim▁end|>
<|file_name|>manage.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import os import sys <|fim▁hole|> os.environ.setdefault("DJANGO_SETTINGS_MODULE", "sim.settings.local") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)<|fim▁end|>
if __name__ == "__main__":
<|file_name|>iter.rs<|end_file_name|><|fim▁begin|>// Copyright (c) 2016, ilammy // // Licensed under MIT license (see LICENSE file in the root directory). // This file may be copied, distributed, and modified only in accordance // with the terms specified by this license. //! Iterator utilities. use std::iter::Iterat...
/// assert_eq!(longest_zip(&[1, 2, 3], &[5, 6]).collect::<Vec<_>>(), /// &[ /// (Some(&1), Some(&5)),