text stringlengths 2 999k |
|---|
import os
import matplotlib
from pyspark.sql import SparkSession
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import pyspark.sql.functions as F
import numpy as np
import statsmodels.api as sm
import pandas as pd
class TaskWaitTimeCDF(object):
def __init__(self, workload_name, df, image_folder_locati... |
# -*- coding: utf-8 -*-
#
# 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
#... |
import csv
import collections, itertools
import nltk.classify.util, nltk.metrics
from nltk.classify import NaiveBayesClassifier
from nltk.corpus import movie_reviews, stopwords
from nltk.collocations import BigramCollocationFinder
from nltk.metrics import BigramAssocMeasures
from nltk.probability import FreqDist, Condi... |
import torch.nn as nn
import torch
from utils import conv_out_size, Flatten
import constants as c
class DiscriminatorModel(nn.Module):
def __init__(self):
super(DiscriminatorModel, self).__init__()
self.d_model = []
for scale_num in xrange(c.NUM_SCALE_NETS):
scale_factor = ... |
from math import ceil
import matplotlib.pyplot as plt
from skimage import io
from skimage.morphology import disk
from examples.utils import Timer
from softcolor.morphology import MorphologyInCIELab, soften_structuring_element
if __name__ == "__main__":
img = io.imread('images/lena-512.gif')
img = img[100:200... |
#!/usr/bin/env python
list1 = [func() for func in [lambda:i*i for i in range(1,10)]]
list2 = [(lambda:i*i)() for i in range(1,10)]
print 'list1 = ' + str(list1)
print 'list2 = ' + str(list2)
funcs = []
for i in range(1,10):
funcs.append(lambda:i*i)
list3 = [func() for fun in funcs]
print 'list3 = ' + str(list3)
li... |
import streamlit as st
import streamlit.components.v1 as components
import pandas as pd
import networkx as nx
import pickle
from pyvis.network import Network
from pages import make_network
from transformers import DistilBertTokenizerFast
from transformers import TFDistilBertForSequenceClassification
# set header titl... |
# Author: Peter Prettenhofer <peter.prettenhofer@gmail.com>
# Olivier Grisel <olivier.grisel@ensta.org>
# Mathieu Blondel <mathieu@mblondel.org>
# Lars Buitinck
# License: BSD 3 clause
# extensions and modifications (c) Martin Werner
from __future__ import print_function
import logging
import ... |
#!/usr/bin/env python3
#-*- coding: utf-8 -*-
import requests
import redis
import time
import datetime
import logging
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
level=logging.INFO)
logger = logging.getLogger(__name__)
cache = redis.Redis(host='redis... |
from conans import ConanFile, CMake, tools
from conans.errors import ConanException, ConanInvalidConfiguration
from collections import namedtuple, OrderedDict
import os
required_conan_version = ">=1.33.0"
class PocoConan(ConanFile):
name = "poco"
url = "https://github.com/conan-io/conan-center-index"
ho... |
# encoding: utf8
from __future__ import unicode_literals
from django.db import models, migrations
def fill_dogs(apps, schema_editor):
CatsBreed = apps.get_model('main', 'CatsBreed')
Dog = apps.get_model('main', 'Dog')
bulldog, created = Dog.objects.get_or_create(breed=u'Бульдог')
dachshund, created = ... |
import torch
import mmdet2trt.core.post_processing.batched_nms as batched_nms
import mmdet2trt.ops.util_ops as mm2trt_util
from mmdet2trt.core.bbox import batched_distance2bbox
from mmdet2trt.models.builder import register_wraper
from mmdet2trt.models.dense_heads.anchor_free_head import AnchorFreeHeadWraper
@registe... |
#!/usr/bin/env python
# Copyright (c) 2015-2017 The Bitcoin Money developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Perform basic ELF security checks on a series of executables.
Exit status will be 0 if successful, and... |
# uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Server\sims\sim_info_utils.py
# Compiled at: 2017-04-18 21:11:56
# Size of source mod 2**32: 1876 bytes
imp... |
from rpython.jit.backend.llsupport.test.ztranslation_test import TranslationTestJITStats
from rpython.translator.translator import TranslationContext
from rpython.config.translationoption import DEFL_GC
from rpython.jit.backend.x86.arch import WORD
import sys
class TestTranslationJITStatsX86(TranslationTestJITStats):... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-04-19 16:03
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('climatemodels', '0014_auto_20160418_1100'),
]
opera... |
# -*- coding: UTF-8 -*-
# NVDAObjects/behaviors.py
# A part of NonVisual Desktop Access (NVDA)
# This file is covered by the GNU General Public License.
# See the file COPYING for more details.
# Copyright (C) 2006-2019 NV Access Limited, Peter Vágner, Joseph Lee, Bill Dengler
"""Mix-in classes which provide common be... |
# Copyright 2020 Ericsson TEI, Fabio Ubaldi
#
# 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... |
'''
Created on 2020-07-04
@author: wf
'''
import csv
import html
import io
import json
import re
import time
from lodstorage.entity import EntityManager
from lodstorage.storageconfig import StoreMode, StorageConfig
import pyparsing as pp
class EventManager(EntityManager):
''' handle a catalog of events '''
d... |
"""
Dimension Data Cloud Module
===========================
This is a cloud module for the Dimension Data Cloud,
using the existing Libcloud driver for Dimension Data.
.. code-block:: yaml
# Note: This example is for /etc/salt/cloud.providers
# or any file in the
# /etc/salt/cloud.providers.d/ directory.... |
# 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 use ... |
def merger_first_into_second(arr1, arr2):
p1 = len(arr1) - 1
runner = len(arr2) - 1
# Assuming arr2 is the padded
p2 = len(arr2) - len(arr1) - 1
while p1 >= 0 or p2 >= 0 and p1 != runner and p2 != runner:
if p1 >= 0 and p2 >= 0:
if arr1[p1] > arr2[p2]:
arr2[runne... |
# Copyright (c) 2015-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD+Patents license found in the
# LICENSE file in the root directory of this source tree.
#@nolint
# not linting this file because it imports * form swigfaiss, which
# causes a ton of useless warnings.
imp... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2021 Robert Cowham, Perforce Software Ltd
# ========================================
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# 1. Redistribution... |
# -*- coding: utf-8 -*-
'''The file contains functions for working with the database'''
import base64
import time
from os.path import isfile
import sqlalchemy as sa
from aiohttp_session.cookie_storage import EncryptedCookieStorage
from envparse import env
# Reading settings file
if isfile('.env'):
e... |
import copy
from collections import OrderedDict, namedtuple
from typing import Dict, List
from influxdb.resultset import ResultSet
from influxpy.client import client_wrapper
from influxpy.compiler import InfluxCompiler
from influxpy.aggregates import BaseAggregate
from influxpy.fields import BaseDuration
from influxp... |
"""
Entradas
P -> int -> p
Q -> int -> q
"""
p , q = map ( int , input ( "Digite 2 valores:" ). split ())
si (p ** 3 + q ** 4 - 2 * p ** 2) > 680 :
print ( "Los valores" + str ( p ), "y" , str ( q ), "satisfacen la expresion" )
otra cosa :
print ( "Los valores" + str ( p ), "y" , str ( q ), "no satisfacen la... |
N=int(input())
V=list(map(int,input().split()))
print(V.count(max(V)))
|
#二分法による非線型方程式の解法プログラム
import numpy as np #数値計算用モジュール
import matplotlib.pyplot as plt #データ可視化用モジュール
#解きたい方程式
def func_f(x):
return x**2.0 -2.0
#二分法(方程式の関数項、探索区間の左端、探索区間の右端、誤差範囲、最大反復回数)
def bisection(func_f, x_min, x_max, error=1e-10, max_loop=100):
#初期値を表示
num_calc = 0 #計算回数
print("{:3d}: {:.15f}... |
"""
Test lldb data formatter subsystem.
"""
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class StdListDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
def setUp(self):
# Call super's setUp().... |
"""
WSGI config for kimchi project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTIN... |
from PIL import Image
def get_image_dimension(path) -> (int, int):
image = Image.open(path)
return image.size
def get_ratio_max_size(iwidth, iheight, swidth, sheight) -> (int, int):
KOEF = 1
new_iw = iwidth
new_ih = iheight
swidth_new = swidth * KOEF
sheight_new = sheight * KOEF
he... |
import os
import numpy as np
import torch
from typing import Optional, Type
from ..config.base_config import BaseConfig
from ..dataset.base_dataset import KoiDataset
from ..model.base_model import GenerativeModel
import random
from torch.utils.tensorboard import SummaryWriter
class Trainer:
"""
Abstract bas... |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2019, 2020, 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modification... |
# Copyright (C) tkornuta, IBM Corporation 2019
#
# 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 agr... |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from typing import Tuple
import libcst as cst
from libcst import parse_module
from libcst._batched_visitor import BatchableCSTVisitor
from l... |
# Copyright (c) 2016, 2018, 2020 Claudiu Popa <pcmanticore@gmail.com>
# Copyright (c) 2016-2017 Łukasz Rogalski <rogalski.91@gmail.com>
# Copyright (c) 2017 Derek Gustafson <degustaf@gmail.com>
# Copyright (c) 2018 Ioana Tagirta <ioana.tagirta@gmail.com>
# Copyright (c) 2019 Hugo van Kemenade <hugovk@users.noreply.gith... |
from src.inc.lang_detection_utils import *
from nltk import pos_tag, ne_chunk
from nltk.tokenize import word_tokenize
from nltk.corpus import stopwords
from nltk.stem import WordNetLemmatizer
from nltk.tree import Tree
from nltk import FreqDist
import itertools
class TopicSelector:
def __init__(self, text: str, m... |
###############################################################################
# Author: Jayden Lee
# Date: 27/06/19
# Purpose: Simple Data Dictionary.
###############################################################################
myDog = {"Name": "Oliver", "Age": 7, "Colour": "Mixed", "Disposition": "Cute"}
print... |
# -*- coding: utf-8 -*-
"""
Instructor Demo: Dicts.
This script showcases basic operations of Python Dicts.
"""
# Initialize a dictionary containing top traders for each month in 2019
top_traders_2019 = {
"january" : "Karen",
"february" : "Harold",
"march" : "Sam"
}
print()
print(f"Dictionary: {top_trad... |
##
# 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 no... |
# -*- coding: utf-8 -*-
import sys
import os
import random
import numpy
import scipy
import ivenv
from geo import *
## how to use Suehiro's geo package
## tools/geo/geo.py
# constructors
# VECTOR()
# VECTOR(vec=[1,2,3])
# I = MATRIX()
# MATRIX(mat=[[1,2,3],[4,5,6],[7,8,9]])
# FRAME(mat=m,vec=v)
# def Rx(th):
# ... |
# Copyright 2022 The Kubernetes 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 ... |
#! /usr/bin/python
# -*- coding: utf-8 -*-
# ported to python 3.x by Dragneel1234
from __future__ import print_function
try:
from urllib2 import urlopen, Request, unquote, HTTPError
from urllib import urlencode
except ImportError:
from urllib.request import urlopen, Request
from urllib.parse import urlencode, unq... |
# Library to extract EXIF information in digital camera image files
#
# To use this library call with:
# f=open(path_name, 'rb')
# tags=EXIF.process_file(f)
# tags will now be a dictionary mapping names of EXIF tags to their
# values in the file named by path_name. You can process the tags
# as you wish. In par... |
import pandas as pd
from gensim import models
from janome.tokenizer import Tokenizer
from janome.analyzer import Analyzer
from janome.charfilter import *
from janome.tokenfilter import *
import neologdn
import re
def split_into_words(text, tokenizer):
# tokens = tokenizer.tokenize(text)
normalized_text = neolo... |
import sys
from cx_Freeze import setup, Executable
import os
import shutil
from distutils.dir_util import copy_tree
def abs_path_maker(path):
return os.path.join(os.getcwd(), path)
if os.path.exists(abs_path_maker("build")):
print("deleting old builds...", end="")
shutil.rmtree(abs_path_maker("build"))
... |
from flask import Flask, jsonify, abort
import json
from random import randint
from operator import itemgetter
from flask.ext.sqlalchemy import SQLAlchemy
from sqlalchemy.sql import func
app = Flask(__name__, instance_relative_config=True)
app.config.from_pyfile('config.py', silent=True)
db = SQLAlchemy(app)
from mo... |
from django.contrib.auth.decorators import login_required
login_decorator = login_required(login_url='/', redirect_field_name=None) |
import os
import pystac
from pystac.layout import BestPracticesLayoutStrategy
from pystac.utils import (is_absolute_href, make_relative_href)
from shapely.geometry import shape, mapping
from stactools.core.copy import (move_asset_file_to_item, move_assets as
do_move_assets)
def merg... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import sys
import warnings
def total_seconds(td): # pragma: no cover
return td.total_seconds()
def is_timestamp(value):
if type(value) == bool:
return False
try:
float(value)
return True
except Exception:
... |
'''
Autor: Raphael Nascimento
ID: Nask
Objetivo: Pegar o Texto formatado de um .txt e reescreve-lo no formato docx
'''
import docx
class Docx(object):
def __init__(self, caminho, diretorio, content):
self.caminho = caminho
self.diretorio = diretorio
self.content = content
self.lis... |
#!/usr/bin/env python
import os
import json
import torch
import numpy as np
import queue
import pprint
import random
import argparse
import importlib
import threading
import traceback
from tqdm import tqdm
from utils import stdout_to_tqdm
from config import system_configs
from nnet.py_factory import NetworkFactory
fr... |
#!/usr/bin/env python
# MIT License
# (c) baltasar 2017
from google.appengine.ext import ndb
class Story(ndb.Model):
added = ndb.DateProperty(auto_now_add=True)
user = ndb.StringProperty(required=True, indexed=True)
title = ndb.StringProperty(required=True, indexed=True)
subtitle = ndb.StringPropert... |
# Copyright (c) 2005-2007 The Regents of The University of Michigan
# Copyright (c) 2011 Regents of the University of California
# 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 o... |
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import operator
import os
import platform
import sys
from setuptools.exte... |
name = "BackpackTF"
|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jun 22 10:27:03 2018
@author: demiliu
"""
from peakaboo.data_smoothing import earth_smooth_matrix
import numpy as np
import matplotlib.pyplot as plt
def twodcontourplot(tadata_nm, tadata_timedelay, tadata_z_corr):
"""
make contour plot
Ar... |
"""
Django settings for config project.
Generated by 'django-admin startproject' using Django 3.1.4.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
from pathlib ... |
from changes.config import db
from changes.models import SnapshotImage, SnapshotStatus
from changes.testutils import APITestCase
class SnapshotImageDetailsTest(APITestCase):
def test_simple(self):
project = self.create_project()
snapshot = self.create_snapshot(project)
plan = self.create_p... |
###########################################################################
#
# Copyright 2020 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/l... |
'''
@copyright: 2022 - Symas Corporation
'''
# config attribute names
ATTRIBUTES = 'attributes'
USER_OU = 'users'
ROLE_OU = 'roles'
PERM_OU = 'perms'
SUFFIX = 'suffix'
DIT = 'dit'
UID = 'uid'
PROP_OC_NAME = 'ftProperties'
OU = 'ou'
INTERNAL_ID = 'ftid'
CN = 'cn'
SN = 'sn'
DN = 'dn'
CONSTRAINT = 'ftCstr'
DESC =... |
#!/usr/bin/env python
import numpy as np
from scipy.spatial import Delaunay
from . import pg_utilities
from . import imports_and_exports
"""
.. module:: generate_shapes
:synopsis: Contains code to generate placental shapes for generic placental models.
:synopsis:Contains code to generate placental shapes for gener... |
import os
import psycopg2
from sys import exit
import cv2
import numpy as np
db_string = 'postgres://postgres:postgres2020!Incyt@172.17.250.12:5432/hashFiles'
#db_string = 'postgres://postgres:Guatemala1@localhost:5432/hashfiles'
sourceImages = '/home/incyt/servicio/uploads'
destinationVideo = '/home/incyt/servicio/up... |
# coding=utf-8
# Copyright 2022 The Google Research 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... |
# Generated by gen_timm_models.py
import torch
import timm.models.vision_transformer
from ...util.model import BenchmarkModel
from torchbenchmark.tasks import COMPUTER_VISION
from .config import TimmConfig
class Model(BenchmarkModel):
task = COMPUTER_VISION.GENERATION
def __init__(self, device=None, jit=Fals... |
"""
WSGI config for chat_server project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_S... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# $Id$
#
# Project: GDAL/OGR Test Suite
# Purpose: gdalinfo testing
# Author: Even Rouault <even dot rouault @ mines-paris dot org>
#
########################################################... |
from .main import get_dictionary
from .main import add_pinyin
from .main import get_pinyin
from .main import do_not_parse_set
|
# ipop-project
# Copyright 2016, University of Florida
#
# 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, m... |
# Advent of Code 2020, Day 7
with open("../input07", "r") as infile:
lines = infile.readlines()
# Parses a number (quantity of bags) and bag name
def parse_num_bag(s):
(n,bs) = s.split(" ",1)
bag = bs.split(" bag")[0]
return (int(n), bag)
# Parse a bag content specification
def bag_parse(line):
(bag,spe... |
import io
from types import NoneType
import utils
from pprint import pprint
def typeMapFromFlatDict():
union: dict[str, set] = {}
for doc in utils.docs(progress_bar=True):
for key, val in doc.items():
union.setdefault(key, set())
union[key].add(type(val))
return union
de... |
import math
from PyQt5.QtCore import QPointF
from PyQt5.QtGui import QPainterPath
EDGE_CP_ROUNDNESS = 100 #: Bezier controll point distance on the line
class GraphicsEdgePathBase:
"""Base Class for calculating the graphics path to draw for an graphics Edge"""
def __init__(self, owner: 'QDMGraphicsEdge'... |
# -*- coding: utf-8 -*-
# import numpy as np
import copy
from ast import literal_eval
from PyQt5.QtWidgets import (QMainWindow, QComboBox, QWidget, QGridLayout,
QDesktopWidget, QLabel, QVBoxLayout, QLineEdit,
QPushButton, QHBoxLayout, QTextEdit, QFileDialog)
... |
# ========================================================================
# Copyright 2020 Emory University
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/lice... |
import torch
import torch.fx.experimental.fx_acc.acc_ops as acc_ops
from torch.testing._internal.common_fx2trt import AccTestCase
from torch.fx.experimental.fx2trt.passes.fuse_pass import (
fuse_permute_linear,
trt_transposed_linear,
)
from torch.testing._internal.common_utils import run_tests
class TestFuseP... |
# Copyright 2018 The trfl 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 applicable law... |
#!/usr/bin/env python3
# Copyright (c) 2020 Sparkbase AG
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php.
"""
Test checking:
1) Masternodes setup/creation.
2) Proposal creation.
3) Vote creation.
4) Proposal and vote broadcast.... |
from dataclasses import dataclass
from fibo.types.blockchain_format.coin import Coin
from fibo.types.blockchain_format.sized_bytes import bytes32
from fibo.util.ints import uint32
from fibo.wallet.util.wallet_types import WalletType
@dataclass(frozen=True)
class WalletCoinRecord:
"""
These are values that co... |
#!/usr/bin/env python
import sklearn as sk
import numpy as np
np.random.seed(1337)
import et_cleartk_io as ctk_io
import nn_models
import sys
import os.path
import dataset_hybrid
import keras as k
from keras.utils.np_utils import to_categorical
from keras.optimizers import RMSprop
from keras.preprocessing.sequence imp... |
import tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['BoxCox'] , ['MovingAverage'] , ['Seasonal_Hour'] , ['SVR'] ); |
# Vanishing Journey Damage Skin
success = sm.addDamageSkin(2435972)
if success:
sm.chat("The Vanishing Journey Damage Skin has been added to your account's damage skin collection.")
# sm.consumeItem(2435972)
|
from .serving import run_simple as run_simple
from .test import Client as Client
from .wrappers import Request as Request
from .wrappers import Response as Response
__version__ = "2.0.3"
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Narrative) on 2019-05-07.
# 2019, SMART Health IT.
from . import element
class Narrative(element.Element):
""" Human-readable summary of the resource (essential clinical and... |
# python3 Steven Otsu binary segmentation
import cv2
from ImageBase import loadImg, plotImg, grayImg, binaryImage
# from mainImageHist import plotImagAndHist, plotImgHist
import matplotlib.pyplot as plt
import numpy as np
def calculateOtsu(img):
hist = cv2.calcHist([img], [0], None, [256], [0, 256])
hist_norm... |
"""This module contains the general information for AdaptorEthRdmaProfile ManagedObject."""
from ...imcmo import ManagedObject
from ...imccoremeta import MoPropertyMeta, MoMeta
from ...imcmeta import VersionMeta
class AdaptorEthRdmaProfileConsts:
pass
class AdaptorEthRdmaProfile(ManagedObject):
"""This is ... |
from plotly.basedatatypes import BaseTraceType
import copy
class Sankey(BaseTraceType):
# arrangement
# -----------
@property
def arrangement(self):
"""
If value is `snap` (the default), the node arrangement is
assisted by automatic snapping of elements to preserve space
... |
import unittest
from retropq.zero_prefix_bst import ZeroPrefixBST
class ZeroPrefixBSTTest(unittest.TestCase):
def test(self):
bst = ZeroPrefixBST()
bst[6] = -1
bst[3] = 0
bst[0] = 1
self.assertEqual(0, bst.zero_prefix_before(5))
self.assertEqual(6, bst.zero_prefix_af... |
#!/usr/bin/env python3
# Copyright (c) 2014-2017 The OFIChain Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the invalidateblock RPC."""
from test_framework.test_framework import OFIChainTestFramework
from... |
#!c:\users\batle\pycharmprojects\rentomatic\venv\scripts\python.exe
# $Id: rst2odt.py 5839 2009-01-07 19:09:28Z dkuhlman $
# Author: Dave Kuhlman <dkuhlman@rexx.com>
# Copyright: This module has been placed in the public domain.
"""
A front end to the Docutils Publisher, producing OpenOffice documents.
"""
import sy... |
from __future__ import absolute_import
from .element import set_modsym_print_mode
from .modsym import ModularSymbols, ModularSymbols_clear_cache
from .heilbronn import HeilbronnCremona, HeilbronnMerel
from .p1list import P1List, lift_to_sl2z
from .p1list_nf import P1NFList, MSymbol
from .ghlist import GHlist
fro... |
from unittest import TestCase
from unittest.mock import (
Mock,
patch,
)
from pypika import Field
from fireant.database import Database
from fireant.middleware.decorators import connection_middleware
@connection_middleware
def test_fetch(database, query, **kwargs):
return kwargs.get('connection')
def ... |
from entities.ships.allies.ally import Ally
from utils.ids.player_id import PlayerID
from utils.ids.projectile_id import ProjectileID
"""A friendly Aegis ship.
"""
class Aegis(Ally):
"""Constructs the Aegis.
"""
def __init__(self, hp, shield, x, y, speed, fire_rate, *args, **kwargs):
super().__i... |
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test running zenxd with the -rpcbind and -rpcallowip options."""
import socket
import sys
from test_f... |
import numpy as np
from sklearn import manifold, decomposition
from matplotlib import pyplot as plt
from sklearn.externals._arff import xrange
class vis:
colors = ['black', 'blue', 'green', 'yellow', 'red']
def __init__(self, X, y):
self.X = X.values[0:1000,0:28]
self.y = y.values[0:1000]
... |
# Copyright 2013 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... |
# encoding: utf-8
#
# Software License Agreement (BSD License)
#
# Copyright (c) 2012, Fraunhofer FKIE/US, Alexander Tiderko
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribution... |
# Copyright (c) 2020 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 appli... |
import rdkit
import rdkit.Chem as Chem
import copy
from fast_jtnn.chemutils import get_clique_mol, tree_decomp, get_mol, get_smiles, set_atommap, enum_assemble, decode_stereo
def get_slots(smiles):
mol = Chem.MolFromSmiles(smiles)
return [(atom.GetSymbol(), atom.GetFormalCharge(), atom.GetTotalNumHs()) for ato... |
'''Test the us of TorchScript to export and import of models with graph structure'''
from collections import namedtuple
import gym
from gym.spaces import Discrete, Box
import numpy as np
import torch
import torch.nn as nn
from torch.optim import Adam
from typing import Union, Tuple, Optional
Sample = namedtuple("Step"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.