prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>Http_Delete.java<|end_file_name|><|fim▁begin|>package tasslegro.base;
import java.io.IOException;
import java.net.URI;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.ParseException;
import org.apache.http.annotation.NotThreadSafe;
import org.apache.http.cli... | super();
} |
<|file_name|>LoginManager.java<|end_file_name|><|fim▁begin|>package com.libertacao.libertacao.manager;
import android.support.annotation.Nullable;
import com.libertacao.libertacao.persistence.UserPreferences;
import com.parse.ParseFacebookUtils;
import com.parse.ParseUser;
public class LoginManager {
private sta... | if(isLoggedIn()) {
int type = ParseUser.getCurrentUser().getInt("type");
if(type % 66 == 6) { |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>#![allow(dead_code)]
pub mod vec3;
pub mod vec4;<|fim▁hole|><|fim▁end|> | pub mod mat4;
pub mod transform; |
<|file_name|>authenticationradiuspolicy_systemglobal_binding.py<|end_file_name|><|fim▁begin|>#
# Copyright (c) 2008-2015 Citrix Systems, 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... | self.authenticationradiuspolicy_systemglobal_binding = []
self.errorcode = 0
self.message = ""
self.severity = "" |
<|file_name|>MAnalogProbe.cc<|end_file_name|><|fim▁begin|>/*<|fim▁hole|> * This file is part of RHexLib,
*
* Copyright (c) 2001 The University of Michigan, its Regents,
* Fellows, Employees and Agents. All rights reserved, and distributed as
* free software under the following license.
*
* Redistribution and us... | |
<|file_name|>test_country.py<|end_file_name|><|fim▁begin|>test_records = [
[{<|fim▁hole|> "country_name": "_Test Country"
}]
]<|fim▁end|> | "doctype": "Country", |
<|file_name|>content_to_visible_time_reporter.cc<|end_file_name|><|fim▁begin|>// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "third_party/blink/public/common/page/content_to_visible_time_repor... | gfx::PresentationFeedback::Failure());
weak_ptr_factory_.InvalidateWeakPtrs(); |
<|file_name|>_i_x_n_annotation_format_8h.js<|end_file_name|><|fim▁begin|><|fim▁hole|> [ "IXNAnnotationFormatPlainString", "_i_x_n_annotation_format_8h.html#a607464fe85fc01c26df0c51826fd4841a7b4fb91d85f0776a7abe6e0623f6b0fc", null ],
[ "IXNAnnotationFormatJson", "_i_x_n_annotation_format_8h.html#a607464fe85fc... | var _i_x_n_annotation_format_8h =
[
[ "IXNAnnotationFormat", "_i_x_n_annotation_format_8h.html#a607464fe85fc01c26df0c51826fd4841", [ |
<|file_name|>install_uninstall.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
from __future__ import unicode_literals
import io
import os.path
import pipes
import sys
from pre_commit import output
from pre_commit.util import make_executable
from pre_commit.util import mkdirp
from pre_commit.uti... | def install( |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
###############################################################################
#
# SageMathCloud: A collaborative web-based interface to Sage, IPython, LaTeX and the Terminal.
#
# Copyright (C) 2014, William Stein
#
# This program is free s... | self._pids = {}
self._logfile = logfile
self._monitor_database = monitor_database |
<|file_name|>map.py<|end_file_name|><|fim▁begin|>from flask import Response
from flask.views import View
from bson import json_util
from mcp import mongo
class Map(View):
def dispatch_request(self, komuna, viti):
json = mongo.db.procurements.aggregate([
{
"$match": {
... | result_json = {}; |
<|file_name|>pipeline_fragment.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 th... | # Go to its parent AppliedPTransform.
producer = producer.parent
return necessary_transforms, all_inputs |
<|file_name|>task.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2013 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You ... |
t = _TASKS.get(tid, None) |
<|file_name|>statement.rs<|end_file_name|><|fim▁begin|>use std::iter::IntoIterator;
use std::os::raw::{c_int, c_void};
#[cfg(feature = "array")]
use std::rc::Rc;
use std::slice::from_raw_parts;
use std::{convert, fmt, mem, ptr, str};
use super::ffi;
use super::{len_as_c_int, str_for_sqlite};
use super::{
AndThenRo... | /// A prepared statement.
pub struct Statement<'conn> {
conn: &'conn Connection, |
<|file_name|>PropertiesCredentials.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2010-2017 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 lo... |
/** |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>mod token;
use crate::error::Error;
use crate::io::Char;
use self::token::Tokens;
pub use self::token::Token;
<|fim▁hole|>) -> impl Iterator<Item = Result<Token, Error>> {
Tokens::from(iter)
}<|fim▁end|> | pub fn tokens<I: Iterator<Item = Result<Char, Error>>>(
iter: I, |
<|file_name|>Frustum.cpp<|end_file_name|><|fim▁begin|>/**
* @file Frustum.cpp
*
* @author Jan Duek <xdusek17@stud.fit.vutbr.cz>
* @date 2013
*/
#include "Frustum.h"
<|fim▁hole|> auto m = glm::transpose(vp);
m_planes[TOP] = Plane::fromCoeficients(-m[1] + m[3]);
m_planes[BOTTOM] = Plane::fromCoeficients(m[1] + ... | enum Planes { TOP, BOTTOM, LEFT, RIGHT, NEAR, FAR };
Frustum::Frustum(const glm::mat4& vp) {
// transpose matrix, so we can access rows via [] operator |
<|file_name|>suffix.ts<|end_file_name|><|fim▁begin|>// random suffixes
export const suffix = [
"-a-palooza",
"-a-thon",
"ability",
"able",
"ably",
"acea",
"aceous",
"acity",
"adelic",
"age",
"agogue",
"agogy",
"aholic",
"ality",
"ambulist",
"amine",
"a... | "oholic", |
<|file_name|>encoder.rs<|end_file_name|><|fim▁begin|>// SPDX-License-Identifier: MIT
// Copyright wtfsckgh@gmail.com
// Copyright iced contributors
use super::constant_offsets::ConstantOffsets;
use super::ex_utils::to_js_error;
use super::instruction::Instruction;
use wasm_bindgen::prelude::*;
/// Encodes instruction... | ///
/// // je short $+4 |
<|file_name|>head-validation.js<|end_file_name|><|fim▁begin|>/**
* Copyright 2020 The AMP HTML 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
*
* ht... | 'amp-video': true,
});
const EXTENSION_URL_PREFIX = new RegExp( |
<|file_name|>render_particle.py<|end_file_name|><|fim▁begin|>import pygame
pygame.init()
#-- SCREEN CHARACTERISTICS ------------------------->>>
background_color = (255,255,255)
(width, height) = (300, 200)
class Particle:
def __init__(self, (x, y), radius):
self.x = x
self.y = y
self.ra... | def display(self):
pygame.draw.circle(screen, self.color, (self.x, self.y), self.radius, self.thickness) |
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-07-08 15:45
from __future__ import unicode_literals
from django.db import migrations
import share.robot
<|fim▁hole|> ('share', '0001_initial'),
('djcelery', '0001_initial'),
]
o... |
class Migration(migrations.Migration):
dependencies = [ |
<|file_name|>Blasticator.js<|end_file_name|><|fim▁begin|>var Blasticator = function() {
var init = function() {
registerSettings();
};
var showDialogue = function() {
new ModalDialogue({
message:'This will destroy EVERYTHING. FOREVER.',
buttons:[{
label:'Keep my data',
role:... |
var registerSettings = function() { |
<|file_name|>use-as-where-use-ends-with-mod-sep.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>//~^ ERROR: expected one of `::`, `;`, or `as`, found `foo`<|fim▁end|> | use std::any:: as foo; //~ ERROR expected identifier, found keyword `as` |
<|file_name|>f03.py<|end_file_name|><|fim▁begin|>"""engine.SCons.Tool.f03
Tool-specific initialization for the generic Posix f03 Fortran compiler.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyrigh... |
__revision__ = "src/engine/SCons/Tool/f03.py 2014/07/05 09:42:21 garyo" |
<|file_name|>local_gpus.py<|end_file_name|><|fim▁begin|>import os
from cosmos.api import Cosmos, py_call
from cosmos.util.helpers import environment_variables
def use_cuda_device(some_arg, num_gpus):
assert "CUDA_VISIBLE_DEVICES" in os.environ
print(("some_arg", some_arg))
print(("CUDA_VISIBLE_DEVICES", ... | |
<|file_name|>managefiles.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Zomboided
#
# 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, ... |
debugTrace("-- Entered managefiles.py with parameter " + action + " --")
if not getID() == "": |
<|file_name|>a02307.js<|end_file_name|><|fim▁begin|>var a02307 =
[
[ "GenericVector", "a02307.html#a60d42eebf02708482a8b506edd417990", null ],<|fim▁hole|> [ "~GenericVector", "a02307.html#a49840c8743a063b87839baef7e19b968", null ],
[ "back", "a02307.html#a48b82547ebbaa5fedecfdebe7e2f155a", null ],
[ "bin... | [ "GenericVector", "a02307.html#a28a69767bcadb6058a2a9df4afecd5fc", null ],
[ "GenericVector", "a02307.html#a2b61cd1cd756770518f5ac30f817a9bf", null ], |
<|file_name|>service-763.service.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 { Injectable } from '@angular/core';
@Injec... |
constructor() { }
} |
<|file_name|>OSQLFunctionSymmetricDifference.java<|end_file_name|><|fim▁begin|>/*
*
* * Copyright 2010-2016 OrientDB LTD (http://orientdb.com)
* *
* * 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 ... | |
<|file_name|>stickyMojo.js<|end_file_name|><|fim▁begin|>(function($) {
$.fn.extend({
stickyMojo: function(options) {
// Exit if there are no elements to avoid errors:
if (this.length === 0) {
return this;
}
var settings = $.extend({
'footerID': '',
'con... | |
<|file_name|>JpaApplicationDataRepository.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 f... | jpaSerializableApplicationData.serializeData();
return saveOrUpdate(jpaSerializableApplicationData.getEntityId(), manager, jpaSerializableApplicationData);
} |
<|file_name|>managePage.js<|end_file_name|><|fim▁begin|>$(document).ready(function () {
//$('#pageListDt').DataTable();
/*
$("#publish").click(function () {
NccPageMask.ShowLoadingMask();
$.ajax({
type: "post",
url: form.action,<|fim▁hole|> ... | data: form.serialize(), |
<|file_name|>benches.rs<|end_file_name|><|fim▁begin|>#![deny(warnings)]
#![feature(test)]
extern crate shove;
extern crate test;
use test::Bencher;
#[bench]<|fim▁hole|>fn foo(_bencher: &mut Bencher) {
3 + 7;
}<|fim▁end|> | |
<|file_name|>test_field.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""Test CLR field support."""
import System
import pytest
from Python.Test import FieldTest
def test_public_instance_field():
"""Test public instance fields."""
ob = FieldTest()
assert ob.PublicField == 0
ob.PublicField... | assert FieldTest.ProtectedStaticField == 1
|
<|file_name|>commandtest.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
import unittest
class TestCommand(unittest.TestCase):
def test_auth(self):
c = command.ConnectionAuth()
assert c.get_id() == 'AUTH'
if __name__ == '__main__':
unittest.main()<|fim▁end|> | from redispy import command |
<|file_name|>popcorn-api-notes.js<|end_file_name|><|fim▁begin|>// http://www.w3.org/2010/05/video/mediaevents.html
var poppy = popcorn( [ vid_elem_ref | 'id_string' ] );
poppy
// pass-through video control methods
.load()
.play()
.pause()
// property setters
.currentTime( time ) // skip forward or b... |
poppy.twitter( 'load', options );
*/ |
<|file_name|>VCRBitrateLimitingReceiver.java<|end_file_name|><|fim▁begin|>/*
* Decompiled with CFR 0_115.
*
* Could not load the following classes:<|fim▁hole|> */
package com.buzzfeed.android.vcr.util;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import a... | * android.content.BroadcastReceiver
* android.content.Context
* android.content.Intent
* android.content.IntentFilter |
<|file_name|>SessionAuthenticationFilterTest.java<|end_file_name|><|fim▁begin|>package com.turalt.openmentor.security;
import static org.easymock.EasyMock.*;
import java.io.UnsupportedEncodingException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.sh... | replay(e); |
<|file_name|>vpmullq.rs<|end_file_name|><|fim▁begin|>use ::{BroadcastMode, Instruction, MaskReg, MergeMode, Mnemonic, OperandSize, Reg, RoundingMode};
use ::RegType::*;
use ::instruction_def::*;
use ::Operand::*;
use ::Reg::*;
use ::RegScale::*;
fn vpmullq_1() {
run_test(&Instruction { mnemonic: Mnemonic::VPMULLQ,... |
fn vpmullq_5() {
run_test(&Instruction { mnemonic: Mnemonic::VPMULLQ, operand1: Some(Direct(XMM5)), operand2: Some(Direct(XMM7)), operand3: Some(IndirectScaledDisplaced(RSI, Two, 1959530681, Some(OperandSize::Xmmword), None)), operand4: None, lock: false, rounding_mode: None, merge_mode: Some(MergeMode::Zero), sae... |
<|file_name|>packet_recv_server.rs<|end_file_name|><|fim▁begin|>#![no_main]
#[macro_use]
extern crate libfuzzer_sys;
#[macro_use]
extern crate lazy_static;
use std::net::SocketAddr;
use std::sync::Mutex;
lazy_static! {
static ref CONFIG: Mutex<quiche::Config> = {
let crt_path = std::env::var("QUICHE_FU... | };
}
|
<|file_name|>graycode.py<|end_file_name|><|fim▁begin|>from __future__ import print_function, division
from sympy.core import Basic
from sympy.core.compatibility import xrange
import random
class GrayCode(Basic):
"""
A Gray code is essentially a Hamiltonian walk on
a n-dimensional cube with edge length o... | b += str(int(bin_list[i]) ^ int(b[i - 1]))
return ''.join(b) |
<|file_name|>dummy.py<|end_file_name|><|fim▁begin|># Online training of a logistic regression model
# using Assumed Density Filtering (ADF).
# We compare the ADF result with MCMC sampling
# of the posterior distribution
# Dependencies:
# !pip install git+https://github.com/blackjax-devs/blackjax.git
# !pip install ... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https:... | self.subscriber = None
def format(self, article, subscriber, codes=None): |
<|file_name|>IEnumOptionsGroupEditpart.java<|end_file_name|><|fim▁begin|>/**
* Copyright (c) 2011 - 2015, Lunifera GmbH (Gross Enzersdorf), Loetz KG (Heidelberg)
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompa... | /**
* An edit part for optionGroup.
*/
public interface IEnumOptionsGroupEditpart extends IFieldEditpart { |
<|file_name|>expr.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/licen... |
fn trans_field<'blk, 'tcx, F>(bcx: Block<'blk, 'tcx>,
base: &ast::Expr,
get_idx: F) |
<|file_name|>fake_env.rs<|end_file_name|><|fim▁begin|>use compile::ExecutableDevEnv;
use foxbox_taxonomy::api::{ API, Error, User };
use foxbox_taxonomy::manager::*;
use foxbox_taxonomy::services::*;
use foxbox_taxonomy::values::*;
use std::cmp::{ Ord, PartialOrd, Ordering as OrdOrdering };
use std::fmt;
use std::col... | on_event: Box<ExtSender<FakeEnvEvent>>,
back_end: Box<ExtSender<AdapterOp>>,
}
impl fmt::Debug for FakeEnv { |
<|file_name|>IN.py<|end_file_name|><|fim▁begin|># Generated by h2py from /usr/include/netinet/in.h
# Included from sys/feature_tests.h
# Included from sys/isa_defs.h
_CHAR_ALIGNMENT = 1
_SHORT_ALIGNMENT = 2
_INT_ALIGNMENT = 4
_LONG_ALIGNMENT = 8
_LONG_LONG_ALIGNMENT = 8
_DOUBLE_ALIGNMENT = 8
_LONG_DOUBLE_ALIGNMENT = ... | def SIZEOF_PTR(umodel): return \
def STRUCT_SIZE(handle): return (sizeof (*(handle).ptr))
|
<|file_name|>database.go<|end_file_name|><|fim▁begin|>package greatspacerace
import (
"bufio"
"fmt"
"github.com/TSavo/go.firebase"
"os"
)
func init() {
f, err := os.Open("firebase.secret")
if err != nil {
fmt.Printf("error opening firebase.secret: %v\n", err)
}
r := bufio.NewReader(f)
url, e... | line, ln []byte
)
for isPrefix && err == nil {
|
<|file_name|>confirmation.component.spec.ts<|end_file_name|><|fim▁begin|>import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ConfirmationComponent } from './confirmation.component';
describe('ConfirmationComponent', () => {
let component: ConfirmationComponent;
let fixture: Componen... | }); |
<|file_name|>MessageQueueBackend.py<|end_file_name|><|fim▁begin|>"""
Message Queue wrapper
"""
__RCSID__ = "$Id$"
from DIRAC.FrameworkSystem.private.standardLogging.Handler.MessageQueueHandler import MessageQueueHandler
from DIRAC.Resources.LogBackends.AbstractBackend import AbstractBackend
from DIRAC.FrameworkSystem... | """
super(MessageQueueBackend, self).__init__(None, JsonFormatter) |
<|file_name|>empty-concept-id.ts<|end_file_name|><|fim▁begin|>import {EMPTY_CONCEPT_ID} from '../registry';
import {DdfDataSet} from '../../ddf-definitions/ddf-data-set';
import {Issue} from '../issue';
export const rule = {
rule: (ddfDataSet: DdfDataSet) => ddfDataSet
.getConcept()
.getAllData()
.filter... | |
<|file_name|>power-save-blocker.js<|end_file_name|><|fim▁begin|>var powerSaveBlocker;<|fim▁hole|>
module.exports = powerSaveBlocker;<|fim▁end|> |
powerSaveBlocker = process.atomBinding('power_save_blocker').powerSaveBlocker; |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>import os
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.sites.models import Site
from django.core.urlresolvers import reverse
from django.test import TestCase
from mock import patch, Mock
import re
import rdflib
fr... |
text = self.vol.get_fulltext()
# check for arbitrary text content
self.assert_('was late in the autumn, the vines yet kept their leaves,' in text, |
<|file_name|>graticule.test.ts<|end_file_name|><|fim▁begin|>import {GraticuleParams} from '../../../src/data';
import {assembleRootData} from '../../../src/compile/data/assemble';
import {GraticuleNode} from '../../../src/compile/data/graticule';
import {parseUnitModelWithScaleAndLayoutSize} from '../../util';
describ... | precision: 2
} as GraticuleParams;
const graticule = new GraticuleNode(null, params); |
<|file_name|>env.rs<|end_file_name|><|fim▁begin|>// Copyright 2017 Jeremy Wall <jeremy@marzhillstudios.com>
//
// 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... |
impl EnvConverter {
pub fn new() -> Self { |
<|file_name|>MaxTextureSizeTest.cpp<|end_file_name|><|fim▁begin|>//
// Copyright 2015 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
#include "test_utils/ANGLETest.h"
using namespace angle;
class MaxTextureSiz... | |
<|file_name|>item-attributes.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.apach... |
mod test_attr_inner_then_outer { |
<|file_name|>issue-2190-1.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/li... | |
<|file_name|>adder.go<|end_file_name|><|fim▁begin|>package add
import (
"errors"
"fmt"
"io"
"log"
"os"
"path/filepath"
"sort"
"time"
"github.com/fhs/gompd/mpd"
"hawx.me/code/aoide/data"
"hawx.me/code/aoide/song"
)
func New(musicDir string, db *data.Database) *Adder {
conn, err := mpd.Dial("tcp", ":6600")... | if err != nil {
conn = nil
}
|
<|file_name|>list.rs<|end_file_name|><|fim▁begin|>/* Copyright 2016 Jordan Miner
*
* Licensed under the MIT license <LICENSE or
* http://opensource.org/licenses/MIT>. This file may not be copied,
* modified, or distributed except according to those terms.
*/
use super::control_prelude::*;
use attributes::set_attr... | s.parse::<usize>().ok().into_iter().filter(|i| *i != 0).next().map(|i| i - 1)
}
} |
<|file_name|>containerRemove.js<|end_file_name|><|fim▁begin|>containerRemoveSchemas = new SimpleSchema({
force: {
type: Boolean,
optional:true,
label: "Force"
},
link: {
type: Boolean,
optional:true,
label: "Link"
},
v: {
type: Boolean,
optional:true,
label: "Volumes"
}
... | AutoForm.hooks({
containerRemoveForm: {
after: {
'method': formNotifier('rm','containers')} |
<|file_name|>test-expire-tiles.cpp<|end_file_name|><|fim▁begin|>#include "expire-tiles.hpp"
#include "options.hpp"
#include <iterator>
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include <stdlib.h>
#include <stdexcept>
#include <boost/format.hpp>
#include <set>
#define EARTH_CIRCUMFERENCE (40075016.68... | // test.
void test_expire_merge_same() {
options_t opt; |
<|file_name|>random_mac.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python<|fim▁hole|>Inspired by http://www.linux-kvm.com/sites/default/files/macgen.py
"""
from sys import argv
import random
DEFAULT_OUI = '00-16-3e' # Xensource, Inc.
def random_mac(oui=None):
"""returns a random MAC address, with optional... | """
Generate random MAC address |
<|file_name|>quit.go<|end_file_name|><|fim▁begin|>package module
import (
"fmt"
"github.com/davidscholberg/irkbot/lib/configure"
"github.com/davidscholberg/irkbot/lib/message"
)
func helpQuit() []string {
s := "quit - ragequit IRC (requires owner privilege)"
return []string{s}
}
<|fim▁hole|> }
actions.quit()
}<... | func quit(cfg *configure.Config, in *message.InboundMsg, actions *actions) {
if in.Event.Nick != cfg.Admin.Owner {
actions.say(fmt.Sprintf("%s: %s", in.Event.Nick, cfg.Admin.DenyMessage))
return |
<|file_name|>slice-mut-2.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<|fim▁hole|>// <LICENSE-MIT o... | // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license |
<|file_name|>bunyanConfig.test.js<|end_file_name|><|fim▁begin|>var bunyanConfig = require('../index');
var bunyan = require('bunyan');
var path = require('path');
describe('bunyan-config', function () {
it('should not convert things it does not understand', function () {
bunyanConfig({
name: 't... | |
<|file_name|>GardenDropGame.py<|end_file_name|><|fim▁begin|>from panda3d.core import *
from panda3d.direct import *
from toontown.toonbase.ToonBaseGlobal import *
from direct.gui.DirectGui import *
from panda3d.core import *
from panda3d.direct import *
from direct.gui.DirectScrolledList import *
from direct.distribute... | self.closestX = countX
self.closestZ = countZ
currentDist = testDist
|
<|file_name|>gesture_drag.rs<|end_file_name|><|fim▁begin|>// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use EventController;
use Gesture;
use GestureSingle;
#[cfg(any(feature = "v3_14", feature = "dox"))]
use Widget;
use ffi;
us... | |
<|file_name|>cask.rs<|end_file_name|><|fim▁begin|>use std::collections::{BTreeSet, HashMap};
use std::collections::hash_map::{Entry as HashMapEntry, Keys};
use std::default::Default;
use std::path::PathBuf;
use std::result::Result::Ok;
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::{Arc, Mutex, RwLock};
... | |
<|file_name|>align.rs<|end_file_name|><|fim▁begin|>macro_rules! expand_align {
() => {
s! {
#[cfg_attr(any(target_pointer_width = "32",
target_arch = "x86_64",
target_arch = "powerpc64",
target_arch = "mips64",
... | any(target_arch = "mips",
target_arch = "arm",
target_arch = "powerpc")), |
<|file_name|>ibm2.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Natural Language Toolkit: IBM Model 2
#
# Copyright (C) 2001-2013 NLTK Project
# Authors: Chin Yee Lee, Hengfeng Li, Ruxin Hou, Calvin Tanujaya Lim
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
"""
Lexical translation mo... | def prob_all_alignments(self, src_sentence, trg_sentence):
"""
Computes the probability of all possible word alignments,
expressed as a marginal distribution over target words t |
<|file_name|>charm.go<|end_file_name|><|fim▁begin|>package charm
import (
"errors"
"fmt"
"os"
)
// The Charm interface is implemented by any type that
// may be handled as a charm.
type Charm interface {
Meta() *Meta
Config() *Config
Revision() int
}
// Read reads a Charm from path, which can point to either a... | |
<|file_name|>FileParser.java<|end_file_name|><|fim▁begin|>package softuni.io;
import org.springframework.stereotype.Component;<|fim▁hole|>@Component
public class FileParser {
public String readFile(String path) throws IOException {
StringBuilder stringBuilder = new StringBuilder();
try (InputStrea... |
import java.io.*;
|
<|file_name|>calculate_intermediate_sums.py<|end_file_name|><|fim▁begin|>"""
Post processing (subset of columns) to calculate intermediate sum edit counts
and other variables. Date sorted.
Usage:
calculate_intermediate_sums (-h|--help)
calculate_intermediate_sums <input> <output>
... | args = docopt.docopt(__doc__) |
<|file_name|>conn_sp.go<|end_file_name|><|fim▁begin|>package freetds
import (
"errors"
"fmt"
"unsafe"
)
/*
#cgo LDFLAGS: -lsybdb
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <errno.h>
#include <unistd.h>
#include <libgen.h>
#include <sybfront.h>
#include <sybdb... | if spParams, ok := conn.spParamsCache.Get(spName); ok {
return spParams, nil
}
|
<|file_name|>core.py<|end_file_name|><|fim▁begin|># (c) 2012, Jeroen Hoekx <jeroen@hoekx.be>
#
# This file is part of Ansible
#
# Ansible 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... |
class FilterModule(object):
''' Ansible core jinja2 filters ''' |
<|file_name|>components.rs<|end_file_name|><|fim▁begin|>use crate::dist::prefix::InstallPrefix;
use crate::errors::*;
/// The representation of the installed toolchain and its components.
/// `Components` and `DirectoryPackage` are the two sides of the
/// installation / uninstallation process.
use crate::utils::utils;... | |
<|file_name|>config_validation.py<|end_file_name|><|fim▁begin|>"""Helpers for config validation using voluptuous."""
import inspect
import logging
import os
import re
from datetime import (timedelta, datetime as datetime_sys,
time as time_sys, date as date_sys)
from socket import _GLOBAL_DEFAULT_T... | vol.Exclusive('service_template', 'service name'): template,
vol.Optional('data'): dict,
vol.Optional('data_template'): {match_all: template_complex},
vol.Optional(CONF_ENTITY_ID): comp_entity_ids, |
<|file_name|>test_modified_huber_loss_op.py<|end_file_name|><|fim▁begin|># Copyright (c) 2018 PaddlePaddle 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
#
# ... | def modified_huber_loss_forward(val): |
<|file_name|>epochGrapher.py<|end_file_name|><|fim▁begin|>import sys,numpy,matplotlib
import matplotlib.pyplot, scipy.stats
import library
def colorDefiner(epoch):
if epoch == '0':
theColor='blue'
elif epoch == '0.5':
theColor='red'<|fim▁hole|> theColor='green'
elif epoch == '1.5':
... | elif epoch == '1': |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>import os
from setuptools import find_packages
from setuptools import setup
version = '1.0'
install_requires = [<|fim▁hole|>tests_require = install_requires + ['Sphinx', 'docutils',
'virtualenv', 'nose', 'coverage']
here = os.pat... | ]
|
<|file_name|>english.js<|end_file_name|><|fim▁begin|>export default {
navigator: {
doc: 'Docs',
demo: 'Demo',
started: 'Get Started'
},
features: {
userExperience: {
title: 'Optimize Experience',
desc: 'To make scroll more smoothly, We support flexible configurations about inertial s... | indexListImg: 'index-list.jpeg', |
<|file_name|>cast-region-to-uint.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.<|fim▁hole|>// option. This file may not be copied, modified, or distributed
// except accord... | //
// 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 |
<|file_name|>bitcoinunits.cpp<|end_file_name|><|fim▁begin|>#include "bitcoinunits.h"
#include <QStringList>
BitcoinUnits::BitcoinUnits(QObject *parent):
QAbstractListModel(parent),
unitlist(availableUnits())
{
}
QList<BitcoinUnits::Unit> BitcoinUnits::availableUnits()
{
QList<BitcoinUnits::Unit> ... |
QString BitcoinUnits::formatWithUnit(int unit, qint64 amount, bool plussign)
{ |
<|file_name|>readline.js<|end_file_name|><|fim▁begin|>/*
* Exemplo de Readline (Input via console)
*
* @author André Ferreira <andrehrf@gmail.com>
*/<|fim▁hole|> input: process.stdin,
output: process.stdout
});
rl.question('Qual sua idade? ', (idade) => {
console.log('Sua idade é :', idade);
rl.cl... |
const readline = require('readline');
const rl = readline.createInterface({ |
<|file_name|>extendablemessageevent.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 crate::dom::bindings::codegen::Bindings::E... | use crate::dom::event::Event; |
<|file_name|>Main1122.cpp<|end_file_name|><|fim▁begin|>#include <iostream>
#include <cstdio>
using namespace std;
<|fim▁hole|>int main() {
cout<<"\n";
printf('\n');
// your code goes here
return 0;
}<|fim▁end|> | |
<|file_name|>cast_kernels.rs<|end_file_name|><|fim▁begin|>// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under t... | b.iter(|| cast_array(&i32_array, DataType::Int64))
});
c.bench_function("cast float32 to int32 512", |b| { |
<|file_name|>builtintypes.py<|end_file_name|><|fim▁begin|>"""
Flow's list of built-in types available in 0.44.0 (Apr 13, 2017).
Related to
https://flow.org/en/docs/types/
and
http://www.saltycrane.com/blog/2016/06/flow-type-cheat-sheet/
"""
def print_type_format(trigger, content=None, description=None):
... | "readableStreamOptions", description="Flow Node.js type"
), |
<|file_name|>vrepConst.py<|end_file_name|><|fim▁begin|># This file is part of the REMOTE API
#
# Copyright 2006-2016 Coppelia Robotics GmbH. All rights reserved.
# marc@coppeliarobotics.com
# www.coppeliarobotics.com
#
# The REMOTE API is licensed under the terms of GNU GPL:
#
# ----------------------------... |
# drawing objects
|
<|file_name|>ajax.service.ts<|end_file_name|><|fim▁begin|>import { Injectable } from '@angular/core';
import { Http, Response, Headers, RequestOptions } from '@angular/http';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/catch';
import 'rxjs/add/operator/de... | let options = new RequestOptions({ headers: headers }); |
<|file_name|>TestDataFormatterObjCNSError.py<|end_file_name|><|fim▁begin|># encoding: utf-8
"""
Test lldb data formatter subsystem.
"""
from __future__ import print_function
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
<|fim▁hole|>
class... | from ObjCDataFormatterTestCase import ObjCDataFormatterTestCase
|
<|file_name|>io.hpp<|end_file_name|><|fim▁begin|>#ifndef HAVE_spiral_io_hpp
#define HAVE_spiral_io_hpp
#include <cstdio>
#include "spiral/core.hpp"
#include "spiral/string.hpp"
namespace spiral {
struct IoObj {
const ObjTable* otable;
std::FILE* stdio;
bool close_on_drop;
};
auto io_from_val(Bg* bg,... |
extern "C" {
auto spiral_std_io_file_open(Bg* bg, void* sp, uint32_t path) -> uint32_t; |
<|file_name|>conditionalGroupProvider.spec.js<|end_file_name|><|fim▁begin|>/**
* Copyright 2014 Daniel Furtlehner
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.a... | c: 5,
d: 0
};
|
<|file_name|>conf.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# pycasso documentation build configuration file, created by
# sphinx-quickstart on Sun Sep 24 01:54:19 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all poss... | #
# needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be |
<|file_name|>krpc.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 Dmitry "Divius" Tantsur <divius.inside@gmail.com>
//
// 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
... | |
<|file_name|>DataFile.cpp<|end_file_name|><|fim▁begin|>/* DataFile.cpp
Copyright (c) 2014 by Michael Zahniser
Endless Sky 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 yo... | char endQuote = *it; |
<|file_name|>common_type-N3843.cpp<|end_file_name|><|fim▁begin|>// Copyright Louis Dionne 2015
// Distributed under the Boost Software License, Version 1.0.
#include <type_traits>
template <typename T>
using void_t = std::conditional_t<true, void, T>;
// sample(common_type-N3843)
template <typename T, typename U>
... | >{}, "");
|
<|file_name|>Star.js<|end_file_name|><|fim▁begin|>"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
<|fim▁hole|>});
exports.default = void 0;
var React = _interopRequireWildcard(require("react"));
var _createSvgIcon = _interopRequireDefault(require("../../utils/creat... | var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
Object.defineProperty(exports, "__esModule", {
value: true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.