text stringlengths 3 1.05M |
|---|
// scripts/upgrade_box.js
require('dotenv').config();
const { ethers, upgrades } = require('hardhat');
const { API_URL, PRIVATE_KEY, POLYGON_KEY, CONTRACT_ADDRESS } = process.env;
async function main() {
const ERC20 = await ethers.getContractFactory("LobbyToken");
console.log('Upgrading LobbyToken...', '0xCb659699... |
from teras.preprocessing import text # NOQA
|
/**
* @file 页面主题
*/
import React from 'react';
import Banner from '../../components/banner/index.js';
import Articlelist from '../../components/article-list/index.js';
import './index.scss';
export default class Home extends React.Component {
render() {
return (
<div className='home'>
... |
import _extends from "@babel/runtime/helpers/esm/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
import * as React from 'react';
import PropTypes from 'prop-types';
import clsx from 'clsx';
import withStyles from '../styles/withStyles';
import capitalize from '../uti... |
const router = require('express').Router();
const Logger = require('../../../services/Logger');
const APIResponse = require('../../../models/api-models');
const StrikeService = require('../../../services/map/Strike');
const MapSecurityService = require('../../../services/security/MapSecurity');
router.post('/join/:str... |
import {readDoc, assert, findParent} from './../../util.js';
/** @test {VariableDoc} */
describe('testVariableDefinition', function () {
const doc = readDoc('variable/index.html');
describe('in summary', function () {
it('has desc', function () {
findParent(doc, '[data-ice="summary"] [href$="#static-var... |
var Chess = (function(Chess) {
'use strict';
Chess.Movement = Chess.Movement || {};
Chess.Movement.Displacement = (function() {
/**
*
* @param {int} x
* @param {int} y
* @param {bool|function} isExtensible
* @param {function} filter
* @constru... |
#C:\Users\null\Desktop\pywinrm>python test1.py
#win-\k8gege
import winrm
s=winrm.Session('http://192.168.1.116',auth=('k8gege','k8gege520'))#2012 ok
#s=winrm.Session('http://192.168.1.20',auth=('k8gege','k8gege520'))#win7 fail
r=s.run_ps('dir')
r=s.run_cmd('whoami')
print r.std_out
print r.std_err |
const hasSingleInstanceLock = require('@/src/api/hasSingleInstanceLock.js');
describe('hasSingleInstanceLock', () => {
test('Returns undefined', () => {
expect(hasSingleInstanceLock())
.toEqual(undefined);
});
});
|
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "X2AP-IEs"
* found in "/home/lixh/ue_folder/openair2/X2AP/MESSAGES/ASN1/R14/x2ap-14.6.0.asn1"
* `asn1c -pdu=all -fcompound-names -gen-PER -no-gen-OER -no-gen-example -fno-include-deps -D /home/lixh/ue_folder/cmake_targets/lte_build_oai/... |
'use strict';
// Constructor for Player object which gets pushed to playerArr
var playerArr = [];
function Player(name) {
this.name = name;
this.score = 500;
playerArr.push(this);
}
// Questions
var allQuestions = [
{
question: 'Who played Rob Petrie\'s wife on The Dick Van Dyke Show?',
... |
/*
* Implementation of multithreading in ARM Cortex-M4. To do.
*/
#ifndef MTARCH_H_
#define MTARCH_H_
struct mtarch_thread {
short mt_thread;
};
#endif /* MTARCH_H_ */
|
#!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.mininode import *
from test_framework.test_framework import NavcoinTestFramework
from... |
"""
Unit-tests for helpers
"""
import commodore.helpers as helpers
def test_apierror():
e = helpers.ApiError('test')
assert(f"{e}" == 'test')
try:
raise helpers.ApiError('test2')
except helpers.ApiError as e2:
assert(f"{e2}" == 'test2')
|
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
int main() {
int control;
char buf2[32];
char buf1[64];
control = 6;
fgets(buf1, 64, stdin);
strncpy(buf2, buf1, 32);
return 0;
} |
(this.webpackJsonpsleepwell=this.webpackJsonpsleepwell||[]).push([[145],{1319:function(t,e,i){"use strict";i.r(e);var n=i(639),o=i(1),s=i(637),a=i(638),r=i(18),c=i(640),h=i.n(c),l=i(13),u=i(642).default;e.default=function(){Object(r.i)();var t=Object(a.e)({mode:"all"}),e=(t.control,t.handleSubmit,t.formState.errors,Obj... |
/*
* If not stated otherwise in this file or this component's LICENSE file the
* following copyright and licenses apply:
*
* Copyright 2020 Metrological
*
* 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 ... |
"""Implementation of :class:`SimpleDomain` class. """
from sympy.polys.domains.domain import Domain
from sympy.utilities import public
@public
class SimpleDomain(Domain):
"""Base class for simple domains, e.g. ZZ, QQ. """
is_Simple = True
def inject(self, *gens):
"""Inject generato... |
const mongoose = require("mongoose");
const userSchema = new mongoose.Schema({
googleUserId: String,
facebookUserId: String,
name: String,
avatar: {
type: String,
default:
"https://cityhope.cc/wp-content/uploads/2020/01/default-avatar.png",
},
balance: { type: Number, default: 0 },
});
modul... |
"""
Modified from [LIDAR Odometry with ICP](https://andrewjkramer.net/lidar-odometry-with-icp/)
"""
import numpy as np
from scipy.spatial import KDTree
import matplotlib.pyplot as plt
import seaborn as sns
from icecream import ic
sns.set_style('dark')
class Align2D:
def __init__(self, source_points, target_point... |
from couchbase_core._libcouchbase import (
LCB_SDCMD_REPLACE, LCB_SDCMD_DICT_ADD, LCB_SDCMD_DICT_UPSERT,
LCB_SDCMD_ARRAY_ADD_FIRST, LCB_SDCMD_ARRAY_ADD_LAST,
LCB_SDCMD_ARRAY_ADD_UNIQUE, LCB_SDCMD_EXISTS, LCB_SDCMD_GET,
LCB_SDCMD_COUNTER, LCB_SDCMD_REMOVE, LCB_SDCMD_ARRAY_INSERT,
LCB_SDCMD_FULLDOC_GE... |
import unittest
from test import support
import errno
import io
import itertools
import socket
import select
import tempfile
import time
import traceback
import queue
import sys
import os
import array
import contextlib
from weakref import proxy
import signal
import math
import pickle
import struct
import random
import... |
#pragma once
#include "common.h"
#include "list.h"
typedef enum {
HAS_CHILD_OF_NEEDLE,
HAS_PARENT_OF_NEEDLE,
HAS_STRICT_PARENT_OF_NEEDLE,
HAS_EXACT_PATH
} has_path_mode_t;
bool has_path(strlist *l, const char *needle, has_path_mode_t mode);
bool strlist_contains(strlist *l, char *s);
size_t strlist_count(str... |
class SessionHelper:
def __init__(self, app):
self.app = app
def login(self, username, password):
wd = self.app.wd
self.app.open_login_page()
wd.find_element_by_name("user").clear()
wd.find_element_by_name("user").send_keys(username)
wd.find_element_by_name("p... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import unittest
import os
import ray
import numpy as np
import time
class TaskTests(unittest.TestCase):
def testSubmittingTasks(self):
for num_local_schedulers in [1, 4]:
for num_worke... |
"""This module contains the general information for FirmwareChassisComponentSpec ManagedObject."""
from ...ucsmo import ManagedObject
from ...ucscoremeta import MoPropertyMeta, MoMeta
from ...ucsmeta import VersionMeta
class FirmwareChassisComponentSpecConsts:
EXCLUDE_BY_DEFAULT_FALSE = "false"
EXCLUDE_BY_DE... |
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-vendors"],{"00ee":function(t,e,n){var r=n("b622"),o=r("toStringTag"),i={};i[o]="z",t.exports="[object z]"===String(i)},"0366":function(t,e,n){var r=n("1c0b");t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 0:return function(){return ... |
import { red, blue, blueGrey, yellow, green } from '@material-ui/core/colors';
const white = '#FFF';
const black = '#000';
export default {
type: 'light',
common: {
black,
white,
commonBackground: white,
contrastText: black,
neutral: '#E4E7EB',
muted: '#9EA0A4'
},
default: {
light: 'rgba(41, 150, 243... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2004-2008 Zuza Software Foundation
#
# This file is part of the Translate Toolkit.
#
# 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; e... |
/**
* Copyright 2013-2020 the original author or authors from the JHipster project.
*
* This file is part of the JHipster project, see https://www.jhipster.tech/
* for more information.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the L... |
/**
* 开启index的webpack-dev-server
* @type {devServer}
*/
const baseServer = require("./base-server")
const config = require("../../config")
const { indexPort } = config
baseServer(indexPort) |
from sqlalchemy import Column, Integer, String
from ...models.car_viewmodels import Car
from .base_model import BaseModel
class CarDataModel(BaseModel):
__tablename__ = "cars"
id = Column("id", Integer, primary_key=True)
year = Column("year", Integer)
make = Column("make", String(255))
model = C... |
/*
** Copyright (C) 2004-2020 by Carnegie Mellon University.
**
** @OPENSOURCE_LICENSE_START@
** See license information in ../../LICENSE.txt
** @OPENSOURCE_LICENSE_END@
*/
/*
** Generic timers which will run callback functions in a separate
** thread context after a given amount of time.
*/
#include <silk/silk.h>
... |
// Copyright (c) 2006-2008 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.
#ifndef CHROME_BROWSER_VIEWS_SAD_TAB_VIEW_H_
#define CHROME_BROWSER_VIEWS_SAD_TAB_VIEW_H_
#include "app/gfx/font.h"
#include "base/basictypes.h"... |
/*
* ak4642.c -- AK4642/AK4643 ALSA Soc Audio driver
*
* Copyright (C) 2009 Renesas Solutions Corp.
* Kuninori Morimoto <morimoto.kuninori@renesas.com>
*
* Based on wm8731.c by Richard Purdie
* Based on ak4535.c by Richard Purdie
* Based on wm8753.c by Liam Girdwood
*
* This program is free software; you ca... |
const _ = {};
_.each = function(list, callback) {
console.log(list);
console.log(callback);
if (Array.isArray(list)) {
// loop through the array
for (let i = 0; i < list.length; i++) {
callback(list[i], i, list);
}
} else {
// loop through the object
... |
function getStateIndex(pStates, pStateName) {
return pStates.findIndex((pState) => pState.name === pStateName);
}
function getTransitionRow(pStates, pTransition) {
// 0's; -1 at the from column, 1 at the to column
const lRetval = Array(pStates.length).fill(0);
lRetval[getStateIndex(pStates, pTransition... |
function searchinput() {
document.getElementById("search").type="text";
} |
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import math
from argparse import Namespace
from dataclasses import dataclass, f... |
import matplotlib.pyplot as plt
from numpy import log
import mne
import numpy as np
import h5py
class RawPSD:
"""
This class contains the PSD of a set of Raw Data. It stores the data of the
psds of each epoch. The psds are calculated with the Library mne.
Attributes:
============
fmin ... |
/*
* Copyright (c) Nordic Semiconductor ASA
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of... |
// @flow
import { createToolbarEvent, sendAnalytics } from '../../analytics';
import { getFeatureFlag, HELP_BUTTON_ENABLED } from '../../base/flags';
import { translate } from '../../base/i18n';
import { IconHelp } from '../../base/icons';
import { connect } from '../../base/redux';
import { AbstractButton, typ... |
'use strict';
/**
* @ngdoc function
* @name openshiftConsole.controller:OAuthController
* @description
* # OAuthController
* Controller of the openshiftConsole
*/
angular.module('openshiftConsole')
.controller('OAuthController', function ($location, $q, RedirectLoginService, DataService, AuthService, Logger) {... |
# yolo_to_onnx.py
#
# Copyright 1993-2019 NVIDIA Corporation. All rights reserved.
#
# NOTICE TO LICENSEE:
#
# This source code and/or documentation ("Licensed Deliverables") are
# subject to NVIDIA intellectual property rights under U.S. and
# international Copyright laws.
#
# These Licensed Deliverables contained he... |
###############################################################################
# Copyright 2015-2016 University of Florida. All rights reserved.
# This file is part of UF CTS-IT's NACCulator project.
# Use of this source code is governed by the license found in the LICENSE file.
#######################################... |
from selenium import webdriver
from bs4 import BeautifulSoup
import requests
import random
import time
import pandas as pd
import logging
import os, sys
import urllib
import shutil
def get_hrefs(urls):
"""
The webpage scrapper for list of all dogs. Design for adoptapet.com
param:
url: the list of l... |
from urllib import request, parse
import http.cookiejar
import json
import random
import time
import requests
baseDelayTime = 20 # 基础延时秒数
randomDelayDeviation = 20 # 叠加随机延时差
getCookiesURL = 'https://weiban.mycourse.cn/#/login' # 请求Cookies URL
loginURL = 'https://weiban.mycourse.cn/pharos/login/login.do' # 登录请求 ... |
# Copyright 2017 OpenStack Foundation
#
# 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 ... |
##### from keras.preprocessing import sequence
from keras.models import Sequential
from keras.layers import Dense, Dropout, Flatten, Activation
from keras.layers import Conv2D, Conv1D
from keras.optimizers import Adam
from keras import backend as K
from keras.utils.training_utils import multi_gpu_model
from keras.call... |
# Copyright 2008 by Bartek Wilczynski. All rights reserved.
# Adapted from test_Mymodule.py by Jeff Chang
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
import os
import unittest
import math
from ... |
/**
******************************************************************************
* @file HAL_i2c.c
* @author AE team
* @version V1.1.0
* @date 09/09/2019
* @brief This file provides all the I2C firmware functions.
******************************************************************************
* @copy
*
*... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import time
from datetime import datetime
EPOCH = datetime(1970, 1, 1)
def to_unix_timestamp(dt):
return int(time.mktime(dt.timetuple()))
|
def findLength(string):
l= 0
s= string.strip()
for i in range(len(string)):
if s[i]==" ":
l=0
else:
l+=1
return l
if __name__=="__main__":
string = input()
print(findLength(string)) |
#!/usr/bin/env python
import argparse
import os
import sys
import subprocess
import logging
import time
import itertools
import glob
import re
from distutils.version import LooseVersion
from liftover_restricted_vcf_map import lift_vcfs, lift_maps
from generate_small_test_ref import gen_restricted_ref_and_vcfs
from va... |
from typing import List, Optional
from pydantic import BaseModel
class Error(BaseModel):
loc: Optional[List[str]] = None
msg: str
type: str
class ErrorResponse(BaseModel):
detail: List[Error]
|
import React, { useState, useEffect } from 'react';
import Alert from 'react-bootstrap/Alert';
import { useParams } from 'react-router-dom';
import Col from 'react-bootstrap/Col'
import Form from 'react-bootstrap/Form';
import Button from 'react-bootstrap/Button';
import Spinner from 'react-bootstrap/Spinner'
import Hi... |
import FWCore.ParameterSet.Config as cms
process = cms.Process("DDCMSDetectorTest")
process.source = cms.Source("EmptySource")
process.maxEvents = cms.untracked.PSet(
input = cms.untracked.int32(1)
)
process.MessageLogger = cms.Service(
"MessageLogger",
statistics = cms.untracked.vstring('cout', 'geo... |
/*
A C-program for MT19937, with initialization improved 2002/1/26.
Coded by Takuji Nishimura and Makoto Matsumoto.
Before using, initialize the state by using init_genrand(seed)
or init_by_array(init_key, key_length).
Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
All rights r... |
import time
def rhs_lookup(P, beta, omega, rho, c, points2, L2, M2, N2, i_harm, interp_funs):
# Create vector for matrix-vector product
if i_harm == 1:
# Second harmonic
xIn = -2 * beta * omega**2 / (rho * c**4) * P[0] * P[0]
elif i_harm == 2:
# Third harmonic
# Interpolate P... |
const getCoordinate = (e, type) =>
type === 'X' ? e.pageX || e.touches[0].pageX : e.pageY || e.touches[0].pageY;
export default getCoordinate;
|
import logger from 'winston';
export default {
up(queryInterface) {
return queryInterface.bulkInsert('Vris', [
{
code: 'Q1',
question: 'Start',
choice: 'A',
response: 'Continue',
weight: 0,
createdAt: new Date(),
updatedAt: new Date()
},
{... |
//ConvexVersion.h
// Copyright Querysoft Limited 2015
//
// Permission is hereby granted, free of charge, to any person or organization
// obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Sof... |
dt_true.rename(columns={'income':'inc','consumption':'con'},inplace=True)
dt_true.head() |
import React, { Component } from "react";
class CustomSelect extends Component {
render() {
const {
input: { value, onChange }
} = this.props;
const selectOptions = this.props.options.map(option => (
<option key={option.label} value={option.value}>
{o... |
from django.test import RequestFactory as BaseRequestFactory
from .site import SiteFactory
class RequestFactory(BaseRequestFactory):
def __init__(self, site=None, user=None, **defaults):
super().__init__(**defaults)
self.site = site
self.user = user
def request(self, user=None, site=... |
# Copyright 2021 Katteli Inc.
# TestFlows.com Open-Source Software Testing Framework (http://testflows.com)
#
# 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/lice... |
class Fields:
def __init__(self, length, offset, maxLength = None):
self.length = length
self.maxLength = length if maxLength is None else maxLength
self.offset = offset
@staticmethod
def from_bytes(bbuff):
return Fields.from_buffer(io.BytesIO(bbuff))
@staticmethod
def from_buffer( buff):
length = ... |
import { useState } from 'react';
const ToDoForm = ({ addTask }) => {
const [userInput, setUserInput] = useState('');
const handleChange = (e) => {
e.preventDefault();
setUserInput(e.target.value);
};
const handleSubmit = (e) => {
e.preventDefault();
addTask(userInput);
setUserInput('');
... |
from getpass import getuser
from shlex import quote
from typing import List, Tuple
import click
import hashlib
import logging
import os
import subprocess
import sys
import time
from ray.autoscaler.docker import check_docker_running_cmd, with_docker_exec
from ray.autoscaler.log_timer import LogTimer
from ray.autoscale... |
import os
import sys
import requests
import subprocess
import shutil
import logging
import tkinter
from tkinter import filedialog
import json
# import winreg
#! VSCodeで実行するときはF5じゃないとsubprocess関連のコードがタヒぬ
class Main:
#* ここで定義する変数はクラス変数になると噂されている
# current_dir = os.path.dirname(os.path.abspath(__file__))
d... |
# coding: utf-8
"""
Licensed to Cloudera, Inc. under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. Cloudera, Inc. licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use thi... |
/**@preserve GeneXus Java 10_3_12-110051 on December 12, 2020 12:58:55.12
*/
gx.evt.autoSkip = false;
gx.define('hconsultavaloratributo', false, function () {
this.ServerClass = "hconsultavaloratributo" ;
this.PackageName = "" ;
this.setObjectType("web");
this.setOnAjaxSessionTimeout("Warn");
this.has... |
/**
* @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
/**
* @fileOverview Defines the {@link CKEDITOR.lang} object, for the
* Slovenian language.
*/
/**#@+
@type String
@example
*/
/... |
import React, { Component } from 'react'
import './AddGunForm.scss'
import 'bootstrap-select';
import toastr from 'toastr'
class Form extends Component {
constructor(props) {
super(props)
this.state = {
gunName: "",
reference:"",
... |
from Tkinter import *
from Dialog import Dialog
# this shows how to create a new window with a button in it
# that can create new windows
class Test(Frame):
def printit(self):
print "hi"
def makeWindow(self):
"""Create a top-level dialog with some buttons.
This uses the Dialog class,... |
import argparse
from typing import List
import torch
import torch.nn as nn
from torch.optim import AdamW as Adam
from logzero import logger as log
from gpt2.data import Vocab, Tokenizer
from gpt2.modeling import Generator
from gpt2.policy_generation import PolicyGenerationSpec, PolicyGenerateConfig, PolicyGenerator
... |
'''LeNet in PyTorch.'''
import torch.nn as nn
import torch.nn.functional as F
class LeNet(nn.Module):
def __init__(self, num_classes=10):
super(LeNet, self).__init__()
self.conv1 = nn.Conv2d(3, 6, 5)
self.conv2 = nn.Conv2d(6, 16, 5)
self.fc1 = nn.Linear(16*5*5, 120)
self.f... |
"""scrapli_community.siemens.roxii.sync_driver"""
from scrapli.driver import NetworkDriver
def default_sync_on_open(conn: NetworkDriver) -> None:
"""
siemens_roxii on_open callable
Args:
conn: NetworkDriver object
Returns:
N/A
Raises:
N/A
"""
conn.acquire_priv(d... |
import pytest
import ray
from ray.experimental import workflow
from filelock import FileLock
def test_workflow_manager(workflow_start_regular, tmp_path):
# For sync between jobs
tmp_file = str(tmp_path / "lock")
lock = FileLock(tmp_file)
lock.acquire()
# For sync between jobs
flag_file = tmp_... |
# fixture and parameter have the same name
# pylint: disable=redefined-outer-name,protected-access
import xml.etree.ElementTree as ET
from unittest.mock import MagicMock, Mock, patch
import yaml
import pytest
from rpdk.core.exceptions import InternalError, SysExitRecommendedError
from rpdk.core.project import Project... |
/*
* Copyright 2016 NIIT Ltd, Wipro Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless requi... |
// @flow
import fs from "fs-extra";
import path from "path";
import pako from "pako";
import {BackendAdapterLoader} from "./analysisAdapter";
import {stringToRepoId} from "../../core/repoId";
import {declaration} from "./declaration";
import {RelationalView} from "./relationalView";
import {createGraph} from "./create... |
import pytest
from eth_tester.exceptions import TransactionFailed
from raiden_contracts.constants import (
TEST_SETTLE_TIMEOUT_MIN,
ChannelEvent,
ChannelState,
)
from raiden_contracts.utils.events import check_channel_closed
from raiden_contracts.tests.utils import ChannelValues
from raiden_contracts.tests... |
from tuneta.tune_ta import TuneTA
import pandas as pd
from pandas_ta import percent_return
from sklearn.model_selection import train_test_split
import yfinance as yf
if __name__ == "__main__":
# Download data set from yahoo, calculate next day return and split into train and test
X = yf.download("SPY", period... |
"""Functions for sampling data.
"""
import numpy as np
__all__ = []
def resample_equal_proportion(X, y, train_size=0.667):
"""Sample in equal proportion.
Parameters
----------
:param y: array, shape (n_obs) Input data to be split
:param train_size: float, default: 0.667
Proportion to sp... |
""" Shared fixtures for tests """
import sqlite3
import pytest
import dbreak
import dbreak.sessions
@pytest.fixture()
def basic_raw_connections():
""" Couple of basic unwrapped SQLite connections """
return {
"conn1": sqlite3.connect(":memory:"),
"conn2": sqlite3.connect(":memory:")
}
... |
const GAMConfiguration = require('@base-cms/marko-web-gam/config');
module.exports = ({
accountId = '6407152',
basePath,
} = {}) => {
const config = new GAMConfiguration(accountId, { basePath });
config
.setTemplate('LB', {
size: [[970, 250], [970, 90], [728, 90], [300, 50]],
sizeMapping: [
... |
//
// CJRadioButtonCycleComposeView.h
// CJRadioDemo
//
// Created by ciyouzen on 14-11-5.
// Copyright (c) 2014年 dvlproad. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "CJRadioButtons.h"
#import "CJCycleComposeView.h"
#import "CJRadioModule.h"
/**
* 一个整合了单选按钮和循环视图的视图
*/
@class CJRadioButtonCycleCo... |
# coding=utf-8
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import functools
from azure.core.credentials import AzureKeyCredential
from azure.ai.textanalytics import TextAnalyticsClient, ApiVersion
from testcase im... |
const each = require("../collection/each.js");
/**
* Create an object from a query string encoded by toQueryString.
* @param {String} str The query string to evaluate
* @param {Boolean} deep If true, the function will attempt to reassemble all arrays encoded
* @returns {Object} The... |
#pragma once
#include <cstdint>
#include <cstdio>
#include <vector>
#include <thread>
#include <OMX_Component.h>
extern "C" {
#include <libavformat/avformat.h>
}
#include "selfdrive/common/queue.h"
#include "selfdrive/loggerd/encoder.h"
struct OmxBuffer {
OMX_BUFFERHEADERTYPE header;
OMX_U8 data[];
};
// OmxE... |
var sigUtil = require('eth-sig-util')
var Eth = require('ethjs')
window.Eth = Eth
////////Check if the user has Web3, set web3 provider and report web3 status//////
if (typeof web3 !== 'undefined') {
web3 = new Web3(web3.currentProvider);
console.log("You've got Web3");
//If there's web3, make sure it's not loc... |
var randomNumber = function (max) {
return Math.floor(Math.random() * max);
};
var slice = Array.prototype.slice.call.bind(Array.prototype.slice);
var pushAll = function (arr, items) {
arr.splice.apply(arr, [arr.length, 0].concat(items));
};
var add = function (arr, item) {
if (!~arr.indexOf(item)) arr.push(item)... |
require('./bootstrap');
import Alpine from 'alpinejs'
window.Alpine = Alpine;
Alpine.start();
import { createApp } from 'vue'
import Messagerie from './components/MessagerieComponent.vue'
import { createRouter, createWebHistory } from 'vue-router'
import store from './store/store'
import MessagesComponent from './comp... |
# coding: utf-8
"""
NiFi Rest Api
The Rest Api provides programmatic access to command and control a NiFi instance in real time. Start and stop processors, monitor queues, query provenance data, and more. Each endpoint below includes a description, ... |
import Controller from '@ember/controller';
export default class ApplicationController extends Controller {
state = {
from: 0,
to: 100
}
min = 0;
max = 300;
template = `
<PaperDualSlider
@from={{this.state.from}}
@to={{this.state.to}}
@min={{this.min}}
@max={{th... |
# Copyright 2016 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/licenses/LICENSE-2.0
#
# Unless required by applica... |
sc = None
vc = None
|
/**
* EverettsInterface EverettsInterface License
* This source code and all modifications done by EverettsInterface
* are licensed under the Apache Public License (version 2) and
* are Copyright (c) 2009-2014 by EverettsInterface, Inc.
*/
/*
* Copyright (C) 2006, 2007 Apple Computer, Inc. All rights reserved.
... |
var baseToString = require('./_baseToString'),
castSlice = require('./_castSlice'),
charsEndIndex = require('./_charsEndIndex'),
stringToArray = require('./_stringToArray'),
toString = require('./toString');
/** Used to match leading and trailing whitespace. */
var reTrimEnd = /\s+$/;
/**
* Removes t... |