prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>webpack.config.js<|end_file_name|><|fim▁begin|>const path = require('path');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const PATHS = {
SRC: path.join(__dirname, 'src')
};
const webpackConfig = {
entry: ['./src/index.jsx'],
plugins: [new ExtractTextPlugin('style.css')],
dev... | };
module.exports = webpackConfig; |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.contrib.auth.models import User
from django.db import models
from .utils import create_slug
class BaseModel(models.Model):
created = models.DateTimeField(auto_now_add=True)
last_updated = models.DateTimeField(auto_now=True)
class Meta():<|f... | abstract = True |
<|file_name|>endpointitem.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from math import floor
from typing import (
Tuple,
Any
)
from PyQt5.QtCore import (
QPointF,
QRectF,
Qt
)
from PyQt5.QtGui import (
QBrush,
QPen,
QPainterPath,
QPolygonF,
QMouseEvent,
QPainter
... | |
<|file_name|>RSyntaxUtilities.java<|end_file_name|><|fim▁begin|>/*
* 08/06/2004
*
* RSyntaxUtilities.java - Utility methods used by RSyntaxTextArea and its
* views.
*
* This library is distributed under a modified BSD license. See the included
* RSyntaxTextArea.License.txt file for details.
*/
packag... | int lineStart = line.getStartOffset();
if (offs==lineStart) { // Start of the line.
return offs;
|
<|file_name|>IWindow.ts<|end_file_name|><|fim▁begin|>"use strict";
/**
* Additional Interfaces
*/
import ILocalStorage from "./ILocalStorage";
/**
* The Window interface
*/
interface IWindow {
atob: any;
btoa: any;
escape: any;
unescape: any;
location: any;
Promise: any;
document: Document;
addEvent... | /** |
<|file_name|>track.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
# mingus - Music theory Python package, track module.
# Copyright (C) 2008-2009, Bart Spaans
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public L... | track."""
for bar in self.bars: |
<|file_name|>_config.js<|end_file_name|><|fim▁begin|>export default {
html: `
<p>42</p>
<p>42</p>
`,
async test({ assert, component, target }) {
await component.updateStore(undefined);
assert.htmlEqual(target.innerHTML, '<p>undefined</p><p>42</p>');
await component.updateStore(33);
assert.htmlEqual(tar... | assert.htmlEqual(target.innerHTML, '<p>undefined</p><p>undefined</p>');
}
}; |
<|file_name|>register-form.controller.js<|end_file_name|><|fim▁begin|>(function() {
'use strict';
angular.module('cd.app.registerForm')
.controller('RegisterFormController', RegisterFormController);
/* @ngInject */
function RegisterFormController ($location, StepsService) {<|fim▁hole|> ... | |
<|file_name|>format_c_api_doc.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: ts=4:sw=4:expandtab:
# Copyright 2008 Mark Mitchell
# License: see __license__ below.
__doc__ = """
Reads a GraphicsMagick source file and parses the specially formatted
comment blocks which precede eac... | print >> outfile, '.. include:: %s' % x
print >> outfile
# print all functions found in this source file |
<|file_name|>vdom-my.js<|end_file_name|><|fim▁begin|>export function Fragment(props, ...children) {
return collect(children);
}
const ATTR_PROPS = '_props';
function collect(children) {
const ch = [];
const push = (c) => {
if (c !== null && c !== undefined && c !== '' && c !== false) {
c... | //# sourceMappingURL=vdom-my.js.map |
<|file_name|>MessageBean.java<|end_file_name|><|fim▁begin|>/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.cgc.bean;
import java.sql.Timestamp;
/**
*
* @author com02
*/
public class MessageBean {
private int runno;<|fim▁hole|> private String m... | |
<|file_name|>PostmarkEMail.java<|end_file_name|><|fim▁begin|>package com.diggime.modules.email.model.impl;
import com.diggime.modules.email.model.EMail;
import com.diggime.modules.email.model.MailContact;
import org.json.JSONObject;
import java.time.LocalDateTime;
import java.util.List;
import static org.foilage.uti... | this.tag = notNull(tag); |
<|file_name|>HdfsClasspathSetupTest.java<|end_file_name|><|fim▁begin|>/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
*... |
for (int i = 0; i < concurrency; i++) {
futures.add( |
<|file_name|>cache.go<|end_file_name|><|fim▁begin|>package config
import (
"log"
"os"
"os/user"
"path/filepath"
"koding/klient/storage"
"koding/tools/util"
"github.com/boltdb/bolt"
)
// CurrentUser represents current user that owns the KD process.
//
// If the process was started with sudo, the CurrentUser r... | |
<|file_name|>533646c7af38_remove_unused_attr_status.py<|end_file_name|><|fim▁begin|># Copyright 2015 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/l... | |
<|file_name|>year-filter.component_angular.ts<|end_file_name|><|fim▁begin|>import { Component } from '@angular/core';
import { IFilterAngularComp } from "@ag-grid-community/angular";
@Component({
selector: 'year-filter',
template: `
<div class="year-filter">
<label>
<input t... | }
getModel(): boolean | null {
return this.isFilterActive() || null; |
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>import unittest
from click.testing import CliRunner
from make_dataset import main
<|fim▁hole|>
class TestMain(unittest.TestCase):
def test_main_runs(self):
runner = CliRunner()
result = runner.invoke(main, ['.', '.'])
assert result.exit_c... | |
<|file_name|>bndstx.rs<|end_file_name|><|fim▁begin|>use ::{BroadcastMode, Instruction, MaskReg, MergeMode, Mnemonic, OperandSize, Reg, RoundingMode};
use ::RegType::*;
use ::instruction_def::*;
use ::Operand::*;<|fim▁hole|>
fn bndstx_1() {
run_test(&Instruction { mnemonic: Mnemonic::BNDSTX, operand1: Some(IndirectS... | use ::Reg::*;
use ::RegScale::*; |
<|file_name|>ShortestPathsBenchmark.java<|end_file_name|><|fim▁begin|>/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
*... | job.getConfiguration().setLong(
PseudoRandomVertexInputFormat.AGGREGATE_VERTICES, |
<|file_name|>CDef.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2004-2013 the Seasar Foundation and the Others.
*
* 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:/... | * @return The snapshot list of classification elements in the code list. (NotNull, EmptyAllowed: when empty specified)
*/
public static List<UQClassificationType> listOf(Collection<String> codeList) {
|
<|file_name|>DruidInputSource.java<|end_file_name|><|fim▁begin|>/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to yo... | return dataSource;
}
@Nullable |
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commente... | # There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used: |
<|file_name|>entry.config.js<|end_file_name|><|fim▁begin|>import merge from 'webpack-merge'
import { isString } from '../../utils'<|fim▁hole|> }
if (Array.isArray(settings)) {
return merge.smart(config, { entry: settings })
}
throw new Error('Unexpected webpack entry value')
}<|fim▁end|> |
export default (config, settings) => {
if (isString(settings)) {
return merge.smart(config, { entry: [settings] }) |
<|file_name|>binary.go<|end_file_name|><|fim▁begin|>// This file contains functions for transpiling binary operator expressions.
package transpiler
import (
"fmt"
goast "go/ast"
"go/token"
"strings"
"github.com/elliotchance/c2go/ast"
"github.com/elliotchance/c2go/program"
"github.com/elliotchance/c2go/types"
... | // then solution is:
// c = 1, b = c, a = b |
<|file_name|>brand1.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib
import urllib2
import re
import json
class Spider:
def __init__(self):
self.url = 'http://brand.efu.com.cn/'
self.user_agent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like... | |
<|file_name|>product.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
###########################################################################
# Module Writen to OpenERP, Open Source Management Solution
#
# Copyright (c) 2012 Vauxoo - http://www.vauxoo.com
# All Rights Reserved.
# info@vauxoo.com
... | res = super(product_product, self).copy(
cr, uid, id, default=default, context=context) |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#![feature(box_syntax)]
#![feature(iter_cmp)]
#![feature(slice_by... | extern crate net_traits;
extern crate num;
extern crate offscreen_gl_context; |
<|file_name|>0004_groupround_schedule_is_set.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-12-06 02:31
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('season', '0003_... | ),
] |
<|file_name|>package_report.py<|end_file_name|><|fim▁begin|>import sublime
import sublime_plugin
<|fim▁hole|>from ..core import oa_syntax, decorate_pkg_name
from ..core import ReportGenerationThread
from ...lib.packages import PackageList
###----------------------------------------------------------------------------
... | |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.shortcuts import render
# Create your views here.
def proindex(request):
return render(request, 'example/probase.html' )
def index(request):
return render(request, 'e_index.html' )
def badges_labels(request):
return re... |
def graph_peity(request): |
<|file_name|>config.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# This file is part of Zenodo.
# Copyright (C) 2015 CERN.
#
# Zenodo 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... |
ZENODO_COMMUNITIES_REQUEST_IF_GRANTS = ['ecfunded', ] |
<|file_name|>r_model_alias.cpp<|end_file_name|><|fim▁begin|>/**
* @file
* @brief shared alias model loading code (md2, md3)
*/
/*
Copyright (C) 1997-2001 Id Software, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License<|fim▁hole|>
This prog... | as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version. |
<|file_name|>foo.rs<|end_file_name|><|fim▁begin|>pub use private::Quz;
pub use hidden::Bar;
mod private {
pub struct Quz;
}
#[doc(hidden)]
pub mod hidden {
pub struct Bar;
}
#[macro_export]
macro_rules! foo {<|fim▁hole|>}<|fim▁end|> | () => {} |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>"Utility functions for the tests."
import json
def get_settings(**defaults):
"Update the default settings by the contents of the 'settings.json' file."
result = defaults.copy()
with open("settings.json", "rb") as infile:
data = json.load(infile)
... | return result |
<|file_name|>AutoincrementalField.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
***************************************************************************
AutoincrementalField.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
... | * the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* * |
<|file_name|>ap_save_tx_calibration.py<|end_file_name|><|fim▁begin|>"""
airPy is a flight controller based on pyboard and written in micropython.
The MIT License (MIT)
Copyright (c) 2016 Fabrizio Scimia, fabrizio.scimia@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
of this soft... | max_thd_vals[i] = struct.unpack('>f', payload[byte_per_thd_set + i*4:i*4 + 4 + byte_per_thd_set])[0]
for i in range(0, int(byte_per_thd_set/4)): |
<|file_name|>PercentSeries.d.ts<|end_file_name|><|fim▁begin|>/**
* Defines Percent Chart Series.
*/
/**
* ============================================================================
* IMPORTS
* ============================================================================
* @hidden
*/
import { Series, Se... | * @param event Event
|
<|file_name|>PluggableSCMMaterialAgent.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2020 ThoughtWorks, 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.apach... | * See the License for the specific language governing permissions and |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>#![allow(dead_code)]
pub mod callback;
#[path = "../../src/utils/environment.rs"]
pub mod environment;
pub mod pool;
pub mod signus;
pub mod wallet;
pub mod ledger;
pub mod anoncreds;
pub mod types;
#[macro_use]
#[path = "../../src/utils/test.rs"]
pub mod test;<|fim▁... |
#[path = "../../src/utils/timeout.rs"]
pub mod timeout; |
<|file_name|>trait-safety-ok.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... | unsafe trait Foo { |
<|file_name|>package.py<|end_file_name|><|fim▁begin|># Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
#
# Author: Milton Woods <milton.woods@bom.gov.au>
# Date: March 22, ... | # Make the site packages directory for extensions,
# if it does not exist already.
mkdirp(module.perl_lib_dir) |
<|file_name|>util.py<|end_file_name|><|fim▁begin|>import collections
import hashlib
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from corehq.util.soft_assert import soft_assert
from corehq import privileges, toggles
from corehq.apps.hqwebapp.templatetags.hq_shared_tags impo... | |
<|file_name|>sbang.py<|end_file_name|><|fim▁begin|>##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tga... | |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from rest_framework import routers
from . import viewsets
router = routers.SimpleRouter()
router.register(r"domains", viewsets.DomainViewSet, basename="domain")
router.register(
r"domainaliases", viewsets.DomainAliasViewSet, basename="domain_alias")
ro... | """Admin API urls."""
|
<|file_name|>modules.go<|end_file_name|><|fim▁begin|>package native
import (
"errors"
"github.com/CyCoreSystems/ari/v5"
)
// Modules provides the ARI modules accessors for a native client
type Modules struct {
client *Client
}
// Get obtains a lazy handle to an asterisk module
func (m *Modules) Get(key *ari.Key)... | |
<|file_name|>eventtrans.py<|end_file_name|><|fim▁begin|>#Author velociraptor Genjix <aphidia@hotmail.com>
from PySide.QtGui import *
from PySide.QtCore import *
class MainWindow(QMainWindow):
def __init__(self):
super(MainWindow, self).__init__()
button = QPushButton(self)
button.setGeomet... | machine.setInitialState(s1)
machine.start()
self.setCentralWidget(button) |
<|file_name|>const.py<|end_file_name|><|fim▁begin|>"""Freebox component constants."""
from __future__ import annotations
import socket
from homeassistant.components.sensor import SensorEntityDescription
from homeassistant.const import DATA_RATE_KILOBYTES_PER_SECOND, PERCENTAGE, Platform
DOMAIN = "freebox"
SERVICE_RE... | APP_DESC = {
"app_id": "hass", |
<|file_name|>power_measurement_suite_new.py<|end_file_name|><|fim▁begin|>import SCPI
import time
import numpy
totalSamples = 10
sampleFreq = 100
#freq= SCPI.SCPI("172.17.5.121")
dmm = SCPI.SCPI("172.17.5.131")
#setup freq gen
#freq.setSquare()
#freq.setVoltage(0,3)
#freq.setFrequency(sampleFreq)
#setup voltage mete... | dmm.setTriggerSource("INT") |
<|file_name|>CompleteOperation.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2012 Red Hat, Inc. and/or its affiliates.
*
* Licensed under the Eclipse Public License version 1.0, available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.jboss.aesh.complete;
import org.jboss.aesh.console.AeshContex... | * be appended. By default this is true.
*
* @param appendSeparator appendSeparator
*/ |
<|file_name|>link_prediction.py<|end_file_name|><|fim▁begin|>"""
Link prediction algorithms.
"""
from math import log
import networkx as nx
from networkx.utils import not_implemented_for<|fim▁hole|>
__all__ = ['resource_allocation_index',
'jaccard_coefficient',
'adamic_adar_index',
'... | |
<|file_name|>application.js<|end_file_name|><|fim▁begin|>import Ember from 'ember';
import DS from 'ember-data';
import DataAdapterMixin from 'ember-simple-auth/mixins/data-adapter-mixin';
export default DS.RESTAdapter.extend(DataAdapterMixin, {
authorizer: 'authorizer:dspace',
initENVProperties: Ember.on('init',... | hash.data.expand = 'all'; //add ?expand=all to all GET calls
}
return this._super(url, type, hash);
} |
<|file_name|>floatingip.py<|end_file_name|><|fim▁begin|># Copyright 2016 Sungard Availability Services
# Copyright 2016 Red Hat
# Copyright 2012 eNovance <licensing@enovance.com>
# Copyright 2013 IBM Corp
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this f... | # Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
<|file_name|>TestVerifySilently.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU G... | (verifySilently ? "-Xlog:gc":"-Xlog:gc+verify=debug"),
RunSystemGC.class.getName()});
ProcessBuilder pb =
ProcessTools.createJavaProcessBuilder(vmOpts.toArray(new String[vmOpts.size()])); |
<|file_name|>settings.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# ask-undrgz system of questions uses data from underguiz.
# Copyright (c) 2010, Nycholas de Oliveira e Oliveira <nycholas@gmail.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modificati... | |
<|file_name|>pool.rs<|end_file_name|><|fim▁begin|>use r2d2::Pool;
use r2d2_postgres::PostgresConnectionManager;
use r2d2::Config;
use postgres::SslMode;
use config::DbConfig;
use database::{Database, DatabaseDDL, DatabaseDev};
use platform::Postgres;
#[cfg(feature = "sqlite")]
use platform::Sqlite;
#[cfg(feature = "mys... | println!("Unable to parse url");
Err(DbError::new("Error parsing url"))
} |
<|file_name|>exceptions.py<|end_file_name|><|fim▁begin|>class DestinationNotFoundException(Exception):
pass
class InvalidDateFormat(Exception):<|fim▁hole|><|fim▁end|> | pass |
<|file_name|>Top10Controller.js<|end_file_name|><|fim▁begin|>/*global GLOBE, Em */
GLOBE.Top10Controller = Em.ArrayController.extend({
needs: ['application'],
relays: [],<|fim▁hole|>
actions: {
showRelayDetail: function(fingerprint) {
this.transitionToRoute('relayDetail', fingerprint);
... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>__all__ = ["sqlite_dump", "sqlite_merge"]
from random import Random
import math
def random_expectations(depth=0, breadth=3, low=1, high=10, random=Random()):
"""
Generate depth x breadth array of random numbers where each row sums to
high, with a mini... | |
<|file_name|>abstractPropertyInConstructor.ts<|end_file_name|><|fim▁begin|>abstract class AbstractClass {
constructor(str: string, other: AbstractClass) {
this.method(parseInt(str));
let val = this.prop.toLowerCase();
if (!str) {
this.prop = "Hello World";
}
... | |
<|file_name|>codeBuffer.hpp<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Pu... | |
<|file_name|>context_provider.rs<|end_file_name|><|fim▁begin|>use std::{
cell::{Cell, RefCell},
collections::BTreeMap,
rc::Rc,
sync::mpsc,
};
use dces::prelude::*;
use super::WindowAdapter;
use crate::{
event::*,
layout::*,
localization::Localization,
render_object::*,
shell::{She... | |
<|file_name|>test_db_search.py<|end_file_name|><|fim▁begin|>import pytest
from united_states_of_browsers.db_merge.db_search import (
check_fts5_installed,
search,
)
pytestmark = pytest.mark.skipif(
not check_fts5_installed(),
reason="FTS5 not available. Search disabled",
)
def test_search_with_keyw... | for row in search(
searchable_db_path,
word_query="start page",
) |
<|file_name|>throughputanalysertest.py<|end_file_name|><|fim▁begin|>## begin license ##
#
# "Meresco Harvester" consists of two subsystems, namely an OAI-harvester and
# a web-control panel.
# "Meresco Harvester" is originally called "Sahara" and was developed for
# SURFnet by:
# Seek You Too B.V. (CQ2) http://www.cq2.... | def testAnalyse(self):
t = ThroughputAnalyser(eventpath = self.testdir) |
<|file_name|>parsed_jvm_command_lines.rs<|end_file_name|><|fim▁begin|>use itertools::Itertools;
use std::slice::Iter;
/// Represents the result of parsing the args of a nailgunnable Process
/// TODO(#8481) We may want to split the classpath by the ":", and store it as a Vec<String>
/// to allow for deep finger... | |
<|file_name|>device.py<|end_file_name|><|fim▁begin|># This file is part of MyPaint.
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2019 by the MyPaint Development Team.
#
# 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 Fre... | settings = Settings(dev_prefs)
self._device_settings[device] = settings
self.devices_updated()
assert settings is not None |
<|file_name|>spawner.py<|end_file_name|><|fim▁begin|>"""
JupyterHub Spawner to spawn user notebooks on a Kubernetes cluster.
This module exports `KubeSpawner` class, which is the actual spawner
implementation that should be used by JupyterHub.
"""
import asyncio
import os
import signal
import string
import sys
import ... |
# specify default ssl alt names |
<|file_name|>gcmc.cpp<|end_file_name|><|fim▁begin|>/*--------------------------------------------
Created by Sina on 06/05/13.
Copyright (c) 2013 MIT. All rights reserved.
--------------------------------------------*/
#include "elements.h"
#include "mpi_compat.h"
#include "gcmc.h"
#include "memory.h"
#include "rand... | } |
<|file_name|>cppad_ipopt_nlp.hpp<|end_file_name|><|fim▁begin|>// $Id$
# ifndef CPPAD_CPPAD_IPOPT_NLP_HPP
# define CPPAD_CPPAD_IPOPT_NLP_HPP
/* --------------------------------------------------------------------------
CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
CppAD is distributed un... | We define an $icode index vector$$ as a vector of non-negative integers |
<|file_name|>accessor.rs<|end_file_name|><|fim▁begin|>use core::Message;
use core::ProtobufEnum;
use core::message_down_cast;
use reflect::EnumValueDescriptor;
/// this trait should not be used directly, use `FieldDescriptor` instead
pub trait FieldAccessor {
fn name_generic(&self) -> &'static str;
fn has_fie... | fns: FieldAccessorFunctions::Repeated(RepeatedGet::F64(get)),
})
} |
<|file_name|>game.js<|end_file_name|><|fim▁begin|><|fim▁hole|>import { combineReducers } from 'redux-immutable';
import gluttonousSnake from 'isomerism/reducers/components/game/gluttonousSnake';
export default combineReducers({
gluttonousSnake,
});<|fim▁end|> | |
<|file_name|>ReasonTextDialogImpl.java<|end_file_name|><|fim▁begin|>//#############################################################################
//# #
//# Copyright (C) <2015> <IMS MAXIMS> #
//# ... | ArrayList markers = new ArrayList();
ArrayList values = new ArrayList();
|
<|file_name|>test_get_neighborhoods.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""
PURPOSE: The routines in this file test the get_neighborhoods module.
Created on 2015-04-02T21:24:17
"""
from __future__ import division, print_function
#import numpy as np
#from types import *
#from nose.tools import raise... |
#make sure the number of neighborhoods is equal to the number of issues.
def test_get_neighborhoods(): |
<|file_name|>RowRenderer.js<|end_file_name|><|fim▁begin|><|fim▁hole|>
attributeHandler: null,
// ---------------------------------------
process: function()
{
if (this.specificHandler.isSpecificRendered(this.indexedXPath) && !this.isValueForceSet()) {
return '';
}
... | AmazonTemplateDescriptionCategorySpecificGridRowRenderer = Class.create(AmazonTemplateDescriptionCategorySpecificRenderer, {
// ---------------------------------------
|
<|file_name|>Gruntfile.js<|end_file_name|><|fim▁begin|>module.exports = function ( grunt ) {
grunt.initConfig( {
pkg: grunt.file.readJSON( 'package.json' ),
banner: '/*!\n' +
'* <%= pkg.name %> v<%= pkg.version %> - <%= pkg.description %>\n' +
'* Copyright (c) <%= grunt.template.to... | |
<|file_name|>test_110_polygons.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Mathmaker creates automatically maths exercises sheets
# with their answers
# Copyright 2006-2017 Nicolas Hainaux <nh.techn@gmail.com>
# This file is part of Mathmaker.
# Mathmaker is free software; you can redistribute it and/o... | 'end\n' |
<|file_name|>SampleApplication.java<|end_file_name|><|fim▁begin|>package com.gdgand.rxjava.rxjavasample.hotandcold;
import android.app.Application;
import com.gdgand.rxjava.rxjavasample.hotandcold.di.component.ApplicationComponent;
import com.gdgand.rxjava.rxjavasample.hotandcold.di.component.DaggerApplicationCompone... | } |
<|file_name|>tables.client.routes.js<|end_file_name|><|fim▁begin|>(function () {
'use strict';
angular
.module('tables')
.config(routeConfig);
routeConfig.$inject = ['$stateProvider'];
function routeConfig($stateProvider) {
$stateProvider
.state('tables', {
abstract: true,
u... | |
<|file_name|>guestmount.py<|end_file_name|><|fim▁begin|>import logging
import os
from autotest.client.shared import error, utils
from virttest import data_dir, utils_test
<|fim▁hole|> result = utils.run("umount -l %s" % mountpoint, ignore_status=True)
if result.exit_status:
logging.debug("Umo... |
def umount_fs(mountpoint):
if os.path.ismount(mountpoint): |
<|file_name|>SGD_AudioManager.cpp<|end_file_name|><|fim▁begin|>/***********************************************************************\
| |
| File: SGD_AudioManager.cpp |
| Author: Douglas Monroe |
| Last Modified: 2014-03-10 |
| |
| Purpose: To load and... | |
<|file_name|>stack-info.component.spec.ts<|end_file_name|><|fim▁begin|>import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { StackInfoComponent } from './stack-info.component';
describe('StackInfoComponent', () => {
let component: StackInfoComponent;
let fixture: ComponentFixture<Stac... | it('should be created', () => {
expect(component).toBeTruthy();
});
}); |
<|file_name|>result.py<|end_file_name|><|fim▁begin|>"""Test result object"""
import os
import sys
import traceback
from StringIO import StringIO
from . import util
from functools import wraps
__unittest = True
def failfast(method):
@wraps(method)
def inner(self, *args, **kw):
if getattr(self, 'fail... | """Converts a sys.exc_info()-style tuple of values into a string.""" |
<|file_name|>.eslintrc.js<|end_file_name|><|fim▁begin|>module.exports = {
root: true,
env: {
node: true,
},
extends: ['plugin:vue/essential', '@vue/prettier', '@vue/typescript'],
rules: {
'vue/max-attributes-per-line': 'off',
'vue/html-self-closing': 'off',
},
parserOptions: {
parser: '@ty... | },
} |
<|file_name|>ball_to_polyline.rs<|end_file_name|><|fim▁begin|>use na::Pnt2;
use na;
use math::Scalar;
use entities::shape::Ball2;
use procedural::Polyline2;
use procedural;
use super::ToPolyline;
impl<N: Scalar> ToPolyline<Pnt2<N>, u32> for Ball2<N> {
fn to_polyline(&self, nsubdiv: u32) -> Polyline2<N> {<|fim▁hole... | let diameter = self.radius() * na::cast(2.0f64); |
<|file_name|>TestSRILM.java<|end_file_name|><|fim▁begin|>package edu.stanford.nlp.lm;
import java.io.File;
import java.util.Arrays;
/**
* This is a simple test of srilm.
* @author Alexandre Denis<|fim▁hole|> */
public class TestSRILM
{
/**
* @param args
*/
public static void main(String[] args)
{
SRILang... | * |
<|file_name|>g.py<|end_file_name|><|fim▁begin|># coding=utf-8
"""g[ravity] class."""
from foamfile import FoamFile, foam_file_from_file
from collections import OrderedDict<|fim▁hole|>class G(FoamFile):
"""G (gravity) class."""
# set default valus for this class
__default_values = OrderedDict()
__defaul... | |
<|file_name|>prelink.py<|end_file_name|><|fim▁begin|>#!/bin/python
import os, subprocess
import logging
from autotest.client import test
from autotest.client.shared import error, software_manager
sm = software_manager.SoftwareManager()
class prelink(test.test):
"""
Autotest module for testing basic functiona... | |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
from werkzeug.routing import Map, Submount
import libcloud
from libcloud_rest.api.handlers import app_handler
from libcloud_rest.api.handlers.compute import compute_handler<|fim▁hole|>from libcloud_rest.api.handlers.storage import storage_handler... | from libcloud_rest.api.handlers.dns import dns_handler
from libcloud_rest.api.handlers.loadbalancer import lb_handler |
<|file_name|>forms.py<|end_file_name|><|fim▁begin|>from django import forms
from poi_manager.models import Poi, PoiCategory
from mptt.forms import TreeNodeChoiceField
class PoiCategoryForm(forms.ModelForm):
cat_name = forms.CharField(max_length=128, help_text="Please enter the category name.")
parent = TreeNo... | fields = ('cat_name', 'parent',)
|
<|file_name|>deprecation-sanity.rs<|end_file_name|><|fim▁begin|>// Various checks that deprecation attributes are used correctly
mod bogus_attribute_types_1 {
#[deprecated(since = "a", note = "a", reason)] //~ ERROR unknown meta item 'reason'
fn f1() { }
<|fim▁hole|> fn f2() { }
#[deprecated(since, not... | #[deprecated(since = "a", note)] //~ ERROR incorrect meta item |
<|file_name|>entry.rs<|end_file_name|><|fim▁begin|>use consts::*;
#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]
pub struct Entry {
pub cell: u8,
pub num: u8,
}
impl Entry {
#[inline] pub fn cell(self) -> usize { self.cell as usize }
#[inline] pub fn row(self) -> u8 { self.cell as u8 / 9 }
#[inlin... | |
<|file_name|>loading.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | //>>built
define("dijit/nls/da/loading",({loadingState:"Indlæser...",errorState:"Der er opstået en fejl"})); |
<|file_name|>deviceorientation.js<|end_file_name|><|fim▁begin|>goog.provide('ol.DeviceOrientation');
goog.provide('ol.DeviceOrientationProperty');
goog.require('goog.events');
goog.require('goog.math');
goog.require('ol.Object');
goog.require('ol.has');
/**
* @enum {string}
*/
ol.DeviceOrientationPrope... | 'getBeta',
ol.DeviceOrientation.prototype.getBeta);
|
<|file_name|>isyeventmonitor.py<|end_file_name|><|fim▁begin|>import base64
import errno
import random
import ssl
import threading
import time
import copy
import websocket
import xmltodict
import config
import debug
from utils import exitutils
import hubs.isy.isycodes as isycodes
import logsupport
from controlevents i... | |
<|file_name|>test_szig.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2.7
############################################################################
##
## Copyright (c) 2000-2015 BalaBit IT Ltd, Budapest, Hungary
## Copyright (c) 2015-2018 BalaSys IT Ltd, Budapest, Hungary
##
##
## This program is free softwar... | |
<|file_name|>compat.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
wakatime.compat
~~~~~~~~~~~~~~~
For working with Python2 and Python3.
:copyright: (c) 2014 Alan Hamlett.
:license: BSD, see LICENSE for more details.
"""
import codecs
import os
import platform
import subprocess
impo... | except:
pass |
<|file_name|>dvwa-login-bruteforce-http-post-csrf.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# Quick PoC template for HTTP POST form brute force, with anti-CRSF token
# Target: DVWA v1.10
# Date: 2015-10-19
# Author: g0tmi1k ~ https://blog.g0tmi1k.com/
# Source: https://blog.g0tmi1k.com/2015/10/dvwa-login/
im... | # Extract session information
session_id = re.match("PHPSESSID=(.*?);", r.headers["set-cookie"])
session_id = session_id.group(1)
print "[i] session_id: %s\n" % session_id |
<|file_name|>task_index.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
from changes.api.base import APIView
from changes.models import Task
class TaskIndexAPIView(APIView):
def get(self):
queryset = Task.query.order_by(Task.date_created.desc())
<|fim▁hole|><|fim▁end|> | return self.paginate(queryset) |
<|file_name|>macro-brackets.rs<|end_file_name|><|fim▁begin|>// Copyright 2018 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/... | |
<|file_name|>D0002FuncTest.java<|end_file_name|><|fim▁begin|>package top.cardone.func.vx.usercenter.userDepartment;
import com.google.common.base.Charsets;
import lombok.extern.log4j.Log4j2;
import lombok.val;
import org.apache.commons.io.FileUtils;
import org.junit.Before;
import org.junit.Test;
import org.junit.runn... | @Value("http://localhost:${server.port:8765}${server.servlet.context-path:}/vx/usercenter/userDepartment/d0002.json")
private String funcUrl;
|
<|file_name|>coqdomain.py<|end_file_name|><|fim▁begin|>##########################################################################
## # The Coq Proof Assistant / The Coq Development Team ##
## v # Copyright INRIA, CNRS and contributors ##
## <O___,, # (see version control and CR... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.