text stringlengths 2 999k |
|---|
# Tencent is pleased to support the open source community by making ncnn available.
#
# Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the... |
# AUTOGENERATED! DO NOT EDIT! File to edit: Discrminators.ipynb (unless otherwise specified).
__all__ = ['ProjectionDiscriminator', 'UnconditionalDiscriminator']
# Cell
#hide
from fastai import *
from fastai.vision import *
from fastai.callbacks import *
from fastai.utils.mem import *
from fastai.vision.gan import *
... |
from typing import Optional
from pyexlatex.models.item import (
StringAdditionMixin,
IsSpecificClassMixin,
IsLatexItemMixin,
_basic_item_str,
_multi_option_item_str,
ItemBase
)
class LineSpacing(ItemBase):
def __init__(self, line_spacing: float):
self.logical_line_spacing = line_sp... |
#!/usr/bin/env python
"""
Tool to pre-process documents contained one or more directories, and export a document-term matrix for each directory.
"""
import os, os.path, sys, codecs
import logging as log
from optparse import OptionParser
import text.util
# --------------------------------------------------------------
... |
from collections import OrderedDict
from app.dataformats import peptable as peptabledata
from app.actions.mergetable import (simple_val_fetch, fill_mergefeature,
get_isobaric_quant)
from app.actions.proteindata import create_featuredata_map
def build_peptidetable(pqdb, headerfiel... |
from __future__ import print_function
import pathlib
from builtins import object
from builtins import str
from typing import Dict
from empire.server.common import helpers
from empire.server.common.module_models import PydanticModule
from empire.server.utils import data_util
from empire.server.utils.module_util import... |
import math
import IMLearn.learners.regressors.linear_regression
from IMLearn.learners.regressors import PolynomialFitting
from IMLearn.utils import split_train_test
import numpy as np
import pandas as pd
import plotly.graph_objects as go
import plotly.express as px
import plotly.io as pio
pio.templates.default = "si... |
#!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible 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, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... |
from setuptools import setup
import versioneer
requirements = [
# package requirements go here
]
setup(
name='sqlerandxmler',
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
description="Execute queries and parse XMLs",
license="MIT",
author="Alex Nally",... |
import os
import json
import requests
import time
import logging
api_domain = os.getenv('GOODDATA_DOMAIN')
api_url = api_domain + "/gdc/projects/" + os.getenv('GOODDATA_PROJECT')
def auth_cookie():
sst = super_secured_token()
temp_token = temporary_token(sst)
return temp_token
def get_username():
if... |
# Copyright 2016, 2017 IBM Corp.
#
# 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 writin... |
import locale
# django imports
from django.conf import settings
from django.core.cache import cache
from django.db import connection
from django.core.exceptions import FieldError
from django.db.models import Q, Count, Min, Max
# import lfs
import lfs.catalog.models
from lfs.catalog.settings import CONFIGURABLE_PRODUC... |
import os
import cv2
import copy
import time
import torch
import numpy as np
from PIL import Image
from os.path import join as pjoin
from copy import deepcopy
from sklearn.decomposition import PCA
from sklearn.linear_model import LinearRegression, LogisticRegression, Lasso
from sklearn.svm import SVC
from sklearn.mode... |
# -*- coding: utf-8 -*-
#
# Copyright 2014 Bernard Yue
#
# 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... |
"""Computations for plot_diff([df...])."""
from typing import Optional, Union, List, Dict, Any
import dask.dataframe as dd
import pandas as pd
from ....errors import DataprepError
from ...intermediate import Intermediate
from ...utils import to_dask
from ...dtypes import DTypeDef
from ...configs import Config
from .mu... |
import datetime
import os
import sys
import time
import pendulum
from dagster import check
from dagster.core.errors import DagsterUserCodeUnreachableError
from dagster.core.host_representation import PipelineSelector, RepositoryLocation
from dagster.core.instance import DagsterInstance
from dagster.core.scheduler.inst... |
from django.contrib.auth.mixins import PermissionRequiredMixin
from django.db.models import Count
from django.shortcuts import get_object_or_404, render
from django.views.generic import View
from circuits.models import Circuit
from dcim.models import Site, Rack, Device, RackReservation
from ipam.models import IPAddres... |
import aiohttp
from shazamio.exceptions import BadMethod
from shazamio.utils import validate_json
class HTTPClient:
@staticmethod
async def request(method: str, url: str, *args, **kwargs) -> dict:
async with aiohttp.ClientSession() as session:
if method.upper() == 'GET':
... |
import subprocess
data = ""
with open('scripts/sonarqubeToken', 'r') as tokenFile:
data=tokenFile.read().replace('\n', '')
subprocess.Popen(["./gradlew", "sonarqube", "-Dsonar.host.url=http://localhost:9000", "-Dsonar.login=" + data], close_fds=True) |
from os import environ
DEFENDER_REDIS_URL = environ.get('REDIS_URL', 'redis://redis:6379') + '/1'
DEFENDER_USE_CELERY = False
|
#
# Coldcard Electrum plugin main code.
#
#
import os, time, io
import traceback
from typing import TYPE_CHECKING, Optional
import struct
from electrum_mona import bip32
from electrum_mona.bip32 import BIP32Node, InvalidMasterKeyVersionBytes
from electrum_mona.i18n import _
from electrum_mona.plugin import Device, hoo... |
# problem - https://practice.geeksforgeeks.org/problems/longest-common-substring1452/1
class Solution:
def longestCommonSubstr(self, S1, S2, n, m):
res = 0
rows,col = n+1,m+1
dp = [[0]*col for i in range(rows)]
for i in range(1,rows):
for j in range(1,col):
... |
# 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... |
import argparse
import keras
import tensorflow as tf
from keras.callbacks import ModelCheckpoint, EarlyStopping, ReduceLROnPlateau
from keras.utils import multi_gpu_model
import migrate
from config import patience, batch_size, epochs, num_train_samples, num_valid_samples
from data_generator import train_gen, valid_ge... |
# -*- coding: utf-8 -*-
# Copyright © 2016-2019, Chris Warrick.
# 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... |
m=600
a=2
resultan_gaya=m*a
print(resultan_gaya)
|
# ref. https://docs.python.org/3/library/random.html
from random import choice
if __name__ == "__main__":
num_seqs = range(20)
print('num_seqs', list(num_seqs))
print('choice(num_seqs)', choice(num_seqs))
print('choice(num_seqs)', choice(num_seqs))
|
from typing import List
def insertionSort(array: List[int], start: int, end: int) -> None:
"""Main insertion sort algorithm\n
Sorts array in-place; returns None
"""
for i in range(start + 1, end): # Iterate through entire array
comparator = array[i] # Make comparison with this value
... |
#!/usr/bin/env python3
# Copyright (c) 2017-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test getblockstats rpc call
#
from test_framework.test_framework import FrancTestFramework
from test_... |
#coding:utf-8
#
# id: bugs.core_4331
# title: LAG, LEAD and NTH_VALUE raise error when the second argument is NULL
# decription:
# tracker_id: CORE-4331
# min_versions: ['3.0']
# versions: 3.0
# qmid: None
import pytest
from firebird.qa import db_factory, isql_act, Action
# version: ... |
# Module providing evasion attacks.
from reports.report_utility import ReportUtility
from reports.report_html import HtmlReport
from reports.report_ipynb import IpynbReport
|
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtCore import QAbstractTableModel, Qt
import pandas as pd
from pandas import DataFrame as DF
class table_view_model(QAbstractTableModel):
def __init__(self, data):
QAbstractTableModel.__init__(self)
self._data = data
def rowCount(self, pare... |
# Copyright 2018 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, ... |
from .commandroute import CommandRoute
from .documentroute import DocumentRoute
from .imageroute import ImageRoute
from .messageroute import MessageRoute
|
# -*- coding: utf-8 -*-
from six.moves import configparser as ConfigParser
from six.moves import http_cookiejar as cookielib
import logging
import mimetypes
from pprint import pformat
import random
import json
from six.moves.urllib.parse import parse_qs, urlparse
import requests
from requests_oauthlib import OAuth1
... |
#!/usr/bin/python3
import tensorflow as tf
from tensorflow.python.platform import gfile
from google.protobuf import text_format
import sys
def convert_pbtxt_to_pb(filename):
with tf.gfile.FastGFile(filename, 'r') as f:
graph_def = tf.GraphDef()
file_content = f.read() ... |
# -*- coding: utf-8 -*-
import os
import sys
sys.path.insert(0, os.path.abspath(".."))
# -- General configuration ------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
exten... |
import datetime as dt
from library.ftx.base import BaseApiClass
class LeveragedTokens(AsyncBaseApiClass):
"""docstring for LeveragedTokens."""
def __init__(self, api_key: str, secret_key: str, subaccount_name: str = ''):
super().__init__(api_key, secret_key, subaccount_name)
def list_leveraged_... |
from package import redact_ex
from package import solve_implicit_ode
import numpy as np
EXERCISE_05 = """\
Make a program that is able to graphically solve the previous equation
using the fully implicit FTCS scheme.\
"""
redact_ex(EXERCISE_05, 5)
slices = 20
itern = 1000
plot_frequency = 0.05
deltat = 1e-3
delt... |
import numpy as np
def to_binary(n, dim):
"""
Obtains the binary representation of an integer.
args:
n: The integer to be converted to binary. The integer shouldn't
be so large that more than dim(the next arg) bits are required
to encode it.
dim:... |
# generated from catkin/cmake/template/pkg.context.pc.in
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "/home/parallels/catkin_ws/devel/.private/ar_track_alvar_msgs/include".split(';') if "/home/parallels/catkin_ws/devel/.private/ar_track_alvar_msgs/include" != "" else []
PROJECT_CATKIN_DEPENDS = "messag... |
# -*- coding: utf-8 -*-
from pandas import DataFrame
from .roc import roc
from pandas_ta.utils import get_drift, get_offset, verify_series
def kst(close, roc1=None, roc2=None, roc3=None, roc4=None, sma1=None, sma2=None, sma3=None, sma4=None, signal=None, drift=None, offset=None, **kwargs):
"""Indicator: 'Know Sur... |
import math as m
import numpy as np
from src.continuous.uniform import UniformDist
from src.prob_distribution import ProbDist
from src.spaces.spaces1d_leafs import ContinuousSpace
class LogisticDist(ProbDist):
"""Simple Logistic distribution."""
def __init__(self, loc = 0, scale = 1):
"""Creates Log... |
"""
Anno values.
General conventions:
- The original marker value from the textual representation is converted to an internal format convenient for algorithms.
The reverse conversion is done by tostring() method. It will return an equivalent representation, which is may differ from
the original one.
- For all mar... |
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
import sys
from collections import OrderedDict
# Reference:
# https://docs.pytest.org/en/latest/writing_plugins.html#hookwrapper-executing-around-other-hooks
# https://docs.pytest.org/en/latest/writing_plugins.html#hook-function-ordering-call-exa... |
# Copyright 2018-2021 Xanadu Quantum Technologies 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... |
import pytest
from pytest import raises
from vyper import compiler
from vyper.exceptions import FunctionDeclarationException
fail_list = [
"""
@public
def foo() -> int128:
pass
""",
]
@pytest.mark.parametrize('bad_code', fail_list)
def test_missing_return(bad_code):
with raises(FunctionDeclarationE... |
from slate import __version__
def test_version():
assert __version__ == '0.1.0'
|
"""
416. Partition Equal Subset Sum
"""
class Solution:
def canPartition(self, nums):
"""
:type nums: List[int]
:rtype: bool
"""
def dfs(beg,target):
if target == 0:
return True
for i in range(beg, len(nums)):
... |
#
# Copyright 2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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; either version 3, or (at your option)
# any later version.
#
#... |
'''
@author: Dallas Fraser
@date: 2016-04-12
@organization: MLSB API
@summary: Holds a class LeagueList that helps imports a League (list of games)
'''
# imports
from sqlalchemy import func
from api.model import Sponsor, Game, League, Division
from api import DB
from api.errors import InvalidField, LeagueDoesNotExist, ... |
# Authors: Robert Luke <mail@robertluke.net>
# Eric Larson <larson.eric.d@gmail.com>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
#
# License: BSD-3-Clause
import re
import numpy as np
from ...io.pick import _picks_to_idx
from ...utils import fill_doc
# Standardized fNIRS channel name regexs... |
# Copyright (c) 2019 Putt Sakdhnagool <putt.sakdhnagool@nectec.or.th>,
#
from __future__ import print_function
import re
first_cap_re = re.compile('(.)([A-Z][a-z]+)')
all_cap_re = re.compile('([a-z0-9])([A-Z])')
def to_snake_case(val):
s1 = first_cap_re.sub(r'\1_\2', val)
return all_cap_re.sub(r'\1_\2', s1).... |
"""
implementation of imagenet dataset
"""
# pylint: disable=unused-argument,missing-docstring
import json
import logging
import os
import time
import cv2
import numpy as np
from pycocotools.cocoeval import COCOeval
import pycoco
import dataset
logging.basicConfig(level=logging.INFO)
log = logging.getLogger("coco")... |
from django.test.testcases import TestCase
class ProcessBlockchainTest(TestCase):
pass
|
from flask_mail import Message
from flask import render_template
from . import mail
def mail_message(subject,template,to,**kwargs):
sender_email = 'shaggyneils@gmail.com'
email = Message(subject, sender=sender_email, recipients=[to])
email.body= render_template(template + ".txt",**kwargs)
email.html =... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
# Set up custom environment before nearly anything else is imported
# NOTE: this should be the first import (no not reorder)
from maskrcnn_benchmark.utils.env import setup_environment # noqa F401 isort:skip
import argparse
import os
os.env... |
# Copyright 2016 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
from django.shortcuts import render
from . import apps
# Create your views here.
def get_home(request):
data = {}
data['news'] = {}
data['weather'] = {}
data['news']['sport1'] = apps.sport1reader()
data['news']['kicker'] = apps.kickerreader()
data['weather']['today'] = apps.weather()
retur... |
import json
import cv2
colors = [[255, 0, 0], [255, 85, 0], [255, 170, 0], [255, 255, 0], [170, 255, 0], [85, 255, 0],
[0, 255, 0], \
[0, 255, 85], [0, 255, 170], [0, 255, 255], [0, 170, 255], [0, 85, 255], [0, 0, 255],
[85, 0, 255], \
[170, 0, 255], [255, 0, 255], [255, ... |
# Copyright The PyTorch Lightning team.
#
# 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 i... |
import _plotly_utils.basevalidators
class OutsidetextfontValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="outsidetextfont", parent_name="icicle", **kwargs):
super(OutsidetextfontValidator, self).__init__(
plotly_name=plotly_name,
parent_nam... |
"""Test cases for the console module."""
import logging
from website_checker import cli
def test_latency_subcommand_prints_usage(mock_click):
"""It prints the usage message with subcommand options."""
result = mock_click.invoke(cli.main, ["latency", "--help"])
assert "Usage: check latency [OPTIONS]" in r... |
#!/usr/bin/env python3
"""
.. code-block:: none
Demeuk - a simple tool to clean up corpora
Usage:
demeuk [options]
Examples:
demeuk -i inputfile.tmp -o outputfile.dict -l logfile.txt
demeuk -i inputfile0*.txt -o outputfile.dict -l logfile.txt
demeuk -i inputdir/* -o output... |
import os
import time
class Var(object):
# Get a bot token from botfather
BOT_TOKEN = os.environ.get("BOT_TOKEN", "")
# Get from my.telegram.org
API_ID = int(os.environ.get("API_ID", 12345))
# Get from my.telegram.org
API_HASH = os.environ.get("API_HASH", "")
# ID of users that can't u... |
# Copyright (c) 2021 PaddlePaddle 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 applic... |
# Build the documentation for nanodbc library
# Configuration
nanodbc_name = 'nanodbc'
nanodbc_versions = ['master', '2.13.0']
# End of Configuration
import errno
import os
import sys
from subprocess import check_call, CalledProcessError, Popen, PIPE
def build_docs(**kwargs):
assert nanodbc_versions
version ... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... |
"""Tools for working with epoched data"""
# Authors: Alexandre Gramfort <gramfort@nmr.mgh.harvard.edu>
# Matti Hamalainen <msh@nmr.mgh.harvard.edu>
# Daniel Strohmeier <daniel.strohmeier@tu-ilmenau.de>
# Denis Engemann <d.engemann@fz-juelich.de>
# Mainak Jas <mainak@neuro.hut.fi>
#
... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('user', '0001_initial'),
('goods', '0001_initial'),
migrations.swappable_dependency(settings.... |
# -*- coding: utf-8 -*-
"""Integration tests for the GUIs."""
#------------------------------------------------------------------------------
# Imports
#------------------------------------------------------------------------------
from itertools import cycle, islice
import logging
import os
from pathlib import Path... |
from __future__ import annotations
from typing import TYPE_CHECKING
from datetime import datetime
from .hypyobject import HypyObject
from .uuid import UUID
from .hypixelplayer import HypixelPlayer
if TYPE_CHECKING:
from .player import Player
from .hypixelfriends import HypixelFriends
class HypixelFriend(Hypy... |
import sys
from CLI.app import run
def main():
run()
if __name__ == "__main__":
sys.exit(main() or 0)
|
from locust import HttpLocust, TaskSet, between
from bs4 import BeautifulSoup
from faker import Faker
import random, time
USER_CREDENTIALS = [
("thomaswolf", "thomaswolf"),
("susanwilliams", "susanwilliams"),
("student_01", "student_01"),
("shaunberkley", "shaunberkley"),
("robertandrews", "roberta... |
#!/usr/bin/env python
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# ---------------------------------------------... |
from . import BaseModel
from busy_beaver.extensions import db
class GitHubSummaryUser(BaseModel):
"""GitHub Summary User table
TODO: GitHubSummaryUser should really be related to
GitHubSummaryConfiguration versus SlackInstallation
"""
__tablename__ = "github_summary_user"
def __repr__(self)... |
from Crypto.PublicKey import RSA
from Crypto.Cipher import AES
from Crypto.Cipher import PKCS1_OAEP
import os
import json
import base65536
# Have put in dodgy functions so that the base library can be changed.
def ByteToString(x):
return base65536.encode(x)
def StrToByte(x):
return base65536.decode(x)
# Encr... |
# Generated by Django 2.2.4 on 2019-11-23 05:13
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('api', '0002_posts'),
]
operations = [
migrations.RenameModel(
old_name='Posts',
new_name='Post',
),
]
|
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import _init_paths
import os
import torch
import torch.utils.data
from opts import opts
from models.model import create_model, load_model, save_model
from models.data_parallel import DataParallel
from logger ... |
# -*- coding: utf-8 -*-
'''
rauth.test_service_ofly
-----------------------
Test suite for rauth.service.OflyService.
'''
from base import RauthTestCase
from test_service import (FakeHexdigest, HttpMixin, MutableDatetime,
RequestMixin, ServiceMixin)
from rauth.compat import pars... |
# 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... |
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)
s = read().rstrip().decode()
for check in range(len(s) - 2, -1, -2):
if s[check // 2:check] == s[:check // 2]:
print(check)
exit()
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 5/15/20 4:49 PM
# @File : grover.py
# qubit number=3
# total number=74
import cirq
import cirq.google as cg
from typing import Optional
import sys
from math import log2
import numpy as np
#thatsNoCode
from cirq.contrib.svg import SVGCircuit
# Symbols for... |
from ase.io import read, write
from ase import Atoms
from maze import Zeotype, OpenDefect, ImperfectZeotype
import os
from ase.visualize import view
from pathlib import Path
from collections import defaultdict
from typing import List
import numpy as np
# %%
def defect_maker(cif_dir, zeolite_code, output_dir, savefile... |
__version__ = '0.0.3'
from . import jws, command
load_jws = jws.load_jws
Jws = jws.Jws
|
#!/usr/bin/env python
import atexit
import ConfigParser
import datetime
import os
import sys
import time
from daemon import runner
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from modules.Models import Base, Metrics, Server, Service
from modules.ServiceStatus import ServiceStatus
cl... |
dataset_type = 'ShipRSImageNet_Level3'
# data_root = 'data/Ship_ImageNet/'
data_root = './data/ShipRSImageNet/'
CLASSES = ('Other Ship', 'Other Warship', 'Submarine', 'Other Aircraft Carrier', 'Enterprise', 'Nimitz', 'Midway','Ticonderoga',
'Other Destroyer', 'Atago DD', 'Arleigh Burke DD', 'Hatsuyuki DD', 'Hy... |
from .assert_equal import assert_equal, EqualAssertionError
from collections.abc import Iterable
def is_iterable(v):
return isinstance(v, Iterable)
def iterables_equal(iterable1, iterable2):
return iterable1 == iterable2 or (
is_iterable(iterable1)
and is_iterable(iterable2)
and all(... |
from typing import Union
import numpy as np
import talib
from jesse.helpers import get_candle_source
def ht_trendmode(candles: np.ndarray, source_type: str = "close", sequential: bool = False) -> Union[float, np.ndarray]:
"""
HT_TRENDMODE - Hilbert Transform - Trend vs Cycle Mode
:param candles: np.nda... |
import decimal
import subprocess
import time
import os
import re
import datetime
import json
from core_symbol import CORE_SYMBOL
from testUtils import Utils
from testUtils import Account
# pylint: disable=too-many-public-methods
class Node(object):
# pylint: disable=too-many-instance-attributes
# pylint: dis... |
"""Make any window dockable within Maya.
:created: 8 Jun 2018
:author: Benoit Gielly <benoit.gielly@gmail.com>
"""
from PySide2.QtCore import QObject
from maya import cmds, mel
from . import utils
def dock_widget(widget, label="DockWindow", area="right", floating=False):
"""Dock the given widget properly for b... |
# load and plot dataset
import numpy
#import matplotlib.pyplot as plt
import matplotlib.axes as axes
import pandas
import math
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import LSTM
from sklearn.preprocessing import MinMaxScaler
from sklearn.metrics import mean_squared_error
im... |
from careers.career_event_zone_director import CareerEventZoneDirector
import sims4.log
logger = sims4.log.Logger('Crime Scene', default_owner='bhill')
class CrimeSceneZoneDirector(CareerEventZoneDirector):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self._should_load_si... |
from conans import ConanFile, AutoToolsBuildEnvironment, CMake, tools
from conans.errors import ConanException
from contextlib import contextmanager
import os
import re
import shlex
import shutil
required_conan_version = ">=1.33.0"
class LibUSBCompatConan(ConanFile):
name = "libusb-compat"
description = "A c... |
# *****************************************************************************
# Copyright (c) 2018, NVIDIA CORPORATION. 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... |
# coding: utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
import hashlib
import sys
from .._ffi import new, unwrap
from ._core_foundation import CoreFoundation, CFHelpers
from ._security import Security, SecurityConst, handle_sec_error
if sys.version_info < (3,):
range = ... |
# Used in Party Quest - Escape
if sm.hasMobsInField():
sm.warp(921160400, 0) # A secret Door to the Aerial Prison
else:
sm.chat("Please eliminate all mobs.")
sm.dispose()
|
"""The purpose of this script is to compare the performance and
accuracy of possible object detection models for real time inference
in a normal computer cpu. We are going to compare several models
selected from the object detection collection of TF hub
(https://tfhub.dev/tensorflow/collections/object_detection/1)
""... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
# Export this package's modules as members:
from ._enums import *
from .database import *
from .database_vulnerability_assessment import *
from .databa... |
import numpy as np
import tensorflow as tf
from baselines.a2c.utils import conv, fc, conv_to_fc, batch_to_seq, seq_to_batch, lstm, lnlstm, sample, check_shape
from baselines.common.distributions import make_pdtype
import baselines.common.tf_util as U
import gym
class LnLstmPolicy(object):
def __init__(self, sess, ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.