prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>LightComponent.cpp<|end_file_name|><|fim▁begin|>#include "LightComponent.h"
#include "../../utils/d3d.h"
#include "../GameObject.h"
#include "Transform.h"
namespace thomas
{
namespace object
{
namespace component
{
LightComponent::LightComponent()<|fim▁hole|> {
}
LightComponent::~LightCo... | |
<|file_name|>item_ring_set_commando_utility_b_01_01.py<|end_file_name|><|fim▁begin|>import sys
def setup(core, object):
object.setAttachment('radial_filename', 'ring/unity')
object.setAttachment('objType', 'ring')
object.setStfFilename('static_item_n')
object.setStfName('item_ring_set_commando_utility_b_01_01')
o... | object.setStringAttribute('@set_bonus:piece_bonus_count_4', '@set_bonus:set_bonus_commando_utility_b_2')
object.setStringAttribute('@set_bonus:piece_bonus_count_5', '@set_bonus:set_bonus_commando_utility_b_3')
object.setAttachment('setBonus', 'set_bonus_commando_utility_b') |
<|file_name|>_jobs_operations.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 gene... | request = _convert_request(request)
request.url = self._client.format_url(request.url)
|
<|file_name|>common-option-converter.ts<|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 req... | item.label.normal.rich['align']['fontSize'] = fontSize; |
<|file_name|>negfc_mcmc.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
"""
Module with the MCMC (``emcee``) sampling for NEGFC parameter estimation.
"""
__author__ = 'O. Wertz, Carlos Alberto Gomez Gonzalez, V. Christiaens'
__all__ = ['mcmc_negfc_sampling',
'chain_zero_truncated',
'show... | case ``save`` is True.
output_file: str, optional
The name of the output file which contains the MCMC results in the case
``save`` is True. |
<|file_name|>PerformanceProgressLogger.java<|end_file_name|><|fim▁begin|>/*!
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License, version 2.1 as published by the Free Software
* Foundation.
*
* You should have received a copy of the G... | private boolean logLevelProgress;
private boolean logRowProgress;
public PerformanceProgressLogger() { |
<|file_name|>test_setcomps.py<|end_file_name|><|fim▁begin|>doctests = """
########### Tests mostly copied from test_listcomps.py ############
Test simple loop with conditional
>>> sum({i*i for i in range(100) if i&1 == 1})
166650
Test simple case
>>> {2*y + x + 1 for x in (0,) for y in (1,)}
set([3]... | |
<|file_name|>checkGGPS2.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Tue Jun 12 13:45:31 2018
<|fim▁hole|><|fim▁end|> | @author: huyn
""" |
<|file_name|>package.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, t... |
homepage = "https://cran.r-project.org/package=ModelMetrics"
url = "https://cran.r-project.org/src/contrib/ModelMetrics_1.1.0.tar.gz"
|
<|file_name|>mux.go<|end_file_name|><|fim▁begin|>// Copyright 2012 The Gorilla Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package mux
import (
"errors"
"fmt"
"net/http"
"path"
"regexp"
"github.com/Ghostofpq/bigzelda/Gode... | |
<|file_name|>widget.tags.js<|end_file_name|><|fim▁begin|>/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2008-2009, The KiWi Project (http://www.kiwi-project.eu)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are per... | _init: function() { |
<|file_name|>signalGenerator.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#-*- coding: utf-8 -*-
'''
# This file is part of Matching Pursuit Python program (python-MP).
#
# python-MP is free software: you can redistribute it and/or modify<|fim▁hole|># python-MP is distributed in the hope that it will... | # it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# |
<|file_name|>RegistryImplUnitTests.cpp<|end_file_name|><|fim▁begin|>#include "StdAfxUnitTests.h"
#include "RegistryImplUnitTests.h"
#include "Registry.h"
using namespace AppSecInc::UnitTests::Registry;
CPPUNIT_TEST_SUITE_REGISTRATION(RegistryUnitTests);
void RegistryUnitTests::testGetStringValue()
{
std::... | CPPUNIT_ASSERT(StringUtils::startsWith(version, L"2."));
|
<|file_name|>xset.js<|end_file_name|><|fim▁begin|>'use strict';
const fs = require('fs');
const Q = require('q');
const exec = require('child_process').exec;
const searchpaths = ["/bin/xset"];
class XSetDriver {
constructor(props) {
this.name = "Backlight Control";
this.devicePath = "xset";
... | |
<|file_name|>base.py<|end_file_name|><|fim▁begin|># vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 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
# ... | try:
for item in body[self._collection]:
kwargs = {self._resource: item} |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from setuptools import setup, find_packages
import os
import sys
# This monstrous hack is to support /etc generation for the Debian package
# with fpm.
if sys.argv[1] == 'install' and os.environ.get('JACQUARD_DEBIAN_HACK'):
def debian_etc_hack(root):
impo... | 'jacquard.commands': (
'storage-dump = jacquard.storage.commands:StorageDump',
'storage-flush = jacquard.storage.commands:StorageFlush', |
<|file_name|>pageTab.js<|end_file_name|><|fim▁begin|>var myTabOption = [
{optionValue:"Default", optionText:"Default", addClass:"", url:"index.html"},
{optionValue:"scriptTab", optionText:"Script Tab", addClass:"", url:"scriptTab.html"}
//{optionValue:"script2Depth", optionText:"Script 2Depth", addClass:"", url:"sc... | options: myTabOption, |
<|file_name|>PhotoSizeSelectActual.js<|end_file_name|><|fim▁begin|>"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _createSvgIcon = _interopRequireDefault(require("./util... | exports.default = _default; |
<|file_name|>cpuspeed.py<|end_file_name|><|fim▁begin|>"""
Support for displaying the current CPU speed.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.cpuspeed/
"""
import logging
import voluptuous as vol
from homeassistant.components.sensor imp... | @property |
<|file_name|>ec2.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 License... |
params = {'Action': 'ModifyImageAttribute'}
params.update(attributes)
|
<|file_name|>imu_3d_widget.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
IMU Plugin
Copyright (C) 2015 Olaf Lüke <olaf@tinkerforge.com>
Copyright (C) 2015 Matthias Bolte <matthias@tinkerforge.com>
Copyright (C) 2019 Erik Fleckstein <erik@tinkerforge.com>
imu_3d_widget.py: IMU OpenGL representation
This ... | License along with this program; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
<|fim▁hole|>admin.site.register(Plugin_Video)<|fim▁end|> | from django.contrib import admin
from ionyweb.plugin_app.plugin_video.models import Plugin_Video
|
<|file_name|>api.py<|end_file_name|><|fim▁begin|>import json
import routing
from werkzeug.local import LocalProxy
from flask import Blueprint, request, current_app
blueprint = Blueprint('journal-api', __name__)
logging = LocalProxy(lambda: current_app.config['logging'])
@blueprint.errorhandler(404)
def return_404(... |
if success: |
<|file_name|>server.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import json, time
from flask import Flask, request, render_template, Response
from gevent import pywsgi, monkey
from helpers.generateCalibration import GenerateCalibration
#monkey.patch_all()
app = Flask(__name__)
#cameraInstance = Camera()
r... | if (int(this) > maxN): |
<|file_name|>test_hypervisor.py<|end_file_name|><|fim▁begin|># Copyright 2013 IBM Corporation
# 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:... | |
<|file_name|>qgscomposerview.cpp<|end_file_name|><|fim▁begin|>/***************************************************************************
qgscomposerview.cpp
-------------------
begin : January 2005
copyright : (C) 2005 by Radim Blazek... | |
<|file_name|>workarounds.py<|end_file_name|><|fim▁begin|>import urllib2
import re
JIRA_URL='https://bugreports.qt-project.org/browse'
class JIRA:
__instance__ = None
# Helper class
class Bug:
CREATOR = 'QTCREATORBUG'
SIMULATOR = 'QTSIM'
SDK = 'QTSDK'
QT = 'QTBUG'
Q... | |
<|file_name|>minCut_test.go<|end_file_name|><|fim▁begin|>package ldp
import (
"testing"
<|fim▁hole|>func Test_minCut(t *testing.T) {
assert := assert.New(t)
assert.Equal(1, minCut("aab"))
assert.Equal(0, minCut("aa"))
}<|fim▁end|> | "github.com/stretchr/testify/assert"
)
|
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import ContactList from './ContactList'
<|fim▁hole|><|fim▁end|> | export default ContactList |
<|file_name|>issue-44912-or.rs<|end_file_name|><|fim▁begin|>// FIXME(tschottdorf): This should compile. See #44912.
pub fn main() {<|fim▁hole|> let _: &i32 = match x {
Some((x, 3)) | &Some((ref x, 5)) => x,
//~^ ERROR is bound inconsistently
_ => &5i32,
};
}<|fim▁end|> | let x = &Some((3, 3)); |
<|file_name|>provision.py<|end_file_name|><|fim▁begin|># 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 2 of the License, or
# (at your option) any later version.
import sys
impor... | for attempt in range(1, conf['POWER_ATTEMPTS'] + 1):
if attempt > 1: |
<|file_name|>serving.rs<|end_file_name|><|fim▁begin|>// Copyright (c) 2016-2018 The http-serve developers
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE.txt or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT.txt or http://opensource.org/licenses/MIT>, at your
// o... | |
<|file_name|>util.cpp<|end_file_name|><|fim▁begin|>// Copyright (c) 2012 Oliver Lau <ola@ct.de>, Heise Zeitschriften Verlag
// All rights reserved.
#include "util.h"
#include <qmath.h>
QRgb rgbFromWaveLength(qreal wave)
{
qreal r = 0, g = 0, b = 0;
if (wave >= 380 && wave <= 440) {
r = -(wave - 440) ... | |
<|file_name|>virtual_network_gateway_connection_list_entity_py3.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 fo... | |
<|file_name|>import_visits.py<|end_file_name|><|fim▁begin|>import csv, os
from Products.CMFCore.utils import getToolByName
def get_folder(self, type, name):
folder_brains = self.queryCatalog({'portal_type':type, 'title':name})[0]
return folder_brains.getObject()
def create_object_in_directory(self, container,... | student.edit(title=student_name, instrument=instrument, email=student_email, phone=student_phone, address=student_address, city=student_city, zip=student_zip)
contact.edit(title=contact_name, type=contact_title, phone=contact_phone, email=contact_email, isAlumni=is_contact_alumni)
faculty.edit(t... |
<|file_name|>fsop_nocgo_windows.go<|end_file_name|><|fim▁begin|>// +build !cgo,windows
/*
* fsop_nocgo_windows.go
*
* Copyright 2017-2020 Bill Zissimopoulos
*/
/*
* This file is part of Cgofuse.
*
* It is licensed under the MIT license. The full license text can be found
* in the License.txt file at the root o... | |
<|file_name|>test_utils.py<|end_file_name|><|fim▁begin|>from nose.tools import * # flake8: noqa
from django.db.models import Q
from tests.base import AdminTestCase
from osf_tests.factories import SubjectFactory
from osf.models import Subject
from osf.models.preprint_provider import rules_to_subjects
from admin.bas... | self.child_one_2
]
rules_returned = get_subject_rules(subjects_selected)
rules_ideal = [[[self.parent_one._id], True]] |
<|file_name|>test_column.py<|end_file_name|><|fim▁begin|>import unittest
import pandas as pd
from pandas_schema import Column
from pandas_schema.validation import CanConvertValidation, LeadingWhitespaceValidation, TrailingWhitespaceValidation
class SingleValidationColumn(unittest.TestCase):
"""
Test a column... | class DoubleValidationColumn(unittest.TestCase):
""" |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>'use strict';
var yeoman = require('yeoman-generator'),
chalk = require('chalk'),<|fim▁hole|> glob = require('glob'),
path = require('path'),
_ = require('lodash');
// placeholder for CM implementaiton delivering a BASH-based project.
var BakeryCM = yeoman.Base... | yosay = require('yosay'),
bakery = require('../../lib/bakery'),
feedback = require('../../lib/feedback'),
debug = require('debug')('bakery:generators:cm-bash:index'), |
<|file_name|>gen_graph.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from __future__ import print_function
import argparse
import array
import math
import os
import random
import sys
import subprocess
def create_graph(nodes, edges, verbose):
if verbose: print('Creating random graph with {} nodes and {} e... | |
<|file_name|>armv7_unknown_linux_musleabihf.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:/... | |
<|file_name|>GameMenuViewModel.py<|end_file_name|><|fim▁begin|>from wx import wx
from Converter import Converter
class GameMenuViewModel(object):
def __init__(self, viewSetter):
self.viewSetter = viewSetter
def displayGameMenu(self):
wx.CallAfter(self.viewSetter.setView, "GameMenu")
<|fim▁h... | def animateCurrentPrices(self, currentPricesJavaMap):
wx.CallAfter(
self.viewSetter.getView("GameMenu").animateCurrentPrices,
Converter(self.viewSetter.gateway).convertJavaMapToDict(currentPricesJavaMap) |
<|file_name|>form_interface.ts<|end_file_name|><|fim▁begin|>import {NgControl} from './ng_control';
import {NgControlGroup} from './ng_control_group';
import {Control} from '../model';
/**
* An interface that {@link NgFormModel} and {@link NgForm} implement.
*
* Only used by the forms module.<|fim▁hole|>export inte... | */ |
<|file_name|>test_assert_all_of_selectors.py<|end_file_name|><|fim▁begin|>import pytest
import re
import capybara
from capybara.exceptions import ElementNotFound
class TestAssertAllOfSelectors:
@pytest.fixture(autouse=True)
def setup_session(self, session):
session.visit("/with_html")
def test_d... | session.assert_all_of_selectors(".//a[@id='foo']")
with pytest.raises(ElementNotFound):
session.assert_all_of_selectors(".//a[@id='red']") |
<|file_name|>approximation.rs<|end_file_name|><|fim▁begin|>use clap::{App, Arg, ArgMatches, SubCommand};
use log_domain::LogDomain;
use rustomata::approximation::equivalence_classes::EquivalenceRelation;
use rustomata::approximation::relabel::RlbElement;
use rustomata::approximation::tts::TTSElement;
use rustomata::app... | ("automaton", Some(parse_matches)) => {
let grammar_file_name = parse_matches.value_of("grammar").unwrap(); |
<|file_name|>op.js<|end_file_name|><|fim▁begin|>'use strict';
/*!
* Snakeskin
* https://github.com/SnakeskinTpl/Snakeskin
*
* Released under the MIT license
* https://github.com/SnakeskinTpl/Snakeskin/blob/master/LICENSE
*/
import Snakeskin from '../core';
Snakeskin.addDirective(
'op',
{
block: true,
gr... | ); |
<|file_name|>cardgen.rs<|end_file_name|><|fim▁begin|>// Copyright: Ankitects Pty Ltd and contributors
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
use super::NoteType;
use crate::{
card::{Card, CardID},
cloze::add_cloze_numbers_in_string,
collection::Collection,
deckc... | target_deck_id: Option<DeckID>,
cache: &mut CardGenCache, |
<|file_name|>plot_knn_regression.py<|end_file_name|><|fim▁begin|>import numpy as np
import matplotlib.pyplot as plt
from sklearn.neighbors import KNeighborsRegressor
from sklearn.metrics import euclidean_distances
from .datasets import make_wave
from .plot_helpers import cm3
def plot_knn_regression(n_neighbors=1):
... | |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from datetime import datetime
from mongoengine import *
from mongoengine.django.auth import User
from django.core.urlresolvers import reverse
import mongoengine.fields
# Create your models here.
class Evento(Document):
titulo = StringField(max_length=200, required=... | # 'indexes': [[("local", "2dsphere"), ("data_modificacao", 1)]]
# } |
<|file_name|>themes.js<|end_file_name|><|fim▁begin|>module.exports = {
light: {
background1: 'rgba(227,227,227,.95)',
background2: 'rgba(204,204,204,.95)',
background2hover: 'rgba(208,208,208,.95)',
foreground1: 'rgba(105,105,105,.95)',
text1: 'rgba(36,36,36,.95)',
text2: 'rgba(87,87,87,.95)'
... | } |
<|file_name|>Codegen.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2009 The Android Open Source Project
*
* 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... | #include "compiler/CompilerInternals.h"
#include "compiler/codegen/arm/ArmLIR.h" |
<|file_name|>sprite_creator.py<|end_file_name|><|fim▁begin|>from PIL import Image
from math import ceil, floor
def load_img(src):
return Image.open(src)
def create_master(width, height):
return Image.new("RGBA", (width, height))
def closest_power_two(num):
result = 2
while result < num:
resul... | from functools import reduce
def generator(name, action, position, frames):
if frames > 1:
return [load_img("img/png/1x/{0}/{1}{2} ({3}).png".format(name, action, position, frame)) for frame in range(1, frames + 1)] |
<|file_name|>match-value-binding-in-guard-3291.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
// htt... | |
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# fmap documentation build configuration file, created by
# sphinx-quickstart on Mon Apr 11 21:30:39 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values ... | # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. |
<|file_name|>share_servers.py<|end_file_name|><|fim▁begin|># Copyright 2014 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
#
# h... | from urllib.parse import urlencode # noqa
from manilaclient import base
from manilaclient.openstack.common.apiclient import base as common_base |
<|file_name|>parse_node.rs<|end_file_name|><|fim▁begin|>/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This software may be used and distributed according to the terms of the
* GNU General Public License version 2.
*/
use crate::graph::{
AliasKey, AliasType, ChangesetKey, FastlogKey, Node, NodeTy... | }
let mpath = match parts[1..].join(NODE_SEP).as_str() {
"/" => None,
p => Some(MPath::new(p)?), |
<|file_name|>0009_auto_20160623_1141.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-06-23 15:41
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
... | migrations.AddField(
model_name='review',
name='keyword_proposed',
field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, related_name='keyword_proposed', to='mendel.Keyword'), |
<|file_name|>serializers.py<|end_file_name|><|fim▁begin|>from rest_framework import serializers as ser
from rest_framework import exceptions
from framework.auth.oauth_scopes import public_scopes
from website.models import ApiOAuth2PersonalToken
from api.base.serializers import JSONAPISerializer, LinksField, IDField, ... | scopes_set = set(validated_data['scopes'].split(' '))
for scope in scopes_set:
if scope not in public_scopes or not public_scopes[scope].is_public: |
<|file_name|>import.parameter.expression.default.js<|end_file_name|><|fim▁begin|>var Helper = require("@kaoscript/runtime").Helper;
module.exports = function() {
var path = require("path");<|fim▁hole|> require("../require/require.string.ks")(Helper.cast(path.join(__dirname, "foobar.txt"), "String", false, null, "Strin... | |
<|file_name|>serializers.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.core.urlresolvers import reverse_lazy
from django.conf import settings
from rest_framework import serializers
from rest_flex_fields import FlexFieldsModelSerializer
from rest_flex_field... | ct = serializers.CharField(source="get_ct")
detail_url = serializers.URLField(source="get_absolute_url") |
<|file_name|>dagre-d3.d.ts<|end_file_name|><|fim▁begin|>// Type definitions for dagre-d3.core.js
// Project: https://github.com/cpettitt/dagre-d3
// Definitions by: Mark Wong Siang Kai <https://github.com/markwongsk>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../d3/d3.d.ts"... | } |
<|file_name|>basic_shape.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/. */
//! CSS handling for the [`basic-shape`](https://drafts.c... | }
/// <https://drafts.csswg.org/css-shapes/#funcdef-inset>
#[allow(missing_docs)] |
<|file_name|>poster1.py<|end_file_name|><|fim▁begin|>import matplotlib as mpl
mpl.rcParams['font.size'] = 14
from morphforge.stdimports import *
from morphforgecontrib.stdimports import *
eqnset_txt_na = """
define_component hh_na {
i = g * (v-erev) * m**3*h
m_inf = m_alpha_rate / (m_alpha_rate + m_beta_rate... | # Setup passive channels:
cell.set_passive( PassiveProperty.SpecificCapacitance, qty('1.0:uF/cm2'))
# Setup active channels: |
<|file_name|>syntax-error.ts<|end_file_name|><|fim▁begin|>//
// Copyright © Daniel T. Gorski <dtg [at] lengo [dot] org> et al.
//
export class SyntaxError {
public name: string;
public stack: string;
public constructor(
public message = "",
public line = 0,<|fim▁hole|> ) {
t... | public column = 0,
public cursor = 0 |
<|file_name|>security_group.py<|end_file_name|><|fim▁begin|># Copyright 2014 Netflix, 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... | elif self.get_detail_level() == 'FULL':
assigned_to = [] |
<|file_name|>strings.js<|end_file_name|><|fim▁begin|><|fim▁hole|> ({
showLayerLabels: "Εμφάνιση των ονομάτων των θεματικών επιπέδων στο widget για χωρο-χρονικά θεματικά επίπεδα."
})
);<|fim▁end|> | define( |
<|file_name|>animator_server.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import glob
import cv2
import cv_bridge
import rospy
from sensor_msgs.msg import Image
from std_msgs.msg import Int32, Float32
import rospkg
import sys
class Animation:
def __init__(self, directory):
self.fnames = [fname fo... | |
<|file_name|>InputFeedback.tsx<|end_file_name|><|fim▁begin|>import * as React from 'react'
import styled from 'styled-components'
import { colors } from 'styles/variables'
interface InputFeedbackProps {
className?: string
valid?: boolean
}
const InputFeedback: React.SFC<InputFeedbackProps> = ({ className, childre... | width: 100%;
margin-top: 0.25rem; |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Copyright © 2015, Peter Atashian
// Licensed under the MIT License <LICENSE.md><|fim▁hole|>//! FFI bindings to iesetup.
#![no_std]
#![experimental]
extern crate winapi;
use winapi::*;
extern "system" {
}<|fim▁end|> | |
<|file_name|>webpack.config.test.js<|end_file_name|><|fim▁begin|><|fim▁hole|>/*eslint-disable */
var webpack = require( "webpack" );
var sml = require( "source-map-loader" );
/*eslint-enable */
var path = require( "path" );
module.exports = {
module: {
preLoaders: [
{
test: /\.js$/,
loader: "source-map-l... | |
<|file_name|>test_thoughts.py<|end_file_name|><|fim▁begin|>import xmlrpclib as xml
import time
# connect to environment via XML-RPC
e = xml.ServerProxy('http://localhost:8001')
def sense():
return e.do('sense', {'agent':'Ralph'})
def step(time):
e.do('meta_step', {'seconds':time})
<|fim▁hole|>def do(command, ... | |
<|file_name|>Gauss2.py<|end_file_name|><|fim▁begin|><|fim▁hole|># -*- coding: utf-8 -*-
"""
Created on Thu Sep 21 16:29:34 2017
@author: ishort
"""
import math
""" procedure to generate Gaussian of unit area when passed a FWHM"""
#IDL: PRO GAUSS2,FWHM,LENGTH,NGAUS
def gauss2(fwhm, length):
... | |
<|file_name|>snative.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/LIC... | * @return result the global permissions flags after the call
`, |
<|file_name|>mongo_cache.py<|end_file_name|><|fim▁begin|># -*- encoding:utf8 -*-
"""<|fim▁hole|>reload(sys)
sys.setdefaultencoding('utf8')
import json
from pymongo import MongoClient
from datetime import datetime, timedelta
from bson.binary import Binary
import zlib
import time
class MongoCache:
def __init__(self... | 使用mongodb作为缓存器
测试本地缓存
"""
import sys |
<|file_name|>forms.py<|end_file_name|><|fim▁begin|>from django.forms import ModelForm, ModelChoiceField
from django.utils.translation import ugettext_lazy as _
from apps.task.models import Task
class FormChoiceField(ModelChoiceField):
def label_from_instance(self, obj):
return obj.name<|fim▁hole|>
class TaskForm... | |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import setuptools
<|fim▁hole|> name="aecg100",
version="1.1.0.18",
author="WHALETEQ Co., LTD",
description="WHALETEQ Co., LTD AECG100 Linux SDK",
url="https://www.whaleteq.com/en/Support/Download/7/Linux%20SDK",
include_pac... | if __name__ == "__main__":
setuptools.setup( |
<|file_name|>process.py<|end_file_name|><|fim▁begin|>from .logging import debug, exception_log
from .typing import Any, List, Dict, Callable, Optional, IO
import os
import shutil
import subprocess
import threading
def add_extension_if_missing(server_binary_args: List[str]) -> List[str]:
if len(server_binary_args)... | process = subprocess.Popen( |
<|file_name|>media3.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# vim:fileencoding=utf-8
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>'
from tinycss.css21 import... | class MalformedExpression(Exception):
|
<|file_name|>index.d.ts<|end_file_name|><|fim▁begin|>/*
* @license Apache-2.0
*
* Copyright (c) 2021 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apac... | /* tslint:disable:max-line-length */
/* tslint:disable:max-file-line-count */
import base = require( '@stdlib/number/uint16/base' ); |
<|file_name|>disallow_re_export_all_in_page.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>use swc_ecmascript::visit::{noop_fold_type, Fold};
pub fn disallow_re_export_all_in_page(is_page_file: bool) -> impl Fold {
Optional::new(
DisallowReExportAllInPage,
is_page_file
)
}
struct DisallowReExportAllInPage;
... | use swc_common::pass::Optional;
use swc_ecmascript::ast::ExportAll;
use swc_ecmascript::utils::HANDLER; |
<|file_name|>RestartDialog.tsx<|end_file_name|><|fim▁begin|>import React from 'react'
import { useDispatch } from 'react-redux'
import Button from '@material-ui/core/Button'
import Checkbox from '@material-ui/core/Checkbox'
import { DialogProps } from '@material-ui/core/Dialog'
import DialogTitle from '@material-ui/co... | <Divider className={classes.divider} />
<Typography variant="caption">
Choose where will begin progress of the restarted item |
<|file_name|>spec.go<|end_file_name|><|fim▁begin|>// Copyright 2015 go-swagger maintainers
//
// 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-... | return d.origSpec
} |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>"""Document management blueprint."""
from __future__ import annotations
from flask import g
from abilian.i18n import _l
from abilian.sbe.apps.communities.blueprint import Blueprint
from abilian.sbe.apps.communities.security import is_manager
from abilian.sbe.apps.doc... | |
<|file_name|>constellation_msg.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/. */
//! The high-level interface from script to constel... | I,
J, |
<|file_name|>test_http.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
import unittest
import run_tests # set sys.path
import tempfile
import os
from kobo.http import *
class TestPOSTTransport(unittest.TestCase):
def setUp(self):
self.postt = POSTTransport()
def test_get_content_type(self):
tf... | #!/usr/bin/python
# -*- coding: utf-8 -*-
|
<|file_name|>development.js<|end_file_name|><|fim▁begin|>'use strict';
module.exports = {
db: {
dbName:'sean-dev',
username : 'SeanDB',
password : 'HU7XQQBNWq',
dialect: "postgres", // 'sqlite', 'postgres', 'mariadb','mysql'
port : 5432 // 5432 for postgres, 3306 for mysql and ma... | mailer: { |
<|file_name|>recursive_auto_encoder.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging, os
logging.basicConfig(level=logging.INFO)
from deepy.networks import RecursiveAutoEncoder
from deepy.trainers import SGDTrainer, LearningRateAnnealer
from util import get_data, VECTOR_SI... |
model.save_params(model_path) |
<|file_name|>stringattr.py<|end_file_name|><|fim▁begin|>import re
from collections import namedtuple, deque
from .regex import RE_SPLIT, RE_KEY, RE_INDEX
from .utils import Enum, _missing
StackItem = namedtuple('StackItem', ['name', 'access_method'])
# Accessor methods:
# INDEX means this accessor is index or key-b... |
def _get(self, obj, stack, default=_missing):
"""Retrieve value from an object structure given a list of
attributes.""" |
<|file_name|>532-unleash-payments-in-usa.py<|end_file_name|><|fim▁begin|>from olympia import amo<|fim▁hole|>import mkt
from mkt.webapps.models import AddonExcludedRegion
def run():
"""Unleash payments in USA."""
(AddonExcludedRegion.objects
.exclude(addon__premium_type=amo.ADDON_FREE)
.filter(region... | |
<|file_name|>migrate_dashboard_searches.py<|end_file_name|><|fim▁begin|>from django.core.management.base import BaseCommand
from optparse import make_option
from crits.dashboards.dashboard import SavedSearch
class Command(BaseCommand):
"""
Script Class.
"""
help = 'Creates the default dashboard.'
... | |
<|file_name|>DateParam.java<|end_file_name|><|fim▁begin|>/**
* Copyright (C) 2012 Ness Computing, 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/license... | import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
|
<|file_name|>user.js<|end_file_name|><|fim▁begin|>const userDao = require('../dao/user'),
tokenDao = require('../dao/token'),
appDao = require('../dao/app'),
tokenRedisDao = require('../dao/redis/token'),
userRedisDao = require('../dao/redis/user'),
passport = require('../service/passport'),
STA... | }; |
<|file_name|>base.py<|end_file_name|><|fim▁begin|># Copyright 2017 OP5 AB
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not u... |
class EmptyPolicyFixture(fixtures.Fixture): |
<|file_name|>0007_themes_high_contrats_logo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-09-21 00:22
from __future__ import unicode_literals
from django.db import migrations, models
import themes.models
class Migration(migrations.Migration):
dependencies = [
... | ), |
<|file_name|>sign_kernel.cc<|end_file_name|><|fim▁begin|>/* Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/l... | |
<|file_name|>Users.js<|end_file_name|><|fim▁begin|>import React from 'react';
import PropTypes from 'prop-types';
import { Link } from 'react-router-dom';
import List from '../../components/List';
import UserIcon from '../../icons/User';
const Item = (props) => {
const { className, item: user } = props;
const clas... | avatar = <UserIcon className="avatar" />;
}
return (
<Link className={classNames.join(' ')} to={`/users/${user._id}`}> |
<|file_name|>IMapAsyncTest.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2008-2013, Hazelcast, Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http... | import java.util.concurrent.CountDownLatch; |
<|file_name|>files.py<|end_file_name|><|fim▁begin|>import six
#==============================================================================
# https://docs.python.org/2/library/csv.html
#==============================================================================
if six.PY2:
import csv
import codecs
i... |
class UnicodeWriter:
"""
A CSV writer which will write rows to CSV file "f", |
<|file_name|>heapview.rs<|end_file_name|><|fim▁begin|>use l2::ast::*;
use std::vec::Vec;
#[derive(Clone, Copy)]
pub enum HeapCellView<'a> {
Str(usize, &'a Atom),
Var(usize)
}
pub struct HeapCellViewer<'a> {
heap: &'a Heap,
state_stack: Vec<(usize, &'a HeapCellValue)>
}
impl<'a> HeapCellViewer<'a> {
... | (_, &HeapCellValue::Ref(cell_num)) => { |
<|file_name|>shared.py<|end_file_name|><|fim▁begin|>from os.path import abspath
import sys
import logging
editorconfig_path = abspath('editorconfig-core-py/')
if editorconfig_path not in sys.path:
sys.path.append(editorconfig_path)
from editorconfig import get_properties, EditorConfigError
class EditorConfigPlu... | if properties.get('trim_trailing_whitespace') == 'true':
properties['trim_trailing_whitespace'] = True
else:
properties['trim_trailing_whitespace'] = False |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.