prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>UVA12376.cpp<|end_file_name|><|fim▁begin|>#include <cstdio>
#include <vector>
#include <utility>
#include <algorithm>
using namespace std;
pair<int, int> computeGreedyLongestPath(const vector<vector<int> > & adjList, int startV, const vector<int> & weightOfVertex);
int main(void)
{
int T, numV, numE, u... | adjList.assign(numV, emptyList);
weightOfVertex.assign(numV, 0); |
<|file_name|>Rectangle.hh<|end_file_name|><|fim▁begin|>#ifndef RT_Rectangle_HH
#define RT_Rectangle_HH
#include "SceneObj.hh"
class Rectangle : public SceneObj {
public:
Rectangle();
~Rectangle() = default;
Rectangle(const Rectangle &other) = default;
Rectangle(Rectangle &&other) = default;
Rectangle &oper... | |
<|file_name|>assignments.go<|end_file_name|><|fim▁begin|>// Copyright 2013 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.
// This file implements initialization and assignment checks.
package types
import (
"go/ast"
"go/t... |
func (check *Checker) initConst(lhs *Const, x *operand) { |
<|file_name|>TooltipAnimation.js<|end_file_name|><|fim▁begin|>'use strict';
import React, {Component, PropTypes} from 'react';
import ReactNative, {Animated, Easing} from 'react-native';
var Animation = require('../Popover/Animation');
class TooltipAnimation extends Animation {
prepareStyle() {
const {
placemen... |
const {anim} = this.state;
return { |
<|file_name|>unittest.py<|end_file_name|><|fim▁begin|>""" discovery and running of std-library "unittest" style tests. """
from __future__ import absolute_import, division, print_function
import sys
import traceback
# for transferring markers
import _pytest._code
from _pytest.config import hookimpl
from _pytest.outco... | if hasattr(self._testcase, "teardown_method"):
self._testcase.teardown_method(self._obj) |
<|file_name|>DefaultLinkAnchorDelegate.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
* PathVisio, a tool for data visualization and analysis using biological pathways
* Copyright 2006-2019 BiGCaT Bioinformatics
*
* Licensed under the Apache Licen... | private int numLinkanchorsV = -1;
private static final int MIN_SIZE_LA = 25; |
<|file_name|>sysdig_tracers.py<|end_file_name|><|fim▁begin|># Copyright (C) 2016 Sysdig inc.
# All rights reserved
# Author: Luca Marturana (luca@sysdig.com)
import os
import traceback
from inspect import isfunction
import sys
import functools
# ensure file descriptor will be closed on execve
O_CLOEXEC = 524288 # ca... | if self.function_calls == 0:
exit_args = {}
for key, value in self.exit_args.items(): |
<|file_name|>bot.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from django.core.management import setup_environ
import settings
setup_environ(settings)
import socket
from trivia.models import *<|fim▁hole|>def send(msg):
irc.send(msg + "\r\n")
print "{SENT} " + msg
return
def msg(user, msg):
send("... |
irc = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
irc.connect((settings.IRC_SERVER, settings.IRC_PORT))
|
<|file_name|>test_dsu.cpp<|end_file_name|><|fim▁begin|>#define BOOST_TEST_MODULE test_dsu
#define BOOST_TEST_DYN_LINK
#include "test.hpp"
#include "dsu.hpp"
using bdata::make;
using bdata::xrange;
BOOST_AUTO_TEST_CASE(one) {
auto dsu = DisjointSetUnion<int>();
dsu.push_back(1);
BOOST_TEST(dsu.xs[1] ==... | BOOST_TEST(dsu.ws[2] == 1);
}
BOOST_AUTO_TEST_CASE(unite2) { |
<|file_name|>binary-cache-store.hh<|end_file_name|><|fim▁begin|>#pragma once
#include "crypto.hh"
#include "store-api.hh"
#include "pool.hh"
#include <atomic>
namespace nix {
struct NarInfo;
struct BinaryCacheStoreConfig : virtual StoreConfig
{
using StoreConfig::StoreConfig;
const Setting<std::string> c... | |
<|file_name|>object.cc<|end_file_name|><|fim▁begin|>// Copyright (c) 2019 ASMlover. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// * Redistributions of source code must retain the abov... |
StringObject::~StringObject(void) {
release_string();
} |
<|file_name|>test_exceptions.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
werkzeug.exceptiosn test
~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD license.
"""
from nose.tools import assert_raises
from werkzeug import excep... | assert_raises(exceptions.Forbidden, abort, 403)
assert_raises(exceptions.NotFound, abort, 404) |
<|file_name|>widget_QTableView_edit_print_signal_when_data_changed.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Ref: http://doc.qt.io/qt-5/modelview.html#2-1-a-read-only-table
import sys
from PyQt5.QtCore import Qt, QAbstractTableModel, QVariant
from PyQt5.QtWidgets import QApplica... | def set_data(self, row_index, column_index, value): |
<|file_name|>XMLGregorianCalendarStringConverter.java<|end_file_name|><|fim▁begin|>package com.oryx.core.converter;
import com.vaadin.data.util.converter.Converter;
import org.apache.log4j.Logger;
import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.DatatypeFactory;
import javax.xml.dat... |
@Override
public XMLGregorianCalendar convertToModel(String date, Class<? extends XMLGregorianCalendar> aClass, Locale locale) throws ConversionException {
if (date == null) |
<|file_name|>notify.py<|end_file_name|><|fim▁begin|>"""Support for Netgear LTE notifications."""
import logging
import attr
import eternalegypt
from homeassistant.components.notify import ATTR_TARGET, BaseNotificationService
from . import CONF_NOTIFY, CONF_RECIPIENT, DATA_KEY
_LOGGER = logging.getLogger(__name__)
... |
targets = kwargs.get(ATTR_TARGET, self.config[CONF_NOTIFY][CONF_RECIPIENT])
if not targets: |
<|file_name|>error-definitions.js<|end_file_name|><|fim▁begin|>'use strict';<|fim▁hole|>module.exports = {
"definitions": {
"validation-error": {
"type": "object",
"description": "Validation error",
"properties": {
"param": {
"type": "string",
"description": "The para... | |
<|file_name|>browser_tree.ts<|end_file_name|><|fim▁begin|>'use strict';
var Funnel = require('broccoli-funnel');
var htmlReplace = require('../html-replace');
var jsReplace = require("../js-replace");
var path = require('path');
var stew = require('broccoli-stew');
import compileWithTypescript from '../broccoli-types... | |
<|file_name|>pd.py<|end_file_name|><|fim▁begin|>##
## This file is part of the libsigrokdecode project.
##
## Copyright (C) 2018 Jorge Solla Rubiales <jorgesolla@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
... | i += 1
# Header only commands are PINGS |
<|file_name|>inpsight.py<|end_file_name|><|fim▁begin|>#
# @BEGIN LICENSE
#
# Psi4: an open-source quantum chemistry software package
#
# Copyright (c) 2007-2022 The Psi4 Developers.
#
# The copyrights for code used from other parties are included in
# the corresponding files.
#
# This file is part of Psi4.
#
# Psi4 is ... | for bond in self.bonds:
fh.write('b(%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)\n' % |
<|file_name|>bytepool_test.go<|end_file_name|><|fim▁begin|>package bpool
import "testing"
func TestBytePool(t *testing.T) {
var size int = 4
var width int = 10
bufPool := NewBytePool(size, width)
// Check the width
if bufPool.Width() != width {
t.Fatalf("bytepool width invalid: got %v want %v", bufPool.Width... |
// Check that retrieved buffer are of the expected width |
<|file_name|>librarywindow.py<|end_file_name|><|fim▁begin|># Copyright 2020 by Kurt Rathjen. All Rights Reserved.
#
# This library is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of t... | """
:type event: QtGui.QKeyEvent
:rtype: None |
<|file_name|>test_service.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# rpclib - Copyright (C) Rpclib contributors.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# ... | __aux__ = SyncAuxProc() |
<|file_name|>scenario_circle.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from tasks import *
from math import cos, sin, pi
import rospy
from signal import signal, SIGINT
from geometry_msgs.msg import Point
import sys
def signal_handler(signal, frame):
print('You pressed Ctrl+C')
print('Leavin... | while True: |
<|file_name|>manage.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "umiss_project.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:<|fim▁hole|> ... | # The above import may fail for some other reason. Ensure that the
# issue is really that Django is missing to avoid masking other
# exceptions on Python 2.
try: |
<|file_name|>puzzle16.py<|end_file_name|><|fim▁begin|>import re
class Aunt:
name = ''
def __init__(self, name):
self.name = name
self.count = {'children':-1,
'cats' : -1,
'samoyeds' : -1,
'pomeranians' : -1,
'akitas' : -1,... | F5 = filterRule(F4, 'akitas', 0)
print len(F5)
F6 = filterRule(F5, 'vizslas', 0)
print len(F6) |
<|file_name|>irc_server.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
PyRC module: pyrc_irc_abstract.irc_server
Purpose
=======
Establish and maintain a connection to an IRC server, generating events as
they occur, and sending data as required.
Legal
=====
All code, unless otherwise indicated, is or... | |
<|file_name|>pearson.py<|end_file_name|><|fim▁begin|>"""Implementation of Pearson collaborative filtering algorithm"""
from math import sqrt, pow
from mlcollection.lib.collaborativefiltering.collaborativefilterbase import \
AbstractCollaborativeFilter
from operator import itemgetter
from scipy import stats, isnan
... | ind_items = set(dataset[individual].keys()) |
<|file_name|>keymap.js<|end_file_name|><|fim▁begin|>/*
Copyright (c) 2016 eyeOS
This file is part of Open365.
Open365 is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 o... | This program is distributed in the hope that it will be useful, |
<|file_name|>auth.module.ts<|end_file_name|><|fim▁begin|>import {NgModule} from '@angular/core';
import {JwtModule} from '@auth0/angular-jwt';
export function jwtTokenGetter() {
return sessionStorage.getItem('token');
}<|fim▁hole|> JwtModule.forRoot({
config: {
tokenGetter: jwtTo... |
@NgModule({
imports: [ |
<|file_name|>missing_field.rs<|end_file_name|><|fim▁begin|>// Copyright 2017 Serde Developers
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may... |
fn main() {} |
<|file_name|>gentotsv.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#title :gentotsv.py
#description :Script to process impute files .gz and create a csv file
#author :Diego Alvarez
#date :2016-06-05
#python_version :3.5
#=========================================================... | |
<|file_name|>band.go<|end_file_name|><|fim▁begin|>// Copyright © 2017 The Things Network
// Use of this source code is governed by the MIT license that can be found in the LICENSE file.
package band
import (
pb_lorawan "github.com/TheThingsNetwork/ttn/api/protocol/lorawan"
"github.com/TheThingsNetwork/ttn/core/type... | }
frequencyPlan.DownlinkChannels = frequencyPlan.UplinkChannels
frequencyPlan.CFList = &lorawan.CFList{922200000, 922400000, 922600000, 922800000, 923000000} |
<|file_name|>utilities.rs<|end_file_name|><|fim▁begin|>use consts::MAP_HEIGHT;
use consts::MAP_WIDTH;
use tcod::console::*;
use tcod::Console;
use object::Object;
use map::Map;
use tcod::console::blit;
use consts::COLOR_DARK_WALL;
use consts::COLOR_DARK_GROUND;
pub fn render_all(root: &mut Root, con: &mut Offscreen,... | }
|
<|file_name|>buffered_flog.py<|end_file_name|><|fim▁begin|>"""
@file
@brief Buffer as a logging function.
"""
from io import StringIO
class BufferedPrint:
"""
Buffered display. Relies on :epkg:`*py:io:StringIO`.
Use it as follows:
.. runpython::
:showcode:
def do_something(fLOG=None)... | "constructor"
self.buffer = StringIO() |
<|file_name|>main.go<|end_file_name|><|fim▁begin|>package main<|fim▁hole|>
Socketcmd 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 later v... |
/* Copyright 2017 Ryan Clarke
This file is part of Socketcmd. |
<|file_name|>LatinExtendedA.js<|end_file_name|><|fim▁begin|>/*************************************************************
*
* MathJax/fonts/HTML-CSS/TeX/png/Main/Bold/LatinExtendedA.js
*
* Defines the image size data needed for the HTML-CSS OutputJax
* to display mathematics using fallback images when the fo... | [11,13,0],[12,15,0],[15,18,0],[17,21,0],[21,25,0],[24,30,0]
]
}
}); |
<|file_name|>DisputeInfoController.java<|end_file_name|><|fim▁begin|>package com.fxs.platform.web.controller;
import java.util.List;
import com.fxs.platform.security.core.support.ResponseMessage;
import com.fxs.platform.security.core.support.Result;
import org.springframework.beans.factory.annotation.Autowired;
impor... |
@PostMapping(value = "/updateAnswer")
public String update(@ModelAttribute(value = "answer") Answer answer, BindingResult result, |
<|file_name|>mtl.rs<|end_file_name|><|fim▁begin|>//! Simplistic mtl loader.
use std::mem;
use std::fs::File;
use std::io::Result as IoResult;
use std::io::Read;
use std::str::FromStr;
use std::path::Path;
use na::Point3;
use obj::Words;
use obj;
fn error(line: usize, err: &str) -> ! {
panic!("At line {}: {}", lin... | |
<|file_name|>shi7_learning.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from __future__ import print_function, division
import multiprocessing
import os
import csv
import datetime
import logging
from datetime import datetime
import argparse
import shutil
import math
from glob import glob
import gzip
from shi7 ... | def main():
start_time = datetime.now() |
<|file_name|>FaultToleranceServiceBeanProxyFactory.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2014 Avanza Bank AB
*
* 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://... | private final BeanFaultToleranceFactory ftFactory;
public FaultToleranceServiceBeanProxyFactory(BeanFaultToleranceFactory ftFactory) {
this.ftFactory = ftFactory; |
<|file_name|>base.py<|end_file_name|><|fim▁begin|>import math
from datetime import datetime
from conch import analyze_segments
from conch.analysis.segments import SegmentMapping
from .helper import generate_pitch_function
from ..segments import generate_utterance_segments
from ...exceptions import SpeakerAttributeErr... | utterance_id = utterance.id
today = datetime.utcnow()
utt_type = corpus_context.hierarchy.highest |
<|file_name|>random_seed.rs<|end_file_name|><|fim▁begin|>use chapter2::dungeon::{Dungeon};
use chapter2::genotype::{Genotype};<|fim▁hole|>use chapter2::phenotype::{Seed};
use rand::{Rng, thread_rng};
#[derive(Clone, Debug)]
pub struct RandomSeed {
seed: Seed,
}
impl RandomSeed {
pub fn new(seed: &Seed) -> Ra... | |
<|file_name|>cluster_mesh_status.go<|end_file_name|><|fim▁begin|>// Code generated by go-swagger; DO NOT EDIT.
// Copyright 2017-2020 Authors of Cilium
// SPDX-License-Identifier: Apache-2.0
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swa... | import ( |
<|file_name|>lenses.test.ts<|end_file_name|><|fim▁begin|>import * as chai from "chai";
const expect = chai.expect;
import * as R from 'ramda';
import { Apppartment } from '../../src/concepts/lenses';
describe('Lenses using Ramda', () => {
describe('lensProp & set example', () => {
it('should keep unchanged the o... |
}); |
<|file_name|>accessibilityHelp.ts<|end_file_name|><|fim▁begin|>/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*... | |
<|file_name|>GetFunctionResult.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2014-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located ... | if (this == obj)
return true; |
<|file_name|>AnnotationList.tsx<|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 ... | accessor: 'long_descr',
Header: t('Description'),
}, |
<|file_name|>hotspots.js<|end_file_name|><|fim▁begin|>var hotspots = (function () {
var exports = {};
exports.show = function (hotspot_list) {
$('.hotspot').hide();
for (var i = 0; i < hotspot_list.length; i += 1) {
$("#hotspot_".concat(hotspot_list[i])).show();
}<|fim▁hole|>};
function mark_hots... | };
exports.initialize = function () {
exports.show(page_params.hotspots); |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>trait Foo {
fn foo(&self);
}
trait FooBar: Foo {
fn foobar(&self);
}
struct Baz;
impl Foo for Baz {
fn foo(&self) { println!("foo"); }
}
impl FooBar for Baz {
fn foobar(&self) { println!("foobar"); }
}
<|fim▁hole|>#[derive(Debug)]
struct Foo1;
fn ma... | |
<|file_name|>test_cloud_memorystore_system.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
# ... | # with the License. You may obtain a copy of the License at
# |
<|file_name|>summarize_chipseq_qc.py<|end_file_name|><|fim▁begin|>import gzip
import glob
import numpy as np
import pandas as pd
from scipy.stats import pearsonr
from scipy.stats import spearmanr
def get_num_lines_gz(filename):
num_lines = 0
with gzip.open(filename, "r") as fp:
for line in fp:
... | for line in fp:
fields = line.strip().split() |
<|file_name|>module_name.js<|end_file_name|><|fim▁begin|>/* Copyright <YEAR(S)> <AUTHOR(S)>
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */
odoo.define_section('module_name', ['module_name.ExportedObject'], function(test) {
"use strict";
test('It should demonstrate a PhantomJS test for web... | result = new ExportedObject(); |
<|file_name|>issue_427.rs<|end_file_name|><|fim▁begin|>#![cfg(feature = "derive")]
/// HID-IO Packet Buffer Struct
///
/// # Remarks
/// Used to store HID-IO data chunks. Will be chunked into individual packets on transmission.
#[repr(C)]
#[derive(PartialEq, Clone, Debug, bincode::Encode)]
pub struct HidIoPacketBuffer... | /// Payload data, chunking is done automatically by serializer
pub data: [u8; H], |
<|file_name|>frs.entities.ts<|end_file_name|><|fim▁begin|>import { Item, Items, ODataEntityArray, ODataEntity, ODataParser, FetchOptions, Logger, LogLevel } from "sp-pnp-js";
import { select, expand } from "../sharepoint/utils/decorators";
import { SelectDecoratorsParser, SelectDecoratorsArrayParser } from "../sharepo... | |
<|file_name|>plot_stats_cluster_spatio_temporal_2samp.py<|end_file_name|><|fim▁begin|>"""
=========================================================================
2 samples permutation test on source data with spatio-temporal clustering
=========================================================================
Tests i... | brain.save_image('clusters.png') |
<|file_name|>borrowck-mutate-in-guard.rs<|end_file_name|><|fim▁begin|>enum Enum<'a> {
A(&'a isize),
B(bool),
}
fn foo() -> isize {
let mut n = 42;
let mut x = Enum::A(&mut n);<|fim▁hole|> Enum::A(_) if { let y = &mut x; *y = Enum::B(false); false } => 1,
//~^ ERROR cannot mutably borrow ... | match x {
Enum::A(_) if { x = Enum::B(false); false } => 1,
//~^ ERROR cannot assign `x` in match guard |
<|file_name|>structaaa_1_1sqrt__type.js<|end_file_name|><|fim▁begin|>var structaaa_1_1sqrt__type =
[<|fim▁hole|><|fim▁end|> | [ "type", "structaaa_1_1sqrt__type.html#a5843af2f9db00396bf14cf79cabecac0", null ]
]; |
<|file_name|>unique-match-discrim.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.apach... | match box true {
_ => { } |
<|file_name|>module_copy_mbed.py<|end_file_name|><|fim▁begin|>"""
mbed SDK
Copyright (c) 2011-2013 ARM Limited
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... | |
<|file_name|>controller.common.js<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2011 Yahoo! Inc. All rights reserved.
*/
YUI.add('master', function(Y, NAME) {
/**
* The master module.
*
* @module master
*/
var DIMENSIONS = {
device: 'smartphone',
region: 'CA',
skin : 'grey'
};<|fim▁hole|> *
... |
/**
* Constructor for the Controller class. |
<|file_name|>viewer.rs<|end_file_name|><|fim▁begin|>use std::f32::consts::PI;
use std::os::raw::c_void;
use std::path::Path;
use std::process;
use std::time::Instant;
use cgmath::{ Deg, Point3 };
use collision::Aabb;
use gl;
use gltf;
use glutin;
use glutin::{
Api,
MouseScrollDelta,
MouseButton,
GlCont... | } else {
Point3::new(
center.x + size / 2.0,
center.y + size / 5.0, |
<|file_name|>options.go<|end_file_name|><|fim▁begin|>/*
Copyright 2014 The Kubernetes Authors All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses... | *genericapiserver.ServerRunOptions
APIGroupPrefix string |
<|file_name|>simple.rs<|end_file_name|><|fim▁begin|>/*
Copyright ⓒ 2016 rust-custom-derive contributors.
Licensed under the MIT license (see LICENSE or <http://opensource.org
/licenses/MIT>) or the Apache License, Version 2.0 (see LICENSE of
<http://www.apache.org/licenses/LICENSE-2.0>), at your option. All
files in t... | fn test_simple_type_item() { |
<|file_name|>request.ts<|end_file_name|><|fim▁begin|>import { Options as RequestOptions } from "request";
import * as _ from "lodash";
import { Headers, Header, Form, FormData, Params,Param, RequestMethod, HeaderValueType } from "../index";
type dataValue = any | any[] | null;
export class Request {
private meth... | });
return this;
} |
<|file_name|>BitMarketAssert.java<|end_file_name|><|fim▁begin|>package org.knowm.xchange.bitmarket;
import static org.assertj.core.api.Assertions.assertThat;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
import org.knowm.xchange.bitmarket.dto.account.BitMarketBalance;
import org.knowm.xcha... | public static void assertEquals(BitMarketOrder o1, BitMarketOrder o2) {
assertThat(o1.getId()).isEqualTo(o2.getId()); |
<|file_name|>meta.ts<|end_file_name|><|fim▁begin|>module.exports = {
'consistent-casing': require('./meta/consistent-casing'),<|fim▁hole|> strict: require('./meta/strict'),
target: require('./meta/target')
};<|fim▁end|> | 'import-helpers': require('./meta/import-helpers'),
'is-valid': require('./meta/is-valid'),
'no-comments': require('./meta/no-comments'), |
<|file_name|>MediaTypes.java<|end_file_name|><|fim▁begin|>package com.qmx.wxmp.common.web;
/**
* 带UTF-8 charset 定义的MediaType.
*
* Jax-RS和Spring的MediaType没有UTF-8的版本,
* Google的MediaType必须再调用toString()函数而不是常量,不能用于Restful方法的annotation。
*
* @author free lance
*/
public class MediaTypes {
public static final Stri... | public static final String TEXT_XML = "text/xml"; |
<|file_name|>4_traitsbounds_mistake1.rs<|end_file_name|><|fim▁begin|>/* Writing a function which adds 2 to every element of vector and a function to multiply 2
to every element of the vector */
/* NOTES: OWNERSHIP AND BORROW RULES
1. Only one owner at a time
2. Only 1 active mutable borrow at a time
... | |
<|file_name|>const.rs<|end_file_name|><|fim▁begin|>// min-llvm-version: 10.0.1<|fim▁hole|>// run-pass
// revisions: mirunsafeck thirunsafeck
// [thirunsafeck]compile-flags: -Z thir-unsafeck
#![feature(asm, global_asm)]
fn const_generic<const X: usize>() -> usize {
unsafe {
let a: usize;
asm!("mov ... | // only-x86_64 |
<|file_name|>caching_map_test.go<|end_file_name|><|fim▁begin|>// Copyright (c) 2021 Tigera, Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.... | string([]byte{1, 1}): string([]byte{1, 2, 4, 3}),
string([]byte{1, 2}): string([]byte{1, 2, 3, 6}),
string([]byte{1, 4}): string([]byte{1, 2, 3, 5}), |
<|file_name|>shopvec.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
import os
import crossval, features, estimators, estpicker, bootstrap
def Vecuum():
print('\nGROUP CHOICES (automated order: 2,1,0,4,3,5,11,10,12)')
print('\nSymptom Severity:\n')
print(' 0= control/mild\n 1= control/severe\n... | os.system('spd-say -r -50 -p -50 -t female3 "your groups have finished running. To run more groups, you must construct additional pylons."')
|
<|file_name|>tco-cross-realm-class-construct.js<|end_file_name|><|fim▁begin|>/*
* Copyright (c) André Bargull
* Alle Rechte vorbehalten / All Rights Reserved. Use is subject to license terms.
*
* <https://github.com/anba/es6draft>
*/
/*---
id: sec-function-calls-runtime-semantics-evaluation
info: Check TypeError ... | ---*/
|
<|file_name|>Event.js<|end_file_name|><|fim▁begin|>(function (factory) {
if (typeof module === "object" && typeof module.exports === "object") {
var v = factory(require, exports);
if (v !== undefined) module.exports = v;
}
else if (typeof define === "function" && define.amd) {
define... | var source = sourceEvent;
return new Event(function (observer) {
return source.Subscribe(new Observable_1.Observer(function (t) {
return Observable_2.protect(function () { return mapping(t); }, observer.OnNext, observer.OnError); |
<|file_name|>longest_increasing_subsequence.py<|end_file_name|><|fim▁begin|>from bisect import bisect_left
from lib import argmax, bin_search_left, yield_while
from math import inf
def search(arr): # binary search, length only. O(n\log n) time
st = [arr[0]] # st[i]: smallest tail of LIS of length i + 1. naturall... | return True
return False
|
<|file_name|>vec4.rs<|end_file_name|><|fim▁begin|>// Generated code.
use std::fmt::{Display, Formatter, Result};
use std::ops::*;
use std::mem;
use Vec4b;
use Mat4;
/// 4-dimensional vector with 32 bit floating point `x`, `y`, `z`, and `w` components.
///
/// Vectors can also represent colors with the help of
/// `r()... | |
<|file_name|>main.py<|end_file_name|><|fim▁begin|>'''
Created on May 9, 2014
@author: Jennifer Reiber Kyle
'''
from kaggle import Submitter, DataReader
from prediction import Preprocessor, Classifier
<|fim▁hole|>
p = Preprocessor(*reader.getData())
submitter = Submitter(submitDir)
train, trainLabels,... | def runPrediction(sourceDirectory,submitDirectory):
reader = DataReader(dataDir) |
<|file_name|>legacy.mouse.shim.js<|end_file_name|><|fim▁begin|>(function($, undefined) {
<|fim▁hole|> $.MouseTracker.subscribeEvents = [ "click", "dblclick", "keypress", "focus", "blur", $.MouseTracker.wheelEventName ];
if( $.MouseTracker.wheelEventName == "DOMMouseScroll" ) {
// Older Firefox
$... | /**
* Plugin to force OpenSeadragon to use the legacy mouse pointer event model
*/
|
<|file_name|>turing.py<|end_file_name|><|fim▁begin|>required_states = ['accept', 'reject', 'init']
class TuringMachine(object):
def __init__(self, sigma, gamma, delta):
self.sigma = sigma
self.gamma = gamma
self.delta = delta
self.state = None
self.tape = None
... | assert char in self.sigma |
<|file_name|>acosh.js<|end_file_name|><|fim▁begin|><|fim▁hole|> // * returns 1: 16.674657798418625
return Math.log(arg + Math.sqrt(arg * arg - 1));
}<|fim▁end|> | function acosh (arg) {
// http://kevin.vanzonneveld.net
// + original by: Onno Marsman
// * example 1: acosh(8723321.4); |
<|file_name|>render_process_host_creation_observer.cc<|end_file_name|><|fim▁begin|><|fim▁hole|>// found in the LICENSE file.
#include "content/public/browser/render_process_host_creation_observer.h"
#include "content/browser/renderer_host/render_process_host_impl.h"
namespace content {
RenderProcessHostCreationObse... | // Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be |
<|file_name|>app.module.ts<|end_file_name|><|fim▁begin|>import { NgModule, ApplicationRef } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { HttpModule } from '@angular/http';
import { FormsModule } from '@angular/forms';
import { AppComponent } from './app.component';
import {... | constructor(public appRef: ApplicationRef) {} |
<|file_name|>IRS16NM.py<|end_file_name|><|fim▁begin|>import sys
sys.path.append('../')
import Graffity
import numpy
import PlotTools
import glob
import astropy.io.fits as pyfits
from scipy import optimize
from os import walk
from os.path import join
def fitGaussian(x, y):
errfunc = lambda p, x, y: numpy.abs(p[0]*n... | figs[0].show()
figs[0].savefig("Amplitude_V_Strehl.png") |
<|file_name|>ppm_writer.rs<|end_file_name|><|fim▁begin|>extern crate ppm;
use std::io;
use ppm::PPMWriter;
fn main() {
let width = 200;
let height = 100;
let image_data = generate_image_data(width, height);
let stdout = io::stdout();
let mut out = stdout.lock();
let mut writer = PPMWriter::... |
for y in 0..height { |
<|file_name|>addBorder_BACKUP_4896.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env/python
# -*-coding : utf-8 -*-
<<<<<<< HEAD<|fim▁hole|>For
picture = ["abc",
"ded"]
the output should be
addBorder(picture) = ["*****",
"*abc*",
"*ded*",
"*****"... | '''
Given a rectangular matrix of characters, add a border of asterisks(*) to it. |
<|file_name|>component.js<|end_file_name|><|fim▁begin|>import Ember from 'ember';
const DELAY = 100;
export default Ember.Component.extend({
classNameBindings : ['inlineBlock:inline-block','clip:clip'],
tooltipService : Ember.inject.service('tooltip'),
inlineBlock : true,
clip : false,
mo... | textChangedEvent : null,
|
<|file_name|>customresource_discovery_controller.go<|end_file_name|><|fim▁begin|>/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/... | |
<|file_name|>routers.py<|end_file_name|><|fim▁begin|>from .viewsets import *
from rest_framework import routers
# Routers provide an easy way of automatically determining the URL conf.<|fim▁hole|>router.register(r'mycontent', MyContentViewSet)
router.register(r'job', JobViewSet)
router.register(r'course', CourseViewSe... | router = routers.DefaultRouter()
router.register(r'person', PersonViewSet)
router.register(r'skill', SkillViewSet) |
<|file_name|>super.rs<|end_file_name|><|fim▁begin|>fn foo() {}
mod inner {
fn main() {<|fim▁hole|><|fim▁end|> | super::f<caret>oo();
}
} |
<|file_name|>xmlpoke.d.ts<|end_file_name|><|fim▁begin|>// Type definitions for xmlpoke 0.1.12
// Project: https://github.com/mikeobrien/node-xmlpoke
// Definitions by: Garth Kidd <https://github.com/garthk/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../xpath/xpath.d.ts" />... | withBasePath(xpath: string): API; |
<|file_name|>conftest.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""Defines fixtures available to all tests."""
import pytest
from webtest import TestApp
from p101stat.app import create_app
from p101stat.database import db as _db
from p101stat.settings import TestConfig
from .factories import IdolFactor... | def idol(db):
"""A idol for the tests.""" |
<|file_name|>find-language-from-key.pipe.ts<|end_file_name|><|fim▁begin|>import { Pipe, PipeTransform } from '@angular/core';
@Pipe({ name: 'findLanguageFromKey' })
export class FindLanguageFromKeyPipe implements PipeTransform {<|fim▁hole|> return this.languages[lang].name;
}
}<|fim▁end|> | private languages: any = {
// jhipster-needle-i18n-language-key-pipe - JHipster will add/remove languages in this object
};
transform(lang: string): string { |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | __author__ = 'shinyorke_mbp' |
<|file_name|>test_search.py<|end_file_name|><|fim▁begin|>import time
from datetime import datetime
from pydoc import locate
from unittest import SkipTest
from countries_plus.models import Country
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Perm... | from ESSArch_Core.agents.models import (
Agent,
AgentTagLink,
AgentTagLinkRelationType, |
<|file_name|>Auth.cpp<|end_file_name|><|fim▁begin|>/*
* Qt Authentication Library
* Copyright (C) 2013 Martin Bříza <mbriza@redhat.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundat... | QString message;
Info type = INFO_NONE; |
<|file_name|>LiveDataCacheKey.java<|end_file_name|><|fim▁begin|>/**
* NOTE: This copyright does *not* cover user programs that use HQ
* program services by normal system calls through the application
* program interfaces provided as part of the Hyperic Plug-in Development
* Kit or the Hyperic Client Development Kit... | * Copyright (C) [2009-2010], VMware, Inc.
* This file is part of HQ.
* |
<|file_name|>Logging.java<|end_file_name|><|fim▁begin|>/*
# Licensed Materials - Property of IBM
# Copyright IBM Corp. 2019
*/
package com.ibm.streamsx.topology.internal.logging;
import java.util.logging.Level;
import java.util.logging.Logger;
public interface Logging {
/**
* Set the root logging level... | |
<|file_name|>GradeActionResource.js<|end_file_name|><|fim▁begin|>var resources = require('jest'),
util = require('util'),
models = require('../../models'),
async = require('async'),
common = require('./../common'),
calc_thresh = require('../../tools/calc_thresh.js'),
GradeActionSuggestion = requ... | // callback(null, object);
// }
// } |
<|file_name|>restaurant_oper.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#-*- encoding:utf-8 -*-
import json
from datetime import datetime
from bottle import route, mako_template as template, redirect, request, response, get, post
from bottle import static_file, view #为了不经过controller直接返回诸如html,css等静态文件引入
f... | id = request.params.get('id') |
<|file_name|>vector.helper.js<|end_file_name|><|fim▁begin|>const {xObjectForm} = require('./xObjectForm');
exports._getPathOptions = function _getPathOptions(options = {}, originX, originY) {
this.current = this.current || {};
const colorspace = options.colorspace || this.options.colorspace;
const colorNam... | size: options.size || this.current.defaultFontSize, |
<|file_name|>lisp.js<|end_file_name|><|fim▁begin|>/*
Language: Lisp
Description: Generic lisp syntax
Author: Vasily Polovnyov <vast@whiteants.net>
Category: lisp
*/
function lisp(hljs) {
var LISP_IDENT_RE = '[a-zA-Z_\\-+\\*\\/<=>&#][a-zA-Z0-9_\\-+*\\/<=>&#!]*';
var MEC_RE = '\\|[^]*?\\|';
var LISP_SIMPLE_NUMBER_... | }
);
var VARIABLE = {
begin: '\\*', end: '\\*' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.