prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>universal.py<|end_file_name|><|fim▁begin|># $Id$
# -*- coding: utf8 -*-
# Authors: David Goodger <goodger@python.org>; Ueli Schlaepfer; Günter Milde
# Maintainer: docutils-develop@lists.sourceforge.net
# Copyright: This module has been placed in the public domain.
"""
Transforms needed by most or all docu... | """
Expose internal attributes if ``expose_internals`` setting is set.
""" |
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>import unittest
from app import read_config
<|fim▁hole|> self.assertEqual(config['cmus_passwd'], 'PaSsWd')
self.assertEqual(config['app_host'], 'localhost')
self.assertEqual(config['app_port'], '8080')
if __name__ == '__main__':
unittest.ma... | class ConfigFileReaderTest(unittest.TestCase):
def test_read(self):
config = read_config('config')
self.assertEqual(config['cmus_host'], 'raspberry') |
<|file_name|>xrenderer.d.ts<|end_file_name|><|fim▁begin|>declare module "core/src/pointer/src/ByteArrayBase" {
export class ByteArrayBase {
static BIG_ENDIAN: string;
static LITTLE_ENDIAN: string;
static SIZE_OF_BOOLEAN: number;
static SIZE_OF_INT8: number;
static SIZE_OF_INT... | static PointLight: string;
static Mesh: string;
static Group: string; |
<|file_name|>Show next instance.py<|end_file_name|><|fim▁begin|>#MenuTitle: Show next instance
# -*- coding: utf-8 -*-
__doc__="""
Jumps to next instance shown in the preview field of the current Edit tab.
"""
import GlyphsApp
<|fim▁hole|>Doc = Glyphs.currentDocument
numberOfInstances = len( Glyphs.font.instances )
t... | |
<|file_name|>buffer_pool.go<|end_file_name|><|fim▁begin|>package quic
import (
"sync"
"github.com/lucas-clemente/quic-go/internal/protocol"
)
type packetBuffer struct {
Data []byte
// refCount counts how many packets Data is used in.
// It doesn't support concurrent use.
// It is > 1 when used for coalesced p... |
// Decrement decrements the reference counter.
// It doesn't put the buffer back into the pool. |
<|file_name|>editaddressdialog.cpp<|end_file_name|><|fim▁begin|>#include "editaddressdialog.h"
#include "ui_editaddressdialog.h"
#include "addresstablemodel.h"
#include "guiutil.h"
#include <QDataWidgetMapper>
#include <QMessageBox>
EditAddressDialog::EditAddressDialog(Mode mode, QWidget *parent) :
QDialog(parent... | { |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>pub mod linsol;<|fim▁hole|><|fim▁end|> |
#[cfg(test)]
mod tests; |
<|file_name|>blog.js<|end_file_name|><|fim▁begin|>import React from "react";
import {graphql} from "gatsby";
import "../styles/main.scss";
<|fim▁hole|>import BlogListing from "../components/blog-post-listing";
import PageFooter from "../components/footer";
class BlogListPage extends React.Component {
render() {
... | import BlogIndexCover from "../assets/images/blog_covers/blog_index_cover.jpeg";
import CompactHeader from "../components/compact-header"; |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>var path = require('path');
var fs = require('fs');
var Writer = require('broccoli-writer');
var Handlebars = require('handlebars');
var walkSync = require('walk-sync');
var RSVP = require('rsvp');
var helpers = require('broccoli-kitchen-si... |
var EXTENSIONS_REGEX = new RegExp('.(hbs|handlebars)'); |
<|file_name|>language.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2011 Nicolas Wack <wackou@gmail.com>
#
# GuessIt is free software; you can redistribute it and/or modify it under
# the terms of the Lesser ... | return language, (pos - 1, end - 1), confidence
return None, None, None
|
<|file_name|>_purefa_facts.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2018, Simon Dodsley (simon@purestorage.com)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metacla... | "10000000C96C48D1", |
<|file_name|>cache.py<|end_file_name|><|fim▁begin|>"""
Caching utilities for zipline
"""
from collections import MutableMapping
import errno
import os
import pickle
from distutils import dir_util
from shutil import rmtree, move
from tempfile import mkdtemp, NamedTemporaryFile
import pandas as pd
from .context_tricks ... | Expired |
<|file_name|>build_lex_table.rs<|end_file_name|><|fim▁begin|>use super::coincident_tokens::CoincidentTokenIndex;
use super::token_conflicts::TokenConflictMap;
use crate::generate::dedup::split_state_id_groups;
use crate::generate::grammars::{LexicalGrammar, SyntaxGrammar};
use crate::generate::nfa::NfaCursor;
use crate... | |
<|file_name|>benchmarks_test.go<|end_file_name|><|fim▁begin|>/*
Copyright 2018 MBT 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-2.0
Unless requi... |
err := repo.Commit("first")
if err != nil {
b.Fatalf("%v", err) |
<|file_name|>socket_server.go<|end_file_name|><|fim▁begin|>/**
* Copyright 2014 @ z3q.net.
* name :
* author : jarryliu
* date : 2013-12-16 19:03
* description :
* history :
*/
package app
import (
"fmt"
"github.com/jsix/gof"
"go2o/src/core"
"go2o/src/core/infrastructure"
"go2o/src/core/service"
"os"
"s... | gcx.Init(debug, trace)
}
} else { |
<|file_name|>generate.js<|end_file_name|><|fim▁begin|>var fs = require('fs');
var path = require('path');
var md_parser = require('./md_parser');
var $ = require('./helper');
var rootDir = path.join(__dirname, '../') + path.sep;
var assetsDir = path.join(rootDir, 'assets') + path.sep;
var templateDir = path.join(rootD... | |
<|file_name|>webPublico.js<|end_file_name|><|fim▁begin|>'use strict';
// WEB PUBLICO
// =============================================================================
var express = require('express');
var router = express.Router();
//var request = require('request');
var Model = require('../../models/jugando.js');
/***... | res.send(401, 'No se encontraron Alarmas'); |
<|file_name|>goftphelp.go<|end_file_name|><|fim▁begin|>package goftp
import (
"fmt"
"strings"
)
//ftp客户端命令的帮助信息
var FTP_CLIENT_CMD_HELP = map[string]string{
FCC_HELP: "print local help information",
FCC_QUESTION_MARK: "print local help information",
FCC_CD: "change remote working directory",
... | } |
<|file_name|>test_www_service.py<|end_file_name|><|fim▁begin|># This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope t... | w = dict(port=None, auth=auth.NoAuth(), logfileName='l')
w.update(kwargs) |
<|file_name|>ai_player.rs<|end_file_name|><|fim▁begin|>//! Provides `game::IsPlayer<::OtherAction>` types.
use {Result, Action};
use rand::thread_rng;
use rand::distributions::{IndependentSample, Range};
use rayon::prelude::*;
use reversi::{board, turn, game, Side, ReversiError};
use reversi::board::Coord;
use std::cm... | }
} |
<|file_name|>assets.rs<|end_file_name|><|fim▁begin|>// Copyright (C) 2013 - 2021 Tim Düsterhus
// Copyright (C) 2021 Maximilian Mader
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation,... | fn serve_asset(req: HttpRequest, filename: &str) -> Result<impl Responder, Error> {
let file = format!("assets/static/{}", filename);
|
<|file_name|>opt_vec.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/license... | }
|
<|file_name|>rawverse.cpp<|end_file_name|><|fim▁begin|>/******************************************************************************
*
* rawverse.cpp - code for class 'RawVerse'- a module that reads raw text
* files: ot and nt using indexs ??.bks ??.cps ??.vss
* and provides lookup and parsing functions bas... | * destidxoff - dest offset into .vss
* srcidxoff - source offset into .vss |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>import * as walkSync from 'walk-sync';
import * as fs from 'fs';
import create from './offers';
import db from '../';
function mockup() {
const path = `${__dirname}`;
const paths = walkSync(`${path}`, { globs: ['*.json'] });
const promises = [];<|fim▁hole|> ... |
paths.forEach((file) => { |
<|file_name|>test_riak.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
'''Make sure the Riak client is sane'''
import unittest
from test import BaseTest
from simhash_db import Client
<|fim▁hole|>
class RiakTest(BaseTest, unittest.TestCase):
'''Test the Riak client'''
def make_client(self, name, num_blo... | |
<|file_name|>driver.rs<|end_file_name|><|fim▁begin|>#[cfg(not(any(test, rustdoc)))]
use alloc::prelude::v1::*;
#[cfg(any(test, rustdoc))]
use std::prelude::v1::*;
use core::fmt::Write;
use crate::debugshell::{Command, DebugShell};
use crate::DRIVERS;
pub fn builtin_drivers(_sh: &mut DebugShell, _args: Vec<String>) -... |
pub fn register_builtins(sh: &mut DebugShell) {
sh.commands.push(Command { |
<|file_name|>ccp-IN.ts<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
// THIS CODE IS GENERATED - DO NOT MODIFY
// See angular/tools/g... | |
<|file_name|>vec.rs<|end_file_name|><|fim▁begin|>#[no_std];
#[no_core];
use zero;
pub trait OwnedVector<T> {
unsafe fn push_fast(&mut self, t: T);
unsafe fn len(&self) -> uint;
unsafe fn set_len(&mut self, newlen: uint);
unsafe fn as_mut_buf<U>(&self, f: &fn(*mut T, uint) -> U) -> U;
unsafe fn dat... | (**repr).fill = zero::size_of::<T>() * newlen;
} |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>pub mod pool;
pub mod state;
pub mod prelude {<|fim▁hole|><|fim▁end|> | pub use super::pool::{ResourceLoader, ResourcePool};
pub use super::state::ResourceState;
} |
<|file_name|>tests.rs<|end_file_name|><|fim▁begin|>use State;
use GLOBALSINDEX;
use Type;
use raw;
use libc;
use std::task;
use std::any::AnyRefExt;
#[test]
fn test_state_init() {
let mut _s = State::new();
}
#[test]
#[should_fail]
fn test_error() {
let mut s = State::new();
s.pushinteger(42);
s.erro... | |
<|file_name|>tenant.py<|end_file_name|><|fim▁begin|># Copyright 2022 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/... | enable_email_link_signin: bool = None,
disable_auth: bool = None,
enable_anonymous_user: bool = None, |
<|file_name|>Devanagari-Extended-regex.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | // Regular expression that matches all symbols in the Devanagari Extended block as per Unicode v6.0.0:
/[\uA8E0-\uA8FF]/; |
<|file_name|>Leverman.java<|end_file_name|><|fim▁begin|>package de.lman;
import de.lman.engine.Colors;
import de.lman.engine.Game;
import de.lman.engine.InputState;
import de.lman.engine.Keys;
import de.lman.engine.Mouse;
import de.lman.engine.math.Mat2f;
import de.lman.engine.math.Scalar;
import de.lman.engine.math.T... | private boolean dragging = false; |
<|file_name|>server.rs<|end_file_name|><|fim▁begin|>use chrono::prelude::*;
use serde::{Deserialize, Serialize};
// use eyre::{
// // eyre,
// Result,
// // Context as _,
// };
use printspool_json_store::{ Record };
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct Server {
pub id: crate::DbId... | fn version(&self) -> printspool_json_store::Version {
self.version |
<|file_name|>test_quota_utils.py<|end_file_name|><|fim▁begin|># Copyright 2016 OpenStack Foundation
# 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
#
# ... |
@mock.patch('keystoneclient.client.Client') |
<|file_name|>test_school_house.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
<|fim▁hole|>class TestSchoolHouse(unittest.TestCase):
pass<|fim▁end|> | |
<|file_name|>dropck-eyepatch-extern-crate.rs<|end_file_name|><|fim▁begin|>// Copyright 2016 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://w... | sr = Sr("sr", &c.0);
println!("{:?}", (dt.0, dr.0, pt.0, pr.0, st.0, sr.0)); |
<|file_name|>locksmithctl.go<|end_file_name|><|fim▁begin|>// Copyright 2015 CoreOS, 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... | |
<|file_name|>ci.go<|end_file_name|><|fim▁begin|>// Copyright 2016 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum 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
// the Free Soft... | |
<|file_name|>constraint_shape_based.py<|end_file_name|><|fim▁begin|># Copyright (C) 2010-2019 The ESPResSo project
#
# This file is part of ESPResSo.
#
# ESPResSo 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... | """
system = self.system
system.time_step = 0.01 |
<|file_name|>Animal2.java<|end_file_name|><|fim▁begin|>package cn.bjsxt.oop.inherit;
/**
* 测试组合
* @author dell
*
*/
public class Animal2 {
String eye;
<|fim▁hole|> public void run(){
System.out.println("跑跑!");
}
public void eat(){
System.out.println("吃吃!");
}
public void sleep(){
Syste... | |
<|file_name|>test_LEGACY_post_update.py<|end_file_name|><|fim▁begin|># -*- coding: UTF-8 -*-
from insights.client.phase.v1 import post_update
from mock.mock import patch
from pytest import raises
def patch_insights_config(old_function):
patcher = patch("insights.client.phase.v1.InsightsConfig",
... | |
<|file_name|>chat.js<|end_file_name|><|fim▁begin|>var Chat = function(socket) {
this.socket = socket;
};
// function to send chat messages<|fim▁hole|> text: text
};
this.socket.emit('message', message);
};
// function to change rooms
Chat.prototype.changeRoom = function(room) {
this.socket.emit... | Chat.prototype.sendMessage = function(room, text) {
var message = {
room: room, |
<|file_name|>test_section_topics.py<|end_file_name|><|fim▁begin|># Copyright 2016 - 2018 Ternaris.
# SPDX-License-Identifier: AGPL-3.0-only
from pkg_resources import resource_filename
<|fim▁hole|>import marv_node.testing
from marv_node.testing import make_dataset, run_nodes, temporary_directory
from marv_robotics.det... | |
<|file_name|>_showticklabels.py<|end_file_name|><|fim▁begin|>import _plotly_utils.basevalidators
class ShowticklabelsValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(
self, plotly_name="showticklabels", parent_name="heatmap.colorbar", **kwargs
):
super(ShowticklabelsValid... | plotly_name=plotly_name,
parent_name=parent_name,
edit_type=kwargs.pop("edit_type", "colorbars"), |
<|file_name|>404.component.ts<|end_file_name|><|fim▁begin|>import {Component} from '@angular/core';
@Component({
selector: 'not-found',
templateUrl: 'app/404.component/404.component.html',<|fim▁hole|> styleUrls: ['app/404.component/404.component.css'],
})
export class NotFoundComponent {}<|fim▁end|> | |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import React, { PropTypes } from 'react';
class Link extends React.Component {
render() {
return <article key={this.props.item.id} className="List-Item">
<header className="List-Item-Header">
<cite className="List-Item-Title"><a href={this.props.it... | export default Link; |
<|file_name|>summarize_tests.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# summarize_tests.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# ... | #
# It will print on a single line
#
# <No of tests run> <No of skipped tests> <No of failed tests> <No of errored tests> <List of unsuccessful tests> |
<|file_name|>test_io.py<|end_file_name|><|fim▁begin|>from __future__ import division, absolute_import, print_function
import sys
import gzip
import os
import threading
from tempfile import mkstemp, NamedTemporaryFile
import time
import warnings
import gc
from io import BytesIO
from datetime import datetime
import num... | """)
test = np.genfromtxt(data, names=True, dtype=None) |
<|file_name|>nullvec_ops_primitive.rs<|end_file_name|><|fim▁begin|>use std::ops::{Add, Sub, Mul, Div, Rem, BitAnd, BitOr, BitXor};
use algos::vec_ops::Elemwise;
use nullvec::NullVec;
macro_rules! add_primitive_broadcast_op {
($t:ident, $tr:ident, $op:ident, $sym:tt) => {
// Nullvec + Primitive
imp... | let nvec = NullVec::new(values);
let res = nvec + 2.; |
<|file_name|>accordion.js<|end_file_name|><|fim▁begin|>KB.onClick('.accordion-toggle', function (e) {<|fim▁hole|> }
});<|fim▁end|> | var sectionElement = KB.dom(e.target).parent('.accordion-section');
if (sectionElement) {
KB.dom(sectionElement).toggleClass('accordion-collapsed'); |
<|file_name|>TestServer.py<|end_file_name|><|fim▁begin|># "$Name: $";
# "$Header: $";
# ============================================================================
#
# file : TestServer.py
#
# description : Python source for the TestServer and its commands.
# The class is derived from Dev... | # Add your own code here
self.attr_SpectrumString = attr.get_write_value()
|
<|file_name|>environment.js<|end_file_name|><|fim▁begin|>/* jshint node: true */
module.exports = function(environment) {
var ENV = {
modulePrefix: 'firehon',
environment: environment,
contentSecurityPolicy: { 'connect-src': "'self' wss://*.firebaseio.com" },
firebase: 'https://firehon.firebaseio.com... | FEATURES: {
// Here you can enable experimental features on an ember canary build
// e.g. 'with-controller': true |
<|file_name|>view_conversion.rs<|end_file_name|><|fim▁begin|>// local imports<|fim▁hole|>use view::MatrixView;
use traits::*;
use sralgebra::MagmaBase;
/// Implements matrix conversion API
impl <'a, T:MagmaBase> Conversion<T> for MatrixView<'a, T> {
/// Converts the view to vector from standard library
fn to_s... | |
<|file_name|>razorback_felspur.py<|end_file_name|><|fim▁begin|>import sys
from services.spawn import MobileTemplate
from services.spawn import WeaponTemplate
from resources.datatables import WeaponType
from resources.datatables import Difficulty
from resources.datatables import Options
from java.util import Vector
de... | attacks = Vector() |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//! Platform-specific extensions to `std` for Windows.
//!
//! Provides access to platform-level information for Windows, and exposes
//! Windows-specific idioms that would otherwise be inappropriate as part
//! the core `std` library. These extensions allow developers t... | #[doc(no_inline)]
#[stable(feature = "rust1", since = "1.0.0")]
pub use super::ffi::{OsStrExt, OsStringExt};
#[doc(no_inline)] |
<|file_name|>test_data_sources.py<|end_file_name|><|fim▁begin|># Copyright (c) 2014 Mirantis 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/li... | # field. |
<|file_name|>active_attempt.rs<|end_file_name|><|fim▁begin|>use splits::Splits;
use attempt::Attempt;
use stopwatch::Stopwatch;
use segment_attempt::SegmentAttempt;
use chrono::Duration;
use std::rc::Rc;
#[derive(Eq, PartialEq)]
pub enum AttemptState {
NotRunning,
Running,
Ended,
}
use self::AttemptState:... | fn move_to_next_segment(&mut self, time: Option<Duration>) -> Option<&SegmentAttempt> {
self.attempt.segments[self.split_index].time = time;
let result = Some(&self.attempt.segments[self.split_index]);
if self.split_index == self.attempt.segments.len() - 1 { |
<|file_name|>state_db.rs<|end_file_name|><|fim▁begin|>// CITA
// Copyright 2016-2017 Cryptape Technologies LLC.
// 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 Lic... | |
<|file_name|>test_nested.py<|end_file_name|><|fim▁begin|>from pylastica.query import Query
from pylastica.aggregation.min import Min
from pylastica.aggregation.nested import Nested
from pylastica.doc_type.mapping import Mapping
from pylastica.document import Document
from tests.base import Base
__author__ = 'Joe Linn'... | "price": 4.98
}
})
] |
<|file_name|>t_PiecewiseHermiteEvaluationImplementation_std.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
from openturns import *
ref = NumericalMathFunction("x", "sin(x)")
size = 12
locations = NumericalPoint(size)
values = NumericalPoint(size)
derivatives = NumericalPoint(size)
# Build locations/values/der... | print "evaluation=", evaluation
# Check the values
for i in range(2 * size): |
<|file_name|>ExecutorDatabaseProducer.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2013 Red Hat, Inc. and/or its affiliates.
*
* 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
*
* ... | public EntityManagerFactory getEntityManagerFactory() {
if (this.emf == null) { |
<|file_name|>slider.js<|end_file_name|><|fim▁begin|>$.widget("metro.slider", {
version: "3.0.0",
options: {
position: 0,
accuracy: 0,
color: 'default',
completeColor: 'default',
markerColor: 'default',
colors: false,
showHint: false,
permanentHin... | },
|
<|file_name|>Icon_test.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
const {assert} = chai;
import {Icon} from '../../../../front_end/ui/Icon.js';
describe('Icon', () => {
it('can create an empty instance without ... | // Copyright 2019 The Chromium Authors. All rights reserved. |
<|file_name|>file.rs<|end_file_name|><|fim▁begin|>use std::path::Path;
use std::fs::File;
use std::io::{Read, Write};
use encoding::{Encoding, DecoderTrap, EncoderTrap};
use encoding::all::WINDOWS_1252;
pub fn read_all_text<P: AsRef<Path>>(path: P) -> String {
let mut file = File::open(path).unwrap();
let mut... | let data = WINDOWS_1252.encode(&text, EncoderTrap::Strict).unwrap();
file.write_all(&data).unwrap();
} |
<|file_name|>conf_fixture.py<|end_file_name|><|fim▁begin|># Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.<|fim▁hole|># Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in complia... | # All Rights Reserved.
# |
<|file_name|>routes.js<|end_file_name|><|fim▁begin|>export default {
'/': {
component: require('./components/NowPlayingView'),
name: 'NowPlaying'
}<|fim▁hole|><|fim▁end|> | } |
<|file_name|>logsgui3.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os
import sys # provides interaction with the Python interpreter
from functools import partial
from PyQt4 import QtGui # provides the graphic elements
from PyQt4.QtCore import Qt # provide... | f.write("Xorg.0.log not found!")
f.write('\n')
|
<|file_name|>bbtests.py<|end_file_name|><|fim▁begin|>import os
import re
import oeqa.utils.ftools as ftools
from oeqa.selftest.base import oeSelfTest
from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars
from oeqa.utils.decorators import testcase
class BitbakeTests(oeSelfTest):
def getline(sel... | for f in ['pn-buildlist', 'recipe-depends.dot', 'task-depends.dot']:
self.addCleanup(os.remove, f) |
<|file_name|>_models.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.
# Code generated by ... |
def __init__(
self, |
<|file_name|>user.server.model.js<|end_file_name|><|fim▁begin|>'use strict';
/**
* Module dependencies.
*/
var mongoose = require('mongoose'),
extend = require('mongoose-schema-extend'),
Schema = mongoose.Schema,
moment = require('moment'),
crypto = require('crypto');
/**
* A Validation function f... | default: '', |
<|file_name|>font_context.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 std::rc::Rc;
extern mod freetype;
extern mod fontco... | }
|
<|file_name|>exceptions.py<|end_file_name|><|fim▁begin|>#---------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#-------------... | #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
<|file_name|>company-card.component.ts<|end_file_name|><|fim▁begin|>import {
Component, Input, OnInit, ChangeDetectionStrategy,
trigger, state, style, transition, animate
} from '@angular/core';
import { ICompany } from '_models/_gen/modelInterfaces';
import { TrackByService } from 'core/services/trackby.serv... | import 'style-loader!./company-card.component.scss';
|
<|file_name|>spinlock_gcc_arm.hpp<|end_file_name|><|fim▁begin|>#ifndef BOOST_SMART_PTR_DETAIL_SPINLOCK_GCC_ARM_HPP_INCLUDED
#define BOOST_SMART_PTR_DETAIL_SPINLOCK_GCC_ARM_HPP_INCLUDED
//
// Copyright (c) 2008, 2011 Peter Dimov
//
// Distributed under the Boost Software License, Version 1.0.
// See accompanying fil... |
__asm__ __volatile__(
"ldrex %0, [%2]; \n" |
<|file_name|>raw.rs<|end_file_name|><|fim▁begin|>// Copyright 2015 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/licenses/LI... | #[stable(feature = "raw_ext", since = "1.1.0")] pub type nlink_t = u32; |
<|file_name|>math.rs<|end_file_name|><|fim▁begin|>//! Various methods for computing with vectors.
use std::ops::{Add, Rem};
use vecmath::{self, traits::Float};
pub use vecmath::{
mat2x3_inv as invert, row_mat2x3_mul as multiply, row_mat2x3_transform_pos2 as transform_pos,
row_mat2x3_transform_vec2 as transfor... |
/// Create a shear matrix.
#[inline(always)]
pub fn shear<T>(v: Vec2d<T>) -> Matrix2d<T> |
<|file_name|>packed-tuple-struct-layout.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... | |
<|file_name|>spark_gce.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
###
# This script sets up a Spark cluster on Google Compute Engine
# Sigmoidanalytics.com
###
from __future__ import with_statement
import logging
import os
import pipes
import random
import shutil
import subprocess
import sys
import tempfi... | def setup_spark(master_nodes,slave_nodes): |
<|file_name|>auxpow_testing.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# Copyright(c) 2014-2019 Daniel Kraft
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Utility routines for auxpow that are needed specifically by... |
def mineBlock(header, target, ok):
""" |
<|file_name|>StoragePoolService.go<|end_file_name|><|fim▁begin|><|fim▁hole|>//
// Copyright 2014, Sander van Harmelen
//
// 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.... | |
<|file_name|>template.go<|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/. */
package components
const (
TYPEDELIMITER = "::"
TYPEROUTE... | DATACENTERREGION = `$(components.#[_component_id="credentials::vcloud"].region)`
VCLOUDURL = `$(components.#[_component_id="credentials::vcloud"].vcloud_url)` |
<|file_name|>test_config.py<|end_file_name|><|fim▁begin|># Copyright (C) 2015-2022 by the RBniCS authors
#
# This file is part of RBniCS.
#
# SPDX-License-Identifier: LGPL-3.0-or-later
import os
import sys
from rbnics.utils.config import Config
def test_config(tempdir):
# Create a default configuration
confi... | |
<|file_name|>attack.cpp<|end_file_name|><|fim▁begin|>/*
Copyright (C) 2003 - 2018 by David White <dave@whitevine.net>
Part of the Battle for Wesnoth Project https://www.wesnoth.org/
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as ... |
if(opp_weapon) {
opp_ctx.emplace(opp_weapon->specials_context(&opp, &u, opp_loc, u_loc, !attacking, weapon));
} |
<|file_name|>DataWriter.cpp<|end_file_name|><|fim▁begin|>#include "StdAfx.h"
#include ".\datawriter.h"
using namespace std;
DataWriter::DataWriter(const std::string &fileName)
{
this->fileName = fileName;
fileStream = NULL;
//Initialize the filestream
fileStream = new fstream(fileName.c_st... | {
if (fileStream->is_open())
{
|
<|file_name|>htmlbaseelement.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 dom::attr::Attr;
use dom::bindings::codegen::Bind... | that have a base url.");
let document = document_from_node(self); |
<|file_name|>debugging.js<|end_file_name|><|fim▁begin|>/*
* Flocking Debugging Unit Generators
* http://github.com/colinbdclark/flocking
*
* Copyright 2011-2014, Colin Clark
* Dual licensed under the MIT and GPL Version 2 licenses.
*/
/*global require*/
/*jshint white: false, newcap: true, regexp: true, browser:... | |
<|file_name|>type_allocation_places.rs<|end_file_name|><|fim▁begin|>#![allow(dead_code)]
use crate::config::MovableTypesHookOutput;
use crate::cpp_data::{CppItem, CppPath};
use crate::cpp_type::{CppPointerLikeTypeKind, CppType};
use crate::processor::ProcessorData;
use log::{info, trace};
use ritual_common::errors::Re... | } else {
"probably movable (no pointers, no virtual functions, but too few items)"
}
} else if stats.pointer_encounters.len() < 5 |
<|file_name|>moment.min.js<|end_file_name|><|fim▁begin|>//! moment.js
//! version : 2.15.1
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
//! license : MIT
//! momentjs.com
;(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
... | });
// ALIASES |
<|file_name|>test-utils.js<|end_file_name|><|fim▁begin|>import { expect } from "chai";
import { createStore, applyMiddleware } from 'redux';
import Immutable from 'immutable';
import reducers from '../src/lib/reducers';
import * as Utils from '../src/lib/utils';
describe('utils', function () {
beforeEach(function ... | '1.children.1',
'1.children.1.children.0',
'1.children.1.children.1', |
<|file_name|>clear_bits_geq.rs<|end_file_name|><|fim▁begin|>use word::{Word, ToWord, UnsignedWord};
/// Clears all bits of `x` at position >= `bit`.
///
/// # Panics
///
/// If `bit >= bit_size()`.
///
/// # Intrinsics:
/// - BMI 2.0: bzhi.
///
/// # Examples
///
/// ```
/// use bitwise::word::*;
///
/// assert_eq!(0b... | }
|
<|file_name|>issue-23898.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... | |
<|file_name|>GroupedByTimeOperator.java<|end_file_name|><|fim▁begin|>package com.oath.cyclops.internal.stream.spliterators.push;
import com.oath.cyclops.types.persistent.PersistentCollection;
import java.util.Collection;
import java.util.concurrent.TimeUnit;
import java.util.function.Consumer;
import java.util.functi... |
}
|
<|file_name|>test_utils.py<|end_file_name|><|fim▁begin|>"""
Test rest_framework_json_api's utils functions.
"""
from rest_framework_json_api import utils
from ..serializers import EntrySerializer
from ..tests import TestBase
class GetRelatedResourceTests(TestBase):
"""
Ensure the `get_related_resource_type` ... | |
<|file_name|>StateManager.cpp<|end_file_name|><|fim▁begin|>#include <cstdlib> // srand()
#include <ctime> // time()
#include "StateManager.hpp"
#include "SDL.hpp"
#include "Log.hpp"
#include "Config.hpp"
#include "GameStateMainMenu.hpp"
#include "GameStateGame.hpp"<|fim▁hole|>
StateManager::StateManager(int width, in... | #include "GameStateGameOver.hpp"
#include "Window.hpp"
#include "Graphics.hpp" |
<|file_name|>secrets.ts<|end_file_name|><|fim▁begin|>import * as _ from 'lodash';
import * as AWS from 'aws-sdk';
import * as config from './config';
export interface Secrets {
REDDIT_CLIENT_ID: string;
REDDIT_CLIENT_TOKEN: string;
REDDIT_USERNAME: string;
REDDIT_PASSWORD: string;
STEAM_API_KEY: string;
}
... | 'REDDIT_CLIENT_TOKEN',
'REDDIT_PASSWORD',
'STEAM_API_KEY', |
<|file_name|>ibm_wire.py<|end_file_name|><|fim▁begin|><|fim▁hole|># Developed exclusively at US Government expense under US Air Force contract
# FA8721-05-C-002. The rights of the United States Government to use, modify,
# reproduce, release, perform, display or disclose this computer software and
# computer software d... | # *****************************************************************
# Copyright (c) 2013 Massachusetts Institute of Technology
# |
<|file_name|>officemru.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Tests for the Microsoft Office MRUs Windows Registry plugin."""
import unittest
from plaso.formatters import officemru # pylint: disable=unused-import
from plaso.formatters import winreg # pylint: disable=unused-impo... | u'SA-23E Mitchell-Hyundyne Starfury.docx')
self._TestRegvalue(event_object, regvalue_identifier, expected_value_string)
expected_message = ( |
<|file_name|>generator.py<|end_file_name|><|fim▁begin|>from PIL import Image
from PIL import ImageFont
from PIL import ImageDraw
from name_generator import get_random_name
FONT_SIZE = 14
FONT = ImageFont.truetype("appletext.ttf", FONT_SIZE)
def generate_new_tombstone(name, inscription):
img = Image.open("created_... | draw.text((330, 160), "Here Lies", (0,0,0), font=FONT)
draw.text((center(len(name)), 160 + FONT_SIZE + 10), name, (0,0,0), font=FONT)
def add_inscription(draw, inscription): |
<|file_name|>set.rs<|end_file_name|><|fim▁begin|>use liner::KeyBindings;
use shell::Shell;
use shell::flags::*;
use std::io::{self, Write};
use std::iter;
const HELP: &'static str = r#"NAME
set - Set or unset values of shell options and positional parameters.
SYNOPSIS
set [ --help ] [-e | +e] [-x | +x] [-o [v... | shell.variables.set_array("args", arguments);
}, |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.