prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>mobile.js<|end_file_name|><|fim▁begin|>// +------------------------------------------------------------------+
// | ____ _ _ __ __ _ __ |
// | / ___| |__ ___ ___| | __ | \/ | |/ / |
// | | | | '_ \ / _ \/ __| |/ / | |\/|... | // in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
// out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
// PARTICULAR PURPOSE. See the GNU General Public License for more de-
// ails. You should have received a copy of the GNU General Public |
<|file_name|>IncorrectMoveFormatException.java<|end_file_name|><|fim▁begin|>package soliddomino.game.exceptions;
<|fim▁hole|>public class IncorrectMoveFormatException extends Exception {
public IncorrectMoveFormatException(String format) {
super(format + " is not the correct format. Expected \'#number-dire... | |
<|file_name|>GameMode.py<|end_file_name|><|fim▁begin|>from python_cowbull_server import error_handler
from flask_helpers.check_kwargs import check_kwargs
class GameMode(object):
"""
A representation of a game mode (complexity, number of digits, guesses allowed, etc.). The
mode contains the following inform... | |
<|file_name|>test_large_block_blob.py<|end_file_name|><|fim▁begin|># coding: utf-8
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# -... | self.assertIsNot(len(block_list), 0)
self.assertBlobEqual(self.container_name, blob_name, data) |
<|file_name|>wrapping_mul.rs<|end_file_name|><|fim▁begin|>use num::arithmetic::traits::{WrappingMul, WrappingMulAssign};
macro_rules! impl_wrapping_mul {
($t:ident) => {
impl WrappingMul<$t> for $t {
type Output = $t;
#[inline]
fn wrapping_mul(self, other: $t) -> $t {
... | |
<|file_name|>0007_remove_organisation_type.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2019-02-04 16:09
from __future__ import unicode_literals
from django.db import migrations
<|fim▁hole|>
dependencies = [
('meinberlin_organisations', '0006_update_orga_type_st... | class Migration(migrations.Migration): |
<|file_name|>actionButtons.tsx<|end_file_name|><|fim▁begin|>import * as React from 'react';
import { FlatButton } from 'material-ui';
import Styling from "../../components/job-form/jobTheme";
export default class FotgetActionButton extends React.Component<any, any>{
render() {
return (
<div cl... | <FlatButton label="Send"
className="continue-btn hovered-class"
labelPosition="before"
primary={true} |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*-
################################################################################
# #<|fim▁hole|># it under the terms of the GNU Affero General Public License as pu... | # Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol #
# #
# This program is free software: you can redistribute it and/or modify # |
<|file_name|>registers.rs<|end_file_name|><|fim▁begin|>// *****************************************************************************
//
// lm4f120h5qr.h - LM4F120H5QR Register Definitions
//
// Copyright (c) 2011-2012 Texas Instruments Incorporated. All rights reserved.
// Software License Agreement
//
// Redistr... | pub const ADC_DCCMP7_COMP1_S: usize = 16;
pub const ADC_DCCMP7_COMP0_S: usize = 0;
|
<|file_name|>GPUVerify.py<|end_file_name|><|fim▁begin|># vim: set sw=2 ts=2 softtabstop=2 expandtab:
from . RunnerBase import RunnerBaseClass
from .. Analysers.GPUVerify import GPUVerifyAnalyser
import logging
import os
import psutil
import re
import sys
import yaml
_logger = logging.getLogger(__name__)
class GPUVeri... | # We use GPUVerify's timeout function and enforce the
# requested timeout and enforce a hard timeout slightly later
self.maxTimeInSeconds = self.maxTimeInSeconds + self.softTimeoutDiff
|
<|file_name|>app.tsx<|end_file_name|><|fim▁begin|>import * as React from 'react'
import { observer } from 'mobx-react'
const DevTools = require('mobx-react-devtools').default
@observer
class App extends React.Component<any, any> {
render() {
return (
<div>
<div>{this.props.appState.count}</div>
... | } |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|># Core Django imports
from django.contrib import admin
<|fim▁hole|>from mantises.models import Mantis, Breed, Molt
class MantisAdmin(VersionAdmin):
list_display = ('__str__',)
def save_model(self, request, obj, form, change):
obj.user = request.user
... | # Third party app imports
from reversion import VersionAdmin
# Local app imports |
<|file_name|>authz-controller.js<|end_file_name|><|fim▁begin|>module.controller('ResourceServerCtrl', function($scope, realm, ResourceServer) {
$scope.realm = realm;
ResourceServer.query({realm : realm.realm}, function (data) {
$scope.servers = data;
});
});
module.controller('ResourceServerDetail... | $scope.selectedRoles = []; |
<|file_name|>base.py<|end_file_name|><|fim▁begin|>from marshmallow import EXCLUDE, Schema<|fim▁hole|>from ..fields.objectid import ID
class BaseSchema(Schema):
id = ID(description='ID', dump_only=True)
class Meta:
strict = True
ordered = True
unknown = EXCLUDE<|fim▁end|> | |
<|file_name|>server.js<|end_file_name|><|fim▁begin|>var express = require("express");
var Pusher = require("pusher");
var bodyParser = require("body-parser");
var env = require("node-env-file");
var app = express();
app.use(bodyParser.urlencoded());
try {
env(__dirname + "/.env");
} catch (_error) {
error = _err... | }
var pusher = new Pusher({ |
<|file_name|>createTestEnvQuery.graphql.ts<|end_file_name|><|fim▁begin|>/* tslint:disable */
/* eslint-disable */
import { ConcreteRequest } from "relay-runtime";
import { FragmentRefs } from "relay-runtime";
export type createTestEnvQueryVariables = {};
export type createTestEnvQueryResponse = {
readonly artwork:... | }
} |
<|file_name|>listener.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# This file is part of pulseaudio-dlna.
# pulseaudio-dlna 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 Licen... | if len(lines) > 0 and self._is_notify_method(lines[0]):
self.server.renderers_holder.process_notify_request(packet)
|
<|file_name|>hook-paste.exceptions.reporter.py<|end_file_name|><|fim▁begin|># some modules use the old-style import: explicitly include <|fim▁hole|><|fim▁end|> | # the new module when the old one is referenced
hiddenimports = ["email.mime.text", "email.mime.multipart"] |
<|file_name|>basic.rs<|end_file_name|><|fim▁begin|>#[macro_use] extern crate bart_derive;
#[test]
fn it_works() {
#[derive(BartDisplay)]
#[template_string="Hello, {{name}}"]
struct Test { name: String }
assert_eq!(
"Hello, World",
Test { name: "World".to_owned() }.to_string()
);
}
... | "Hello, World",
Test(Nested { name: "World" }).to_string()
); |
<|file_name|>scatteringTools.py<|end_file_name|><|fim▁begin|>#
# Copyright 2015 VTT Technical Research Center of Finland
#
# 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... | '''
print('Weight fraction is %.1f %%' % (weight_frac * 100)) |
<|file_name|>dark_mode.rs<|end_file_name|><|fim▁begin|>/// This is a simple implementation of support for Windows Dark Mode,
/// which is inspired by the solution in https://github.com/ysc3839/win32-darkmode
use std::ffi::OsStr;
use std::os::windows::ffi::OsStrExt;
use winapi::{
shared::{
basetsd::SIZE_T,
... | dwPlatformId: ULONG,
szCSDVersion: [WCHAR; 128],
} |
<|file_name|>serve.go<|end_file_name|><|fim▁begin|>// Copyright 2017 Monax Industries Limited
//
// 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/LICEN... | } |
<|file_name|>neutron.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
'''
Module for handling openstack neutron calls.
:maintainer: <akilesh1597@gmail.com>
:maturity: new
:platform: all
:optdepends: - neutronclient Python adapter
:configuration: This module is not usable until the following are specified
... | delete a floating IP
|
<|file_name|>InstrumentSelector.js<|end_file_name|><|fim▁begin|>function InstrumentSelector(list) {
this.instruments = list;
this.currentInstrument;
this.updateInstrumentView();
}
InstrumentSelector.prototype.addInstrument = function (type, url, colorCode) {
var l = this.instruments.push(new Instrument(type, url,... | for (var a=0; a<len; a++) {
bar.removeChild(bar.children[a]);
} |
<|file_name|>actual.js<|end_file_name|><|fim▁begin|><|fim▁hole|>export default (...modifiers): Array<string> => {};<|fim▁end|> | |
<|file_name|>filter_news.py<|end_file_name|><|fim▁begin|>"""Generate year files with news counts
Usage:
filter_news.py <directory> <output> <lang>
Options:
-h, --help
"""
from docopt import docopt
from os import listdir
from os.path import isfile, join, getsize
import datetime
from tqdm import *
import pandas... | else:
number = str(i)
df_index.append(number)
|
<|file_name|>test_studies.py<|end_file_name|><|fim▁begin|>"""Test study generator."""
from typing import Collection
from vizier.pyvizier import pythia as vz
def flat_space_with_all_types() -> vz.SearchSpace:
"""Search space with all parameter types."""
space = vz.SearchSpace()
root = space.select_root()
roo... | |
<|file_name|>mainwindow.py<|end_file_name|><|fim▁begin|>#! python3
"""
GUI for Ultrasonic Temperature Controller
Copyright (c) 2015 by Stefan Lehmann
"""
import os
import datetime
import logging
import json
import serial
from qtpy.QtWidgets import QAction, QDialog, QMainWindow, QMessageBox, \
QDockWidge... | self._connected = True
self.objectexplorer.refresh()
|
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import React from 'react';
import ReactDOM from 'react-dom';
import ReactDOMServer from 'react-dom/server';
import { Router, RouterContext, match, browserHistory, createMemoryHistory } from 'react-router';
import HtmlBase from './pages/html-base';
import routes from '.... | // entire page rendering |
<|file_name|>Base64StringAdapter.java<|end_file_name|><|fim▁begin|>/**
* Copyright Microsoft Corporation
*
* 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/license... | *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, |
<|file_name|>front.js<|end_file_name|><|fim▁begin|>var wocs_loading_first_time = true;//simply flag var
jQuery(function () {
if (woocs_drop_down_view == 'chosen') {
try {
if (jQuery("select.woocommerce-currency-switcher").length) {
jQuery("select.woocommerce-currency-switcher").... | |
<|file_name|>build_gecko.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/. */
mod common {
use std::{env, fs, io};
use std::pat... |
trait BuilderExt {
fn get_initial_builder() -> Builder; |
<|file_name|>run_tests.py<|end_file_name|><|fim▁begin|># Copyright (c) 2012 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 logging
import os
import sys
import unittest
from telemetry.core import browser_options
fro... | if options_for_unittests.GetBrowserType() not in types:
logging.debug('Skipping test %s because it requires %s' %
(test.id(), types))
return False |
<|file_name|>threaded.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 Apa... | |
<|file_name|>tacticattacker.cpp<|end_file_name|><|fim▁begin|>#include "tacticattacker.h"
TacticAttacker::TacticAttacker(WorldModel *worldmodel, QObject *parent) :
Tactic("TacticAttacker", worldmodel, parent)
{
everyOneInTheirPos = false;
maxDistance = sqrt(pow(Field::MaxX*2,2)+pow(Field::MaxY*2,2))... | |
<|file_name|>test_tensor.py<|end_file_name|><|fim▁begin|># ----------------------------------------------------------------------------
# Copyright 2015 Nervana Systems Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obt... | |
<|file_name|>blocktools.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# Copyright (c) 2015-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Utilities for manipulating blocks and transacti... | tx.vin.append(CTxIn(COutPoint(prevtx.sha256, n), script_sig, 0xffffffff))
tx.vout.append(CTxOut(amount, script_pub_key))
tx.calc_sha256()
return tx |
<|file_name|>issue-826-generating-methods-when-asked-not-to.rs<|end_file_name|><|fim▁begin|>#![allow(
dead_code,
non_snake_case,<|fim▁hole|> non_upper_case_globals
)]
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct Foo {
pub _address: u8,
}
#[test]
fn bindgen_test_layout_Foo() {
assert_... | non_camel_case_types, |
<|file_name|>app.module.ts<|end_file_name|><|fim▁begin|>import {NgModule} from '@angular/core';
import {BrowserModule} from '@angular/platform-browser';
import {GridModule} from "./library/grid.module";
import {AppComponent} from './app.component';
import {BlueDynamicComponent} from "./blue-dynamic.component";
im... | RedDynamicComponent
], |
<|file_name|>backendstree.py<|end_file_name|><|fim▁begin|># -----------------------------------------------------------------------------
# Getting Things GNOME! - a personal organizer for the GNOME desktop
# Copyright (c) 2008-2013 - Lionel Dricot & Bertrand Rousseau
#
# This program is free software: you can redistri... | if backend_id in self.backendid_to_iter:
self.liststore.remove(self.backendid_to_iter[backend_id]) |
<|file_name|>print-tree-actions.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The html5ever Project Developers. See the
// COPYRIGHT file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT... | |
<|file_name|>test_datasets.py<|end_file_name|><|fim▁begin|>#from spectrum import datasets
from spectrum.datasets import *
def test_marple_data():<|fim▁hole|>def test_timeseries():
data = data_cosine(N=1024, A=0.1, sampling=1024, freq=200)
ts = TimeSeries(data, sampling=1)
#assert ts.N == 1024
#assert t... | d = marple_data
assert len(d) == 64
|
<|file_name|>PrayImpl.java<|end_file_name|><|fim▁begin|>/**
*/
package net.paissad.waqtsalat.core.impl;
import java.util.Calendar;
import net.paissad.waqtsalat.core.WaqtSalatPackage;
import net.paissad.waqtsalat.core.api.Pray;
import net.paissad.waqtsalat.core.api.PrayName;
import org.eclipse.emf.common.notify.Notifi... | */
public PrayName getName() {
return name; |
<|file_name|>history.py<|end_file_name|><|fim▁begin|>import collections
import functools
import re
import wrappers
class History(object):
"""
Tracking of operations provenance.
>>> h = History("some_op")
>>> print str(h)
some_op()
>>> h.add_args(["w1", "w2"])
>>> print str(h)
some_op... | |
<|file_name|>config.py<|end_file_name|><|fim▁begin|>import logging
import warnings
from collections import namedtuple<|fim▁hole|>
Field = namedtuple('Field', ('name', 'type_', 'default', 'desc', 'warn'))
class Config:
"""配置模块
用户可以在 rc 文件中配置各个选项的值
"""
def __init__(self):
object.__setattr__(s... |
logger = logging.getLogger(__name__) |
<|file_name|>background_extractor.cpp<|end_file_name|><|fim▁begin|>#include "background_extractor.h"
namespace TooManyPeeps {
BackgroundExtractor::BackgroundExtractor(const cv::Mat& original, cv::Mat& result,
int historySize, double threshold)
: ProcessFilter(original, result) {
backgroundExtractor = c... |
}; |
<|file_name|>embed_countries.js<|end_file_name|><|fim▁begin|>//= require d3/d3
//= require jquery.qtip.min
//= require simple_statistics
gfw.ui.model.CountriesEmbedOverview = cdb.core.Model.extend({
defaults: {
graph: 'total_loss',
years: true,
class: null
}
});
gfw.ui.view.CountriesEmbedOverview = c... | |
<|file_name|>LSOCK_CODgram.cpp<|end_file_name|><|fim▁begin|>// $Id: LSOCK_CODgram.cpp 79134 2007-07-31 18:23:50Z johnnyw $
#include "ace/LSOCK_CODgram.h"
#if !defined (ACE_LACKS_UNIX_DOMAIN_SOCKETS)
#include "ace/Log_Msg.h"
ACE_RCSID(ace, LSOCK_CODgram, "$Id: LSOCK_CODgram.cpp 79134 2007-07-31 18:23:50Z johnn... | int protocol_family,
int protocol)
{
ACE_TRACE ("ACE_LSOCK_CODgram::ACE_LSOCK_CODgram");
|
<|file_name|>resources.py<|end_file_name|><|fim▁begin|># Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | SUBNET = 'subnet' |
<|file_name|>coursier_fetch_integration_test.py<|end_file_name|><|fim▁begin|># Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
import pytest
from pants.core.util_rules import config_files, source_files... | ResolvedClasspathEntry,
) |
<|file_name|>textures.py<|end_file_name|><|fim▁begin|># This file is part of the Minecraft Overviewer.
#
# Minecraft Overviewer 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 t... | # first rotations |
<|file_name|>DataSourceProperties.java<|end_file_name|><|fim▁begin|>package com.zts.service.config;
import org.springframework.boot.context.properties.ConfigurationProperties;
@ConfigurationProperties(prefix = DataSourceProperties.DS, ignoreUnknownFields = false)
public class DataSourceProperties {
//对应配置文件里的配置键
p... | this.testOnReturn = testOnReturn;
}
private boolean testOnBorrow = false; |
<|file_name|>cookie_reader.py<|end_file_name|><|fim▁begin|>########################################################################################################################
#
# cookie_reader.py
#
# Purpose: read cookies from the web browser (currently only Chrome supported) and make them into Python objects
#
# ... | #
######################################################################################################################## |
<|file_name|>gandi.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 the Apache Licen... | available_res = account['resources']['available']
|
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from datetime import datetime
from django.db import models
from uuidfield.fields import UUIDField
from access import acl
import amo.models
from translations.fields import save_signal
from mkt.constants import comm as const
class CommunicationPermissionModel(amo.... | |
<|file_name|>location_strategy.ts<|end_file_name|><|fim▁begin|>import {CONST_EXPR} from 'angular2/src/facade/lang';
import {OpaqueToken} from 'angular2/core';
import {UrlChangeListener} from './platform_location';
/**
* `LocationStrategy` is responsible for representing and reading route state
* from the browser's U... | * ]); |
<|file_name|>run.test.ts<|end_file_name|><|fim▁begin|>import htmlKeyboardResponse from "@jspsych/plugin-html-keyboard-response";
import { flushPromises, startTimeline } from "../utils";<|fim▁hole|> document.body.innerHTML = "";
});
function setReadyState(targetState: "loading" | "complete") {
jest.spyOn(do... |
describe("jsPsych.run()", () => {
beforeEach(() => { |
<|file_name|>blockmanager.go<|end_file_name|><|fim▁begin|>package miner
import (
"crypto/rand"
"errors"
"time"
"github.com/NebulousLabs/Sia/crypto"
"github.com/NebulousLabs/Sia/modules"
"github.com/NebulousLabs/Sia/types"
)
var (
errLateHeader = errors.New("header is old, block could not be recovered")
)
// ... | delete(m.blockMem, m.headerMem[m.memProgress])
delete(m.arbDataMem, m.headerMem[m.memProgress])
m.blockMem[header] = m.sourceBlock |
<|file_name|>window.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 devtools_traits::{ScriptToDevtoolsControlMsg, TimelineMark... |
impl Window {
pub fn new(runtime: Rc<Runtime>, |
<|file_name|>drivertasks.py<|end_file_name|><|fim▁begin|># Copyright 2014, Red Hat, 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... |
import logging
import threading |
<|file_name|>xdamage.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#
# examples/xdamage.py -- demonstrate damage extension
#
# Copyright (C) 2019 Mohit Garg <mrmohitgarg1990@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public L... | flags=(Xutil.PPosition | Xutil.PSize | Xutil.PMinSize),
min_width=50,
min_height=50 |
<|file_name|>browser.js<|end_file_name|><|fim▁begin|>'use strict';
var eachAsync = require('each-async');
var onetime = require('onetime');
var arrify = require('arrify');<|fim▁hole|>
eachAsync(arrify(hostnames), function (hostname, i, next) {
var img = new Image();
img.onload = function () {
cb(true);
// ... |
module.exports = function (hostnames, cb) {
cb = onetime(cb); |
<|file_name|>Element_scroll.js<|end_file_name|><|fim▁begin|>describe("Ext.dom.Element_scroll", function() {
var el;
afterEach(function(){
Ext.destroy(el);
el = null;
});
function expectLeft(left) {
expect(el.dom.scrollLeft).toBe(left);
}
functi... | expectTop(125); |
<|file_name|>isa_traits.hh<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2003-2005 The Regents of The University of Michigan
* Copyright (c) 2007-2008 The Florida State University
* Copyright (c) 2009 The University of Edinburgh
* All rights reserved.
*
* Redistribution and use in source and binary forms, with ... |
const Addr PageShift = 12;
const Addr PageBytes = ULL(1) << PageShift; |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// The MIT License (MIT)
// Copyright (c) 2015 Y. T. Chung <zonyitoo@gmail.com>
// 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 withou... | |
<|file_name|>note.js<|end_file_name|><|fim▁begin|>/*
***** BEGIN LICENSE BLOCK *****
Copyright © 2009 Center for History and New Media
George Mason University, Fairfax, Virginia, USA
http://zotero.org
This file is part of Zotero.
Zotero is free so... | noteEditor.collection = Zotero.Collections.get(collectionID);
}
}
noteEditor.refresh(); |
<|file_name|>alua.py<|end_file_name|><|fim▁begin|>'''
Implements the RTS ALUA Target Port Group class.
This file is part of RTSLib.
Copyright (c) 2016 by Red Hat, 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... | path = "%s/alua_support_transitioning" % self.path
return int(fread(path))
def _set_alua_support_transitioning(self, enabled): |
<|file_name|>windowmanager.py<|end_file_name|><|fim▁begin|>from types import *
from robot import utils
from selenium.webdriver.remote.webdriver import WebDriver
from selenium.common.exceptions import NoSuchWindowException
class WindowManager(object):
def __init__(self):
self._strategies = {
't... | self._select_by_last_index(browser)
return
(prefix, criteria) = self._parse_locator(locator) |
<|file_name|>sensor.py<|end_file_name|><|fim▁begin|>"""Component to make instant statistics about your history."""
import datetime
import logging
import math
import voluptuous as vol
from homeassistant.components import history
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const impor... | |
<|file_name|>uconf.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
from __future__ import absolute_import, division, print_function
import sys
import os
import codecs
import collections
import io
import re
# Define an isstr() and isint() that work on both Python2 and Python3.
# See http://stackoverflow.com/questio... | |
<|file_name|>nuimo_controller.py<|end_file_name|><|fim▁begin|>"""
Component that connects to a Nuimo device over Bluetooth LE.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/nuimo_controller/
"""
import logging
import threading
import time
import volupt... | EVENT_NUIMO = 'nuimo_input'
DEFAULT_NAME = 'None'
|
<|file_name|>containers.py<|end_file_name|><|fim▁begin|>''' Provide special versions of list and dict, that can automatically notify
about changes when used for property values.
Mutations to these values are detected, and the properties owning the
collection is notified of the changes. Consider the following model
def... | |
<|file_name|>directory.rs<|end_file_name|><|fim▁begin|>// Copyright 2022 Pants project contributors (see CONTRIBUTORS.md).
// Licensed under the Apache License, Version 2.0 (see LICENSE).
use std::collections::HashMap;
use std::fmt::{self, Debug};
use std::hash::{self, Hash};
use std::ops::Deref;
use std::path::{Path,... | // whether these types can be merged. |
<|file_name|>issue-4312.rs<|end_file_name|><|fim▁begin|>// issue 4312
fn main() {
/* " */
println!("Hello, world!");
/* abc " */
println!("Hello, world!");
/* " abc */
println!("Hello, world!");
let y = 4;
let x = match 1 + y == 3 {
True => 3,
False => 4,
/* " unr... | };
} |
<|file_name|>triangle.rs<|end_file_name|><|fim▁begin|>extern mod gl;
extern mod glfw;
extern mod sgl;
use sgl::vertex_buffer::*;
use sgl::vertex_array::*;
use sgl::shader::*;
use sgl::shader_program::*;
#[start]
fn start(argc: int, argv: **u8, crate_map: *u8) -> int {
// Run GLFW on the main thread
std::rt::st... | let vertex_source = std::io::read_whole_file_str(&std::path::Path("triangle.vs")).unwrap();
let fragment_source = std::io::read_whole_file_str(&std::path::Path("triangle.fs")).unwrap();
// Create and compile the vertex shader |
<|file_name|>itrial.py<|end_file_name|><|fim▁begin|># Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Interfaces for Trial.
Maintainer: Jonathan Lange
"""
from __future__ import division, absolute_import
import zope.interface as zi
from zope.interface import Attribute
class ITestCase(zi.... | |
<|file_name|>app.component.ts<|end_file_name|><|fim▁begin|>import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html'
})
export class AppComponent {
source: any =
{
localdata: [
['Alfreds Futterkiste', 'Maria Anders', 'Sales R... | ['Bon app', 'Laurence Lebihan', 'Owner', '12, rue des Bouchers', 'Marseille', 'France'], |
<|file_name|>felfdip.js<|end_file_name|><|fim▁begin|>//A container for data pertaining to the local card game state. Defines the decks stored locally as well as the local player data.
class CardSystem {
constructor() {
this.deck = [random_deck()]; //Plan on having multiple decks available
this.playe... | |
<|file_name|>list.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file ... | // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at |
<|file_name|>tfuncs.py<|end_file_name|><|fim▁begin|><|fim▁hole|>testdir = os.path.dirname(__file__)
test_tempdir = os.path.join(os.path.abspath(testdir), 'tmp')
unwriteable = os.path.join(os.path.abspath(testdir), 'unwriteable')
def setup():
if not os.path.exists(test_tempdir):
os.system('mkdir -p %s' % te... | import pybedtools
import os
|
<|file_name|>try_init.rs<|end_file_name|><|fim▁begin|>use guifast_shared::action::Command;
use guifast_shared::error::*;
use guifast_shared::string;
use libflo_action_std::{ ACTION_MAPPER, parse_fn, ParseMap, PARSE_MAP };
use libflo_std::LIBFLO;
use serde_json;
pub unsafe fn try_init() -> Result<()> {
if ACTION_MA... | )?;
PARSE_MAP.set(parser)?;
} |
<|file_name|>04transforms_test.go<|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 ... | ptest.RunAndValidate(t, p)
} |
<|file_name|>ui_maya_dock.py<|end_file_name|><|fim▁begin|># module General Ui
# file ui_maya_dock.py
# Main Dock Window interface
from thlib.side.Qt import QtWidgets as QtGui
#from thlib.side.Qt import QtCore
from thlib.environment import env_inst, env_mode, env_read_config, env_write_config
import thlib.maya_function... | main_tab.show()
main_tab.raise_() |
<|file_name|>videotracklist.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 https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::cell::DomRefCell;
use crate... | fn SelectedIndex(&self) -> i32 {
if let Some(idx) = self.selected_index() {
return idx as i32; |
<|file_name|>HttpRequestExecutor.hpp<|end_file_name|><|fim▁begin|>/*================================================================================
code generated by: java2cpp
author: Zoran Angelov, mailto://baldzar@gmail.com
class: org.apache.http.protocol.HttpRequestExecutor
===============================... | : object<HttpRequestExecutor>(jobj)
{
}
|
<|file_name|>service.go<|end_file_name|><|fim▁begin|>package service
import (
gofig "github.com/akutz/gofig/types"
"github.com/thecodeteam/rexray/libstorage/api/registry"
"github.com/thecodeteam/rexray/libstorage/api/server/handlers"
"github.com/thecodeteam/rexray/libstorage/api/server/httputils"
"github.com/the... | "serviceInspect",
"/services/{service}", |
<|file_name|>untar.go<|end_file_name|><|fim▁begin|>package gonfler
import (
"archive/tar"<|fim▁hole|>type TarArchive struct {
handle *tar.Reader
file *os.File
}
func (archive TarArchive) Close() error {
return archive.file.Close()
}
func (archive TarArchive) Volumes() VolumeIterator {
var next func() VolumeIt... | "os"
)
|
<|file_name|>method.cc<|end_file_name|><|fim▁begin|>#include "util/mapper.h"
#include "method.h"
namespace frost {
cstr_map_t<http_method> http_method_assist::_desc;
// frost::unordered_map<std::string, http_method> http_method_assist::_desc<|fim▁hole|> // ("OPTIONS", http_method::OPTIONS)
... | // = mapper<std::string, http_method>() |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>__all__ = ["wordlists", "roles", "bnc", "processes", "verbs",
"uktous", "tagtoclass", "queries", "mergetags"]
from corpkit.dictionaries.bnc import _get_bnc
from corpkit.dictionaries.process_types import processes
from corpkit.dictionaries.process_types ... | |
<|file_name|>ConstructionHeuristicPickEarlyType.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2010 JBoss 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.apac... |
package org.optaplanner.core.impl.constructionheuristic.greedyFit.decider;
|
<|file_name|>main.js<|end_file_name|><|fim▁begin|>/**
* main.js: The entry point for MuTube.
* Plays the role of the 'main process' in Electron.
*/
// define constants from various packages for the main process
const {
app,
BrowserWindow,
ipcMain
} = require('electron');
let mainWindow;
// execute the... | width: 600,
height: 600,
minWidth: 600, |
<|file_name|>workspace.rs<|end_file_name|><|fim▁begin|>use crate::config::GeneralConfig;
use crate::core::stack::Stack;
use crate::layout::{Layout, LayoutMessage};
use crate::window_system::{Window, WindowSystem};
/// Represents a single workspace with a `tag` (name),
/// `id`, a `layout` and a `stack` for all windows... | id,
tag,
layout,
stack, |
<|file_name|>DefaultAnimations.java<|end_file_name|><|fim▁begin|>package com.github.daneko.simpleitemanimator;
import android.support.v4.view.ViewCompat;
import android.support.v4.view.ViewPropertyAnimatorCompat;
import android.view.View;
import fj.F;
import fj.F2;
import fj.F3;
import fj.Unit;
import fj.data.Option;... | }
final int deltaX = |
<|file_name|>sweetalert2.d.ts<|end_file_name|><|fim▁begin|>declare module 'sweetalert2' {
/**
* Shorthand function to display a simple SweetAlert modal.
*
* ex.
* import swal from 'sweetalert2';
* swal('The Internet?', 'That thing is still around?', 'question');
*/
function swa... | /**
* A custom CSS class for the input field.
*
* @default null |
<|file_name|>server.js<|end_file_name|><|fim▁begin|>var os = require('os');
var fs = require('fs');
var path = require('path');
var SerialPort = require("serialport");
//Default configuration
var config = {
spm: { }, //Serial port manager
cli: true, //Command line interface
port: 5147,
mode: "http", //HTTP ser... | var clientPath = path.join(__dirname, "node_modules", "remote-serial-port-client", "lib"); |
<|file_name|>virer.py<|end_file_name|><|fim▁begin|># -*-coding:Utf-8 -*
# Copyright (c) 2013 LE GOFF Vincent
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code m... | return |
<|file_name|>ProxyServiceProjectFieldController.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2011, WSO2 Inc. (http://www.wso2.org) 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 ... | } |
<|file_name|>authentication.js<|end_file_name|><|fim▁begin|>/* eslint-disable camelcase */
import {Response} from 'ember-cli-mirage';
import {isBlank} from 'ember-utils';
import $ from 'jquery';
export default function mockAuthentication(server) {
server.post('/authentication/token', function ({roles, users}, {req... | |
<|file_name|>kms.rs<|end_file_name|><|fim▁begin|>// Copyright 2021 TiKV Project Authors. Licensed under Apache-2.0.
use async_trait::async_trait;
use crate::error::{Error, KmsError, Result};
use derive_more::Deref;
use kvproto::encryptionpb::MasterKeyKms;
#[derive(Debug, Clone)]
pub struct Location {
pub region:... | |
<|file_name|>ReplicaSyncupReader.java<|end_file_name|><|fim▁begin|>/*-
* See the file LICENSE for redistribution information.
*
* Copyright (c) 2002-2010 Oracle. All rights reserved.
*
* $Id: ReplicaSyncupReader.java,v 1.4 2010/01/11 20:00:48 linda Exp $
*/
package com.sleepycat.je.rep.stream;
import static com... | byte currentType = currentEntryHeader.getType();
/* |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.