prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>config_options.py<|end_file_name|><|fim▁begin|>## \file config_options.py
# \brief python package for config
# \author T. Lukaczyk, F. Palacios
# \version 6.1.0 "Falcon"
#
# The current SU2 release has been coordinated by the
# SU2 International Developers Society <www.su2devsociety.org>
# with selec... |
def __init__(self,*args,**kwarg):
ordered_bunch.__init__(self)
self.FFDTAG = []
|
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>extern crate byteorder;
extern crate elf;
use std::path::PathBuf;
use std::fs::{File, OpenOptions};
use std::io::*;
use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt};
use std::process::Command;
static BOOT_FILE_BLOCK_SIZE :u32 = 512;
static BOOT_FILE_HEADER_LE... | |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from datetime import datetime
from decimal import Decimal
from django.contrib.sites.models import Site
from django.db import models
from django.utils.translation import ugettext_lazy as _
from l10n.utils import moneyfmt
from payment.modules.giftcertificate.utils impor... | site = models.ForeignKey(Site, null=True, blank=True, verbose_name=_('Site')) |
<|file_name|>options.cc<|end_file_name|><|fim▁begin|>/*
* Copyright © 2011,2012 Google, Inc.
*
* This is part of HarfBuzz, a text shaping library.
*
* Permission is hereby granted, without written agreement and without
* license or royalty fees, to use, copy, modify, and distribute this
* software and its docu... | format_options_t *format_opts = (format_options_t *) data;
format_opts->show_text = format_opts->show_unicode = format_opts->show_line_num = true; |
<|file_name|>email.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | export { default, email } from '@abcum/ember-helpers/helpers/email'; |
<|file_name|>index.js<|end_file_name|><|fim▁begin|><|fim▁hole|>* @Author: yw850
* @Date: 2017-07-24 18:13:22
* @Last Modified by: yw850
* @Last Modified time: 2017-07-24 18:41:42
*/
'use strict';
require('./index.css')
require('page/common/header/index.js');
require('page/common/nav/index.js');
var _mm = requir... | /* |
<|file_name|>manage.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django_propeller_demo.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
#... | import django
except ImportError:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and " |
<|file_name|>TraceTree.java<|end_file_name|><|fim▁begin|>package nest.util;
import android.text.TextUtils;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import timber.log.Timber;
public class TraceTree extends Timber.HollowTree {
private final DebugTree debugTree;
public TraceTree(boolea... | if (lastTrace != null) {
message = (TextUtils.isEmpty(message) ? "" : message +" ") + "at "+ lastTrace;
lastTrace = null; |
<|file_name|>number.py<|end_file_name|><|fim▁begin|>"""Configure number in a device through MQTT topic."""
from __future__ import annotations
import functools
import logging
import voluptuous as vol
from homeassistant.components import number
from homeassistant.components.number import (
DEFAULT_MAX_VALUE,
D... | vol.Optional(CONF_VALUE_TEMPLATE): cv.template,
}, |
<|file_name|>jquery.fs.stepper.js<|end_file_name|><|fim▁begin|>;(function ($, window) {
"use strict";
/**
* @options
* @param customClass [string] <''> "Class applied to instance"
* @param lables.up [string] <'Up'> "Up arrow label"
* @param lables.down [string] <'Down'> "Down arrow label"
*/
var options =... | // Bind keyboard events
$stepper.on("keypress", ".stepper-input", data, _onKeyup);
|
<|file_name|>signup.js<|end_file_name|><|fim▁begin|>$(function() {
$('input:not(.button)').blur(function() {
if (validation.isFieldValid(this.id, $(this).val())) {
$('.error').text('').hide();<|fim▁hole|> });
});<|fim▁end|> | } else {
$('.error').text(validation.form[this.id].errorMessage).show();
} |
<|file_name|>Location.java<|end_file_name|><|fim▁begin|>package com.weatherapp.model.entities;
import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
@JsonIgnoreProperties(ignoreUnknown = true)
public class Location implements Serializable {
/**
*
*/
private stat... | public String getName() {
|
<|file_name|>roomba.py<|end_file_name|><|fim▁begin|>"""Class for Roomba devices."""
import logging
from homeassistant.components.vacuum import SUPPORT_FAN_SPEED
from .irobot_base import SUPPORT_IROBOT, IRobotVacuum
_LOGGER = logging.getLogger(__name__)
ATTR_BIN_FULL = "bin_full"
ATTR_BIN_PRESENT = "bin_present"
FA... | def fan_speed_list(self):
"""Get the list of available fan speed steps of the vacuum cleaner."""
return FAN_SPEEDS
|
<|file_name|>resources.py<|end_file_name|><|fim▁begin|>from pyramid.security import ALL_PERMISSIONS, Allow, Authenticated
from .models import DBSession, Distro, Package, Upstream, User
from uptrack.schemas import DistroSchema, UpstreamSchema, UserSchema
resources = {}
class RootFactory(object):
__name__ = 'Roo... | __schema__ = DistroSchema
class PackageResource(BaseResource): |
<|file_name|>async_client.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# 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/lic... | # Quick check: If we got a request object, we should *not* have
# gotten any keyword arguments that map to the request. |
<|file_name|>get_value.rs<|end_file_name|><|fim▁begin|>use machine::Machine;
use process::Context;<|fim▁hole|>pub trait GetValue {
fn get_value(&self, vm: &Machine, context: &Context) -> i32;
fn get_value_long(&self, vm: &Machine, context: &Context) -> i32 {
self.get_value(vm, context)
}
}<|fim▁end|... | |
<|file_name|>attr-before-view-item.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.apac... | |
<|file_name|>grades.py<|end_file_name|><|fim▁begin|>from django import template
from ..models import Grade
register = template.Library()
@register.filter
def to_grade_number(year):
"""Returns a `Grade` object for a year."""
return Grade(year).number
@register.filter<|fim▁hole|><|fim▁end|> | def to_grade_name(year):
"""Returns a `Grade` object for a year."""
return Grade(year).name |
<|file_name|>index.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | module.exports = require('./lib/bionode-bwa') |
<|file_name|>svggraphicselement.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<|fim▁hole|>use crate::dom::document::Document;
use crate::dom::svgelement::SVGElement;
use crate::dom::virtualmeth... | * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::inheritance::Castable; |
<|file_name|>app.py<|end_file_name|><|fim▁begin|>from freight.models import App, Repository
from .base import Serializer
from .manager import add
@add(App)
class AppSerializer(Serializer):
def serialize(self, item, attrs):
env_map = {}
for env, env_data in list(item.environments.items()):
... | |
<|file_name|>macro-of-higher-order.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.apac... | // run-pass |
<|file_name|>fs.py<|end_file_name|><|fim▁begin|><|fim▁hole|>def unescape(s):
s = s.replace("<", "<")
s = s.replace(">", ">")
# this has to be last:
s = s.replace("&", "&")
return s
class FilesystemMixin:
def h_fs_get(_,path,eltName=''):
from stat import S_ISDIR
data = ... | import os,json
from cgi import escape |
<|file_name|>log_syntax-trace_macros-macro-locations.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
... | // make sure these macros can be used as in the various places that
// macros can occur. |
<|file_name|>generic-static-methods.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.apa... | // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms. |
<|file_name|>RivGridPartMgr.cpp<|end_file_name|><|fim▁begin|>/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2011- Statoil ASA
// Copyright (C) 2013- Ceetron Solutions AS
// Copyright (C) 2011-2012 Ceetron AS
//
// ResInsight is free software: you can r... | //--------------------------------------------------------------------------------------------------
///
//-------------------------------------------------------------------------------------------------- |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>""" Telewall. This application connects to asterisk and provides Statis-Apps.
It has a user interface using a button, display and led. It also provides
a web interface.<|fim▁hole|><|fim▁end|> |
The Application should be run using python 2.7, because ARI (Asterisk REST Interface) does not support python 3.
""" |
<|file_name|>flat-table.config.js<|end_file_name|><|fim▁begin|>export const FLAT_TABLE_THEMES = [
"light",
"dark",
"transparent-base",
"transparent-white",
];<|fim▁hole|>export const FLAT_TABLE_SIZES = ["compact", "small", "medium", "large"];<|fim▁end|> | |
<|file_name|>walk_test.go<|end_file_name|><|fim▁begin|>// Copyright (C) 2014 The Syncthing Authors.
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this file,
// You can obtain one at https://mozilla.org/MPL/2.0/.
package scann... | Dir: "testdata/bar",
BlockSize: 128 * 1024,
}) |
<|file_name|>perfectcuboid.go<|end_file_name|><|fim▁begin|>package main
import (<|fim▁hole|> "sync"
)
const NUM_CONCURRENT_CUBOID_SEARCHES = 50
type Cuboid struct {
Length float64
Width float64
Height float64
BottomFaceDiagonalLength float64
SideFaceDiagonalLength float64
FrontFaceDiagonalLength float64
Space... | "flag"
"fmt"
"math" |
<|file_name|>adaptive_input.py<|end_file_name|><|fim▁begin|># Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from typing import List
import torch
from torch import nn<|fim▁hole|>class Adapt... |
from fairseq.modules.quant_noise import quant_noise
|
<|file_name|>package.py<|end_file_name|><|fim▁begin|># Copyright 2013-2021 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)
#
# Original Author: Mark Olesen <mark.olesen@esi-group.com>
#
# Lega... | add_extra_files(self, self.common, self.assets) |
<|file_name|>oauth_utils.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3
from .compat import BaseHTTPRequestHandler, HTTPServer
import urllib
import json
import sys
import time
import warnings
from slackly import SlackClient
warnings.warn("This part of slackly (oauth_utils) is highly experimental and will likely ... | host, query = urllib.parse.splitquery(self.path)
query_values = urllib.parse.parse_qs(query) |
<|file_name|>test_validation.py<|end_file_name|><|fim▁begin|>from decimal import Decimal
from voluptuous import MultipleInvalid
from minfraud.validation import validate_transaction, validate_report
import unittest
class ValidationBase:
def setup_transaction(self, transaction):
if "device" not in transac... | |
<|file_name|>bitcoingui.cpp<|end_file_name|><|fim▁begin|>// Copyright (c) 2011-2014 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "bitcoingui.h"
#include "bitcoinunits.h"
#include "clientmo... | appMenuBar = menuBar();
#endif |
<|file_name|>new_visualization_dialog.js<|end_file_name|><|fim▁begin|>/**
* Dialog to add a new visualization from any of your
* existing tables.
*
*/
cdb.admin.NewVisualizationDialogTableItem = cdb.core.View.extend({
events: {
"click .remove" : "_onRemove"
},
tagName: "li",
className: "table",
ini... | title: _t('Create visualization'),
loading_data: _t('Loading data…'),
description: _t('Select the layers you will use on this visualization (you will be able to add more later)'),
new_vis_title: _t("Give a name to your visualization"), |
<|file_name|>FormattingTuple.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 You und... |
public String getMessage() { |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""Main module."""
import os
import pygame
import signal
import logging
import argparse
from threading import Event
from multiprocessing import Value
from injector import Injector, singleton
from ballercfg import ConfigurationManager
from .locals import * # noqa... | while not self.shutdown.is_set():
# Pump/handle events (both pygame and akurra) |
<|file_name|>example.ts<|end_file_name|><|fim▁begin|>// ⚪ Initialization
let canvas = document.getElementById('game') as HTMLCanvasElement;
var gl = canvas.getContext('webgl');
if (!gl) {
throw new Error('Could not create WebGL Context!');
}
// 🔲 Create NDC Space Quad (attribute vec2 position)
let ndcQuad = [ 1.0, ... | gl.attachShader(program, vs); |
<|file_name|>reportcase.py<|end_file_name|><|fim▁begin|>import copy
from corehq.pillows.case import CasePillow
from corehq.pillows.mappings.reportcase_mapping import REPORT_CASE_MAPPING, REPORT_CASE_INDEX
from django.conf import settings
from .base import convert_property_dict
<|fim▁hole|> """
Simple/Common Case... |
class ReportCasePillow(CasePillow): |
<|file_name|>01-run.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python3
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2016 Martine Lenders <mail@martine-lenders.eu>
#
# Distributed under terms of the MIT license.
from __future__ import print_function
import os
import sys
import random
import subprocess
... | |
<|file_name|>namednodemap.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::Binding... | fn new_inherited(elem: JSRef<Element>) -> NamedNodeMap {
NamedNodeMap { |
<|file_name|>ImplementedCommonColumnAutoSetupper.java<|end_file_name|><|fim▁begin|>package info.bati11.otameshi.dbflute.allcommon;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.dbflute.Entity;
import org.dbflute.hook.CommonColumnAutoSetupper;
/**
* The basic implementation of the auto set-uppe... | // ==========
/** The logger instance for this class. (NotNull) */ |
<|file_name|>copy-tpl.js<|end_file_name|><|fim▁begin|>'use strict';
var path = require('path');
var _ = require('lodash');
module.exports = function (from, to, context, tplSettings) {
context = context || {};
tplSettings = tplSettings || {};<|fim▁hole|> process: function (contents) {
return _.template(co... | this.copy(from, to, { |
<|file_name|>experiment_tuple_n25k8.py<|end_file_name|><|fim▁begin|><|fim▁hole|>last updated: 05/27/2015
A module for replicating the 25 total arms with 8 arms shown at a time tuple bandits pure exploration
experiments from the NEXT paper.
Usage:
python experiment_tuple_n25k8.py
"""
import os, sys
# The line below i... | """
author: Lalit Jain, lalitkumarjj@gmail.com
modified: Chris Fernandez, chris2fernandez@gmail.com |
<|file_name|>example.rs<|end_file_name|><|fim▁begin|>// Ignoring the README's injunction, this is heavily based on the implementation from maplit.
// Original source is at https://github.com/bluss/maplit/blob/master/src/lib.rs#L27-L60
#[macro_export]<|fim▁hole|> let mut _map = ::std::collections::HashMap::n... | macro_rules! hashmap {
($($key:expr => $value:expr,)+) => { hashmap!($($key => $value),+) };
($($key:expr => $value:expr),*) => {
{ |
<|file_name|>keyring.go<|end_file_name|><|fim▁begin|>package agent
import (
"bytes"
"encoding/base64"
"encoding/json"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"github.com/hashicorp/consul/agent/config"
"github.com/hashicorp/consul/agent/consul"
"github.com/hashicorp/consul/agent/structs"
"github.com/hashicor... | }
if _, err := os.Stat(fileLAN); err != nil { |
<|file_name|>_virtual_network_peerings_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 info... | self._serialize = serializer
self._deserialize = deserializer
self._config = config |
<|file_name|>test_list_goals.py<|end_file_name|><|fim▁begin|># coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
... |
TaskRegistrar(name=self._LLAMA_NAME, action=ListGoalsTest.LlamaTask)\
.install().with_description(self._LLAMA_DESC)
self.assert_console_output( |
<|file_name|>optimizers.py<|end_file_name|><|fim▁begin|># Code in this file is copied and adapted from
# https://github.com/openai/evolution-strategies-starter.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
class Optimizer(object):
... | self.beta2 = beta2
self.epsilon = epsilon
self.m = np.zeros(self.dim, dtype=np.float32)
self.v = np.zeros(self.dim, dtype=np.float32) |
<|file_name|>htmldlistelement.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::bindings::codegen::Bindings::HTMLDListEleme... | } |
<|file_name|>tsdb_handler.py<|end_file_name|><|fim▁begin|># Copyright 2014 Baidu, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | """
import http.client |
<|file_name|>test_concurrency.py<|end_file_name|><|fim▁begin|>from nose.tools import with_setup, eq_ as eq
from common import vim, cleanup<|fim▁hole|>def test_interrupt_from_another_thread():
session = vim.session
timer = Timer(0.5, lambda: session.threadsafe_call(lambda: session.stop()))
timer.start()
... | from threading import Timer
@with_setup(setup=cleanup) |
<|file_name|>data_types.py<|end_file_name|><|fim▁begin|># Copyright 2020 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Various custom data types for use throughout the unexpected pass finder."""
from __future__ import... | stats = step_map.setdefault(r.step, BuildStats())
self._AddSingleResult(r, stats)
return matched_results
|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#
# XML Export, (C) Agaplan 2011
#
import models<|fim▁hole|><|fim▁end|> | import wizard |
<|file_name|>resultmodulation.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2015: Alignak team, see AUTHORS.txt file for contributors
#
# This file is part of Alignak.
#
# Alignak is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Pub... | |
<|file_name|>notosanshebrew_regular.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
class Charset(object):
common_name = 'NotoSansHebrew-Regular'
native_name = ''
def glyphs(self):
chars = []
chars.append(0x0000) #null ????
chars.append(0x200C) #uni200C ZERO WIDTH NON-JO... | |
<|file_name|>import.go<|end_file_name|><|fim▁begin|>// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package ast
import (
"go/token"
"sort"
"strconv"
)
// SortImports sorts runs of consecutive import line... | |
<|file_name|>char_sync.cpp<|end_file_name|><|fim▁begin|>/*
===========================================================================
Copyright (c) 2010-2015 Darkstar Dev Teams
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as pu... | along with this program. If not, see http://www.gnu.org/licenses/
|
<|file_name|>MultiTextNoTitle.java<|end_file_name|><|fim▁begin|>package wblut.Render2016;<|fim▁hole|>
import processing.core.PConstants;
public class MultiTextNoTitle extends Slide {
String[] lines = null;
int offset;
public MultiTextNoTitle(final RTO home, final String... lines) {
super(home, "");
this.line... |
import java.util.Arrays; |
<|file_name|>unique.py<|end_file_name|><|fim▁begin|># Copyright 2017 The TensorFlow 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... | """
def _apply_fn(dataset): |
<|file_name|>editor-database-module.js<|end_file_name|><|fim▁begin|>(function() {
'use strict';
angular
.module('editor.database', [])
.config(function($indexedDBProvider) {
$indexedDBProvider
.connection('otus-studio')
.upgradeDatabase(1, function(ev... | }); |
<|file_name|>scheduler_test.go<|end_file_name|><|fim▁begin|>package controller
import (
"reflect"
"testing"
kutil "k8s.io/kubernetes/pkg/util"
)
func TestScheduler(t *testing.T) {
keys := []string{}
s := NewScheduler(2, kutil.NewFakeAlwaysRateLimiter(), func(key, value interface{}) {
keys = append(keys, key.(... | }
} |
<|file_name|>geomobjects.hpp<|end_file_name|><|fim▁begin|>#ifndef FILE_OBJECTS
#define FILE_OBJECTS
/* *************************************************************************/
/* File: geomobjects.hpp */
/* Author: Joachim Schoeberl ... | |
<|file_name|>confirmings.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright (C) 2005-2008 Francisco José Rodríguez Bogado, #
# Diego Muñoz Escalante. ... | (self.wids['e_fechar'].get_text()
== confirming.fechaRecepcion.strftime('%d/%m/%Y')) |
<|file_name|>api.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright 2017 Ricequant, 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/licens... | """"""
pass
|
<|file_name|>sortable-debug.js<|end_file_name|><|fim▁begin|>/*
YUI 3.5.1 (build 22)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add('sortable', function(Y) {
/**
* The class allows you to create a Drag & Drop reordered list.
* @mo... |
if (!dropsort) {
Y.log('No delegate parent found', 'error', 'sortable');
return; |
<|file_name|>owsvmclassification.py<|end_file_name|><|fim▁begin|>from collections import OrderedDict
from PyQt4 import QtGui
from PyQt4.QtCore import Qt
from Orange.data import Table
from Orange.classification.svm import SVMLearner, NuSVMLearner
from Orange.widgets import settings, gui
from Orange.widgets.utils.owlea... | ("RBF", "exp(-g|x-y|²)"),
("Sigmoid", "tanh(g x⋅y + c)")) |
<|file_name|>ModularFocalNetwork.py<|end_file_name|><|fim▁begin|>"""
Examples
========
ModularFocalNetwork(8, [1600, 800], 4).plot() => 8 modules, 4 connections to each neuron
"""
import numpy as np
from Plotters import plot_connectivity_matrix
def range_from_base(base, size):
return xrange(base, base + size)
... | dim -- dimensions of matrix, [nodes_in_target_layer, nodes_in_input_layer]
focal_width -- how connections per node in target layer
Each community will have an even number of nodes, where each node has focal_width |
<|file_name|>eziepngfix.js<|end_file_name|><|fim▁begin|>//
// Created on: <18-Nov-2004 10:54:01 bh>
//
// ## BEGIN COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
// SOFTWARE NAME: eZ Publish
// SOFTWARE RELEASE: 4.1.x
// COPYRIGHT NOTICE: Copyright (C) 1999-2011 eZ Systems AS
// SOFTWARE LICENSE: GNU General Public License ... | /*!
Forces use of DirectX transparency filter for image tags with
"transparent-png-icon" as class. The result: correct alpha
blending for normal (32x32) PNG icons in Internet Explorer. |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>// TODO: many items from tokio-core::io have been deprecated in favour of tokio-io
#![allow(deprecated)]
#[macro_use] extern crate log;
extern crate env_logger;
extern crate futures;
extern crate getopts;
extern crate librespot;
extern crate tokio_core;
extern crate to... |
fn poll(&mut self) -> Poll<(), ()> { |
<|file_name|>semeval.py<|end_file_name|><|fim▁begin|>import codecs
f = codecs.open("/Users/hjp/Downloads/task/data/dev.txt", 'r', 'utf-8')
for line in f.readlines():
print(line)
sents = line.split('\t')
print(sents[1] + "\t" + sents[3])
for i in range(len(sents)):
print(sents[i])
<|fim▁hol... | f.close() |
<|file_name|>doc.go<|end_file_name|><|fim▁begin|>// Copyright 2015 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
/*
Catacomb leverages tomb.Tomb to bind the lifetimes of, and track the errors
of, a group of related workers. It's intended to be close to a drop-in
replacement for a Tomb: if ... | |
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>"""
* Copyright (c) 2017 SUSE LLC
*
* openATTIC 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 package is distributed in the... | Settings_mock.RGW_API_SECRET_KEY = 'sk' |
<|file_name|>region.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/lic... | debug!("temporary_scope({}) = {} [enclosing]", expr_id, id);
return Some(id); |
<|file_name|>Person.java<|end_file_name|><|fim▁begin|>package com.dynamo2.myerp.crm.dao.entities;
// Generated Mar 20, 2012 11:10:03 AM by Hibernate Tools 3.4.0.CR1
import static javax.persistence.GenerationType.IDENTITY;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
impor... | public String getGender() {
return this.gender; |
<|file_name|>collection.go<|end_file_name|><|fim▁begin|>package models
import (
"time"
)<|fim▁hole|> Created time.Time `json:"created"`
Modified time.Time `json:"modified"`
Albums []Album `json:"albums"`
}<|fim▁end|> |
type Collection struct {
Id int64 `json:"id"`
Name string `json:"name"` |
<|file_name|>inner-cfg-non-inline-mod.rs<|end_file_name|><|fim▁begin|>// check-pass
mod module_with_cfg;
mod module_with_cfg {} // Ok, the module above is configured away by an inner attribute.
<|fim▁hole|><|fim▁end|> | fn main() {} |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from setuptools import setup, find_packages
setup(
name = "CyprjToMakefile",
version = "0.1",
author = "Simon Marchi",
author_email = "simon.marchi@polymtl.ca",
description = "Generate Makefiles from Cypress cyprj files.",
license = "GPLv3",
... | }, |
<|file_name|>ingtitpre.js<|end_file_name|><|fim▁begin|>/**
* Librerías Javascript<|fim▁hole|> * @version SVN: $Id$
*
* @copyright Copyright 2007, Cide S.A.
* @license http://opensource.org/licenses/gpl-2.0.php GPLv2
*/
function codigopadre(){
var codigo=$('cideftit_codpre').value;
if (codigo.length==2){... | *
* @package Roraima
* @author $Author$ <desarrollo@cidesa.com.ve> |
<|file_name|>Role.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
* This file is part of Termitaria, a project management tool
* Copyright (C) 2008-2013 CodeSphere S.R.L., www.codesphere.ro
*
* Termitaria is free software; you can redistri... | }
/**
* @return the observation
|
<|file_name|>qray_driver.py<|end_file_name|><|fim▁begin|>"""Driver module for Newport's Spectra-Physics Quanta-Ray INDI, PRO, and LAB
Series Nd:YAG lasers.
NOTE: the watchdog parameter is important! The laser will turn off if it does
not receive a command within the watchdog time period. Therefore, it is
advised to ... | |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#![doc(html_root_url = "http://cpjreynolds.github.io/rustty/rustty/index.html")]
//! # Rustty
//!
//! Rustty is a terminal UI library that provides a simple, concise abstraction over an
//! underlying terminal device.<|fim▁hole|>//! pushed onto an input stream to be rea... | //!
//! Rustty is based on the concepts of cells and events. A terminal display is an array of cells,
//! each holding a character and a set of foreground and background styles. Events are how a
//! terminal communicates changes in its state; events are received from a terminal, processed, and |
<|file_name|>InstantiatorTest.java<|end_file_name|><|fim▁begin|>/**
* Copyright (C) 2013 Julian Atienza Herrero <j.atienza at har.mrc.ac.uk>
*
* MEDICAL RESEARCH COUNCIL UK MRC
*
* Harwell Mammalian Genetics Unit
*
* http://www.har.mrc.ac.uk
*
* Licensed under the Apache License, Version 2.0 (the "License"); y... | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
<|file_name|>arrow.cpp<|end_file_name|><|fim▁begin|>#include "arrow.h"
/**
* @brief Arrow::Arrow
*/
Arrow::Arrow() : Shape(SHAPES::ARROW) {
}
/**
* @brief Arrow::Arrow
* @param col Colour of the new object
* @param pos Starting point for the new object
*/
Arrow::Arrow(QColor col, QPoint pos) : Shape(SHAPES::ARR... | */
void Arrow::read(const QJsonObject& json) {
read_shape(json);
} |
<|file_name|>instr_vcvttps2udq.rs<|end_file_name|><|fim▁begin|>use ::{BroadcastMode, Instruction, MaskReg, MergeMode, Mnemonic, OperandSize, Reg, RoundingMode};
use ::RegType::*;
use ::instruction_def::*;
use ::Operand::*;
use ::Reg::*;
use ::RegScale::*;
use ::test::run_test;
#[test]
fn vcvttps2udq_1() {
run_test... | |
<|file_name|>errors_test.go<|end_file_name|><|fim▁begin|>package errors_test
import (
"io"
"testing"
. "v2ray.com/core/common/errors"
"v2ray.com/core/testing/assert"
)
func TestError(t *testing.T) {
assert := assert.On(t)
err := New("TestError")
assert.Bool(GetSeverity(err) == SeverityInfo).IsTrue()
err = ... |
err = New("TestError3").Base(io.EOF).AtWarning()
assert.Bool(GetSeverity(err) == SeverityWarning).IsTrue() |
<|file_name|>app.rs<|end_file_name|><|fim▁begin|>use clap::{ App, Arg, ArgMatches, SubCommand };
pub fn run<'a>() -> ArgMatches<'a> {
App::new(env!("CARGO_PKG_NAME"))
.version(env!("CARGO_PKG_VERSION"))
.author(env!("CARGO_PKG_AUTHORS"))<|fim▁hole|> .arg(
Arg::wit... | .about("Wiz is a package manager.")
.subcommand(
SubCommand::with_name("install")
.about("Installs package.") |
<|file_name|>adaptive_trapezint.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import math
def trapezint(f, a, b, n) :
"""
Just for testing - uses trapazoidal approximation from on f from a to b with
n trapazoids
"""
output = 0.0
for i in range(int(n)):
f_output_lower = f( a + i * (b... | max_second_derivative = i_second_d |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>def get (request, query):
import badge
import archived
from ..issuers.library.badges import library
from ..issuers.library.programs.mit.badges import scratch
badges = [
badge.get(request, query)['badge'],
archived.get(request, qu... | library.get(request, query)['badge'],
scratch.get(request, query)['badge'],
]
|
<|file_name|>video.rs<|end_file_name|><|fim▁begin|>use ffmpeg::frame;
use glium::texture::{SrgbTexture2d};
use glium::{Program, Display, VertexBuffer, Surface};
use glium::buffer::BufferView;
use glium::buffer::BufferMode::Persistent;
use glium::buffer::BufferType::PixelUnpackBuffer;
use glium::index::PrimitiveType::T... | if self.timestamp < frame.timestamp().unwrap() {
self.timestamp = frame.timestamp().unwrap();
|
<|file_name|>make_instances.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""Dump instances for bunny, in Promela and SlugsIn."""
import argparse
import itertools
import pprint
import logging
import re
from tugs import utils
log = logging.getLogger(__name__)
INPUT_FILE = 'bunny.pml'
PROMELA_PATH = 'pml/bunny_... | for i in xrange(n, m):
code = make_promela(i)
promela_file = PROMELA_PATH.format(i=i) |
<|file_name|>test_workflows.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 ... |
mock_hook.return_value.get_workflow.assert_called_once_with(
workflow_id=WORKFLOW_ID, |
<|file_name|>creep.roleUpgrader.js<|end_file_name|><|fim▁begin|>"use strict";
const setupTask = require('utils').setupTask;
const calcTasks = require("calcTasks");
module.exports = {
run : function(creep){
if(!creep.task){
var room = creep.room;
var creepsByTask = _(Game.creeps).filter( ... | var upgradeContainer = room.controller.pos.findInRange(FIND_STRUCTURES,1,{filter: (s) => s.structureType == STRUCTURE_CONTAINER})[0];
creep.task=upgradeList[myIndex]; |
<|file_name|>bootstrap.py<|end_file_name|><|fim▁begin|>import percolation as P
import rdflib as r
import os
import time
from rdflib import ConjunctiveGraph
TT = time.time()
class PercolationServer:
def __init__(self, percolationdir="~/.percolation/"):
percolationdir = os.path.expanduser(percolationdir)
... | c(P.client.getAllTriples()) |
<|file_name|>currency.js<|end_file_name|><|fim▁begin|>frappe.ui.form.ControlCurrency = frappe.ui.form.ControlFloat.extend({
format_for_input: function(value) {
var formatted_value = format_number(value, this.get_number_format(), this.get_precision());
return isNaN(parseFloat(value)) ? "" : formatted_value;
},
g... | if (!this.df.precision) {
if(frappe.boot.sysdefaults.currency_precision) {
this.df.precision = frappe.boot.sysdefaults.currency_precision;
} else { |
<|file_name|>OfferManager.py<|end_file_name|><|fim▁begin|>import re
from gi.repository import GObject
from pychess.Utils.const import DRAW_OFFER, ABORT_OFFER, ADJOURN_OFFER, TAKEBACK_OFFER, \
PAUSE_OFFER, RESUME_OFFER, SWITCH_OFFER, RESIGNATION, FLAG_CALL, MATCH_OFFER, \
WHITE, ACTION_ERROR_SWITCH_UNDERWAY, A... | |
<|file_name|>button_type_link.spec.js<|end_file_name|><|fim▁begin|>modules.define(
'spec',
['button', 'i-bem__dom', 'chai', 'jquery', 'BEMHTML'],
function(provide, Button, BEMDOM, chai, $, BEMHTML) {
var expect = chai.expect;
describe('button_type_link', function() {
var button;
beforeEach(functi... | it('should properly gets url', function() {
button.domElem.attr('href').should.be.equal('/');
button.getUrl().should.be.equal('/');
}); |
<|file_name|>assignment-visitor.js<|end_file_name|><|fim▁begin|>'use strict';
var _require = require('./parseProps'),
parsePropTypes = _require.parsePropTypes,
parseDefaultProps = _require.parseDefaultProps,
resolveToValue = require('./util/resolveToValue');
module.exports = function (state) {
var json ... | var isAssigning = function isAssigning(node, name) { |
<|file_name|>XmlAbstractNode.java<|end_file_name|><|fim▁begin|>/*
* dmfs - http://dmfs.org/<|fim▁hole|> * 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 ... | *
* Copyright (C) 2012 Marten Gajda <marten@dmfs.org>
* |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.