prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>EnumTestUtil.java<|end_file_name|><|fim▁begin|>/*- * Copyright (C) 2013-2014 The JBromo Authors. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, inclu...
value = InvocationUtil.invokeMethod(method, one, one.name()); Assert.assertEquals(one, value); }
<|file_name|>api.py<|end_file_name|><|fim▁begin|># vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2011 X.commerce, a business unit of eBay Inc. # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # ...
def fixed_ip_get_by_address_detailed(context, address):
<|file_name|>inkind_jsonenums.go<|end_file_name|><|fim▁begin|>// generated by jsonenums -type=InKind; DO NOT EDIT package incoming <|fim▁hole|> "encoding/json" "fmt" ) var ( _InKindNameToValue = map[string]InKind{ "control": control, "state": state, "checkForUpdates": checkForUpdates, "upd...
import (
<|file_name|>config.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # This file is part of pygal # # A python svg graph plotting library # Copyright © 2012 Kozea # # This library is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by...
setattr( fs,
<|file_name|>vectorio_example_test.go<|end_file_name|><|fim▁begin|>package vectorio_test import ( "fmt" "io/ioutil" "syscall" "github.com/google/vectorio" ) func ExampleVectorioCombined() { // Create a temp file for demo purposes f, err := ioutil.TempFile("", "vectorio") if err != nil { panic(err) } defer...
<|file_name|>BMNGRestLayer.js<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2014 United States Government as represented by the Administrator of the * National Aeronautics and Space Administration. All Rights Reserved. */ /** * @exports BMNGRestLayer */ define([ '../error/ArgumentError', ...
* May be null, in which case the server address is assumed to be the full path to the data directory. * @param {String} displayName The display name to assign this layer. Defaults to "Blue Marble" if null or * undefined. * @param {Date} initialTime A date value indicating the mont...
<|file_name|>ICyclable.java<|end_file_name|><|fim▁begin|>package io.github.ititus.mymod.util; public interface ICyclable<T> { T next(int i); T prev(int i); default T next() { return next(1); } default T prev() { return prev(1); }<|fim▁hole|> }<|fim▁end|>
<|file_name|>module.js<|end_file_name|><|fim▁begin|><|fim▁hole|>], function (ng) { 'use strict'; return ng.module('backgroundModule', []); });<|fim▁end|>
define([ 'angular'
<|file_name|>ColorPreview.java<|end_file_name|><|fim▁begin|>package de.j4velin.pedometer.util; import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint;<|fim▁hole|>import android.view.View; public class ColorPreview extends View { private Paint ...
import android.util.AttributeSet;
<|file_name|>aggregation_push_down.go<|end_file_name|><|fim▁begin|>// Copyright 2016 PingCAP, 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...
<|file_name|>SceneEditor.cpp<|end_file_name|><|fim▁begin|>/************************************************************************** The MIT License (MIT) Copyright (c) 2015 Dmitry Sovetov https://github.com/dmsovetov Permission is hereby granted, free of charge, to any person obtaining a copy of this softwar...
<|file_name|>0002_auto_20160120_1337.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import unicode_literals <|fim▁hole|> class Migration(migrations.Migration): dependencies = [ ('umibukela', '0001_initial'), ] operations = [ migrations.CreateModel( name...
from django.db import models, migrations
<|file_name|>hello.js<|end_file_name|><|fim▁begin|>/** * This is a "mini-app" that encapsulates router definitions. See more * at: http://expressjs.com/guide/routing.html (search for "express.Router") * */ var router = require('express').Router({ mergeParams: true }); module.exports = router; // Don't just use, but a...
<|file_name|>menu-item-selectable.ts<|end_file_name|><|fim▁begin|>/** * @license * Copyright Google LLC 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 */ import {coerceBooleanProperty, BooleanInput} from '...
/** Event emitted when the selectable item is clicked */ @Output('cdkMenuItemToggled') toggled: EventEmitter<CdkMenuItemSelectable> = new EventEmitter(); /** Whether the element is checked */
<|file_name|>file_util.py<|end_file_name|><|fim▁begin|>"""distutils.file_util Utility functions for operating on single files. """ # This module should be kept compatible with Python 2.1. __revision__ = "$Id: file_util.py,v 1.17 2004/11/10 22:23:14 loewis Exp $" import os from distutils.errors import DistutilsFileE...
<|file_name|>lib-css-list.js<|end_file_name|><|fim▁begin|>var libCssList = [ "bootstrap/dist/css/bootstrap.css", "bootstrap/dist/css/bootstrap-theme.css" ]; var basePath = "lib/"; <|fim▁hole|>for (var fileIndex = 0; fileIndex < libCssList.length; fileIndex++) { libCssList[fileIndex] = basePath + libCssList...
<|file_name|>markdown.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licens...
format!("{}", MarkdownWithToc(text)) } else {
<|file_name|>networkPlotWidget.py<|end_file_name|><|fim▁begin|>from collections import OrderedDict from math import sqrt import numpy as np import pyqtgraph as pg from qtpy import QtWidgets import skrf from . import smith_chart, util class NetworkPlotWidget(QtWidgets.QWidget): S_VALS = OrderedDict(( ("d...
def update_plot(self):
<|file_name|>CircularArc.java<|end_file_name|><|fim▁begin|>/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package curveavg; /** * Small helper class for computing the circular arc ...
<|file_name|>utils.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Keyak v2 implementation by Jos Wetzels and Wouter Bokslag # hereby denoted as "the implementer". # Based on Keccak Python and Keyak v2 C++ implementations<|fim▁hole|># For more information, feedback or questions, please refer to: # http://key...
# by the Keccak, Keyak and Ketje Teams, namely, Guido Bertoni, # Joan Daemen, Michaël Peeters, Gilles Van Assche and Ronny Van Keer #
<|file_name|>forms.py<|end_file_name|><|fim▁begin|>""" Polish-specific form helpers """ import re from django.newforms import ValidationError from django.newforms.fields import Select, RegexField from django.utils.translation import ugettext_lazy as _ class PLVoivodeshipSelect(Select): """ A select widget wi...
result %= 11 if result == 10: result = 0
<|file_name|>0005_auto_20141221_2023.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('programacao', '0004_auto_20141221_1952'), ]<|fim▁hole|> operatio...
<|file_name|>templating.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ flask.testsuite.templating ~~~~~~~~~~~~~~~~~~~~~~~~~~ Template functionality :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import flask import unittest from flask.testsui...
self.assert_equal(app.jinja_env.tests['boolean'], boolean) self.assert_true(app.jinja_env.tests['boolean'](False))
<|file_name|>principal.py<|end_file_name|><|fim▁begin|>from office365.runtime.paths.service_operation import ServiceOperationPath from office365.sharepoint.base_entity import BaseEntity class Principal(BaseEntity): """Represents a user or group that can be assigned permissions to control security.""" @proper...
@property
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>""" decorstate ~~~~~~~~~~ Simple "state machines" with Python decorators. :copyright: (c) 2015-2017 Andrew Hawker :license: Apache 2.0, see LICENSE for more details. """ try: from setuptools import setup<|fim▁hole|> setup( name='decorstate...
except ImportError: from distutils.core import setup
<|file_name|>tsxElementResolution.js<|end_file_name|><|fim▁begin|>//// [tsxElementResolution.tsx] declare namespace JSX { interface IntrinsicElements { foundFirst: { x: string }; 'string_named'; 'var'; } } class foundFirst { } class Other {} module Dotted { export class Name { }<|fim▁hole|>} // Should fin...
<|file_name|>NavigatorActionsStateController.java<|end_file_name|><|fim▁begin|>/* * aTunes * Copyright (C) Alex Aranda, Sylvain Gaudard and contributors * * See http://www.atunes.org/wiki/index.php?title=Contributing for information about contributors * * http://www.atunes.org * http://sourceforge.net/projects/a...
/** * Enables or disables tree popup actions *
<|file_name|>generate_bindings.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """code generator for GL/GLES extension wrangler.""" import os impo...
'EGLint* num_config', }, { 'return_type': 'EGLBoolean', 'names': ['eglChooseConfig'], 'arguments': 'EGLDisplay dpy, const EGLint* attrib_list, EGLConfig* configs, '
<|file_name|>my-books-page.component.ts<|end_file_name|><|fim▁begin|>import {Component, OnInit} from '@angular/core' <|fim▁hole|> templateUrl: './my-books-page.component.html', styleUrls: ['./my-books-page.component.css'] }) export class MyBooksPageComponent implements OnInit { constructor() { } ngOnInit() {...
@Component({ selector: 'wn-my-books-page',
<|file_name|>ProductMilestoneReleaseProvider.java<|end_file_name|><|fim▁begin|>/** * JBoss, Home of Professional Open Source. * Copyright 2014 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License");<|fim▁hole|> * you may not...
<|file_name|>getNameBadIndexed.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- ## ## ## This file is part of Indico. ## Copyright (C) 2002 - 2014 European Organization for Nuclear Research (CERN). ## ## Indico is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Publi...
from indico.core.db import DBMgr from MaKaC import user
<|file_name|>setup_ranger_plugin.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """ 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 f...
if previous_jdbc_jar and os.path.isfile(previous_jdbc_jar): File(previous_jdbc_jar, action='delete')
<|file_name|>path-text.tsx<|end_file_name|><|fim▁begin|>import * as React from 'react' import * as Path from 'path' import { clamp } from '../../lib/clamp' import { Tooltip } from './tooltip' import { createObservableRef } from './observable-ref' interface IPathTextProps { /** * The file system path which is to b...
private resizeIfNecessary() { if (!this.pathElementRef.current || !this.pathInnerElement) {
<|file_name|>retry.py<|end_file_name|><|fim▁begin|>import math import time # Retry decorator with exponential backoff def retry(tries, delay=1, backoff=2): """Retries a function or method until it returns True. delay sets the initial delay, and backoff sets how much the delay should lengthen after each failure...
return deco_retry # @retry(arg[, ...]) -> true decorator
<|file_name|>ch3_3_boston_housing.py<|end_file_name|><|fim▁begin|>import numpy as np import keras as ks import matplotlib.pyplot as plt from keras.datasets import boston_housing from keras import models from keras import layers from keras.utils.np_utils import to_categorical (train_data, train_targets), (test_data, t...
<|file_name|>group_lib.py<|end_file_name|><|fim▁begin|>from sys import maxsize class Group: def __init__(self, group_name=None, group_header=None, group_footer=None, id=None): self.group_name = group_name self.group_header = group_header self.group_footer = group_footer self.id = i...
return maxsize
<|file_name|>Theme.ts<|end_file_name|><|fim▁begin|>import { AlloyTriggers, Attachment, Debugging, Swapping } from '@ephox/alloy'; import { Cell, Fun } from '@ephox/katamari'; import { PlatformDetection } from '@ephox/sand'; import { Element, Focus, Insert, Node } from '@ephox/sugar'; import DOMUtils from 'tinymce/core...
const original = Element.fromDom(args.targetNode);
<|file_name|>ModifyHaVipAttribute_test.go<|end_file_name|><|fim▁begin|>package ecs import ( "fmt" "testing" ) func TestModifyHaVipAttribute(t *testing.T) { var req ModifyHaVipAttributeRequest req.Init() req.SetFormat("JSON")<|fim▁hole|> if err != nil { t.Errorf("Error: %s", err.Error()) } fmt.Printf("Success...
req.SetRegionId("cn-shenzhen") var accessId = "Ie65kUInu5GeAsma" var accessSecret = "8cCqoxdYU9zKUihwXFXiN1HEACBDwB" resp, err := ModifyHaVipAttribute(&req, accessId, accessSecret)
<|file_name|>tool-trillspell.cpp<|end_file_name|><|fim▁begin|>// // Programmer: Craig Stuart Sapp <craig@ccrma.stanford.edu> // Creation Date: Sat Aug 25 14:12:42 PDT 2018 // Last Modified: Sat Aug 25 19:47:08 PDT 2018 // Filename: tool-trillspell.cpp // URL: https://github.com/craigsapp/humlib/blob/m...
<|file_name|>Room.cpp<|end_file_name|><|fim▁begin|>// // Created by Yorick on 18/10/2016. // #include "Room.h" #include "../Rng.h" using namespace std; Room::Room(Coordinate coordinate, RoomType roomType, int securityLevel) { _coordinate = coordinate; _securityLevel = securityLevel; _type = roomType; ...
}
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>extern crate capnp; pub mod event; pub mod service;<|fim▁hole|> include!(concat!(env!("OUT_DIR"), "/dht_msg_capnp.rs")); }<|fim▁end|>
pub mod dht_msg_capnp {
<|file_name|>_change_password.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- <|fim▁hole|>from django.views.generic import FormView class ChangePassword(FormView): pass change_password = ChangePassword.as_view()<|fim▁end|>
<|file_name|>UserAssignedIdentity.java<|end_file_name|><|fim▁begin|>// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.applicationinsights.models; import com.azure.core.annotation...
public void validate() { } }
<|file_name|>add_ad_groups.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Copyright 2014 Google Inc. All Rights Reserved. #<|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 "...
# 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|>register.go<|end_file_name|><|fim▁begin|>// Copyright 2019 Google LLC 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.org/lic...
<|file_name|>Good.java<|end_file_name|><|fim▁begin|>package generics.p19; import java.util.Random; import utils.Generator; public class Good { private final int id; private String description; public Good(int id, String description) { this.id = id; this.description = description;...
public static Generator<Good> generator = new Generator<Good>() {
<|file_name|>QueryHolder.cpp<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * 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 ver...
<|file_name|>ClipPhotoActivity.java<|end_file_name|><|fim▁begin|>package me.nereo.multi_image_selector; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Matrix; import android.graph...
context.startActivity(targetIntent); }
<|file_name|>0005_auto_20150430_1645.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('discussions', '0004_auto_20150430_1641'), ] operations = [ ...
model_name='discussion',
<|file_name|>connection_monitor_parameters.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 informati...
class ConnectionMonitorParameters(Model): """Parameters that define the operation to create a connection monitor. All required parameters must be populated in order to send to Azure.
<|file_name|>mac_utils.py<|end_file_name|><|fim▁begin|>""" Helper functions for use by mac modules .. versionadded:: 2016.3.0 """ import logging import os import plistlib import subprocess import time import xml.parsers.expat import salt.grains.extra import salt.modules.cmdmod import salt.utils.args import salt.utils...
Args: cmd: Returns:
<|file_name|>streaming_distribution.py<|end_file_name|><|fim▁begin|># Copyright 2014-2015 Isotoma Limited # # 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/...
}), "S3Origin": serializers.Resource(group="s3origin"), }
<|file_name|>lmdb.rs<|end_file_name|><|fim▁begin|>// Copyright 2021 The Grin Developers // // 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....
#[test] fn test_exists() -> Result<(), store::Error> {
<|file_name|>createFile.js<|end_file_name|><|fim▁begin|>"use strict"; var Client = require("./../lib/index"); var testAuth = require("./../testAuth.json"); var github = new Client({ debug: true }); github.authenticate({ type: "oauth", token: testAuth["token"]<|fim▁hole|> github.repos.createFile({ own...
});
<|file_name|>callback_full_pipeline.py<|end_file_name|><|fim▁begin|># Copyright 2013-2015 DataStax, 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/LIC...
future.add_callbacks(self.insert_next, self.insert_next)
<|file_name|>install-dependencies.js<|end_file_name|><|fim▁begin|>'use strict'; module.exports = function (grunt) { var exec = require('child_process').exec;<|fim▁hole|> cb = this.async(); options = this.options({ cwd: '', stdout: true, stderr: true, failOnError: true, isDevelopm...
grunt.registerMultiTask('install-dependencies', 'Installs npm dependencies.', function () { var cb, options, cp;
<|file_name|>version.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
document.write('2018年1月');
<|file_name|>generate-from-blueprint.js<|end_file_name|><|fim▁begin|>/*jshint quotmark: false*/ 'use strict'; var Blueprint = require('../models/blueprint'); var Task = require('../models/task'); var parseOptions = require('../utilities/parse-options'); var merge = require('lodash-node/modern/object...
<|file_name|>clonesrv4.py<|end_file_name|><|fim▁begin|>""" Clone server Model Four Author: Min RK <benjaminrk@gmail.com """ import zmq from kvsimple import KVMsg # simple struct for routing information for a key-value snapshot class Route: def __init__(self, socket, identity, subtree): self.socket = soc...
if request == "ICANHAZ?": pass
<|file_name|>android_policy_writer_unittest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # Copyright (c) 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. '''Unit tests for writers.android_policy_writer''' <|fim...
import os import sys if __name__ == '__main__': sys.path.append(os.path.join(os.path.dirname(__file__), '../../../..'))
<|file_name|>search.js<|end_file_name|><|fim▁begin|>define(['jquery', 'uri', 'base/ui', 'masonry', 'base/login', 'analytics', 'localized', 'jquery-ui.autocomplete'], function ($, URI, UI, Masonry, webmakerAuth, analytics, localized) { var query = $('.search-poster').attr('data-query'), queryKeys = URI.parse...
} $searchField.click(function () {
<|file_name|>OreDictHelper.java<|end_file_name|><|fim▁begin|>package com.InfinityRaider.AgriCraft.utility; import com.InfinityRaider.AgriCraft.items.ItemAgricraft; import com.InfinityRaider.AgriCraft.items.ItemNugget; import com.InfinityRaider.AgriCraft.reference.Data; import net.minecraft.block.Block; import net.mine...
public static void getRegisteredOres() { //Vanilla
<|file_name|>MooEditable.js<|end_file_name|><|fim▁begin|>/* --- name: MooEditable description: Class for creating a WYSIWYG editor, for contentEditable-capable browsers. license: MIT-style license authors: - Lim Chee Aun - Radovan Lozej - Ryan Mitchell - Olivier Refalo - T.J. Leahy requires: - Core/Class.Extras - ...
<|file_name|>tuf_store.go<|end_file_name|><|fim▁begin|>package storage import ( "encoding/hex" "fmt" "time" "github.com/docker/go/canonical/json" "github.com/docker/notary" "github.com/docker/notary/storage" "github.com/docker/notary/tuf/data" ) // TUFMetaStorage wraps a MetaStore in order to walk the TUF tre...
} snapshotSHA256Bytes, ok := snapshotChecksums.Hashes[notary.SHA256] if !ok {
<|file_name|>ArduinoSerial.cpp<|end_file_name|><|fim▁begin|>/* * Arduino-serial * -------------- * * A simple command-line example program showing how a computer can * communicate with an Arduino board. Works on any POSIX system (Mac/Unix/PC) * * * Compile with something like: * gcc -o arduino-serial arduino...
} assert(brate != 0);
<|file_name|>Repository.java<|end_file_name|><|fim▁begin|>package br.com.vepo.datatransform.model; import org.springframework.beans.factory.annotation.Autowired; public abstract class Repository<T> { @Autowired protected MongoConnection mongoConnection; public <V> T find(Class<T> clazz, V key) { return mongoCon...
<|file_name|>args.rs<|end_file_name|><|fim▁begin|>// Copyright 2017 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT.<|fim▁hole|>// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/li...
//
<|file_name|>filter-by.pipe.ts<|end_file_name|><|fim▁begin|>import { Pipe, PipeTransform } from '@angular/core'; import * as _ from 'lodash'; @Pipe({name: 'myFilterBy'}) export class FilterByPipe implements PipeTransform { public transform(array: any[], args: string): any[] { if (args) { array = _.filter(array, ...
} return array; }
<|file_name|>exception.py<|end_file_name|><|fim▁begin|># Copyright 2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at<|fim▁hole|># http://www.apache.org/licenses/L...
#
<|file_name|>cssconditionrule.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 dom::bindings::codegen::Bindings::CSSConditionRu...
#[dom_struct] pub struct CSSConditionRule {
<|file_name|>type_half.hpp<|end_file_name|><|fim▁begin|>/////////////////////////////////////////////////////////////////////////////////////////////////// // OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net) /////////////////////////////////////////////////////////////////////////////////...
<|file_name|>testBumper.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2 import config import comm import sys import time import signal from jderobotTypes import BumperData if __name__ == '__main__': cfg = config.load(sys.argv[1])<|fim▁hole|> client = jdrc.getBumperClient("Test.Bumper") while T...
jdrc= comm.init(cfg, "Test")
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//! Specific packets use std::error::Error; use std::fmt::{self, Debug}; use std::io::{self, Read, Write}; #[cfg(feature = "tokio")] use tokio::io::{AsyncRead, AsyncReadExt}; use crate::control::fixed_header::FixedHeaderError; use crate::control::variable_header::Vari...
impl<T: EncodablePacket> codec::Encoder<T> for MqttCodec {
<|file_name|>entropy_test.go<|end_file_name|><|fim▁begin|>package entropy import ( "bytes" "errors" "fmt" "testing" "github.com/hashicorp/errwrap" ) type mockSourcer struct{} type mockSourcerWithError struct{} type mockSourcerFailureWithError struct{} type mockSourcerFailureWithoutError struct{} // simulates a...
}, } for _, test := range tests {
<|file_name|>transcribe.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/lice...
}
<|file_name|>AEDAcrypt_test.go<|end_file_name|><|fim▁begin|><|fim▁hole|>func TestEncrypter(t *testing.T) { var str string = "Hello World!" strenc := Encrypter([]byte(str)) _, err := Decrypter(strenc) if err != nil { t.Error("Expected 1.5, got ") } } func TestDecrypter(t *testing.T) { var str string = "Hello W...
package AEDAcrypt import "testing"
<|file_name|>test_scriptargs.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- """ Unit tests for script argument utilities. """ from __future__ import print_function, unicode_literals import pytest import argparse from Cerebrum.utils.scriptargs import build_callback_action <|fim▁hole|> d...
class CallbackCalled(Exception): pass
<|file_name|>get_menu.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """ Retrieves menu from Drupal site """ from aashestrap.models import Menu from django.core.management.base import BaseCommand import urllib2<|fim▁hole|> class Command(BaseCommand): def handle(self, *args, **options): get_menu...
from django.http import HttpResponse from BeautifulSoup import BeautifulSoup from django.core.exceptions import ObjectDoesNotExist
<|file_name|>latency.rs<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License");<|fim▁hole|> * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applica...
* you may not use this file except in compliance with the License.
<|file_name|>task2.py<|end_file_name|><|fim▁begin|>from mpi4py import MPI from utils.mpi_helper import finalize from utils.mpi_helper import init init() comm = MPI.COMM_WORLD rank = comm.Get_rank() size = comm.Get_size() print "process [", rank, "] - running" if rank == 0: data = {'name': "PROCESS-" + str(rank...
finalize()
<|file_name|>session.rs<|end_file_name|><|fim▁begin|>use std::io::Write; use nickel::{Continue, FormBody, Halt, MediaType, Middleware, MiddlewareResult, Request, Response}; use redis::Commands; use api::consumer::response::BADSESSION; use api::rds::RedisExtension; use api::routes::CONSUMER_HANDSHAKE; pub const SESSI...
pub struct SessionMiddleware; impl<D> Middleware<D> for SessionMiddleware {
<|file_name|>PathVariable.py<|end_file_name|><|fim▁begin|>"""SCons.Variables.PathVariable This file defines an option type for SCons implementing path settings. To be used whenever a a user-specified path override should be allowed. Arguments to PathVariable are: option-name = name of this option on the command l...
return (key, '%s ( /path/to/%s )' % (help, key), default, validator, None)
<|file_name|>day_7.rs<|end_file_name|><|fim▁begin|>use alloc::raw_vec::RawVec; use std::ops::{Deref, DerefMut}; use std::{slice, ptr}; use std::intrinsics::assume; pub struct Stack<T> { size: usize, buf: RawVec<T> } impl <T> Deref for Stack<T> { type Target = [T]; fn deref(&self) -> &[T] { u...
<|file_name|>chatroomServer.py<|end_file_name|><|fim▁begin|>import socket import threading import time def tcplink(sock, addr): print 'Accept new connection from %s:%s...' % addr sock.send('Welcome!') while True: data = sock.recv(1024) time.sleep(1) if data == 'exit' or no...
while True: sock, addr = s.accept() t = threading.Thread(target=tcplink, args=(sock, addr))
<|file_name|>game.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # game.py # # Copyright (C) 2013, 2014 Kano Computing Ltd. # License: http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2 # import stage import gameloop import math import random import config import gamestate as gs direction...
def isOutOfBoundaries(x, y): if x < stage.boundaries['left'] or x > stage.boundaries['right'] - 1:
<|file_name|>ed_print.py<|end_file_name|><|fim▁begin|>############################################################################### # Name: ed_print.py # # Purpose: Editra's printer class # # Author: Cody Precord <cp...
ret = False return ret
<|file_name|>BitmapDataChannelTest.ts<|end_file_name|><|fim▁begin|>import BitmapDataChannel from "openfl/display/BitmapDataChannel"; import * as assert from "assert"; describe ("TypeScript | BitmapDataChannel", function () { <|fim▁hole|> case BitmapDataChannel.ALPHA: case BitmapDataChannel.BLUE: case Bit...
it ("test", function () { switch (+BitmapDataChannel.ALPHA) {
<|file_name|>ads_tags.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals from django import template from django.conf import settings from django.utils import timezone from ads.models import Ad <|fim▁hole|>def render_ads_zone(context, zone): """ Returns an advertise for a ``zone``. Ta...
register = template.Library() @register.inclusion_tag('ads/tags/render_ads_zone.html', takes_context=True)
<|file_name|>numbers.cc<|end_file_name|><|fim▁begin|>// Copyright 2010 Google Inc. All Rights Reserved. // Refactored from contributions of various authors in strings/strutil.cc // // This file contains string processing functions related to // numeric values. #define __STDC_FORMAT_MACROS 1 #include "strings/numbers.h"...
// AutoDigitStrCmp // AutoDigitLessThan
<|file_name|>test_pool.py<|end_file_name|><|fim▁begin|>import threading, time from sqlalchemy import pool, interfaces, select, event import sqlalchemy as tsa from sqlalchemy import testing from sqlalchemy.testing.util import gc_collect, lazy_gc from sqlalchemy.testing import eq_, assert_raises from sqlalchemy.testing.e...
c1.close() else: c2 = None
<|file_name|>interface.py<|end_file_name|><|fim▁begin|>""" Interface definition. """ from zope import interface class IMailer(interface.Interface): """ An object that sends e-mail. """ def send(sender, recipient, content): """ Sends the content to the recipient as the sender. "...
"""
<|file_name|>runner.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # daemon/runner.py # Part of python-daemon, an implementation of PEP 3143. # # Copyright © 2009 Ben Finney <ben+python@benfinney.id.au> # Copyright © 2007–2008 Robert Niederreiter, Jens Klein # Copyright © 2003 Clark Evans # Copyright © 2002 N...
def _stop(self): """ Exit the daemon process specified in the current PID file. """ if not self.pidfile.is_locked():
<|file_name|>compression.rs<|end_file_name|><|fim▁begin|>use libc::{c_int,size_t,intptr_t}; #[link(name="libfwnt",kind="dylib")] extern { fn libfwnt_lzxpress_huffman_decompress( compressed_data: *const u8, compressed_data_size: size_t,<|fim▁hole|> uncompressed_data_size: *mut size_t, ...
uncompressed_data: *mut u8,
<|file_name|>validation.py<|end_file_name|><|fim▁begin|>import json import os from functools import wraps from docker.utils.ports import split_port from jsonschema import Draft4Validator from jsonschema import FormatChecker from jsonschema import ValidationError from .errors import ConfigurationError DOCKER_CONFIG_...
<|file_name|>parse-per.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python """ Parse PER vs. SINR data from trace files. Revision Info ============= * $LastChangedBy: mandke $ * $LastChangedDate: 2011-10-19 17:04:02 -0500 (Wed, 19 Oct 2011) $ * $LastChangedRevision: 5220 $ :author: Ketan Mandke <kmandke@mail.ute...
assert (param['label'] is not None) parsed_data = {'parameters': parameters, 'data': data} sys.stdout.write("%s\n"%(parsed_data) ) # parse model PER from trace
<|file_name|>TorrentProvider.py<|end_file_name|><|fim▁begin|># coding=utf-8 # This file is part of SickRage. # # URL: https://sickrage.github.io # Git: https://github.com/SickRage/SickRage.git # # SickRage is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as ...
for item in self.search(search_strings[0]): title, url = self._get_title_and_url(item)
<|file_name|>htmliframeelement.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 dom::attr::Attr; use dom::attr::AttrValue; use ...
#[dom_struct]
<|file_name|>Invoice.java<|end_file_name|><|fim▁begin|>package model.beans; import java.util.Date; /** * * @author Gepardas */ public class Invoice { private String buyerName; private String buyerCode; private String buyerAdress; private String buyerCity; private String buyer...
<|file_name|>position.mako.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/. */ <%! from data import to_rust_ident %> <%namespace name=...
<|file_name|>QuickBot.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python """ @brief QuickBot class for Beaglebone Black @author Rowland O'Flaherty (rowlandoflaherty.com) @date 02/07/2014 @version: 1.0 @copyright: Copyright (C) 2014, Georgia Tech Research Corporation see the LICENSE file included with this software (see...