prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>activation.py<|end_file_name|><|fim▁begin|># Copyright (C) 2014 Universidad Politecnica de Madrid
# 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/licen... | """Manager class for activating user in the USER REGISTRATION extension for Keystone.
For more information about the extension: https://www.github.com/ging/keystone
""" |
<|file_name|>ftplib.py<|end_file_name|><|fim▁begin|>"""An FTP client class and some helper functions.
Based on RFC 959: File Transfer Protocol (FTP), by J. Postel and J. Reynolds
Example:
>>> from ftplib import FTP
>>> ftp = FTP('ftp.python.org') # connect to host, default port
>>> ftp.login() # default, i.e... | if w1 == 'default':
default = 1
elif w1 == 'machine' and w2:
host = w2.lower()
|
<|file_name|>albino-build.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>
#[phase(plugin, link)] extern crate log;
extern crate getopts;
extern crate whitebase;
extern crate albino;
use getopts::Matches;
use std::os;
use std::io::IoError;
use whitebase::syntax::{Compiler, Assembly, Brainfuck, DT, Ook, Whitespace};
use ... | #![crate_name="albino-build"]
#![crate_type="bin"]
#![feature(phase)]
#![unstable] |
<|file_name|>render_task.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
//! The task that handles all rendering/painting.
use bu... | }
|
<|file_name|>log.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-<|fim▁hole|>from abc import ABCMeta, abstractmethod
from collections import namedtuple
InternalEvent = namedtuple(
'InternalEvent',
('identifier', 'state_change_id', 'block_number', 'event_object'),
)
# TODO:
# - snapshots should be used... | import pickle
import sqlite3
import threading |
<|file_name|>opengl-graphics.cpp<|end_file_name|><|fim▁begin|>/* Cabal - Legacy Game Implementations
*
* Cabal is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; yo... | assert(_transactionMode != kTransactionNone);
_currentState.aspectRatioCorrection = enable; |
<|file_name|>config.go<|end_file_name|><|fim▁begin|>/*
Copyright 2017 Ahmed Zaher
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 by appl... | |
<|file_name|>smf_plot.py<|end_file_name|><|fim▁begin|>import astropy.cosmology as co
aa=co.Planck15
import astropy.io.fits as fits
import matplotlib
import matplotlib
matplotlib.rcParams['agg.path.chunksize'] = 2000000
matplotlib.rcParams.update({'font.size': 12})
matplotlib.use('Agg')
import matplotlib.pyplot as p
i... | path_2_cosmos_cat = os.path.join( cosmos_dir, "photoz-2.0", "photoz_vers2.0_010312.fits")
#path_2_cosmos_cat = os.path.join( cosmos_dir, "COSMOS2015_Laigle+_v1.1.fits.gz")
|
<|file_name|>bucketlist.py<|end_file_name|><|fim▁begin|>import logging
import pprint
from flask import jsonify, make_response, request
from flask_restful import Resource, reqparse, fields, marshal
from app.models import BucketList
from app.common.db import save_record, delete_record
from app.common.auth.authorize impo... | else: |
<|file_name|>test_M201.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
from .MockPrinter import MockPrinter
import mock
from random import random
class M201_Tests(MockPrinter):
def setUp(self):
self.printer.path_planner.native_planner.setAcceleration = mock.Mock()
self.printer.axis_c... | |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from sqlalchemy import Column, Integer, String, Sequence, ForeignKey, Enum, Float
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
from . import Base
from .utils import ModelMixin
class Source(Base, ModelMixin):
__... | # describe source
name = Column(String(50), unique=True, nullable=False)
description = Column(String(250)) |
<|file_name|>JsonpMainTemplatePlugin.js<|end_file_name|><|fim▁begin|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const { SyncWaterfallHook } = require("tapable");
const Template = require("../Template");
class JsonpMainTemplatePlugin {
apply(mainT... | ]),
"}",
"return result;"
]), |
<|file_name|>test_airflow.py<|end_file_name|><|fim▁begin|># Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
from .common import BaseTest
import jmespath
class TestApacheAirflow(BaseTest):
def test_airflow_environment_value_filter(self):
session_factory = self.replay_flight_dat... | def test_airflow_environment_kms_filter(self):
session_factory = self.replay_flight_data('test_airflow_environment_kms_filter') |
<|file_name|>mcts.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>use mcts::{statistics, SearchSettings};
use rand::Rng;
use search_graph;
use std::{cmp, mem};
#[derive(Clone, Debug)]
pub struct Game {}
impl statistics::two_player::PlayerMapping for Role {
fn player_one() -> Self {
Role::Dwarf
}
fn player_two()... | use crate::actions::Action;
use crate::Role; |
<|file_name|>aws_test.go<|end_file_name|><|fim▁begin|>/*
Copyright 2014 The Kubernetes Authors All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/license... | true, "",
}, |
<|file_name|>logging.rs<|end_file_name|><|fim▁begin|>use jack_sys as j;
use lazy_static::lazy_static;
use std::ffi;
use std::io::{stderr, Write};
use std::sync::{Mutex, Once};
lazy_static! {
static ref INFO_FN: Mutex<Option<fn(&str)>> = Mutex::new(None);
static ref ERROR_FN: Mutex<Option<fn(&str)>> = Mutex::ne... | /// reset it to use stderr.
pub fn error_callback() -> Option<fn(&str)> { |
<|file_name|>core_test.py<|end_file_name|><|fim▁begin|>from pytest import fixture
from functional.core import (
builder,
PreparedImagesOutputChecker,
PDFDocumentChecker,
DjVuDocumentChecker)
@fixture()
def checker_classes():
""" Run all checkers in one test for optimization reason... |
def test_checker_valid_order(builder, checker_classes): |
<|file_name|>path_utils.rs<|end_file_name|><|fim▁begin|>use crate::borrow_set::{BorrowData, BorrowSet, TwoPhaseActivation};
use crate::places_conflict;
use crate::AccessDepth;
use crate::BorrowIndex;
use crate::Upvar;
use rustc_data_structures::graph::dominators::Dominators;
use rustc_middle::mir::BorrowKind;
use rustc... | // which would generate an error).
true
} |
<|file_name|>IMethodRefForm.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 ... | * This class implements the byte code form for those bytecodes which have
|
<|file_name|>people.py<|end_file_name|><|fim▁begin|>from scrapelib import HTTPError<|fim▁hole|>from openstates.utils import LXMLMixin
from pupa.scrape import Person, Scraper
class UTPersonScraper(Scraper, LXMLMixin):
def scrape(self):
PARTIES = {"R": "Republican", "D": "Democratic"}
representative... | |
<|file_name|>Serializer.java<|end_file_name|><|fim▁begin|><|fim▁hole|> * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless r... | /**
* Copyright 2014 TangoMe Inc.
* |
<|file_name|>test_dns_relay.py<|end_file_name|><|fim▁begin|># Copyright 2016 Cisco Systems, 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
#
# htt... | sock, addr, port = relay._open_dns_ext_socket()
|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: UTF-8 -*-
# YaBlog
# (c) Regis FLORET
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyri... | # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
<|file_name|>grpc.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2020 Google 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/LI... | from google.auth import credentials as ga_credentials # type: ignore
from google.auth.transport.grpc import SslCredentials # type: ignore
import grpc # type: ignore |
<|file_name|>OCAPI.js<|end_file_name|><|fim▁begin|>var Client = require('node-rest-client').Client;
//REST server properties
var host_url = "http://sapient5-evaluation-dw.demandware.net";
var api_path = "/s/SiteGenesis/dw/shop/v17_2/";
var server_url = host_url+api_path;
var client_id = "5a40714c-52c3-44df-a00d-9d3bb2d... | } |
<|file_name|>sql_func.py<|end_file_name|><|fim▁begin|>from django.db import connection
from laboratory.settings import TIME_ZONE
from utils.db import namedtuplefetchall
def get_history_dir(d_s, d_e, card_id, who_create_dir, services, is_serv, iss_pk, is_parent, for_slave_hosp):
with connection.cursor() as cursor:... | res_id,
res_title,
to_char(data_sozdaniya AT TIME ZONE %(tz)s, 'DD.MM.YY') as date_create,
time_confirmation, |
<|file_name|>auction_collection.js<|end_file_name|><|fim▁begin|>/**
* Auction collection
*/
'use strict';
var Model = require('../models/auction_model.js');<|fim▁hole|> model: Model
});
module.exports = AuctionCollection;<|fim▁end|> | var Collection = require('tungstenjs/adaptors/backbone').Collection;
var AuctionCollection = Collection.extend({ |
<|file_name|>compiler.hh<|end_file_name|><|fim▁begin|>// Copyright (c) 2019 ASMlover. All rights reserved.
//<|fim▁hole|>// are met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list ofconditions and the following disclaimer.
//
// * Redistributions in binary form must rep... | // Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions |
<|file_name|>flow_label.py<|end_file_name|><|fim▁begin|># ===============================================================================
# Copyright 2013 Jake Ross
#
# 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 c... | """
|
<|file_name|>bitcoin_ca_ES.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="ca_ES" version="2.1">
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About BitSeeds</source>
<translation>Sobre BitS... | <location line="+1"/>
<source>Show transaction details</source> |
<|file_name|>main.js<|end_file_name|><|fim▁begin|>var rowIdSequence = 100;
var rowClassRules = {
"red-row": 'data.color == "Red"',
"green-row": 'data.color == "Green"',
"blue-row": 'data.color == "Blue"',
};
var gridOptions = {
defaultColDef: {
width: 80,
sortable: true,
filter... | {field: "value2"}
],
components: {
dragSourceCellRenderer: DragSourceRenderer, |
<|file_name|>network_node.cc<|end_file_name|><|fim▁begin|>/*
* Copyright 2018 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights gran... | rtc::CritScope crit(&crit_sect_);
if (!endpoint_)
return false;
rtc::CopyOnWriteBuffer buffer(packet, length); |
<|file_name|>output7off.py<|end_file_name|><|fim▁begin|># THIS IS THE PYTHON CODE FOR PiFACE OUTPUT OFF
#
# Copyright (C) 2014 Tim Massey
#
# 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 Foun... | # This program 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 General Public License for more details. |
<|file_name|>SWIM.py<|end_file_name|><|fim▁begin|>import unittest
import random
from pygraph.classes.graph import graph
class SWIM(object):
def __init__(self, graph):
self.graph = graph
def edge_alive(self, nodeA, nodeB, alive):
'''
edge_alive(A, B, True|False)
'''
edg... |
if __name__ == '__main__': |
<|file_name|>simpleworkflow-rules.py<|end_file_name|><|fim▁begin|>import sys
import os<|fim▁hole|>from baserules import BaseIndexData
class IndexData(BaseIndexData):
def __activate__(self, context):
BaseIndexData.__activate__(self,context)<|fim▁end|> | from com.googlecode.fascinator.common import FascinatorHome
sys.path.append(os.path.join(FascinatorHome.getPath(),"harvest", "workflows")) |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# ----------------------------------------------------------------------------
# cocos "jscompile" plugin
#
# Copyright 2013 (C) Intel
#
# License: MIT
# ----------------------------------------------------------------------------
'''
"jscompile" p... |
parser.add_argument("-c", "--use_closure_compiler", |
<|file_name|>DataBaseManagementService.java<|end_file_name|><|fim▁begin|>/**
*
*/
package com.airnoise.services;
import java.sql.SQLException;
import com.airnoise.core.exception.PersistenceException;
import com.airnoise.dao.DataBaseManager;
/**
* @author tomio
*
*/
public class DataBaseManagementService {
... | public void createDB() throws PersistenceException {
try {
this.manager.getDataBaseManagementDAO().createDB(); |
<|file_name|>ServerModpackRemoteInstallTask.java<|end_file_name|><|fim▁begin|>/*
* Hello Minecraft! Launcher
* Copyright (C) 2020 huangyuhui <huanghongxun2008@126.com> and contributors
*<|fim▁hole|> * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WI... | * 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, or |
<|file_name|>zsyscall_darwin_arm.go<|end_file_name|><|fim▁begin|>// mksyscall.pl -l32 syscall_bsd.go syscall_darwin.go syscall_darwin_arm.go
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
package syscall
import "unsafe"<|fim▁hole|>
func getgroups(ngid int, gid *_Gid_t) (n int, err error) {
r0, _, e1 := RawSy... |
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
<|file_name|>attr.rs<|end_file_name|><|fim▁begin|>use syn::{
parse::{Parse, ParseStream},
LitStr, Token,
};
use super::case::RenameRule;
mod kw {
syn::custom_keyword!(rename);
syn::custom_keyword!(rename_all);
}
pub struct RenameAttr(LitStr);
impl RenameAttr {
pub fn into_inner(self) -> LitStr {... | pub fn into_inner(self) -> RenameRule { |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>use crossbeam_channel::{bounded, select};
use crossbeam_utils::thread;
fn main() {
let people = vec!["Anna", "Bob", "Cody", "Dave", "Eva"];
let (s, r) = bounded(1); // Make room for one unmatched send.
// Either send my name into the channel or receive som... | .unwrap();
|
<|file_name|>Tephigrams_From_Radiosonde_Climatology_Onset.py<|end_file_name|><|fim▁begin|># Now make a simple example using the custom projection.
import pdb
import sys
import os
import pkg_resources
pkg_resources.require('matplotlib==1.4.0')
import datetime
from dateutil.relativedelta import relativedelta
import re
i... | # '--', # 'Mean mixed layer mixing ratio',
# '--', # '1000 hPa to 500 hPa thickness',
# '--') ... |
<|file_name|>construct.rs<|end_file_name|><|fim▁begin|>/// This is now a no-op. It does not need to be called anymore.<|fim▁hole|><|fim▁end|> | pub fn construct() {} |
<|file_name|>sas.py<|end_file_name|><|fim▁begin|>"""
pygments.styles.sas
~~~~~~~~~~~~~~~~~~~
Style inspired by SAS' enhanced program editor. Note This is not
meant to be a complete style. It's merely meant to mimic SAS'
program editor syntax highlighting.
:copyright: Copyright 2006-2021 by the... | Generic.Error: '#d30202',
Error: 'bg:#e3d2d2 #a61717'
} |
<|file_name|>fail.ts<|end_file_name|><|fim▁begin|>// Error code 1 due to explicit type error
/*var a: string = '',
b: number = a + 2;
console.log(b);*/
// Error code 4 due to accessing private member
export class TestClass1 {
public publicMember: PrivateInterface;
constructor() {
this.publicMemb... | }
} |
<|file_name|>hostDevServer.js<|end_file_name|><|fim▁begin|>const {
createServer,
plugins: { queryParser, serveStatic }
} = require('restify');
const { join } = require('path');
const fetch = require('node-fetch');
const proxy = require('http-proxy-middleware');
const { PORT = 5000 } = process.env;
const server = c... | return res.send(500); |
<|file_name|>index.d.ts<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright Google LLC All Rights Reserved.<|fim▁hole|> */
import { BuilderContext, BuilderOutput } from '@angular-devkit/architect';
import { Observable } from 'rxjs';
import { Schema as NgPackagrBuilderOptions } from './schema';
/**
* @experimenta... | *
* 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 |
<|file_name|>display.py<|end_file_name|><|fim▁begin|># Copyright 2018 Flight Lab 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
... | self._generate_page(
template_path=template_path, kwargs={
'image_path': image_path |
<|file_name|>settings-overview-routing.module.ts<|end_file_name|><|fim▁begin|>import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { SettingsOverviewComponent } from './settings-overview.component';
const routes: Routes = [
{
path: '',
component: Settings... | |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>fn main() {
let number = 3;
<|fim▁hole|> if number < 5 {
println!("condition was true");
} else {
println!("condition was false");
}
let condition = true;
let number = if condition {
5
} else {
6 //; or 'h' w... | |
<|file_name|>svg_to_svg_ordered_dithering.py<|end_file_name|><|fim▁begin|>"""Copyright (c) 2017 abhishek-sehgal954
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 2 of ... | you enter and height proportional to the new width, thus maintaining the aspect ratio")
self.OptionParser.add_option("--inkscape_path", action="store", type="string", dest="inkscape_path", default="", help="") |
<|file_name|>errors.rs<|end_file_name|><|fim▁begin|>use std::error;
use std::fmt;
use std::io;
use parsed_class::FieldRef;
#[derive(Debug)]
pub enum ClassLoadingError {
NoClassDefFound(Result<String, io::Error>),
ClassFormatError(String),
UnsupportedClassVersion,
NoSuchFieldError(FieldRef),
#[allow... | match *self {
ClassLoadingError::NoClassDefFound(ref err) => {
write!(f, |
<|file_name|>test_website.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
import frappe, unittest
from werkzeug.wrappers import Request
from werkzeug.test import EnvironBuilder
from frappe.website import render
def set_request(**kwargs):
builder = EnvironBuilder(**kwargs)
frappe.local.reque... | self.assertTrue(response.status_code, 200) |
<|file_name|>image_synthese_facette_image.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
@file
@brief image et synthèse
"""
from .image_synthese_facette import Rectangle
from .image_synthese_base import Rayon, Couleur
from .image_synthese_sphere import Sphere
class RectangleImage(Rectangle):
"""défi... | """retourne le rayon réfléchi au point p de la surface,
si aucune, retourne None"""
if p == rayon.origine:
return None |
<|file_name|>vfpsingle.cpp<|end_file_name|><|fim▁begin|>/*
vfp/vfpsingle.c - ARM VFPv3 emulation unit - SoftFloat single instruction
Copyright (C) 2003 Skyeye Develop Group
for help please send mail to <skyeye-developer@lists.gro.clinux.org>
This program is free software; you can redistribute it and/or... | |
<|file_name|>callback.rs<|end_file_name|><|fim▁begin|>use std::mem;
use std::ptr;
use std::cell::RefCell;
use std::sync::mpsc::Sender;
use std::sync::{Arc, Mutex};
use std::ffi::OsString;
use std::os::windows::ffi::OsStringExt;
use CursorState;
use Event;
use super::event;
use user32;
use shell32;
use winapi;
/// Th... | // let &ThreadLocalData { ref cursor_state, .. } = stored;
}); |
<|file_name|>conf.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# dodotable documentation build configuration file, created by
# sphinx-quickstart on Thu Sep 17 11:47:28 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all po... | # Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [ |
<|file_name|>myaddon.cc<|end_file_name|><|fim▁begin|>#include <nan.h>
<|fim▁hole|>using namespace v8;
NAN_METHOD(Length) {
Nan::MaybeLocal<String> maybeStr = Nan::To<String>(info[0]);
v8::Local<String> str;
if(maybeStr.ToLocal(&str) == false) {
Nan::ThrowError("Error converting first argument to string");
... | |
<|file_name|>profile.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""
Profile script for CNFgen package
"""
from __future__ import print_function
import os
import sys
from contextlib import contextmanager
@contextmanager
def erase_stdout():
with file(os.devnull,"w") as null:
old_stdout = sys.std... | from cProfile import run as profile
|
<|file_name|>allocation.py<|end_file_name|><|fim▁begin|># ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that... | # But don't do this! If alloc fails, we've already silently dealloc'd
# the original block.
# self.dealloc(start, size)
# return self.alloc(new_size) |
<|file_name|>test_deploy.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http:... | |
<|file_name|>vga.rs<|end_file_name|><|fim▁begin|>/*******************************************************************************
*
* kit/kernel/terminal/vga.rs
*
* vim:ft=rust:ts=4:sw=4:et:tw=80
*
* Copyright (C) 2015-2021, Devyn Cairns
* Redistribution of this file is permitted under the terms of the simplifie... | }
|
<|file_name|>MSEdge.cpp<|end_file_name|><|fim▁begin|>/****************************************************************************/
/// @file MSEdge.cpp
/// @author Christian Roessel
/// @author Jakob Erdmann
/// @author Christoph Sommer
/// @author Daniel Krajzewicz
/// @author Laura Bieker
/// @author Michae... | if (pars.departPos >= 0.) { |
<|file_name|>ExceptionTable.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2000-2004 The Apache Software 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
*
* http... |
/** |
<|file_name|>cover.py<|end_file_name|><|fim▁begin|>"""Support for RFXtrx covers."""
import logging
from homeassistant.components.cover import CoverEntity
from homeassistant.const import CONF_DEVICES, STATE_OPEN
from homeassistant.core import callback
from . import (
CONF_AUTOMATIC_ADD,
CONF_DATA_BITS,
CON... | |
<|file_name|>PageDomain.java<|end_file_name|><|fim▁begin|>package com.zlwh.hands.api.domain.base;
public class PageDomain {
private String pageNo;
private String pageSize = "15";
private long pageTime; // 上次刷新时间,分页查询时,防止分页数据错乱
public String getPageNo() {
return pageNo;
}
public void setPageNo(String pageNo... | this.pageSize = pageSize; |
<|file_name|>main.js<|end_file_name|><|fim▁begin|><|fim▁hole|>jQuery(function($) {
//smooth scroll
$('.navbar-nav > li.anchor').click(function(event) {
//event.preventDefault();
var target = $(this).find('>a').prop('hash');
$('#navbar .active').removeClass('active');
$(this).addClass('active');
$('htm... | |
<|file_name|>dispatcher.rs<|end_file_name|><|fim▁begin|>/*
Copyright 2017 Jinjing Wang
This file is part of mtcp.
mtcp is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at you... | }
Some(Packet::TCP(tcp)) => {
// debug!("Dispatch TCP: {:#?}", tcp.connection); |
<|file_name|>plot1.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
#!/usr/bin/python
# https://en.wikipedia.org/wiki/Matplotlib<|fim▁hole|>
import numpy
import matplotlib.pyplot as plt
from numpy.random import rand
a = rand(100)
b = rand(100)
plt.scatter(a, b)
plt.show()<|fim▁end|> | |
<|file_name|>animation.py<|end_file_name|><|fim▁begin|>import pygame
class Animation:
def __init__(self, sheet, seq):
#Attributes
self.sheet = sheet
self.length = seq[0]
self.delay = seq[1]
self.x = seq[2]
self.y = seq[3]
self.w = seq[4]
self.h = seq[... | |
<|file_name|>cookie-monster-spec.js<|end_file_name|><|fim▁begin|>var cookie = require('../index');
chai.should();
describe('cookie monster', function() {
it('sets a cookie', function (){
cookie.setItem('cookieKey', 'cookieVal');
document.cookie.should.contain('cookieKey=cookieVal');
});
it('gets a coo... | it('sets 30 cookies and clears all of them', function (){ |
<|file_name|>config.py<|end_file_name|><|fim▁begin|>from yaml import load
from os import environ
from os.path import join, isfile
from ..module_ultra_repo import ModuleUltraRepo
from ..module_ultra_config import ModuleUltraConfig
class RepoDaemonConfig:
"""Represent a MU repo to the MU daemon."""
def __init... | 'repo_path': repo_path,
'pipelines': pipelines, |
<|file_name|>grad_multiply.py<|end_file_name|><|fim▁begin|># Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights<|fim▁hole|># can be found in the P... | |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import binascii
import hashlib
from reversecoin.bitcoin.key import CKey as Key
from reversecoin.bitcoin.base58 import encode, decode
def myhash(s):
return hashlib.sha256(hashlib.sha256(s).digest()).digest()
def myhash160(s):
h = hashlib... | hash_address = myhash(extended_address) |
<|file_name|>lfm_service.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Taifxx
#
# 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... |
except Exception as exc: |
<|file_name|>trumail.js<|end_file_name|><|fim▁begin|>$('.ui.dropdown').dropdown();
$(document).ready(function() {
$('#test-form').on('submit', function(e) {
e.preventDefault();
var format = document.getElementsByName('test-format')[0].value;
var email = document.getElementsByName('test-emai... |
$('#test-button').addClass('loading');
var xhr = new XMLHttpRequest(); |
<|file_name|>serve.go<|end_file_name|><|fim▁begin|>// FUSE service loop, for servers that wish to use it.
package fs // import "github.com/muthu-r/horcrux/bazil-fuse/fuse/fs"
import (
"encoding/binary"
"fmt"
"hash/fnv"
"io"
"reflect"
"runtime"
"strings"
"sync"
"time"
"golang.org/x/net/context"
log "githu... | case r.Errno != "" && r.Out != nil:
return fmt.Sprintf("-> [%v] %v error=%s", r.Request, r.Out, r.errstr()) |
<|file_name|>index.d.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.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior a... | * .
*/ |
<|file_name|>test_lockfile.py<|end_file_name|><|fim▁begin|># Copyright (c) 2005 Divmod, Inc.
# See LICENSE for details.<|fim▁hole|>class LockingTestCase(unittest.TestCase):
def testBasics(self):
lockf = self.mktemp()
lock = lockfile.FilesystemLock(lockf)
self.failUnless(lock.lock())
... |
from twisted.trial import unittest
from twisted.python import lockfile
|
<|file_name|>index.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 {Rule, SchematicsException, Tree, UpdateRecorder} from '@an... | if (!allPaths.length) {
throw new SchematicsException(
'Could not find any tsconfig file. Cannot migrate to Typed Forms.'); |
<|file_name|>target.py<|end_file_name|><|fim▁begin|># Library for RTS2 JSON calls.
# (C) 2012 Petr Kubanek, Institute of Physics
#
# 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 the Free Software Foundation; either
#... | |
<|file_name|>resubscribe.ts<|end_file_name|><|fim▁begin|>import type { ExternalMethods } from './types'
const resubscribe: ExternalMethods['resubscribe'] = async (
pool,
readModelName
) => {
const { dropReadModel } = pool
await dropReadModel(pool, readModelName)
}<|fim▁hole|>
export default resubscribe<|fim▁e... | |
<|file_name|>tuflowmodel.py<|end_file_name|><|fim▁begin|>"""
Summary:
Container and main interface for accessing the Tuflow model and a class
for containing the main tuflow model files (Tcf, Tgc, etc).
There are several other classes in here that are used to determine the
order of the files... | if not 'after' in kwargs.keys() and not 'before' in kwargs.keys(): |
<|file_name|>catalog_item.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from functools import partial
from types import NoneType
from navmazing import NavigateToSibling, NavigateToAttribute
from cfme.exceptions import DestinationNotFound
from cfme.fixtures import pytest_selenium as sel
from cfme.provisionin... | fields=[ |
<|file_name|>fonts.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2015 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License a... | 0x14d8, 0x14d9, 0x14da, 0x14db, 0x14dc, 0x14dd, 0x14de, 0x14df, 0x14e0,
0x14e1, 0x14e2, 0x14e3, 0x14e4, 0x14e5, 0x14e6, 0x14e7, 0x14e8, 0x14e9, |
<|file_name|>passport.js<|end_file_name|><|fim▁begin|>// load all the things we need
var LocalStrategy = require('passport-local').Strategy;
var FacebookStrategy = require('passport-facebook').Strategy;
var TwitterStrategy = require('passport-twitter').Strategy;
var GoogleStrategy = require('passport-google-o... | |
<|file_name|>_test_ns.py<|end_file_name|><|fim▁begin|>import unittest
import numpy as np
import socket
import Pyro4
from nested_sampling import NestedSampling, MonteCarloWalker, Harmonic, Replica
class TestNS(unittest.TestCase):
"""to test distributed computing must start a dispatcher with --server-name test and -... | |
<|file_name|>table_db.cc<|end_file_name|><|fim▁begin|>//
// Copyleft RIME Developers
// License: GPLv3
//
// 2013-04-18 GONG Chen <chen.sst@gmail.com>
//
#include <boost/algorithm/string.hpp>
#include <boost/lexical_cast.hpp>
#include <rime/dict/table_db.h>
#include <rime/dict/user_db.h>
// Rime table entry format:
//... | boost::algorithm::is_any_of("\t"));
if (row.size() != 2 ||
row[0].empty() || row[1].empty())
return false; |
<|file_name|>imap_attachment_to_s3_operator.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
#... | # http://www.apache.org/licenses/LICENSE-2.0 |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from django.views.generic import TemplateView
from dja... | |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from collections import defaultdict
from datetime import datetime, timedelta
from django.contrib.auth.models import User
from django.db import models
from django.db.models import Q, Count, Sum, Max, Min
from django.db.models.signals import pre_save
from django.dispatc... | continue # cache is up to date
|
<|file_name|>text.build.js<|end_file_name|><|fim▁begin|>//A simple build file using the tests directory for requirejs
{
baseUrl: "../../../requirejs/tests/text",
paths: {
text: "../../../requirejs/../text/text"
},
dir: "builds/text",
optimize: "none",
optimizeAllPluginResources: ... |
modules: [
{
name: "widget"
|
<|file_name|>scheduler.go<|end_file_name|><|fim▁begin|>/*
Copyright 2014 Google Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-... | */ |
<|file_name|>ast_builder.py<|end_file_name|><|fim▁begin|>from . import ast
from .pystates import symbols as syms
from .grammar.sourcefile import SourceFile
import token
import six
import re
class ASTError(Exception):
pass
class ASTMeta(type):
def __new__(cls, name, bases, attrs):
handlers = {}
... | if is_str:
return ast.Str(''.join(chars), *node.start)
return ast.Bytes(bytes(chars), *node.start) |
<|file_name|>jsoncli.py<|end_file_name|><|fim▁begin|>"""
JsonCli: Library for CLI based on JSON
--------------------------------------
+------------------------+-------------+
| This is the JsonCli common library. |
+------------------------+-------------+
"""<|fim▁hole|>
type_map = {
'structure': str,
'map'... | import argparse
from collections import OrderedDict
from argcomplete import autocomplete
from botocore import xform_name |
<|file_name|>backfill_opportunity_ids.py<|end_file_name|><|fim▁begin|>"""
Backfill opportunity ids for Enterprise Coupons, Enterprise Offers and Manual Order Offers.
"""
import csv
import logging
from collections import Counter, defaultdict
from time import sleep
from uuid import UUID
from django.core.management imp... | type=int,
)
parser.add_argument( |
<|file_name|>console.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# Console
import sys, os, time, subprocess
def MCS():
return subprocess.Popen(['python', 'mcs.py'])
def color(text, color):
if color == 0: color = "\033[0m"
if color == 1: color = "\033[94m"
if color == 2: color = "\033[92m"
... | |
<|file_name|>test_turtle.py<|end_file_name|><|fim▁begin|>import pickle
import unittest
from test import test_support as support
turtle = support.import_module('turtle')
Vec2D = turtle.Vec2D
test_config = """\
width = 0.75
height = 0.8
canvwidth = 500
canvheight = 200
leftright = 100
topbottom = 100
mode = world
color... | def test_rotate(self): |
<|file_name|>filterFASTA.py<|end_file_name|><|fim▁begin|>from Bio import SeqIO
import sys, string
fasta_file = "/Users/saljh8/GitHub/altanalyze/AltDatabase/EnsMart72/Hs/SequenceData/Homo_sapiens.GRCh37.72.cdna.all.fa" # Input fasta file<|fim▁hole|>
fasta_sequences = SeqIO.parse(open(fasta_file),'fasta')
wit... | result_file = "/Users/saljh8/GitHub/altanalyze/AltDatabase/EnsMart72/Hs/SequenceData/Homo_sapiens.GRCh37.72.cdna.all.filtered.fa" # Output fasta file |
<|file_name|>multiplecdrc_it_test.go<|end_file_name|><|fim▁begin|>// +build integration
/*
Real-time Online/Offline Charging System (OCS) for Telecom & ISP environments
Copyright (C) ITsysCOM GmbH
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.