prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>merkleblock.cpp<|end_file_name|><|fim▁begin|>// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2016 The Oakcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "merkleblock.h... | // combine subhashes |
<|file_name|>FooBaseH2.py<|end_file_name|><|fim▁begin|>from sqlalchemy import Column, String
<|fim▁hole|> name2 = Column(String)
__mapper_args__ = {
'polymorphic_identity': "2"
}<|fim▁end|> | from FooBaseH import FooBaseH
class FooBaseH2(FooBaseH): |
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-01-06 12:34
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.forms.widgets
class Migra... | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
<|file_name|>block_device.py<|end_file_name|><|fim▁begin|># vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 Isaku Yamahata <yamahata@valinux co jp>
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the Licen... | bdm['volume_size'] = utils.validate_integer(
bdm['volume_size'], 'volume_size', min_value=0)
except exception.InvalidInput as e:
raise exception.InvalidBDMFormat( |
<|file_name|>content_annotations_cluster_processor.cc<|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
// found in the LICENSE file.
#include "components/history_clusters/core/content_annotations_cluster_... | int intersection_size = 0;
for (const auto& token : cluster1) {
if (cluster2.find(token) != cluster2.end()) {
intersection_size++; |
<|file_name|>account_chart.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redis... | } |
<|file_name|>file_utils.cc<|end_file_name|><|fim▁begin|>/*
* file_utils.cc
* Copyright (C) 2016 elasticlog <elasticlog01@gmail.com>
*
* Distributed under terms of the GNU GENERAL PUBLIC LICENSE.
*/
#include "file_utils.h"
#include <sys/types.h><|fim▁hole|>#include <sys/stat.h>
#include <unistd.h>
#include <fcntl... | |
<|file_name|>index.js<|end_file_name|><|fim▁begin|><|fim▁hole|>module.exports = exports = require('./lib/rhetorical');<|fim▁end|> | |
<|file_name|>ko.js<|end_file_name|><|fim▁begin|><|fim▁hole|> */
CKEDITOR.plugins.setLang( 'magicline', 'ko', {
title: '여기에 그래프 삽입'
} );<|fim▁end|> | /**
* @license Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license |
<|file_name|>generatorOverloads3.ts<|end_file_name|><|fim▁begin|>//@target: ES6
class C {
*f(s: string): Iterable<any>;
*f(s: number): Iterable<any>;
<|fim▁hole|><|fim▁end|> | *f(s: any): Iterable<any> { }
} |
<|file_name|>Bundle.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
* Copyright (c) 2010 Robert "Unlogic" Olofsson (unlogic@unlogic.se).
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GN... | |
<|file_name|>StartScreen.py<|end_file_name|><|fim▁begin|>from graphics import *
from Button import *
from CreateNewUserScreen import *
from ChangePasswordScreen import *
import os
class StartScreen:
def is_game_in_progress(self,gid):
for filename in os.listdir("games"):
if str(gid) == ... | if login_button.clicked(p):
user1 = user_entry.getText()
|
<|file_name|>provider_info.py<|end_file_name|><|fim▁begin|># Copyright 2015 PerfKitBenchmarker 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.a... | |
<|file_name|>Common.cpp<|end_file_name|><|fim▁begin|>/*
This file is part of cpp-ethereum.
cpp-ethereum 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 your option) an... | "In addition, ÐApp is attempting to send " +
formatBalance(value) + " to said recipient, with additional network fees of up to " + |
<|file_name|>tag.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/licenses/LI... |
enum colour { red(int, int), green, }
|
<|file_name|>namespace_pathfinder_1_1_internal_1_1_g_u_i.js<|end_file_name|><|fim▁begin|>var namespace_pathfinder_1_1_internal_1_1_g_u_i =
[<|fim▁hole|> [ "ModExtensionsUI", "class_pathfinder_1_1_internal_1_1_g_u_i_1_1_mod_extensions_u_i.html", "class_pathfinder_1_1_internal_1_1_g_u_i_1_1_mod_extensions_u_i" ],
... | |
<|file_name|>color.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/. */
//! Specified color values.
use super::AllowQuirks;
#[cfg(fea... | MozMacMenuitem,
MozMacActiveMenuitem, |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>use std::net::SocketAddr;
use std::sync::Arc;
use hyper::server::Server;
use hyper::service::{make_service_fn, service_fn};
use log::{error, info};
use crate::runtime;
use crate::server::github_handler::GithubHandlerState;
use crate::server::octobot_service::OctobotSe... | let http_addr: SocketAddr = match config.main.listen_addr {
Some(ref addr_and_port) => addr_and_port.parse().unwrap(), |
<|file_name|>spaceletmanager.js<|end_file_name|><|fim▁begin|>/**
* Spacelet Manager, 2013 Spaceify Inc.
* SpaceletManager is a class for managing Spacelets and their processes. It launches spacelet processes, manages their quotas and access rights and terminates them when needed.
*
* @class SpaceletManager
*/
var... | dockerContainer.sync.startContainer(application.getProvidesServicesCount(), application.getDockerImageId(), volumes, binds); |
<|file_name|>CS_table_No2_No4.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Created on Wed Sep 09 14:51:02 2015
@author: Methinee
"""
import pandas as pd
import numpy as np
from collections import defaultdict
from astropy.table import Table, Column
df = pd.read_csv('../data/CS_table_No2_No4_new.csv',de... | countStd = 0 |
<|file_name|>canvas_cow_game_cow2url.js<|end_file_name|><|fim▁begin|>var scene;
var camera;
var renderer;
var stats;
var geometry;
var material;
var line;
var ambientLight;
var loader;
var cow;
var cowMixer;
var walkCow;
var walkCowMixer;
var cowStatus = "walkings"; // none standing walking
cowCur = "walking"; // sta... | scene.add(cow);
scene.remove(walkCow); |
<|file_name|>UpdateFileRequest.js<|end_file_name|><|fim▁begin|>/**
* Pipedrive API v1
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https:/... | * Constructs a <code>UpdateFileRequest</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not. |
<|file_name|>ida_client.py<|end_file_name|><|fim▁begin|># System imports
import itertools
import concurrent.futures
# Third party imports
import requests
class Client:
"""
Used for sending commands to one or more IDA containers over HTTP.
"""
def __init__(self, urls):
"""
>>> client ... | data_to_send['timeout'] = timeout |
<|file_name|>GuiSpellchecker.cpp<|end_file_name|><|fim▁begin|>/**
* \file GuiSpellchecker.cpp
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author John Levon
* \author Edwin Leuven
* \author Abdelrazak Younes
*
* Full author contact details are ava... | dispatch(FuncRequest(LFUN_WORD_REPLACE, datastring));
d->forward();
d->check(); // continue spellchecking
d->canCheck(); |
<|file_name|>mod.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/. */
//! Tests for parsing and serialization of values/properties
use... | // is preserved in the panic
macro_rules! assert_roundtrip_with_context {
($fun:expr, $string:expr) => {
assert_roundtrip_with_context!($fun, $string, $string); |
<|file_name|>BBBAuthenticator.java<|end_file_name|><|fim▁begin|>// Copyright (c) 2014 blinkbox Entertainment Limited. All rights reserved.
package com.blinkboxbooks.android.authentication;
import android.accounts.AbstractAccountAuthenticator;
import android.accounts.Account;
import android.accounts.AccountAuthenticato... | public class BBBAuthenticator extends AbstractAccountAuthenticator {
|
<|file_name|>userland.py<|end_file_name|><|fim▁begin|>import logging
from ..calling_conventions import SYSCALL_CC
from ..errors import AngrUnsupportedSyscallError
from ..procedures import SIM_PROCEDURES as P
from .simos import SimOS
_l = logging.getLogger('angr.simos.userland')
class SimUserland(SimOS):
"""
... | |
<|file_name|>_namelengthsrc.py<|end_file_name|><|fim▁begin|>import _plotly_utils.basevalidators<|fim▁hole|>
class NamelengthsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="namelengthsrc", parent_name="bar.hoverlabel", **kwargs
):
super(NamelengthsrcVali... | |
<|file_name|>model.py<|end_file_name|><|fim▁begin|>from typing import Any, Dict, Optional
from flask import g, render_template, url_for
from flask_babel import format_number, lazy_gettext as _
from flask_wtf import FlaskForm
from wtforms import (
BooleanField, IntegerField, SelectMultipleField, StringField, Submit... | return render_template(
'model/class_view.html',
class_=class_, |
<|file_name|>bitcoin_ms_MY.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="ms_MY" version="2.1">
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About HiCoin</source>
<translation type="unfini... | <translation type="unfinished"/>
</message> |
<|file_name|>border.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/. */<|fim▁hole|>
<% data.new_style_struct("Border", inherited=F... |
<%namespace name="helpers" file="/helpers.mako.rs" />
<% from data import Method %> |
<|file_name|>test_trailing.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015-2016 Cisco Systems
#
# 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, including without... |
assert res is None |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright 2009 Google Inc. Released under the GPL v2
"""This is a convenience module to import all available types of hosts.
Implementation details:
You should 'import hosts' instead of importing every available host module.
"""
from autotest_lib.client.common_... | |
<|file_name|>context_managers.py<|end_file_name|><|fim▁begin|>from psycopg2 import InterfaceError
class CursorContextManager:
"""Instantiated once per :func:`~postgres.Postgres.get_cursor` call.
:param pool: see :mod:`psycopg2_pool`
:param bool autocommit: see :attr:`psycopg2:connection.autocommit`
:... | |
<|file_name|>type_name.rs<|end_file_name|><|fim▁begin|>#![feature(core, core_intrinsics)]
extern crate core;
#[cfg(test)]
mod tests {
use core::intrinsics::type_name;
// pub fn type_name<T>() -> usize;
macro_rules! type_name_test {
($T:ty, $message:expr) => ({
let message: &'static str = unsafe { t... | type_name_test!( f32, "f32" );
type_name_test!( f64, "f64" );
type_name_test!( [u8; 0], "[u8; 0]" ); |
<|file_name|>gdb-pretty-struct-and-enums-pre-gdb-7-7.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-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-APACH... |
// ignore-windows failing on win32 bot |
<|file_name|>create.go<|end_file_name|><|fim▁begin|>package tccpoutputs
import (
"context"
"github.com/giantswarm/microerror"
"github.com/giantswarm/aws-operator/service/controller/controllercontext"
"github.com/giantswarm/aws-operator/service/controller/key"
"github.com/giantswarm/aws-operator/service/internal... | v, err := cloudFormation.GetOutputValue(outputs, OperatorVersion)
if err != nil {
return microerror.Mask(err)
} |
<|file_name|>Helper.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
* Copyright (c) 1998, 2013 Oracle and/or its affiliates. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Pub... | * Can be used to mark code if a workaround is added for a JDBC driver or other bug.
*/
public static void systemBug(String description) {
// Use sender to find what is needy.
|
<|file_name|>basic.js<|end_file_name|><|fim▁begin|>import test from 'ava';
import debounce from 'lodash.debounce';<|fim▁hole|>import helper from './_helper';
import expected from './basic/expected.json';
test.beforeEach(t => {
const config = helper.getSuiteConfig('basic');
t.context.config = config
t.context.e... | import webpack from 'webpack';
import 'babel-core/register';
|
<|file_name|>AlarmFontIcon.tsx<|end_file_name|><|fim▁begin|>// This is a generated file from running the "createIcons" script. This file should not be updated manually.
import { forwardRef } from "react";
import { FontIcon, FontIconProps } from "@react-md/icon";
export const AlarmFontIcon = forwardRef<HTMLElement, Fo... | return ( |
<|file_name|>keycodes.rs<|end_file_name|><|fim▁begin|>// https://stackoverflow.
// com/questions/3202629/where-can-i-find-a-list-of-mac-virtual-key-codes
/* keycodes for keys that are independent of keyboard layout */
#![allow(non_upper_case_globals)]
#![allow(dead_code)]
pub const kVK_Return: u16 = 0x24;
pub const ... | pub const kVK_PageDown: u16 = 0x79;
pub const kVK_F1: u16 = 0x7A;
pub const kVK_LeftArrow: u16 = 0x7B;
pub const kVK_RightArrow: u16 = 0x7C; |
<|file_name|>huawei_driver.py<|end_file_name|><|fim▁begin|># Copyright (c) 2016 Huawei Technologies Co., Ltd.
# 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
#... | self._delete_lun_with_check(dst_id)
LOG.debug("Migrate lun %s successfully.", src_id) |
<|file_name|>wedding-gift-list-honeymoon.ts<|end_file_name|><|fim▁begin|>/// <reference path="../../../bower_components/polymer-ts/polymer-ts.d.ts" />
@component("wedding-gift-list-honeymoon")
class WeddingGiftListHoneymoon extends polymer.Base {
constructor() {
super();
}<|fim▁hole|>
Wedding... |
} |
<|file_name|>Transport.ts<|end_file_name|><|fim▁begin|>import {BrowserHeaders} from "browser-headers";
import fetchRequest from "./fetch";
import xhrRequest from "./xhr";
import msStreamRequest from "./msStream";
declare const Response: any;
declare const Headers: any;
export interface Transport {
(options: Transpo... | |
<|file_name|>SemanticVector.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import gensim, logging
class SemanticVector:
model = ''
def __init__(self, structure):
self.structure = structure
def model_word2vec(self, min_count=15, window=15, size=100):
print 'preparing sentences li... | |
<|file_name|>0002_auto_20190218_1136.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2019-02-18 11:36
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [... | ] |
<|file_name|>server.rs<|end_file_name|><|fim▁begin|>/*
Copyright (C) 2013 Tox project All Rights Reserved.
Copyright © 2017 Roman Proskuryakov <humbug@deeptown.org>
This file is part of Tox.
Tox is libre software: you can redistribute it and/or modify
it under the terms of the GNU General Public L... | // emulate send OobSend from client_1
let handle_res = server.handle_packet(&client_pk_1, Packet::OobSend( |
<|file_name|>BaseImage2D.java<|end_file_name|><|fim▁begin|>/*****************************************************************************
* Web3d.org Copyright (c) 2001
* Java Source
*
* This source is licensed under the GNU LGPL v2.1
* Please read http://www.gn... | */
public boolean getIsActive () {
return vfIsActive; |
<|file_name|>jandw.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Copyright (C), 2013, The Schilduil Team. All rights reserved.
"""
import sys
import pony.orm
import suapp.orm
from suapp.logdecorator import loguse, logging
__all__ = ["Wooster", "Drone", "Jeeves"]
class FlowExc... |
def toJSON(self):
return "Drone %s > %s" % (self.name, self.tovertex)
|
<|file_name|>test_services.py<|end_file_name|><|fim▁begin|># Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | "downloads:daily:12-01-{:02d}:foo".format(i + 7)
for i in reversed(range(8)) |
<|file_name|>GCodeLoader.py<|end_file_name|><|fim▁begin|># rasPyCNCController
# Copyright 2016 Francesco Santini <francesco.santini@gmail.com>
#
# This file is part of rasPyCNCController.
#
# rasPyCNCController is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public Licens... | self.gcode = None
self.times = None
self.bBox = None
self.loaded = False |
<|file_name|>ThreeMFWriter.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from UM.Mesh.MeshWriter import MeshWriter
from UM.Math.Vector import Vector
from UM.Logger import Logger
from UM.Math.Matrix import Matrix
from UM.Application im... | archive.close()
else:
self._archive = archive
|
<|file_name|>InfoBarGenerics.py<|end_file_name|><|fim▁begin|>from ChannelSelection import ChannelSelection, BouquetSelector, SilentBouquetSelector
from Components.ActionMap import ActionMap, HelpableActionMap
from Components.ActionMap import NumberActionMap
from Components.Harddisk import harddiskmanager
from Componen... | del self.selectedSubservice |
<|file_name|>app.js<|end_file_name|><|fim▁begin|><|fim▁hole|>// 'directory.controllers' is found in controllers.js
angular.module('directory', ['ionic', 'directory.controllers', 'ionic.contrib.ui.cards'])
.config(function ($stateProvider, $urlRouterProvider) {
// Ionic uses AngularUI Router which uses th... | // angular.module is a global place for creating, registering and retrieving Angular modules
// 'directory' is the name of this angular module example (also set in a <body> attribute in index.html)
// the 2nd parameter is an array of 'requires'
// 'directory.services' is found in services.js |
<|file_name|>client.ts<|end_file_name|><|fim▁begin|>export class HttpClient {
private static defaultHeaders: { [key: string]: string } = { "Accept": "application/json" };
private setRequestHeaders(httpRequest: XMLHttpRequest, headers: { [key: string]: string } = {}) {
const h = { ...HttpClient.defaultHeaders... |
if (!httpRequest) {
return false;
} |
<|file_name|>By_xpath_p1.py<|end_file_name|><|fim▁begin|>from selenium import webdriver
from time import sleep
driver = webdriver.Firefox()
driver.get("https://www.baidu.com/")<|fim▁hole|># a.根据input标签中的id属性定位元素
driver.find_element_by_xpath("//input[@id='kw']").send_keys("51zxw")
# b.根据input标签中name属性定位元素
driver.find_... |
#绝对路径定位
# driver.find_element_by_xpath("/html/body/div[1]/div[1]/div/div[1]/div/form/span[1]/input").send_keys("51zxw")
|
<|file_name|>01-document.py<|end_file_name|><|fim▁begin|>import os, sys; sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", ".."))
import codecs
from pattern.vector import Document, PORTER, LEMMA
# A Document is a "bag-of-words" that splits a string into words and counts them.
# A list of words or dicti... | in a vent line attached to the ship's external tank.
The Discovery was initially scheduled to make its 39th and final flight last Monday,
bearing fresh supplies and an intelligent robot for the International Space Station.
But complications delayed the flight from Monday to Friday, |
<|file_name|>marching_triangles_performance.rs<|end_file_name|><|fim▁begin|>extern crate isosurface;
extern crate ndarray;
use ndarray::Array;
use isosurface::marching_triangles;
fn main() {
let n = 256;
let xs = Array::linspace(-0.5f64, 0.5, n);
let ys = Array::linspace(-0.5, 0.5, n);
let dim = (xs.... | *u = (x * x + y * y).sqrt() - 0.4;
}
u
}; |
<|file_name|>base.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
import numpy
import time
import traceback
import colorsys
import random
class EffectLayer(object):
"""Abstract base class for one layer of an LED light effect. Layers operate on a shared framebuffer,
adding their own con... | |
<|file_name|>webserve.py<|end_file_name|><|fim▁begin|># Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the ... | return _munge(t)
@cherrypy.expose |
<|file_name|>extends.py<|end_file_name|><|fim▁begin|># vim:ts=4:sts=4:sw=4:expandtab<|fim▁hole|>from satori.web.utils.decorators import contest_view
from django import forms
from django.shortcuts import render_to_response
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
from sat... | from satori.client.common import want_import
want_import(globals(), '*') |
<|file_name|>app.py<|end_file_name|><|fim▁begin|>from flask import Flask
app = Flask(__name__)
@app.route('/')
def CMC():
return 'Welcome to the Container Master Class by Cerulean Canvas'
<|fim▁hole|><|fim▁end|> | if __name__ == '__main__':
app.run(host='0.0.0.0') |
<|file_name|>batch_norm_model.py<|end_file_name|><|fim▁begin|>import numpy as np
from ray.rllib.models.modelv2 import ModelV2
from ray.rllib.models.tf.misc import normc_initializer
from ray.rllib.models.tf.tf_modelv2 import TFModelV2
from ray.rllib.models.torch.misc import SlimFC, normc_initializer as \
torch_norm... |
class TorchBatchNormModel(TorchModelV2, nn.Module): |
<|file_name|>conc_update.js<|end_file_name|><|fim▁begin|>load("jstests/libs/slow_weekly_util.js");
test = new SlowWeeklyMongod("conc_update");
db = test.getDB("concurrency");
db.dropDatabase();
NRECORDS = 3 * 1024 * 1024;
print("loading " + NRECORDS + " documents (progress msg every 1024*1024 documents)");
var bulk =... | }, "update never finished", 2 * 60 * 60 * 1000, 10); |
<|file_name|>mut_mut.rs<|end_file_name|><|fim▁begin|>use clippy_utils::diagnostics::span_lint;
use clippy_utils::higher;
use rustc_hir as hir;
use rustc_hir::intravisit;
use rustc_lint::{LateContext, LateLintPass, LintContext};
use rustc_middle::hir::map::Map;
use rustc_middle::lint::in_external_macro;
use rustc_middle... | }
pub struct MutVisitor<'a, 'tcx> {
cx: &'a LateContext<'tcx>, |
<|file_name|>naclports.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Copyright (c) 2013 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Library for manipulating naclports packages in python.
This library ... | |
<|file_name|>main.js<|end_file_name|><|fim▁begin|><|fim▁hole|>var node = document.getElementById('main');
window.render = function(){
React.render(<Examples />, node);
};
window.unmount = function() {
React.unmountComponentAtNode(node);
};
window.render();<|fim▁end|> | import React from 'react';
import Examples from './Examples';
|
<|file_name|>L.Control.Locate.js<|end_file_name|><|fim▁begin|>/*
Copyright (c) 2014 Dominik Moritz
This file is part of the leaflet locate control. It is licensed under the MIT license.
You can find the project at: https://github.com/domoritz/leaflet-locatecontrol
*/
L.Control.Locate = L.Control.extend({
options: ... | var locate = function () { |
<|file_name|>hepdata_test.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# This file is part of HEPData.
# Copyright (C) 2016 CERN.
#
# HEPData 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... | """HEPData module test cases."""
|
<|file_name|>materials.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf8 -*-
from bs4 import BeautifulSoup as Soup
import urls
import re
import proxy
from datetime import *
import time
from time import mktime
import functions
def materials ( config ):
url = "https://www.lectio.dk/lectio/%s/Materia... | |
<|file_name|>api.go<|end_file_name|><|fim▁begin|>// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package types declares the data types and implements
// the algorithms for type-checking of Go packages.
// ... | mode operandMode
Type Type
Value exact.Value |
<|file_name|>progress.py<|end_file_name|><|fim▁begin|><|fim▁hole|> current += 1
if current:
previous = current - 1
else:
previous = current
# print out every percent
frac = percent/100.
value = max(1, frac*total)
return not (int(current/value) == int(previous/value))
... | def progress(current, total, percent=10, iteration=None):
"""
Used in a loop to indicate progress
""" |
<|file_name|>AutoIndentTest.java<|end_file_name|><|fim▁begin|>/*
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
* Copyright (C) 2003-2019 The IdeaVim authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as publishe... | |
<|file_name|>terrplant_functions.py<|end_file_name|><|fim▁begin|>from __future__ import division #brings in Python 3.0 mixed type calculation rules
import logging
import numpy as np
import pandas as pd
class TerrplantFunctions(object):
"""
Function class for Stir.
"""
def __init__(self):
"""C... | |
<|file_name|>assistant.rs<|end_file_name|><|fim▁begin|>use std::mem::transmute;
use std::boxed::Box as Box_;
use Assistant;
use ffi;
use glib::object::IsA;
use glib_ffi;
pub trait AssistantExtManual {
fn set_forward_page_func<F: Fn(i32) -> i32 + 'static>(&self, f: F);
}
impl<O: IsA<Assistant>> AssistantExtManual... | unsafe extern "C" fn forward_page_trampoline(current_page: i32, f: glib_ffi::gpointer) -> i32 { |
<|file_name|>timestamp_anti_stealing_link_config.py<|end_file_name|><|fim▁begin|>class TimestampAntiStealingLinkConfig(dict):
def __init__(self, json):
if json is not None:
if 'enabled' in json.keys():
self.enabled = json['enabled']
else:
self.enabled = None
if 'primaryKey' in js... | |
<|file_name|>NavigationBean.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* ... | |
<|file_name|>main.go<|end_file_name|><|fim▁begin|>/*
Copyright 2019 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless re... | |
<|file_name|>JobSubmitTest.java<|end_file_name|><|fim▁begin|>/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you u... |
@Override
public void initializeOnMaster(ClassLoader loader) throws Exception {
throw new RuntimeException("test exception"); |
<|file_name|>test_all_docs.py<|end_file_name|><|fim▁begin|>from corehq.dbaccessors.couchapps.all_docs import \
get_all_doc_ids_for_domain_grouped_by_db, get_doc_count_by_type, \
delete_all_docs_by_doc_type, get_doc_count_by_domain_type
from dimagi.utils.couch.database import get_db
from django.test import TestC... | get_all_doc_ids_for_domain_grouped_by_db(self.domain1)},
{get_db(None).uri: ['main_db_doc_all-docs-domain1'],
get_db('users').uri: ['users_db_doc_all-docs-domain1'], |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""<|fim▁hole|>handling filled in controls (questionnaires) by a patient. The report
can be exported in docX and PDF format.
"""<|fim▁end|> | Automatic generated reports can be edited by an healthprofessional during |
<|file_name|>connection.py<|end_file_name|><|fim▁begin|># This file is part of Lurklib.
# Copyright (C) 2011 LK-
#
# Lurklib 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 ... | proxy_port=None, proxy_username=None, proxy_password=None): |
<|file_name|>timer_asm.go<|end_file_name|><|fim▁begin|>// Copyright 2016 Netflix, 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/LICENSE-2.0... | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and |
<|file_name|>balbec_twisted.py<|end_file_name|><|fim▁begin|>import argparse
from twisted.internet import reactor
from twisted.web.server import Site
from twisted.web.resource import Resource
import os
from balbec.jsonhandler import JSONHandler
from balbec.xmlhandler import XmlHandler
ROOT = lambda base : os.path.join(... | output = handler.xml() |
<|file_name|>access_log.py<|end_file_name|><|fim▁begin|>"""Model for an access log."""
import functools
import logging
import numpy as np
from django.conf import settings
from django.db import models
from django.utils import timezone
logger = logging.getLogger(__name__)
class AccessLogMixin(models.Model):
"""Ba... | def __init__(self, *args, **kwargs): |
<|file_name|>Blob.cc<|end_file_name|><|fim▁begin|>/** \file
* \author John Bridgman
* \brief
*/
#include <Variant/Blob.h>
#include <stdlib.h>
#include <new>
#include <string.h>
#include <algorithm>
namespace libvariant {
static void MallocFree(void *ptr, void *) {
free(ptr);
}
shared_ptr<Blob> Blob::Create(... |
BlobPtr Blob::CreateFree(struct iovec *iov, unsigned iov_len) {
return shared_ptr<Blob>(new Blob(iov, iov_len, MallocFree, 0));
} |
<|file_name|>config_validation.py<|end_file_name|><|fim▁begin|># Copyright 2016 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.
import re
# Note: this module is tested by a unit test config_validation_test.py,
# rather th... | 'builder_port': {'type': 'integer'},
'test_type': {'type': 'string'},
'improvement_direction': {'type': 'integer'},
'recipe_tester_name': {'type': 'string'}, |
<|file_name|>problem6.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
################################################################################
#
# Project Euler - Problem 6
#
# The sum of the squares of the first ten natural numbers is,
#
# 1^2 + 2^2 + ... + 10^2 = 385
# The square of the sum of the firs... | |
<|file_name|>GetDetailDataForUserRequestType.java<|end_file_name|><|fim▁begin|>/*
* TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
* Copyright (c) 2008, Nationwide Health Information Network (NHIN) Connect. All rights reserved.
* Redistribution and use in source and binary forms, with or without modi... | * <sequence>
* <element name="userId" type="{http://www.w3.org/2001/XMLSchema}string"/>
* <element name="dataSource" type="{http://www.w3.org/2001/XMLSchema}string"/>
* <element name="itemId" type="{http://www.w3.org/2001/XMLSchema}string"/> |
<|file_name|>URLSearchParams.js<|end_file_name|><|fim▁begin|>'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _Sdk = require('./Sdk');
<|fim▁hole|>var _global2 = _interopRequireDefault(_global);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: o... | var _Sdk2 = _interopRequireDefault(_Sdk);
var _global = require('./global');
|
<|file_name|>mockMangaRequest.ts<|end_file_name|><|fim▁begin|>import {OptionsWithUri} from "request";
import {IMangaRequest, IMangaRequestFactory} from "../../interface";
import {MangaRequestResult} from "../../util/mangaRequestResult";
export interface IMatchFileProvider {
getHtml(uri: string): Promise<string>;
... | async request(options: OptionsWithUri): Promise<IMangaRequest> { |
<|file_name|>rook.js<|end_file_name|><|fim▁begin|>function Rook(loc, isWhite, asset){
Piece.call(this, loc, isWhite, asset);
this.name = "Rook";
}
Rook.prototype = Object.create(Piece.prototype);
Rook.prototype.constructor = Rook;
Rook.prototype.getValidMoveSet = function(board) {
var result = [];
var current... | if(cap){
if(cap.isWhite() !== this.white){
result.push(currentSpeculation); |
<|file_name|>test_ttl.py<|end_file_name|><|fim▁begin|>import unittest
from Tribler.community.market.core.ttl import Ttl
class TtlTestSuite(unittest.TestCase):
"""Ttl test cases."""
def setUp(self):
# Object creation
self.ttl = Ttl(0)
self.ttl2 = Ttl(2)
self.ttl3 = Ttl(2)
... | |
<|file_name|>directory.rs<|end_file_name|><|fim▁begin|>use std::collections::HashMap;
use std::fmt::{self, Debug, Formatter};
use std::fs::File;
use std::io::Read;
use std::path::{Path, PathBuf};
use hex::ToHex;
use serde_json;
use core::{Package, PackageId, Summary, SourceId, Source, Dependency, Registry};
use sour... | |
<|file_name|>dkbeacon.py<|end_file_name|><|fim▁begin|>from dronekit import connect
import time
import argparse
import pprint
import rospy
import copy
from gf_beacon.srv import *
import hostapd
import beaconencoder
import findap
class sample_beacon_data:
def __init__(self, connect_string):
print "init"
... | |
<|file_name|>md5.py<|end_file_name|><|fim▁begin|>from __future__ import with_statement
from fabric.api import task
@task
def md5():
"""
Check MD5 sums (unavailable, empty, with content)
"""
import hashlib
from fabric.api import cd, hide, run, settings<|fim▁hole|> import fabtools
with cd... | |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>use self::llvm::{Builder, Context, Module};
use self::codegen::*;
use Emission;
use lib::{time_action, CanonPathBuf};
use lib::front::ast;
use std::fs;
use std::io::Write;
use std::process::Command;
use std::env::current_dir;
mod llvm;
mod codegen;
mod gc;
pub fn compi... | let module = Module::new("main", &context);
let mut codegenerator = CodeGenerator::new(&context, &builder, &module, ast.adts.clone());
time_action( |
<|file_name|>postcss.config.js<|end_file_name|><|fim▁begin|>const autoprefixer = require('autoprefixer');
const precss = require('precss');
const stylelint = require('stylelint');
const fontMagician = require('postcss-font-magician')({
// this is required due to a weird bug where if we let PFM use the `//` protocol W... | }; |
<|file_name|>get_all_networks.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#
# 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
#
# ht... | |
<|file_name|>driver.cpp<|end_file_name|><|fim▁begin|>/************************************************************************
Copyright 2008 Mark Pictor
This file is part of RS274NGC.
RS274NGC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public Licens... | redirected and the user does not see them.
*/ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.