text stringlengths 3 1.05M |
|---|
'''URL routing for expense app.'''
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^nova-verba/', views.new_budget, name='new_budget'),
url(r'^novo-reembolso/', views.new_reimburse, name='new_reimburse'),
url(r'^reembolsos/todos/', views.list_all_reimburses, name='list_all_re... |
from ROOT import TH1D, TF1, TCanvas, TPad, TFile, TPaveLabel, TPaveText
from ROOT import gROOT, gStyle
from array import array
import psrchive
import sys
import time
import numpy as np
from optparse import OptionParser
full_usage = """
"""
usage = "usage: %prog [options]"
gStyle.SetOptFit()
parser = OptionParser... |
/****************************************************************************
* drivers/sensors/bh1750fvi.c
*
* 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 owner... |
from sqlalchemy.testing import fixtures
from sqlalchemy.engine.ddl import SchemaGenerator, SchemaDropper
from sqlalchemy.engine import default
from sqlalchemy import MetaData, Table, Column, Integer, Sequence
from sqlalchemy import schema
class EmitDDLTest(fixtures.TestBase):
def _mock_connection(self, item_exists... |
class Tau {
static TAU = 2 * Math.PI
static TAU_2 = this.TAU/2
static TAU_4 = this.TAU/4
static TAU_6 = this.TAU/6
static TAU_8 = this.TAU/8
static TAU_12 = this.TAU/12
constructor(){
// This consists solely of static methods and constants
... |
// David Eberly, Geometric Tools, Redmond WA 98052
// Copyright (c) 1998-2021
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
// https://www.geometrictools.com/License/Boost/LICENSE_1_0.txt
// Version: 4.0.2019.08.13
#pragma once
#include <algorithm>
#include <at... |
define([
'angularAMD'
], function(angularAMD) {
'use strict';
/**
* @ngdoc directive
* @name contextMenuApp.directive:contextMenu
* @description
* # contextMenu
* Custom Context Menu Directive
*/
angular.module('contextMenuApp', [])
.directive('ngRightClick', funct... |
import os
import random
import stat
import string
import unittest
import nvmet.nvme as nvme
# Default test devices are ram disks, but allow user to specify different
# block devices or files.
NVMET_TEST_DEVICES = os.getenv("NVMET_TEST_DEVICES",
"/dev/ram0,/dev/ram1").split(',')
def te... |
$(function() {
$(document).on('click', '[data-tab-track]', function() {
var $this = $(this);
var field = $this.data('tab-track');
var value = $this.data('tab-track-id');
$('#' + field).val(value);
});
}); |
/****************************************************************************
* Copyright 2021 EPAM Systems
*
* 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... |
joo.classLoader.prepare("package flashx.textLayout.formats",/* {*/
/**
* Defines values for setting the <code>direction</code> property of the <code>TextLayoutFormat</code> class. Left-to-right reading order is used in Latin-style scripts. Right-to-left reading order is used with scripts such as Arabic or Hebrew.
*... |
#!/usr/bin/env python
my_name = 'Zed A. Shaw'
my_age = 35 # not a lie
my_height = 74 # inches
my_weight = 180 # lbs
my_eyes = 'Blue'
my_teeth = 'White'
my_hair = 'Brown'
print "Let's talk about %s." % my_name
print "He's %d inches tall." % my_height
print "He's %d pounds heavy." % my_weight
print "Actually that's not t... |
/*eslint no-console: 0*/
import test from "ava";
import { post } from "../../build/browser/index.umd.js";
test("Creating a resource in jsonplaceholder. (Content-Type)", async t => {
t.plan(2);
try {
const _post = {
title: "foo",
body: "bar",
userId: Math.random(),
};
const {
re... |
import { utilGetAllNodes } from '@id-sdk/util';
import { t } from '../core/localizer';
import { behaviorOperation } from '../behavior/operation';
import { prefs } from '../core/preferences';
import { modeMove } from '../modes/move';
import { utilTotalExtent } from '../util/util';
export function operationMove(contex... |
from .fdio import * # yapf: disable # NOQA
# version detector. Precedence: installed dist, git, 'UNKNOWN'
try:
from ._dist_ver import __version__
except ImportError:
try:
from setuptools_scm import get_version
__version__ = get_version(root="..", relative_to=__file__)
except (ImportError,... |
import sqlite3 as sq
import datetime as dt
from contextlib import contextmanager
from rapidfuzz import fuzz
from rapidfuzz import process
@contextmanager
def cursor():
try:
conn = sq.connect('bot.db')
cur = conn.cursor()
yield cur
conn.commit()
finally:
conn.close()
d... |
import logging
# Setup Basic Configuration
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s %(levelname)s: %(message)s',
datefmt='%Y-%m-%d %H:%M:%S')
logger = logging.getLogger(__name__)
|
# Copyright (c) 2016 Ansible, Inc.
# All Rights Reserved.
import json
from django.utils.encoding import smart_text
from django.core.mail.backends.base import BaseEmailBackend
from django.utils.translation import ugettext_lazy as _
class AWXBaseEmailBackend(BaseEmailBackend):
def format_body(self, body):
... |
(window.webpackJsonp=window.webpackJsonp||[]).push([[27],{157:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return i})),n.d(t,"metadata",(function(){return c})),n.d(t,"rightToc",(function(){return l})),n.d(t,"default",(function(){return s}));var r=n(2),o=n(9),a=(n(0),n(323)),i={id:"login",title:"T... |
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin Developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
//
// Why base-58 instead of standard base-64 encoding?
// - Don't want 0OIl char... |
var express = require('express')
var app = express()
var path = require('path')
var bodyParser = require('body-parser')
var cookieSession = require('cookie-session')
var apiRoute = require('./routes/api.js')
// 设置静态路径
app.use(express.static(path.join(__dirname, 'public')))
// 配置body解析器
app.use(bodyParser.json())
app... |
/* eslint-disable @typescript-eslint/no-var-requires */
process.env.NODE_ENV = 'test';
module.exports = wallaby => ({
files: [
'src/**/*.ts',
'jest.config.js',
'test/avatar.png',
'test/profile.jpg',
],
tests: ['test/**/*.test.ts'],
testFramework: 'jest',
env: {
type: 'node',
runner: ... |
export default {
lang: {
colorpicker: {
confirm: 'OK',
clear: 'Tøm'
},
datepicker: {
now: 'Nå',
today: 'I dag',
cancel: 'Avbryt',
clear: 'Tøm',
confirm: 'OK',
selectDate: 'Velg dato',
selectTime: 'Velg tidspunkt',
startDate: 'Start Dato',
s... |
import { __rest } from "tslib";
import * as React from 'react';
import { css } from '@patternfly/react-styles';
import styles from '@patternfly/react-styles/css/components/Wizard/wizard';
export const WizardNavItem = (_a) => {
var { children = null, content = '', isCurrent = false, isDisabled = false, step, onNavIt... |
"""
General image database
An image database creates a list of relative image path called image_set_index and
transform index to absolute image path. As to training, it is necessary that ground
truth and proposals are mixed together for training.
roidb
basic format [image_index]
['image', 'height', 'width', 'flipped',
... |
from typing import Dict
from datetime import datetime
from botocore.paginate import Paginator
class ListDeviceEvents(Paginator):
def paginate(self, DeviceId: str, FromTimeStamp: datetime, ToTimeStamp: datetime, PaginationConfig: Dict = None) -> Dict:
"""
Creates an iterator that will paginate thro... |
// eslint-disable-next-line @typescript-eslint/no-var-requires
const path = require('path')
// If your port is set to 80,
// use administrator privileges to execute the command line.
// For example, on Mac: sudo npm run / sudo yarn
const devServerPort = 9527 // TODO: get this variable from setting.ts
const mockServerP... |
# -*- coding: utf-8 -*-
"""@package Methods.Machine.SlotW21.comp_surface
SlotW21 Computation of surface method
@date Created on Mon Dec 08 17:34:45 2014
@copyright (C) 2014-2015 EOMYS ENGINEERING.
@author pierre_b
"""
from numpy import sin, tan
def comp_surface(self):
"""Compute the Slot total surface (by analyt... |
import { _ as __vue_normalize__, r as registerComponent, u as use } from './chunk-cca88db8.js';
import { T as Tag } from './chunk-3c2169d7.js';
export { T as BTag } from './chunk-3c2169d7.js';
//
//
//
//
//
//
var script = {
name: 'BTaglist',
props: {
attached: Boolean
}
};
/* script */
const __vue_script_... |
//
// File: rtGetInf.h
//
// Code generated for Simulink model 'est_estimator'.
//
// Model version : 1.1142
// Simulink Coder version : 8.11 (R2016b) 25-Aug-2016
// C/C++ source code generated on : Mon Dec 4 08:33:06 2017
//
#ifndef RTW_HEADER_rtGetInf_h_
#define RTW_HEADER_rtGetInf_h_
#inclu... |
/* Copyright (c) 2001, Stanford University
* All rights reserved
*
* See the file LICENSE.txt for information on redistributing this software.
*/
#include "cr_error.h"
#include "cr_mem.h"
#include "cr_string.h"
#include "packspu.h"
#include "packspu_proto.h"
static void packspu_GetHostBufferSubDataARB( GLenum tar... |
import React, { Component } from 'react';
import { Link } from 'react-router-dom';
import axios from 'axios';
class Register extends Component {
constructor(props){
super(props);
this.state ={
username: "",
password: ""
}
}
//handleChange
handleChange =... |
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, String
Base = declarative_base()
class SeatReservation(Base):
__tablename__ = "seat_reservation"
__table_args__ = {"sqlite_autoincrement": True}
id = Column(Integer, primary_key=True)
trainid = Column(Stri... |
define(['angular'], function(angular) {
var hello = angular.module('home', []);
});
|
import React from 'react'
import { Provider } from 'react-redux'
import { render } from 'react-dom'
import { configureStore } from 'redux-starter-kit'
import App from './components/App'
import rootReducer from './ducks'
import * as serviceWorker from './serviceWorker'
import './styles.scss'
const store = configure... |
# flake8: noqa
# import all models into this package
# if you have many models here with many references from one model to another this may
# raise a RecursionError
# to avoid this, import only the models that you directly need like:
# from from fds.sdk.ProcuretoPayProvisioning.model.pet import Pet
# or import this pa... |
# -*- coding: utf-8 -*-
#
# This file is part of the pyFDA project hosted at https://github.com/chipmuenk/pyfda
#
# Copyright © pyFDA Project Contributors
# Licensed under the terms of the MIT License
# (see file LICENSE in root directory for details)
"""
Widget for plotting \|H(z)\| in 3D
"""
import logging
logger = ... |
(self.webpackChunkgeonode_mapstore_client=self.webpackChunkgeonode_mapstore_client||[]).push([[4495,5110,9534,6287],{90079:(e,t,n)=>{"use strict";n.d(t,{Z:()=>E});var r=n(72500),o=n.n(r),i=n(86494),a=n(27418),l=n.n(a),c=n(45697),s=n.n(c),u=n(24852),p=n.n(u),f=n(33044),d=n(5346);function y(e){return(y="function"==typeof... |
class Solution:
def canVisitAllRooms(self, rooms: List[List[int]]) -> bool:
# we use this below list for checking whether all list have been visited or not
visited=[False]*len(rooms)
# per condition room 0 is always unlocked
visited[0]=True
#we use stack for acquiring key to ... |
# -*- coding: utf-8 -*-
from datetime import datetime
import numpy as np
import pytest
from pandas.core.dtypes.common import is_float_dtype, is_integer_dtype
from pandas.core.dtypes.dtypes import CategoricalDtype
import pandas as pd
from pandas import (
Categorical, CategoricalIndex, DatetimeIndex, Index, Inter... |
from __future__ import absolute_import # Avoid importing `importlib` from this package.
import copy
import imp
from importlib import import_module
import os
import sys
import warnings
from django.core.exceptions import ImproperlyConfigured
from django.utils import six
from django.utils.deprecation import RemovedInDj... |
#ifndef __MTKFB_H
#define __MTKFB_H
#define MTK_FB_OVERLAY_SUPPORT
#define MTK_FB_SYNC_SUPPORT
#define MTK_FB_ION_SUPPORT
#define MTK_FB_NO_ION_FD ((int)(~0U>>1))
/* IOCTL commands. */
#define MTK_IOW(num, dtype) _IOW('O', num, dtype)
#define MTK_IOR(num, dtype) _IOR('O', num, dtype)
#define MTK_IOWR... |
$(document).ready(function (){
toasterOptions();
initialLoad();
setDateRangePicker();
function toasterOptions()
{
toastr.options = {
"closeButton": true,
"debug": false,
"newestOnTop": true,
"progressBar": true,
"positionClass": "toast-center-center",... |
export { default } from "./FilterSelector";
|
const DeedCard = require('../../deedcard.js');
const GameActions = require('../../GameActions/index.js');
class RedRiverRoulette extends DeedCard {
setupCardAbilities(ability) {
this.action({
title: 'Red River Roulette',
playType: ['resolution'],
cost: ability.costs.boot... |
import io
import sys
"""
Normalize the input text to output ascii-only text
by removing any line that contains non-ascii
Also lowercase all text
"""
printable_chars = ' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~'
def main():
with io.TextIOWrapper(sys.stdin.bu... |
'''LastPass Vault search'''
import subprocess
import re
import os
from shutil import which
from albertv0 import *
__iid__ = 'PythonInterface/v0.1'
__prettyname__ = 'LastPass'
__version__ = '1.0'
__trigger__ = 'lp '
__author__ = 'David Piçarra'
__dependencies__ = ['lpass']
if not which('lpass'):
raise Exception("`... |
"""
Quantiphyse - widget which allows a data sets view metadata to be changed
The widget automatically switches to show the 'current' data, whether it is
currently visible or not.
Copyright (c) 2013-2020 University of Oxford
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file ex... |
import './index.css';
import 'bootstrap/dist/css/bootstrap.min.css';
import React, { useEffect } from 'react';
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom';
import Footer from './components/layout/Footer';
import Register from './components/auth/Register';
import SubscribePlan from './compo... |
from chainer.backends import cuda
from chainer.backends import intel64
from chainer import function_node
from chainer.utils import type_check
_kern = None
def _get_kern():
global _kern
if _kern is None:
_kern = cuda.elementwise(
'T cond, T x, T slope', 'T y',
'y = cond <= 0 ?... |
/*
HLSL shader compiler implementation
*/
#pragma once
#include "backend.h"
#include <string>
#include <tscore/system/memory.h>
/////////////////////////////////////////////////////////////////////////////////////////////////
namespace ts
{
class HLSLCompiler : public IShaderBackend
{
private:
void* m_modul... |
import math
def pairs(k, arr):
arr=set(arr)
brr=set(x+k for x in arr)
count=arr.intersection(brr)
return count.__len__() |
import faulthandler
faulthandler.enable()
from tensor2tensor.data_generators import problem
from tensor2tensor.data_generators import text_problems
from tensor2tensor.data_generators import translate
from tensor2tensor.utils import registry
from tensor2tensor import problems
import tensorflow as tf
import os
import lo... |
/**
* Copyright 2017 IBM Corp. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the 'License'); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable l... |
# Copyrights. All rights reserved.
# ECOLE POLYTECHNIQUE FEDERALE DE LAUSANNE, Switzerland,
# Space Center (eSpace), 2018
# See the LICENSE.TXT file for more details.
import os
import time
import torch as th
from practical_deep_stereo import visualization
def get_learning_rate(optimizer):
for param_group in op... |
import os
import time
import torch
import numpy as np
"""[ElegantRL](https://github.com/AI4Finance-LLC/ElegantRL)"""
class Evaluator:
def __init__(self, cwd, agent_id, device, env, eval_times1, eval_times2, eval_gap, ):
self.recorder = list() # total_step, r_avg, r_std, obj_c, ...
self.recorder_... |
const initialState = {
data: null,
userLogin: false
};
const userAccountReducer = (state = initialState, action) => {
switch(action.type) {
case 'USER_ACCOUNT' :
return {
...state,
data : action.payload,
userLogin : action.status
... |
/***************************************************************************
*cr
*cr (C) Copyright 2007 The Board of Trustees of the
*cr University of Illinois
*cr All Rights Reserved
*cr
********************************************************************... |
import unittest
from concurrent.futures import ThreadPoolExecutor
from unittest.mock import mock_open
from dirhunt import __version__
from dirhunt.tests._compat import Mock, patch
from dirhunt.crawler import Crawler
from dirhunt.crawler_url import CrawlerUrl
from dirhunt.processors import GenericProcessor
from dirhunt... |
# -*- coding: utf-8 -*-
'''
Error generator to enable integration testing of salt runner error handling
'''
# Import python libs
# Import salt libs
import salt.utils.error
def error(name=None, message=''):
'''
If name is None Then return empty dict
Otherwise raise an exception with __name__ from name... |
// @flow
type O = {};
type F = () => void;
type T = [boolean, ?number];
type ObjMapAlias = $ObjMap<O, F>;
type ObjMapAliasLiteral = $ObjMap<{}, () => number>;
type ObjMapiAlias = $ObjMapi<O, F>;
type TupleMapAliasTuple = $ObjMapi<T, F>;
type TupleMapAliasObj = $ObjMapi<O, F>;
let ObjMapTypeAnnotation: $ObjMap<O, F>;
|
# -*- encoding: utf-8 -*-
import functools as ft
from inspect import getdoc
import re
import h2o
from h2o.automl._base import H2OAutoMLBaseMixin
from h2o.automl._h2o_automl_output import H2OAutoMLOutput
from h2o.base import Keyed
from h2o.estimators import H2OEstimator
from h2o.exceptions import H2OResponseError, H2OV... |
var express = require('express');
var path = require('path');
var favicon = require('serve-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var compression = require('compression');
var routes = require('./routes/index');
var users = requir... |
#ifndef _MMeshIntersector
#define _MMeshIntersector
//-
// ===========================================================================
// Copyright 2018 Autodesk, Inc. All rights reserved.
//
// Use of this software is subject to the terms of the Autodesk license
// agreement provided at the time of installation or dow... |
__all__ = ["GetNextPackage", "PackageDto"]
from shipping.application.queries.package import GetNextPackage, PackageDto
|
/**
* @license
* Visual Blocks Language
*
* Copyright 2012 Google Inc.
* https://developers.google.com/blockly/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apa... |
from rest_framework import serializers
from hub.models import Project
class ProjectSerializer(serializers.Serializer):
project_name = serializers.CharField(max_length=30)
duration = serializers.IntegerField()
allocated_time = serializers.IntegerField()
|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# -----------------------------------------------------------------------------------------------------------
# Name: tinyserver.py
# Purpose: Small server using threads that listens on a default port and returns a response
# with echo of the s... |
const webpack = require('webpack')
const { merge } = require('webpack-merge')
const common = require('./webpack.common.js')
const paths = require('./paths')
module.exports = merge(common, {
// Set the mode to development or production
mode: 'development',
// Control how source maps are generated
devtool: 'inl... |
//------------------------------------------------------------------------------
// GB_AxB: hard-coded C=A*B and C<M>=A*B
//------------------------------------------------------------------------------
// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2018, All Rights Reserved.
// http://suitesparse.com See ... |
var searchData=
[
['container_20views_7128',['Container Views',['../group__containerviews.html',1,'']]],
['controls_7129',['Controls',['../group__controls.html',1,'']]]
];
|
# Importa as blibliotecas
import pyautogui
import time
# Abre o executar do Windows e busca o servidor
pyautogui.hotkey('win','r');pyautogui.typewrite('\\\srsdcsp01\\NETLOGON\\Bitdefender\\Setup');pyautogui.press('enter')
time.sleep(2)
# Abre o arquivo de instalação
pyautogui.click(520,479);pyautogui.typewrite('epskit... |
# Copyright (C) 2019 ZTE. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
import torch
import torch.nn as nn
from torch.utils.model_zoo import load_url
__all__ = [
'VGG', 'vgg11', 'vgg11_bn', 'vgg13', 'vgg13_bn', 'vgg16', 'vgg16_bn',
'vgg19_bn', 'vgg19',
]
model_urls = {
'vgg11': 'https://download.pytorch.org/models/vgg11-bbd30ac9.pth',
'vgg13': 'https://download.pytorch.or... |
/*
* /MathJax-v2/jax/output/SVG/fonts/STIX-Web/Shapes/Regular/Main.js
*
* Copyright (c) 2009-2018 The MathJax Consortium
*
* 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
*
* ... |
import subprocess
import sys
import setup_util
def start(args, logfile, errfile):
setup_util.replace_text("wicket/src/main/webapp/WEB-INF/resin-web.xml", "mysql:\/\/.*:3306", "mysql://" + args.database_host + ":3306")
try:
subprocess.check_call("mvn clean compile war:war", shell=True, cwd="wicket", stderr=er... |
# Copyright 2011 Denali Systems, 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://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
import { h } from 'vue'
export default {
name: "CircleSlice2",
vendor: "Mdi",
type: "",
tags: ["circle","slice","2"],
render() {
return h(
"svg",
{"xmlns":"http://www.w3.org/2000/svg","width":"24","height":"24","viewBox":"0 0 24 24","class":"v-icon","fill":"currentColor","data-name":"mdi-circl... |
'use strict';
// NOTE: any test that hits the pathfinder CTE should be considered for serialising. This is
// because the rate limits on this environment are quite low, therefore parallel tests might cause
// failures due to these rate limits, which could be misleading. At the time of writing, all are.
// TODO:
// - ... |
/*
Created by Andrew DeChristopher <drew@kiir.us> on 8/30/2016.
*/
// core libraries
const io = require('socket.io').listen(27000);
const ss = require('socket.io-stream');
const fs = require('fs');
const path = require('path');
const mime = require('mime');
const c = require('chalk');
// demo webservice libraries
co... |
"""
Example demonstrating Proof Verification.
First Issuer creates Claim Definition for existing Schema.
After that, it issues a Claim to Prover (as in issue_credential.py example)
Once Prover has successfully stored its Claim, it uses Proof Request that he
received, to get Claims which satisfy the Proof Request from... |
import chai from 'chai';
chai.should();
import merge from '../src/merge';
describe('merge', () => {
it('two empty objects', () => {
merge({}, {}).should.deep.equal({});
});
it('empty and plain objects', () => {
const o = { id: 25994, name: 'Terra', visible: true };
const expected ... |
import codecs
import os
import re
class MovieCorpus:
"""A class to load cornel movie corpus data"""
def __init__(self, data_path, input_paths, label_col, limit=None):
self.paths = [os.path.join(data_path, input_path) for input_path in input_paths]
self.label_col = label_col
self.limit... |
from gpiozero import MotionSensor
from subprocess import call
from time import sleep
# Time to wait until display should turn off after last motion detected
timeUntilDisplayOff = 1800
# The GPIO data pin to which the PIR sensor is connected
pin = 14
pir = MotionSensor(pin)
timer = timeUntilDisplayOff
while True:
i... |
/*
*
* Copyright (C) 2011, 2015 Cisco Systems, Inc.
* Copyright (C) 2015 CBA research group, Technical University of Catalonia.
*
* 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:
*
* ... |
# Copyright 2020 The T5 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... |
const { Joi } = require('../../../utils/validation');
module.exports = {
tx_uid: Joi.object()
.bignumber()
.required(),
id: Joi.string()
.base58()
.required(),
height: Joi.number().required(),
tx_type: Joi.number()
.min(1)
.max(16)
.required(),
tx_version: Joi.number()
.requir... |
from __future__ import print_function
import glob
import itertools as it
import numpy as np
import os
import sys
import xgboost as xgb
try:
from sklearn import datasets
from sklearn.preprocessing import scale
except ImportError:
None
class Dataset:
def __init__(self, name, get_dataset, objective, me... |
# -*- coding: utf-8 -*-
from ogs5py import OGS
model = OGS(
task_root='diff_aniso_root',
task_id='diff_aniso',
output_dir='out',
)
model.msh.read_file('diff_aniso.msh')
model.gli.read_file('diff_aniso.gli')
model.pcs.add_block(
main_key='PROCESS',
PCS_TYPE='LIQUID_FLOW',
NUM_TYPE='NEW',
)
model... |
#ifndef PrepareRawSpectra_H
#define PrepareRawSpectra_H
#include "AliUtilTOFParams.h"
#include "RooPlot.h"
#include "RooRealVar.h"
#include "TCanvas.h"
#include "TF1.h"
#include "TFile.h"
#include "TH1F.h"
#include "TList.h"
#include "TOFMacroUtils.h"
#include "TROOT.h"
#include "TString.h"
#include "TStyle.h"
#includ... |
from django.contrib import admin
from user import models
admin.site.register(models.UserPreferences, admin.ModelAdmin)
|
#ifndef __HELLOWORLD_SCENE_H__
#define __HELLOWORLD_SCENE_H__
#include "cocos2d.h"
class HelloWorld : public cocos2d::Layer
{
public:
// there's no 'id' in cpp, so we recommend returning the class instance pointer
static cocos2d::Scene* createScene();
// Here's a difference. Method 'init' in cocos2d-x re... |
# Copyright 2020 The Magenta Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... |
# 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, Version 2.0 (the
# "License"); you may not u... |
#ifndef DASH__ITERATOR_INTERNAL_CONTIGUOUSRANGE_H__
#define DASH__ITERATOR_INTERNAL_CONTIGUOUSRANGE_H__
#include <dash/GlobPtr.h>
#include <dash/internal/Macro.h>
#include <dash/Exception.h>
namespace dash {
namespace internal {
/**
* Iterator used to find consecutive memory ranges across a global memory range.
*/... |
import psycopg2
from datetime import datetime
import binascii
import _thread
import time
import socket
PORT1 = 8802
def serverX():
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s1:
s1.bind(('',PORT1))
s1.listen()
conn1, addr = s1.accept()
... |
import Vue from 'vue';
import App from '@modules/Demo';
new Vue({
el: '#app',
render: h => h(App),
}); |
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_putstr.c :+: :+: :+: ... |
'use strict';
const admin = require('firebase-admin');
/* eslint-disable import/no-unresolved */
const serviceAccount = require('./../fb.json');
admin.initializeApp({
credential: admin.credential.cert(serviceAccount),
databaseURL: process.env.FIREBASE_URL,
});
module.exports = admin;
|
export { default, initialize } from 'nullbase-core/initializers/nb-textarea-theme-init';
|