prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>StopPaymentTask.java<|end_file_name|><|fim▁begin|>package com.citypark.api.task;
import com.citypark.api.parser.CityParkStartPaymentParser;
import android.content.Context;
import android.os.AsyncTask;
import android.text.format.Time;
public class StopPaymentTask extends AsyncTask<Void, Void, Boolean> {... | |
<|file_name|>ConnectedNode.js<|end_file_name|><|fim▁begin|>goog.provide('crow.ConnectedNode');
goog.require('crow.Node');
/**<|fim▁hole|>
crow.ConnectedNode = function(id){
crow.Node.apply(this, arguments);
this.connections = [];
this.connectionDistances = {};
};
crow.ConnectedNode.prototype = new crow.Node();
crow... | * ConnectedNodes are nodes that have to be explicitly "connected" to other nodes.
* @class
*/ |
<|file_name|>apk.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Kevin Brebanov <https://github.com/kbrebanov>
# Based on pacman (Afterburn <http://github.com/afterburn>, Aaron Bull Schaefer <aaron@elasticdog.com>)
# and apt (Matthew Williams <matthew@flowroute.com>) modules.
#
# ... | |
<|file_name|>source-map-consumer-compiled.js<|end_file_name|><|fim▁begin|>/* -*- Mode: js; js-indent-level: 2; -*- */
/*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
* http://opensource.org/licenses/BSD-3-Clause
*/
'use strict';
if (typeof define !== 'f... | */
SourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { |
<|file_name|>powGenerator.py<|end_file_name|><|fim▁begin|>from findSentence import sentenceGrab
from phoneticWords import findPhonetics
from phoneticIndex import findPhoneticIndex
from random import randint
from math import floor
import sys
def main():
library = sys.argv[1]
subject = sys.argv[2]
dictionar... |
sentenceIndex = punSentence.find(punWord) |
<|file_name|>newtype-struct-drop-run.rs<|end_file_name|><|fim▁begin|>// Copyright 2013 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.ap... | use std::cell::Cell;
struct Foo(@Cell<int>); |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""
Initialization script for restapi for the application.
"""
from flask import Blueprint
from app.common.logging import setup_logging
<|fim▁hole|># Setup logger
# api_log = setup_logging(__name__, 'logs/api.log', maxFilesize=1000000,
# bac... | api = Blueprint('api', __name__)
|
<|file_name|>gen_zpaql.rs<|end_file_name|><|fim▁begin|>use zpaql::{ZPAQLOp, Loc, Reg, OtherReg, SwapLoc};
use ir::{IR, IRVar, IROp, IRUOp};
use options;
use std::collections::HashMap;
/// keeps track of variable copies in registers or memory locations
pub struct Cache {
pub last_hold: HashMap<Loc, IRVar>,
}
impl... | IRUOp::Invert => { code.push(ZPAQLOp::Not(Loc::Reg(Reg::A)) ); }, // bitwise ~
IRUOp::USub => { code.push(ZPAQLOp::Not(Loc::Reg(Reg::A)) ); code.push(ZPAQLOp::Inc(Loc::Reg(Reg::A))); }, // -x == ~x + 1
}
... |
<|file_name|>dft.py<|end_file_name|><|fim▁begin|>import numpy as np
from pyquante2.dft.functionals import xs,cvwn5
# Maybe move these to the functionals module and import from there?
xname = dict(lda=xs,xs=xs,svwn=xs)
cname = dict(lda=cvwn5,svwn=cvwn5,xs=None)
def get_xc(grid,D,**kwargs):
xcname = kwargs.get('xcn... | |
<|file_name|>orthographic.rs<|end_file_name|><|fim▁begin|>#[cfg(feature = "arbitrary")]
use quickcheck::{Arbitrary, Gen};
use rand::distributions::{Distribution, Standard};
use rand::Rng;
#[cfg(feature = "serde-serialize")]
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use std::fmt;
use std::mem;
use ... | |
<|file_name|>user_module.cc<|end_file_name|><|fim▁begin|>/**
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2013 B... | library->min_version.build, library->min_version.qfe);
sb.AppendFormat("\n");
// Counts. |
<|file_name|>central_planner_test.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apa... | |
<|file_name|>Event_Generator_Base.H<|end_file_name|><|fim▁begin|>#ifndef SHRIMPS_EVENT_GENERATOR_BASE_H
#define SHRIMPS_EVENT_GENERATOR_BASE_H
#include "SHRiMPS/Eikonals/Omega_ik.H"
namespace SHRIMPS {
class Event_Generator_Base {
protected:
Omega_ik * p_eikonal;
double m_smin;
public:
Event_Gene... | virtual double TMax() const { return 0.; } |
<|file_name|>RedBlackIntegerMap.java<|end_file_name|><|fim▁begin|>package org.katlas.JavaKh.rows;
import org.katlas.JavaKh.utils.RedBlackIntegerTree;
public class RedBlackIntegerMap<F> extends RedBlackIntegerTree<F> implements MatrixRow<F> {
/**
*
*/
private static final long serialVersionUID = 58856... |
} |
<|file_name|>Table1.cpp<|end_file_name|><|fim▁begin|>//include files
#include "Table1.h"
namespace hoge{
/*
* This class is generated automatically.
* Never change from your hand.
*/
/**
* <pre>
* schema name : "tiny_query_helper_test"
* table name : "table1"
* remarks : ""<|fim▁hole|> * </pre>
*/
... | *
* Persistable:
* Available to use Persistor-methods, like DBManager\#insert(IPersistable),\#update(IPersistable),\#delete(IPersistable),else.
* |
<|file_name|>test.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
import sys
sys.path.append('..') # help python find cyton.py relative to scripts folder
from openbci import cyton as bci
import logging
import time
def printData(sample):
# os.system('clear')
print("----------------")
... | port = '/dev/tty.usbserial-DB00JAM0'
# port = '/dev/tty.OpenBCI-DN0096XA' |
<|file_name|>__openerp__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011-2012 Domsense s.r.l. (<http://www.domsense.com>).
# Copyright (C) 2012 Agile Business... | "depends": ["account_voucher_cash_basis"],
"author": "Agile Business Group",
"description": """
See 'account_voucher_cash_basis' description. |
<|file_name|>ScatterCanvas.java<|end_file_name|><|fim▁begin|>/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.jtex.plot;
/**
*
* @author hios
*/
public interface Scatte... |
public ScatterOptions getScatterOptions();
|
<|file_name|>739_daily-temperatures.py<|end_file_name|><|fim▁begin|>class Solution:
def dailyTemperatures(self, T):
ans = []
m = [None]*101
for i in range(len(T)-1, -1, -1):
x = T[i]
m[x] = i
ans.append(min([x for x in m[x+1:] if x is not None], default=i)... | print(Solution().dailyTemperatures([73, 74, 75, 71, 69, 72, 76, 73])) |
<|file_name|>AssemblyConnector.java<|end_file_name|><|fim▁begin|>/**
* <copyright>
* </copyright>
*
* $Id$
*/
package kieker.tools.slastic.metamodel.componentAssembly;
import kieker.tools.slastic.metamodel.core.FQNamedEntity;
import kieker.tools.slastic.metamodel.typeRepository.ConnectorType;
/**
* <!-- begin-... | |
<|file_name|>strategy.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 27 18:31:59 2017
@author: katsuya.ishiyama
"""
from numpy import random
# Definition of module level constants
SUCCESS_CODE = 1
FAILURE_CODE = 0
class Strategy():
def __init__(self, n):
... | self.tried_strategy.append(self.current_strategy) |
<|file_name|>UtilCellInfoFormatter.java<|end_file_name|><|fim▁begin|>package edu.towson.cis.cosc603.project2.monopoly.gui;
import edu.towson.cis.cosc603.project2.monopoly.Cell;
import edu.towson.cis.cosc603.project2.monopoly.Player;
import edu.towson.cis.cosc603.project2.monopoly.UtilityCell;
// TODO: Auto-generated ... | public String format(Cell cell) {
UtilityCell c = (UtilityCell)cell; |
<|file_name|>bitcoin_sr.ts<|end_file_name|><|fim▁begin|><TS language="sr" version="2.1">
<context><|fim▁hole|> <name>AddressBookPage</name>
<message>
<source>Right-click to edit address or label</source>
<translation>Десни клик за измену адресе или ознаке</translation>
</message>
<message... | |
<|file_name|>query.py<|end_file_name|><|fim▁begin|># This file is part of beets.
# Copyright 2016, Adrian Sampson.
#
# 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 restriction, inclu... |
def __hash__(self): |
<|file_name|>pattern.js<|end_file_name|><|fim▁begin|>/* Mark special links
*
* Options:
* external_links_open_new_window(boolean): Open external links in a new window. (false)
* mark_special_links(boolean): Marks external or special protocl links with class. (true)
*
* Documentation:
* # General
*
* ... | // and no img children should be wrapped in a link-external span
contentarea
.find(
'a[href^="http:"]:not(.link-plain):not([href^="' + |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import os
from carton.cart import Cart
from django.contrib import messages
from django.shortcuts import render, redirect
from django.template.response import TemplateResponse
from django.views.generic import View
from authentication.views import LoginRequiredMixin
f... |
Args:
request: The incoming get request object
**kwargs: Any keyword arguments passed to the function |
<|file_name|>test_deprecations.py<|end_file_name|><|fim▁begin|>"""
Tests related to deprecation warnings. Also a convenient place
to document how deprecations should eventually be turned into errors.
"""
from __future__ import division, absolute_import, print_function
import datetime
import sys
import operator
import... | class TestBinaryReprInsufficientWidthParameterForRepresentation(_DeprecationTestCase):
"""
If a 'width' parameter is passed into ``binary_repr`` that is insufficient to
represent the number in base 2 (positive) or 2's complement (negative) form, |
<|file_name|>zfs_permissions.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Nate Coraor <nate@coraor.org>
#
# 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
# ... | rval.append(ent)
elif self.state == 'absent' and ent_perms is not None:
rval.append(ent) |
<|file_name|>ping.go<|end_file_name|><|fim▁begin|>package server
import (<|fim▁hole|>
"github.com/gin-gonic/gin"
)
func handlePing(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{"hello": "world!", "goto": "https://github.com/treeder/functions"})
}<|fim▁end|> | "net/http" |
<|file_name|>0004_area_of_circle.rs<|end_file_name|><|fim▁begin|>// Area of circle
fn main() {
let r = 5.0;<|fim▁hole|> println!("Value = {} ",c);
}<|fim▁end|> | let pi = 3.14;
let c = pi * r * r; |
<|file_name|>PhotosNotesApi.java<|end_file_name|><|fim▁begin|>/*
* Jinx is Copyright 2010-2020 by Jeremy Brooks and Contributors
*
* Jinx 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 o... | * @see <a href="https://www.flickr.com/services/api/">Flickr API documentation</a> for more details. |
<|file_name|>about.client.config.js<|end_file_name|><|fim▁begin|>'use strict';
// Configuring the Articles module
angular.module('about').run(['Menus',<|fim▁hole|>]);<|fim▁end|> | function(Menus) {
// Set top bar menu items
Menus.addMenuItem('mainmenu', 'About Us', 'about', 'left-margin', '/about-us', true, null, 3);
} |
<|file_name|>hooks.test.js<|end_file_name|><|fim▁begin|>'use strict';
/* jshint -W030 */
var chai = require('chai')
, expect = chai.expect
, Support = require(__dirname + '/../support')
, DataTypes = require(__dirname + '/../../../lib/data-types')
, Sequelize = Support.Sequelize
, dialect = Support.getTestDi... | , afterHook = sinon.spy();
this.User.beforeSync(beforeHook); |
<|file_name|>jump_to.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""<|fim▁hole|>#
# This file is licensed under the GNU General Public License v3
# (GPLv3). See LICENSE.txt for details.
# testing if we are preserving task_data between wf jumps
def main_wf(current):
current.task_data['from_main'] = T... | """
# Copyright (C) 2015 ZetaOps Inc. |
<|file_name|>index.d.ts<|end_file_name|><|fim▁begin|>// Type definitions for @storybook/addon-actions 3.4
// Project: https://github.com/storybooks/storybook, https://github.com/storybooks/storybook/tree/master/addons/actions
// Definitions by: Joscha Feth <https://github.com/joscha>, June <https://github.com/jicjjang>... | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
export type HandlerFunction = (...args: any[]) => undefined; |
<|file_name|>test_user.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import os
import pytest
from skylines.lib import files
from skylines.lib.types import is_unicode
from skylines.model import User, IGCFile
from tests.data import users, igcs
<|fim▁hole|>
def test_user_delete_deletes_user(db_session):
jo... | |
<|file_name|>GuiHealth.java<|end_file_name|><|fim▁begin|>package com.tage.rpgutil.client.gui;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
import cpw.mods.fml.common.eventhandler.Cancelable;
import cpw.mods.fml.common.eventhandler.Event;<|fim▁hole|>public class GuiHealth extends Event
{
public st... | import cpw.mods.fml.common.eventhandler.EventPriority;
@Cancelable |
<|file_name|>new_users_saver.py<|end_file_name|><|fim▁begin|>################################################################################
# new_users_saver funciton
################################################################################
def newusers(m):
dict_updater()
un = m.from_user.username
... | # "newusers" saves new users in the dictionary
# (see dict_updater_saver.py for "dict_updater()" and "dict_saver()") |
<|file_name|>index.d.ts<|end_file_name|><|fim▁begin|>// Generated by typings
// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/587f9d9cb018514c03434ccc0fc53ffcad32e8b7/whatwg-fetch/whatwg-fetch.d.ts
// Type definitions for fetch API
// Project: https://github.com/github/fetch
// Definitions b... | has(name: string): boolean;
set(name: string, value: string): void; |
<|file_name|>test_dict_vectorizer.py<|end_file_name|><|fim▁begin|># Authors: Lars Buitinck
# Dan Blanchard <dblanchard@ets.org>
# License: BSD 3 clause
from random import Random
import numpy as np
import scipy.sparse as sp
from numpy.testing import assert_array_equal
from numpy.testing import assert_allclose
... | v = DictVectorizer(sparse=False)
with pytest.raises(TypeError) as error:
v.fit(D2)
assert str(error.value) == error_value |
<|file_name|>udp.rs<|end_file_name|><|fim▁begin|>use crate::sys::unix::net::{new_ip_socket, socket_addr};
use std::io;
use std::mem;
use std::net::{self, SocketAddr};
use std::os::unix::io::{AsRawFd, FromRawFd};
pub fn bind(addr: SocketAddr) -> io::Result<net::UdpSocket> {
// Gives a warning for non Apple platfor... | |
<|file_name|>graph_test.go<|end_file_name|><|fim▁begin|>package docker
import (
"archive/tar"
"bytes"
"errors"
"github.com/dotcloud/docker/utils"
"io"
"io/ioutil"
"os"
"path"
"testing"
"time"
)
func TestInit(t *testing.T) {
graph := tempGraph(t)
defer os.RemoveAll(graph.Root)
// Root should exist
if _, ... | defer os.RemoveAll(graph.Root) |
<|file_name|>RoutingPrinterTest.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2011 Carl Green
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, ... | routing.setEffectId(0);
routing.setUpperInputConnection(0); |
<|file_name|>FizzyText.js<|end_file_name|><|fim▁begin|>/*
Credits: Most of the original code seems to have been
written by George Michael Brower. The changes I've made
include adding background particle animations, text
placement and modification, and integration with a
sparkfun heart rate monitor ... | // __defineGetter__ and __defineSetter__ make JavaScript believe that
// we've defined a variable 'this.message'. This way, whenever we
// change the message variable, we can call some more functions.
|
<|file_name|>network_json.go<|end_file_name|><|fim▁begin|>// +build json
package net
import (
"encoding/json"
"github.com/v2ray/v2ray-core/common/serial"
)
func (this *NetworkList) UnmarshalJSON(data []byte) error {
var strlist serial.StringLiteralList
if err := json.Unmarshal(data, &strlist); err != nil {
re... | |
<|file_name|>util.rs<|end_file_name|><|fim▁begin|>use std::fs::File;
use std::io::BufReader;
use std::io::Error;
use std::io::prelude::*;
use std::path::Path;
pub fn get_mnist_vector(fname: &str) -> Result<Vec<Vec<f32>>, Error> {
let path = Path::new(fname);
match File::open(&path) {
Ok(file) => {
... | let ind = i as usize; |
<|file_name|>pomodoro.py<|end_file_name|><|fim▁begin|>import CursesTimer
import Audio
import Utils
import database
import datetime
class Pomodoro:
'''
pomodoro関連
'''
def __init__(self):
self.db = database.database()
self.t = CursesTimer.CursesTimer()
self.u = Utils.Utils()
... | today = datetime.datetime.today()
#もし今のhourがdayendより前ならenddatetimeは今日
if today.hour < self.dayend: |
<|file_name|>test_logger.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import logging
from unittest import mock
import olympia.core.logger
from olympia.amo.tests import TestCase
from olympia.users.models import UserProfile
class LoggerTests(TestCase):
@mock.patch('olympia.core.get_remote_addr', lambd... | def test_logger_adapter_user_is_none(self):
log = olympia.core.logger.getLogger('test')
expected_kwargs = {
'extra': { |
<|file_name|>timer.js<|end_file_name|><|fim▁begin|>export class Timer {
/**
* diff 2 `Date` in Millisecond
* @param {Date} since
* @param {Date} until
*/
static diff(since, until) {
return (until.getTime() - since.getTime());
}
constructor() {
/** time elapsed in mil... | }
|
<|file_name|>l3_match.py<|end_file_name|><|fim▁begin|>import re
import string_example
"""
One small letter,
surrounded by EXACTLY three big bodyguards on each of its sides.
"""
class StingMatch(object):
"""String match """
def __init__(self):
self.msg = string_example.string
def match(se... | main() |
<|file_name|>main.py<|end_file_name|><|fim▁begin|>#!python2.7
'''
Created on Jul 13, 2014
@author: cilia
'''
import os.path
import os
import time
import sys
import tempfile
from utils.path import loadModule
import utils
conf = utils.get_conf()
def run_task(task_conf):
# import pdb; pdb.set_trace()
print 'run... | |
<|file_name|>timeandtweet.py<|end_file_name|><|fim▁begin|>from twitter import *
import simplejson
import serial
import datetime
import time
import threading
QUIT = 0
prevtweet = ""
def centerstring(string,width):
""" Pad a string to a specific width """
return " "*((width-len(string))/2)+string
def padstring(st... | p.close()
QUIT = 1 |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>//! Tkacz, a library
pub mod config;
pub mod query;
pub mod store;
pub mod taxonomy;
pub mod thing;
pub mod types;
pub use crate::query::{Query, QueryParser};
pub use crate::store::Store;
pub use crate::taxonomy::{ContentSource, Taxon};
pub use crate::thing::Thing;
pub... | |
<|file_name|>LibflacAudioRenderer.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");<|fim▁hole|> * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
... | |
<|file_name|>Slider.tsx<|end_file_name|><|fim▁begin|>import React, { FunctionComponent } from 'react';
import { Range, createSliderWithTooltip } from 'rc-slider';
import { cx, css } from 'emotion';
import { Global, css as cssCore } from '@emotion/core';
import { stylesFactory } from '../../themes';
import { GrafanaThem... | |
<|file_name|>Wall.java<|end_file_name|><|fim▁begin|>package com.sadc.game.gameobject.trackobject;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.sadc.game.GameConstants;
import com.sadc.game.gameobject.GameUtils;
import com.sadc.game.gameobject.Player;
/**
* @a... | |
<|file_name|>s3-object-lambda.rs<|end_file_name|><|fim▁begin|>/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
// snippet-start:[s3.rust.s3-object-lambda-packages]
use aws_endpoint::partition;
use aws_endpoint::partition::endpoint;
use aws_endpoint::{... | println!();
} |
<|file_name|>SNAClassNames.java<|end_file_name|><|fim▁begin|>/*
* @author Flavio Keller
*
* Copyright 2014 University of Zurich
*
* 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
*
... | * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License. |
<|file_name|>lib.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/licens... |
// we don't need to introspect into these at all: an
// expression/block context can't possibly contain exported things. |
<|file_name|>run.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import json
import sys
import web
from coloredcoinlib import BlockchainState, ColorDefinition
blockchainstate = BlockchainState.from_url(None, True)
urls = (
'/tx', 'Tx',
'/prefetch', 'Prefetch',
)
class ErrorThrowingRequestProcessor:... | |
<|file_name|>lint-expr-stmt-attrs-for-early-lints.rs<|end_file_name|><|fim▁begin|>// run-pass
#![feature(stmt_expr_attributes)]
#![deny(unused_parens)]
// Tests that lint attributes on statements/expressions are
// correctly applied to non-builtin early (AST) lints
<|fim▁hole|> }
}<|fim▁end|> | fn main() {
#[allow(unused_parens)]
{
let _ = (9); |
<|file_name|>kartograph-script.py<|end_file_name|><|fim▁begin|>#!C:\Users\SeanSaito\Dev\aviato\flask\Scripts\python.exe<|fim▁hole|>
if __name__ == '__main__':
sys.exit(
load_entry_point('kartograph.py==0.6.8', 'console_scripts', 'kartograph')()
)<|fim▁end|> | # EASY-INSTALL-ENTRY-SCRIPT: 'kartograph.py==0.6.8','console_scripts','kartograph'
__requires__ = 'kartograph.py==0.6.8'
import sys
from pkg_resources import load_entry_point |
<|file_name|>jmg.js<|end_file_name|><|fim▁begin|>/*
JMG (Javascript Mini GUI)
(c) Roberto Lopez <jmg.contact.box *at* gmail.com>
The MIT License (MIT)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to de... | //------------------------------------------------------------------------------------------------------------------------
// text
//------------------------------------------------------------------------------------------------------------------------
|
<|file_name|>kinova_test.py<|end_file_name|><|fim▁begin|># Copyright 2019 The dm_control Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE... | physics = mjcf.Physics.from_mjcf_model(hand.mjcf_model) |
<|file_name|>octave.js<|end_file_name|><|fim▁begin|><|fim▁hole|>Simpla CMS 2.3.8 = 1040075c69dc0e56580b73f479381087<|fim▁end|> | |
<|file_name|>TimeModel.py<|end_file_name|><|fim▁begin|>from time import time
from gi.repository import GLib, GObject
from pychess.Utils.const import WHITE, BLACK
from pychess.System.Log import log
class TimeModel(GObject.GObject):
__gsignals__ = {
"player_changed": (GObject.SignalFlags.RUN_FIRST, None,... | if color == self.movingColor and self.started and movecount == -1:
if self.paused:
return self.intervals[color][movecount] - self.pauseInterval
elif self.counter: |
<|file_name|>calibrate_head_s2r2.py<|end_file_name|><|fim▁begin|>#Copyright 2008, Meka Robotics
#All rights reserved.
#http://mekabot.com
#Redistribution and use in source and binary forms, with or without
#modification, are permitted.
#THIS SOFTWARE IS PROVIDED BY THE Copyright HOLDERS AND CONTRIBUTORS
#"AS IS" A... | |
<|file_name|>test_project_duplicate_subtask.py<|end_file_name|><|fim▁begin|># Copyright (C) 2021 ForgeFlow S.L.
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html)
from odoo.tests.common import TransactionCase
class TestProjectDuplicateSubtask(TransactionCase):
def setUp(self):<|fim▁hole|> ... | |
<|file_name|>vxworks_dassemble.py<|end_file_name|><|fim▁begin|>import os
import sys
import string
filenames = os.listdir(os.getcwd())
for file in filenames:
if os.path.splitext(file)[1] == ".o" or os.path.splitext(file)[1] == ".elf" :
print "objdumparm.exe -D "+file
os.system("C:/WindRiver/gnu/4.1.2-vxwo... | os.system("pause") |
<|file_name|>sboxes.rs<|end_file_name|><|fim▁begin|>/// Tiger s-boxes
pub const SBOXES: [[u64; 256]; 4] = [[0x02AAB17CF7E90C5E,
0xAC424B03E243A8EC,
0x72CD5BE30DD5FCD3,
0x6D019B93F6F97F3A,
... | 0x3249D8F9C80046C9,
0x80CF9BEDE388FB63,
0x1881539A116CF19E, |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>// Copyright 2015 The Gfx-rs Developers.
//
// 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... | use genmesh::generators::{Plane, SharedVertex, IndexedPolygon}; |
<|file_name|>groupbylazy.rs<|end_file_name|><|fim▁begin|>use std::cell::{Cell, RefCell};
use std::vec;
/// A trait to unify FnMut for GroupBy with the chunk key in IntoChunks
trait KeyFunction<A> {
type Key;
fn call_mut(&mut self, arg: A) -> Self::Key;
}
impl<'a, A, K, F: ?Sized> KeyFunction<A> for F
wher... | |
<|file_name|>AtomicVolatilePartitionCounterStateConsistencyTest.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.
* Th... | |
<|file_name|>outlet.ts<|end_file_name|><|fim▁begin|>import { Simple } from '@glimmer/interfaces';
import { DirtyableTag, Tag, TagWrapper, VersionedPathReference } from '@glimmer/reference';
import { Opaque, Option } from '@glimmer/util';
import { environment } from 'ember-environment';
import { run } from 'ember-metal'... | |
<|file_name|>juce_MemoryInputStream.cpp<|end_file_name|><|fim▁begin|>/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2017 - ROLI Ltd.
JUCE is an open source library subject to commercial or open-source
licensin... | while (numBytesRead < data.getSize())
{
|
<|file_name|>MotivationBtnView.js<|end_file_name|><|fim▁begin|>define([ 'backbone', 'metro', 'util' ], function(Backbone, Metro, Util) {
var MotivationBtnView = Backbone.View.extend({
className: 'motivation-btn-view menu-btn',
events: {
'click': 'toggle',
'mouseover': 'over',
'mouseout': 'out',
... |
var MotivationView = Backbone.View.extend({
|
<|file_name|>DehnenMcLaughlin.cc<|end_file_name|><|fim▁begin|>//-----------------------------------------------------------------------------+
// |
// DehnenMcLaughlin.cc |
// ... | // This program is distributed in the hope that it will be useful, but |
// WITHOUT ANY WARRANTY; without even the implied warranty of |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// General Public License for more details. ... |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""
Meteorology visualisation examples<|fim▁hole|><|fim▁end|> | ==================================
""" |
<|file_name|>DllLoader.cpp<|end_file_name|><|fim▁begin|>/**
* @file DllLoader.cpp
* @author Minmin Gong
*
* @section DESCRIPTION
*
* This source file is part of KFL, a subproject of KlayGE
* For the latest info, see http://www.klayge.org
*
* @section LICENSE
*
* This program is free software; you ... | *
* This program is distributed in the hope that it will be useful,
|
<|file_name|>queue.ts<|end_file_name|><|fim▁begin|>import { QueueAction } from './QueueAction';
import { QueueScheduler } from './QueueScheduler';
/**
*
* 队列调度器
*
* <span class="informal">将每个任务都放到队列里,而不是立刻执行它们</span>
*
* `queue` 调度器, 当和延时一起使用的时候, 和 {@link async} 调度器行为一样。
*
* 当和延时一起使用, 它同步地调用当前任务,即调度的时候执行。然而当递归... | * console.log('before', state);
* this.schedule(state - 1); // `this` 指向当前执行的 Action, |
<|file_name|>Betamax.java<|end_file_name|><|fim▁begin|>/**
* Copyright (C) 2010-2012 Regis Montoya (aka r3gis - www.r3gis.fr)
* This file is part of CSipSimple.
*
* CSipSimple is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Fr... | |
<|file_name|>conftest.py<|end_file_name|><|fim▁begin|>"""Configuration and injectable fixtures for Pytest.<|fim▁hole|>
DI and functions over complex inheritance hierarchies FTW!
"""
import os
import warnings
pytest_plugins = ["abilian.testing.fixtures"]
if os.environ.get("FAIL_ON_WARNINGS"):
# Don't remove !
... |
Supposed to replace the too-complex current UnitTest-based testing
framework. |
<|file_name|>test_pm_force.py<|end_file_name|><|fim▁begin|>#
# Test PM force parallelisation:
# check force does not depend on number of MPI nodes
import fs
import numpy as np
import h5py
import pm_setup
# read reference file
# $ python3 create_force_h5.py to create
file = h5py.File('force_%s.h5' % fs.config_precisio... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from warnings import warn
from beaker.crypto.pbkdf2 import PBKDF2, strxor
from beaker.crypto.util import hmac, sha1, hmac_sha1, md5
from beaker import util
keyLength = None
if util.jython:
try:
from beaker.crypto.jcecrypto import getKeyLength, aesEncr... | |
<|file_name|>clientChat.js<|end_file_name|><|fim▁begin|>"use strict";
exports.__esModule = true;
var vueClient_1 = require("../../bibliotheque/vueClient");
console.log("* Chargement du script");
/* Test - déclaration d'une variable externe - Possible
cf. declare
*/
function centreNoeud() {
return JSON.parse(vueClie... |
function envoyerMessage(texte: string, destinataire: Identifiant) {
let msg: MessageTchat = creerMessageCommunication(noeud.centre().enJSON().id, destinataire, texte);
console.log("- Envoi du message brut : " + msg.brut()); |
<|file_name|>visitors.js<|end_file_name|><|fim▁begin|>"use strict";
exports.__esModule = true;
var _typeof2 = require("babel-runtime/helpers/typeof");
var _typeof3 = _interopRequireDefault(_typeof2);
var _keys = require("babel-runtime/core-js/object/keys");
var _keys2 = _interopRequireDefault(_keys);
var _getIter... | _i4 = _iterator4.next(); |
<|file_name|>csv.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 the Apache... | |
<|file_name|>utils.go<|end_file_name|><|fim▁begin|>package configor
import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"os"
"path"
"reflect"
"strings"
"github.com/BurntSushi/toml"
yaml "gopkg.in/yaml.v2"
)
func (configor *Configor) getENVPrefix(config interface{}) string {
if configor.Config.ENVPrefix ==... | if example, err := getConfigurationFileWithENVPrefix(file, "example"); err == nil {
fmt.Printf("Failed to find configuration %v, using example file %v\n", file, example)
results = append(results, example)
} else { |
<|file_name|>packet.go<|end_file_name|><|fim▁begin|>// Copyright 2011 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 packet implements parsing and serialization of OpenPGP packets, as
// specified in RFC 4880.
pack... | buf[1] = byte(length)
n = 2
} else if length < 8384 {
length -= 192 |
<|file_name|>test27_sticker.py<|end_file_name|><|fim▁begin|>import sys
import time
from pprint import pprint
import telepot
from telepot.namedtuple import StickerSet
TOKEN = sys.argv[1]
USER_ID = long(sys.argv[2])
STICKER_SET = sys.argv[3]
bot = telepot.Bot(TOKEN)
<|fim▁hole|>f = bot.uploadStickerFile(USER_ID, open('... | |
<|file_name|>title.service.ts<|end_file_name|><|fim▁begin|>import { Inject, Injectable, Injector } from '@angular/core';
import { DOCUMENT, Title } from '@angular/platform-browser';
import { ActivatedRoute, Router } from '@angular/router';
import { MenuService } from '../menu/menu.service';
/* tslint:disable */
/**
* ... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: UTF-8 -*-
# Pluma External Tools plugin
# Copyright (C) 2005-2006 Steve Frécinaux <steve@istique.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publis... | None)])
manager.insert_action_group(self._action_group, -1)
ui_string = """ |
<|file_name|>shift.py<|end_file_name|><|fim▁begin|>import numpy
from chainer.backends import cuda
from chainer import function_node
from chainer.utils import type_check
def _pair(x):
if hasattr(x, '__getitem__'):
return x
return x, x
class Shift(function_node.FunctionNode):
def __init__(self, ... | py = self.kh // 2 * abs(self.dy)
px = self.kw // 2 * abs(self.dx)
x = numpy.pad(x, ((0, 0), (0, 0), (py, py), (px, px)), |
<|file_name|>button.rs<|end_file_name|><|fim▁begin|>//! Easy use of buttons.
use peripheral;
/// The user button.
pub static BUTTONS: [Button; 1] = [Button { i: 0 }];
/// A single button.
pub struct Button {
i: u8,
}
impl Button {
/// Read the state of the button.
pub fn pressed(&self) -> bool {
... | /// Initializes the necessary stuff to enable the button.
///
/// # Safety |
<|file_name|>platform-service.ts<|end_file_name|><|fim▁begin|>///<reference path="../.d.ts"/>
"use strict";
import path = require("path");
import shell = require("shelljs");
import util = require("util");
import constants = require("./../constants");
import helpers = require("./../common/helpers");
import semver = req... | this.$fs.deleteFile(fileToDelete).wait();
});
|
<|file_name|>plotit.py<|end_file_name|><|fim▁begin|>import numpy as np
import os
import sys
import os.path as op
import matplotlib as mpl
import mpl.pyplot as plt
import palettable.colorbrewer as pal
from datetime import datetime
from cycler import cycler
#plt.rc('axes', prop_cycle=cycler('color', pal.qualitative.Dark... | fig.tight_layout(pad=0.2, w_pad=0.75, h_pad=1.5)
fig.subplots_adjust(bottom=0.08, right=0.92, top=0.92)
plotfile = op.join(thispath,"heatComplete.pdf")
ax2.set_xlim([heat[0,0],heat[-1,0]]) |
<|file_name|>main.py<|end_file_name|><|fim▁begin|># Copyright 2017 Google 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/licenses/LICENSE-2.0
#
# Unless re... | }
}
}
] |
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
<|fim▁hole|><|fim▁end|> | from reports.accidents.models import * |
<|file_name|>JsonPathMessageConstructionInterceptor.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2006-2015 the original author or 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 Licens... | import com.consol.citrus.context.TestContext; |
<|file_name|>validate.go<|end_file_name|><|fim▁begin|>package cpf
import (
"errors"
"strconv"
"strings"
)
// Valid validates the cpf and return a boolean and the error if any
func Valid(digits string) (bool, error) {
return valid(digits)
}
func sanitize(data string) string {
data = strings.Replace(data, ".", ""... | if len(data) != 11 {
return false, errors.New("Invalid length")
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.