text stringlengths 3 1.05M |
|---|
/*
* Copyright 2009-2017 Alibaba Cloud 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... |
import moment from 'moment';
export default class BookingFeeCalculator {
static calculate(arrivalRaw, departureRaw, dailyFee) {
if (!arrivalRaw || !departureRaw || !dailyFee) {
return null;
}
const arrival = moment(arrivalRaw);
const departure = moment(departureRaw);
if (arrival.isAfter(d... |
# -*- coding: utf-8 -*-
import uuid
class Experiment(object):
HEADER_ROW = 1
EXP_ID_COL = 1
def __init__(self, ws, experiment_id=None):
self._ws = ws
self._prepare_experiment_header()
self.experiment_id = experiment_id or self._uuid()
self.row = self._find_or_create_row(s... |
const DomainViews = require('domain_abstract/view/DomainViews');
const TraitView = require('./TraitView');
const TraitSelectView = require('./TraitSelectView');
const TraitCheckboxView = require('./TraitCheckboxView');
const TraitNumberView = require('./TraitNumberView');
const TraitColorView = require('./TraitColorVie... |
import IPython
import sys
from squad_client import logging
from squad_client.core.command import SquadClientCommand
logger = logging.getLogger(__name__)
class ShellCommand(SquadClientCommand):
command = 'shell'
help_text = 'run squad-client on shell'
def register(self, subparser):
parser = sup... |
#! /usr/bin/env python
#
#
# This is a simple script based on GDAL to dump overview to separate file.
# It is used in WKTRaster testing to compare raster samples.
#
# NOTE: GDAL does include Frank's (unofficial) dumpoverviews utility too,
# which dumps overview as complete geospatial raster dataset.
#
# Copyrigh... |
# 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... |
class BaseError(Exception):
pass
class UnknownError(BaseError):
pass
class InvalidModuleError(BaseError):
pass
class NoPermissionError(BaseError):
pass
class MandatoryKeyNotFoundError(BaseError):
pass
class InvalidDataError(BaseError):
pass
class InvalidDataRIndexError(BaseError):
... |
'use strict';
function getRandomIntInclusive(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
} |
/*
* Copyright 2019, Emanuel Rabina (http://www.ultraq.net.nz/)
*
* 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 unittest
import numpy
from worldengine.plates import Step, center_land, world_gen
from worldengine.model.world import World, Size, GenerationParameters
from tests.draw_test import TestBase
from worldengine.generation import sea_depth
from worldengine.common import anti_alias
class TestGeneration(TestBase):
... |
import gql from 'graphql-tag'
export const deleteSupplier = gql`
mutation deleteSupplier($id: ID!){
deleteSupplier(input: {
where: {
id: $id
}
}){
supplier {
id
}
}
}
` |
import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)
/* Layout */
import Layout from '@/layout'
/**
* Note: sub-menu only appear when route children.length >= 1
* Detail see: https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html
*
* hidden: true ... |
module.exports={input:"./messenger.component.dialog.js",output:"./messenger.component.dialog.bundle.js",namespaceFunction:null};
//# sourceMappingURL=bundle.config.map.js |
# -*- coding: utf-8 -*-
"""
File Name: model
Description : 模型层
Author : mick.yi
date: 2019/4/1
"""
import keras
from keras import layers, Input, Model
import tensorflow as tf
from east.layers.base_net import resnet50
from east.layers.losses import balanced_cross_entropy, iou_lo... |
import { setPriority } from '@shoutem/core/middlewareUtils';
import {
createScreenViewMiddleware,
createEventsMiddleware,
ANALYTICS_OUT_MIDDLEWARE_PRIORITY,
} from 'shoutem.analytics';
import FlurryAnalytics from 'react-native-flurry-analytics';
import { isFlurryActive } from './services/flurry';
function tra... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from gaebusiness.gaeutil import SaveCommand, ModelSearchCommand
from gaeforms.ndb.form import ModelForm
from gaegraph.business_base import UpdateNode, NodeSearch, DeleteNode
from product_app.product_model import Product
class ProductSav... |
// Copyright (c) 2018 David Hulse
// All rights reserved.
//
// You can use this software under the terms of 'INDIGO Astronomy
// open-source license' (see LICENSE.md).
//
// THIS SOFTWARE IS PROVIDED BY THE AUTHORS 'AS IS' AND ANY EXPRESS
// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTI... |
# -*- coding: utf-8 -*-
import collections
import itertools
import json
import os
import posixpath
import re
import time
import urlparse
import uuid
from datetime import datetime
from operator import attrgetter
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django.db impor... |
addEventListener('animationend', (e) => {
if(e.animationName === 'out-loader') e.target.remove();
});
|
# Generated by Django 2.1.15 on 2020-04-23 12:37
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0006_auto_20200421_0435'),
]
operations = [
migrations.CreateModel(
name='BillDetail',... |
# Copyright (c) 2016-present, Facebook, Inc.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import functools
import logging
import os
import re
import shutil
import subprocess
import sys
import time
import traceback
from col... |
import networkx as nx
from collections import OrderedDict
from sortedcontainers import SortedSet
import numpy as np
# methods to ensure proper graph structure for both Yamada and Substitute
# classes
def is_weighted(graph):
"""
Determine if graph has a 'weight' attribute.
Args:
graph (nx.Graph... |
# Copyright 2022 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... |
# -*- coding: utf-8 -*-
#
# michael a.g. aïvázis
# orthologue
# (c) 1998-2022 all rights reserved
#
import operator
# declaration
class Boolean:
"""
This is a mix-in class that traps the boolean operators
The point is to redirect boolean operations among instances of subclasses of {Boolean} to
meth... |
import {
css,
html,
javascript,
nodejs,
postgres,
react,
redux,
express,
materialUi,
git,
mocha,
sequelize,
webpack,
chai,
jwt,
heroku,
} from '../../../static/logos';
export const skillsData = [
{
phrase: 'I am proficient in',
items: [
nodejs,
react,
materia... |
# (Odd or Even) Use if statements to determine whether an integer is odd or even. [Hint: Use the remainder operator. An even number is a multiple of 2. Any multiple of 2 leaves a remainder of 0 when divided by 2.]
integer = int(input('Enter an integer number: '))
if (integer % 2) == 0:
print(integer, 'is an even ... |
def solveQuestion(currentA, currentB, multA, multB, divide):
total = 0
count = 0
last16Bits = 2**16
while count < 5000000:
count += 1
currentA = (currentA * multA) % divide
while currentA % 4 != 0:
currentA = (currentA * multA) % divide
currentB = (currentB *... |
# Copyright 2019, OpenCensus 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 w... |
from setuptools import setup
setup(name='pynxhuy',
version='0.3',
description='The nxhuyiest joke in the world',
url='https://github.com/nxhuy-github/pynxhuy',
author='Xuan Huy NGUYEN',
author_email='nxhuy@example.com',
packages=['pynxhuy'],
zip_safe=False)
|
from django.urls import path
from drfvg import register_models
## models to register
from .models.project import Project
## projects/
urlpatterns = [ ] + register_models( [ Project ], app_name='projects')
|
/**
* This header is generated by class-dump-z 0.2a.
* class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3.
*
* Source: (null)
*/
#import <XXUnknownSuperclass.h> // Unknown library
@interface StreetViewItemBase : XXUnknownSuperclass {
int _type;
id _streetViewItem;
}
@property(retain, nonatom... |
from nose.tools import eq_
from ..revision import Revision
from ..unavailable import Unavailable
def test_construction_and_values():
id = 129
parent_id = 105
bytes = 2324
sha1 = "1234567890123457890123457890ab"
page_id = 12
minor = False
revision = Revision(id, parent_id, bytes, sha1... |
class Connect4():
def __init__(self):
self.grid=[[" "]*7 for i in range(6)]
self.check=[0]*7
self.player=False
self.finish=False
def play(self, col):
if self.finish:
return "Game has finished!"
self.check[col]+=1
if self.check[col]>=7:
... |
# coding=utf-8
# Copyright 2020 The Mesh TensorFlow 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 applicab... |
// Hungarian
export default {
'fabric.reactions.loading': 'Betöltés...',
'fabric.reactions.more.emoji': 'Még több emoji',
'fabric.reactions.error.unexpected': 'Valami hiba történt',
};
//# sourceMappingURL=hu.js.map |
from typing import Tuple, List, Dict, Optional, Union, Any, Callable
import os
import cv2
import random
import collections
import numpy as np
import pandas as pd
from pathlib import Path
from torch.utils.data import Dataset, DataLoader
IMAGE_SIZE = 224
SEED = 69
TEST_SIZE = 0.1
INPUT_FILENAME_KEY = "filename"
INPU... |
import * as swcHelpers from "@swc/helpers";
// public is allowed on a constructor but is not meaningful
var C = function C() {
"use strict";
swcHelpers.classCallCheck(this, C);
};
var c = new C();
var r = c.constructor;
var C2 = function C2(x) {
"use strict";
swcHelpers.classCallCheck(this, C2);
};
var ... |
# AUTOGENERATED! DO NOT EDIT! File to edit: ../00_card.ipynb.
# %% ../00_card.ipynb 3
from __future__ import print_function, division
import random
class Card:
"""Represents a standard playing card.
Attributes:
suit: integer 0-3
rank: integer 1-13
"""
suit_names = ["Clubs", "Diamon... |
from setuptools import setup, find_packages
import os
name = "presence_analyzer"
version = "0.2.2"
def read(*rnames):
return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
setup(
name=name,
version=version,
description="Presence analyzer",
long_description=read('README.md'),
... |
#!/usr/bin/env python
import subprocess
import sys,os
passed = 0
# Unbuffered stdout.
sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)
# Yes, these should be in a for loop.
# Run test 1
sys.stdout.write("Running test 1... ");
subprocess.call("./hello_world < 1.in > 1.out",shell=True)
rt = subprocess.call("diff -... |
// Copyright 2019 Shift Cryptosecurity AG
//
// 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 ... |
class QuizBrain:
def __init__(self, question_list):
self.question_number = 0
self.question_list = question_list
self.score = 0
def still_has_questions(self):
return self.question_number < len(self.question_list)
def next_question(self):
show_question = self.quest... |
# from mathutils.geometry import interpolate_bezier
# from compas.geometry import add_vectors
from ._geometry import BlenderGeometry
class BlenderCurve(BlenderGeometry):
"""Wrapper for Blender curves.
Examples
--------
.. code-block:: python
pass
"""
@property
def geometry(self... |
# Copyright 2019 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
! function(e) {
"object" == typeof exports ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : "undefined" != typeof window ? window.PouchDB = e() : "undefined" != typeof global ? global.PouchDB = e() : "undefined" != typeof self && (self.PouchDB = e())
}(function() {
var define, module, ... |
var bidfactory = require('src/bidfactory.js');
var bidmanager = require('src/bidmanager.js');
var adloader = require('src/adloader.js');
var utils = require('src/utils.js');
var adaptermanager = require('src/adaptermanager');
var PulsePointAdapter = function PulsePointAdapter() {
var getJsStaticUrl = window.location... |
from __future__ import (absolute_import, print_function, division)
import numpy as np
import astropy.units as u
from .helpers import _test_valid_x_range
from .baseclasses import BaseExtAveModel
from .shapes import (P92, _curve_F99_method)
__all__ = ['G03_SMCBar', 'G03_LMCAvg', 'G03_LMC2',
'GCC09_MWAvg']
... |
from torch import nn
import torch.nn.functional as F
class NNHeuristic(nn.Module):
"""
Define a neural network for use in DQN with a heuristic input.
"""
def __init__(self, input_dims: int=6):
super(NNHeuristic, self).__init__()
self.conv1 = nn.Sequential(nn.Linear(input_dims, 64))
... |
__author__ = 'jcorbett'
from nose.tools import *
def test_this_not():
assert_true(False)
|
var classarm__compute_1_1test_1_1_le_net5_fixture =
[
[ "run", "classarm__compute_1_1test_1_1_le_net5_fixture.xhtml#a13a43e6d814de94978c515cb084873b1", null ],
[ "setup", "classarm__compute_1_1test_1_1_le_net5_fixture.xhtml#ae0889d5950a7bc129f6ecdbbdc6bcdde", null ],
[ "teardown", "classarm__compute_1_1test... |
/***********************************************************************
Copyright (c) 2006-2011, Skype Limited. 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 retai... |
import PromiseQueue from './PromiseQueue.js'
// this will become generic and not webapi specific
// we just need to abstract what IS webapi specific first
export default class FileCache_t
{
constructor()
{
// we keep some meta on the side. eg. known size if we're streaming a file
// Do we leave this, even if we... |
require('./server');
const Dynfor = require('../dist/dynfor');
test('Connection must fail on wrong port or ip', async () => {
try {
Dynfor({
host: 'localhost',
port: 3,
username: 'foo',
password: 'bar',
sshForwardPort: 1080,
keepaliveI... |
import React from "react";
import { BrowserRouter as Router, Route, Switch } from "react-router-dom";
import { ApolloProvider } from '@apollo/react-hooks';
import ApolloClient from 'apollo-boost';
import Home from "./pages/Home";
import Detail from "./pages/Detail";
import NoMatch from "./pages/NoMatch";
import Login ... |
# -*- coding: utf-8 -*-
import sys
import warnings
from collections import defaultdict, OrderedDict
from django.db.models.query import RawQuerySet
from django.core.exceptions import FieldError
from itertools import groupby, chain, islice
from operator import itemgetter
from .utils import _getattr
from .validation impor... |
from clib.links.model.gan.wgan import WGANGenerator, WGANCritic
|
/* -*- Mode: js2; indent-tabs-mode: nil; tab-width: 4; js2-indent-offset: 4; js2-basic-offset: 4; -*-
* vim: set ts=4 sw=4 et tw=99 ft=js:
*/
import * as os from '@node-compat/os';
import * as path from '@node-compat/path';
import * as fs from '@node-compat/fs';
import * as child_proce... |
/*
*
* Copyright (C) 2015-2019, Open Connections GmbH
* All rights reserved. See COPYRIGHT file for details.
*
* This software and supporting documentation are maintained by
*
* OFFIS e.V.
* R&D Division Health
* Escherweg 2
* D-26121 Oldenburg, Germany
*
*
* Module: dcmiod
*
* Author: ... |
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('@carbon/icon-helpers'), require('prop-types'), require('react')) :
typeof define === 'function' && define.amd ? define(['@carbon/icon-helpers', 'prop-types', 'react'], factory) :
(global.... |
import json
import requests
from cache import vocabulary_cache
HOST = "https://mastertables.athento.com/"
class MasterTablesClient:
host = HOST
api_key = "default"
def __init__(self, api_key, host=HOST):
self.host = host
self.api_key = api_key
@vocabulary_cache
... |
"""
Module: 'flowlib.modules._m5bala' on M5 FlowUI v1.4.0-beta
"""
# MCU: (sysname='esp32', nodename='esp32', release='1.11.0', version='v1.11-284-g5d8e1c867 on 2019-08-30', machine='ESP32 module with ESP32')
# Stubber: 1.3.1 - updated
from typing import Any
def const():
pass
machine = None
os = None
time = Non... |
// luhn extra validators
window.ParsleyConfig = window.ParsleyConfig || {};
window.ParsleyConfig.validators = window.ParsleyConfig.validators || {};
window.ParsleyConfig.validators.luhn = {
fn: function (value) {
value = value.replace(/[ -]/g, '');
var digit, n, sum, _j, _len1, _ref2;
sum = 0;
... |
# ----------------------------------------------------------------------------------
# Electrum plugin for the Digital Bitbox hardware wallet by Shift Devices AG
# digitalbitbox.com
#
import base64
import hashlib
import hmac
import json
import math
import os
import re
import requests
import struct
import time
from bi... |
/*
** LuaJIT common internal definitions.
** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h
*/
#ifndef _LJ_DEF_H
#define _LJ_DEF_H
#include "lua.h"
#if defined(_MSC_VER) && (_MSC_VER < 1700)
/* Old MSVC is stuck in the last century and doesn't have C99's stdint.h. */
typedef __int8 int8_t;
typed... |
# Generated by Django 2.2.4 on 2019-10-02 11:51
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('conferences', '0014_artifactdescriptor_mandatory'),
('submissions', '0006_auto_20190905_1746'),
]
operations = [
migrations.RenameModel(
... |
from __future__ import absolute_import
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('viz_tools', parent_package, top... |
# coding=utf-8
# Author: Rion B Correia
# Date: Sept 02, 2019
#
# Description: Builds a MultiLayer network (HS, MM & DM) based on genes found by DGE with StringDB edges.
#
#
import numpy as np
import pandas as pd
pd.set_option('display.max_rows', 100)
pd.set_option('display.max_columns', 500)
pd.set_option('display.wid... |
# encoding: utf-8
"""
@author: BrikerMan
@contact: eliyar917@gmail.com
@blog: https://eliyar.biz
@version: 1.0
@license: Apache Licence
@file: __init__.py
@time: 2019-01-22
"""
# from tests.kashgari.tasks import *
# from tests.kashgari.embeddings import *
|
// tag-#anon#ST[ARR100{F64}$F64$'a'|S32'a_size'|U32'$pad0'|ARR100{F64}$F64$'b'|S32'b_size'|U32'$pad1'|F64'sample_time'|ARR100{F64}$F64$'a_uncertainty'|ARR100{F64}$F64$'b_uncertainty']
// file /home/lucascordeiro/dsverifier/bmc/core/definitions.h line 144
struct anonymous$0;
// tag-#anon#ST[ARR20{ARR20{F64}$F64$}$ARR20... |
/*
* Copyright (c) 2011-2014 Wind River Systems, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/
/*
* @file
* pi computation portion of FPU sharing test
*
* This module is used for the FPU sharing test, and supplements the basic
* load/store test by incorporating two additional threads that utilize the
* flo... |
/**
* @license Copyright 2017 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 logging, json, scipy
import azure.functions as func
import numpy as np
import pandas as pd
# from tensorflow.keras.applications.vgg16 import VGG16
# from tensorflow.keras.models import Model
from azure.storage.blob import BlobServiceClient, BlobClient, BlobLeaseClient
from io import BytesIO
from PIL import Imag... |
"use strict";
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _extends2 = _interopRequireDef... |
angular.module("numen.cmis",[]).factory("CmisManagerFactory",["$q",function(l){return function(n,e){var c=cmis.createSession(n);e.username&&e.password&&c.setCredentials(e.username,e.password);e.token&&c.setToken(e.token);for(var g=e.errorCallback||function(){},f=l.defer(),m={connect:function(){c.loadRepositories().ok(f... |
/*
AngularJS v1.8.0
(c) 2010-2020 Google, Inc. http://angularjs.org
License: MIT
*/
(function(Y,z){'use strict';function Fa(a,b,c){if(!a)throw Pa("areq",b||"?",c||"required");return a}function Ga(a,b){if(!a&&!b)return"";if(!a)return b;if(!b)return a;Z(a)&&(a=a.join(" "));Z(b)&&(b=b.join(" "));return a+" "+b}function... |
from .elements import AbstractElement, PREFERRED_NAMES
from ..parser import Parser, ParserError
from ..utils import fix_return_string
class String(AbstractElement):
PREFERRED_NAMES = ['s', 'x', 'y', 'z'] + PREFERRED_NAMES
def __init__(self):
self._alpha = set()
self._min_len = float('inf')
... |
import functools
import os
from abc import ABC, abstractmethod
from typing import Optional, Any
import pydantic
import requests
class AccountInfo(pydantic.BaseModel):
employer_id: Optional[int] = None
employer_name: Optional[str] = None
unit_id: Optional[int] = None
unit_name: Optional[str] = None
... |
import usocket
class Response:
def __init__(self, f):
self.raw = f
self.encoding = "utf-8"
self._cached = None
def close(self):
if self.raw:
self.raw.close()
self.raw = None
self._cached = None
@property
def content(self):
if se... |
# Copyright 2018 Francesco Ceccon
#
# 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 React from "react";
import { Col, Container, Row } from "react-bootstrap";
import "./style.css";
function Header() {
return (
<Container className = "text-center justify-content-center fixed-top bg-transparent mt-2 mb-4">
<Row className="text-center justify-content-center">
... |
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from __future__ import print_function
import json
import os
import pprint
import sys
import warnings
try:
from jsonschema import ValidationError
from jsonschema import Draft4Validator as Validator
except Impor... |
import random
import time
import math
#CONSTANTS
GRAVITY = 9.81
def main():
import time
import math
def Trajectory(angle, start_velocity, air_time):
v0_x = math.cos(angle)
v0_y = math.sin(angle)
sy = (v0_y * air_time) + (0.5 * GRAVITY * air_time**2)
sx = v0_x * air_time
if __name__ == '__ma... |
from pathlib import Path
from unittest.mock import patch
from nix_alien import fhs_env
@patch("nix_alien.fhs_env.find_libs")
def test_create_fhs_env(mock_find_libs):
mock_find_libs.return_value = {
"libfoo.so": "foo.out",
"libfoo.6.so": "foo.out",
"libbar.so": "bar.out",
"libquux.... |
import requests
try:
import re, secrets, uuid
unblacklist = True
except ImportError:
print("[!] You need to install the following modules: re, secrets, uuid if you want to unblacklist")
unblacklist = False
#import scruber
#region unblacklist
def replace_referents(data):
cache = {}
... |
"""
CHANGE LOF: Ver: 1.1
>> 15th July 2021
>> Minor update: Shifting of few functions
>> Added a Class
- BooleanVar
>> Added 3 functions
- def change_on_hovering(event: Any) -> None:
- def return_on_hovering(event: Any) -> None:
- def aot(root, label) -> None:
COMPATIBLE WITH main VER: 4.2.1
"""
import... |
__copyright__ = "Copyright (c) 2020 Jina AI Limited. All rights reserved."
__license__ = "Apache-2.0"
import time
from typing import Iterator, Callable, Union, Sequence, Optional
from . import request
from .grpc import GrpcClient
from .helper import ProgressBar, pprint_routes
from ...enums import ClientMode
from ...e... |
from datetime import datetime
import hashlib
from werkzeug.security import generate_password_hash, check_password_hash
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
from markdown import markdown
import bleach
from flask import current_app, request, url_for
from flask_login import UserMix... |
# coding: utf-8
#################################################################################
# The Institute for the Design of Advanced Energy Systems Integrated Platform
# Framework (IDAES IP) was produced under the DOE Institute for the
# Design of Advanced Energy Systems (IDAES), and is copyright (c) 2018-2021
... |
"""Helper functions for Z-Wave JS integration."""
from __future__ import annotations
from typing import Any, cast
import voluptuous as vol
from zwave_js_server.client import Client as ZwaveClient
from zwave_js_server.model.node import Node as ZwaveNode
from zwave_js_server.model.value import Value as ZwaveValue, get_... |
/*
* This combined file was created by the DataTables downloader builder:
* https://datatables.net/download
*
* To rebuild or modify this file with the latest versions of the included
* software please visit:
* https://datatables.net/download/#bs/jq-3.3.1/dt-1.10.18/fh-3.1.4/r-2.2.2/sc-1.5.0
*
* Included li... |
import base64
import json
import nacl.signing
import os
import time
from binascii import unhexlify
from collections import OrderedDict
from config import DATA_FOLDER
from copy import deepcopy
from dht.utils import digest
from keys.keychain import KeyChain
from market.contracts import Contract
from protos.objects import... |
#!/usr/bin/env python
#
# Copyright 2013 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.
"""Installs an APK.
"""
import optparse
import os
import subprocess
import sys
from util import build_utils
from util import md5_c... |
import sys
# Import cpuinfo.py from up one directory
sys.path.append('../cpuinfo')
# NOTE: Pyinstaller may spawn infinite processes if __main__ is not used
if __name__ == '__main__':
from multiprocessing import freeze_support
from cpuinfo import get_cpu_info
# NOTE: Pyinstaller also requires freeze_support
free... |
/*
YUI 3.6.0 (build 5521)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add("lang/datatype-date-format_en-NZ",function(a){a.Intl.add("datatype-date-format","en-NZ",{"a":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"A":["Sunday","Monday","Tuesday","W... |
/*
* Copyright (C) 2018 bzt (bztsrc@github)
*
* 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, mer... |
"""payu.experiment
===============
Basic file system operations for Payu
:copyright: Copyright 2011 Marshall Ward, see AUTHORS for details.
:license: Apache License, Version 2.0, see LICENSE for details.
"""
# Standard library
import errno
import os
# Extensions
import yaml
DEFAULT_CONFIG_FNAME = 'conf... |
#Written by Gary Zeri
#Member of the LaRue CatLab at Chapman University
#Graphable Data Abstract class to provide a common interface for all graphable data objects in the Comp Chem Library
from abc import ABC, abstractmethod
from compChemGlobal import plot
class GraphableData(ABC):
#Declare all global varia... |
import pytest
from rdkit import Chem
from aizynthfinder.chem import (
MoleculeException,
Molecule,
TreeMolecule,
Reaction,
RetroReaction,
FixedRetroReaction,
hash_reactions,
)
from aizynthfinder.analysis import ReactionTree
def test_no_input():
with pytest.raises(MoleculeException):
... |
"""
learning_rate_schedulers.py
---------------------------
This module provide classes and functions for managing learning rate schedules.
By: Sebastian D. Goodfellow, Ph.D., 2018
"""
# Compatibility imports
from __future__ import absolute_import, division, print_function
# 3rd party imports
import numpy as np
cla... |