prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>fast_forward_button.js<|end_file_name|><|fim▁begin|>/*! @license
* Shaka Player
* Copyright 2016 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
goog.provide('shaka.ui.FastForwardButton');
goog.require('shaka.ui.Controls');
goog.require('shaka.ui.Element');
goog.require('shaka.ui.Enums');
goog.r... | };
|
<|file_name|>postsynaptictypes.py<|end_file_name|><|fim▁begin|><|fim▁hole|># -*- coding: utf-8 -*-
# ---------------------------------------------------------------------
# Copyright (c) 2012 Michael Hull.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are... | #!/usr/bin/python |
<|file_name|>index.d.ts<|end_file_name|><|fim▁begin|>import {
Bank,
Pattern,
Transaction,
Parser,
} from './src/types';
export const getPatternFromMessage:<|fim▁hole|> (message: string, bankId?: string) => Pattern | void;
export const getTransaction:
(message: string, pattern: Pattern, timezone: string) => ... | |
<|file_name|>login.js<|end_file_name|><|fim▁begin|>(function(){
function isValid($, eventName){
var valid = true;
$.each(function(i, el){
valid = valid && el.dispatchEvent(new Event(eventName));<|fim▁hole|> });
return valid;
}
function setHandler(els){
... | |
<|file_name|>history.rs<|end_file_name|><|fim▁begin|>use std::io::prelude::*;
use std::path::Path;
use curl::http;
use yaml_rust::Yaml;
use super::file;
use super::yaml_util;
use super::request::SpagRequest;
use super::remember;
const HISTORY_DIR: &'static str = ".spag";
const HISTORY_FILE: &'static str = ".spag/his... |
pub fn get(raw_index: &String) -> Result<String, String> { |
<|file_name|>plugin_repo_test.go<|end_file_name|><|fim▁begin|>package pluginrepo_test
import (
"fmt"
"net/http"
"net/http/httptest"
. "github.com/cloudfoundry/cli/cf/actors/pluginrepo"
"github.com/cloudfoundry/cli/cf/models"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "g... | testServer1 *httptest.Server
testServer2 *httptest.Server
)
|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013 - The pycangjie authors
#
# This file is part of pycangjie, the Python bindings to libcangjie.
#
# pycangjie is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# ... | for code in gen_codes():
setattr(cls, "test_%s" % code.replace("*", ""), tester(code))
|
<|file_name|>metadata_definitions.py<|end_file_name|><|fim▁begin|># coding=utf-8
"""InaSAFE Disaster risk tool by Australian Aid - Flood Raster Impact on
Population.
Contact : ole.moller.nielsen@gmail.com
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU... | 'impact': tr('Need evacuation'),
'title': tr('Need evacuation'), |
<|file_name|>horizontal-footer-details.ts<|end_file_name|><|fim▁begin|>import {Component, View} from "angular2/angular2";
@Component({
selector: "horizontal-footer-details"<|fim▁hole|> templateUrl: "./app/components/horizontal-footer-details/horizontal-footer-details.html"
})
export class GdgHorizontalFooterDetails... | })
@View({ |
<|file_name|>sword_verses.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# vim: sw=4:ts=4:sts=4:fdm=indent:fdl=0:
# -*- coding: UTF8 -*-
#
# A sword KJV indexed search module.
# Copyright (C) 2012-2013 Josiah Gordon <josiahg@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it... | verse_list = verse_key.parseVerseList(verse_ref_str, 'Genesis 1:1', True, |
<|file_name|>buildSoftBenchmark.js<|end_file_name|><|fim▁begin|>/**
* node buildHardBenchmark.js ./wiki_benchmark ./soft_benchmark
*
* nohup node buildSoftBenchmark.js ./soft_benchmark > buildSoftBenchmark.out 2>&1&
*/
var fs = require('fs');
var csv = require('csv');
//var outputDir = process.argv[2];
var targe... |
// console.log(surfaceFormMap);
|
<|file_name|>is_vertex_manifold.cpp<|end_file_name|><|fim▁begin|>// This file is part of libigl, a simple c++ geometry processing library.
//
// Copyright (C) 2015 Alec Jacobson <alecjacobson@gmail.com>
//
// This Source Code Form is subject to the terms of the Mozilla Public License
// v. 2.0. If a copy of the MPL ... | {
// Each neighbor
for(const auto & n : c) |
<|file_name|>LogSettings.java<|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.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
*/
package com.microsoft.azure.m... | private RetentionPolicy retentionPolicy;
/**
* Get the category value. |
<|file_name|>pivot_switcher.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
oyPivotSwitcher.py by Erkan Ozgur Yilmaz (c) 2009
v10.5.17
Description :
-------------
A tool for easy animating of switching of pivots
Version History :
-----------------
v10.5.17
- modifications for Maya 2011 and PyMel 1.0.2
v... | future_pivot_pos = pm.xform(self._futurePivot, q=True, ws=True, t=True)
|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from google.oauth2 import service_account
from ..config import config
cred_file = config.get("GoogleCloud", "CredentialPath")
credentials = service_account.Credentials.from_service_account_file(cred_file)
scoped_credentials = credentials.with_scopes([
'https:... | ]) |
<|file_name|>bigip_device_dns.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = ty... | |
<|file_name|>retinanet_model.py<|end_file_name|><|fim▁begin|># Copyright 2019 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.a... | labels['cls_targets'],
labels['num_positives'])
box_loss = self._box_loss_fn(outputs['box_outputs'], |
<|file_name|>event_confirm_registration.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: ... | |
<|file_name|>syslog_plugin.go<|end_file_name|><|fim▁begin|>package command
import (
"os"
"strings"
"github.com/hashicorp/go-plugin"
"github.com/hashicorp/nomad/client/driver"
)
<|fim▁hole|>type SyslogPluginCommand struct {
Meta
}
func (e *SyslogPluginCommand) Help() string {
helpText := `
This is a command u... | |
<|file_name|>UserDirBlock.py<|end_file_name|><|fim▁begin|>import time
from Block import Block
from ..ProtectFlags import ProtectFlags
class UserDirBlock(Block):
def __init__(self, blkdev, blk_num):
Block.__init__(self, blkdev, blk_num, is_type=Block.T_SHORT, is_sub_type=Block.ST_USERDIR)
def set(self, data)... | self._read() |
<|file_name|>CountsTest.java<|end_file_name|><|fim▁begin|>package com.jgrillo.wordcount.api;
import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.dat... | mapBuilder.put(distinctWords.get(i), counts.get(i)); // counts.size() >= distinctWords.size()
}
|
<|file_name|>CoreClientOverOneWaySSLKerb5Test.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... |
public String getSuitableCipherSuite() throws Exception {
return "TLS_KRB5_WITH_3DES_EDE_CBC_SHA";
} |
<|file_name|>SwatchesColor.js<|end_file_name|><|fim▁begin|>import React from 'react';
import reactCSS from 'reactcss';
import { Swatch } from 'react-color/lib/components/common';
export const SwatchesColor = ({
color,
onClick = () => {},
onSwatchHover,
first,
last,
active,
}) => {
const styles = reactCS... | marginBottom: '1px',
},
check: { |
<|file_name|>properties_data_metaball.py<|end_file_name|><|fim▁begin|># ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 2
# of the L... | def unregister():
pass
|
<|file_name|>test_cache.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
import sys
import types
from contextlib import contextmanager
from kombu.utils.encoding import str_to_bytes
from celery import signature
from celery import states
from celery import group
from celery.backends.cache import... |
def test_pylibmc_unicode_key(self):
with reset_modules('celery.backends.cache'):
with self.mock_pylibmc(): |
<|file_name|>IFDSSolver.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
* Copyright (c) 2012 Eric Bodden.
* Copyright (c) 2013 Tata Consultancy Services & Ecole Polytechnique de Montreal
* All rights reserved. This program and the accompanying materi... |
//still line 15.2 of Naeem/Lhotak/Rodriguez
//for each already-queried exit value <eP,d4> reachable from <sP,d3>,
//create new caller-side jump functions to the return sites |
<|file_name|>actual.js<|end_file_name|><|fim▁begin|>let arr = [];<|fim▁hole|>}<|fim▁end|> | for(let i = 0; i < 10; i++) {
for (let i = 0; i < 10; i++) {
arr.push(() => i);
} |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>"""
Setup for the API
"""
import api
log = api.logger.use(__name__)
def index_mongo():<|fim▁hole|> """
Ensure the mongo collections are indexed.
"""
db = api.common.get_conn()
log.debug("Ensuring mongo is indexed.")
db.users.ensure_index("u... | |
<|file_name|>index.tsx<|end_file_name|><|fim▁begin|>import * as Container from '../../util/container'
import * as Constants from '../../constants/profile'
import * as ProfileGen from '../profile-gen'
import * as RPCTypes from '../../constants/types/rpc-gen'
import * as RouteTreeGen from '../route-tree-gen'
import * as ... | openURL(`https://keybase.io/${action.payload.username}`)
return undefined
}
} |
<|file_name|>bench.rs<|end_file_name|><|fim▁begin|>/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This software may be used and distributed according to the terms of the
* GNU General Public License version 2.
*/
use lz4_pyframe::compress;
use lz4_pyframe::decompress;
use minibench::bench;
use minibe... | });
} |
<|file_name|>caching.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
'''
Import this module to have access to a global redis cache named GLOBAL_CACHE.
USAGE:
from caching import GLOBAL_CACHE
GLOBAL_CACHE.store('foo', 'bar')
GLOBAL_CACHE.get('foo')
>> bar
'''
from redis_cache import SimpleCache
... | |
<|file_name|>websocketService.js<|end_file_name|><|fim▁begin|>'use strict';
angular.module('MainConsole')
.factory('WebSocketService',
['$rootScope', '$q', '$filter', '$location',
function ($rootScope, $q, $filter, $location) {
var service = {};
<|fim▁hole|> service.wsConnect = function() {... | |
<|file_name|>manually_destroyed_control.rs<|end_file_name|><|fim▁begin|>/* Copyright 2015 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.
*/
extern crate clear_coat;
extern c... |
#[test]
#[should_panic(expected="attempted to use destroyed control")] |
<|file_name|>context_processors.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from datetime import date
from django.conf import settings
def settings_context(request):
"""
Makes available a template var for some interesting var in settings.py
"""
try:
ITEMS_PER... | try:
TAGS_PER_PAGE = settings.TAGS_PER_PAGE
except AttributeError:
TAGS_PER_PAGE = 200 |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#############################################################
# ubi_reader/ubi_io
# (c) 2013 Jason Pruitt (jrspruitt@gmail.com)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Pub... | else:
chunk_size = self.block_size
buf = self.read(chunk_size) |
<|file_name|>test_file_browser_netcdf4.py<|end_file_name|><|fim▁begin|>from pydons import MatStruct, FileBrowser, LazyDataset
import netCDF4
import numpy as np
import tempfile
import os
DATADIR = os.path.join(os.path.dirname(__file__), 'data')
def test_netcdf4():
d = MatStruct()
data1 = np.random.rand(np.r... | dd = FileBrowser(tmpf.name)
assert 'mygroup' in dd
assert 'var1' in dd.mygroup |
<|file_name|>api.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 {GeneratedFile, ParseSourceSpan, Position} from '@angular/co... | } |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>"""<|fim▁end|> | """
This module contains transformation functions (clip->clip)
One file for one fx. The file's name is the fx's name |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>from urlparse import urljoin
<|fim▁hole|> """
Return a slash or empty string based on tastypie setting
"""
if getattr(settings, 'TASTYPIE_ALLOW_MISSING_SLASH', False):
return ''
return '/'
def urljoin_forced(base, path, **kwargs):
"""
... | from django.conf import settings
def trailing_slash_or_none(): |
<|file_name|>AccessEvent.java<|end_file_name|><|fim▁begin|>/**
* Logback: the reliable, generic, fast and flexible logging framework.
* Copyright (C) 1999-2015, QOS.ch. All rights reserved.
*
* This program and the accompanying materials are dual-licensed under
* either the terms of the Eclipse Public License... | getProtocol();
getRemoteAddr();
getRemoteHost();
getRemoteUser();
|
<|file_name|>AggregateControllerTest.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 t... | import org.junit.Test; |
<|file_name|>test.py<|end_file_name|><|fim▁begin|>from backend import photos, boards
<|fim▁hole|>#print p.new('asdf',1,1)
print p.get(1)
b = boards()
print p.all(1)
print b.get(1)<|fim▁end|> | p = photos() |
<|file_name|>wiggle_to_binned_array.py<|end_file_name|><|fim▁begin|>#!/afs/bx.psu.edu/project/pythons/py2.7-linux-x86_64-ucs4/bin/python2.7
"""
Convert wiggle data to a binned array. This assumes the input data is on a
single chromosome and does no sanity checks!
usage: %prog score_file out_file < wiggle_data
-c,... | else:
scores.to_file( out )
out.close()
|
<|file_name|>custom_tests.rs<|end_file_name|><|fim▁begin|>use crate::generated::{CloudWatch, CloudWatchClient, Dimension, MetricDatum, PutMetricDataInput};
use rusoto_core::param::Params;
use rusoto_core::signature::SignedRequest;
use rusoto_core::signature::SignedRequestPayload;
use rusoto_core::Region;
use rusoto_mo... | value: Some(1.0),
..Default::default()
}];
let request = PutMetricDataInput { |
<|file_name|>testing.go<|end_file_name|><|fim▁begin|>// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package testing provides support for automated testing of Go packages.
// It is intended to be used in c... | c.SkipNow()
} |
<|file_name|>reach_api.py<|end_file_name|><|fim▁begin|>import os
import json
import tempfile
import urllib, urllib2
import requests
from indra.java_vm import autoclass, JavaException<|fim▁hole|>from processor import ReachProcessor
def process_pmc(pmc_id):
xml_str = pmc_client.get_xml(pmc_id)
with tempfile.Nam... | import indra.databases.pmc_client as pmc_client |
<|file_name|>uint1.cpp<|end_file_name|><|fim▁begin|>/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2001-2011 Hartmut Kaiser
Copyright (c) 2011 Bryce Lelbach
Distributed under the Boost Software License, Version 1... | using boost::spirit::qi::_1; |
<|file_name|>gcp_compute_operator.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# 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 licens... | template_fields = ('project_id', 'zone', 'resource_id', 'gcp_conn_id', 'api_version')
@apply_defaults |
<|file_name|>exceptions.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
class ImproperlyConfigured(Exception):<|fim▁hole|>
class TaskHandlingError(Exception):
pass<|fim▁end|> | pass |
<|file_name|>Tuplerator.java<|end_file_name|><|fim▁begin|>/* This file is part of VoltDB.
* Copyright (C) 2008-2015 VoltDB Inc.
*
* This program 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, eith... | * integerColValueByName = it['integerCol']
* stringColValyeByName = it['stringCol'] |
<|file_name|>overlays.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
from functools import total_ordering
from django.contrib.gis.geos import (
LinearRing, LineString, Point, Polygon, fromstr,
)
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
fro... | |
<|file_name|>MockFile.java<|end_file_name|><|fim▁begin|>/**
* Copyright (C) 2010-2015 Gordon Fraser, Andrea Arcuri and EvoSuite
* contributors
*
* This file is part of EvoSuite.
*
* EvoSuite is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser Public License as published... | return file.isReadPermission();
}
|
<|file_name|>sco_bulletins_json.py<|end_file_name|><|fim▁begin|># -*- mode: python -*-
# -*- coding: iso8859-15 -*-
##############################################################################
#
# Gestion scolarite IUT
#
# Copyright (c) 2001 - 2013 Emmanuel Viennet. All rights reserved.
#
# This program is free sof... | docdate = datetime.datetime.now().isoformat()
|
<|file_name|>issue_234.rs<|end_file_name|><|fim▁begin|>use zip::result::ZipError;
const BUF: &[u8] = &[
0, 80, 75, 1, 2, 127, 120, 0, 3, 3, 75, 80, 232, 3, 0, 0, 0, 0, 0, 0, 3, 0, 1, 0, 7, 0, 0, 0,
0, 65, 0, 1, 0, 0, 0, 4, 0, 0, 224, 255, 0, 255, 255, 255, 255, 255, 255, 20, 39, 221, 221,
221, 221, 221, 22... | 221, 221, 37, 221, 221, 221, 221, 221, 129, 4, 0, 0, 221, 221, 80, 75, 1, 2, 127, 120, 0, 4, 0,
0, 2, 127, 120, 0, 79, 75, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, |
<|file_name|>tree_0a5cf070976fd6198437c00ce2cc4fcb.js<|end_file_name|><|fim▁begin|>/**
* @version: $Id: tree.js 904 2011-03-02 20:15:56Z Radek Suski $<|fim▁hole|> * Email: sobi[at]sigsiu.net
* Url: http://www.Sigsiu.NET
* ===================================================
* @copyright Copyright (C) 2006 - 2011 Sig... | * @package: SobiPro Library
* ===================================================
* @author
* Name: Sigrid Suski & Radek Suski, Sigsiu.NET GmbH |
<|file_name|>test_vec_val_vect.py<|end_file_name|><|fim▁begin|>import numpy as np
from numpy.random import randn
from numpy.testing import assert_almost_equal, dec
from dipy.reconst.vec_val_sum import vec_val_vect
def make_vecs_vals(shape):
return randn(*(shape)), randn(*(shape[:-2] + shape[-1:]))
try:
np.... | shape = shape0 + shape1
evecs, evals = make_vecs_vals(shape)
res1 = dumb_sum(evecs, evals) |
<|file_name|>tictactoe.pb.go<|end_file_name|><|fim▁begin|>// Code generated by protoc-gen-go.
// source: tictactoe.proto
// DO NOT EDIT!
/*
Package tictactoe is a generated protocol buffer package.
It is generated from these files:
tictactoe.proto
It has these top-level messages:
CreateRequest
CreateReply
TurnRe... | }
func (m *Event) Reset() { *m = Event{} } |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># This file is part of Boomer Core.
#
# Boomer Core 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) ... | def __init_path(path): |
<|file_name|>component.rs<|end_file_name|><|fim▁begin|>use std::comm::{TryRecvError,Empty,Disconnected};
use std::fmt;
use message::{Message,MessageData};
use message::MessageData::{MsgStart};
#[deriving(PartialEq,Clone)]
pub enum ComponentType {
ManagerComponent,
ExtractorComponent,
AudioDecoderComponent,... | }
impl ComponentStruct {
pub fn new(component_type: ComponentType) -> ComponentStruct { |
<|file_name|>main-menu.controller.spec.js<|end_file_name|><|fim▁begin|>/* jshint -W030 */<|fim▁hole|> // load the controller's module
beforeEach(module('ftiApp.mainMenu'));
var controller;
var menuEntry = {name: 'test', state: 'test.main'};
var mainMenuMock = {
getMenu: function () {
return [menuEntry]
}
}... | 'use strict';
describe('Controller: MainMenuController', function () {
|
<|file_name|>iter2.rs<|end_file_name|><|fim▁begin|>// iter2.rs
fn main() {
let arr = [10, 20, 30];
for i in arr {
println!("{}", i);
}<|fim▁hole|><|fim▁end|> | }
// this doensn't work, try to compile it! |
<|file_name|>xbee.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""XBeeModem.py bypasses the XBee's 802.15.4 capabilities and simply uses it modem for communications
You don't have to master 802.15.4 and a large set of XBee commands
to make a very simple but potentially useful network. At its core,
the XB... | Jeff Irland (jeff.irland@gmail.com) in March 2013
"""
# imported modules |
<|file_name|>specular_reflection.rs<|end_file_name|><|fim▁begin|>//! Defines a BRDF that describes specular reflection
use std::f32;
use enum_set::EnumSet;
use linalg::Vector;
use film::Colorf;
use bxdf::{self, BxDF, BxDFType};
use bxdf::fresnel::Fresnel;
/// Specular reflection BRDF that implements a specularly ref... | SpecularReflection { reflectance: *c, fresnel: fresnel } |
<|file_name|>plugin.py<|end_file_name|><|fim▁begin|>from Plugins.Plugin import PluginDescriptor
from Screens.Console import Console
from Screens.ChoiceBox import ChoiceBox
from Screens.MessageBox import MessageBox
from Screens.Screen import Screen
from Screens.Standby import TryQuitMainloop
from Screens.Ipkg import Ipk... | self.ipkg.addCallback(self.ipkgCallback)
self.onShown.append(self.setWindowTitle) |
<|file_name|>lib.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/. */
//! This module provides rust bindings for the XPCOM string types... | }
impl<'a> cmp::PartialEq<str> for $String<'a> { |
<|file_name|>ex1.py<|end_file_name|><|fim▁begin|>import pandas as pd
<|fim▁hole|>print(tv_budget_x)<|fim▁end|> | adv = pd.read_csv('Advertising.csv')
tv_budget_x = adv.TV.tolist()
|
<|file_name|>cone.rs<|end_file_name|><|fim▁begin|>extern crate ncollide;
use ncollide::shape::Cone;
fn main() {
let cone = Cone::new(0.5f32, 0.75);
assert!(cone.half_height() == 0.5);
assert!(cone.radius() == 0.75);<|fim▁hole|><|fim▁end|> | } |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from .split import Split
from .tree import Tree
from .node import Node
from .column import NominalColumn, OrdinalColumn, ContinuousColumn
from .stats import Stats
from .invalid_split_reason import InvalidSplitReason
<|fim▁hole|><|fim▁end|> | __version__ = "5.3.0" |
<|file_name|>func_use_for_or_listcomp_var.py<|end_file_name|><|fim▁begin|>"""test a warning is triggered when using for a lists comprehension variable"""
__revision__ = 'yo'
TEST_LC = [C for C in __revision__ if C.isalpha()]
print C # WARN
C = 4
print C # this one shouldn't trigger any warning
B = [B for B in __rev... | for var1, var2 in TEST_LC: |
<|file_name|>gcp.py<|end_file_name|><|fim▁begin|>########
# Copyright (c) 2014-2020 Cloudify Platform Ltd. 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:... |
@property
def discovery(self):
""" |
<|file_name|>init.js<|end_file_name|><|fim▁begin|>/* **************************************************************
#Inicia as funções e plugins
* ***************************************************************/
(function() {
// Ativa o menu mobile
app.menu();
// Ativa o slideshow, se presente na página.
va... | if(el[x].classList.contains("is-active")) {
el[x].classList.remove("is-active");
} |
<|file_name|>sequences.py<|end_file_name|><|fim▁begin|># sequences.py
# strings
>>> # 4 ways to make a string
>>> str1 = 'This is a string. We built it with single quotes.'
>>> str2 = "This is also a string, but built with double quotes."
>>> str3 = '''This is built using triple quotes,
... so it can span multiple li... | >>> encoded_s = s.encode('utf-8') # utf-8 encoded version of s
>>> encoded_s
b'This is \xc3\xbc\xc5\x8b\xc3\xadc0de' # result: bytes object
>>> type(encoded_s) # another way to verify it |
<|file_name|>KeyEdit.cpp<|end_file_name|><|fim▁begin|>/**************************************************************************
Copyright [2009] [CrypTool Team]
This file is part of CrypTool.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with... | |
<|file_name|>viz.js<|end_file_name|><|fim▁begin|>'use strict';
var _ = require('lodash');
var utils = require('../utils');
var d3 = require('d3');
var sunCalc = require('suncalc');
var geocoder = require('geocoder');
var Path = require('svg-path-generator');
var margin = {
top: 20,
right: 0,
bottom: 20,
... | |
<|file_name|>parser.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/lic... | } else {
after.push(subpat); |
<|file_name|>parse.test.js<|end_file_name|><|fim▁begin|>var fs = require('co-fs')
, test = require('bandage')
, main = require('..')
, parse = main.parse
, write = main.write
, parseFmtpConfig = main.parseFmtpConfig
, parseParams = main.parseParams
, parseImageAttributes = main.parseImageAttributes
, pa... | |
<|file_name|>dataset.py<|end_file_name|><|fim▁begin|>import string, copy
def joinHeaders(first, second, joined, on):
joined.headers = first.headers[:]
mappedHeaders = {}
for header in second.headers:
if header == on:
continue
i = 0
newHeader = header
while newHeader in first.headers:
newHeader = '{0}_... | return None
# create new dataset
joined = Dataset() |
<|file_name|>order-page.component.spec.ts<|end_file_name|><|fim▁begin|>import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { DebugElement, NO_ERRORS_SCHEMA } from '@angular/core';
import { NgbModule, NgbModal, ModalDismissReasons } from '@ng-bootstrap/ng-bootstrap';
import { OrderPageComp... | describe('OrderPageComponent', () => {
let component: OrderPageComponent;
let fixture: ComponentFixture<OrderPageComponent>; |
<|file_name|>create.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015 The Johns Hopkins University/Applied Physics Laboratory
# 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 Li... | |
<|file_name|>configparser.py<|end_file_name|><|fim▁begin|><<<<<<< HEAD
<<<<<<< HEAD
"""Configuration file parser.
A configuration file consists of sections, lead by a "[section]" header,
and followed by "name: value" entries, with continuations and such in
the style of RFC 822.
Intrinsic defaults can be specified by ... |
def optionxform(self, optionstr):
return optionstr.lower()
|
<|file_name|>iam-object-store.go<|end_file_name|><|fim▁begin|>// Copyright (c) 2015-2021 MinIO, Inc.
//
// This file is part of MinIO Object Storage stack
//
// This program 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... |
func (iamOS *IAMObjectStore) deleteGroupInfo(ctx context.Context, name string) error { |
<|file_name|>analysis.py<|end_file_name|><|fim▁begin|># -*- mode: python; coding: utf-8 -*-
# Copyright 2016-2017 Peter Williams <peter@newton.cx> and collaborators
# Licensed under the MIT License
"""Various helpers for X-ray analysis that rely on CIAO tools.
"""
from __future__ import absolute_import, division, pri... | |
<|file_name|>connections.js<|end_file_name|><|fim▁begin|>'use strict';
/**<|fim▁hole|> * @name networkAnalyzerApp.controller:ConnectionsCtrl
* @description
* # ConnectionsCtrl
* Controller of the networkAnalyzerApp
*/
angular.module('networkAnalyzerApp')
.controller('ConnectionsCtrl', function ($scope) {
$sc... | * @ngdoc function |
<|file_name|>WalletName.py<|end_file_name|><|fim▁begin|>__author__ = 'frank'
import json
from BaseObject import BaseObject
from Requestor import process_request
class WalletName(BaseObject):
"""
Wallet Name object
:param domain_name: Domain name that Wallet Name should be associated with.
:param na... | WalletName object to commit changes to the API.
"""
|
<|file_name|>ProfileSkillsModule.js<|end_file_name|><|fim▁begin|>import React, { Component, PropTypes } from 'react'
import { updateCurrentUser, notify } from '../actions'
import ListItemTagInput from './ListItemTagInput'
export default class ProfileSkillsModule extends Component {
static propTypes = {
person: P... |
update = (type, tags) => { |
<|file_name|>test_subscriptions.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/.
#
# Copyright (c) 2015 Digi International Inc. All Rights... | 'uri': 'vehicle/data/VehicleSpeed',
})
def test_delete(self): |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>export { AbilityScoresViewModel } from './ability_scores';
export { ActionsToolbarViewModel } from './actions_toolbar';
export { ArmorViewModel } from './armor';
export { CharacterNameViewModel } from './character_name';
export { CharacterPortraitModel } from './charac... | export { MagicItemsViewModel } from './magic_items';
export { ProficienciesViewModel } from './proficiencies'; |
<|file_name|>TransportStopAction.java<|end_file_name|><|fim▁begin|>/*
* Created on 17-dic-2005
*
* TODO To change the template for this generated file go to Window -
* Preferences - Java - Code Style - Code Templates
*/
package org.herac.tuxguitar.gui.actions.transport;
<|fim▁hole|>import org.eclipse.swt.events.T... | |
<|file_name|>memes_zaebali.py<|end_file_name|><|fim▁begin|># coding: utf-8
__author__ = "@strizhechenko"
import sys
from morpher import Morpher
from twitterbot_utils import Twibot
from apscheduler.schedulers.blocking import BlockingScheduler
sched = BlockingScheduler()
bot = Twibot()
morphy = Morpher()
def tweets2... | |
<|file_name|>mm.lang.js<|end_file_name|><|fim▁begin|>// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Ap... | if (MM.plugins[plugin].settings.lang.component != 'core') {
return MM.lang.s('plugin' + plugin + 'name', plugin);
} |
<|file_name|>panel.py<|end_file_name|><|fim▁begin|>from django.utils.translation import ugettext_lazy as _
import horizon
from horizon.test.test_dashboards.dogs import dashboard
class Puppies(horizon.Panel):
name = _("Puppies")
slug = "puppies"<|fim▁hole|><|fim▁end|> |
dashboard.Dogs.register(Puppies) |
<|file_name|>spoof.py<|end_file_name|><|fim▁begin|>import sqlite3
import logging
from time import sleep
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
from scapy.all import *
import sweetSecurityDB
dbPath="/opt/sweetsecurity/client/SweetSecurity.db"
def convertMAC(mac):
newMac="%s%s:%s%s:%s%s:%s%s:%s%s:%... | conn = sqlite3.connect(dbPath) |
<|file_name|>issue-10291.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/lic... |
fn main() {} |
<|file_name|>webrender_helpers.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/. */
// TODO(gw): This contains helper traits and implem... | builder.define_scroll_frame_with_parent(
node.id,
parent_id,
node.content_rect.to_rectf(), |
<|file_name|>websocket.py<|end_file_name|><|fim▁begin|>import os
import socket
import struct
from OpenSSL import SSL
from mitmproxy import exceptions
from mitmproxy import flow
from mitmproxy.proxy.protocol import base
from mitmproxy.net import tcp
from mitmproxy.net import websockets
from mitmproxy.websocket import W... |
def _handle_ping_pong(self, frame, source_conn, other_conn, is_server):
# just forward the ping/pong to the other side
other_conn.send(bytes(frame)) |
<|file_name|>concurrent_hash_map.rs<|end_file_name|><|fim▁begin|>use std::ptr;
use std::marker::Copy;
use std::clone::Clone;
use std::ops::Deref;
use std::ops::DerefMut;
use std::sync::{RwLock, RwLockWriteGuard};
use std::sync::atomic::{AtomicUsize, Ordering};
use std::fmt::{Debug, Formatter, Result};
use super::s... | else {
let mut new_bucket = Link::new(Bucket::new(key, val)); |
<|file_name|>Add Binary-optimized.cpp<|end_file_name|><|fim▁begin|>class Solution {
public:
string addBinary(string a, string b) {
string sum = "";
int carry = 0;
for (int i = a.size() - 1, j = b.size() - 1; i >= 0 || j >= 0; i--, j--) {
in... | }
}; |
<|file_name|>bitcoin_ja.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="ja" version="2.0">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About BulbaCoin</source>
... | <message>
<location line="-11"/>
<source>&New Address</source> |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>var config = require('../lib/config')();
var Changeset = require('./Changeset');
var queries = require('./queries');
var helpers = require('../helpers');
require('../validators');
var validate = require('validate.js');
var errors = require('../errors');
var pgPromise =... |
var changesetsArray = searchResult.rows.map(function (row) { |
<|file_name|>Twitter.js<|end_file_name|><|fim▁begin|><|fim▁hole|>// components
import Loading from '../../components/loading/Loading';
// styles
var style = require('./_index.scss');
// data
var Timeline = require('react-twitter-widgets').Timeline;
var Twitter = React.createClass({
getInitialState: function(){
... | // core
import React from 'react';
import PropTypes from 'react';
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.