prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>// Powerlink Analyzer - Analyze Ethernet POWERLINK Network Traffic
// Copyright (C) 2016, Thomas Keh
//
// 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 F... | print!("{}", opts.usage(&brief)); |
<|file_name|>runabalib.py<|end_file_name|><|fim▁begin|># coding: utf-8
# Distributed under the terms of the MIT License.
import ababe
import sys, ast
import click
import yaml
from ababe.cmdline.apps import *
def run():
try:<|fim▁hole|> except KeyboardInterrupt:
pass
except EOFError:
pass
@c... | ababe.cmdline.runabalib.exec_from_cmdline() |
<|file_name|>game-list.js<|end_file_name|><|fim▁begin|>var React = require('react');
var Firebase = require('firebase');
var Game = require('../../game.js');
var FirebaseIntegration = require('../../firebase-integration');
var GameContainer = require('../game-container/game-container');
//var gameListRef = new Firebas... | |
<|file_name|>stack.py<|end_file_name|><|fim▁begin|>"""Basic quilt-like functionality
"""
__copyright__ = """
Copyright (C) 2005, Catalin Marinas <catalin.marinas@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 as
published ... | |
<|file_name|>shape.py<|end_file_name|><|fim▁begin|># Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.... | if context is None:
self._context = { |
<|file_name|>Measure.js<|end_file_name|><|fim▁begin|>Clazz.declarePackage ("JU");
Clazz.load (["JU.V3"], "JU.Measure", ["java.lang.Float", "javajs.api.Interface", "JU.Lst", "$.P3", "$.P4", "$.Quat"], function () {
c$ = Clazz.declareType (JU, "Measure");
c$.computeAngle = Clazz.defineMethod (c$, "computeAngle",
fun... | }, "JU.P3,JU.P4,JU.P3");
c$.distanceToPlaneD = Clazz.defineMethod (c$, "distanceToPlaneD",
function (plane, d, pt) {
return (plane == null ? NaN : (plane.dot (pt) + plane.w) / d);
|
<|file_name|>api.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# coding=utf8
#
"""
Python SDK for Weibo
Simple wrapper for weibo oauth2
author: seraphwlq@gmail.com
"""
import time
from utils.http import request
from utils.http import SDataDict
from utils.http import encode_params
from utils.const import WE... | return access token as object:
{"access_token":"your-access-token","expires_in":12345678}
expires_in is standard unix-epoch-time |
<|file_name|>instances_post.go<|end_file_name|><|fim▁begin|>package main
import (
"crypto/x509"
"encoding/json"
"encoding/pem"
"errors"
"fmt"
"io"
"io/ioutil"
"net/http"
"os"
"strings"
"github.com/dustinkirkland/golang-petname"
"github.com/gorilla/websocket"
log "gopkg.in/inconshreveable/log15.v2"
"git... |
for _, entry := range allowedGroups {
if group == entry { |
<|file_name|>enter_try.rs<|end_file_name|><|fim▁begin|>// https://rustbyexample.com/error/multiple_error_types/enter_try.html
// http://rust-lang-ja.org/rust-by-example/error/option_with_result/enter_try.html<|fim▁hole|>
// Use `String` as our error type
type Result<T> = std::result::Result<T, String>;
fn double_first... | |
<|file_name|>distributions.py<|end_file_name|><|fim▁begin|># coding=utf-8
# Copyright 2022 The ML Fairness Gym Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apac... | @attr.s
class Bernoulli(Distribution): |
<|file_name|>global_messages.py<|end_file_name|><|fim▁begin|># Copyright (c) 2016-2017 The OrarioTreniBot Authors (see AUTHORS)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restr... | .format(value=bar.value, max_value=bar.max_value, percentage=round(bar.percentage, 1))
)
time.sleep(0.1)
|
<|file_name|>ImageTools.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
# Copyright
Copyright (C) 2012 by Victor
victor@caern.de
# License
This file is part of SoulCreator.
SoulCreator is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as publis... | You should have received a copy of the GNU General Public License along with
SoulCreator. If not, see <http://www.gnu.org/licenses/>.
"""
|
<|file_name|>fcn_32s.py<|end_file_name|><|fim▁begin|>from nets import vgg
import tensorflow as tf
from preprocessing import vgg_preprocessing
from ..utils.upsampling import bilinear_upsample_weights
slim = tf.contrib.slim
# Mean values for VGG-16
from preprocessing.vgg_preprocessing import _R_MEAN, _G_MEAN, _B_MEAN
... |
upsample_factor = 32
# Convert image to float32 before subtracting the |
<|file_name|>label-piece.component.ts<|end_file_name|><|fim▁begin|>// Copyright (c) 2017 VMware, Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://... | labelColor: {[key: string]: string};
|
<|file_name|>SignaturesModel.ts<|end_file_name|><|fim▁begin|>import { BelongsTo, Column, DataType, ForeignKey, IBuildOptions, Model, PrimaryKey, Table } from 'sequelize-typescript';
import { TransactionType } from '../helpers';<|fim▁hole|>import { FilteredModelAttributes } from 'sequelize-typescript/lib/models/Model';
... | import { TransactionsModel } from './TransactionsModel'; |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>
macro_rules! regex {
($e:expr) => (::regex::Regex::new($e).unwrap())
}
pub mod core;
pub mod env;
pub mod printer;
pub mod reader;
pub mod readline;
pub mod types;<|fim▁end|> | extern crate libc;
extern crate regex;
extern crate time;
extern crate num; |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
# $Id: setup.py,v 1.2 2002/01/08 07:13:21 jgg Exp $
from distutils.core import setup, Extension
from distutils.sysconfig import parse_makefile
from DistUtilsExtra.command import *
import glob, os, string
# The apt_pkg module
files = map(lambda ... | source = open(template, "r")
build = open(os.path.join("build", template[:-3]), "w")
lines = source.readlines() |
<|file_name|>message_media_downloadable_image.py<|end_file_name|><|fim▁begin|>from .message_media_downloadable import DownloadableMediaMessageProtocolEntity
from yowsup.layers.protocol_messages.protocolentities.attributes.attributes_image import ImageAttributes
from yowsup.layers.protocol_messages.protocolentities.attr... | ) |
<|file_name|>types.go<|end_file_name|><|fim▁begin|>package VNC
type PixelFormat struct {
BitsPerPixel uint8
Depth uint8
BigEndian uint8
TrueColor uint8
RedMax uint16
GreenMax uint16
BlueMax uint16
<|fim▁hole|> P1, P2, P3 uint8 // padding bytes
}
var (
PixelFormatRGBA... | RedShift uint8
GreenShift uint8
BlueShift uint8
|
<|file_name|>derive_order.rs<|end_file_name|><|fim▁begin|>extern crate clap;
extern crate regex;
use std::str;
use clap::{App, Arg, SubCommand, AppSettings};
include!("../clap-test.rs");
static NO_DERIVE_ORDER: &'static str = "test 1.2
USAGE:
test [FLAGS] [OPTIONS]
FLAGS:
--flag_a second flag
... | -h, --help Prints help information |
<|file_name|>test_brick_linuxscsi.py<|end_file_name|><|fim▁begin|># vim: tabstop=4 shiftwidth=4 softtabstop=4
# (c) Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You m... | expected_commands = [('multipath -F')]
self.assertEqual(expected_commands, self.cmds)
|
<|file_name|>simpleForm.js<|end_file_name|><|fim▁begin|>'use strict';
const { BasePage } = require('kakunin');
class SimpleForm extends BasePage {
constructor() {
super();
this.url = '/form/simple';
this.form = $('form');
this.nameInput = this.form.$('input[name="name"]');<|fim▁hole|>
this.sub... | this.descriptionTextarea = this.form.$('textarea[name="description"]');
this.optionCheckboxes = this.form.$$('input[type="checkbox"]');
this.optionRadios = this.form.$$('input[type="radio"]');
this.statusSelect = this.form.$('select[name="status"]'); |
<|file_name|>tvcache.py<|end_file_name|><|fim▁begin|># Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the F... | if not showObj: |
<|file_name|>dwarftools.py<|end_file_name|><|fim▁begin|>from elftools.dwarf.ranges import RangeEntry, BaseAddressEntry
from elftools.dwarf import constants
def get_die_offset_by_reference(referer_die, attrname, use_abstract_origin=True):
'''Return the offset of the DIE referred by the given attribute in the referr... | |
<|file_name|>forms.py<|end_file_name|><|fim▁begin|>from django import forms<|fim▁hole|>
class DoorPrizeWinnerForm(forms.ModelForm):
class Meta:
model = DoorPrizeWinner
fields = ['fan', 'event']<|fim▁end|> |
from games.models import DoorPrizeWinner |
<|file_name|>queuemodel.cpp<|end_file_name|><|fim▁begin|>/*
* Unplayer
* Copyright (C) 2015-2019 Alexey Rochev <equeim@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either v... | }
}
int QueueModel::rowCount(const QModelIndex&) const |
<|file_name|>dupelink.go<|end_file_name|><|fim▁begin|>package dupelink
import (
"net/url"
"strconv"
"time"
"log"
"github.com/tucnak/telebot"
"github.com/asdine/storm"
"github.com/focusshifter/muxgoob/registry"
)
type DupeLinkPlugin struct {
}
type DupeLink struct {
ID int `storm:"id,increment"`
URL string... |
newLink := DupeLink{URL: currentURL,
MessageID: message.ID,
Sender: *message.Sender, |
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|>"""
WSGI config for horario project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/
"""
import os<|fim▁hole|>
application = get_wsgi_a... |
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "asignacion_horario.settings") |
<|file_name|>angular-gantt-resizeSensor-plugin.js<|end_file_name|><|fim▁begin|>/*
Project: angular-gantt v1.3.2 - Gantt chart component for AngularJS
Authors: Marco Schweighauser, Rémi Alvergnat
License: MIT
Homepage: https://www.angular-gantt.com
Github: https://github.com/angular-gantt/angular-gantt.git
*/
(function(... | |
<|file_name|>util.js<|end_file_name|><|fim▁begin|>"use strict";
var _ = require('lodash');
_.mixin({
pickObjectParams: function (data, params) {
params = Array.prototype.slice.call(arguments, 1);
return _.map(data, function (item) {
return _.pick.apply(_, [item].concat(params));
... | } |
<|file_name|>19180cf98af6_nsx_gw_devices.py<|end_file_name|><|fim▁begin|># Copyright 2014 OpenStack Foundation
#<|fim▁hole|># http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASI... | # 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
# |
<|file_name|>WfActivityDao.java<|end_file_name|><|fim▁begin|>package com.zswxsqxt.wf.dao;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Repository;
import cn.org.rapid_framework.page.Page;
import com.opendata.common.base.BaseHiber... | hql.append(" and ett.description=?");
param.add(query.getDescription());
}
if(!StringUtils.isEmpty(query.getUrl())) |
<|file_name|>home.js<|end_file_name|><|fim▁begin|>/* global fetch */
import React from 'react';
import { render } from 'react-dom';
import { Link } from 'react-router';
function Home() {
return (
<div className="container">
<h2>Who are you?</h2><|fim▁hole|> <Link to="/caseHandler">... | |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>'use strict'
// Load requirements
const slack = require('slack')
const path = require('path')
// Load utilities
const i18n = require('../locale')
const logger = require('../log')
// Data directory
const dataDir = path.join(__dirname, '../../../data/')
// User track... | |
<|file_name|>opcode.rs<|end_file_name|><|fim▁begin|>//! Ethereum opcodes
#[derive(Copy, Clone, Eq, PartialEq, Debug)]
/// Opcode enum. One-to-one corresponding to an `u8` value.
pub enum Opcode {
STOP, ADD, MUL, SUB, DIV, SDIV, MOD, SMOD, ADDMOD, MULMOD, EXP,
SIGNEXTEND,
LT, GT, SLT, SGT, EQ, ISZERO, AND,... | Opcode::STOP => 0x00,
Opcode::ADD => 0x01, |
<|file_name|>read-exif-exifread.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# python-gphoto2 - Python interface to libgphoto2
# http://github.com/jim-easterbrook/python-gphoto2
# Copyright (C) 2015-19 Jim Easterbrook jim@jim-easterbrook.me.uk
#
# This program is free software: you can redistribute it and/o... | |
<|file_name|>test_torchserve.py<|end_file_name|><|fim▁begin|># Copyright 2019 kubeflow.org.
#
# 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
#... | KFServing.delete(service_name, KFSERVING_TEST_NAMESPACE) |
<|file_name|>settings.py<|end_file_name|><|fim▁begin|># Django settings for apmanager project.
import os
from django.utils.translation import ugettext_lazy as _
DEBUG = True
USE_DAEMON = True
if os.environ.get("USE_DEV_PATHS", None):
DEV_PATHS = True
else:
DEV_PATHS = False
TEMPLATE_DEBUG = DEBUG
ADMINS = (
... | else:
UPLOAD_ROOT = '/var/lib/apmanager/uploads/'
|
<|file_name|>decorators.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
__all__ = ['quantity_input']
import inspect
from astropy.utils.decorators import wraps
from astropy.utils.misc import isiterable
from .core import Unit, UnitBase, UnitsError... | |
<|file_name|>app.e2e-spec.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>
describe('demo1 App', () => {
let page: Demo1Page;
beforeEach(() => {
page = new Demo1Page();
});
it('should display welcome message', () => {
page.navigateTo();
expect(page.getParagraphText()).toEqual('Welcome to app!!');
})... | import { Demo1Page } from './app.po'; |
<|file_name|>files_4.js<|end_file_name|><|fim▁begin|>var searchData=
[
['lcd_2ec',['lcd.c',['../lcd_8c.html',1,'']]],
['lcd_2eh',['lcd.h',['../lcd_8h.html',1,'']]],
['light_2ec',['light.c',['../light_8c.html',1,'']]],
['light_2eh',['light.h',['../light_8h.html',1,'']]]<|fim▁hole|><|fim▁end|> | ]; |
<|file_name|>src.py<|end_file_name|><|fim▁begin|>from itertools import permutations
import re
def create_formula(combination,numbers):
formula = ""
index = 0
for op in combination:
formula += str(numbers[index]) + op
index += 1
formula += numbers[index]
return formula
'''
Unnece... | listFinal = [] |
<|file_name|>specs.js<|end_file_name|><|fim▁begin|>Test.expect(reverseWords('The quick brown fox jumps over the lazy dog.') === 'ehT kciuq nworb xof spmuj revo eht yzal .god');
Test.expect(reverseWords('apple') === 'elppa');
Test.expect(reverseWords('a b c d') === 'a b c d');<|fim▁hole|><|fim▁end|> | Test.expect(reverseWords('double spaced words') === 'elbuod decaps sdrow'); |
<|file_name|>solve.py<|end_file_name|><|fim▁begin|>import caffe
import surgery, score
import numpy as np
import os
import setproctitle
setproctitle.setproctitle(os.path.basename(os.getcwd()))
weights = '../ilsvrc-nets/vgg16-fcn.caffemodel'
# init
caffe.set_device(int(sys.argv[1]))
caffe.set_mode_gpu()
solver = caf... |
for _ in range(50): |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.views.generic import TemplateView
# All todos view
class Home( TemplateView ):
<|fim▁hole|> # Set the view template
template_name = 'index.html'<|fim▁end|> | |
<|file_name|>gulpfile.js<|end_file_name|><|fim▁begin|>const elixir = require('laravel-elixir');
require('laravel-elixir-vue-2');
var jsuglify = require('gulp-uglify');
var rename = require('gulp-rename');
var node_path = 'node_modules';
var paths = {
'jquery': node_path + '/jquery',
'bootstrap': node_path +... |
.copy('resources/assets/fonts', 'public/fonts')
.copy('resources/assets/js/admin', 'public/js/admin') |
<|file_name|>bio_tune_menu.cpp<|end_file_name|><|fim▁begin|>/*********************
* bio_tune_menu.cpp *
*********************/
/****************************************************************************
* Written By Mark Pelletier 2017 - Aleph Objects, Inc. *
* Written By Marcio Teixeira 2... | case 6: SpinnerDialogBox::enqueueAndWait_P(F("G0 E0 F120")); break;
case 7: StatusScreen::unlockMotors(); break;
default:
return false; |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | from .fields import CharArrayField, TextArrayField, IntegerArrayField |
<|file_name|>addtwonumbers.rs<|end_file_name|><|fim▁begin|>use std::io::{self, BufRead};
fn main() {
for line in io::stdin().lock().lines().map(|l| l.unwrap()) {
let nums: Vec<i64> = line.split_whitespace()
.map(|num| num.parse().unwrap())
.collect();
let n1 = n... | println!("{}", n1 + n2) |
<|file_name|>tests.rs<|end_file_name|><|fim▁begin|>use crate::nailgun::{CommandRunner, ARGS_TO_START_NAILGUN, NAILGUN_MAIN_CLASS};
use crate::{PlatformConstraint, Process, ProcessMetadata};
use futures::compat::Future01CompatExt;
use hashing::EMPTY_DIGEST;
use std::fs::read_link;
use std::os::unix::fs::symlink;
use std... | let original_mock_jdk_dir = unique_temp_dir(std::env::temp_dir(), None);
let original_mock_jdk_path = original_mock_jdk_dir.path().to_owned();
let requested_mock_jdk_dir = unique_temp_dir(std::env::temp_dir(), None);
let requested_mock_jdk_path = requested_mock_jdk_dir.path().to_owned(); |
<|file_name|>err_2021_001_logging_perm.py<|end_file_name|><|fim▁begin|># Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICE... | |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import Game from '../models/game'
<|fim▁hole|> constructor() {
const game = new Game({
onTick: () => {
this.ui.game.update()
}
})
const { snake, map } = game
this.snake = snake
this.map = map
this.game = game
game.start(... |
class Store { |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|># blender CAM utils.py (c) 2012 Vilem Novak
#
# ***** 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 ... | # set correct path location
path.location = ori.location
path.rotation_euler = ori.rotation_euler |
<|file_name|>TestLoadUsingPaths.py<|end_file_name|><|fim▁begin|>"""
Test that SBProcess.LoadImageUsingPaths works correctly.
"""
from __future__ import print_function
import os
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
@skipIfWind... |
self.assertNotEqual(token, lldb.LLDB_INVALID_IMAGE_TOKEN, "Got a valid token with included empty path")
self.assertEqual(out_spec, lldb.SBFileSpec(self.hidden_lib), "Found the expected library with included empty path") |
<|file_name|>hls.js<|end_file_name|><|fim▁begin|>typeof window !== "undefined" &&
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define([], factory);
else if(... | * @param {Uint8Array} data - The data to search in |
<|file_name|>qt.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2014 Thomas Voegtlin
#
# 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 S... | if not xprv:
return
try:
k = bitcoin.deserialize_xkey(xprv)[-1].encode('hex') |
<|file_name|>array.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<|fim▁hole|>#[test]
fn eq() {
test!([0] == [0]);
test!([0, 1] == [0, 1]);
test!([0, 1, 2] == [0, 1, 2]);
test!([... | // file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
<|file_name|>core_parallel_multifile_actions_1.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# Copyright 2007 Rene Rivera.
# Copyright 2011 Steven Watanabe
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
# Added to gu... | echo 003
}
|
<|file_name|>SideWall.java<|end_file_name|><|fim▁begin|><|fim▁hole|>package com.aspose.cells.model;
public class SideWall {
private Link link = null;
public Link getLink() {
return link;
}
public void setLink(Link link) {
this.link = link;
}
}<|fim▁end|> | |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>pub struct Luhn {
result: Option<String>,
}
#[inline]
fn is_valid(id: &str) -> bool {
let mut index: u32 = 0;
let mut sum: u32 = 0;
for c in id.chars().rev() {
if c.is_whitespace() {
continue;
}
let mut v = match c.t... | } |
<|file_name|>test_fake_quantize_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
#
# ht... | out_accum = np.zeros(1).astype("float32")
out_state = np.zeros(1).astype("float32")
out_scale = np.zeros(1).astype("float32")
out_accum[0] = self.attrs['moving_rate'] * accum[0] + np.max( |
<|file_name|>GruntFile.js<|end_file_name|><|fim▁begin|>module.exports = function (grunt) {
// Define the configuration for all the tasks
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
// Configure a mochaTest task
mochaTest: {
test: {
options: ... | grunt.loadNpmTasks('grunt-mocha-test'); |
<|file_name|>production.js<|end_file_name|><|fim▁begin|>const path = require('path');
module.exports = {
HOST: 'localhost',
PORT: 3000,
URL: {
ROOT: 'https://bootflex.herokuapp.com',
API: 'https://bootflex.herokuapp.com/api'
},<|fim▁hole|> }
};<|fim▁end|> | PATH: {
ROOT: path.join(__dirname, '..') |
<|file_name|>extra.py<|end_file_name|><|fim▁begin|>""" Created by Max 12/10/2017 """
from ValueIteration import ValueIteration
from Game import Game
x = {(0, 32, -5, -5): None,
(0, 32, -5, -4): None,
(0, 32, -5, -3): None,
(0, 32, -5, -2): None,
(0, 32, -5, -1): None,
(0, 32, -5, 0): None,
(0, 32, -5, 1): None,... | (7, 19, 4, 1): (0, 1), |
<|file_name|>DescribeConfigRulesRequestMarshaller.java<|end_file_name|><|fim▁begin|><|fim▁hole|>/*
* Copyright 2017-2022 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 ... | |
<|file_name|>parser.rs<|end_file_name|><|fim▁begin|>use std::str::{from_utf8, Utf8Error};
use nom::*;
use nom::types::CompleteByteSlice;
/*
* Core structs
*/
#[derive(Debug,PartialEq,Eq)]
pub struct TarEntry<'a> {
pub header: PosixHeader<'a>,
pub contents: &'a [u8]
}
#[derive(Debug,PartialEq,Eq)]
pub str... | |
<|file_name|>epd.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
from __future__ import print_function
from .ChessFile import ChessFile, LoadingError
from pychess.Utils.GameModel import GameModel
from pychess.Utils.const import WHITE, BLACK, WON_RESIGN, WAITING_TO_START, BLACKWON, WHITEWON, DRAW
... | if model.status in (WHITEWON, BLACKWON) and model.reason == WON_RESIGN:
file.write(u" resign;")
print(u"", file=file) |
<|file_name|>dir_68267d1309a1af8e8297ef4c3efbcdba.js<|end_file_name|><|fim▁begin|>var dir_68267d1309a1af8e8297ef4c3efbcdba =
[
[ "BeagleGoo.cpp", "_beagle_goo_8cpp.html", [
[ "BeagleGoo", "struct_beagle_goo.html", "struct_beagle_goo" ]
] ],
[ "BeagleGooP.cpp", "_beagle_goo_p_8cpp.html", "_beagle_goo_p... | [ "HD44780gpioPhy.cpp", "_h_d44780gpio_phy_8cpp.html", "_h_d44780gpio_phy_8cpp" ],
[ "SPI.cpp", "_s_p_i_8cpp.html", "_s_p_i_8cpp" ], |
<|file_name|>run_on.py<|end_file_name|><|fim▁begin|>import sys
import os
import files.io
from StringIO import StringIO
from constants import *
added_path = os.path.join(os.path.dirname(os.path.abspath(os.path.dirname(__file__))), "script")
sys.path.append(added_path)
import script
import mess
sys.path.pop()
def full_... | assert "template" in input_files, "Need to submit non-empty template"
assert "spreadsheet" in input_files, "Need to submit non-empty spreadsheet"
output_location = StringIO()
kwargs = {} |
<|file_name|>CardDeck.d.ts<|end_file_name|><|fim▁begin|>import { CSSModule } from '../index';
export interface CardDeckProps extends React.HTMLAttributes<HTMLElement> {
tag?: React.ReactType;
className?: string;
cssModule?: CSSModule;
}
declare const CardDeck: React.StatelessComponent<CardDeckProps>;<|fim▁hole|... | |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>#![cfg_attr(
not(any(
feature = "vulkan",
feature = "dx11",
feature = "dx12",
feature = "metal",
feature = "gl",
)),
allow(dead_code, unused_extern_crates, unused_imports)
)]
#[cfg(feature = "dx11")]
extern crate gfx_... | },
},
count: 1,
}), |
<|file_name|>posts.js<|end_file_name|><|fim▁begin|>'use strict';
angular.module('myApp.post', ['ngRoute'])
.config(['$routeProvider', function($routeProvider) {
$routeProvider.when('/new-post', {
templateUrl: 'posts/new-post.html',
controller: 'PostCtrl'
});
}])
.controller('PostCtrl', ['$scope', '$firebaseArr... | |
<|file_name|>1d76643bcec4_nvp_netbinding.py<|end_file_name|><|fim▁begin|># vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 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 may obtain
# a ... | |
<|file_name|>Main.java<|end_file_name|><|fim▁begin|>package org.cqframework.cql.tools.parsetree;
import org.antlr.v4.runtime.ANTLRInputStream;
import org.antlr.v4.runtime.CommonTokenStream;
import org.antlr.v4.runtime.ParserRuleContext;
import org.cqframework.cql.gen.cqlLexer;
import org.cqframework.cql.gen.cqlParser;... |
import java.io.FileInputStream;
import java.io.IOException; |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (C) 2009 Damien Churchill <damoxc@gmail.com>
#
# Basic plugin template created by:
# Copyright (C) 2008 Martijn Voncken <mvoncken@gmail.com>
# Copyright (C) 2007-2009 Andrew Resch <andrewresch@gmail.com>
#
# This file is part of De... | |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
readme = open('README.rst').read()
history = open('HISTORY.rst').read().replace('.. :changelog:', '')
... | test_requirements = [
# TODO: put package test requirements here
]
|
<|file_name|>mkslides.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | /usr/bin/env python
pandoc -t s5 --self-contained trial.md -o index.html |
<|file_name|>regress-89443.js<|end_file_name|><|fim▁begin|>/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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://m... | * SUMMARY: Regression test for bug 89443
* See http://bugzilla.mozilla.org/show_bug.cgi?id=89443
* |
<|file_name|>protocol_setup_server.py<|end_file_name|><|fim▁begin|>from tasty.types import conversions<|fim▁hole|>__params__ = {'la': 32, 'lb': 32, 'da': 10}
driver = TestDriver()
def protocol(client, server, params):
server.ga = Garbled(val=Unsigned(bitlen=764, dim=[1], signed=False, passive=True, empty=True), si... | from tasty.types import *
from tasty.types.driver import TestDriver |
<|file_name|>index.d.ts<|end_file_name|><|fim▁begin|>// Type definitions for geojson 7946.0
// Project: https://geojson.org/
// Definitions by: Jacob Bruun <https://github.com/cobster>
// Arne Schubert <https://github.com/atd-schubert>
// Jeff Jacobson <https://github.com/JeffJacobson>
/... | * to add these foreign members.
*/
export interface GeoJsonObject {
// Don't include foreign members directly into this type def. |
<|file_name|>lexical-scope-in-unconditional-loop.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-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... | |
<|file_name|>syscall_windows.go<|end_file_name|><|fim▁begin|>// Copyright 2016 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.<|fim▁hole|>package ipv6
import (
"syscall"
"unsafe"
)
func getsockopt(s uintptr, level, name int... | |
<|file_name|>24.d.ts<|end_file_name|><|fim▁begin|><|fim▁hole|> CarbonIconProps & React.RefAttributes<SVGSVGElement>
>;
export default CloudDownload24;<|fim▁end|> | import * as React from "react";
import { CarbonIconProps } from "../../";
declare const CloudDownload24: React.ForwardRefExoticComponent< |
<|file_name|>User.java<|end_file_name|><|fim▁begin|>/*
* $Id$
*<|fim▁hole|> * regarding copyright ownership. The ASF licenses this file
* to you 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
*
... | * 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 |
<|file_name|>islamic.js.uncompressed.js<|end_file_name|><|fim▁begin|>define(
"dojo/cldr/nls/fr/islamic", //begin v1.x content
{
"dateFormatItem-yM": "M/yyyy",
"dateFormatItem-yyyyMMMEd": "E d MMM y G",
"dateFormatItem-yQ": "'T'Q y",
"dateFormatItem-MMMEd": "E d MMM",
"dateFormatItem-hms": "h:mm:ss a",
"dateFormat... | |
<|file_name|>system_page_browser_proxy.ts<|end_file_name|><|fim▁begin|>// Copyright 2016 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.
/** @fileoverview Handles interprocess communication for the system page. */
// cl... | static setInstance(obj: SystemPageBrowserProxy) { |
<|file_name|>FloatObjectPredicate.java<|end_file_name|><|fim▁begin|>// THIS CODE IS MACHINE-GENERATED, DO NOT EDIT!
package fallk.jfunktion;
/**<|fim▁hole|> * {@link java.util.function.BiPredicate} for {@code float}/{@code char}.
*
* @see java.util.function.BiPredicate
*/
@FunctionalInterface
public interface Floa... | * Represents a predicate (boolean-valued function) of a {@code float}-valued and a generic argument.
* This is the primitive type specialization of |
<|file_name|>test_index.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from django.conf import settings
from django.contrib.auth.models import User
from django.shortcuts import reverse
<|fim▁hole|>from ...views.index_views import user_login
from app.models import TheUser
# --------------------------... | from django.test import TestCase
from rest_framework.test import APIClient
|
<|file_name|>instance_hellfire_ramparts.cpp<|end_file_name|><|fim▁begin|>/* Copyright (C) 2006 - 2012 ScriptDev2 <http://www.scriptdev2.com/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; e... | #include "hellfire_ramparts.h"
instance_ramparts::instance_ramparts(Map* pMap) : ScriptedInstance(pMap),
m_uiSentryCounter(0) |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
from geoip2.errors import GeoIP2Error
from ipware import get_client_ip
def get_location_from_ip(request):
client_ip, is_routable = get_client_ip(request)
if client_ip is not None:
g = GeoIP2()
try:
record = g.city(clie... | from django.contrib.gis.geoip2 import GeoIP2 |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Xlib.__init__ -- glue for Xlib package
#
# Copyright (C) 2000-2002 Peter Liljenberg <petli@ctrl-c.liu.se>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License
# as published by th... | # from Xlib import *
] |
<|file_name|>IconButton_test.ts<|end_file_name|><|fim▁begin|>// Copyright 2020 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.
import {assertNotNullOrUndefined} from '../../../../../front_end/core/platform/platform.js';
... | iconWidth: '3ex',
},
],
}); |
<|file_name|>matching.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 attr::{AttrSelectorOperation, NamespaceConstraint, Parse... | _ => false,
}
} |
<|file_name|>.eslintrc.js<|end_file_name|><|fim▁begin|>module.exports = {
extends: ["standard", "standard-react"],
env: {
browser: true,
es6: true
},
globals: {
graphql: true
},
plugins: ["class-property"],
parser: "babel-eslint",
rules: {
indent: ["off"],
"no-unused-vars": [
"... | "react/jsx-uses-react": "error", |
<|file_name|>protractor.conf.js<|end_file_name|><|fim▁begin|>'use strict';
var seleniumServerJar =
'/usr/local/lib/node_modules/protractor' +
'/selenium/selenium-server-standalone-2.41.0.jar';
// A reference configuration file.
exports.config = {
// ----- How to setup Selenium -----
//
// There are three wa... |
// ----- What tests to run -----
//
// Spec patterns are relative to the location of this config. |
<|file_name|>router.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
from __future__ import absolute_import
import six.moves.SimpleHTTPServer
from six.moves.BaseHTTPServer import HTTPServer
from six.moves.socketserver import ForkingMixIn
import six.moves.urllib.request, six.moves.urllib.parse, six.moves.urllib.e... | result['pathre'] = parse_path_filter(pieces[i][len('path:'):])
elif pieces[i].startswith('pathre:'):
result['pathre'] = pieces[i][len('pathre:'):]
elif pieces[i].startswith('context:'): |
<|file_name|>task-stderr.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... | let mut reader = ChanReader::new(rx);
let stderr = ChanWriter::new(tx);
let res = thread::Builder::new().stderr(box stderr as Box<Writer + Send>) |
<|file_name|>tutorial-05.rs<|end_file_name|><|fim▁begin|>#[macro_use]
extern crate glium;
fn main() {
#[allow(unused_imports)]
use glium::{glutin, Surface};
let event_loop = glutin::event_loop::EventLoop::new();
let wb = glutin::window::WindowBuilder::new();
let cb = glutin::ContextBuilder::new();... | #[derive(Copy, Clone)] |
<|file_name|>ReactBrowserEventEmitter.js<|end_file_name|><|fim▁begin|>/**
* Copyright 2013-2014 Facebook, 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... | } else if (dependency === topLevelTypes.topScroll) { |
<|file_name|>dummy_operator.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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.