prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>red.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # Example using an RGB character LCD wired directly to Raspberry Pi or BeagleBone Black. import time import Adafruit_CharLCD as LCD # Raspberry Pi configuration: <|fim▁hole|>lcd_rs = 27 # Change this to pin 21 on older revision Raspberry Pi's...
<|file_name|>read_depth_stencil.py<|end_file_name|><|fim▁begin|>'''OpenGL extension NV.read_depth_stencil This module customises the behaviour of the OpenGL.raw.GLES2.NV.read_depth_stencil to provide a more Python-friendly API The official definition of this extension is available here: http://www.opengl.org/regist...
<|file_name|>Binary2.java<|end_file_name|><|fim▁begin|>package com.bytezone.diskbrowser.nufx; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.util.ArrayList; import java.util.List; import com.bytezone.diskbrowser.prodos.write.DiskFullException; import com.bytezone.diskbr...
int totalBlocks; String fileName; // ---------------------------------------------------------------------------------//
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import React, { Component } from 'react'; import { AppRegistry, StyleSheet, Text, View, TouchableOpacity, } from 'react-native'; import ScrollableTabView, { ScrollableTabBar, } from 'react-native-scrollable-tab-view'; class wsapp extends Component { ren...
<|file_name|>Packet_LOCAL_INFILE_Request_test.go<|end_file_name|><|fim▁begin|><|fim▁hole|>import "testing" import "github.com/stretchr/testify/assert" var LOCAL_INFILE_Request_test_packets = []struct { packet Proto context Context }{ {packet: Proto{data: StringToPacket(` 0c 00 00 01 fb 2f 65 74 63 2f 70 61 73 7...
package MySQLProtocol
<|file_name|>index.js<|end_file_name|><|fim▁begin|>var Filter = require('broccoli-filter') module.exports = WrapFilter; WrapFilter.prototype = Object.create(Filter.prototype); WrapFilter.prototype.constructor = WrapFilter; function WrapFilter (inputTree, options) { if (!(this instanceof WrapFilter)) return new WrapF...
<|file_name|>index_ttl.go<|end_file_name|><|fim▁begin|>package storage import ( "fmt" "strings" "time" mgo "github.com/ilius/mgo" "github.com/ilius/mgo/bson" ) func ModifyIndexTTL(db mgo.Database, collection string, index mgo.Index) error { keyInfo, err := mgo.ParseIndexKey(index.Key) if err != nil { return...
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>import random import time import datetime from consts import * __all__ = ['gen_valid_id', 'gen_list_page', 'log'] def gen_valid_id(collection): def gen_id(): _id = '' for i in range(4): _id += random.choice('0123456789') retur...
def add_key(key, value):
<|file_name|>sp_head.cc<|end_file_name|><|fim▁begin|>/* Copyright (c) 2002, 2016, Oracle and/or its affiliates. Copyright (c) 2011, 2020, MariaDB 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 Fo...
Add tables used by routine to the table list. Converts multi-set of tables used by this routine to table list and adds this list to the end of table list specified by 'query_tables_last_ptr'.
<|file_name|>api.rs<|end_file_name|><|fim▁begin|>pub mod collected { use crate::BenchmarkName; use crate::Commit; <|fim▁hole|> #[derive(Debug, PartialEq, Clone, serde::Serialize, serde::Deserialize)] pub enum Request { // Will benchmark commit with these benchmarks BenchmarkCommit { ...
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import browserColor from 'tap-browser-color'; browserColor(); import test from 'tape'; import React from 'react'; import universal from '../../client'; import routes from '../fixtures/routes'; import reducers from '../fixtures/reducers'; const app = universal({ Reac...
<|file_name|>mmu.py<|end_file_name|><|fim▁begin|>try: from primitives import Mem except ImportError: from mem import Mem import sys if sys.version >= '3': xrange = range class MMU(): def __init__(self, mem, size=0): """ Initialize MMU """ self._enabled = False self._mem...
<|file_name|>requestService.ts<|end_file_name|><|fim▁begin|>/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *---...
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import patterns, include, url from django.shortcuts import redirect, render_to_response from django.template.context import RequestContext # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() #...
} return render_to_response('docs/docs.html', RequestContext(request, ctx))
<|file_name|>gcpubsub_info.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # Copyright 2016 Google Inc. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_ve...
except ImportError as e: HAS_GOOGLE_CLOUD_PUBSUB = False
<|file_name|>regression_fuzz.rs<|end_file_name|><|fim▁begin|>// These tests are only run for the "default" test target because some of them // can take quite a long time. Some of them take long enough that it's not // practical to run them in debug mode. :-/ // See: https://oss-fuzz.com/testcase-detail/567322549918105...
<|file_name|>context.go<|end_file_name|><|fim▁begin|>// This file is part of graze/golang-service // // Copyright (c) 2016 Nature Delivered Ltd. <https://www.graze.com> // // For the full copyright and license information, please view the LICENSE // file that was distributed with this source code. // // license: https:...
logger log.FieldLogger handler http.Handler }
<|file_name|>test11_cross_validate_objects_1200ms_scaled_method_v.py<|end_file_name|><|fim▁begin|># Principal Component Analysis Code : from numpy import mean,cov,double,cumsum,dot,linalg,array,rank,size,flipud from pylab import * import numpy as np import matplotlib.pyplot as pp #from enthought.mayavi import mlab i...
num_data,dim = X.shape #center data
<|file_name|>buffer_map.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::collections::HashMap; use std::collections::hash_...
entry.insert(BufferValue { buffers: vec!(new_buffer), last_action: *counter, });
<|file_name|>Utils.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # This file is part of EventGhost. # Copyright © 2005-2016 EventGhost Project <http://www.eventghost.net/> # # EventGhost is free software: you can redistribute it and/or modify it under # the terms of the GNU General Public License as publish...
)
<|file_name|>test_discretization.py<|end_file_name|><|fim▁begin|>from unittest import TestCase from tcontrol.discretization import c2d from ..transferfunction import tf from ..model_conversion import *<|fim▁hole|> class TestDiscretization(TestCase): def setUp(self): self.s1 = tf([1], [1, 0, 1]) sel...
from ..statespace import StateSpace import numpy as np from .tools.test_utility import assert_ss_equal
<|file_name|>mv.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- class Mv: def command(self): self.config = { "command": { "mv": { "function": self.mvScreams, "usage": "mv <user>", "help": "Le clavier y colle!" } }} ...
<|file_name|>lib.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/. */ #![deny(unsafe_code)] #![cfg_attr(feature = "unstable", feature(c...
extern crate webrender_api; extern crate webvr_traits;
<|file_name|>test_fixes.py<|end_file_name|><|fim▁begin|># Authors: Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org> # Gael Varoquaux <gael.varoquaux@normalesup.org> # Alex Gramfort <alexandre.gramfort@telecom-paristech.fr> # License: BSD import numpy as np from nose.tools import assert_equ...
from ..fixes import _filtfilt as mne_filtfilt
<|file_name|>main.py<|end_file_name|><|fim▁begin|>from flask import Blueprint, render_template, redirect, url_for, current_app monitoring_main = Blueprint('monitoring_main', __name__, # pylint: disable=invalid-name template_folder='templates', static_url_path='...
return redirect(url_for('monitoring_main.events'))
<|file_name|>Vec2D.py<|end_file_name|><|fim▁begin|>"basic 2D vector geometry" from math import acos, sqrt, sin, cos, pi class Vec2D(object): " Simple 2D vector class for euclidean geometry " EPSILON = 0.0001 def __init__(self, x=0.0, y=0.0): self.pos_x = x self.pos_y = y def dot(sel...
return Vec2D(self.pos_x - other.pos_x, self.pos_y - other.pos_y)
<|file_name|>testroute.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from .base import BaseHandler <|fim▁hole|><|fim▁end|>
class TestRoute(BaseHandler): def get(self, file): return self.render(str(file) + '.jade', show_h1=1)
<|file_name|>searching_polyhedron_vertices_with_fuzzy_sphere.cpp<|end_file_name|><|fim▁begin|>#include <CGAL/Exact_predicates_inexact_constructions_kernel.h> #include <CGAL/Polyhedron_3.h> #include <CGAL/IO/Polyhedron_iostream.h> #include <CGAL/boost/graph/graph_traits_Polyhedron_3.h> #include <CGAL/Search_traits_3.h...
Point_3 query(0.0, 0.0, 0.0); double radius = 0.5; double epsilon = 0.01;
<|file_name|>client.js<|end_file_name|><|fim▁begin|><|fim▁hole|> export default axios.create({ baseURL: 'http://localhost:9000/v1/' });<|fim▁end|>
import axios from 'axios';
<|file_name|>processor.py<|end_file_name|><|fim▁begin|>from indra.statements import * from rdflib import URIRef, Namespace from rdflib.namespace import RDF import collections import urllib import re import keyword BEL = Namespace("http://www.openbel.org/") prefixes = """ PREFIX belvoc: <http://www.openbel.org/vo...
citation, evidence, annotations)) elif act_type == 'Catalytic': if mod == 'Hydroxylation':
<|file_name|>base_filters.py<|end_file_name|><|fim▁begin|>import re import os import pytz from PIL import Image from dateutil.parser import parse from datetime import datetime from decimal import Decimal from django.template import Library from django.conf import settings from django.template.defaultfilters import str...
@register.filter def get_object(obj): """return obj.object if this obj has the attribute of object""" if hasattr(obj, 'object'):
<|file_name|>simpleapi.rs<|end_file_name|><|fim▁begin|>// Simple API example, ported from http://lua-users.org/wiki/SimpleLuaApiExample // This is a simple introductory example of how to interface to Lua from Rust. // The Rust program loads a Lua script file, sets some Lua variables, runs the // Lua script, and reads ...
*/ for i in range_inclusive(1, 5) { L.pushinteger(i); // Push the table index L.pushinteger(i*2); // Push the cell value
<|file_name|>server-again.py<|end_file_name|><|fim▁begin|>########################################################################### # Concurrent WSGI server - webserver3h.py # # # # Tested with Python 2.7.9 on Ubun...
return
<|file_name|>analysis.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python from os import path from collections import defaultdict import math root = path.dirname(path.dirname(path.dirname(__file__))) result_dir = path.join(root, 'results') def get_file_name(test): test = '%s_result' % test return path.join(...
<|file_name|>TSEditorHandler.cpp<|end_file_name|><|fim▁begin|>/* * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later versi...
} } void TSEditorHandler::vSetConfigurationData(xmlDocPtr pXmlDoc) {
<|file_name|>vrstageparameters.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ use crate::dom::bindings::cell::DomRefCell; use cr...
fn SizeZ(&self) -> Finite<f32> { Finite::wrap(self.parameters.borrow().size_z) } }
<|file_name|>writefile.rs<|end_file_name|><|fim▁begin|>use std::io::File; <|fim▁hole|>}<|fim▁end|>
fn main(){ let mut file = File::create(&Path::new("test.txt")); file.write(bytes!("pewpewpew\n"));
<|file_name|>encoding.go<|end_file_name|><|fim▁begin|>// Copyright ©2017 The Gonum 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 encoding import "gonum.org/v1/gonum/graph" // Builder is a graph that can have user-defined ...
} (*a)[i].Value = attr.Value
<|file_name|>chunks.rs<|end_file_name|><|fim▁begin|>use std::sync::{Arc, Mutex}; use simple_parallel; use state::LSystem; use super::{LProcessor, SimpleProcessor}; /// Parallel processor dividing a state into chunks to be individually iterated /// within a pool of threads. pub struct ChunksProcessor { /// The num...
<|file_name|>union_find.rs<|end_file_name|><|fim▁begin|>pub struct UnionFind { parents: Vec<usize>, ranks: Vec<u64> } impl UnionFind { pub fn new(size: usize) -> UnionFind { UnionFind { parents: (0..size).map(|i| i).collect(), ranks: (0..size).map(|_| 0).collect() } ...
pub fn union(&mut self, x: usize, y: usize) { let xr = self.find(x); let yr = self.find(y);
<|file_name|>cli.py<|end_file_name|><|fim▁begin|>"""Top-level import for all CLI-related functionality in apitools. Note that importing this file will ultimately have side-effects, and may require imports not available in all environments (such as App Engine). In particular, picking up some readline-related imports ca...
from googlecloudapis.apitools.base.py.app2 import * from googlecloudapis.apitools.base.py.base_cli import *
<|file_name|>classes.py<|end_file_name|><|fim▁begin|>############################################################################ # # Copyright (C) 2016 The Qt Company Ltd. # Contact: https://www.qt.io/licensing/ # # This file is part of Qt Creator. # # Commercial License Usage # Licensees holding valid commercial Qt l...
elif target == Targets.SIMULATOR:
<|file_name|>freshen.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/license...
self.infcx.type_variables.borrow().probe(v), ty::TyVar(v),
<|file_name|>byte-string-literals.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.apach...
b"\x0Z"; //~ ERROR illegal character in numeric character escape: Z b"é"; //~ ERROR byte constant must be ASCII
<|file_name|>FirebirdInterface.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # -*- coding: iso-8859-1 -*- from downloadCommon import DownloadCommon, getSeqName from DdlCommonInterface import DdlCommonInterface import re class FbDownloader(DownloadCommon): def __init__(self): self.strDbms = 'firebi...
12 : 'date', 13 : 'time', 35 : 'timestamp', 37 : 'varchar',
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>#[allow(clippy::unreadable_literal)] #[allow(clippy::too_many_arguments)] #[allow(clippy::match_same_arms)] #[allow(clippy::type_complexity)] mod auto; pub use auto::*; mod utils; mod aggregator;<|fim▁hole|> pub mod prelude { pub use glib::prelude::*; pub use g...
mod aggregator_pad;
<|file_name|>index.js<|end_file_name|><|fim▁begin|>/* @flow */ /* global Navigator, navigator */ import config from 'config'; import * as React from 'react'; import { Helmet } from 'react-helmet'; import { connect } from 'react-redux'; import { withRouter } from 'react-router-dom'; import NestedStatus from 'react-neste...
}, }; }
<|file_name|>miniterm.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # Very simple serial terminal # (C)2002-2009 Chris Liechti <cliechti@gmx.net> # Input characters are sent directly (only LF -> CR/LF/CRLF translation is # done), received characters are displayed as is (or escaped trough pythons # repr, usefu...
<|file_name|>main.py<|end_file_name|><|fim▁begin|>from ConfigParser import DEFAULTSECT from cmd import Cmd import logging import sys import subprocess import argparse import datetime from fibbing import FibbingManager import fibbingnode from fibbingnode.misc.utils import dump_threads import signal log = fibbingnode.lo...
self.fibbing.root.lsdb.graph.edges(data=True)) def do_print_net(self, line=''):
<|file_name|>test_gpu_demos.py<|end_file_name|><|fim▁begin|>import os import subprocess import sys import pytest sys.path.append("tests/python") import testing as tm import test_demos as td # noqa @pytest.mark.skipif(**tm.no_cupy()) def test_data_iterator(): script = os.path.join(td.PYTHON_DEMO_DIR, 'quan...
<|file_name|>modulefinder1.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # https://docs.python.org/3/library/modulefinder.html from modulefinder import ModuleFinder finder = ModuleFinder() finder.run_script('graph1.py') print('Loaded modules:') for name, mod in finder.modules.items(): print('%s: ' % na...
<|file_name|>resources.component.ts<|end_file_name|><|fim▁begin|>import { Component, OnInit } from '@angular/core'; import { IF_result } from '../shared/index'; import { ResourceService } from '../shared/api/resource.service'; /** * 环境声明 * @type {any} */ declare var $:any; /** * interface - 资源单 */ interface IF_r...
isLoader : true, isLast : false, page : 1,
<|file_name|>ex6.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python ''' Use Netmiko to execute 'show arp' on pynet-rtr1, pynet-rtr2, and juniper-srx. ''' from netmiko import ConnectHandler from getpass import getpass from routers import pynet_rtr1, pynet_rtr2, pynet_jnpr_srx1 <|fim▁hole|> ''' ip_address = r...
def main(): ''' Use Netmiko to execute 'show arp' on pynet-rtr1, pynet-rtr2, and juniper-srx.
<|file_name|>ban_self_closing_custom_element_tagnames.js<|end_file_name|><|fim▁begin|>// Copyright 2021 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be<|fim▁hole|> const {isLitHtmlTemplateCall} = require('./utils.js'); module.exports = { meta: { ...
// found in the LICENSE file. 'use strict';
<|file_name|>test_signals.py<|end_file_name|><|fim▁begin|>from django.test import TestCase, Client from sendgrid import utils, signals import json class SignalTestCase(TestCase): def setUp(self): self.client = Client() self.email_data = {'subject': 'Test Subject', 'bod...
# verify that we received a signal self.assertEqual(len(data), 2)
<|file_name|>registry.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2014 CERN. ## ## Invenio 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; eit...
## Invenio is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
<|file_name|>debugSmoke.ts<|end_file_name|><|fim▁begin|>/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *-------...
<|file_name|>0008_auto_20150809_1341.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 = [ ('let_me_app', '0007_auto_20150723_2238'), ] operations = [<|fim▁...
migrations.AlterField( model_name='event', name='start_at',
<|file_name|>OI.java<|end_file_name|><|fim▁begin|>package team.gif; import edu.wpi.first.wpilibj.Joystick; import edu.wpi.first.wpilibj.buttons.Button; import edu.wpi.first.wpilibj.buttons.DigitalIOButton; import edu.wpi.first.wpilibj.buttons.JoystickButton; import team.gif.commands.*; public class OI { publ...
} }
<|file_name|>fake_plumlib.py<|end_file_name|><|fim▁begin|># Copyright 2013 PLUMgrid, Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www....
<|file_name|>git.rs<|end_file_name|><|fim▁begin|>use std::collections::HashMap; use std::env; use crate::config; use crate::errors::*; use crate::ConfigScope; pub struct Repo { repo: git2::Repository, } impl Repo { pub fn new() -> Result<Self> { let repo = env::current_dir() .chain_err(||...
result.insert(name.into(), value.into()); } } Ok(result)
<|file_name|>bulk.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013 OpenStack, LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Un...
<|file_name|>MyRecycleview.java<|end_file_name|><|fim▁begin|>package com.yezi.text.widget; import android.content.Intent; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.SwitchCompat; import android.view.View; import android.widget.CompoundButton; import com...
<|file_name|>serve.go<|end_file_name|><|fim▁begin|>// FUSE service loop, for servers that wish to use it. package fs // import "bazil.org/fuse/fs" import ( "encoding/binary" "fmt" "hash/fnv" "io" "log" "reflect" "runtime" "strings" "sync" "time" "golang.org/x/net/context" ) import ( "bytes" "bazil.org...
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>import styled, { css as styledCss, keyframes } from 'styled-components' import type { TTestable } from '@/spec' import Img from '@/Img' import { theme } from '@/utils/themes' import css from '@/utils/css' const DURATION = '2.5s' const load = keyframes` 0% { top...
const liquid2Rule = styledCss` ${liquid2} ${DURATION} infinite;
<|file_name|>app.component.ts<|end_file_name|><|fim▁begin|>/* * Angular 2 decorators and services */ import { Component, OnInit, ViewEncapsulation } from '@angular/core'; import { AppState } from './app.service'; /* * App Component * Top Level Component */ @Component({ selector: 'app', encapsulation: Vi...
// console.log('Initial App State', this.appState.state); } }
<|file_name|>model_deployment.py<|end_file_name|><|fim▁begin|># Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License");<|fim▁hole|># https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the Licen...
# you may not use this file except in compliance with the License. # You may obtain a copy of the License at #
<|file_name|>setup.py<|end_file_name|><|fim▁begin|># vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 # # Copyright (c) 2014, Arista Networks, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # ...
# CONSEQUENTIAL DAMAGES (INCLUDING, 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
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#![cfg_attr(feature = "unstable", feature(const_fn, drop_types_in_const))] #![cfg_attr(feature = "serde_derive", feature(proc_macro))] #![cfg_attr(feature = "nightly-testing", feature(plugin))] #![cfg_attr(feature = "nightly-testing", plugin(clippy))] #![cfg_attr(not(fea...
output_path, )); }
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from setuptools import setup, find_packages setup( name='pulp_ostree_common', version='1.0.0a1', packages=find_packages(), url='http://www.pulpproject.org', license='GPLv2+',<|fim▁hole|><|fim▁end|>
author='Pulp Team', author_email='pulp-list@redhat.com', description='common code for pulp\'s ostree support', )
<|file_name|>td_sequence.py<|end_file_name|><|fim▁begin|>''' TD_Sequence in class. ''' import numpy as np import pandas as pd import json import pandas.io.data as web from datetime import date, datetime, timedelta<|fim▁hole|> def __init__(self, data): self.data = data def sequence(self): setu...
from collections import defaultdict class TDSequence(object):
<|file_name|>test_overlay.py<|end_file_name|><|fim▁begin|>import os import pytest import sdk_install import sdk_networks import sdk_utils from tests import config overlay_nostrict = pytest.mark.skipif(os.environ.get("SECURITY") == "strict", reason="overlay tests currently broken in strict") @pytest.fixture(scope...
@pytest.mark.dcos_min_version('1.9') def test_install(): sdk_networks.check_task_network("template-0-node")
<|file_name|>deriving-span-Show-enum-struct-variant.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 /...
extern crate rand; struct Error;
<|file_name|>package-info.java<|end_file_name|><|fim▁begin|>/** * CKFinder * ======== * http://ckfinder.com * Copyright (C) 2007-2013, CKSource - Frederico Knabben. All rights reserved. * * The software, this file and its contents are subject to the CKFinder * License. Please read the license.txt file before usi...
/** * CKFinder for Java - server connector. */ package com.ckfinder.connector;
<|file_name|>03-literals-and-operators.rs<|end_file_name|><|fim▁begin|>fn main() { // Integer addition println!("1 + 2 = {}", 1u + 2); // Integer subtraction println!("1 - 2 = {}", 1i - 2); <|fim▁hole|> println!("true OR false is {}", true || false); println!("NOT true is {}", !true); // Bi...
// Short-circuiting boolean logic println!("true AND false is {}", true && false);
<|file_name|>fdb-legacy.js<|end_file_name|><|fim▁begin|>(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.expo...
<|file_name|>feature_block.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # Copyright (c) 2015-2018 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test block processing.""" import copy import...
block.vtx.extend(tx_list) # this is a little handier to use than the version in blocktools.py def create_tx(self, spend_tx, n, value, script=CScript([OP_TRUE, OP_DROP] * 15 + [OP_TRUE])):
<|file_name|>system_tables.go<|end_file_name|><|fim▁begin|>/* Copyright 2022 The Vitess Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unle...
} return isDbNameCol(col), isTableNameCol(col)
<|file_name|>index.d.ts<|end_file_name|><|fim▁begin|>// Type definitions for unused-files-webpack-plugin 3.4 // Project: https://github.com/tomchentw/unused-files-webpack-plugin // Definitions by: Vladimir Grenaderov <https://github.com/VladimirGrenaderov> // Max Boguslavskiy <https://github.com/maxbogu...
export class UnusedFilesWebpackPlugin extends Plugin { constructor(options: Options);
<|file_name|>factory.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright 2017 DST Controls # # 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.apach...
osisoftpy.factory ~~~~~~~~~~~~ """ from __future__ import (absolute_import, division, unicode_literals)
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models class Entry(models.Model): title = models.CharField(max_length=200) date = models.DateTimeField() class Meta: ordering = ('date',) def __unicode__(self): return self.title def get_absolu...
def __unicode__(self): return self.title
<|file_name|>test_dolfin_linear_solver.py<|end_file_name|><|fim▁begin|># Copyright (C) 2015-2022 by the RBniCS authors # # This file is part of RBniCS. # # SPDX-License-Identifier: LGPL-3.0-or-later import pytest from numpy import isclose from dolfin import (assemble, dx, Function, FunctionSpace, grad, inner, solve, T...
# Return return (self.a, self.f(g))
<|file_name|>lint-ctypes.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/lic...
<|file_name|>TestDOMUtil.java<|end_file_name|><|fim▁begin|>package org.auscope.portal.core.util; import java.io.IOException; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import javax.xml.XMLConstants; import javax.xml.namespace.NamespaceContext; import javax.xml.parsers.ParserConfigurati...
xPath.setNamespaceContext(new SimpleXMLNamespace());
<|file_name|>scheme.go<|end_file_name|><|fim▁begin|>package scheme import ( "k8s.io/apimachinery/pkg/runtime" utilruntime "k8s.io/apimachinery/pkg/util/runtime" operatorv1alpha1 "github.com/openshift/api/operator/v1alpha1" servicecertsignerv1alpha1 "github.com/openshift/api/servicecertsigner/v1alpha1" ) <|fim▁hol...
var ConfigScheme = runtime.NewScheme() func init() {
<|file_name|>0003_replace_null_tweetchunk_tz_country.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration):<|fim▁hole|> """Write your forwar...
def forwards(self, orm):
<|file_name|>main.go<|end_file_name|><|fim▁begin|>// Copyright 2012-Present Couchbase, Inc. // // Use of this software is governed by the Business Source License included // in the file licenses/BSL-Couchbase.txt. As of the Change Date specified // in that file, in accordance with the Business Source License, use ...
package main
<|file_name|>test.py<|end_file_name|><|fim▁begin|>from bottle import Bottle, run app = Bottle() @app.route('/') def index(): return 'PService Running' # # Start a server instance # run( app, # Run |app| Bottle() instance host = '0.0.0.0', port = 8080, re...
<|file_name|>CreativeClickThroughUrl.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 required ...
public java.lang.String getCustomClickThroughUrl() {
<|file_name|>test_error.py<|end_file_name|><|fim▁begin|># pylint: disable-all import unittest from circleci.error import CircleCIException, BadKeyError, BadVerbError, InvalidFilterError class TestCircleCIError(unittest.TestCase): def setUp(self): self.base = CircleCIException('fake') self.key = ...
def test_key_message(self): self.assertIn('deploy-key', self.key.message) def test_filter_message(self):
<|file_name|>as-array-test.js<|end_file_name|><|fim▁begin|>/* eslint-env jest */ jest.unmock('../as-array'); import { asArray, } from '../as-array'; describe('asArray()', () => { it('returns input as it is if an array', () => { expect(asArray([1, 2, 3])).toEqual([1, 2, 3]); }); <|fim▁hole|> }); it('con...
it('converts scalar value to an array which contains it', () => { expect(asArray(42)).toEqual([42]);
<|file_name|>contents.js<|end_file_name|><|fim▁begin|>(function(){ <|fim▁hole|>print (new \tomk79\pickles2\px2dthelper\main($px))->document_modules()->build_js(); ?> })();<|fim▁end|>
<?php
<|file_name|>Event.ts<|end_file_name|><|fim▁begin|>// 注意不能重名 module GameEvents { // 游戏状态 export var GAME_READY : string = "GameEventsGameReady"; export var GAME_START : string = "GameEventsGameStart"; export var GAME_PLAY : string = "GameEventsGamePlay"; export var GAME_OVER : string = "GameEventsGameOver"; <|f...
// 游戏逻辑
<|file_name|>viewer.js<|end_file_name|><|fim▁begin|>import React, {Component} from 'react'; import PdfJS from './pdfJS'; import Contract from "../../contract"; import Event from '../../event'; import AnnotationLoader from '../../annotator/loader'; class Viewer extends Component { constructor(props) { supe...
let annotations = Contract.getAnnotations(); annotations.result.forEach(annotation=> {
<|file_name|>introspection_helper.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from gi.repository import GLib, GObject, Gio from dfeet import dbus_utils def args_signature_markup(arg_signature): return '<small><span foreground="#2E8B57">%s</span></small>' % (arg_signature) def args_name_markup(arg_n...
self.__property_info = property_info # Gio.GDBusPropertyInfo object self.__value = None # the value
<|file_name|>common.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- __author__ = 'eveliotc' __license__ = 'See LICENSE' import alfred<|fim▁hole|>from alfred import Item import sys from subprocess import Popen, PIPE def json_to_obj(x): if isinstance(x, dict): return type('X', (), {k: json_to_obj(v)...
<|file_name|>lsf.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python #Copyright (C) 2013 by Thomas Keane (tk2@sanger.ac.uk) # #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 restricti...
<|file_name|>implant_method.py<|end_file_name|><|fim▁begin|># coding=utf8 from types import MethodType def implant_method(obj, func, func_name): base_class = obj.__class__ event = MethodType(func, obj, base_class)<|fim▁hole|> pass<|fim▁end|>
setattr(obj, func_name, event) if __name__ == "__main__":
<|file_name|>committers.py<|end_file_name|><|fim▁begin|># Copyright (c) 2011, Apple Inc. All rights reserved. # Copyright (c) 2009, 2011, 2012 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are ...
def _tokenize_contributor_name(self, contributor):
<|file_name|>cputemp_cubie1.py<|end_file_name|><|fim▁begin|>## Cubieboard@Armbian plugin for temperature measurment from libraries import utility def plugin_main(json_arguments=None): data="Undefned" <|fim▁hole|><|fim▁end|>
with open ("/sys/class/hwmon/hwmon0/device/temp1_input", "r") as temperature: data=temperature.read() return "{0} C".format(int(data)/1000)