prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>route_lifecycle_reflector.js<|end_file_name|><|fim▁begin|>import { Type } from 'angular2/src/facade/lang';
import { CanActivate } from './lifecycle_annotations_impl';
import { reflector } from 'angular2/src/core/reflection/reflection';
export function hasLifecycleHook(e, type) {
if (!(type instanceof T... | var annotations = reflector.annotations(type);
for (let i = 0; i < annotations.length; i += 1) { |
<|file_name|>ActionType.java<|end_file_name|><|fim▁begin|>package trendli.me.makhana.common.entities;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
public enum ActionType
{
MOVE( "Moving", "newTile" ), FABRICATING( "Fabricating" );
private final String verb;
private final ... | |
<|file_name|>FormModel.js<|end_file_name|><|fim▁begin|>//Pathway model
var FormModel = function () {
var self = this;
self.id = undefined;
self.name = undefined;
self.dataElements = []
ko.track(self);
<|fim▁hole|>
console.log('need to add form previe... |
self.previewForm = function(){ |
<|file_name|>dist.rs<|end_file_name|><|fim▁begin|>// Tests of installation and updates from a v2 Rust distribution
// server (mocked on the file system)
pub mod mock;
use std::cell::Cell;
use std::collections::HashMap;
use std::env;
use std::fs;
use std::path::Path;
use std::str::FromStr;
use std::sync::Arc;
use url... | |
<|file_name|>curry.js<|end_file_name|><|fim▁begin|>//>>built
define("dojox/lang/functional/curry",["dijit","dojo","dojox","dojo/require!dojox/lang/functional/lambda"],function(_1,_2,_3){
_2.provide("dojox.lang.functional.curry");
_2.require("dojox.lang.functional.lambda");
(function(){
var df=_3.lang.functional,ap=Arra... | f=df.lambda(f);
return function(){ |
<|file_name|>IncrementCounterListener.java<|end_file_name|><|fim▁begin|>/* 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 req... | */
package org.camunda.bpm.engine.test.api.runtime.util; |
<|file_name|>result.rs<|end_file_name|><|fim▁begin|>//! A module describing Lox-specific Result and Error types
use object::Object;
use std::result;
use std::error;
use std::fmt;
use std::io;
/// A Lox-Specific Result Type
pub type Result<T> = result::Result<T, Error>;
/// A Lox-Specific Error
#[derive(Debug)]
pub ... | } |
<|file_name|>rpc_getchaintips.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# Copyright (c) 2014-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the getchaintips RPC.
- introduce a... | longTip = tips[0]
assert_equal (longTip['branchlen'], 0)
assert_equal (longTip['height'], 220) |
<|file_name|>FrequencyTypeDeserializer.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2015-2018 Jeeva Kandasamy (jkandasa@gmail.com)
* and other contributors as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with... | @Override |
<|file_name|>instruction.rs<|end_file_name|><|fim▁begin|>//!
//! MOS 6502 Instruction set
//!
use std::fmt;
use addr::Address;
use mem::Addressable;
use super::{Mos6502, Operand, IRQ_VECTOR};
use super::{CarryFlag, ZeroFlag, InterruptDisableFlag, DecimalFlag};
use super::{BreakFlag, UnusedAlwaysOnFlag, NegativeFlag, O... | if carry { result |= 0x01 }
operand.set(cpu, result);
cpu.set_zn(result); |
<|file_name|>forward_ref.ts<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {ForwardRefFn, Inject, ReflectiveInjector, forwardRe... | // #docregion forward_ref
class Door {
lock: Lock;
constructor(@Inject(forwardRef(() => Lock)) lock: Lock) { this.lock = lock; } |
<|file_name|>unic.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# *-* coding: UTF-8 *-*
"""Problema unic."""
from __future__ import print_function
def gaseste_unic(istoric):
"""unic"""
result = istoric.pop()
for numar in istoric:
result = result ^ numar
return result
<|fim▁hole|>if _... | |
<|file_name|>sql.js<|end_file_name|><|fim▁begin|>function Migrator(config, transactionDb) {
this.db = transactionDb;
this.dbname = config.adapter.db_name;
this.table = config.adapter.collection_name;
this.idAttribute = config.adapter.idAttribute;
this.column = function(name) {
var parts = na... | |
<|file_name|>test_authorization.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.test import TestCase, RequestFactory
from django.contrib.auth import get_user_model, authenticate
from django.contrib.auth.models import AnonymousUser
import json
import status
f... |
class IsAuthenticatedOrReadOnlyAPIView(IsAuthenticatedOrReadOnlyMixin,
APIView): |
<|file_name|>task_for_master.cpp<|end_file_name|><|fim▁begin|>//
// tast_for_master.cpp
// ActorModel
//
// Created by Dmitriy Kuragin on 11/14/13.
// Copyright (c) 2013 Dmitriy Kuragin. All rights reserved.
//
#include "task_for_master.h"<|fim▁hole|>{
return l.square - r.square < FLT_EPSILON && l.client == r.... | #include <cfloat>
bool operator == (task_for_master const& l, task_for_master const& r) |
<|file_name|>terminal_colors_unix.go<|end_file_name|><|fim▁begin|>// Copyright 2014-2015 Apcera Inc. All rights reserved.
// +build !windows
package terminal
import "fmt"
var ColorError int = 167
var ColorWarn int = 93
var ColorSuccess int = 82
var ColorNeutral int = 50
var BackgroundColorBlack = "\033[30;49m"
var ... | // Display helpers
//--------------------------------------------------------------------------- |
<|file_name|>nxtBridgeCtrl.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Copyright (c) 2014 l8orre
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 wit... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># isort:skip_file
from .data_connector import DataConnector
from .runtime_data_connector import RuntimeDataConnector
from .file_path_data_connector import FilePathDataConnector
from .configured_asset_file_path_data_connector import (
ConfiguredAssetFilePathData... | ) |
<|file_name|>arbitrary_self_types_struct.rs<|end_file_name|><|fim▁begin|>// Copyright 2017 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://ww... | impl Foo { |
<|file_name|>control_poshold.cpp<|end_file_name|><|fim▁begin|>/// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
#include "Copter.h"
#if POSHOLD_ENABLED == ENABLED
/*
* control_poshold.pde - init and run calls for PosHold flight mode
* PosHold tries to improve upon regular loiter by ... | #define POSHOLD_STICK_RELEASE_SMOOTH_ANGLE 1800 // max angle required (in centi-degrees) after which the smooth stick release effect is applied
#define POSHOLD_WIND_COMP_ESTIMATE_SPEED_MAX 10 // wind compensation estimates will only run when velocity is at or below this speed in cm/s |
<|file_name|>cannot-mutate-captured-non-mut-var.rs<|end_file_name|><|fim▁begin|>#![feature(unboxed_closures)]
use std::io::Read;
fn to_fn_once<A,F:FnOnce<A>>(f: F) -> F { f }
fn main() {
let x = 1;
to_fn_once(move|| { x = 2; });
//~^ ERROR: cannot assign to `x`, as it is not declared as mutable
let ... | } |
<|file_name|>pessoa-model.js<|end_file_name|><|fim▁begin|>/**
* Created by Hernandes on 21/04/2016.
*/
function PessoaModel(m){
var self = this;
<|fim▁hole|> self.Nome = ko.observable('').extend({required:true,editable:true});
self.Email = ko.observable('').extend({required:true,editable:true});
... | var base = new BaseModel();
ko.utils.extend(self,base);
self.PessoaID = ko.observable().defaultValue(0).extend({required:true});
|
<|file_name|>issue-50493.rs<|end_file_name|><|fim▁begin|>// Copyright 2016 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... | #[macro_use]
extern crate issue_50493;
|
<|file_name|>editor-tab.js<|end_file_name|><|fim▁begin|>define([
'jquery',
'room-info',
'local-session',
'utils',
'connection',
'mode-list'
], function ($, roomInfo, localSession, Utils, connection, modeList) {
"use strict";
/**
* タブ単体の制御
* @param {String} viewerId
* @param {String} tabId
* @param {String} t... | */
serialize: function () {
var data = this.getState(); |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from distutils.core import setup
setup(
name="flowtools",
description="Tools for flow maps from modified Gromacs simulations",
long_description="See README.md",
license='GPLv3',
version='0.2.30',
u... | 'scripts/f_flowmaps.py',
'scripts/f_print.py',
'scripts/f_spread_delta_t.py', |
<|file_name|>perf_embedding.py<|end_file_name|><|fim▁begin|>import sys, os
from pythonparser import diagnostic<|fim▁hole|>from ..module import Module
from ..embedding import Stitcher
from ..targets import OR1KTarget
from . import benchmark
def main():
if not len(sys.argv) == 2:
print("Expected exactly one... | from ...language.environment import ProcessArgumentManager
from ...master.databases import DeviceDB, DatasetDB
from ...master.worker_db import DeviceManager, DatasetManager |
<|file_name|>test_sample_images.py<|end_file_name|><|fim▁begin|># Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
... | # Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, |
<|file_name|>custom.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
from bokeh.core.properties import String
from bokeh.document import Document
from bokeh.embed import file_html
from bokeh.models.callbacks import Callback
from bokeh.models.glyphs import Circle
from bokeh.models import Plot, Data... | |
<|file_name|>tagme.py<|end_file_name|><|fim▁begin|>"""
TAGME implementation
@author: Faegheh Hasibi (faegheh.hasibi@idi.ntnu.no)
"""
import argparse
import math
from nordlys.config import OUTPUT_DIR
from nordlys.tagme import config
from nordlys.tagme import test_coll
from nordlys.tagme.query import Query
from nordlys... | disamb_ens = {}
for m_i in self.rel_scores:
if len(self.rel_scores[m_i].keys()) == 0: |
<|file_name|>chalk_initial_program.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>
impl Foo for i32 { }
impl Foo for u32 { }
fn gimme<F: Foo>() { }
// Note: this also tests that `std::process::Termination` is implemented for `()`.
fn main() {
gimme::<i32>();
gimme::<u32>();
gimme::<f32>(); //~ERROR the trai... | // compile-flags: -Z chalk
trait Foo { } |
<|file_name|>UsbFacadeTest.java<|end_file_name|><|fim▁begin|>package com.felhr.usbmassstorageforandroid.bulkonlytests;
import android.hardware.usb.UsbConstants;
import android.hardware.usb.UsbDevice;
import android.hardware.usb.UsbDeviceConnection;
import android.hardware.usb.UsbInterface;
import com.felhr.usbmasssto... |
// Initialize and inject dependencies
usbFacade = new UsbFacade(mDevice, mConnection);
usbFacade.setCallback(mCallback); |
<|file_name|>exp2f64.rs<|end_file_name|><|fim▁begin|>#![feature(core, core_intrinsics, core_float)]
extern crate core;
#[cfg(test)]
mod tests {
use core::intrinsics::exp2f64;
use core::num::Float;
use core::f64;
// pub fn exp2f64(x: f64) -> f64;
#[test]
fn expf64_test1() {
let x: f64 = f64... |
#[test]
fn expf64_test2() { |
<|file_name|>estr-shared.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<|fim▁hole|>// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the M... | // http://rust-lang.org/COPYRIGHT.
// |
<|file_name|>callnode.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Publ... | if (n != NULL && n->is_Unlock()) {
UnlockNode *unlock = n->as_Unlock();
if (lock->obj_node()->eqv_uncast(unlock->obj_node()) &&
BoxLockNode::same_slot(lock->box_node(), unlock->box_node()) && |
<|file_name|>test_texture.rs<|end_file_name|><|fim▁begin|>extern crate image;
use std::path::Path;
use self::image::GenericImage;
#[allow(unused_imports)]
use std::collections::HashMap;
#[allow(unused_imports)]
use implement::render::texture::{ TextureNormalized, TextureBuiltin, Texture, Channel };
#[allow(unused_im... | let t_modulated_checker : Texture = texture::modulate( &t_checker, &channel_val );
assert!( 255u8 == t_modulated_solid[(0usize,Channel::R)] );
assert!( 120u8 == t_modulated_solid[(0usize,Channel::G)] ); |
<|file_name|>NumberRange.java<|end_file_name|><|fim▁begin|>/* Copyright 2008, 2009, 2010 by the Oxford University Computing Laboratory
This file is part of HermiT.
HermiT is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published b... | |
<|file_name|>addon-links.stories.js<|end_file_name|><|fim▁begin|><|fim▁hole|>import React from 'react';
import { storiesOf } from '@storybook/react';
import { linkTo, hrefTo } from '@storybook/addon-links';
import LinkTo from '@storybook/addon-links/react';
import { action } from '@storybook/addon-actions';
storiesOf(... | |
<|file_name|>gulpfile.js<|end_file_name|><|fim▁begin|>// ## Globals
var argv = require('minimist')(process.argv.slice(2));
var autoprefixer = require('gulp-autoprefixer');
var browserSync = require('browser-sync').create();
var changed = require('gulp-changed');
var concat = require('gulp-concat');
... | // `config` - Store arbitrary configuration values here.
var config = manifest.config || {}; |
<|file_name|>client.py<|end_file_name|><|fim▁begin|>from flask import Flask, redirect, url_for, session, request, render_template_string, abort
import requests
import os
import ast
import base64
from nocache import nocache
#App config
ALLOWED_EXTENSIONS = set(['mp4'])
app = Flask(__name__)
app.secret_key = os.urandom... | password = request.form['password']
video_ID = request.form['video_ID']
is_deleted = ((requests.post(url='http://127.0.0.1:8080/delete-video', data={'username' : username, 'password' : password, 'video_ID' : video_ID})).content).decode("utf-8") # Done |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>try:
from setuptools import setup
except ImportError:
from distutils.core import setup
try:
with open('README.rst') as file:
long_description = file.read()
except IOError:<|fim▁hole|> long_description = 'Python lib for sniffets.com'
setup(
... | |
<|file_name|>ScatterView.js<|end_file_name|><|fim▁begin|>define(function (require) {
var SymbolDraw = require('../helper/SymbolDraw');
var LargeSymbolDraw = require('../helper/LargeSymbolDraw');
require('../../echarts').extendChartView({
type: 'scatter',
init: function () {
... | var data = seriesModel.getData();
var largeSymbolDraw = this._largeSymbolDraw;
var normalSymbolDraw = this._normalSymbolDraw;
|
<|file_name|>bench.rs<|end_file_name|><|fim▁begin|>#![feature(test)]
extern crate robots;
extern crate test;
use std::any::Any;
use std::sync::{Arc, Mutex};
use std::sync::mpsc::{channel, Sender};
use robots::actors::{Actor, ActorSystem, ActorCell, ActorContext, Props};
use test::Bencher;
#[derive(Copy, Clone, Par... | InternalState { sender: sender } |
<|file_name|>entity.py<|end_file_name|><|fim▁begin|>##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties,... | "entity_read", |
<|file_name|>forms.py<|end_file_name|><|fim▁begin|># Copyright 2013 Kylin OS, 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... | redirect = reverse('horizon:admin:instances:index') |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>def get_timestamp():
import time
return int(time.time())
def load_name_map(map_file_path):
from os.path import isfile
import ConfigParser
<|fim▁hole|> raise Exception("Missing effort in {0}".format(map_file_path))
retval = {}
for op... | config = ConfigParser.RawConfigParser()
config.read(map_file_path)
if not config.has_section("effort"): |
<|file_name|>makerealworddoc.py<|end_file_name|><|fim▁begin|>#coding=gbk
"""Convert HTML page to Word 97 document
This script is used during the build process of "Dive Into Python"
(http://diveintopython.org/) to create the downloadable Word 97 version
of the book (http://diveintopython.org/diveintopython.doc)
Looks ... | |
<|file_name|>tmux.rs<|end_file_name|><|fim▁begin|>use fastup::{Document, Node};
use fastup::Node::*;
use color::Color888;
use std::fmt;
#[derive(Debug, Copy, Clone, Default)]
pub struct Renderer;
impl super::Renderer for Renderer {
fn render(&self, doc: &Document) -> String {
let env = Environment::defaul... | style += &format!(",fg=#{}", color); |
<|file_name|>make_fileids.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os, sys
def touch(path):
with open(path, 'a'):
os.utime(path, None)<|fim▁hole|>for fn in sorted(os.listdir('.')):
if not fn.endswith('.wav'):
continue
base_fn = os.path.splitext(fn)[0]
txt_fn = base_f... |
fout = open('sample.fileids', 'wb')
fout2 = open('sample.transcription', 'wb') |
<|file_name|>vfnmsub231ps.rs<|end_file_name|><|fim▁begin|>use ::{BroadcastMode, Instruction, MaskReg, MergeMode, Mnemonic, OperandSize, Reg, RoundingMode};
use ::RegType::*;
use ::instruction_def::*;
use ::Operand::*;
use ::Reg::*;
use ::RegScale::*;
fn vfnmsub231ps_1() {
run_test(&Instruction { mnemonic: Mnemonic... | |
<|file_name|>ami2stomp-get.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# vim: set expandtab shiftwidth=4:
# http://www.voip-info.org/wiki/view/asterisk+manager+events
import sys,time
import simplejson as json
from stompy.simple import Client
import ConfigParser<|fim▁hole|>config = ConfigParser.ConfigParser()... | |
<|file_name|>controllers.js<|end_file_name|><|fim▁begin|>movieApp.
controller('MovieController', function($scope, MovieService) {
$scope.listMovies = function () {
MovieService.listMovies()
.success(function (result) {
$scope.movies = result;
})
.error(function (error) {
... | |
<|file_name|>MessageRestServiceTest.java<|end_file_name|><|fim▁begin|>package org.camunda.bpm.engine.rest.wink;
import org.camunda.bpm.engine.rest.AbstractMessageRestServiceTest;
import org.camunda.bpm.engine.rest.util.WinkTomcatServerBootstrap;<|fim▁hole|>import org.junit.AfterClass;
import org.junit.BeforeClass;
pu... | |
<|file_name|>data-persister.js<|end_file_name|><|fim▁begin|>/// <reference path="lib/jquery-2.0.3.js" />
define(["httpRequester"], function (httpRequester) {
function getStudents() {
var url = this.url + "api/students/";
return httpRequester.getJSON(url);
}
function getMarksByStudentId(st... | students: getStudents,
marks: getMarksByStudentId,
url: this.url |
<|file_name|>logger.js<|end_file_name|><|fim▁begin|>Object.defineProperty(exports, '__esModule', {
value: true
});
const path = require('path');
<|fim▁hole|>// explicitly set the config dir, otherwise if oxygen is globally installed it will use cwd
let originalNodeCfgDir = process.env.NODE_CONFIG_DIR;
process.env.... | |
<|file_name|>doc-before-struct-rbrace-2.rs<|end_file_name|><|fim▁begin|>struct X {
a: u8 /// document
//~^ ERROR found a documentation comment that doesn't document anything<|fim▁hole|>fn main() {
let y = X {a: 1};
}<|fim▁end|> | //~| HELP maybe a comment was intended
}
|
<|file_name|>clients.py<|end_file_name|><|fim▁begin|># Copyright 2014 - Rackspace Hosting.
#
# 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
... | |
<|file_name|>mod.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/. */
//! Servo heavily uses display lists, which are retained-mode lis... | |
<|file_name|>derive_macros.rs<|end_file_name|><|fim▁begin|>#![allow(clippy::bool_assert_comparison)]
use liquid::{Parser, ParserBuilder};
use liquid_core::parser::FilterReflection;
mod derive_macros_test_filters;
fn build_parser() -> Parser {
ParserBuilder::new()
.filter(derive_macros_test_filters::TestP... | .parse("{{ 0 | state: \"hello\" }}")
.unwrap() |
<|file_name|>UpdatingDataGetter.js<|end_file_name|><|fim▁begin|>/**
* Created by kalle on 12.5.2014.
*/
/// <reference path="jquery.d.ts" />
var TheBall;
(function (TheBall) {
(function (Interface) {
(function (UI) {
var ResourceLocatedObject = (function () {
function ResourceLoc... | UI.ResourceLocatedObject = ResourceLocatedObject;
|
<|file_name|>permissions.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from cms.exceptions import NoPermissionsException
from cms.models import Page, PagePermission, GlobalPagePermission
from cms.plugin_pool import plugin_pool
from cms.utils import get_cms_setting
from django.conf import settings
from django.... | # those
return 0
try: |
<|file_name|>fn-types.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/licens... | fn main() { } |
<|file_name|>uuid.hpp<|end_file_name|><|fim▁begin|>/* Gnomescroll, Copyright (c) 2013 Symbolic Analytics
* Licensed under GPLv3 */
#pragma once
#include <uuid/uuid.h>
#include <serializer/constants.hpp>
namespace serializer
{
// returns bytes written, excluding NUL
size_t write_uuid(char* str, size_t buffer_size, u... |
} // serializer |
<|file_name|>creator.go<|end_file_name|><|fim▁begin|>// Copyright 2018 Project Harbor 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/licenses/LICEN... | |
<|file_name|>bytes.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>}
impl<'a> Unit<'a> {
const fn new(value: f32, name: &str) -> Unit {
Unit { value, name }
}
}
const BYTE_UNITS: [Unit; 6] = [
Unit::new(1e3, "k"),
Unit::new(1e6, "M"),
Unit::new(1e9, "G"),
Unit::new(1e12, "T"),
Unit::ne... | struct Unit<'a> {
value: f32,
name: &'a str, |
<|file_name|>fetchComponentDataBeforeRender.js<|end_file_name|><|fim▁begin|>/**
* This looks at static needs parameter in components and waits for the promise to be fullfilled
* It is used to make sure server side rendered pages wait for APIs to resolve before
* returning res.end()
*<|fim▁hole|>
export function fet... | * As seen in: https://github.com/caljrimmer/isomorphic-redux-app
*/ |
<|file_name|>KPNdef.java<|end_file_name|><|fim▁begin|>package net.lardcave.keepassnfc.nfccomms;
import android.content.Intent;
import android.content.IntentFilter;
import android.nfc.FormatException;
import android.nfc.NdefMessage;
import android.nfc.NdefRecord;
import android.nfc.NfcAdapter;
import android.nfc.Tag;
i... | public byte[] getSecretKey() {
return secretKey; |
<|file_name|>home-test.js<|end_file_name|><|fim▁begin|>(function () {
'use strict';
/**
* @ngdoc function
* @name app.test:homeTest
* @description
* # homeTest
* Test of the app
*/
describe('homeCtrl', function () {
var controller = null, $scope = null, $location;
beforeEach(function () {
module('g4m... | $scope: $scope
}); |
<|file_name|>AppBuilder.js<|end_file_name|><|fim▁begin|>const
path = require('path'),
fs = require('fs'),
glob = require('glob'),
pug = require('pug'),
stylus = require('stylus'),
nib = require('nib'),
autoprefixer = require('autoprefixer-stylus'),
{rollup} = require('rollup'),
rollupPluginPug = requi... | throw error;
}
this.onEnd('viewer js bundle generated.'); |
<|file_name|>index.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | module.exports = require( "./src/LRUCache" ); |
<|file_name|>main.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | import CommuniqueApp from './communique-app';
CommuniqueApp.open(); |
<|file_name|>missing_newline.py<|end_file_name|><|fim▁begin|><|fim▁hole|>import ast
# This comment should not prevent the I201 below, it is not a newline.
import X # I201
import flake8_import_order # I201<|fim▁end|> | # appnexus cryptography edited google pep8 smarkets |
<|file_name|>find.spec.js<|end_file_name|><|fim▁begin|>import Database from "almaden";
import Collection from "../../lib/collection.js";
import Model from "../../../";
import {ModelQuery} from "../../lib/modelFinder.js";
import {User} from "../testClasses.js";
import databaseConfig from "../databaseConfig.json";
let ... | describe("(instance way)", () => {
beforeEach(() => {
database = new Database(databaseConfig); |
<|file_name|>sql_transformer.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 ... | |
<|file_name|>test_listhostshandler.py<|end_file_name|><|fim▁begin|>try:
import json
except ImportError:
import simplejson as json<|fim▁hole|>
from . import TestCase
from server import ListHostsHandler
class TestListHostsHandler(TestCase):
def setUp(self):
"""
Create an instance each time ... | |
<|file_name|>rsa.rs<|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 License, Ve... | |
<|file_name|>DownloadServlet.java<|end_file_name|><|fim▁begin|>/**
* OpenKM, Open Document Management System (http://www.openkm.com)
* Copyright (c) 2006-2015 Paco Avila & Josep Llort
*
* No bytes were intentionally harmed during the development of this application.
*
* This program is free software; you can re... | |
<|file_name|>streams_to_stream_ff_1i_base.cpp<|end_file_name|><|fim▁begin|>/*
* This file is protected by Copyright. Please refer to the COPYRIGHT file
* distributed with this source distribution.
*
* This file is part of GNUHAWK.
*
* GNUHAWK is free software: you can redistribute it and/or modify is under the ... | |
<|file_name|>trait-cast.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/lice... | right: Option<Tree>, |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding:utf-8 -*-
from setuptools import setup
setup(
name='libipa',
version='0.0.6',
author='Andrew Udvare',<|fim▁hole|> packages=['ipa'],
scripts=['bin/ipa-unzip-bin', 'bin/ipa-dump-info'],
url='https://github.com/T... | author_email='audvare@gmail.com', |
<|file_name|>test_file.py<|end_file_name|><|fim▁begin|>from runtests.mpi import MPITest
from nbodykit.lab import *
from nbodykit import setup_logging
from numpy.testing import assert_allclose
import tempfile
import os
@MPITest([1])
def test_hdf(comm):
import h5py
# fake structured array
dset = numpy.empt... | source = HDFCatalog(tmpfile, dataset='X', attrs={"Nmesh":32}, comm=comm)
assert_allclose(source['Position'], dset['Position'])
region = source.query_range(32, 64) |
<|file_name|>build.rs<|end_file_name|><|fim▁begin|>// Copyright (c) 2014 Richard Diamond & contributors.
//
// This file is part of Rust Rocket.
//
// Rust Rocket 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 F... | use rustc::back::svh::Svh; |
<|file_name|>solari_fr.ts<|end_file_name|><|fim▁begin|><TS language="fr" version="2.0">
<context>
<name>AddressBookPage</name>
<message>
<source>Double-click to edit address or label</source>
<translation>Double cliquer afin de modifier l'adresse ou l'étiquette</translation>
</message>
<... | <translation>L'adresse du destinataire n’est pas valide, veuillez la vérifier.</translation>
</message>
<message> |
<|file_name|>ldap3mock.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
2020-09-07 Cornelius Kölbel <cornelius.koelbel@netknights.it>
Add exception
2017-04-26 Friedrich Weber <friedrich.weber@netknights.it>
Make it possible to check for correct LDAPS/STARTTLS settings
2017-01-08 Corneli... | |
<|file_name|>IMazeSolverWithPower.java<|end_file_name|><|fim▁begin|>package cs2020;
public interface IMazeSolverWithPower extends IMazeSolver {
/**
* Finds the shortest path from a given starting coordinate to an
<|fim▁hole|> * @param startCol
* @param endRow
* @param endCol
* @param superpowers
... | * ending coordinate with a fixed number of Powers given
*
* @param startRow
|
<|file_name|>gensets.py<|end_file_name|><|fim▁begin|>"""
Hannah Aizenman
10/13/2013
Generates a random subset of size 10^P for p in [1,MAX_P) from [0, 10^8)
"""
import random
MAX_P = 8
max_value = 10**MAX_P
large_set = range(max_value)
for p in xrange(1,MAX_P):
print "list of size: 10^{0}".format(p)
f = ope... | f.close() |
<|file_name|>build.js<|end_file_name|><|fim▁begin|>import isNil from "lodash/isNil";<|fim▁hole|>import isArray from "lodash/isArray";
import isFunction from "lodash/isFunction";
import isObject from "lodash/isObject";
import mergeWith from "lodash/mergeWith";
import Fakerator from "lib/fakerator";
module.exports = fu... | |
<|file_name|>main.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
try:
import simplejson as json
except ImportError:
import json
import logging
import werkzeug
from openerp import http
from openerp.http import request
_logger = logging.getLogger(__name__)
class SipsController(http.Controller):
... | else:
_logger.warning('Sips: data are corrupted') |
<|file_name|>trace_test.py<|end_file_name|><|fim▁begin|># Copyright 2011 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.
import tempfile
import unittest
from .log import *
from .parsed_trace_events import *
class TraceTe... | unittest.TestCase.__init__(self, *args)
self._file = None |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls.defaults import patterns, url
urlpatterns = patterns('',<|fim▁hole|><|fim▁end|> | url(r'^$', 'tests.views.index'),
) |
<|file_name|>mod.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.
//<|fim▁hole|>// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://op... | // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or |
<|file_name|>ing-experience-design.min.js<|end_file_name|><|fim▁begin|>/*!
* Office for Experience Design v1.0.0 (http://ing-experience-design.com/)<|fim▁hole|><|fim▁end|> | * Copyright 2016 ING, Office for Experience Design
* Licensed under MIT (https://spdx.org/licenses/MIT)
*/ |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>#![cfg(feature = "window")]
#[phase(plugin)]
extern crate gl_generator;
use glutin;
#[cfg(not(target_os = "android"))]
mod gl {
generate_gl_bindings! {
api: "gl",
profile: "core",
version: "1.1",
generator: "struct"
}
}
#[cfg(t... | self.gl.Clear(gl::COLOR_BUFFER_BIT);
self.gl.Begin(gl::TRIANGLES);
self.gl.Color3f(1.0, 0.0, 0.0); |
<|file_name|>basics.js<|end_file_name|><|fim▁begin|>"use strict";
var testCase = require('nodeunit').testCase,
path = require('path'),
fs = require('fs'),
avconv;
function read(stream, callback) {
var output = [],
err = [];
stream.on('data', function(data) {
output.pu... | },
TypeError,
'a type error must be thrown here'
); |
<|file_name|>comp-355.component.spec.ts<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { async, ComponentFixture, TestBed } fro... |
beforeEach(async(() => { |
<|file_name|>errors-to-list.pipe.ts<|end_file_name|><|fim▁begin|>import { Pipe, PipeTransform } from '@angular/core';
import * as _ from 'lodash';
@Pipe({
name: 'myErrorsToList'
})
export class ErrorsToListPipe implements PipeTransform {
transform(value: {[key: string]: string | boolean}): any[] {
return _.to... | } |
<|file_name|>handlers.py<|end_file_name|><|fim▁begin|># ----------------------------------------------------------------------------
# Copyright (c) 2016-2017, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this softwa... | def __init__(self, name, default=NoDefault, description=None):
if default is not NoDefault and default is not None: |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models
from .workflow import TestStateMachine
class TestModel(models.Model):
name = models.CharField(max_length=100)
state = models.CharField(max_length=20, null=True, blank=True)<|fim▁hole|> class Meta:
permissions = TestSt... | state_num = models.IntegerField(null=True, blank=True)
other_state = models.CharField(max_length=20, null=True, blank=True)
message = models.CharField(max_length=250, null=True, blank=True)
|
<|file_name|>RemoteCommandWriterTest.java<|end_file_name|><|fim▁begin|>/*
* 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 the License, or
* (at your option) any l... | |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>// #![feature(core)]
// #![feature(test)]
// #![feature(alloc)]
// #![feature(str_words)]
extern crate mmap;
extern crate time;
// extern crate alloc;
// extern crate core;
// extern crate test;
extern crate byteorder;
extern crate docopt;
use docopt::Docopt;
use std... | // edges: || File::open(format!("{}.edges", prefix)).unwrap(),
// };
let mut u_writer = BufWriter::new(File::create(format!("{}.upper", prefix)).unwrap()); |
<|file_name|>medical_tags.py<|end_file_name|><|fim▁begin|>from datetime import timedelta
from django import template
import ws.utils.dates as date_utils
import ws.utils.perms as perm_utils
from ws import forms
from ws.utils.itinerary import get_cars
register = template.Library()
@register.inclusion_tag('for_templa... | }
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.