text stringlengths 3 1.05M |
|---|
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.InterceptedCommand = void 0;
/**
* Implements a [[ICommand command]] wrapped by an interceptor.
* It allows to build command call chains. The interceptor can alter execution
* and delegate calls to a next command, which can be inter... |
from azureml.core import Workspace, Experiment, Environment, ScriptRunConfig
from azureml.core.authentication import InteractiveLoginAuthentication
from azureml.train.hyperdrive import GridParameterSampling
from azureml.train.hyperdrive import HyperDriveConfig
from azureml.core import Dataset
from azureml.widgets ... |
"use strict";
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj ... |
module.exports = function(options) {
return function(req, res, next) {
// Implement the middleware function based on the options object
next()
}
}
|
# Copyright 2015 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... |
'''
Read an annotated VOTABLE and show different outputs
Created on 31 mars 2020
@author: laurentmichel
'''
import os, sys
from astropy import units as u
from astropy.coordinates import SkyCoord
import matplotlib.pyplot as plt
from client.parser.mango_browser import MangoBrowser
import logging
logging.getLogger('mat... |
import firebase_admin
from firebase_admin import credentials, firestore, storage
class DB_Init:
def __init__(self):
super().__init__()
self.init_firestore_app()
self.db = firestore.client()
def init_firestore_app(self):
cred = credentials.Certificate("fellowcoder-org-dev-fire... |
mycallback( {"TOTAL FED-NONFED AMOUNT": "230.00", "Activity is Direct Candidate Support": "", "PAYEE CITY": "Alexandria", "EXPENDITURE DATE": "20100910", "PAYEE SUFFIX": "", "EXPENDITURE PURPOSE DESCRIP": "personnel training", "PAYEE LAST NAME": "", "PAYEE FIRST NAME": "", "Activity is Direct Fundraising": "", "BACK RE... |
/* parser generated by jison 0.4.17 */
/*
Returns a Parser object of the following structure:
Parser: {
yy: {}
}
Parser.prototype: {
yy: {},
trace: function(),
symbols_: {associative list: name ==> number},
terminals_: {associative list: number ==> name},
productions_: [...],
perfo... |
/****************************************散点图参数开始**********************************************************/
var sanDianOption = {
tooltip : {
trigger: 'axis',
showDelay : 0,
axisPointer:{
show: false,
type : 'cross',
lineStyle: {
t... |
from __future__ import absolute_import, print_function
import subprocess
import pytest
from os.path import join, dirname, pardir
from unittest import TestCase, skipIf
try:
import IPython
except ImportError:
is_IPython = False
else:
is_IPython = True
@pytest.mark.examples
class TestExamples(TestCase):
... |
import os
import queue
from fake_useragent import UserAgent
'''
配置文件:
Root_Path路径信息 项目根目录的绝对路径
'''
Root_Path = os.path.dirname(os.path.abspath(__file__))
'''
Server酱your_key
'''
SERVERKEY=''
'''
工具所在路径:
chrome路径信息 Chrome_Path 例如:C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.... |
//starts
const {
WAConnection,
MessageType,
Presence,
Mimetype,
GroupSettingChange,
MessageOptions,
WALocationMessage,
WA_MESSAGE_STUB_TYPES,
ReconnectMode,
ProxyAgent,
waChatKey,
mentionedJid,
processTime,
} = require('@adiwajshing/baileys')
// Load Js File
const { ... |
// This file was automatically generated. Do not modify.
'use strict';
goog.provide('Blockly.Msg.hi');
goog.require('Blockly.Msg');
Blockly.Msg.ADD_COMMENT = "टिप्पणी छोड़ें";
Blockly.Msg.CHANGE_VALUE_TITLE = "मान परिवर्तित करें:";
Blockly.Msg.CLEAN_UP = "Clean up Blocks"; // untranslated
Blockly.Msg.COLLAPSE_ALL... |
"""Unit test for KNX binary/integer objects."""
import pytest
from xknx.dpt import (
DPT2ByteFloat,
DPTArray,
DPTBase,
DPTBinary,
DPTNumeric,
DPTScaling,
DPTString,
DPTTemperature,
)
from xknx.exceptions import ConversionError
class TestDPT:
"""Test class for KNX binary/integer ob... |
import AxiosMockAdapter from 'axios-mock-adapter';
import { TEST_HOST } from 'helpers/test_constants';
import axios from '~/lib/utils/axios_utils';
import boardsStore from '~/boards/stores/boards_store';
import eventHub from '~/boards/eventhub';
import { listObj, listObjDuplicate } from './mock_data';
import ListIssue... |
/**
* A class representation of the BSON Double type.
*
* @class
* @param {number} value the number we want to represent as a double.
* @return {Double}
*/
function Double(value) {
if(!(this instanceof Double)) return new Double(value);
this._bsontype = 'Double';
this.value = value;
}
/**
* Access the nu... |
import nodeResolve from "@rollup/plugin-node-resolve";
import { uglify } from "@microsoft/applicationinsights-rollup-plugin-uglify3-js";
import replace from "@rollup/plugin-replace";
import dynamicRemove from "@microsoft/dynamicproto-js/tools/rollup/node/removedynamic";
import { es3Poly, es3Check, importCheck } from "@... |
# Utility functions.
#
# Copyright (c) 2016 Gijs van Tulder / Erasmus MC, the Netherlands
# This code is licensed under the MIT license. See LICENSE for details.
import numpy as np
import matplotlib.pyplot as plt
def generate_data(N):
"""Creates a noisy dataset with some simple pattern in it."""
T = N * 38
... |
import { Meteor } from 'meteor/meteor';
import { DDPRateLimiter } from 'meteor/ddp-rate-limiter';
import { RateLimiter } from 'meteor/rate-limit';
import _ from 'underscore';
RocketChat.RateLimiter = new class {
limitFunction(fn, numRequests, timeInterval, matchers) {
if (process.env.TEST_MODE === 'true') {
retu... |
import numpy as np
from scipy import stats
VALID_MIN = 20
VALID_MAX = 2 ** (16 - 1)
COLOR_MAP = {
"hand": (0, 0, 255),
"left": (255, 0, 0),
"right": (0, 255, 0),
}
def convert_depth_to_uvd(depth):
if depth.ndim == 2:
d = np.expand_dims(depth, axis=0)
d = depth
_, H, W = d.shape
u... |
import { addBooleanParameter } from "@ovh-ui/common/component-utils";
import get from "lodash/get";
export default class {
/* @ngInject */
constructor ($attrs, $compile, $element, $scope, $timeout) {
this.$attrs = $attrs;
this.$compile = $compile;
this.$element = $element;
this.... |
'use strict'
const chai = require('chai')
const dirtyChai = require('dirty-chai')
const fs = require('fs')
const path = require('path')
const os = require('os')
const qs = require('querystring')
const http = require('http')
const { closeWindow } = require('./window-helpers')
const { emittedOnce } = require('./events-h... |
#pragma once
#include "Enums.h"
class Tree
{
public:
Enums::SymbolAndValue getPayload();
Tree** getChildren();
Tree(Enums::SymbolAndValue p);
Tree(Enums::SymbolAndValue p, Tree* first);
Tree(Enums::SymbolAndValue p, Tree* first, Tree* second);
Tree(Enums::SymbolAndValue p, Tree* first, Tree* second, Tree* third)... |
# Princeton University licenses this file to You 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 writin... |
#!/usr/bin/python
# Copyright (c) PLUMgrid, Inc.
# Licensed under the Apache License, Version 2.0 (the "License")
# run in project examples directory with:
# sudo ./hello_world.py"
# see trace_fields.py for a longer example
from bcc import BPF
# This may not work for 4.17 on x64, you need replace kprobe__sys_clone w... |
[{"Owner":"JohnK","Date":"2018-11-13T21:43:11Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_\n\t_lt_a href_eq__qt_https_dd_//en.m.wikipedia.org/wiki/BabylonJS_qt_ rel_eq__qt_external nofollow_qt__gt_https_dd_//en.m.wikipedia.org/wiki/BabylonJS_lt_/a_gt_\n_lt_/p_gt_\n\n_lt_p_gt_\n\tEDIT 17 Nov 2018 O... |
/***************************************************************************
* Copyright 1998-2017 by authors (see AUTHORS.txt) *
* *
* This file is part of LuxRender. *
* ... |
# Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.c (the "License");
# you may not use this file except in compliance with the License.
"""
Userbot module to help you manage a group
"""
from asyncio import sleep
from os import remove
from telethon.errors ... |
"""
Author: Daniel Fink
Email: daniel-fink@outlook.com
"""
from quart import Quart, request, jsonify
import os
import asyncio
import numpy as np
from qiskitSerializer import QiskitSerializer
from quantumBackendFactory import QuantumBackendFactory
from clusteringCircuitGenerator import ClusteringCircuitGenerator
from d... |
/**
* @file TCPServer-IPv4.c
* @author Natan Meirov (NatanMeirov@gmail.com)
* @brief A TCP Server implementation, supports IPv4 only
* @version 1.0
* @date 2021-04-20
*
* @copyright Copyright (c) 2021
*
*/
#ifndef __TCPSERVER_IPV4_H__
#define __TCPSERVER_IPV4_H__
/* Defines: */
typedef struct TCPServer TC... |
#pragma once
#include <Core/Block.h>
#include <DataStreams/IBlockStream_fwd.h>
#include <Storages/TableLockHolder.h>
#include <boost/noncopyable.hpp>
#include <memory>
#include <string>
#include <vector>
namespace DB
{
struct Progress;
/** Interface of stream for writing data (into table, filesystem, network, te... |
var chai = require('chai');
chai.should();
var menu = require('./fixtures/example_menu.json').menu;
var untappd = require('../scripts/untappd.js');
describe('#untappd', function(){
describe('Extract Menu Info', function(){
var processedMenu;
before(function(){
processedMenu = untappd.__extractMenuInfo... |
window.onload = () => {
'use strict';
if ('serviceWorker' in navigator) {
navigator.serviceWorker
.register('./sw.js').then(function (registration) {
// Service worker registered correctly.
console.log('ServiceWorker registration successful with scop... |
"use strict";
/*
* ATTENTION: An "eval-source-map" devtool has been used.
* This devtool is neither made for production nor for readable output files.
* It uses "eval()" calls to create a separate source file with attached SourceMaps in the browser devtools.
* If you are trying to read the output file, select a dif... |
/*
* Copyright (c) 2015, Freescale Semiconductor, Inc.
* Copyright 2016 - 2017 NXP
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef _USB_DEVICE_CONFIG_H_
#define _USB_DEVICE_CONFIG_H_
/*******************************************************************************
* Definitions
******... |
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modi... |
#!/usr/bin/env python3
"""
Author : dickdijk <dickdijk@localhost>
Date : 2020-09-12
Purpose: Rock the Casbah
"""
import argparse
import re
from pprint import pprint
import sys
# --------------------------------------------------
def get_args():
"""Get command-line arguments"""
parser = argparse.ArgumentP... |
import numpy as np
import pytest
import pandas as pd
import pandas.util.testing as tm
@pytest.fixture
def sparse_df():
return pd.SparseDataFrame({0: {0: 1}, 1: {1: 1}, 2: {2: 1}}) # eye
@pytest.fixture
def multi_index3():
return pd.MultiIndex.from_tuples([(0, 0), (1, 1), (2, 2)])
@pytest.mark.filterwarn... |
module.exports = {
siteMetadata: {
title: 'Frontend Developer Test Project',
},
plugins: ['gatsby-plugin-react-helmet'],
}
|
from setuptools import setup, find_packages
setup(
name='hpccloud-plugin',
version='1.0.0',
description='Girder plugin to support HPCCloud projects and simulations',
packages=find_packages(),
install_requires=[
'girder>=3.0.0a5'
],
entry_points={
'girder.plugin': [
'hp... |
const fs = require("fs");
const rules = require("./src/eslint-rule-hints");
const RULES_PLACEHOLDER = new RegExp(/INSERT_RULES/g);
/** @type {string} */
const snippets = fs.readFileSync("./src/snippets.json", "utf8");
fs.writeFileSync(
"./snippets/snippets.json",
snippets.replace(RULES_PLACEHOLDER, rules.join(",... |
/*-------------------------------------------------------------------------
*
* ASCII and MULE_INTERNAL
*
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $PostgreSQL$
*
*--------------------... |
#ifndef TYPEDEFS_H
#define TYPEDEFS_H
#include <string>
#include <vector>
#include <set>
#include <map>
using af_key_t = std::pair<std::string /* sample */, std::string /* cluster */>;
using af_table_t = std::map<af_key_t, float>;
using edge_t = std::pair<std::string /* from node */, std::string /* to node */>;
usin... |
var dir_46d8e2746c43089a4f7a5f7f15101a6a =
[
[ "inc", "dir_bd0bc0336deaf85967edaa654261a041.html", "dir_bd0bc0336deaf85967edaa654261a041" ]
]; |
const { stripIndent } = require('common-tags')
const { Promise } = Cypress
describe('src/cy/commands/cookies', () => {
beforeEach(() => {
// call through normally on everything
cy.stub(Cypress, 'automation').rejects(new Error('Cypress.automation was not stubbed'))
})
context('test:before:run:async', () ... |
"""Implementation of a Volumio inteface."""
import aiohttp
import asyncio
import urllib
class Volumio:
"""A connection to Volumio."""
def __init__(self, host, port, session=None):
"""Initialize the object."""
self._host = host
self._port = port
self._created_session = False
... |
from ddtrace import Pin
from flask import abort, Blueprint, render_template_string
from .limiter import limiter
# Create a new Blueprint
bp = Blueprint('bp', __name__, url_prefix='/bp/')
# Just showing that we can override the service set for this blueprint
Pin.override(bp, service='flask-bp', app='flask', app_type... |
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
import SocketServer
class S(BaseHTTPRequestHandler):
def _set_headers(self):
self.send_response(200)
self.send_header('Content-type', 'text/html')
self.end_headers()
def do_GET(self):
self._set_headers()
self... |
(function() {
'use strict';
var globals = typeof window === 'undefined' ? global : window;
if (typeof globals.require === 'function') return;
var modules = {};
var cache = {};
var aliases = {};
var has = ({}).hasOwnProperty;
var expRe = /^\.\.?(\/|$)/;
var expand = function(root, name) {
var re... |
# -*- coding: utf-8 -*-
# Copyright (c) Vispy Development Team. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
import numpy as np
from ..ext.six.moves import xrange
def _fix_colors(colors):
colors = np.asarray(colors)
if colors.ndim not in (2, 3):
rais... |
from contextlib import suppress
import ibis.config_init # noqa: F401
import ibis.expr.api as api # noqa: F401
import ibis.expr.types as ir # noqa: F401
# pandas backend is mandatory
import ibis.pandas.api as pandas # noqa: F401
import ibis.util as util # noqa: F401
from ibis.common.exceptions import IbisError
fro... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
# dive.py
#
# Copyright 2021 baarkerlounger
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publi... |
const readFile = () => {
const file = document.querySelector('#file').files[0];
const reader = new FileReader();
reader.onload = function(progressEvent){
let lines = this.result.split('\n');
lines.forEach(line => {
document.querySelector('.result').innerHTML += `${line}<br>`;
})
};
reader.readAsText(f... |
from setuptools import setup
setup(name='vnav',
version='0.1',
description='Script to parse DICOM files from a vNav series and convert them into motion scores',
url='https://github.com/MRIMotionCorrection/parse_vNav_Motion',
author='Dylan Tisdall',
author_email='mtisdall@mail.med.upenn.edu',
li... |
#!/usr/bin/env python
# Copyright 2014-2019 The PySCF Developers. 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
#
# U... |
from .commun import get_innov
import innov
def test_join_url():
def join (base):
assert innov.util.join_url(base, "/1") == base + "/1"
assert innov.util.join_url(base, "/1/") == base + "/1/"
assert innov.util.join_url(base, "1") == base + "/1"
assert innov.util.join_url(base... |
import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
# noqa: F401
# noqa: F401
# noqa: F401
# noqa: F401
import traceback
# Disable insecure warnings
requests.packages.urllib3.disable_warnings()
'''CONSTANTS'''
DEPROVISIONED_STATUS = 'DEPROVISIONED'
USER_IS_DISABLED_MSG = 'Dea... |
#!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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 a... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Contributors: Titouan Parcollet
# Authors: Chiheb Trabelsi
import numpy as np
from numpy.random import RandomState
from random import gauss
import keras.backend as K
from tensorflow.keras import initializers
from tensorflow.keras.initializers import Initializ... |
"""
MIT License
Copyright (c) 2021 TheHamkerCat
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, ... |
// Copyright (c) 2013 TopCoder. 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 la... |
/*****************************************************************************
*
* ---------------------------------- bfs.c ---------------------------------- *
*
*****************************************************************************/
#include <stdlib.h>
// #include <string.h>
// #include <stdio.h>
#include "b... |
"""This module contains the general information for MgmtConnection ManagedObject."""
import sys, os
from ...ucsmo import ManagedObject
from ...ucscoremeta import UcsVersion, MoPropertyMeta, MoMeta
from ...ucsmeta import VersionMeta
class MgmtConnectionConsts():
ACK_ACKNOWLEDGED = "acknowledged"
ACK_UN_INITIA... |
(function (J) {
J.ready(function () {
checkParam();
J.class('func-img').tip([
'获取汉字的拼音|音调',
'支持多音字词',
'获取汉字的笔画数|笔画顺序',
'支持繁简体转换|繁体拼音笔画'
]);
J.id('_year').txt((new Date()).getFullYear());
J.id('tryInput').on('input', function () ... |
#ifndef BARELYMUSICIAN_DSP_DSP_UTILS_H_
#define BARELYMUSICIAN_DSP_DSP_UTILS_H_
namespace barelyapi {
/// PI.
inline constexpr double kPi = 3.14159265358979323846;
inline constexpr double kTwoPi = 2.0 * kPi;
/// Minimum dB threshold.
inline constexpr double kMinDecibels = -80.0;
/// Converts a value from dB to line... |
# Copyright 2020 Juan L Gamella
# 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 conditions and the following disclaimer.
# 2.... |
"""
Use this python script to apply semantic segmentation any videos
of your choice.
USAGE: python test_vid.py --input <path to vid> --model-path <path to saved checkpoint/weight file>
"""
import cv2
import torch
import argparse
import time
import albumentations
import config
import numpy as np
from PIL import Image... |
// MIT License
// Copyright (c) 2017 Vadim Grigoruk @nesbox // grigoruk@gmail.com
// Damien de Lemeny @ddelemeny // hello@ddelemeny.me
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// ... |
#pragma once
#include "il2cpp-config.h"
#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif
#include <stdint.h>
#include "UnityEngine_UI_UnityEngine_EventSystems_PointerInp1441575871.h"
#include "UnityEngine_UnityEngine_Vector22243707579.h"
#ifdef __clang__
#pragma clang d... |
from __future__ import print_function
from numpy import pi, sin, cos
import numpy as np
from bokeh.io import show, output_file
from bokeh.models.glyphs import Line, Circle
from bokeh.models import (
Plot, DataRange1d, LinearAxis, ColumnDataSource,
PanTool, WheelZoomTool, SaveTool, Legend,
)
from bokeh.core.en... |
import h5py
import numpy as np
import math
def load_dataset():
train_dataset = h5py.File('datasets/train_signs.h5', "r")
train_set_x_orig = np.array(train_dataset["train_set_x"][:])
train_set_y_orig = np.array(train_dataset["train_set_y"][:])
test_dataset = h5py.File('datasets/test_signs.h5', "r")
... |
import os
from setuptools import find_packages, setup
with open(os.path.join("stable_baselines3", "version.txt"), "r") as file_handler:
__version__ = file_handler.read().strip()
long_description = """
# Stable Baselines3
Stable Baselines3 is a set of reliable implementations of reinforcement learning algorith... |
var pos = 0;
let pageWidth = window.innerWidth;
const pacArray = [
['PacMan1.png', 'PacMan2.png'],
['PacMan3.png', 'PacMan4.png']
];
// direction 0 is left to right, 1 is right to left
var direction = 0;
// mouth 0 is open, 1 is closed
var mouth = 0;
function run() {
let img = document.getEleme... |
import yaml
import db
with open("input.yaml", "r") as f:
servers = yaml.safe_load(f)["servers"]
devices = []
for server in servers:
if type(server["slot"]) == int:
start = end = server["slot"]
else:
rr = server["slot"].split("-")
start, end = map(int, rr)
devices.append(db.Devi... |
#include "../lvgl/lvgl.h"
#ifndef LV_ATTRIBUTE_MEM_ALIGN
#define LV_ATTRIBUTE_MEM_ALIGN
#endif
const LV_ATTRIBUTE_MEM_ALIGN uint8_t menu_map[] = {
#if LV_COLOR_DEPTH == 1 || LV_COLOR_DEPTH == 8
/*Pixel format: Alpha 8 bit, Red: 3 bit, Green: 3 bit, Blue: 2 bit*/
0x00, 0x00, 0xff, 0x80, 0xff, 0xdf, 0xff, ... |
#!/usr/bin/python3
import os
import platform
import sys
import time
import socket
print >> sys.stderr, __doc__
print "Version :", platform.python_version()
print "Program :", sys.executable
print 'Script :', os.path.abspath(__file__)
print
s = socket.socket()
s.bind(("",0))
socketname = s.getsockname()
print socke... |
#!/usr/bin/env python3
# SPDX-License-Identifier: MIT
import sys, pathlib
import time
sys.path.append(str(pathlib.Path(__file__).resolve().parents[1]))
# speaker_amp.py -- play audio through the embedded speaker on Mac mini
#
# sample usage with sox:
#
# sox INPUT_FILE -t raw -r 48000 -c 1 -e signed-int -b 32 -L - g... |
/*! For license information please see summernote-lite.min.js.LICENSE.txt */
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("jquery"));else if("function"==typeof define&&define.amd)define(["jquery"],e);else{var n="object"==typeof exports?e(require("jquery")):e(t.jQuery);for... |
const request = require('request');
const crypto = require('crypto');
const config = {
url: 'https://live.kewail.com/sms/v1/sendsinglesms',
accesskey: '5d819a6787b65f1f37d6cc83', // 根据实际填 accesskey
secretkey: 'b9e9b328ed43453da397ab820e23fd40', // 根据实际填 secretkey
};
let sms = {
getRandom(lower = 100... |
"""empty message
Revision ID: 2f75e96dd995
Revises: 4bc7f3b6b092
Create Date: 2019-08-28 17:33:02.279980
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = "2f75e96dd995"
down_revision = "4bc7f3b6b092"
branch_labels = None... |
/**********************************************************************
marshal.c -
$Author: normal $
created at: Thu Apr 27 16:30:01 JST 1995
Copyright (C) 1993-2007 Yukihiro Matsumoto
**********************************************************************/
#if defined __GNUC__ && __GNUC__ < 3
# error too ... |
import { linkColor, linkHoverColor } from './Links'
import { white, grays } from './Colors'
import { borderWidth, componentActiveColor, componentActiveBg } from './Components'
import { inputBtnFocusBoxShadow } from './InputButtons'
import {
paginationPaddingY,
paginationPaddingX,
paginationPaddingYSm,
paginati... |
import numpy as np
class VectorNewton(object):
"""
Vectorized Newton solver
"""
def __init__(self, f, J):
self.f = f
self.J = J
def solve(self, x0, tol=1e-10, verbose=False):
x = x0.copy()
y = self.f(x)
r = np.abs(y).max()
i = 0
while r > tol:... |
// Primitives module containing methods for creating primitive objects.
define (function () { // jshint ignore:line
'use strict';
return {
// Create a cube
makeBox: function (l, b, h) {
var geometry = new THREE.BoxGeometry(l, b, h);
for (var i = 0; i < geometry.faces.length; i +=2) {
var hex = Math... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 CERN.
#
# Babel-EDTF is free software; you can redistribute it and/or modify it under
# the terms of the MIT License; see LICENSE file for more details.
"""Module tests."""
def test_version():
"""Test version import."""
from babel_edtf import __version__
ass... |
"""HTTP Client using pyCurl."""
from collections import deque
from functools import partial
from io import BytesIO
from time import time
from kombu.asynchronous.hub import READ, WRITE, get_event_loop
from kombu.exceptions import HttpError
from kombu.utils.encoding import bytes_to_str
from .base import BaseClient
tr... |
# This file is part of the RingDecomposerLib, licensed
# under BSD New license (see LICENSE in the root directory).
# Copyright (c) 2016
# University of Hamburg, ZBH - Center for Bioinformatics
# Niek Andresen, Florian Flachsenberg, Matthias Rarey
#
# Please cite:
#
# Kolodzik, A.; Urbaczek, S.; Rarey, M.
# Unique Ri... |
from itertools import *
from more_itertools import *
size = 10
lines = [line.strip() for line in open("input-11.txt")]
o = list(list(map(int, list(line))) for line in lines)
print(o)
flash_count = 0
step = 0
while True:
step += 1
flashed = []
for i in range(size):
flashed.append([False]*size)
... |
// Copyright (C) 2015 André Bargull. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: Compound Assignment Operator evaluates its operands from left to right.
description: >
The left-hand side expression is evaluated before the right-hand side.
Left-hand si... |
from __future__ import print_function, division
try:
import cPickle as pickle
except:
import pickle
from pdb import set_trace
import numpy as np
from sklearn.feature_extraction.text import TfidfVectorizer
import csv
from collections import Counter
from sklearn import svm
import matplotlib.pyplot as plt
import t... |
/**
* The MIT License
* Copyright (c) 2016 Population Register Centre (VRK)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to... |
import Api from '@/services/api';
export default {
async getGenres() {
return await Api().get('/genres');
},
async updateGenre(genre) {
return await Api().put(`/genre/${genre._id}`, genre);
},
async addGenre(genre) {
return await Api().post(`/genre`, genre);
},
async deleteGenre(genre) {
... |
#!/usr/bin/env python
"""Test for RunningStats class."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from builtins import range # pylint: disable=redefined-builtin
from grr_response_core.lib import flags
from grr_response_core.lib.rdfvalues import ... |
import random , os
corner=[(0,0),(2,2),(0,2),(2,0)]
edge=[(0,1),(2,1),(1,0),(1,2)]
center = [(1,1)]
random.shuffle(corner)
random.shuffle(edge)
diagonal1 = [(i,j) for i in range(3) for j in range(3) if i == j]
diagonal2 = [(i,j) for i in range(3) for j in range(3) if (i+j) == 2]
priority = center + corner... |
#!/usr/bin/python
#
# Copyright 2018-2020 Polyaxon, 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 required by applicable ... |
r"""
Isomorphisms between Weierstrass models of elliptic curves
AUTHORS:
- Robert Bradshaw (2007): initial version
- John Cremona (Jan 2008): isomorphisms, automorphisms and twists
in all characteristics
"""
#*****************************************************************************
# Copyright (C) 2007 Rober... |
from datetime import date
from stringLibs import rpad
def init():
global high_pole
global low_pole
global logging
global logfile
high_pole = "lazers"
low_pole = "feelings"
logging = True
today = date.today()
logfile = f'game-{rpad(today.year,2,"0")}.{rpad(today.month,2,"0")}.{rpad(today.day,2,"0"... |
import copy
import tensorflow as tf
from onnx_tf.handlers.backend_handler import BackendHandler
from onnx_tf.handlers.handler import onnx_op
from onnx_tf.handlers.handler import tf_func
@onnx_op("Compress")
@tf_func(tf.gather)
class Compress(BackendHandler):
@classmethod
def _common(cls, node, **kwargs):
at... |