prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>newtype-struct-drop-run.rs<|end_file_name|><|fim▁begin|>// Copyright 2013 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.ap... | impl Drop for Foo {
fn finalize(&self) { |
<|file_name|>PUTS.C<|end_file_name|><|fim▁begin|>/*
Copyright (c) 2015, Digi International Inc.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copi... |
Configure the serial utility for port connected to RS232, 19200 8N1.
Run Hyperterminal.
|
<|file_name|>forms.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import django
import sys
from itertools import chain
from django import forms
from django.conf import settings
from django.db.models.query import QuerySet
from django.template.loader import render_to_string
from django.utils.encoding import forc... | if value is None: value = []
has_id = attrs and 'id' in attrs
final_attrs = self.build_attrs(attrs, name=name) |
<|file_name|>StaticText.js<|end_file_name|><|fim▁begin|>/**
* StaticText.js
* Text that cannot be changed after loaded by the game<|fim▁hole|>
export default class StaticText extends Text {
constructor (config) {
super(config);
this.static = true;
}
}<|fim▁end|> | */
import GamePiece from './GamePiece.js';
import Info from './Info.js';
import Text from './Text.js'; |
<|file_name|>00015.py<|end_file_name|><|fim▁begin|><|fim▁hole|> return pyn.distance(fx, fy) <= 1<|fim▁end|> | def caught(pyn, fpyn):
fx, fy = fpyn.xy() |
<|file_name|>paginar.py<|end_file_name|><|fim▁begin|>import flask.views
from flask import request
TAM_PAGINA=5
def calculoPrimeraPag(cant):
"""
Setea los valores correspondientes a la primera pagina de un paginar,
recibe la cantidad de items, fases o proyectos que existen para dicho paginar
"""
if... | return infopag
def calculoDeSiguiente(cant): |
<|file_name|>RedisPool.java<|end_file_name|><|fim▁begin|>package orestes.bloomfilter.redis.helper;
import java.util.ArrayList;
import java.util.List;
import java.util.Map.Entry;
import java.util.Random;
import java.util.Set;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
import redis.clients.... | p.multi();
T responses = f.apply(p);
Response<List<Object>> exec = p.exec();
p.sync(); |
<|file_name|>PaintableShape.cpp<|end_file_name|><|fim▁begin|>/*
* PaintableShape.cpp
*
* Created on: Mar 19, 2017
* Author: Brian Schnepp
* License: See 'LICENSE' in root of this repository.
*/
#include <PathToolKit/graphic/gstructs.h>
#include <PathToolKit/graphic/PaintableShape.h>
#include <PathTool... | Color colors[2] = new Color[2]; |
<|file_name|>CaptureActivity.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2008 ZXing 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.o... | // wrong size and partially
// off screen.
cameraManager = new CameraManager(getApplication());
|
<|file_name|>sinumber.py<|end_file_name|><|fim▁begin|>"""
Functions for converting numbers with SI units to integers
"""
import copy
import re
si_multipliers = {
None: 1,
'': 1,
'k': 1000 ** 1,
'm': 1000 ** 2,
'g': 1000 ** 3,
't': 1000 ** 4,
'p': 1000 ** 5,
'e': 1000 ** 6,
'z': 100... | integer if that is what was passed in.""" |
<|file_name|>glx.rs<|end_file_name|><|fim▁begin|>/*
* This file generated automatically from glx.xml by r_client.py.
* Edit at your peril.
*/
//Make the compiler quiet
#![allow(unused_imports)]
#![allow(non_camel_case_types)]
use std;
use libc::*;
use ffi;
use ffi::xproto;
pub static GLX_MAJOR_VERSION : c_uint = 1... |
pub fn xcb_glx_get_doublev_data (R : *mut get_doublev_reply) -> *mut float64; |
<|file_name|>map.rs<|end_file_name|><|fim▁begin|>/*
* map.rs: commands for mapping/unmapping memory regions and listing mapped regions as well.
* Copyright (C) 2019 Oddcoder
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as publi... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from .exc import ParameterTypeError # noqa
from .nest import nest # noqa<|fim▁hole|>
__version__ = '0.2.1'<|fim▁end|> | from .unnest import unnest # noqa |
<|file_name|>cloudpro_servers.go<|end_file_name|><|fim▁begin|>package cloudatcost
import (
"fmt"
"net/http"
"net/url"
)
type CloudProService struct {
client *Client
}
func (s *CloudProService) Resources() (*CloudProResourcesData, *http.Response, error) {
u := fmt.Sprintf("/api/v1/cloudpro/resources.php?key=%s&l... | rr := new(CloudProResourcesResponse)
resp, err := s.client.Do(req, rr) |
<|file_name|>test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Test suite for language_check."""
from __future__ import unicode_literals
import unittest
import warnings
from collections import namedtuple
import language_check
class TestLanguageTool(unittest.TestCase):
CheckT... | 'fr': {
'il monte en haut si il veut.':
'Il monte s’il veut.', |
<|file_name|>ScheduleServiceImpl.java<|end_file_name|><|fim▁begin|>package alexp.blog.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import alexp.blog.repository.*;
import alexp.blog.model.Schedule;
@Service("ScheduleService")
public class Sched... | // TODO Auto-generated method stub
System.out.println("I am in service");
return schedulerepository.findByUsernameIgnoreCase(username); |
<|file_name|>nickel_test.go<|end_file_name|><|fim▁begin|>package money_test
import (
"github.com/reiver/go-money"
"testing"
)
func TestCADNickel(t *testing.T) {
var expected money.CAD = money.CADCents(5)
var actual money.CAD = money.CADNickel()
if expected != actual {
t.Error("The actual value is not equa... | |
<|file_name|>ProgressController.js<|end_file_name|><|fim▁begin|>angular.module('app')
.controller('ProgressController', ['$scope', function ($scope) {<|fim▁hole|> $scope.percent = p;
}
}])<|fim▁end|> | $scope.percent = 45;
$scope.setPercent = function(p) { |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.http import HttpResponse, HttpResponseRedirect
from django.core.urlresolvers import reverse
from django.shortcuts import render_to_response
from omeroweb.webgateway.views import getBlitzConnection, _session_logout
from omeroweb.webgateway import views as we... | w = image.getWidth()
h = image.getHeight()
z = image.z_count() /2 |
<|file_name|>utilization_kpi_subdag.py<|end_file_name|><|fim▁begin|>from airflow.models import DAG
from airflow.operators.dummy_operator import DummyOperator
from datetime import datetime, timedelta
from airflow.operators import PythonOperator
from airflow.hooks import RedisHook
from airflow.models import Variable
from... | ss_kpi_dict['max_value']=curr_value |
<|file_name|>real_server_pooling.py<|end_file_name|><|fim▁begin|>from python_kemptech_api import *
# Specify the LoadMaster connection credentials here:
loadmaster_ip = ""
username = ""
password = ""
vs_ip_1 = ""
vs_ip_2 = ""
rs_ip_1 = ""
rs_ip_2 = ""
vs_port = ""
rs_port = ""
class RealServerPool(object):
healt... | self.checkpostdata = None
self.checkpattern = None
self.checkcodes = None |
<|file_name|>profiles.rs<|end_file_name|><|fim▁begin|>use std::env;
use cargotest::is_nightly;
use cargotest::support::{execs, project};
use hamcrest::assert_that;
#[test]
fn profile_overrides() {
let p = project("foo")
.file(
"Cargo.toml",
r#"
[package]
na... | |
<|file_name|>cuda.py<|end_file_name|><|fim▁begin|>from .cuda_products import gmt_func as gp_device
from .cuda_products import imt_func as ip_device
import numpy as np
import numba.cuda
import numba
import math
import random
from . import *
def sequential_rotor_estimation_chunks(reference_model_array, query_model_arr... | for b_ind in range(32):
sum_abs += abs(C1[b_ind] + C2[b_ind]) |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>var should = require('should');
var annotationRouter = require('../../index.js');
var path = './mock.js';
describe('get basic routes', function(){
describe('asynchronous', function(){
var err;
before(function(done){
routes = {};... | route.should.have.property('method', method); |
<|file_name|>issue-21402.rs<|end_file_name|><|fim▁begin|>// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/lic... | // pretty-expanded FIXME #23616
|
<|file_name|>FileViewerController.java<|end_file_name|><|fim▁begin|>/* This file is part of F3TextViewerFX.
*
* F3TextViewerFX 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 Licen... | |
<|file_name|>mainController.js<|end_file_name|><|fim▁begin|>angular.module('mainController',[])
.controller('mainController', function($rootScope, $location, Auth){
var vm = this;
vm.loggedIn = Auth.isLoggedIn();
// o rootscope é usado para detectar alterações na rota
// quando acontecer uma troca de rota (req... | $rootScope.$on('$routeChangeStart',function(){
// pegar a pessoa que está logada
vm.loggedIn = Auth.isLoggedIn(); |
<|file_name|>ast.go<|end_file_name|><|fim▁begin|>package influxql
import (
"bytes"
"errors"
"fmt"
"regexp"
"regexp/syntax"
"sort"
"strconv"
"strings"
"time"
"github.com/gogo/protobuf/proto"
internal "github.com/influxdata/influxdb/influxql/internal"
)
// DataType represents the primitive data types availa... | |
<|file_name|>object_delete.bigg.js<|end_file_name|><|fim▁begin|><div ng-include="'components/navbar/navbar.html'"></div>
<div class="container">
<div class="row">
<div class="col-lg-12"><|fim▁hole|></div><|fim▁end|> | <h1 class="page-header">Delete A ${model["name"]} :</h1>
</div>
</div> |
<|file_name|>Bounds.js<|end_file_name|><|fim▁begin|><|fim▁hole|>export function Bounds(width, height) {
this.width = width;
this.height = height;
}
Bounds.prototype.equals = function(o) {
return ((o != null) && (this.width == o.width) && (this.height == o.height));
};<|fim▁end|> | |
<|file_name|>Glyph.test.tsx<|end_file_name|><|fim▁begin|>import React from 'react';
import { shallow, render } from 'enzyme';
import { Glyph } from '../src';
describe('<Glyph />', () => {
test('it should be defined', () => {
expect(Glyph).toBeDefined();
});
test('it should be wrapped in a <Glyph ... | }); |
<|file_name|>STLFile.py<|end_file_name|><|fim▁begin|># ICE Revision: $Id$
"""Read a STL file and do simple manipulations"""
from os import path
from PyFoam.Error import error
from PyFoam.ThirdParty.six import next as iterNext
class STLFile(object):
"""Store a complete STL-file and do simple manipulations with i... | info["min"]=[min(m) for m in zip(info["min"], |
<|file_name|>cspSLSPlot.py<|end_file_name|><|fim▁begin|># cspSLS.py - Stochastic Local Search for Solving CSPs
# AIFCA Python3 code Version 0.7.1 Documentation at http://aipython.org
# Artificial Intelligence: Foundations of Computational Agents
# http://artint.info
# Copyright David L Poole and Alan K Mackworth 2017.... | SLSearcher.max_display_level = temp_mdl # restore display
|
<|file_name|>repeat_finder_RRBS_NormalBCD19pCD27pcell23_44_CTCTCTAC.G.py<|end_file_name|><|fim▁begin|>import glob
import numpy as np<|fim▁hole|>os.chdir("/gpfs/commons/home/biederstedte-934/evan_projects/RRBS_anno_clean")
repeats = pd.read_csv("repeats_hg19.csv")
annofiles = glob.glob("RRBS_NormalBCD19pCD27pcell23_44_... | import pandas as pd
from numpy import nan
import os
|
<|file_name|>expandable.pipe.ts<|end_file_name|><|fim▁begin|>/*
* Lumeer: Modern Data Definition and Processing Platform
*
* Copyright (C) since 2017 Lumeer.io, s.r.o. and/or its affiliates.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public Lic... | return row && !row.expanded && row.linkedRows && row.linkedRows.length > 1;
}
} |
<|file_name|>tests.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
from config_reader import ConfigReader
class TestConfigReader(unittest.TestCase):
def setUp(self):
self.config = ConfigReader("""
<root>
<person>
<name>山田</name>
<age>15</age... | # coding: utf-8
import unittest |
<|file_name|>create_project.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
from django import forms
from django.contrib import messages
from django.core.urlresolvers import reverse
from sentry.models import Project, Team
from sentry.web.forms.add_project import AddProjectForm
from sentry.web.f... | ERR_NO_TEAMS = 'You cannot create a new project because there are no teams to assign it to.'
|
<|file_name|>forms.py<|end_file_name|><|fim▁begin|>from django import forms<|fim▁hole|>from models import FormDataGroup
import re
# On this page, users can upload an xsd file from their laptop
# Then they get redirected to a page where they can download the xsd
class RegisterXForm(forms.Form):
file = forms.FileFi... | |
<|file_name|>hyperbolic.py<|end_file_name|><|fim▁begin|>from __future__ import print_function, division
from sympy.core import S, sympify, cacheit, pi, I, Rational
from sympy.core.add import Add
from sympy.core.function import Function, ArgumentIndexError, _coeff_isneg
from sympy.functions.combinatorial.factorials imp... |
class HyperbolicFunction(Function):
"""
Base class for hyperbolic functions. |
<|file_name|>testutil.py<|end_file_name|><|fim▁begin|>import io
from pathlib import Path
from typing import Mapping
import fontTools.designspaceLib
import fontTools.ttLib
import fontTools.ttLib.tables._n_a_m_e
import fontTools.varLib
import ufo2ft
import ufoLib2
import statmake.classes
import statmake.lib
def dump_... | elif axis.Format == 4:
entry["AxisValueRecord"] = [
(r.AxisIndex, r.Value) for r in axis.AxisValueRecord |
<|file_name|>yahoo.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.a... |
import {validateData, writeScript} from '../../3p/3p'; |
<|file_name|>sample_control.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
"""
Sample for python PCSC wrapper module: send a Control Code to a card or
reader
__author__ = "Ludovic Rousseau"
Copyright 2007-2010 Ludovic Rousseau
Author: Ludovic Rousseau, mailto:ludovic.rousseau@free.fr
This file is part of pys... | except error as e:
print(e) |
<|file_name|>test_standalone.py<|end_file_name|><|fim▁begin|>import os
import sys
if sys.version_info[:2] == (2, 6):
import unittest2 as unittest
else:
import unittest
from avocado.utils import process
basedir = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', '..')
basedir = os.path.abspath(b... | |
<|file_name|>std_nodes.py<|end_file_name|><|fim▁begin|>from pyjsparserdata import *
class BaseNode:
def finish(self):
pass
def finishArrayExpression(self, elements):
self.type = Syntax.ArrayExpression
self.elements = elements
self.finish()
... | |
<|file_name|>Stocks_SimpleMarkovChain.py<|end_file_name|><|fim▁begin|># http://github.com/timestocome
# use hidden markov model to predict changes in a stock market index fund
# http://cs229.stanford.edu/proj2009/ShinLee.pdf
# https://www.dartmouth.edu/~chance/teaching_aids/books_articles/probability_book/Chapter11.p... | total_transitions += 1
previous = data.iloc[i]['gainLoss'] |
<|file_name|>align.rs<|end_file_name|><|fim▁begin|>use internal;
#[repr(u32)]
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Copy, Clone)]
#[cfg_attr(feature = "serde_support", derive(Serialize, Deserialize))]
pub enum Align {
Auto = 0,
FlexStart = 1,
Center = 2,
FlexEnd = 3,
Stretch = 4,
Baseline = 5,
S... | fn from(a: internal::YGAlign) -> Align {
match a {
internal::YGAlign::YGAlignAuto => Align::Auto,
internal::YGAlign::YGAlignFlexStart => Align::FlexStart, |
<|file_name|>i18n.py<|end_file_name|><|fim▁begin|># coding: utf-8
"""
flask_wtf.i18n
~~~~~~~~~~~~~~
Internationalization support for Flask WTF.
:copyright: (c) 2013 by Hsiaoming Yang.
"""
from flask import _request_ctx_stack
from wtforms.ext.i18n.utils import messages_path
from flask.ext.babel import... | return translations |
<|file_name|>0002_auto_20160519_0326.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('get_feedback', '0001_initial'),
]
operations = [
migrat... | migrations.AlterField(
model_name='course', |
<|file_name|>no071.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# neighbors
# a/b < c/d
# need bc - ad = 1
# The converse is also true. If
# bc - ad = 1
# for positive integers a,b,c and d with a < b and c < d then a/b and c/d
# will be neighbours in the Farey sequence of order max(b,d).
# By listing the s... | if __name__ == '__main__':
print euler_timer(71)(main)(verbose=True) |
<|file_name|>test.py<|end_file_name|><|fim▁begin|># coding=utf-8
from __future__ import absolute_import<|fim▁hole|>
# ######### IN-MEMORY TEST DATABASE
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": ":memory:",
},
}<|fim▁end|> |
from .base import * |
<|file_name|>BEXPStyle.java<|end_file_name|><|fim▁begin|>package org.jb2011.lnf.beautyeye.winlnfutils.d;
///*
// * @(#)XPStyle.java 1.28 07/01/09
// *
// * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
// * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
// */
//
///*
// * <p>These classes a... | // static class GlyphButton extends JButton {
// private Skin skin; |
<|file_name|>groupme_bot.py<|end_file_name|><|fim▁begin|>import os
from flask import Flask
from flask import request
import requests
import random
import codecs
#API id
#move this to a config file
bot_id = ''
app = Flask(__name__)
<|fim▁hole|> text = text.lower()
return text.encode('ascii','replace_spc')
def send(... | #encode string as ASCII
def stripped(text): |
<|file_name|>test_transaction_serializer.py<|end_file_name|><|fim▁begin|>import pytest
from django.test import RequestFactory
from django.core.urlresolvers import reverse
from api.transaction.serializers import TransactionSerializer
from iati.transaction.factories import TransactionFactory
class TestTransactionSerial... | expected_url = "http://testserver{reverse}".format( |
<|file_name|>source_util.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2013 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.or... | |
<|file_name|>text_run.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use app_units::Au;
use font::{Font, FontHandleMethods, FontM... | |
<|file_name|>ErrorFontIcon.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 ErrorFontIcon = forwardRef<HTMLElement, Fo... | error
</FontIcon>
);
} |
<|file_name|>rn.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# rn.py - load network of routes from OSM
#<|fim▁hole|># the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be usef... | # Copyright (C) 2012, Stefan Schramm <mail@stefanschramm.net>
#
# 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|>list-overview.js<|end_file_name|><|fim▁begin|>const ajaxurl = window.mc4wp_vars.ajaxurl
const m = require('mithril')
if (!Element.prototype.matches) {
Element.prototype.matches = Element.prototype.msMatchesSelector ||
Element.prototype.webkitMatchesSelector
}
function showDetails (evt) {
evt.prev... | m('td', [
m('strong', f.title), |
<|file_name|>diff.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
class DictDiffer(object):
"""
Calculate the difference between two dictionaries as:
(1) items added
(2) items removed
(3) keys same in both but changed values
(4) keys same in both and unchanged value... |
- NmapDiff.changed()
- NmapDiff.added()
- NmapDiff.removed() |
<|file_name|>SpriteTween.java<|end_file_name|><|fim▁begin|>package org.globalgamejam.maze.tweens;
import aurelienribon.tweenengine.TweenAccessor;
import com.badlogic.gdx.graphics.g2d.Sprite;
public class SpriteTween implements TweenAccessor<Sprite> {
public static final int BOUNCE = 1;
public static final int ALP... | switch (tweenType) {
case BOUNCE:
returnValues[0] = target.getY();
return 1; |
<|file_name|>TileEntityDropperMixin_API.java<|end_file_name|><|fim▁begin|>/*
* This file is part of Sponge, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a... | * all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
<|file_name|>binary.py<|end_file_name|><|fim▁begin|># coding=utf-8
"""
Binary class deconstruct, reconstruct packet
"""
import copy
class Binary(object):
@staticmethod<|fim▁hole|> :return: dict with packet and list of buffers
"""
buffers = []
packet_data = packet.get('data', None)
... | def deconstruct_packet(packet):
"""
Replaces every bytearray in packet with a numbered placeholder.
:param packet: |
<|file_name|>ConfigurationHandler.java<|end_file_name|><|fim▁begin|>package soupbubbles.minecraftboom.handler;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import org.apache.logging.log4j.Level;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.item.I... | |
<|file_name|>rotation.go<|end_file_name|><|fim▁begin|>package database
import (
"context"
"errors"
"fmt"
"strconv"
"time"
"github.com/hashicorp/errwrap"
"github.com/hashicorp/go-multierror"
v4 "github.com/hashicorp/vault/sdk/database/dbplugin"
v5 "github.com/hashicorp/vault/sdk/database/dbplugin/v5"
"github... | // Load roles and populate queue with static accounts
b.populateQueue(ctx, conf.StorageView)
// Launch ticker |
<|file_name|>wordprofile.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
'''
* Copyright 2015 by Benjamin J. Land (a.k.a. BenLand100)
*
* This file is part of chatlogs.
*
* chatlogs is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as publish... | for i in db.get_iter(query,args):
thin = ' '.join([x.lower() for x in i.msg.split(' ') if len(x) <= maxlen])
words.update([word for word in wordtokregex.findall(thin)]) |
<|file_name|>types.rs<|end_file_name|><|fim▁begin|>#[derive(Debug, Clone)]
pub enum FnType {
Simple,
None,
}
impl<'a> Into<String> for &'a FnType {
fn into(self) -> String {
match self {
&FnType::Simple => String::from("SIMPLE"),
_ => String::from(""),
}
}
}
imp... | match s.as_ref() {
"LINK" => StructType::Link, |
<|file_name|>infragistics.ui.regional-sl.js<|end_file_name|><|fim▁begin|>/* Slovenia +*/
/*global jQuery */
(function ($) {
$.ig = $.ig || {};
$.ig.regional = $.ig.regional || {};
if ($.datepicker && $.datepicker.regional) {
$.datepicker.regional['sl'] = {
closeText: 'Zapri',
prevText: '<Prej... | dateFormat: 'dd.mm.yy',
firstDay: 1,
isRTL: false,
showMonthAfterYear: false, |
<|file_name|>note.go<|end_file_name|><|fim▁begin|>package notes
import (
"fmt"
"math/rand"
"regexp"
"strings"
"time"
)
const (
DATEFORMATGETPARAM = "02/01/2006"
DATEHOURFORMATPRINT = "02/01/2006 Mon 15:04"
HOURFORMATPRINT = "15:04"
DATEFORMATPRINT = "02 Jan 2006"
DATEFORMATFORHTML = "Monday, 02 J... | |
<|file_name|>0033_apiaccess.py<|end_file_name|><|fim▁begin|># Generated by Django 2.2.13 on 2020-10-23 00:43
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('community', '0032_accesslevel'),
]
operations = [
... | name='ApiAccess', |
<|file_name|>TouchController.java<|end_file_name|><|fim▁begin|>package emu.project64.input;
import java.util.Set;
import emu.project64.AndroidDevice;
import emu.project64.input.map.TouchMap;
import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.graphics.Point;
import android.os.V... | // Two d-pad buttons pressed simultaneously
switch( index ) |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from flask import Blueprint
auth = Blueprint('auth', __name__)<|fim▁hole|>
from . import views<|fim▁end|> | |
<|file_name|>test-stream-pipe-error-handling.js<|end_file_name|><|fim▁begin|>// Copyright Joyent, Inc. and other Node contributors.
//
// 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 witho... | var gotErr = null; |
<|file_name|>03_instanced_drawing.py<|end_file_name|><|fim▁begin|>from glfwpy.glfw import *
import sys
import numpy as np
from OpenGL.GL import *
from OpenGL.arrays import ArrayDatatype
import ctypes
vertex = """
#version 330
in vec3 vin_position;
in vec3 vin_color;
uniform vec3 vu_displacement[2];
out vec3 vout_col... | return glGetUniformLocation(self.program_id, name)
def attribute_location(self, name):
return glGetAttribLocation(self.program_id, name) |
<|file_name|>function_expression-out.js<|end_file_name|><|fim▁begin|>var a = function() {
return 'b';
};
b = function doB(q, wer, ty) {
var c = function(n) {
return function() {
return q +
wer - ty;
}
}
return c
}
this.foo = {
bar: function() {
var r = function() {
re(); draw... | };
|
<|file_name|>benchmarks_test.py<|end_file_name|><|fim▁begin|># Copyright 2017 The TensorFlow 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... | self._benchmark_transpose(m, num_iters=self._num_iters_2_by_2) |
<|file_name|>processFile.py<|end_file_name|><|fim▁begin|>'''
Created on Mar 28, 2016
@author: Ziv
'''
class MyClass(object):
'''
classdocs
'''
def __init__(self, params):
'''
Constructor
'''
import sys
import os
from getArgs import getParams
from parse import parse
... |
return True |
<|file_name|>droidbox_compatible.py<|end_file_name|><|fim▁begin|># I have to modify droidbox scripts to let it work with droidbot
# This is a compatible version which generate a report with the same format of original DroidBox
__author__ = 'yuanchun'
####################################################################... |
# Duration given?
if len(argv) == 3:
duration = int(argv[2]) |
<|file_name|>functional_test.rs<|end_file_name|><|fim▁begin|>use crate::schema;
use crate::Index;
use crate::IndexSettings;
use crate::IndexSortByField;
use crate::Order;
use crate::Searcher;
use crate::{doc, schema::*};
use rand::thread_rng;
use rand::Rng;
use std::collections::HashSet;
fn check_index_content(searche... | if !doc_set.is_empty() { |
<|file_name|>latlng.js<|end_file_name|><|fim▁begin|>/* @flow */
import { PropTypes } from 'react'
export default PropTypes.oneOfType([
// [Number, Number]
PropTypes.arrayOf(PropTypes.number),
// {lat: Number, lng: Number}
PropTypes.shape({
lat: PropTypes.number,
lng: PropTypes.number,
}),
// {lat:... | ]) |
<|file_name|>onlineDocs.py<|end_file_name|><|fim▁begin|><|fim▁hole|>import webbrowser
import platform
def get_version():
version = platform.python_version()
if len(version) != 3: # This is to exclude minor versions.
version = version[0:3]
return version
def open_doc(url):
webbrowser.open(ur... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># GUI for pyfdtd using PySide
# Copyright (C) 2012 Patrik Gebhardt
# Contact: grosser.knuff@googlemail.com
#
# This program is free software: you can redistribute it and/or modify<|fim▁hole|># the Free Software Foundation, either version 3 of the License, or
# (at ... | # it under the terms of the GNU General Public License as published by |
<|file_name|>artemisapplication.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright 2012 Aarhus University
*
* Licensed under the GNU General Public License, Version 3 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www... | |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// 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/LICENSE-2.0
//
// U... | |
<|file_name|>test_oncebitten.py<|end_file_name|><|fim▁begin|>"""Test for the once bitten strategy."""
import random
import axelrod
from .test_player import TestPlayer
C, D = 'C', 'D'
class TestOnceBitten(TestPlayer):
name = "Once Bitten"
player = axelrod.OnceBitten
expected_classifier = {
'me... | self.responses_test([C, C], [D, D], [D])
# Sometime eventually forget count:
self.responses_test([C, C], [D, D], [D] * 13 + [C]) |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from distutils.core import setup
from setuptools import find_packages
from ponypusher import VERSION
setup(<|fim▁hole|>description='Pusher app library for django',
author='Raymond McGinlay',
author_email='ray@lvlup.us',
#version number is derived from VERSION attribu... | #this is the name of the package to install from pypi/chishop
name='django-ponypusher', |
<|file_name|>zone.go<|end_file_name|><|fim▁begin|>package world
<|fim▁hole|>import "fmt"
type Zone struct {
Id string
Rooms map[string]*Room
Name string
}
func (z Zone) String() string {
return fmt.Sprintf("(Zone %s: '%s')", z.Id, z.Name)
}<|fim▁end|> | |
<|file_name|>charset.py<|end_file_name|><|fim▁begin|># Copyright (C) 2001-2006 Python Software Foundation
# Author: Ben Gertzfield, Barry Warsaw
# Contact: email-sig@python.org
__all__ = [
'Charset',
'add_alias',
'add_charset',
'add_codec',
]
import email.base64mime
import email.quoprimime
from e... | return len(s)
def header_encode(self, s, convert=False): |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>mod project;<|fim▁hole|>
pub use self::project::{Project, Folder};<|fim▁end|> | mod build; |
<|file_name|>WebConfigurer.java<|end_file_name|><|fim▁begin|>package org.mdo.storyline.character.config;
import com.codahale.metrics.MetricRegistry;
import com.codahale.metrics.servlet.InstrumentedFilter;
import com.codahale.metrics.servlets.MetricsServlet;
import org.mdo.storyline.character.web.filter.CachingHttpHead... | |
<|file_name|>47628.cc<|end_file_name|><|fim▁begin|><|fim▁hole|>// This file is part of the GNU ISO C++ Library. This library 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, or (at your ... | // Copyright (C) 2011-2014 Free Software Foundation, Inc.
// |
<|file_name|>mount.rs<|end_file_name|><|fim▁begin|>use util::*;
use hyper::status::StatusCode;
use hyper::client::Response;
fn with_path<F>(path: &str, f: F) where F: FnOnce(&mut Response) {
run_example("mount", |port| {
let url = format!("http://localhost:{}{}", port, path);
let ref mut res = res... |
#[test]
fn ignores_unmatched_prefixes() { |
<|file_name|>type-mismatch.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/l... |
fn main() {
let x = true;
let y = 1; |
<|file_name|>attr.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use devtools_traits::AttrInfo;
use dom::bindings::cell::DOMRefCe... | unsafe fn value_ref_forever(&self) -> &'static str {
&**self.value_forever()
} |
<|file_name|>main.go<|end_file_name|><|fim▁begin|>package main
import (
"html/template"
"net/http"
"path"
)
type Book struct {
Title string `json:"title"`
Author string `json:"author"`
}
func main() {
http.HandleFunc("/", ShowBooks)
http.ListenAndServe(":8080", nil)
}
func ShowBooks(w http.ResponseWriter, r... | http.Error(w, err.Error(), http.StatusInternalServerError)
return |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Copyright © 2015, Peter Atashian
// Licensed under the MIT License <LICENSE.md>
//! FFI bindings to gdi32.
#![cfg(all(windows, any(target_arch = "x86", target_arch = "x86_64")))]
extern crate winapi;
use winapi::*;
extern "system" {
// pub fn AbortDoc();
// pu... | // pub fn GetOutlineTextMetricsA();
// pub fn GetOutlineTextMetricsW();
// pub fn GetPaletteEntries(); |
<|file_name|>functionLiteralForOverloads.ts<|end_file_name|><|fim▁begin|>// basic uses of function literals with overloads
var f: {
(x: string): string;
<|fim▁hole|> (x: number): number;
} = (x) => x;
var f2: {
<T>(x: string): string;
<T>(x: number): number;
} = (x) => x;
var f3: {
<T>... | |
<|file_name|>fileCommands.ts<|end_file_name|><|fim▁begin|>/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*-----... | |
<|file_name|>codec.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python -OOOO
# vim: set fileencoding=utf8 shiftwidth=4 tabstop=4 textwidth=80 foldmethod=marker :
# Copyright (c) 2010, Kou Man Tong. All rights reserved.
# For licensing, see LICENSE file included in the package.
"""
Base codec functions for bson.
"""
impor... | return (base, name, value)
def encode_boolean_element(name, value):
return "\x08" + encode_cstring(name) + struct.pack("<b", value) |
<|file_name|>sub.rs<|end_file_name|><|fim▁begin|>#![feature(core)]
extern crate core;
#[cfg(test)]
mod tests {
use core::ops::Sub;
#[derive(Copy, Clone)]
struct A<T> {
value: T<|fim▁hole|> }
impl Sub for A<T> {
type Output = A<T>;
fn sub(self, rhs: A<T>) -> Self::Output {
A { value: self.... | |
<|file_name|>ja.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | tinyMCE.addI18n('ja.emojiau',{
desc:"au\u7d75\u6587\u5b57",
title:"au\u7d75\u6587\u5b57"
}); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.