text stringlengths 3 1.05M |
|---|
//= require app_theme/frontend/base
//= require app_theme/frontend/init
|
var setData = require('@progress/kendo-angular-intl').setData;
setData({
name: "th",
identity: {
language: "th"
},
territory: "TH",
numbers: {
symbols: {
decimal: ".",
group: ",",
list: ";",
percentSign: "%",
plusSign: "+",
... |
class Solution(object):
def sortedSquares(self, A):
"""
:type A: List[int]
:rtype: List[int]
"""
N = len(A)
j = 0
while j < N and A[j] < 0:
j += 1
i = j - 1
res = []
while 0 <= i and j < N:
if A[... |
import pytest
import os
from pathlib import Path
import py3adb
from py3adb import ADB
@pytest.fixture(scope='module')
def adb_executable():
"""
Default ADB executable location in Linux
:return: Location of default ADB executable if there
"""
file_location = '/usr/bin/adb'
if not os.path.isfi... |
$("html").on("click", "button", function(evt) {
var btn = $(evt.currentTarget);
var x = evt.pageX - btn.offset().left;
var y = evt.pageY - btn.offset().top;
var currentRipple = $("<ripple/>");
currentRipple.appendTo(btn).css({
left: x,
top: y
});
setTimeout(()=> {c... |
#!/usr/bin/env python3
"""Script to calculate IMs for empirical distributed seismicity
Writes to multiple empirical DB depending on the config
"""
import argparse
import math
import time
import threading
from mpi4py import MPI
import pandas as pd
import gmhazard_calc as sc
import common
comm = MPI.COMM_WORLD
rank =... |
/**
* angular-input-masks
* Personalized input masks for AngularJS
* @version v2.3.0
* @link http://github.com/assisrafael/angular-input-masks
* @license MIT
*/
require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var ... |
from typing import Union, Tuple, Optional
from collections import OrderedDict
import torch
from torch import nn
class Flatten(nn.Module):
"""
Flatten input tensor to ``(batch_size, -1)`` shape.
"""
def forward(self, x: torch.Tensor):
return x.view(x.size(0), -1)
class ConvBlock(nn.Module):
... |
import Mailgun from "mailgun-js";
import config from "../middleware/config.js";
import express from "express";
import nunjucks from "nunjucks";
import helmet from "helmet";
import path from "path";
import EnglishWord from "../models/EnglishWord";
import WordController from "../controllers/WordController";
export defau... |
"""Support for Axis camera streaming."""
from urllib.parse import urlencode
from homeassistant.components.camera import CameraEntityFeature
from homeassistant.components.mjpeg import MjpegCamera, filter_urllib3_logging
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import HTTP_DIGEST_AUT... |
/**********************************************************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No
* other uses are authorized. This software is owned by Renesas El... |
from abc import ABC, abstractmethod
from typing import Any, List
from zpy.custom.models import DBSSMCredentialsModel, SSMConstants
from zpy.cloud.aws.ssm import SSMParameter
from zpy.api import ApiConfiguration
from zpy.db import DBConnection
from zpy.db.oracle import OracleDB
import logging
import os
class Plugin(A... |
Ext.define('Mas.view.Viewport', {
requires : [ 'Ext.layout.container.Border', 'Ext.tab.Panel' ],
itemId : 'mainView',
extend : 'Ext.container.Viewport',
layout : 'border',
items : [ {
xtype : 'GlobalNav',
region : 'north', // position for region
height : 30
}, {
region : 'center', // center re... |
################################################################################
# Author: Mohamed Boughaba #
# Repository: https://github.com/mboughaba/dotfiles #
# Description: My own taste of dotfiles ... |
#!/usr/bin/env python
# coding=utf-8
# Stan 2013-05-07
from __future__ import (division, absolute_import,
print_function, unicode_literals)
import sys
import os
import glob
import importlib
import logging
try:
from . import __pkgname__, __description__, __version__
from .core.backward... |
#
#
# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Google Inc.
# 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 copyri... |
#!/usr/bin/env python3
# Copyright (c) 2014-2017 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Script to generate list of seed nodes for chainparams.cpp.
This script expects two text files in the dir... |
from collections import deque
import numpy as np
import imutils
import cv2
import time
# green
greenLower = (29, 86, 6)
greenUpper = (64, 255, 255)
# redish
# greenLower = (150,50,50)
# greenUpper = (170,255,255)
# red
greenLower = (160, 100, 100)
greenUpper = (190, 255, 255)
pts = deque(maxlen=32)
camera = cv2.Video... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
"""This module contains some supporting classes."""
import re
from cached_property import cached_property
from threading import Lock
class Widgetable(object):
"""A base class that should be a base class of anything that can be or act like a Widget."... |
const Kamora = require('kamora')
const error = require('../../../config/error')
const validate = require('../../middleware/validate')
const organizationRepository = require('../../repositories/organization')
const userRepository = require('../../repositories/user')
const router = new Kamora.Router()
const Validator = ... |
/*
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
* This devtool is not neither made for production nor for readable output files.
* It uses "eval()" calls to create a separate source file in the browser devtools.
* If you are trying to read the output file, select a differ... |
/*
* If not stated otherwise in this file or this component's Licenses.txt file the
* following copyright and licenses apply:
*
* Copyright 2015 RDK Management
*
* 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 ... |
/*
ivtv driver internal defines and structures
Copyright (C) 2003-2004 Kevin Thayer <nufan_wfk at yahoo.com>
Copyright (C) 2004 Chris Kennedy <c@groovy.org>
Copyright (C) 2005-2007 Hans Verkuil <hverkuil@xs4all.nl>
This program is free software; you can redistribute it and/or modify
it under... |
#pragma once
#include "il2cpp.h"
void Dpr_Battle_Logic_ExpCalculator_CalcExpContainer___ctor (Dpr_Battle_Logic_ExpCalculator_CalcExpContainer_o* __this, const MethodInfo* method_info);
void Dpr_Battle_Logic_ExpCalculator_CalcExpContainer__Clear (Dpr_Battle_Logic_ExpCalculator_CalcExpContainer_o* __this, const MethodI... |
/* $Id$ */
/*
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
*
* 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; eit... |
import logging
from typing import Union, Optional
from lcs.agents.xcs import Condition
from lcs.agents.xncs import Effect, Configuration
import lcs.agents.xcs as xcs
class Classifier(xcs.Classifier):
def __init__(self,
cfg: Optional[Configuration] = None,
condition: Union[Condit... |
# !/usr/bin/env python3
################################################################################
# #
# Program purpose: Prints details in formatted manner. #
# Program Author : Happi Yvan <ivensteinpoker... |
"""The test runner command execution script and save the
test coverage and passing tests number.
This is used by the deploying job mainly.
Command example:
$ python run_tests_and_save_coverage_and_num.py
"""
import re
from logging import Logger
from typing import List
from typing import Match
from typing ... |
#!/usr/bin/env python
import sys
import os
import py7zlib
class un7zip(object):
@classmethod
def is_7zfile(cls, filepath):
'''
Class method: determine if file path points to a valid 7z archive.
'''
is7z = False
fp = None
try:
print("opening "+filepa... |
/**
* @licstart The following is the entire license notice for the
* Javascript code in this page
*
* Copyright 2020 Mozilla 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... |
var staticDayTime = require('./staticDayTime')
var toStringDate = require('./toStringDate')
var isDate = require('./isDate')
/**
* 返回某个年份的第几周
*
* @param {Date} date 日期或数字
* @return {Number}
*/
function getYearWeek (date) {
date = toStringDate(date)
if (isDate(date)) {
date.setHours(0, 0, 0, 0)
... |
function getFuture() {
return JSON.parse(localStorage.getItem("future")) || [];
}
function getPast() {
return JSON.parse(localStorage.getItem("past")) || [];
}
function setFuture(arrayFuture) {
localStorage.setItem("future", JSON.stringify(arrayFuture));
}
function setPast() {}
export { getFuture, getPast, se... |
# Import modules here
import sys
import os
import pytest
import numpy as np
from math import isclose
import platform
sys.path.insert(0, os.path.abspath('../src'))
from read_files import ReadTextFileKeywords, read_csv_columns_by_headers
from read_files import read_csv_columns_by_index, read_text_columns_by_headers
from... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# rule_engine/errors.py
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... |
# Abaqus/CAE script
# Created by M.A. Bessa (M.A.Bessa@tudelft.nl) on 12-Nov-2019 01:18:37
#
from abaqus import *
from abaqusConstants import *
session.viewports['Viewport: 1'].makeCurrent()
#session.viewports['Viewport: 1'].maximize()
from caeModules import *
from driverUtils import executeOnCaeStartup
executeOnCaeSta... |
import "regenerator-runtime";
import "bootstrap/dist/css/bootstrap.min.css";
import "./styles/style.css";
import "./components/app-bar.js";
import main from "./script/view/main.js";
document.addEventListener("DOMContentLoaded", main);
|
"""Stop pytest warning about module already imported: PYTEST_DONT_REWRITE"""
__version__ = "1.7.0"
|
/*$Header: /data/petsun4/data1/src_solaris/4dfptoanalyze/RCS/4dfptoanalyze.c,v 1.26 2007/05/04 04:10:12 avi Exp $*/
/*$Log: 4dfptoanalyze.c,v $
* Revision 1.26 2007/05/04 04:10:12 avi
* quiet gcc -Wall
*
* Revision 1.25 2007/05/01 02:53:59 avi
* gcc v3 compliant (replace libsunmanth function nint() with C co... |
'use strict'
// Template version: 1.2.4
// see http://vuejs-templates.github.io/webpack for documentation.
const path = require('path')
module.exports = {
dev: {
// Paths
assetsSubDirectory: 'static',
assetsPublicPath: '/',
proxyTable: {
'/admin': {
target: 'http://localhost:8080',
... |
import { createStore, applyMiddleware } from 'redux'
import thunk from 'redux-thunk'
import { composeWithDevTools } from 'redux-devtools-extension'
// import { routerMiddleware } from 'react-router-redux'
import reducers from './reducers'
import { history } from './'
// Create Store
export default onCompletion... |
"""
ASGI config for imageclassification project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/4.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('... |
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { AzureB... |
module.exports.commandInfo = {
name: "servers",
aliases: ["servs"],
userPermissions: ROLES.USER.BOT_OWNER
};
/**
* Allows an admin to check the server list
* @param {module:"discord.js".Message} message - Message from the discord server
* @param {("fr"|"en")} language - Language to use in the response
* @param ... |
import xmltodict
import os
import math
import glob
from xml.etree.ElementTree import Element, SubElement, ElementTree
import sys
import lxml.etree as etree
import fnmatch
def merge_nml(skeleton_folder, file_to_write):
skeleton_folder = sys.argv[1]
file_to_write = sys.argv[2]
files_to_merge = glob.glob(skel... |
/**
* @file test_scl_sha_runner.c
* @brief test runner for test_scl_sha.c
*
* @copyright Copyright (c) 2020 SiFive, Inc
* @copyright SPDX-License-Identifier: MIT
*
*/
#include "unity.h"
#include "unity_fixture.h"
// SHA 224
TEST_GROUP_RUNNER(scl_soft_sha_224)
{
RUN_TEST_CASE(scl_soft_sha_224, msg_abc_all_a... |
from django.db import models
from django_deferred_polymorph.models import DeferredPolymorphManager
class TaxManager(DeferredPolymorphManager):
_cache = {}
def get_for_id(self, id):
try:
tax = self.__class__._cache[self.db][id]
except KeyError:
# This could raise a D... |
//import the orm to create functions that will interact with the database
//refer to 00-CatsAppProblem for structure
var orm = require("../config/orm.js");
var burgers = {
//returns whole res from burgers data
all: function(cb) {
orm.all("burgers", function(res) {
cb(res);
});
},
//the variables cols and va... |
# $Id: states.py 7958 2016-07-28 21:52:14Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
This is the ``docutils.parsers.rst.states`` module, the core of
the reStructuredText parser. It defines the following:
:Classes:
- `RSTStateMachine`: ... |
# 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/licenses/LICENSE-2.0
#
# Unless required by applica... |
"""
.. _usr00:
Matlab2cpp is a semi-automatic tool for converting code from Matlab to C++. matlab2cpp is written in Python and is a Python module. Installing the Matlab2cpp module, makes the module available in Python as a module and can be loaded with "import matlab2cpp". In addition to the module, the script "m2cpp ... |
#python -m pip install requests
import requests
import json
CONSOLE_IP = '127.0.0.1'
CONSOLE_API_PORT = '8083'
CONSOLE_API_VERSION = 'v1'
def writeFile(fileName, data):
with open(fileName+".json", "w") as outfile:
outfile.write(json.dumps(data, indent=4))
def getApiToken(username, password):
... |
//Core
import React from 'react';
import PropTypes from 'prop-types';
//Styles
import { StyledCommentInput, StyledCommentLabel } from './CommentInput.styles';
const CommentInput = ({ comment, onChangeTransactionInfo }) => (
<StyledCommentLabel>
<StyledCommentInput
required
type="text"
name="comment"
pla... |
export const TRANSFORM_WIDTH = {
label: 'Width',
param: 'w',
type: 'number'
}
export const TRANSFORM_HEIGHT = {
label: 'Height',
param: 'h',
type: 'number'
}
export const TRANSFORM_POSITION_X = {
label: 'X Offset',
param: 'x',
type: 'number'
}
export const TRANSFORM_POSITION_Y = {
label: 'Y Offse... |
/**
******************************************************************************
* @file stm32l0xx_hal_dac.h
* @author MCD Application Team
* @brief Header file of DAC HAL module.
******************************************************************************
* @attention
*
* <h2><center>© C... |
# https://juejin.im/post/5b9f1af0e51d450e425eb32d
# https://github.com/jadore801120/attention-is-all-you-need-pytorch/blob/master/transformer/SubLayers.py
# https://github.com/jadore801120/attention-is-all-you-need-pytorch/blob/master/transformer/Modules.py
import torch
from torch import nn
class ScaledDotProductAtte... |
(window.webpackJsonp=window.webpackJsonp||[]).push([[0],{107:function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ARTWORK_PERSISTED=exports.IS_FONT_SIZE_MAX=exports.RESET=exports.CHANGE_FONT_COLOR=exports.OPEN_MANUAL_DIALOG=exports.CLOSE_CONFIRM_DIALOG... |
import cv2
import numpy as np
def create_orb_features(image: np.ndarray, max_features: int) -> tuple:
"""Создать ORB и применить к изображению.
:param image: изображение для ORB.
:param max_features: количество фич в ORB.
:return: фичи, полученные с помощью ORB.
"""
orb = cv2.ORB_create(max_fe... |
# Copyright 2019 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... |
from __future__ import print_function, absolute_import
import os
import sys
import time
import datetime
import argparse
import os.path as osp
import numpy as np
import torch
import torch.nn as nn
import torch.backends.cudnn as cudnn
from torch.utils.data import DataLoader
from torch.optim import lr_scheduler
import d... |
# -*-coding:Utf-8 -*
# Copyright (c) 2010-2017 NOEL-BARON Léo
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# ... |
#
# reviewboard/admin/forms.py -- Form classes for the admin UI
#
# Copyright (c) 2008-2010 Christian Hammond
# Copyright (c) 2008-2010 David Trowbridge
#
# 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... |
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(gene... |
import '@vaadin/vaadin-lumo-styles/color.js';
import '@vaadin/vaadin-lumo-styles/sizing.js';
import '@vaadin/vaadin-lumo-styles/style.js';
import '@vaadin/vaadin-lumo-styles/typography.js';
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
registerStyles(
'vaadin-input-con... |
import itertools
import os
import unittest
def data(name, mode='rb', **kwargs):
return open(
os.path.join(
os.path.dirname(__file__),
'data', name,
),
mode,
**kwargs,
)
class DataTestCase(unittest.TestCase):
def assertJson(self, actual, expected, p... |
if (typeof __coverage__ === 'undefined') { __coverage__ = {}; }
if (!__coverage__['build/dd-drop-plugin/dd-drop-plugin.js']) {
__coverage__['build/dd-drop-plugin/dd-drop-plugin.js'] = {"path":"build/dd-drop-plugin/dd-drop-plugin.js","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0},"b":{},"f":{"1":0,"2":0}... |
#!python
# The prebuild script is intended to simplify life for developers and dev-ops. It's repsonsible for acquiring
# tools required by the build as well as dependencies on which we rely.
#
# By using this script, we can reduce the requirements for a developer getting started to:
#
# * A working C++ dev enviro... |
(function(b,k){function f(q){var a=q.length,b=g.type(q);return g.isWindow(q)?!1:1===q.nodeType&&a?!0:"array"===b||"function"!==b&&(0===a||"number"===typeof a&&0<a&&a-1 in q)}function e(q,a,b,c){if(g.acceptData(q)){var d=g.expando,j=q.nodeType,l=j?g.cache:q,e=j?q[d]:q[d]&&d;if(e&&l[e]&&(c||l[e].data)||!(b===k&&"string"=... |
;(function () {
'use strict';
angular.module('app.core', [
'ui.router', 'ngMaterial',
'ngAnimate', 'toastr'
]);
})(); |
var test = require('tap').test;
var path = require('path');
var concat = require('concat-stream');
var spawn = require('child_process').spawn;
var stripFullStack = require('./common').stripFullStack;
test(function (t) {
t.plan(2);
var ps = spawn(process.execPath, [path.join(__dirname, 'double_end', '... |
/** \file shapes.h
* \brief This file defines various shapes used by the database.
*
* \author Eric Chang
* \date 2018/07/19
*/
#ifndef CBAG_SCHEMATIC_POLYGON_H
#define CBAG_SCHEMATIC_POLYGON_H
#include <cbag/common/point_array.h>
#include <cbag/schematic/shape_base.h>
namespace cbag {
namespace sch {
stru... |
# -*- coding: utf-8 -*-
# Scrapy settings for fr project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# https://docs.scrapy.org/en/latest/topics/settings.html
# https://docs.scrapy.org/en/latest/topics/... |
# Allstate Purchase Prediction Challenge
# Author: Alessandro Mariani <alzmcr@yahoo.it>
# https://www.kaggle.com/c/allstate-purchase-prediction-challenge
'''
RandomForestParallel: is just a "fancy" class which will help
optimize memory usage while fitting several random forest
on the same machine. It implement... |
# Copyright 2021 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/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
import datetime, pytz
import flow_api
def handler(system: flow_api.System, this: flow_api.Execution):
inputs = this.get('input_value') or {}
message_id = inputs.get('message_id')
if message_id is None:
defaults = {
'scheduled_at': '08:30',
}
if 'flow_name' in inputs:
... |
from unittest import TestCase
import numpy as np
from cmlkit import Dataset
from cscribe.mbtr import LMBTR
# Not really testing for correctness, but testing for not being broken.
class TestLMBTR2(TestCase):
def setUp(self):
self.data = Dataset(
z=np.array([[1, 2, 2]]),
r=np.arra... |
const Test = require('tape');
const Utils = require('../lib/utils');
Test('utils', function (t) {
t.test('prefix', function (t) {
t.plan(3);
var str = 'foobar';
str = Utils.prefix(str, 'foo');
t.equal(str, 'foobar', 'string had prefix so is the same.');
str = 'bar';
... |
# Copyright 2018 Google 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 required by applicable law or a... |
import time
import pytest
from brownie import network
from classes.event_subscriber import EventSubscriber
from scripts.deploy import deploy_event_emitter
from scripts.useful.tools import LOCAL_BLOCKCHAIN_ENVIRONMENTS, get_account
def only_local(msg: str = ""):
if network.show_active() not in LOCAL_BLOCKCHAIN_... |
#!/usr/bin/env python
#
# Copyright (c) 2020 Intel Corporation.
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
#
"""
Execute scenarios via ros service
Internally, the CARLA scenario runner is executed
"""
import sys
import os
try:
import queue... |
describe("Unified replacer", function(){
var emoji = new EmojiConvertor();
emoji.img_set = 'apple';
emoji.img_sets.apple.path = '/';
emoji.use_css_imgs = false;
emoji.colons_mode = false;
emoji.text_mode = false;
emoji.include_title = false;
emoji.allow_native = false;
emoji.use_sheet = false;
emoji.avoid_... |
import os
import shutil
import unittest
from unittest import TestCase
from pymatgen.io.qchem.inputs import QCInput
from custodian.qchem.handlers import QChemErrorHandler
__author__ = "Samuel Blau, Brandon Woods, Shyam Dwaraknath, Ryan Kingsbury"
__copyright__ = "Copyright 2018, The Materials Project"
__version__ = "... |
var Player = function() {
this.songQueue = [];
this.currentSong = null;
};
Player.prototype.shuffle = function() {
this.songQueue.sort(() => { return Math.random() > 0.5 ? 1 : 0; });
};
Player.prototype.play = function() {
if (this.currentSong === null) {
this.currentSong = this.songQueue.unshift();
t... |
#basic code but needs optimizing as very slow at present
import os
from astropy.io import fits
from astropy.table import Table, vstack, join
from astropy.table import Column, unique
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
import matplotlib.cm as cm
import numpy as np
#some useful funct... |
import numpy as np
import soundfile as sf
from scipy import signal
import random
import os
def load_audio(path):
sound, sample_rate = sf.read(path, dtype='int16')
# TODO this should be 32768.0 to get twos-complement range.
# TODO the difference is negligible but should be fixed for new models.
soun... |
from django.shortcuts import render, redirect
from django.contrib import messages, auth
from django.core.validators import validate_email
from django.contrib.auth.models import User
from django.contrib.auth.decorators import login_required
from .models import FormContato
def login(request):
if request.method != '... |
"""Download and pre-process SQuAD and GloVe.
Author:
Chris Chute (chute@stanford.edu)
"""
"""
setup_and_prep.py
Downloads SQuAD 2.0 dataset and GloVe vecto embeddings and will
preprocess:
SQuAD 2.0 Dataset:
[context, question, answer] per sample
train: 129,941 samples
dev: 6,078 samples
test: 5915 samples, taken ... |
// GENERATED CODE -- DO NOT EDIT!
'use strict';
var grpc = require('@grpc/grpc-js');
var as_external_api_fuotaDeployment_pb = require('../../../as/external/api/fuotaDeployment_pb.js');
var google_api_annotations_pb = require('../../../google/api/annotations_pb.js');
var google_protobuf_timestamp_pb = require('google-p... |
/*
* Poll chat plugin
* By bumbadadabum and Zarel.
* Redone by Volco and WGC for Collapsible Multi-Polls
*/
'use strict';
/** @typedef {{source: string, supportHTML: boolean}} QuestionData */
/** @typedef {{name: string, votes: number}} Option */
class Poll {
constructor(room, questionData, options, name) {
i... |
(() => {
if (!kaboom) {
console.error("kaboom not found");
return;
}
function loadCP437() {
loadFont(
"CP437",
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASAAAACACAYAAACr6LTaAAAKMWlDQ1BJQ0MgcHJvZmlsZQAASImdlndUU9kWh8+9N71QkhCKlNBraFICSA29SJEuKjEJEErAkAAiNkRUcERRkaYIMijggKNDkbEiioUBUbHrBBlE1HFwFBuWSWStGd+8e... |
# orm/path_registry.py
# Copyright (C) 2005-2018 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Path tracking utilities, representing mapper graph traversals.
"""
from .. ... |
from stock_indicators._cslib import CsQuote, CsCandleProperties
from stock_indicators.indicators.common.candles import CandleProperties
from stock_indicators.indicators.common.quote import Quote
class TestTypeCompat:
def test_quote_based_class(self):
# Quote
assert issubclass(Quote, CsQuote)
... |
# (c) FFRI Security, Inc., 2020 / Koh M. Nakagawa: FFRI Security, Inc.
import os
import shutil
def make_backup_file(path: str) -> None:
print(f"make backup file of {path}")
backup_file_name = path + ".back"
if os.path.exists(backup_file_name):
print(f"backup file ({backup_file_name}) already exis... |
from setuptools import setup, find_packages
setup(name="geventirc",
version="0.1dev",
author="Antonin Amand (@gwik)",
author_email="antonin.amand@gmail.com",
description="gevent based irc client",
namespace_packages=['geventirc'],
package_dir = {'':'lib'},
packages=find_packag... |
android.app.IntentService.extend("com.tns.notifications.NotificationIntentService" /* give your class a valid name as it will need to be declared in the AndroidManifest later */ , {
onHandleIntent: function(intent) {
var GoogleApi = com.google.android.gms.location;
//var action = intent.getAction()... |
""" Utils related to protobuf """
import sys
from pathlib import Path
import os
from google.protobuf import json_format
def import_protobuf_from_dir(proto_dir, method_name, service_name = None):
"""
Dynamic import of grpc-protobuf from given directory (proto_dir)
service_name should be provided only in th... |
import argparse
import logging
import yaml
from pathlib import Path
from script_utils.common import common_setup
from release.helpers.misc import subprocess_call
def main():
# Use first line of file docstring as description if it exists.
parser = argparse.ArgumentParser(
description=__doc__.split('\... |
from typing import Union
from .._tier0 import plugin_function
from .._tier0 import Image
from .._tier0 import push
from ._AffineTransform3D import AffineTransform3D
from skimage.transform import AffineTransform
import numpy as np
@plugin_function
def affine_transform(source : Image, destination : Image = None, transf... |
from typing import (List, Optional)
from enum import Enum
from rastervision.pipeline.config import (register_config, Field, Config)
from rastervision.core.rv_pipeline.rv_pipeline_config import (RVPipelineConfig,
PredictOptions)
from rastervision.core.data i... |
# Copyright 2017-2021 TensorHub, 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 law or agreed to in writ... |
import os
import argparse
import logging
import cv2
import numpy as np
from skimage.transform import radon
import ast
import imageio
import transform_color_image
import math
logging.basicConfig(level=logging.INFO, format='%(asctime)-15s %(message)s')
def main(
imageSizeHW,
outputDirectory,
num... |