prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>ArrayLongLongHashMapTest.java<|end_file_name|><|fim▁begin|>package org.kevoree.modeling.memory.struct.map.impl;
import org.kevoree.modeling.memory.struct.map.BaseKLongLongHashMapTest;
import org.kevoree.modeling.memory.struct.map.KLongLongMap;
public class ArrayLongLongHashMapTest extends BaseKLongLongHa... | } |
<|file_name|>deferred.rs<|end_file_name|><|fim▁begin|>use std::ops;
use std::str;
use std::fmt;
#[derive(Debug, Clone, PartialEq, Eq)]
pub(crate) enum Deferred<T> {
StaticStr(&'static str),
Actual(T),
}
impl<T> Deferred<T> where T: From<&'static str> {
pub(crate) fn into_actual(self) -> T {
match... |
impl<T> ops::Deref for Deferred<T> where T: ops::Deref<Target=str> {
|
<|file_name|>profile.ts<|end_file_name|><|fim▁begin|>import "bootstrap-slider";
import "bootstrap-switch";
export module profile {
function onInfoSubmit() {
var params: { [key: string]: string } = {};
$("#info-container .info-field").each(function() {
let name: string = this.getAttribu... | $("button.iu-button[type='submit']").on("click", onInfoSubmit);
});
} |
<|file_name|>issue-8767.rs<|end_file_name|><|fim▁begin|>impl B { //~ ERROR cannot find type `B` in this scope
}
<|fim▁hole|><|fim▁end|> | fn main() {
} |
<|file_name|>594422d373ee_fip_qos.py<|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... | def upgrade(): |
<|file_name|>attr.hpp<|end_file_name|><|fim▁begin|>/*=============================================================================
Copyright (c) 2001-2011 Hartmut Kaiser
Copyright (c) 2001-2014 Joel de Guzman
Copyright (c) 2013 Agustin Berge
Distributed under the Boost Software License, Version 1.0. (S... | attr_parser& operator= (attr_parser const&);
}; |
<|file_name|>query.py<|end_file_name|><|fim▁begin|>from key import Key
def _object_getattr(obj, field):
"""Attribute getter for the objects to operate on.
This function can be overridden in classes or instances of Query, Filter, and
Order. Thus, a custom function to extract values to attributes can be
... |
"""
order = order if isinstance(order, Order) else Order(order) |
<|file_name|>test_with_httpretty.py<|end_file_name|><|fim▁begin|>import concurrent
from concurrent.futures._base import Future
import json
from threading import Barrier
import time
import unittest
import requests_mock
from rpcclient.client import RpcClient
from rpcclient.deserialize import DictDeserializer
from rpcclie... | |
<|file_name|>useragent.go<|end_file_name|><|fim▁begin|>package dockerversion // import "github.com/tiborvass/docker/dockerversion"
import (
"context"
"fmt"
"runtime"
"github.com/tiborvass/docker/pkg/parsers/kernel"
"github.com/tiborvass/docker/pkg/useragent"
)
// UAStringKey is used as key type for user-agent s... | // getUserAgentFromContext returns the previously saved user-agent context stored in ctx, if one exists |
<|file_name|>ThreadableLoader.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2009 Google Inc. 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 m... | |
<|file_name|>api.py<|end_file_name|><|fim▁begin|>from allocine import allocine
from constants import *
from elcinema import elcinema
from imdb import imdby as Imdb
from rotten import rotten
from tmdb import tmdb<|fim▁hole|>
def search(query, site):
if site == "imdb":
provider = Imdb()
elif site == "elc... | |
<|file_name|>types.py<|end_file_name|><|fim▁begin|>import os
import sys
import stat
from ._compat import open_stream, text_type, filename_to_ui, get_streerror
from .exceptions import BadParameter
from .utils import safecall, LazyFile
class ParamType(object):
"""Helper for converting values through types. The fo... | |
<|file_name|>RealData.java<|end_file_name|><|fim▁begin|>package com.flying.promotion.javatuning.future.jdk;
import java.util.concurrent.Callable;<|fim▁hole|> * Created by Joseph on 7/25/2016.
*/
public class RealData implements Callable<String>{
private String para;
public RealData(String para){
this.... |
/** |
<|file_name|>browserify-zlib.d.ts<|end_file_name|><|fim▁begin|>/// <reference path='../typings/browser.d.ts' />
// TypeScript definitions for browserify-zlib:
// https://github.com/devongovett/browserify-zlib
//
// Note that this is a tiny fraction of available
// methods; for a reference, see the Node.js zlib
// do... | function gunzipSync(buffer:Buffer) : Buffer;
} |
<|file_name|>test_protocol.py<|end_file_name|><|fim▁begin|># Copyright 2014 CERN.
#
# 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|>IRPredictor.java<|end_file_name|><|fim▁begin|><|fim▁hole|> *
* 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 above copyright notice,
* this list... | /*
* Copyright (c) 2012, JInterval Project.
* All rights reserved. |
<|file_name|>BinaryMain.cpp<|end_file_name|><|fim▁begin|><|fim▁hole|>
int main(int argc, char* argv[])
{
BinaryLLHeap <int> heap;
heap.insert(5);
return 0;
}<|fim▁end|> | #include "BinaryLLHeap.h" |
<|file_name|>HighCardDictDimensionIndexCodec.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... | }
@Override
public ColumnPageEncoder createEncoder(Map<String, String> parameter) { |
<|file_name|>control_detail.component.html.ts<|end_file_name|><|fim▁begin|>export const HTML_TEMPLATE = `<|fim▁hole|> </form>
</div>
`;<|fim▁end|> | <div class="navbar navbar-default" role="navigation">
<h1 class="navbar-form pull-left" style="display: inline;">Auftrag {{ id }}</h1>
<form class="navbar-form pull-right">
<button class="btn btn-primary" (click)="back()">Zurück zur Übersicht</button> |
<|file_name|>test_crashstorage.py<|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/.
import os
import time
import json
from contextlib import ... | from socorro.external.hbase import hbase_client
from socorro.external.crashstorage_base import ( |
<|file_name|>svh-a-no-change.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.apache.org... | //! (#14132). |
<|file_name|>extpipe.cpp<|end_file_name|><|fim▁begin|>#include <unistd.h>
#include <string.h>
#include <signal.h>
#include <sys/wait.h>
#include <errno.h>
#include <vdr/tools.h>
#include <vdr/thread.h>
#include "extpipe.h"
cExtPipe::cExtPipe(void)
{
pid = -1;
f_stderr = -1;
f_stdout= -1;
}
cExtPipe::~c... | bool cExtPipe::Open(const char *Command)
{ |
<|file_name|>eq.js<|end_file_name|><|fim▁begin|>var _curry2 = require('./internal/_curry2');
/**
* Tests if two items are equal. Equality is strict here, meaning reference equality for objects and
* non-coercing equality for primitives.
*
* @func
* @memberOf R
* @category Relation
* @sig a -> b -> Boolean
* ... | * @return {Boolean}
* @example |
<|file_name|>0005_workertype_is_active.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0004_auto_20161116_1209'),
]
operations = [
migrations.Ad... | # -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-11-16 12:50 |
<|file_name|>info_base.rs<|end_file_name|><|fim▁begin|>use super::{imports::Imports, *};
use crate::{codegen::Visibility, library, version::Version};
#[derive(Debug, Default)]
pub struct InfoBase {
pub full_name: String,
pub type_id: library::TypeId,
pub name: String,
pub functions: Vec<functions::Info... | impl InfoBase {
///TODO: return iterator |
<|file_name|>plot_circos_plot.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""
Read the list of chimeric interactions and generate a file that can be read
by circos.
"""
import sys
import argparse
from collections import defaultdict
from math import log
import pro_clash
def process_command_line(argv):
... | |
<|file_name|>die.py<|end_file_name|><|fim▁begin|>from random import randint<|fim▁hole|>
class Die():
'''A class representing a single die'''
def __init__(self, num_sides=6):
'''assume a six-side die'''
self.num_sides = num_sides
def roll(self):
'''return a random number between 1 a... | |
<|file_name|>where-clauses.rs<|end_file_name|><|fim▁begin|>// run-pass
trait Equal {
fn equal(&self, other: &Self) -> bool;
fn equals<T,U>(&self, this: &T, that: &T, x: &U, y: &U) -> bool
where T: Eq, U: Eq;
}
impl<T> Equal for T where T: Eq {
fn equal(&self, other: &T) -> bool {
self =... |
fn main() { |
<|file_name|>metrics_confusion_matrix_test.py<|end_file_name|><|fim▁begin|># Copyright 2016 The TensorFlow 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
#
# ... | self.evaluate(update_op) |
<|file_name|>predicates_test.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/... | |
<|file_name|>csr.go<|end_file_name|><|fim▁begin|>package openssl
import (
"fmt"
"io/ioutil"
"os/exec"
"regexp"
log "github.com/cihub/seelog"
)
type CSR struct {
//path string
//key string
content []byte
contentKey []byte
}
func (o *Openssl) LoadCSR(filename, keyfile string) (*CSR, error) {
var err er... | |
<|file_name|>classpath.rs<|end_file_name|><|fim▁begin|>// rustyVM - Java VM written in pure Rust
// Copyright (c) 2013 Alexander Gessler
//
// 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 ... |
// ----------------------------------------------
pub fn get_paths<'a>(&'a self) -> &'a ~[~str] |
<|file_name|>cms_plugins.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.utils.translation import get_language, to_locale
from cms.plugin_base import CMSPluginBase
from cms.plugin_pool import plugin_pool
from .conf import settings
from .models import Facebo... |
class FacebookCommentsPlugin(CMSPluginBase): |
<|file_name|>course.py<|end_file_name|><|fim▁begin|>import json
import os
import re
import shutil
import xmltodict
import zipfile
from django.conf import settings
from django.conf.urls import url
from django.core.exceptions import MultipleObjectsReturned
from django.db.models import Q
from django.http import HttpRespo... |
class Meta: |
<|file_name|>users.js<|end_file_name|><|fim▁begin|>// Constants
export const USERS_INCREMENT = 'USERS_INCREMENT'
export const USERS_DOUBLE_ASYNC = 'USERS_DOUBLE_ASYNC'<|fim▁hole|>// Actions
export function increment(value = 1) {
return {
type: USERS_INCREMENT,
payload: value
}
}
export const doubleAsync = ... | |
<|file_name|>camera.rs<|end_file_name|><|fim▁begin|>use glfw;
use std::uint;
use std::libc::c_int;
use std::hashmap::HashMap;
use math::{Vec3, Mat4};
use gl::Mesh;
use gl::shader::{Shader, AttribLocation, UniformLocation};
use glfw::Window;
pub struct Camera {
window: ~Window,
translation: Vec3<f32>,
ro... | attribs: ~HashMap<~str, AttribLocation>, |
<|file_name|>statistics.cpp<|end_file_name|><|fim▁begin|>/*
* (c)2016-2017, Cris Luengo.
* Based on original DIPlib code: (c)1995-2014, Delft University of Technology.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may o... | for( dip::uint ii = 0; ii < bufferLength; ++ii ) { |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>"""Automabot bot for Discord."""
from os import path
from setuptools import setup, find_packages
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.rst'), 'r', encoding='utf-8') as f:
long_description = f.read()
setup(
name='auto... | 'docs': ('Sphinx>=1.6.0', 'sphinxcontrib-trio')
},
) |
<|file_name|>ClusterBean.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 un... | |
<|file_name|>base_handler.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# 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/.
#
# Copyright 2017-2019 - Edoardo Morass... | |
<|file_name|>flatten.rs<|end_file_name|><|fim▁begin|>use crate::fmt;
use crate::iter::{DoubleEndedIterator, Fuse, FusedIterator, Iterator, Map, TrustedLen};
use crate::ops::Try;
/// An iterator that maps each element to an iterator, and yields the elements
/// of the produced iterators.
///
/// This `struct` is create... | /// Adapts an iterator by flattening it, for use in `flatten()` and `flat_map()`.
fn new(iter: I) -> FlattenCompat<I, U> { |
<|file_name|>HookshotState.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2009 Christopho, Solarus - http://www.solarus-engine.org
*
* Solarus 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 v... | #include "hero/HookshotState.h"
#include "hero/FreeState.h"
#include "hero/HeroSprites.h" |
<|file_name|>UsuarioControllerTest.js<|end_file_name|><|fim▁begin|>/**
* Usuario Controller Test Suite
*
* @author Thiago Paes <mrprompt@gmail.com>
* @license MIT
*/
'use strict';
var connection = require('../test');
var Usuario = require('../../src/controllers/UsuarioController');
var sinon = require('sinon');... | };
|
<|file_name|>resolved_item_builder.hpp<|end_file_name|><|fim▁begin|>/*
Playdar - music content resolver
Copyright (C) 2009 Richard Jones
Copyright (C) 2009 Last.fm Ltd.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as pub... | out.push_back( Pair("duration", file->duration) );
out.push_back( Pair("bitrate", file->bitrate) );
artist_ptr artobj = Library::load_artist( db, file->piartid);
track_ptr trkobj = Library::load_track( db, file->pitrkid); |
<|file_name|>clienteController.js<|end_file_name|><|fim▁begin|>'use strict';
var app = angular.module('exemplo', []).controller('clienteController', function($scope, $http){
$scope.mensagem_erro = '';
$scope.resultado = '';
$scope.novoCliente = {};
$scope.carregarClientes = function() {
var url ... | var url = 'http://localhost:8080/cliente/'; |
<|file_name|>roles.py<|end_file_name|><|fim▁begin|># Copyright 2015-2017 Rumma & Ko Ltd<|fim▁hole|>from lino.core.roles import UserRole
class SimpleContactsUser(UserRole):
pass
class ContactsUser(SimpleContactsUser):
pass
class ContactsStaff(ContactsUser):
pass<|fim▁end|> | # License: BSD (see file COPYING for details)
|
<|file_name|>GirlComponent.js<|end_file_name|><|fim▁begin|>/**
* Created by TC on 2016/10/10.
*/
import React, {
Component,
} from 'react'<|fim▁hole|> ToastAndroid,
ActivityIndicator,
}
from 'react-native'
import PixelRatio from "react-native/Libraries/Utilities/PixelRatio";
class GirlComponent ext... |
import {
Image,
View, |
<|file_name|>DistributedGoofySpeedwayAI.py<|end_file_name|><|fim▁begin|>from otp.ai.AIBaseGlobal import *
import DistributedCCharBaseAI
from direct.directnotify import DirectNotifyGlobal
from direct.fsm import ClassicFSM, State
from direct.fsm import State
from direct.task import Task
import random
from toontown.toonba... | def exitChatty(self):
self.ignore(self.chattyDoneEvent)
self.chatty.exit()
|
<|file_name|>htmllinkelement.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::attr::{Attr, AttrValue};
use dom::attr::Attr... | |
<|file_name|>structure-constructor-type-mismatch.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
// h... | |
<|file_name|>300.cpp<|end_file_name|><|fim▁begin|>#include "cpp_header.h"
class Solution {
public:
int lengthOfLIS(vector<int>& nums)
{
vector<int> lens(nums.size(), 1);
int longest = 0;
for(int i = 0; i < nums.size(); i++)
{
for(int j = 0; j < i; j++)
{
if(nums[i] > nums[j])
{
lens[i] = ... | cout << casenum << " pass\n";
}
else
{ |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>def main():
"""Instantiate a DockerStats object and collect stats."""<|fim▁hole|> print('Docker Service Module')
if __name__ == '__main__':
main()<|fim▁end|> | |
<|file_name|>vis_utils_test.py<|end_file_name|><|fim▁begin|># Copyright 2018 The TensorFlow 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.ap... | model.add(keras.layers.Dense(5, name='dense')) |
<|file_name|>ConverNumberServiceAsync.java<|end_file_name|><|fim▁begin|>package es.josealmela.BasicMathCalculator.client;
import com.google.gwt.user.client.rpc.AsyncCallback;<|fim▁hole|>/**
* The async counterpart of <code>convertNumberService</code>.
*/
public interface ConverNumberServiceAsync {
void convertNumb... | |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>'use strict';
var path = require('path');
var Stream = require('readable-stream');
var BufferStreams = require('bufferstreams');
var ttf2woff2 = require('ttf2woff2');
var PluginError = require('plugin-error');
var replaceExtension = require('replace-ext');
var PLUGIN... |
stream.push(file);
done();
|
<|file_name|>about.js<|end_file_name|><|fim▁begin|>import React from "react"
import Img from "gatsby-image"
import { StaticQuery, graphql } from "gatsby"
import html5 from "../images/html5.svg"
import js from "../images/javascript.svg"
import jQuery from "../images/jquery.svg"
import php from "../images/php.svg"
import... | |
<|file_name|>plugins_hook.js<|end_file_name|><|fim▁begin|>#!/usr/bin/env node
var pluginlist = [
];
var exec = require('child_process').exec;
function puts(error, stdout, stderr) {
console.log(stdout);<|fim▁hole|>});<|fim▁end|> | }
pluginlist.forEach(function(plug) {
exec("cordova plugin add " + plug, puts); |
<|file_name|>model.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# 자세한 설명은 상위 폴더의 03 - Seq2Seq.py 등에서 찾으실 수 있습니다.
import tensorflow as tf
# Seq2Seq 기본 클래스
class Seq2Seq:
logits = None
outputs = None
cost = None
train_op = None
def __init__(self, vocab_size, n_hidden=128, n_layers=3):
... | |
<|file_name|>CoMPlEx_hwConfig_Dialog.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'GUIs\CoMPlEx_hwConfig_Dialog.ui'
#
# Created by: PyQt4 UI code generator 4.11.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
t... | |
<|file_name|>db_connector.py<|end_file_name|><|fim▁begin|>import os
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import create_engine<|fim▁hole|>from sqlalchemy.orm import sessionmaker
Base = declarative_base()
class DBConnector():
'''
where every row is the details one employee was... | |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import patterns, include, url
from django.conf import settings
from django.views.generic import ListView
from django.views.generic.detail import DetailView
from foo.hotel.models import Hotel
from foo.hotel.views import HotelLimitListView
from foo.... | |
<|file_name|>ranking.py<|end_file_name|><|fim▁begin|>"""Metrics to assess performance on classification task given scores
Functions named as ``*_score`` return a scalar value to maximize: the higher
the better
Function named as ``*_error`` or ``*_loss`` return a scalar value to minimize:
the lower the better
"""
# A... | |
<|file_name|>HealthStateScope.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2016 ThoughtWorks, 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/lic... | if (getClass() != that.getClass()) { return false; }
return equals((HealthStateScope) that);
} |
<|file_name|>version-check.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# 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 r... | |
<|file_name|>gcp.py<|end_file_name|><|fim▁begin|>""" Launcher functionality for the Google Compute Engine (GCE)
"""
import json
import logging
import os
from dcos_launch import onprem, util
from dcos_launch.platforms import gcp
from dcos_test_utils.helpers import Host
from googleapiclient.errors import HttpError
log ... | def get_cluster_hosts(self) -> [Host]:
return list(self.deployment.hosts)[1:]
def get_bootstrap_host(self) -> Host: |
<|file_name|>issue-3099.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>// 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 not be copied, modified, or ... | // 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.
// |
<|file_name|>ev3.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
# Copyright (c) 2015 Eric Pascual
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation fi... | has changed since last `process()` call. `state` parameter is the new |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>$ = require("jquery");
jQuery = require("jquery");
var StatusTable = require("./content/status-table");
var ArchiveTable = require("./content/archive-table");
var FailuresTable = require("./content/failures-table");
var UploadTestFile = require("./content/upload-test-... | }
|
<|file_name|>091.py<|end_file_name|><|fim▁begin|>#-*- encoding: utf-8 -*-
"""
Right triangles with integer coordinates
The points P (x1, y1) and Q (x2, y2) are plotted at integer co-ordinates and are joined to the origin, O(0,0), to form ΔOPQ.
<|fim▁hole|>
Given that 0 ≤ x1, y1, x2, y2 ≤ 50, how many right triangles... |
There are exactly fourteen triangles containing a right angle that can be formed when each co-ordinate lies between 0 and 2 inclusive; that is,0 ≤ x1, y1, x2, y2 ≤ 2. |
<|file_name|>test_create_page.py<|end_file_name|><|fim▁begin|>from unittest import TestCase
from machete.base.tests import IntegrationTestCase
from machete.wiki.models import Wiki, Page
class CreatePageTest(TestCase):
def test_create_page(self):
wiki = Wiki.create()
page = wiki.create_page("test n... |
class PageIntegrationTest(IntegrationTestCase):
def test_create_page(self):
url = "/projects/{}/wiki/".format(self.project.vid) |
<|file_name|>misc.js<|end_file_name|><|fim▁begin|>import Vector from '../prototype'
import {componentOrder, allComponents} from './components'
export const withInvertedCurryingSupport = f => {
const curried = right => left => f(left, right)
return (first, second) => {
if (second === undefined) {
// chec... | }
return f(first, second) |
<|file_name|>udisks2.go<|end_file_name|><|fim▁begin|>// -*- Mode: Go; indent-tabs-mode: t -*-
/*
* Copyright (C) 2016-2017 Canonical Ltd
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as
* published by the Free Software Fou... | SUBSYSTEMS=="usb", ATTRS{idVendor}=="050d", ATTRS{idProduct}=="0248", ENV{ID_INSTANCE}=="0:0", ENV{ID_DRIVE_FLASH_CF}="1"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="050d", ATTRS{idProduct}=="0248", ENV{ID_INSTANCE}=="0:1", ENV{ID_DRIVE_FLASH_MS}="1"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="050d", ATTRS{idProduct}=="0248", ENV{ID... |
<|file_name|>attr-main-2.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.<|fim▁hole|>// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.a... | // |
<|file_name|>GNode.java<|end_file_name|><|fim▁begin|>/*
Galois, a framework to exploit amorphous data-parallelism in irregular
programs.
Copyright (C) 2010, The University of Texas at Austin. All rights reserved.
UNIVERSITY EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES CONCERNING THIS SOFTWARE
AND DOCUMENTATION, INCLUDIN... | kind.
File: GNode.java
|
<|file_name|>AboutPage.spec.js<|end_file_name|><|fim▁begin|>import React from 'react';
import {shallow} from 'enzyme';
import AboutPage from './AboutPage';
describe('<AboutPage />', () => {
it('should have a header called \'About\'', () => {<|fim▁hole|> const wrapper = shallow(<AboutPage />);
const actual = wrappe... | |
<|file_name|>wx._gdi_.py<|end_file_name|><|fim▁begin|>def __load():
import imp, os, sys
try:
dirname = os.path.dirname(__loader__.archive)
except NameError:
dirname = sys.prefix
path = os.path.join(dirname, 'wx._gdi_.pyd')
#print "py2exe extension module", __name__, "->", path... | __load()
del __load |
<|file_name|>actions.py<|end_file_name|><|fim▁begin|># Copyright 2017 AT&T Intellectual Property. All other 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://ww... | |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns(
'',<|fim▁hole|> url(r'^logout/$', 'django.contrib.auth.views.logout', {'next_page': '/'}, name='logout'),
)<|fim▁end|> | url(r'', include('frontpage.urls')),
url(r'^auth/', include('social.apps.django_app.urls', namespace='social')),
url(r'^admin/', include(admin.site.urls)), |
<|file_name|>photopreviewdlg.cpp<|end_file_name|><|fim▁begin|>/*
photo_prev: Application to assist in sorting through photographs.
Copyright (C) 2008 Jeremiah LaRocco
This file is part of photo_prev.
photo_prev is free software: you can redistribute it and/or modify
it under the terms of the GNU General Pu... | reject_dir_tb->text()); |
<|file_name|>pull.rs<|end_file_name|><|fim▁begin|>// Copyright (c) 2016-2017 Chef Software Inc. and/or applicable contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// ht... | |
<|file_name|>ExifTagWriteOperation.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 lat... | *
* @author FracPete (fracpete at waikato dot ac dot nz)
*/ |
<|file_name|>solution9.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
digits = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'}
found = True
while found:
input_string = input('Please give me some digits... \n')
found = False
for character in input_string:
if character not in digits:
... | |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.http import HttpResponseRedirect, Http404
from django.contrib import auth
from django.contrib.auth import get_user_model
from django.contrib.auth.decorators import login_required<|fim▁hole|>from django.contrib.auth.models import User
@login_required
def ... | |
<|file_name|>plotting.py<|end_file_name|><|fim▁begin|>"""
Demo of the histogram (hist) function used to plot a cumulative distribution.
"""
import numpy as np
import matplotlib.pyplot as plt<|fim▁hole|>
def plot_loss_over_time(file_name):
with open(file_name, 'r') as f:
lines = f.readlines()
events = ... | from matplotlib import mlab |
<|file_name|>validate.rs<|end_file_name|><|fim▁begin|>//! Validates the MIR to ensure that invariants are upheld.
use super::MirPass;
use rustc_index::bit_set::BitSet;
use rustc_infer::infer::TyCtxtInferExt;
use rustc_middle::mir::interpret::Scalar;
use rustc_middle::mir::traversal;
use rustc_middle::mir::visit::{Plac... |
/// Returns whether the two types are equal up to lifetimes.
/// All lifetimes, including higher-ranked ones, get ignored for this comparison.
/// (This is unlike the `erasing_regions` methods, which keep higher-ranked lifetimes for soundness reasons.) |
<|file_name|>inject-script.spec.ts<|end_file_name|><|fim▁begin|>import { injectCoreHtml } from './inject-scripts';
describe('Inject Scripts', () => {
describe('injectCoreHtml', () => {
it('should replace an existed injected script tag', () => {
const inputHtml = '' +
'<html>\n' +
'<head>... | '</body>\n' +
'</html>'; |
<|file_name|>foreign.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/li... | /// Prepares a call to a native function. This requires adapting |
<|file_name|>decode.rs<|end_file_name|><|fim▁begin|>use std::{iter, fs, path};
use image::ImageFormat;
use criterion::{Criterion, criterion_group, criterion_main};
#[derive(Clone, Copy)]
struct BenchDef {
dir: &'static [&'static str],
files: &'static [&'static str],
format: ImageFormat,
}
fn load_all(c: ... | BenchDef {
dir: &["webp", "images"], |
<|file_name|>fmt.rs<|end_file_name|><|fim▁begin|>#![feature(core)]
extern crate core;
#[cfg(test)]
mod tests {
use core::fmt::radix;
use core::fmt::RadixFmt;
use core::fmt::Radix;
// #[derive(Clone, Copy, PartialEq)]
// #[unstable(feature = "core",
// reason = "may be renamed or mov... | radix_fmt_test_impl! { i64, 68, 35, "1x" }
radix_fmt_test_impl! { i64, 68, 36, "1w" }
} |
<|file_name|>switcher.js<|end_file_name|><|fim▁begin|>var EventEmitter = require('events').EventEmitter;
var util = require('util');
var WSProcessor = require('./wsprocessor');
var TCPProcessor = require('./tcpprocessor');
var logger = require('pomelo-logger').getLogger('pomelo', __filename);
var HTTP_METHODS = [
'G... | socket.setNoDelay(true);
}
processTcp(self, self.tcpprocessor, socket, data);
} |
<|file_name|>log.rs<|end_file_name|><|fim▁begin|>//!
//! Global, mutable log.
//!
//! You may think, "Global and mutable?" and wonder how the borrow checker doesn't completely have a meltdown.
//!
//! Well I do too.
//!
// What can I say, I think `GlobalLog` is prettier than GLOBALLLOG
#![allow(non_upper_case_globals)... | }
}
/// |
<|file_name|>ThridPartyStorageServiceImpl.java<|end_file_name|><|fim▁begin|>package com.enseirb.telecom.dngroup.dvd2c.service.impl;
import java.net.URI;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import javax.inject.Inject;
import javax.ws.rs.core.UriBuilder;
import org.slf4j.Lo... | conf.setBaseUrl(baseUrL);
conf.setName(name); |
<|file_name|>testapp_spec.js<|end_file_name|><|fim▁begin|>/*global jasmine*/
var excludes = [<|fim▁hole|> "map_lazy_init.html",
"map-lazy-load.html",
"marker_with_dynamic_position.html",
"marker_with_dynamic_address.html",
"marker_with_info_window.html",
"places-auto-complete.html"
];
functi... | "map_events.html", |
<|file_name|>time.rs<|end_file_name|><|fim▁begin|>use std::io::{self, Write};
use std::time::{Duration, Instant};
/// RAII timer to measure how long phases take.
#[derive(Debug)]
pub struct Timer<'a> {
output: bool,
name: &'a str,
start: Instant,
}
impl<'a> Timer<'a> {
/// Creates a Timer with the giv... | |
<|file_name|>MesosStreamMessageTypes.ts<|end_file_name|><|fim▁begin|>export const AGENT_ADDED = "AGENT_ADDED";
export const AGENT_REMOVED = "AGENT_REMOVED";
export const FRAMEWORK_ADDED = "FRAMEWORK_ADDED";
export const FRAMEWORK_REMOVED = "FRAMEWORK_REMOVED";<|fim▁hole|>export const GET_MASTER = "GET_MASTER";
export c... | export const FRAMEWORK_UPDATED = "FRAMEWORK_UPDATED";
export const GET_AGENTS = "GET_AGENTS";
export const GET_EXECUTORS = "GET_EXECUTORS";
export const GET_FRAMEWORKS = "GET_FRAMEWORKS"; |
<|file_name|>buglist.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Copyright (C) 2008,2011 Lanedo GmbH
#
# Author: Tim Janik
#
# 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 ve... | if not buglisturl:
return []
# Bugzilla query to use |
<|file_name|>test_image.py<|end_file_name|><|fim▁begin|>def test_image_export_reference(exporters, state, bpy_image_default, gltf_image_default):
state['settings']['images_data_storage'] = 'REFERENCE'
gltf_image_default['uri'] = '../filepath.png'
output = exporters.ImageExporter.export(state, bpy_image_defa... | |
<|file_name|>views.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*-
from django.conf import settings
from django.contrib import auth
from django.http import Http404, HttpResponse, HttpResponseRedirect
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.views.decorators.csrf import... | |
<|file_name|>nofile.go<|end_file_name|><|fim▁begin|>package main
import (
"log"
"os/exec"
"strconv"
"strings"
)
var t_ipv4 string = " IPv4 "
var t_ipv6 string = " IPv6 "
var t_unix string = " unix "
//执行lsof命令
func execLSOF(result chan string) {
top := exec.Command("lsof", "-bw")
out, err := top.CombinedOutput... | return "-2", "-2", "-2"
}
sysopenfile := -1 //lsof 第一行排除 |
<|file_name|>run.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""
Goal: Implement the application entry point.
@authors:
Andrei Sura <sura.andrei@gmail.com>
"""
import argparse
from olass.olass_client import OlassClient
from olass.version import __version__
DEFAULT_SETTINGS_FILE = 'config/settings.py'
d... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.