prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>bind-by-move.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<|fim▁hole|>// option. ... | // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your |
<|file_name|>TestingParallelAPSPConfigMXBean.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the<|fim▁hole|>package org.opendaylight.controller.config.manager.testingservices.paral... | * terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/ |
<|file_name|>PathVariable.py<|end_file_name|><|fim▁begin|>"""SCons.Variables.PathVariable
This file defines an option type for SCons implementing path settings.
To be used whenever a a user-specified path override should be allowed.
Arguments to PathVariable are:
option-name = name of this option on the command l... | if not os.path.isdir(val):
if os.path.isfile(val):
m = 'Directory path for option %s is a file: %s' |
<|file_name|>py-finish-breakpoint2.py<|end_file_name|><|fim▁begin|># Copyright (C) 2011-2016 Free Software Foundation, Inc.
# 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 3 of t... | print ("exception did not finish ...")
print ("Python script imported") |
<|file_name|>0002_auto__del_participant.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):
# Deleting model 'Participant'
db.de... | |
<|file_name|>test_get_objects.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
gateway tests - Testing the gateway.getObject() and searchObjects() methods
Copyright 2013 Glencoe Software, Inc. All rights reserved.
Use is subject to license terms supplied in LICENSE.txt
py... | def testGetExperimenter(self, gatewaywrapper):
gatewaywrapper.loginAsAuthor() |
<|file_name|>util.rs<|end_file_name|><|fim▁begin|>use std::str;
pub fn as_rust_str(string: &'static [u8]) -> &'static str
{
unsafe
{
&str::from_utf8_unchecked(string)[0 .. string.len() -1]<|fim▁hole|>{
unsafe
{
&str::from_utf8_unchecked(string)[0 .. string.len() -1]
}
}<|fim▁end|> | }
}
pub fn as_rust_str_from(string: &[u8]) -> &str |
<|file_name|>glass.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#!/usr/bin/env python
#
# pynbome library
# glass.py (c) Mikhail Mezyakov <mihail265@gmail.com>
#
# View through tiled glass
import os
import subprocess
from wand.image import Image
from . import prepare_filter
@prepare_filter
def apply_filte... | }
|
<|file_name|>chagen.go<|end_file_name|><|fim▁begin|>/*
Copyright 2017 Artem Sidorenko <artem@posteo.de>
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... | |
<|file_name|>header.js<|end_file_name|><|fim▁begin|>'use strict';
describe('Service: header', function () {
// load the service's module
beforeEach(module('musicyaoBackendApp'));
// instantiate service
var header;
beforeEach(inject(function (_header_) {
header = _header_;
}));
it('should do someth... | expect(!!header).toBe(true);
});
}); |
<|file_name|>issue-13698.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... | |
<|file_name|>IStringBuffer.java<|end_file_name|><|fim▁begin|>package org.lionsoul.jcseg.util;
import java.io.Serializable;
/**
* string buffer class
*
* @author chenxin<chenxin619315@gmail.com>
*/
public class IStringBuffer implements Serializable
{
private static final long serialVersionUID = 1L;
/**
... | * @param c the char to append to |
<|file_name|>zz_read_gen.go<|end_file_name|><|fim▁begin|>// Copyright 2017-2022 The Usacloud 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/licen... | fs.AddFlag(cmd.LocalFlags().Lookup("generate-skeleton")) |
<|file_name|>home_tags.py<|end_file_name|><|fim▁begin|>from django import template
from django.conf import settings
register = template.Library()
# settings value<|fim▁hole|><|fim▁end|> | @register.assignment_tag
def get_google_maps_key():
return getattr(settings, 'GOOGLE_MAPS_KEY', "") |
<|file_name|>DbInstaller.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import sys
from argparse import ArgumentParser
from DatabaseLogin import DatabaseLogin
from GlobalInstaller import GlobalInstaller
from PyQt5 import QtWidgets
from Ui_MainWindow import Ui_MainWindow
# import damit Installe... | |
<|file_name|>utils.rs<|end_file_name|><|fim▁begin|>use gtk::*;
use vte::Terminal;
use rustc_serialize::{Encodable, json};
use std::env;
use std::collections::{HashMap, HashSet};
use std::io::{Read, Write};
use std::fs::{self, metadata};
use std::ops::Deref;
use std::path::{Path, PathBuf};
pub static WINDOW_WIDTH : i32... |
#[derive(RustcDecodable, RustcEncodable)]
pub struct KeySettings {
pub new_project: Option<String>, |
<|file_name|>AudioManager.java<|end_file_name|><|fim▁begin|>package net.ausiasmarch.fartman.util;
import com.badlogic.gdx.audio.Music;
import com.badlogic.gdx.audio.Sound;
/**
* AudioManager.java
* Gestiona la musica y sonidos
* @author Luis
*
*/
public class AudioManager {
/** Administrador de audio */
publi... | /** Reproduce sonido */ |
<|file_name|>Decorator.cpp<|end_file_name|><|fim▁begin|>#include "../header/Base.h"
#include "../header/Decorator.h"
<|fim▁hole|>
Decorator::Decorator(Base* node) {
}
Decorator::~Decorator() {
}<|fim▁end|> | Decorator::Decorator() {
} |
<|file_name|>ViewportContainers.js<|end_file_name|><|fim▁begin|>var ViewportContainers = function ( editor ) {
var container = new UI.Panel();<|fim▁hole|>
};<|fim▁end|> | container.setId( 'ViewportContainers' );
return container; |
<|file_name|>Ex9.3.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Exercise 9.3 from Kane 1985."""
from __future__ import division
from sympy import cos, diff, expand, pi, solve, symbols
from sympy.physics.mechanics import ReferenceFrame, Point
from sympy.physics.mechanics import dot, ... | B = B_prime.orientnew('B', 'Axis', [pi/2 - q[1], B_prime.x])
C = B.orientnew('C', 'Axis', [q[2], B.z])
## --- Define Points and their velocities --- |
<|file_name|>restore.py<|end_file_name|><|fim▁begin|>import os
import shutil<|fim▁hole|>print '<html>'
found_pages = glob('archive/*.py')
if found_pages:
path = "/cgi-bin/archive/"
moveto = "/cgi-bin/pages/"
files = os.listdir(path)
files.sort()
for f in files:
src = path+f
dst = m... | from glob import glob
print 'Content-type:text/html\r\n\r\n' |
<|file_name|>reflect.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/license... | fn visit_param(&self, i: uint) -> bool {
if ! self.inner.visit_param(i) { return false; }
true |
<|file_name|>_version.py<|end_file_name|><|fim▁begin|># coding=utf-8<|fim▁hole|># Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
VERSION = "1.0.0b3"<|fim▁end|> | # --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator. |
<|file_name|>partenonurlutils.go<|end_file_name|><|fim▁begin|>package uriuti
import (
"bytes"
"crypto/tls"
"errors"
"io/ioutil"
"net/http"
"text/template"
"strings"
)
//Relaces parameters to values in SOAP/REST URLs
func BuildURL(urlTemplate string, data map[string]interface{}) (url string, err erro... | // For control over HTTP client headers,
// redirect policy, and other settings, |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Copyright (c) 2016-2017 Chef Software Inc. and/or applicable contributors
//
// 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
//
// htt... | extern crate toml;
extern crate uuid;
extern crate zmq;
|
<|file_name|>GraphicalMapper.js<|end_file_name|><|fim▁begin|>import React from 'react';
import {withStyles} from '@material-ui/core/styles';
import Popover from '@material-ui/core/Popover';
import {VisualQueryManager, PastebinContext} from './Pastebin';
import GraphicalQuery from '../components/GraphicalQuery';
const ... | const overlays = []; |
<|file_name|>BulkItem.java<|end_file_name|><|fim▁begin|>package com.farevee.groceries;
public class BulkItem
implements Item
{
//+--------+------------------------------------------------------
// | Fields |
// +--------+
/**
* The type of food of the bulk item
*/
BulkFood food;
/**
* The un... | {
return this.getWeight().amount;
}//getWeightAmount()
|
<|file_name|>conftest.py<|end_file_name|><|fim▁begin|>from tests.approvals_config import configure_approvaltests
import pytest
# begin-snippet: conftest_pytest_session_scoped
@pytest.fixture(scope="session", autouse=True)
def set_default_reporter_for_all_tests():
configure_approvaltests()<|fim▁hole|># end-snippet... | |
<|file_name|>kubernetes_mongodb_ycsb_benchmark.py<|end_file_name|><|fim▁begin|># Copyright 2015 PerfKitBenchmarker Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License a... | |
<|file_name|>applypendingmaintenanceactionrequest.cpp<|end_file_name|><|fim▁begin|>/*
Copyright 2013-2021 Paul Colby
This file is part of QtAws.
QtAws 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 Softwa... | * </p <ul> <li>
*
* For the alphabetical list of API actions, see <a |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>use std::collections::HashMap;
pub struct SourcePrimes {
primes: Vec<u64>,
until: u64
}
pub struct Factors {
primes: Vec<u64>,
counts: Vec<u64>
}
impl Factors {
pub fn new(factor_map: &HashMap<u64, u64>) -> Factors {
let (primes, counts) = ... | }
pub fn product(&self) -> u64 {
let mut product = 1u64; |
<|file_name|>set-gc.cpp<|end_file_name|><|fim▁begin|>//
// immer: immutable data structures for C++
// Copyright (C) 2016, 2017, 2018 Juan Pedro Bolivar Puente
//
// This software is distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
/... | vars[dst] = std::move(vars[src]).insert(value); |
<|file_name|>plot_mne_inverse_envelope_correlation_volume.py<|end_file_name|><|fim▁begin|>"""
====================================================
Compute envelope correlations in volume source space
====================================================
Compute envelope correlations of orthogonalized activity
:footcite... | |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import urllib
import telnetlib
import logging
import cjson
from models import BinaryResource
from django.http import HttpResponse
from django.shortcuts import render_to_response
from django import forms
from django.contrib.auth import authenticate, login
from sana.mr... |
username = request.REQUEST.get('username',None)
password = request.REQUEST.get('password',None)
user = authenticate(username=username, password=password) |
<|file_name|>api_cli_test.go<|end_file_name|><|fim▁begin|>package server_test
import (
"os"
"testing"
"github.com/stretchr/testify/require"
"github.com/kopia/kopia/internal/apiclient"
"github.com/kopia/kopia/internal/repotesting"
"github.com/kopia/kopia/internal/serverapi"
)
func TestCLIAPI(t *testing.T) {
c... | require.NoError(t, err) |
<|file_name|>model.py<|end_file_name|><|fim▁begin|># emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""The freesurfer module provides basic functions for interfacing with
freesurfer tools.
Change directory to provide relative paths for doctests
... | desc='set binval=0, binvalnot=1')
frame_no = traits.Int(argstr='--frame %s',
desc='use 0-based frame of input (default is 0)')
merge_file = File(exists=True, argstr='--merge %s', |
<|file_name|>mod.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 version... | //! Spec deserialization. |
<|file_name|>mapping_test.py<|end_file_name|><|fim▁begin|>'''
Created on 2010 aza 30
@author: peio
It test the mapping module of franklin
'''
import unittest, os, StringIO
from os.path import join, exists
from tempfile import NamedTemporaryFile
from franklin.utils.misc_utils import TEST_DATA_DIR, NamedTemporaryDir
... | out_bam_fhand.close()
parameters = {'threads':None, 'kmer':13}
map_reads_with_gmap(temp_genome, reads_fhand.name, out_bam_fpath, |
<|file_name|>codethanksfes2017_e.py<|end_file_name|><|fim▁begin|>N = int(input())
ans = [0] * N
for i in range(0, N, 5):
q = [0] * N
for j in range(i, min(N, i + 5)):
q[j] = 10 ** (j - i)
print('? {}'.format(' '.join(map(str, q))), flush=True)
S = str(int(input().strip()) - sum(q) * 7)[::-1]
... | print('! {}'.format(' '.join(map(str, ans))), flush=True) |
<|file_name|>GridInverseDistanceNearestNeighbor.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
***************************************************************************
GridInverseDistanceNearestNeighbor.py
---------------------
Date : September 2017
Copyright ... | |
<|file_name|>Dir.py<|end_file_name|><|fim▁begin|>import os
def Dir_toStdName(path):
if not (path[-1]=="/" or path[-1] == "//"):
path=path+"/"
return path
<|fim▁hole|>def Dir_getFiles(path):
path=Dir_toStdName(path)
allfiles=[]
files=os.listdir(path)
for f in files:
abs_path = path + f
if os.path.isdi... | |
<|file_name|>markup.js<|end_file_name|><|fim▁begin|>var gulp = require('gulp');
var config = require('../config').markup;
var browserSync = require('browser-sync');
<|fim▁hole|>var taskDef = function () {
return gulp.src(config.src)
.pipe(gulp.dest(config.dest))
.pipe(browserSync.reload({
... | |
<|file_name|>nlp_engine.py<|end_file_name|><|fim▁begin|>''' author@esilgard '''
# Copyright (c) 2013-2016 Fred Hutchinson Cancer Research Center
#
# 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 a... | |
<|file_name|>test_managers.py<|end_file_name|><|fim▁begin|>"""Unit tests of resource managers."""
import pytest
from ..utilities.general import is_never_authz, is_no_authz, uses_cataloging, uses_filesystem_only
from dlkit.abstract_osid.osid import errors
from dlkit.abstract_osid.type.objects import TypeList as abc_... | if self.svc_mgr.supports_bin_query():
self.svc_mgr.get_bin_query_session() |
<|file_name|>node.py<|end_file_name|><|fim▁begin|># Copyright (c) 2014 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the License);
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# Unless re... | if (node.data["status"] == "discover" and |
<|file_name|>login.test.ts<|end_file_name|><|fim▁begin|>require('dotenv').config();
import {EMAIL_IS_REQUIRED, EMAIL_IS_INVALID,
PASSWORD_IS_REQUIRED, INVALID_CREDENTIALS} from '../../constants/errors';
const db = require('../../models');
import {seedDb} from '../../utils';
import {expectError} from '../helper... | expect(data.user).toMatchSnapshot(); |
<|file_name|>ecommerce.go<|end_file_name|><|fim▁begin|>package measurement
<|fim▁hole|>type TransactionMessage struct {
}
// item
type ItemMessage struct{}
// impression
// action
// refund
// purchase<|fim▁end|> | // transaction |
<|file_name|>clutter.py<|end_file_name|><|fim▁begin|><|fim▁hole|>GnuXzPackage ('clutter', '1.10.6',
sources = [ 'http://source.clutter-project.org/sources/clutter/1.10/%{name}-%{version}.tar.xz' ],
)<|fim▁end|> | |
<|file_name|>bitcoin_ca@valencia.ts<|end_file_name|><|fim▁begin|><TS language="ca@valencia" version="2.0">
<context>
<name>AboutDialog</name>
<message>
<source>About Petecoin Core</source>
<translation type="unfinished"/>
</message>
<message>
<source><b>Petecoin Core</b&... | |
<|file_name|>impl_qpid.py<|end_file_name|><|fim▁begin|># vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack Foundation
# Copyright 2011 - 2012, Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the Licen... | |
<|file_name|>toy.ts<|end_file_name|><|fim▁begin|>import { Controller } from "./controller.js";
import { loadShaders, samples } from "./samples.js";
import { View } from "./view.js";
export function init() {<|fim▁hole|> window.onload = () => doInit();
}
function doInit() {
const controller = new Controller();
... | |
<|file_name|>values.go<|end_file_name|><|fim▁begin|>package main
import "fmt"<|fim▁hole|> fmt.Println("1+1 =", 1+1)
fmt.Println("7.0/3.0 =", 7.0/3.0)
fmt.Println(true && false)
fmt.Println(true || false)
fmt.Println(!true)
}<|fim▁end|> |
func main() {
fmt.Println("go" + "lang")
|
<|file_name|>RemoveValueLoggable.java<|end_file_name|><|fim▁begin|>/*L
* Copyright Oracle Inc
*
* Distributed under the OSI-approved BSD 3-Clause License.
* See http://ncip.github.com/cadsr-cgmdr-nci-uk/LICENSE.txt for details.
*/
<|fim▁hole|>/*
* eXist Open Source Native XML Database
* Copyright (C) ... | |
<|file_name|>iptables_manager.py<|end_file_name|><|fim▁begin|># vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Locaweb.
# 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 c... | elif line.startswith('['):
line = _strip_packets_bytes(line) |
<|file_name|>prefixSumComputer.test.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 informatio... | assert.strictEqual(indexOfResult.index, 3);
assert.strictEqual(indexOfResult.remainder, 0);
indexOfResult = psc.getIndexOf(2);
assert.strictEqual(indexOfResult.index, 4); |
<|file_name|>trait-bounds-not-on-impl.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.a... | |
<|file_name|>SaveSharp.js<|end_file_name|><|fim▁begin|>import createSvgIcon from './utils/createSvgIcon';
import { jsx as _jsx } from "react/jsx-runtime";
export default createSvgIcon( /*#__PURE__*/_jsx("path", {<|fim▁hole|> d: "M17 3H3v18h18V7l-4-4zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3zm3-10H5V5h... | |
<|file_name|>horn_sequence.py<|end_file_name|><|fim▁begin|>LONG_HORN = 750
LONG_HORN_SPACE = LONG_HORN/2
SHORT_HORN = 400
SHORT_HORN_SPACE = SHORT_HORN/2
sequences = {
'CreekFleet': {
# Three long horns immediately (three minutes to start)
0: 'LLL',
# Two long horns a minute later ... | 'ISAF': {
# One short horn immediately (five minutes to start)
0: 'S',
|
<|file_name|>backend.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
import string
from urlparse import urlparse, parse_qs
from mopidy import backend
from mopidy.models import SearchResult, Track, Album, Artist
import pykka
import pafy
import requests
import un... | ' ',
''.join(c for c in safe_uri if c in valid_chars)
).strip() |
<|file_name|>limited-debuginfo.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
// http://www.apa... | fn zzz() {()}
fn some_function(a: int, b: int) { |
<|file_name|>basket.rs<|end_file_name|><|fim▁begin|>use rocket_contrib::Template;<|fim▁hole|>use rocket::State;
use model::{AuthUser, Basket};
use context::Context;
use db::Db;
#[get("/<username>/<basket>", rank = 10)]
pub fn index(
username: &str,
basket: &str,
auth_user: Option<AuthUser>,
db: State... | |
<|file_name|>index.d.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.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior ... | * resource group.
*
* @param {object} [options] Optional Parameters. |
<|file_name|>angular-locale_uk-ua.js<|end_file_name|><|fim▁begin|>'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
function getDecimals(n) {
n = n + '';
var i = n.indexOf('.');
re... | "\u0442\u0440\u0430\u0432\u0435\u043d\u044c",
"\u0447\u0435\u0440\u0432\u0435\u043d\u044c", |
<|file_name|>data.service.ts<|end_file_name|><|fim▁begin|>import { Injectable } from '@angular/core';
import { Http, Response } from '@angular/http';
//Grab everything with import 'rxjs/Rx';
import { Observable } from 'rxjs/Observable';
import { Observer } from 'rxjs/Observer';
import 'rxjs/add/observable/throw';
imp... | @Injectable()
export class DataService extends BaseDataService {
baseUrl: string = 'http://localhost:3010';
|
<|file_name|>url.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
//! Generic types for url properties.
/// An image url or none,... | }
/// Returns whether the value is `none`. |
<|file_name|>SipLogger.java<|end_file_name|><|fim▁begin|>/*
* Jitsi, the OpenSource Java VoIP and Instant Messaging client.
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package net.java.sip.communicator.impl.protocol.sip;
import gov.nist.core.*;
import gov.nist.javax.sip.*;
import g... | byte[] srcAddr;
int srcPort;
byte[] dstAddr; |
<|file_name|>topn_push_down.go<|end_file_name|><|fim▁begin|>// Copyright 2017 PingCAP, 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/LICENS... | |
<|file_name|>test_frequencies.py<|end_file_name|><|fim▁begin|>from datetime import datetime, time, timedelta
from pandas.compat import range
import sys
import os
import nose
import numpy as np
from pandas import Index, DatetimeIndex, Timestamp, Series, date_range, period_range
import pandas.tseries.frequencies as f... | assert(result.n == -310)
|
<|file_name|>webpage_condition_operator.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# 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.... | __protobuf__ = proto.module(
package="google.ads.googleads.v10.enums",
marshal="google.ads.googleads.v10", |
<|file_name|>EdgeTest.java<|end_file_name|><|fim▁begin|>package lena.lerning.selenium;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.edge.EdgeDriver;
import org.ope... | driver=null;
}
} |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>/*!
* The ```ladspa``` crate provides an interface for writing [LADSPA](http://www.ladspa.org/)
* plugins safely in Rust.
*
* ##Creating the project
*
* Run ```cargo new my_ladspa_plugin``` to generate a Cargo project for your plugin, then add
* the following to t... | /// the library. Labels are case sensitive and expected not to contain spaces.
pub label: &'static str,
|
<|file_name|>unreachable-locals.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
// http://www.ap... | #![allow(unused_variables)]
#![omit_gdb_pretty_printer_section]
// No need to actually run the debugger, just make sure that the compiler can |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from django.test import TestCase
from django.conf import settings
from django.contrib.sites.models import Site
from django.db.models.query import QuerySet<|fim▁hole|>from music.models import TrackContributor, Credit, Track, Album, CreditOption
from music.utils impor... |
from preferences import preferences
|
<|file_name|>import_prescribing.py<|end_file_name|><|fim▁begin|>"""
Import prescribing data from CSV files into SQLite
"""
from collections import namedtuple
import csv
from itertools import groupby
import logging
import os
import sqlite3
import gzip
import heapq
from matrixstore.matrix_ops import sparse_matrix, final... | for row in matrices: |
<|file_name|>IsClientAbortedCommand.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2021 PANTHEON.tech, s.r.o. and others. All rights reserved.
*<|fim▁hole|> * terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
packa... | * This program and the accompanying materials are made available under the |
<|file_name|>csv_user_import_mappings.py<|end_file_name|><|fim▁begin|>from knowledgebase.models import ArticleCategory
def transform_category(value):
try:
return ArticleCategory.objects.get(name=value)
except ArticleCategory.DoesNotExist:
raise ValueError("Could not find category with name: %s... | |
<|file_name|>0002_group_members.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
<|fim▁hole|> dependencies = [
migrations.swappable_dependency(set... | |
<|file_name|>scd.py<|end_file_name|><|fim▁begin|># extension imports<|fim▁hole|><|fim▁end|> | from _NetworKit import PageRankNibble, GCE |
<|file_name|>AddNewSpecificJournalActivity.java<|end_file_name|><|fim▁begin|>package com.orbital.lead.controller.Activity;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.DatePickerDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
i... | }
|
<|file_name|>namingpeoplecontent.js<|end_file_name|><|fim▁begin|>/*
*
* (c) Copyright Ascensio System Limited 2010-2021
*
* 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:/... | |
<|file_name|>test_cssr.py<|end_file_name|><|fim▁begin|># Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
Created on Jan 24, 2012
"""
__author__ = "Shyue Ping Ong"
__copyright__ = "Copyright 2012, The Materials Project"
__version__ = "0.1"
__maintainer__ = "Shyue Ping On... |
from pymatgen.core.structure import Structure |
<|file_name|>WebTermImportanceFilter.java<|end_file_name|><|fim▁begin|>package info.ephyra.answerselection.filters;
import info.ephyra.io.Logger;
import info.ephyra.io.MsgPrinter;
import info.ephyra.nlp.NETagger;
import info.ephyra.nlp.OpenNLP;
import info.ephyra.nlp.SnowballStemmer;
import info.ephyra.nlp.Stan... | * that use different sources for text snippets.</p>
|
<|file_name|>RegRestoreKey.py<|end_file_name|><|fim▁begin|>import win32api, win32security
import win32con, ntsecuritycon, winnt
import os
temp_dir=win32api.GetTempPath()
fname=win32api.GetTempFileName(temp_dir,'rsk')[0]
print fname<|fim▁hole|>
## enable backup and restore privs
required_privs = ((win32security.LookupP... | ## file can't exist
os.remove(fname) |
<|file_name|>TitleBuilder.java<|end_file_name|><|fim▁begin|>package cn.com.jautoitx;
import org.apache.commons.lang3.StringUtils;
import com.sun.jna.platform.win32.WinDef.HWND;
/**
* Build window title base on Advanced Window Descriptions.
*
* @author zhengbo.wang
*/
public class TitleBuilder {
/**
* Build w... | this.height = height;
} |
<|file_name|>KeySignatureEvent.cpp<|end_file_name|><|fim▁begin|>/*
* MidiEditor
* Copyright (C) 2010 Markus Schwenk
*
* 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 3 of t... | text = "g";
break;
} |
<|file_name|>box.mako.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
<%namespace name="helpers" file="/helpers.mako.rs" />
<%hel... | // |
<|file_name|>windblow.py<|end_file_name|><|fim▁begin|># This file is part of OpenDrift.
#
# OpenDrift 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, version 2
#
# OpenDrift is distributed in the hope that it ... | ElementType = PassiveTracer
required_variables = {
'x_wind': {'fallback': 0},
'y_wind': {'fallback': 0} |
<|file_name|>StubInfo.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2000 - 2008 TagServlet Ltd
*
* This file is part of Open BlueDragon (OpenBD) CFML Server Engine.
*
* OpenBD is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published ... | |
<|file_name|>resource_task.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/. */
//! A task that takes a URL and streams back the binary... | match self.progress_port.recv().unwrap() {
ProgressMsg::Payload(data) => Some(data),
ProgressMsg::Done(Ok(())) => None,
ProgressMsg::Done(Err(e)) => { |
<|file_name|>kcgrassex.cc<|end_file_name|><|fim▁begin|>#include <kccachedb.h>
using namespace std;
using namespace kyotocabinet;
// main routine
int main(int argc, char** argv) {
// create the database object
GrassDB db;
// open the database
if (!db.open("*", GrassDB::OWRITER | GrassDB::OCREATE)) {
cerr... | if (!db.close()) {
cerr << "close error: " << db.error().name() << endl;
} |
<|file_name|>SinglePeak.py<|end_file_name|><|fim▁begin|># -*- uft-8 -*-
import matplotlib
class SinglePeak():
"""Creat a class as a Peak Container"""
def __init__(self,StandardPeak):
self.StandardPeak=StandardPeak
self.Indicator=False
self.RecordIntegrationTime=0
self.MaxCounts=0
self.PeakPixel=0
self.pix... | Spectrum=list(Spectrum)
self.Spectrum=Spectrum[self.pixel[0]:self.pixel[1]]
return self.Spectrum |
<|file_name|>request.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 hyper::header::Headers;
use hyper::method::Method;
use ms... | pub struct RequestInit {
pub method: Method,
pub url: Url, |
<|file_name|>AutoLayoutGenerate.java<|end_file_name|><|fim▁begin|>package com.chenantao.autolayout.utils;
import android.view.ViewGroup;
/**
* Created by Chenantao_gg on 2016/1/20.
*/
public class AutoLayoutGenerate
{
public static <T extends ViewGroup> T generate(Class<T> clazz, Class[] argumentTypes, Ob... | // (AttributeSet) arguments[1]);
// Callback noOp = NoOp.INSTANCE;
// Callback[] callbacks = new Callback[]{methodInterceptor, noOp};
|
<|file_name|>config.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
import logging
import os
from flask import Flask
from flask_pymongo import PyMongo
from raven.contrib.flask import Sentry
from heman.api import HemanAPI
api = HemanAPI(prefix='/api')
"""API object
"""
sentry = Sentry(logging=... | |
<|file_name|>views.py<|end_file_name|><|fim▁begin|># Create your views here.
import random
import json
import hashlib
import smtplib
from django.shortcuts import render_to_response, get_object_or_404
from django.conf import settings
from django.template import RequestContext
from django.contrib.auth.models import Use... | |
<|file_name|>AddVetEditor.java<|end_file_name|><|fim▁begin|>package org.minimalj.example.petclinic.frontend;
<|fim▁hole|>import org.minimalj.frontend.Frontend;
import org.minimalj.frontend.editor.Editor.NewObjectEditor;
import org.minimalj.frontend.form.Form;
public class AddVetEditor extends NewObjectEditor<Vet> {
... | import org.minimalj.backend.Backend;
import org.minimalj.example.petclinic.model.Vet; |
<|file_name|>RenderOptions.ts<|end_file_name|><|fim▁begin|>module Supler {
interface RenderAnyValueField {
(fieldData:FieldData, options:any, compact:boolean): string
}
interface RenderPossibleValuesField {
(fieldData:FieldData,
possibleValues:SelectValue[],
containerOptions:any,
elemen... |
selectBody += HtmlUtil.renderTagEscaped('option', optionOptions, v.label);
}); |
<|file_name|>jolokia-env.js<|end_file_name|><|fim▁begin|>(function() {
var port = 8080;
if (window.location.search) {
var params = window.location.search.match(/port=(\d+)/);
if (params) {
port = params[1];
}<|fim▁hole|> if (params) {
window.JOLOKIA_POLL_IN... |
// How often to poll
params = window.location.search.match(/pollInterval=(\d+)/); |
<|file_name|>VariableDeclaration7_es6.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>// @target:es6
let a<|fim▁end|> | |
<|file_name|>views.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""CMS view for static pages"""
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
from django.utils.translation... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.