prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>pub mod types;
pub mod utils;
pub mod connection;
pub mod init;
use futures::{
Future,
Stream,
Sink
};
use futures::sync::mpsc::UnboundedSender;
use futures::sync::oneshot::{
Sender as OneshotSender,
channel as oneshot_channel
};
use crate::utils as client_ut... | } |
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Package'
db.create_table('banzai_p... | 'status': ('django.db.models.fields.CharField', [], {'max_length': '4', 'blank': 'True'}) |
<|file_name|>generatePgData.ts<|end_file_name|><|fim▁begin|>import * as faker from 'faker'
import { Client } from 'pg'
const numberOfPersons = 200
const numberOfProducts = 100
const client = new Client({
database: 'captain_sql_test',
})
function randomNumber(max, from?) {
return Math.floor(Math.random() * ma... | |
<|file_name|>payment_mode.ts<|end_file_name|><|fim▁begin|>export class PaymentMode {
id: number;
name: string;
description: string;<|fim▁hole|> live_mode?: boolean;
}<|fim▁end|> | method_type: string;
code: string;
active?: boolean; |
<|file_name|>test_smtsolver.py<|end_file_name|><|fim▁begin|># Copyright (c) 2014, Fundacion Dr. Manuel Sadosky
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code m... | |
<|file_name|>JdbcCheckpointSpiCustomConfigSelfTest.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.<|fim▁hole|> * (the... | * The ASF licenses this file to You under the Apache License, Version 2.0 |
<|file_name|>app.js<|end_file_name|><|fim▁begin|>var win = Ti.UI.createWindow({
backgroundColor:'white'
});
win.open();
var GA = require('analytics.google');
//GA.optOut = true;
GA.debug = true;
GA.trackUncaughtExceptions = true;
var tracker = GA.getTracker("UA-XXXXXX-X");
tracker.trackEvent({
category: "category",... | transaction.addItem({
sku: "ABC123",
name: "My Alphabet",
category: "product category", |
<|file_name|>base64_ops_test.py<|end_file_name|><|fim▁begin|># Copyright 2016 The TensorFlow 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 on an "AS IS" BA... | # 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|>CommitmentProtocolImpl.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
"FreePastry" Peer-to-Peer Application Development Substrate
Copyright 2002-2007, Rice University. Copyright 2006-2007, Max Planck Institute
for Software Systems. All... | int nextReceiveCacheEntry;
int signatureSizeBytes;
int hashSizeBytes; |
<|file_name|>common.py<|end_file_name|><|fim▁begin|>from contextlib import contextmanager
from fnmatch import fnmatch
import stat
from pyrsistent import pset
import attr
from filesystems import Path, exceptions
def _realpath(fs, path, seen=pset()):
"""
.. warning::
The ``os.path`` module's realpath... | def _set_contents(fs, path, contents, mode): |
<|file_name|>lexical-scope-in-unique-closure.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// ... | |
<|file_name|>kapow_it.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="it" sourcelanguage="en">
<context>
<name>LocaleDialog</name>
<message>
<source>Select application language:</source>
<translation>Seleziona la lingua dell'a... | </message>
<message> |
<|file_name|>scan_dihedral.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import sys
import string
import subprocess
#----------------------------------------------------------------------
# Define some handy functions
#----------------------------------------------------------------------
def get_contents(fil... | |
<|file_name|>extractors.ts<|end_file_name|><|fim▁begin|>import { BaseNumberExtractor, RegExpValue, BasePercentageExtractor } from "../extractors";
import { Constants } from "../constants";
import { LongFormatType } from "../models";
import { ChineseNumeric } from "../../resources/chineseNumeric";
import { RegExpUtility... |
let regexes = new Array<RegExpValue>( |
<|file_name|>challenges_test.py<|end_file_name|><|fim▁begin|>"""Tests for acme.challenges."""
import unittest
import mock
import OpenSSL
import requests
from six.moves.urllib import parse as urllib_parse # pylint: disable=import-error
from acme import errors
from acme import jose
from acme import test_util
CERT =... | from acme.challenges import HTTP01Response
self.msg = HTTP01Response(key_authorization=u'foo')
self.jmsg = {
'resource': 'challenge', |
<|file_name|>0007_auto_20150408_1402.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('viewer', '0006_meter_on_auditlist'),
]
operations = [
m... | new_name='kw', |
<|file_name|>EntryPointNode.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2007 JBoss 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/LICE... | * The handle of the fact to retract. |
<|file_name|>TweetCoordinates.java<|end_file_name|><|fim▁begin|>package smash.data.tweets.pojo;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
/**
* @author Yikai Gong
*/
public class TweetCoordinates implements Serializable {
private String type;
/... |
public void setCoordinates(List<BigDecimal> coordinates) {
this.coordinates = coordinates;
} |
<|file_name|>failure.py<|end_file_name|><|fim▁begin|># Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from tracing.mre import job as job_module
class Failure(object):
def __init__(self, job, function_h... | assert isinstance(job, job_module.Job)
self.job = job
self.function_handle_string = function_handle_string |
<|file_name|>BaseStudy.py<|end_file_name|><|fim▁begin|>from PyQt4 import QtCore
from PyQt4 import QtGui
from Action import Speech
from UI.ActionPushButton import ActionPushButton
class BaseStudy(QtGui.QWidget):
def __init__(self):
super(BaseStudy, self).__init__()
self._actionQueue = None
... | self._grpSpeech = QtGui.QGroupBox(wgtGeneral) |
<|file_name|>friend_request.js<|end_file_name|><|fim▁begin|>OW_FriendRequest = function( itemKey, params )
{
var listLoaded = false;
var model = OW.Console.getData(itemKey);
var list = OW.Console.getItem(itemKey);
var counter = new OW_DataModel();
counter.addObserver(this);
this.onDataChange ... | {
if ( res && res.script )
{ |
<|file_name|>tool_palette.rs<|end_file_name|><|fim▁begin|>// This file is part of rgtk.
//
// rgtk 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 3 of the License, or
// (at your optio... | |
<|file_name|>DialogAdd.py<|end_file_name|><|fim▁begin|># dialog_add.py.in - dialog to add a new repository
#
# Copyright (c) 2004-2005 Canonical
# 2005 Michiel Sikkes
#
# Authors:
# Michael Vogt <mvo@debian.org><|fim▁hole|>#
# This program is free software; you can redistribute ... | # Michiel Sikkes <michiels@gnome.org>
# Sebastian Heinlein <glatzor@ubuntu.com> |
<|file_name|>default_storage_factory_builder.go<|end_file_name|><|fim▁begin|>/*
Copyright 2016 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/lice... | servers := strings.Split(tokens[1], ";")
storageFactory.SetEtcdLocation(groupResource, servers)
}
if len(c.EncryptionProviderConfigFilepath) != 0 { |
<|file_name|>JsonResponse.java<|end_file_name|><|fim▁begin|>package com.cf.tradeprocessor.web.rest.response;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
public class JsonResponse {
private Boolean success;
@JsonInclude(Include.NON_NULL)
private ... | this.success = success;
this.result = result; |
<|file_name|>tasks.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
from celery import shared_task
import praw
from .commonTasks import *
from .models import Redditor, RedditorStatus, Status
@shared_task
def test(param):
return 'The test task executed with argument "%s" ' % param
@shared... | update_user_status(redditor, 30)
|
<|file_name|>main.cpp<|end_file_name|><|fim▁begin|>// MIT License
//
// Copyright( c ) 2017 Packt
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files( the "Software" ), to deal
// in the Software without restriction, including without... | return false;
} |
<|file_name|>logging_v2_generated_config_service_v2_delete_sink_sync.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# 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 L... | )
|
<|file_name|>MainModule.java<|end_file_name|><|fim▁begin|>package com.kata.businessrules;
import org.w3c.dom.Document;
import com.google.inject.AbstractModule;
import com.google.inject.TypeLiteral;
import com.kata.businessrules.products.Product;
public class MainModule extends AbstractModule {
@Override
protected... | bind(ReceiptGenerator.class).toInstance(new ReceiptGenerator() {
@Override |
<|file_name|>adder.js<|end_file_name|><|fim▁begin|>var app = angular.module('app',[]);
app.controller('adderController', function($scope) {
$scope.firstNumber = 2;
$scope.secondNumber = 2;
$scope.lvalue = 2+2;
$scope.thirdNumber = function () {
if (!$scope.firstNumber || !$scope.secondNumber) {
return $scope.... | return $scope.lvalue;
}
};
}); |
<|file_name|>test_ghost_check_dao.py<|end_file_name|><|fim▁begin|>from datetime import datetime, timedelta
from rdr_service.dao.ghost_check_dao import GhostCheckDao
from tests.helpers.unittest_base import BaseTestCase
class GhostCheckDaoTest(BaseTestCase):
def test_loads_only_vibrent(self):
"""We might a... |
participants = GhostCheckDao.get_participants_needing_checked( |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>pub struct PascalsTriangle {
rows: Vec<Vec<u32>>
}
impl PascalsTriangle {
fn next_row(current_row: &Vec<u32>) -> Vec<u32> {
let mut row1 = current_row.clone();
let mut row2 = current_row.clone();
row1.push(0);
row1.reverse();
... | } |
<|file_name|>eval-enum.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/licen... | |
<|file_name|>stage_2.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# File written by pyctools-editor. Do not edit.
import argparse
import logging
from pyctools.core.compound import Compound
import pyctools.components.arithmetic
import pyctools.components.qt.qtdisplay
import pyctools.components.zone.zoneplatege... | class Network(object):
components = \
{ 'clipper': { 'class': 'pyctools.components.arithmetic.Arithmetic', |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>pub const TEST_HOST: &'static str = "localhost:23432";<|fim▁end|> | pub mod long_tests_pb;
pub mod long_tests_pb_grpc;
|
<|file_name|>timestamp.js<|end_file_name|><|fim▁begin|>'use strict';
// src\services\message\hooks\timestamp.js
//
// Use this hook to manipulate incoming or outgoing data.
// For more information on hooks see: http://docs.feathersjs.com/hooks/readme.html
const defaults = {};
module.exports = function(options) {
op... | createdBy: usr._id,
createdAt: Date.now()
} |
<|file_name|>terminal.rs<|end_file_name|><|fim▁begin|>use std::ops::{Index, IndexMut};
use std::io::prelude::*;
use std::fs::OpenOptions;
use std::fs::File;
use std::os::unix::io::{AsRawFd, RawFd};
use std::sync::atomic::{AtomicBool, Ordering, ATOMIC_BOOL_INIT};
use std::collections::VecDeque;
use nix::sys::termios;
u... | driver: Driver,
backbuffer: CellBuffer, // Internal backbuffer.
frontbuffer: CellBuffer, // Internal frontbuffer.
outbuffer: OutBuffer, // Internal output buffer. |
<|file_name|>incoming_calls.py<|end_file_name|><|fim▁begin|><|fim▁hole|># -*- coding: utf-8 -*-
import logging
from pprint import pformat
from time import clock, sleep
try:
import unittest2 as unittest
except ImportError:
import unittest
import config
from event_stack import TimeOutReach... | |
<|file_name|>Repository.ts<|end_file_name|><|fim▁begin|>export class Repository {
constructor(owner: string, repo: string) {
this.owner = owner;
this.name = repo;
}
readonly owner : string;
readonly name : string;
toString() : string {
return `${this.owner}/${this.name}`;
... | if (parts.length != 2) {
throw new Error(`Can't parse ${s} to repo`); |
<|file_name|>cafferun.py<|end_file_name|><|fim▁begin|>import numpy as np
import cPickle
import math
import string
import re
import subprocess
from datetime import datetime
from cwsm.performance import Performance
def cafferun(params):
# load general and optimization parameters
with open('../tmp/optparams.pkl'... | optimize = genparams['optimize']
|
<|file_name|>file_map.py<|end_file_name|><|fim▁begin|>import os
import re
from amlib import conf, utils, log
'''
Functions for parsing AD automount maps into a common dict format.
Part of ampush. https://github.com/sfu-rcg/ampush
Copyright (C) 2016 Research Computing Group, Simon Fraser University.
'''
# ff = flat fi... |
{'yuv': {'options': '-intr,bg,tcp,vers=4',
'server_dir': '/yuv', |
<|file_name|>CreateDevicePoolRequestProtocolMarshaller.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2017-2022 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... | @SdkInternalApi
public class CreateDevicePoolRequestProtocolMarshaller implements Marshaller<Request<CreateDevicePoolRequest>, CreateDevicePoolRequest> {
|
<|file_name|>cognitiveServicesSearch.js<|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.<|fim▁hole|>
exports.EntitySearchAPI = require('./entitySearch/entitySearchAPI');
exports... | */
'use strict'; |
<|file_name|>test_survey.py<|end_file_name|><|fim▁begin|>from datetime import date
from django.core.validators import URLValidator
from django.utils.timezone import now
from survey.tests.models import BaseModelTest
class TestSurvey(BaseModelTest):
def test_unicode(self):
"""Unicode generation."""
... | def test_expiration_date_is_in_future(self):
"""by default the expiration should be a week in the future"""
self.assertGreater(self.survey.expire_date, now())
|
<|file_name|>15.5.4.20-1-2.js<|end_file_name|><|fim▁begin|><|fim▁hole|>/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
/// that the following conditions are met:
/// * Redistributions of source code must retain the above copyright notice, this list of cond... | /// Copyright (c) 2009 Microsoft Corporation
/// |
<|file_name|>spherical-portal-link.js<|end_file_name|><|fim▁begin|>import Constants from '../constants';
import LinkDrawable from './link';
import SphericalPortalLinkMesh from '../mesh/spherical-portal-link';
/**
* Represents a portal link that follows the surface of a sphere.
*
* Hooray for custom shaders, etc!
... | |
<|file_name|>ComponentsGridItem.tsx<|end_file_name|><|fim▁begin|>import React, { memo, useCallback, MouseEvent } from 'react'
import { Link } from 'gatsby'
import styled, { useTheme } from 'styled-components'
import media from '../../../theming/mediaQueries'
import { ChartNavData } from '../../../types'
export const C... | `} |
<|file_name|>common.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import os
SECRET_KEY = os.environ["SECRET_KEY"]
LANGUAGES = {"en": "English", "es": "Español"}
BABEL_TRANSLATION_DIRECTORIES = "translations"
HASHEDASSETS_CATALOG = "/srv/www/hashedassets.yml"
HASHEDASSETS_SRC_DIR = "static/build"
HASHEDA... | |
<|file_name|>Complex.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from gi.overrides.keysyms import musicalflat
from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.GLUT import *
from PIL import Image
from pygame.mixer import music
class BancoReserva:
def __init__(self):
self.textura1 = ... | glNewList(self.obj,GL_COMPILE)
glPushMatrix()
glTranslatef(10, -.15, 5) |
<|file_name|>special_tests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# special_tests.py: testing special and reserved file handling
#
# Subversion is a tool for revision control.
# See http://subversion.tigris.org for more information.
#
# ==============================================================... | expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
expected_status.add({ |
<|file_name|>Textarea.story.js<|end_file_name|><|fim▁begin|>/**
* @flow
*/
import React from 'react';
import {storiesOf} from '@kadira/storybook';
import Textarea from './Textarea';
storiesOf('<Textarea />', module)
.add('Default state', () => <Textarea />)
.add('Error state', () => <Textarea error />)
.add('... | .add('No border variant', () => <Textarea noBorder />); |
<|file_name|>trie.go<|end_file_name|><|fim▁begin|>// Copyright 2014 The go-krypton Authors
// This file is part of the go-krypton library.
//
// The go-krypton 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 Softw... | |
<|file_name|>picPage.java<|end_file_name|><|fim▁begin|>package com.rootulp.rootulpjsona;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.AsyncTask;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.util.Log;... | this.bmImage = bmImage;
}
protected Bitmap doInBackground(String... urls) { |
<|file_name|>helpers.py<|end_file_name|><|fim▁begin|># Copyright (C) 2015-2020 Nikos Roussos <nikos@roussos.cc>.
# This file is part of Monopati - https://github.com/comzeradd/monopati
# Monopati is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published... | chdir(cfg['output'])
with socketserver.TCPServer(('', port), Handler) as httpd:
print('Serving at http://localhost:{0}'.format(port)) |
<|file_name|>env.py<|end_file_name|><|fim▁begin|>from __future__ import with_statement
import os
import sys
from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig
# We need to go back a dir to get the config.
_this_dir = os.path.dirname((os.path.abspath(__file... | fileConfig(config.config_file_name)
# add your model's MetaData object here |
<|file_name|>test_category_group.py<|end_file_name|><|fim▁begin|>import unittest
import numpy
from deltaphi.category_info import RawCategoryInfo, CategoryGroup, CategoryInfoFactory
from deltaphi.fake_entities import FakeCategoryInfo
__author__ = 'Emanuele Tamponi'
class TestCategoryGroup(unittest.TestCase):
d... | |
<|file_name|>configgit.py<|end_file_name|><|fim▁begin|>import unittest, tempfile, os.path
from gitdh.config import Config
from gitdh.git import Git
from subprocess import check_output
class GitdhConfigGitTestCase(unittest.TestCase):
def setUp(self):
self.cStr = """
[Git]
RepositoryPath = /var/lib/gitolite/reposito... | self.assertEqual(c.repoPath, d.name) |
<|file_name|>DelayedDataCheckConfigTests.java<|end_file_name|><|fim▁begin|>/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2... | import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.test.AbstractSerializingTestCase;
import java.io.IOException; |
<|file_name|>copy.go<|end_file_name|><|fim▁begin|>package container
import (
"io"
"os"
"path/filepath"
"golang.org/x/net/context"
log "github.com/Sirupsen/logrus"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/strslice"
"github.com/docker/docker/pkg/archive"
"github.com/docker/dock... | |
<|file_name|>compile_test.py<|end_file_name|><|fim▁begin|>'''
compile_test.py - check pyximport functionality with pysam
==========================================================
test script for checking if compilation against
pysam and tabix works.
'''
# clean up previous compilation
import os
import unittest
impor... | |
<|file_name|>sha1-hmac.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Auth-SHA1/HMAC
~~~~~~~~~~~~~~
Securing an Eve-powered API with Basic Authentication (RFC2617).
This script assumes that user accounts are stored in a MongoDB collection
('accounts'), and that passwords are stored a... |
from eve import Eve
from eve.auth import BasicAuth
from werkzeug.security import check_password_hash |
<|file_name|>0002_bookinstance_borrower.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-05-10 09:46
from __future__ import unicode_literals
<|fim▁hole|>
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODE... | from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
|
<|file_name|>Twist.cpp<|end_file_name|><|fim▁begin|>/*****************************************************************************
* Copyright (c) 2014-2020 OpenRCT2 developers
*
* For a complete list of all authors, please refer to contributors.md
* Interested in contributing? Visit https://github.com/OpenRCT2/Ope... | |
<|file_name|>lint-output-format-2.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.apach... | let _x = foo();
//~^ WARNING use of deprecated item 'lint_output_format::foo': text
let _y = bar();
} |
<|file_name|>tools.py<|end_file_name|><|fim▁begin|># Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LI... |
Returns: |
<|file_name|>generate_response_curve.py<|end_file_name|><|fim▁begin|>import astropy.io.fits
import numpy as np
import matplotlib.pyplot as plt
# Create an empty numpy array. 2D; spectra with 4 data elements.
filtered = np.zeros((2040,4))
combined_extracted_1d_spectra_ = astropy.io.fits.open("xtfbrsnN20160705S0025.fit... | effspec = np.load("effspec.npy")
|
<|file_name|>role.py<|end_file_name|><|fim▁begin|>from staffjoy.resource import Resource
from staffjoy.resources.worker import Worker
from staffjoy.resources.schedule import Schedule
from staffjoy.resources.shift import Shift
from staffjoy.resources.shift_query import ShiftQuery
from staffjoy.resources.recurring_shift ... | |
<|file_name|>auth.service.stub2.ts<|end_file_name|><|fim▁begin|>import { Observable } from 'rxjs/Observable';
import { Injectable } from '@angular/core';
import { ResponseOptions, Response } from '@angular/http';
import {
invalid_username_and_password,
login_success,
register_success,
register_failed
} from '..... | this.isLoggedIn = false;
}
checkTimeOut() { |
<|file_name|>list.cpp<|end_file_name|><|fim▁begin|>#include <filezilla.h>
#include "directorycache.h"
#include "list.h"
enum listStates
{
list_init = 0,
list_waitresolve,
list_waitlock,
list_list
};
int CStorjListOpData::Send()
{
LogMessage(MessageType::Debug_Verbose, L"CStorjListOpData::Send() in state %d", op... | }
CDirentry entry;
entry.name = name; |
<|file_name|>541.go<|end_file_name|><|fim▁begin|>reverseStr(s string, k int) string {
bs := []byte(s)
for i := 0; i < len(bs); i += 2 * k {
if (i+k-1) >= len(bs) {
reverse(&bs, i, len(bs)-1)
}else{
reverse(&bs, i, i+k-1)
} <|fim▁hole|>}
func reverse(s... | }
return string(bs[:]) |
<|file_name|>modules.d.ts<|end_file_name|><|fim▁begin|>declare module '@stratumn/canonicaljson' {
export function stringify(obj: any): string;
}
declare module '@stratumn/js-crypto' {
export namespace sig {
class SigningPrivateKey {
constructor(opts: { algo?: string; pemPrivateKey?: string });
exp... | sign: ( |
<|file_name|>pdf2txt.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
""" Program that convert a pdf to a text file using Tesseract OCR.
The pdf file is first converted to a png file using ghostscript,
then the png file if processed by Tesseract.
"""
import os
import subprocess
import glob
import platform
imp... | short_name = filename[0:-4]
|
<|file_name|>28.py<|end_file_name|><|fim▁begin|>class Solution(object):
def strStr(self, haystack, needle):
"""
:type haystack: str
:type needle: str
:rtype: int
"""<|fim▁hole|><|fim▁end|> | for i in range(len(haystack)-len(needle) + 1):
if haystack[i: i + len(needle)] == needle:
return i
return -1 |
<|file_name|>helpers.rs<|end_file_name|><|fim▁begin|>// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity 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 ver... | const ACCOUNT_CHURN: f32 = 0.01; |
<|file_name|>kendo.culture.yo-NG.js<|end_file_name|><|fim▁begin|>/*
* Kendo UI Web v2013.1.319 (http://kendoui.com)
* Copyright 2013 Telerik AD. All rights reserved.
*
* Kendo UI Web commercial licenses may be obtained at
* https://www.kendoui.com/purchase/license-agreement/kendo-ui-web-commercial.aspx
* If you d... | T: "h:mm:ss tt",
|
<|file_name|>JTextFieldPrazo.java<|end_file_name|><|fim▁begin|>package componentes;
import javax.swing.JTextField;
import javax.swing.text.AttributeSet;
import javax.swing.text.BadLocationException;
import javax.swing.text.PlainDocument;
public class JTextFieldPrazo extends PlainDocument {
/**
*
*/
... | |
<|file_name|>GeometryPrecisionReducer.java<|end_file_name|><|fim▁begin|>/*
* The JTS Topology Suite is a collection of Java classes that
* implement the fundamental operations required to validate a given
* geo-spatial data set to a known topological specification.
*
* Copyright (C) 2001 Vivid Solutions
*
... | *
* @param g the geometry to reduce
* @param precModel the precision model to use
* @return the reduced geometry
|
<|file_name|>all_11.js<|end_file_name|><|fim▁begin|>var searchData=
[
['wait_5ffor_5fcal_132',['wait_for_cal',['../class_a_d_c___module.html#a4fb69b5b2d07c3fc8f5f0bbbf05dfa2a',1,'ADC_Module']]],<|fim▁hole|> ['waituntilstable_133',['waitUntilStable',['../namespace_v_r_e_f.html#a108f7c1b5a2073bc092eafcae58575b0',1,'VR... | |
<|file_name|>decode.rs<|end_file_name|><|fim▁begin|>//! Utilities for decoding a C4FM signal into symbols.
use bits;
use consts;
/// Decodes symbol from sample at each symbol instant.
#[derive(Copy, Clone)]
pub struct Decoder {
/// Sample index into current symbol period.
pos: usize,
/// Decider used for ... | None
} |
<|file_name|>ink.datepicker.js<|end_file_name|><|fim▁begin|>/**
* @module Ink.UI.DatePicker_1
* @version 1
* Date selector
*/
Ink.createModule('Ink.UI.DatePicker', '1', ['Ink.UI.Common_1','Ink.Dom.Event_1','Ink.Dom.Css_1','Ink.Dom.Element_1','Ink.Dom.Selector_1','Ink.Util.Array_1','Ink.Util.Date_1', 'Ink.Dom.Brows... | var wDayFirst = (new Date( year , month , 1 )).getDay(); // Sunday=0
var startWeekDay = this._options.startWeekDay || 0; // Sunday=0
var result = wDayFirst - startWeekDay; |
<|file_name|>serializers.py<|end_file_name|><|fim▁begin|>from guardian.shortcuts import get_perms
from rest_framework import serializers as ser
from rest_framework.exceptions import ValidationError
from reviews.workflow import Workflows
from api.actions.serializers import ReviewableCountsRelationshipField
from api.ba... | |
<|file_name|>exceptions.py<|end_file_name|><|fim▁begin|>class StopSendingException(Exception):
"""<|fim▁hole|> """<|fim▁end|> | pre_send exception |
<|file_name|>dnc.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
# Copyright (C) 2009 Sebastian Garcia
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the Licen... | #
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
<|file_name|>thousands_separator.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
<|fim▁hole|>print " Formated number:", "{:,}".format(102403)<|fim▁end|> | |
<|file_name|>util.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2012-2013 Hector Martin "marcan" <hector@marcansoft.com><|fim▁hole|># it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 or version 3.
#
# T... | #
# This program is free software; you can redistribute it and/or modify |
<|file_name|>greek-numeral-view.js<|end_file_name|><|fim▁begin|>import { Constants, Feature } from 'alpheios-data-models'
import Morpheme from '@lib/morpheme.js'
import Form from '@lib/form.js'
import Table from '@views/lib/table.js'
import GreekView from '../greek-view.js'
import GroupFeatureType from '../../../lib/g... | |
<|file_name|>write.js<|end_file_name|><|fim▁begin|>/**
* Write the input to the paramsified file
*
* ---
* INPUTS:
*
* - FILES
* Write the list of files to the paramsified file (line feed after each filename).
*
* - STRINGS
* Write the strings (concatenated) to the paramsified file.
*
* - STRING
* Wr... | });
break;
case State.TYPES.STRING: |
<|file_name|>list_user.py<|end_file_name|><|fim▁begin|>"""This module contains the ``list_user`` command."""
import click
from ovmm.handlers.postgres import PostgreSQLDatabaseHandler
@click.command()
def list_user():
"""List users managed by ovmm."""
click.echo('\n{:-^60}'.format(' Process: List Users '))
... | |
<|file_name|>PyRtAudioTest.py<|end_file_name|><|fim▁begin|>import rtaudio as rt
from math import cos
import struct
class audio_generator:
def __init__(self):
self.idx = -1
self.freq = 440.
def __call__(self):
self.idx += 1
if self.idx%48000 == 0:
self.freq *= 2**(... | print 'Default input device: ', dac.getDefaultInputDevice()
print 'is stream open: ', dac.isStreamOpen()
print 'is stream running: ', dac.isStreamRunning()
|
<|file_name|>call-generic-method-nonconst-bound.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>
#![feature(const_fn_trait_bound)]
struct S;
impl PartialEq for S {
fn eq(&self, _: &S) -> bool {
true
}
}
const fn equals_self<T: PartialEq>(t: &T) -> bool {
true
}
pub const EQ: bool = equals_self(&S);
... | // check-pass |
<|file_name|>mock.py<|end_file_name|><|fim▁begin|>#
# (c) Dave Kirby 2001 - 2005
# mock@thedeveloperscoach.com
#
# Original call interceptor and call assertion code by Phil Dawes (pdawes@users.sourceforge.net)
# Call interceptor code enhanced by Bruce Cropley (cropleyb@yahoo.com.au)
#
# This Python module and asso... | # All rights reserved.
#
# Redistribution and use in source and binary forms, with or without |
<|file_name|>event.js<|end_file_name|><|fim▁begin|>import Ember from 'ember';
import DS from 'ember-data';
const secondsInDay = 86400;
const days = [
'monday',
'tuesday',
'wednesday',
'thursday',
'friday',
'saturday',
'sunday',
];
export default DS.Model.extend(Ember.Copyable, {
temp: DS.attr('number'... | }, |
<|file_name|>import.ts<|end_file_name|><|fim▁begin|>import BinaryStream from '../../../common/binarystream';
import { byteLengthUtf8 } from '../../../common/utf8';
/**
* An import.
*/
export default class Import {
isCustom = 0;
path = '';
load(stream: BinaryStream): void {
this.isCustom = stream.readUint8... | this.path = stream.readNull(); |
<|file_name|>is_disjoint.rs<|end_file_name|><|fim▁begin|>extern crate roaring;
use roaring::RoaringBitmap;
#[test]
fn array() {<|fim▁hole|> let bitmap1: RoaringBitmap<u32> = (0..2000u32).collect();
let bitmap2: RoaringBitmap<u32> = (4000..6000u32).collect();
assert_eq!(bitmap1.is_disjoint(&bitmap2), true);
... | |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>export * from './src/index';<|fim▁end|> | |
<|file_name|>Student.java<|end_file_name|><|fim▁begin|>package org.judal.examples.java.model.array;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.GregorianCalendar;
import javax.jdo.JDOException;
import org.judal.storage.DataSource;
import o... | public String getFirstName() {
|
<|file_name|>history.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -- Content-Encoding: UTF-8 --
"""
Gathers components according to their history.
This algorithm is a test: it can be a memory hog
:author: Thomas Calmant
:license: Apache Software License 2.0
:version: 3.0.0
..
Copyright 2014 isandlaTec... | for candidate in candidates:
components = sorted(component.name
for component in candidate.components) |
<|file_name|>ZmFolderPropsDialog.js<|end_file_name|><|fim▁begin|>/*
* ***** BEGIN LICENSE BLOCK *****
* Zimbra Collaboration Suite Web Client
* Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Zimbra, Inc.
*
* The contents of this file are subject to the Zimbra Public License
* Version 1.3 ("License"); you may n... | |
<|file_name|>constantes.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2017 KMEE
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from __future__ import division, print_function, unicode_literals
TIPO_COBRANCA = (
('0', u'Carteira'),
('1', u'Cheque'),
('2', u'CNAB'),
)... | ) |
<|file_name|>test_links.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
import unittest
import mechanize
from links import links
class LinksTest(unittest.TestCase):
"""Test para 'links.py'"""
def test_obtener_parametros_de_la_url(self):
url_unlam = 'http://www.unla... | self.assertEqual(parametro,
'docume' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.