prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>bar.js<|end_file_name|><|fim▁begin|>import shaven from 'shaven'
const svgNS = 'http://www.w3.org/2000/svg'
export default function (svg, config) {
const yDensity = 0.1
const yRange = config.max.value - config.min.value
const graphHeight = config.height * 0.8
const graphWidth = config.width * 0.9... | )[0]
function localSetAnimations () { |
<|file_name|>ajax.js<|end_file_name|><|fim▁begin|>/**
* Ajax函数
*/
// 创建一个XMLHttpRequest对象
var createXHR;
if (window.XMLHttpRequest) {
createXHR = function() {
return new XMLHttpRequest();
};
} else if (window.ActiveXObject) {
createXHR = function() {
return new ActiveXObject('Microsoft.XM... | |
<|file_name|>test_base.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses thi... | beeswax.conf.HIVE_SERVER_BIN.set_for_testing(get_run_root('ext/hive/hive') + '/bin/hiveserver2'),
beeswax.conf.HIVE_CONF_DIR.set_for_testing(HIVE_CONF) |
<|file_name|>assignment2_true.py<|end_file_name|><|fim▁begin|>import pandas as pd
import matplotlib.pyplot as plt
import matplotlib
import assignment2_helper as helper
# Look pretty...
matplotlib.style.use('ggplot')
# Do * NOT * alter this line, until instructed!
scaleFeatures = True
# TODO: Load up the dataset an... | |
<|file_name|>group.rs<|end_file_name|><|fim▁begin|>//! Fuctions and Structs for dealing with /etc/group
use std::path::Path;
use std::num::ParseIntError;
use libc::gid_t;
use entries::{Entries,Entry};
/// An entry from /etc/group
#[derive(Debug, PartialEq, PartialOrd)]
pub struct GroupEntry {
/// Group Name
... |
/// Return a [`GroupEntry`](struct.GroupEntry.html)
/// for a given `uid` from `/etc/group` |
<|file_name|>knight_tour.rs<|end_file_name|><|fim▁begin|>extern crate nalgebra as na;
extern crate num;
use na::DMatrix;
use na::Scalar;
use na::dimension::Dynamic;
use std::fmt::Display;
use num::FromPrimitive;
const N: usize = 5; //map size N x N
trait ChessFunc {
fn isSafe(&self, x: isize, y: isize) -> bool;
... | let mut result = false;
for cnt in 0..moves.len() { |
<|file_name|>acorn@2.4.0.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | module.exports = require("npm:acorn@2.4.0/dist/acorn"); |
<|file_name|>s3.go<|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/. */
package output
import "reflect"
// S3Grantee ...
type S3Grantee ... | }
// ComponentName returns a components name
func (s S3) ComponentName() string { |
<|file_name|>fix_temp_rescale.cpp<|end_file_name|><|fim▁begin|>/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (20... | id_temp = new char[n];
strcpy(id_temp,arg[1]);
int icompute = modify->find_compute(id_temp); |
<|file_name|>negation.py<|end_file_name|><|fim▁begin|>import os
from pynsett.discourse import Discourse
from pynsett.drt import Drs
from pynsett.extractor import Extractor
from pynsett.knowledge import Knowledge
<|fim▁hole|>drs = Drs.create_from_natural_language(text)
drs.plot()
print(drs)<|fim▁end|> | _path = os.path.dirname(__file__)
text = "John Smith is not blond" |
<|file_name|>task.js<|end_file_name|><|fim▁begin|>/** @jsx html */
import { html } from '../../../snabbdom-jsx';
import Type from 'union-type';
import { bind, pipe, isBoolean, targetValue, targetChecked } from './helpers';
import { KEY_ENTER } from './constants';
// model : {id: Number, title: String, done: B... | StartEdit : () => ({...task, editing: true, editingValue: task.title}),
CommitEdit : title => ({...task, title, editing: false, editingValue: ''}),
|
<|file_name|>0011_menuitem_menu_url.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from urllib.parse import urljoin, urlsplit
from django.db import migrations, models
def forwards(apps, schema_editor):
MenuItem = apps.get_model('external_services', 'MenuItem')
i... | |
<|file_name|>login.js<|end_file_name|><|fim▁begin|>if (!com) var com = {}
if (!com.corejsf) {
com.corejsf = {
showProgress: function(data) {
var inputId = data.source.id
var progressbarId = inputId.substring(0, inputId.length - "name".length)
+ "pole";
if (data.status =... | |
<|file_name|>amount-store.ts<|end_file_name|><|fim▁begin|>import { Map, List, Iterable, Iterator } from 'immutable';
import { Amount, Metric } from './amount';
export interface AmountStore<K, V extends Metric> {
store: Map<K, Amount<V>>;
}
export class AmountStore<K, V extends Metric> implements AmountStore<K, V> {... | |
<|file_name|>test_logging.py<|end_file_name|><|fim▁begin|>from agrc import logging
import unittest
import sys
import datetime
import os
import shutil
from mock import Mock, patch
class LoggerTests(unittest.TestCase):<|fim▁hole|>
def setUp(self):
self.logger = logging.Logger()
def tearDown(self):
... | logTxt = 'test log text'
erTxt = 'test error text' |
<|file_name|>test_geopackage.py<|end_file_name|><|fim▁begin|># coding=utf-8
"""
InaSAFE Disaster risk assessment tool by AusAid - **Clipper test suite.**
Contact : ole.moller.nielsen@gmail.com
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Pub... |
# Test to add a raster
layer_name = 'raster_flood' |
<|file_name|>pulse.py<|end_file_name|><|fim▁begin|>'''
Pulse characterization
Created Fri May 12 2017
@author: cpkmanchee
'''
import numpy as np
import os.path
import inspect
from beamtools.constants import h,c,pi
from beamtools.common import normalize, gaussian, sech2, alias_dict
from beamtools.import_data_file im... | pcovGaus = np.zeros((nFitArgs,nFitArgs)) |
<|file_name|>bitcoin_ach.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="ach" version="2.0">
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About CoinsBazar Core</source>
<translation type="u... | </message>
<message> |
<|file_name|>forex.service-spec.ts<|end_file_name|><|fim▁begin|>/// <reference path="../models/forexDeal.ts"/>
/// <reference path="../services/forex.service.ts"/>
'use strict';
describe("forex api service", function(): void {
var forexService: any,
httpBackend: any;
beforeEach(function (){ <|fim▁hole|> fore... | module('app.services');
var run = function($httpBackend: any, _ForexService_: any) { |
<|file_name|>general_neighbor_searching.cpp<|end_file_name|><|fim▁begin|>#include <CGAL/Epick_d.h>
#include <CGAL/point_generators_d.h>
#include <CGAL/Manhattan_distance_iso_box_point.h>
#include <CGAL/K_neighbor_search.h>
#include <CGAL/Search_traits_d.h>
typedef CGAL::Epick_d<CGAL::Dimension_tag<4> > Kernel;
typedef... | Iso_box_d query(pp,qq);
|
<|file_name|>Random_Forrest_Classification.py<|end_file_name|><|fim▁begin|>import pandas as pd<|fim▁hole|>
url = "https://archive.ics.uci.edu/ml/machine-learning-databases/pima-indians-diabetes/pima-indians-diabetes.data"
names = ['preg', 'plas', 'pres', 'skin', 'test', 'mass', 'pedi', 'age', 'class']
df = pd.read_csv... | from sklearn import model_selection
from sklearn.ensemble import RandomForestClassifier |
<|file_name|>yelp_polarity_test.py<|end_file_name|><|fim▁begin|># coding=utf-8
# Copyright 2022 The TensorFlow Datasets 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:/... | testing.test_main() |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>from django.contrib import admin
from alert.donate.models import Donation
from alert.userHandling.models import UserProfile
class DonorInline(admin.TabularInline):
model = UserProfile.donation.through
max_num = 1
raw_id_fields = (<|fim▁hole|>class Donatio... | 'userprofile',
)
|
<|file_name|>a04869.js<|end_file_name|><|fim▁begin|>var a04869 =
[<|fim▁hole|> [ "Label", "a04869.html#ad4701118c2e75f005c1f7e4c53abb35d", null ],
[ "List", "a04869.html#a848ab6ee611dbc860f80a47ecef2faa7", null ],
[ "SampleCount", "a04869.html#aab481329945e65c4aeee79b145e4de51", null ]
];<|fim▁end|> | [ "font_sample_count", "a04869.html#af23335c4319e0c5f010380d9de8f5a6d", null ], |
<|file_name|>UUIDsManager.cpp<|end_file_name|><|fim▁begin|>// Benoit 2011-05-16
#include <ros/node_handle.h>
#include <ros/subscriber.h>
#include <ros/rate.h>
#include <eu_nifti_env_msg_ros/RequestForUUIDs.h>
#include "NIFTiROSUtil.h"
#include "UUIDsManager.h"
namespace eu
{
namespace nifti
{
names... |
uuid = instance->availableUUIDs.front();
instance->availableUUIDs.pop(); |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# -----------------------------------------------------------------------------
# Copyright (C) 2015 Daniel Standage <daniel.standage@gmail.com>
#
# This file is part of tag (http://github.com/standage/tag) and is licensed
# under the BSD 3-c... | def open(filename, mode): |
<|file_name|>FlowableFlatMapSingle.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2016-present, RxJava 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
*
* http://www.a... | public void onError(Throwable e) {
innerError(this, e);
}
|
<|file_name|>note-has-filtered-read.js<|end_file_name|><|fim▁begin|>import getNotes from './get-notes';<|fim▁hole|>export const noteHasFilteredRead = ( noteState, noteId ) =>
noteState.filteredNoteReads.includes( noteId );
export default ( state, noteId ) => noteHasFilteredRead( getNotes( state ), noteId );<|fim▁end|... | |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | export * from './rpcServer'; |
<|file_name|>ValueSerdeFactoryTest.java<|end_file_name|><|fim▁begin|>/**
* Copyright 2011-2021 Asakusa Framework Team.
*
* 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://ww... | HiveDecimal value = HiveDecimal.create(new BigDecimal("123.45"));
assertThat(inspector.copyObject(option), is((Object) option));
assertThat(inspector.copyObject(option), is(not(sameInstance((Object) option)))); |
<|file_name|>MSVSUserFile.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python2.4
# Copyright (c) 2009 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Visual Studio user preferences file writer."""
import common
import os
import r... | # these to add additional capabilities, I suppose, but they might |
<|file_name|>taghelpers.py<|end_file_name|><|fim▁begin|>"""
:Requirements: django-tagging
This module contains some additional helper tags for the django-tagging
project. Note that the functionality here might already be present in
django-tagging but perhaps with some slightly different behaviour or
usage.
"""
from ... | def __init__(self, tags_string, urlname, junctor=None, last_junctor=None):
self.tags_string = template.Variable(tags_string)
self.junctor = junctor is None and ', ' or junctor.lstrip('"').rstrip('"') |
<|file_name|>F.rs<|end_file_name|><|fim▁begin|>#![allow(unused_imports)]
use std::cmp::*;
use std::collections::*;
struct Scanner {
buffer : std::collections::VecDeque<String>
}
impl Scanner {
fn new() -> Scanner {
Scanner {
buffer: std::collections::VecDeque::new()
}
}
fn next<T : ... | if self.buffer.len() == 0 {
let mut input = String::new();
std::io::stdin().read_line(&mut input).ok();
for word in input.split_whitespace() { |
<|file_name|>layout_interface.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/. */
//! The high-level interface from script to layout. ... | } |
<|file_name|>inOutSelector.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
***************************************************************************
inOutSelector.py
---------------------
Date : April 2011
Copyright : (C) 2011 by Giuseppe Sucameli
Email ... |
self.connect(self.selectBtn, SIGNAL("clicked()"), self.selectButtonClicked) |
<|file_name|>camera.rs<|end_file_name|><|fim▁begin|>use corange::*;
#[derive(Clone)]
pub enum CameraType {
Manual,
Orbit,
Free,
}
#[derive(Clone)]
pub struct Camera {
pub position: vec3,
pub target: vec3,
pub fov: f32,
pub near_clip: f32,
pub far_clip: f32,
pub movement: CameraType... | impl Default for Camera { |
<|file_name|>SimpleCommandBus.spec.ts<|end_file_name|><|fim▁begin|>import * as sinon from "sinon";
import * as chai from "chai";<|fim▁hole|>import {CommandHandler} from "../../../main/Apha/CommandHandling/CommandHandler";
import {Command} from "../../../main/Apha/Message/Command";
import {NoCommandHandlerException} fro... | import * as chaiAsPromised from "chai-as-promised";
import {expect} from "chai";
import {SimpleCommandBus} from "../../../main/Apha/CommandHandling/SimpleCommandBus"; |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>__author__ = 'Stephanie'
from ODMconnection import dbconnection
from readSensors import readSensors
from updateSensors import updateSensors
from createSensors import createSensors
from deleteSensors import deleteSensors
<|fim▁hole|> 'deleteSensors',
]<|fim▁end... | __all__ = [
'readSensors',
'updateSensors',
'createSensors', |
<|file_name|>http.py<|end_file_name|><|fim▁begin|>"""
Forwards events to a HTTP call. The configuration used by this notifier
is as follows:
url
Full URL to contact with the event data. A POST request will be made to this
URL with the contents of the events in the body.
Eventually this should be enhanced to suppo... | # Basic headers
headers = {'Accept': 'application/json',
'Content-Type': 'application/json'}
|
<|file_name|>enum_same_crate_empty_match.rs<|end_file_name|><|fim▁begin|>#![deny(unreachable_patterns)]
#[non_exhaustive]
pub enum NonExhaustiveEnum {
Unit,
//~^ not covered
Tuple(u32),
//~^ not covered
Struct { field: u32 }
//~^ not covered
}
pub enum NormalEnum {
Unit,
//~^ not cover... | }
fn main() { |
<|file_name|>clipshape.py<|end_file_name|><|fim▁begin|>__author__ = "Laura Martinez Sanchez"
__license__ = "GPL"
__version__ = "1.0"
__email__ = "lmartisa@gmail.com"
from osgeo import gdal, gdalnumeric, ogr, osr
import numpy as np
from PIL import Image, ImageDraw
from collections import defaultdict
import pickle
impo... | geoTransaux = img.GetGeoTransform() |
<|file_name|>http.src.js<|end_file_name|><|fim▁begin|>define(['jquery','xing'],function($,xing) {
var $body = $('body'),
$progress = $($body.data('progressDisplay')),
$status = $($body.data('statusMessage')),
curPath = window.location.pathname,
baseDir = curP... | xing.http.ajax('POST',path,data,callback,stopLoadingIcon);
},
|
<|file_name|>output.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
INSTR_PER_LINE = 8
<|fim▁hole|>class Output(object):
def __init__(self):
pass
def output_text(self, tokens, outfile):
fd = open(outfile, 'w')
instr_counter = 0
for t in tokens:
... | |
<|file_name|>coherence_copy_like_err_tuple.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://... | fn main() { } |
<|file_name|>gothon_app.py<|end_file_name|><|fim▁begin|>import web
from gothonweb import map
urls = (
'/game', 'GameEngine',
'/', 'Index',
)
app = web.application(urls, globals())
#little hack so that debug mode works with sessions
if web.config.get('_session') is None:
store = web.session.DiskStore('ses... | render = web.template.render('templates/', base="layout")
|
<|file_name|>ConstPointer.cpp<|end_file_name|><|fim▁begin|>#include <iostream>
using namespace std;
void display(const int *xPos, const int *yPos);
void move(int *xPos, int *yPos);
int main(void) {
int x = 10;
int y = 20;
display(&x, &y);
move(&x, &y);
display(&x, &y);
return 0;
}<|fim▁hole|> cout << "Curren... |
void display(const int *xPos, const int *yPos) {
// btw const not needed for this |
<|file_name|>feedback.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import access
import util
@auth.requires_login()
def index():
"""Produces a list of the feedback obtained for a given venue,
or for all venues."""
venue_id = request.args(0)
if venue_id == 'all':
q = (db.submission.u... | db.task.comments.readable = True
ranking_link = None |
<|file_name|>StylesMixin.py<|end_file_name|><|fim▁begin|># Python imports
# Lib imports
from PyInquirer import style_from_dict, Token
# Application imports
class StylesMixin:
"""
The StylesMixin has style methods that get called and
return their respective objects.
"""
def default(self... | Token.Selected: '#5F819D', |
<|file_name|>leader_scroll_dialog.cpp<|end_file_name|><|fim▁begin|>/*
Copyright (C) 2003 - 2016 by David White <dave@whitevine.net>
Part of the Battle for Wesnoth Project http://www.wesnoth.org/
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Publi... | |
<|file_name|>version.go<|end_file_name|><|fim▁begin|>package eventgrid
import "github.com/Azure/azure-sdk-for-go/version"
// 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) A... | } |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#![allow(non_camel_case_types)]
extern crate libc;
use self::libc::{int64_t, size_t, ssize_t, time_t, timeval, uint8_t, uint32_t, uint64_t};
pub type Enum_Unnamed1 = ::libc::c_uint;
pub const LIBRADOS_OP_FLAG_EXCL: ::libc::c_uint = 1;
pub const LIBRADOS_OP_FLAG_FAILOK:... | |
<|file_name|>1138_08_03-flood-fill.py<|end_file_name|><|fim▁begin|>"""
Crawls a terrain raster from a starting
point and "floods" everything at the same
or lower elevation by producing a mask
image of 1,0 values.
"""
import numpy as np
from linecache import getline
def floodFill(c,r,mask):
"""
Crawls ... | check non-recursively.
|
<|file_name|>invalidinstruction.cpp<|end_file_name|><|fim▁begin|>/****************************************************************************<|fim▁hole|>** Copyright (C) 2016 Christian Gagneraud <chgans@gna.org>
** All rights reserved.
**
** GNU Lesser General Public License Usage
** This file may be used under the te... | ** |
<|file_name|>init-tslint.ts<|end_file_name|><|fim▁begin|>import * as oclif from '@oclif/command';
import * as path from 'path';
import {writeJsonFile} from '../utils';
export const commandName = path.basename(__filename, '.js');
// tslint:disable-next-line:no-default-export
export default class InitTsLint extends ocl... | flags.force
); |
<|file_name|>if28.py<|end_file_name|><|fim▁begin|>from polyphony import testbench
def g(x):
if x == 0:
return 0
return 1
def h(x):
if x == 0:
pass
def f(v, i, j, k):
if i == 0:
return v
elif i == 1:
return v<|fim▁hole|> elif i == 2:
h(g(j) + g(k))
... | |
<|file_name|>equality_compare.cc<|end_file_name|><|fim▁begin|>#include "firestore/src/swig/equality_compare.h"
namespace {
template <typename T>
bool EqualityCompareHelper(const T* lhs, const T* rhs) {
return lhs == rhs || (lhs != nullptr && rhs != nullptr && *lhs == *rhs);
}
} // namespace
namespace firebase {
... | bool QueryEquals(const Query* lhs, const Query* rhs) {
return EqualityCompareHelper(lhs, rhs);
} |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# coding=utf-8
"""
The full documentation is at https://python_hangman.readthedocs.org.
"""
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
from setuptools.command.test import test as TestCommand
... | include_package_data=True,
install_requires=requirements,
license='MIT', |
<|file_name|>prelude.rs<|end_file_name|><|fim▁begin|>pub use crate::ansi::AnsiString;
pub use crate::engine::{factory::*, fuzzy::FuzzyAlgorithm};
pub use crate::event::Event;
pub use crate::helper::item_reader::{SkimItemReader, SkimItemReaderOption};
pub use crate::helper::selector::DefaultSkimSelector;
pub use crate::... | pub use crossbeam::channel::{bounded, unbounded, Receiver, Sender};
pub use std::borrow::Cow; |
<|file_name|>ReportSynthesisKeyPartnershipPmu.java<|end_file_name|><|fim▁begin|>package org.cgiar.ccafs.marlo.data.model;
// Generated Jun 20, 2018 1:50:25 PM by Hibernate Tools 3.4.0.CR1
import org.cgiar.ccafs.marlo.data.IAuditLog;
import com.google.gson.annotations.Expose;
/**
* ReportSynthesisMeliaStud... | }
public void setReportSynthesisKeyPartnership(ReportSynthesisKeyPartnership reportSynthesisKeyPartnership) {
|
<|file_name|>Question.go<|end_file_name|><|fim▁begin|>package lib
import (
"log"
"strings"
)
type (
Question struct {
RelatesTo struct {
Answers []string `json:"answers"`
Save bool `json:"save"`
SaveTag string `json:"saveTag"`
} `json:"relatesTo"`
Context []string `json:"context"`
... | for i := range this {
for a := range this[i].RelatesTo.Answers {
if strings.EqualFold(this[i].RelatesTo.Answers[a], prevAnswer) {
return this[i], this[i].RelatesTo.Save |
<|file_name|>psd.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
import math, logging, threading, concurrent.futures
import numpy
import simplespectral
from soapypower import threadpool
logger = logging.getLogger(__name__)
class PSD:
"""Compute averaged power spectral density using Welch's method"""
... | |
<|file_name|>font.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/. */
//! Generic types for font stuff.
use app_units::Au;
use byteor... | /// The keyword used
pub kw: KeywordSize,
/// A factor to be multiplied by the computed size of the keyword |
<|file_name|>RestQuery.js<|end_file_name|><|fim▁begin|>// An object that encapsulates everything we need to run a 'find'
// operation, encoded in the REST API format.
var Parse = require('parse/node').Parse;
import { default as FilesController } from './Controllers/FilesController';
// restOptions can include:
// ... |
// Keep replacing $select clauses
return this.replaceSelect(); |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>extern crate clap;
extern crate yaml_rust;
extern crate lxd;
use std::env;
use std::fs::File;
use std::io::Read;
use clap::{App, Arg, ArgMatches, SubCommand};
use yaml_rust::YamlLoader;
use lxd::{Container,LxdServer};
fn create_dividing_line(widths: &Vec<usize>) ->... | } |
<|file_name|>get_instance_console_output.go<|end_file_name|><|fim▁begin|>package ecs
//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... | response, err = client.GetInstanceConsoleOutput(request) |
<|file_name|>termsSpec.js<|end_file_name|><|fim▁begin|>/* global girderTest, describe, it, expect, runs, waitsFor, girder, beforeEach */
girderTest.importPlugin('terms');
girderTest.startApp();
describe('Create and log in to a user for testing', function () {
it('create an admin user', girderTest.createUser('rock... | var folderId = window.location.hash.split('/')[3];
expect(folderId).toMatch(/[0-9a-f]{24}/);
window.location.assign('#folder/' + folderId);
}); |
<|file_name|>manager.rs<|end_file_name|><|fim▁begin|>// Copyright 2017 The Grin Developers
//
// 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... | /// # use std::path::PathBuf; |
<|file_name|>harfbuzz.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/. */
extern mod harfbuzz;
use font::{Font, FontHandleMethods, Fo... | |
<|file_name|>CreateFileCommand.java<|end_file_name|><|fim▁begin|>package fs.command;
import fs.App;
import fs.Disk;
import fs.util.FileUtils;
import java.util.Arrays;
/**
*
* @author José Andrés García Sáenz <jags9415@gmail.com><|fim▁hole|>public class CreateFileCommand extends Command {
public final static St... | */ |
<|file_name|>cvar.cc<|end_file_name|><|fim▁begin|>// This file is part of the :(){ :|:& };:'s project
// Licensing information can be found in the LICENSE file
// (C) 2014 :(){ :|:& };:. All rights reserved.
#include "sys/common.h"
CVar * CVar::root = NULL;
// --------------------------------------------------------... | valueString = str;
return; |
<|file_name|>generate_executions.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Machine Description Interface C API
#
# This software is delivered under the terms of the MIT License
#
# Copyright (c) 2016 STMicroelectronics
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of... | # copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following
# conditions:
# |
<|file_name|>import.component.ts<|end_file_name|><|fim▁begin|>import {Component} from 'angular2/core';
import {FORM_DIRECTIVES, NgFor} from 'angular2/common';
import {Http} from 'angular2/http';
import {RuneService} from '../../services/rune/rune.service';
import {MasteryService} from '../../services/mastery/mastery.s... | |
<|file_name|>whenMessageEndsWith.test.ts<|end_file_name|><|fim▁begin|>import { MessageHandler } from "../src";
import { MessageMock } from "./__mocks__/message-mock";
describe("MessageHandler.whenMessageEndsWith test", () => {
test("whenMessageEndsWith should fire", () => {
// Given
const handler =... | handler.whenMessageEndsWith("foo").do(callback)
// When |
<|file_name|>nav.js<|end_file_name|><|fim▁begin|>/* globals $ */
const modals = window.modals;
const footer = window.footer;
const notifier = window.notifier;
const admin = window.admin;
((scope) => {
const modalLogin = modals.get("login");
const modalRegister = modals.get("register");
const helperFuncs = ... | });
|
<|file_name|>AuthService.spec.ts<|end_file_name|><|fim▁begin|>import {addProviders} from '@angular/core/testing'
import {Response, ResponseOptions, RequestMethod} from '@angular/http'
import {injectService, defaultProviders} from '../../../testing/Utils'
import {Environment} from '../../Environment'
import {AuthService... | function createUrl(endpoint: string) {
return Environment.HOST + endpoint
} |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import include, url
from . import views<|fim▁hole|> url(r'^hello', views.hello),
]<|fim▁end|> |
urlpatterns = [
url(r'^$', views.channel_list),
url(r'^play', views.play_channel), |
<|file_name|>binary_manager.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 __future__ import print_function
from __future__ import absolute_import
import contextlib
im... | dep_platform = '%s_%s' % (os_name, arch_name)
c = base_config.BaseConfig(config, writable=True) |
<|file_name|>UrlInputHistory.ts<|end_file_name|><|fim▁begin|>/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.<|fim▁hole|> * Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*... | |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>"use strict"
const messages = require("..").messages
const ruleName = require("..").ruleName
const rules = require("../../../rules")
<|fim▁hole|>testRule(rule, {
ruleName,
config: ["always"],
accept: [ {
code: "a { background-size: 0 , 0; }",
}, {
cod... | const rule = rules[ruleName]
|
<|file_name|>CompiledOperation.java<|end_file_name|><|fim▁begin|>/*
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license
* agreements. See the NOTICE file distributed with this work for additional information regarding
* copyright ownership. The ASF licenses this file to You under... |
// check if the receiver is the iterator, in which
// case we resolve the method on the constraint rather |
<|file_name|>test-utils.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*-
import base64
import hashlib
import io
import nose
import requests
import aliyunauth.utils
import aliyunauth.consts<|fim▁hole|>def test_cal_b64md5():
s_data = b"foo"
l_data = b"bar" * aliyunauth.consts.MD5_CHUNK_SIZE
# normal ... | |
<|file_name|>sensor.py<|end_file_name|><|fim▁begin|>"""The Minecraft Server sensor platform."""
from __future__ import annotations
from typing import Any
from homeassistant.components.sensor import SensorEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import TIME_MILLISECONDS
from... | |
<|file_name|>BlockingRpcResponse.java<|end_file_name|><|fim▁begin|>package io.teknek.nibiru.transport.rpc;
import io.teknek.nibiru.transport.BaseResponse;
public class BlockingRpcResponse<T> implements BaseResponse {
private String exception;
private T rpcResult;
public BlockingRpcResponse(){
}
pub... |
public void setException(String exception) { |
<|file_name|>main.cpp<|end_file_name|><|fim▁begin|>#include <rx/iterate.hpp>
#include <rx/sum.hpp>
#include <rx/take.hpp>
#include <rx/select.hpp>
#include <rx/where.hpp>
#include <rx/concurrency.hpp>
#include <boost/lexical_cast.hpp>
#include <iostream>
template<class T>
class ConsoleWriter
{
public:
typedef T ... | |
<|file_name|>Parent001.java<|end_file_name|><|fim▁begin|>package cn.bjsxt.oop.staticInitBlock;
public class Parent001 /*extends Object*/ {
static int aa;
static {
System.out.println(" 静态初始化Parent001");
aa=200;
<|fim▁hole|><|fim▁end|> | }
} |
<|file_name|>alias.js<|end_file_name|><|fim▁begin|>import { get } from "ember-metal/property_get";
import { set } from "ember-metal/property_set";
import Ember from "ember-metal/core"; // Ember.assert
import EmberError from "ember-metal/error";
import {
Descriptor,
defineProperty
} from "ember-metal/properties";
im... | defineProperty(obj, keyName, null);
return set(obj, keyName, value);
} |
<|file_name|>mongo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Author: Leo Vidarte <http://nerdlabs.com.ar>
#
# This file is part of lai-client.
#
# lai-client is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3
# as published by the Fr... | if doc.id:
return self.update(doc)
else:
return self.insert(doc) |
<|file_name|>MibObj.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
* This file is part of OpenNMS(R).
*
* Copyright (C) 2011-2012 The OpenNMS Group, Inc.
* OpenNMS(R) is Copyright (C) 1999-2012 The OpenNMS Group, Inc.
*
* OpenNMS(R) is a register... | |
<|file_name|>ucs_decode.py<|end_file_name|><|fim▁begin|>'''
Created on Feb 4, 2016
Decoding tables taken from https://github.com/typiconman/Perl-Lingua-CU
@author: mike kroutikov
'''
from __future__ import print_function, unicode_literals
import codecs
def ucs_decode(input_, errors='strict'):
return ''.join(dec... | '\u0440\u0483', # lowercase re with titlo
'\u0467\u0300', # lowercase small yus with grave
'\u047e', # capital OT
'\u041e\u0443', # diagraph capital UK |
<|file_name|>jquery.multi-select.js<|end_file_name|><|fim▁begin|>/*
* MultiSelect v0.9.8
* Copyright (c) 2012 Louis Cuny
*
* This program is free software. It comes without any warranty, to
* the extent permitted by applicable law. You can redistribute it
* and/or modify it under the terms of the Do What The Fuck You W... | |
<|file_name|>update-list-item.3.x.js<|end_file_name|><|fim▁begin|>// To set up environmental variables, see http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;<|fim▁hole|>const Twilio = require('twilio').Twilio;
const client = new Twilio(accountSid, authToken);
const service = client.sync.services... | const authToken = process.env.TWILIO_AUTH_TOKEN; |
<|file_name|>test_client.py<|end_file_name|><|fim▁begin|># Copyright (c) 2010-2011 OpenStack, LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENS... | # I'll leave it for now.
self.assertEquals(type(value), dict) |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache... | """
Convert python list to java type array
:param gateway: Py4j Gateway
:param jtype: java type of element in array
|
<|file_name|>create_proposals.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Copyright 2015 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
#
# ... | |
<|file_name|>api_test.go<|end_file_name|><|fim▁begin|>package keyapi
import (
"bytes"
"crypto/tls"
"crypto/x509"
"errors"
"io/ioutil"
"log"
"net"
"net/http"
"net/http/httptest"
"strings"
"testing"
"time"
"github.com/sipb/homeworld/platform/keysystem/keyserver/account"
"github.com/sipb/homeworld/platform... | if err == nil { |
<|file_name|>WB_MutableCoordinateMath3D.java<|end_file_name|><|fim▁begin|>/*
* HE_Mesh Frederik Vanhoutte - www.wblut.com
*
* https://github.com/wblut/HE_Mesh
* A Processing/Java library for for creating and manipulating polygonal meshes.
*
* Public Domain: http://creativecommons.org/publicdomain/zero/1.0/
*... | |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>"""simpleplantms URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to url... | |
<|file_name|>friendly-unit.js<|end_file_name|><|fim▁begin|>ig.module(<|fim▁hole|>).defines(function () {
FriendlyUnit = Unit.extend({
// Nothing yet!
});
});<|fim▁end|> | 'game.entities.abstract.friendly-unit'
).requires(
'game.entities.abstract.unit' |
<|file_name|>NewMovie.js<|end_file_name|><|fim▁begin|>module.exports = function() {
'use strict';
this.title = element(by.model('movie.title'));
this.releaseYear = element(by.model('movie.releaseYear'));
this.description = element(by.css('div[contenteditable=true]'));
this.save = element(by.css('.b... | this.releaseYear.clear();
this.releaseYear.sendKeys(releaseYear); |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# d$
#
# This program is free so... | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.