prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>photoimport.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import logging
import os
import re
import sys
from io import BytesIO
from PIL import Image
from triptools import config, DB
from triptools.common import Trackpoint, tp_dist, distance, get_names
from triptools.exif_... | for filename in get_names(config.get("Photo", "name"), config.get("Photo", "mask")):
try: |
<|file_name|>fake_computeprojectmetadata.go<|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/licen... |
// Patch applies the patch and returns the patched computeProjectMetadata.
func (c *FakeComputeProjectMetadatas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ComputeProjectMetadata, err error) {
obj, err := c.Fake. |
<|file_name|>test_ldap_tls_livetest.py<|end_file_name|><|fim▁begin|># Copyright 2013 OpenStack Foundation
# Copyright 2013 IBM Corp.
#
# 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
#
# h... | |
<|file_name|>magiclink.py<|end_file_name|><|fim▁begin|>"""
Magic Link.
pymdownx.magiclink
An extension for Python Markdown.
Find http|ftp links and email address and turn them to actual links
MIT license.
Copyright (c) 2014 - 2017 Isaac Muse <isaacmuse@gmail.com>
Permission is hereby granted, free of charge, to any... | (?P<www>w{3}\.)[^_\W][-\w]*(?:\.[-\w.]+)+ # www.
) |
<|file_name|>CFZApplication.java<|end_file_name|><|fim▁begin|>package net.comfreeze.lib;
import android.app.AlarmManager;
import android.app.Application;
import android.app.NotificationManager;
import android.content.ComponentName;
import android.content.Context;
import android.content.SharedPreferences;
import androi... |
public static String hash(final String algorithm, final String s) {
try {
// Create specified hash |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
mod ast;
mod errors;
use std::{iter::Peekable, str::Chars};
pub use ast::{Docb... | in_progress_text: Option<SpanString>,
sections: Vec<DocblockSection>,
}
|
<|file_name|>Tuple20.java<|end_file_name|><|fim▁begin|>package org.sfm.tuples;
public class Tuple20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20> extends Tuple19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19> {
private final T20 e... | ", element16=" + getElement16() +
", element17=" + getElement17() +
", element18=" + getElement18() + |
<|file_name|>Francais.fr.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="fr_FR">
<context>
<name>CMS50Serial</name>
<message>
<location filename="../sleepyhead/oximetry.cpp" line="471"/>
<source>Processing...</source>
<tran... | |
<|file_name|>layout_image.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/. */
//! Infrastructure to initiate network requests for imag... |
let request = FetchRequestInit {
url: url, |
<|file_name|>sample.py<|end_file_name|><|fim▁begin|>################################################################################
# Copyright (C) 2012-2013 Leap Motion, Inc. All rights reserved. #
# Leap Motion proprietary and confidential. Not for distribution. #
# Use subject to the term... | def on_disconnect(self, controller):
# Note: not dispatched when running in a debugger. |
<|file_name|>tornado_server.py<|end_file_name|><|fim▁begin|>import os.path
import logging
_logger = logging.getLogger(__name__)
from operator import itemgetter
from tornado.web import Application, RequestHandler, StaticFileHandler
from tornado.ioloop import IOLoop
config = {
'DEBUG': True,
'PORT' : 5000
}
... | logging.basicConfig(level=(logging.DEBUG if config.get('DEBUG') else logging.INFO),
format="%(asctime)s: %(levelname)s %(name)s %(funcName)s %(lineno)d: %(message)s")
main() |
<|file_name|>AbstractConcordionFixture.java<|end_file_name|><|fim▁begin|>package info.pupcode.model.repo.test;
import org.junit.Before;
import org.springframework.context.support.ClassPathXmlApplicationContext;
/**
* Created by fabientronche1 on 08.11.15.<|fim▁hole|>public class AbstractConcordionFixture {
prot... | */ |
<|file_name|>AmazonLoadBalancersTag.tsx<|end_file_name|><|fim▁begin|>// This is all mercilessly copied from LoadBalancersTag.tsx. This should be clenaed up at some point
// Probably when we convert clusters view to React.
import * as React from 'react';
import * as ReactGA from 'react-ga';
import autoBindMethods from ... | </Tooltip>
)
} |
<|file_name|>ovh_ip_loadbalancing_backend.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# This file is part of Ansible
#
# Ansible 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 Li... | name = module.params.get('name') |
<|file_name|>voidptr.py<|end_file_name|><|fim▁begin|># Copyright Niall Douglas 2005.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
"""
>>> from voidptr_ext import *
Check for correct conversion
... | >>> try: use("")
... except TypeError: pass
... else: print 'expected a TypeError'
|
<|file_name|>test_dashboard_views_module_delete.py<|end_file_name|><|fim▁begin|>import pytest
from django.urls import reverse
from adhocracy4.modules.models import Module
from adhocracy4.test.helpers import redirect_target
@pytest.mark.django_db
def test_module_delete_perms(client, phase, user, user2):
module = ... | |
<|file_name|>fcgiclient_test.go<|end_file_name|><|fim▁begin|>package fcgiclient
import (
"bytes"
"crypto/md5"
"encoding/binary"
"fmt"
"io"
"io/ioutil"
"log"
"math/rand"
"net"
"net/http"
"net/http/fcgi"
"net/url"
"os"
"path/filepath"
"strconv"
"strings"
"testing"
"time"
)
// test fcgi protocol includ... | }
// close fo on exit and check for its returned error
defer func() { |
<|file_name|>mempool_persist.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# Copyright (c) 2014-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test mempool persistence.
By default, bit... |
mempooldat0 = os.path.join(self.nodes[0].datadir, 'regtest', 'mempool.dat')
mempooldat1 = os.path.join(self.nodes[1].datadir, 'regtest', 'mempool.dat') |
<|file_name|>TestComplexMath.py<|end_file_name|><|fim▁begin|>"""The WaveBlocks Project
Test the complex math functions.
@author: R. Bourquin
@copyright: Copyright (C) 2010, 2011 R. Bourquin
@license: Modified BSD License
"""
from numpy import *
from matplotlib.pyplot import *
from WaveBlocks.ComplexMath import *
fr... | plot(c, imag(y), "g-", label=r"$\Im y$")
plot(c, angle(y), "c-", label=r"$\arg y$")
plot(c, cont_angle(y), "m-", label=r"$\arg_c y$") |
<|file_name|>arbitrary_self_types_pin_lifetime_impl_trait.rs<|end_file_name|><|fim▁begin|>use std::pin::Pin;
struct Foo;
impl Foo {<|fim▁hole|>}
fn main() {
{ Pin::new(&Foo).f() };
}<|fim▁end|> | fn f(self: Pin<&Self>) -> impl Clone { self } //~ ERROR E0759 |
<|file_name|>settings.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
<|fim▁hole|>#############settings#############
NAME = "1" #GitStar用户名
PASSWORD = "1" #GitStar密码
GITNAME = "1" #GitHub用户名
GITPASSWORD = "1" #GitHub密码
#############settings#############<|fim▁end|> | |
<|file_name|>scheduler_class.py<|end_file_name|><|fim▁begin|>"""
MIT License
Copyright (c) 2017 cgalleguillosm, AlessioNetti
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 restric... | if not (blocked_idx is None):
# If there is no a reservation, calculate it for the blocked job
if not self._reserved_slot[0]:
blocked_job = queued_jobs[blocked_idx]
|
<|file_name|>test_checksum.py<|end_file_name|><|fim▁begin|>import pytest
import tempfile
import shutil
import os
import music_rename
from music_rename import checksum
@pytest.fixture()
def empty(request):
dir = tempfile.mkdtemp()
os.mknod(os.path.join(dir, 'empty.txt'))
def cleanup():
shutil.rmt... |
request.addfinalizer(cleanup) |
<|file_name|>PodcastDataResponse.java<|end_file_name|><|fim▁begin|><|fim▁hole|>
public class PodcastDataResponse extends ArrayList<Podcast> {
}<|fim▁end|> | package it.gvnn.slackcast.search;
import java.util.ArrayList; |
<|file_name|>ParallelAgent.py<|end_file_name|><|fim▁begin|>"""
Experimental agent implementation running separate threads for emulation and GPU training.
This is slightly (estimate ~20%) faster than the sequential implementation, but results might be different.
Copyright 2016 Rasmus Larsen
This software may be modifi... | for i in xrange(int(self.train_start)): # wait for replay memory to fill |
<|file_name|>gbb.py<|end_file_name|><|fim▁begin|># SPDX-License-Identifier: GPL-2.0+
# Copyright (c) 2018 Google, Inc
# Written by Simon Glass <sjg@chromium.org>
#
# Support for a Chromium OS Google Binary Block, used to record read-only
# information mostly used by firmware.
from collections import OrderedDict
from... |
Properties / Entry arguments:
- hardware-id: Hardware ID to use for this build (a string)
- keydir: Directory containing the public keys to use |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""Kraken Framework."""
import logging
import os
__all__ = ['core', 'helpers', 'plugins', 'ui']
krakenPath = os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..'))
if os.environ.get('KRAKEN_PATH', None) is None:
os.environ['KR... | |
<|file_name|>murmur3_native_128_86_le.js<|end_file_name|><|fim▁begin|>const murmur = require('murmurhash-native/stream')
<|fim▁hole|> endianness: 'LE'
})
}
module.exports = createHash<|fim▁end|> | function createHash () {
// algorithm, seed and endianness - do affect the results!
return murmur.createHash('murmurHash128x86', {
seed: 0, |
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>import random
from decimal import Decimal, ROUND_HALF_UP
from django.test import TestCase
from django.core.validators import ValidationError
from .models import *
def setup():
"""
Create dummy data
"""
Status.objects.create(
name="Hero",
... | """
Test balance is sum of payments minus sum of purchases
"""
setup() |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from app import db
import datetime
from geoalchemy2 import Geometry
from sqlalchemy.dialects import postgresql
from sqlalchemy.dialects.postgresql import UUID
from sqlalchemy import Column
import sqlalchemy
from slugify import slugify
from flask.ext.login import UserM... | nickname = db.Column(db.String)
social_id = db.Column(db.String, unique=True) |
<|file_name|>xinput.rs<|end_file_name|><|fim▁begin|>// Copyright © 2015, Peter Atashian
// Licensed under the MIT License <LICENSE.md>
//! XInput procedure declarations, constant definitions and macros
use shared::minwindef::{BYTE, WORD, DWORD};
use um::winnt::{WCHAR, SHORT};
pub const XINPUT_DEVTYPE_GAMEPAD: BYTE = 0... | pub const BATTERY_TYPE_DISCONNECTED: BYTE = 0x00; |
<|file_name|>Application.java<|end_file_name|><|fim▁begin|>package org.openstreetmap.osmaxil;
import org.apache.log4j.Logger;
import org.openstreetmap.osmaxil.flow.__AbstractImportFlow;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.support.ClassPathXmlApplicationContext;... | public static final String NAME = "Osmaxil";
private static ClassPathXmlApplicationContext applicationContext;
|
<|file_name|>pre_parse.rs<|end_file_name|><|fim▁begin|>use futures::{Stream, StreamExt, TryFutureExt};
use juniper::{
executor::{execute_validated_query_async, get_operation, resolve_validated_subscription},
graphql_object, graphql_subscription,
parser::parse_document_source,
validation::{validate_input... | #[derive(Clone)]
pub struct User; |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>/*
== run-info == (Matthias Drescher, 2016/2017)
This program shows the current cpu and memory load of the machine within a terminal UI.
Since it depends on linux-specific system files, it will only run on a linux machine.
*/
extern crate term;
extern crate clap;
use... | mem::swap(&mut cpuinfo_new, &mut cpuinfo_old);
cpuinfo_new = CPUInfo::new();
match cpuinfo_new.update() { |
<|file_name|>sysvipc.py<|end_file_name|><|fim▁begin|>## Copyright (C) 2007-2012 Red Hat, Inc., Bryn M. Reeves <bmr@redhat.com>
### This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version ... | ## GNU General Public License for more details.
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>#
# Copyright (C) 2014-2015
# Sean Poyser (seanpoyser@gmail.com)
#
# This Program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either versio... | |
<|file_name|>lmdtest.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
import os
import json
import base64
import psycopg2
pg_host = os.getenv('PGHOST', "172.17.0.1")
pg_user = os.getenv('PGUSER', "postgres")
pg_password = os.getenv('PGPASSWORD', "root")
pg_database = os.getenv('PGDATABASE', "db_s... | }, {
"table": "table_core_msisdns", |
<|file_name|>test.xpi.js<|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 strict";
var fs = require("fs");
var path = require("pa... |
describe("jpm xpi", function () {
beforeEach(utils.setup); |
<|file_name|>tile.rs<|end_file_name|><|fim▁begin|>use std::f64::{self, consts};
const EARTH_RADIUS: f64 = 6378137.0;
const PERIMETER: f64 = EARTH_RADIUS * 2. * consts::PI;
#[allow(dead_code)]
/**
* Turns WGS 84 coordinates into WebMercator
* tiles numbering
*/
pub fn lon_lat_to_tile(lon: f64, lat: f64, zoom: u32)... | }
}
|
<|file_name|>mysql.rs<|end_file_name|><|fim▁begin|>use crate::prelude::*;
#[cfg(feature = "db-diesel-mysql")]
mod diesel_mysql {
use super::*;
use ::diesel::{
deserialize::{self, FromSql},
mysql::Mysql,
serialize::{self, IsNull, Output, ToSql},
sql_types::Numeric,
};
use... | |
<|file_name|>v8_fuzz_config.py<|end_file_name|><|fim▁begin|># Copyright 2018 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json
import os
import random
THIS_DIR = os.path.dirname(os.path.abspath(__file__))
# L... | if self.rng.random() < p: |
<|file_name|>test_rfc6402.py<|end_file_name|><|fim▁begin|>#
# This file is part of pyasn1-modules software.
#
# Created by Russ Housley
# Copyright (c) 2019, Vigil Security, LLC
# License: http://snmplabs.com/pyasn1/license.html
#
import sys
import unittest
from pyasn1.codec.der.decoder import decode as der_decoder
fr... | |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>export * from './checkout-content.component';<|fim▁hole|>export * from './checkout-item.component';<|fim▁end|> | |
<|file_name|>wizard.py<|end_file_name|><|fim▁begin|>"""
FormWizard class -- implements a multi-page form, validating between each
step and storing the form's state as HTML hidden fields so that no state is
stored on the server side.
"""
import cPickle as pickle
from django import forms
from django.conf import setting... | |
<|file_name|>stats.py<|end_file_name|><|fim▁begin|># last modified 10.3.2009
class StatsError(Exception):
"""
Exception raised for errors resulting from collection
of statistical information about the grid.
Attributes:
expression -- input expression in which error occurred
message -- ... | """
def __init__(self, expression, message):
self.expression = expression
self.message = message |
<|file_name|>issue-3656.rs<|end_file_name|><|fim▁begin|>// run-pass
#![allow(dead_code)]
#![allow(improper_ctypes)]
// Issue #3656
// Incorrect struct size computation in the FFI, because of not taking
// the alignment of elements into account.
// pretty-expanded FIXME #23616
// ignore-wasm32-bare no libc to test with... |
pub struct KEYGEN { |
<|file_name|>parser.py<|end_file_name|><|fim▁begin|>#
# -*- coding: utf-8 -*-
#
# pyllage
#
# Copyright (C) 2013 barisumog at gmail.com
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either v... | |
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>import datetime
import logging
from unittest.mock import patch
from django.test import TestCase
from django.test.utils import override_settings
from konfera import models
from payments import utils
from payments.models import ProcessedTransaction
def make_payment(n... | |
<|file_name|>linkage2.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licens... | } |
<|file_name|>RodaAros.java<|end_file_name|><|fim▁begin|>package Aula_4.Carro;
import java.awt.Graphics2D;
public class RodaAros extends Roda {
int n;
public RodaAros(int n, int raio, int xi, int yi) {
super(raio, xi, yi, 0);
this.n = n;
}
/*public RodaAros(int xi, int yi) {
super(17, xi, y... | } |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template import RequestContext
from oauth_access.access import OAuthAccess
from oauth_access.exceptions import MissingToken
def oauth_login(request, service,
... | return access.callback.finish_signup(request, service) |
<|file_name|>recipe-541082.py<|end_file_name|><|fim▁begin|>def urepr(x):
import re, unicodedata
def toname(m):
try:
return r"\N{%s}" % unicodedata.name(unichr(int(m.group(1), 16)))<|fim▁hole|>
return re.sub(
r"\\[xu]((?<=x)[0-9a-f]{2}|(?<=u)[0-9a-f]{4})",
toname,
... | except ValueError:
return m.group(0) |
<|file_name|>difflib_closest_match.py<|end_file_name|><|fim▁begin|>import difflib
class Repository:
def __init__(self, fname=None):
if not fname:
fname = '/usr/share/dict/words'
with open(fname) as f:
self.repository = [x.rstrip('\n') for x in f.readlines()]
... | if len(w.split()) != 1:
sys.exit('please enter a word only')
try: |
<|file_name|>fields.py<|end_file_name|><|fim▁begin|>from django.conf import settings
from django import forms
from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext_lazy as _
from captcha_registration.recaptcha.widgets import ReCaptcha
from captcha_registration.recaptcha.client i... | |
<|file_name|>NZBClient.py<|end_file_name|><|fim▁begin|>import sys, os, urllib, time, socket, mt, ssl
from dlmanager.NZB import NZBParser
from dlmanager.NZB.nntplib2 import NNTP_SSL,NNTPError,NNTP, NNTPReplyError
from dlmanager.NZB.Decoder import ArticleDecoder
class StatusReport(object):
def __init__(self):
... | # empty the cache of any files.
def clearCache(self):
mt.utils.rmdir(self.cache_path) |
<|file_name|>nbbase.py<|end_file_name|><|fim▁begin|>"""Python API for composing notebook elements
The Python representation of a notebook is a nested structure of
dictionary subclasses that support attribute access
(IPython.utils.ipstruct.Struct). The functions in this module are merely
helpers to build the structs in... | cell.update(from_dict(kwargs))
validate(cell, 'raw_cell') |
<|file_name|>test_kdtree.py<|end_file_name|><|fim▁begin|># Copyright Anne M. Archibald 2008
# Released under the scipy license
from __future__ import division, print_function, absolute_import
from numpy.testing import (assert_equal, assert_array_equal,
assert_almost_equal, assert_array_almost_equal, assert_, run_... |
class test_small_nonleaf_compiled(test_small):
def setUp(self): |
<|file_name|>file_ops.py<|end_file_name|><|fim▁begin|># Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
import os
import logging
logger = logging.getLogger(__name__)
def create_directory(path):
"""
Creates a directory if it doesn't already exist.
... | |
<|file_name|>error.rs<|end_file_name|><|fim▁begin|>use std::io;
use std::str::Utf8Error;
use sdl2::IntegerOrSdlError;
use sdl2::video::WindowBuildError;
use core_compat;
#[derive(Debug)]
pub enum Error {
SpriteLoad,
MapLoad,
Rm(core_compat::error::Error),
Io(io::Error),
Utf8(Utf8Err... | Str(String),
WindowBuildError,
IntegerOrSdlError,
|
<|file_name|>load.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from itertools import groupby
from time import time
from functools import partial
import re
import django
django.setup()
from django.db import transaction
from clldutils.dsv import reader
from clldutils.text imp... | |
<|file_name|>OnlController.java<|end_file_name|><|fim▁begin|>package controller;
import java.io.IOException;
import java.sql.Time;
import java.util.Calendar;
import java.util.List;
import java.util.TimeZone;
import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.annotati... | MessageProperties.getData("ERR13")); |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>use std::io::Read;
use std::fs::File;
fn part_1(input: &String) {
let total = input.lines()
.map(|l| l
.trim()
.split_whitespace()
.map(|v| v.parse::<i32>().unwrap())
.collect::<Vec<_>>())
.filter(|v| ... | |
<|file_name|>filesearch.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org... | }
loop { |
<|file_name|>test_event.py<|end_file_name|><|fim▁begin|># Copyright © 2016 Lars Peter Søndergaard <lps@chireiden.net>
# Copyright © 2016 FichteFoll <fichtefoll2@googlemail.com>
#
# This file is part of Shanghai, an asynchronous multi-server IRC bot.
#
# Shanghai is free software: you can redistribute it and/or modify... | assert called == 2 |
<|file_name|>guildMemberAdd.js<|end_file_name|><|fim▁begin|>const Log = require("../util/log.js");
const common = require("../util/common.js");
const setting_global = require("../settings.json");
const setting_color = setting_global.commands.user.guilds.color;
const setting_mute = setting_global.commands.admin.mute;
co... | |
<|file_name|>let-else-bool-binop-init.rs<|end_file_name|><|fim▁begin|>// run-rustfix<|fim▁hole|>#![feature(let_else)]
fn main() {
let true = true && false else { return }; //~ ERROR a `&&` expression cannot be directly assigned in `let...else`
let true = true || false else { return }; //~ ERROR a `||` expressi... | |
<|file_name|>prestart.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3<|fim▁hole|>
def pull_ncapture():
d_client = docker.from_env()
d_client.images.pull('cyberreboot/vent-ncapture', tag='master')
if __name__ == '__main__': # pragma: no cover
pull_ncapture()<|fim▁end|> | import docker
|
<|file_name|>IBitmapDrawable.java<|end_file_name|><|fim▁begin|>package com.greenlemonmobile.app.ebook.books.imagezoom.graphics;
import android.graphics.Bitmap;
/**
* Base interface used in the {@link ImageViewTouchBase} view
* @author alessandro
*
*/
public interface IBitmapDrawable {
<|fim▁hole|><|fim▁end|> | Bitmap getBitmap();
} |
<|file_name|>CommandReadMainBatteryVoltage.java<|end_file_name|><|fim▁begin|>/*
* The MIT License
*
* Copyright 2014 Jon Arney, Ensor Robotics.
*
* 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... | */
class CommandReadMainBatteryVoltage extends CommandReadBatteryVoltage {
protected CommandReadMainBatteryVoltage(RoboClaw aRoboClaw) { |
<|file_name|>BenchmarkConvolve.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2011-2015, Peter Abeles. All Rights Reserved.
*
* This file is part of BoofCV (http://boofcv.org).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the Licen... | public int timeConvolve2D_Std_I8_I8_DIV(int reps) {
for( int i = 0; i < reps; i++ )
ConvolveImageStandard.convolve(kernel2D_I32, input_U8, out_U8,10);
return 0; |
<|file_name|>reset.component.ts<|end_file_name|><|fim▁begin|>import { Component, ViewEncapsulation } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';
import { FormGroup, AbstractControl, FormBuilder, Validators } from '@angular/forms';
import { AppBase } from './../../../../app.base'
imp... | |
<|file_name|>Range.py<|end_file_name|><|fim▁begin|>import math
import json
import os
import pytest
import rti_python.ADCP.AdcpCommands
def calculate_predicted_range(**kwargs):
"""
:param SystemFrequency=: System frequency for this configuration.
:param CWPON=: Flag if Water Profile is turned on.
:para... | :param _CBTON_: Flag if Bottom Track is turned on. |
<|file_name|>s2n_test_scenario.py<|end_file_name|><|fim▁begin|>##
# Copyright Amazon.com, Inc. or its affiliates. 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.
# A copy of the License is located at
#
# http://... | TLS13 = 34
class Mode(Enum): |
<|file_name|>HtmlReport.java<|end_file_name|><|fim▁begin|>/**
* Copyright (c) 2008 Pyxis Technologies inc.
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or<|fim... | * (at your option) any later version. |
<|file_name|>develop.py<|end_file_name|><|fim▁begin|>from .common import * # noqa<|fim▁hole|><|fim▁end|> |
LANGUAGE_CODE = 'nb' |
<|file_name|>main.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public L... | static int get_legal_text(FileBuff &fbuf, char **legal_text); // Get pointer to legal text |
<|file_name|>ext-lang-sk.js<|end_file_name|><|fim▁begin|>/*
This file is part of Ext JS 3.4
Copyright (c) 2011-2013 Sencha Inc
Contact: http://www.sencha.com/contact
GNU General Public License Usage
This file may be used under the terms of the GNU General Public License version 3.0 as
published by the Free Software... | |
<|file_name|>pci.py<|end_file_name|><|fim▁begin|># Copyright 2013 Intel Corporation
# 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.apac... |
@wsgi.extends
def show(self, req, resp_obj, id): |
<|file_name|>get_data.py<|end_file_name|><|fim▁begin|>from pymacy.db import get_db
from bson.json_util import dumps
db = get_db()
results = []
count = 0
for i in db.benchmark.find({"element": "Ni"}):
count += 1
if count > 100:
break
results.append(i)
print(results[0])
with open("Ni.json", 'w') as ... | file = dumps(results)
f.write(file) |
<|file_name|>entry_point.py<|end_file_name|><|fim▁begin|>from rpython.rlib import jit<|fim▁hole|>import interpret
import parse
import kernel_type as kt
def entry_point(argv):
jit.set_param(None, "trace_limit", 20000)
interpret.run(argv)
return 0
def target(driver, args):
return entry_point, None<|fim▁... | |
<|file_name|>send_specific_registration_data_to_share.py<|end_file_name|><|fim▁begin|>""" Sends specified registrations to SHARE """
import argparse
import json
import logging
import django
django.setup()
from osf.models import AbstractNode
from scripts import utils as script_utils
from website import settings
from we... | |
<|file_name|>app.js<|end_file_name|><|fim▁begin|>import React, { Component } from 'react';
import InputBar from "../containers/input_bar";
import PriceList from "../containers/price_list";
import StateTax from "../containers/state_tax";
import TipPercent from "../containers/tip_percent";
import FinalAmount from "../con... | <div className="row">
<PriceList />
<StateTax /> |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# vim: set filetype=python expandtab tabstop=4 shiftwidth=4 autoindent smartindent:
#from distutils.core import setup
import os
import logging
import setuptools
import distutils.cmd
import subprocess
# TODO add check to make sure required libs ar... | def __init__(self, dist=None): |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
# Register your models here.
admin.site.register(Question)<|fim▁end|> | from django.contrib import admin
from .models import Question |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>var height = window.innerHeight;
// console.log(height);
var main = document.getElementById('main');
var btn = document.getElementById("btn");
main.style.height = height + 'px';
btn.style.top = (height-90) + 'px';
document.getElementById('usr_name').onkeydown = functio... | //alert("登录成功"); |
<|file_name|>base.rs<|end_file_name|><|fim▁begin|>use indexmap::IndexMap;
use crate::{
ast::{Directive, FromInputValue, InputValue, Selection},
executor::{ExecutionResult, Executor, Registry, Variables},
parser::Spanning,
schema::meta::{Argument, MetaType},
value::{DefaultScalarValue, Object, Scala... | /// }
/// } |
<|file_name|>test_ce_is_is_instance.py<|end_file_name|><|fim▁begin|># (c) 2019 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible 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 ... | self.mock_set_config.stop()
self.mock_get_config.stop() |
<|file_name|>ssl.rs<|end_file_name|><|fim▁begin|>// #![feature(plugin)]
// #![plugin(clippy)]
extern crate cassandra_sys;
use std::mem;
use std::io::Result as IoResult;
use std::io::Read;
use std::fs::File;
use cassandra_sys::*;
use std::ffi::CString;
fn load_trusted_cert_file(file: &str, ssl: &mut CassSsl) -> IoRes... |
let mut keyspace_name = mem::zeroed();
let mut keyspace_name_length = mem::zeroed(); |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>// DO NOT EDIT !
// This file was generated automatically from 'src/mako/cli/main.rs.mako'
// DO NOT EDIT !
#![allow(unused_variables, unused_imports, dead_code, unused_mut)]
#[macro_use]
extern crate clap;
extern crate yup_oauth2 as oauth2;
extern crate yup_hyper_mock... | (Some(r##"out"##),
Some(r##"o"##), |
<|file_name|>error.rs<|end_file_name|><|fim▁begin|>use actix_web::error::ResponseError;
use snafu::{Backtrace, Snafu};
use crate::{db, github};
#[derive(Debug, Snafu)]
#[snafu(visibility = "pub(crate)")]
pub enum ShaftError {
#[snafu(display("{}", source))]
DatabaseError {
source: db::DatabaseError,<|... | backtrace: Backtrace,
},
#[snafu(display("{}", source))] |
<|file_name|>test_float.py<|end_file_name|><|fim▁begin|>from .. utils import TranspileTestCase, UnaryOperationTestCase, BinaryOperationTestCase, InplaceOperationTestCase
class FloatTests(TranspileTestCase):
def test_setattr(self):
self.assertCodeExecution("""
x = 3.14159
try:
... | 'test_ne_class',
'test_ne_frozenset',
|
<|file_name|>MainWindow.cpp<|end_file_name|><|fim▁begin|>#include <QtCore/QElapsedTimer>
#include <QtGui/QFileDialog>
#include <QtGui/QMessageBox>
#include <QtGui/QInputDialog>
#include <QtGui/QColorDialog>
#include <QtGui/QMdiSubWindow>
#include "MainWindow.h"
QtMainWindow::QtMainWindow(QApplication* app)... | |
<|file_name|>test_harvest_utils.py<|end_file_name|><|fim▁begin|>import nose
import ckanext.dcatapit.harvesters.utils as utils
eq_ = nose.tools.eq_
ok_ = nose.tools.ok_
csw_harvester_config = {
'dataset_themes': 'OP_DATPRO',
'dataset_places': 'ITA_BZO',<|fim▁hole|> 'agents': {
'publisher': {
... | 'dataset_languages': '{ITA,DEU}',
'frequency': 'UNKNOWN', |
<|file_name|>ref.py<|end_file_name|><|fim▁begin|>energies = dict()
energies[81] = -3.17 # Ammoniadimer.xyz
energies[82] = -5.02 # Waterdimer.xyz
energies[83] = -1.50 # BenzeneMethanecomplex.xyz
energies[84] = -18.61 # Formicaciddimer.xyz
energies[85] = -15.96 # Formamidedimer.xyz
energies[86] =... | names[90] = "Ethenedimer.xyz"
names[91] = "Benzenedimerparalleldisplaced.xyz"
names[92] = "Pyrazinedimer.xyz" |
<|file_name|>uniq-self-in-mut-slot.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.apac... | // pretty-expanded FIXME #23616
#![allow(unknown_features)]
#![feature(box_syntax)] |
<|file_name|>test_logging.py<|end_file_name|><|fim▁begin|>import logging
from django.template import Context, Engine, Variable, VariableDoesNotExist
from django.test import SimpleTestCase, ignore_warnings
from django.utils.deprecation import RemovedInDjango21Warning
class TestHandler(logging.Handler):
def __init... | return "template_name"
|
<|file_name|>brief_forms.py<|end_file_name|><|fim▁begin|>from wtforms import IntegerField, SelectMultipleField
from wtforms.validators import NumberRange
from dmutils.forms import DmForm
import flask_featureflags
class BriefSearchForm(DmForm):
page = IntegerField(default=1, validators=(NumberRange(min=1),))
s... | |
<|file_name|>strings.js<|end_file_name|><|fim▁begin|>///////////////////////////////////////////////////////////////////////////
// Copyright © Esri. 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.<|fim▁hole|>/... | // You may obtain a copy of the License at |
<|file_name|>PliExtraInfo.py<|end_file_name|><|fim▁begin|># shamelessly copied from pliExpertInfo (Vali, Mirakels, Littlesat)
from enigma import iServiceInformation, iPlayableService
from Components.Converter.Converter import Converter
from Components.Element import cached
from Components.config import config
from Too... | if info.getInfo(iServiceInformation.sIsCrypted) == 1:
data = self.ecmdata.getEcmData() |
<|file_name|>HomeScreen.tsx<|end_file_name|><|fim▁begin|>import React from 'react';
import { connect } from 'react-redux';
import { View, Text, FlatList } from 'react-native';
import sb from 'react-native-style-block';
import dateHelper from '@shared/utils/date-helper';
import appConfig from '../config.app';
import Con... | }
class HomeScreen extends React.Component<Props> {
state = {
isRefreshing: false, |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.