prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>interaction.spec.js<|end_file_name|><|fim▁begin|>/* eslint-env jest */
describe('Interaction', () => {
describe('Interaction - security level loose', () => {
it('Graph: should handle a click on a node with a bound function', () => {
const url = 'http://localhost:9000/click_security_loose.html';... | cy.viewport(1440, 1024); |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>//! # The Redox OS Kernel, version 2
//!
//! The Redox OS Kernel is a hybrid kernel that supports X86_64 systems and<|fim▁hole|>//! provides Unix-like syscalls for primarily Rust applications
#![deny(warnings)]
#![feature(alloc)]
#![feature(asm)]
#![feature(collections)... | |
<|file_name|>curve.py<|end_file_name|><|fim▁begin|>from org.jfree.data.xy import XYSeries, XYSeriesCollection
from org.jfree.chart.plot import PlotOrientation
from org.jfree.chart import ChartFactory
from geoscript.plot.chart import Chart
from org.jfree.chart.renderer.xy import XYSplineRenderer, XYLine3DRenderer
def c... | PlotOrientation.VERTICAL, True, True, False)
if smooth: |
<|file_name|>interval-bar.ts<|end_file_name|><|fim▁begin|>//intervalbar.ts
//
//
import {BaseBar} from './basebar';
import {IntervalledViewModel} from '../data/intervalmodel';
import {IIntervalledSigleItem} from 'infodata';
import {customElement} from 'aurelia-framework';
//
@customElement('interval-bar')
expo... | |
<|file_name|>utils-drag.js<|end_file_name|><|fim▁begin|>'use strict';
// event
// eventType - 'dragStart', 'drag', 'dragStop'
// pos - absolute pos,
// returnCallback
var app = angular.module('utilsDrag', []);
app.directive('utilsDrag', function ( ) {
return {
restrict: 'A',
scope:
... | {
var cursorTop = $(element).height() / 2;
var cursorLeft = $(element).width() / 2;
|
<|file_name|>RestTestHelper.java<|end_file_name|><|fim▁begin|>package org.regkas.service.rest;
import javax.enterprise.context.Dependent;
import javax.enterprise.inject.Specializes;
import javax.ws.rs.client.Invocation;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.MediaType;
import java.net.URL;
import... | return createRestCallWithHeaderCredentialsForTestUser(url, addPath, MediaType.APPLICATION_JSON_TYPE);
} |
<|file_name|>springyui.js<|end_file_name|><|fim▁begin|>/**
Copyright (c) 2010 Dennis Hotson
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation th... | |
<|file_name|>switch_file.py<|end_file_name|><|fim▁begin|>import sublime, sublime_plugin
import os.path
import platform
def compare_file_names(x, y):
if platform.system() == 'Windows' or platform.system() == 'Darwin':
return x.lower() == y.lower()
else:
return x == y
class SwitchFileCommand(sub... | start = 0
count = len(extensions)
if ext != "": |
<|file_name|>caroussel.js<|end_file_name|><|fim▁begin|>$(document).ready(function(){
createCaroussel($('div[data-caroussel=caroussel]'));
setVisibleInCaroussel($('div[data-caroussel=caroussel]'), 0);
setAutoChange($('div[data-caroussel=caroussel]'));
});
function createCaroussel(carousselElement){
carousselElement... | }); |
<|file_name|>ty.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/license... | // compute an *intermediate* contents for, e.g., Option<List> of |
<|file_name|>zhanzhuanxc.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'ByStudent'
def zhanzhuanxc(p,q,e):
def egcd(a, b):
x,y, u,v = 0,1, 1,0
while a != 0:
q, r = b//a, b%a
m, n = x-u*q, y-v*q
b,a, x,y, u,v = a,r, u,v,... | return int(d)
# print zhanzhuanxc(18443,49891,19) |
<|file_name|>OverflowSet.Example.scss.d.ts<|end_file_name|><|fim▁begin|>declare const styles: {
overflowLinks: string;
overflowButton: string;<|fim▁hole|><|fim▁end|> | isEnabled: string;
isOpened: string;
};
export = styles; |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright (c) 2011 CSIRO<|fim▁hole|># atnf-enquiries@csiro.au
#
# This file is part of the ASKAP software distribution.
#
# The ASKAP software distribution is free software: you can redistribute it
# and/or modify it under the terms of the GNU General Public Licen... | # Australia Telescope National Facility (ATNF)
# Commonwealth Scientific and Industrial Research Organisation (CSIRO)
# PO Box 76, Epping NSW 1710, Australia |
<|file_name|>all_permutations.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
class AllPermutations(object):
def __init__(self, arr):
self.arr = arr
def all_permutations(self):
results = []
used = []
self._all_permutations(self.arr, used, results)
return results... | def main(): |
<|file_name|>conftest.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import pytest
# ``py.test --runslow`` causes the entire testsuite to be run, including test
# that are decorated with ``@@slow`` (scaffolding tests).
# see http://pytest.org/latest/example/simple.html#control-skipping-of-tests-according-to... | ## reason="need --runslow option to run" |
<|file_name|>reader.rs<|end_file_name|><|fim▁begin|>use rustc_serialize::json::{Json, Object};
use std::fs::File;
use super::responses::Responses;
use super::outcome::Outcome;
pub struct Phase {
pub operation: Responses,
pub outcome: Outcome,
}
impl Phase {
fn from_json(object: &Object) -> Result<Phase, ... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from .sanic import Sanic
from .blueprints import Blueprint<|fim▁hole|>
__version__ = '0.1.9'
__all__ = ['Sanic', 'Blueprint']<|fim▁end|> | |
<|file_name|>email.service.configure.route.js<|end_file_name|><|fim▁begin|>var mailServiceRoutes = (function () {
'use strict';
var HTTPStatus = require('http-status'),
express = require('express'),
tokenAuthMiddleware = require('../middlewares/token.authentication.middleware'),
roleAu... | |
<|file_name|>calculator.rs<|end_file_name|><|fim▁begin|>use std::collections::{VecDeque, HashMap};
use std::str::FromStr;
use std::rc::Rc;
/// The description of a calculator operation and how to execute it.
#[derive(Clone)]
pub struct OpSpec {
/// A counted reference to the function itself.
/// Takes a calcul... | make_unop(String::from("Natural Logarithm"),
Box::new(|x| x.ln()),
String::from("push(ln(pop))")));
calc.ops.insert(String::from("lg"), |
<|file_name|>shBrushPython.js<|end_file_name|><|fim▁begin|>/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.90 (Sat, 18 Jun 2016 21:01:41 G... |
// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})(); |
<|file_name|>XtraDrugType.java<|end_file_name|><|fim▁begin|>//
// Diese Datei wurde mit der JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 generiert
// Siehe <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Änderungen an dieser Datei gehen bei einer N... | * Ruft den Wert der iocmCategory-Eigenschaft ab. |
<|file_name|>mdichild.cpp<|end_file_name|><|fim▁begin|>#include <QtWidgets>
#include "mdichild.h"
MdiChild::MdiChild()
{
setAttribute(Qt::WA_DeleteOnClose);
isUntitled = true;
}
void MdiChild::newFile()
{
static int sequenceNumber = 1;
isUntitled = true;
curFile = tr("document%1.txt").arg(sequen... | return false; |
<|file_name|>config.ts<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | export const FIREBASE_ROOT = 'https://sweltering-inferno-2727.firebaseio.com/'; |
<|file_name|>LoginController.js<|end_file_name|><|fim▁begin|>import { connect } from 'react-redux'
import { increment, doubleAsync,callApiAsync } from '../modules/Login'
/* This is a container component. Notice it does not contain any JSX,
nor does it import React. This component is **only** responsible for
w... | jsonResult: state.jsonResult
}) |
<|file_name|>tcp-connect-timeouts.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apach... | #![reexport_test_harness_main = "test_main"]
#![allow(unused_imports)] |
<|file_name|>Six_zebra_models30110.py<|end_file_name|><|fim▁begin|>import _surface
import chimera
try:
import chimera.runCommand
except:
pass
from VolumePath import markerset as ms
try:
from VolumePath import Marker_Set, Link
new_marker_set=Marker_Set
except:
from VolumePath import volume_path_dialog
d= vol... | marker_sets["particle_19 geometry"]=s
s= marker_sets["particle_19 geometry"]
mark=s.place_marker((11007.5, 8508.02, 10007.1), (0.7, 0.7, 0.7), 623.587)
if "particle_20 geometry" not in marker_sets: |
<|file_name|>serviceworkerjob.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 Job is an abstraction of async operation in se... | } |
<|file_name|>create_org_data_czar_policy.py<|end_file_name|><|fim▁begin|>"""
create_org_data_czar_policy.py
Creates an IAM group for an edX org and applies an S3 policy to that group
that allows for read-only access to the group.
"""
import argparse
import boto3
from botocore.exceptions import ClientError
from strin... | args = parser.parse_args()
iam_connection = boto3.client('iam') |
<|file_name|>expr_unary.rs<|end_file_name|><|fim▁begin|>#![feature(never_type)]
#![allow(unused_variables)]
#![allow(unused_assignments)]
#![allow(dead_code)]
#![deny(unreachable_code)]
<|fim▁hole|> let x: ! = ! { return; }; //~ ERROR unreachable
//~| ERROR cannot apply unary operator `!` to type `!`
}
fn main(... | fn foo() { |
<|file_name|>util.go<|end_file_name|><|fim▁begin|>package byteutil
import (
"bytes"
// "fmt"
"unsafe"
"github.com/shenwei356/bpool"
)
// ReverseByteSlice reverses a byte slice
func ReverseByteSlice(s []byte) []byte {
// make a copy of s
l := len(s)
t := make([]byte, l)
for i := 0; i < l; i++ {
t[i] = s[i]
... | |
<|file_name|>test_tables_client_v1beta1.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright 2019 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
#
# https://w... | client.update_column_spec(dataset_name="name", column_spec_name="column2")
client.auto_ml_client.list_table_specs.assert_called_with("name") |
<|file_name|>extern-call-deep2.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.o... | fn count(n: uint) -> uint {
unsafe {
info!("n = %?", n);
rustrt::rust_dbg_call(cb, n) |
<|file_name|>jinja2.py<|end_file_name|><|fim▁begin|># Since this package contains a "django" module, this is required on Python 2.
from __future__ import absolute_import
import sys
import jinja2
from django.conf import settings
from django.template import TemplateDoesNotExist, TemplateSyntaxError
from django.utils i... | ) |
<|file_name|>Store2.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (C) 2007 Johann Prieur <johann.prieur@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; eithe... | %s
</MessageType>
<Content xmlns="http://messenger.msn.com/ws/2004/09/oim/">
%s |
<|file_name|>test_trigger.py<|end_file_name|><|fim▁begin|># Copyright 2013 - Red Hat, 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
... | obj = trigger.TriggerController() |
<|file_name|>closures-in.js<|end_file_name|><|fim▁begin|>M.profile("generators");
function* forOfBlockScope() {
let a = [1, 2, 3, 4, 5, 6, 7, 8];
let b = [10, 11, 12, 13, 14, 15, 16];
const funs = [];
for (const i of a) {
let j = 0;
funs.push(function* iter() {
yield `fo1: ${i} ${j++}`;
});
... | yield `fo5: ${i} ${j++}`;
});
}
} |
<|file_name|>edp_engine.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
#
... | # distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |
<|file_name|>report.hpp<|end_file_name|><|fim▁begin|>#pragma once
#include <fstream>
#include <iomanip>
#include <map>
#include <sstream>
#include <string>
#include "jw.hpp"
namespace Zee {
class Report {
public:
Report(std::string title, std::string rowTitle)
: title_(title), rowTitle_(rowTitle) {
... | |
<|file_name|>service.go<|end_file_name|><|fim▁begin|>// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package backup
import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/client"
"github.com/aws/aws-sdk-go/aws/client/metadata"
"github.com/aws/aws-sdk-go/aws/request"
"github.... | APIVersion: "2018-11-15",
},
handlers, |
<|file_name|>SchemasManagementTest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = "Rastislav Szabo <raszabo@cisco.com>, Lukas Macko <lmacko@cisco.com>"
__copyright__ = "Copyright 2016, Cisco Systems, Inc."
__license__ = "Apache 2.0"
# Licensed under the Apache License, Versi... | def setUpClass(self): |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// =================================================================
//
// * WARNING *
//
// This file is generated!
//
// Changes made to this file will be overwritten. If changes are
// required to the generated code, the ... | //! <p>Use the AWS Elemental MediaTailor SDK to configure scalable ad insertion for your live and VOD content. With AWS Elemental MediaTailor, you can serve targeted ads to viewers while maintaining broadcast quality in over-the-top (OTT) video applications. For information about using the service, including detailed i... |
<|file_name|>zerigo.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 Lice... | |
<|file_name|>45_regularexpressions.go<|end_file_name|><|fim▁begin|>package main
import (
"bytes"
"fmt"
"regexp"
)
func main() {<|fim▁hole|>
fmt.Println(r.MatchString("peach"))
fmt.Println(r.FindString("peach punch"))
fmt.Println(r.FindStringIndex("peach punch"))
fmt.Println(r.FindStringSubmatch("peach punch... | match, _ := regexp.MatchString("p([a-z]+)ch", "peach")
fmt.Println(match)
r, _ := regexp.Compile("p([a-z]+)ch") |
<|file_name|>options.js<|end_file_name|><|fim▁begin|>const Combinatorics = require('js-combinatorics');
const widths = [null, 20, 60];
const heights = [null, 40, 80];
const horizontalAlignments = [null, 'left', 'right', 'center'];
const verticalAlignments = [null, 'bottom', 'top', 'center'];
const orients = [null... |
const results = {
bar: {
keys: ['width', 'height', 'horizontalAlign', 'verticalAlign'], |
<|file_name|>key.cpp<|end_file_name|><|fim▁begin|>// Copyright (c) 2009-2012 The Paccoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <map>
#include <openssl/ecdsa.h>
#include <openssl/obj_mac.h>
#in... | for (int i=0; i<4; i++)
{
CKey keyRec;
keyRec.fSet = true; |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: iso-8859-1 -*-
# -----------------------------------------------------------------------
# jsonrpc - jsonrpc interface for XBMC-compatible remotes
# -----------------------------------------------------------------------
# $Id$
#
# JSONRPC and XBMC eve... | #
# Not all API calls are implemented yet.
# |
<|file_name|>add_tags.go<|end_file_name|><|fim▁begin|>package tasks
// This file is generated by methodGenerator.
// DO NOT MOTIFY THIS FILE.
import (
"net/url"
"github.com/kawaken/go-rtm/methods"<|fim▁hole|>)
// AddTags returns "rtm.tasks.addTags" method instance.
func AddTags(timeline string, listID string, tas... | |
<|file_name|>CodeFormatter.py<|end_file_name|><|fim▁begin|># @author Avtandil Kikabidze
# @copyright Copyright (c) 2008-2015, Avtandil Kikabidze aka LONGMAN (akalongman@gmail.com)
# @link http://longman.me
# @license The MIT License (MIT)
import os
import sys
import sublime
impo... |
if (saving and not formatter.format_on_save_enabled()):
return
|
<|file_name|>test_ws.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
###############################################################################
# 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 ... | |
<|file_name|>auto-ref-sliceable.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.... | v.push_val(3);
assert!(v == ~[1, 2, 3]);
} |
<|file_name|>SdFile.cpp<|end_file_name|><|fim▁begin|>/**
* Marlin 3D Printer Firmware
* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it a... |
#endif // SDSUPPORT |
<|file_name|>condition_list_widget.cpp<|end_file_name|><|fim▁begin|>/****************************************************************************
KHotKeys
Copyright (C) 1999-2001 Lubos Lunak <l.lunak@kde.org>
Distributed under the terms of the GNU General Public License version 2.
*******************************... | #include <assert.h>
#include <qpushbutton.h>
#include <qheader.h> |
<|file_name|>bitcoin_ar.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="ar" version="2.0">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About Nanolite</source>
... | <location line="+1"/> |
<|file_name|>dictutils.py<|end_file_name|><|fim▁begin|>#
# Copyright (c) 2013 Red Hat, 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... | """
if dct: |
<|file_name|>missed.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
# encoding: UTF-8
from six import iteritems
from collections import defaultdict
from json import dumps
from ..config import CONFIG
class MissedKeys(object):
""" Object append missed key"""
def __init__(self, client):
... | self.key_folder = defaultdict(set)
def append(self, key, source_path=None):
""" Add key to missed |
<|file_name|>test_avhrr_l0_hrpt.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2009-2021 Satpy developers
#
# This file is part of satpy.
#
# satpy is free software: you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published b... | assert isinstance(result, xr.DataArray)
def test_platform_name(self):
"""Test that the platform name is correct.""" |
<|file_name|>17_removing_text.rs<|end_file_name|><|fim▁begin|>fn main() {
let mut choco = "chocolate".to_string();
println!("{}", choco.len());<|fim▁hole|> // this crap takes an ownership, how does it reallocate the buffer?
// TODO: Know how? Perhaps it just repositions the symbols in current buffer?
... | |
<|file_name|>test_variables.py<|end_file_name|><|fim▁begin|>from tests.base import TestBase
from pascal.program import Program
class TestVariables(TestBase):
def test_pass_valid_var(self):
file_name = "tests/mock_pas/all_var.pas"
pascal_program = Program(file_name)
pascal_program.run()
... | pascal_program = Program(file_name)
pascal_program.run() |
<|file_name|>message.rs<|end_file_name|><|fim▁begin|>use libc::{c_int, size_t, c_void};
use std::mem;
use std::marker::PhantomData;
#[repr(C)]
pub struct nl_msg {
_unused: [u8; 0],
}
#[repr(C)]
pub struct nlmsghdr {
_unused: [u8; 0],
}
#[link(name="nl-3")]
extern "C" {
// Exposed msg functions
fn nlmsg_allo... |
pub fn with_data<D>(data: &D) -> NetlinkData<T> { |
<|file_name|>PDFTextStreamEngine.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... | |
<|file_name|>repeat_with.rs<|end_file_name|><|fim▁begin|>use crate::iter::{FusedIterator, TrustedLen};
/// Creates a new iterator that repeats elements of type `A` endlessly by
/// applying the provided closure, the repeater, `F: FnMut() -> A`.
///
/// The `repeat_with()` function calls the repeater over and over agai... | /// please open a GitHub issue explaining your use case. |
<|file_name|>KuhnMunkresWongTest.java<|end_file_name|><|fim▁begin|>/*
* This file is part of ELKI:
* Environment for Developing KDD-Applications Supported by Index-Structures
*
* Copyright (C) 2019
* ELKI Development Team
*
* This program is free software: you can redistribute it and/or modify
* it under the ... | int[] assignment = new KuhnMunkresWong().run(KuhnMunkresTest.DIFFICULT); |
<|file_name|>group.py<|end_file_name|><|fim▁begin|>from datetime import datetime
from collections import defaultdict
DEFAULT_RELEASE = datetime(1970, 1, 1)
_SORT_KEY = lambda eps: eps[0].released or DEFAULT_RELEASE
class PodcastGrouper(object):
"""Groups episodes of two podcasts based on certain features
T... | raise ValueError("podcasts must not be None")
self.podcasts = podcasts
|
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>from django.contrib import admin
from models import Article, RelatedLink, Category
# Register your models here.
class RelatedLinkInline(admin.TabularInline):
model = RelatedLink
extra = 1
class ArticleAdmin(admin.ModelAdmin):
prepopulated_fields = {"slug": ("title... | |
<|file_name|>SessionRegisteredEventDecoder.ts<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2017 ZeXtras S.r.l.
*
* 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, version 2 of
* the Licen... | |
<|file_name|>0000_get_requester_ratings_fn.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('crowdsourcing', '0007_auto_20151208_1957'),
]
operations = [
migrations.RunSQL('''
CREA... | |
<|file_name|>test_lmdb_utils.py<|end_file_name|><|fim▁begin|>'''
Created on Jan 06, 2016
@author: kashefy
'''
from nose.tools import assert_greater, assert_equal, assert_is_instance, assert_true
import nideep.iow.lmdb_utils as lu
class TestLMDBConsts:
def test_map_sz(self):
assert_greater(lu.MAP_SZ, 0)
... |
for i in xrange(10, 100):
assert_equal(lu.IDX_FMT.format(i), s[:-2] + '%d' % i) |
<|file_name|>connect.js<|end_file_name|><|fim▁begin|>var Q = require('q');
var uuid = require('uuid');
var crypto = require('../../../../crypto/crypto');
function Connect() {
}
var connect = new Connect();
module.exports = connect;
Connect.prototype.init = function(letter, handler) {
console.log(letter);
... | letter.crypto.encryptSecret = JSON.stringify(encryptSecret.toJSON());
deferred.resolve(letter);
|
<|file_name|>bar.rs<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | mod foo;
mod baz; |
<|file_name|>build.rs<|end_file_name|><|fim▁begin|>extern crate libbindgen;
extern crate gcc;
extern crate glob;
use std::env;
use std::path::Path;
fn gen_header() {
let out_dir = env::var("OUT_DIR").unwrap();
let _ = libbindgen::builder()
.header("wrapper.h")
.no_unstable_rust()
// .use_core()
... | for path in glob::glob("../lua/*.c").unwrap().filter_map(Result::ok) {
if path.ends_with("lua.c") || path.ends_with("luac.c") { |
<|file_name|>test_corpora_dictionary.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Unit tests for the `corpora.Dictionary` class.
"""
from collections import Mapping
import logging
import tempfile
import ... | self.assertEqual(d.dfs, expected)
def testDocFreqAndToken2IdForSeveralDocsWithOneWord(self):
# two docs |
<|file_name|>api.d.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 { ParseSourceSpan } from '@angular/compiler';
import * as t... | * Load a referenced resource either statically or asynchronously. If the host returns a
* `Promise<string>` it is assumed the user of the corresponding `Program` will call
* `loadNgStructureAsync()`. Returing `Promise<string>` outside `loadNgStructureAsync()` will |
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Layer'
db.create_table('layers_lay... | ('email', self.gf('django.db.models.fields.EmailField')(max_length=75, blank=True)),
('minimum_distance', self.gf('django.db.models.fields.IntegerField')(default=0)),
('new_nodes_allowed', self.gf('django.db.models.fields.BooleanField')(default=True)), |
<|file_name|>Requests.js<|end_file_name|><|fim▁begin|>/*
Copyright 2015 Ricardo Tubio-Pardavila
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/LIC... |
for (var i = 0, L = slots.length; i < L; i++) {
if (slots[i].identifier === slotId) { |
<|file_name|>test_unit_expectmax.py<|end_file_name|><|fim▁begin|>from __future__ import print_function, division
import numpy as np
import pytest
import sys
import chronostar.likelihood
sys.path.insert(0,'..')
from chronostar import expectmax as em
from chronostar.synthdata import SynthData
from chronostar.componen... | |
<|file_name|>bug244.go<|end_file_name|><|fim▁begin|>// $G $D/$F.go && $L $F.$A && ./$A.out
// Copyright 2010 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
var nf int
var ng int
func f() (int, int, int) {
nf+... |
func g() int {
ng++
return 4 |
<|file_name|>directives.js<|end_file_name|><|fim▁begin|>'use strict';
angular.module('myApp.view1')
.directive('articolo', [function(){
return{
restrict: "EAC",
scope: {
articolo: "=news",
searchKey: "=searchKey"
},<|fim▁hole|><|fim▁end|> | templateUrl: 'app/components/view1/view1_articolo.html'
}
}])
; |
<|file_name|>run_all.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
# -*- coding: utf-8 -*-
# OpenFisca -- A versatile microsimulation software
# By: OpenFisca Team <contact@openfisca.fr>
#
# Copyright (C) 2011, 2012, 2013, 2014, 2015 OpenFisca Team
# https://github.com/openfisca
#
# This file is part of Open... | def run_all(year = None, check = False):
assert year is not None
pre_processing.create_indivim_menagem(year = year) |
<|file_name|>en.js<|end_file_name|><|fim▁begin|>{
"CMSMAIN.WARNINGSAVEPAGESBEFOREADDING" : "You have to save a page before adding children underneath it",
"CMSMAIN.CANTADDCHILDREN" : "You can't add children to the selected node",
"CMSMAIN.ERRORADDINGPAGE" : "Error adding page",
"CMSMAIN.FILTEREDTREE" : "Filtered tr... | "CMSMAIN.RESTORING": "Restoring...",
"CMSMAIN.ERRORREVERTING": "Error reverting to live content", |
<|file_name|>application.js<|end_file_name|><|fim▁begin|>function ajaxChimpCallback(a) {
if ("success" === a.result) {
$(".beta-request-result").show();
$(".beta-request-form").hide();
$(".beta-request-title").hide();
$.featherlight.current().close();
}
else
{
a... | |
<|file_name|>contratoservidor.py<|end_file_name|><|fim▁begin|>from django.contrib.auth.decorators import login_required, permission_required,\
user_passes_test
from django.shortcuts import render_to_response, get_object_or_404
from django.template.context import RequestContext
from project.tramitacao.forms import F... | |
<|file_name|>pptls.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*-coding:utf-8-*-
import time<|fim▁hole|>print """Hola! Bienvenido al juego Piedra Papel Tijera Lagarto Spock!\nEstas son las reglas:\n Las tijeras cortan el papel\n El papel cubre a la piedra\n La piedra aplasta al lagarto\n El lagarto envene... | from time import sleep
import random
depo, sus, tab, user_puntos, pc_puntos = ["piedra", "papel", "tijera", "lagarto", "spock"], "-" * 35, " " * 4, 0, 0 |
<|file_name|>infer-from-object-issue-26952.rs<|end_file_name|><|fim▁begin|>// run-pass
#![allow(dead_code)]
#![allow(unused_variables)]
// Test that when we match a trait reference like `Foo<A>: Foo<_#0t>`,<|fim▁hole|>// that, then you get an unconstrained type-variable in `call`.
//
// Also serves as a regression test... | // we unify with `_#0t` with `A`. In this code, if we failed to do |
<|file_name|>datasize.go<|end_file_name|><|fim▁begin|>package datasize
import (
"errors"
"fmt"
"strconv"
"strings"
)
type ByteSize uint64
const (
B ByteSize = 1
KB = B << 10
MB = KB << 10
GB = MB << 10
TB = GB << 10
PB = TB << 10
EB = PB << 10
fnUnm... | |
<|file_name|>TableDelegate.qunit.js<|end_file_name|><|fim▁begin|>/* global QUnit, sinon */
sap.ui.define([
"sap/ui/mdc/Table",
"sap/ui/mdc/table/Column",
"sap/ui/mdc/library",
"../../QUnitUtils",
"../../util/createAppEnvironment",
"sap/ui/fl/write/api/ControlPersonalizationWriteAPI",
"sap/ui/core/Core",
"sap/ui... | header: "CountryKey",
dataProperty: "CountryKey", |
<|file_name|>Action.java<|end_file_name|><|fim▁begin|>package no.dusken.momus.model.websocket;<|fim▁hole|> CREATE, UPDATE, DELETE
}<|fim▁end|> |
public enum Action { |
<|file_name|>scheme_Hirajoshi_D.js<|end_file_name|><|fim▁begin|>/* eslint quote-props: ["error", "consistent"] */
// Japanese Hirajoshi scale
// 1-4-2-1-4
// Gb G B Db D Gb
export default {
'a': { instrument: 'piano', note: 'a4' },
'b': { instrument: 'piano', note: 'eb3' },
'c': { instrument: 'piano', note: 'd... | '(': { instrument: 'swell', note: 'g3' },
')': { instrument: 'swell', note: 'eb3' },
'=': { instrument: 'swell', note: 'eb3' },
'~': { instrument: 'swell', note: 'g3' }, |
<|file_name|>StreamModule.java<|end_file_name|><|fim▁begin|>package models.message;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlE... | }
|
<|file_name|>DateUtil.java<|end_file_name|><|fim▁begin|>package com.eveningoutpost.dexdrip.Models;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;
// from package info.nightscout.client.utils;
/**
* Created by mike on 30.12.2... | try {
SimpleDateFormat f = new SimpleDateFormat(FORMAT_DATE_ISO2);
f.setTimeZone(TimeZone.getTimeZone("UTC")); |
<|file_name|>sqlite_check.py<|end_file_name|><|fim▁begin|># Script Name : sqlite_check.py
# Author : Craig Richards
# Created : 20 May 2013
# Last Modified :
# Version : 1.0
# Modifications :
# Description : Runs checks to check my SQLITE database
import sqlite3 as lite
import sys
import os
dropbox = os.getenv(... | "SQLite version: %s" % data
|
<|file_name|>export_node.cpp<|end_file_name|><|fim▁begin|>#include "export_node.hpp"
#include <sstream>
#include "constant_mappings.hpp"
namespace opossum {
ExportNode::ExportNode(const std::string& init_table_name, const std::string& init_file_name,
const FileType init_file_type)
: Abstr... | return table_name == export_node.table_name && file_name == export_node.file_name &&
file_type == export_node.file_type;
}
|
<|file_name|>testrunner.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (c) 2006-2010 Tampere University of Technology
#
# 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 w... | return False
print "setup complete"
self._activeTarget = self._targets[0] |
<|file_name|>test_ext_bowtie.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""Unit tests for functions calling bowtie externally."""
from pathlib2 import Path
import pytest
from imfusion.external import bowtie
class TestBowtieIndex(object):
"""Unit tests for the bowtie_index function."""
def tes... |
mock_run.assert_called_once_with(
args=['bowtie-build', 'reference.fa', 'genome'], log_path=None) |
<|file_name|>contest.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
__author__ = 'AminHP'
# python imports
import os
import shutil
import zipfile
import StringIO
import base64
# flask imports
from flask import jsonify, request, g, send_file, abort
# project imports
from project import app
from project.exten... | return abort(404, "Contest or Team does not exist") |
<|file_name|>qb_docker_image.scratch.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#
# Copyright 2016 Red Hat | Ansible
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADA... | # if self.push and not self.repository:
# self.push_image(self.name, self.tag) |
<|file_name|>capabilities.js<|end_file_name|><|fim▁begin|>function safeMatchMedia(query) {
var m = window.matchMedia(query);
return !!m && m.matches;
}
define('capabilities', [], function() {
var capabilities = {
'JSON': window.JSON && typeof JSON.parse == 'function',
'debug': (('' + docume... |
try { |
<|file_name|>mutation-drift-selection.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <headingcell level=1>
# Wright-Fisher model of mutation, selection and random genetic drift
# <markdowncell>
# A Wright-Fisher model has a fixed population size *N* and discrete non-overlapping... |
# <codecell> |
<|file_name|>WordAlignmentFeatureExtractorFactory.java<|end_file_name|><|fim▁begin|><|fim▁hole|>
/**
* A factory for making word alignment feature extractors
*
* @author John McCrae <john@mccr.ae>
*/
public interface WordAlignmentFeatureExtractorFactory {
/**
* An identifier for this WAFE
* @return T... | package org.insightcentre.unlp.naisc.wordalign;
import java.util.Map; |
<|file_name|>MEN.py<|end_file_name|><|fim▁begin|>#Evaluate semantic space against MEN dataset
import sys
import utils
from scipy import stats
import numpy as np
from math import sqrt
#Note: this is scipy's spearman, without tie adjustment
def spearman(x,y):
return stats.spearmanr(x, y)[0]
def readMEN(annotation_fi... | |
<|file_name|>twister.rs<|end_file_name|><|fim▁begin|>use std::iter::Iterator;
pub struct Twister {
index: usize,
state: [u32; 624],
}
impl Twister {
pub fn new(seed: u32) -> Twister {
let mut state = [0u32; 624];
state[0] = seed;
for idx in 1..state.len() {
state[idx] =... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.