prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>Lesson27.java<|end_file_name|><|fim▁begin|>package demos.nehe.lesson27;
import demos.common.GLDisplay;
import demos.common.LessonNativeLoader;
/**
* @author Abdul Bezrati
*/
public class Lesson27 extends LessonNativeLoader {
public static void main(String[] args) {
GLDisplay neheGLDisplay ... | InputHandler inputHandler = new InputHandler(renderer, neheGLDisplay);
neheGLDisplay.addGLEventListener(renderer);
neheGLDisplay.addKeyListener(inputHandler);
|
<|file_name|>ApplicationFeature.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
*... | public boolean isContributed() { |
<|file_name|>nameserver.go<|end_file_name|><|fim▁begin|>/**
Copyright (C) 2012 Roberto Costumero Moreno <roberto@costumero.es>
This file is part of Cosmofs.
Cosmofs 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 Foundati... | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
|
<|file_name|>logrok.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""Query and aggregate data from log files using SQL-like syntax"""
import sys
import argparse
import os
import re
import ast
import readline
import atexit
import time
import inspect
from multiprocessing import cpu_count
try:
from collectio... | |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|><|fim▁hole|>import numpy as np
import os
if os.path.exists('MANIFEST'):
os.remove('MANIFEST')
include_dirs = [np.get_include()]
setup(name="pystruct",
version="0.3.2",
install_requires=["ad3", "numpy"],
packages=['pystruct', 'pystruct.learners... | from setuptools import setup
from setuptools.extension import Extension |
<|file_name|>package.py<|end_file_name|><|fim▁begin|>##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, t... | """CUDA is a parallel computing platform and programming model invented
by NVIDIA. It enables dramatic increases in computing performance by
harnessing the power of the graphics processing unit (GPU).
|
<|file_name|>doc.go<|end_file_name|><|fim▁begin|>/*
Copyright 2015 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
<|fim▁hole|> http://www.apache.org/licenses/LICENSE-2.0
... | |
<|file_name|>SVGRenderTreeAsText.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2004, 2005, 2007, 2009 Apple Inc. All rights reserved.
* (C) 2005 Rob Buis <buis@kde.org>
* (C) 2006 Alexander Kellett <lypanov@kde.org>
* Copyright (C) Research In Motion Limited 2010. All rights reserved.
*
... | #include "RenderSVGContainer.h"
#include "RenderSVGGradientStop.h" |
<|file_name|>doc.go<|end_file_name|><|fim▁begin|>// Package sqlite3 provides the needed specifics to support the generic
// versioning service.<|fim▁hole|><|fim▁end|> | package sqlite3 |
<|file_name|>formulas.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from django.conf import settings
def mask_toggle(number_to_mask_or_unmask):
return int(number_to_mask_or_unmask) ^ settings.MASKING_KEY<|fim▁end|> | |
<|file_name|>group.server.model.js<|end_file_name|><|fim▁begin|>'use strict';
/**
* Module dependencies.
*/
var mongoose = require('mongoose'),
Schema = mongoose.Schema;
/**
* Exam Schema
*/<|fim▁hole|> },
group_type: { //分组类型
type: String,
default: '',
trim: true
},
group_created:{//分组数据入库时间(时间戳)
... | var GroupSchema = new Schema({
group_name: {//分组名称
type: String,
default: '' |
<|file_name|>download_hots_map.py<|end_file_name|><|fim▁begin|>import os;
link = "http://media.blizzard.com/heroes/images/battlegrounds/maps/haunted-mines-v2/underground/6/"
column = 0;
rc_column = 0;
while (rc_column == 0):
row = 0;<|fim▁hole|> rc_column = os.system('wget ' + link + str(column) + '/' + str(row) + '... | |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | mod cli; |
<|file_name|>youtube.go<|end_file_name|><|fim▁begin|>package api
import (
"net/http"
"net/url"
"github.com/nordsieck/defect"
)
const (
PlaylistItems = "https://www.googleapis.com/youtube/v3/playlistItems"
Key = "key"
Part = "part"
ContentDetails = "contentDetails"
PlaylistID = "play... | MaxResults = "maxResults" |
<|file_name|>main.go<|end_file_name|><|fim▁begin|>// Copyright 2022 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/LICENSE-2.0
//
// ... | aiplatform "cloud.google.com/go/aiplatform/apiv1"
aiplatformpb "google.golang.org/genproto/googleapis/cloud/aiplatform/v1" |
<|file_name|>Compressor.ts<|end_file_name|><|fim▁begin|>namespace Allors.Protocol {
export class Compressor {
static readonly indexMarker = '~';
static readonly itemSeparator = ',';
private keyByValue: { [k: string]: string };
private counter: number;
constructor() {
this.keyByValue = {};
... | }
const key = (++this.counter).toString();
this.keyByValue[value] = key; |
<|file_name|>clock_sr_RS.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="sr_RS">
<context>
<name>FirstDayCombo</name>
<message>
<location filename="../../../lxqtclockconfiguration.cpp" line="49"/>
<source><locale based></sour... | <translation type="unfinished"></translation>
</message>
<message> |
<|file_name|>image_graph.py<|end_file_name|><|fim▁begin|>import tensorflow as tf
from tensorflow.contrib import layers
from tensorflow.contrib.framework import arg_scope
from tensormate.graph import TfGgraphBuilder
class ImageGraphBuilder(TfGgraphBuilder):
def __init__(self, scope=None, device=None, plain=False... | layers.avg_pool2d,
layers.max_pool2d,
layers.batch_norm)):
super(ImageGraphBuilder, self).__init__(scope=scope, device=device, plain=plain) |
<|file_name|>CollectionCtrl.js<|end_file_name|><|fim▁begin|>(function(){
function CollectionCtrl(Fixtures){
this.albums = Fixtures.getCollection(12);<|fim▁hole|> }
angular
.module('blocJams')
.controller('CollectionCtrl',['Fixtures', CollectionCtrl]);
})();<|fim▁end|> | |
<|file_name|>auth_handler.go<|end_file_name|><|fim▁begin|>package controller<|fim▁hole|>
import (
"net/http"
"encoding/json"
"rest-commander/store"
"rest-commander/model/dto"
)
type AuthenticationController interface {
HandleLogin(w http.ResponseWriter, r *http.Request)
HandleLogout(w http.ResponseWriter, r *htt... | |
<|file_name|>IteratorGuide.java<|end_file_name|><|fim▁begin|>package com.baeldung.iteratorguide;<|fim▁hole|>import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
public class IteratorGuide {
public static void main(String[] args) {
List<String> items = new ArrayList<>();
... |
import java.util.ArrayList; |
<|file_name|>encodeBackslashEscapes.js<|end_file_name|><|fim▁begin|>/**<|fim▁hole|> * text = escapeCharacters(text,"\\",true);
* text = escapeCharacters(text,"`*_{}[]()>#+-.!",true);
*
* ...but we're sidestepping its use of the (slow) RegExp constructor
* as an optimization for Firefox. This function gets ca... | * Returns the string, with after processing the following backslash escape sequences.
*
* attacklab: The polite way to do this is with the new escapeCharacters() function:
* |
<|file_name|>command.cc<|end_file_name|><|fim▁begin|>// Copyright 2011 Software Freedom Conservancy
// 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/L... | LOG(DEBUG) << "Raw JSON command: " << json_command;
Json::Value root; |
<|file_name|>kahansum.rs<|end_file_name|><|fim▁begin|>// Implements http://rosettacode.org/wiki/Kahan_summation
#![feature(std_misc)]
#![feature(collections)]
use std::num::Float;
use std::f32;
fn find_max(lst: &[f32]) -> Option<f32> {
if lst.is_empty() { return None }
let max = lst.iter().fold(f32::NEG_INFIN... | let res = with_bits(v, 3);
assert!(res == 3.123f32); |
<|file_name|>nowvideo.py<|end_file_name|><|fim▁begin|>"""
urlresolver Kodi plugin
Copyright (C) 2011 t0mm0
Updated by Gujal (C) 2016
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 Founda... | |
<|file_name|>bc-tabs.js<|end_file_name|><|fim▁begin|>/**
* @module components
*
*/
import $ from 'jquery';
import { assert } from '@ember/debug';
import { dasherize } from '@ember/string';
import EmberObject, { get, set } from '@ember/object';
import { isNone, isEmpty } from '@ember/utils';
import Component from '@e... | set(this, 'model', model);
return model;
},
|
<|file_name|>upload.js<|end_file_name|><|fim▁begin|>(function () {
"use strict";
require('futures/forEachAsync');
var fs = require('fs'),
crypto = require('crypto'),
path = require('path'),
exec = require('child_process').exec,
mime = require('mime'),
FileStat = require('filestat'),
dbaccess = require(... | |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>function solve(params) {
var N = parseInt(params[0]),
K = parseInt(params[1]),
numbersAsString = params[2];
var numbers = numbersAsString.split(' ').map(Number);
var result = [];
for (var i = 0; i < N; i += 1) {
if(i+K-1 === N)... | for (var j = 0; j < K; j += 1) {
if(numbers[i+j] > max) { |
<|file_name|>tests.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*-
"""
Tests for django.core.servers.
"""
from __future__ import unicode_literals
import os
import socket
from django.core.exceptions import ImproperlyConfigured
from django.test import LiveServerTestCase
from django.test.utils import override_... | from .models import Person |
<|file_name|>no.js<|end_file_name|><|fim▁begin|>/*
Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'stylescombo', 'no', {
label: 'Stil',
panelTitle: 'Stilformater',
panelT... | |
<|file_name|>RListItem.java<|end_file_name|><|fim▁begin|>/*<|fim▁hole|> 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
version 2.1 of the License, or (at your option) any... | GNU LESSER GENERAL PUBLIC LICENSE
Copyright (C) 2006 The Lobo Project
|
<|file_name|>dirac-dms-user-lfns.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
########################################################################
# $HeadURL$
########################################################################
"""
Get the list of all the user files.
"""
__RCSID__ = "$Id$"
from DIRAC.... | Script.parseCommandLine( ignoreErrors = False )
|
<|file_name|>timerservice_impl.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 infor... | self._namespace = namespace |
<|file_name|>apps.py<|end_file_name|><|fim▁begin|>from importlib import import_module
from django.apps import AppConfig as BaseAppConfig
<|fim▁hole|>
name = "gestioneide"
def ready(self):
import_module("gestioneide.receivers")<|fim▁end|> | class AppConfig(BaseAppConfig): |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>"""Tests for the Plaato integration."""<|fim▁end|> | |
<|file_name|>south_settings.py<|end_file_name|><|fim▁begin|>"""
These settings are used by the ``manage.py`` command.
With normal tests we want to use the fastest possible way which is an
in-memory sqlite database but if you want to create South migrations you
need a persistant database.
Unfortunately there seems to ... | }
}
INSTALLED_APPS.append('south', ) |
<|file_name|>buttons.py<|end_file_name|><|fim▁begin|>import numpy
import argparse
import time
import mido
import colorsys
import gitgrid.gridcontroller
import gitgrid.utils.utils
args = gitgrid.utils.utils.controller_args()
tmp = gitgrid.gridcontroller.create(args.controller, args.input, args.output)
def toggle(x, y... | |
<|file_name|>installp.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Kairo Araujo <kairo@kairo.eti.br>
# 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
__metac... | repository_path: /repository/AIX71/installp/base
package_license: yes
state: present
|
<|file_name|>size.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/. */
//! Generic type for CSS properties that are composed by two di... | pub fn new(width: L, height: L) -> Self {
Self { width, height } |
<|file_name|>supported-languages.component.ts<|end_file_name|><|fim▁begin|>import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-supported-languages',
templateUrl: './supported-languages.component.html',<|fim▁hole|>})
export class SupportedLanguagesComponent implements OnInit {
construc... | styleUrls: ['./supported-languages.component.sass'] |
<|file_name|>level_bar.rs<|end_file_name|><|fim▁begin|>// This file was generated by gir (5c017c9) from gir-files (71d73f0)
// DO NOT EDIT
#[cfg(feature = "v3_6")]
use LevelBarMode;
use Orientable;
use Widget;
use ffi;
use glib;
use glib::object::Downcast;
use glib::object::IsA;
#[cfg(feature = "v3_6")]
use glib::sign... |
#[cfg(feature = "v3_6")]
fn get_offset_value<'a, P: Into<Option<&'a str>>>(&self, name: P) -> Option<f64>;
|
<|file_name|>ContainerTurboFurnace.java<|end_file_name|><|fim▁begin|>package com.projectreddog.machinemod.container;
import com.projectreddog.machinemod.inventory.SlotBlazePowder;
import com.projectreddog.machinemod.inventory.SlotNotBlazePowder;
import com.projectreddog.machinemod.inventory.SlotOutputOnlyTurobFurnace;... | // null checks and checks if the item can be stacked (maxStackSize > 1)
if (slotObject != null && slotObject.getHasStack()) { |
<|file_name|>typeinference.js<|end_file_name|><|fim▁begin|>(function (ns) {
// dependencies
var assert = require('assert');
var esgraph = require('esgraph');
var worklist = require('analyses');
var common = require("../../base/common.js");
var Context = require("../../base/context.js");
var... | |
<|file_name|>abstractpattern.js<|end_file_name|><|fim▁begin|>// Copyright 2007 The Closure Library Authors. All Rights Reserved.
//<|fim▁hole|>//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed o... | // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at |
<|file_name|>create-item.js<|end_file_name|><|fim▁begin|>import { Application } from 'spectron';
import electron from 'electron-prebuilt';
import { assert } from 'chai';
import MockServer from '../util/mock-server';
import items from '../test-cases/items';
import models from '../test-cases/models';
describe('Creating ... | return app.client.click('.toast');
}).then(() => {
return app.client.waitForVisible('.toast', 10000, true);
}).then(() => { |
<|file_name|>ConcurrentClientsTest.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is av... | long sessionId = netconfClient.getSessionId();
LOG.info("Client with session id {}: hello exchanged", sessionId);
final NetconfMessage getMessage = XmlFileLoader |
<|file_name|>events.py<|end_file_name|><|fim▁begin|>from openstates.utils import LXMLMixin
import datetime as dt
from pupa.scrape import Scraper, Event
from .utils import get_short_codes
from requests import HTTPError
import pytz
URL = "http://www.capitol.hawaii.gov/upcominghearings.aspx"
class HIEventScraper(Scrap... | for bill in bills:
try:
row = next(bill.iterancestors(tag='tr')) |
<|file_name|>structs.go<|end_file_name|><|fim▁begin|>package log
type logLevel struct {
Level int
Prefix string
ColorFunc func(...interface{}) string
}
type logLevels []*logLevel
func (l *logLevels) getFunc(Level int) func(...interface{}) string {
level := l.getLevel(Level)
if level != nil {
return lev... | return nil |
<|file_name|>thermo.py<|end_file_name|><|fim▁begin|>import math
import scipy.optimize as opt
log = math.log
exp = math.exp
small = 1e-20 # unitless
T0 = 1 # K
Tcrit = 650 # K
zero_C = 273.15 # K
p0 = 1 # Pa
atm ... | # |
<|file_name|>KEGGcompoundImport.java<|end_file_name|><|fim▁begin|>/*
* Concept profile generation tool suite
* Copyright (C) 2015 Biosemantics Group, Erasmus University Medical Center,
* Rotterdam, The Netherlands
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of t... | loader.save(ontology,keggcCuratedOntologyPath); |
<|file_name|>multipleblock.rs<|end_file_name|><|fim▁begin|>//
/*
*/
#![feature(inclusive_range_syntax)]
#![feature(type_ascription)]
#![feature(more_struct_aliases)]
extern crate modbus_server;
extern crate futures;
extern crate tokio_proto;
extern crate tokio_service;
extern crate docopt;
extern crate rustc_seria... | struct Args {
arg_resource: Vec<u8>,
flag_addr: String
} |
<|file_name|>samples.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'events.ui'
#
# Created by: PyQt4 UI code generator 4.11.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
from collections import *
from... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
#... | appName = os.path.splitext(os.path.basename(sys.argv[0]))[0] or 'UnknownApp'
appLogDir = os.path.abspath(os.path.join( |
<|file_name|>lecture_03.py<|end_file_name|><|fim▁begin|># coding=utf-8
# Лекция http://uneex.ru/LecturesCMC/PythonIntro2014/03_DataTypes
<|fim▁hole|>
# print decimal.Decimal(1.1) + decimal.Decimal(1.1)
# print decimal.Decimal("1.1") + decimal.Decimal("1.1")
# print dir(random)
a = []
for j in range(0, 10):
a.appen... | import decimal
import random |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>#![allow(unused)]
use poisson::{algorithm, Builder, Float, Type, Vector};
use rand::distributions::{Distribution, Standard};
use rand::{rngs::SmallRng, SeedableRng};
use num_traits::NumCast;
use alga::general::AbstractField;
use alga::linear::{FiniteDimVectorSpace, No... | |
<|file_name|>TrajectoryDrawing.hpp<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2004
* Swiss Federal Institute of Technology, Lausanne. All rights reserved.
*
* Developed at the Autonomous Systems Lab.
* Visit our homepage at http://asl.epfl.ch/
*
* This program is free software; you can redistribute it an... | |
<|file_name|>common.py<|end_file_name|><|fim▁begin|>from django.utils.encoding import force_text
import re
from django.utils import six
from ginger import serializer
from jinja2 import Markup
__all__ = ['html_json', 'html_attrs', "Element", "CssClassList", "CssStyle", 'add_css_class', 'empty']
def html_json(values)... | self.children = []
def __call__(self, **kwargs):
el = self.copy() |
<|file_name|>StockageException.java<|end_file_name|><|fim▁begin|>package fr.pizzeria.exception;
public class StockageException extends Exception {
public StockageException() {
super();
}
<|fim▁hole|> super(message, cause);
}
public StockageException(String message) {
super(message);
}
public StockageExce... | public StockageException(String message, Throwable cause) { |
<|file_name|>messages.go<|end_file_name|><|fim▁begin|>// The goal of this package is to integrate structured logging an metrics
// reporting with error handling in an interface as close as possible to the
// fluency of fmt.Errorf(...)
// or of errors.Wrapf(err, "fmt", args...)
// Concerns:
// a. structured logging ... | // IncCounter implements part of LogSink on LogSet
func (ls LogSet) IncCounter(name string, amount int64) {
ls.GetCounter(name).Inc(amount) |
<|file_name|>coerce-unsafe-to-closure.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copi... | // 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. |
<|file_name|>main.go<|end_file_name|><|fim▁begin|>package main
import (
"net/http"
"os"
"github.com/sim4life/go_hero/Godeps/_workspace/src/github.com/russross/blackfriday"
)
func GenerateMarkdown(rw http.ResponseWriter, r *http.Request) {
markdown := blackfriday.MarkdownCommon([]byte(r.FormValue("body")))
rw.Wr... | if port == "" { |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
##
# myapp.urls
##
##
# Copyright (C) $YEAR$, $AUTHOR_NAME$ <$AUTHOR_EMAIL$>
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of version 3 of the GNU Affero General Public L... | # |
<|file_name|>filesystem.go<|end_file_name|><|fim▁begin|>// Copyright 2016 CoreOS, 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... | |
<|file_name|>main.go<|end_file_name|><|fim▁begin|>package main
import (
"flag"<|fim▁hole|> "os/signal"
"syscall"
"time"
"go-common/app/job/main/ugcpay/conf"
"go-common/app/job/main/ugcpay/server/http"
"go-common/app/job/main/ugcpay/service"
ecode "go-common/library/ecode/tip"
"go-common/library/log"
)
func m... | "os" |
<|file_name|>proptest.py<|end_file_name|><|fim▁begin|>#!/usr/local/bin/python3
class TestClass(object):
def foo():
doc = "The foo property."
def fget(self):
return self._foo
def fset(self, value):
self._foo = value
def fdel(self):
del self._foo
... | def bar(): |
<|file_name|>feed_parse_extractSweetjamtranslationsCom.py<|end_file_name|><|fim▁begin|>def extractSweetjamtranslationsCom(item):
'''
Parser for 'sweetjamtranslations.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
retu... | ('Loiterous', 'Loiterous', 'oel'), |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>use std::io::{self, Read, Write};
use std::error::Error;
use std::fmt;
use std::convert::From;
use control::FixedHeader;
use control::fixed_header::FixedHeaderError;
use control::variable_header::VariableHeaderError;
use control::ControlType;
use encodable::StringEncode... | |
<|file_name|>aio_dio_bugs.py<|end_file_name|><|fim▁begin|>import os
from autotest.client import test, utils
# tests is a simple array of "cmd" "arguments"
tests = [["aio-dio-invalidate-failure", "poo"],
["aio-dio-subblock-eof-read", "eoftest"],
["aio-free-ring-with-bogus-nr-pages", ""],
["a... |
def setup(self):
os.chdir(self.srcdir) |
<|file_name|>reflect.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/license... | self.align_to::<~str>();
if ! self.inner.visit_str() { return false; }
self.bump_past::<~str>();
true |
<|file_name|>RealisticBot.java<|end_file_name|><|fim▁begin|>package com.stf.bj.app.game.players;
import java.util.Random;
import com.stf.bj.app.game.bj.Spot;
import com.stf.bj.app.game.server.Event;
import com.stf.bj.app.game.server.EventType;
import com.stf.bj.app.settings.AppSettings;
import com.stf.bj.app.strategy... | play = Play.STAND;
}
}
|
<|file_name|>promise.js<|end_file_name|><|fim▁begin|>/**
* Copyright 2016 The AMP HTML 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... | }
}, error => {
// Don't follow behavior of Promise.all and Promise.race error so that |
<|file_name|>index.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | import SocialShare from './SocialShare'
export default SocialShare |
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django_google_dork.models
import model_utils.fields
import django.utils.timezone
<|fim▁hole|>class Migration(migrations.Migration):
replaces = [... | |
<|file_name|>ThumbnailCheckLibrary.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2013 University of Dundee & Open Microscopy Environment.
* All rights reserved.
*
* 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
* ... | |
<|file_name|>cmdcache.py<|end_file_name|><|fim▁begin|># Built-in imports
import os, re, inspect, keyword
# Maya imports
import maya.cmds as cmds
import maya.mel as mm
# PyMEL imports
import pymel.util as util
import pymel.versions as versions
# Module imports
from . import plogging
from . import startup
_logger = p... | |
<|file_name|>serializers.py<|end_file_name|><|fim▁begin|>from rest_framework import serializers
from .models import User, Activity, Period
class UserSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = User
fields = ('url', 'username', 'email')
extra_kwargs = {
... | model = Period |
<|file_name|>KnowledgeBaseService.java<|end_file_name|><|fim▁begin|>package jp.ac.nii.prl.mape.controller.service;
import jp.ac.nii.prl.mape.controller.model.MAPEKComponent;
public interface KnowledgeBaseService {
<|fim▁hole|>
}<|fim▁end|> | void put(MAPEKComponent kb, String bx, String view, String param);
String get(MAPEKComponent kb, String bx, String param); |
<|file_name|>getOneTrustConsent.jest.ts<|end_file_name|><|fim▁begin|>import { delay } from "../delay"
import { getOneTrustConsent } from "../getOneTrustConsent"
import { oneTrustReady } from "../oneTrustReady"
jest.mock("../delay")
jest.mock("../oneTrustReady")
describe("getOneTrustConsent", () => {
const delayMock... | expect(delayMock).toHaveBeenCalledWith(10) |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
... | Object.defineProperty(exports, "createStream", { enumerable: true, get: function () { return createStream_1.createStream; } });
const getBorderCharacters_1 = require("./getBorderCharacters");
Object.defineProperty(exports, "getBorderCharacters", { enumerable: true, get: function () { return getBorderCharacters_1.getBor... |
<|file_name|>m1.js<|end_file_name|><|fim▁begin|>var m1_a1 = 10;
var m1_c1 = (function () {
function m1_c1() {
}
return m1_c1;
})();
<|fim▁hole|>var m1_instance1 = new m1_c1();
function m1_f1() {
return m1_instance1;
}
//# sourceMappingURL=m1.js.map<|fim▁end|> | |
<|file_name|>shared.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>pub const EMPTY_COLUMN: Column = [0; DISPLAY_HEIGHT];
pub const DISPLAY_WIDTH: usize = 17;
pub const DISPLAY_HEIGHT: usize = 7;<|fim▁end|> | pub type Column = [u8; DISPLAY_HEIGHT];
|
<|file_name|>msg.go<|end_file_name|><|fim▁begin|>package darwin
import (
"github.com/currantlabs/ble"
"github.com/raff/goble/xpc"
)
type msg xpc.Dict
func (m msg) id() int { return xpc.Dict(m).MustGetInt("kCBMsgId") }
func (m msg) args() xpc.Dict { return xpc.Dict(m).MustGetDict("kCBMsgArgs") }
func (m msg)... | } |
<|file_name|>index.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | var scroller = angular.module("scroller", ["ngTouch", "angular-websql"]); |
<|file_name|>drive_to_point_controller.py<|end_file_name|><|fim▁begin|>import logging
import logging.config
import sys
import threading
import os
from amberclient.collision_avoidance.collision_avoidance_proxy import CollisionAvoidanceProxy
from amberclient.common.amber_client import AmberClient
from amberclient.locati... | |
<|file_name|>13a57b7f084_add_user.py<|end_file_name|><|fim▁begin|>"""Add user
Revision ID: 13a57b7f084
Revises: None
Create Date: 2014-05-11 17:12:17.244013
"""
# revision identifiers, used by Alembic.
revision = '13a57b7f084'
down_revision = None
from alembic import op
import sqlalchemy as sa
def upgrade():
... | sa.Column('id', sa.Integer(), nullable=False), |
<|file_name|>HeadingsParser.py<|end_file_name|><|fim▁begin|>import re
class HeadingsParser():
"""
The HeadingParser parses the document for headings.
NOT YET: converts headings to raw latex headings in the correct way, so that they can be referrenced to later
see https://www.sharelatex.com/learn/Secti... | self.title_start_marker_regex = re.compile(r'[=]{3,}')
self.title_end_marker_regex = re.compile(r'[=]{3,}')
self.title_content_regex = re.compile( |
<|file_name|>testMessagePartHitInfo.java<|end_file_name|><|fim▁begin|>package generated.zcsclient.mail;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;
<|fim▁hole|> * <p>The follo... | /**
* <p>Java class for messagePartHitInfo complex type.
* |
<|file_name|>EidMap.java<|end_file_name|><|fim▁begin|>/**
Copyright (c) 2011, Cisco Systems, Inc.
All rights reserved.
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 abo... | * sub-elements, adding a Dtn <-> Ipn EID Mapping for each. We also
* parse the ending < /EidMap > tag.
* @param parser The config file parser |
<|file_name|>table_rowgroup.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/. */
//! CSS table formatting contexts.
#![deny(unsafe_cod... | self.block_flow.generated_containing_block_size(flow)
}
|
<|file_name|>data_source_aws_network_acls.go<|end_file_name|><|fim▁begin|>package aws
import (
"errors"
"fmt"<|fim▁hole|> "github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/helper/schema"
)
func dataSourceAwsNetworkAcls() *schema.Resource {
return &schema.Resource{
Read: dataSource... | "log"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/ec2" |
<|file_name|>FunctionalAnalysisArchitectureImpl.java<|end_file_name|><|fim▁begin|>/**
* <copyright>
* </copyright>
*
* $Id$
*/
package org.obeonetwork.dsl.east_adl.structure.functional_analysis_architecture.impl;
import java.util.Collection;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.e... | if (msgs != null) msgs.dispatch();
} |
<|file_name|>speaker.py<|end_file_name|><|fim▁begin|>import pygame
import logging
from tools.action import Action
class Speaker(Action):
def __init__(self, id, params):
super(Speaker, self).__init__(id, params)
try:
self.path_to_audio = params["path_to_audio"]
self.repetitions = int(params["repetitions"])... | pygame.mixer.quit() |
<|file_name|>web_form.js<|end_file_name|><|fim▁begin|>frappe.provide("frappe.ui");
frappe.provide("frappe.web_form");
import EventEmitterMixin from '../../frappe/event_emitter';
export default class WebForm extends frappe.ui.FieldGroup {
constructor(opts) {
super();
Object.assign(this, opts);
frappe.web_form = ... | |
<|file_name|>unique-autoderef-field.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.
//<|fim▁hole|>// except according to those terms.
// run-pass
#![feature(box_syntax)]
s... | // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed |
<|file_name|>types.rs<|end_file_name|><|fim▁begin|>// Copyright 2015 Ted Mielczarek. See the COPYRIGHT
// file at the top-level directory of this distribution.
use range_map::{Range, RangeMap};
use std::cmp::Ordering;
use std::collections::HashMap;
/// A publicly visible linker symbol.
#[derive(Debug, Eq, PartialEq)]... | self.init.address.checked_add(self.size as u64)? - 1, |
<|file_name|>test_product.cpp<|end_file_name|><|fim▁begin|>//
// Created by Aman LaChapelle on 5/26/17.
//
// pytorch_inference
// Copyright (c) 2017 Aman LaChapelle
// Full license at pytorch_inference/LICENSE.txt
//
#include "../include/layers.hpp"
#include "utils.hpp"
int main(){
std::vector<pytorch::tensor> te... | |
<|file_name|>EventActionObject.java<|end_file_name|><|fim▁begin|>/*
* RAFTools - Copyright (C) 2016 Zane van Iperen.
* Contact: zane@zanevaniperen.com
*
<|fim▁hole|> * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2, and on... | |
<|file_name|>hardware.py<|end_file_name|><|fim▁begin|>#
# Copyright (c) 1999--2015 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# ... | hwdict['platform'] = uname |
<|file_name|>GetAllJobsResponse.java<|end_file_name|><|fim▁begin|>/**
* GetAllUsersResponse.java
* Created by pgirard at 2:07:29 PM on Aug 19, 2010
* in the com.qagwaai.starmalaccamax.shared.services.action package
* for the JobMalaccamax project
*/
package com.qagwaai.starmalaccamax.client.service.action;
... | import com.google.gwt.user.client.rpc.IsSerializable;
import com.qagwaai.starmalaccamax.shared.model.JobDTO;
|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""
# lint-amnesty, pylint: disable=django-not-configured
# lint-amnesty, pylint: disable=django-not-configured
Bookmarks module.
"""
<|fim▁hole|>
DEFAULT_FIELDS = [
'id',
'course_id',
'usage_id',
'block_type',
'created',
]
OPTIONAL_FIELDS = [
... |
from collections import namedtuple |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.